#! /bin/sh # # This is patch #1 to gawk 3.1. cd to gawk-3.1.0 and sh this file. # Then remove all the .orig files and rename the directory gawk-3.1.1 # Changes to files that are automatically recreated have been omitted. # They will be recreated the first time you run make. # This includes all the extracted example files in awklib. # You will need Texinfo 4.2 or later to remake the doc/*.info files. # First, slight rearranging: echo Removing old / obselete files rm -f \ Makefile.in \ aclocal.m4 \ awklib/Makefile.in \ configure \ doc/Makefile.in \ doc/uf002331.eps \ doc/uf002331.jpg \ intl/* \ missing_d/strftime.3 \ missing_d/strftime.c \ po/Makefile.in.in \ po/cat-id-tbl.c \ po/stamp-cat-id \ test/Makefile.in # Now, apply the patch: echo Applying patch patch -p1 << \EOF diff -crN gawk-3.1.0/ABOUT-NLS gawk-3.1.1/ABOUT-NLS *** gawk-3.1.0/ABOUT-NLS Wed Feb 16 09:57:30 2000 --- gawk-3.1.1/ABOUT-NLS Sun Apr 28 17:01:51 2002 *************** *** 8,14 **** 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. --- 8,14 ---- 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. *************** *** 22,29 **** `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 --- 22,29 ---- `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. ! Quick configuration advice ! ========================== If you want to exploit the full power of internationalization, you should configure it using *************** *** 34,46 **** 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'. --- 34,47 ---- package, despite the existence of internationalizing capabilities in the operating system where this package is being installed. So far, only the `gettext' implementation in the GNU C library version 2 provides as ! many features (such as locale alias, message inheritance, automatic ! charset conversion or plural form handling) as the implementation here. ! It is also not possible to offer this additional functionality on top ! of a `catgets' implementation. Future versions of GNU `gettext' will ! very likely convey even more functionality. So it might be a good idea ! to change to GNU `gettext' as soon as possible. ! So you need _not_ provide this option if you are using GNU libc 2 or you have installed a recent copy of the GNU gettext package with the included `libintl'. *************** *** 53,75 **** 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 --- 54,73 ---- ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of ! messages. It will automatically detect whether the system already ! provides the GNU `gettext' functions. If not, the GNU `gettext' own library will be used. This library is wholly contained within this package, usually in the `intl/' subdirectory, so prior installation of ! the GNU `gettext' package is _not_ required. Installers may use special options at configuration time for changing the default behaviour. The commands: ./configure --with-included-gettext ./configure --disable-nls ! will respectively bypass any pre-existing `gettext' to use the ! internationalizing routines provided within this package, or else, ! _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will *************** *** 83,100 **** 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 --- 81,90 ---- to prevent auto-detection. ! The configuration process will not test for the `catgets' function ! and therefore it will not be used. The reason is that even an ! emulation of `gettext' on top of `catgets' could not provide all the ! extensions of the GNU `gettext' library. Internationalized packages have usually many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless *************** *** 110,131 **** 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 ================= --- 100,141 ---- As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate ! `LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, ! and `CC' is an ISO 3166 two-letter country code. For example, let's ! suppose that you speak German and live in Germany. At the shell ! prompt, merely execute `setenv LANG de_DE' (in `csh'), ! `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). ! This can be done from your `.login' or `.profile' file, once and for ! all. ! ! You might think that the country code specification is redundant. ! But in fact, some languages have dialects in different countries. For ! example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The ! country code serves to distinguish the dialects. ! ! The locale naming convention of `LL_CC', with `LL' denoting the ! language and `CC' denoting the country, is the one use on systems based ! on GNU libc. On other systems, some variations of this scheme are ! used, such as `LL' or `LL_CC.ENCODING'. You can get the list of ! locales supported by your system for your country by running the command ! `locale -a | grep '^LL''. ! ! Not all programs have translations for all languages. By default, an ! English message is shown in place of a nonexistent translation. If you ! understand other languages, you can set up a priority list of languages. ! This is done through a different environment variable, called ! `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' ! for the purpose of message handling, but you still need to have `LANG' ! set to the primary language; this is required by other parts of the ! system libraries. For example, some Swedish users who would rather ! read translations in German than English for when Swedish is not ! available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. ! ! In the `LANGUAGE' environment variable, but not in the `LANG' ! environment variable, `LL_CC' combinations can be abbreviated as `LL' ! to denote the language's main dialect. For example, `de' is equivalent ! to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' ! (Portuguese as spoken in Portugal) in this context. Translating Teams ================= *************** *** 133,165 **** 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 --- 143,163 ---- For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. ! Each translation team has its own mailing list. The up-to-date list of ! teams can be found at the Free Translation Project's homepage, ! `http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" ! area. ! If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. ! The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate ! _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `translation@iro.umontreal.ca' to reach the *************** *** 173,214 **** ================== 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 --- 171,372 ---- ================== Languages are not equally supported in all packages. The following ! matrix shows the current state of internationalization, as of April ! 2002. The matrix shows, in regard of each package, for which languages ! PO files have been submitted to translation coordination, with a ! translation percentage of at least 50%. ! ! Ready PO files bg ca cs da de el en eo es et fi fr ! +-------------------------------------+ ! a2ps | [] [] [] [] | ! bash | [] [] [] [] | ! bfd | [] [] | ! binutils | [] [] | ! bison | [] [] [] [] | ! clisp | [] [] [] [] | ! cpio | [] [] [] [] | ! diffutils | [] [] [] [] [] [] | ! enscript | [] [] | ! error | [] [] | ! fetchmail | [] () [] [] [] () | ! fileutils | [] [] [] [] [] | ! findutils | [] [] [] [] [] | ! flex | [] [] [] [] [] | ! gas | [] [] | ! gawk | [] [] [] | ! gcal | [] [] | ! gcc | [] [] | ! gettext | [] [] [] [] [] | ! gnupg | [] [] [] [] [] [] | ! gprof | [] [] | ! gpsdrive | () () () () () | ! grep | [] [] [] [] [] [] [] | ! gretl | | ! hello | [] [] [] [] [] [] [] [] | ! id-utils | [] [] [] | ! indent | [] [] [] [] [] | ! jpilot | () [] [] [] | ! jwhois | [] [] | ! kbd | [] [] | ! ld | [] [] | ! libc | [] [] [] [] [] [] [] | ! lilypond | [] [] | ! lynx | [] [] [] [] | ! m4 | [] [] [] [] [] | ! make | [] [] [] [] | ! mysecretdiary | [] [] | ! nano | [] () [] [] [] [] | ! nano_1_0 | [] () [] [] [] [] | ! opcodes | [] [] [] | ! parted | [] [] [] [] [] | ! ptx | [] [] [] [] [] | ! python | | ! recode | [] [] [] [] [] [] | ! sed | [] [] [] [] [] [] [] [] | ! sh-utils | [] [] [] [] [] [] [] [] | ! sharutils | [] [] [] [] [] [] | ! sketch | () [] () | ! soundtracker | [] [] [] | ! sp | [] | ! tar | [] [] [] [] [] [] | ! texinfo | [] [] [] [] [] | ! textutils | [] [] [] [] [] | ! util-linux | [] [] [] [] [] [] | ! vorbis-tools | | ! wastesedge | | ! wdiff | [] [] [] [] [] [] | ! wget | [] [] [] [] [] [] [] [] [] | ! +-------------------------------------+ ! bg ca cs da de el en eo es et fi fr ! 2 14 11 31 40 10 1 8 41 16 1 50 ! ! gl he hr hu id it ja ko lv nb nl nn ! +-------------------------------------+ ! a2ps | () () [] | ! bash | | ! bfd | [] | ! binutils | [] | ! bison | [] [] | ! clisp | [] | ! cpio | [] [] [] | ! diffutils | [] [] [] [] | ! enscript | [] [] | ! error | [] | ! fetchmail | [] | ! fileutils | [] [] [] | ! findutils | [] [] [] [] [] [] [] | ! flex | [] | ! gas | | ! gawk | [] | ! gcal | | ! gcc | | ! gettext | [] [] | ! gnupg | [] [] [] [] | ! gprof | | ! gpsdrive | () () | ! grep | [] [] [] [] [] [] | ! gretl | | ! hello | [] [] [] [] [] [] [] [] [] [] [] [] | ! id-utils | [] | ! indent | [] [] [] | ! jpilot | () () | ! jwhois | [] | ! kbd | | ! ld | | ! libc | [] [] [] [] | ! lilypond | [] [] | ! lynx | [] [] [] | ! m4 | [] [] [] [] | ! make | [] [] [] [] [] [] | ! mysecretdiary | | ! nano | [] [] [] () [] [] [] | ! nano_1_0 | [] [] [] () [] [] | ! opcodes | [] | ! parted | [] [] [] | ! ptx | [] [] [] [] | ! python | | ! recode | [] [] [] | ! sed | [] [] [] [] [] [] [] | ! sh-utils | [] [] [] [] [] | ! sharutils | [] [] [] | ! sketch | () | ! soundtracker | [] | ! sp | | ! tar | [] [] [] [] [] | ! texinfo | [] [] [] | ! textutils | [] [] [] | ! util-linux | () [] | ! vorbis-tools | | ! wastesedge | | ! wdiff | [] [] | ! wget | [] [] [] [] [] [] | ! +-------------------------------------+ ! gl he hr hu id it ja ko lv nb nl nn ! 23 9 8 4 12 12 25 9 1 8 20 4 ! ! no pl pt pt_BR ru sk sl sv tr uk zh_TW ! +----------------------------------------+ ! a2ps | () () () [] [] [] [] () | 9 ! bash | | 4 ! bfd | [] [] | 5 ! binutils | [] | 4 ! bison | [] [] [] | 9 ! clisp | | 5 ! cpio | [] [] [] [] | 11 ! diffutils | [] [] [] [] [] [] | 16 ! enscript | [] [] [] | 7 ! error | [] [] [] | 6 ! fetchmail | () () [] | 6 ! fileutils | [] [] [] [] [] | 13 ! findutils | [] [] [] [] [] [] [] | 19 ! flex | [] [] [] | 9 ! gas | [] | 3 ! gawk | [] [] | 6 ! gcal | [] [] | 4 ! gcc | [] | 3 ! gettext | [] [] [] [] [] [] | 13 ! gnupg | [] [] [] | 13 ! gprof | [] [] | 4 ! gpsdrive | () | 0 ! grep | [] [] [] [] | 17 ! gretl | | 0 ! hello | [] [] [] [] [] [] [] | 27 ! id-utils | [] [] | 6 ! indent | [] [] [] [] | 12 ! jpilot | () () [] | 4 ! jwhois | () () [] [] | 5 ! kbd | [] [] | 4 ! ld | [] [] | 4 ! libc | [] [] [] [] [] [] | 17 ! lilypond | [] | 5 ! lynx | [] [] [] | 10 ! m4 | [] [] [] | 12 ! make | [] [] [] [] | 14 ! mysecretdiary | [] [] | 4 ! nano | () [] [] [] [] | 15 ! nano_1_0 | () [] [] [] [] | 14 ! opcodes | [] [] | 6 ! parted | [] [] [] | 11 ! ptx | [] [] [] [] [] [] | 15 ! python | | 0 ! recode | [] [] [] [] | 13 ! sed | [] [] [] [] [] [] | 21 ! sh-utils | [] [] [] [] [] [] [] [] [] | 22 ! sharutils | [] [] [] [] | 13 ! sketch | [] () | 3 ! soundtracker | [] | 5 ! sp | | 1 ! tar | [] [] [] [] [] [] [] | 18 ! texinfo | [] [] | 10 ! textutils | [] [] [] [] [] | 13 ! util-linux | [] [] [] | 10 ! vorbis-tools | [] | 1 ! wastesedge | | 0 ! wdiff | [] [] [] [] | 12 ! wget | [] [] [] [] [] [] [] [] | 23 ! +----------------------------------------+ ! 35 teams no pl pt pt_BR ru sk sl sv tr uk zh_TW ! 58 domains 5 16 2 14 27 11 11 41 36 4 9 536 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 *************** *** 221,226 **** 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. --- 379,405 ---- lag between the mere existence a PO file and its wide availability in a distribution. ! If April 2002 seems to be old, you may fetch a more recent copy of ! this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date ! matrix with full percentage details can be found at ! `http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. ! ! Using `gettext' in new packages ! =============================== ! ! If you are writing a freely available program and want to ! internationalize it you are welcome to use GNU `gettext' in your ! package. Of course you have to respect the GNU Library General Public ! License which covers the use of the GNU `gettext' library. This means ! in particular that even non-free programs can use `libintl' as a shared ! library, whereas only free software can use `libintl' as a static ! library or use modified versions of `libintl'. ! ! Once the sources are changed appropriately and the setup can handle ! to use of `gettext' the only thing missing are the translations. The ! Free Translation Project is also available for packages which are not ! developed inside the GNU project. Therefore the information given above ! applies also for every other Free Software Project. Contact ! `translation@iro.umontreal.ca' to make the `.pot' files available to ! the translation teams. diff -crN gawk-3.1.0/ChangeLog gawk-3.1.1/ChangeLog *** gawk-3.1.0/ChangeLog Sun Jun 3 13:05:12 2001 --- gawk-3.1.1/ChangeLog Wed May 1 16:41:47 2002 *************** *** 1,3 **** --- 1,656 ---- + Wed May 1 16:41:32 2002 Arnold D. Robbins + + * Release 3.1.1: Release tar file made. + + Wed May 1 16:07:49 2002 Arnold D. Robbins + + * getopt.c: Installed latest version from glibc. + + Sun Apr 28 17:19:07 2002 Arnold D. Robbins + + * fixvers: Changed patterns to allow test versions of the + form `gawk-3.1.1a'. + * patchlev.h: Patchlevel is now a string constant. + * main.c (version): Print patchlevel using %s, not %d. + * Makefile.am: Rework DEFPATH stuff and datadir stuff yet again. + + * config.sub: Updated with current version from ftp.gnu.org. + * config.guess: Ditto. + + Upgrade to gettext-0.11.2: + + * ABOUT-NLS: Replaced with version from gettext 0.11.2. + * config.rpath: Replaced with version from gettext 0.11.2. + * intl/*: Replaced with version from gettext 0.11.2. + * po/Makefile.in.in: Replaced with version from gettext 0.11.2. + * po/Makevars.template: Replaced with version from gettext 0.11.2. + * po/Rules-quot: Replaced with version from gettext 0.11.2. + * po/boldquot.sed: Replaced with version from gettext 0.11.2. + * po/en@boldquot.header: Replaced with version from gettext 0.11.2. + * po/en@quot.header: Replaced with version from gettext 0.11.2. + * po/insert-header.sin: Replaced with version from gettext 0.11.2. + * po/quot.sed: Replaced with version from gettext 0.11.2. + * po/remove-potcdate.sin: Replaced with version from gettext 0.11.2. + * m4/codeset.m4: Replaced with version from gettext 0.11.2. + * m4/gettext.m4: Replaced with version from gettext 0.11.2. + * m4/glibc21.m4: Replaced with version from gettext 0.11.2. + * m4/iconv.m4: Replaced with version from gettext 0.11.2. + * m4/isc-posix.m4: Replaced with version from gettext 0.11.2. + * m4/lcmessage.m4: Replaced with version from gettext 0.11.2. + * m4/lib-ld.m4: Replaced with version from gettext 0.11.2. + * m4/lib-link.m4: Replaced with version from gettext 0.11.2. + * m4/lib-prefix.m4: Replaced with version from gettext 0.11.2. + * m4/progtest.m4: Replaced with version from gettext 0.11.2. + + Wed Apr 17 15:09:45 2002 Arnold D. Robbins + + * regex.c (PREFIX): Change test for token concatenation ability + to `#ifdef HAVE_STRINGIZE'. If a cpp has one, it ought to have + the other. + + Tue Apr 16 12:26:06 2002 Arnold D. Robbins + + * profile.c (tree_eval): Make unary minus case smarter, + use is_scalar test and if false parenthesize expression. + Add Node_TEXTDOMAIN case. + (pp_lhs, is_scalar, prec_level): Add Node_TEXTDOMAIN cases. + + Thu Apr 11 21:28:33 2002 Arnold D. Robbins + + * array.c (do_adump): Spelling fix in output message. + * builtin.c: Ditto, in multiple routines. + (do_toupper, do_tolower): Add cast to size_t in assigment to mbclen + for some compilers. + * re.c (research): Fix way returning is done to silence some + compiler diagnostics. + + Wed Apr 10 19:30:51 2002 Arnold D. Robbins + + * Makefile.am (datadir): Set directly to have `/awk'. + (DEFPATH): Go back to using $(datadir) for path. + + Tue Apr 9 17:34:09 2002 Arnold D. Robbins + + Upgraded to gettext 0.11.1. + + * Makefile.am (LDADD): Use @LIBINTL@ instead of @INTLLIBS@. + * ABOUT-NLS: Version from 0.11.1. + * config.rpath: Version from 0.11.1. + * aclocal.m4: Regenerated based on new files. + * intl/*: Replaced with version from 0.11.1. + * m4/ChangeLog: New file. + * m4/codeset.m4: New file. + * m4/gettext.m4: Version from 0.11.1. + * po/ChangeLog: New file. + * po/Makefile.in.in: Version from 0.11.1. + * po/remove-potcdate.sin: New file. + + Mon Apr 8 22:22:58 2002 Arnold D. Robbins + + * Makefile.am (libexecdir): Set directly to have `/awk'. + (DEFPATH): Use $(pkgdatadir) for path. + (install-exec-hook): Add version link for pgawk. + (uninstall-links): Remove pgawk version link. + + Wed Mar 20 13:44:21 2002 Isamu Hasegawa + + * regex.c (__alignof__): Definition for non-GCC compilers. + + Sun Mar 17 17:41:55 2002 Arnold D. Robbins + + * io.c (do_pathopen): Malloc buffers to hold constructed + filenames: No Arbitrary Limits! Thanks to keoki@techie.com + for the bug report. + + Sun Mar 10 16:59:06 2002 Scott Deifik + + * awk.h (LOCALEDIR): Provide a definition in case not using + i18n stuff. + + Wed Mar 6 18:14:44 2002 Arnold D. Robbins + + * main.c (usage): Add some explanatory text and examples at end. + + Sun Mar 3 16:42:50 2002 Arnold D. Robbins + + * getopt.h, getopt.c, getopt1.c: Update to current version + from glibc CVS. + + Fri Feb 22 15:53:38 2002 Isamu Hasegawa + + * dfa.c (fetch_wc): Fix type from wchar_t to wint_t. + (parse_bracket_exp_mb): Likewise. + * regex.c (extract_number): Retrieve the sign information from + byte-code in case of AIX. + + Thu Feb 21 16:44:24 2002 Arnold D. Robbins + + * re.c (resetup): Moved setting re_max_failures into regex.c. + * regex.c (re_max_failures): Set to really big if REGEX_MALLOC + defined. Do this in both places that define re_max_failures. + + Thu Feb 21 19:02:22 2002 Isamu Hasegawa + + * builtin.c (sub_common): Avoid index_multibyte_buffer invocation + in single byte character environments. + + Thu Feb 21 10:08:56 2002 Isamu Hasegawa + + * dfa.c (parse_bracket_exp_mb): For ':', use wctype_t in MALLOC, + not wchar_t. + + Thu Feb 21 09:52:16 2002 Arnold D. Robbins + + Upgraded to automake 1.5 and gettext-0.11. + Also bug fix to multibyte code. + + * ABOUT-NLS: upgraded. + * config.guess, config.sub, config.rpath, gettext.h, ylwrap: new files. + * Makefile.am: added above to appropriate places. + * awk.h: Replace libintl.h and macros with include of gettext.h. + (emalloc, erealloc): Add num bytes to error message, put string inside _(). + (index_multibyte_buffer): Removed decl. + * awklib/Makefile.am: Use $(EXEEXT) for grcat and pwcat targets. + * builtin.c (index_multibyte_buffer): Made static to this file. + (sub_common): Add checks that replacement string is length > 0 so + that we don't try to malloc(0): this fails on some systems. + * configure.in (AM_GNU_GETTEXT): Update macro for gettext 0.11. + (ALL_LINGUAS): Removed. + * m4/codeset.m4: new file. + * m4/gettext.m4: updated. + * m4/glibc21.m4: new file. + * m4/iconv.m4: new file. + * m4/isc-posix.m4: new file. + * m4/lcmessage.m4: updated. + * m4/lib-ld.m4: new file. + * m4/lib-link.m4: new file. + * m4/lib-prefix.m4: new file. + * m4/progtest.m4: updated. + * intl/*: Replaced with version from gettext 0.11. + * po/*: Revised for gettext 0.11. + + Mon Feb 18 14:42:39 2002 Arnold D. Robbins + + * builtin.c (nondec2awknum): Change assert to runtime check + in case user passed in bad data. + + 2002-02-17 Paul Eggert + + * re.c (resetup): Try to avoid silly limitation of regex.c by + setting re_max_failures to the largest reasonable value. + + Sun Feb 17 14:57:43 2002 Arnold D. Robbins + + * builtin.c (research): If re_search() returns -2, the + match failed since regex couldn't allocate enough memory + for what it needed. Fail with a fatal message instead. + This is a workaround, not a fix, but I don't mess with + regex.[ch]. + + Fri Feb 8 16:01:11 2002 Arnold D. Robbins + + * awkgram.y (LEX_FOR): Fix case of array loop with body of single + delete statement to actually check the right things to make the + optimization. + * profile.c (tree_eval): Add case for Node_K_delete_loop. + (prec_level): Ditto. + + Mon Feb 4 10:38:00 2002 Bruno Haible + + * awk.h (dcngettext): New macro. + (do_dcngettext): New declaration. + * awkgram.y (tokentab): Add dcngettext. + (snode): Add a warning for incorrect use of dcngettext. + (dumpintlstr): fflush at the end, not in the middle. + (dumpintlstr2): New function. + * builtin.c (localecategory_from_argument): New function, extracted + from do_dcgettext. + (do_dcgettext): Call it. + (do_dcngettext): New function. + + Sun Feb 3 17:56:20 2002 Bruno Haible + + * builtin.c (do_bindtextdomain): Don't free the same variable twice. + * main.c (main): Call setlocale for LC_MESSAGE, to make dcgettext + function work on glibc systems. + + Wed Jan 23 15:03:36 2002 Andreas Buening + + * configure.in (PATH_SEPARATOR): Code added for OS/2. + Makefile.am (PATH_SEPARATOR): Added. + (DEFPATH): Make use of PATH_SEPARATOR. + + Wed Jan 23 14:46:04 2002 Arnold D. Robbins + + * awkgram.y (yylex): Add test for lasttok != '$' when looking + at _"...". See comments in code. + + Wed Aug 15 07:43:10 2001 Isamu Hasegawa + + * regex.c : Implements the codes for exactn_bin to work correctly + in multibyte environments, in case of invalid multibyte sequence. + + Wed Aug 15 07:36:56 2001 Isamu Hasegawa + + * regex.c : Implements the codes for charset/charset_not to + work in multibyte environments. + + Wed Aug 15 05:04:34 2001 Isamu Hasegawa + + * regex.c : Add some comments. + + Wed Aug 15 05:04:15 2001 Isamu Hasegawa + + * regex.c (count_mbs_length): New function, check the mutibyte + strings and count how many wchar_t the substring occupy. + (CHAR_T): New macro, character type depending on + environments(singlebyte/multibyte). + (UCHAR_T): New macro, unsigned character type. + (COMPILED_BUFFER_VAR): New macro, the buffer containing + the compiled buffer. + Adapt singlebyte/multibyte environments with CHAR_T, UCHAR_T, + and COMPILED_BUFFER_VAR. + + Mon Jun 25 09:00:41 2001 Isamu Hasegawa + + * regex.c : Reorganize code to build code twice. byte_* are + for single byte, wcs_* are for multibyte character sets. + Chose functions according to current locale dynamically. + * regex.c (convert_mbs_to_wcs): New function, convert multibyte + strings to wide character strings for multibyte environments. + + Fri Jun 22 05:43:50 2001 Isamu Hasegawa + + * regex.c (MBS_SUPPORT): New macro, defined if the environment + can handle multibyte characters. + (OFFSET_ADDRESS_SIZE): Offset address size in the + compiled buffer. + Rewrite offset addresses with OFFSET_ADDRESS_SIZE. + + Thu Apr 26 08:03:17 2001 Isamu Hasegawa + + * builtin.c (index_multibyte_buffer) : inspect the buffer and write + the index. + (sub_common) : in multibyte environment, skip multibyte characters + when we check special characters. + * awk.h (index_multibyte_buffer) : add prototype. + * eval.c (cmp_nodes) : in multibyte environment, compare per character. + * field.c (re_parse_field) : in multibyte environment, avoid to + call research() on invalid boundary. + (sc_parse_field) : in multibyte environment, avoid to compare on + invalid boundary. + (null_parse_field) : in multibyte environment, split per + character, not per byte. + * io.c (get_a_record) : in multibyte environment, avoid to compare + on invalid boundary. + + Wed Apr 25 08:29:47 2001 Isamu Hasegawa + + * awk.h (strncasecmpmbs) : add prototype. + * builtin.c (strncasecmpmbs) : new function like strncasecmp but for + multibyte strings. + (do_index) : in multibyte environment, compare per character. + * builtin.c (do_tolower) : in multibyte environment, user towlower + instead of TOLOWER. + (do_toupper) : in multibyte environment, user towupper instead + of TOUPPER. + + Tue Apr 24 10:38:06 2001 Isamu Hasegawa + + In multibyte environments, handle multibyte characters as single + characters in bracket expressions. + + * dfa.h (mb_char_classes) : new structure. + (mbcsets) : new variable. + (nmbcsets) : new variable. + (mbcsets_alloc) : new variable. + * 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. + + Mon Apr 23 01:40:09 2001 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. + + Fri Apr 20 11:31:24 2001 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. + (mblen_buf) : new variable contains the amount of remain byte + of corresponding multibyte character in the input string. + + Fri Apr 20 06:28:59 2001 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. + + Thu Apr 19 09:32:47 2001 Isamu Hasegawa + + * awkgram.y (cur_mbstate) : new varialble containing means current + shift state. + (cur_char_ring) : new varialbe reffering the buffer which contains + last some character from the buffer. + (cur_ring_idx) : new variable containing the current index on + cur_char_ring. + (nextc_is_1stbyte) : new macro, means that last nextc() return a + singlebyte character or 1st byte of a multibyte character. + (nextc) : check the buffer and update cur_ring_char in multibyte + environments. + (pushback) : adjust cur_ring_idx in multibyte environments. + (yylex) : add check whether nextc() returned 1st-byte in multibyte + environments. + * re.c (make_regexp) : in multibyte environment, skip multibyte + characters when we check special characters. + + Wed Apr 18 07:58:20 2001 Isamu Hasegawa + + * awk.h (MBS_SUPPORT) : New flag, means supporting multibyte strings. + * configure.in : add check for wchar.h, wctype.h, mbrtowc, and mbrlen. + + Wed Jan 16 16:32:40 2002 Arnold D. Robbins + + * builtin.c (do_strtonum): Simplified. Check first if the + value matches a non-decimal number, and if so convert it. + Otherwise do a regular force_number. + + Mon Jan 7 22:12:15 2002 Arnold D. Robbins + + * awkgram.y (statement): moved delete, print, and expressions into + new non-terminal `simple_stmt'. Allow opt_simple_stmt in the + first and third part of a for loop, per latest POSIX, which documents + an otherwise undocumented historical oddity in Unix awk. This has + the pleasant side effect of making line numbers more accurate for + messages involving delete statements. + (opt_simple_stmt, simple_stmt): new non-terminals. + + Based on bug report from drj@pobox.com. + + Mon Dec 24 14:04:02 2001 Arnold D. Robbins + + * configure.in: Changes for VMS with new strftime: + (AC_HEADER_TIME): added + (AC_CHECK_HEADERS): Check for sys/time.h. + (TIME_T_IN_SYS_TYPES_H): Add header check. + * acconfig.h (TIME_T_IN_SYS_TYPES_H): Added. + + Wed Dec 19 16:01:58 2001 Peter J. Farley III + + * configure.in: Add MS-DOS to getpgrp special case. + * dfa.c, getopt.c, regex.c: Fix code to work with --disable-nls. + + Wed Dec 19 15:59:25 2001 Eli Zaretskii + + * profile.c (init_profiling_signals) [__DJGPP__]: Use SIGINT + instead of SIGHUP and SIGQUIT instead of SIGUSR1. + + Tue Dec 18 20:56:07 2001 Andreas Buening + + More OS/2 stuff. + + * awk.h (O_BINARY): Don't redefine for EMX. + * io.c (gawk_popen): Add __EMX__ in case compiling DOS executable. + * configure.in: Add OS/2 to case for manual GETPGRP_VOID. + + Tue Dec 4 17:54:30 2001 Arnold D. Robbins + + New configure time option, --with-whiny-user-strftime. + + * configure.in (AC_ARG_WITH): Add appropriate code for autoconf. + * accondig.h (USE_INCLUDED_STRFTIME): add #undef for it. + * custom.h (USE_INCLUDED_STRFTIME): set things up write. + + Tue Dec 4 16:44:07 2001 Andreas Buening + + Mongo patch for updated OS/2 support. + + * awk.h (TOUPPER, TOLOWER): Define only if not already defined. + * awkgram.y (extproc feature): Add ifdef for __EMX__. + * gawkmisc.c (__EMX__): include pc/gawkmisc.c directly. + * io.c (__EMX__): Added for a number of places in addition to OS2 def. + (two_way_open): Added OS/2 specific code added that uses spawn. + (gawk_popen): ditto. + + Mon Dec 3 14:07:56 2001 Arnold D. Robbins + + Fix use of getgroups to use dynamic memory, solves + problem of systems where NGROUPS_MAX lies. + + * awk.h (groupset, ngroups): New extern variables. + * configure.in (AC_CHECK_FUNCS): Add getgroups to list. + * io.c (user_open): Use global ngroups and groupset variables, + don't call getgroups here. + * main.c (init_groupset): New function to init global + vars using malloc. Declare it at top. + (main): Call init_groupset(). + (load_procinfo): Use global ngroups and groupset variables. + + Sun Nov 18 11:56:01 2001 Arnold D. Robbins + + * random.c (srandomdev): ifdef-out. Lots of compile time + problems on multiple platforms, and gawk doesn't even + use the routine. The heck with fine-grained solutions. + + Wed Nov 14 16:12:40 2001 Pat Rankin + + * builtin.c (bchunk_one): Use `ofre < 1' instead of `ofre <= 0' + to avoid compiler complaint about suspicious comparison for + unsigned variable. (`ofre == 0' ought to suffice...) + + Tue Nov 13 17:27:52 2001 Arnold D. Robbins + + * awkgram.y (yyerror): Fix the code to behave like it + used to. Keep "no arbitrary limits" by mallocing the + buffer and freeing it. + + Wed Nov 7 16:46:20 2001 Arnold D. Robbins + + * awkgram.y (yyerror): Remove dependency upon buf[] to + hold prepended space and `^' pointer. Avoids core dumps + for long source lines. + + Sat Nov 3 22:27:21 2001 Arnold D. Robbins + + * m4/strtod.m4: Add missing `#endif'. Oops. + + Mon Oct 29 14:53:57 2001 Arnold D. Robbins + + * awkgram.y: Add semicolons in calls to count_args(). + Apparently bisoon adds a semicolon to each body + automatically and byacc doesn't. + + Sun Oct 28 16:53:18 2001 Arnold D. Robbins + + * builtin.c (format_tree): Fix off-by-one error in "ran out + for this one" diagnostic. Also fix lint check for too many + arguments vs. count in format string. + + Wed Oct 10 11:01:47 2001 Arnold D. Robbins + + * fixvers: Check that files exist before doing `cmp', in + case they're in a source code system and aren't there. + Fix from Grant Erickson (gerickson@brocade.com). + + Thu Oct 4 18:20:36 2001 Arnold D. Robbins + + * eval.c (r_tree_eval): For comparison, dupnode() results of + evaluation so that we can hang on to them and avoid memory + corruption. Change calls to free_temp() to unref(). + + Tue Sep 25 15:19:53 2001 Arnold D. Robbins + + * io.c (iop_open): Only call os_close_on_exec() for + fd > fileno(stderr). + + 2001-09-07 Paul Eggert + + * io.c (redirect): When deciding to use the fdopen bug hack, + use "__sun" rather than "solaris". No compilers predefine + "solaris", but both GCC and Sun C predefine "__sun". + + Thu Aug 30 15:17:12 2001 Arnold D. Robbins + + * main.c (copyleft): Use a printf %d for last year of update + to avoid translation strings changing when the file + is updated from now on. Suggestion from Ulrich Drepper. + + Thu Aug 23 14:01:14 2001 Arnold D. Robbins + + * awkgram.y (unary minus production): Add check that value + isn't a string. Based on bug report from drj@pobox.com. + * profile.c (tree_eval): For node_val, only test NUMBER + to see if value is numeric, not NUM|NUMBER. + + Thu Aug 16 12:21:28 2001 Arnold D. Robbins + + * configure.in (ALL_LINGUAS): Added `fr' and `tr'. + * po/fr.po, po/tr.fo: New files. + + 2001-08-13 Paul Eggert + + This patch fixes a bug that causes gawk to rewind standard + input incorrectly. It also removes all instances of fseek, + from the gawk source proper, which should make gawk a bit + more portable. + + (The original patch removed off_t & lseek too, but I need + that for something else. ADR.) + + * posix/gawkmisc.c (optimal_bufsize): + Don't use lseek on the input, because that might change + its state. Instead, just check whether it is a regular file. + This obviates the need to invoke isatty. + (Also, fix a spelling error in the first line of the source.) + * pc/gawkmisc.pc, unsupported/atari/gawkmisc.atr: Likewise. + + * awk.h (S_ISREG): Move this macro here ... + * io.c (S_ISREG): from here. + + * protos.h (fseek): Remove prototype; no longer used. + + Fri Aug 3 13:38:54 2001 Arnold D. Robbins + + * array.c (assoc_lookup): Change assert test on type to real test + to protect against FS[1] = "x" kinds of things. It'd be better + to do this in the grammar, but this is easier and just as + effective. + + Undid BECAMEARRAY changes of 25 June 2001 in favor of correct code: + * eval.c (pop_fcall): Change test and comment for freeing n->vname. + (flags2str): removed BECAMEARRAY entry. + * awk.h (BECAMEARRAY): Removed define. + * array.c (assoc_lookup): Removed setting of BECAMEARRAY flag. + + Mon Jul 23 17:33:13 2001 Arnold D. Robbins + + * io.c (get_a_record): Handle case where RS = "" and input file + is only newlines. See test/onlynl. Bug report by + Michel Jouvin . + + Wed Jul 4 18:34:19 2001 Arnold D. Robbins + + * eval.c (assign_val): Don't allow negative values for NF. + * field.c (set_NF): Robustify field-freeing code to make sure + values are always positive. + + Sun Jul 1 19:15:01 2001 Arnold D. Robbins + + * builtin.c (do_index): If second string is "", return 1. + + Mon Jun 25 19:34:24 2001 Arnold D. Robbins + + Further rationalization of treatment of dynamic regexes, + so that profiling code works correctly. + * awk.h (NODETYPE): New type, Node_dynregex. + * awkgram.y (mk_rexp): Use Node_dynregex. + * eval.c (nodetypes): Add Node_dynregex. + (r_tree_eval): Add Node_dynregex to case for match_op(). + * profile.c (tree_eval): Add Node_dynregex to case for pp_match_op(). + (pp_match_op): Handle Node_dynregex, simplify cases for ~ and !~. + * re.c (re_update): Add assertion that type is Node_regex when flags + indicate CONST. + + New lint warning. + * awkgram.y (yylex): Added lint warning that constant with leading + zero is treated as octal or hex. + + Generalized code for those who are Strong In The Ways of the Source. + * awk.h: New boolean variable. + * main.c (main): set it. + * eval.c (interpret): For arrays, check it. Remove variable 'first', + not needed anymore. + * profile.c (pp_string_fp): Enable printing of non-ascii characters + verbatim if variable set. + + Fix memory corruption on SCO for array vars as params changed globally. + * awk.h (BECAMEARRAY): new flag. + * array.c (assoc_lookup): set the flag as appropriate. + * eval.c (flags2str): Add the flag. + (pop_fcall): Check the flag, don't free memory if set. + + Wed Jun 13 18:07:06 2001 Arnold D. Robbins + + * eval.c (fmt_index): Actually call erealloc() to grow fmt_list + if that's really necessary. Bug report from David Jones, + djones@zoonami.com. + + Sun Jun 10 14:24:48 2001 Arnold D. Robbins + + * profile.c (pp_match_op): Rationalized the code. + + Thu Jun 7 11:54:36 2001 Arnold D. Robbins + + * awk.h (O_BINARY): Don't define if already defined + (as is true for cygwin/gcc --- oops). + Sun Jun 3 13:04:44 2001 Arnold D. Robbins * Release 3.1.0: Release tar file made. And there was diff -crN gawk-3.1.0/FUTURES gawk-3.1.1/FUTURES *** gawk-3.1.0/FUTURES Tue Nov 7 18:18:18 2000 --- gawk-3.1.1/FUTURES Mon Apr 15 09:38:15 2002 *************** *** 17,24 **** ====== DONE: A PROCINFO array to replace /dev/pid, /dev/user, et al. - DONE: Add `abort' statement a la Thompson awk. - DONE: Provide awk profiling. DONE: Integrate GNU NLS support. --- 17,22 ---- diff -crN gawk-3.1.0/Makefile.am gawk-3.1.1/Makefile.am *** gawk-3.1.0/Makefile.am Tue May 15 20:09:08 2001 --- gawk-3.1.1/Makefile.am Sun Apr 28 17:27:54 2002 *************** *** 1,7 **** # # Makefile.am --- automake input file for gawk # ! # Copyright (C) 2000-2001 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. --- 1,7 ---- # # Makefile.am --- automake input file for gawk # ! # Copyright (C) 2000-2002 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. *************** *** 45,50 **** --- 45,53 ---- PROBLEMS \ README_d \ bisonfix.sed \ + config.guess \ + config.rpath \ + config.sub \ depcomp \ extension \ fixvers \ *************** *** 54,60 **** pc \ posix \ unsupported \ ! vms # The order to do things in. # Build in intl first in case we need the local gettext version. --- 57,64 ---- pc \ posix \ unsupported \ ! vms \ ! ylwrap # The order to do things in. # Build in intl first in case we need the local gettext version. *************** *** 86,91 **** --- 90,96 ---- getopt.c \ getopt.h \ getopt1.c \ + gettext.h \ io.c \ main.c \ msg.c \ *************** *** 105,128 **** pgawk_SOURCES = $(base_sources) eval_p.c profile_p.c # Get extra libs as needed ! LDADD = @INTLLIBS@ @SOCKET_LIBS@ # stuff for compiling gawk/pgawk ! DEFPATH="\".:$(datadir)\"" DEFS= -DDEFPATH=$(DEFPATH) -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR="\"$(datadir)/locale\"" ! INCLUDES = -I. -I$(srcdir) -I$(srcdir)/intl # We want hard links for install-exec-hook, below LN= ln # First, add a link from gawk to gawk-X.Y.Z # For systems where gawk is awk, add a link to awk install-exec-hook: (fullname=gawk-`./gawk --version | sed 1q | awk '{print $$3}'` ; \ cd $(DESTDIR)$(bindir); \ $(LN) gawk $$fullname ; \ if [ ! -f awk ]; \ then $(LN_S) gawk awk; \ fi; exit 0) --- 110,143 ---- pgawk_SOURCES = $(base_sources) eval_p.c profile_p.c # Get extra libs as needed ! LDADD = @LIBINTL@ @SOCKET_LIBS@ ! ! # Special stuff for OS/2, remove after switch to autoconf 2.5x ! PATH_SEPARATOR = @PATH_SEPARATOR@ ! ! # Set autoconf Makefile.in variables correctly ! datadir = @datadir@ ! awkdatadir = @datadir@/awk ! libexecdir = @libexecdir@/awk # stuff for compiling gawk/pgawk ! DEFPATH="\".$(PATH_SEPARATOR)$(awkdatadir)\"" DEFS= -DDEFPATH=$(DEFPATH) -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR="\"$(datadir)/locale\"" ! INCLUDES = -I$(srcdir)/intl # We want hard links for install-exec-hook, below LN= ln # First, add a link from gawk to gawk-X.Y.Z + # Same for pgawk # For systems where gawk is awk, add a link to awk install-exec-hook: (fullname=gawk-`./gawk --version | sed 1q | awk '{print $$3}'` ; \ cd $(DESTDIR)$(bindir); \ $(LN) gawk $$fullname ; \ + $(LN) pgawk p$$fullname ; \ if [ ! -f awk ]; \ then $(LN_S) gawk awk; \ fi; exit 0) *************** *** 132,138 **** (cd $(DESTDIR)$(bindir); \ if [ -f awk ] && cmp awk gawk > /dev/null; then rm -f awk; fi ; \ fullname=gawk-`./gawk --version | sed 1q | ./gawk '{print $$3}'` ; \ ! rm -f $$fullname; exit 0) uninstall-recursive: uninstall-links --- 147,153 ---- (cd $(DESTDIR)$(bindir); \ if [ -f awk ] && cmp awk gawk > /dev/null; then rm -f awk; fi ; \ fullname=gawk-`./gawk --version | sed 1q | ./gawk '{print $$3}'` ; \ ! rm -f $$fullname p$$fullname; exit 0) uninstall-recursive: uninstall-links diff -crN gawk-3.1.0/Makefile.in gawk-3.1.1/Makefile.in *** gawk-3.1.0/Makefile.in Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/Makefile.in Mon Apr 29 17:36:46 2002 *************** *** 0 **** --- 1,802 ---- + # 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@ + + # + # Makefile.am --- automake input file for gawk + # + # Copyright (C) 2000-2002 the Free Software Foundation, Inc. + # + # This file is part of GAWK, the GNU implementation of the + # AWK Programming Language. + # + # GAWK 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. + # + # GAWK 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 + # + + # Automatic de-ANSI-fication if needed + + SHELL = @SHELL@ + + srcdir = @srcdir@ + top_srcdir = @top_srcdir@ + VPATH = @srcdir@ + prefix = @prefix@ + exec_prefix = @exec_prefix@ + + bindir = @bindir@ + sbindir = @sbindir@ + 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@ + CATOBJEXT = @CATOBJEXT@ + CC = @CC@ + CFLAGS = @CFLAGS@ + CPP = @CPP@ + DATADIRNAME = @DATADIRNAME@ + DEPDIR = @DEPDIR@ + EXEEXT = @EXEEXT@ + GENCAT = @GENCAT@ + GLIBC21 = @GLIBC21@ + GMSGFMT = @GMSGFMT@ + HAVE_LIB = @HAVE_LIB@ + INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ + INSTOBJEXT = @INSTOBJEXT@ + INTLBISON = @INTLBISON@ + INTLLIBS = @INTLLIBS@ + INTLOBJS = @INTLOBJS@ + INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ + LIB = @LIB@ + LIBICONV = @LIBICONV@ + LIBINTL = @LIBINTL@ + LN_S = @LN_S@ + LTLIB = @LTLIB@ + LTLIBICONV = @LTLIBICONV@ + LTLIBINTL = @LTLIBINTL@ + MKINSTALLDIRS = @MKINSTALLDIRS@ + OBJEXT = @OBJEXT@ + PACKAGE = @PACKAGE@ + POSUB = @POSUB@ + RANLIB = @RANLIB@ + SOCKET_LIBS = @SOCKET_LIBS@ + U = @U@ + USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ + USE_NLS = @USE_NLS@ + VERSION = @VERSION@ + YACC = @YACC@ + am__include = @am__include@ + am__quote = @am__quote@ + install_sh = @install_sh@ + libexecdir = @libexecdir@/awk + + # Set autoconf Makefile.in variables correctly + datadir = @datadir@ + + # Special stuff for OS/2, remove after switch to autoconf 2.5x + PATH_SEPARATOR = @PATH_SEPARATOR@ + + AUTOMAKE_OPTIONS = ansi2knr + + # This undocumented variable insures that aclocal runs + # correctly after changing configure.in + ACLOCAL_AMFLAGS = -I m4 + + # This insures that make flags get passed down to child makes. + AM_MAKEFLAGS = 'CFLAGS=$(CFLAGS)' 'LDFLAGS=$(LDFLAGS)' + + # Stuff to include in the dist that doesn't need it's own + # Makefile.am files + EXTRA_DIST = \ + COPYING \ + FUTURES \ + INSTALL \ + LIMITATIONS \ + NEWS \ + POSIX.STD \ + PROBLEMS \ + README_d \ + bisonfix.sed \ + config.guess \ + config.rpath \ + config.sub \ + depcomp \ + extension \ + fixvers \ + m4 \ + missing \ + missing_d \ + pc \ + posix \ + unsupported \ + vms \ + ylwrap + + + # The order to do things in. + # Build in intl first in case we need the local gettext version. + # Build explicitly "." next in order to build gawk first, so + # that `make check' without a prior `make' works. + SUBDIRS = \ + intl \ + . \ + awklib \ + doc \ + po \ + test + + + # what to make and install + bin_PROGRAMS = gawk pgawk + + # sources for both gawk and pgawk + base_sources = \ + array.c \ + awk.h \ + awkgram.y \ + builtin.c \ + custom.h \ + dfa.c \ + dfa.h \ + ext.c \ + field.c \ + gawkmisc.c \ + getopt.c \ + getopt.h \ + getopt1.c \ + gettext.h \ + io.c \ + main.c \ + msg.c \ + node.c \ + patchlev.h \ + protos.h \ + random.c \ + random.h \ + re.c \ + regex.c \ + regex.h \ + replace.c \ + version.in \ + version.c + + + gawk_SOURCES = $(base_sources) eval.c profile.c + pgawk_SOURCES = $(base_sources) eval_p.c profile_p.c + + # Get extra libs as needed + LDADD = @LIBINTL@ @SOCKET_LIBS@ + awkdatadir = @datadir@/awk + + # stuff for compiling gawk/pgawk + DEFPATH = "\".$(PATH_SEPARATOR)$(awkdatadir)\"" + + DEFS = -DDEFPATH=$(DEFPATH) -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR="\"$(datadir)/locale\"" + + INCLUDES = -I$(srcdir)/intl + + # We want hard links for install-exec-hook, below + LN = ln + subdir = . + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = config.h + CONFIG_CLEAN_FILES = intl/Makefile + bin_PROGRAMS = gawk$(EXEEXT) pgawk$(EXEEXT) + PROGRAMS = $(bin_PROGRAMS) + + am_gawk_OBJECTS = array$U.$(OBJEXT) awkgram$U.$(OBJEXT) \ + builtin$U.$(OBJEXT) dfa$U.$(OBJEXT) ext$U.$(OBJEXT) \ + field$U.$(OBJEXT) gawkmisc$U.$(OBJEXT) getopt$U.$(OBJEXT) \ + getopt1$U.$(OBJEXT) io$U.$(OBJEXT) main$U.$(OBJEXT) \ + msg$U.$(OBJEXT) node$U.$(OBJEXT) random$U.$(OBJEXT) \ + re$U.$(OBJEXT) regex$U.$(OBJEXT) replace$U.$(OBJEXT) \ + version$U.$(OBJEXT) eval$U.$(OBJEXT) profile$U.$(OBJEXT) + gawk_OBJECTS = $(am_gawk_OBJECTS) + gawk_LDADD = $(LDADD) + gawk_DEPENDENCIES = + gawk_LDFLAGS = + am_pgawk_OBJECTS = array$U.$(OBJEXT) awkgram$U.$(OBJEXT) \ + builtin$U.$(OBJEXT) dfa$U.$(OBJEXT) ext$U.$(OBJEXT) \ + field$U.$(OBJEXT) gawkmisc$U.$(OBJEXT) getopt$U.$(OBJEXT) \ + getopt1$U.$(OBJEXT) io$U.$(OBJEXT) main$U.$(OBJEXT) \ + msg$U.$(OBJEXT) node$U.$(OBJEXT) random$U.$(OBJEXT) \ + re$U.$(OBJEXT) regex$U.$(OBJEXT) replace$U.$(OBJEXT) \ + version$U.$(OBJEXT) eval_p$U.$(OBJEXT) profile_p$U.$(OBJEXT) + pgawk_OBJECTS = $(am_pgawk_OBJECTS) + pgawk_LDADD = $(LDADD) + pgawk_DEPENDENCIES = + pgawk_LDFLAGS = + DEFAULT_INCLUDES = -I. -I$(srcdir) -I. + CPPFLAGS = @CPPFLAGS@ + LDFLAGS = @LDFLAGS@ + LIBS = @LIBS@ + depcomp = $(SHELL) $(top_srcdir)/depcomp + @AMDEP_TRUE@DEP_FILES = $(DEPDIR)/array$U.Po $(DEPDIR)/awkgram$U.Po \ + @AMDEP_TRUE@ $(DEPDIR)/builtin$U.Po $(DEPDIR)/dfa$U.Po \ + @AMDEP_TRUE@ $(DEPDIR)/eval$U.Po $(DEPDIR)/eval_p$U.Po \ + @AMDEP_TRUE@ $(DEPDIR)/ext$U.Po $(DEPDIR)/field$U.Po \ + @AMDEP_TRUE@ $(DEPDIR)/gawkmisc$U.Po $(DEPDIR)/getopt$U.Po \ + @AMDEP_TRUE@ $(DEPDIR)/getopt1$U.Po $(DEPDIR)/io$U.Po \ + @AMDEP_TRUE@ $(DEPDIR)/main$U.Po $(DEPDIR)/msg$U.Po \ + @AMDEP_TRUE@ $(DEPDIR)/node$U.Po $(DEPDIR)/profile$U.Po \ + @AMDEP_TRUE@ $(DEPDIR)/profile_p$U.Po $(DEPDIR)/random$U.Po \ + @AMDEP_TRUE@ $(DEPDIR)/re$U.Po $(DEPDIR)/regex$U.Po \ + @AMDEP_TRUE@ $(DEPDIR)/replace$U.Po $(DEPDIR)/version$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 $@ + YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) + YLWRAP = $(top_srcdir)/ylwrap + DIST_SOURCES = $(gawk_SOURCES) $(pgawk_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 acconfig.h acinclude.m4 \ + aclocal.m4 ansi2knr.1 ansi2knr.c awkgram.c config.guess \ + config.sub configh.in configure configure.in depcomp install-sh \ + missing mkinstalldirs ylwrap + DIST_SUBDIRS = $(SUBDIRS) + SOURCES = $(gawk_SOURCES) $(pgawk_SOURCES) + + all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + + .SUFFIXES: + .SUFFIXES: .c .o .obj .y + $(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 acinclude.m4 m4/arch.m4 m4/codeset.m4 m4/gettext.m4 m4/glibc21.m4 m4/iconv.m4 m4/isc-posix.m4 m4/jm-mktime.m4 m4/largefile.m4 m4/lcmessage.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/progtest.m4 m4/socket.m4 m4/ssize_t.m4 m4/strtod.m4 + 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)/configh.in $(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:configh.in \ + $(SHELL) ./config.status + @mv stamp-hT stamp-h + $(srcdir)/configh.in: $(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) $(top_srcdir)/acconfig.h + @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 + 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) + gawk$(EXEEXT): $(gawk_OBJECTS) $(gawk_DEPENDENCIES) + @rm -f gawk$(EXEEXT) + $(LINK) $(gawk_LDFLAGS) $(gawk_OBJECTS) $(gawk_LDADD) $(LIBS) + pgawk$(EXEEXT): $(pgawk_OBJECTS) $(pgawk_DEPENDENCIES) + @rm -f pgawk$(EXEEXT) + $(LINK) $(pgawk_LDFLAGS) $(pgawk_OBJECTS) $(pgawk_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 + + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/array$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/awkgram$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/builtin$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/dfa$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/eval$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/eval_p$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/ext$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/field$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/gawkmisc$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt1$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/io$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/main$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/msg$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/node$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/profile$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/profile_p$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/random$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/re$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/regex$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/replace$U.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/version$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@ + array_.c: array.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/array.c; then echo $(srcdir)/array.c; else echo array.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > array_.c || rm -f array_.c + awkgram_.c: awkgram.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/awkgram.c; then echo $(srcdir)/awkgram.c; else echo awkgram.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > awkgram_.c || rm -f awkgram_.c + builtin_.c: builtin.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/builtin.c; then echo $(srcdir)/builtin.c; else echo builtin.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > builtin_.c || rm -f builtin_.c + 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 + eval_.c: eval.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/eval.c; then echo $(srcdir)/eval.c; else echo eval.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > eval_.c || rm -f eval_.c + eval_p_.c: eval_p.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/eval_p.c; then echo $(srcdir)/eval_p.c; else echo eval_p.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > eval_p_.c || rm -f eval_p_.c + ext_.c: ext.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ext.c; then echo $(srcdir)/ext.c; else echo ext.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ext_.c || rm -f ext_.c + field_.c: field.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/field.c; then echo $(srcdir)/field.c; else echo field.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > field_.c || rm -f field_.c + gawkmisc_.c: gawkmisc.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/gawkmisc.c; then echo $(srcdir)/gawkmisc.c; else echo gawkmisc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > gawkmisc_.c || rm -f gawkmisc_.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 + io_.c: io.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/io.c; then echo $(srcdir)/io.c; else echo io.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > io_.c || rm -f io_.c + main_.c: main.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/main.c; then echo $(srcdir)/main.c; else echo main.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > main_.c || rm -f main_.c + msg_.c: msg.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/msg.c; then echo $(srcdir)/msg.c; else echo msg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > msg_.c || rm -f msg_.c + node_.c: node.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/node.c; then echo $(srcdir)/node.c; else echo node.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > node_.c || rm -f node_.c + profile_.c: profile.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/profile.c; then echo $(srcdir)/profile.c; else echo profile.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > profile_.c || rm -f profile_.c + profile_p_.c: profile_p.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/profile_p.c; then echo $(srcdir)/profile_p.c; else echo profile_p.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > profile_p_.c || rm -f profile_p_.c + random_.c: random.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/random.c; then echo $(srcdir)/random.c; else echo random.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > random_.c || rm -f random_.c + re_.c: re.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/re.c; then echo $(srcdir)/re.c; else echo re.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > re_.c || rm -f re_.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 + replace_.c: replace.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/replace.c; then echo $(srcdir)/replace.c; else echo replace.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > replace_.c || rm -f replace_.c + version_.c: version.c $(ANSI2KNR) + $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/version.c; then echo $(srcdir)/version.c; else echo version.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > version_.c || rm -f version_.c + array_.$(OBJEXT) awkgram_.$(OBJEXT) builtin_.$(OBJEXT) dfa_.$(OBJEXT) \ + eval_.$(OBJEXT) eval_p_.$(OBJEXT) ext_.$(OBJEXT) field_.$(OBJEXT) \ + gawkmisc_.$(OBJEXT) getopt_.$(OBJEXT) getopt1_.$(OBJEXT) io_.$(OBJEXT) \ + main_.$(OBJEXT) msg_.$(OBJEXT) node_.$(OBJEXT) profile_.$(OBJEXT) \ + profile_p_.$(OBJEXT) random_.$(OBJEXT) re_.$(OBJEXT) regex_.$(OBJEXT) \ + replace_.$(OBJEXT) version_.$(OBJEXT) : $(ANSI2KNR) + + .y.c: + $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h -- $(YACCCOMPILE) + 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) configh.in $(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)configh.in$$unique$(LISP)$$tags" \ + || etags $(ETAGS_ARGS) $$tags configh.in $$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 + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="${top_distdir}" distdir="$(distdir)" \ + dist-hook + -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 + $(MAKE) $(AM_MAKEFLAGS) check-local + check: check-recursive + all-am: Makefile $(ANSI2KNR) $(PROGRAMS) config.h + installdirs: installdirs-recursive + installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(bindir) + + 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-binPROGRAMS clean-generic clean-krextra 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-compile distclean-depend \ + distclean-generic distclean-hdr distclean-tags + + dvi: dvi-recursive + + dvi-am: + + info: info-recursive + + info-am: + + install-data-am: + + install-exec-am: install-binPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + + 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-binPROGRAMS uninstall-info-am + + uninstall-info: uninstall-info-recursive + + .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am check-local \ + clean clean-binPROGRAMS clean-generic clean-krextra \ + clean-recursive dist dist-all distcheck distclean \ + distclean-compile distclean-depend distclean-generic \ + distclean-hdr distclean-recursive distclean-tags distdir dvi \ + dvi-am dvi-recursive info info-am info-recursive install \ + install-am install-binPROGRAMS 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-binPROGRAMS uninstall-info-am \ + uninstall-info-recursive uninstall-recursive + + + # First, add a link from gawk to gawk-X.Y.Z + # Same for pgawk + # For systems where gawk is awk, add a link to awk + install-exec-hook: + (fullname=gawk-`./gawk --version | sed 1q | awk '{print $$3}'` ; \ + cd $(DESTDIR)$(bindir); \ + $(LN) gawk $$fullname ; \ + $(LN) pgawk p$$fullname ; \ + if [ ! -f awk ]; \ + then $(LN_S) gawk awk; \ + fi; exit 0) + + # Undo the above when uninstalling + uninstall-links: + (cd $(DESTDIR)$(bindir); \ + if [ -f awk ] && cmp awk gawk > /dev/null; then rm -f awk; fi ; \ + fullname=gawk-`./gawk --version | sed 1q | ./gawk '{print $$3}'` ; \ + rm -f $$fullname p$$fullname; exit 0) + + uninstall-recursive: uninstall-links + + # force there to be a gawk executable before running tests + check-local: gawk pgawk + + # A little extra clean up when making distributions. + # FIXME: most of this rule should go away upon switching to libtool. + dist-hook: + cd $(distdir)/extension ; rm -f *.o *.so + + # Special rules for individual files + awkgram.c: awkgram.y + $(YACC) $(AM_YFLAGS) $(YFLAGS) $< && sed -f $(srcdir)/bisonfix.sed < y.tab.c > $*.c && $(RM) y.tab.c + if test -f y.tab.h; then \ + if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \ + else :; fi + + # these force version and patchlevel to be up to date based + # on what's in configure.in. No-one else but me should have + # to use them. So there. + patchlev.h: configure.in + ./fixvers -p + + version.c: configure.in version.in + ./fixvers -v + # 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 -crN gawk-3.1.0/NEWS gawk-3.1.1/NEWS *** gawk-3.1.0/NEWS Mon Feb 26 10:40:00 2001 --- gawk-3.1.1/NEWS Mon Apr 29 14:52:29 2002 *************** *** 1,3 **** --- 1,52 ---- + Changes from 3.1.0 to 3.1.1 + --------------------------- + + 1. Six new translations. + + 2. Having more than 4 different value for OFMT and/or CONVFMT now works. + + 3. The handling of dynamic regexes is now more more sane, esp. w.r.t. + the profiling code. The profiling code has been fixed in several + places. + + 4. The return value of index("", "") is now 1. + + 5. Gawk should no longer close fd 0 in child processes. + + 6. Fixed test for strtod semantics and regenerated configure. + + 7. Gawk can now be built with byacc; an accidental bison dependency was + removed. + + 8. yyerror() will no longer dump core on long source lines. + + 9. Gawk now correctly queries getgroups(2) to figure out how many groups + the process has. + + 10. New configure option to force use of included strftime, e.g. on + Solaris systems. See `./configure --help' for the details. Replaced + the included strftime.c with the one from textutils. + + 11. OS/2 port has been updated. + + 12. Multi-byte character support has been added, courtesy of IBM Japan. + + 13. The `for (iggy in foo) delete foo[iggy]' -> `delete foo' optimisation + now works. + + 14. Upgraded to gettext 0.11.2 and automake 1.5. + + 15. Full gettext compatibility (new dcngettext function). + + 16. The O'Reilly copyedits and indexing changes for the documentation have + been folded into the texinfo version of the manuals. + + 17. A humongously long value for the AWKPATH environment variable will no + longer dump core. + + 18. Configuration / Installation issues have been straightened out in + Makefile.am. + Changes from 3.0.6 to 3.1.0 --------------------------- diff -crN gawk-3.1.0/README gawk-3.1.1/README *** gawk-3.1.0/README Wed May 16 10:43:45 2001 --- gawk-3.1.1/README Tue Apr 16 13:54:14 2002 *************** *** 1,10 **** README: ! This is GNU Awk 3.1.0. It is upwardly compatible with the Bell Labs research version of awk. It is almost completely compliant with the 1993 POSIX 1003.2 standard for awk. (See the note below about POSIX.) ! There are lots of new features -- see NEWS and ChangeLog for details. Work to be done is described briefly in the FUTURES file. Changes in this version are summarized in the NEWS file. Please read the LIMITATIONS file. --- 1,10 ---- README: ! This is GNU Awk 3.1.1. It is upwardly compatible with the Bell Labs research version of awk. It is almost completely compliant with the 1993 POSIX 1003.2 standard for awk. (See the note below about POSIX.) ! This is a bug fix release. See NEWS and ChangeLog for details. Work to be done is described briefly in the FUTURES file. Changes in this version are summarized in the NEWS file. Please read the LIMITATIONS file. *************** *** 92,99 **** juan@biophnet.unlp.edu.ar OS/2: ! Kai Uwe Rommel ! rommel@ars.de Tandem: Stephen Davies --- 92,98 ---- juan@biophnet.unlp.edu.ar OS/2: ! gawk-maintainer@unixos2.org Tandem: Stephen Davies diff -crN gawk-3.1.0/README_d/README.VMS gawk-3.1.1/README_d/README.VMS *** gawk-3.1.0/README_d/README.VMS Fri Dec 13 05:56:43 1996 --- gawk-3.1.1/README_d/README.VMS Mon Apr 22 14:22:27 2002 *************** *** 19,27 **** `@vmsbuild GNUC DO_GNUC_SETUP' or `MMS/MACRO=("GNUC","DO_GNUC_SETUP")'. ! Tested under Alpha/VMS V6.2 using DEC C V5.2 and under VAX/VMS V6.2 ! using DEC C V5.2, VAX C 3.2, and GNU C 2.7.1. GAWK should work without ! modifications for VMS V4.6 and up. Installing GAWK on VMS: --- 19,26 ---- `@vmsbuild GNUC DO_GNUC_SETUP' or `MMS/MACRO=("GNUC","DO_GNUC_SETUP")'. ! Tested under Alpha/VMS V7.1 using DEC C V6.4. GAWK should work ! without modifications for VMS V4.6 and up. Installing GAWK on VMS: *************** *** 80,103 **** value should be quoted so that it retains a single translation, not a multi-translation RMS searchlist. - - Building and using GAWK under VMS POSIX: - - Ignore the instructions above, although vms/gawk.hlp should still - be made available in a help library. The source tree should be unpacked - into a container file subsystem rather than into the ordinary VMS file - system. Make sure that the two scripts, 'configure' and 'vms/posix-cc.sh', - are executable; use `chmod +x' on them if necessary. Then execute the - following two commands: - |psx> CC=vms/posix-cc.sh configure - |psx> make CC=c89 gawk - The first command will construct files "config.h" and "Makefile" out - of templates, using a script to make the C compiler fit 'configure's - expectations. The second command will compile and link 'gawk' using - the C compiler directly; ignore any warnings from `make' about being - unable to redefine "CC". The configure script will take a very long - time to execute, but at least it provides incremental feedback as it - runs. - - Tested with VAX/VMS V6.2 + VMS POSIX V2.0 + DEC C V5.2. - --- 79,81 ---- diff -crN gawk-3.1.0/README_d/README.ia64 gawk-3.1.1/README_d/README.ia64 *** gawk-3.1.0/README_d/README.ia64 Wed Apr 25 17:17:52 2001 --- gawk-3.1.1/README_d/README.ia64 Tue Apr 16 13:55:42 2002 *************** *** 1,3 **** --- 1,7 ---- + Tue Apr 16 13:55:15 IDT 2002 + ============================ + The current version of the IA-64 environment builds gawk without any problems. + Wed Apr 25 17:17:01 IDT 2001 ============================ diff -crN gawk-3.1.0/README_d/README.pc gawk-3.1.1/README_d/README.pc *** gawk-3.1.0/README_d/README.pc Sun Jan 7 15:36:06 2001 --- gawk-3.1.1/README_d/README.pc Wed Jan 16 15:16:35 2002 *************** *** 8,13 **** --- 8,27 ---- version for Windows 9x/NT, and MSC can be used to build 16-bit versions for DOS and OS/2. + The cygwin environment (http://www.cygwin.com) may also be used + to compile and run gawk under Windows. For cygwin, building and + installation is the same as under Unix: + + tar -xvpzf gawk-3.1.x.tar.gz + cd gawk-3.1.x + ./configure && make + + The `configure' step takes a long time, but works otherwise. + + ******************************** N O T E ********************************** + * The `|&' operator only works when gawk is compiled for cygwin. Neither * + * socket support nor two-way pipes work in any other Windows environment! * + *************************************************************************** Building gawk ------------- *************** *** 330,335 **** --- 344,351 ---- 9. gawk built from the mingw32 and vcWin32 targets continues to have problems with pipes; in particular, the pipeio1 test fails. + 10. As mentioned above, `|&' only works with cygwin. + Gawk thanks ----------- *************** *** 350,360 **** Scott Deifik, scottd@amgen.com (DOS versions) or ! Kai Uwe Rommel, rommel@ars.de (OS/2 or bound versions) Darrel Hankerson, hankedr@mail.auburn.edu ! Support for Win32 started in gawk-3.0.3. Reports concerning the emx ! version using rsxnt (emxnt) should go to Kai Uwe Rommel. Reports on the Visual C++ version (vcWin32) may be sent to Juan Grigera, juan@biophnet.unlp.edu.ar (Visual C++ version) --- 366,375 ---- Scott Deifik, scottd@amgen.com (DOS versions) or ! gawk-maintainer@unixos2.org (OS/2 version) Darrel Hankerson, hankedr@mail.auburn.edu ! Support for Win32 started in gawk-3.0.3. Reports on the Visual C++ version (vcWin32) may be sent to Juan Grigera, juan@biophnet.unlp.edu.ar (Visual C++ version) diff -crN gawk-3.1.0/README_d/README.solaris gawk-3.1.1/README_d/README.solaris *** gawk-3.1.0/README_d/README.solaris Tue Jul 4 07:57:24 2000 --- gawk-3.1.1/README_d/README.solaris Sun Sep 9 12:01:57 2001 *************** *** 53,60 **** Arnold Robbins arnold@gnu.org ! Solution to Problem #1: ! ======================= From: Paul Nevai Subject: Re: gawk-3.0.4 To: arnold@skeeve.com (Aharon Robbins) --- 53,65 ---- Arnold Robbins arnold@gnu.org ! Solution (a) to Problem #2: ! =========================== ! Now fixed in the code via Paul Eggert's 2001-09-0 patch. See the ! ChangeLog. ! ! Solution (b) to Problem #2: ! =========================== From: Paul Nevai Subject: Re: gawk-3.0.4 To: arnold@skeeve.com (Aharon Robbins) diff -crN gawk-3.1.0/acconfig.h gawk-3.1.1/acconfig.h *** gawk-3.1.0/acconfig.h Sun Jan 21 17:47:22 2001 --- gawk-3.1.1/acconfig.h Mon Dec 24 14:27:33 2001 *************** *** 33,38 **** --- 33,40 ---- #undef DYNAMIC /* allow dynamic addition of builtins */ #undef STRTOD_NOT_C89 /* strtod doesn't have C89 semantics */ #undef ssize_t /* signed version of size_t */ + #undef USE_INCLUDED_STRFTIME /* force use of our version of strftime */ + #undef TIME_T_IN_SYS_TYPES_H /* some systems define this type here */ @BOTTOM@ diff -crN gawk-3.1.0/aclocal.m4 gawk-3.1.1/aclocal.m4 *** gawk-3.1.0/aclocal.m4 Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/aclocal.m4 Mon Apr 29 17:36:45 2002 *************** *** 0 **** --- 1,2792 ---- + # 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. + + sinclude(arch.m4)dnl + sinclude(gettext.m4)dnl + sinclude(jm-mktime.m4)dnl + sinclude(largefile.m4)dnl + sinclude(lcmessage.m4)dnl + sinclude(progtest.m4)dnl + sinclude(socket.m4)dnl + sinclude(strtod.m4)dnl + + # 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 + + # isc-posix.m4 serial 2 (gettext-0.11.2) + dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + + # This file is not needed with autoconf-2.53 and newer. Remove it in 2005. + + # 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 19 + + 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_TEST_INCLUDES + AC_DEFUN(AC_SYS_LARGEFILE_TEST_INCLUDES, + [[#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply "#define LARGE_OFF_T 9223372036854775807", + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ + # define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; + ]]) + + dnl Internal subroutine of AC_SYS_LARGEFILE. + dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLUDES, FUNCTION-BODY) + AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE, + [AC_CACHE_CHECK([for $1 value needed for large files], $3, + [$3=no + AC_TRY_COMPILE([$5], + [$6], + , + [AC_TRY_COMPILE([#define $1 $2] + [$5] + , + [$6], + [$3=$2])])]) + if test "[$]$3" != no; then + AC_DEFINE_UNQUOTED([$1], [$]$3, [$4]) + fi]) + + AC_DEFUN(AC_SYS_LARGEFILE, + [AC_REQUIRE([AC_PROG_CC]) + AC_ARG_ENABLE(largefile, + [ --disable-largefile omit support for large files]) + if test "$enable_largefile" != no; then + + AC_CACHE_CHECK([for special C compiler options needed for large files], + ac_cv_sys_largefile_CC, + [ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , , + [ac_save_CC="$CC" + CC="$CC -n32" + AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , + ac_cv_sys_largefile_CC=' -n32') + CC="$ac_save_CC"]) + fi]) + if test "$ac_cv_sys_largefile_CC" != no; then + CC="$CC$ac_cv_sys_largefile_CC" + fi + + AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, + ac_cv_sys_file_offset_bits, + [Number of bits in a file offset, on hosts where this is settable.], + AC_SYS_LARGEFILE_TEST_INCLUDES) + AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, + ac_cv_sys_large_files, + [Define for large files, on AIX-style hosts.], + AC_SYS_LARGEFILE_TEST_INCLUDES) + fi + ]) + + AC_DEFUN(AC_FUNC_FSEEKO, + [AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1, + ac_cv_sys_largefile_source, + [Define to make fseeko visible on some hosts (e.g. glibc 2.2).], + [#include ], [return !fseeko;]) + # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug + # in glibc 2.1.3, but that breaks too many other things. + # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. + + AC_CACHE_CHECK([for fseeko], ac_cv_func_fseeko, + [ac_cv_func_fseeko=no + AC_TRY_LINK([#include ], + [return fseeko && fseeko (stdin, 0, 0);], + [ac_cv_func_fseeko=yes])]) + if test $ac_cv_func_fseeko != no; then + AC_DEFINE(HAVE_FSEEKO, 1, + [Define if fseeko (and presumably ftello) exists and is declared.]) + fi]) + + dnl + dnl arch.m4 --- autoconf input file for gawk + dnl + dnl Copyright (C) 1995, 1996, 1998, 1999, 2000 the Free Software Foundation, Inc. + dnl + dnl This file is part of GAWK, the GNU implementation of the + dnl AWK Progamming Language. + dnl + dnl GAWK is free software; you can redistribute it and/or modify + dnl it under the terms of the GNU General Public License as published by + dnl the Free Software Foundation; either version 2 of the License, or + dnl (at your option) any later version. + dnl + dnl GAWK is distributed in the hope that it will be useful, + dnl but WITHOUT ANY WARRANTY; without even the implied warranty of + dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + dnl GNU General Public License for more details. + dnl + dnl You should have received a copy of the GNU General Public License + dnl along with this program; if not, write to the Free Software + dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + dnl + + dnl Check for AIX and add _XOPEN_SOURCE_EXTENDED + AC_DEFUN(GAWK_AC_AIX_TWEAK, [ + AC_MSG_CHECKING([for AIX compilation hacks]) + AC_CACHE_VAL(gawk_cv_aix_hack, [ + if test -d /lpp/bos + then + CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED=1" + gawk_cv_aix_hack=yes + else + gawk_cv_aix_hack=no + fi + ])dnl + AC_MSG_RESULT([${gawk_cv_aix_hack}]) + ])dnl + + dnl Check for Alpha Linux systems + AC_DEFUN(GAWK_AC_LINUX_ALPHA, [ + AC_MSG_CHECKING([for Linux/Alpha compilation hacks]) + AC_CACHE_VAL(gawk_cv_linux_alpha_hack, [ + if test "Linux" = "`uname`" && test "alpha" = "`uname -m`" + then + # this isn't necessarily always true, + # the vendor's compiler is also often found + if test "$GCC" = yes + then + CFLAGS="$CFLAGS -mieee" + gawk_cv_linux_alpha_hack=yes + else + gawk_cv_linux_alpha_hack=no + fi + else + gawk_cv_linux_alpha_hack=no + fi + ])dnl + AC_MSG_RESULT([${gawk_cv_linux_alpha_hack}]) + ])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 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 + ]) + + # gettext.m4 serial 14 (gettext-0.11.2) + dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + dnl + dnl This file can can be used in projects which are not available under + dnl the GNU General Public License or the GNU Library General Public + dnl License but which still want to provide support for the GNU gettext + dnl functionality. + dnl Please note that the actual code of the GNU gettext library is covered + dnl by the GNU Library General Public License, and the rest of the GNU + dnl gettext package package is covered by the GNU General Public License. + dnl They are *not* in the public domain. + + dnl Authors: + dnl Ulrich Drepper , 1995-2000. + dnl Bruno Haible , 2000-2002. + + dnl Macro to add for using GNU gettext. + + dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). + dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The + dnl default (if it is not specified or empty) is 'no-libtool'. + dnl INTLSYMBOL should be 'external' for packages with no intl directory, + dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. + dnl If INTLSYMBOL 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). If INTLSYMBOL is 'no-libtool', 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 INTLDIR 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 If INTLSYMBOL is 'external', only cases 2 and 3 can occur. + 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_GNU_GETTEXT], + [ + dnl Argument checking. + ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , + [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT + ])])])])]) + ifelse([$2], [], , [ifelse([$2], [need-ngettext], , + [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT + ])])]) + define(gt_included_intl, ifelse([$1], [external], [no], [yes])) + define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) + + AC_REQUIRE([AM_PO_SUBDIRS])dnl + ifelse(gt_included_intl, yes, [ + AC_REQUIRE([AM_INTL_SUBDIR])dnl + ]) + + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + 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) + + ifelse(gt_included_intl, yes, [ + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + ]) + LIBINTL= + LTLIBINTL= + POSUB= + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + ifelse(gt_included_intl, yes, [ + 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. + + dnl Add a version number to the cache macros. + define([gt_api_version], ifelse([$2], [need-ngettext], 2, 1)) + define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) + define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) + + AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, + [AC_TRY_LINK([#include + extern int _nl_msg_cat_cntr; + extern int *_nl_domain_bindings;], + [bindtextdomain ("", ""); + return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], + gt_cv_func_gnugettext_libc=yes, + gt_cv_func_gnugettext_libc=no)]) + + if test "$gt_cv_func_gnugettext_libc" != "yes"; then + dnl Sometimes libintl requires libiconv, so first search for libiconv. + ifelse(gt_included_intl, yes, , [ + AM_ICONV_LINK + ]) + dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL + dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) + dnl because that would add "-liconv" to LIBINTL and LTLIBINTL + dnl even if libiconv doesn't exist. + AC_LIB_LINKFLAGS_BODY([intl]) + AC_CACHE_CHECK([for GNU gettext in libintl], + gt_cv_func_gnugettext_libintl, + [gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + dnl Now see whether libintl exists and does not depend on libiconv. + AC_TRY_LINK([#include + extern int _nl_msg_cat_cntr; + extern + #ifdef __cplusplus + "C" + #endif + const char *_nl_expand_alias ();], + [bindtextdomain ("", ""); + return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], + gt_cv_func_gnugettext_libintl=yes, + gt_cv_func_gnugettext_libintl=no) + dnl Now see whether libintl exists and depends on libiconv. + if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + AC_TRY_LINK([#include + extern int _nl_msg_cat_cntr; + extern + #ifdef __cplusplus + "C" + #endif + const char *_nl_expand_alias ();], + [bindtextdomain ("", ""); + return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], + [LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + gt_cv_func_gnugettext_libintl=yes + ]) + fi + CPPFLAGS="$gt_save_CPPFLAGS" + 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 + gt_use_preinstalled_gnugettext=yes + else + dnl Reset the values set by searching for libintl. + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + ifelse(gt_included_intl, yes, [ + if test "$gt_use_preinstalled_gnugettext" != "yes"; then + dnl GNU gettext is not found in the C library. + dnl Fall back on included 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)" + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" + LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions to use GNU gettext tools. + CATOBJEXT=.gmo + fi + ]) + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + AC_DEFINE(ENABLE_NLS, 1, + [Define to 1 if translation of program messages to the user's native language + is requested.]) + else + USE_NLS=no + fi + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext_libintl" = "yes"; then + AC_MSG_CHECKING([how to link with libintl]) + AC_MSG_RESULT([$LIBINTL]) + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) + fi + + dnl For backward compatibility. Some packages may be using this. + AC_DEFINE(HAVE_GETTEXT, 1, + [Define if the GNU gettext() function is already present or preinstalled.]) + AC_DEFINE(HAVE_DCGETTEXT, 1, + [Define if the GNU dcgettext() function is already present or preinstalled.]) + fi + + dnl We need to process the po/ directory. + POSUB=po + fi + + ifelse(gt_included_intl, yes, [ + 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 Make all variables we use known to autoconf. + AC_SUBST(BUILD_INCLUDED_LIBINTL) + AC_SUBST(USE_INCLUDED_LIBINTL) + AC_SUBST(CATOBJEXT) + AC_SUBST(INTLOBJS) + + 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 Enable libtool support if the surrounding package wishes it. + INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix + AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) + ]) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLLIBS="$LIBINTL" + AC_SUBST(INTLLIBS) + + dnl Make all documented variables known to autoconf. + AC_SUBST(LIBINTL) + AC_SUBST(LTLIBINTL) + AC_SUBST(POSUB) + ]) + + + dnl Checks for all prerequisites of the po subdirectory, + dnl except for USE_NLS. + AC_DEFUN([AM_PO_SUBDIRS], + [ + AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AM_MKINSTALLDIRS])dnl + + dnl Perform the following tests also if --disable-nls has been given, + dnl because they are needed for "make dist" to work. + + dnl Search for GNU msgfmt in the PATH. + dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. + dnl The second test excludes FreeBSD msgfmt. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + + dnl Search for GNU xgettext 0.11 or newer in the PATH. + dnl The first test excludes Solaris xgettext and early GNU xgettext versions. + dnl The second test excludes FreeBSD xgettext. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + + dnl Search for GNU msgmerge 0.11 or newer in the PATH. + AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, + [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) + + 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 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + AC_MSG_RESULT( + [found $GMSGFMT 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 --copyright-holder= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.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" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + fi + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + GMOFILES= + UPDATEPOFILES= + DUMMYPOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; 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 + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done], + [# Capture the value of obsolete $ALL_LINGUAS because we need it to compute + # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it + # from automake. + eval 'ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + ]) + ]) + + + dnl Checks for all prerequisites of the intl subdirectory, + dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, + dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. + AC_DEFUN([AM_INTL_SUBDIR], + [ + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AM_MKINSTALLDIRS])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 getc_unlocked getcwd getegid \ + geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \ + strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) + + AM_ICONV + AM_LANGINFO_CODESET + AM_LC_MESSAGES + + 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 + ]) + + + AC_DEFUN([AM_MKINSTALLDIRS], + [ + 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) + ]) + + # lib-prefix.m4 serial 1 (gettext-0.11) + dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + + dnl From Bruno Haible. + + dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed + dnl to access previously installed libraries. The basic assumption is that + dnl a user will want packages to use other packages he previously installed + dnl with the same --prefix option. + dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate + dnl libraries, but is otherwise very convenient. + AC_DEFUN([AC_LIB_PREFIX], + [ + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_ARG_WITH([lib-prefix], + [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir], + [ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + ]) + if test $use_additional = yes; then + dnl Potentially add $additional_includedir to $CPPFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's already present in $CPPFLAGS, + dnl 3. if it's /usr/local/include and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + for x in $CPPFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $CPPFLAGS. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" + fi + fi + fi + fi + dnl Potentially add $additional_libdir to $LDFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's already present in $LDFLAGS, + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + for x in $LDFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LDFLAGS. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" + fi + fi + fi + fi + fi + ]) + + dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, + dnl acl_final_exec_prefix, containing the values to which $prefix and + dnl $exec_prefix will expand at the end of the configure script. + AC_DEFUN([AC_LIB_PREPARE_PREFIX], + [ + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + ]) + + dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the + dnl variables prefix and exec_prefix bound to the values they will have + dnl at the end of the configure script. + AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], + [ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + $1 + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + ]) + + # lib-link.m4 serial 2 (gettext-0.11.2) + dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + + dnl From Bruno Haible. + + dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and + dnl the libraries corresponding to explicit and implicit dependencies. + dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and + dnl augments the CPPFLAGS variable. + AC_DEFUN([AC_LIB_LINKFLAGS], + [ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + ac_cv_lib[]Name[]_libs="$LIB[]NAME" + ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" + ac_cv_lib[]Name[]_cppflags="$INC[]NAME" + ]) + LIB[]NAME="$ac_cv_lib[]Name[]_libs" + LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" + INC[]NAME="$ac_cv_lib[]Name[]_cppflags" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the + dnl results of this search when this library appears as a dependency. + HAVE_LIB[]NAME=yes + undefine([Name]) + undefine([NAME]) + ]) + + dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) + dnl searches for libname and the libraries corresponding to explicit and + dnl implicit dependencies, together with the specified include files and + dnl the ability to compile and link the specified testcode. If found, it + dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and + dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and + dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs + dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. + AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], + [ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + + dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + + dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, + dnl because if the user has installed lib[]Name and not disabled its use + dnl via --without-lib[]Name-prefix, he wants to use it. + ac_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + + AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIB[]NAME" + AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) + LIBS="$ac_save_LIBS" + ]) + if test "$ac_cv_lib[]Name" = yes; then + HAVE_LIB[]NAME=yes + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) + AC_MSG_CHECKING([how to link with lib[]$1]) + AC_MSG_RESULT([$LIB[]NAME]) + else + HAVE_LIB[]NAME=no + dnl If $LIB[]NAME didn't lead to a usable library, we don't need + dnl $INC[]NAME either. + CPPFLAGS="$ac_save_CPPFLAGS" + LIB[]NAME= + LTLIB[]NAME= + fi + AC_SUBST([HAVE_LIB]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + undefine([Name]) + undefine([NAME]) + ]) + + dnl Determine the platform dependent parameters needed to use rpath: + dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, + dnl hardcode_direct, hardcode_minus_L, + dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec. + AC_DEFUN([AC_LIB_RPATH], + [ + AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS + AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host + AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir + AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" + sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" + ]) + + dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and + dnl the libraries corresponding to explicit and implicit dependencies. + dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. + AC_DEFUN([AC_LIB_LINKFLAGS_BODY], + [ + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_ARG_WITH([lib$1-prefix], + [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib + --without-lib$1-prefix don't search for lib$1 in includedir and libdir], + [ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + ]) + dnl Search the library and its dependencies in $additional_libdir and + dnl $LDFLAGS. Using breadth-first-seach. + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='$1 $2' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS + dnl or AC_LIB_HAVE_LINKFLAGS call. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" + else + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined + dnl that this library doesn't exist. So just drop it. + : + fi + else + dnl Search the library lib$name in $additional_libdir and $LDFLAGS + dnl and the already constructed $LIBNAME/$LTLIBNAME. + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + dnl Found the library. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + dnl Linking with a shared library. We attempt to hardcode its + dnl directory into the executable's runpath, unless it's the + dnl standard /usr/lib. + if test "X$found_dir" = "X/usr/lib"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. + if test "$hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + dnl Rely on "-L$found_dir". + dnl But don't add it if it's already contained in the LDFLAGS + dnl or the already constructed $LIBNAME + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + dnl Linking with a static library. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" + else + dnl We shouldn't come here, but anyway it's good to have a + dnl fallback. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" + fi + fi + dnl Assume the include files are nearby. + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + dnl Potentially add $additional_includedir to $INCNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's /usr/local/include and we are using GCC on Linux, + dnl 3. if it's already present in $CPPFLAGS or the already + dnl constructed $INCNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INC[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $INCNAME. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + dnl Look for dependencies. + if test -n "$found_la"; then + dnl Read the .la file. It defines the variables + dnl dlname, library_names, old_library, dependency_libs, current, + dnl age, revision, installed, dlopen, dlpreopen, libdir. + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + dnl We use only dependency_libs. + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's /usr/local/lib and we are using GCC on Linux, + dnl 3. if it's already present in $LDFLAGS or the already + dnl constructed $LIBNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + ;; + -l*) + dnl Handle this in the next round. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + dnl Handle this in the next round. Throw away the .la's + dnl directory; it is already contained in a preceding -L + dnl option. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + dnl Most likely an immediate library name. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" + ;; + esac + done + fi + else + dnl Didn't find the library; assume it is in the system directories + dnl known to the linker and runtime loader. (All the system + dnl directories known to the linker should also be known to the + dnl runtime loader, otherwise the system is severely misconfigured.) + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + else + dnl The -rpath options are cumulative. + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + dnl When using libtool, the option that works for both libraries and + dnl executables is -R. The -R options are cumulative. + for found_dir in $ltrpathdirs; do + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" + done + fi + ]) + + dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, + dnl unless already present in VAR. + dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes + dnl contains two or three consecutive elements that belong together. + AC_DEFUN([AC_LIB_APPENDTOVAR], + [ + for element in [$2]; do + haveit= + for x in $[$1]; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + [$1]="${[$1]}${[$1]:+ }$element" + fi + done + ]) + + # lib-ld.m4 serial 1 (gettext-0.11) + dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + + dnl Subroutines of libtool.m4, + dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision + dnl with libtool.m4. + + dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. + AC_DEFUN([AC_LIB_PROG_LD_GNU], + [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, + [# I'd rather use --version here, but apparently some GNU ld's only accept -v. + if $LD -v 2>&1 &5; then + acl_cv_prog_gnu_ld=yes + else + acl_cv_prog_gnu_ld=no + fi]) + with_gnu_ld=$acl_cv_prog_gnu_ld + ]) + + dnl From libtool-1.4. Sets the variable LD. + AC_DEFUN([AC_LIB_PROG_LD], + [AC_ARG_WITH(gnu-ld, + [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], + test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + ac_prog=ld + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]* | [A-Za-z]:[\\/]*)] + [re_direlt='/[^/][^/]*/\.\./'] + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) + else + AC_MSG_CHECKING([for non-GNU ld]) + fi + AC_CACHE_VAL(acl_cv_path_LD, + [if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" + else + acl_cv_path_LD="$LD" # Let the user override the test with a path. + fi]) + LD="$acl_cv_path_LD" + if test -n "$LD"; then + AC_MSG_RESULT($LD) + else + AC_MSG_RESULT(no) + fi + test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) + AC_LIB_PROG_LD_GNU + ]) + + # iconv.m4 serial AM3 (gettext-0.11) + dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + + dnl From Bruno Haible. + + AC_DEFUN([AM_ICONV_LINK], + [ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([iconv]) + + dnl Add $INCICONV to CPPFLAGS before performing the following checks, + dnl because if the user has installed libiconv and not disabled its use + dnl via --without-libiconv-prefix, he wants to use it. The first + dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. + am_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) + + 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 $LIBICONV" + 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.]) + fi + if test "$am_cv_lib_iconv" = yes; then + AC_MSG_CHECKING([how to link with libiconv]) + AC_MSG_RESULT([$LIBICONV]) + else + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV + dnl either. + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + AC_SUBST(LIBICONV) + AC_SUBST(LTLIBICONV) + ]) + + AC_DEFUN([AM_ICONV], + [ + AC_REQUIRE([AM_ICONV_LINK]) + if test "$am_cv_func_iconv" = yes; then + 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 + ]) + + # progtest.m4 serial 2 (gettext-0.10.40) + dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + dnl + dnl This file can can be used in projects which are not available under + dnl the GNU General Public License or the GNU Library General Public + dnl License but which still want to provide support for the GNU gettext + dnl functionality. + dnl Please note that the actual code of the GNU gettext library is covered + dnl by the GNU Library General Public License, and the rest of the GNU + dnl gettext package package is covered by the GNU General Public License. + dnl They are *not* in the public domain. + + dnl Authors: + dnl Ulrich Drepper , 1996. + + # Search path for a program which passes the given test. + + 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 + ]) + + # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40) + dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + + # 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" + ] + ) + + # codeset.m4 serial AM1 (gettext-0.10.40) + dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + + 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 + ]) + + # lcmessage.m4 serial 2 (gettext-0.10.40) + dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + dnl + dnl This file can can be used in projects which are not available under + dnl the GNU General Public License or the GNU Library General Public + dnl License but which still want to provide support for the GNU gettext + dnl functionality. + dnl Please note that the actual code of the GNU gettext library is covered + dnl by the GNU Library General Public License, and the rest of the GNU + dnl gettext package package is covered by the GNU General Public License. + dnl They are *not* in the public domain. + + dnl Authors: + dnl Ulrich Drepper , 1995. + + # Check whether LC_MESSAGES is available in . + + 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]) + + #serial 1 + + dnl AC_PREREQ(2.14a) + + dnl This is a specialization of AC_CHECK_TYPE applied to `ssize_t' with + dnl the difference that it also includes unistd.h on systems that have it. + dnl On Fujitsu UXP/V systems ssize_t is defined in unistd.h. + AC_DEFUN(GAWK_AC_TYPE_SSIZE_T, + [ + AC_CHECK_HEADERS(unistd.h) + AC_CHECK_TYPE(ssize_t, int, + [ + #include + #if STDC_HEADERS + # include + # include + #endif + #if HAVE_UNISTD_H + # include + #endif + ] + ) + ] + ) + + dnl + dnl strtod.m4 --- autoconf input file for gawk + dnl + dnl Copyright (C) 2001, 2002 the Free Software Foundation, Inc. + dnl + dnl This file is part of GAWK, the GNU implementation of the + dnl AWK Progamming Language. + dnl + dnl GAWK is free software; you can redistribute it and/or modify + dnl it under the terms of the GNU General Public License as published by + dnl the Free Software Foundation; either version 2 of the License, or + dnl (at your option) any later version. + dnl + dnl GAWK is distributed in the hope that it will be useful, + dnl but WITHOUT ANY WARRANTY; without even the implied warranty of + dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + dnl GNU General Public License for more details. + dnl + dnl You should have received a copy of the GNU General Public License + dnl along with this program; if not, write to the Free Software + dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + + dnl Check for strtod with C89 semantics + + AC_DEFUN(GAWK_AC_FUNC_STRTOD_C89, + [ + AC_CHECK_HEADERS(stdlib.h) + AC_CHECK_FUNCS(strtod) + AC_CACHE_CHECK([for strtod with C89 semantics], gawk_ac_cv_func_strtod_c89, + [AC_TRY_RUN( + [/* Test program from Arnold Robbins (arnold@skeeve.com) */ + #if HAVE_STDLIB_H + #include + #else + extern double strtod(); + #endif + + int + main () + { + #if ! HAVE_STRTOD + exit(1); + #else + double d; + char *str = "0x345a"; + + d = strtod(str, 0); + if (d == 0) + exit (0); + else + exit (1); + #endif + }], + gawk_ac_cv_func_strtod_c89=yes, gawk_ac_cv_func_strtod_c89=no, + gawk_ac_cv_func_strtod_c89=no)]) + if test $gawk_ac_cv_func_strtod_c89 = no; then + AC_DEFINE(STRTOD_NOT_C89) + fi + ])# GAWK_FUNC_STRTOD_C89 + + #serial 7 + + dnl From Jim Meyering. + dnl A wrapper around AC_FUNC_MKTIME. + + AC_DEFUN(jm_FUNC_MKTIME, + [AC_REQUIRE([AC_FUNC_MKTIME])dnl + + dnl mktime.c uses localtime_r if it exists. Check for it. + AC_CHECK_FUNCS(localtime_r) + + if test $ac_cv_func_working_mktime = no; then + AC_DEFINE_UNQUOTED(mktime, rpl_mktime, + [Define to rpl_mktime if the replacement function should be used.]) + fi + ]) + + # AC_FUNC_MKTIME + # -------------- + # Stolen from CVS Autoconf. Should be removed once you use Autoconf 2.15. + AC_DEFUN(AC_FUNC_MKTIME, + [AC_REQUIRE([AC_HEADER_TIME])dnl + AC_CHECK_HEADERS(sys/time.h unistd.h) + AC_CHECK_FUNCS(alarm) + AC_CACHE_CHECK([for working mktime], ac_cv_func_working_mktime, + [AC_TRY_RUN( + [/* Test program from Paul Eggert (eggert@twinsun.com) + and Tony Leneis (tony@plaza.ds.adp.com). */ + #if TIME_WITH_SYS_TIME + # include + # include + #else + # if HAVE_SYS_TIME_H + # include + # else + # include + # endif + #endif + + #if HAVE_UNISTD_H + # include + #endif + + #if !HAVE_ALARM + # define alarm(X) /* empty */ + #endif + + /* Work around redefinition to rpl_putenv by other config tests. */ + #undef putenv + + static time_t time_t_max; + + /* Values we'll use to set the TZ environment variable. */ + static const char *const tz_strings[] = { + (const char *) 0, "TZ=GMT0", "TZ=JST-9", + "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" + }; + #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + + /* Fail if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ + static void + spring_forward_gap () + { + /* glibc (up to about 1998-10-07) failed this test) */ + struct tm tm; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + tm.tm_year = 98; + tm.tm_mon = 3; + tm.tm_mday = 5; + tm.tm_hour = 2; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + if (mktime (&tm) == (time_t)-1) + exit (1); + } + + static void + mktime_test (now) + time_t now; + { + struct tm *lt; + if ((lt = localtime (&now)) && mktime (lt) != now) + exit (1); + now = time_t_max - now; + if ((lt = localtime (&now)) && mktime (lt) != now) + exit (1); + } + + static void + irix_6_4_bug () + { + /* Based on code from Ariel Faigon. */ + struct tm tm; + tm.tm_year = 96; + tm.tm_mon = 3; + tm.tm_mday = 0; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); + if (tm.tm_mon != 2 || tm.tm_mday != 31) + exit (1); + } + + static void + bigtime_test (j) + int j; + { + struct tm tm; + time_t now; + tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; + now = mktime (&tm); + if (now != (time_t) -1) + { + struct tm *lt = localtime (&now); + if (! (lt + && lt->tm_year == tm.tm_year + && lt->tm_mon == tm.tm_mon + && lt->tm_mday == tm.tm_mday + && lt->tm_hour == tm.tm_hour + && lt->tm_min == tm.tm_min + && lt->tm_sec == tm.tm_sec + && lt->tm_yday == tm.tm_yday + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) + exit (1); + } + } + + int + main () + { + time_t t, delta; + int i, j; + + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + alarm (60); + + for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2) + continue; + time_t_max--; + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv (tz_strings[i]); + + for (t = 0; t <= time_t_max - delta; t += delta) + mktime_test (t); + mktime_test ((time_t) 60 * 60); + mktime_test ((time_t) 60 * 60 * 24); + + for (j = 1; 0 < j; j *= 2) + bigtime_test (j); + bigtime_test (j - 1); + } + irix_6_4_bug (); + spring_forward_gap (); + exit (0); + }], + ac_cv_func_working_mktime=yes, ac_cv_func_working_mktime=no, + ac_cv_func_working_mktime=no)]) + if test $ac_cv_func_working_mktime = no; then + LIBOBJS="$LIBOBJS mktime.${ac_objext}" + fi + ])# AC_FUNC_MKTIME + dnl + dnl socket.m4 --- autoconf input file for gawk + dnl + dnl Copyright (C) 1995, 96, 98, 99, 2000 the Free Software Foundation, Inc. + dnl + dnl This file is part of GAWK, the GNU implementation of the + dnl AWK Progamming Language. + dnl + dnl GAWK is free software; you can redistribute it and/or modify + dnl it under the terms of the GNU General Public License as published by + dnl the Free Software Foundation; either version 2 of the License, or + dnl (at your option) any later version. + dnl + dnl GAWK is distributed in the hope that it will be useful, + dnl but WITHOUT ANY WARRANTY; without even the implied warranty of + dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + dnl GNU General Public License for more details. + dnl + dnl You should have received a copy of the GNU General Public License + dnl along with this program; if not, write to the Free Software + dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + dnl + + dnl Find the socket libraries + dnl largely stolen from AC_PATH_XTRA + AC_DEFUN(GAWK_AC_LIB_SOCKETS, [ + gawk_have_sockets=no + # Check for system-dependent location of socket libraries + + SOCKET_LIBS= + if test "$ISC" = yes; then + SOCKET_LIBS="-lnsl_s -linet" + else + # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And karl@cs.umb.edu says + # the Alpha needs dnet_stub (dnet does not exist). + # + # ADR: Is this needed just for sockets??? + # AC_CHECK_LIB(dnet, dnet_ntoa, [SOCKET_LIBS="$SOCKET_LIBS -ldnet"]) + # if test $ac_cv_lib_dnet_ntoa = no; then + # AC_CHECK_LIB(dnet_stub, dnet_ntoa, + # [SOCKET_LIBS="$SOCKET_LIBS -ldnet_stub"]) + # fi + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # chad@anasazi.com says the Pyramid MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to dickey@clark.net. + AC_CHECK_FUNC(gethostbyname) + if test $ac_cv_func_gethostbyname = no; then + AC_CHECK_LIB(nsl, gethostbyname, SOCKET_LIBS="$SOCKET_LIBS -lnsl") + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says simon@lia.di.epfl.ch: it contains + # gethostby* variants that don't use the nameserver (or something). + # -lsocket must be given before -lnsl if both are needed. + # We assume that if connect needs -lnsl, so does gethostbyname. + AC_CHECK_FUNC(connect) + if test $ac_cv_func_connect = no; then + AC_CHECK_LIB(socket, connect, SOCKET_LIBS="-lsocket $SOCKET_LIBS" + gawk_have_sockets=yes, , + $SOCKET_LIBS) + else + gawk_have_sockets=yes + fi + fi + + if test "${gawk_have_sockets}" = "yes" + then + AC_MSG_CHECKING([where to find the socket library calls]) + case "${SOCKET_LIBS}" in + ?*) gawk_lib_loc="${SOCKET_LIBS}" ;; + *) gawk_lib_loc="the standard library" ;; + esac + AC_MSG_RESULT([${gawk_lib_loc}]) + + AC_DEFINE(HAVE_SOCKETS) + fi + AC_SUBST(SOCKET_LIBS)dnl + ])dnl + diff -crN gawk-3.1.0/array.c gawk-3.1.1/array.c *** gawk-3.1.0/array.c Tue Feb 20 16:35:24 2001 --- gawk-3.1.1/array.c Tue Apr 16 14:40:06 2002 *************** *** 3,9 **** */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. --- 3,9 ---- */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. *************** *** 270,276 **** register int hash1; register NODE *bucket; ! assert(symbol->type == Node_var_array || symbol->type == Node_var); (void) force_string(subs); --- 270,278 ---- register int hash1; register NODE *bucket; ! /* protect against silly users, e.g. FS[1] = "x" */ ! if (symbol->type != Node_var_array && symbol->type != Node_var) ! fatal(_("attempt to use scalar `%s' as array"), symbol->vname); (void) force_string(subs); *************** *** 607,613 **** a = tree->lnode; if (a->type == Node_param_list) { ! printf(_("%s: is paramater\n"), a->vname); a = stack_ptr[a->param_cnt]; } --- 609,615 ---- a = tree->lnode; if (a->type == Node_param_list) { ! printf(_("%s: is parameter\n"), a->vname); a = stack_ptr[a->param_cnt]; } diff -crN gawk-3.1.0/awk.h gawk-3.1.1/awk.h *** gawk-3.1.0/awk.h Sun Apr 22 16:44:13 2001 --- gawk-3.1.1/awk.h Tue Apr 16 14:40:18 2002 *************** *** 3,9 **** */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. --- 3,9 ---- */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. *************** *** 49,69 **** #include #include ! #if defined(HAVE_LIBINTL_H) && defined(ENABLE_NLS) && ENABLE_NLS > 0 ! #include ! #else /* ! (HAVE_LOCALE_H && defined(ENABLE_NLS) && ENABLE_LS > 0) */ ! #define gettext(msgid) (msgid) ! #define gettext_noop(msgid) msgid ! #define dgettext(domain, msgid) (msgid) ! #define dcgettext(domain, msgid, cat) (msgid) ! #define bindtextdomain(domain, directory) (directory) ! #define textdomain(package) /* nothing */ #ifndef LOCALEDIR #define LOCALEDIR NULL #endif /* LOCALEDIR */ ! #endif /* ! (HAVE_LOCALE_H && defined(ENABLE_NLS) && ENABLE_LS > 0) */ ! #define _(msgid) gettext(msgid) ! #define N_(msgid) msgid #ifdef HAVE_LOCALE_H #include --- 49,63 ---- #include #include ! #include "gettext.h" ! #define _(msgid) gettext(msgid) ! #define N_(msgid) msgid ! ! #if ! (defined(HAVE_LIBINTL_H) && defined(ENABLE_NLS) && ENABLE_NLS > 0) #ifndef LOCALEDIR #define LOCALEDIR NULL #endif /* LOCALEDIR */ ! #endif #ifdef HAVE_LOCALE_H #include *************** *** 82,87 **** --- 76,87 ---- #ifdef HAVE_SIGNUM_H #include #endif + #if defined(HAVE_MBRLEN) && defined(HAVE_MBRTOWC) && defined(HAVE_WCHAR_H) && defined(HAVE_WCTYPE_H) + /* We can handle multibyte strings. */ + #define MBS_SUPPORT + #include + #include + #endif /* ----------------- System dependencies (with more includes) -----------*/ *************** *** 116,124 **** #define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper ((unsigned char) c)) #define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit ((unsigned char) c)) #define TOUPPER(c) toupper((unsigned char) c) #define TOLOWER(c) tolower((unsigned char) c) ! #ifdef __STDC__ #define P(s) s --- 116,127 ---- #define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper ((unsigned char) c)) #define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit ((unsigned char) c)) + #ifndef TOUPPER #define TOUPPER(c) toupper((unsigned char) c) + #endif + #ifndef TOLOWER #define TOLOWER(c) tolower((unsigned char) c) ! #endif #ifdef __STDC__ #define P(s) s *************** *** 139,144 **** --- 142,151 ---- #include /* avoid in io.c */ #endif /* VMS */ + #if ! defined(S_ISREG) && defined(S_IFREG) + #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) + #endif + #ifdef STDC_HEADERS #include #else /* not STDC_HEADERS */ *************** *** 169,175 **** #include #endif /* atarist || VMS */ ! #if ! defined(MSDOS) && ! defined(OS2) && ! defined(WIN32) #define O_BINARY 0 #endif --- 176,182 ---- #include #endif /* atarist || VMS */ ! #if ! defined(MSDOS) && ! defined(OS2) && ! defined(WIN32) && ! defined(__EMX__) && ! defined(O_BINARY) /*duh*/ #define O_BINARY 0 #endif *************** *** 368,373 **** --- 375,381 ---- Node_cond_exp, /* lnode is conditonal, rnode is if_branches */ Node_regex, /* a regexp, text, compiled, flags, etc */ + Node_dynregex, /* a dynamic regexp */ Node_hashnode, /* an identifier in the symbol table */ Node_ahash, /* an array element */ Node_array_ref, /* array passed by ref as parameter */ *************** *** 641,646 **** --- 649,660 ---- extern int do_tidy_mem; extern int in_begin_rule; extern int in_end_rule; + extern int whiny_users; + + #if defined (HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0 + extern GETGROUPS_T *groupset; + extern int ngroups; + #endif extern const char *myname; *************** *** 730,749 **** #ifdef HAVE_STRINGIZE #define emalloc(var,ty,x,str) (void)((var=(ty)malloc((MALLOC_ARG_T)(x))) ||\ ! (fatal("%s: %s: can't allocate memory (%s)",\ ! (str), #var, strerror(errno)),0)) #define erealloc(var,ty,x,str) (void)((var=(ty)realloc((char *)var,\ (MALLOC_ARG_T)(x))) ||\ ! (fatal("%s: %s: can't allocate memory (%s)",\ ! (str), #var, strerror(errno)),0)) #else /* HAVE_STRINGIZE */ #define emalloc(var,ty,x,str) (void)((var=(ty)malloc((MALLOC_ARG_T)(x))) ||\ ! (fatal("%s: %s: can't allocate memory (%s)",\ ! (str), "var", strerror(errno)),0)) #define erealloc(var,ty,x,str) (void)((var=(ty)realloc((char *)var,\ (MALLOC_ARG_T)(x))) ||\ ! (fatal("%s: %s: can't allocate memory (%s)",\ ! (str), "var", strerror(errno)),0)) #endif /* HAVE_STRINGIZE */ #ifdef GAWKDEBUG --- 744,763 ---- #ifdef HAVE_STRINGIZE #define emalloc(var,ty,x,str) (void)((var=(ty)malloc((MALLOC_ARG_T)(x))) ||\ ! (fatal(_("%s: %s: can't allocate %d bytes of memory (%s)"),\ ! (str), #var, x, strerror(errno)),0)) #define erealloc(var,ty,x,str) (void)((var=(ty)realloc((char *)var,\ (MALLOC_ARG_T)(x))) ||\ ! (fatal(_("%s: %s: can't allocate %d bytes of memory (%s)"),\ ! (str), #var, x, strerror(errno)),0)) #else /* HAVE_STRINGIZE */ #define emalloc(var,ty,x,str) (void)((var=(ty)malloc((MALLOC_ARG_T)(x))) ||\ ! (fatal(_("%s: %s: can't allocate %d bytes of memory (%s)"),\ ! (str), "var", x, strerror(errno)),0)) #define erealloc(var,ty,x,str) (void)((var=(ty)realloc((char *)var,\ (MALLOC_ARG_T)(x))) ||\ ! (fatal(_("%s: %s: can't allocate %d bytes of memory (%s)"),\ ! (str), "var", x, strerror(errno)),0)) #endif /* HAVE_STRINGIZE */ #ifdef GAWKDEBUG *************** *** 852,858 **** --- 866,877 ---- extern NODE *do_strtonum P((NODE *tree)); extern AWKNUM nondec2awknum P((char *str, size_t len)); extern NODE *do_dcgettext P((NODE *tree)); + extern NODE *do_dcngettext P((NODE *tree)); extern NODE *do_bindtextdomain P((NODE *tree)); + #ifdef MBS_SUPPORT + extern int strncasecmpmbs P((const char *, mbstate_t, const char *, + mbstate_t, size_t)); + #endif /* eval.c */ extern int interpret P((NODE *volatile tree)); extern NODE *r_tree_eval P((NODE *tree, int iscond)); diff -crN gawk-3.1.0/awkgram.y gawk-3.1.1/awkgram.y *** gawk-3.1.0/awkgram.y Mon Apr 23 10:25:58 2001 --- gawk-3.1.1/awkgram.y Tue Apr 16 14:40:13 2002 *************** *** 3,9 **** */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. --- 3,9 ---- */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. *************** *** 56,61 **** --- 56,62 ---- static int isnoeffect P((NODETYPE t)); static int isassignable P((NODE *n)); static void dumpintlstr P((char *str, size_t len)); + static void dumpintlstr2 P((char *str1, size_t len1, char *str2, size_t len2)); static void count_args P((NODE *n)); enum defref { FUNC_DEFINE, FUNC_USE }; *************** *** 110,115 **** --- 111,117 ---- %type rexpression_list opt_rexpression_list %type expression_list opt_expression_list %type statements statement if_statement opt_param_list + %type simple_stmt opt_simple_stmt %type opt_exp opt_variable regexp %type input_redir output_redir %type print *************** *** 406,429 **** * Check that the body is a `delete a[i]' statement, * and that both the loop var and array names match. */ ! if ($8 != NULL && $8->type == Node_K_delete ! && $8->rnode != NULL ! && ($8->rnode->type == Node_var || $8->rnode->type == Node_param_list) ! && strcmp($3, $8->rnode->var_value->vname) == 0 ! && strcmp($5, $8->lnode->vname) == 0) { ! $8->type = Node_K_delete_loop; ! $$ = $8; } else { $$ = node($8, Node_K_arrayfor, make_for_loop(variable($3, CAN_FREE, Node_var), (NODE *) NULL, variable($5, CAN_FREE, Node_var_array))); } } ! | LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement { $$ = node($12, Node_K_for, (NODE *) make_for_loop($3, $6, $9)); } ! | LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement { $$ = node($11, Node_K_for, (NODE *) make_for_loop($3, (NODE *) NULL, $8)); --- 408,443 ---- * Check that the body is a `delete a[i]' statement, * and that both the loop var and array names match. */ ! if ($8 != NULL && $8->type == Node_K_delete) { ! NODE *arr, *sub; ! ! assert($8->rnode->type == Node_expression_list); ! arr = $8->lnode; /* array var */ ! sub = $8->rnode->lnode; /* index var */ ! ! if ( (arr->type == Node_var ! || arr->type == Node_var_array ! || arr->type == Node_param_list) ! && (sub->type == Node_var || sub->type == Node_param_list) ! && strcmp($3, sub->vname) == 0 ! && strcmp($5, arr->vname) == 0) { ! $8->type = Node_K_delete_loop; ! $$ = $8; ! } ! else ! goto regular_loop; } else { + regular_loop: $$ = node($8, Node_K_arrayfor, make_for_loop(variable($3, CAN_FREE, Node_var), (NODE *) NULL, variable($5, CAN_FREE, Node_var_array))); } } ! | LEX_FOR '(' opt_simple_stmt semi opt_nls exp semi opt_nls opt_simple_stmt r_paren opt_nls statement { $$ = node($12, Node_K_for, (NODE *) make_for_loop($3, $6, $9)); } ! | LEX_FOR '(' opt_simple_stmt semi opt_nls semi opt_nls opt_simple_stmt r_paren opt_nls statement { $$ = node($11, Node_K_for, (NODE *) make_for_loop($3, (NODE *) NULL, $8)); *************** *** 434,467 **** | LEX_CONTINUE statement_term /* similarly */ { $$ = node((NODE *) NULL, Node_K_continue, (NODE *) NULL); } - | print '(' expression_list r_paren output_redir statement_term - { - $$ = node($3, $1, $5); - if ($$->type == Node_K_printf) - count_args($$) - } - | print opt_rexpression_list output_redir statement_term - { - if ($1 == Node_K_print && $2 == NULL) { - static int warned = FALSE; - - $2 = node(node(make_number(0.0), - Node_field_spec, - (NODE *) NULL), - Node_expression_list, - (NODE *) NULL); - - if (do_lint && ! io_allowed && ! warned) { - warned = TRUE; - lintwarn( - _("plain `print' in BEGIN or END rule should probably be `print \"\"'")); - } - } - - $$ = node($2, $1, $3); - if ($$->type == Node_K_printf) - count_args($$) - } | LEX_NEXT statement_term { NODETYPE type; --- 448,453 ---- *************** *** 498,506 **** } opt_exp statement_term { $$ = node($3, Node_K_return, (NODE *) NULL); } ! | LEX_DELETE NAME '[' expression_list ']' statement_term { $$ = node(variable($2, CAN_FREE, Node_var_array), Node_K_delete, $4); } ! | LEX_DELETE NAME statement_term { if (do_lint) lintwarn(_("`delete array' is a gawk extension")); --- 484,532 ---- } opt_exp statement_term { $$ = node($3, Node_K_return, (NODE *) NULL); } ! | simple_stmt statement_term ! ; ! ! /* ! * A simple_stmt exists to satisfy a constraint in the POSIX ! * grammar allowing them to occur as the 1st and 3rd parts ! * in a `for (...;...;...)' loop. This is a historical oddity ! * inherited from Unix awk, not at all documented in the AK&W ! * awk book. We support it, as this was reported as a bug. ! * We don't bother to document it though. So there. ! */ ! simple_stmt ! : print '(' expression_list r_paren output_redir ! { ! $$ = node($3, $1, $5); ! if ($$->type == Node_K_printf) ! count_args($$); ! } ! | print opt_rexpression_list output_redir ! { ! if ($1 == Node_K_print && $2 == NULL) { ! static int warned = FALSE; ! ! $2 = node(node(make_number(0.0), ! Node_field_spec, ! (NODE *) NULL), ! Node_expression_list, ! (NODE *) NULL); ! ! if (do_lint && ! io_allowed && ! warned) { ! warned = TRUE; ! lintwarn( ! _("plain `print' in BEGIN or END rule should probably be `print \"\"'")); ! } ! } ! ! $$ = node($2, $1, $3); ! if ($$->type == Node_K_printf) ! count_args($$); ! } ! | LEX_DELETE NAME '[' expression_list ']' { $$ = node(variable($2, CAN_FREE, Node_var_array), Node_K_delete, $4); } ! | LEX_DELETE NAME { if (do_lint) lintwarn(_("`delete array' is a gawk extension")); *************** *** 514,520 **** } $$ = node(variable($2, CAN_FREE, Node_var_array), Node_K_delete, (NODE *) NULL); } ! | exp statement_term { $$ = $1; } ; --- 540,553 ---- } $$ = node(variable($2, CAN_FREE, Node_var_array), Node_K_delete, (NODE *) NULL); } ! | exp ! { $$ = $1; } ! ; ! ! opt_simple_stmt ! : /* empty */ ! { $$ = NULL; } ! | simple_stmt { $$ = $1; } ; *************** *** 819,825 **** | '-' simp_exp %prec UNARY { ! if ($2->type == Node_val) { $2->numbr = -(force_number($2)); $$ = $2; } else --- 852,858 ---- | '-' simp_exp %prec UNARY { ! if ($2->type == Node_val && ($2->flags & (STR|STRING)) == 0) { $2->numbr = -(force_number($2)); $$ = $2; } else *************** *** 919,924 **** --- 952,958 ---- {"continue", Node_K_continue, LEX_CONTINUE, 0, 0}, {"cos", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_cos}, {"dcgettext", Node_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_dcgettext}, + {"dcngettext", Node_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3)|A(4)|A(5), do_dcngettext}, {"delete", Node_K_delete, LEX_DELETE, NOT_OLD, 0}, {"do", Node_K_do, LEX_DO, NOT_OLD, 0}, {"else", Node_illegal, LEX_ELSE, 0, 0}, *************** *** 969,974 **** --- 1003,1022 ---- {"xor", Node_builtin, LEX_BUILTIN, GAWKX|A(2), do_xor}, }; + #ifdef MBS_SUPPORT + /* Variable containing the current shift state. */ + static mbstate_t cur_mbstate; + /* Ring buffer containing current characters. */ + #define MAX_CHAR_IN_RING_BUFFER 8 + #define RING_BUFFER_SIZE (MAX_CHAR_IN_RING_BUFFER * MB_LEN_MAX) + static char cur_char_ring[RING_BUFFER_SIZE]; + /* Index for ring buffers. */ + static int cur_ring_idx; + /* This macro means that last nextc() return a singlebyte character + or 1st byte of a multibyte character. */ + #define nextc_is_1stbyte (cur_char_ring[cur_ring_idx] == 1) + #endif /* MBS_SUPPORT */ + /* getfname --- return name of a builtin function (for pretty printing) */ const char * *************** *** 1006,1012 **** const char *mesg = NULL; register char *bp, *cp; char *scan; ! char buf[120]; static char end_of_file_line[] = "(END OF FILE)"; errcount++; --- 1054,1061 ---- const char *mesg = NULL; register char *bp, *cp; char *scan; ! char *buf; ! int count; static char end_of_file_line[] = "(END OF FILE)"; errcount++; *************** *** 1033,1043 **** bp = thisline + strlen(thisline); } msg("%.*s", (int) (bp - thisline), thisline); bp = buf; ! cp = buf + sizeof(buf) - 24; /* 24 more than longest msg. input */ if (lexptr != NULL) { scan = thisline; ! while (bp < cp && scan < lexeme) if (*scan++ == '\t') *bp++ = '\t'; else --- 1082,1105 ---- bp = thisline + strlen(thisline); } msg("%.*s", (int) (bp - thisline), thisline); + + #if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__ + va_start(args, m); + if (mesg == NULL) + mesg = m; + #else + va_start(args); + if (mesg == NULL) + mesg = va_arg(args, char *); + #endif + count = (bp - thisline) + strlen(mesg) + 2 + 1; + emalloc(buf, char *, count, "yyerror"); + bp = buf; ! if (lexptr != NULL) { scan = thisline; ! while (scan < lexeme) if (*scan++ == '\t') *bp++ = '\t'; else *************** *** 1045,1062 **** *bp++ = '^'; *bp++ = ' '; } - #if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__ - va_start(args, m); - if (mesg == NULL) - mesg = m; - #else - va_start(args); - if (mesg == NULL) - mesg = va_arg(args, char *); - #endif strcpy(bp, mesg); err("", buf, args); va_end(args); } /* get_src_buf --- read the next buffer of source program */ --- 1107,1116 ---- *bp++ = '^'; *bp++ = ' '; } strcpy(bp, mesg); err("", buf, args); va_end(args); + free(buf); } /* get_src_buf --- read the next buffer of source program */ *************** *** 1237,1242 **** --- 1291,1365 ---- /* nextc --- get the next input character */ + #ifdef MBS_SUPPORT + + static int + nextc() + { + if (MB_CUR_MAX > 1) { + /* Update the buffer index. */ + cur_ring_idx = (cur_ring_idx == RING_BUFFER_SIZE - 1)? 0 : + cur_ring_idx + 1; + + /* Did we already check the current character? */ + if (cur_char_ring[cur_ring_idx] == 0) { + /* No, we need to check the next character on the buffer. */ + int idx, work_ring_idx = cur_ring_idx; + mbstate_t tmp_state; + size_t mbclen; + + if (!lexptr || lexptr >= lexend) + if (!get_src_buf()) { + return EOF; + } + + for (idx = 0 ; lexptr + idx < lexend ; idx++) { + tmp_state = cur_mbstate; + mbclen = mbrlen(lexptr, idx + 1, &tmp_state); + + if (mbclen == 1 || mbclen == (size_t)-1 || mbclen == 0) { + /* It is a singlebyte character, non-complete multibyte + character or EOF. We treat it as a singlebyte + character. */ + cur_char_ring[work_ring_idx] = 1; + break; + } else if (mbclen == (size_t)-2) { + /* It is not a complete multibyte character. */ + cur_char_ring[work_ring_idx] = idx + 1; + } else { + /* mbclen > 1 */ + cur_char_ring[work_ring_idx] = mbclen; + break; + } + work_ring_idx = (work_ring_idx == RING_BUFFER_SIZE - 1)? + 0 : work_ring_idx + 1; + } + cur_mbstate = tmp_state; + + /* Put a mark on the position on which we write next character. */ + work_ring_idx = (work_ring_idx == RING_BUFFER_SIZE - 1)? + 0 : work_ring_idx + 1; + cur_char_ring[work_ring_idx] = 0; + } + + return (int) (unsigned char) *lexptr++; + } + else { + int c; + + if (lexptr && lexptr < lexend) + c = (int) (unsigned char) *lexptr++; + else if (get_src_buf()) + c = (int) (unsigned char) *lexptr++; + else + c = EOF; + + return c; + } + } + + #else /* MBS_SUPPORT */ + #if GAWKDEBUG int nextc() *************** *** 1259,1268 **** --- 1382,1410 ---- ) #endif + #endif /* MBS_SUPPORT */ + /* pushback --- push a character back on the input */ + #ifdef MBS_SUPPORT + + static void + pushback() + { + if (MB_CUR_MAX > 1) { + cur_ring_idx = (cur_ring_idx == 0)? RING_BUFFER_SIZE - 1 : + cur_ring_idx - 1; + (lexptr && lexptr > lexptr_begin ? lexptr-- : lexptr); + } else + (lexptr && lexptr > lexptr_begin ? lexptr-- : lexptr); + } + + #else + #define pushback() (lexptr && lexptr > lexptr_begin ? lexptr-- : lexptr) + #endif /* MBS_SUPPORT */ + /* allow_newline --- allow newline after &&, ||, ? and : */ static void *************** *** 1317,1323 **** return 0; } pushback(); ! #ifdef OS2 /* * added for OS/2's extproc feature of cmd.exe * (like #! in BSD sh) --- 1459,1465 ---- return 0; } pushback(); ! #if defined OS2 || defined __EMX__ /* * added for OS/2's extproc feature of cmd.exe * (like #! in BSD sh) *************** *** 1352,1357 **** --- 1494,1502 ---- tok = tokstart; for (;;) { c = nextc(); + #ifdef MBS_SUPPORT + if (MB_CUR_MAX == 1 || nextc_is_1stbyte) + #endif switch (c) { case '[': /* one day check for `.' and `=' too */ *************** *** 1409,1414 **** --- 1554,1562 ---- tok = tokstart; yylval.nodetypeval = Node_illegal; + #ifdef MBS_SUPPORT + if (MB_CUR_MAX == 1 || nextc_is_1stbyte) + #endif switch (c) { case EOF: if (lasttok != NEWLINE) { *************** *** 1650,1655 **** --- 1798,1806 ---- yyerror(_("unterminated string")); exit(1); } + #ifdef MBS_SUPPORT + if (MB_CUR_MAX == 1 || nextc_is_1stbyte) + #endif if (c == '\\') { c = nextc(); if (c == '\n') { *************** *** 1779,1787 **** eof_warned = TRUE; } tokadd('\0'); ! if (! do_traditional && isnondecimal(tokstart)) yylval.nodeval = make_number(nondec2awknum(tokstart, strlen(tokstart))); ! else yylval.nodeval = make_number(atof(tokstart)); yylval.nodeval->flags |= PERM; return lasttok = YNUMBER; --- 1930,1944 ---- eof_warned = TRUE; } tokadd('\0'); ! if (! do_traditional && isnondecimal(tokstart)) { ! static short warned = FALSE; ! if (do_lint && ! warned) { ! warned = TRUE; ! lintwarn("numeric constant `%.*s' treated as octal or hexadecimal", ! strlen(tokstart)-1, tokstart); ! } yylval.nodeval = make_number(nondec2awknum(tokstart, strlen(tokstart))); ! } else yylval.nodeval = make_number(atof(tokstart)); yylval.nodeval->flags |= PERM; return lasttok = YNUMBER; *************** *** 1816,1822 **** exit(1); } ! if (! do_traditional && c == '_') { if ((c = nextc()) == '"') { intlstr = TRUE; goto string; --- 1973,1993 ---- exit(1); } ! /* ! * Lots of fog here. Consider: ! * ! * print "xyzzy"$_"foo" ! * ! * Without the check for ` lasttok != '$'' ', this is parsed as ! * ! * print "xxyzz" $(_"foo") ! * ! * With the check, it is "correctly" parsed as three ! * string concatenations. Sigh. This seems to be ! * "more correct", but this is definitely one of those ! * occasions where the interactions are funny. ! */ ! if (! do_traditional && c == '_' && lasttok != '$') { if ((c = nextc()) == '"') { intlstr = TRUE; goto string; *************** *** 1953,1959 **** /* traverse expression list to see how many args. given */ for (n = subn; n != NULL; n = n->rnode) { nexp++; ! if (nexp > 3) break; } --- 2124,2130 ---- /* traverse expression list to see how many args. given */ for (n = subn; n != NULL; n = n->rnode) { nexp++; ! if (nexp > 5) break; } *************** *** 2047,2054 **** /* don't dump it, the lexer already did */ else dumpintlstr(str->stptr, str->stlen); ! } r->subnode = subn; if (r->proc == do_sprintf) { --- 2218,2238 ---- /* don't dump it, the lexer already did */ else dumpintlstr(str->stptr, str->stlen); ! } else if (do_intl /* --gen-po */ ! && r->proc == do_dcngettext /* dcngettext(...) */ ! && subn->lnode->type == Node_val /* 1st arg is constant */ ! && (subn->lnode->flags & STR) != 0 /* it's a string constant */ ! && subn->rnode->lnode->type == Node_val /* 2nd arg is constant too */ ! && (subn->rnode->lnode->flags & STR) != 0) { /* it's a string constant */ ! /* ala xgettext, dcngettext("some string", "some plural" ...) dumps the string */ ! NODE *str1 = subn->lnode; ! NODE *str2 = subn->rnode->lnode; + if (((str1->flags | str2->flags) & INTLSTR) != 0) + warning(_("use of dcngettext(_\"...\") is incorrect: remove leading underscore")); + else + dumpintlstr2(str1->stptr, str1->stlen, str2->stptr, str2->stlen); + } r->subnode = subn; if (r->proc == do_sprintf) { *************** *** 2726,2732 **** return exp; getnode(n); ! n->type = Node_regex; n->re_exp = exp; n->re_text = NULL; n->re_reg = NULL; --- 2910,2916 ---- return exp; getnode(n); ! n->type = Node_dynregex; n->re_exp = exp; n->re_text = NULL; n->re_reg = NULL; *************** *** 2828,2834 **** NODE * stopme(NODE *tree) { ! return tmp_number((AWKNUM) 0.0); } /* dumpintlstr --- write out an initial .po file entry for the string */ --- 3012,3018 ---- NODE * stopme(NODE *tree) { ! return 0; } /* dumpintlstr --- write out an initial .po file entry for the string */ *************** *** 2848,2857 **** } printf("msgid "); - fflush(stdout); pp_string_fp(stdout, str, len, '"', TRUE); putchar('\n'); printf("msgstr \"\"\n\n"); } /* count_args --- count the number of printf arguments */ --- 3032,3067 ---- } printf("msgid "); pp_string_fp(stdout, str, len, '"', TRUE); putchar('\n'); printf("msgstr \"\"\n\n"); + fflush(stdout); + } + + /* dumpintlstr2 --- write out an initial .po file entry for the string and its plural */ + + static void + dumpintlstr2(char *str1, size_t len1, char *str2, size_t len2) + { + char *cp; + + /* See the GNU gettext distribution for details on the file format */ + + if (source != NULL) { + /* ala the gettext sources, remove leading `./'s */ + for (cp = source; cp[0] == '.' && cp[1] == '/'; cp += 2) + continue; + printf("#: %s:%d\n", cp, sourceline); + } + + printf("msgid "); + pp_string_fp(stdout, str1, len1, '"', TRUE); + putchar('\n'); + printf("msgid_plural "); + pp_string_fp(stdout, str2, len2, '"', TRUE); + putchar('\n'); + printf("msgstr[0] \"\"\nmsgstr[1] \"\"\n\n"); + fflush(stdout); } /* count_args --- count the number of printf arguments */ diff -crN gawk-3.1.0/awklib/ChangeLog gawk-3.1.1/awklib/ChangeLog *** gawk-3.1.0/awklib/ChangeLog Sun Jun 3 13:05:33 2001 --- gawk-3.1.1/awklib/ChangeLog Wed May 1 16:41:52 2002 *************** *** 1,3 **** --- 1,15 ---- + Wed May 1 16:41:32 2002 Arnold D. Robbins + + * Release 3.1.1: Release tar file made. + + Wed Apr 17 15:20:27 2002 Arnold D. Robbins + + * Makefile.am (clean): Add *.exe to list of files to be cleaned. + + 2002-01-27 Bruno Haible + + * eg/lib/libintl.awk (dcngettext): New function. + Sun Jun 3 13:04:44 2001 Arnold D. Robbins * Release 3.1.0: Release tar file made. And there was diff -crN gawk-3.1.0/awklib/Makefile.am gawk-3.1.1/awklib/Makefile.am *** gawk-3.1.0/awklib/Makefile.am Tue Feb 27 11:53:18 2001 --- gawk-3.1.1/awklib/Makefile.am Wed Apr 17 15:20:19 2002 *************** *** 1,7 **** # # awklib/Makefile.am --- automake input file for gawk # ! # Copyright (C) 1995-2001 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. --- 1,7 ---- # # awklib/Makefile.am --- automake input file for gawk # ! # Copyright (C) 1995-2002 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. *************** *** 49,55 **** rm -f $(DESTDIR)$(bindir)/igawk clean-local: ! rm -f $(AUXAWK) igawk stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi rm -fr eg stamp-eg --- 49,55 ---- rm -f $(DESTDIR)$(bindir)/igawk clean-local: ! rm -f $(AUXAWK) igawk *.exe stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi rm -fr eg stamp-eg *************** *** 57,66 **** @echo 'some makes are stupid and will not check a directory' > stamp-eg @echo 'against a file, so this file is a place holder. gack.' >> stamp-eg ! pwcat: $(srcdir)/eg/lib/pwcat.c $(CC) $(CFLAGS) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@ ! grcat: $(srcdir)/eg/lib/grcat.c $(CC) $(CFLAGS) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@ igawk: $(srcdir)/eg/prog/igawk.sh --- 57,66 ---- @echo 'some makes are stupid and will not check a directory' > stamp-eg @echo 'against a file, so this file is a place holder. gack.' >> stamp-eg ! pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c $(CC) $(CFLAGS) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@ ! grcat$(EXEEXT): $(srcdir)/eg/lib/grcat.c $(CC) $(CFLAGS) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@ igawk: $(srcdir)/eg/prog/igawk.sh diff -crN gawk-3.1.0/awklib/Makefile.in gawk-3.1.1/awklib/Makefile.in *** gawk-3.1.0/awklib/Makefile.in Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/awklib/Makefile.in Mon Apr 29 17:37:02 2002 *************** *** 0 **** --- 1,428 ---- + # 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@ + + # + # awklib/Makefile.am --- automake input file for gawk + # + # Copyright (C) 1995-2002 the Free Software Foundation, Inc. + # + # This file is part of GAWK, the GNU implementation of the + # AWK Programming Language. + # + # GAWK 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. + # + # GAWK 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 + # + + SHELL = @SHELL@ + + srcdir = @srcdir@ + top_srcdir = @top_srcdir@ + VPATH = @srcdir@ + prefix = @prefix@ + exec_prefix = @exec_prefix@ + + bindir = @bindir@ + sbindir = @sbindir@ + 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@ + CATOBJEXT = @CATOBJEXT@ + CC = @CC@ + CFLAGS = @CFLAGS@ + CPP = @CPP@ + DATADIRNAME = @DATADIRNAME@ + DEPDIR = @DEPDIR@ + EXEEXT = @EXEEXT@ + GENCAT = @GENCAT@ + GLIBC21 = @GLIBC21@ + GMSGFMT = @GMSGFMT@ + HAVE_LIB = @HAVE_LIB@ + INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ + INSTOBJEXT = @INSTOBJEXT@ + INTLBISON = @INTLBISON@ + INTLLIBS = @INTLLIBS@ + INTLOBJS = @INTLOBJS@ + INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ + LIB = @LIB@ + LIBICONV = @LIBICONV@ + LIBINTL = @LIBINTL@ + LN_S = @LN_S@ + LTLIB = @LTLIB@ + LTLIBICONV = @LTLIBICONV@ + LTLIBINTL = @LTLIBINTL@ + MKINSTALLDIRS = @MKINSTALLDIRS@ + OBJEXT = @OBJEXT@ + PACKAGE = @PACKAGE@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + POSUB = @POSUB@ + RANLIB = @RANLIB@ + SOCKET_LIBS = @SOCKET_LIBS@ + U = @U@ + USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ + USE_NLS = @USE_NLS@ + VERSION = @VERSION@ + YACC = @YACC@ + am__include = @am__include@ + am__quote = @am__quote@ + install_sh = @install_sh@ + libexecdir = @libexecdir@/awk + + datadir = @datadir@/awk + + EXTRA_DIST = ChangeLog extract.awk eg stamp-eg + + bin_SCRIPTS = igawk + libexec_PROGRAMS = pwcat grcat + AUXAWK = passwd.awk group.awk + nodist_grcat_SOURCES = grcat.c + nodist_pwcat_SOURCES = pwcat.c + subdir = awklib + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = $(top_builddir)/config.h + CONFIG_CLEAN_FILES = + libexec_PROGRAMS = pwcat$(EXEEXT) grcat$(EXEEXT) + PROGRAMS = $(libexec_PROGRAMS) + + nodist_grcat_OBJECTS = grcat.$(OBJEXT) + grcat_OBJECTS = $(nodist_grcat_OBJECTS) + grcat_LDADD = $(LDADD) + grcat_DEPENDENCIES = + grcat_LDFLAGS = + nodist_pwcat_OBJECTS = pwcat.$(OBJEXT) + pwcat_OBJECTS = $(nodist_pwcat_OBJECTS) + pwcat_LDADD = $(LDADD) + pwcat_DEPENDENCIES = + pwcat_LDFLAGS = + SCRIPTS = $(bin_SCRIPTS) + + + DEFS = @DEFS@ + DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) + CPPFLAGS = @CPPFLAGS@ + LDFLAGS = @LDFLAGS@ + LIBS = @LIBS@ + depcomp = $(SHELL) $(top_srcdir)/depcomp + @AMDEP_TRUE@DEP_FILES = $(DEPDIR)/grcat.Po $(DEPDIR)/pwcat.Po + COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + CCLD = $(CC) + LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + DIST_SOURCES = + DIST_COMMON = ChangeLog Makefile.am Makefile.in + SOURCES = $(nodist_grcat_SOURCES) $(nodist_pwcat_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 awklib/Makefile + Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status + install-libexecPROGRAMS: $(libexec_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libexecdir) + @list='$(libexec_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)$(libexecdir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$f; \ + else :; fi; \ + done + + uninstall-libexecPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(libexecdir)/$$f"; \ + rm -f $(DESTDIR)$(libexecdir)/$$f; \ + done + + clean-libexecPROGRAMS: + -test -z "$(libexec_PROGRAMS)" || rm -f $(libexec_PROGRAMS) + install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_SCRIPTS)'; for p in $$list; do \ + f="`echo $$p|sed '$(transform)'`"; \ + if test -f $$p; then \ + echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/$$f; \ + elif test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/$$f; \ + else :; fi; \ + done + + uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(bin_SCRIPTS)'; for p in $$list; do \ + f="`echo $$p|sed '$(transform)'`"; \ + echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ + rm -f $(DESTDIR)$(bindir)/$$f; \ + done + + mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + + distclean-compile: + -rm -f *.tab.c + + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/grcat.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pwcat.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@ + 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 $(PROGRAMS) $(SCRIPTS) + + installdirs: + $(mkinstalldirs) $(DESTDIR)$(libexecdir) $(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-generic clean-libexecPROGRAMS clean-local mostlyclean-am + + distclean: distclean-am + + distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-tags + + dvi: dvi-am + + dvi-am: + + info: info-am + + info-am: + + install-data-am: + + install-exec-am: install-binSCRIPTS install-libexecPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + + 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 + + uninstall-am: uninstall-binSCRIPTS uninstall-info-am \ + uninstall-libexecPROGRAMS uninstall-local + + .PHONY: GTAGS all all-am check check-am clean clean-generic \ + clean-libexecPROGRAMS clean-local distclean distclean-compile \ + distclean-depend distclean-generic distclean-tags distdir dvi \ + dvi-am info info-am install install-am install-binSCRIPTS \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-libexecPROGRAMS \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic tags \ + uninstall uninstall-am uninstall-binSCRIPTS uninstall-info-am \ + uninstall-libexecPROGRAMS uninstall-local + + + all: stamp-eg $(AUXPROGS) igawk $(AUXAWK) + + install-exec-hook: $(AUXAWK) + $(mkinstalldirs) $(DESTDIR)$(datadir) + for i in $(AUXAWK) $(srcdir)/eg/lib/*.awk ; do \ + progname=`echo $$i | sed 's;.*/;;'` ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(datadir)/$$progname ; \ + done + + # libexecdir and datadir are removed in the top level Makefile's uninstall + uninstall-local: + rm -fr $(DESTDIR)$(libexecdir)/* $(DESTDIR)$(datadir)/* + rm -f $(DESTDIR)$(bindir)/igawk + + clean-local: + rm -f $(AUXAWK) igawk *.exe + + stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi + rm -fr eg stamp-eg + $(AWK) -f $(srcdir)/extract.awk $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi + @echo 'some makes are stupid and will not check a directory' > stamp-eg + @echo 'against a file, so this file is a place holder. gack.' >> stamp-eg + + pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c + $(CC) $(CFLAGS) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@ + + grcat$(EXEEXT): $(srcdir)/eg/lib/grcat.c + $(CC) $(CFLAGS) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@ + + igawk: $(srcdir)/eg/prog/igawk.sh + cp $(srcdir)/eg/prog/igawk.sh $@ ; chmod 755 $@ + + passwd.awk: $(srcdir)/eg/lib/passwdawk.in + (cd $(srcdir)/eg/lib ; \ + sed 's;/usr/local/libexec/awk;$(libexecdir);' < passwdawk.in) > passwd.awk + + group.awk: $(srcdir)/eg/lib/groupawk.in + (cd $(srcdir)/eg/lib ; \ + sed 's;/usr/local/libexec/awk;$(libexecdir);' < groupawk.in) > group.awk + # 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 -crN gawk-3.1.0/awklib/eg/lib/grcat.c gawk-3.1.1/awklib/eg/lib/grcat.c *** gawk-3.1.0/awklib/eg/lib/grcat.c Sun May 13 18:42:06 2001 --- gawk-3.1.1/awklib/eg/lib/grcat.c Mon Apr 22 14:27:33 2002 *************** *** 8,13 **** --- 8,21 ---- * Public Domain */ + /* For OS/2, do nothing. */ + #if HAVE_CONFIG_H + #include + #endif + + #ifndef HAVE_GETPGRENT + int main() { exit(0); } + #else #include #include *************** *** 32,34 **** --- 40,43 ---- endgrent(); exit(0); } + #endif /* HAVE_GETPGRENT */ diff -crN gawk-3.1.0/builtin.c gawk-3.1.1/builtin.c *** gawk-3.1.0/builtin.c Tue Feb 27 12:14:24 2001 --- gawk-3.1.1/builtin.c Tue Apr 16 14:40:31 2002 *************** *** 3,9 **** */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. --- 3,9 ---- */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. *************** *** 204,209 **** --- 204,274 ---- return tmp_number((AWKNUM) status); } + #ifdef MBS_SUPPORT + /* strncasecmpmbs --- like strncasecmp(multibyte string version) */ + int + strncasecmpmbs(const char *s1, mbstate_t mbs1, const char *s2, + mbstate_t mbs2, size_t n) + { + int i1, i2, mbclen1, mbclen2, gap; + wchar_t wc1, wc2; + for (i1 = i2 = 0 ; i1 < n && i2 < n ;i1 += mbclen1, i2 += mbclen2) { + mbclen1 = mbrtowc(&wc1, s1 + i1, n - i1, &mbs1); + if (mbclen1 == (size_t) -1 || mbclen1 == (size_t) -2 || mbclen1 == 0) { + /* We treat it as a singlebyte character. */ + mbclen1 = 1; + wc1 = s1[i1]; + } + mbclen2 = mbrtowc(&wc2, s2 + i2, n - i2, &mbs2); + if (mbclen2 == (size_t) -1 || mbclen2 == (size_t) -2 || mbclen2 == 0) { + /* We treat it as a singlebyte character. */ + mbclen2 = 1; + wc2 = s2[i2]; + } + if ((gap = towlower(wc1) - towlower(wc2)) != 0) + /* s1 and s2 are not equivalent. */ + return gap; + } + /* s1 and s2 are equivalent. */ + return 0; + } + + /* Inspect the buffer `src' and write the index of each byte to `dest'. + Caller must allocate `dest'. + e.g. str = , , a, b, , , , c + where mb(i) means the `i'-th byte of a multibyte character. + dest = 1, 2, 1, 1, 1, 2, 3. 1 + */ + static void + index_multibyte_buffer(char* src, char* dest, int len) + { + int idx, prev_idx; + mbstate_t mbs, prevs; + memset(&prevs, 0, sizeof(mbstate_t)); + + for (idx = prev_idx = 0 ; idx < len ; idx++) { + size_t mbclen; + mbs = prevs; + mbclen = mbrlen(src + prev_idx, idx - prev_idx + 1, &mbs); + if (mbclen == (size_t) -1 || mbclen == 1 || mbclen == 0) { + /* singlebyte character. */ + mbclen = 1; + prev_idx = idx + 1; + } else if (mbclen == (size_t) -2) { + /* a part of a multibyte character. */ + mbclen = idx - prev_idx + 1; + } else if (mbclen > 1) { + /* the end of a multibyte character. */ + prev_idx = idx + 1; + prevs = mbs; + } else { + /* Can't reach. */ + } + dest[idx] = mbclen; + } + } + #endif + /* do_index --- find index of a string */ NODE * *************** *** 213,218 **** --- 278,291 ---- register char *p1, *p2; register size_t l1, l2; long ret; + #ifdef MBS_SUPPORT + size_t mbclen = 0; + mbstate_t mbs1, mbs2; + if (MB_CUR_MAX > 1) { + memset(&mbs1, 0, sizeof(mbstate_t)); + memset(&mbs2, 0, sizeof(mbstate_t)); + } + #endif s1 = tree_eval(tree->lnode); *************** *** 231,241 **** --- 304,341 ---- l2 = s2->stlen; ret = 0; + /* + * Icky special case, index(foo, "") should return 1, + * since both bwk awk and mawk do, and since match("foo", "") + * returns 1. This makes index("", "") work, too, fwiw. + */ + if (l2 == 0) { + ret = 1; + goto out; + } + /* IGNORECASE will already be false if posix */ if (IGNORECASE) { while (l1 > 0) { if (l2 > l1) break; + #ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) { + if (strncasecmpmbs(p1, mbs1, p2, mbs2, l2) == 0) { + ret = 1 + s1->stlen - l1; + break; + } + /* Update l1, and p1. */ + mbclen = mbrlen(p1, l1, &mbs1); + if ((mbclen == 1) || (mbclen == (size_t) -1) + || (mbclen == (size_t) -2) || (mbclen == 0)) { + /* We treat it as a singlebyte character. */ + mbclen = 1; + } + l1 -= mbclen; + p1 += mbclen; + } else { + #endif if (casetable[(unsigned char)*p1] == casetable[(unsigned char)*p2] && (l2 == 1 || strncasecmp(p1, p2, l2) == 0)) { ret = 1 + s1->stlen - l1; *************** *** 243,248 **** --- 343,351 ---- } l1--; p1++; + #ifdef MBS_SUPPORT + } + #endif } } else { while (l1 > 0) { *************** *** 253,262 **** --- 356,382 ---- ret = 1 + s1->stlen - l1; break; } + #ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) { + mbclen = mbrlen(p1, l1, &mbs1); + if ((mbclen == 1) || (mbclen == (size_t) -1) || + (mbclen == (size_t) -2) || (mbclen == 0)) { + /* We treat it as a singlebyte character. */ + mbclen = 1; + } + l1 -= mbclen; + p1 += mbclen; + } else { + l1--; + p1++; + } + #else l1--; p1++; + #endif } } + out: free_temp(s1); free_temp(s2); return tmp_number((AWKNUM) ret); *************** *** 360,366 **** /* copy one byte from 's' to 'obufout' checking for space in the process */ #define bchunk_one(s) { \ ! if (ofre <= 0) { \ long olen = obufout - obuf; \ erealloc(obuf, char *, osiz * 2, "format_tree"); \ ofre += osiz; \ --- 480,486 ---- /* copy one byte from 's' to 'obufout' checking for space in the process */ #define bchunk_one(s) { \ ! if (ofre < 1) { \ long olen = obufout - obuf; \ erealloc(obuf, char *, osiz * 2, "format_tree"); \ ofre += osiz; \ *************** *** 945,958 **** if (toofew) fatal("%s\n\t`%s'\n\t%*s%s", _("not enough arguments to satisfy format string"), ! fmt_string, s1 - fmt_string - 2, "", _("^ ran out for this one")); } if (do_lint) { if (need_format) lintwarn( _("[s]printf: format specifier does not have control letter")); ! if (carg != NULL) lintwarn( _("too many arguments supplied for format string")); } --- 1065,1078 ---- if (toofew) fatal("%s\n\t`%s'\n\t%*s%s", _("not enough arguments to satisfy format string"), ! fmt_string, s1 - fmt_string - 1, "", _("^ ran out for this one")); } if (do_lint) { if (need_format) lintwarn( _("[s]printf: format specifier does not have control letter")); ! if (cur_arg < num_args) lintwarn( _("too many arguments supplied for format string")); } *************** *** 1140,1146 **** if (tree->lnode != NULL) { NODE *tmp = tree_eval(tree->lnode); if (do_lint && (tmp->flags & (STRING|STR)) == 0) ! lintwarn(_("strftime: recieved non-string first argument")); t1 = force_string(tmp); format = t1->stptr; formatlen = t1->stlen; --- 1260,1266 ---- if (tree->lnode != NULL) { NODE *tmp = tree_eval(tree->lnode); if (do_lint && (tmp->flags & (STRING|STR)) == 0) ! lintwarn(_("strftime: received non-string first argument")); t1 = force_string(tmp); format = t1->stptr; formatlen = t1->stlen; *************** *** 1155,1161 **** if (tree->rnode != NULL) { t2 = tree_eval(tree->rnode->lnode); if (do_lint && (t2->flags & (NUM|NUMBER)) == 0) ! lintwarn(_("strftime: recieved non-numeric second argument")); fclock = (time_t) force_number(t2); free_temp(t2); } --- 1275,1281 ---- if (tree->rnode != NULL) { t2 = tree_eval(tree->rnode->lnode); if (do_lint && (t2->flags & (NUM|NUMBER)) == 0) ! lintwarn(_("strftime: received non-numeric second argument")); fclock = (time_t) force_number(t2); free_temp(t2); } *************** *** 1263,1269 **** (void) flush_io(); /* so output is synchronous with gawk's */ tmp = tree_eval(tree->lnode); if (do_lint && (tmp->flags & (STRING|STR)) == 0) ! lintwarn(_("system: recieved non-string argument")); cmd = force_string(tmp)->stptr; if (cmd && *cmd) { --- 1383,1389 ---- (void) flush_io(); /* so output is synchronous with gawk's */ tmp = tree_eval(tree->lnode); if (do_lint && (tmp->flags & (STRING|STR)) == 0) ! lintwarn(_("system: received non-string argument")); cmd = force_string(tmp)->stptr; if (cmd && *cmd) { *************** *** 1380,1393 **** { NODE *t1, *t2; register unsigned char *cp, *cp2; t1 = tree_eval(tree->lnode); if (do_lint && (t1->flags & (STRING|STR)) == 0) ! lintwarn(_("tolower: recieved non-string argument")); t1 = force_string(t1); t2 = tmp_string(t1->stptr, t1->stlen); for (cp = (unsigned char *)t2->stptr, cp2 = (unsigned char *)(t2->stptr + t2->stlen); cp < cp2; cp++) if (ISUPPER(*cp)) *cp = TOLOWER(*cp); free_temp(t1); --- 1500,1541 ---- { NODE *t1, *t2; register unsigned char *cp, *cp2; + #ifdef MBS_SUPPORT + size_t mbclen = 0; + mbstate_t mbs, prev_mbs; + if (MB_CUR_MAX > 1) + memset(&mbs, 0, sizeof(mbstate_t)); + #endif t1 = tree_eval(tree->lnode); if (do_lint && (t1->flags & (STRING|STR)) == 0) ! lintwarn(_("tolower: received non-string argument")); t1 = force_string(t1); t2 = tmp_string(t1->stptr, t1->stlen); for (cp = (unsigned char *)t2->stptr, cp2 = (unsigned char *)(t2->stptr + t2->stlen); cp < cp2; cp++) + #ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) { + wchar_t wc; + prev_mbs = mbs; + mbclen = (size_t) mbrtowc(&wc, cp, cp2 - cp, &mbs); + if ((mbclen != 1) && (mbclen != (size_t) -1) && + (mbclen != (size_t) -2) && (mbclen != 0)) { + /* a multibyte character. */ + if (iswupper(wc)) + { + wc = towlower(wc); + wcrtomb(cp, wc, &prev_mbs); + } + /* Adjust the pointer. */ + cp += mbclen - 1; + } else { + /* Otherwise we treat it as a singlebyte character. */ + if (ISUPPER(*cp)) + *cp = tolower(*cp); + } + } else + #endif if (ISUPPER(*cp)) *cp = TOLOWER(*cp); free_temp(t1); *************** *** 1401,1414 **** { NODE *t1, *t2; register unsigned char *cp, *cp2; t1 = tree_eval(tree->lnode); if (do_lint && (t1->flags & (STRING|STR)) == 0) ! lintwarn(_("toupper: recieved non-string argument")); t1 = force_string(t1); t2 = tmp_string(t1->stptr, t1->stlen); for (cp = (unsigned char *)t2->stptr, cp2 = (unsigned char *)(t2->stptr + t2->stlen); cp < cp2; cp++) if (ISLOWER(*cp)) *cp = TOUPPER(*cp); free_temp(t1); --- 1549,1590 ---- { NODE *t1, *t2; register unsigned char *cp, *cp2; + #ifdef MBS_SUPPORT + size_t mbclen = 0; + mbstate_t mbs, prev_mbs; + if (MB_CUR_MAX > 1) + memset(&mbs, 0, sizeof(mbstate_t)); + #endif t1 = tree_eval(tree->lnode); if (do_lint && (t1->flags & (STRING|STR)) == 0) ! lintwarn(_("toupper: received non-string argument")); t1 = force_string(t1); t2 = tmp_string(t1->stptr, t1->stlen); for (cp = (unsigned char *)t2->stptr, cp2 = (unsigned char *)(t2->stptr + t2->stlen); cp < cp2; cp++) + #ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) { + wchar_t wc; + prev_mbs = mbs; + mbclen = (size_t) mbrtowc(&wc, cp, cp2 - cp, &mbs); + if ((mbclen != 1) && (mbclen != (size_t) -1) && + (mbclen != (size_t) -2) && (mbclen != 0)) { + /* a multibyte character. */ + if (iswlower(wc)) + { + wc = towupper(wc); + wcrtomb(cp, wc, &prev_mbs); + } + /* Adjust the pointer. */ + cp += mbclen - 1; + } else { + /* Otherwise we treat it as a singlebyte character. */ + if (ISLOWER(*cp)) + *cp = toupper(*cp); + } + } else + #endif if (ISLOWER(*cp)) *cp = TOUPPER(*cp); free_temp(t1); *************** *** 1669,1674 **** --- 1845,1853 ---- int global = (how_many == -1); long current; int lastmatchnonzero; + #ifdef MBS_SUPPORT + char *mb_indices; + #endif tmp = tree->lnode; rp = re_update(tmp); *************** *** 1712,1719 **** --- 1891,1918 ---- buf[buflen] = '\0'; buf[buflen + 1] = '\0'; ampersands = 0; + #ifdef MBS_SUPPORT + /* + * Some systems' malloc() can't handle being called with an + * argument of zero. Thus we have to have some special case + * code to check for `repllen == 0'. This can occur for + * something like: + * sub(/foo/, "", mystring) + * for example. + */ + if (MB_CUR_MAX > 1 && repllen > 0) { + emalloc(mb_indices, char *, repllen * sizeof(char), "sub_common"); + index_multibyte_buffer(repl, mb_indices, repllen); + } else + mb_indices = NULL; + #endif for (scan = repl; scan < replend; scan++) { + #ifdef MBS_SUPPORT + if ((MB_CUR_MAX == 1 || (repllen > 0 && mb_indices[scan - repl] == 1)) + && (*scan == '&')) { + #else if (*scan == '&') { + #endif repllen--; ampersands++; } else if (*scan == '\\') { *************** *** 1783,1792 **** --- 1982,2003 ---- * making substitutions as we go. */ for (scan = repl; scan < replend; scan++) + #ifdef MBS_SUPPORT + if ((MB_CUR_MAX == 1 + || (repllen > 0 && mb_indices[scan - repl] == 1)) + && (*scan == '&')) + #else if (*scan == '&') + #endif for (cp = matchstart; cp < matchend; cp++) *bp++ = *cp; + #ifdef MBS_SUPPORT + else if ((MB_CUR_MAX == 1 + || (repllen > 0 && mb_indices[scan - repl] == 1)) + && (*scan == '\\')) { + #else else if (*scan == '\\') { + #endif if (backdigs) { /* gensub, behave sanely */ if (ISDIGIT(scan[1])) { int dig = scan[1] - '0'; *************** *** 1872,1877 **** --- 2083,2092 ---- (*after_assign)(); t->flags &= ~(NUM|NUMBER); } + #ifdef MBS_SUPPORT + if (mb_indices != NULL) + free(mb_indices); + #endif return tmp_number((AWKNUM) matches); } *************** *** 2250,2258 **** tmp = tree_eval(tree->lnode); ! if ((tmp->flags & (NUM|NUMBER)) != 0) ! d = (double) force_number(tmp); ! else if (isnondecimal(tmp->stptr)) d = nondec2awknum(tmp->stptr, tmp->stlen); else d = (double) force_number(tmp); --- 2465,2471 ---- tmp = tree_eval(tree->lnode); ! if (isnondecimal(tmp->stptr)) d = nondec2awknum(tmp->stptr, tmp->stlen); else d = (double) force_number(tmp); *************** *** 2278,2284 **** char *start = str; if (*str == '0' && (str[1] == 'x' || str[1] == 'X')) { ! assert(len > 2); for (str += 2, len -= 2; len > 0; len--, str++) { switch (*str) { --- 2491,2502 ---- char *start = str; if (*str == '0' && (str[1] == 'x' || str[1] == 'X')) { ! /* ! * User called strtonum("0x") or some such, ! * so just quit early. ! */ ! if (len <= 2) ! return (AWKNUM) 0.0; for (str += 2, len -= 2; len > 0; len--, str++) { switch (*str) { *************** *** 2336,2360 **** return retval; } ! /* do_dcgettext --- handle i18n translations */ ! /* ! * awk usage is ! * ! * str = dcgettext(string [, domain [, category]]) ! * ! * Default domain is TEXTDOMAIN, default category is LC_MESSAGES. ! */ ! NODE * ! do_dcgettext(NODE *tree) { - NODE *tmp, *t1, *t2; - char *string; - char *the_result; - #if ENABLE_NLS && HAVE_LC_MESSAGES && HAVE_DCGETTEXT - int lc_cat = -1; - char *category, *domain; static struct category_table { int val; char *name; --- 2554,2566 ---- return retval; } ! /* do_dcgettext, do_dcngettext --- handle i18n translations */ ! #if ENABLE_NLS && HAVE_LC_MESSAGES && HAVE_DCGETTEXT ! static int ! localecategory_from_argument(NODE *tree) { static struct category_table { int val; char *name; *************** *** 2384,2410 **** { LC_TIME, "LC_TIME" }, #endif /* LC_TIME */ }; - #endif /* ENABLE_NLS */ - tmp = tree->lnode; /* first argument */ - t1 = force_string(tree_eval(tmp)); - string = t1->stptr; - - t2 = NULL; - #if ENABLE_NLS && HAVE_LC_MESSAGES && HAVE_DCGETTEXT - tree = tree->rnode; /* second argument */ if (tree != NULL) { - tmp = tree->lnode; - t2 = force_string(tree_eval(tmp)); - domain = t2->stptr; - } else - domain = TEXTDOMAIN; - - if (tree != NULL && tree->rnode != NULL) { /* third argument */ int low, high, i, mid; ! NODE *t; - tree = tree->rnode; tmp = tree->lnode; t = force_string(tree_eval(tmp)); category = t->stptr; --- 2590,2602 ---- { LC_TIME, "LC_TIME" }, #endif /* LC_TIME */ }; if (tree != NULL) { int low, high, i, mid; ! NODE *tmp, *t; ! char *category; ! int lc_cat = -1; tmp = tree->lnode; t = force_string(tree_eval(tmp)); category = t->stptr; *************** *** 2429,2434 **** --- 2621,2669 ---- fatal(_("dcgettext: `%s' is not a valid locale category"), category); free_temp(t); + return lc_cat; + } else + return LC_MESSAGES; + } + + #endif + + /* + * awk usage is + * + * str = dcgettext(string [, domain [, category]]) + * str = dcngettext(string1, string2, number [, domain [, category]]) + * + * Default domain is TEXTDOMAIN, default category is LC_MESSAGES. + */ + + NODE * + do_dcgettext(NODE *tree) + { + NODE *tmp, *t1, *t2; + char *string; + char *the_result; + #if ENABLE_NLS && HAVE_LC_MESSAGES && HAVE_DCGETTEXT + int lc_cat; + char *domain; + #endif /* ENABLE_NLS */ + + tmp = tree->lnode; /* first argument */ + t1 = force_string(tree_eval(tmp)); + string = t1->stptr; + + t2 = NULL; + #if ENABLE_NLS && HAVE_LC_MESSAGES && HAVE_DCGETTEXT + tree = tree->rnode; /* second argument */ + if (tree != NULL) { + tmp = tree->lnode; + t2 = force_string(tree_eval(tmp)); + domain = t2->stptr; + } else + domain = TEXTDOMAIN; + + if (tree && tree->rnode != NULL) { /* third argument */ + lc_cat = localecategory_from_argument(tree->rnode); } else lc_cat = LC_MESSAGES; *************** *** 2443,2448 **** --- 2678,2733 ---- return tmp_string(the_result, strlen(the_result)); } + NODE * + do_dcngettext(NODE *tree) + { + NODE *tmp, *t1, *t2, *t3; + char *string1, *string2; + long number; + char *the_result; + #if ENABLE_NLS && HAVE_LC_MESSAGES && HAVE_DCGETTEXT + int lc_cat; + char *domain; + #endif /* ENABLE_NLS */ + + tmp = tree->lnode; /* first argument */ + t1 = force_string(tree_eval(tmp)); + string1 = t1->stptr; + + tmp = tree->rnode->lnode; /* second argument */ + t2 = force_string(tree_eval(tmp)); + string2 = t2->stptr; + + tmp = tree->rnode->rnode->lnode; /* third argument */ + number = (long) double_to_int(force_number(tree_eval(tmp))); + + t3 = NULL; + #if ENABLE_NLS && HAVE_LC_MESSAGES && HAVE_DCGETTEXT + tree = tree->rnode->rnode->rnode; /* fourth argument */ + if (tree != NULL) { + tmp = tree->lnode; + t3 = force_string(tree_eval(tmp)); + domain = t3->stptr; + } else + domain = TEXTDOMAIN; + + if (tree && tree->rnode != NULL) { /* fifth argument */ + lc_cat = localecategory_from_argument(tree->rnode); + } else + lc_cat = LC_MESSAGES; + + the_result = dcngettext(domain, string1, string2, number, lc_cat); + #else + the_result = (number == 1 ? string1 : string2); + #endif + free_temp(t1); + free_temp(t2); + if (t3 != NULL) + free_temp(t3); + + return tmp_string(the_result, strlen(the_result)); + } + /* do_bindtextdomain --- set the directory for a text domain */ /* *************** *** 2482,2488 **** free_temp(t1); if (t2 != NULL) ! free_temp(t1); return tmp_string(the_result, strlen(the_result)); } --- 2767,2773 ---- free_temp(t1); if (t2 != NULL) ! free_temp(t2); return tmp_string(the_result, strlen(the_result)); } diff -crN gawk-3.1.0/config.guess gawk-3.1.1/config.guess *** gawk-3.1.0/config.guess Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/config.guess Sun Apr 28 17:08:33 2002 *************** *** 0 **** --- 1,1321 ---- + #! /bin/sh + # Attempt to guess a canonical system name. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + # 2000, 2001, 2002 Free Software Foundation, Inc. + + timestamp='2002-03-20' + + # 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. + + # Originally written by Per Bothner . + # Please send patches to . Submit a context + # diff and a properly formatted ChangeLog entry. + # + # 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 c99 ; 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. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + 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 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-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 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_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;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + 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=`(sed 1q /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 ;; + # 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 ;; + 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) + eval $set_cc_for_build + 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 + $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 + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } + EOF + $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 | sed 1q | 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]) + 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" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + 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 + (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:*:*) + eval $set_cc_for_build + 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 + $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 ;; + 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*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 ;; + 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 ;; + 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 ;; + 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 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + 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-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + ;; + 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. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C 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 + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + 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 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*: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]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[GKLNPTVW]: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 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + 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 + + eval $set_cc_for_build + 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 + + $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 -crN gawk-3.1.0/config.rpath gawk-3.1.1/config.rpath *** gawk-3.1.0/config.rpath Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/config.rpath Sun Apr 28 17:01:51 2002 *************** *** 0 **** --- 1,513 ---- + #! /bin/sh + # Output a system dependent set of variables, describing how to set the + # run time search path of shared libraries in an executable. + # + # Copyright 1996-2002 Free Software Foundation, Inc. + # Taken from GNU libtool, 2001 + # Originally by Gordon Matzigkeit , 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 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. + # + # The first argument passed to this file is the canonical host specification, + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM + # or + # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM + # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld + # should be set by the caller. + # + # The set of defined variables is at the end of this script. + + # All known linkers require a `.a' archive for static linking (except M$VC, + # which needs '.lib'). + libext=a + shlibext= + + host="$1" + host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + wl= + if test "$GCC" = yes; then + wl='-Wl,' + else + case "$host_os" in + aix3* | aix4* | aix5*) + wl='-Wl,' + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6*) + wl='-Wl,' + ;; + linux*) + echo '__INTEL_COMPILER' > conftest.$ac_ext + if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null + then + : + else + # Intel icc + wl='-Qoption,ld,' + fi + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + solaris*) + wl='-Wl,' + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + if test "x$host_vendor" = xsni; then + wl='-LD' + else + wl='-Wl,' + fi + ;; + esac + fi + + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_direct=no + hardcode_minus_L=no + + case "$host_os" in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + case "$host_os" in + aix3* | aix4* | aix5*) + # On AIX, the GNU linker is very broken + ld_shlibs=no + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can use + # them. + ld_shlibs=no + ;; + beos*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + ;; + solaris* | sysv5*) + if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + fi + else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + esac + fi + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' + fi + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + hardcode_direct=yes + ;; + freebsd1*) + ld_shlibs=no + ;; + freebsd2.2*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + freebsd2*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9* | hpux10* | hpux11*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_minus_L=yes # Not in the search PATH, but as the default + # location of the library. + ;; + irix5* | irix6*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + openbsd*) + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + sco3.2v5*) + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + if test "x$host_vendor" = xsno; then + hardcode_direct=yes # is this really true??? + else + hardcode_direct=no # Motorola manual says yes, but my tests say they lie + fi + ;; + sysv4.3*) + ;; + sysv5*) + hardcode_libdir_flag_spec= + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4.2uw2*) + hardcode_direct=yes + hardcode_minus_L=no + ;; + sysv5uw7* | unixware7*) + ;; + *) + ld_shlibs=no + ;; + esac + fi + + # Check dynamic linker characteristics + libname_spec='lib$name' + sys_lib_dlsearch_path_spec="/lib /usr/lib" + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + case "$host_os" in + aix3*) + shlibext=so + ;; + aix4* | aix5*) + shlibext=so + ;; + amigaos*) + shlibext=ixlibrary + ;; + beos*) + shlibext=so + ;; + bsdi4*) + shlibext=so + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + ;; + cygwin* | mingw* | pw32*) + case $GCC,$host_os in + yes,cygwin*) + shlibext=dll.a + ;; + yes,mingw*) + shlibext=dll + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` + ;; + yes,pw32*) + shlibext=dll + ;; + *) + shlibext=dll + ;; + esac + ;; + darwin* | rhapsody*) + shlibext=dylib + ;; + freebsd1*) + ;; + freebsd*) + shlibext=so + ;; + gnu*) + shlibext=so + ;; + hpux9* | hpux10* | hpux11*) + shlibext=sl + ;; + irix5* | irix6*) + shlibext=so + case "$host_os" in + irix5*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 ") libsuff= shlibsuff= ;; + *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + ;; + linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) + ;; + linux-gnu*) + shlibext=so + ;; + netbsd*) + shlibext=so + ;; + newsos6) + shlibext=so + ;; + openbsd*) + shlibext=so + ;; + os2*) + libname_spec='$name' + shlibext=dll + ;; + osf3* | osf4* | osf5*) + shlibext=so + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + sco3.2v5*) + shlibext=so + ;; + solaris*) + shlibext=so + ;; + sunos4*) + shlibext=so + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + shlibext=so + case "$host_vendor" in + motorola) + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + uts4*) + shlibext=so + ;; + dgux*) + shlibext=so + ;; + sysv4*MP*) + if test -d /usr/nec; then + shlibext=so + fi + ;; + esac + + sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` + escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + + sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. Submit a context + # diff and a properly formatted ChangeLog entry. + # + # 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-* | rtmk-nova*) + 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] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[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 \ + | mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el | mips64vr4300 \ + | mips64vr4300el | mips64vr5000 | mips64vr5000el \ + | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ + | mipsisa32 | mipsisa64 \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | 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]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | clipper-* | 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[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ + | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ + | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | 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 + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + 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 | j90) + basic_machine=j90-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 + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + 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 + ;; + 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 + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + 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 + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + 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 | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i686-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + 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 + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs | simso-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 + ;; + t3d) + basic_machine=alpha-cray + os=-unicos + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + 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 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + 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 + ;; + 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 + ;; + sh64) + basic_machine=sh64-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* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* ) + # 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 + ;; + -atheos*) + os=-atheos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -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 + ;; + # This must come before the *-dec entry. + 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 + ;; + or32-*) + os=-coff + ;; + *-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* | -windiss*) + 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 -crN gawk-3.1.0/configh.in gawk-3.1.1/configh.in *** gawk-3.1.0/configh.in Tue Feb 27 12:18:34 2001 --- gawk-3.1.1/configh.in Tue Apr 16 13:29:06 2002 *************** *** 142,147 **** --- 142,149 ---- #undef DYNAMIC /* allow dynamic addition of builtins */ #undef STRTOD_NOT_C89 /* strtod doesn't have C89 semantics */ #undef ssize_t /* signed version of size_t */ + #undef USE_INCLUDED_STRFTIME /* force use of our version of strftime */ + #undef TIME_T_IN_SYS_TYPES_H /* some systems define this type here */ /* Define if you have the __argz_count function. */ #undef HAVE___ARGZ_COUNT *************** *** 155,178 **** /* Define if you have the alarm function. */ #undef HAVE_ALARM ! /* Define if you have the dcgettext function. */ ! #undef HAVE_DCGETTEXT /* Define if you have the fmod function. */ #undef HAVE_FMOD /* Define if you have the getcwd function. */ #undef HAVE_GETCWD /* Define if you have the getpagesize function. */ #undef HAVE_GETPAGESIZE /* Define if you have the memcmp function. */ #undef HAVE_MEMCMP /* Define if you have the memcpy function. */ #undef HAVE_MEMCPY /* Define if you have the memset function. */ #undef HAVE_MEMSET --- 157,210 ---- /* Define if you have the alarm function. */ #undef HAVE_ALARM ! /* Define if you have the feof_unlocked function. */ ! #undef HAVE_FEOF_UNLOCKED ! ! /* Define if you have the fgets_unlocked function. */ ! #undef HAVE_FGETS_UNLOCKED /* Define if you have the fmod function. */ #undef HAVE_FMOD + /* Define if you have the getc_unlocked function. */ + #undef HAVE_GETC_UNLOCKED + /* Define if you have the getcwd function. */ #undef HAVE_GETCWD + /* Define if you have the getegid function. */ + #undef HAVE_GETEGID + + /* Define if you have the geteuid function. */ + #undef HAVE_GETEUID + + /* Define if you have the getgid function. */ + #undef HAVE_GETGID + + /* Define if you have the getgroups function. */ + #undef HAVE_GETGROUPS + /* Define if you have the getpagesize function. */ #undef HAVE_GETPAGESIZE + /* Define if you have the getuid function. */ + #undef HAVE_GETUID + + /* Define if you have the mbrlen function. */ + #undef HAVE_MBRLEN + + /* Define if you have the mbrtowc function. */ + #undef HAVE_MBRTOWC + /* Define if you have the memcmp function. */ #undef HAVE_MEMCMP /* Define if you have the memcpy function. */ #undef HAVE_MEMCPY + /* Define if you have the mempcpy function. */ + #undef HAVE_MEMPCPY + /* Define if you have the memset function. */ #undef HAVE_MEMSET *************** *** 212,220 **** --- 244,258 ---- /* Define if you have the strtod function. */ #undef HAVE_STRTOD + /* Define if you have the strtoul function. */ + #undef HAVE_STRTOUL + /* Define if you have the system function. */ #undef HAVE_SYSTEM + /* Define if you have the tsearch function. */ + #undef HAVE_TSEARCH + /* Define if you have the tzset function. */ #undef HAVE_TZSET *************** *** 257,262 **** --- 295,303 ---- /* Define if you have the header file. */ #undef HAVE_STDARG_H + /* Define if you have the header file. */ + #undef HAVE_STDDEF_H + /* Define if you have the header file. */ #undef HAVE_STDLIB_H *************** *** 272,288 **** /* Define if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define if you have the header file. */ #undef HAVE_UNISTD_H ! /* Define if you have the i library (-li). */ ! #undef HAVE_LIBI ! /* Define if you have the intl library (-lintl). */ ! #undef HAVE_LIBINTL /* Define if you have the m library (-lm). */ #undef HAVE_LIBM --- 313,335 ---- /* Define if you have the header file. */ #undef HAVE_SYS_SOCKET_H + /* Define if you have the header file. */ + #undef HAVE_SYS_STAT_H + /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H + /* Define if you have the header file. */ + #undef HAVE_SYS_TYPES_H + /* Define if you have the header file. */ #undef HAVE_UNISTD_H ! /* Define if you have the header file. */ ! #undef HAVE_WCHAR_H ! /* Define if you have the header file. */ ! #undef HAVE_WCTYPE_H /* Define if you have the m library (-lm). */ #undef HAVE_LIBM *************** *** 302,321 **** /* Define if compiler has function prototypes */ #undef PROTOTYPES ! /* Define to 1 if you have the stpcpy function. */ ! #undef HAVE_STPCPY ! /* Define if your locale.h file contains LC_MESSAGES. */ #undef HAVE_LC_MESSAGES ! /* Define to 1 if NLS is requested. */ #undef ENABLE_NLS ! /* Define to 1 if you have gettext and don't want to use GNU gettext. */ #undef HAVE_GETTEXT ! /* Define as 1 if you have catgets and don't want to use GNU gettext. */ ! #undef HAVE_CATGETS #include /* overrides for stuff autoconf can't deal with */ --- 349,375 ---- /* Define if compiler has function prototypes */ #undef PROTOTYPES ! /* Define if you have the iconv() function. */ ! #undef HAVE_ICONV ! ! /* Define as const if the declaration of iconv() needs const. */ ! #undef ICONV_CONST ! /* 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 translation of program messages to the user's native language ! is requested. */ #undef ENABLE_NLS ! /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT ! /* Define if the GNU dcgettext() function is already present or preinstalled. */ ! #undef HAVE_DCGETTEXT #include /* overrides for stuff autoconf can't deal with */ diff -crN gawk-3.1.0/configure gawk-3.1.1/configure *** gawk-3.1.0/configure Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/configure Mon Apr 29 17:36:47 2002 *************** *** 0 **** --- 1,7297 ---- + #! /bin/sh + + # Guess values for system-dependent variables and create Makefiles. + # Generated automatically using autoconf version 2.13 + # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. + # + # This configure script is free software; the Free Software Foundation + # gives unlimited permission to copy, distribute and modify it. + + # Defaults: + ac_help= + ac_default_prefix=/usr/local + # Any additions from configure.in: + ac_help="$ac_help + --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors" + ac_help="$ac_help + --enable-portals Enable /p as path prefix for portals" + ac_help="$ac_help + --with-whiny-user-strftime Force use of included version of strftime for deficient systems" + ac_help="$ac_help + --disable-largefile omit support for large files" + ac_help="$ac_help + --with-gnu-ld assume the C compiler uses GNU ld [default=no]" + ac_help="$ac_help + --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib + --without-libiconv-prefix don't search for libiconv in includedir and libdir" + ac_help="$ac_help + --disable-nls do not use Native Language Support" + ac_help="$ac_help + --with-included-gettext use the GNU gettext library included here" + ac_help="$ac_help + --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib + --without-libintl-prefix don't search for libintl in includedir and libdir" + + # Initialize some variables set by options. + # The variables have the same names as the options, with + # dashes changed to underlines. + build=NONE + cache_file=./config.cache + exec_prefix=NONE + host=NONE + no_create= + nonopt=NONE + no_recursion= + prefix=NONE + program_prefix=NONE + program_suffix=NONE + program_transform_name=s,x,x, + silent= + site= + srcdir= + target=NONE + verbose= + x_includes=NONE + x_libraries=NONE + 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' + + # Initialize some other variables. + subdirs= + MFLAGS= MAKEFLAGS= + SHELL=${CONFIG_SHELL-/bin/sh} + # Maximum number of lines to put in a shell here document. + ac_max_here_lines=12 + + 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 + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # 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 ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$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" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) 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) + # 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 << EOF + Usage: configure [options] [host] + Options: [defaults in brackets after descriptions] + Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure + Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --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 + EOF + cat << EOF + Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] + Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR + EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$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) + 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 ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + 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 "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac + done + + if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } + fi + + trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + + # File descriptor usage: + # 0 standard input + # 1 file creation + # 2 errors and warnings + # 3 some systems may open it to /dev/tty + # 4 used on the Kubota Titan + # 6 checking for... messages and results + # 5 compiler messages saved in config.log + if test "$silent" = yes; then + exec 6>/dev/null + else + exec 6>&1 + fi + exec 5>./config.log + + echo "\ + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. + " 1>&5 + + # Strip out --no-create and --no-recursion so they do not pile up. + # Also quote any args containing shell metacharacters. + ac_configure_args= + for ac_arg + do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac + done + + # NLS nuisances. + # Only set these to C if already set. These must not be set unconditionally + # because not all systems understand e.g. LANG=C (notably SCO). + # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! + # Non-C LC_CTYPE values break the ctype check. + if test "${LANG+set}" = set; then LANG=C; export LANG; fi + if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi + if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi + if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + + # 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 + + # A filename unique to this package, relative to the directory that + # configure is in, which we can look for to find out if srcdir is correct. + ac_unique_file=awk.h + + # 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_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + 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 "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi + fi + srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + + # 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 "loading site script $ac_site_file" + . "$ac_site_file" + fi + done + + if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file + else + echo "creating cache $cache_file" + > $cache_file + fi + + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' + ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross + + ac_exeext= + ac_objext=o + if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' + ' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi + else + ac_n= ac_c='\c' ac_t= + fi + + # Check whether --with-gnu-ld or --without-gnu-ld was given. + if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes + else + with_gnu_ld=no + fi + + ac_prog=ld + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 + echo "configure:557: checking for ld used by GCC" >&5 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + elif test "$with_gnu_ld" = yes; then + echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 + echo "configure:587: checking for GNU ld" >&5 + else + echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 + echo "configure:590: checking for non-GNU ld" >&5 + fi + if eval "test \"`echo '$''{'acl_cv_path_LD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" + else + acl_cv_path_LD="$LD" # Let the user override the test with a path. + fi + fi + + LD="$acl_cv_path_LD" + if test -n "$LD"; then + echo "$ac_t""$LD" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } + echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 + echo "configure:625: checking if the linker ($LD) is GNU ld" >&5 + if eval "test \"`echo '$''{'acl_cv_prog_gnu_ld'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. + if $LD -v 2>&1 &5; then + acl_cv_prog_gnu_ld=yes + else + acl_cv_prog_gnu_ld=no + fi + fi + + echo "$ac_t""$acl_cv_prog_gnu_ld" 1>&6 + with_gnu_ld=$acl_cv_prog_gnu_ld + + + + + 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 + fi + done + if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } + fi + ac_config_guess=$ac_aux_dir/config.guess + ac_config_sub=$ac_aux_dir/config.sub + ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + + # expand $ac_aux_dir to an absolute path + am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` + + # 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 + # 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 $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 + echo "configure:678: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/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 + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + + 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 "$ac_t""$INSTALL" 1>&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_PROGRAM}' + + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 + echo "configure:731: checking whether build environment is sane" >&5 + # 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 "configure: error: ls -t appears to fail. Make sure there is not a broken + alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftest.file + ) + then + # Ok. + : + else + { echo "configure: error: newly created file is older than distributed files! + Check your system clock" 1>&2; exit 1; } + fi + echo "$ac_t""yes" 1>&6 + if test "$program_transform_name" = s,x,x,; then + program_transform_name= + else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed + s,\\,\\\\,g; s,\$,$$,g + EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed + fi + 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" + + # sed with no file args requires a program. + test "$program_transform_name" = "" && program_transform_name="s,x,x," + + 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 "configure: warning: ${am_backtick}missing' script is too old or missing" 1>&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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:802: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. + else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AWK="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" + fi + fi + AWK="$ac_cv_prog_AWK" + if test -n "$AWK"; then + echo "$ac_t""$AWK" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + test -n "$AWK" && break + done + + echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 + echo "configure:832: checking whether ${MAKE-make} sets \${MAKE}" >&5 + set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftestmake <<\EOF + all: + @echo 'ac_maketemp="${MAKE}"' + EOF + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} -f conftestmake 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 conftestmake + fi + if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= + else + echo "$ac_t""no" 1>&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 "configure: error: source directory already configured; run \"make distclean\" there first" 1>&2; exit 1; } + fi + + # Define the identity of the package. + PACKAGE=gawk + VERSION=3.1.1 + cat >> confdefs.h <> confdefs.h <> confdefs.h <<\EOF + #define HAVE_PORTALS 1 + EOF + + fi + + # Check whether --with-whiny-user-strftime or --without-whiny-user-strftime was given. + if test "${with_whiny_user_strftime+set}" = set; then + withval="$with_whiny_user_strftime" + if test "$withval" = yes + then + cat >> confdefs.h <<\EOF + #define USE_INCLUDED_STRFTIME 1 + EOF + + fi + + fi + + + for ac_prog in 'bison -y' byacc + 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:980: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. + else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_YACC="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" + fi + fi + YACC="$ac_cv_prog_YACC" + if test -n "$YACC"; then + echo "$ac_t""$YACC" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + test -n "$YACC" && break + done + test -n "$YACC" || YACC="yacc" + + echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 + echo "configure:1011: checking whether ln -s works" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + rm -f conftestdata + if ln -s X conftestdata 2>/dev/null + then + rm -f conftestdata + ac_cv_prog_LN_S="ln -s" + else + ac_cv_prog_LN_S=ln + fi + fi + LN_S="$ac_cv_prog_LN_S" + if test "$ac_cv_prog_LN_S" = "ln -s"; then + echo "$ac_t""yes" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + # Extract the first word of "gcc", so it can be a program name with args. + set dummy gcc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:1034: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" + fi + fi + CC="$ac_cv_prog_CC" + if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 + else + echo "$ac_t""no" 1>&6 + 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:1064: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" + 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 $# -gt 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 "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi + fi + fi + fi + CC="$ac_cv_prog_CC" + if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. + set dummy cl; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:1115: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" + fi + fi + CC="$ac_cv_prog_CC" + if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } + fi + + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 + echo "configure:1147: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' + ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross + + cat > conftest.$ac_ext << EOF + + #line 1158 "configure" + #include "confdefs.h" + + main(){return(0);} + EOF + if { (eval echo configure:1163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no + fi + rm -fr conftest* + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' + ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross + + echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 + if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } + fi + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 + echo "configure:1189: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 + echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 + cross_compiling=$ac_cv_prog_cc_cross + + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 + echo "configure:1194: checking whether we are using GNU C" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes + else + ac_cv_prog_gcc=no + fi + fi + + echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + + if test $ac_cv_prog_gcc = yes; then + GCC=yes + else + GCC= + fi + + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 + echo "configure:1222: checking whether ${CC-cc} accepts -g" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + echo 'void f(){}' > conftest.c + if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes + else + ac_cv_prog_cc_g=no + fi + rm -f conftest* + + fi + + echo "$ac_t""$ac_cv_prog_cc_g" 1>&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 + + + 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 $ac_n "checking for style of include used by $am_make""... $ac_c" 1>&6 + echo "configure:1261: checking for style of include used by $am_make" >&5 + 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 "$ac_t""$_am_result" 1>&6 + rm -f confinc confmf + + + depcc="$CC" am_compiler_list= + + echo $ac_n "checking dependency style of $depcc""... $ac_c" 1>&6 + echo "configure:1295: checking dependency style of $depcc" >&5 + if eval "test \"`echo '$''{'am_cv_CC_dependencies_compiler_type'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&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 "$ac_t""$am_cv_CC_dependencies_compiler_type" 1>&6 + CCDEPMODE="depmode=$am_cv_CC_dependencies_compiler_type" + + + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 + echo "configure:1362: checking how to run the C preprocessor" >&5 + # On Suns, sometimes $CPP names a directory. + if test -n "$CPP" && test -d "$CPP"; then + CPP= + fi + if test -z "$CPP"; then + if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:1383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:1400: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:1417: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp + fi + rm -f conftest* + fi + rm -f conftest* + fi + rm -f conftest* + ac_cv_prog_CPP="$CPP" + fi + CPP="$ac_cv_prog_CPP" + else + ac_cv_prog_CPP="$CPP" + fi + echo "$ac_t""$CPP" 1>&6 + + # Extract the first word of "ranlib", so it can be a program name with args. + set dummy ranlib; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:1444: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" + fi + fi + RANLIB="$ac_cv_prog_RANLIB" + if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + + # This is a hack. Different versions of install on different systems + # are just too different. Chuck it and use install-sh. + # + # If the user supplies $INSTALL, figure they know what they're doing. + if test "x$INSTALL" = "x" + then + INSTALL="$srcdir/install-sh -c" + export INSTALL + fi + + # 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 + # 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 $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 + echo "configure:1494: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/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 + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + + 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 "$ac_t""$INSTALL" 1>&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_PROGRAM}' + + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + + echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 + echo "configure:1548: checking whether ${MAKE-make} sets \${MAKE}" >&5 + set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftestmake <<\EOF + all: + @echo 'ac_maketemp="${MAKE}"' + EOF + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} -f conftestmake 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 conftestmake + fi + if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= + else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" + fi + + + # This is mainly for my use during testing and development. + # Yes, it's a bit of a hack. + echo $ac_n "checking for special development options""... $ac_c" 1>&6 + echo "configure:1578: checking for special development options" >&5 + if test -f $srcdir/.developing + then + # add other debug flags as appropriate, save GAWKDEBUG for emergencies + CFLAGS="$CFLAGS -DARRAYDEBUG" + # turn on compiler warnings if we're doing development + if test "$GCC" = yes + then + CFLAGS="$CFLAGS -Wall" + fi + echo "$ac_t""yes" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + + + echo $ac_n "checking for AIX""... $ac_c" 1>&6 + echo "configure:1596: checking for AIX" >&5 + cat > conftest.$ac_ext <&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF + #define _ALL_SOURCE 1 + EOF + + else + rm -rf conftest* + echo "$ac_t""no" 1>&6 + fi + rm -f conftest* + + + + echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6 + echo "configure:1621: checking for strerror in -lcposix" >&5 + ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" + LIBS="-lcposix $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* + LIBS="$ac_save_LIBS" + + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lcposix" + else + echo "$ac_t""no" 1>&6 + fi + + + + ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 + echo "configure:1664: checking for minix/config.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:1674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + MINIX=yes + else + echo "$ac_t""no" 1>&6 + MINIX= + fi + + if test "$MINIX" = yes; then + cat >> confdefs.h <<\EOF + #define _POSIX_SOURCE 1 + EOF + + cat >> confdefs.h <<\EOF + #define _POSIX_1_SOURCE 2 + EOF + + cat >> confdefs.h <<\EOF + #define _MINIX 1 + EOF + + 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 + + echo $ac_n "checking for special C compiler options needed for large files""... $ac_c" 1>&6 + echo "configure:1721: checking for special C compiler options needed for large files" >&5 + if eval "test \"`echo '$''{'ac_cv_sys_largefile_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat > conftest.$ac_ext < + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply "#define LARGE_OFF_T 9223372036854775807", + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ + # define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; + + int main() { + + ; return 0; } + EOF + if { (eval echo configure:1746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_save_CC="$CC" + CC="$CC -n32" + cat > conftest.$ac_ext < + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply "#define LARGE_OFF_T 9223372036854775807", + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ + # define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; + + int main() { + + ; return 0; } + EOF + if { (eval echo configure:1771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sys_largefile_CC=' -n32' + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* + CC="$ac_save_CC" + fi + rm -f conftest* + fi + fi + + echo "$ac_t""$ac_cv_sys_largefile_CC" 1>&6 + if test "$ac_cv_sys_largefile_CC" != no; then + CC="$CC$ac_cv_sys_largefile_CC" + fi + + echo $ac_n "checking for _FILE_OFFSET_BITS value needed for large files""... $ac_c" 1>&6 + echo "configure:1791: checking for _FILE_OFFSET_BITS value needed for large files" >&5 + if eval "test \"`echo '$''{'ac_cv_sys_file_offset_bits'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_cv_sys_file_offset_bits=no + cat > conftest.$ac_ext < + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply "#define LARGE_OFF_T 9223372036854775807", + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ + # define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; + + int main() { + + ; return 0; } + EOF + if { (eval echo configure:1813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cat > conftest.$ac_ext < + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply "#define LARGE_OFF_T 9223372036854775807", + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ + # define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; + + + int main() { + + ; return 0; } + EOF + if { (eval echo configure:1838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sys_file_offset_bits=64 + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_sys_file_offset_bits" 1>&6 + if test "$ac_cv_sys_file_offset_bits" != no; then + cat >> confdefs.h <&6 + echo "configure:1858: checking for _LARGE_FILES value needed for large files" >&5 + if eval "test \"`echo '$''{'ac_cv_sys_large_files'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_cv_sys_large_files=no + cat > conftest.$ac_ext < + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply "#define LARGE_OFF_T 9223372036854775807", + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ + # define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; + + int main() { + + ; return 0; } + EOF + if { (eval echo configure:1880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cat > conftest.$ac_ext < + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply "#define LARGE_OFF_T 9223372036854775807", + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ + # define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; + + + int main() { + + ; return 0; } + EOF + if { (eval echo configure:1905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sys_large_files=1 + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_sys_large_files" 1>&6 + if test "$ac_cv_sys_large_files" != no; then + cat >> confdefs.h <&6 + echo "configure:1928: checking for AIX compilation hacks" >&5 + if eval "test \"`echo '$''{'gawk_cv_aix_hack'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + + if test -d /lpp/bos + then + CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED=1" + gawk_cv_aix_hack=yes + else + gawk_cv_aix_hack=no + fi + + fi + echo "$ac_t""${gawk_cv_aix_hack}" 1>&6 + + + echo $ac_n "checking for Linux/Alpha compilation hacks""... $ac_c" 1>&6 + echo "configure:1946: checking for Linux/Alpha compilation hacks" >&5 + if eval "test \"`echo '$''{'gawk_cv_linux_alpha_hack'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + + if test "Linux" = "`uname`" && test "alpha" = "`uname -m`" + then + # this isn't necessarily always true, + # the vendor's compiler is also often found + if test "$GCC" = yes + then + CFLAGS="$CFLAGS -mieee" + gawk_cv_linux_alpha_hack=yes + else + gawk_cv_linux_alpha_hack=no + fi + else + gawk_cv_linux_alpha_hack=no + fi + + fi + echo "$ac_t""${gawk_cv_linux_alpha_hack}" 1>&6 + + + if test "$ISC" = 1 # will be set by test for ISC + then + CFLAGS="$CFLAGS -D_SYSV3" + fi + + + + + echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 + echo "configure:1979: checking for ${CC-cc} option to accept ANSI C" >&5 + if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&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 < + #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; + + int main() { + + return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + + ; return 0; } + EOF + if { (eval echo configure:2033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + am_cv_prog_cc_stdc="$ac_arg"; break + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* + done + CC="$ac_save_CC" + + fi + + if test -z "$am_cv_prog_cc_stdc"; then + echo "$ac_t""none needed" 1>&6 + else + echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6 + fi + case "x$am_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $am_cv_prog_cc_stdc" ;; + esac + + + + echo $ac_n "checking for function prototypes""... $ac_c" 1>&6 + echo "configure:2059: checking for function prototypes" >&5 + if test "$am_cv_prog_cc_stdc" != no; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF + #define PROTOTYPES 1 + EOF + + U= ANSI2KNR= + else + echo "$ac_t""no" 1>&6 + U=_ ANSI2KNR=./ansi2knr + fi + # Ensure some checks needed by ansi2knr itself. + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 + echo "configure:2073: checking for ANSI C header files" >&5 + if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include + #include + #include + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:2086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no + fi + rm -f conftest* + + if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat > conftest.$ac_ext < + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : + else + rm -rf conftest* + 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 < + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : + else + rm -rf conftest* + 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 < + #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') + #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) + #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); } + + EOF + if { (eval echo configure:2153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + : + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no + fi + rm -fr conftest* + fi + + fi + fi + + echo "$ac_t""$ac_cv_header_stdc" 1>&6 + if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF + #define STDC_HEADERS 1 + EOF + + fi + + for ac_hdr in string.h + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 + echo "configure:2180: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:2190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 + fi + done + + + + + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + + + echo $ac_n "checking for shared library run path origin""... $ac_c" 1>&6 + echo "configure:2236: checking for shared library run path origin" >&5 + if eval "test \"`echo '$''{'acl_cv_rpath'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + + fi + + echo "$ac_t""$acl_cv_rpath" 1>&6 + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" + sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" + + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + + # Make sure we can run config.sub. + if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + fi + + echo $ac_n "checking host system type""... $ac_c" 1>&6 + echo "configure:2277: checking host system type" >&5 + + host_alias=$host + case "$host_alias" in + NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; + esac + + host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` + host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + echo "$ac_t""$host" 1>&6 + + echo $ac_n "checking for working const""... $ac_c" 1>&6 + echo "configure:2298: checking for working const" >&5 + if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } + + ; return 0; } + EOF + if { (eval echo configure:2352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_const=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_const=no + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_c_const" 1>&6 + if test $ac_cv_c_const = no; then + cat >> confdefs.h <<\EOF + #define const + EOF + + fi + + echo $ac_n "checking for inline""... $ac_c" 1>&6 + echo "configure:2373: checking for inline" >&5 + if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_cv_c_inline=no + for ac_kw in inline __inline__ __inline; do + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_inline=$ac_kw; break + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* + done + + fi + + echo "$ac_t""$ac_cv_c_inline" 1>&6 + case "$ac_cv_c_inline" in + inline | yes) ;; + no) cat >> confdefs.h <<\EOF + #define inline + EOF + ;; + *) cat >> confdefs.h <&6 + echo "configure:2413: checking for off_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #if STDC_HEADERS + #include + #include + #endif + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_off_t=yes + else + rm -rf conftest* + ac_cv_type_off_t=no + fi + rm -f conftest* + + fi + echo "$ac_t""$ac_cv_type_off_t" 1>&6 + if test $ac_cv_type_off_t = no; then + cat >> confdefs.h <<\EOF + #define off_t long + EOF + + fi + + echo $ac_n "checking for size_t""... $ac_c" 1>&6 + echo "configure:2446: checking for size_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #if STDC_HEADERS + #include + #include + #endif + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_size_t=yes + else + rm -rf conftest* + ac_cv_type_size_t=no + fi + rm -f conftest* + + fi + echo "$ac_t""$ac_cv_type_size_t" 1>&6 + if test $ac_cv_type_size_t = no; then + cat >> confdefs.h <<\EOF + #define size_t unsigned + EOF + + fi + + # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works + # for constant arguments. Useless! + echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 + echo "configure:2481: checking for working alloca.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + char *p = alloca(2 * sizeof(int)); + ; return 0; } + EOF + if { (eval echo configure:2493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_header_alloca_h=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_alloca_h=no + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 + if test $ac_cv_header_alloca_h = yes; then + cat >> confdefs.h <<\EOF + #define HAVE_ALLOCA_H 1 + EOF + + fi + + echo $ac_n "checking for alloca""... $ac_c" 1>&6 + echo "configure:2514: checking for alloca" >&5 + if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + # 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 + + int main() { + char *p = (char *) alloca(1); + ; return 0; } + EOF + if { (eval echo configure:2547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_alloca_works=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_func_alloca_works=no + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 + if test $ac_cv_func_alloca_works = yes; then + cat >> confdefs.h <<\EOF + #define HAVE_ALLOCA 1 + EOF + + fi + + if test $ac_cv_func_alloca_works = no; then + # 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 <<\EOF + #define C_ALLOCA 1 + EOF + + + echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 + echo "configure:2579: checking whether alloca needs Cray hooks" >&5 + if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5 | + egrep "webecray" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_os_cray=yes + else + rm -rf conftest* + ac_cv_os_cray=no + fi + rm -f conftest* + + fi + + echo "$ac_t""$ac_cv_os_cray" 1>&6 + if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 + echo "configure:2609: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* 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(); + + 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 + $ac_func(); + #endif + + ; return 0; } + EOF + if { (eval echo configure:2637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" + fi + rm -f conftest* + fi + + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <&6 + fi + + done + fi + + echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 + echo "configure:2664: checking stack direction for C alloca" >&5 + if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then + ac_cv_c_stack_direction=0 + else + cat > conftest.$ac_ext < addr) ? 1 : -1; + } + main () + { + exit (find_stack_direction() < 0); + } + EOF + if { (eval echo configure:2691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_c_stack_direction=1 + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_c_stack_direction=-1 + fi + rm -fr conftest* + fi + + fi + + echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 + cat >> confdefs.h <&6 + echo "configure:2716: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:2726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 + fi + done + + for ac_func in getpagesize + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 + echo "configure:2755: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* 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(); + + 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 + $ac_func(); + #endif + + ; return 0; } + EOF + if { (eval echo configure:2783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" + fi + rm -f conftest* + fi + + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 + fi + done + + echo $ac_n "checking for working mmap""... $ac_c" 1>&6 + echo "configure:2808: checking for working mmap" >&5 + if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then + ac_cv_func_mmap_fixed_mapped=no + else + cat > conftest.$ac_ext < + #include + #include + + #if HAVE_SYS_TYPES_H + # include + #endif + + #if HAVE_STDLIB_H + # include + #endif + + #if HAVE_SYS_STAT_H + # include + #endif + + #if HAVE_UNISTD_H + # include + #endif + + /* This mess was copied from the GNU getpagesize.h. */ + #ifndef HAVE_GETPAGESIZE + + /* Assume that all systems that can run configure have sys/param.h. */ + # ifndef HAVE_SYS_PARAM_H + # define HAVE_SYS_PARAM_H 1 + # endif + + # ifdef _SC_PAGESIZE + # define getpagesize() sysconf(_SC_PAGESIZE) + # else /* no _SC_PAGESIZE */ + # ifdef 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 */ + + #ifdef __cplusplus + extern "C" { void *malloc(unsigned); } + #else + char *malloc(); + #endif + + int + main() + { + char *data, *data2, *data3; + int i, pagesize; + int fd; + + pagesize = getpagesize(); + + /* + * First, make a file with some known garbage in it. + */ + data = malloc(pagesize); + if (!data) + exit(1); + for (i = 0; i < pagesize; ++i) + *(data + i) = rand(); + umask(0); + fd = creat("conftestmmap", 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("conftestmmap", O_RDWR); + if (fd < 0) + exit(1); + data2 = 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 = 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); + unlink("conftestmmap"); + exit(0); + } + + EOF + if { (eval echo configure:2969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_func_mmap_fixed_mapped=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_mmap_fixed_mapped=no + fi + rm -fr conftest* + fi + + fi + + echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6 + if test $ac_cv_func_mmap_fixed_mapped = yes; then + cat >> confdefs.h <<\EOF + #define HAVE_MMAP 1 + EOF + + fi + + + echo $ac_n "checking whether we are using the GNU C Library 2.1 or newer""... $ac_c" 1>&6 + echo "configure:2993: checking whether we are using the GNU C Library 2.1 or newer" >&5 + if eval "test \"`echo '$''{'ac_cv_gnu_library_2_1'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif + #endif + + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "Lucky GNU user" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_gnu_library_2_1=yes + else + rm -rf conftest* + ac_cv_gnu_library_2_1=no + fi + rm -f conftest* + + + + fi + + echo "$ac_t""$ac_cv_gnu_library_2_1" 1>&6 + + GLIBC21="$ac_cv_gnu_library_2_1" + + + + + + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. + if test "${with_libiconv_prefix+set}" = set; then + withval="$with_libiconv_prefix" + + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + + fi + + LIBICONV= + LTLIBICONV= + INCICONV= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='iconv ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "X$found_dir" = "X/usr/lib"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBICONV; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" + ;; + esac + done + fi + else + LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" + done + fi + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + echo $ac_n "checking for iconv""... $ac_c" 1>&6 + echo "configure:3436: checking for iconv" >&5 + if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat > conftest.$ac_ext < + #include + int main() { + iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; return 0; } + EOF + if { (eval echo configure:3454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_func_iconv=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat > conftest.$ac_ext < + #include + int main() { + iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; return 0; } + EOF + if { (eval echo configure:3476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_lib_iconv=yes + am_cv_func_iconv=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* + LIBS="$am_save_LIBS" + fi + + fi + + echo "$ac_t""$am_cv_func_iconv" 1>&6 + if test "$am_cv_func_iconv" = yes; then + cat >> confdefs.h <<\EOF + #define HAVE_ICONV 1 + EOF + + fi + if test "$am_cv_lib_iconv" = yes; then + echo $ac_n "checking how to link with libiconv""... $ac_c" 1>&6 + echo "configure:3499: checking how to link with libiconv" >&5 + echo "$ac_t""$LIBICONV" 1>&6 + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + + + + # Extract the first word of "msgfmt", so it can be a program name with args. + set dummy msgfmt; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:3515: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&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 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); 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 "$ac_t""$MSGFMT" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. + set dummy gmsgfmt; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:3550: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + case "$GMSGFMT" in + /*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_GMSGFMT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; + esac + fi + GMSGFMT="$ac_cv_path_GMSGFMT" + if test -n "$GMSGFMT"; then + echo "$ac_t""$GMSGFMT" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + + # Extract the first word of "xgettext", so it can be a program name with args. + set dummy xgettext; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:3587: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&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 --copyright-holder= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); 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 "$ac_t""$XGETTEXT" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + rm -f messages.po + + # Extract the first word of "msgmerge", so it can be a program name with args. + set dummy msgmerge; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:3624: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_path_MSGMERGE'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + case "$MSGMERGE" in + /*) + ac_cv_path_MSGMERGE="$MSGMERGE" # 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 --update -q /dev/null /dev/null >/dev/null 2>&1; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" + ;; + esac + fi + MSGMERGE="$ac_cv_path_MSGMERGE" + if test "$MSGMERGE" != ":"; then + echo "$ac_t""$MSGMERGE" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + + if test "$GMSGFMT" != ":"; then + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + echo "$ac_t""found $GMSGFMT program is not GNU msgfmt; ignore it" 1>&6 + GMSGFMT=":" + fi + fi + + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + echo "$ac_t""found xgettext program is not GNU xgettext; ignore it" 1>&6 + XGETTEXT=":" + fi + rm -f messages.po + fi + + + + + + for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ + stdlib.h string.h unistd.h sys/param.h + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 + echo "configure:3687: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:3697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 + fi + done + + for ac_func in feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \ + geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \ + strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 + echo "configure:3728: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* 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(); + + 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 + $ac_func(); + #endif + + ; return 0; } + EOF + if { (eval echo configure:3756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" + fi + rm -f conftest* + fi + + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 + fi + done + + + + + if test "$am_cv_func_iconv" = yes; then + echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6 + echo "configure:3785: checking for iconv declaration" >&5 + if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + + cat > conftest.$ac_ext < + #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 + + int main() { + + ; return 0; } + EOF + if { (eval echo configure:3810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + am_cv_proto_iconv_arg1="" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + am_cv_proto_iconv_arg1="const" + fi + rm -f conftest* + 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 "$ac_t""${ac_t:- + }$am_cv_proto_iconv" 1>&6 + cat >> confdefs.h <&6 + echo "configure:3834: checking for nl_langinfo and CODESET" >&5 + if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + char* cs = nl_langinfo(CODESET); + ; return 0; } + EOF + if { (eval echo configure:3846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_langinfo_codeset=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + am_cv_langinfo_codeset=no + fi + rm -f conftest* + + fi + + echo "$ac_t""$am_cv_langinfo_codeset" 1>&6 + if test $am_cv_langinfo_codeset = yes; then + cat >> confdefs.h <<\EOF + #define HAVE_LANGINFO_CODESET 1 + EOF + + fi + + if test $ac_cv_header_locale_h = yes; then + echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 + echo "configure:3869: checking for LC_MESSAGES" >&5 + if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + return LC_MESSAGES + ; return 0; } + EOF + if { (eval echo configure:3881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_val_LC_MESSAGES=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + am_cv_val_LC_MESSAGES=no + fi + rm -f conftest* + fi + + echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6 + if test $am_cv_val_LC_MESSAGES = yes; then + cat >> confdefs.h <<\EOF + #define HAVE_LC_MESSAGES 1 + EOF + + fi + 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:3907: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_INTLBISON'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$INTLBISON"; then + ac_cv_prog_INTLBISON="$INTLBISON" # Let the user override the test. + else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_INTLBISON="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" + fi + fi + INTLBISON="$ac_cv_prog_INTLBISON" + if test -n "$INTLBISON"; then + echo "$ac_t""$INTLBISON" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + test -n "$INTLBISON" && break + done + + if test -z "$INTLBISON"; then + ac_verc_fail=yes + else + echo $ac_n "checking version of bison""... $ac_c" 1>&6 + echo "configure:3940: checking version of bison" >&5 + 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 "$ac_t""$ac_prog_version" 1>&6 + fi + if test $ac_verc_fail = yes; then + INTLBISON=: + fi + + + + + + + + + + + + + + echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 + echo "configure:3967: checking whether NLS is requested" >&5 + # 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 "$ac_t""$USE_NLS" 1>&6 + + + + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + + LIBINTL= + LTLIBINTL= + POSUB= + + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + + echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 + echo "configure:3991: checking whether included gettext is requested" >&5 + # 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 "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6 + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + + + + + + + echo $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6 + echo "configure:4011: checking for GNU gettext in libc" >&5 + if eval "test \"`echo '$''{'gt_cv_func_gnugettext2_libc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + extern int _nl_msg_cat_cntr; + extern int *_nl_domain_bindings; + int main() { + bindtextdomain ("", ""); + return (int) gettext ("") + (int) ngettext ("", "", 0) + _nl_msg_cat_cntr + *_nl_domain_bindings + ; return 0; } + EOF + if { (eval echo configure:4026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + gt_cv_func_gnugettext2_libc=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gt_cv_func_gnugettext2_libc=no + fi + rm -f conftest* + fi + + echo "$ac_t""$gt_cv_func_gnugettext2_libc" 1>&6 + + if test "$gt_cv_func_gnugettext2_libc" != "yes"; then + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + # Check whether --with-libintl-prefix or --without-libintl-prefix was given. + if test "${with_libintl_prefix+set}" = set; then + withval="$with_libintl_prefix" + + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + + fi + + LIBINTL= + LTLIBINTL= + INCINTL= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='intl ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "X$found_dir" = "X/usr/lib"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$hardcode_direct" = yes; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBINTL; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" + ;; + esac + done + fi + else + LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" + done + fi + + echo $ac_n "checking for GNU gettext in libintl""... $ac_c" 1>&6 + echo "configure:4419: checking for GNU gettext in libintl" >&5 + if eval "test \"`echo '$''{'gt_cv_func_gnugettext2_libintl'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + gt_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + cat > conftest.$ac_ext < + extern int _nl_msg_cat_cntr; + extern + #ifdef __cplusplus + "C" + #endif + const char *_nl_expand_alias (); + int main() { + bindtextdomain ("", ""); + return (int) gettext ("") + (int) ngettext ("", "", 0) + _nl_msg_cat_cntr + *_nl_expand_alias (0) + ; return 0; } + EOF + if { (eval echo configure:4442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + gt_cv_func_gnugettext2_libintl=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gt_cv_func_gnugettext2_libintl=no + fi + rm -f conftest* + if test "$gt_cv_func_gnugettext2_libintl" != yes && test -n "$LIBICONV"; then + LIBS="$LIBS $LIBICONV" + cat > conftest.$ac_ext < + extern int _nl_msg_cat_cntr; + extern + #ifdef __cplusplus + "C" + #endif + const char *_nl_expand_alias (); + int main() { + bindtextdomain ("", ""); + return (int) gettext ("") + (int) ngettext ("", "", 0) + _nl_msg_cat_cntr + *_nl_expand_alias (0) + ; return 0; } + EOF + if { (eval echo configure:4469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + LIBINTL="$LIBINTL $LIBICONV" + LTLIBINTL="$LTLIBINTL $LTLIBICONV" + gt_cv_func_gnugettext2_libintl=yes + + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* + fi + CPPFLAGS="$gt_save_CPPFLAGS" + LIBS="$gt_save_LIBS" + fi + + echo "$ac_t""$gt_cv_func_gnugettext2_libintl" 1>&6 + fi + + if test "$gt_cv_func_gnugettext2_libc" = "yes" \ + || { test "$gt_cv_func_gnugettext2_libintl" = "yes" \ + && test "$PACKAGE" != gettext; }; then + gt_use_preinstalled_gnugettext=yes + else + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + + if test "$gt_use_preinstalled_gnugettext" != "yes"; then + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + INTLOBJS="\$(GETTOBJS)" + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + LIBINTL="\${top_builddir}/intl/libintl.a $LIBICONV" + LTLIBINTL="\${top_builddir}/intl/libintl.a $LTLIBICONV" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + CATOBJEXT=.gmo + fi + + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + cat >> confdefs.h <<\EOF + #define ENABLE_NLS 1 + EOF + + else + USE_NLS=no + fi + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if test "$gt_cv_func_gnugettext2_libintl" = "yes"; then + echo $ac_n "checking how to link with libintl""... $ac_c" 1>&6 + echo "configure:4535: checking how to link with libintl" >&5 + echo "$ac_t""$LIBINTL" 1>&6 + + for element in $INCINTL; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + fi + + cat >> confdefs.h <<\EOF + #define HAVE_GETTEXT 1 + EOF + + cat >> confdefs.h <<\EOF + #define HAVE_DCGETTEXT 1 + EOF + + fi + + POSUB=po + fi + + + if test "$PACKAGE" = gettext; then + BUILD_INCLUDED_LIBINTL=yes + fi + + + + + + + nls_cv_header_intl= + nls_cv_header_libgt= + + DATADIRNAME=share + + + INSTOBJEXT=.mo + + + GENCAT=gencat + + + INTL_LIBTOOL_SUFFIX_PREFIX= + + + + INTLLIBS="$LIBINTL" + + + + + + + + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 + echo "configure:4610: checking for ANSI C header files" >&5 + if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include + #include + #include + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:4623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no + fi + rm -f conftest* + + if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat > conftest.$ac_ext < + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : + else + rm -rf conftest* + 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 < + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : + else + rm -rf conftest* + 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 < + #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') + #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) + #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); } + + EOF + if { (eval echo configure:4690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + : + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no + fi + rm -fr conftest* + fi + + fi + fi + + echo "$ac_t""$ac_cv_header_stdc" 1>&6 + if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF + #define STDC_HEADERS 1 + EOF + + fi + + echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 + echo "configure:4714: checking for sys/wait.h that is POSIX.1 compatible" >&5 + if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include + #ifndef WEXITSTATUS + #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) + #endif + #ifndef WIFEXITED + #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) + #endif + int main() { + int s; + wait (&s); + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; + ; return 0; } + EOF + if { (eval echo configure:4735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_sys_wait_h=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_sys_wait_h=no + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 + if test $ac_cv_header_sys_wait_h = yes; then + cat >> confdefs.h <<\EOF + #define HAVE_SYS_WAIT_H 1 + EOF + + fi + + echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 + echo "configure:4756: checking whether time.h and sys/time.h may both be included" >&5 + if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include + #include + int main() { + struct tm *tp; + ; return 0; } + EOF + if { (eval echo configure:4770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_time=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_time=no + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_header_time" 1>&6 + if test $ac_cv_header_time = yes; then + cat >> confdefs.h <<\EOF + #define TIME_WITH_SYS_TIME 1 + EOF + + fi + + for ac_hdr in fcntl.h limits.h locale.h libintl.h mcheck.h \ + netdb.h netinet/in.h signum.h stdarg.h string.h \ + sys/param.h sys/socket.h sys/time.h unistd.h \ + wchar.h wctype.h + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 + echo "configure:4797: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:4807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 + fi + done + + + if test "$ac_cv_header_string_h" = yes + then + for ac_hdr in memory.h + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 + echo "configure:4840: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:4850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 + fi + done + + else + for ac_hdr in strings.h + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 + echo "configure:4881: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:4891: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 + fi + done + + fi + + echo $ac_n "checking for pid_t""... $ac_c" 1>&6 + echo "configure:4920: checking for pid_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #if STDC_HEADERS + #include + #include + #endif + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_pid_t=yes + else + rm -rf conftest* + ac_cv_type_pid_t=no + fi + rm -f conftest* + + fi + echo "$ac_t""$ac_cv_type_pid_t" 1>&6 + if test $ac_cv_type_pid_t = no; then + cat >> confdefs.h <<\EOF + #define pid_t int + EOF + + fi + + echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 + echo "configure:4953: checking return type of signal handlers" >&5 + if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include + #ifdef signal + #undef signal + #endif + #ifdef __cplusplus + extern "C" void (*signal (int, void (*)(int)))(int); + #else + void (*signal ()) (); + #endif + + int main() { + int i; + ; return 0; } + EOF + if { (eval echo configure:4975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_type_signal=void + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_signal=int + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_type_signal" 1>&6 + cat >> confdefs.h <&6 + echo "configure:4994: checking for size_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #if STDC_HEADERS + #include + #include + #endif + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_size_t=yes + else + rm -rf conftest* + ac_cv_type_size_t=no + fi + rm -f conftest* + + fi + echo "$ac_t""$ac_cv_type_size_t" 1>&6 + if test $ac_cv_type_size_t = no; then + cat >> confdefs.h <<\EOF + #define size_t unsigned + EOF + + fi + + echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 + echo "configure:5027: checking for uid_t in sys/types.h" >&5 + if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "uid_t" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_uid_t=yes + else + rm -rf conftest* + ac_cv_type_uid_t=no + fi + rm -f conftest* + + fi + + echo "$ac_t""$ac_cv_type_uid_t" 1>&6 + if test $ac_cv_type_uid_t = no; then + cat >> confdefs.h <<\EOF + #define uid_t int + EOF + + cat >> confdefs.h <<\EOF + #define gid_t int + EOF + + fi + + echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 + echo "configure:5061: checking type of array argument to getgroups" >&5 + if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then + ac_cv_type_getgroups=cross + else + cat > conftest.$ac_ext < + #define NGID 256 + #undef MAX + #define MAX(x, y) ((x) > (y) ? (x) : (y)) + main() + { + gid_t gidset[NGID]; + int i, n; + union { gid_t gval; long lval; } val; + + val.lval = -1; + for (i = 0; i < NGID; i++) + gidset[i] = val.gval; + n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, + gidset); + /* Exit non-zero if getgroups seems to require an array of ints. This + happens when gid_t is short but getgroups modifies an array of ints. */ + exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0); + } + + EOF + if { (eval echo configure:5094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_type_getgroups=gid_t + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_type_getgroups=int + fi + rm -fr conftest* + fi + + if test $ac_cv_type_getgroups = cross; then + cat > conftest.$ac_ext < + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_getgroups=gid_t + else + rm -rf conftest* + ac_cv_type_getgroups=int + fi + rm -f conftest* + + fi + fi + + echo "$ac_t""$ac_cv_type_getgroups" 1>&6 + cat >> confdefs.h <&6 + echo "configure:5136: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:5146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 + fi + done + + echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 + echo "configure:5173: checking for ssize_t" >&5 + if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #if STDC_HEADERS + #include + #include + #endif + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_ssize_t=yes + else + rm -rf conftest* + ac_cv_type_ssize_t=no + fi + rm -f conftest* + + fi + echo "$ac_t""$ac_cv_type_ssize_t" 1>&6 + if test $ac_cv_type_ssize_t = no; then + cat >> confdefs.h <<\EOF + #define ssize_t int + EOF + + fi + + + + cat > conftest.$ac_ext < + EOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "int.*sprintf" >/dev/null 2>&1; then + rm -rf conftest* + cat >> confdefs.h <<\EOF + #define SPRINTF_RET int + EOF + + else + rm -rf conftest* + cat >> confdefs.h <<\EOF + #define SPRINTF_RET char * + EOF + + fi + rm -f conftest* + + cat > conftest.$ac_ext < + int main() { + + time_t foo; + foo = 0; + + ; return 0; } + EOF + if { (eval echo configure:5239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cat >> confdefs.h <<\EOF + #define TIME_T_IN_SYS_TYPES_H 1 + EOF + + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* + + cat >> confdefs.h <<\EOF + #define REGEX_MALLOC 1 + EOF + + echo $ac_n "checking for vprintf""... $ac_c" 1>&6 + echo "configure:5256: checking for vprintf" >&5 + if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char vprintf(); + + 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_vprintf) || defined (__stub___vprintf) + choke me + #else + vprintf(); + #endif + + ; return 0; } + EOF + if { (eval echo configure:5284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_vprintf=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_vprintf=no" + fi + rm -f conftest* + fi + + if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF + #define HAVE_VPRINTF 1 + EOF + + else + echo "$ac_t""no" 1>&6 + fi + + if test "$ac_cv_func_vprintf" != yes; then + echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 + echo "configure:5308: checking for _doprnt" >&5 + if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char _doprnt(); + + 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 + _doprnt(); + #endif + + ; return 0; } + EOF + if { (eval echo configure:5336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func__doprnt=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func__doprnt=no" + fi + rm -f conftest* + fi + + if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF + #define HAVE_DOPRNT 1 + EOF + + else + echo "$ac_t""no" 1>&6 + fi + + fi + + + for ac_hdr in stdlib.h + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 + echo "configure:5365: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:5375: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 + fi + done + + for ac_func in strtod + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 + echo "configure:5404: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* 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(); + + 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 + $ac_func(); + #endif + + ; return 0; } + EOF + if { (eval echo configure:5432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" + fi + rm -f conftest* + fi + + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 + fi + done + + echo $ac_n "checking for strtod with C89 semantics""... $ac_c" 1>&6 + echo "configure:5457: checking for strtod with C89 semantics" >&5 + if eval "test \"`echo '$''{'gawk_ac_cv_func_strtod_c89'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then + gawk_ac_cv_func_strtod_c89=no + else + cat > conftest.$ac_ext < + #else + extern double strtod(); + #endif + + int + main () + { + #if ! HAVE_STRTOD + exit(1); + #else + double d; + char *str = "0x345a"; + + d = strtod(str, 0); + if (d == 0) + exit (0); + else + exit (1); + #endif + } + EOF + if { (eval echo configure:5491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + gawk_ac_cv_func_strtod_c89=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + gawk_ac_cv_func_strtod_c89=no + fi + rm -fr conftest* + fi + + fi + + echo "$ac_t""$gawk_ac_cv_func_strtod_c89" 1>&6 + if test $gawk_ac_cv_func_strtod_c89 = no; then + cat >> confdefs.h <<\EOF + #define STRTOD_NOT_C89 1 + EOF + + fi + + for ac_hdr in sys/time.h unistd.h + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 + echo "configure:5517: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:5527: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 + fi + done + + for ac_func in alarm + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 + echo "configure:5556: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* 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(); + + 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 + $ac_func(); + #endif + + ; return 0; } + EOF + if { (eval echo configure:5584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" + fi + rm -f conftest* + fi + + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 + fi + done + + echo $ac_n "checking for working mktime""... $ac_c" 1>&6 + echo "configure:5609: checking for working mktime" >&5 + if eval "test \"`echo '$''{'ac_cv_func_working_mktime'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then + ac_cv_func_working_mktime=no + else + cat > conftest.$ac_ext < + # include + #else + # if HAVE_SYS_TIME_H + # include + # else + # include + # endif + #endif + + #if HAVE_UNISTD_H + # include + #endif + + #if !HAVE_ALARM + # define alarm(X) /* empty */ + #endif + + /* Work around redefinition to rpl_putenv by other config tests. */ + #undef putenv + + static time_t time_t_max; + + /* Values we'll use to set the TZ environment variable. */ + static const char *const tz_strings[] = { + (const char *) 0, "TZ=GMT0", "TZ=JST-9", + "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" + }; + #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) + + /* Fail if mktime fails to convert a date in the spring-forward gap. + Based on a problem report from Andreas Jaeger. */ + static void + spring_forward_gap () + { + /* glibc (up to about 1998-10-07) failed this test) */ + struct tm tm; + + /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" + instead of "TZ=America/Vancouver" in order to detect the bug even + on systems that don't support the Olson extension, or don't have the + full zoneinfo tables installed. */ + putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); + + tm.tm_year = 98; + tm.tm_mon = 3; + tm.tm_mday = 5; + tm.tm_hour = 2; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + if (mktime (&tm) == (time_t)-1) + exit (1); + } + + static void + mktime_test (now) + time_t now; + { + struct tm *lt; + if ((lt = localtime (&now)) && mktime (lt) != now) + exit (1); + now = time_t_max - now; + if ((lt = localtime (&now)) && mktime (lt) != now) + exit (1); + } + + static void + irix_6_4_bug () + { + /* Based on code from Ariel Faigon. */ + struct tm tm; + tm.tm_year = 96; + tm.tm_mon = 3; + tm.tm_mday = 0; + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_isdst = -1; + mktime (&tm); + if (tm.tm_mon != 2 || tm.tm_mday != 31) + exit (1); + } + + static void + bigtime_test (j) + int j; + { + struct tm tm; + time_t now; + tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; + now = mktime (&tm); + if (now != (time_t) -1) + { + struct tm *lt = localtime (&now); + if (! (lt + && lt->tm_year == tm.tm_year + && lt->tm_mon == tm.tm_mon + && lt->tm_mday == tm.tm_mday + && lt->tm_hour == tm.tm_hour + && lt->tm_min == tm.tm_min + && lt->tm_sec == tm.tm_sec + && lt->tm_yday == tm.tm_yday + && lt->tm_wday == tm.tm_wday + && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) + == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) + exit (1); + } + } + + int + main () + { + time_t t, delta; + int i, j; + + /* This test makes some buggy mktime implementations loop. + Give up after 60 seconds; a mktime slower than that + isn't worth using anyway. */ + alarm (60); + + for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2) + continue; + time_t_max--; + delta = time_t_max / 997; /* a suitable prime number */ + for (i = 0; i < N_STRINGS; i++) + { + if (tz_strings[i]) + putenv (tz_strings[i]); + + for (t = 0; t <= time_t_max - delta; t += delta) + mktime_test (t); + mktime_test ((time_t) 60 * 60); + mktime_test ((time_t) 60 * 60 * 24); + + for (j = 1; 0 < j; j *= 2) + bigtime_test (j); + bigtime_test (j - 1); + } + irix_6_4_bug (); + spring_forward_gap (); + exit (0); + } + EOF + if { (eval echo configure:5766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_func_working_mktime=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_working_mktime=no + fi + rm -fr conftest* + fi + + fi + + echo "$ac_t""$ac_cv_func_working_mktime" 1>&6 + if test $ac_cv_func_working_mktime = no; then + LIBOBJS="$LIBOBJS mktime.${ac_objext}" + fi + + case "$ac_cv_func_working_mktime" in + yes) cat >> confdefs.h <<\EOF + #define HAVE_MKTIME 1 + EOF + + ;; + esac + + echo $ac_n "checking for fmod in -lm""... $ac_c" 1>&6 + echo "configure:5794: checking for fmod in -lm" >&5 + ac_lib_var=`echo m'_'fmod | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" + LIBS="-lm $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* + LIBS="$ac_save_LIBS" + + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 + fi + + for ac_func in getgroups memset memcpy memcmp fmod setlocale strchr strerror \ + strftime strncasecmp strtod system tzset mbrlen mbrtowc + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 + echo "configure:5844: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* 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(); + + 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 + $ac_func(); + #endif + + ; return 0; } + EOF + if { (eval echo configure:5872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" + fi + rm -f conftest* + fi + + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 + fi + done + + + ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 + echo "configure:5899: checking for dlfcn.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" + { (eval echo configure:5909: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" + else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" + fi + rm -f conftest* + fi + if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 + echo "configure:5926: checking for dlopen in -ldl" >&5 + ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" + LIBS="-ldl $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* + LIBS="$ac_save_LIBS" + + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF + #define DYNAMIC 1 + EOF + + LIBS="$LIBS -ldl" + if test "$GCC" = yes + then + # Add others here as appropriate, + # one day use GNU libtool. + if uname | egrep -i linux > /dev/null + then + LDFLAGS="$LDFLAGS -rdynamic" + fi + fi + + else + echo "$ac_t""no" 1>&6 + fi + + else + echo "$ac_t""no" 1>&6 + fi + + + case `(uname) 2> /dev/null` in + *VMS*|*BeOS*|*OS/2*|*MS-DOS*) + cat >> confdefs.h <<\EOF + #define GETPGRP_VOID 1 + EOF + + ;; + *) echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 + echo "configure:5992: checking whether getpgrp takes no argument" >&5 + if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$cross_compiling" = yes; then + { echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; } + else + cat > conftest.$ac_ext < + #include + + int pid; + int pg1, pg2, pg3, pg4; + int ng, np, s, child; + + main() + { + pid = getpid(); + pg1 = getpgrp(0); + pg2 = getpgrp(); + pg3 = getpgrp(pid); + pg4 = getpgrp(1); + + /* + * If all of these values are the same, it's pretty sure that + * we're on a system that ignores getpgrp's first argument. + */ + if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3) + exit(0); + + child = fork(); + if (child < 0) + exit(1); + else if (child == 0) { + np = getpid(); + /* + * If this is Sys V, this will not work; pgrp will be + * set to np because setpgrp just changes a pgrp to be + * the same as the pid. + */ + setpgrp(np, pg1); + ng = getpgrp(0); /* Same result for Sys V and BSD */ + if (ng == pg1) { + exit(1); + } else { + exit(0); + } + } else { + wait(&s); + exit(s>>8); + } + } + + EOF + if { (eval echo configure:6055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_func_getpgrp_void=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_getpgrp_void=no + fi + rm -fr conftest* + fi + + + fi + + echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6 + if test $ac_cv_func_getpgrp_void = yes; then + cat >> confdefs.h <<\EOF + #define GETPGRP_VOID 1 + EOF + + fi + + ;; + esac + + + gawk_have_sockets=no + # Check for system-dependent location of socket libraries + + SOCKET_LIBS= + if test "$ISC" = yes; then + SOCKET_LIBS="-lnsl_s -linet" + else + # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And karl@cs.umb.edu says + # the Alpha needs dnet_stub (dnet does not exist). + # + # ADR: Is this needed just for sockets??? + # AC_CHECK_LIB(dnet, dnet_ntoa, [SOCKET_LIBS="$SOCKET_LIBS -ldnet"]) + # if test $ac_cv_lib_dnet_ntoa = no; then + # AC_CHECK_LIB(dnet_stub, dnet_ntoa, + # [SOCKET_LIBS="$SOCKET_LIBS -ldnet_stub"]) + # fi + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # chad@anasazi.com says the Pyramid MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to dickey@clark.net. + echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 + echo "configure:6107: checking for gethostbyname" >&5 + if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char gethostbyname(); + + 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_gethostbyname) || defined (__stub___gethostbyname) + choke me + #else + gethostbyname(); + #endif + + ; return 0; } + EOF + if { (eval echo configure:6135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_gethostbyname=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_gethostbyname=no" + fi + rm -f conftest* + fi + + if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : + else + echo "$ac_t""no" 1>&6 + fi + + if test $ac_cv_func_gethostbyname = no; then + echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 + echo "configure:6156: checking for gethostbyname in -lnsl" >&5 + ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" + LIBS="-lnsl $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* + LIBS="$ac_save_LIBS" + + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SOCKET_LIBS="$SOCKET_LIBS -lnsl" + else + echo "$ac_t""no" 1>&6 + fi + + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says simon@lia.di.epfl.ch: it contains + # gethostby* variants that don't use the nameserver (or something). + # -lsocket must be given before -lnsl if both are needed. + # We assume that if connect needs -lnsl, so does gethostbyname. + echo $ac_n "checking for connect""... $ac_c" 1>&6 + echo "configure:6205: checking for connect" >&5 + if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char connect(); + + 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_connect) || defined (__stub___connect) + choke me + #else + connect(); + #endif + + ; return 0; } + EOF + if { (eval echo configure:6233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_connect=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_connect=no" + fi + rm -f conftest* + fi + + if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : + else + echo "$ac_t""no" 1>&6 + fi + + if test $ac_cv_func_connect = no; then + echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 + echo "configure:6254: checking for connect in -lsocket" >&5 + ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" + LIBS="-lsocket $SOCKET_LIBS $LIBS" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" + fi + rm -f conftest* + LIBS="$ac_save_LIBS" + + fi + if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SOCKET_LIBS="-lsocket $SOCKET_LIBS" + gawk_have_sockets=yes + else + echo "$ac_t""no" 1>&6 + fi + + else + gawk_have_sockets=yes + fi + fi + + if test "${gawk_have_sockets}" = "yes" + then + echo $ac_n "checking where to find the socket library calls""... $ac_c" 1>&6 + echo "configure:6302: checking where to find the socket library calls" >&5 + case "${SOCKET_LIBS}" in + ?*) gawk_lib_loc="${SOCKET_LIBS}" ;; + *) gawk_lib_loc="the standard library" ;; + esac + echo "$ac_t""${gawk_lib_loc}" 1>&6 + + cat >> confdefs.h <<\EOF + #define HAVE_SOCKETS 1 + EOF + + fi + + + echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 + echo "configure:6317: checking for st_blksize in struct stat" >&5 + if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include + int main() { + struct stat s; s.st_blksize; + ; return 0; } + EOF + if { (eval echo configure:6330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_st_blksize=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_struct_st_blksize=no + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6 + if test $ac_cv_struct_st_blksize = yes; then + cat >> confdefs.h <<\EOF + #define HAVE_ST_BLKSIZE 1 + EOF + + fi + + echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 + echo "configure:6351: checking whether time.h and sys/time.h may both be included" >&5 + if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include + #include + int main() { + struct tm *tp; + ; return 0; } + EOF + if { (eval echo configure:6365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_time=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_time=no + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_header_time" 1>&6 + if test $ac_cv_header_time = yes; then + cat >> confdefs.h <<\EOF + #define TIME_WITH_SYS_TIME 1 + EOF + + fi + + echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 + echo "configure:6386: checking whether struct tm is in sys/time.h or time.h" >&5 + if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include + int main() { + struct tm *tp; tp->tm_sec; + ; return 0; } + EOF + if { (eval echo configure:6399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_tm=time.h + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_struct_tm=sys/time.h + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_struct_tm" 1>&6 + if test $ac_cv_struct_tm = sys/time.h; then + cat >> confdefs.h <<\EOF + #define TM_IN_SYS_TIME 1 + EOF + + fi + + echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 + echo "configure:6420: checking for tm_zone in struct tm" >&5 + if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include <$ac_cv_struct_tm> + int main() { + struct tm tm; tm.tm_zone; + ; return 0; } + EOF + if { (eval echo configure:6433: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_tm_zone=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_struct_tm_zone=no + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6 + if test "$ac_cv_struct_tm_zone" = yes; then + cat >> confdefs.h <<\EOF + #define HAVE_TM_ZONE 1 + EOF + + else + echo $ac_n "checking for tzname""... $ac_c" 1>&6 + echo "configure:6453: checking for tzname" >&5 + if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #ifndef tzname /* For SGI. */ + extern char *tzname[]; /* RS6000 and others reject char **tzname. */ + #endif + int main() { + atoi(*tzname); + ; return 0; } + EOF + if { (eval echo configure:6468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_var_tzname=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_var_tzname=no + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_var_tzname" 1>&6 + if test $ac_cv_var_tzname = yes; then + cat >> confdefs.h <<\EOF + #define HAVE_TZNAME 1 + EOF + + fi + fi + + + echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 + echo "configure:6491: checking whether char is unsigned" >&5 + if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test "$GCC" = yes; then + # GCC predefines this symbol on systems where it applies. + cat > conftest.$ac_ext <&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_c_char_unsigned=yes + else + rm -rf conftest* + ac_cv_c_char_unsigned=no + fi + rm -f conftest* + + else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_c_char_unsigned=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_c_char_unsigned=no + fi + rm -fr conftest* + fi + + fi + fi + + echo "$ac_t""$ac_cv_c_char_unsigned" 1>&6 + if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then + cat >> confdefs.h <<\EOF + #define __CHAR_UNSIGNED__ 1 + EOF + + fi + + echo $ac_n "checking for working const""... $ac_c" 1>&6 + echo "configure:6554: checking for working const" >&5 + if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } + + ; return 0; } + EOF + if { (eval echo configure:6608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_const=yes + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_const=no + fi + rm -f conftest* + fi + + echo "$ac_t""$ac_cv_c_const" 1>&6 + if test $ac_cv_c_const = no; then + cat >> confdefs.h <<\EOF + #define const + EOF + + fi + + echo $ac_n "checking for inline""... $ac_c" 1>&6 + echo "configure:6629: checking for inline" >&5 + if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_cv_c_inline=no + for ac_kw in inline __inline__ __inline; do + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_inline=$ac_kw; break + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* + done + + fi + + echo "$ac_t""$ac_cv_c_inline" 1>&6 + case "$ac_cv_c_inline" in + inline | yes) ;; + no) cat >> confdefs.h <<\EOF + #define inline + EOF + ;; + *) cat >> confdefs.h <&6 + echo "configure:6671: checking for preprocessor stringizing operator" >&5 + if eval "test \"`echo '$''{'ac_cv_c_stringize'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5 | + egrep "#teststring" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_c_stringize=no + else + rm -rf conftest* + ac_cv_c_stringize=yes + fi + rm -f conftest* + + fi + + if test "${ac_cv_c_stringize}" = yes + then + cat >> confdefs.h <<\EOF + #define HAVE_STRINGIZE 1 + EOF + + fi + echo "$ac_t""${ac_cv_c_stringize}" 1>&6 + + + PATH_SEPARATOR=':' + if test `uname` = 'OS/2'; then + PATH_SEPARATOR=';' + fi + + + trap '' 1 2 15 + cat > confcache <<\EOF + # 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. It is not useful on other systems. + # If it contains results you don't want to keep, you may remove or edit it. + # + # By default, configure uses ./config.cache as the cache file, + # creating it if it does not exist already. You can give configure + # the --cache-file=FILE option to use a different cache file; that is + # what configure does when it calls configure scripts in + # subdirectories, so they share the cache. + # Giving --cache-file=/dev/null disables caching, for debugging configure. + # config.status only pays attention to the cache file if you give it the + # --recheck option to rerun configure. + # + EOF + # 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 \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache + if cmp -s $cache_file confcache; then + : + else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi + fi + rm -f confcache + + trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + + test "x$prefix" = xNONE && prefix=$ac_default_prefix + # Let make expand exec_prefix. + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + + # Any assignment to VPATH causes Sun make to only execute + # the first set of double-colon rules, so remove it if not needed. + # If there is a colon in the path, we need to keep it. + if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' + fi + + trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + + DEFS=-DHAVE_CONFIG_H + + # Without the "./", some shells look in PATH for config.status. + : ${CONFIG_STATUS=./config.status} + + echo creating $CONFIG_STATUS + rm -f $CONFIG_STATUS + cat > $CONFIG_STATUS </dev/null | sed 1q`: + # + # $0 $ac_configure_args + # + # Compiler output produced by configure, useful for debugging + # configure, is in ./config.log if it exists. + + ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" + for ac_option + do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac + done + + ac_given_srcdir=$srcdir + ac_given_INSTALL="$INSTALL" + + trap 'rm -fr `echo "Makefile \ + awklib/Makefile \ + doc/Makefile \ + intl/Makefile \ + po/Makefile.in \ + test/Makefile config.h:configh.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 + EOF + cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF + $ac_vpsub + $extrasub + s%@SHELL@%$SHELL%g + s%@CFLAGS@%$CFLAGS%g + s%@CPPFLAGS@%$CPPFLAGS%g + s%@CXXFLAGS@%$CXXFLAGS%g + s%@FFLAGS@%$FFLAGS%g + s%@DEFS@%$DEFS%g + s%@LDFLAGS@%$LDFLAGS%g + s%@LIBS@%$LIBS%g + s%@exec_prefix@%$exec_prefix%g + s%@prefix@%$prefix%g + s%@program_transform_name@%$program_transform_name%g + s%@bindir@%$bindir%g + s%@sbindir@%$sbindir%g + s%@libexecdir@%$libexecdir%g + s%@datadir@%$datadir%g + s%@sysconfdir@%$sysconfdir%g + s%@sharedstatedir@%$sharedstatedir%g + s%@localstatedir@%$localstatedir%g + s%@libdir@%$libdir%g + s%@includedir@%$includedir%g + s%@oldincludedir@%$oldincludedir%g + s%@infodir@%$infodir%g + s%@mandir@%$mandir%g + s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g + s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g + s%@INSTALL_DATA@%$INSTALL_DATA%g + s%@PACKAGE@%$PACKAGE%g + s%@VERSION@%$VERSION%g + s%@EXEEXT@%$EXEEXT%g + s%@OBJEXT@%$OBJEXT%g + s%@ACLOCAL@%$ACLOCAL%g + s%@AUTOCONF@%$AUTOCONF%g + s%@AUTOMAKE@%$AUTOMAKE%g + s%@AUTOHEADER@%$AUTOHEADER%g + s%@MAKEINFO@%$MAKEINFO%g + s%@AMTAR@%$AMTAR%g + s%@install_sh@%$install_sh%g + s%@INSTALL_STRIP_PROGRAM@%$INSTALL_STRIP_PROGRAM%g + s%@AWK@%$AWK%g + s%@SET_MAKE@%$SET_MAKE%g + s%@AMDEP_TRUE@%$AMDEP_TRUE%g + s%@AMDEP_FALSE@%$AMDEP_FALSE%g + s%@AMDEPBACKSLASH@%$AMDEPBACKSLASH%g + s%@DEPDIR@%$DEPDIR%g + s%@YACC@%$YACC%g + s%@LN_S@%$LN_S%g + s%@CC@%$CC%g + s%@am__include@%$am__include%g + s%@am__quote@%$am__quote%g + s%@CCDEPMODE@%$CCDEPMODE%g + s%@CPP@%$CPP%g + s%@RANLIB@%$RANLIB%g + s%@U@%$U%g + s%@ANSI2KNR@%$ANSI2KNR%g + s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g + s%@MSGFMT@%$MSGFMT%g + s%@GMSGFMT@%$GMSGFMT%g + s%@XGETTEXT@%$XGETTEXT%g + s%@MSGMERGE@%$MSGMERGE%g + s%@host@%$host%g + s%@host_alias@%$host_alias%g + s%@host_cpu@%$host_cpu%g + s%@host_vendor@%$host_vendor%g + s%@host_os@%$host_os%g + s%@ALLOCA@%$ALLOCA%g + s%@GLIBC21@%$GLIBC21%g + s%@LIBICONV@%$LIBICONV%g + s%@LTLIBICONV@%$LTLIBICONV%g + s%@INTLBISON@%$INTLBISON%g + s%@USE_NLS@%$USE_NLS%g + s%@BUILD_INCLUDED_LIBINTL@%$BUILD_INCLUDED_LIBINTL%g + s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g + s%@CATOBJEXT@%$CATOBJEXT%g + s%@INTLOBJS@%$INTLOBJS%g + s%@DATADIRNAME@%$DATADIRNAME%g + s%@INSTOBJEXT@%$INSTOBJEXT%g + s%@GENCAT@%$GENCAT%g + s%@INTL_LIBTOOL_SUFFIX_PREFIX@%$INTL_LIBTOOL_SUFFIX_PREFIX%g + s%@INTLLIBS@%$INTLLIBS%g + s%@LIBINTL@%$LIBINTL%g + s%@LTLIBINTL@%$LTLIBINTL%g + s%@POSUB@%$POSUB%g + s%@SOCKET_LIBS@%$SOCKET_LIBS%g + s%@PATH_SEPARATOR@%$PATH_SEPARATOR%g + + CEOF + EOF + + cat >> $CONFIG_STATUS <<\EOF + + # 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_cmds=90 # Maximum number of lines to put in a sed script. + ac_file=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_cmds # 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" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi + EOF + + cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ + # $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub + s%@configure_input@%$configure_input%g + s%@srcdir@%$srcdir%g + s%@top_srcdir@%$top_srcdir%g + s%@INSTALL@%$INSTALL%g + " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file + fi; done + rm -f conftest.s* + + # 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='\3' + ac_dD='%g' + # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". + ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' + ac_uB='\([ ]\)%\1#\2define\3' + ac_uC=' ' + ac_uD='\4%g' + # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". + ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' + ac_eB='$%\1#\2define\3' + ac_eC=' ' + ac_eD='%g' + + if test "${CONFIG_HEADERS+set}" != set; then + EOF + cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + fi + for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in + + EOF + + # Transform confdefs.h into a sed script conftest.vals that substitutes + # the proper values into config.h.in to produce config.h. 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.vals + cat > conftest.hdr <<\EOF + s/[\\&%]/\\&/g + s%[\\$`]%\\&%g + s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp + s%ac_d%ac_u%gp + s%ac_u%ac_e%gp + EOF + sed -n -f conftest.hdr confdefs.h > conftest.vals + rm -f conftest.hdr + + # 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.vals <<\EOF + s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% + EOF + + # Break up conftest.vals because some shells have a limit on + # the size of here documents, and old seds have small limits too. + + rm -f conftest.tail + while : + do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in + ' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals + done + rm -f conftest.vals + + cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi + fi; done + + EOF + cat >> $CONFIG_STATUS < "\$am_dir"stamp-h\$am_indx + ;; + esac + am_indx=\`expr \$am_indx + 1\` + done + AMDEP_TRUE="$AMDEP_TRUE" + ac_aux_dir="$ac_aux_dir" + # Capture the value of obsolete $ALL_LINGUAS because we need it to compute + # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it + # from automake. + eval 'ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + + + EOF + cat >> $CONFIG_STATUS <<\EOF + test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h + + 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 + + + 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" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + fi + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + GMOFILES= + UPDATEPOFILES= + DUMMYPOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; 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 + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done + + exit 0 + EOF + chmod +x $CONFIG_STATUS + rm -fr confdefs* $ac_clean_files + test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff -crN gawk-3.1.0/configure.in gawk-3.1.1/configure.in *** gawk-3.1.0/configure.in Tue May 15 19:46:40 2001 --- gawk-3.1.1/configure.in Mon Apr 29 15:23:32 2002 *************** *** 1,7 **** dnl dnl configure.in --- autoconf input file for gawk dnl ! dnl Copyright (C) 1995-2001 the Free Software Foundation, Inc. dnl dnl This file is part of GAWK, the GNU implementation of the dnl AWK Programming Language. --- 1,7 ---- dnl dnl configure.in --- autoconf input file for gawk dnl ! dnl Copyright (C) 1995-2002 the Free Software Foundation, Inc. dnl dnl This file is part of GAWK, the GNU implementation of the dnl AWK Programming Language. *************** *** 25,35 **** AC_INIT(awk.h) AC_PREREQ(2.13) ! AM_INIT_AUTOMAKE(gawk, 3.1.0) AM_CONFIG_HEADER(config.h:configh.in) dnl Additional argument stuff AC_ARG_ENABLE(portals, [ --enable-portals Enable /p as path prefix for portals], AC_DEFINE(HAVE_PORTALS)) dnl checks for programs AC_PROG_YACC --- 25,41 ---- AC_INIT(awk.h) AC_PREREQ(2.13) ! AM_INIT_AUTOMAKE(gawk, 3.1.1) AM_CONFIG_HEADER(config.h:configh.in) dnl Additional argument stuff AC_ARG_ENABLE(portals, [ --enable-portals Enable /p as path prefix for portals], AC_DEFINE(HAVE_PORTALS)) + AC_ARG_WITH(whiny-user-strftime, [ --with-whiny-user-strftime Force use of included version of strftime for deficient systems], + if test "$withval" = yes + then + AC_DEFINE(USE_INCLUDED_STRFTIME) + fi + ) dnl checks for programs AC_PROG_YACC *************** *** 89,103 **** AM_PROG_CC_STDC AM_C_PROTOTYPES ! ALL_LINGUAS="he" ! AM_GNU_GETTEXT dnl checks for header files AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h limits.h locale.h libintl.h mcheck.h \ netdb.h netinet/in.h signum.h stdarg.h string.h \ ! sys/param.h sys/socket.h unistd.h) if test "$ac_cv_header_string_h" = yes then --- 95,111 ---- AM_PROG_CC_STDC AM_C_PROTOTYPES ! dnl initialize GNU gettext ! AM_GNU_GETTEXT([no-libtool], [need-ngettext]) dnl checks for header files AC_HEADER_STDC AC_HEADER_SYS_WAIT + AC_HEADER_TIME AC_CHECK_HEADERS(fcntl.h limits.h locale.h libintl.h mcheck.h \ netdb.h netinet/in.h signum.h stdarg.h string.h \ ! sys/param.h sys/socket.h sys/time.h unistd.h \ ! wchar.h wctype.h) if test "$ac_cv_header_string_h" = yes then *************** *** 115,120 **** --- 123,134 ---- AC_EGREP_HEADER([int.*sprintf], stdio.h, AC_DEFINE(SPRINTF_RET, int), AC_DEFINE(SPRINTF_RET, char *)) + dnl see if time_t is defined in + AC_TRY_COMPILE([#include ],[ + time_t foo; + foo = 0; + ], + AC_DEFINE(TIME_T_IN_SYS_TYPES_H)) dnl checks for functions AC_DEFINE(REGEX_MALLOC) *************** *** 128,135 **** esac AC_CHECK_LIB(m, fmod) ! AC_CHECK_FUNCS(memset memcpy memcmp fmod setlocale strchr strerror \ ! strftime strncasecmp strtod system tzset) dnl check for dynamic linking dnl This is known to be very primitive --- 142,149 ---- esac AC_CHECK_LIB(m, fmod) ! AC_CHECK_FUNCS(getgroups memset memcpy memcmp fmod setlocale strchr strerror \ ! strftime strncasecmp strtod system tzset mbrlen mbrtowc) dnl check for dynamic linking dnl This is known to be very primitive *************** *** 150,158 **** dnl check for how to use getpgrp dnl have to hardwire it for VMS POSIX. Sigh. ! dnl ditto for BeOS. case `(uname) 2> /dev/null` in ! *VMS*|*BeOS*) AC_DEFINE(GETPGRP_VOID) ;; *) AC_FUNC_GETPGRP --- 164,172 ---- dnl check for how to use getpgrp dnl have to hardwire it for VMS POSIX. Sigh. ! dnl ditto for BeOS, OS/2, and MS-DOS. case `(uname) 2> /dev/null` in ! *VMS*|*BeOS*|*OS/2*|*MS-DOS*) AC_DEFINE(GETPGRP_VOID) ;; *) AC_FUNC_GETPGRP *************** *** 174,179 **** --- 188,201 ---- AC_C_INLINE AC_C_STRINGIZE + dnl the following code is for OS/2 only and can be removed if autoconf 2.5x is used + dnl instead of autoconf 2.13 + PATH_SEPARATOR=':' + if test `uname` = 'OS/2'; then + PATH_SEPARATOR=';' + fi + AC_SUBST(PATH_SEPARATOR) + AC_OUTPUT(Makefile \ awklib/Makefile \ doc/Makefile \ diff -crN gawk-3.1.0/custom.h gawk-3.1.1/custom.h *** gawk-3.1.0/custom.h Sun Jan 21 17:52:10 2001 --- gawk-3.1.1/custom.h Tue Apr 16 14:40:47 2002 *************** *** 11,17 **** */ /* ! * Copyright (C) 1995-2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. --- 11,17 ---- */ /* ! * Copyright (C) 1995-2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. *************** *** 85,87 **** --- 85,91 ---- #define HAVE_MKTIME 1 #endif + /* For whiny users */ + #ifdef USE_INCLUDED_STRFTIME + #undef HAVE_STRFTIME + #endif diff -crN gawk-3.1.0/dfa.c gawk-3.1.1/dfa.c *** gawk-3.1.0/dfa.c Mon Apr 9 13:28:39 2001 --- gawk-3.1.1/dfa.c Tue Apr 16 14:57:13 2002 *************** *** 1,5 **** /* 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 --- 1,5 ---- /* dfa.c - deterministic extended regexp routines for GNU ! Copyright 1988, 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 General Public License as published by *************** *** 46,51 **** --- 46,61 ---- #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) *************** *** 91,107 **** 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" --- 101,122 ---- host does not conform to Posix. */ #define ISASCIIDIGIT(c) ((unsigned) (c) - '0' <= 9) + /* Don't use gettext if ENABLE_NLS is not defined */ /* If we (don't) have I18N. */ /* glibc defines _ */ ! #ifdef ENABLE_NLS ! # ifndef _ ! # ifdef HAVE_LIBINTL_H ! # include ! # ifndef _ ! # define _(Str) gettext (Str) ! # endif ! # else ! # define _(Str) (Str) # endif # endif + #else + # define _(Str) (Str) #endif #include "regex.h" *************** *** 234,239 **** --- 249,258 ---- case ORTOP: s = "ORTOP"; break; case LPAREN: s = "LPAREN"; break; case RPAREN: s = "RPAREN"; 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); *************** *** 349,356 **** static int parens; /* Count of outstanding left parens. */ static int minrep, maxrep; /* Repeat counts for {m,n}. */ /* Note that characters become unsigned here. */ ! #define FETCH(c, eoferr) \ { \ if (! lexleft) \ { \ --- 368,484 ---- static int parens; /* Count of outstanding left parens. */ static int minrep, maxrep; /* Repeat counts for {m,n}. */ + #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 wint_t + fetch_wc (char const *eoferr) + { + wchar_t wc; + if (! lexleft) + { + if (eoferr != 0) + dfaerror (eoferr); + else + return WEOF; + } + + 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) \ { \ *************** *** 362,367 **** --- 490,691 ---- (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 () + { + wint_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->multibyteb_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 = WEOF; /* 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, wctype_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 = WEOF; + } + 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 == WEOF) + 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] = (wchar_t)wc; + REALLOC_IF_NECESSARY(work_mbc->range_ends, wchar_t, + range_ends_al, work_mbc->nranges + 1); + work_mbc->range_ends[work_mbc->nranges++] = (wchar_t)wc2; + } + else if (wc != WEOF) + /* build normal characters. */ + { + REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al, + work_mbc->nchars + 1); + work_mbc->chars[work_mbc->nchars++] = (wchar_t)wc; + } + } + while ((wc = wc1) != L']'); + } + #endif /* MBS_SUPPORT */ #ifdef __STDC__ #define FUNC(F, P) static int F(int c) { return P(c); } *************** *** 442,447 **** --- 766,779 ---- 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 '\\': *************** *** 662,667 **** --- 994,1008 ---- 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)) *************** *** 687,692 **** --- 1028,1044 ---- case '[': if (backslash) goto normal_char; + #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(). */ + laststart = 0; + parse_bracket_exp_mb(); + return lasttok = MBCSET; + } + #endif zeroset(ccl); FETCH(c, _("Unbalanced [")); if (c == '^') *************** *** 815,820 **** --- 1167,1192 ---- 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 unnecessary, but it is safer to treat other symbols + as single byte characters. */ + dfa->multibyte_prop[dfa->tindex] = 3; + } + #endif + REALLOC_IF_NECESSARY(dfa->tokens, token, dfa->talloc, dfa->tindex); dfa->tokens[dfa->tindex++] = t; *************** *** 858,864 **** --- 1230,1239 ---- atom atom: + + ANYCHAR + MBCSET CSET BACKREF BEGLINE *************** *** 876,885 **** --- 1251,1281 ---- { 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 == LPAREN) { *************** *** 998,1003 **** --- 1394,1407 ---- lasttok = END; laststart = 1; parens = 0; + #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 regexp syntax bits specified")); *************** *** 1139,1144 **** --- 1543,1552 ---- 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) { *************** *** 1181,1186 **** --- 1589,1598 ---- 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]; *************** *** 1462,1467 **** --- 1874,1883 ---- 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 *************** *** 1563,1568 **** --- 1979,1987 ---- 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. */ *************** *** 1584,1589 **** --- 2003,2025 ---- 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; *************** *** 1720,1728 **** --- 2156,2201 ---- 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); *************** *** 1871,1876 **** --- 2344,2777 ---- 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 \ + && (unsigned char const *)p < buf_end) \ + ++p; \ + if ((char*)p >= end) \ + { \ + free(mblen_buf); \ + free(inputwcs); \ + return NULL; \ + } \ + } + + 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); + REALLOC(d->newlines, 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 && d->fails[works]) + { + works = d->fails[works][*p]; + rval = TRANSIT_STATE_DONE; + } + + else if (works >= 0) + { + build_state(works, d); + } + else + { + works = 0; + } + } + } + *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 a pointer to the first *************** *** 1914,1921 **** --- 2815,2894 ---- trans = d->trans; *end = eol; + #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 - begin + 2); + MALLOC(inputwcs, wchar_t, end - begin + 2); + memset(&mbs, 0, sizeof(mbstate_t)); + remain_bytes = 0; + for (i = 0; i < end - begin + 1; i++) + { + if (remain_bytes == 0) + { + remain_bytes + = mbrtowc(inputwcs + i, begin + i, end - 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 ((char *) p > end) + break; + s1 = 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 = (unsigned char *)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]) != 0) { /* hand-optimized loop */ s1 = t[*p++]; if ((t = trans[s1]) == 0) { *************** *** 1931,1940 **** { if (backref) *backref = (d->states[s].backref != 0); ! return (char *) p; } s1 = s; s = d->fails[s][*p++]; continue; } --- 2904,2933 ---- { 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 *) p; } s1 = s; + #ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) + { + unsigned char const *nextp; + nextp = p; + s = transit_state(d, s, &nextp); + p = (unsigned char *)nextp; + + /* Trans table might be updated. */ + trans = d->trans; + } + else + #endif /* MBS_SUPPORT */ s = d->fails[s][*p++]; continue; } *************** *** 1945,1951 **** /* Check if we've run off the end of the buffer. */ if ((char *) p > end) ! return NULL; if (s >= 0) { --- 2938,2953 ---- /* Check if we've run off the end of the buffer. */ if ((char *) p > end) ! { ! #ifdef MBS_SUPPORT ! if (MB_CUR_MAX > 1) ! { ! free(mblen_buf); ! free(inputwcs); ! } ! #endif /* MBS_SUPPORT */ ! return NULL; ! } if (s >= 0) { *************** *** 1976,1981 **** --- 2978,2993 ---- 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; *************** *** 2036,2041 **** --- 3048,3084 ---- 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); *************** *** 2091,2096 **** --- 3134,3143 ---- ---- ---- ----- -- -- 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 *************** *** 2536,2542 **** /* not on *my* shift */ goto done; } ! else if (t >= CSET) { /* easy enough */ resetmust(mp); --- 3583,3594 ---- /* not on *my* shift */ goto done; } ! else if (t >= CSET ! #ifdef MBS_SUPPORT ! || t == ANYCHAR ! || t == MBCSET ! #endif /* MBS_SUPPORT */ ! ) { /* easy enough */ resetmust(mp); diff -crN gawk-3.1.0/dfa.h gawk-3.1.1/dfa.h *** gawk-3.1.0/dfa.h Fri Aug 13 18:02:53 1999 --- gawk-3.1.1/dfa.h Tue Apr 16 14:57:19 2002 *************** *** 1,5 **** /* 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 --- 1,5 ---- /* dfa.h - declarations for GNU deterministic regexp compiler ! Copyright (C) 1988, 1998, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by *************** *** 136,141 **** --- 136,150 ---- RPAREN, /* RPAREN never appears in the parse tree. */ + #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. */ *************** *** 223,228 **** --- 232,243 ---- 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 *************** *** 234,239 **** --- 249,274 ---- 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 { *************** *** 252,257 **** --- 287,318 ---- 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. */ diff -crN gawk-3.1.0/doc/ChangeLog gawk-3.1.1/doc/ChangeLog *** gawk-3.1.0/doc/ChangeLog Sun Jun 3 13:05:21 2001 --- gawk-3.1.1/doc/ChangeLog Wed May 1 16:41:54 2002 *************** *** 1,3 **** --- 1,55 ---- + Wed May 1 16:41:32 2002 Arnold D. Robbins + + * Release 3.1.1: Release tar file made. + + Tue Apr 16 13:26:13 2002 Arnold D. Robbins + + * gawk.texi: FINALLY. All O'Reilly production and + indexing changes integrated. Index reviewed and + cleaned up. + * gawkinet.texi: Ditto. + * awkcard.in: Redid page breaking. + * Makefile.am (clean): Add `awkcard.tr' to list of files + that are removed. + (distclean): Depend on clean to REALLY GET `awkcard.tr'. + Sheesh. + + Mon Apr 15 14:43:51 2002 Arnold D. Robbins + + * texinfo.tex: Updated to version from Texinfo 4.2. + * gawk.texi: Modified to use new @copying command. + * gawkinet.texi: Ditto. + + Wed Mar 20 17:07:50 2002 Arnold D. Robbins + + * texinfo.tex: Updated to version from Texinfo 4.1. + + 2002-02-10 Paul Eggert + + * gawk.texi (Word Sorting): Don't use sort +1, as POSIX 1003.1-2001 + no longer allows it. Use sort -k instead. + + 2002-01-27 Bruno Haible + + * gawk.texi: Document the dcngettext function. + * awkcard.in: Likewise. + * gawk.1: Likewise. + + Mon Jan 28 18:41:02 2002 Arnold D. Robbins + + * gawkinet.texi, Makefile.am: Removed User Friendly cartoon. + Sigh. + + Wed Dec 19 16:00:39 2001 Eli Zaretskii + + * gawk.texi (Profiling): Describe the signals used for profile + dumping in the DJGPP version. + + Mon Sep 3 18:30:13 2001 Arnold D. Robbins + + * gawk.texi (Top): Put in @ifnottex so that makeinfo + --html is now happy. + Sun Jun 3 13:04:44 2001 Arnold D. Robbins * Release 3.1.0: Release tar file made. And there was diff -crN gawk-3.1.0/doc/Makefile.am gawk-3.1.1/doc/Makefile.am *** gawk-3.1.0/doc/Makefile.am Sun Jan 28 20:28:56 2001 --- gawk-3.1.1/doc/Makefile.am Tue Apr 16 15:22:53 2002 *************** *** 1,7 **** # # doc/Makefile.am --- automake input file for gawk # ! # Copyright (C) 2000, 2001 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. --- 1,7 ---- # # doc/Makefile.am --- automake input file for gawk # ! # Copyright (C) 2000, 2001, 2002 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. *************** *** 30,36 **** EXTRA_DIST = ChangeLog README.card ad.block setter.outline \ awkcard.in awkforai.txt texinfo.tex cardfonts \ macros colors no.colors $(man_MANS) \ ! uf002331.eps uf002331.jpg lflashlight.eps rflashlight.eps \ statist.jpg statist.eps MAKEINFO = @MAKEINFO@ --no-split --- 30,36 ---- EXTRA_DIST = ChangeLog README.card ad.block setter.outline \ awkcard.in awkforai.txt texinfo.tex cardfonts \ macros colors no.colors $(man_MANS) \ ! lflashlight.eps rflashlight.eps \ statist.jpg statist.eps MAKEINFO = @MAKEINFO@ --no-split *************** *** 76,80 **** $(TROFF) $(CARDSRC_N) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps && touch awkcard.nc clean: ! rm -f *.ps *~ awkcard.nc --- 76,81 ---- $(TROFF) $(CARDSRC_N) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps && touch awkcard.nc clean: ! rm -f *.ps *~ awkcard.nc awkcard.tr + distclean: clean diff -crN gawk-3.1.0/doc/Makefile.in gawk-3.1.1/doc/Makefile.in *** gawk-3.1.0/doc/Makefile.in Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/doc/Makefile.in Mon Apr 29 17:37:00 2002 *************** *** 0 **** --- 1,449 ---- + # 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@ + + # + # doc/Makefile.am --- automake input file for gawk + # + # Copyright (C) 2000, 2001, 2002 the Free Software Foundation, Inc. + # + # This file is part of GAWK, the GNU implementation of the + # AWK Programming Language. + # + # GAWK 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. + # + # GAWK 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 + # + + 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@ + CATOBJEXT = @CATOBJEXT@ + CC = @CC@ + CFLAGS = @CFLAGS@ + CPP = @CPP@ + DATADIRNAME = @DATADIRNAME@ + DEPDIR = @DEPDIR@ + EXEEXT = @EXEEXT@ + GENCAT = @GENCAT@ + GLIBC21 = @GLIBC21@ + GMSGFMT = @GMSGFMT@ + HAVE_LIB = @HAVE_LIB@ + INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ + INSTOBJEXT = @INSTOBJEXT@ + INTLBISON = @INTLBISON@ + INTLLIBS = @INTLLIBS@ + INTLOBJS = @INTLOBJS@ + INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ + LIB = @LIB@ + LIBICONV = @LIBICONV@ + LIBINTL = @LIBINTL@ + LN_S = @LN_S@ + LTLIB = @LTLIB@ + LTLIBICONV = @LTLIBICONV@ + LTLIBINTL = @LTLIBINTL@ + MKINSTALLDIRS = @MKINSTALLDIRS@ + OBJEXT = @OBJEXT@ + PACKAGE = @PACKAGE@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + POSUB = @POSUB@ + RANLIB = @RANLIB@ + SOCKET_LIBS = @SOCKET_LIBS@ + U = @U@ + USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ + USE_NLS = @USE_NLS@ + VERSION = @VERSION@ + YACC = @YACC@ + am__include = @am__include@ + am__quote = @am__quote@ + install_sh = @install_sh@ + + info_TEXINFOS = gawk.texi gawkinet.texi + + man_MANS = gawk.1 igawk.1 + + EXTRA_DIST = ChangeLog README.card ad.block setter.outline \ + awkcard.in awkforai.txt texinfo.tex cardfonts \ + macros colors no.colors $(man_MANS) \ + lflashlight.eps rflashlight.eps \ + statist.jpg statist.eps + + + MAKEINFO = @MAKEINFO@ --no-split + + TROFF = groff -t -Tps + SEDME = sed -e "s/^level0 restore/level0 restore flashme 100 72 moveto (Copyright `date '+%m-%d-%y %T'`, FSF, Inc. (all)) show/" \ + -e "s/^\/level0 save def/\/level0 save def 30 -48 translate/" + + + CARDSRC = $(srcdir)/macros $(srcdir)/cardfonts $(srcdir)/colors awkcard.tr + CARDSRC_N = $(srcdir)/macros $(srcdir)/cardfonts $(srcdir)/no.colors awkcard.tr + CARDFILES = $(CARDSRC) ad.block awkcard.in setter.outline + + # Use this if your troff can correctly handle macros from 'colors' file + AWKCARD = awkcard.ps + subdir = doc + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = $(top_builddir)/config.h + CONFIG_CLEAN_FILES = + DIST_SOURCES = + INFO_DEPS = gawk.info gawkinet.info + DVIS = gawk.dvi gawkinet.dvi + TEXINFOS = gawk.texi gawkinet.texi + + NROFF = nroff + MANS = $(man_MANS) + DIST_COMMON = ChangeLog Makefile.am Makefile.in texinfo.tex + 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 + + gawk.info: gawk.texi + gawk.dvi: gawk.texi + + gawkinet.info: gawkinet.texi + gawkinet.dvi: gawkinet.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,.*/,,'` + 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 gawk.aux gawk.cp gawk.cps gawk.dvi gawk.fn gawk.ky gawk.log gawk.pg \ + gawk.ps gawk.toc gawk.tp gawk.vr gawkinet.aux gawkinet.cp \ + gawkinet.cps gawkinet.dvi gawkinet.fn gawkinet.ky \ + gawkinet.log gawkinet.pg gawkinet.ps gawkinet.toc gawkinet.tp \ + gawkinet.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: + + 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 + + mostlyclean: mostlyclean-am + + mostlyclean-am: mostlyclean-aminfo mostlyclean-generic + + 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 mostlyclean mostlyclean-aminfo \ + mostlyclean-generic uninstall uninstall-am uninstall-info-am \ + uninstall-man uninstall-man1 + + + # Uncomment the following definition of AWKCARD if your troff can produce + # Postscript but still has troubles with macros from 'colors'. As this + # is not groff you will have to change TROFF macro as well. Do not forget + # to ensure that awkcard.tr is processed by tbl. + #AWKCARD = awkcard.nc + + postscript: gawk.ps gawkinet.ps gawk.1.ps igawk.1.ps $(AWKCARD) + + gawk.ps: gawk.dvi + dvips -o gawk.ps gawk.dvi + + gawkinet.ps: gawkinet.dvi + dvips -o gawkinet.ps gawkinet.dvi + + gawk.1.ps: gawk.1 + -groff -man $(srcdir)/gawk.1 > gawk.1.ps + + igawk.1.ps: igawk.1 + -groff -man $(srcdir)/igawk.1 > igawk.1.ps + + awkcard.tr: awkcard.in + sed 's:SRCDIR:$(srcdir):' < $(srcdir)/awkcard.in > awkcard.tr + + awkcard.ps: $(CARDFILES) + $(TROFF) $(CARDSRC) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps + + awkcard.nc: $(CARDFILES) + $(TROFF) $(CARDSRC_N) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps && touch awkcard.nc + + clean: + rm -f *.ps *~ awkcard.nc awkcard.tr + + distclean: clean + # 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 -crN gawk-3.1.0/doc/awkcard.in gawk-3.1.1/doc/awkcard.in *** gawk-3.1.0/doc/awkcard.in Mon May 14 19:56:36 2001 --- gawk-3.1.1/doc/awkcard.in Tue Apr 16 14:32:24 2002 *************** *** 1,6 **** .\" AWK Reference Card --- Arnold Robbins, arnold@gnu.org .\" ! .\" Copyright (C) 1996-2001 Free Software Foundation, Inc. .\" .\" Permission is granted to make and distribute verbatim copies of .\" this reference card provided the copyright notice and this permission --- 1,6 ---- .\" AWK Reference Card --- Arnold Robbins, arnold@gnu.org .\" ! .\" Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. .\" .\" Permission is granted to make and distribute verbatim copies of .\" this reference card provided the copyright notice and this permission *************** *** 57,71 **** Conversions And Comparisons 9 Copying Permissions 18 Definitions 2 ! Dynamic Extensions (\*(GK) 18 ! Environment Variables (\*(GK) 18 Escape Sequences 8 Expressions 11 Fields 6 FTP/HTTP Information 18 ! Historical Features (\*(GK) 18 Input Control 12 ! Internationalization (\*(GK) 16 Lines And Statements 5 Localization (\*(GK) 17 Numeric Functions 14 --- 57,71 ---- Conversions And Comparisons 9 Copying Permissions 18 Definitions 2 ! Dynamic Extensions (\*(GK) 14 ! Environment Variables (\*(GK) 16 Escape Sequences 8 Expressions 11 Fields 6 FTP/HTTP Information 18 ! Historical Features (\*(GK) 16 Input Control 12 ! Internationalization (\*(GK) 18 Lines And Statements 5 Localization (\*(GK) 17 Numeric Functions 14 *************** *** 97,105 **** \*(CD .SL .nf ! \*(FR\(co Copyright 1996-2001, Free Software Foundation ! 59 Temple Place \(em Suite 330 ! Boston, MA 02111-1307 USA .nf .BT --- 97,104 ---- \*(CD .SL .nf ! \*(FRCopyright \(co 1996, 1997, 1998, 1999, 2000, 2001, 2002 ! Free Software Foundation, Inc. .nf .BT *************** *** 111,117 **** .ES \*(CDThis card describes POSIX AWK, as well as the three freely available \*(AK implementations ! (see \fHFTP Information\fP below). \*(CLCommon extensions (in two or more versions) are printed in light blue. \*(CBFeatures specific to just one version\(emusually GNU AWK (\*(GK)\(emare printed in dark blue. --- 110,116 ---- .ES \*(CDThis card describes POSIX AWK, as well as the three freely available \*(AK implementations ! (see \fHFTP/HTTP Information\fP below). \*(CLCommon extensions (in two or more versions) are printed in light blue. \*(CBFeatures specific to just one version\(emusually GNU AWK (\*(GK)\(emare printed in dark blue. *************** *** 1422,1428 **** \*(CRThese filenames are now obsolete. Use the \*(FCPROCINFO\fP array to obtain the information they provide.\*(CL .EB "\s+2\f(HBSPECIAL FILENAMES\*(FR\s0" ! .\" --- Builtin Numeric Functions .ES .fi --- 1421,1427 ---- \*(CRThese filenames are now obsolete. Use the \*(FCPROCINFO\fP array to obtain the information they provide.\*(CL .EB "\s+2\f(HBSPECIAL FILENAMES\*(FR\s0" ! .sp .5 .\" --- Builtin Numeric Functions .ES .fi *************** *** 1445,1450 **** --- 1444,1467 ---- T} .TE .EB "\s+2\f(HBNUMERIC FUNCTIONS\*(FR\s0" + .sp .5 + .\" --- Extensions + .ES + .fi + .in +.2i + .ti -.2i + \*(CD\*(FCextension(\*(FIlib\*(FC, \*(FIfunc\*(FC)\*(FR + .br + dynamically load the shared library + \*(FIlib\*(FR + and call + \*(FIfunc\*(FR + in it to initialize the library. + This adds new built-in functions to \*(GK. + It returns the value returned by + \*(FIfunc\*(FR.\*(CB + .in -.2i + .EB "\s+2\f(HBDYNAMIC EXTENSIONS (\*(GK\f(HB)\*(FR\s0" .BT *************** *** 1647,1686 **** .in -.2i .EB "\s+2\f(HBBIT MANIPULATION FUNCTIONS (\*(GK\f(HB)\*(FR\s0" ! .\" --- Builtin Internationalizatin Functions .ES .fi ! \*(CD\*(GK ! provides the following functions for runtime message translation. ! .in +.2i ! .sp .5 ! .ti -.2i ! \*(FCbindtextdomain(\*(FIdirectory \*(FR[\*(FC, \*(FIdomain\*(FR]\*(FC)\*(FR ! .br ! specifies the directory where \*(GK looks for the \*(FC\&.mo\*(FR ! files, in case they ! will not or cannot be placed in the ``standard'' locations ! (e.g., during testing.) ! It returns the directory where \*(FIdomain\*(FR is ``bound.'' .sp .5 ! The default \*(FIdomain\*(FR is the value of \*(FCTEXTDOMAIN\*(FR. ! When \*(FIdirectory\*(FR is the null string (\*(FC"\^"\*(FR), ! \*(FCbindtextdomain()\*(FR returns the current binding for the ! given \*(FIdomain\*(FR. ! .ti -.2i ! \*(FCdcgettext(\*(FIstring \*(FR[\*(FC, \*(FIdomain \*(FR[\*(FC, \*(FIcategory\*(FR]]\*(FC)\*(FR ! .br ! returns the translation of \*(FIstring\*(FR in text domain ! \*(FIdomain\*(FR for locale category \*(FIcategory\*(FR. ! The default value for \*(FIdomain\*(FR is the current value of \*(FCTEXTDOMAIN\*(FR. ! The default value for \*(FIcategory\*(FR is \*(FC"LC_MESSAGES"\*(FR. .sp .5 ! If you supply a value for \*(FIcategory\*(FR, it must be a string equal to ! one of the known locale categories. ! You must also supply a text domain. Use \*(FCTEXTDOMAIN\*(FR ! to use the current domain.\*(CB ! .in -.2i ! .EB "\s+2\f(HBINTERNATIONALIZATION (\*(GK\f(HB)\*(FR\s0" .BT --- 1664,1706 ---- .in -.2i .EB "\s+2\f(HBBIT MANIPULATION FUNCTIONS (\*(GK\f(HB)\*(FR\s0" ! .\" --- Environment Variables .ES .fi ! \*(CDThe environment variable \*(FCAWKPATH\fP specifies a search path to use ! when finding source files named with the \*(FC\-f\fP ! option. ! The default path is ! \*(FC".:/usr/local/share/awk"\*(FR. ! .\" if this variable does not exist. ! .\" (The actual directory may vary, ! .\" depending upon how \*(GK was built and installed.) ! If a file name given to the \*(FC\-f\fP option contains a ``/'' character, ! no path search is performed. .sp .5 ! If \*(FCPOSIXLY_CORRECT\fP exists ! .\" in the environment, ! then \*(GK ! behaves exactly as if the \*(FC\-\^\-posix\fP option had been given.\*(CB ! .EB "\s+2\f(HBENVIRONMENT VARIABLES (\*(GK\f(HB)\*(FR\s0" ! ! .\" --- Historical Features ! .ES ! .fi ! \*(CD1. It is possible to call the \*(FClength()\fP ! built-in function not only with no argument, but even without parentheses. ! This feature is marked as ``deprecated'' in the POSIX standard, and \*(GK ! issues a warning about its use if \*(FC\-\^\-lint\fP ! is specified on the command line. .sp .5 ! 2. The \*(FCcontinue\fP ! and \*(FCbreak\fP statements may be used outside the body of a ! \*(FCwhile\*(FR, \*(FCfor\*(FR, or \*(FCdo\fP loop. ! Historical AWK implementations have treated such usage as ! equivalent to the \*(FCnext\fP statement. ! \*(GK supports this usage if \*(FC\-\^\-traditional\fP ! is specified.\*(CB ! .EB "\s+2\f(HBHISTORICAL FEATURES (\*(GK\f(HB)\*(FR\s0" .BT *************** *** 1756,1764 **** .sp .5 2. Mark all strings that should be translated with leading underscores. .sp .5 ! 3. Use the \*(FCdcgettext()\*(FR ! and/or \*(FCbindtextdomain()\*(FR ! functions in your program, as necessary or appropriate. .sp .5 4. Run .sp .5 --- 1776,1787 ---- .sp .5 2. Mark all strings that should be translated with leading underscores. .sp .5 ! 3. Use the ! \*(FCbindtextdomain()\*(FR, ! \*(FCdcgettext()\*(FR, ! and/or ! \*(FCdcngettext()\*(FR ! functions in your program, as appropriate. .sp .5 4. Run .sp .5 *************** *** 1777,1844 **** .BT ! .\" --- Extensions .ES .fi .in +.2i .ti -.2i ! \*(CD\*(FCextension(\*(FIlib\*(FC, \*(FIfunc\*(FC)\*(FR .br ! dynamically load the shared library ! \*(FIlib\*(FR ! and call ! \*(FIfunc\*(FR ! in it to initialize the library. ! This adds new built-in functions to \*(GK. ! It returns the value returned by ! \*(FIfunc\*(FR.\*(CB ! .in -.2i ! .EB "\s+2\f(HBDYNAMIC EXTENSIONS (\*(GK\f(HB)\*(FR\s0" ! ! .\" --- Environment Variables ! .ES ! .fi ! \*(CDThe environment variable \*(FCAWKPATH\fP specifies a search path to use ! when finding source files named with the \*(FC\-f\fP ! option. ! The default path is ! \*(FC".:/usr/local/share/awk"\*(FR, ! if this variable does not exist. ! (The actual directory may vary, ! depending upon how \*(GK was built and installed.) ! If a file name given to the \*(FC\-f\fP option contains a ``/'' character, ! no path search is performed. .sp .5 ! If \*(FCPOSIXLY_CORRECT\fP exists in the environment, then \*(GK ! behaves exactly as if \*(FC\-\^\-posix\fP had been specified on the ! command line.\*(CB ! .EB "\s+2\f(HBENVIRONMENT VARIABLES (\*(GK\f(HB)\*(FR\s0" ! ! .\" --- Historical Features ! .ES ! .fi ! \*(CD\*(GK supports two features of historical AWK implementations. ! First, it is possible to call the \*(FClength()\fP ! built-in function not only with no argument, but even without parentheses. ! This feature is marked as ``deprecated'' in the POSIX standard, and \*(GK ! issues a warning about its use if \*(FC\-\^\-lint\fP ! is specified on the command line. .sp .5 ! The other feature is the use of \*(FCcontinue\fP ! or \*(FCbreak\fP statements outside the body of a ! \*(FCwhile\*(FR, \*(FCfor\*(FR, or \*(FCdo\fP loop. ! Historical AWK implementations have treated such usage as ! equivalent to the \*(FCnext\fP statement. ! \*(GK supports this usage if \*(FC\-\^\-traditional\fP ! is specified.\*(CB ! .EB "\s+2\f(HBHISTORICAL FEATURES (\*(GK\f(HB)\*(FR\s0" ! .\" --- FTP Information .ES .nf ! \*(CDHost: \*(FCgnudist.gnu.org\*(FR ! File: \*(FC/gnu/gawk/gawk-3.1.0.tar.gz\fP .in +.2i .fi GNU \*(AK (\*(GK). There may be a later version. --- 1800,1859 ---- .BT ! .\" --- Builtin Internationalization Functions .ES .fi + \*(CD\*(GK + provides the following functions for runtime message translation. .in +.2i + .sp .5 .ti -.2i ! \*(FCbindtextdomain(\*(FIdirectory \*(FR[\*(FC, \*(FIdomain\*(FR]\*(FC)\*(FR .br ! specifies the directory where \*(GK looks for the \*(FC\&.mo\*(FR ! files, in case they ! will not or cannot be placed in the ``standard'' locations ! (e.g., during testing.) ! It returns the directory where \*(FIdomain\*(FR is ``bound.'' .sp .5 ! The default \*(FIdomain\*(FR is the value of \*(FCTEXTDOMAIN\*(FR. ! When \*(FIdirectory\*(FR is the null string (\*(FC"\^"\*(FR), ! \*(FCbindtextdomain()\*(FR returns the current binding for the ! given \*(FIdomain\*(FR. ! .ti -.2i ! \*(FCdcgettext(\*(FIstring \*(FR[\*(FC, \*(FIdomain \*(FR[\*(FC, \*(FIcategory\*(FR]]\*(FC)\*(FR ! .br ! returns the translation of \*(FIstring\*(FR in text domain ! \*(FIdomain\*(FR for locale category \*(FIcategory\*(FR. ! The default value for \*(FIdomain\*(FR is the current value of \*(FCTEXTDOMAIN\*(FR. ! The default value for \*(FIcategory\*(FR is \*(FC"LC_MESSAGES"\*(FR. .sp .5 ! If you supply a value for \*(FIcategory\*(FR, it must be a string equal to ! one of the known locale categories. ! You must also supply a text domain. Use \*(FCTEXTDOMAIN\*(FR ! to use the current domain. ! .ti -.2i ! \*(FCdcngettext(\*(FIstring1 \*(FR, \*(FIstring2 \*(FR, \*(FInumber \*(FR[\*(FC, \*(FIdomain \*(FR[\*(FC, \*(FIcategory\*(FR]]\*(FC)\*(FR ! .br ! returns the plural form used for \*(FInumber\*(FR of the translation of ! \*(FIstring1\*(FR and \*(FIstring2\*(FR in text domain ! \*(FIdomain\*(FR for locale category \*(FIcategory\*(FR. ! The default value for \*(FIdomain\*(FR is the current value of \*(FCTEXTDOMAIN\*(FR. ! The default value for \*(FIcategory\*(FR is \*(FC"LC_MESSAGES"\*(FR. ! .sp .5 ! If you supply a value for \*(FIcategory\*(FR, it must be a string equal to ! one of the known locale categories. ! You must also supply a text domain. Use \*(FCTEXTDOMAIN\*(FR ! to use the current domain.\*(CB ! .in -.2i ! .EB "\s+2\f(HBINTERNATIONALIZATION (\*(GK\f(HB)\*(FR\s0" ! .\" --- FTP/HTTP Information .ES .nf ! \*(CDHost: \*(FCftp.gnu.org\*(FR ! File: \*(FC/gnu/gawk/gawk-3.1.1.tar.gz\fP .in +.2i .fi GNU \*(AK (\*(GK). There may be a later version. *************** *** 1861,1870 **** .in -.2i .EB "\s+2\f(HBFTP/HTTP INFORMATION\*(FR\s0" .\" --- Copying Permissions .ES .fi ! \*(CDCopyright \(co 1996-2001 Free Software Foundation, Inc. .sp .5 Permission is granted to make and distribute verbatim copies of this reference card provided the copyright notice and this permission notice --- 1876,1886 ---- .in -.2i .EB "\s+2\f(HBFTP/HTTP INFORMATION\*(FR\s0" + .\" --- Copying Permissions .ES .fi ! \*(CDCopyright \(co 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. .sp .5 Permission is granted to make and distribute verbatim copies of this reference card provided the copyright notice and this permission notice diff -crN gawk-3.1.0/doc/gawk.1 gawk-3.1.1/doc/gawk.1 *** gawk-3.1.0/doc/gawk.1 Tue May 29 15:53:08 2001 --- gawk-3.1.1/doc/gawk.1 Tue Apr 16 14:02:26 2002 *************** *** 14,20 **** . if \w'\(rq' .ds rq "\(rq . \} .\} ! .TH GAWK 1 "May 29 2001" "Free Software Foundation" "Utility Commands" .SH NAME gawk \- pattern scanning and processing language .SH SYNOPSIS --- 14,20 ---- . if \w'\(rq' .ds rq "\(rq . \} .\} ! .TH GAWK 1 "Apr 16 2002" "Free Software Foundation" "Utility Commands" .SH NAME gawk \- pattern scanning and processing language .SH SYNOPSIS *************** *** 923,928 **** --- 923,929 ---- The index of the first character matched by .BR match() ; 0 if no match. + (This implies that character indices start at one.) .TP .B RLENGTH The length of the string matched by *************** *** 1494,1509 **** For example, the name .B e might be used to represent all of ! \*(lqe,\*(rq \*(lqe\h'-\w:e:u'\`,\*(rq and \*(lqe\h'-\w:e:u'\`.\*(rq In this case, .B [[=e=]] is a regular expression that matches any of .BR e , - ....BR "e\'" , .BR "e\h'-\w:e:u'\'" , or - ....BR "e\`" . .BR "e\h'-\w:e:u'\`" . .PP These features are very valuable in non-English speaking locales. --- 1495,1508 ---- For example, the name .B e might be used to represent all of ! \*(lqe,\*(rq \*(lqe\h'-\w:e:u'\',\*(rq and \*(lqe\h'-\w:e:u'\`.\*(rq In this case, .B [[=e=]] is a regular expression that matches any of .BR e , .BR "e\h'-\w:e:u'\'" , or .BR "e\h'-\w:e:u'\`" . .PP These features are very valuable in non-English speaking locales. *************** *** 1677,1683 **** \fBdelete \fIarray\^\fB[\^\fIindex\^\fB]\fR \fBdelete \fIarray\^\fR \fBexit\fR [ \fIexpression\fR ] ! \fB{ \fIstatements \fB} .fi .RE .SS "I/O Statements" --- 1676,1682 ---- \fBdelete \fIarray\^\fB[\^\fIindex\^\fB]\fR \fBdelete \fIarray\^\fR \fBexit\fR [ \fIexpression\fR ] ! \fB{ \fIstatements \fB}\fR .fi .RE .SS "I/O Statements" *************** *** 2322,2327 **** --- 2321,2327 ---- or 0 if .I t is not present. + (This implies that character indices start at one.) .TP \fBlength(\fR[\fIs\fR]\fB) Returns the length of the string *************** *** 2629,2634 **** --- 2629,2663 ---- You must also supply a text domain. Use .B TEXTDOMAIN if you want to use the current domain. + .TP + \fBdcngettext(\fIstring1 \fR, \fIstring2 \fR, \fInumber \fR[\fB, \fIdomain \fR[\fB, \fIcategory\fR]]\fB)\fR + Returns the plural form used for + .I number + of the translation of + .I string1 + and + .I string2 + in + text domain + .I domain + for locale category + .IR category . + The default value for + .I domain + is the current value of + .BR TEXTDOMAIN . + The default value for + .I category + is \fB"LC_MESSAGES"\fR. + .sp .5 + If you supply a value for + .IR category , + it must be a string equal to + one of the known locale categories described + in \*(EP. + You must also supply a text domain. Use + .B TEXTDOMAIN + if you want to use the current domain. .SH USER-DEFINED FUNCTIONS Functions in \*(AK are defined as follows: .PP *************** *** 3224,3237 **** the parse stack, generating a rather unhelpful message. Such programs are surprisingly difficult to diagnose in the completely general case, and the effort to do so really is not worth it. - .ig - .PP - .I Gawk - suffers from ``feeping creaturism.'' - It's too bad - .I perl - is so inelegant. - .. .SH AUTHORS The original version of \*(UX .I awk --- 3253,3258 ---- *************** *** 3299,3305 **** provided valuable assistance during testing and debugging. We thank him. .SH COPYING PERMISSIONS ! Copyright \(co 1989, 1991\-2001 Free Software Foundation, Inc. .PP Permission is granted to make and distribute verbatim copies of this manual page provided the copyright notice and this permission --- 3320,3327 ---- provided valuable assistance during testing and debugging. We thank him. .SH COPYING PERMISSIONS ! Copyright \(co 1989, 1991, 1992, 1993, 1994, 1995, 1996, ! 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. .PP Permission is granted to make and distribute verbatim copies of this manual page provided the copyright notice and this permission diff -crN gawk-3.1.0/doc/gawk.texi gawk-3.1.1/doc/gawk.texi *** gawk-3.1.0/doc/gawk.texi Sun May 13 18:38:13 2001 --- gawk-3.1.1/doc/gawk.texi Mon Apr 22 14:26:20 2002 *************** *** 20,28 **** @c applies to and all the info about who's publishing this edition @c These apply across the board. ! @set UPDATE-MONTH March, 2001 @set VERSION 3.1 ! @set PATCHLEVEL 0 @set FSF --- 20,28 ---- @c applies to and all the info about who's publishing this edition @c These apply across the board. ! @set UPDATE-MONTH April, 2002 @set VERSION 3.1 ! @set PATCHLEVEL 1 @set FSF *************** *** 68,73 **** --- 68,74 ---- @set DF data file @set DDF Data File @set PVERSION version + @set CTL Ctrl @ignore Some comments on the layout for TeX. *************** *** 96,114 **** @finalout @end iftex ! @c Comment out the "smallbook" for technical review. Saves ! @c considerable paper. Remember to turn it back on *before* ! @c starting the page-breaking work. ! @smallbook ! ! @ifinfo ! This file documents @command{awk}, a program that you can use to select ! particular records in a file and perform operations upon them. This is Edition @value{EDITION} of @cite{@value{TITLE}: @value{SUBTITLE}}, ! for the @value{VERSION}.@value{PATCHLEVEL} version of the GNU implementation of AWK. ! ! Copyright (C) 1989, 1991, 1992, 1993, 1996-2001 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or --- 97,109 ---- @finalout @end iftex ! @copying ! Copyright @copyright{} 1989, 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. ! @sp 2 This is Edition @value{EDITION} of @cite{@value{TITLE}: @value{SUBTITLE}}, ! for the @value{VERSION}.@value{PATCHLEVEL} (or later) version of the GNU ! implementation of AWK. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or *************** *** 127,137 **** software. Copies published by the Free Software Foundation raise funds for GNU development.'' @end enumerate ! @end ifinfo @c Uncomment this for the release. Leaving it off saves paper @c during editing and review. ! @setchapternewpage odd @titlepage @title @value{TITLE} --- 122,142 ---- software. Copies published by the Free Software Foundation raise funds for GNU development.'' @end enumerate ! @end copying ! ! @c Comment out the "smallbook" for technical review. Saves ! @c considerable paper. Remember to turn it back on *before* ! @c starting the page-breaking work. ! ! @c 4/2002: Karl Berry recommends commenting out this and the ! @c `@setchapternewpage odd', and letting users use `texi2dvi -t' ! @c if they want to waste paper. ! @c @smallbook ! @c Uncomment this for the release. Leaving it off saves paper @c during editing and review. ! @c @setchapternewpage odd @titlepage @title @value{TITLE} *************** *** 166,179 **** Registered Trademark of Paramount Pictures Corporation. @* @c sorry, i couldn't resist @sp 3 - Copyright @copyright{} 1989, 1991, 1992, 1993, 1996-2001 Free Software Foundation, Inc. - @sp 2 - - This is Edition @value{EDITION} of @cite{@value{TITLE}: @value{SUBTITLE}}, - for the @value{VERSION}.@value{PATCHLEVEL} (or later) version of the GNU - implementation of AWK. - - @sp 2 Published by: @sp 1 --- 171,176 ---- *************** *** 187,210 **** @c This one is correct for gawk 3.1.0 from the FSF ISBN 1-882114-28-0 @* ! ! 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'', the Front-Cover ! texts being (a) (see below), and with the Back-Cover Texts being (b) ! (see below). A copy of the license is included in the section entitled ! ``GNU Free Documentation License''. ! ! @enumerate a ! @item ! ``A GNU Manual'' ! ! @item ! ``You have freedom to copy and modify this GNU Manual, like GNU ! software. Copies published by the Free Software Foundation raise ! funds for GNU development.'' ! @end enumerate @sp 2 Cover art by Etienne Suvasa. @end titlepage --- 184,191 ---- @c This one is correct for gawk 3.1.0 from the FSF ISBN 1-882114-28-0 @* ! @sp 2 ! @insertcopying @sp 2 Cover art by Etienne Suvasa. @end titlepage *************** *** 237,243 **** @oddheading @| @| @strong{@thischapter}@ @ @ @thispage @end iftex ! @ifinfo @node Top, Foreword, (dir), (dir) @top General Introduction @c Preface node should come right after the Top --- 218,224 ---- @oddheading @| @| @strong{@thischapter}@ @ @ @thispage @end iftex ! @ifnottex @node Top, Foreword, (dir), (dir) @top General Introduction @c Preface node should come right after the Top *************** *** 247,257 **** This file documents @command{awk}, a program that you can use to select particular records in a file and perform operations upon them. ! This is Edition @value{EDITION} of @cite{@value{TITLE}: @value{SUBTITLE}}, ! for the @value{VERSION}.@value{PATCHLEVEL} version of the GNU implementation ! of AWK. ! @end ifinfo @menu * Foreword:: Some nice words about this --- 228,236 ---- This file documents @command{awk}, a program that you can use to select particular records in a file and perform operations upon them. ! @insertcopying ! @end ifnottex @menu * Foreword:: Some nice words about this *************** *** 309,315 **** * Acknowledgments:: Acknowledgments. * Running gawk:: How to run @command{gawk} programs; includes command-line syntax. ! * One-shot:: Running a short throw-away @command{awk} program. * Read Terminal:: Using no input files (input from terminal instead). --- 288,294 ---- * Acknowledgments:: Acknowledgments. * Running gawk:: How to run @command{gawk} programs; includes command-line syntax. ! * One-shot:: Running a short throwaway @command{awk} program. * Read Terminal:: Using no input files (input from terminal instead). *************** *** 333,339 **** * When:: When to use @command{gawk} and when to use other things. * Regexp Usage:: How to Use Regular Expressions. ! * Escape Sequences:: How to write non-printing characters. * Regexp Operators:: Regular Expression Operators. * Character Lists:: What can go between @samp{[...]}. * GNU Regexp Operators:: Operators specific to GNU software. --- 312,318 ---- * When:: When to use @command{gawk} and when to use other things. * Regexp Usage:: How to Use Regular Expressions. ! * Escape Sequences:: How to write nonprinting characters. * Regexp Operators:: Regular Expression Operators. * Character Lists:: What can go between @samp{[...]}. * GNU Regexp Operators:: Operators specific to GNU software. *************** *** 342,348 **** * Computed Regexps:: Using Dynamic Regexps. * Records:: Controlling how data is split into records. * Fields:: An introduction to fields. ! * Non-Constant Fields:: Non-constant Field Numbers. * Changing Fields:: Changing the Contents of a Field. * Field Separators:: The field separator and how to change it. * Regexp Field Splitting:: Using regexps as the field separator. --- 321,327 ---- * Computed Regexps:: Using Dynamic Regexps. * Records:: Controlling how data is split into records. * Fields:: An introduction to fields. ! * Nonconstant Fields:: Nonconstant Field Numbers. * Changing Fields:: Changing the Contents of a Field. * Field Separators:: The field separator and how to change it. * Regexp Field Splitting:: Using regexps as the field separator. *************** *** 390,396 **** * Close Files And Pipes:: Closing Input and Output Files and Pipes. * Constants:: String, numeric and regexp constants. * Scalar Constants:: Numeric and string constants. ! * Non-decimal-numbers:: What are octal and hex numbers. * Regexp Constants:: Regular Expression constants. * Using Constant Regexps:: When and how to use a regexp constant. * Variables:: Variables give names to values for later --- 369,375 ---- * Close Files And Pipes:: Closing Input and Output Files and Pipes. * Constants:: String, numeric and regexp constants. * Scalar Constants:: Numeric and string constants. ! * Nondecimal-numbers:: What are octal and hex numbers. * Regexp Constants:: Regular Expression constants. * Using Constant Regexps:: When and how to use a regexp constant. * Variables:: Variables give names to values for later *************** *** 503,509 **** * I18N Portability:: @command{awk}-level portability issues. * I18N Example:: A simple i18n example. * Gawk I18N:: @command{gawk} is also internationalized. ! * Non-decimal Data:: Allowing non-decimal input data. * Two-way I/O:: Two-way communications with another process. * TCP/IP Networking:: Using @command{gawk} for network --- 482,488 ---- * I18N Portability:: @command{awk}-level portability issues. * I18N Example:: A simple i18n example. * Gawk I18N:: @command{gawk} is also internationalized. ! * Nondecimal Data:: Allowing nondecimal input data. * Two-way I/O:: Two-way communications with another process. * TCP/IP Networking:: Using @command{gawk} for network *************** *** 595,600 **** --- 574,581 ---- and OS/2. * PC Using:: Running @command{gawk} on MS-DOS, Win32 and OS/2. + * Cygwin:: Building and running @command{gawk} for + Cygwin. * VMS Installation:: Installing @command{gawk} on VMS. * VMS Compilation:: How to compile @command{gawk} under VMS. * VMS Installation Details:: How to install @command{gawk} under VMS. *************** *** 774,780 **** You might want to extract certain lines and discard the rest. Or you may need to make changes wherever certain patterns appear, but leave the rest of the file alone. ! Writing single-use programs for these tasks in languages such as C, C++ or Pascal is time-consuming and inconvenient. Such jobs are often easier with @command{awk}. The @command{awk} utility interprets a special-purpose programming language --- 755,761 ---- You might want to extract certain lines and discard the rest. Or you may need to make changes wherever certain patterns appear, but leave the rest of the file alone. ! Writing single-use programs for these tasks in languages such as C, C++, or Pascal is time-consuming and inconvenient. Such jobs are often easier with @command{awk}. The @command{awk} utility interprets a special-purpose programming language *************** *** 788,795 **** Thus, we usually don't distinguish between @command{gawk} and other @command{awk} implementations. ! @cindex uses of @command{awk} ! @cindex applications of @command{awk} Using @command{awk} allows you to: @itemize @bullet --- 769,780 ---- Thus, we usually don't distinguish between @command{gawk} and other @command{awk} implementations. ! @cindex @command{awk}, POSIX and, See Also POSIX @command{awk} ! @cindex @command{awk}, POSIX and ! @cindex POSIX, @command{awk} and ! @cindex @command{gawk}, @command{awk} and ! @cindex @command{awk}, @command{gawk} and ! @cindex @command{awk}, uses for Using @command{awk} allows you to: @itemize @bullet *************** *** 807,816 **** @item Experiment with algorithms that you can adapt later to other computer ! languages. @end itemize ! @cindex uses of @command{gawk} In addition, @command{gawk} provides facilities that make it easy to: --- 792,803 ---- @item Experiment with algorithms that you can adapt later to other computer ! languages @end itemize ! @cindex @command{awk}, See Also @command{gawk} ! @cindex @command{gawk}, See Also @command{awk} ! @cindex @command{gawk}, uses for In addition, @command{gawk} provides facilities that make it easy to: *************** *** 823,848 **** Sort data @item ! Perform simple network communications. @end itemize This @value{DOCUMENT} teaches you about the @command{awk} language and how you can use it effectively. You should already be familiar with basic system commands, such as @command{cat} and @command{ls},@footnote{These commands ! are available on POSIX-compliant systems, as well as on traditional Unix ! based systems. If you are using some other operating system, you still need to be familiar with the ideas of I/O redirection and pipes.} as well as basic shell ! facilities, such as Input/Output (I/O) redirection and pipes. Implementations of the @command{awk} language are available for many different computing environments. This @value{DOCUMENT}, while describing the @command{awk} language in general, also describes the particular implementation of @command{awk} called @command{gawk} (which stands for ``GNU awk''). @command{gawk} runs on a broad range of Unix systems, ! ranging from 80386 PC-based computers, up through large-scale systems, such as Crays. @command{gawk} has also been ported to Mac OS X, ! MS-DOS, Microsoft Windows (all versions) and OS/2 PC's, Atari and Amiga ! micro-computers, BeOS, Tandem D20, and VMS. @menu * History:: The history of @command{gawk} and --- 810,836 ---- Sort data @item ! Perform simple network communications @end itemize This @value{DOCUMENT} teaches you about the @command{awk} language and how you can use it effectively. You should already be familiar with basic system commands, such as @command{cat} and @command{ls},@footnote{These commands ! are available on POSIX-compliant systems, as well as on traditional ! Unix-based systems. If you are using some other operating system, you still need to be familiar with the ideas of I/O redirection and pipes.} as well as basic shell ! facilities, such as input/output (I/O) redirection and pipes. + @cindex GNU @command{awk}, See @command{gawk} Implementations of the @command{awk} language are available for many different computing environments. This @value{DOCUMENT}, while describing the @command{awk} language in general, also describes the particular implementation of @command{awk} called @command{gawk} (which stands for ``GNU awk''). @command{gawk} runs on a broad range of Unix systems, ! ranging from 80386 PC-based computers up through large-scale systems, such as Crays. @command{gawk} has also been ported to Mac OS X, ! MS-DOS, Microsoft Windows (all versions) and OS/2 PCs, Atari and Amiga ! microcomputers, BeOS, Tandem D20, and VMS. @menu * History:: The history of @command{gawk} and *************** *** 876,888 **** more parts C. Document very well and release. @end quotation - @cindex acronym - @cindex history of @command{awk} @cindex Aho, Alfred @cindex Weinberger, Peter @cindex Kernighan, Brian ! @cindex old @command{awk} ! @cindex new @command{awk} The name @command{awk} comes from the initials of its designers: Alfred V.@: Aho, Peter J.@: Weinberger and Brian W.@: Kernighan. The original version of @command{awk} was written in 1977 at AT&T Bell Laboratories. --- 864,873 ---- more parts C. Document very well and release. @end quotation @cindex Aho, Alfred @cindex Weinberger, Peter @cindex Kernighan, Brian ! @cindex @command{awk}, history of The name @command{awk} comes from the initials of its designers: Alfred V.@: Aho, Peter J.@: Weinberger and Brian W.@: Kernighan. The original version of @command{awk} was written in 1977 at AT&T Bell Laboratories. *************** *** 925,948 **** @node Names, This Manual, History, Preface @section A Rose by Any Other Name ! @cindex old @command{awk} vs. new @command{awk} ! @cindex new @command{awk} vs. old @command{awk} The @command{awk} language has evolved over the years. Full details are provided in @ref{Language History, ,The Evolution of the @command{awk} Language}. The language described in this @value{DOCUMENT} is often referred to as ``new @command{awk}'' (@command{nawk}). Because of this, many systems have multiple versions of @command{awk}. Some systems have an @command{awk} utility that implements the original version of the @command{awk} language and a @command{nawk} utility for the new version. ! Others have an @command{oawk} for the ``old @command{awk}'' language and plain @command{awk} for the new one. Still others only have one version, which is usually the new one.@footnote{Often, these systems use @command{gawk} for their @command{awk} implementation!} All in all, this makes it difficult for you to know which version of @command{awk} you should run when writing your programs. The best advice I can give here is to check your local documentation. Look for @command{awk}, --- 910,935 ---- @node Names, This Manual, History, Preface @section A Rose by Any Other Name ! @cindex @command{awk}, new vs. old The @command{awk} language has evolved over the years. Full details are provided in @ref{Language History, ,The Evolution of the @command{awk} Language}. The language described in this @value{DOCUMENT} is often referred to as ``new @command{awk}'' (@command{nawk}). + @cindex @command{awk}, versions of Because of this, many systems have multiple versions of @command{awk}. Some systems have an @command{awk} utility that implements the original version of the @command{awk} language and a @command{nawk} utility for the new version. ! Others have an @command{oawk} version for the ``old @command{awk}'' language and plain @command{awk} for the new one. Still others only have one version, which is usually the new one.@footnote{Often, these systems use @command{gawk} for their @command{awk} implementation!} + @cindex @command{nawk} utility + @cindex @command{oawk} utility All in all, this makes it difficult for you to know which version of @command{awk} you should run when writing your programs. The best advice I can give here is to check your local documentation. Look for @command{awk}, *************** *** 959,1002 **** @node This Manual, Conventions, Names, Preface @section Using This Book ! @cindex book, using this ! @cindex using this book ! @cindex language, @command{awk} ! @cindex program, @command{awk} ! @ignore ! @cindex @command{awk} language ! @cindex @command{awk} program ! @end ignore ! @cindex Brandon, Dick ! @cindex sex, comparisons with ! @quotation ! @i{Documentation is like sex: when it is good, it is very, very good; and ! when it is bad, it is better than nothing.}@* ! Dick Brandon ! @end quotation The term @command{awk} refers to a particular program as well as to the language you use to tell this program what to do. When we need to be careful, we call ! the program ``the @command{awk} utility'' and the language ``the @command{awk} ! language.'' This @value{DOCUMENT} explains both the @command{awk} language and how to run the @command{awk} utility. The term @dfn{@command{awk} program} refers to a program written by you in the @command{awk} programming language. Primarily, this @value{DOCUMENT} explains the features of @command{awk}, as defined in the POSIX standard. It does so in the context of the @command{gawk} implementation. While doing so, it also attempts to describe important differences between @command{gawk} and other @command{awk} implementations.@footnote{All such differences ! appear in the index under the heading ``differences between @command{gawk} and ! @command{awk}.''} Finally, any @command{gawk} features that are not in the POSIX standard for @command{awk} are noted. @ifnotinfo This @value{DOCUMENT} has the difficult task of being both a tutorial and a reference. If you are a novice, feel free to skip over details that seem too complex. ! You should also ignore the many cross references; they are for the expert user and for the online Info version of the document. @end ifnotinfo --- 946,979 ---- @node This Manual, Conventions, Names, Preface @section Using This Book ! @cindex @command{awk}, terms describing The term @command{awk} refers to a particular program as well as to the language you use to tell this program what to do. When we need to be careful, we call ! the language ``the @command{awk} language,'' ! and the program ``the @command{awk} utility.'' This @value{DOCUMENT} explains both the @command{awk} language and how to run the @command{awk} utility. The term @dfn{@command{awk} program} refers to a program written by you in the @command{awk} programming language. + @cindex @command{gawk}, @command{awk} and + @cindex @command{awk}, @command{gawk} and + @cindex POSIX @command{awk} Primarily, this @value{DOCUMENT} explains the features of @command{awk}, as defined in the POSIX standard. It does so in the context of the @command{gawk} implementation. While doing so, it also attempts to describe important differences between @command{gawk} and other @command{awk} implementations.@footnote{All such differences ! appear in the index under the ! entry ``differences in @command{awk} and @command{gawk}.''} ! Finally, any @command{gawk} features that are not in the POSIX standard for @command{awk} are noted. @ifnotinfo This @value{DOCUMENT} has the difficult task of being both a tutorial and a reference. If you are a novice, feel free to skip over details that seem too complex. ! You should also ignore the many cross-references; they are for the expert user and for the online Info version of the document. @end ifnotinfo *************** *** 1006,1012 **** scattered throughout the @value{DOCUMENT}. They add a more complete explanation of points that are relevant, but not likely to be of interest on first reading. ! All appear in the index, under the heading ``advanced notes.'' Most of the time, the examples use complete @command{awk} programs. In some of the more advanced sections, only the part of the @command{awk} --- 983,989 ---- scattered throughout the @value{DOCUMENT}. They add a more complete explanation of points that are relevant, but not likely to be of interest on first reading. ! All appear in the index, under the heading ``advanced features.'' Most of the time, the examples use complete @command{awk} programs. In some of the more advanced sections, only the part of the @command{awk} *************** *** 1054,1060 **** @ref{Functions}, describes the built-in functions @command{awk} and ! @command{gawk} provide for you, as well as how to define your own functions. @ref{Internationalization, ,Internationalization with @command{gawk}}, --- 1031,1037 ---- @ref{Functions}, describes the built-in functions @command{awk} and ! @command{gawk} provide, as well as how to define your own functions. @ref{Internationalization, ,Internationalization with @command{gawk}}, *************** *** 1076,1087 **** @ref{Library Functions, ,A Library of @command{awk} Functions}, and @ref{Sample Programs, ,Practical @command{awk} Programs}, provide many sample @command{awk} programs. ! Reading them allows you to see @command{awk} being used ! for solving real problems. @ref{Language History, ,The Evolution of the @command{awk} Language}, ! describes how the @command{awk} language has evolved since it was ! first released to present. It also describes how @command{gawk} has acquired features over time. @ref{Installation, ,Installing @command{gawk}}, --- 1053,1064 ---- @ref{Library Functions, ,A Library of @command{awk} Functions}, and @ref{Sample Programs, ,Practical @command{awk} Programs}, provide many sample @command{awk} programs. ! Reading them allows you to see @command{awk} ! solving real problems. @ref{Language History, ,The Evolution of the @command{awk} Language}, ! describes how the @command{awk} language has evolved since ! first release to present. It also describes how @command{gawk} has acquired features over time. @ref{Installation, ,Installing @command{gawk}}, *************** *** 1101,1117 **** provides some very cursory background material for those who are completely unfamiliar with computer programming. Also centralized there is a discussion of some of the issues ! involved in using floating-point numbers. The @ref{Glossary}, defines most, if not all, the significant terms used throughout the book. ! If you find terms that you aren't familiar with, try looking them up. @ref{Copying, ,GNU General Public License}, and @ref{GNU Free Documentation License}, ! present the licenses that cover the @command{gawk} source code, and this @value{DOCUMENT}, respectively. @node Conventions, Manual History, This Manual, Preface --- 1078,1094 ---- provides some very cursory background material for those who are completely unfamiliar with computer programming. Also centralized there is a discussion of some of the issues ! surrounding floating-point numbers. The @ref{Glossary}, defines most, if not all, the significant terms used throughout the book. ! If you find terms that you aren't familiar with, try looking them up here. @ref{Copying, ,GNU General Public License}, and @ref{GNU Free Documentation License}, ! present the licenses that cover the @command{gawk} source code and this @value{DOCUMENT}, respectively. @node Conventions, Manual History, This Manual, Preface *************** *** 1157,1163 **** Characters that you type at the keyboard look @kbd{like this}. In particular, there are special characters called ``control characters.'' These are characters that you type by holding down both the @kbd{CONTROL} key and ! another key, at the same time. For example, a @kbd{Ctrl-d} is typed by first pressing and holding the @kbd{CONTROL} key, next pressing the @kbd{d} key and finally releasing both keys. --- 1134,1140 ---- Characters that you type at the keyboard look @kbd{like this}. In particular, there are special characters called ``control characters.'' These are characters that you type by holding down both the @kbd{CONTROL} key and ! another key, at the same time. For example, a @kbd{@value{CTL}-d} is typed by first pressing and holding the @kbd{CONTROL} key, next pressing the @kbd{d} key and finally releasing both keys. *************** *** 1170,1176 **** Brian Kernighan @end quotation ! @cindex d.c., see ``dark corner'' @cindex dark corner Until the POSIX standard (and @cite{The Gawk Manual}), many features of @command{awk} were either poorly documented or not --- 1147,1153 ---- Brian Kernighan @end quotation ! @cindex d.c., See dark corner @cindex dark corner Until the POSIX standard (and @cite{The Gawk Manual}), many features of @command{awk} were either poorly documented or not *************** *** 1191,1216 **** @node Manual History, How To Contribute, Conventions, Preface @unnumberedsec The GNU Project and This Book - @cindex Torvalds, Linus - @cindex sex, comparisons with - @quotation - @i{Software is like sex: it's better when it's free.}@* - Linus Torvalds - @end quotation ! @cindex FSF ! @cindex Free Software Foundation @cindex Stallman, Richard ! The Free Software Foundation (FSF) is a non-profit organization dedicated to the production and distribution of freely distributable software. It was founded by Richard M.@: Stallman, the author of the original Emacs editor. GNU Emacs is the most widely used version of Emacs today. @cindex GNU Project ! @cindex GPL ! @cindex General Public License ! @cindex GNU General Public License ! @cindex online documentation @cindex documentation, online The GNU@footnote{GNU stands for ``GNU's not Unix.''} Project is an ongoing effort on the part of the Free Software --- 1168,1185 ---- @node Manual History, How To Contribute, Conventions, Preface @unnumberedsec The GNU Project and This Book ! @cindex FSF (Free Software Foundation) ! @cindex Free Software Foundation (FSF) @cindex Stallman, Richard ! The Free Software Foundation (FSF) is a nonprofit organization dedicated to the production and distribution of freely distributable software. It was founded by Richard M.@: Stallman, the author of the original Emacs editor. GNU Emacs is the most widely used version of Emacs today. @cindex GNU Project ! @cindex GPL (General Public License) ! @cindex General Public License, See GPL @cindex documentation, online The GNU@footnote{GNU stands for ``GNU's not Unix.''} Project is an ongoing effort on the part of the Free Software *************** *** 1240,1249 **** @cindex Linux @cindex GNU/Linux ! @cindex BSD-based operating systems ! @cindex NetBSD ! @cindex FreeBSD ! @cindex OpenBSD Until the GNU operating system is more fully developed, you should consider using GNU/Linux, a freely distributable, Unix-like operating system for Intel 80386, DEC Alpha, Sun SPARC, IBM S/390, and other --- 1209,1216 ---- @cindex Linux @cindex GNU/Linux ! @cindex operating systems, BSD-based ! @cindex Alpha (DEC) Until the GNU operating system is more fully developed, you should consider using GNU/Linux, a freely distributable, Unix-like operating system for Intel 80386, DEC Alpha, Sun SPARC, IBM S/390, and other *************** *** 1260,1271 **** of @command{gawk} for their versions of @command{awk}.) @ifnotinfo ! The @value{DOCUMENT} you are reading now is actually free---at least, the ! information in it is free to anyone. The machine readable source code for the @value{DOCUMENT} comes with @command{gawk}; anyone may take this @value{DOCUMENT} to a copying machine and make as many ! copies of it as they like. (Take a moment to check the Free Documentation ! License; see @ref{GNU Free Documentation License}.) Although you could just print it out yourself, bound books are much easier to read and use. Furthermore, --- 1227,1238 ---- of @command{gawk} for their versions of @command{awk}.) @ifnotinfo ! The @value{DOCUMENT} you are reading is actually free---at least, the ! information in it is free to anyone. The machine-readable source code for the @value{DOCUMENT} comes with @command{gawk}; anyone may take this @value{DOCUMENT} to a copying machine and make as many ! copies as they like. (Take a moment to check the Free Documentation ! License in @ref{GNU Free Documentation License}.) Although you could just print it out yourself, bound books are much easier to read and use. Furthermore, *************** *** 1384,1390 **** @cindex Stallman, Richard I would like to acknowledge Richard M.@: Stallman, for his vision of a better world and for his courage in founding the FSF and starting the ! GNU project. The following people (in alphabetical order) provided helpful comments on various --- 1351,1357 ---- @cindex Stallman, Richard I would like to acknowledge Richard M.@: Stallman, for his vision of a better world and for his courage in founding the FSF and starting the ! GNU Project. The following people (in alphabetical order) provided helpful comments on various *************** *** 1394,1400 **** Karl Berry, Dr.@: Michael Brennan, Rich Burridge, ! Claire Coutier, Diane Close, Scott Deifik, Christopher (``Topher'') Eliot, --- 1361,1367 ---- Karl Berry, Dr.@: Michael Brennan, Rich Burridge, ! Claire Cloutier, Diane Close, Scott Deifik, Christopher (``Topher'') Eliot, *************** *** 1411,1417 **** @cindex Berry, Karl @cindex Chassell, Robert J.@: ! @cindex Texinfo Robert J.@: Chassell provided much valuable advice on the use of Texinfo. He also deserves special thanks for --- 1378,1384 ---- @cindex Berry, Karl @cindex Chassell, Robert J.@: ! @c @cindex Texinfo Robert J.@: Chassell provided much valuable advice on the use of Texinfo. He also deserves special thanks for *************** *** 1442,1455 **** --- 1409,1425 ---- @cindex Drepper, Ulrich @cindex GNITS mailing list + @cindex mailing list, GNITS The intrepid members of the GNITS mailing list, and most notably Ulrich Drepper, provided invaluable help and feedback for the design of the internationalization features. @cindex Beebe, Nelson @cindex Brown, Martin + @cindex Buening, Andreas @cindex Deifik, Scott @cindex Hankerson, Darrel + @cindex Hasegawa, Isamu @cindex Jaegermann, Michal @cindex Kahrs, J@"urgen @cindex Rankin, Pat *************** *** 1457,1471 **** @cindex Zaretskii, Eli Nelson Beebe, Martin Brown, Scott Deifik, Darrel Hankerson, Michal Jaegermann, J@"urgen Kahrs, Pat Rankin, Kai Uwe Rommel, and Eli Zaretskii (in alphabetical order) ! are long-time members of the @command{gawk} ``crack portability team.'' Without their hard work and help, @command{gawk} would not be nearly the fine program it is today. It has been and continues to be a pleasure working with this team of fine --- 1427,1443 ---- @cindex Zaretskii, Eli Nelson Beebe, Martin Brown, + Andreas Buening, Scott Deifik, Darrel Hankerson, + Isamu Hasegawa, Michal Jaegermann, J@"urgen Kahrs, Pat Rankin, Kai Uwe Rommel, and Eli Zaretskii (in alphabetical order) ! make up the @command{gawk} ``crack portability team.'' Without their hard work and help, @command{gawk} would not be nearly the fine program it is today. It has been and continues to be a pleasure working with this team of fine *************** *** 1487,1493 **** @cindex Robbins, Harry @cindex G-d I must thank my wonderful wife, Miriam, for her patience through ! the many versions of this project, for her proof-reading, and for sharing me with the computer. I would like to thank my parents for their love, and for the grace with which they raised and educated me. --- 1459,1465 ---- @cindex Robbins, Harry @cindex G-d I must thank my wonderful wife, Miriam, for her patience through ! the many versions of this project, for her proofreading, and for sharing me with the computer. I would like to thank my parents for their love, and for the grace with which they raised and educated me. *************** *** 1554,1563 **** @node Getting Started, Regexp, Preface, Top @chapter Getting Started with @command{awk} ! @cindex script, definition of ! @cindex rule, definition of ! @cindex program, definition of ! @cindex basic function of @command{awk} The basic function of @command{awk} is to search files for lines (or other units of text) that contain certain patterns. When a line matches one --- 1526,1536 ---- @node Getting Started, Regexp, Preface, Top @chapter Getting Started with @command{awk} ! @c @cindex script, definition of ! @c @cindex rule, definition of ! @c @cindex program, definition of ! @c @cindex basic function of @command{awk} ! @cindex @command{awk}, function of The basic function of @command{awk} is to search files for lines (or other units of text) that contain certain patterns. When a line matches one *************** *** 1565,1574 **** @command{awk} keeps processing input lines in this way until it reaches the end of the input files. ! @cindex data-driven languages ! @cindex procedural languages ! @cindex language, data-driven ! @cindex language, procedural Programs in @command{awk} are different from programs in most other languages, because @command{awk} programs are @dfn{data-driven}; that is, you describe the data you want to work with and then what to do when you find it. --- 1538,1547 ---- @command{awk} keeps processing input lines in this way until it reaches the end of the input files. ! @cindex @command{awk}, uses for ! @c comma here is NOT for secondary ! @cindex programming languages, data-driven vs. procedural ! @cindex @command{awk} programs Programs in @command{awk} are different from programs in most other languages, because @command{awk} programs are @dfn{data-driven}; that is, you describe the data you want to work with and then what to do when you find it. *************** *** 1577,1583 **** languages, it is usually much harder to clearly describe the data your program will process. For this reason, @command{awk} programs are often refreshingly easy to ! write and read. @cindex program, definition of @cindex rule, definition of --- 1550,1556 ---- languages, it is usually much harder to clearly describe the data your program will process. For this reason, @command{awk} programs are often refreshingly easy to ! read and write. @cindex program, definition of @cindex rule, definition of *************** *** 1619,1626 **** @node Running gawk, Sample Data Files, Getting Started, Getting Started @section How to Run @command{awk} Programs ! @cindex command-line formats ! @cindex running @command{awk} programs There are several ways to run an @command{awk} program. If the program is short, it is easiest to include it in the command that runs @command{awk}, like this: --- 1592,1598 ---- @node Running gawk, Sample Data Files, Getting Started, Getting Started @section How to Run @command{awk} Programs ! @cindex @command{awk} programs, running There are several ways to run an @command{awk} program. If the program is short, it is easiest to include it in the command that runs @command{awk}, like this: *************** *** 1629,1634 **** --- 1601,1607 ---- awk '@var{program}' @var{input-file1} @var{input-file2} @dots{} @end example + @cindex command line, formats When the program is long, it is usually more convenient to put it in a file and run it with a command like this: *************** *** 1640,1646 **** variations of each. @menu ! * One-shot:: Running a short throw-away @command{awk} program. * Read Terminal:: Using no input files (input from terminal instead). --- 1613,1619 ---- variations of each. @menu ! * One-shot:: Running a short throwaway @command{awk} program. * Read Terminal:: Using no input files (input from terminal instead). *************** *** 1653,1659 **** @end menu @node One-shot, Read Terminal, Running gawk, Running gawk ! @subsection One-Shot Throw-Away @command{awk} Programs Once you are familiar with @command{awk}, you will often type in simple programs the moment you want to use them. Then you can write the --- 1626,1632 ---- @end menu @node One-shot, Read Terminal, Running gawk, Running gawk ! @subsection One-Shot Throwaway @command{awk} Programs Once you are familiar with @command{awk}, you will often type in simple programs the moment you want to use them. Then you can write the *************** *** 1667,1673 **** where @var{program} consists of a series of @var{patterns} and @var{actions}, as described earlier. ! @cindex single quotes, why needed This command format instructs the @dfn{shell}, or command interpreter, to start @command{awk} and use the @var{program} to process records in the input file(s). There are single quotes around @var{program} so --- 1640,1647 ---- where @var{program} consists of a series of @var{patterns} and @var{actions}, as described earlier. ! @cindex single quote (@code{'}) ! @cindex @code{'} (single quote) This command format instructs the @dfn{shell}, or command interpreter, to start @command{awk} and use the @var{program} to process records in the input file(s). There are single quotes around @var{program} so *************** *** 1676,1681 **** --- 1650,1657 ---- a single argument for @command{awk}, and allow @var{program} to be more than one line long. + @cindex shells, scripts + @cindex @command{awk} programs, running, from shell scripts This format is also useful for running short or medium-sized @command{awk} programs from shell scripts, because it avoids the need for a separate file for the @command{awk} program. A self-contained shell script is more *************** *** 1710,1715 **** --- 1686,1692 ---- @cindex standard input @cindex input, standard + @cindex input files, running @command{awk} without You can also run @command{awk} without any input files. If you type the following command line: *************** *** 1720,1741 **** @noindent @command{awk} applies the @var{program} to the @dfn{standard input}, which usually means whatever you type on the terminal. This continues ! until you indicate end-of-file by typing @kbd{Ctrl-d}. (On other operating systems, the end-of-file character may be different. ! For example, on OS/2 and MS-DOS, it is @kbd{Ctrl-z}.) As an example, the following program prints a friendly piece of advice (from Douglas Adams's @cite{The Hitchhiker's Guide to the Galaxy}), ! to keep you from worrying about the complexities of computer programming. ! (@code{BEGIN} is a feature we haven't discussed yet.): @example $ awk "BEGIN @{ print \"Don't Panic!\" @}" @print{} Don't Panic! @end example ! @cindex quoting, shell ! @cindex shell quoting This program does not read any input. The @samp{\} before each of the inner double quotes is necessary because of the shell's quoting rules---in particular because it mixes both single quotes and --- 1697,1724 ---- @noindent @command{awk} applies the @var{program} to the @dfn{standard input}, which usually means whatever you type on the terminal. This continues ! until you indicate end-of-file by typing @kbd{@value{CTL}-d}. (On other operating systems, the end-of-file character may be different. ! For example, on OS/2 and MS-DOS, it is @kbd{@value{CTL}-z}.) + @cindex files, input, See input files + @cindex input files, running @command{awk} without + @cindex @command{awk} programs, running, without input files As an example, the following program prints a friendly piece of advice (from Douglas Adams's @cite{The Hitchhiker's Guide to the Galaxy}), ! to keep you from worrying about the complexities of computer programming ! (@code{BEGIN} is a feature we haven't discussed yet): @example $ awk "BEGIN @{ print \"Don't Panic!\" @}" @print{} Don't Panic! @end example ! @cindex quoting ! @cindex double quote (@code{"}) ! @cindex @code{"} (double quote) ! @cindex @code{\} (backslash) ! @cindex backslash (@code{\}) This program does not read any input. The @samp{\} before each of the inner double quotes is necessary because of the shell's quoting rules---in particular because it mixes both single quotes and *************** *** 1744,1751 **** put the single quote into the message.} This next simple @command{awk} program ! emulates the @command{cat} utility; it copies whatever you type at the ! keyboard to its standard output. (Why this works is explained shortly.) @example $ awk '@{ print @}' --- 1727,1734 ---- put the single quote into the message.} This next simple @command{awk} program ! emulates the @command{cat} utility; it copies whatever you type on the ! keyboard to its standard output (why this works is explained shortly). @example $ awk '@{ print @}' *************** *** 1757,1773 **** @print{} Four score and seven years ago, ... What, me worry? @print{} What, me worry? ! @kbd{Ctrl-d} @end example @node Long, Executable Scripts, Read Terminal, Running gawk @subsection Running Long Programs ! @cindex running long programs ! @cindex @code{-f} option ! @cindex command-line option, @code{-f} ! @cindex program file ! @cindex file, @command{awk} program Sometimes your @command{awk} programs can be very long. In this case, it is more convenient to put the program into a separate file. In order to tell @command{awk} to use that file for its program, you type: --- 1740,1754 ---- @print{} Four score and seven years ago, ... What, me worry? @print{} What, me worry? ! @kbd{@value{CTL}-d} @end example @node Long, Executable Scripts, Read Terminal, Running gawk @subsection Running Long Programs ! @cindex @command{awk} programs, running ! @cindex @command{awk} programs, lengthy ! @cindex files, @command{awk} programs in Sometimes your @command{awk} programs can be very long. In this case, it is more convenient to put the program into a separate file. In order to tell @command{awk} to use that file for its program, you type: *************** *** 1776,1781 **** --- 1757,1765 ---- awk -f @var{source-file} @var{input-file1} @var{input-file2} @dots{} @end example + @cindex @code{-f} option + @cindex command line, options + @cindex options, command-line The @option{-f} instructs the @command{awk} utility to get the @command{awk} program from the file @var{source-file}. Any @value{FN} can be used for @var{source-file}. For example, you could put the program: *************** *** 1798,1805 **** awk "BEGIN @{ print \"Don't Panic!\" @}" @end example ! @cindex quoting, shell ! @cindex shell quoting @noindent This was explained earlier (@pxref{Read Terminal, ,Running @command{awk} Without Input Files}). --- 1782,1788 ---- awk "BEGIN @{ print \"Don't Panic!\" @}" @end example ! @cindex quoting @noindent This was explained earlier (@pxref{Read Terminal, ,Running @command{awk} Without Input Files}). *************** *** 1809,1814 **** --- 1792,1801 ---- program did not have single quotes around it. The quotes are only needed for programs that are provided on the @command{awk} command line. + @c STARTOFRANGE sq1x + @cindex single quote (@code{'}) + @c STARTOFRANGE qs2x + @cindex @code{'} (single quote) If you want to identify your @command{awk} program files clearly as such, you can add the extension @file{.awk} to the @value{FN}. This doesn't affect the execution of the @command{awk} program but it does make *************** *** 1816,1826 **** @node Executable Scripts, Comments, Long, Running gawk @subsection Executable @command{awk} Programs ! @cindex executable scripts ! @cindex scripts, executable ! @cindex self-contained programs ! @cindex program, self-contained ! @cindex @code{#!} (executable scripts) Once you have learned @command{awk}, you may want to write self-contained @command{awk} scripts, using the @samp{#!} script mechanism. You can do --- 1803,1814 ---- @node Executable Scripts, Comments, Long, Running gawk @subsection Executable @command{awk} Programs ! @cindex @command{awk} programs ! @cindex @code{#} (number sign), @code{#!} (executable scripts) ! @cindex number sign (@code{#}), @code{#!} (executable scripts) ! @cindex Unix, @command{awk} scripts and ! @cindex @code{#} (number sign), @code{#!} (executable scripts), portability issues with ! @cindex number sign (@code{#}), @code{#!} (executable scripts), portability issues with Once you have learned @command{awk}, you may want to write self-contained @command{awk} scripts, using the @samp{#!} script mechanism. You can do *************** *** 1845,1851 **** interpreter. The operating system then runs the interpreter with the given argument and the full argument list of the executed program. The first argument in the list is the full @value{FN} of the @command{awk} program. The rest of the ! argument list is either options to @command{awk}, or @value{DF}s, or both.} as if you had typed @samp{awk -f advice}: --- 1833,1839 ---- interpreter. The operating system then runs the interpreter with the given argument and the full argument list of the executed program. The first argument in the list is the full @value{FN} of the @command{awk} program. The rest of the ! argument list contains either options to @command{awk}, or @value{DF}s, or both.} as if you had typed @samp{awk -f advice}: *************** *** 1862,1868 **** @c fakenode --- for prepinfo @subheading Advanced Notes: Portability Issues with @samp{#!} ! @cindex advanced notes Some systems limit the length of the interpreter name to 32 characters. Often, this can be dealt with by using a symbolic link. --- 1850,1856 ---- @c fakenode --- for prepinfo @subheading Advanced Notes: Portability Issues with @samp{#!} ! @cindex portability, @code{#!} (executable scripts) Some systems limit the length of the interpreter name to 32 characters. Often, this can be dealt with by using a symbolic link. *************** *** 1873,1879 **** Doing this leads to confusing behavior---most likely a usage diagnostic of some sort from @command{awk}. ! @cindex portability issues Finally, the value of @code{ARGV[0]} (@pxref{Built-in Variables}) --- 1861,1868 ---- Doing this leads to confusing behavior---most likely a usage diagnostic of some sort from @command{awk}. ! @cindex @code{ARGC}/@code{ARGV} variables, portability and ! @cindex portability, @code{ARGV} variable Finally, the value of @code{ARGV[0]} (@pxref{Built-in Variables}) *************** *** 1885,1895 **** @node Comments, Quoting, Executable Scripts, Running gawk @subsection Comments in @command{awk} Programs ! @cindex @code{#} (comment) ! @cindex comments ! @cindex use of comments ! @cindex documenting @command{awk} programs ! @cindex programs, documenting A @dfn{comment} is some text that is included in a program for the sake of human readers; it is not really an executable part of the program. Comments --- 1874,1883 ---- @node Comments, Quoting, Executable Scripts, Running gawk @subsection Comments in @command{awk} Programs ! @cindex @code{#} (number sign), commenting ! @cindex number sign (@code{#}), commenting ! @cindex commenting ! @cindex @command{awk} programs, documenting A @dfn{comment} is some text that is included in a program for the sake of human readers; it is not really an executable part of the program. Comments *************** *** 1909,1923 **** BEGIN @{ print "Don't Panic!" @} @end example ! You can put comment lines into keyboard-composed throw-away @command{awk} programs, but this usually isn't very useful; the purpose of a comment is to help you or another person understand the program when reading it at a later time. ! @cindex quoting, shell ! @cindex shell quoting @strong{Caution:} As mentioned in ! @ref{One-shot, ,One-Shot Throw-Away @command{awk} Programs}, you can enclose small to medium programs in single quotes, in order to keep your shell scripts self-contained. When doing so, @emph{don't} put an apostrophe (i.e., a single quote) into a comment (or anywhere else --- 1897,1912 ---- BEGIN @{ print "Don't Panic!" @} @end example ! You can put comment lines into keyboard-composed throwaway @command{awk} programs, but this usually isn't very useful; the purpose of a comment is to help you or another person understand the program when reading it at a later time. ! @cindex quoting ! @cindex single quote (@code{'}), vs. apostrophe ! @cindex @code{'} (single quote), vs. apostrophe @strong{Caution:} As mentioned in ! @ref{One-shot, ,One-Shot Throwaway @command{awk} Programs}, you can enclose small to medium programs in single quotes, in order to keep your shell scripts self-contained. When doing so, @emph{don't} put an apostrophe (i.e., a single quote) into a comment (or anywhere else *************** *** 1933,1939 **** @end example The shell sees that the first two quotes match, and that ! a new quoted object begins at the end of the command-line. It therefore prompts with the secondary prompt, waiting for more input. With Unix @command{awk}, closing the quoted string produces this result: --- 1922,1928 ---- @end example The shell sees that the first two quotes match, and that ! a new quoted object begins at the end of the command line. It therefore prompts with the secondary prompt, waiting for more input. With Unix @command{awk}, closing the quoted string produces this result: *************** *** 1944,1959 **** @error{} source line number 1 @end example Putting a backslash before the single quote in @samp{let's} wouldn't help, since backslashes are not special inside single quotes. The next @value{SUBSECTION} describes the shell's quoting rules. @node Quoting, , Comments, Running gawk ! @subsection Shell Quoting Issues ! @c the indexing here is purposely different, until we ! @c get a way to mark the defining instance for an index entry ! @cindex quoting rules, shell ! @cindex shell quoting rules For short to medium length @command{awk} programs, it is most convenient to enter the program on the @command{awk} command line. --- 1933,1947 ---- @error{} source line number 1 @end example + @cindex @code{\} (backslash) + @cindex backslash (@code{\}) Putting a backslash before the single quote in @samp{let's} wouldn't help, since backslashes are not special inside single quotes. The next @value{SUBSECTION} describes the shell's quoting rules. @node Quoting, , Comments, Running gawk ! @subsection Shell-Quoting Issues ! @cindex quoting, rules for For short to medium length @command{awk} programs, it is most convenient to enter the program on the @command{awk} command line. *************** *** 1965,1971 **** awk '@var{program text}' @var{input-file1} @var{input-file2} @dots{} @end example ! @cindex @command{csh} utility Once you are working with the shell, it is helpful to have a basic knowledge of shell quoting rules. The following rules apply only to POSIX-compliant, Bourne-style shells (such as @command{bash}, the GNU Bourne-Again --- 1953,1960 ---- awk '@var{program text}' @var{input-file1} @var{input-file2} @dots{} @end example ! @cindex shells, quoting, rules for ! @cindex Bourne shell, quoting rules for Once you are working with the shell, it is helpful to have a basic knowledge of shell quoting rules. The following rules apply only to POSIX-compliant, Bourne-style shells (such as @command{bash}, the GNU Bourne-Again *************** *** 1983,2004 **** character on to the command. @item Single quotes protect everything between the opening and closing quotes. The shell does no interpretation of the quoted text, passing it on verbatim to the command. It is @emph{impossible} to embed a single quote inside single-quoted text. Refer back to @ref{Comments, ,Comments in @command{awk} Programs}, ! for an example showing what happens if you try. @item Double quotes protect most things between the opening and closing quotes. The shell does at least variable and command substitution on the quoted text. Different shells may do additional kinds of processing on double-quoted text. Since certain characters within double-quoted text are processed by the shell, they must be @dfn{escaped} within the text. Of note are the characters ! @samp{$}, @samp{`}, @samp{\} and @samp{"}, all of which must be preceded by a backslash within double-quoted text if they are to be passed on literally to the program. (The leading backslash is stripped first.) Thus, the example seen --- 1972,1999 ---- character on to the command. @item + @cindex @code{\} (backslash) + @cindex backslash (@code{\}) + @cindex single quote (@code{'}) + @cindex @code{'} (single quote) Single quotes protect everything between the opening and closing quotes. The shell does no interpretation of the quoted text, passing it on verbatim to the command. It is @emph{impossible} to embed a single quote inside single-quoted text. Refer back to @ref{Comments, ,Comments in @command{awk} Programs}, ! for an example of what happens if you try. @item + @cindex double quote (@code{"}) + @cindex @code{"} (double quote) Double quotes protect most things between the opening and closing quotes. The shell does at least variable and command substitution on the quoted text. Different shells may do additional kinds of processing on double-quoted text. Since certain characters within double-quoted text are processed by the shell, they must be @dfn{escaped} within the text. Of note are the characters ! @samp{$}, @samp{`}, @samp{\}, and @samp{"}, all of which must be preceded by a backslash within double-quoted text if they are to be passed on literally to the program. (The leading backslash is stripped first.) Thus, the example seen *************** *** 2013,2018 **** --- 2008,2015 ---- @print{} Don't Panic! @end example + @cindex single quote (@code{'}), with double quotes + @cindex @code{'} (single quote), with double quotes Note that the single quote is not special within double quotes. @item *************** *** 2026,2031 **** --- 2023,2029 ---- @end example @noindent + @cindex null strings, quoting and Don't use this: @example *************** *** 2038,2044 **** This results in syntax errors at best, and confusing behavior at worst. @end itemize ! @cindex shell quoting, tricks Mixing single and double quotes is difficult. You have to resort to shell quoting tricks, like this: --- 2036,2042 ---- This results in syntax errors at best, and confusing behavior at worst. @end itemize ! @cindex quoting, tricks for Mixing single and double quotes is difficult. You have to resort to shell quoting tricks, like this: *************** *** 2070,2075 **** --- 2068,2075 ---- @end example @noindent + @c ENDOFRANGE sq1x + @c ENDOFRANGE qs2x This option is also painful, because double quotes, backslashes, and dollar signs are very common in @command{awk} programs. *************** *** 2081,2097 **** @section @value{DDF}s for the Examples @c For gawk >= 3.2, update these data files. No-one has such slow modems! ! @cindex input file, sample ! @cindex sample input files ! @cindex @file{BBS-list} file Many of the examples in this @value{DOCUMENT} take their input from two sample ! @value{DF}s. The first, called @file{BBS-list}, represents a list of computer bulletin board systems together with information about those systems. The second @value{DF}, called @file{inventory-shipped}, contains information about monthly shipments. In both files, each line is considered to be one @dfn{record}. ! In the file @file{BBS-list}, each record contains the name of a computer bulletin board, its phone number, the board's baud rate(s), and a code for the number of hours it is operational. An @samp{A} in the last column means the board operates 24 hours a day. A @samp{B} in the last --- 2081,2096 ---- @section @value{DDF}s for the Examples @c For gawk >= 3.2, update these data files. No-one has such slow modems! ! @cindex input files, examples ! @cindex @code{BBS-list} file Many of the examples in this @value{DOCUMENT} take their input from two sample ! @value{DF}s. The first, @file{BBS-list}, represents a list of computer bulletin board systems together with information about those systems. The second @value{DF}, called @file{inventory-shipped}, contains information about monthly shipments. In both files, each line is considered to be one @dfn{record}. ! In the @value{DF} @file{BBS-list}, each record contains the name of a computer bulletin board, its phone number, the board's baud rate(s), and a code for the number of hours it is operational. An @samp{A} in the last column means the board operates 24 hours a day. A @samp{B} in the last *************** *** 2120,2127 **** @c endfile @end example ! @cindex @file{inventory-shipped} file ! The second @value{DF}, called @file{inventory-shipped}, represents information about shipments during the year. Each record contains the month, the number of green crates shipped, the number of red boxes shipped, the number of --- 2119,2126 ---- @c endfile @end example ! @cindex @code{inventory-shipped} file ! The @value{DF} @file{inventory-shipped} represents information about shipments during the year. Each record contains the month, the number of green crates shipped, the number of red boxes shipped, the number of *************** *** 2173,2182 **** @section Some Simple Examples The following command runs a simple @command{awk} program that searches the ! input file @file{BBS-list} for the character string @samp{foo}. (A ! string of characters is usually called a @dfn{string}. ! The term @dfn{string} is based on similar usage in English, such ! as ``a string of pearls,'' or, ``a string of cars in a train.''): @example awk '/foo/ @{ print $0 @}' BBS-list --- 2172,2181 ---- @section Some Simple Examples The following command runs a simple @command{awk} program that searches the ! input file @file{BBS-list} for the character string @samp{foo} (a ! grouping of characters is usually called a @dfn{string}; ! the term @dfn{string} is based on similar usage in English, such ! as ``a string of pearls,'' or ``a string of cars in a train''): @example awk '/foo/ @{ print $0 @}' BBS-list *************** *** 2208,2231 **** @print{} sabafoo 555-2127 1200/300 C @end example ! @cindex action, default ! @cindex pattern, default ! @cindex default action ! @cindex default pattern In an @command{awk} rule, either the pattern or the action can be omitted, but not both. If the pattern is omitted, then the action is performed for @emph{every} input line. If the action is omitted, the default action is to print all lines that match the pattern. ! @cindex empty action ! @cindex action, empty Thus, we could leave out the action (the @code{print} statement and the curly ! braces) in the above example and the result would be the same: all lines matching the pattern @samp{foo} are printed. By comparison, omitting the @code{print} statement but retaining the curly braces makes an empty action that does nothing (i.e., no lines are printed). ! @cindex one-liners Many practical @command{awk} programs are just a line or two. Following is a collection of useful, short programs to get you started. Some of these programs contain constructs that haven't been covered yet. (The description --- 2207,2227 ---- @print{} sabafoo 555-2127 1200/300 C @end example ! @cindex actions, default ! @cindex patterns, default In an @command{awk} rule, either the pattern or the action can be omitted, but not both. If the pattern is omitted, then the action is performed for @emph{every} input line. If the action is omitted, the default action is to print all lines that match the pattern. ! @cindex actions, empty Thus, we could leave out the action (the @code{print} statement and the curly ! braces) in the previous example and the result would be the same: all lines matching the pattern @samp{foo} are printed. By comparison, omitting the @code{print} statement but retaining the curly braces makes an empty action that does nothing (i.e., no lines are printed). ! @cindex @command{awk} programs, one-line examples Many practical @command{awk} programs are just a line or two. Following is a collection of useful, short programs to get you started. Some of these programs contain constructs that haven't been covered yet. (The description *************** *** 2314,2320 **** @end example @item ! Count lines in a file: @example awk 'END @{ print NR @}' data --- 2310,2316 ---- @end example @item ! Count the lines in a file: @example awk 'END @{ print NR @}' data *************** *** 2328,2339 **** @end example If you use the expression @samp{NR % 2 == 1} instead, ! it would print the odd-numbered lines. @end itemize @node Two Rules, More Complex, Very Simple, Getting Started @section An Example with Two Rules ! @cindex how @command{awk} works The @command{awk} utility reads the input files one line at a time. For each line, @command{awk} tries the patterns of each of the rules. --- 2324,2335 ---- @end example If you use the expression @samp{NR % 2 == 1} instead, ! the program would print the odd-numbered lines. @end itemize @node Two Rules, More Complex, Very Simple, Getting Started @section An Example with Two Rules ! @cindex @command{awk} programs The @command{awk} utility reads the input files one line at a time. For each line, @command{awk} tries the patterns of each of the rules. *************** *** 2345,2351 **** @command{awk} reads the next line. (However, @pxref{Next Statement, ,The @code{next} Statement}, and also @pxref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}). ! This continues until the end of the file is reached. For example, the following @command{awk} program contains two rules: @example --- 2341,2347 ---- @command{awk} reads the next line. (However, @pxref{Next Statement, ,The @code{next} Statement}, and also @pxref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}). ! This continues until the program reaches the end of the file. For example, the following @command{awk} program contains two rules: @example *************** *** 2364,2370 **** strings, it is printed twice, once by each rule. This is what happens if we run this program on our two sample @value{DF}s, ! @file{BBS-list} and @file{inventory-shipped}, as shown here: @example $ awk '/12/ @{ print $0 @} --- 2360,2366 ---- strings, it is printed twice, once by each rule. This is what happens if we run this program on our two sample @value{DF}s, ! @file{BBS-list} and @file{inventory-shipped}: @example $ awk '/12/ @{ print $0 @} *************** *** 2403,2418 **** END @{ print sum @}' @end example ! @cindex @command{csh} utility ! @cindex @command{csh}, backslash continuation ! @cindex backslash continuation, in @command{csh} @cindex @command{ls} utility This command prints the total number of bytes in all the files in the current directory that were last modified in November (of any year). @footnote{In the C shell (@command{csh}), you need to type a semicolon and then a backslash at the end of the first line; see @ref{Statements/Lines, ,@command{awk} Statements Versus Lines}, for an ! explanation as to why. In a POSIX-compliant shell, such as the Bourne shell or @command{bash}, you can type the example as shown. If the command @samp{echo $path} produces an empty output line, you are most likely using a POSIX-compliant shell. Otherwise, you are probably using the --- 2399,2414 ---- END @{ print sum @}' @end example ! @cindex @command{csh} utility, backslash continuation and @cindex @command{ls} utility + @cindex backslash (@code{\}), continuing lines and, in @command{csh} + @cindex @code{\} (backslash), continuing lines and, in @command{csh} This command prints the total number of bytes in all the files in the current directory that were last modified in November (of any year). @footnote{In the C shell (@command{csh}), you need to type a semicolon and then a backslash at the end of the first line; see @ref{Statements/Lines, ,@command{awk} Statements Versus Lines}, for an ! explanation. In a POSIX-compliant shell, such as the Bourne shell or @command{bash}, you can type the example as shown. If the command @samp{echo $path} produces an empty output line, you are most likely using a POSIX-compliant shell. Otherwise, you are probably using the *************** *** 2433,2448 **** @end example @noindent The first field contains read-write permissions, the second field contains the number of links to the file, and the third field identifies the owner of the file. The fourth field identifies the group of the file. The fifth field contains the size of the file in bytes. The ! sixth, seventh and eighth fields contain the month, day, and time, respectively, that the file was last modified. Finally, the ninth field contains the name of the file.@footnote{On some very old systems, you may need to use @samp{ls -lg} to get this output.} ! @cindex automatic initialization @cindex initialization, automatic The @samp{$6 == "Nov"} in our @command{awk} program is an expression that tests whether the sixth field of the output from @w{@samp{ls -l}} --- 2429,2445 ---- @end example @noindent + @cindex line continuations, with C shell The first field contains read-write permissions, the second field contains the number of links to the file, and the third field identifies the owner of the file. The fourth field identifies the group of the file. The fifth field contains the size of the file in bytes. The ! sixth, seventh, and eighth fields contain the month, day, and time, respectively, that the file was last modified. Finally, the ninth field contains the name of the file.@footnote{On some very old systems, you may need to use @samp{ls -lg} to get this output.} ! @c @cindex automatic initialization @cindex initialization, automatic The @samp{$6 == "Nov"} in our @command{awk} program is an expression that tests whether the sixth field of the output from @w{@samp{ls -l}} *************** *** 2462,2474 **** (@pxref{Action Overview, ,Actions}). Before you can move on to more advanced @command{awk} programming, you have to know how @command{awk} interprets your input and displays your output. By manipulating fields and using ! @code{print} statements, you can produce some very useful and impressive ! looking reports. @node Statements/Lines, Other Features, More Complex, Getting Started @section @command{awk} Statements Versus Lines ! @cindex line break ! @cindex newline Most often, each line in an @command{awk} program is a separate statement or separate rule, like this: --- 2459,2471 ---- (@pxref{Action Overview, ,Actions}). Before you can move on to more advanced @command{awk} programming, you have to know how @command{awk} interprets your input and displays your output. By manipulating fields and using ! @code{print} statements, you can produce some very useful and ! impressive-looking reports. @node Statements/Lines, Other Features, More Complex, Getting Started @section @command{awk} Statements Versus Lines ! @cindex line breaks ! @cindex newlines Most often, each line in an @command{awk} program is a separate statement or separate rule, like this: *************** *** 2478,2483 **** --- 2475,2481 ---- /21/ @{ print $0 @}' BBS-list inventory-shipped @end example + @cindex @command{gawk}, newlines in However, @command{gawk} ignores newlines after any of the following symbols and keywords: *************** *** 2494,2502 **** extension; if @option{--posix} is specified (@pxref{Options, , Command-Line Options}), then this extension is disabled.} ! @cindex backslash continuation ! @cindex continuation of lines ! @cindex line continuation If you would like to split a single statement into two lines at a point where a newline would terminate it, you can @dfn{continue} it by ending the first line with a backslash character (@samp{\}). The backslash must be --- 2492,2499 ---- extension; if @option{--posix} is specified (@pxref{Options, , Command-Line Options}), then this extension is disabled.} ! @cindex @code{\} (backslash), continuing lines and ! @cindex backslash (@code{\}), continuing lines and If you would like to split a single statement into two lines at a point where a newline would terminate it, you can @dfn{continue} it by ending the first line with a backslash character (@samp{\}). The backslash must be *************** *** 2510,2516 **** @end example @noindent ! @cindex portability issues We have generally not used backslash continuation in the sample programs in this @value{DOCUMENT}. In @command{gawk}, there is no limit on the length of a line, so backslash continuation is never strictly necessary; --- 2507,2513 ---- @end example @noindent ! @cindex portability, backslash continuation and We have generally not used backslash continuation in the sample programs in this @value{DOCUMENT}. In @command{gawk}, there is no limit on the length of a line, so backslash continuation is never strictly necessary; *************** *** 2528,2537 **** @c solaris 2.7 nawk does not. Solaris /usr/xpg4/bin/awk does though! sigh. @cindex @command{csh} utility ! @cindex @command{csh}, backslash continuation ! @cindex backslash continuation, in @command{csh} @strong{Caution:} @emph{Backslash continuation does not work as described ! above with the C shell.} It works for @command{awk} programs in files and for one-shot programs, @emph{provided} you are using a POSIX-compliant shell, such as the Unix Bourne shell or @command{bash}. But the C shell behaves differently! There, you must use two backslashes in a row, followed by --- 2525,2534 ---- @c solaris 2.7 nawk does not. Solaris /usr/xpg4/bin/awk does though! sigh. @cindex @command{csh} utility ! @cindex backslash (@code{\}), continuing lines and, in @command{csh} ! @cindex @code{\} (backslash), continuing lines and, in @command{csh} @strong{Caution:} @emph{Backslash continuation does not work as described ! with the C shell.} It works for @command{awk} programs in files and for one-shot programs, @emph{provided} you are using a POSIX-compliant shell, such as the Unix Bourne shell or @command{bash}. But the C shell behaves differently! There, you must use two backslashes in a row, followed by *************** *** 2563,2572 **** @command{awk} is a line-oriented language. Each rule's action has to begin on the same line as the pattern. To have the pattern and action on separate lines, you @emph{must} use backslash continuation; there ! is no other way. ! @cindex backslash continuation, and comments ! @cindex comments and backslash continuation Another thing to keep in mind is that backslash continuation and comments do not mix. As soon as @command{awk} sees the @samp{#} that starts a comment, it ignores @emph{everything} on the rest of the --- 2560,2570 ---- @command{awk} is a line-oriented language. Each rule's action has to begin on the same line as the pattern. To have the pattern and action on separate lines, you @emph{must} use backslash continuation; there ! is no other option. ! @cindex backslash (@code{\}), continuing lines and, comments and ! @cindex @code{\} (backslash), continuing lines and, comments and ! @cindex commenting, backslash continuation and Another thing to keep in mind is that backslash continuation and comments do not mix. As soon as @command{awk} sees the @samp{#} that starts a comment, it ignores @emph{everything} on the rest of the *************** *** 2586,2592 **** noticed because it is ``hidden'' inside the comment. Thus, the @code{BEGIN} is noted as a syntax error. ! @cindex multiple statements on one line When @command{awk} statements within one rule are short, you might want to put more than one of them on a line. This is accomplished by separating the statements with a semicolon (@samp{;}). --- 2584,2592 ---- noticed because it is ``hidden'' inside the comment. Thus, the @code{BEGIN} is noted as a syntax error. ! @cindex statements, multiple ! @cindex @code{;} (semicolon) ! @cindex semicolon (@code{;}) When @command{awk} statements within one rule are short, you might want to put more than one of them on a line. This is accomplished by separating the statements with a semicolon (@samp{;}). *************** *** 2607,2619 **** @node Other Features, When, Statements/Lines, Getting Started @section Other Features of @command{awk} The @command{awk} language provides a number of predefined, or @dfn{built-in}, variables that your programs can use to get information from @command{awk}. There are other variables your program can set as well to control how @command{awk} processes your data. In addition, @command{awk} provides a number of built-in functions for doing ! common computational and string related operations. @command{gawk} provides built-in functions for working with timestamps, performing bit manipulation, and for runtime string translation. --- 2607,2620 ---- @node Other Features, When, Statements/Lines, Getting Started @section Other Features of @command{awk} + @cindex variables The @command{awk} language provides a number of predefined, or @dfn{built-in}, variables that your programs can use to get information from @command{awk}. There are other variables your program can set as well to control how @command{awk} processes your data. In addition, @command{awk} provides a number of built-in functions for doing ! common computational and string-related operations. @command{gawk} provides built-in functions for working with timestamps, performing bit manipulation, and for runtime string translation. *************** *** 2625,2632 **** @node When, , Other Features, Getting Started @section When to Use @command{awk} ! @cindex uses of @command{awk} ! @cindex applications of @command{awk} Now that you've seen some of what @command{awk} can do, you might wonder how @command{awk} could be useful for you. By using utility programs, advanced patterns, field separators, arithmetic --- 2626,2632 ---- @node When, , Other Features, Getting Started @section When to Use @command{awk} ! @cindex @command{awk}, uses for Now that you've seen some of what @command{awk} can do, you might wonder how @command{awk} could be useful for you. By using utility programs, advanced patterns, field separators, arithmetic *************** *** 2645,2654 **** Complex programs have been written in @command{awk}, including a complete retargetable assembler for eight-bit microprocessors (@pxref{Glossary}, for ! more information), and a microcode assembler for a special purpose Prolog computer. However, @command{awk}'s capabilities are strained by tasks of such complexity. If you find yourself writing @command{awk} scripts of more than, say, a few hundred lines, you might consider using a different programming language. Emacs Lisp is a good choice if you need sophisticated string --- 2645,2655 ---- Complex programs have been written in @command{awk}, including a complete retargetable assembler for eight-bit microprocessors (@pxref{Glossary}, for ! more information), and a microcode assembler for a special-purpose Prolog computer. However, @command{awk}'s capabilities are strained by tasks of such complexity. + @cindex @command{awk} programs, complex If you find yourself writing @command{awk} scripts of more than, say, a few hundred lines, you might consider using a different programming language. Emacs Lisp is a good choice if you need sophisticated string *************** *** 2662,2677 **** @node Regexp, Reading Files, Getting Started, Top @chapter Regular Expressions ! @cindex pattern, regular expressions ! @cindex regexp ! @cindex regular expression ! @cindex regular expressions as patterns A @dfn{regular expression}, or @dfn{regexp}, is a way of describing a set of strings. Because regular expressions are such a fundamental part of @command{awk} programming, their format and use deserve a separate @value{CHAPTER}. A regular expression enclosed in slashes (@samp{/}) is an @command{awk} pattern that matches every input record whose text belongs to that set. --- 2663,2679 ---- @node Regexp, Reading Files, Getting Started, Top @chapter Regular Expressions ! @cindex regexp, See regular expressions ! @c STARTOFRANGE regexp ! @cindex regular expressions A @dfn{regular expression}, or @dfn{regexp}, is a way of describing a set of strings. Because regular expressions are such a fundamental part of @command{awk} programming, their format and use deserve a separate @value{CHAPTER}. + @cindex forward slash (@code{/}) + @cindex @code{/} (forward slash) A regular expression enclosed in slashes (@samp{/}) is an @command{awk} pattern that matches every input record whose text belongs to that set. *************** *** 2690,2696 **** @menu * Regexp Usage:: How to Use Regular Expressions. ! * Escape Sequences:: How to write non-printing characters. * Regexp Operators:: Regular Expression Operators. * Character Lists:: What can go between @samp{[...]}. * GNU Regexp Operators:: Operators specific to GNU software. --- 2692,2698 ---- @menu * Regexp Usage:: How to Use Regular Expressions. ! * Escape Sequences:: How to write nonprinting characters. * Regexp Operators:: Regular Expression Operators. * Character Lists:: What can go between @samp{[...]}. * GNU Regexp Operators:: Operators specific to GNU software. *************** *** 2702,2707 **** --- 2704,2710 ---- @node Regexp Usage, Escape Sequences, Regexp, Regexp @section How to Use Regular Expressions + @cindex regular expressions, as patterns A regular expression can be used as a pattern by enclosing it in slashes. Then the regular expression is tested against the entire text of each record. (Normally, it only needs *************** *** 2717,2728 **** @print{} 555-2127 @end example ! @cindex regexp operators ! @cindex string-matching operators @cindex operators, string-matching ! @cindex operators, regexp matching ! @cindex @code{~} operator ! @cindex @code{!~} operator Regular expressions can also be used in matching expressions. These expressions allow you to specify the string to match against; it need not be the entire current input record. The two operators @samp{~} --- 2720,2740 ---- @print{} 555-2127 @end example ! @cindex regular expressions, operators @cindex operators, string-matching ! @c @cindex operators, @code{~} ! @cindex string-matching operators ! @code{~} (tilde), @code{~} operator ! @cindex tilde (@code{~}), @code{~} operator ! @cindex @code{!} (exclamation point), @code{!~} operator ! @cindex exclamation point (@code{!}), @code{!~} operator ! @c @cindex operators, @code{!~} ! @cindex @code{if} statement ! @cindex @code{while} statement ! @cindex @code{do}-@code{while} statement ! @c @cindex statements, @code{if} ! @c @cindex statements, @code{while} ! @c @cindex statements, @code{do} Regular expressions can also be used in matching expressions. These expressions allow you to specify the string to match against; it need not be the entire current input record. The two operators @samp{~} *************** *** 2777,2783 **** @dots{} @end example ! @cindex regexp constant When a regexp is enclosed in slashes, such as @code{/foo/}, we call it a @dfn{regexp constant}, much like @code{5.27} is a numeric constant and @code{"foo"} is a string constant. --- 2789,2796 ---- @dots{} @end example ! @cindex regexp constants ! @cindex regular expressions, constants, See regexp constants When a regexp is enclosed in slashes, such as @code{/foo/}, we call it a @dfn{regexp constant}, much like @code{5.27} is a numeric constant and @code{"foo"} is a string constant. *************** *** 2785,2798 **** @node Escape Sequences, Regexp Operators, Regexp Usage, Regexp @section Escape Sequences ! @cindex escape sequence notation Some characters cannot be included literally in string constants (@code{"foo"}) or regexp constants (@code{/foo/}). Instead, they should be represented with @dfn{escape sequences}, which are character sequences beginning with a backslash (@samp{\}). ! One use of an escape sequence is to include a double quote character in a string constant. Because a plain double quote ends the string, you ! must use @samp{\"} to represent an actual double quote character as a part of the string. For example: @example --- 2798,2813 ---- @node Escape Sequences, Regexp Operators, Regexp Usage, Regexp @section Escape Sequences ! @cindex escape sequences ! @cindex backslash (@code{\}), in escape sequences ! @cindex @code{\} (backslash), in escape sequences Some characters cannot be included literally in string constants (@code{"foo"}) or regexp constants (@code{/foo/}). Instead, they should be represented with @dfn{escape sequences}, which are character sequences beginning with a backslash (@samp{\}). ! One use of an escape sequence is to include a double-quote character in a string constant. Because a plain double quote ends the string, you ! must use @samp{\"} to represent an actual double-quote character as a part of the string. For example: @example *************** *** 2805,2812 **** string or regexp. Thus, the string whose contents are the two characters @samp{"} and @samp{\} must be written @code{"\"\\"}. ! Another use of backslash is to represent unprintable characters ! such as tab or newline. While there is nothing to stop you from entering most unprintable characters directly in a string constant or regexp constant, they may look ugly. --- 2820,2827 ---- string or regexp. Thus, the string whose contents are the two characters @samp{"} and @samp{\} must be written @code{"\"\\"}. ! Backslash also represents unprintable characters ! such as TAB or newline. While there is nothing to stop you from entering most unprintable characters directly in a string constant or regexp constant, they may look ugly. *************** *** 2819,2875 **** @item \\ A literal backslash, @samp{\}. ! @cindex @command{awk} language, V.4 version ! @cindex @code{\a} escape sequence @item \a ! The ``alert'' character, @kbd{Ctrl-g}, ASCII code 7 (BEL). (This usually makes some sort of audible noise.) ! @cindex @code{\b} escape sequence @item \b ! Backspace, @kbd{Ctrl-h}, ASCII code 8 (BS). ! @cindex @code{\f} escape sequence @item \f ! Formfeed, @kbd{Ctrl-l}, ASCII code 12 (FF). ! @cindex @code{\n} escape sequence @item \n ! Newline, @kbd{Ctrl-j}, ASCII code 10 (LF). ! @cindex @code{\r} escape sequence @item \r ! Carriage return, @kbd{Ctrl-m}, ASCII code 13 (CR). ! @cindex @code{\t} escape sequence @item \t ! Horizontal tab, @kbd{Ctrl-i}, ASCII code 9 (HT). ! @cindex @command{awk} language, V.4 version ! @cindex @code{\v} escape sequence @item \v ! Vertical tab, @kbd{Ctrl-k}, ASCII code 11 (VT). ! @cindex @code{\}@var{nnn} escape sequence (octal) @item \@var{nnn} The octal value @var{nnn}, where @var{nnn} stands for 1 to 3 digits between @samp{0} and @samp{7}. For example, the code for the ASCII ESC (escape) character is @samp{\033}. ! @cindex @code{\x} escape sequence ! @cindex @command{awk} language, V.4 version ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} @item \x@var{hh}@dots{} The hexadecimal value @var{hh}, where @var{hh} stands for a sequence ! of hexadecimal digits (@samp{0} through @samp{9}, and either @samp{A} ! through @samp{F} or @samp{a} through @samp{f}). Like the same construct ! in ISO C, the escape sequence continues until the first non-hexadecimal digit is seen. However, using more than two hexadecimal digits produces undefined results. (The @samp{\x} escape sequence is not allowed in POSIX @command{awk}.) ! @cindex @code{\/} escape sequence @item \/ A literal slash (necessary for regexp constants only). This expression is used when you want to write a regexp --- 2834,2899 ---- @item \\ A literal backslash, @samp{\}. ! @c @cindex @command{awk} language, V.4 version ! @cindex @code{\} (backslash), @code{\a} escape sequence ! @cindex backslash (@code{\}), @code{\a} escape sequence @item \a ! The ``alert'' character, @kbd{@value{CTL}-g}, ASCII code 7 (BEL). (This usually makes some sort of audible noise.) ! @cindex @code{\} (backslash), @code{\b} escape sequence ! @cindex backslash (@code{\}), @code{\b} escape sequence @item \b ! Backspace, @kbd{@value{CTL}-h}, ASCII code 8 (BS). ! @cindex @code{\} (backslash), @code{\f} escape sequence ! @cindex backslash (@code{\}), @code{\f} escape sequence @item \f ! Formfeed, @kbd{@value{CTL}-l}, ASCII code 12 (FF). ! @cindex @code{\} (backslash), @code{\n} escape sequence ! @cindex backslash (@code{\}), @code{\n} escape sequence @item \n ! Newline, @kbd{@value{CTL}-j}, ASCII code 10 (LF). ! @cindex @code{\} (backslash), @code{\r} escape sequence ! @cindex backslash (@code{\}), @code{\r} escape sequence @item \r ! Carriage return, @kbd{@value{CTL}-m}, ASCII code 13 (CR). ! @cindex @code{\} (backslash), @code{\t} escape sequence ! @cindex backslash (@code{\}), @code{\t} escape sequence @item \t ! Horizontal TAB, @kbd{@value{CTL}-i}, ASCII code 9 (HT). ! @c @cindex @command{awk} language, V.4 version ! @cindex @code{\} (backslash), @code{\v} escape sequence ! @cindex backslash (@code{\}), @code{\v} escape sequence @item \v ! Vertical tab, @kbd{@value{CTL}-k}, ASCII code 11 (VT). ! @cindex @code{\} (backslash), @code{\}@var{nnn} escape sequence ! @cindex backslash (@code{\}), @code{\}@var{nnn} escape sequence @item \@var{nnn} The octal value @var{nnn}, where @var{nnn} stands for 1 to 3 digits between @samp{0} and @samp{7}. For example, the code for the ASCII ESC (escape) character is @samp{\033}. ! @c @cindex @command{awk} language, V.4 version ! @c @cindex @command{awk} language, POSIX version ! @cindex @code{\} (backslash), @code{\x} escape sequence ! @cindex backslash (@code{\}), @code{\x} escape sequence @item \x@var{hh}@dots{} The hexadecimal value @var{hh}, where @var{hh} stands for a sequence ! of hexadecimal digits (@samp{0}--@samp{9}, and either @samp{A}--@samp{F} ! or @samp{a}--@samp{f}). Like the same construct ! in ISO C, the escape sequence continues until the first nonhexadecimal digit is seen. However, using more than two hexadecimal digits produces undefined results. (The @samp{\x} escape sequence is not allowed in POSIX @command{awk}.) ! @cindex @code{\} (backslash), @code{\/} escape sequence ! @cindex backslash (@code{\}), @code{\/} escape sequence @item \/ A literal slash (necessary for regexp constants only). This expression is used when you want to write a regexp *************** *** 2877,2883 **** slashes, you need to escape the slash that is part of the pattern, in order to tell @command{awk} to keep processing the rest of the regexp. ! @cindex @code{\"} escape sequence @item \" A literal double quote (necessary for string constants only). This expression is used when you want to write a string --- 2901,2908 ---- slashes, you need to escape the slash that is part of the pattern, in order to tell @command{awk} to keep processing the rest of the regexp. ! @cindex @code{\} (backslash), @code{\"} escape sequence ! @cindex backslash (@code{\}), @code{\"} escape sequence @item \" A literal double quote (necessary for string constants only). This expression is used when you want to write a string *************** *** 2890,2905 **** with a backslash have special meaning in regexps. @xref{GNU Regexp Operators, ,@command{gawk}-Specific Regexp Operators}. ! In a regexp, a backslash before any character that is not in the above table and not listed in @ref{GNU Regexp Operators, ,@command{gawk}-Specific Regexp Operators}, means that the next character should be taken literally, even if it would normally be a regexp operator. For example, @code{/a\+b/} matches the three characters @samp{a+b}. ! @cindex portability issues For complete portability, do not use a backslash before any character not ! shown in the table above. To summarize: --- 2915,2932 ---- with a backslash have special meaning in regexps. @xref{GNU Regexp Operators, ,@command{gawk}-Specific Regexp Operators}. ! In a regexp, a backslash before any character that is not in the previous list and not listed in @ref{GNU Regexp Operators, ,@command{gawk}-Specific Regexp Operators}, means that the next character should be taken literally, even if it would normally be a regexp operator. For example, @code{/a\+b/} matches the three characters @samp{a+b}. ! @cindex backslash (@code{\}), in escape sequences ! @cindex @code{\} (backslash), in escape sequences ! @cindex portability For complete portability, do not use a backslash before any character not ! shown in the previous list. To summarize: *************** *** 2922,2966 **** @c fakenode --- for prepinfo @subheading Advanced Notes: Backslash Before Regular Characters ! @cindex advanced notes ! @cindex common mistakes ! @cindex mistakes, common ! @cindex errors, common If you place a backslash in a string constant before something that is ! not one of the characters listed above, POSIX @command{awk} purposely leaves what happens as undefined. There are two choices: ! @cindex automatic warnings ! @cindex warnings, automatic @table @asis @item Strip the backslash out This is what Unix @command{awk} and @command{gawk} both do. For example, @code{"a\qc"} is the same as @code{"aqc"}. ! (Because this is such an easy bug to both introduce and to miss, @command{gawk} warns you about it.) Consider @samp{FS = @w{"[ \t]+\|[ \t]+"}} to use vertical bars surrounded by whitespace as the field separator. There should be ! two backslashes in the string, @samp{FS = @w{"[ \t]+\\|[ \t]+"}}.) @c I did this! This is why I added the warning. @item Leave the backslash alone Some other @command{awk} implementations do this. ! In such implementations, @code{"a\qc"} is the same as if you had typed @code{"a\\qc"}. @end table @c fakenode --- for prepinfo @subheading Advanced Notes: Escape Sequences for Metacharacters ! @cindex advanced notes Suppose you use an octal or hexadecimal ! escape to represent a regexp metacharacter ! (@pxref{Regexp Operators, , Regular Expression Operators}). Does @command{awk} treat the character as a literal character or as a regexp operator? ! @cindex dark corner Historically, such characters were taken literally. @value{DARKCORNER} However, the POSIX standard indicates that they should be treated --- 2949,2996 ---- @c fakenode --- for prepinfo @subheading Advanced Notes: Backslash Before Regular Characters ! @cindex portability, backslash in escape sequences ! @cindex POSIX @command{awk}, backslashes in string constants ! @cindex backslash (@code{\}), in escape sequences, POSIX and ! @cindex @code{\} (backslash), in escape sequences, POSIX and ! @cindex troubleshooting, backslash before nonspecial character If you place a backslash in a string constant before something that is ! not one of the characters previously listed, POSIX @command{awk} purposely leaves what happens as undefined. There are two choices: ! @c @cindex automatic warnings ! @c @cindex warnings, automatic @table @asis @item Strip the backslash out This is what Unix @command{awk} and @command{gawk} both do. For example, @code{"a\qc"} is the same as @code{"aqc"}. ! (Because this is such an easy bug both to introduce and to miss, @command{gawk} warns you about it.) Consider @samp{FS = @w{"[ \t]+\|[ \t]+"}} to use vertical bars surrounded by whitespace as the field separator. There should be ! two backslashes in the string @samp{FS = @w{"[ \t]+\\|[ \t]+"}}.) @c I did this! This is why I added the warning. + @cindex @command{gawk}, escape sequences + @cindex Unix @command{awk}, backslashes in escape sequences @item Leave the backslash alone Some other @command{awk} implementations do this. ! In such implementations, typing @code{"a\qc"} is the same as typing @code{"a\\qc"}. @end table @c fakenode --- for prepinfo @subheading Advanced Notes: Escape Sequences for Metacharacters ! @cindex metacharacters, escape sequences for Suppose you use an octal or hexadecimal ! escape to represent a regexp metacharacter. ! (See @ref{Regexp Operators, , Regular Expression Operators}.) Does @command{awk} treat the character as a literal character or as a regexp operator? ! @cindex dark corner, escape sequences, for metacharacters Historically, such characters were taken literally. @value{DARKCORNER} However, the POSIX standard indicates that they should be treated *************** *** 2972,2980 **** @node Regexp Operators, Character Lists, Escape Sequences, Regexp @section Regular Expression Operators ! @cindex metacharacters ! @cindex regular expression metacharacters ! @cindex regexp operators You can combine regular expressions with special characters, called @dfn{regular expression operators} or @dfn{metacharacters}, to --- 3002,3009 ---- @node Regexp Operators, Character Lists, Escape Sequences, Regexp @section Regular Expression Operators ! @c STARTOFRANGE regexpo ! @cindex regular expressions, operators You can combine regular expressions with special characters, called @dfn{regular expression operators} or @dfn{metacharacters}, to *************** *** 2985,3009 **** earlier @end ifnotinfo in @ref{Escape Sequences}, ! are valid inside a regexp. They are introduced by a @samp{\}, and ! are recognized and converted into the corresponding real characters as the very first step in processing regexps. Here is a list of metacharacters. All characters that are not escape sequences and that are not listed in the table stand for themselves: @table @code @item \ This is used to suppress the special meaning of a character when matching. For example, @samp{\$} matches the character @samp{$}. ! @cindex anchors in regexps ! @cindex regexp, anchors ! @cindex Texinfo @item ^ This matches the beginning of a string. For example, @samp{^@@chapter} ! matches @samp{@@chapter} at the beginning of a string, and can be used to identify chapter beginnings in Texinfo source files. The @samp{^} is known as an @dfn{anchor}, because it anchors the pattern to match only at the beginning of the string. --- 3014,3041 ---- earlier @end ifnotinfo in @ref{Escape Sequences}, ! are valid inside a regexp. They are introduced by a @samp{\} and ! are recognized and converted into corresponding real characters as the very first step in processing regexps. Here is a list of metacharacters. All characters that are not escape sequences and that are not listed in the table stand for themselves: @table @code + @cindex backslash (@code{\}) + @cindex @code{\} (backslash) @item \ This is used to suppress the special meaning of a character when matching. For example, @samp{\$} matches the character @samp{$}. ! @cindex regular expressions, anchors in ! @cindex Texinfo, chapter beginnings in files ! @cindex @code{^} (caret) ! @cindex caret (@code{^}) @item ^ This matches the beginning of a string. For example, @samp{^@@chapter} ! matches @samp{@@chapter} at the beginning of a string and can be used to identify chapter beginnings in Texinfo source files. The @samp{^} is known as an @dfn{anchor}, because it anchors the pattern to match only at the beginning of the string. *************** *** 3016,3072 **** if ("line1\nLINE 2" ~ /^L/) @dots{} @end example @item $ ! This is similar to @samp{^} but it matches only at the end of a string. For example, @samp{p$} matches a record that ends with a @samp{p}. The @samp{$} is an anchor and does not match the end of a line embedded in a string. ! The condition is not true in the following example: @example if ("line1\nLINE 2" ~ /1$/) @dots{} @end example @item . This matches any single character, @emph{including} the newline character. For example, @samp{.P} matches any single character followed by a @samp{P} in a string. Using ! concatenation, we can make a regular expression such as @samp{U.A}, that matches any three-character sequence that begins with @samp{U} and ends with @samp{A}. ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} In strict POSIX mode (@pxref{Options, ,Command-Line Options}), @samp{.} does not match the @sc{nul} character, which is a character with all bits equal to zero. Otherwise, @sc{nul} is just another character. Other versions of @command{awk} may not be able to match the @sc{nul} character. ! @cindex character list ! @cindex character set (regexp component) ! @cindex character class ! @cindex bracket expression @item [@dots{}] This is called a @dfn{character list}.@footnote{In other literature, you may see a character list referred to as either a ! @dfn{character set}, a @dfn{character class} or a @dfn{bracket expression}.} It matches any @emph{one} of the characters that are enclosed in the square brackets. For example, @samp{[MVX]} matches any one of ! the characters @samp{M}, @samp{V}, or @samp{X}, in a string. A full discussion of what can be inside the square brackets of a character list is given in @ref{Character Lists, ,Using Character Lists}. ! @cindex complemented character list ! @cindex character list, complemented @item [^ @dots{}] This is a @dfn{complemented character list}. The first character after the @samp{[} @emph{must} be a @samp{^}. It matches any characters @emph{except} those in the square brackets. For example, @samp{[^awk]} ! matches any character that is not an @samp{a}, a @samp{w}, ! or a @samp{k}. @item | This is the @dfn{alternation operator} and it is used to specify alternatives. --- 3048,3110 ---- if ("line1\nLINE 2" ~ /^L/) @dots{} @end example + @cindex @code{$} (dollar sign) + @cindex dollar sign (@code{$}) @item $ ! This is similar to @samp{^}, but it matches only at the end of a string. For example, @samp{p$} matches a record that ends with a @samp{p}. The @samp{$} is an anchor and does not match the end of a line embedded in a string. ! The condition in the following example is not true: @example if ("line1\nLINE 2" ~ /1$/) @dots{} @end example + @cindex @code{.} (period) + @cindex period (@code{.}) @item . This matches any single character, @emph{including} the newline character. For example, @samp{.P} matches any single character followed by a @samp{P} in a string. Using ! concatenation, we can make a regular expression such as @samp{U.A}, which matches any three-character sequence that begins with @samp{U} and ends with @samp{A}. ! @c comma before using does NOT do tertiary ! @cindex POSIX @command{awk}, period (@code{.}), using In strict POSIX mode (@pxref{Options, ,Command-Line Options}), @samp{.} does not match the @sc{nul} character, which is a character with all bits equal to zero. Otherwise, @sc{nul} is just another character. Other versions of @command{awk} may not be able to match the @sc{nul} character. ! @cindex @code{[]} (square brackets) ! @cindex square brackets (@code{[]}) ! @cindex character lists ! @cindex character sets, See Also character lists ! @cindex bracket expressions, See character lists @item [@dots{}] This is called a @dfn{character list}.@footnote{In other literature, you may see a character list referred to as either a ! @dfn{character set}, a @dfn{character class}, or a @dfn{bracket expression}.} It matches any @emph{one} of the characters that are enclosed in the square brackets. For example, @samp{[MVX]} matches any one of ! the characters @samp{M}, @samp{V}, or @samp{X} in a string. A full discussion of what can be inside the square brackets of a character list is given in @ref{Character Lists, ,Using Character Lists}. ! @cindex character lists, complemented @item [^ @dots{}] This is a @dfn{complemented character list}. The first character after the @samp{[} @emph{must} be a @samp{^}. It matches any characters @emph{except} those in the square brackets. For example, @samp{[^awk]} ! matches any character that is not an @samp{a}, @samp{w}, ! or @samp{k}. + @cindex @code{|} (vertical bar) + @cindex vertical bar (@code{|}) @item | This is the @dfn{alternation operator} and it is used to specify alternatives. *************** *** 3078,3092 **** The alternation applies to the largest possible regexps on either side. ! @cindex Texinfo @item (@dots{}) ! Parentheses are used for grouping in regular expressions, similar to arithmetic. They can be used to concatenate regular expressions containing the alternation operator, @samp{|}. For example, @samp{@@(samp|code)\@{[^@}]+\@}} matches both @samp{@@code@{foo@}} and @samp{@@samp@{bar@}}. (These are Texinfo formatting control sequences.) @item * This symbol means that the preceding regular expression should be repeated as many times as necessary to find a match. For example, @samp{ph*} --- 3116,3133 ---- The alternation applies to the largest possible regexps on either side. ! @cindex @code{()} (parentheses) ! @cindex parentheses @code{()} @item (@dots{}) ! Parentheses are used for grouping in regular expressions, as in arithmetic. They can be used to concatenate regular expressions containing the alternation operator, @samp{|}. For example, @samp{@@(samp|code)\@{[^@}]+\@}} matches both @samp{@@code@{foo@}} and @samp{@@samp@{bar@}}. (These are Texinfo formatting control sequences.) + @cindex @code{*} (asterisk), @code{*} operator, as regexp operator + @cindex asterisk (@code{*}), @code{*} operator, as regexp operator @item * This symbol means that the preceding regular expression should be repeated as many times as necessary to find a match. For example, @samp{ph*} *************** *** 3103,3110 **** Notice the escaping of the parentheses by preceding them with backslashes. @item + ! This symbol is similar to @samp{*} except that the preceding expression must be matched at least once. This means that @samp{wh+y} would match @samp{why} and @samp{whhy}, but not @samp{wy}, whereas @samp{wh*y} would match all three of these strings. --- 3144,3153 ---- Notice the escaping of the parentheses by preceding them with backslashes. + @cindex @code{+} (plus sign) + @cindex plus sign (@code{+}) @item + ! This symbol is similar to @samp{*}, except that the preceding expression must be matched at least once. This means that @samp{wh+y} would match @samp{why} and @samp{whhy}, but not @samp{wy}, whereas @samp{wh*y} would match all three of these strings. *************** *** 3115,3127 **** awk '/\(c[ad]+r x\)/ @{ print @}' sample @end example @item ? ! This symbol is similar to @samp{*} except that the preceding expression can be matched either once or not at all. For example, @samp{fe?d} matches @samp{fed} and @samp{fd}, but nothing else. - @cindex @command{awk} language, POSIX version - @cindex POSIX @command{awk} @cindex interval expressions @item @{@var{n}@} @itemx @{@var{n},@} --- 3158,3170 ---- awk '/\(c[ad]+r x\)/ @{ print @}' sample @end example + @cindex @code{?} (question mark) + @cindex question mark (@code{?}) @item ? ! This symbol is similar to @samp{*}, except that the preceding expression can be matched either once or not at all. For example, @samp{fe?d} matches @samp{fed} and @samp{fd}, but nothing else. @cindex interval expressions @item @{@var{n}@} @itemx @{@var{n},@} *************** *** 3145,3154 **** --- 3188,3199 ---- Matches @samp{whhy} or @samp{whhhy}, and so on. @end table + @cindex POSIX @command{awk}, interval expressions in Interval expressions were not traditionally available in @command{awk}. They were added as part of the POSIX standard to make @command{awk} and @command{egrep} consistent with each other. + @cindex @command{gawk}, interval expressions and However, because old programs may use @samp{@{} and @samp{@}} in regexp constants, by default @command{gawk} does @emph{not} match interval expressions in regexps. If either @option{--posix} or @option{--re-interval} are specified *************** *** 3163,3175 **** @end table @cindex precedence, regexp operators ! @cindex regexp operators, precedence of In regular expressions, the @samp{*}, @samp{+}, and @samp{?} operators, as well as the braces @samp{@{} and @samp{@}}, have the highest precedence, followed by concatenation, and finally by @samp{|}. As in arithmetic, parentheses can change how operators are grouped. In POSIX @command{awk} and @command{gawk}, the @samp{*}, @samp{+}, and @samp{?} operators stand for themselves when there is nothing in the regexp that precedes them. For example, @samp{/+/} matches a literal plus sign. However, many other versions of --- 3208,3222 ---- @end table @cindex precedence, regexp operators ! @cindex regular expressions, operators, precedence of In regular expressions, the @samp{*}, @samp{+}, and @samp{?} operators, as well as the braces @samp{@{} and @samp{@}}, have the highest precedence, followed by concatenation, and finally by @samp{|}. As in arithmetic, parentheses can change how operators are grouped. + @cindex POSIX @command{awk}, regular expressions and + @cindex @command{gawk}, regular expressions, precedence In POSIX @command{awk} and @command{gawk}, the @samp{*}, @samp{+}, and @samp{?} operators stand for themselves when there is nothing in the regexp that precedes them. For example, @samp{/+/} matches a literal plus sign. However, many other versions of *************** *** 3179,3187 **** --- 3226,3239 ---- (@pxref{Options, ,Command-Line Options}), POSIX character classes and interval expressions are not available in regular expressions. + @c ENDOFRANGE regexpo @node Character Lists, GNU Regexp Operators, Regexp Operators, Regexp @section Using Character Lists + @c STARTOFRANGE charlist + @cindex character lists + @cindex character lists, range expressions + @cindex range expressions Within a character list, a @dfn{range expression} consists of two characters separated by a hyphen. It matches any single character that *************** *** 3195,3200 **** --- 3247,3258 ---- locale by setting the @env{LC_ALL} environment variable to the value @samp{C}. + @cindex @code{\} (backslash), in character lists + @cindex backslash (@code{\}), in character lists + @cindex @code{^} (caret), in character lists + @cindex caret (@code{^}), in character lists + @cindex @code{-} (hyphen), in character lists + @cindex hyphen (@code{-}), in character lists To include one of the characters @samp{\}, @samp{]}, @samp{-}, or @samp{^} in a character list, put a @samp{\} in front of it. For example: *************** *** 3205,3210 **** --- 3263,3271 ---- @noindent matches either @samp{d} or @samp{]}. + @cindex POSIX @command{awk}, character lists and + @cindex Extended Regular Expressions (EREs) + @cindex EREs (Extended Regular Expressions) @cindex @command{egrep} utility This treatment of @samp{\} in character lists is compatible with other @command{awk} *************** *** 3214,3222 **** POSIX EREs are based on the regular expressions accepted by the traditional @command{egrep} utility. ! @cindex character class ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} @dfn{Character classes} are a new feature introduced in the POSIX standard. A character class is a special notation for describing lists of characters that have a specific attribute, but the --- 3275,3282 ---- POSIX EREs are based on the regular expressions accepted by the traditional @command{egrep} utility. ! @cindex character lists, character classes ! @cindex POSIX @command{awk}, character lists and, character classes @dfn{Character classes} are a new feature introduced in the POSIX standard. A character class is a special notation for describing lists of characters that have a specific attribute, but the *************** *** 3227,3233 **** A character class is only valid in a regexp @emph{inside} the brackets of a character list. Character classes consist of @samp{[:}, a keyword denoting the class, and @samp{:]}. Here are the character ! classes defined by the POSIX standard: @c the regular table is commented out while trying out the multitable. @c leave it here in case we need to go back, but make sure the text --- 3287,3293 ---- A character class is only valid in a regexp @emph{inside} the brackets of a character list. Character classes consist of @samp{[:}, a keyword denoting the class, and @samp{:]}. Here are the character ! classes defined by the POSIX standard. @c the regular table is commented out while trying out the multitable. @c leave it here in case we need to go back, but make sure the text *************** *** 3242,3248 **** Alphabetic characters. @item [:blank:] ! Space and tab characters. @item [:cntrl:] Control characters. --- 3302,3308 ---- Alphabetic characters. @item [:blank:] ! Space and TAB characters. @item [:cntrl:] Control characters. *************** *** 3265,3271 **** control characters, or space characters). @item [:space:] ! Space characters (such as space, tab, and formfeed, to name a few). @item [:upper:] Uppercase alphabetic characters. --- 3325,3331 ---- control characters, or space characters). @item [:space:] ! Space characters (such as space, TAB, and formfeed, to name a few). @item [:upper:] Uppercase alphabetic characters. *************** *** 3278,3284 **** @multitable {@code{[:xdigit:]}} {Characters that are both printable and visible. (A space is} @item @code{[:alnum:]} @tab Alphanumeric characters. @item @code{[:alpha:]} @tab Alphabetic characters. ! @item @code{[:blank:]} @tab Space and tab characters. @item @code{[:cntrl:]} @tab Control characters. @item @code{[:digit:]} @tab Numeric characters. @item @code{[:graph:]} @tab Characters that are both printable and visible. --- 3338,3344 ---- @multitable {@code{[:xdigit:]}} {Characters that are both printable and visible. (A space is} @item @code{[:alnum:]} @tab Alphanumeric characters. @item @code{[:alpha:]} @tab Alphabetic characters. ! @item @code{[:blank:]} @tab Space and TAB characters. @item @code{[:cntrl:]} @tab Control characters. @item @code{[:digit:]} @tab Numeric characters. @item @code{[:graph:]} @tab Characters that are both printable and visible. *************** *** 3287,3293 **** @item @code{[:print:]} @tab Printable characters (characters that are not control characters). @item @code{[:punct:]} @tab Punctuation characters (characters that are not letters, digits, control characters, or space characters). ! @item @code{[:space:]} @tab Space characters (such as space, tab, and formfeed, to name a few). @item @code{[:upper:]} @tab Uppercase alphabetic characters. @item @code{[:xdigit:]} @tab Characters that are hexadecimal digits. @end multitable --- 3347,3353 ---- @item @code{[:print:]} @tab Printable characters (characters that are not control characters). @item @code{[:punct:]} @tab Punctuation characters (characters that are not letters, digits, control characters, or space characters). ! @item @code{[:space:]} @tab Space characters (such as space, TAB, and formfeed, to name a few). @item @code{[:upper:]} @tab Uppercase alphabetic characters. @item @code{[:xdigit:]} @tab Characters that are hexadecimal digits. @end multitable *************** *** 3301,3306 **** --- 3361,3368 ---- @code{/[[:alnum:]]/} to match the alphabetic and numeric characters in your character set. + @cindex character lists, collating elements + @cindex character lists, non-ASCII @cindex collating elements Two additional special sequences can appear in character lists. These apply to non-ASCII character sets, which can have single symbols *************** *** 3308,3325 **** character. They can also have several characters that are equivalent for @dfn{collating}, or sorting, purposes. (For example, in French, a plain ``e'' and a grave-accented ``@`e'' are equivalent.) @table @asis @cindex collating symbols ! @item Collating Symbols ! A @dfn{collating symbol} is a multicharacter collating element enclosed between @samp{[.} and @samp{.]}. For example, if @samp{ch} is a collating element, then @code{[[.ch.]]} is a regexp that matches this collating element, whereas @code{[ch]} is a regexp that matches either @samp{c} or @samp{h}. ! @cindex equivalence classes ! @item Equivalence Classes ! An @dfn{equivalence class} is a locale-specific name for a list of characters that are equal. The name is enclosed between @samp{[=} and @samp{=]}. For example, the name @samp{e} might be used to represent all of --- 3370,3389 ---- character. They can also have several characters that are equivalent for @dfn{collating}, or sorting, purposes. (For example, in French, a plain ``e'' and a grave-accented ``@`e'' are equivalent.) + These sequences are: @table @asis + @cindex character lists, collating symbols @cindex collating symbols ! @item Collating symbols ! Multicharacter collating elements enclosed between @samp{[.} and @samp{.]}. For example, if @samp{ch} is a collating element, then @code{[[.ch.]]} is a regexp that matches this collating element, whereas @code{[ch]} is a regexp that matches either @samp{c} or @samp{h}. ! @cindex character lists, equivalence classes ! @item Equivalence classes ! Locale-specific names for a list of characters that are equal. The name is enclosed between @samp{[=} and @samp{=]}. For example, the name @samp{e} might be used to represent all of *************** *** 3327,3345 **** that matches any of @samp{e}, @samp{@'e}, or @samp{@`e}. @end table ! These features are very valuable in non-English speaking locales. @strong{Caution:} The library functions that @command{gawk} uses for regular ! expression matching currently only recognize POSIX character classes; they do not recognize collating symbols or equivalence classes. @c maybe one day ... @node GNU Regexp Operators, Case-sensitivity, Character Lists, Regexp @section @command{gawk}-Specific Regexp Operators @c This section adapted (long ago) from the regex-0.12 manual ! @cindex regexp operators, GNU specific @cindex word, regexp definition of GNU software that deals with regular expressions provides a number of additional regexp operators. These operators are described in this --- 3391,3418 ---- that matches any of @samp{e}, @samp{@'e}, or @samp{@`e}. @end table ! These features are very valuable in non-English-speaking locales. + @cindex internationalization, localization, character classes + @cindex @command{gawk}, character classes and + @cindex POSIX @command{awk}, character lists and, character classes @strong{Caution:} The library functions that @command{gawk} uses for regular ! expression matching currently recognize only POSIX character classes; they do not recognize collating symbols or equivalence classes. @c maybe one day ... + @c ENDOFRANGE charlist @node GNU Regexp Operators, Case-sensitivity, Character Lists, Regexp @section @command{gawk}-Specific Regexp Operators @c This section adapted (long ago) from the regex-0.12 manual ! @c STARTOFRANGE regexpg ! @cindex regular expressions, operators, @command{gawk} ! @c STARTOFRANGE gregexp ! @cindex @command{gawk}, regular expressions, operators ! @cindex operators, GNU-specific ! @cindex regular expressions, operators, for words @cindex word, regexp definition of GNU software that deals with regular expressions provides a number of additional regexp operators. These operators are described in this *************** *** 3350,3386 **** or underscores (@samp{_}): @table @code ! @cindex @code{\w} regexp operator @item \w Matches any word-constituent character---that is, it matches any ! letter, digit, or underscore. Think of it as short-hand for @w{@code{[[:alnum:]_]}}. ! @cindex @code{\W} regexp operator @item \W Matches any character that is not word-constituent. ! Think of it as short-hand for @w{@code{[^[:alnum:]_]}}. ! @cindex @code{\<} regexp operator @item \< Matches the empty string at the beginning of a word. For example, @code{/\} regexp operator @item \> Matches the empty string at the end of a word. For example, @code{/stow\>/} matches @samp{stow} but not @samp{stowaway}. ! @cindex @code{\y} regexp operator @cindex word boundaries, matching @item \y Matches the empty string at either the beginning or the end of a word (i.e., the word boundar@strong{y}). For example, @samp{\yballs?\y} matches either @samp{ball} or @samp{balls}, as a separate word. ! @cindex @code{\B} regexp operator @item \B Matches the empty string that occurs between two word-constituent characters. For example, --- 3423,3472 ---- or underscores (@samp{_}): @table @code ! @c @cindex operators, @code{\w} (@command{gawk}) ! @cindex backslash (@code{\}), @code{\w} operator (@command{gawk}) ! @cindex @code{\} (backslash), @code{\w} operator (@command{gawk}) @item \w Matches any word-constituent character---that is, it matches any ! letter, digit, or underscore. Think of it as shorthand for @w{@code{[[:alnum:]_]}}. ! @c @cindex operators, @code{\W} (@command{gawk}) ! @cindex backslash (@code{\}), @code{\W} operator (@command{gawk}) ! @cindex @code{\} (backslash), @code{\W} operator (@command{gawk}) @item \W Matches any character that is not word-constituent. ! Think of it as shorthand for @w{@code{[^[:alnum:]_]}}. ! @c @cindex operators, @code{\<} (@command{gawk}) ! @cindex backslash (@code{\}), @code{\<} operator (@command{gawk}) ! @cindex @code{\} (backslash), @code{\<} operator (@command{gawk}) @item \< Matches the empty string at the beginning of a word. For example, @code{/\} (@command{gawk}) ! @cindex backslash (@code{\}), @code{\>} operator (@command{gawk}) ! @cindex @code{\} (backslash), @code{\>} operator (@command{gawk}) @item \> Matches the empty string at the end of a word. For example, @code{/stow\>/} matches @samp{stow} but not @samp{stowaway}. ! @c @cindex operators, @code{\y} (@command{gawk}) ! @cindex backslash (@code{\}), @code{\y} operator (@command{gawk}) ! @cindex @code{\} (backslash), @code{\y} operator (@command{gawk}) ! @c comma before using does NOT do secondary @cindex word boundaries, matching @item \y Matches the empty string at either the beginning or the end of a word (i.e., the word boundar@strong{y}). For example, @samp{\yballs?\y} matches either @samp{ball} or @samp{balls}, as a separate word. ! @c @cindex operators, @code{\B} (@command{gawk}) ! @cindex backslash (@code{\}), @code{\B} operator (@command{gawk}) ! @cindex @code{\} (backslash), @code{\B} operator (@command{gawk}) @item \B Matches the empty string that occurs between two word-constituent characters. For example, *************** *** 3388,3416 **** @samp{\B} is essentially the opposite of @samp{\y}. @end table ! @cindex buffer matching operators There are two other operators that work on buffers. In Emacs, a @dfn{buffer} is, naturally, an Emacs buffer. For other programs, @command{gawk}'s regexp library routines consider the entire string to match as the buffer. @table @code @item \` ! @cindex @code{\`} regexp operator Matches the empty string at the beginning of a buffer (string). ! @cindex @code{\'} regexp operator @item \' Matches the empty string at the end of a buffer (string). @end table Because @samp{^} and @samp{$} always work in terms of the beginning and end of strings, these operators don't add any new capabilities for @command{awk}. They are provided for compatibility with other GNU software. In other GNU software, the word-boundary operator is @samp{\b}. However, that conflicts with the @command{awk} language's definition of @samp{\b} as backspace, so @command{gawk} uses a different letter. --- 3474,3516 ---- @samp{\B} is essentially the opposite of @samp{\y}. @end table ! @cindex buffers, operators for ! @cindex regular expressions, operators, for buffers ! @cindex operators, string-matching, for buffers There are two other operators that work on buffers. In Emacs, a @dfn{buffer} is, naturally, an Emacs buffer. For other programs, @command{gawk}'s regexp library routines consider the entire string to match as the buffer. + The operators are: @table @code @item \` ! @c @cindex operators, @code{\`} (@command{gawk}) ! @cindex backslash (@code{\}), @code{\`} operator (@command{gawk}) ! @cindex @code{\} (backslash), @code{\`} operator (@command{gawk}) Matches the empty string at the beginning of a buffer (string). ! @c @cindex operators, @code{\'} (@command{gawk}) ! @cindex backslash (@code{\}), @code{\'} operator (@command{gawk}) ! @cindex @code{\} (backslash), @code{\'} operator (@command{gawk}) @item \' Matches the empty string at the end of a buffer (string). @end table + @cindex @code{^} (caret) + @cindex caret (@code{^}) + @cindex @code{?} (question mark) + @cindex question mark (@code{?}) Because @samp{^} and @samp{$} always work in terms of the beginning and end of strings, these operators don't add any new capabilities for @command{awk}. They are provided for compatibility with other GNU software. + @cindex @command{gawk}, word-boundary operator + @cindex word-boundary operator (@command{gawk}) + @cindex operators, word-boundary (@command{gawk}) In other GNU software, the word-boundary operator is @samp{\b}. However, that conflicts with the @command{awk} language's definition of @samp{\b} as backspace, so @command{gawk} uses a different letter. *************** *** 3422,3428 **** @c NOTE!!! Keep this in sync with the same table in the summary appendix! @c @c Should really do this with file inclusion. ! @cindex regexp, effect of command-line options The various command-line options (@pxref{Options, ,Command-Line Options}) control how @command{gawk} interprets characters in regexps: --- 3522,3529 ---- @c NOTE!!! Keep this in sync with the same table in the summary appendix! @c @c Should really do this with file inclusion. ! @cindex regular expressions, @command{gawk}, command-line options ! @cindex @command{gawk}, command-line options The various command-line options (@pxref{Options, ,Command-Line Options}) control how @command{gawk} interprets characters in regexps: *************** *** 3449,3455 **** @item @code{--traditional} Traditional Unix @command{awk} regexps are matched. The GNU operators are not special, interval expressions are not available, nor ! are the POSIX character classes (@code{[[:alnum:]]} and so on). Characters described by octal and hexadecimal escape sequences are treated literally, even if they represent regexp metacharacters. --- 3550,3556 ---- @item @code{--traditional} Traditional Unix @command{awk} regexps are matched. The GNU operators are not special, interval expressions are not available, nor ! are the POSIX character classes (@code{[[:alnum:]]}, etc.). Characters described by octal and hexadecimal escape sequences are treated literally, even if they represent regexp metacharacters. *************** *** 3457,3468 **** Allow interval expressions in regexps, even if @option{--traditional} has been provided. @end table @node Case-sensitivity, Leftmost Longest, GNU Regexp Operators, Regexp @section Case Sensitivity in Matching ! @cindex case sensitivity ! @cindex ignoring case Case is normally significant in regular expressions, both when matching ordinary characters (i.e., not metacharacters) and inside character sets. Thus, a @samp{w} in a regular expression matches only a lowercase --- 3558,3573 ---- Allow interval expressions in regexps, even if @option{--traditional} has been provided. @end table + @c ENDOFRANGE gregexp + @c ENDOFRANGE regexpg @node Case-sensitivity, Leftmost Longest, GNU Regexp Operators, Regexp @section Case Sensitivity in Matching ! @c STARTOFRANGE regexpcs ! @cindex regular expressions, case sensitivity ! @c STARTOFRANGE csregexp ! @cindex case sensitivity, regexps and Case is normally significant in regular expressions, both when matching ordinary characters (i.e., not metacharacters) and inside character sets. Thus, a @samp{w} in a regular expression matches only a lowercase *************** *** 3470,3476 **** The simplest way to do a case-independent match is to use a character list---for example, @samp{[Ww]}. However, this can be cumbersome if ! you need to use it often and it can make the regular expressions harder to read. There are two alternatives that you might prefer. One way to perform a case-insensitive match at a particular point in the --- 3575,3581 ---- The simplest way to do a case-independent match is to use a character list---for example, @samp{[Ww]}. However, this can be cumbersome if ! you need to use it often, and it can make the regular expressions harder to read. There are two alternatives that you might prefer. One way to perform a case-insensitive match at a particular point in the *************** *** 3488,3502 **** converts the first field to lowercase before matching against it. This works in any POSIX-compliant @command{awk}. ! @cindex differences between @command{gawk} and @command{awk} ! @cindex @code{~} operator ! @cindex @code{!~} operator @cindex @code{IGNORECASE} variable Another method, specific to @command{gawk}, is to set the variable @code{IGNORECASE} to a nonzero value (@pxref{Built-in Variables}). When @code{IGNORECASE} is not zero, @emph{all} regexp and string operations ignore case. Changing the value of ! @code{IGNORECASE} dynamically controls the case sensitivity of the program as it runs. Case is significant by default because @code{IGNORECASE} (like most variables) is initialized to zero: --- 3593,3612 ---- converts the first field to lowercase before matching against it. This works in any POSIX-compliant @command{awk}. ! @cindex @command{gawk}, regular expressions, case sensitivity ! @cindex case sensitivity, @command{gawk} ! @cindex differences in @command{awk} and @command{gawk}, regular expressions ! @cindex @code{~} (tilde), @code{~} operator ! @cindex tilde (@code{~}), @code{~} operator ! @cindex @code{!} (exclamation point), @code{!~} operator ! @cindex exclamation point (@code{!}), @code{!~} operator @cindex @code{IGNORECASE} variable + @c @cindex variables, @code{IGNORECASE} Another method, specific to @command{gawk}, is to set the variable @code{IGNORECASE} to a nonzero value (@pxref{Built-in Variables}). When @code{IGNORECASE} is not zero, @emph{all} regexp and string operations ignore case. Changing the value of ! @code{IGNORECASE} dynamically controls the case-sensitivity of the program as it runs. Case is significant by default because @code{IGNORECASE} (like most variables) is initialized to zero: *************** *** 3534,3557 **** Beginning with @value{PVERSION} 3.0, both regexp and string comparison operations are also affected by @code{IGNORECASE}. ! @cindex ISO 8859-1 ! @cindex ISO Latin-1 Beginning with @command{gawk} 3.0, the equivalences between upper- and lowercase characters are based on the ISO-8859-1 (ISO Latin-1) character set. This character set is a superset of the traditional 128 ! ASCII characters, that also provides a number of characters suitable for use with European languages. The value of @code{IGNORECASE} has no effect if @command{gawk} is in compatibility mode (@pxref{Options, ,Command-Line Options}). Case is always significant in compatibility mode. @node Leftmost Longest, Computed Regexps, Case-sensitivity, Regexp @section How Much Text Matches? ! @cindex leftmost longest match ! @cindex matching, leftmost longest Consider the following: @example --- 3644,3669 ---- Beginning with @value{PVERSION} 3.0, both regexp and string comparison operations are also affected by @code{IGNORECASE}. ! @c @cindex ISO 8859-1 ! @c @cindex ISO Latin-1 Beginning with @command{gawk} 3.0, the equivalences between upper- and lowercase characters are based on the ISO-8859-1 (ISO Latin-1) character set. This character set is a superset of the traditional 128 ! ASCII characters, which also provides a number of characters suitable for use with European languages. The value of @code{IGNORECASE} has no effect if @command{gawk} is in compatibility mode (@pxref{Options, ,Command-Line Options}). Case is always significant in compatibility mode. + @c ENDOFRANGE csregexp + @c ENDOFRANGE regexpcs @node Leftmost Longest, Computed Regexps, Case-sensitivity, Regexp @section How Much Text Matches? ! @cindex regular expressions, leftmost longest match ! @c @cindex matching, leftmost longest Consider the following: @example *************** *** 3589,3600 **** @node Computed Regexps, , Leftmost Longest, Regexp @section Using Dynamic Regexps ! @cindex computed regular expressions @cindex regular expressions, computed ! @cindex dynamic regular expressions ! @cindex regexp, dynamic ! @cindex @code{~} operator ! @cindex @code{!~} operator The righthand side of a @samp{~} or @samp{!~} operator need not be a regexp constant (i.e., a string of characters between slashes). It may be any expression. The expression is evaluated and converted to a string --- 3701,3716 ---- @node Computed Regexps, , Leftmost Longest, Regexp @section Using Dynamic Regexps ! @c STARTOFRANGE dregexp @cindex regular expressions, computed ! @c STARTOFRANGE regexpd ! @cindex regular expressions, dynamic ! @cindex @code{~} (tilde), @code{~} operator ! @cindex tilde (@code{~}), @code{~} operator ! @cindex @code{!} (exclamation point), @code{!~} operator ! @cindex exclamation point (@code{!}), @code{!~} operator ! @c @cindex operators, @code{~} ! @c @cindex operators, @code{!~} The righthand side of a @samp{~} or @samp{!~} operator need not be a regexp constant (i.e., a string of characters between slashes). It may be any expression. The expression is evaluated and converted to a string *************** *** 3620,3629 **** the string is, in essence, scanned @emph{twice}: the first time when @command{awk} reads your program, and the second time when it goes to match the string on the lefthand side of the operator with the pattern ! on the right. This is true of any string valued expression (such as ! @code{digits_regexp} shown previously), not just string constants. ! @cindex regexp constants, difference between slashes and quotes What difference does it make if the string is scanned twice? The answer has to do with escape sequences, and particularly with backslashes. To get a backslash into a regular expression inside a --- 3736,3749 ---- the string is, in essence, scanned @emph{twice}: the first time when @command{awk} reads your program, and the second time when it goes to match the string on the lefthand side of the operator with the pattern ! on the right. This is true of any string-valued expression (such as ! @code{digits_regexp}, shown previously), not just string constants. ! @cindex regexp constants, slashes vs. quotes ! @cindex @code{\} (backslash), regexp constants ! @cindex backslash (@code{\}), regexp constants ! @cindex @code{"} (double quote), regexp constants ! @cindex double quote (@code{"}), regexp constants What difference does it make if the string is scanned twice? The answer has to do with escape sequences, and particularly with backslashes. To get a backslash into a regular expression inside a *************** *** 3635,3643 **** second one so that the string actually contains the two characters @samp{\} and @samp{*}. ! @cindex common mistakes ! @cindex mistakes, common ! @cindex errors, common Given that you can use both regexp and string constants to describe regular expressions, which should you use? The answer is ``regexp constants,'' for several reasons: --- 3755,3763 ---- second one so that the string actually contains the two characters @samp{\} and @samp{*}. ! @cindex troubleshooting, regexp constants vs. string constants ! @cindex regexp constants, vs. string constants ! @cindex string constants, vs. regexp constants Given that you can use both regexp and string constants to describe regular expressions, which should you use? The answer is ``regexp constants,'' for several reasons: *************** *** 3651,3657 **** @item It is more efficient to use regexp constants. @command{awk} can note ! that you have supplied a regexp, and store it internally in a form that makes pattern matching more efficient. When using a string constant, @command{awk} must first convert the string into this internal form and then perform the pattern matching. --- 3771,3777 ---- @item It is more efficient to use regexp constants. @command{awk} can note ! that you have supplied a regexp and store it internally in a form that makes pattern matching more efficient. When using a string constant, @command{awk} must first convert the string into this internal form and then perform the pattern matching. *************** *** 3663,3673 **** @c fakenode --- for prepinfo @subheading Advanced Notes: Using @code{\n} in Character Lists of Dynamic Regexps ! @cindex advanced notes ! @cindex dynamic regular expressions with embedded newlines ! @cindex regexp, dynamic, with embedded newlines ! @cindex newlines, embedded in dynamic regexps ! @cindex embedded newlines, in dynamic regexps Some commercial versions of @command{awk} do not allow the newline character to be used inside a character list for a dynamic regexp: --- 3783,3790 ---- @c fakenode --- for prepinfo @subheading Advanced Notes: Using @code{\n} in Character Lists of Dynamic Regexps ! @cindex regular expressions, dynamic, with embedded newlines ! @cindex newlines, in dynamic regexps Some commercial versions of @command{awk} do not allow the newline character to be used inside a character list for a dynamic regexp: *************** *** 3681,3720 **** @error{} >>> <<< @end example But a newline in a regexp constant works with no problem: @example $ awk '$0 ~ /[ \t\n]/' here is a sample line @print{} here is a sample line ! @kbd{Ctrl-d} @end example @command{gawk} does not have this problem, and it isn't likely to occur often in practice, but it's worth noting for future reference. @node Reading Files, Printing, Regexp, Top @chapter Reading Input Files ! @cindex reading files ! @cindex input ! @cindex standard input @cindex @code{FILENAME} variable In the typical @command{awk} program, all input is read either from the ! standard input (by default, this is the keyboard but often it is a pipe from another ! command), or from files whose names you specify on the @command{awk} command line. If you specify input files, @command{awk} reads them in order, processing all the data from one before going on to the next. The name of the current input file can be found in the built-in variable @code{FILENAME} (@pxref{Built-in Variables}). The input is read in units called @dfn{records}, and is processed by the rules of your program one record at a time. By default, each record is one line. Each record is automatically split into chunks called @dfn{fields}. This makes it more convenient for programs to work on the parts of a record. On rare occasions, you may need to use the @code{getline} command. The @code{getline} command is valuable, both because it can do explicit input from any number of files, and because the files --- 3798,3844 ---- @error{} >>> <<< @end example + @cindex newlines, in regexp constants But a newline in a regexp constant works with no problem: @example $ awk '$0 ~ /[ \t\n]/' here is a sample line @print{} here is a sample line ! @kbd{@value{CTL}-d} @end example @command{gawk} does not have this problem, and it isn't likely to occur often in practice, but it's worth noting for future reference. + @c ENDOFRANGE dregexp + @c ENDOFRANGE regexpd + @c ENDOFRANGE regexp @node Reading Files, Printing, Regexp, Top @chapter Reading Input Files ! @c STARTOFRANGE infir ! @cindex input files, reading ! @cindex input files @cindex @code{FILENAME} variable In the typical @command{awk} program, all input is read either from the ! standard input (by default, this is the keyboard, but often it is a pipe from another ! command) or from files whose names you specify on the @command{awk} command line. If you specify input files, @command{awk} reads them in order, processing all the data from one before going on to the next. The name of the current input file can be found in the built-in variable @code{FILENAME} (@pxref{Built-in Variables}). + @cindex records + @cindex fields The input is read in units called @dfn{records}, and is processed by the rules of your program one record at a time. By default, each record is one line. Each record is automatically split into chunks called @dfn{fields}. This makes it more convenient for programs to work on the parts of a record. + @cindex @code{getline} command On rare occasions, you may need to use the @code{getline} command. The @code{getline} command is valuable, both because it can do explicit input from any number of files, and because the files *************** *** 3724,3730 **** @menu * Records:: Controlling how data is split into records. * Fields:: An introduction to fields. ! * Non-Constant Fields:: Non-constant Field Numbers. * Changing Fields:: Changing the Contents of a Field. * Field Separators:: The field separator and how to change it. * Constant Size:: Reading constant width data. --- 3848,3854 ---- @menu * Records:: Controlling how data is split into records. * Fields:: An introduction to fields. ! * Nonconstant Fields:: Nonconstant Field Numbers. * Changing Fields:: Changing the Contents of a Field. * Field Separators:: The field separator and how to change it. * Constant Size:: Reading constant width data. *************** *** 3736,3742 **** @node Records, Fields, Reading Files, Reading Files @section How Input Is Split into Records ! @cindex number of records, @code{NR}, @code{FNR} @cindex @code{NR} variable @cindex @code{FNR} variable The @command{awk} utility divides the input for your @command{awk} --- 3860,3869 ---- @node Records, Fields, Reading Files, Reading Files @section How Input Is Split into Records ! @c STARTOFRANGE inspl ! @cindex input, splitting into records ! @c STARTOFRANGE recspl ! @cindex records, splitting input into @cindex @code{NR} variable @cindex @code{FNR} variable The @command{awk} utility divides the input for your @command{awk} *************** *** 3750,3765 **** number of input records read so far from all @value{DF}s. It starts at zero, but is never automatically reset to zero. ! @cindex record separator, @code{RS} ! @cindex changing the record separator ! @cindex record, definition of ! @cindex @code{RS} variable Records are separated by a character called the @dfn{record separator}. By default, the record separator is the newline character. This is why records are, by default, single lines. A different character can be used for the record separator by assigning the character to the built-in variable @code{RS}. Like any other variable, the value of @code{RS} can be changed in the @command{awk} program with the assignment operator, @samp{=} --- 3877,3892 ---- number of input records read so far from all @value{DF}s. It starts at zero, but is never automatically reset to zero. ! @cindex separators, for records ! @cindex record separators Records are separated by a character called the @dfn{record separator}. By default, the record separator is the newline character. This is why records are, by default, single lines. A different character can be used for the record separator by assigning the character to the built-in variable @code{RS}. + @cindex newlines, as record separators + @cindex @code{RS} variable Like any other variable, the value of @code{RS} can be changed in the @command{awk} program with the assignment operator, @samp{=} *************** *** 3772,3777 **** --- 3899,3905 ---- (@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}). For example: + @cindex @code{BEGIN} pattern @example awk 'BEGIN @{ RS = "/" @} @{ print $0 @}' BBS-list *************** *** 3783,3789 **** are separated by slashes. Then the input file is read, and the second rule in the @command{awk} program (the action with no pattern) prints each record. Because each @code{print} statement adds a newline at the end of ! its output, the effect of this @command{awk} program is to copy the input with each slash changed to a newline. Here are the results of running the program on @file{BBS-list}: --- 3911,3917 ---- are separated by slashes. Then the input file is read, and the second rule in the @command{awk} program (the action with no pattern) prints each record. Because each @code{print} statement adds a newline at the end of ! its output, this @command{awk} program copies the input with each slash changed to a newline. Here are the results of running the program on @file{BBS-list}: *************** *** 3836,3841 **** --- 3964,3971 ---- is the original newline in the @value{DF}, not the one added by @command{awk} when it printed the record! + @cindex record separators, changing + @cindex separators, for records Another way to change the record separator is on the command line, using the variable-assignment feature (@pxref{Other Arguments, ,Other Command-Line Arguments}): *************** *** 3859,3870 **** There is one field, consisting of a newline. The value of the built-in variable @code{NF} is the number of fields in the current record. ! @cindex dark corner Reaching the end of an input file terminates the current input record, even if the last character in the file is not the character in @code{RS}. @value{DARKCORNER} ! @cindex empty string The empty string @code{""} (a string without any characters) has a special meaning as the value of @code{RS}. It means that records are separated --- 3989,4001 ---- There is one field, consisting of a newline. The value of the built-in variable @code{NF} is the number of fields in the current record. ! @cindex dark corner, input files Reaching the end of an input file terminates the current input record, even if the last character in the file is not the character in @code{RS}. @value{DARKCORNER} ! @cindex null strings ! @cindex strings, empty, See null strings The empty string @code{""} (a string without any characters) has a special meaning as the value of @code{RS}. It means that records are separated *************** *** 3877,3886 **** affected. @cindex @code{RT} variable ! @cindex record terminator, @code{RT} ! @cindex terminator, record ! @cindex differences between @command{gawk} and @command{awk} ! @cindex regular expressions as record separators After the end of the record has been determined, @command{gawk} sets the variable @code{RT} to the text in the input that matched @code{RS}. --- 4008,4019 ---- affected. @cindex @code{RT} variable ! @cindex records, terminating ! @cindex terminating records ! @cindex differences in @command{awk} and @command{gawk}, record separators ! @cindex regular expressions, as record separators ! @cindex record separators, regular expressions as ! @cindex separators, for records, regular expressions as After the end of the record has been determined, @command{gawk} sets the variable @code{RT} to the text in the input that matched @code{RS}. *************** *** 3893,3899 **** record starts at the end of the matching string. This general rule is actually at work in the usual case, where @code{RS} contains just a newline: a record ends at the beginning of the next matching string (the ! next newline in the input) and the following record starts just after the end of this string (at the first character of the following line). The newline, because it matches @code{RS}, is not part of either record. --- 4026,4032 ---- record starts at the end of the matching string. This general rule is actually at work in the usual case, where @code{RS} contains just a newline: a record ends at the beginning of the next matching string (the ! next newline in the input), and the following record starts just after the end of this string (at the first character of the following line). The newline, because it matches @code{RS}, is not part of either record. *************** *** 3924,3930 **** @xref{Simple Sed, ,A Simple Stream Editor}, for a more useful example of @code{RS} as a regexp and @code{RT}. ! @cindex differences between @command{gawk} and @command{awk} The use of @code{RS} as a regular expression and the @code{RT} variable are @command{gawk} extensions; they are not available in compatibility mode --- 4057,4063 ---- @xref{Simple Sed, ,A Simple Stream Editor}, for a more useful example of @code{RS} as a regexp and @code{RT}. ! @cindex differences in @command{awk} and @command{gawk}, @code{RS}/@code{RT} variables The use of @code{RS} as a regular expression and the @code{RT} variable are @command{gawk} extensions; they are not available in compatibility mode *************** *** 3934,3942 **** @c fakenode --- for prepinfo @subheading Advanced Notes: @code{RS = "\0"} Is Not Portable - @cindex advanced notes - @cindex portability issues There are times when you might want to treat an entire @value{DF} as a single record. The only way to make this happen is to give @code{RS} a value that you know doesn't occur in the input file. This is hard --- 4067,4075 ---- @c fakenode --- for prepinfo @subheading Advanced Notes: @code{RS = "\0"} Is Not Portable + @cindex advanced features, @value{DF}s as single record + @cindex portability, @value{DF}s as single record There are times when you might want to treat an entire @value{DF} as a single record. The only way to make this happen is to give @code{RS} a value that you know doesn't occur in the input file. This is hard *************** *** 3952,3982 **** BEGIN @{ RS = "\0" @} # whole file becomes one record? @end example ! @cindex differences between @command{gawk} and @command{awk} @command{gawk} in fact accepts this, and uses the @sc{nul} character for the record separator. However, this usage is @emph{not} portable to other @command{awk} implementations. ! @cindex dark corner All other @command{awk} implementations@footnote{At least that we know about.} store strings internally as C-style strings. C strings use the @sc{nul} character as the string terminator. In effect, this means that @samp{RS = "\0"} is the same as @samp{RS = ""}. @value{DARKCORNER} The best way to treat a whole file as a single record is to simply read the file in, one record at a time, concatenating each record onto the end of the previous ones. ! @node Fields, Non-Constant Fields, Records, Reading Files @section Examining Fields @cindex examining fields @cindex fields @cindex accessing fields When @command{awk} reads an input record, the record is ! automatically separated or @dfn{parsed} by the interpreter into chunks called @dfn{fields}. By default, fields are separated by @dfn{whitespace}, like words in a line. Whitespace in @command{awk} means any string of one or more spaces, --- 4085,4124 ---- BEGIN @{ RS = "\0" @} # whole file becomes one record? @end example ! @cindex differences in @command{awk} and @command{gawk}, strings, storing @command{gawk} in fact accepts this, and uses the @sc{nul} character for the record separator. However, this usage is @emph{not} portable to other @command{awk} implementations. ! @cindex dark corner, strings, storing All other @command{awk} implementations@footnote{At least that we know about.} store strings internally as C-style strings. C strings use the @sc{nul} character as the string terminator. In effect, this means that @samp{RS = "\0"} is the same as @samp{RS = ""}. @value{DARKCORNER} + @cindex records, treating files as + @cindex files, as single records The best way to treat a whole file as a single record is to simply read the file in, one record at a time, concatenating each record onto the end of the previous ones. + @c ENDOFRANGE inspl + @c ENDOFRANGE recspl ! @node Fields, Nonconstant Fields, Records, Reading Files @section Examining Fields @cindex examining fields @cindex fields @cindex accessing fields + @c STARTOFRANGE fiex + @cindex fields, examining + @cindex POSIX @command{awk}, field separators and + @cindex field separators, POSIX and + @cindex separators, field, POSIX and When @command{awk} reads an input record, the record is ! automatically @dfn{parsed} or separated by the interpreter into chunks called @dfn{fields}. By default, fields are separated by @dfn{whitespace}, like words in a line. Whitespace in @command{awk} means any string of one or more spaces, *************** *** 3993,4004 **** @cindex @code{$} field operator @cindex field operator @code{$} A dollar-sign (@samp{$}) is used to refer to a field in an @command{awk} program, followed by the number of the field you want. Thus, @code{$1} refers to the first field, @code{$2} to the second, and so on. (Unlike the Unix shells, the field numbers are not limited to single digits. ! @code{$127} is the one hundred and twenty-seventh field in the record.) For example, suppose the following is a line of input: @example --- 4135,4150 ---- @cindex @code{$} field operator @cindex field operator @code{$} + @cindex @code{$} (dollar sign), @code{$} field operator + @cindex dollar sign (@code{$}), @code{$} field operator + @c The comma here does NOT mark a secondary term: + @cindex field operators, dollar sign as A dollar-sign (@samp{$}) is used to refer to a field in an @command{awk} program, followed by the number of the field you want. Thus, @code{$1} refers to the first field, @code{$2} to the second, and so on. (Unlike the Unix shells, the field numbers are not limited to single digits. ! @code{$127} is the one hundred twenty-seventh field in the record.) For example, suppose the following is a line of input: @example *************** *** 4013,4019 **** field. @cindex @code{NF} variable ! @cindex number of fields, @code{NF} @code{NF} is a built-in variable whose value is the number of fields in the current record. @command{awk} automatically updates the value of @code{NF} each time it reads a record. No matter how many fields --- 4159,4165 ---- field. @cindex @code{NF} variable ! @cindex fields, number of @code{NF} is a built-in variable whose value is the number of fields in the current record. @command{awk} automatically updates the value of @code{NF} each time it reads a record. No matter how many fields *************** *** 4023,4029 **** one (such as @code{$8} when the record has only seven fields), you get the empty string. (If used in a numeric operation, you get zero.) ! The use of @code{$0}, which looks like a reference to the ``zeroth'' field, is a special case: it represents the whole input record when you are not interested in specific fields. Here are some more examples: --- 4169,4175 ---- one (such as @code{$8} when the record has only seven fields), you get the empty string. (If used in a numeric operation, you get zero.) ! The use of @code{$0}, which looks like a reference to the ``zero-th'' field, is a special case: it represents the whole input record when you are not interested in specific fields. Here are some more examples: *************** *** 4055,4063 **** @print{} macfoo A @print{} sabafoo C @end example ! @node Non-Constant Fields, Changing Fields, Fields, Reading Files ! @section Non-Constant Field Numbers The number of a field does not need to be a constant. Any expression in the @command{awk} language can be used after a @samp{$} to refer to a --- 4201,4212 ---- @print{} macfoo A @print{} sabafoo C @end example + @c ENDOFRANGE fiex ! @node Nonconstant Fields, Changing Fields, Fields, Reading Files ! @section Nonconstant Field Numbers ! @cindex fields, numbers ! @cindex field numbers The number of a field does not need to be a constant. Any expression in the @command{awk} language can be used after a @samp{$} to refer to a *************** *** 4106,4122 **** @code{$NF} is not a special feature---it is the direct consequence of evaluating @code{NF} and using its value as a field number. ! @node Changing Fields, Field Separators, Non-Constant Fields, Reading Files @section Changing the Contents of a Field @cindex fields, changing contents of - @cindex changing contents of a field - @cindex assignment to fields The contents of a field, as seen by @command{awk}, can be changed within an @command{awk} program; this changes what @command{awk} perceives as the current input record. (The actual input is untouched; @command{awk} @emph{never} modifies the input file.) ! Consider this example and its output: @example $ awk '@{ nboxes = $3 ; $3 = $3 - 10 --- 4255,4269 ---- @code{$NF} is not a special feature---it is the direct consequence of evaluating @code{NF} and using its value as a field number. ! @node Changing Fields, Field Separators, Nonconstant Fields, Reading Files @section Changing the Contents of a Field @cindex fields, changing contents of The contents of a field, as seen by @command{awk}, can be changed within an @command{awk} program; this changes what @command{awk} perceives as the current input record. (The actual input is untouched; @command{awk} @emph{never} modifies the input file.) ! Consider the following example and its output: @example $ awk '@{ nboxes = $3 ; $3 = $3 - 10 *************** *** 4171,4176 **** --- 4318,4325 ---- @dots{} @end example + @cindex adding, fields + @cindex fields, adding @noindent We've just created @code{$6}, whose value is the sum of fields @code{$2}, @code{$3}, @code{$4}, and @code{$5}. The @samp{+} sign *************** *** 4183,4188 **** --- 4332,4340 ---- the appropriate number of field separators between it and the previously existing fields. + @cindex @code{OFS} variable + @cindex output field separator, See @code{OFS} variable + @cindex field separators, See Also @code{OFS} This recomputation affects and is affected by @code{NF} (the number of fields; @pxref{Fields, ,Examining Fields}). It is also affected by a feature that has not been discussed yet: *************** *** 4240,4246 **** and @code{NF} is updated with the value six. @c FIXME: Verify that this is in POSIX ! @cindex dark corner Decrementing @code{NF} throws away the values of the fields after the new value of @code{NF} and recomputes @code{$0}. @value{DARKCORNER} --- 4392,4399 ---- and @code{NF} is updated with the value six. @c FIXME: Verify that this is in POSIX ! @cindex dark corner, @code{NF} variable, decrementing ! @cindex @code{NF} variable, decrementing Decrementing @code{NF} throws away the values of the fields after the new value of @code{NF} and recomputes @code{$0}. @value{DARKCORNER} *************** *** 4253,4261 **** @print{} a b c @end example ! @cindex portability issues @strong{Caution:} Some versions of @command{awk} don't rebuild @code{$0} when @code{NF} is decremented. Caveat emptor. @node Field Separators, Constant Size, Changing Fields, Reading Files @section Specifying How Fields Are Separated --- 4406,4416 ---- @print{} a b c @end example ! @c the comma before decrementing does NOT represent a tertiary entry ! @cindex portability, @code{NF} variable, decrementing @strong{Caution:} Some versions of @command{awk} don't rebuild @code{$0} when @code{NF} is decremented. Caveat emptor. + @c ENDOFRANGE ficon @node Field Separators, Constant Size, Changing Fields, Reading Files @section Specifying How Fields Are Separated *************** *** 4269,4275 **** @cindex @code{FS} variable @cindex fields, separating ! @cindex field separator, @code{FS} The @dfn{field separator}, which is either a single character or a regular expression, controls the way @command{awk} splits an input record into fields. @command{awk} scans the input record for character sequences that --- 4424,4433 ---- @cindex @code{FS} variable @cindex fields, separating ! @c STARTOFRANGE fisepr ! @cindex field separators ! @c STARTOFRANGE fisepg ! @cindex fields, separating The @dfn{field separator}, which is either a single character or a regular expression, controls the way @command{awk} splits an input record into fields. @command{awk} scans the input record for character sequences that *************** *** 4288,4301 **** @samp{@bullet{}gai@bullet{}pan}. Note the leading spaces in the values of the second and third fields. ! @cindex common mistakes ! @cindex mistakes, common ! @cindex errors, common The field separator is represented by the built-in variable @code{FS}. Shell programmers take note: @command{awk} does @emph{not} use the name @code{IFS} that is used by the POSIX-compliant shells (such as the Unix Bourne shell, @command{sh}, or @command{bash}). The value of @code{FS} can be changed in the @command{awk} program with the assignment operator, @samp{=} (@pxref{Assignment Ops, ,Assignment Expressions}). Often the right time to do this is at the beginning of execution --- 4446,4458 ---- @samp{@bullet{}gai@bullet{}pan}. Note the leading spaces in the values of the second and third fields. ! @cindex troubleshooting, @command{awk} uses @code{FS} not @code{IFS} The field separator is represented by the built-in variable @code{FS}. Shell programmers take note: @command{awk} does @emph{not} use the name @code{IFS} that is used by the POSIX-compliant shells (such as the Unix Bourne shell, @command{sh}, or @command{bash}). + @cindex @code{FS} variable, changing value of The value of @code{FS} can be changed in the @command{awk} program with the assignment operator, @samp{=} (@pxref{Assignment Ops, ,Assignment Expressions}). Often the right time to do this is at the beginning of execution *************** *** 4310,4315 **** --- 4467,4473 ---- awk 'BEGIN @{ FS = "," @} ; @{ print $2 @}' @end example + @cindex @code{BEGIN} pattern @noindent Given the input line: *************** *** 4321,4328 **** this @command{awk} program extracts and prints the string @samp{@bullet{}29@bullet{}Oak@bullet{}St.}. ! @cindex field separator, choice of @cindex regular expressions as field separators Sometimes the input data contains separator characters that don't separate fields the way you thought they would. For instance, the person's name in the example we just used might have a title or --- 4479,4487 ---- this @command{awk} program extracts and prints the string @samp{@bullet{}29@bullet{}Oak@bullet{}St.}. ! @cindex field separators, choice of @cindex regular expressions as field separators + @cindex field separators, regular expressions as Sometimes the input data contains separator characters that don't separate fields the way you thought they would. For instance, the person's name in the example we just used might have a title or *************** *** 4341,4346 **** --- 4500,4507 ---- (If the data is not in a form that is easy to process, perhaps you can massage it first with a separate @command{awk} program.) + @cindex newlines, as field separators + @cindex whitespace, as field separators Fields are normally separated by whitespace sequences (spaces, tabs, and newlines), not by single spaces. Two spaces in a row do not delimit an empty field. The default value of the field separator @code{FS} *************** *** 4361,4366 **** --- 4522,4531 ---- @node Regexp Field Splitting, Single Character Fields, Field Separators, Field Separators @subsection Using Regular Expressions to Separate Fields + @c STARTOFRANGE regexpfs + @cindex regular expressions, as field separators + @c STARTOFRANGE fsregexp + @cindex field separators, regular expressions as The previous @value{SUBSECTION} discussed the use of single characters or simple strings as the value of @code{FS}. *************** *** 4374,4383 **** @noindent makes every area of an input line that consists of a comma followed by a ! space and a tab into a field separator. @ifinfo (@samp{\t} ! is an @dfn{escape sequence} that stands for a tab; @pxref{Escape Sequences}, for the complete list of similar escape sequences.) @end ifinfo --- 4539,4548 ---- @noindent makes every area of an input line that consists of a comma followed by a ! space and a TAB into a field separator. @ifinfo (@samp{\t} ! is an @dfn{escape sequence} that stands for a TAB; @pxref{Escape Sequences}, for the complete list of similar escape sequences.) @end ifinfo *************** *** 4414,4421 **** @end example @noindent ! @cindex null string ! @cindex empty string In this case, the first field is @dfn{null} or empty. The stripping of leading and trailing whitespace also comes into --- 4579,4587 ---- @end example @noindent ! @cindex null strings ! @cindex strings, null ! @cindex empty strings, See null strings In this case, the first field is @dfn{null} or empty. The stripping of leading and trailing whitespace also comes into *************** *** 4434,4445 **** separated by the value of @code{OFS}. Because the leading whitespace was ignored when finding @code{$1}, it is not part of the new @code{$0}. Finally, the last @code{print} statement prints the new @code{$0}. @node Single Character Fields, Command Line Field Separator, Regexp Field Splitting, Field Separators @subsection Making Each Character a Separate Field ! @cindex differences between @command{gawk} and @command{awk} @cindex single-character fields There are times when you may want to examine each character of a record separately. This can be done in @command{gawk} by simply assigning the null string (@code{""}) to @code{FS}. In this case, --- 4600,4614 ---- separated by the value of @code{OFS}. Because the leading whitespace was ignored when finding @code{$1}, it is not part of the new @code{$0}. Finally, the last @code{print} statement prints the new @code{$0}. + @c ENDOFRANGE regexpfs + @c ENDOFRANGE fsregexp @node Single Character Fields, Command Line Field Separator, Regexp Field Splitting, Field Separators @subsection Making Each Character a Separate Field ! @cindex differences in @command{awk} and @command{gawk}, single-character fields @cindex single-character fields + @cindex fields, single-character There are times when you may want to examine each character of a record separately. This can be done in @command{gawk} by simply assigning the null string (@code{""}) to @code{FS}. In this case, *************** *** 4457,4463 **** @print{} Field 3 is b @end example ! @cindex dark corner Traditionally, the behavior of @code{FS} equal to @code{""} was not defined. In this case, most versions of Unix @command{awk} simply treat the entire record as only having one field. --- 4626,4633 ---- @print{} Field 3 is b @end example ! @cindex dark corner, @code{FS} as null string ! @cindex FS variable, as null string Traditionally, the behavior of @code{FS} equal to @code{""} was not defined. In this case, most versions of Unix @command{awk} simply treat the entire record as only having one field. *************** *** 4470,4478 **** @node Command Line Field Separator, Field Splitting Summary, Single Character Fields, Field Separators @subsection Setting @code{FS} from the Command Line @cindex @code{-F} option ! @cindex command-line option, @code{-F} ! @cindex field separator, on command line ! @cindex command line, setting @code{FS} on @code{FS} can be set on the command line. Use the @option{-F} option to do so. For example: --- 4640,4651 ---- @node Command Line Field Separator, Field Splitting Summary, Single Character Fields, Field Separators @subsection Setting @code{FS} from the Command Line @cindex @code{-F} option ! @cindex options, command-line ! @cindex command line, options ! @cindex field separators, on command line ! @c The comma before "setting" does NOT represent a tertiary ! @cindex command line, @code{FS} on, setting ! @cindex @code{FS} variable, setting from command line @code{FS} can be set on the command line. Use the @option{-F} option to do so. For example: *************** *** 4483,4489 **** @noindent sets @code{FS} to the @samp{,} character. Notice that the option uses ! a capital @samp{F} instead of a lowercase @option{-f}, which specifies a file containing an @command{awk} program. Case is significant in command-line options: the @option{-F} and @option{-f} options have nothing to do with each other. --- 4656,4663 ---- @noindent sets @code{FS} to the @samp{,} character. Notice that the option uses ! an uppercase @samp{F} instead of a lowercase @samp{f}. The latter ! option (@option{-f}) specifies a file containing an @command{awk} program. Case is significant in command-line options: the @option{-F} and @option{-f} options have nothing to do with each other. *************** *** 4502,4517 **** @end example @noindent Because @samp{\} is used for quoting in the shell, @command{awk} sees @samp{-F\\}. Then @command{awk} processes the @samp{\\} for escape characters (@pxref{Escape Sequences}), finally yielding a single @samp{\} to use for the field separator. ! @cindex historical features As a special case, in compatibility mode (@pxref{Options, ,Command-Line Options}), if the argument to @option{-F} is @samp{t}, then @code{FS} is set to ! the tab character. If you type @samp{-F\t} at the shell, without any quotes, the @samp{\} gets deleted, so @command{awk} figures that you really want your fields to be separated with tabs and not @samp{t}s. Use @samp{-v FS="t"} or @samp{-F"[t]"} on the command line --- 4676,4693 ---- @end example @noindent + @cindex @code{\} (backslash), as field separators + @cindex backslash (@code{\}), as field separators Because @samp{\} is used for quoting in the shell, @command{awk} sees @samp{-F\\}. Then @command{awk} processes the @samp{\\} for escape characters (@pxref{Escape Sequences}), finally yielding a single @samp{\} to use for the field separator. ! @c @cindex historical features As a special case, in compatibility mode (@pxref{Options, ,Command-Line Options}), if the argument to @option{-F} is @samp{t}, then @code{FS} is set to ! the TAB character. If you type @samp{-F\t} at the shell, without any quotes, the @samp{\} gets deleted, so @command{awk} figures that you really want your fields to be separated with tabs and not @samp{t}s. Use @samp{-v FS="t"} or @samp{-F"[t]"} on the command line *************** *** 4558,4563 **** --- 4734,4741 ---- originally intended. This demonstrates why you have to be careful in choosing your field and record separators. + @c The comma after "password files" does NOT start a tertiary + @cindex Unix @command{awk}, password files, field separators and Perhaps the most common use of a single character as the field separator occurs when processing the Unix system password file. On many Unix systems, each user has a separate entry in the system password *************** *** 4579,4590 **** @end example @node Field Splitting Summary, , Command Line Field Separator, Field Separators ! @subsection Field Splitting Summary The following table summarizes how fields are split, based on the ! value of @code{FS}. (@samp{==} means ``is equal to.'') @table @code @item FS == " " --- 4757,4768 ---- @end example @node Field Splitting Summary, , Command Line Field Separator, Field Separators ! @subsection Field-Splitting Summary The following table summarizes how fields are split, based on the ! value of @code{FS} (@samp{==} means ``is equal to''): @table @code @item FS == " " *************** *** 4611,4627 **** @c fakenode --- for prepinfo @subheading Advanced Notes: Changing @code{FS} Does Not Affect the Fields ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} According to the POSIX standard, @command{awk} is supposed to behave as if each record is split into fields at the time it is read. In particular, this means that if you change the value of @code{FS} after a record is read, the value of the fields (i.e., how they were split) should reflect the old value of @code{FS}, not the new one. ! @cindex dark corner @cindex @command{sed} utility ! @cindex stream editor However, many implementations of @command{awk} do not work this way. Instead, they defer splitting the fields until a field is actually referenced. The fields are split --- 4789,4805 ---- @c fakenode --- for prepinfo @subheading Advanced Notes: Changing @code{FS} Does Not Affect the Fields ! @cindex POSIX @command{awk}, field separators and ! @cindex field separators, POSIX and According to the POSIX standard, @command{awk} is supposed to behave as if each record is split into fields at the time it is read. In particular, this means that if you change the value of @code{FS} after a record is read, the value of the fields (i.e., how they were split) should reflect the old value of @code{FS}, not the new one. ! @cindex dark corner, field separators @cindex @command{sed} utility ! @cindex stream editors However, many implementations of @command{awk} do not work this way. Instead, they defer splitting the fields until a field is actually referenced. The fields are split *************** *** 4652,4657 **** --- 4830,4837 ---- @example root:nSijPlPhZZwgE:0:0:Root:/: @end example + @c ENDOFRANGE fisepr + @c ENDOFRANGE fisepg @node Constant Size, Multiple Line, Field Separators, Reading Files @section Reading Fixed-Width Data *************** *** 4668,4673 **** --- 4848,4856 ---- the first reading.) @end ifinfo + @cindex data, fixed-width + @cindex fixed-width data + @cindex advanced features, fixed-width data @command{gawk} @value{PVERSION} 2.13 introduced a facility for dealing with fixed-width fields with no distinctive field separator. For example, data of this nature arises in the input for old Fortran programs where *************** *** 4682,4689 **** (@pxref{String Functions, ,String Manipulation Functions}), this is awkward and inefficient for a large number of fields. ! @cindex fatal errors @cindex @command{w} utility The splitting of an input record into fixed-width fields is specified by assigning a string containing space-separated numbers to the built-in variable @code{FIELDWIDTHS}. Each number specifies the width of the field, --- 4865,4874 ---- (@pxref{String Functions, ,String Manipulation Functions}), this is awkward and inefficient for a large number of fields. ! @c comma before specifying is part of tertiary ! @cindex troubleshooting, fatal errors, field widths, specifying @cindex @command{w} utility + @cindex @code{FIELDWIDTHS} variable The splitting of an input record into fixed-width fields is specified by assigning a string containing space-separated numbers to the built-in variable @code{FIELDWIDTHS}. Each number specifies the width of the field, *************** *** 4711,4717 **** The following program takes the above input, converts the idle time to number of seconds, and prints out the first two fields and the calculated ! idle time. @strong{Note:} This program uses a number of @command{awk} features that --- 4896,4902 ---- The following program takes the above input, converts the idle time to number of seconds, and prints out the first two fields and the calculated ! idle time: @strong{Note:} This program uses a number of @command{awk} features that *************** *** 4762,4769 **** Exercise: Write a ballot card reading program @end ignore ! Assigning a value to @code{FS} causes @command{gawk} to return to using ! @code{FS} for field splitting. Use @samp{FS = FS} to make this happen, without having to know the current value of @code{FS}. In order to tell which kind of field splitting is in effect, use @code{PROCINFO["FS"]} --- 4947,4955 ---- Exercise: Write a ballot card reading program @end ignore ! @cindex @command{gawk}, splitting fields and ! Assigning a value to @code{FS} causes @command{gawk} to use ! @code{FS} for field splitting again. Use @samp{FS = FS} to make this happen, without having to know the current value of @code{FS}. In order to tell which kind of field splitting is in effect, use @code{PROCINFO["FS"]} *************** *** 4787,4800 **** @node Multiple Line, Getline, Constant Size, Reading Files @section Multiple-Line Records ! @cindex multiple line records ! @cindex input, multiple line records ! @cindex reading files, multiple line records ! @cindex records, multiple line In some databases, a single line cannot conveniently hold all the information in one entry. In such cases, you can use multiline records. The first step in doing this is to choose your data format. One technique is to use an unusual character or string to separate records. For example, you could use the formfeed character (written @samp{\f} in @command{awk}, as in C) to separate them, making each record --- 4973,4990 ---- @node Multiple Line, Getline, Constant Size, Reading Files @section Multiple-Line Records ! @c STARTOFRANGE recm ! @cindex records, multiline ! @c STARTOFRANGE imr ! @cindex input, multiline records ! @c STARTOFRANGE frm ! @cindex files, reading, multiline records ! @cindex input, files, See input files In some databases, a single line cannot conveniently hold all the information in one entry. In such cases, you can use multiline records. The first step in doing this is to choose your data format. + @cindex record separators, with multiline records One technique is to use an unusual character or string to separate records. For example, you could use the formfeed character (written @samp{\f} in @command{awk}, as in C) to separate them, making each record *************** *** 4803,4813 **** other character could equally well be used, as long as it won't be part of the data in a record. Another technique is to have blank lines separate records. By a special dispensation, an empty string as the value of @code{RS} indicates that records are separated by one or more blank lines. When @code{RS} is set to the empty string, each record always ends at the first blank line ! encountered. The next record doesn't start until the first non-blank line that follows. No matter how many blank lines appear in a row, they all act as one record separator. (Blank lines must be completely empty; lines that contain only --- 4993,5004 ---- other character could equally well be used, as long as it won't be part of the data in a record. + @cindex @code{RS} variable, multiline records and Another technique is to have blank lines separate records. By a special dispensation, an empty string as the value of @code{RS} indicates that records are separated by one or more blank lines. When @code{RS} is set to the empty string, each record always ends at the first blank line ! encountered. The next record doesn't start until the first nonblank line that follows. No matter how many blank lines appear in a row, they all act as one record separator. (Blank lines must be completely empty; lines that contain only *************** *** 4822,4831 **** sequence when there is a choice (@pxref{Leftmost Longest, ,How Much Text Matches?}). So the next record doesn't start until ! the first non-blank line that follows---no matter how many blank lines appear in a row, they are considered one record separator. ! @cindex dark corner There is an important difference between @samp{RS = ""} and @samp{RS = "\n\n+"}. In the first case, leading newlines in the input @value{DF} are ignored, and if a file ends without extra blank lines --- 5013,5022 ---- sequence when there is a choice (@pxref{Leftmost Longest, ,How Much Text Matches?}). So the next record doesn't start until ! the first nonblank line that follows---no matter how many blank lines appear in a row, they are considered one record separator. ! @cindex dark corner, multiline records There is an important difference between @samp{RS = ""} and @samp{RS = "\n\n+"}. In the first case, leading newlines in the input @value{DF} are ignored, and if a file ends without extra blank lines *************** *** 4833,4838 **** --- 5024,5030 ---- In the second case, this special processing is not done. @value{DARKCORNER} + @cindex field separators, in multiline records Now that the input is separated into records, the second step is to separate the fields in the record. One way to do this is to divide each of the lines into fields in the normal manner. This happens by default *************** *** 4854,4860 **** expression matches a single newline.) A practical example of a @value{DF} organized this way might be a mailing list, where each entry is separated by blank lines. Consider a mailing ! list in a file named @file{addresses}, that looks like this: @example Jane Doe --- 5046,5052 ---- expression matches a single newline.) A practical example of a @value{DF} organized this way might be a mailing list, where each entry is separated by blank lines. Consider a mailing ! list in a file named @file{addresses}, which looks like this: @example Jane Doe *************** *** 4932,4953 **** @item RS == @var{regexp} Records are separated by occurrences of characters that match @var{regexp}. Leading and trailing matches of @var{regexp} delimit empty records. ! (This is a @command{gawk} extension, it is not specified by the POSIX standard.) @end table @cindex @code{RT} variable In all cases, @command{gawk} sets @code{RT} to the input text that matched the value specified by @code{RS}. @node Getline, , Multiple Line, Reading Files @section Explicit Input with @code{getline} ! @cindex @code{getline} built-in function @cindex input, explicit - @cindex explicit input - @cindex input, @code{getline} command - @cindex reading files, @code{getline} command So far we have been getting our input data from @command{awk}'s main input stream---either the standard input (usually your terminal, sometimes the output from another program) or from the --- 5124,5146 ---- @item RS == @var{regexp} Records are separated by occurrences of characters that match @var{regexp}. Leading and trailing matches of @var{regexp} delimit empty records. ! (This is a @command{gawk} extension; it is not specified by the POSIX standard.) @end table @cindex @code{RT} variable In all cases, @command{gawk} sets @code{RT} to the input text that matched the value specified by @code{RS}. + @c ENDOFRANGE recm + @c ENDOFRANGE imr + @c ENDOFRANGE frm @node Getline, , Multiple Line, Reading Files @section Explicit Input with @code{getline} ! @c STARTOFRANGE getl ! @cindex @code{getline} command, explicit input with @cindex input, explicit So far we have been getting our input data from @command{awk}'s main input stream---either the standard input (usually your terminal, sometimes the output from another program) or from the *************** *** 4963,4972 **** rest of this @value{DOCUMENT} and have a good knowledge of how @command{awk} works. @cindex @code{ERRNO} variable ! @cindex differences between @command{gawk} and @command{awk} ! @cindex @code{getline}, return values The @code{getline} command returns one if it finds a record and zero if ! the end of the file is encountered. If there is some error in getting a record, such as a file that cannot be opened, then @code{getline} returns @minus{}1. In this case, @command{gawk} sets the variable @code{ERRNO} to a string describing the error that occurred. --- 5156,5165 ---- rest of this @value{DOCUMENT} and have a good knowledge of how @command{awk} works. @cindex @code{ERRNO} variable ! @cindex differences in @command{awk} and @command{gawk}, @code{getline} command ! @cindex @code{getline} command, return values The @code{getline} command returns one if it finds a record and zero if ! it encounters the end of the file. If there is some error in getting a record, such as a file that cannot be opened, then @code{getline} returns @minus{}1. In this case, @command{gawk} sets the variable @code{ERRNO} to a string describing the error that occurred. *************** *** 4997,5004 **** from the current input file. All it does in this case is read the next input record and split it up into fields. This is useful if you've finished processing the current record, but want to do some special ! processing @emph{right now} on the next record. Here's an ! example: @example @{ --- 5190,5196 ---- from the current input file. All it does in this case is read the next input record and split it up into fields. This is useful if you've finished processing the current record, but want to do some special ! processing on the next record @emph{right now}. For example: @example @{ *************** *** 5049,5054 **** --- 5241,5248 ---- @node Getline/Variable, Getline/File, Plain Getline, Getline @subsection Using @code{getline} into a Variable + @c comma before using is NOT for tertiary + @cindex variables, @code{getline} command into, using You can use @samp{getline @var{var}} to read the next record from @command{awk}'s input into the variable @var{var}. No other processing is *************** *** 5058,5065 **** any rules. This form of @code{getline} allows you to read that line and store it in a variable so that the main read-a-line-and-check-each-rule loop of @command{awk} never sees it. ! The following example swaps every two lines of input. ! The program is as follows: @example @{ --- 5252,5258 ---- any rules. This form of @code{getline} allows you to read that line and store it in a variable so that the main read-a-line-and-check-each-rule loop of @command{awk} never sees it. ! The following example swaps every two lines of input: @example @{ *************** *** 5101,5107 **** @cindex input redirection @cindex redirection of input ! @cindex @code{<} I/O operator Use @samp{getline < @var{file}} to read the next record from @var{file}. Here @var{file} is a string-valued expression that specifies the @value{FN}. @samp{< @var{file}} is called a @dfn{redirection} --- 5294,5302 ---- @cindex input redirection @cindex redirection of input ! @cindex @code{<} (left angle bracket), @code{<} operator (I/O) ! @cindex left angle bracket (@code{<}), @code{<} operator (I/O) ! @cindex operators, input/output Use @samp{getline < @var{file}} to read the next record from @var{file}. Here @var{file} is a string-valued expression that specifies the @value{FN}. @samp{< @var{file}} is called a @dfn{redirection} *************** *** 5126,5131 **** --- 5321,5327 ---- the normal manner, so the values of @code{$0} and the other fields are changed, resulting in a new value of @code{NF}. + @cindex POSIX @command{awk}, @code{<} operator and @c Thanks to Paul Eggert for initial wording here According to POSIX, @samp{getline < @var{expression}} is ambiguous if @var{expression} contains unparenthesized operators other than *************** *** 5138,5143 **** --- 5334,5341 ---- @node Getline/Variable/File, Getline/Pipe, Getline/File, Getline @subsection Using @code{getline} into a Variable from a File + @c comma before using is NOT for tertiary + @cindex variables, @code{getline} command into, using Use @samp{getline @var{var} < @var{file}} to read input from the file *************** *** 5164,5172 **** @end example Note here how the name of the extra input file is not built into ! the program; it is taken directly from the data, from the second field on the @samp{@@include} line. The @code{close} function is called to ensure that if two identical @samp{@@include} lines appear in the input, the entire specified file is included twice. --- 5362,5371 ---- @end example Note here how the name of the extra input file is not built into ! the program; it is taken directly from the data, specifically from the second field on the @samp{@@include} line. + @cindex @code{close} function The @code{close} function is called to ensure that if two identical @samp{@@include} lines appear in the input, the entire specified file is included twice. *************** *** 5182,5190 **** @node Getline/Pipe, Getline/Variable/Pipe, Getline/Variable/File, Getline @subsection Using @code{getline} from a Pipe ! @cindex @code{|} I/O operator @cindex input pipeline ! @cindex pipeline, input The output of a command can also be piped into @code{getline}, using @samp{@var{command} | getline}. In this case, the string @var{command} is run as a shell command and its output --- 5381,5391 ---- @node Getline/Pipe, Getline/Variable/Pipe, Getline/Variable/File, Getline @subsection Using @code{getline} from a Pipe ! @cindex @code{|} (vertical bar), @code{|} operator (I/O) ! @cindex vertical bar (@code{|}), @code{|} operator (I/O) @cindex input pipeline ! @cindex pipes, input ! @cindex operators, input/output The output of a command can also be piped into @code{getline}, using @samp{@var{command} | getline}. In this case, the string @var{command} is run as a shell command and its output *************** *** 5207,5212 **** --- 5408,5414 ---- @end example @noindent + @cindex @code{close} function The @code{close} function is called to ensure that if two identical @samp{@@execute} lines appear in the input, the command is run for each one. *************** *** 5242,5255 **** @end example @noindent ! Notice that this program ran the command @command{who} and printed the result. (If you try this program yourself, you will of course get different results, depending upon who is logged in on your system.) This variation of @code{getline} splits the record into fields, sets the ! value of @code{NF} and recomputes the value of @code{$0}. The values of @code{NR} and @code{FNR} are not changed. @c Thanks to Paul Eggert for initial wording here According to POSIX, @samp{@var{expression} | getline} is ambiguous if @var{expression} contains unparenthesized operators other than --- 5444,5458 ---- @end example @noindent ! Notice that this program ran the command @command{who} and printed the previous result. (If you try this program yourself, you will of course get different results, depending upon who is logged in on your system.) This variation of @code{getline} splits the record into fields, sets the ! value of @code{NF}, and recomputes the value of @code{$0}. The values of @code{NR} and @code{FNR} are not changed. + @cindex POSIX @command{awk}, @code{|} I/O operator and @c Thanks to Paul Eggert for initial wording here According to POSIX, @samp{@var{expression} | getline} is ambiguous if @var{expression} contains unparenthesized operators other than *************** *** 5264,5269 **** --- 5467,5474 ---- @node Getline/Variable/Pipe, Getline/Coprocess, Getline/Pipe, Getline @subsection Using @code{getline} into a Variable from a Pipe + @c comma before using is NOT for tertiary + @cindex variables, @code{getline} command into, using When you use @samp{@var{command} | getline @var{var}}, the output of @var{command} is sent through a pipe to *************** *** 5297,5305 **** @node Getline/Coprocess, Getline/Variable/Coprocess, Getline/Variable/Pipe, Getline @subsection Using @code{getline} from a Coprocess ! @cindex coprocess ! @cindex @code{|&} I/O operator ! @cindex differences between @command{gawk} and @command{awk} Input into @code{getline} from a pipe is a one-way operation. The command that is started with @samp{@var{command} | getline} only --- 5502,5514 ---- @node Getline/Coprocess, Getline/Variable/Coprocess, Getline/Variable/Pipe, Getline @subsection Using @code{getline} from a Coprocess ! @cindex coprocesses, @code{getline} from ! @c comma before using is NOT for tertiary ! @cindex @code{getline} command, coprocesses, using from ! @cindex @code{|} (vertical bar), @code{|&} operator (I/O) ! @cindex vertical bar (@code{|}), @code{|&} operator (I/O) ! @cindex operators, input/output ! @cindex differences in @command{awk} and @command{gawk}, input/output operators Input into @code{getline} from a pipe is a one-way operation. The command that is started with @samp{@var{command} | getline} only *************** *** 5310,5316 **** @command{gawk} allows you start a @dfn{coprocess}, with which two-way communications are possible. This is done with the @samp{|&} operator. ! Typically, you write data to the coprocess first, and then read results back, as shown in the following: @example --- 5519,5525 ---- @command{gawk} allows you start a @dfn{coprocess}, with which two-way communications are possible. This is done with the @samp{|&} operator. ! Typically, you write data to the coprocess first and then read results back, as shown in the following: @example *************** *** 5325,5331 **** @code{FNR} are not changed, because the main input stream is not used. However, the record is split into fields in ! the normal manner, thus changing the values of @code{$0}, the other fields, and of @code{NF}. Coprocesses are an advanced feature. They are discussed here only because --- 5534,5540 ---- @code{FNR} are not changed, because the main input stream is not used. However, the record is split into fields in ! the normal manner, thus changing the values of @code{$0}, of the other fields, and of @code{NF}. Coprocesses are an advanced feature. They are discussed here only because *************** *** 5335,5340 **** --- 5544,5551 ---- @node Getline/Variable/Coprocess, Getline Notes, Getline/Coprocess, Getline @subsection Using @code{getline} into a Variable from a Coprocess + @c comma before using is NOT for tertiary + @cindex variables, @code{getline} command into, using When you use @samp{@var{command} |& getline @var{var}}, the output from the coprocess @var{command} is sent through a two-way pipe to @code{getline} *************** *** 5352,5358 **** @end ifinfo @node Getline Notes, Getline Summary, Getline/Variable/Coprocess, Getline ! @subsection Points About @code{getline} to Remember Here are some miscellaneous points about @code{getline} that you should bear in mind: --- 5563,5569 ---- @end ifinfo @node Getline Notes, Getline Summary, Getline/Variable/Coprocess, Getline ! @subsection Points to Remember About @code{getline} Here are some miscellaneous points about @code{getline} that you should bear in mind: *************** *** 5363,5382 **** program and start testing the new record against every pattern. However, the new record is tested against any subsequent rules. ! @cindex differences between @command{gawk} and @command{awk} ! @cindex limitations ! @cindex implementation limits @item Many @command{awk} implementations limit the number of pipelines that an @command{awk} program may have open to just one. In @command{gawk}, there is no such limit. You can open as many pipelines (and coprocesses) as the underlying operating system permits. ! @cindex side effects ! @cindex @code{FILENAME} variable ! @cindex dark corner ! @cindex @code{getline}, setting @code{FILENAME} ! @cindex @code{FILENAME}, being set by @code{getline} @item An interesting side effect occurs if you use @code{getline} without a redirection inside a @code{BEGIN} rule. Because an unredirected @code{getline} --- 5574,5595 ---- program and start testing the new record against every pattern. However, the new record is tested against any subsequent rules. ! @cindex differences in @command{awk} and @command{gawk}, implementation limitations ! @cindex implementation issues, @command{gawk}, limits ! @cindex @command{awk}, implementations, limits ! @cindex @command{gawk}, implementation issues, limits @item Many @command{awk} implementations limit the number of pipelines that an @command{awk} program may have open to just one. In @command{gawk}, there is no such limit. You can open as many pipelines (and coprocesses) as the underlying operating system permits. ! @cindex side effects, @code{FILENAME} variable ! @c The comma before "setting with" does NOT represent a tertiary ! @cindex @code{FILENAME} variable, @code{getline}, setting with ! @cindex dark corner, @code{FILENAME} variable ! @cindex @code{getline} command, @code{FILENAME} variable and ! @cindex @code{BEGIN} pattern, @code{getline} and @item An interesting side effect occurs if you use @code{getline} without a redirection inside a @code{BEGIN} rule. Because an unredirected @code{getline} *************** *** 5391,5404 **** @node Getline Summary, , Getline Notes, Getline @subsection Summary of @code{getline} Variants The following table summarizes the eight variants of @code{getline}, listing which built-in variables are set by each one. @multitable {@var{command} @code{|& getline} @var{var}} {1234567890123456789012345678901234567890} ! @item @code{getline} @tab Sets @code{$0}, @code{NF}, @code{FNR} and @code{NR} ! @item @code{getline} @var{var} @tab Sets @var{var}, @code{FNR} and @code{NR} @item @code{getline <} @var{file} @tab Sets @code{$0} and @code{NF} --- 5604,5618 ---- @node Getline Summary, , Getline Notes, Getline @subsection Summary of @code{getline} Variants + @cindex @code{getline} command, variants The following table summarizes the eight variants of @code{getline}, listing which built-in variables are set by each one. @multitable {@var{command} @code{|& getline} @var{var}} {1234567890123456789012345678901234567890} ! @item @code{getline} @tab Sets @code{$0}, @code{NF}, @code{FNR}, and @code{NR} ! @item @code{getline} @var{var} @tab Sets @var{var}, @code{FNR}, and @code{NR} @item @code{getline <} @var{file} @tab Sets @code{$0} and @code{NF} *************** *** 5408,5426 **** @item @var{command} @code{| getline} @var{var} @tab Sets @var{var} ! @item @var{command} @code{|& getline} @tab Sets @code{$0} and @code{NF} ! (this is a @command{gawk} extension) ! @item @var{command} @code{|& getline} @var{var} @tab Sets @var{var} ! (this is a @command{gawk} extension) @end multitable @node Printing, Expressions, Reading Files, Top @chapter Printing Output @cindex printing ! @cindex output ! One of the most common programming actions is to @dfn{print} or output, some or all of the input. Use the @code{print} statement for simple output, and the @code{printf} statement for fancier formatting. --- 5622,5644 ---- @item @var{command} @code{| getline} @var{var} @tab Sets @var{var} ! @item @var{command} @code{|& getline} @tab Sets @code{$0} and @code{NF}. ! This is a @command{gawk} extension ! @item @var{command} @code{|& getline} @var{var} @tab Sets @var{var}. ! This is a @command{gawk} extension @end multitable + @c ENDOFRANGE getl + @c ENDOFRANGE inex + @c ENDOFRANGE infir @node Printing, Expressions, Reading Files, Top @chapter Printing Output + @c STARTOFRANGE prnt @cindex printing ! @cindex output, printing, See printing ! One of the most common programming actions is to @dfn{print}, or output, some or all of the input. Use the @code{print} statement for simple output, and the @code{printf} statement for fancier formatting. *************** *** 5430,5438 **** columns, whether to use exponential notation or not, and so on. (For the exceptions, @pxref{Output Separators}, and @ref{OFMT, ,Controlling Numeric Output with @code{print}}.) ! For that, you need the @code{printf} statement (@pxref{Printf, ,Using @code{printf} Statements for Fancier Printing}). Besides basic and formatted printing, this @value{CHAPTER} also covers I/O redirections to files and pipes, introduces the special @value{FN}s that @command{gawk} processes internally, --- 5648,5659 ---- columns, whether to use exponential notation or not, and so on. (For the exceptions, @pxref{Output Separators}, and @ref{OFMT, ,Controlling Numeric Output with @code{print}}.) ! For printing with specifications, you need the @code{printf} statement (@pxref{Printf, ,Using @code{printf} Statements for Fancier Printing}). + @c STARTOFRANGE prnts + @cindex @code{print} statement + @cindex @code{printf} statement Besides basic and formatted printing, this @value{CHAPTER} also covers I/O redirections to files and pipes, introduces the special @value{FN}s that @command{gawk} processes internally, *************** *** 5454,5460 **** @node Print, Print Examples, Printing, Printing @section The @code{print} Statement - @cindex @code{print} statement The @code{print} statement is used to produce output with simple, standardized formatting. Specify only the strings or numbers to print, in a --- 5675,5680 ---- *************** *** 5475,5487 **** current record (such as @code{$1}), variables, or any @command{awk} expression. Numeric values are converted to strings and then printed. The simple statement @samp{print} with no items is equivalent to @samp{print $0}: it prints the entire current record. To print a blank line, use @samp{print ""}, where @code{""} is the empty string. To print a fixed piece of text, use a string constant, such as @w{@code{"Don't Panic"}}, as one item. If you forget to use the ! double quote characters, your text is taken as an @command{awk} ! expression and you will probably get an error. Keep in mind that a space is printed between any two items. @node Print Examples, Output Separators, Print, Printing --- 5695,5710 ---- current record (such as @code{$1}), variables, or any @command{awk} expression. Numeric values are converted to strings and then printed. + @cindex records, printing + @cindex lines, blank, printing + @cindex text, printing The simple statement @samp{print} with no items is equivalent to @samp{print $0}: it prints the entire current record. To print a blank line, use @samp{print ""}, where @code{""} is the empty string. To print a fixed piece of text, use a string constant, such as @w{@code{"Don't Panic"}}, as one item. If you forget to use the ! double-quote characters, your text is taken as an @command{awk} ! expression, and you will probably get an error. Keep in mind that a space is printed between any two items. @node Print Examples, Output Separators, Print, Printing *************** *** 5492,5497 **** --- 5715,5721 ---- newline, the newline is output along with the rest of the string. A single @code{print} statement can make any number of lines this way. + @cindex newlines, printing The following is an example of printing a string that contains embedded newlines (the @samp{\n} is an escape sequence, used to represent the newline character; @pxref{Escape Sequences}): *************** *** 5503,5508 **** --- 5727,5733 ---- @print{} line three @end example + @cindex fields, printing The next example, which is run on the @file{inventory-shipped} file, prints the first two fields of each input record, with a space between them: *************** *** 5515,5523 **** @dots{} @end example ! @cindex common mistakes ! @cindex mistakes, common ! @cindex errors, common A common mistake in using the @code{print} statement is to omit the comma between two items. This often has the effect of making the items run together in the output, with no space. The reason for this is that --- 5740,5748 ---- @dots{} @end example ! @cindex @code{print} statement, commas, omitting ! @c comma does NOT start tertiary ! @cindex troubleshooting, @code{print} statement, omitting commas A common mistake in using the @code{print} statement is to omit the comma between two items. This often has the effect of making the items run together in the output, with no space. The reason for this is that *************** *** 5532,5537 **** --- 5757,5764 ---- @dots{} @end example + @c comma does NOT start tertiary + @cindex @code{BEGIN} pattern, headings, adding To someone unfamiliar with the @file{inventory-shipped} file, neither example's output makes much sense. A heading line at the beginning would make it clearer. Let's add some headings to our table of months *************** *** 5571,5576 **** --- 5798,5806 ---- @end group @end example + @c comma does NOT start tertiary + @cindex @code{printf} statement, columns, aligning + @cindex columns, aligning Lining up columns this way can get pretty complicated when there are many columns to fix. Counting spaces for two or three columns is simple, but any more than this can take up *************** *** 5578,5595 **** created (@pxref{Printf, ,Using @code{printf} Statements for Fancier Printing}); one of its specialties is lining up columns of data. ! @cindex line continuation @strong{Note:} You can continue either a @code{print} or @code{printf} statement simply by putting a newline after any comma (@pxref{Statements/Lines, ,@command{awk} Statements Versus Lines}). @node Output Separators, OFMT, Print Examples, Printing @section Output Separators - @cindex output field separator, @code{OFS} - @cindex output record separator, @code{ORS} @cindex @code{OFS} variable - @cindex @code{ORS} variable As mentioned previously, a @code{print} statement contains a list of items separated by commas. In the output, the items are normally separated by single spaces. However, this doesn't need to be the case; --- 5808,5824 ---- created (@pxref{Printf, ,Using @code{printf} Statements for Fancier Printing}); one of its specialties is lining up columns of data. ! @cindex line continuations, in @code{print} statement ! @cindex @code{print} statement, line continuations and @strong{Note:} You can continue either a @code{print} or @code{printf} statement simply by putting a newline after any comma (@pxref{Statements/Lines, ,@command{awk} Statements Versus Lines}). + @c ENDOFRANGE prnts @node Output Separators, OFMT, Print Examples, Printing @section Output Separators @cindex @code{OFS} variable As mentioned previously, a @code{print} statement contains a list of items separated by commas. In the output, the items are normally separated by single spaces. However, this doesn't need to be the case; *************** *** 5605,5610 **** --- 5834,5843 ---- value of @code{ORS} is the string @code{"\n"}; i.e., a newline character. Thus, each @code{print} statement normally makes a separate line. + @cindex output, records + @cindex output record separator, See @code{ORS} variable + @cindex @code{ORS} variable + @cindex @code{BEGIN} pattern, @code{OFS}/@code{ORS} variables, assigning values to In order to change how output fields and records are separated, assign new values to the variables @code{OFS} and @code{ORS}. The usual place to do this is in the @code{BEGIN} rule *************** *** 5644,5653 **** @node OFMT, Printf, Output Separators, Printing @section Controlling Numeric Output with @code{print} ! @cindex @code{OFMT} variable ! @cindex numeric output format ! @cindex format, numeric output ! @cindex output format specifier, @code{OFMT} When the @code{print} statement is used to print numeric values, @command{awk} internally converts the number to a string of characters and prints that string. @command{awk} uses the @code{sprintf} function --- 5877,5885 ---- @node OFMT, Printf, Output Separators, Printing @section Controlling Numeric Output with @code{print} ! @cindex numeric, output format ! @c the comma does NOT start a secondary ! @cindex formats, numeric output When the @code{print} statement is used to print numeric values, @command{awk} internally converts the number to a string of characters and prints that string. @command{awk} uses the @code{sprintf} function *************** *** 5660,5665 **** --- 5892,5901 ---- more fully in @ref{Control Letters, , Format-Control Letters}. + @cindex @code{sprintf} function + @cindex @code{OFMT} variable + @c the comma before OFMT does NOT start a tertiary + @cindex output, format specifier, @code{OFMT} The built-in variable @code{OFMT} contains the default format specification that @code{print} uses with @code{sprintf} when it wants to convert a number to a string for printing. *************** *** 5676,5694 **** @end example @noindent ! @cindex dark corner ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} According to the POSIX standard, @command{awk}'s behavior is undefined if @code{OFMT} contains anything but a floating-point conversion specification. @value{DARKCORNER} @node Printf, Redirection, OFMT, Printing @section Using @code{printf} Statements for Fancier Printing - @cindex formatted output - @cindex output, formatted - @cindex @code{printf} statement For more precise control over the output format than what is normally provided by @code{print}, use @code{printf}. @code{printf} can be used to --- 5912,5931 ---- @end example @noindent ! @cindex dark corner, @code{OFMT} variable ! @cindex POSIX @command{awk}, @code{OFMT} variable and ! @cindex @code{OFMT} variable, POSIX @command{awk} and According to the POSIX standard, @command{awk}'s behavior is undefined if @code{OFMT} contains anything but a floating-point conversion specification. @value{DARKCORNER} @node Printf, Redirection, OFMT, Printing @section Using @code{printf} Statements for Fancier Printing + @c STARTOFRANGE printfs + @cindex @code{printf} statement + @cindex output, formatted + @cindex formatting output For more precise control over the output format than what is normally provided by @code{print}, use @code{printf}. @code{printf} can be used to *************** *** 5719,5728 **** @noindent The entire list of arguments may optionally be enclosed in parentheses. The parentheses are necessary if any of the item expressions use the @samp{>} ! relational operator; otherwise it can be confused with a redirection (@pxref{Redirection, ,Redirecting Output of @code{print} and @code{printf}}). ! @cindex format string The difference between @code{printf} and @code{print} is the @var{format} argument. This is an expression whose value is taken as a string; it specifies how to output each of the other arguments. It is called the --- 5956,5965 ---- @noindent The entire list of arguments may optionally be enclosed in parentheses. The parentheses are necessary if any of the item expressions use the @samp{>} ! relational operator; otherwise, it can be confused with a redirection (@pxref{Redirection, ,Redirecting Output of @code{print} and @code{printf}}). ! @cindex format strings The difference between @code{printf} and @code{print} is the @var{format} argument. This is an expression whose value is taken as a string; it specifies how to output each of the other arguments. It is called the *************** *** 5755,5762 **** @node Control Letters, Format Modifiers, Basic Printf, Printf @subsection Format-Control Letters ! @cindex @code{printf}, format-control characters ! @cindex format specifier, @code{printf} A format specifier starts with the character @samp{%} and ends with a @dfn{format-control letter}---it tells the @code{printf} statement --- 5992,5999 ---- @node Control Letters, Format Modifiers, Basic Printf, Printf @subsection Format-Control Letters ! @cindex @code{printf} statement, format-control characters ! @cindex format specifiers, @code{printf} statement A format specifier starts with the character @samp{%} and ends with a @dfn{format-control letter}---it tells the @code{printf} statement *************** *** 5826,5837 **** instead of @samp{a} through @samp{f}. @item %% ! This isn't a format-control letter but it does have meaning---the sequence @samp{%%} outputs one @samp{%}; it does not consume an argument and it ignores any modifiers. @end table ! @cindex dark corner @strong{Note:} When using the integer format-control letters for values that are outside the range of a C @code{long} integer, @command{gawk} switches to the --- 6063,6075 ---- instead of @samp{a} through @samp{f}. @item %% ! This isn't a format-control letter, but it does have meaning---the sequence @samp{%%} outputs one @samp{%}; it does not consume an argument and it ignores any modifiers. @end table ! @cindex dark corner, format-control characters ! @cindex @command{gawk}, format-control characters @strong{Note:} When using the integer format-control letters for values that are outside the range of a C @code{long} integer, @command{gawk} switches to the *************** *** 5842,5849 **** @node Format Modifiers, Printf Examples, Control Letters, Printf @subsection Modifiers for @code{printf} Formats ! @cindex @code{printf}, modifiers ! @cindex modifiers (in format specifiers) A format specification can also include @dfn{modifiers} that can control how much of the item's value is printed, as well as how much space it gets. The modifiers come between the @samp{%} and the format-control letter. --- 6080,6089 ---- @node Format Modifiers, Printf Examples, Control Letters, Printf @subsection Modifiers for @code{printf} Formats ! @c STARTOFRANGE pfm ! @cindex @code{printf} statement, modifiers ! @c the comma here does NOT start a secondary ! @cindex modifiers, in format specifiers A format specification can also include @dfn{modifiers} that can control how much of the item's value is printed, as well as how much space it gets. The modifiers come between the @samp{%} and the format-control letter. *************** *** 5853,5868 **** which they may appear: @table @code ! @cindex differences between @command{gawk} and @command{awk} ! @cindex @code{printf}, positional specifier ! @cindex positional specifier, @code{printf} @item @var{N}$ An integer constant followed by a @samp{$} is a @dfn{positional specifier}. Normally, format specifications are applied to arguments in the order given in the format string. With a positional specifier, the format specification is applied to a specific argument, instead of what would be the next argument in the list. Positional specifiers begin ! counting with one: @example printf "%s %s\n", "don't", "panic" --- 6093,6109 ---- which they may appear: @table @code ! @cindex differences in @command{awk} and @command{gawk}, @code{print}/@code{printf} statements ! @cindex @code{printf} statement, positional specifiers ! @c the command does NOT start a secondary ! @cindex positional specifiers, @code{printf} statement @item @var{N}$ An integer constant followed by a @samp{$} is a @dfn{positional specifier}. Normally, format specifications are applied to arguments in the order given in the format string. With a positional specifier, the format specification is applied to a specific argument, instead of what would be the next argument in the list. Positional specifiers begin ! counting with one. Thus: @example printf "%s %s\n", "don't", "panic" *************** *** 5880,5886 **** For now, we will not use them. @item - ! The minus sign, used before the width modifier (see further on in this table), says to left-justify the argument within its specified width. Normally, the argument --- 6121,6127 ---- For now, we will not use them. @item - ! The minus sign, used before the width modifier (see later on in this table), says to left-justify the argument within its specified width. Normally, the argument *************** *** 5898,5904 **** negative values with a minus sign. @item + ! The plus sign, used before the width modifier (see further on in this table), says to always supply a sign for numeric conversions, even if the data to format is positive. The @samp{+} overrides the space modifier. --- 6139,6145 ---- negative values with a minus sign. @item + ! The plus sign, used before the width modifier (see later on in this table), says to always supply a sign for numeric conversions, even if the data to format is positive. The @samp{+} overrides the space modifier. *************** *** 6013,6022 **** @noindent This is not particularly easy to read but it does work. ! @cindex fatal errors ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} ! @cindex lint checks C programmers may be used to supplying additional @samp{l}, @samp{L}, and @samp{h} modifiers in @code{printf} format strings. These are not valid in @command{awk}. --- 6254,6262 ---- @noindent This is not particularly easy to read but it does work. ! @c @cindex lint checks ! @cindex troubleshooting, fatal errors, @code{printf} format strings ! @cindex POSIX @command{awk}, @code{printf} format strings and C programmers may be used to supplying additional @samp{l}, @samp{L}, and @samp{h} modifiers in @code{printf} format strings. These are not valid in @command{awk}. *************** *** 6025,6030 **** --- 6265,6271 ---- (@pxref{Options, ,Command-Line Options}), @command{gawk} warns about their use. If @option{--posix} is supplied, their use is a fatal error. + @c ENDOFRANGE pfm @node Printf Examples, , Format Modifiers, Printf @subsection Examples Using @code{printf} *************** *** 6111,6116 **** --- 6352,6358 ---- @file{inventory-shipped} example that was covered earlier in the @value{SECTION} on the @code{print} statement (@pxref{Print, ,The @code{print} Statement}). + @c ENDOFRANGE printfs @node Redirection, Special Files, Printf, Printing @section Redirecting Output of @code{print} and @code{printf} *************** *** 6127,6139 **** Redirections in @command{awk} are written just like redirections in shell commands, except that they are written inside the @command{awk} program. There are four forms of output redirection: output to a file, output appended to a file, output through a pipe to another command, and output to a coprocess. They are all shown for the @code{print} statement, but they work identically for @code{printf}: @table @code ! @cindex @code{>} I/O operator @item print @var{items} > @var{output-file} This type of redirection prints the items into the output file named @var{output-file}. The @value{FN} @var{output-file} can be any --- 6369,6386 ---- Redirections in @command{awk} are written just like redirections in shell commands, except that they are written inside the @command{awk} program. + @c the commas here are part of the see also + @cindex @code{print} statement, See Also redirection, of output + @cindex @code{printf} statement, See Also redirection, of output There are four forms of output redirection: output to a file, output appended to a file, output through a pipe to another command, and output to a coprocess. They are all shown for the @code{print} statement, but they work identically for @code{printf}: @table @code ! @cindex @code{>} (right angle bracket), @code{>} operator (I/O) ! @cindex right angle bracket (@code{>}), @code{>} operator (I/O) ! @cindex operators, input/output @item print @var{items} > @var{output-file} This type of redirection prints the items into the output file named @var{output-file}. The @value{FN} @var{output-file} can be any *************** *** 6165,6171 **** @noindent Each output file contains one name or number per line. ! @cindex @code{>>} I/O operator @item print @var{items} >> @var{output-file} This type of redirection prints the items into the pre-existing output file named @var{output-file}. The difference between this and the --- 6412,6419 ---- @noindent Each output file contains one name or number per line. ! @cindex @code{>} (right angle bracket), @code{>>} operator (I/O) ! @cindex right angle bracket (@code{>}), @code{>>} operator (I/O) @item print @var{items} >> @var{output-file} This type of redirection prints the items into the pre-existing output file named @var{output-file}. The difference between this and the *************** *** 6174,6182 **** appended to the file. If @var{output-file} does not exist, then it is created. ! @cindex @code{|} I/O operator ! @cindex pipes for output ! @cindex output, piping @item print @var{items} | @var{command} It is also possible to send output to another program through a pipe instead of into a file. This type of redirection opens a pipe to --- 6422,6430 ---- appended to the file. If @var{output-file} does not exist, then it is created. ! @cindex @code{|} (vertical bar), @code{|} operator (I/O) ! @cindex pipes, output ! @cindex output, pipes @item print @var{items} | @var{command} It is also possible to send output to another program through a pipe instead of into a file. This type of redirection opens a pipe to *************** *** 6218,6231 **** @end example The message is built using string concatenation and saved in the variable ! @code{m}. It is then sent down the pipeline to the @command{mail} program. (The parentheses group the items to concatenate---see @ref{Concatenation, ,String Concatenation}.) The @code{close} function is called here because it's a good idea to close the pipe as soon as all the intended output has been sent to it. @xref{Close Files And Pipes, ,Closing Input and Output Redirections}, ! for more information on this. This example also illustrates the use of a variable to represent a @var{file} or @var{command}---it is not necessary to always --- 6466,6479 ---- @end example The message is built using string concatenation and saved in the variable ! @code{m}. It's then sent down the pipeline to the @command{mail} program. (The parentheses group the items to concatenate---see @ref{Concatenation, ,String Concatenation}.) The @code{close} function is called here because it's a good idea to close the pipe as soon as all the intended output has been sent to it. @xref{Close Files And Pipes, ,Closing Input and Output Redirections}, ! for more information. This example also illustrates the use of a variable to represent a @var{file} or @var{command}---it is not necessary to always *************** *** 6233,6247 **** because @command{awk} requires that the string value be spelled identically every time. ! @cindex coprocess ! @cindex @code{|&} I/O operator ! @cindex differences between @command{gawk} and @command{awk} @item print @var{items} |& @var{command} This type of redirection prints the items to the input of @var{command}. The difference between this and the single-@samp{|} redirection is that the output from @var{command} can be read with @code{getline}. ! Thus @var{command} is a @dfn{coprocess}, that works together with, but subsidiary to, the @command{awk} program. This feature is a @command{gawk} extension, and is not available in --- 6481,6496 ---- because @command{awk} requires that the string value be spelled identically every time. ! @cindex coprocesses ! @cindex @code{|} (vertical bar), @code{|&} operator (I/O) ! @cindex operators, input/output ! @cindex differences in @command{awk} and @command{gawk}, input/output operators @item print @var{items} |& @var{command} This type of redirection prints the items to the input of @var{command}. The difference between this and the single-@samp{|} redirection is that the output from @var{command} can be read with @code{getline}. ! Thus @var{command} is a @dfn{coprocess}, which works together with, but subsidiary to, the @command{awk} program. This feature is a @command{gawk} extension, and is not available in *************** *** 6251,6263 **** @end table Redirecting output using @samp{>}, @samp{>>}, @samp{|}, or @samp{|&} ! asks the system to open a file, pipe, or coprocess, only if the particular @var{file} or @var{command} you specify has not already been written to by your program or if it has been closed since it was last written to. ! @cindex common mistakes ! @cindex mistakes, common ! @cindex errors, common It is a common error to use @samp{>} redirection for the first @code{print} to a file, and then to use @samp{>>} for subsequent output: --- 6500,6510 ---- @end table Redirecting output using @samp{>}, @samp{>>}, @samp{|}, or @samp{|&} ! asks the system to open a file, pipe, or coprocess only if the particular @var{file} or @var{command} you specify has not already been written to by your program or if it has been closed since it was last written to. ! @cindex troubleshooting, printing It is a common error to use @samp{>} redirection for the first @code{print} to a file, and then to use @samp{>>} for subsequent output: *************** *** 6275,6283 **** use @samp{>} for all the @code{print} statements, since the output file is only opened once. ! @cindex differences between @command{gawk} and @command{awk} ! @cindex limitations ! @cindex implementation limits @ifnotinfo As mentioned earlier (@pxref{Getline Notes, ,Points About @code{getline} to Remember}), --- 6522,6532 ---- use @samp{>} for all the @code{print} statements, since the output file is only opened once. ! @cindex differences in @command{awk} and @command{gawk}, implementation limitations ! @c the comma here does NOT start a secondary ! @cindex implementation issues, @command{gawk}, limits ! @cindex @command{awk}, implementation issues, pipes ! @cindex @command{gawk}, implementation issues, pipes @ifnotinfo As mentioned earlier (@pxref{Getline Notes, ,Points About @code{getline} to Remember}), *************** *** 6293,6309 **** @c fakenode --- for prepinfo @subheading Advanced Notes: Piping into @command{sh} ! @cindex advanced notes ! @cindex shell, piping commands into ! @cindex piping commands into the shell ! A particularly powerful way to use redirection is to build command lines, and pipe them into the shell, @command{sh}. For example, suppose you have a list of files brought over from a system where all the @value{FN}s are stored in uppercase, and you wish to rename them to have names in all lowercase. The following program is both simple and efficient: ! @cindex @command{mv} utility @example @{ printf("mv %s %s\n", $0, tolower($0)) | "sh" @} --- 6542,6557 ---- @c fakenode --- for prepinfo @subheading Advanced Notes: Piping into @command{sh} ! @cindex advanced features, piping into @command{sh} ! @cindex shells, piping commands into ! A particularly powerful way to use redirection is to build command lines and pipe them into the shell, @command{sh}. For example, suppose you have a list of files brought over from a system where all the @value{FN}s are stored in uppercase, and you wish to rename them to have names in all lowercase. The following program is both simple and efficient: ! @c @cindex @command{mv} utility @example @{ printf("mv %s %s\n", $0, tolower($0)) | "sh" @} *************** *** 6316,6324 **** --- 6564,6576 ---- The program builds up a list of command lines, using the @command{mv} utility to rename the files. It then sends the list to the shell for execution. + @c ENDOFRANGE outre + @c ENDOFRANGE reout @node Special Files, Close Files And Pipes, Redirection, Printing @section Special @value{FFN}s in @command{gawk} + @c STARTOFRANGE gfn + @cindex @command{gawk}, @value{FN}s in @command{gawk} provides a number of special @value{FN}s that it interprets internally. These @value{FN}s provide access to standard file descriptors, *************** *** 6334,6342 **** @node Special FD, Special Process, Special Files, Special Files @subsection Special Files for Standard Descriptors @cindex standard input @cindex standard output ! @cindex standard error output @cindex file descriptors Running programs conventionally have three input and output streams already available to them for reading and writing. These are known as --- 6586,6597 ---- @node Special FD, Special Process, Special Files, Special Files @subsection Special Files for Standard Descriptors @cindex standard input + @cindex input, standard @cindex standard output ! @cindex output, standard ! @cindex error output @cindex file descriptors + @cindex files, descriptors, See file descriptors Running programs conventionally have three input and output streams already available to them for reading and writing. These are known as *************** *** 6345,6354 **** they are often redirected with the shell, via the @samp{<}, @samp{<<}, @samp{>}, @samp{>>}, @samp{>&}, and @samp{|} operators. Standard error is typically used for writing error messages; the reason there are two separate ! streams, standard output, and standard error, is so that they can be redirected separately. ! @cindex differences between @command{gawk} and @command{awk} In other implementations of @command{awk}, the only way to write an error message to standard error in an @command{awk} program is as follows: --- 6600,6610 ---- they are often redirected with the shell, via the @samp{<}, @samp{<<}, @samp{>}, @samp{>>}, @samp{>&}, and @samp{|} operators. Standard error is typically used for writing error messages; the reason there are two separate ! streams, standard output and standard error, is so that they can be redirected separately. ! @cindex differences in @command{awk} and @command{gawk}, error messages ! @cindex error handling In other implementations of @command{awk}, the only way to write an error message to standard error in an @command{awk} program is as follows: *************** *** 6379,6391 **** streams, as well as any other inherited open files. If the @value{FN} matches one of these special names when @command{gawk} redirects input or output, then it directly uses the stream that the @value{FN} stands for. ! (These special @value{FN}s work for all operating systems that @command{gawk} ! has been ported to, not just those that are POSIX-compliant.): ! @cindex @file{/dev/stdin} special file ! @cindex @file{/dev/stdout} special file ! @cindex @file{/dev/stderr} special file ! @cindex @file{/dev/fd} special files @table @file @item /dev/stdin The standard input (file descriptor 0). --- 6635,6650 ---- streams, as well as any other inherited open files. If the @value{FN} matches one of these special names when @command{gawk} redirects input or output, then it directly uses the stream that the @value{FN} stands for. ! These special @value{FN}s work for all operating systems that @command{gawk} ! has been ported to, not just those that are POSIX-compliant: ! @cindex @value{FN}s, standard streams in @command{gawk} ! @cindex @code{/dev/@dots{}} special files (@command{gawk}) ! @cindex files, @code{/dev/@dots{}} special files ! @c @cindex @code{/dev/stdin} special file ! @c @cindex @code{/dev/stdout} special file ! @c @cindex @code{/dev/stderr} special file ! @c @cindex @code{/dev/fd} special files @table @file @item /dev/stdin The standard input (file descriptor 0). *************** *** 6413,6421 **** print "Serious error detected!" > "/dev/stderr" @end example ! @cindex common mistakes ! @cindex mistakes, common ! @cindex errors, common Note the use of quotes around the @value{FN}. Like any other redirection, the value must be a string. It is a common error to omit the quotes, which leads --- 6672,6678 ---- print "Serious error detected!" > "/dev/stderr" @end example ! @cindex troubleshooting, quotes with @value{FN}s Note the use of quotes around the @value{FN}. Like any other redirection, the value must be a string. It is a common error to omit the quotes, which leads *************** *** 6425,6430 **** --- 6682,6689 ---- @node Special Process, Special Network, Special FD, Special Files @subsection Special Files for Process-Related Information + @cindex files, for process information + @cindex process information, files for @command{gawk} also provides special @value{FN}s that give access to information about the running @command{gawk} process. Each of these ``files'' provides a single record of information. To read them more than once, they must *************** *** 6432,6442 **** (@pxref{Close Files And Pipes, ,Closing Input and Output Redirections}). The @value{FN}s are: ! @cindex process information ! @cindex @file{/dev/pid} special file ! @cindex @file{/dev/pgrpid} special file ! @cindex @file{/dev/ppid} special file ! @cindex @file{/dev/user} special file @table @file @item /dev/pid Reading this file returns the process ID of the current process, --- 6691,6700 ---- (@pxref{Close Files And Pipes, ,Closing Input and Output Redirections}). The @value{FN}s are: ! @c @cindex @code{/dev/pid} special file ! @c @cindex @code{/dev/pgrpid} special file ! @c @cindex @code{/dev/ppid} special file ! @c @cindex @code{/dev/user} special file @table @file @item /dev/pid Reading this file returns the process ID of the current process, *************** *** 6482,6489 **** as well as for I/O redirections within an @command{awk} program. They may not be used as source files with the @option{-f} option. ! @cindex automatic warnings ! @cindex warnings, automatic @strong{Note:} The special files that provide process-related information are now considered obsolete and will disappear entirely --- 6740,6747 ---- as well as for I/O redirections within an @command{awk} program. They may not be used as source files with the @option{-f} option. ! @c @cindex automatic warnings ! @c @cindex warnings, automatic @strong{Note:} The special files that provide process-related information are now considered obsolete and will disappear entirely *************** *** 6495,6504 **** @node Special Network, Special Caveats, Special Process, Special Files @subsection Special Files for Network Communications Starting with @value{PVERSION} 3.1 of @command{gawk}, @command{awk} programs can open a two-way ! TCP/IP connection, acting as either a client or server. This is done using a special @value{FN} of the form: @example --- 6753,6764 ---- @node Special Network, Special Caveats, Special Process, Special Files @subsection Special Files for Network Communications + @cindex networks, support for + @cindex TCP/IP, support for Starting with @value{PVERSION} 3.1 of @command{gawk}, @command{awk} programs can open a two-way ! TCP/IP connection, acting as either a client or a server. This is done using a special @value{FN} of the form: @example *************** *** 6519,6533 **** @subsection Special @value{FFN} Caveats Here is a list of things to bear in mind when using the ! special @value{FN}s that @command{gawk} provides. @itemize @bullet @item Recognition of these special @value{FN}s is disabled if @command{gawk} is in compatibility mode (@pxref{Options, ,Command-Line Options}). ! @cindex automatic warnings ! @cindex warnings, automatic @item @ifnottex The --- 6779,6796 ---- @subsection Special @value{FFN} Caveats Here is a list of things to bear in mind when using the ! special @value{FN}s that @command{gawk} provides: @itemize @bullet + @cindex compatibility mode (@command{gawk}), @value{FN}s + @cindex @value{FN}s, in compatibility mode @item Recognition of these special @value{FN}s is disabled if @command{gawk} is in compatibility mode (@pxref{Options, ,Command-Line Options}). ! @c @cindex automatic warnings ! @c @cindex warnings, automatic ! @cindex @code{PROCINFO} array @item @ifnottex The *************** *** 6548,6556 **** @item Starting with @value{PVERSION} 3.1, @command{gawk} @emph{always} interprets these special @value{FN}s.@footnote{Older versions of ! @command{gawk} would only interpret these names internally if the system ! did not actually have a a @file{/dev/fd} directory or any of the other ! above listed special files. Usually this didn't make a difference, but sometimes it did; thus, it was decided to make @command{gawk}'s behavior consistent on all systems and to have it always interpret the special @value{FN}s itself.} --- 6811,6819 ---- @item Starting with @value{PVERSION} 3.1, @command{gawk} @emph{always} interprets these special @value{FN}s.@footnote{Older versions of ! @command{gawk} would interpret these names internally only if the system ! did not actually have a @file{/dev/fd} directory or any of the other ! special files listed earlier. Usually this didn't make a difference, but sometimes it did; thus, it was decided to make @command{gawk}'s behavior consistent on all systems and to have it always interpret the special @value{FN}s itself.} *************** *** 6561,6574 **** close any of the files related to file descriptors 0, 1, and 2. Doing so results in unpredictable behavior. @end itemize @node Close Files And Pipes, , Special Files, Printing @section Closing Input and Output Redirections ! @cindex closing input files and pipes ! @cindex closing output files and pipes ! @cindex closing coprocesses ! @cindex coprocess ! @cindex @code{close} built-in function If the same @value{FN} or the same shell command is used with @code{getline} more than once during the execution of an @command{awk} program --- 6824,6845 ---- close any of the files related to file descriptors 0, 1, and 2. Doing so results in unpredictable behavior. @end itemize + @c ENDOFRANGE gfn @node Close Files And Pipes, , Special Files, Printing @section Closing Input and Output Redirections ! @cindex files, output, See output files ! @c STARTOFRANGE ifc ! @cindex input files, closing ! @c comma before closing is NOT start of tertiary ! @c STARTOFRANGE ofc ! @cindex output, files, closing ! @c STARTOFRANGE pc ! @cindex pipes, closing ! @c STARTOFRANGE cc ! @cindex coprocesses, closing ! @c comma before using is NOT start of tertiary ! @cindex @code{getline} command, coprocesses, using from If the same @value{FN} or the same shell command is used with @code{getline} more than once during the execution of an @command{awk} program *************** *** 6583,6588 **** --- 6854,6860 ---- writes to the same file or command are appended to the previous writes. The file or pipe stays open until @command{awk} exits. + @cindex @code{close} function This implies that special steps are necessary in order to read the same file again from the beginning, or to rerun a shell command (rather than reading more output from the same command). The @code{close} function *************** *** 6665,6672 **** a separate message. @end itemize ! @cindex differences between @command{gawk} and @command{awk} ! @cindex portability issues If you use more files than the system allows you to have open, @command{gawk} attempts to multiplex the available open files among your @value{DF}s. @command{gawk}'s ability to do this depends upon the --- 6937,6944 ---- a separate message. @end itemize ! @cindex differences in @command{awk} and @command{gawk}, @code{close} function ! @cindex portability, @code{close} function and If you use more files than the system allows you to have open, @command{gawk} attempts to multiplex the available open files among your @value{DF}s. @command{gawk}'s ability to do this depends upon the *************** *** 6706,6711 **** --- 6978,6985 ---- does not represent a file, pipe or coprocess that was opened with a redirection. + @c comma is part of tertiary + @cindex @code{|} (vertical bar), @code{|&} operator (I/O), pipes, closing When using the @samp{|&} operator to communicate with a coprocess, it is occasionally useful to be able to close one end of the two-way pipe without closing the other. *************** *** 6722,6732 **** @c fakenode --- for prepinfo @subheading Advanced Notes: Using @code{close}'s Return Value ! @cindex advanced notes ! @cindex dark corner ! @cindex differences between @command{gawk} and @command{awk} ! @cindex @code{close}, return value ! @cindex return value from @code{close} In many versions of Unix @command{awk}, the @code{close} function is actually a statement. It is a syntax error to try and use the return --- 6996,7008 ---- @c fakenode --- for prepinfo @subheading Advanced Notes: Using @code{close}'s Return Value ! @cindex advanced features, @code{close} function ! @cindex dark corner, @code{close} function ! @cindex @code{close} function, return values ! @c comma does NOT start secondary ! @cindex return values, @code{close} function ! @cindex differences in @command{awk} and @command{gawk}, @code{close} function ! @cindex Unix @command{awk}, @code{close} function and In many versions of Unix @command{awk}, the @code{close} function is actually a statement. It is a syntax error to try and use the return *************** *** 6759,6764 **** --- 7035,7043 ---- It allows you to get the output from a command as well as its exit status. + @cindex pipes, closing + @c comma does NOT start tertiary + @cindex POSIX @command{awk}, pipes, closing For POSIX-compliant systems, if the exit status is a number above 128, then the program was terminated by a signal. Subtract 128 to get the signal number: *************** *** 6776,6785 **** from @code{print} or @code{printf}, the return value from @code{close} is that of the library's @code{pclose} function. @node Expressions, Patterns and Actions, Printing, Top @chapter Expressions ! @cindex expression Expressions are the basic building blocks of @command{awk} patterns and actions. An expression evaluates to a value that you can print, test, --- 7055,7070 ---- from @code{print} or @code{printf}, the return value from @code{close} is that of the library's @code{pclose} function. + @c ENDOFRANGE ifc + @c ENDOFRANGE ofc + @c ENDOFRANGE pc + @c ENDOFRANGE cc + @c ENDOFRANGE prnt @node Expressions, Patterns and Actions, Printing, Top @chapter Expressions ! @c STARTOFRANGE exps ! @cindex expressions Expressions are the basic building blocks of @command{awk} patterns and actions. An expression evaluates to a value that you can print, test, *************** *** 6832,6846 **** @menu * Scalar Constants:: Numeric and string constants. ! * Non-decimal-numbers:: What are octal and hex numbers. * Regexp Constants:: Regular Expression constants. @end menu ! @node Scalar Constants, Non-decimal-numbers, Constants, Constants @subsection Numeric and String Constants ! @cindex numeric constant ! @cindex numeric value A @dfn{numeric constant} stands for a number. This number can be an integer, a decimal fraction, or a number in scientific (exponential) notation.@footnote{The internal representation of all numbers, --- 7117,7130 ---- @menu * Scalar Constants:: Numeric and string constants. ! * Nondecimal-numbers:: What are octal and hex numbers. * Regexp Constants:: Regular Expression constants. @end menu ! @node Scalar Constants, Nondecimal-numbers, Constants, Constants @subsection Numeric and String Constants ! @cindex numeric, constants A @dfn{numeric constant} stands for a number. This number can be an integer, a decimal fraction, or a number in scientific (exponential) notation.@footnote{The internal representation of all numbers, *************** *** 6858,6878 **** @cindex string constants A string constant consists of a sequence of characters enclosed in ! double quote marks. For example: @example "parrot" @end example @noindent ! @cindex differences between @command{gawk} and @command{awk} represents the string whose contents are @samp{parrot}. Strings in @command{gawk} can be of any length, and they can contain any of the possible eight-bit ASCII characters including ASCII @sc{nul} (character code zero). Other @command{awk} implementations may have difficulty with some character codes. ! @node Non-decimal-numbers, Regexp Constants, Scalar Constants, Constants @subsection Octal and Hexadecimal Numbers @cindex octal numbers @cindex hexadecimal numbers --- 7142,7163 ---- @cindex string constants A string constant consists of a sequence of characters enclosed in ! double-quotation marks. For example: @example "parrot" @end example @noindent ! @cindex differences in @command{awk} and @command{gawk}, strings ! @cindex strings, length of represents the string whose contents are @samp{parrot}. Strings in @command{gawk} can be of any length, and they can contain any of the possible eight-bit ASCII characters including ASCII @sc{nul} (character code zero). Other @command{awk} implementations may have difficulty with some character codes. ! @node Nondecimal-numbers, Regexp Constants, Scalar Constants, Constants @subsection Octal and Hexadecimal Numbers @cindex octal numbers @cindex hexadecimal numbers *************** *** 6882,6897 **** In @command{awk}, all numbers are in decimal; i.e., base 10. Many other programming languages allow you to specify numbers in other bases, often octal (base 8) and hexadecimal (base 16). ! In octal, the numbers go 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, etc.. ! Just as @samp{11} in decimal is 1 times 10 plus 1, so ! @samp{11} in octal is 1 times 8, plus 1. This equals nine in decimal. In hexadecimal, there are 16 digits. Since the everyday decimal ! number system only has ten digits (@samp{0}---@samp{9}), the letters @samp{a} through @samp{f} are used to represent the rest. (Case in the letters is usually irrelevant; hexadecimal @samp{a} and @samp{A} have the same value.) ! Thus, @samp{11} in ! hexadecimal is 1 times 16 plus 1, which equals 17 in decimal. Just by looking at plain @samp{11}, you can't tell what base it's in. So, in C, C++, and other languages derived from C, --- 7167,7182 ---- In @command{awk}, all numbers are in decimal; i.e., base 10. Many other programming languages allow you to specify numbers in other bases, often octal (base 8) and hexadecimal (base 16). ! In octal, the numbers go 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, etc. ! Just as @samp{11}, in decimal, is 1 times 10 plus 1, so ! @samp{11}, in octal, is 1 times 8, plus 1. This equals 9 in decimal. In hexadecimal, there are 16 digits. Since the everyday decimal ! number system only has ten digits (@samp{0}--@samp{9}), the letters @samp{a} through @samp{f} are used to represent the rest. (Case in the letters is usually irrelevant; hexadecimal @samp{a} and @samp{A} have the same value.) ! Thus, @samp{11}, in ! hexadecimal, is 1 times 16 plus 1, which equals 17 in decimal. Just by looking at plain @samp{11}, you can't tell what base it's in. So, in C, C++, and other languages derived from C, *************** *** 6902,6908 **** @table @code @item 11 ! Decimal 11. @item 011 Octal 11, decimal value 9. --- 7187,7193 ---- @table @code @item 11 ! Decimal value 11. @item 011 Octal 11, decimal value 9. *************** *** 6922,6934 **** useful when working with data that cannot be represented conveniently as characters or as regular numbers, such as binary data of various sorts. @command{gawk} allows the use of octal and hexadecimal constants in your program text. However, such numbers in the input data are not treated differently; doing so by default would break old programs. (If you really need to do this, use the @option{--non-decimal-data} ! command-line option, ! @pxref{Non-decimal Data, ,Allowing Non-Decimal Input Data}.) If you have octal or hexadecimal data, you can use the @code{strtonum} function (@pxref{String Functions, ,String Manipulation Functions}) --- 7207,7221 ---- useful when working with data that cannot be represented conveniently as characters or as regular numbers, such as binary data of various sorts. + @cindex @command{gawk}, octal numbers and + @cindex @command{gawk}, hexadecimal numbers and @command{gawk} allows the use of octal and hexadecimal constants in your program text. However, such numbers in the input data are not treated differently; doing so by default would break old programs. (If you really need to do this, use the @option{--non-decimal-data} ! command-line option; ! @pxref{Nondecimal Data, ,Allowing Nondecimal Input Data}.) If you have octal or hexadecimal data, you can use the @code{strtonum} function (@pxref{String Functions, ,String Manipulation Functions}) *************** *** 6939,6945 **** for more information. Unlike some early C implementations, @samp{8} and @samp{9} are not valid ! in octal constants; e.g., @command{gawk} treats @samp{018} as decimal 18. @example $ gawk 'BEGIN @{ print "021 is", 021 ; print 018 @}' --- 7226,7232 ---- for more information. Unlike some early C implementations, @samp{8} and @samp{9} are not valid ! in octal constants; e.g., @command{gawk} treats @samp{018} as decimal 18: @example $ gawk 'BEGIN @{ print "021 is", 021 ; print 018 @}' *************** *** 6947,6952 **** --- 7234,7241 ---- @print{} 18 @end example + @cindex compatibility mode (@command{gawk}), octal numbers + @cindex compatibility mode (@command{gawk}), hexadecimal numbers Octal and hexadecimal source code constants are a @command{gawk} extension. If @command{gawk} is in compatibility mode (@pxref{Options, ,Command-Line Options}), *************** *** 6954,6960 **** @c fakenode --- for prepinfo @subheading Advanced Notes: A Constant's Base Does Not Affect Its Value ! @cindex advanced notes Once a numeric constant has been converted internally into a number, --- 7243,7250 ---- @c fakenode --- for prepinfo @subheading Advanced Notes: A Constant's Base Does Not Affect Its Value ! @c comma before values does NOT start tertiary ! @cindex advanced features, constants, values of Once a numeric constant has been converted internally into a number, *************** *** 6968,6995 **** @print{} 0x11 is <17> @end example ! @node Regexp Constants, , Non-decimal-numbers, Constants @subsection Regular Expression Constants ! @cindex @code{~} operator ! @cindex @code{!~} operator A regexp constant is a regular expression description enclosed in slashes, such as @code{@w{/^beginning and end$/}}. Most regexps used in @command{awk} programs are constant, but the @samp{~} and @samp{!~} matching operators can also match computed or ``dynamic'' regexps (which are just ordinary strings or variables that contain a regexp). @node Using Constant Regexps, Variables, Constants, Expressions @section Using Regular Expression Constants ! @cindex dark corner When used on the righthand side of the @samp{~} or @samp{!~} operators, a regexp constant merely stands for the regexp that is to be matched. However, regexp constants (such as @code{/foo/}) may be used like simple expressions. When a regexp constant appears by itself, it has the same meaning as if it appeared ! in a pattern, i.e.; @samp{($0 ~ /foo/)} @value{DARKCORNER} @xref{Expression Patterns, ,Expressions as Patterns}. This means that the following two code segments: --- 7258,7290 ---- @print{} 0x11 is <17> @end example ! @node Regexp Constants, , Nondecimal-numbers, Constants @subsection Regular Expression Constants ! @c STARTOFRANGE rec ! @cindex regexp constants ! @cindex @code{~} (tilde), @code{~} operator ! @cindex tilde (@code{~}), @code{~} operator ! @cindex @code{!} (exclamation point), @code{!~} operator ! @cindex exclamation point (@code{!}), @code{!~} operator A regexp constant is a regular expression description enclosed in slashes, such as @code{@w{/^beginning and end$/}}. Most regexps used in @command{awk} programs are constant, but the @samp{~} and @samp{!~} matching operators can also match computed or ``dynamic'' regexps (which are just ordinary strings or variables that contain a regexp). + @c ENDOFRANGE cnst @node Using Constant Regexps, Variables, Constants, Expressions @section Using Regular Expression Constants ! @cindex dark corner, regexp constants When used on the righthand side of the @samp{~} or @samp{!~} operators, a regexp constant merely stands for the regexp that is to be matched. However, regexp constants (such as @code{/foo/}) may be used like simple expressions. When a regexp constant appears by itself, it has the same meaning as if it appeared ! in a pattern, i.e., @samp{($0 ~ /foo/)} @value{DARKCORNER} @xref{Expression Patterns, ,Expressions as Patterns}. This means that the following two code segments: *************** *** 7018,7025 **** if (/foo/ ~ $1) print "found foo" @end example ! @cindex automatic warnings ! @cindex warnings, automatic @noindent This code is ``obviously'' testing @code{$1} for a match against the regexp @code{/foo/}. But in fact, the expression @samp{/foo/ ~ $1} actually means --- 7313,7322 ---- if (/foo/ ~ $1) print "found foo" @end example ! @c @cindex automatic warnings ! @c @cindex warnings, automatic ! @cindex @command{gawk}, regexp constants and ! @cindex regexp constants, in @command{gawk} @noindent This code is ``obviously'' testing @code{$1} for a match against the regexp @code{/foo/}. But in fact, the expression @samp{/foo/ ~ $1} actually means *************** *** 7042,7049 **** This feature of the language has never been well documented until the POSIX specification. ! @cindex differences between @command{gawk} and @command{awk} ! @cindex dark corner Constant regular expressions are also used as the first argument for the @code{gensub}, @code{sub}, and @code{gsub} functions, and as the second argument of the @code{match} function --- 7339,7349 ---- This feature of the language has never been well documented until the POSIX specification. ! @cindex differences in @command{awk} and @command{gawk}, regexp constants ! @cindex dark corner, regexp constants, as arguments to user-defined functions ! @cindex @code{gensub} function (@command{gawk}) ! @cindex @code{sub} function ! @cindex @code{gsub} function Constant regular expressions are also used as the first argument for the @code{gensub}, @code{sub}, and @code{gsub} functions, and as the second argument of the @code{match} function *************** *** 7053,7059 **** older implementations do not. @value{DARKCORNER} This can lead to confusion when attempting to use regexp constants ! as arguments to user defined functions (@pxref{User-defined, ,User-Defined Functions}). For example: --- 7353,7359 ---- older implementations do not. @value{DARKCORNER} This can lead to confusion when attempting to use regexp constants ! as arguments to user-defined functions (@pxref{User-defined, ,User-Defined Functions}). For example: *************** *** 7075,7082 **** @} @end example ! @cindex automatic warnings ! @cindex warnings, automatic In this example, the programmer wants to pass a regexp constant to the user-defined function @code{mysub}, which in turn passes it on to either @code{sub} or @code{gsub}. However, what really happens is that --- 7375,7382 ---- @} @end example ! @c @cindex automatic warnings ! @c @cindex warnings, automatic In this example, the programmer wants to pass a regexp constant to the user-defined function @code{mysub}, which in turn passes it on to either @code{sub} or @code{gsub}. However, what really happens is that *************** *** 7085,7094 **** --- 7385,7397 ---- @command{gawk} issues a warning when it sees a regexp constant used as a parameter to a user-defined function, since passing a truth value in this way is probably not what was intended. + @c ENDOFRANGE rec @node Variables, Conversion, Using Constant Regexps, Expressions @section Variables + @cindex variables, user-defined + @cindex user-defined, variables Variables are ways of storing values at one point in your program for use later in another part of your program. They can be manipulated entirely within the program text, and they can also be assigned values *************** *** 7104,7111 **** @node Using Variables, Assignment Options, Variables, Variables @subsection Using Variables in a Program - @cindex variables, user-defined - @cindex user-defined variables Variables let you give names to values and refer to them later. Variables have already been used in many of the examples. The name of a variable must be a sequence of letters, digits, or underscores, and it may not begin --- 7407,7412 ---- *************** *** 7119,7124 **** --- 7420,7427 ---- @xref{Assignment Ops, ,Assignment Expressions}. @c NEXT ED: Can also be changed by sub, gsub, split + @cindex variables, built-in + @cindex variables, initializing A few variables have special built-in meanings, such as @code{FS} (the field separator), and @code{NF} (the number of fields in the current input record). @xref{Built-in Variables}, for a list of the built-in variables. *************** *** 7135,7140 **** --- 7438,7446 ---- @node Assignment Options, , Using Variables, Variables @subsection Assigning Variables on the Command Line + @cindex variables, assigning on command line + @c comma before assigning does NOT start tertiary + @cindex command line, variables, assigning on Any @command{awk} variable can be set by including a @dfn{variable assignment} among the arguments on the command line when @command{awk} is invoked *************** *** 7145,7150 **** --- 7451,7458 ---- @var{variable}=@var{text} @end example + @c comma before assigning does NOT start tertiary + @cindex @code{-v} option, variables, assigning @noindent With it, a variable is set either at the beginning of the @command{awk} run or in between input files. *************** *** 7187,7205 **** @dots{} @end example ! @cindex dark corner Command-line arguments are made available for explicit examination by ! the @command{awk} program in an array named @code{ARGV} (@pxref{ARGC and ARGV, ,Using @code{ARGC} and @code{ARGV}}). @command{awk} processes the values of command-line assignments for escape sequences - @value{DARKCORNER} (@pxref{Escape Sequences}). @node Conversion, Arithmetic Ops, Variables, Expressions @section Conversion of Strings and Numbers ! @cindex conversion of strings and numbers Strings are converted to numbers and numbers are converted to strings, if the context of the @command{awk} program demands it. For example, if the value of either @code{foo} or @code{bar} in the expression @samp{foo + bar} --- 7495,7516 ---- @dots{} @end example ! @cindex dark corner, command-line arguments Command-line arguments are made available for explicit examination by ! the @command{awk} program in the @code{ARGV} array (@pxref{ARGC and ARGV, ,Using @code{ARGC} and @code{ARGV}}). @command{awk} processes the values of command-line assignments for escape sequences (@pxref{Escape Sequences}). + @value{DARKCORNER} @node Conversion, Arithmetic Ops, Variables, Expressions @section Conversion of Strings and Numbers ! @cindex converting, strings to numbers ! @cindex strings, converting ! @cindex numbers, converting ! @cindex converting, numbers Strings are converted to numbers and numbers are converted to strings, if the context of the @command{awk} program demands it. For example, if the value of either @code{foo} or @code{bar} in the expression @samp{foo + bar} *************** *** 7216,7225 **** This prints the (numeric) value 27. The numeric values of the variables @code{two} and @code{three} are converted to strings and concatenated together. The resulting string is converted back to the ! number 23, to which four is then added. ! @cindex null string ! @cindex empty string @cindex type conversion If, for some reason, you need to force a number to be converted to a string, concatenate the empty string, @code{""}, with that number. --- 7527,7535 ---- This prints the (numeric) value 27. The numeric values of the variables @code{two} and @code{three} are converted to strings and concatenated together. The resulting string is converted back to the ! number 23, to which 4 is then added. ! @cindex null strings, converting numbers to strings @cindex type conversion If, for some reason, you need to force a number to be converted to a string, concatenate the empty string, @code{""}, with that number. *************** *** 7247,7253 **** most of the time.@footnote{Pathological cases can require up to 752 digits (!), but we doubt that you need to worry about this.} ! @cindex dark corner Strange results can occur if you set @code{CONVFMT} to a string that doesn't tell @code{sprintf} how to format floating-point numbers in a useful way. For example, if you forget the @samp{%} in the format, @command{awk} converts --- 7557,7563 ---- most of the time.@footnote{Pathological cases can require up to 752 digits (!), but we doubt that you need to worry about this.} ! @cindex dark corner, @code{CONVFMT} variable Strange results can occur if you set @code{CONVFMT} to a string that doesn't tell @code{sprintf} how to format floating-point numbers in a useful way. For example, if you forget the @samp{%} in the format, @command{awk} converts *************** *** 7266,7274 **** @code{b} has the value @code{"12"}, not @code{"12.00"}. @value{DARKCORNER} ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} @cindex @code{OFMT} variable Prior to the POSIX standard, @command{awk} used the value of @code{OFMT} for converting numbers to strings. @code{OFMT} specifies the output format to use when printing numbers with @code{print}. --- 7576,7585 ---- @code{b} has the value @code{"12"}, not @code{"12.00"}. @value{DARKCORNER} ! @cindex POSIX @command{awk}, @code{OFMT} variable and @cindex @code{OFMT} variable + @cindex portability, new @command{awk} vs. old @command{awk} + @cindex @command{awk}, new vs. old, @code{OFMT} variable Prior to the POSIX standard, @command{awk} used the value of @code{OFMT} for converting numbers to strings. @code{OFMT} specifies the output format to use when printing numbers with @code{print}. *************** *** 7287,7299 **** @section Arithmetic Operators @cindex arithmetic operators @cindex operators, arithmetic ! @cindex addition ! @cindex subtraction ! @cindex multiplication ! @cindex division ! @cindex remainder ! @cindex quotient ! @cindex exponentiation The @command{awk} language uses the common arithmetic operators when evaluating expressions. All of these arithmetic operators follow normal --- 7598,7610 ---- @section Arithmetic Operators @cindex arithmetic operators @cindex operators, arithmetic ! @c @cindex addition ! @c @cindex subtraction ! @c @cindex multiplication ! @c @cindex division ! @c @cindex remainder ! @c @cindex quotient ! @c @cindex exponentiation The @command{awk} language uses the common arithmetic operators when evaluating expressions. All of these arithmetic operators follow normal *************** *** 7331,7338 **** @item + @var{x} Unary plus; the expression is converted to a number. ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} @item @var{x} ^ @var{y} @itemx @var{x} ** @var{y} Exponentiation; @var{x} raised to the @var{y} power. @samp{2 ^ 3} has --- 7642,7648 ---- @item + @var{x} Unary plus; the expression is converted to a number. ! @cindex POSIX @command{awk}, arithmetic operators and @item @var{x} ^ @var{y} @itemx @var{x} ** @var{y} Exponentiation; @var{x} raised to the @var{y} power. @samp{2 ^ 3} has *************** *** 7342,7350 **** @item @var{x} * @var{y} Multiplication. ! @cindex common mistakes ! @cindex mistakes, common ! @cindex errors, common @item @var{x} / @var{y} Division; because all numbers in @command{awk} are floating-point numbers, the result is @emph{not} rounded to an integer---@samp{3 / 4} has --- 7652,7659 ---- @item @var{x} * @var{y} Multiplication. ! @cindex troubleshooting, division ! @cindex division @item @var{x} / @var{y} Division; because all numbers in @command{awk} are floating-point numbers, the result is @emph{not} rounded to an integer---@samp{3 / 4} has *************** *** 7368,7374 **** the multiplication operators all have the same precedence, and addition and subtraction have the same precedence. ! @cindex differences between @command{gawk} and @command{awk} When computing the remainder of @code{@var{x} % @var{y}}, the quotient is rounded toward zero to an integer and multiplied by @var{y}. This result is subtracted from @var{x}; --- 7677,7684 ---- the multiplication operators all have the same precedence, and addition and subtraction have the same precedence. ! @cindex differences in @command{awk} and @command{gawk}, trunc-mod operation ! @cindex trunc-mod operation When computing the remainder of @code{@var{x} % @var{y}}, the quotient is rounded toward zero to an integer and multiplied by @var{y}. This result is subtracted from @var{x}; *************** *** 7387,7396 **** @end example In other @command{awk} implementations, the signedness of the remainder ! may be machine dependent. @c !!! what does posix say? ! @cindex portability issues @strong{Note:} The POSIX standard only specifies the use of @samp{^} for exponentiation. --- 7697,7708 ---- @end example In other @command{awk} implementations, the signedness of the remainder ! may be machine-dependent. @c !!! what does posix say? ! @cindex portability, @code{**} operator and ! @cindex @code{*} (asterisk), @code{**} operator ! @cindex asterisk (@code{*}), @code{**} operator @strong{Note:} The POSIX standard only specifies the use of @samp{^} for exponentiation. *************** *** 7406,7412 **** @cindex string operators @cindex operators, string ! @cindex concatenation There is only one string operation: concatenation. It does not have a specific operator to represent it. Instead, concatenation is performed by writing expressions next to one another, with no operator. For example: --- 7718,7724 ---- @cindex string operators @cindex operators, string ! @cindex concatenating There is only one string operation: concatenation. It does not have a specific operator to represent it. Instead, concatenation is performed by writing expressions next to one another, with no operator. For example: *************** *** 7428,7436 **** @dots{} @end example ! @cindex common mistakes ! @cindex mistakes, common ! @cindex errors, common Because string concatenation does not have an explicit operator, it is often necessary to insure that it happens at the right time by using parentheses to enclose the items to concatenate. For example, the --- 7740,7746 ---- @dots{} @end example ! @cindex troubleshooting, string concatenation Because string concatenation does not have an explicit operator, it is often necessary to insure that it happens at the right time by using parentheses to enclose the items to concatenate. For example, the *************** *** 7451,7458 **** @end example @cindex order of evaluation, concatenation ! @cindex concatenation evaluation order ! @cindex evaluation, order of @cindex side effects Parentheses should be used around concatenation in all but the most common contexts, such as on the righthand side of @samp{=}. --- 7761,7767 ---- @end example @cindex order of evaluation, concatenation ! @cindex evaluation order, concatenation @cindex side effects Parentheses should be used around concatenation in all but the most common contexts, such as on the righthand side of @samp{=}. *************** *** 7531,7541 **** @node Assignment Ops, Increment Ops, Concatenation, Expressions @section Assignment Expressions @cindex assignment operators @cindex operators, assignment ! @cindex expression, assignment ! ! @cindex @code{=} operator An @dfn{assignment} is an expression that stores a (usually different) value into a variable. For example, let's assign the value one to the variable @code{z}: --- 7840,7853 ---- @node Assignment Ops, Increment Ops, Concatenation, Expressions @section Assignment Expressions + @c STARTOFRANGE asop @cindex assignment operators + @c STARTOFRANGE opas @cindex operators, assignment ! @c STARTOFRANGE exas ! @cindex expressions, assignment ! @cindex @code{=} (equals sign), @code{=} operator ! @cindex equals sign (@code{=}), @code{=} operator An @dfn{assignment} is an expression that stores a (usually different) value into a variable. For example, let's assign the value one to the variable @code{z}: *************** *** 7558,7564 **** @end example @noindent ! @cindex side effects This also illustrates string concatenation. The @samp{=} sign is called an @dfn{assignment operator}. It is the simplest assignment operator because the value of the righthand --- 7870,7876 ---- @end example @noindent ! @cindex side effects, assignment expressions This also illustrates string concatenation. The @samp{=} sign is called an @dfn{assignment operator}. It is the simplest assignment operator because the value of the righthand *************** *** 7570,7577 **** makes itself felt through the alteration of the variable. We call this a @dfn{side effect}. ! @cindex lvalue ! @cindex rvalue The lefthand operand of an assignment need not be a variable (@pxref{Variables}); it can also be a field (@pxref{Changing Fields, ,Changing the Contents of a Field}) or --- 7882,7891 ---- makes itself felt through the alteration of the variable. We call this a @dfn{side effect}. ! @cindex lvalues/rvalues ! @cindex rvalues/lvalues ! @cindex assignment operators, lvalues/rvalues ! @cindex operators, assignment The lefthand operand of an assignment need not be a variable (@pxref{Variables}); it can also be a field (@pxref{Changing Fields, ,Changing the Contents of a Field}) or *************** *** 7580,7588 **** which means they can appear on the lefthand side of an assignment operator. The righthand operand may be any expression; it produces the new value that the assignment stores in the specified variable, field, or array ! element. (Such values are called @dfn{rvalues}). ! @cindex types of variables It is important to note that variables do @emph{not} have permanent types. A variable's type is simply the type of whatever value it happens to hold at the moment. In the following program fragment, the variable --- 7894,7902 ---- which means they can appear on the lefthand side of an assignment operator. The righthand operand may be any expression; it produces the new value that the assignment stores in the specified variable, field, or array ! element. (Such values are called @dfn{rvalues}.) ! @cindex variables, types of It is important to note that variables do @emph{not} have permanent types. A variable's type is simply the type of whatever value it happens to hold at the moment. In the following program fragment, the variable *************** *** 7611,7617 **** @strong{Note:} Using a variable as a number and then later as a string can be confusing and is poor programming style. The previous two examples illustrate how @command{awk} works, @emph{not} how you should write your ! own programs! An assignment is an expression, so it has a value---the same value that is assigned. Thus, @samp{z = 1} is an expression with the value one. --- 7925,7931 ---- @strong{Note:} Using a variable as a number and then later as a string can be confusing and is poor programming style. The previous two examples illustrate how @command{awk} works, @emph{not} how you should write your ! programs! An assignment is an expression, so it has a value---the same value that is assigned. Thus, @samp{z = 1} is an expression with the value one. *************** *** 7635,7640 **** --- 7949,7956 ---- programs hard to read; such nesting of assignments should be avoided, except perhaps in a one-shot program. + @cindex @code{+} (plus sign), @code{+=} operator + @cindex plus sign (@code{+}), @code{+=} operator Aside from @samp{=}, there are several other assignment operators that do arithmetic with the old value of the variable. For example, the operator @samp{+=} computes a new value by adding the righthand value *************** *** 7673,7678 **** --- 7989,7996 ---- @} @end example + @cindex operators, assignment, evaluation order + @cindex assignment operators, evaluation order @noindent The indices of @code{bar} are practically guaranteed to be different, because @code{rand} returns different values each time it is called. *************** *** 7723,7735 **** @end table @end ignore ! @cindex @code{+=} operator ! @cindex @code{-=} operator ! @cindex @code{*=} operator ! @cindex @code{/=} operator ! @cindex @code{%=} operator ! @cindex @code{^=} operator ! @cindex @code{**=} operator @multitable {@var{lvalue} *= @var{coefficient}} {Subtracts @var{decrement} from the value of @var{lvalue}.} @item @var{lvalue} @code{+=} @var{increment} @tab Adds @var{increment} to the value of @var{lvalue}. --- 8041,8058 ---- @end table @end ignore ! @cindex @code{-} (hyphen), @code{-=} operator ! @cindex hyphen (@code{-}), @code{-=} operator ! @cindex @code{*} (asterisk), @code{*=} operator ! @cindex asterisk (@code{*}), @code{*=} operator ! @cindex @code{/} (forward slash), @code{/=} operator ! @cindex forward slash (@code{/}), @code{/=} operator ! @cindex @code{%} (percent sign), @code{%=} operator ! @cindex percent sign (@code{%}), @code{%=} operator ! @cindex @code{^} (caret), @code{^=} operator ! @cindex caret (@code{^}), @code{^=} operator ! @cindex @code{*} (asterisk), @code{**=} operator ! @cindex asterisk (@code{*}), @code{**=} operator @multitable {@var{lvalue} *= @var{coefficient}} {Subtracts @var{decrement} from the value of @var{lvalue}.} @item @var{lvalue} @code{+=} @var{increment} @tab Adds @var{increment} to the value of @var{lvalue}. *************** *** 7747,7760 **** @item @var{lvalue} @code{**=} @var{power} @tab Raises @var{lvalue} to the power @var{power}. @end multitable ! @cindex portability issues @strong{Note:} Only the @samp{^=} operator is specified by POSIX. For maximum portability, do not use the @samp{**=} operator. @c fakenode --- for prepinfo @subheading Advanced Notes: Syntactic Ambiguities Between @samp{/=} and Regular Expressions ! @cindex advanced notes @c derived from email from "Nelson H. F. Beebe" @c Date: Mon, 1 Sep 1997 13:38:35 -0600 (MDT) --- 8070,8088 ---- @item @var{lvalue} @code{**=} @var{power} @tab Raises @var{lvalue} to the power @var{power}. @end multitable ! @cindex POSIX @command{awk}, @code{**=} operator and ! @cindex portability, @code{**=} operator and @strong{Note:} Only the @samp{^=} operator is specified by POSIX. For maximum portability, do not use the @samp{**=} operator. @c fakenode --- for prepinfo @subheading Advanced Notes: Syntactic Ambiguities Between @samp{/=} and Regular Expressions ! @cindex advanced features, regexp constants ! @cindex dark corner, regexp constants, @code{/=} operator and ! @cindex @code{/} (forward slash), @code{/=} operator, vs. @code{/=@dots{}/} regexp constant ! @cindex forward slash (@code{/}), @code{/=} operator, vs. @code{/=@dots{}/} regexp constant ! @cindex regexp constants, @code{/=@dots{}/}, @code{/=} operator and @c derived from email from "Nelson H. F. Beebe" @c Date: Mon, 1 Sep 1997 13:38:35 -0600 (MDT) *************** *** 7786,7805 **** @command{gawk} does not have this problem, nor do the other ! freely-available versions described in @ref{Other Versions, , Other Freely Available @command{awk} Implementations}. @node Increment Ops, Truth Values, Assignment Ops, Expressions @section Increment and Decrement Operators @cindex increment operators ! @cindex operators, increment @dfn{Increment} and @dfn{decrement operators} increase or decrease the value of a variable by one. An assignment operator can do the same thing, so ! the increment operators add no power to the @command{awk} language; however they are convenient abbreviations for very common operations. @cindex side effects The operator used for adding one is written @samp{++}. It can be used to increment a variable either before or after taking its value. To pre-increment a variable @code{v}, write @samp{++v}. This adds --- 8114,8141 ---- @command{gawk} does not have this problem, nor do the other ! freely available versions described in @ref{Other Versions, , Other Freely Available @command{awk} Implementations}. + @c ENDOFRANGE exas + @c ENDOFRANGE opas + @c ENDOFRANGE asop @node Increment Ops, Truth Values, Assignment Ops, Expressions @section Increment and Decrement Operators + @c STARTOFRANGE inop @cindex increment operators ! @c STARTOFRANGE opde ! @cindex operators, decrement/increment @dfn{Increment} and @dfn{decrement operators} increase or decrease the value of a variable by one. An assignment operator can do the same thing, so ! the increment operators add no power to the @command{awk} language; however, they are convenient abbreviations for very common operations. @cindex side effects + @cindex @code{+} (plus sign), decrement/increment operators + @cindex plus sign (@code{+}), decrement/increment operators + @cindex side effects, decrement/increment operators The operator used for adding one is written @samp{++}. It can be used to increment a variable either before or after taking its value. To pre-increment a variable @code{v}, write @samp{++v}. This adds *************** *** 7820,7839 **** not necessarily equal @code{foo}. But the difference is minute as long as you stick to numbers that are fairly small (less than 10e12). Fields and array elements are incremented just like variables. (Use @samp{$(i++)} when you want to do a field reference and a variable increment at the same time. The parentheses are necessary because of the precedence of the field reference operator @samp{$}.) @cindex decrement operators - @cindex operators, decrement The decrement operator @samp{--} works just like @samp{++}, except that it subtracts one instead of adding it. As with @samp{++}, it can be used before the lvalue to pre-decrement or after it to post-decrement. Following is a summary of increment and decrement expressions: @table @code ! @cindex @code{++} operator @item ++@var{lvalue} This expression increments @var{lvalue}, and the new value becomes the value of the expression. --- 8156,8177 ---- not necessarily equal @code{foo}. But the difference is minute as long as you stick to numbers that are fairly small (less than 10e12). + @cindex @code{$} (dollar sign), incrementing fields and arrays + @cindex dollar sign (@code{$}), incrementing fields and arrays Fields and array elements are incremented just like variables. (Use @samp{$(i++)} when you want to do a field reference and a variable increment at the same time. The parentheses are necessary because of the precedence of the field reference operator @samp{$}.) @cindex decrement operators The decrement operator @samp{--} works just like @samp{++}, except that it subtracts one instead of adding it. As with @samp{++}, it can be used before the lvalue to pre-decrement or after it to post-decrement. Following is a summary of increment and decrement expressions: @table @code ! @cindex @code{+} (plus sign), @code{++} operator ! @cindex plus sign (@code{+}), @code{++} operator @item ++@var{lvalue} This expression increments @var{lvalue}, and the new value becomes the value of the expression. *************** *** 7842,7848 **** This expression increments @var{lvalue}, but the value of the expression is the @emph{old} value of @var{lvalue}. ! @cindex @code{--} operator @item --@var{lvalue} This expression is like @samp{++@var{lvalue}}, but instead of adding, it subtracts. It --- 8180,8187 ---- This expression increments @var{lvalue}, but the value of the expression is the @emph{old} value of @var{lvalue}. ! @cindex @code{-} (hyphen), @code{--} operator ! @cindex hyphen (@code{-}), @code{--} operator @item --@var{lvalue} This expression is like @samp{++@var{lvalue}}, but instead of adding, it subtracts. It *************** *** 7857,7867 **** @c fakenode --- for prepinfo @subheading Advanced Notes: Operator Evaluation Order ! @cindex advanced notes @cindex precedence ! @cindex operator precedence ! @cindex portability issues ! @cindex evaluation, order of @cindex Marx, Groucho @quotation @i{Doctor, doctor! It hurts when I do this!@* --- 8196,8207 ---- @c fakenode --- for prepinfo @subheading Advanced Notes: Operator Evaluation Order ! @c comma before precedence does NOT start tertiary ! @cindex advanced features, operators, precedence @cindex precedence ! @cindex operators, precedence ! @cindex portability, operators ! @cindex evaluation order @cindex Marx, Groucho @quotation @i{Doctor, doctor! It hurts when I do this!@* *************** *** 7899,7913 **** You should avoid such things in your own programs. @c You'll sleep better at night and be able to look at yourself @c in the mirror in the morning. @node Truth Values, Typing and Comparison, Increment Ops, Expressions @section True and False in @command{awk} @cindex truth values ! @cindex logical true ! @cindex logical false ! @cindex null string ! @cindex empty string Many programming languages have a special representation for the concepts of ``true'' and ``false.'' Such languages usually use the special constants @code{true} and @code{false}, or perhaps their uppercase --- 8239,8256 ---- You should avoid such things in your own programs. @c You'll sleep better at night and be able to look at yourself @c in the mirror in the morning. + @c ENDOFRANGE inop + @c ENDOFRANGE opde + @c ENDOFRANGE deop @node Truth Values, Typing and Comparison, Increment Ops, Expressions @section True and False in @command{awk} @cindex truth values ! @cindex logical false/true ! @cindex false, logical ! @cindex true, logical ! @cindex null strings Many programming languages have a special representation for the concepts of ``true'' and ``false.'' Such languages usually use the special constants @code{true} and @code{false}, or perhaps their uppercase *************** *** 7915,7921 **** However, @command{awk} is different. It borrows a very simple concept of true and false from C. In @command{awk}, any nonzero numeric value @emph{or} any ! non-empty string value is true. Any other value (zero or the null string @code{""}) is false. The following program prints @samp{A strange truth value} three times: --- 8258,8264 ---- However, @command{awk} is different. It borrows a very simple concept of true and false from C. In @command{awk}, any nonzero numeric value @emph{or} any ! nonempty string value is true. Any other value (zero or the null string @code{""}) is false. The following program prints @samp{A strange truth value} three times: *************** *** 7937,7960 **** @node Typing and Comparison, Boolean Ops, Truth Values, Expressions @section Variable Typing and Comparison Expressions - @cindex comparison expressions - @cindex expression, comparison - @cindex expression, matching - @cindex relational operators - @cindex operators, relational - @cindex regexp operators - @cindex variable typing - @cindex types of variables @quotation @i{The Guide is definitive. Reality is frequently inaccurate.}@* The Hitchhiker's Guide to the Galaxy @end quotation Unlike other programming languages, @command{awk} variables do not have a fixed type. Instead, they can be either a number or a string, depending upon the value that is assigned to them. ! @cindex numeric string The 1992 POSIX standard introduced the concept of a @dfn{numeric string}, which is simply a string that looks like a number---for example, @code{@w{" +2"}}. This concept is used --- 8280,8310 ---- @node Typing and Comparison, Boolean Ops, Truth Values, Expressions @section Variable Typing and Comparison Expressions @quotation @i{The Guide is definitive. Reality is frequently inaccurate.}@* The Hitchhiker's Guide to the Galaxy @end quotation + @c STARTOFRANGE comex + @cindex comparison expressions + @c STARTOFRANGE excom + @cindex expressions, comparison + @cindex expressions, matching, See comparison expressions + @cindex matching, expressions, See comparison expressions + @cindex relational operators, See comparison operators + @c comma is part of See + @cindex operators, relational, See operators, comparison + @c STARTOFRANGE varting + @cindex variable typing + @c STARTOFRANGE vartypc + @cindex variables, types of, comparison expressions and Unlike other programming languages, @command{awk} variables do not have a fixed type. Instead, they can be either a number or a string, depending upon the value that is assigned to them. ! @cindex numeric, strings ! @cindex strings, numeric ! @cindex POSIX @command{awk}, numeric strings and The 1992 POSIX standard introduced the concept of a @dfn{numeric string}, which is simply a string that looks like a number---for example, @code{@w{" +2"}}. This concept is used *************** *** 8082,8097 **** operators}, which are a superset of those in C. Here is a table of them: ! @cindex relational operators ! @cindex operators, relational ! @cindex @code{<} operator ! @cindex @code{<=} operator ! @cindex @code{>} operator ! @cindex @code{>=} operator ! @cindex @code{==} operator ! @cindex @code{!=} operator ! @cindex @code{~} operator ! @cindex @code{!~} operator @cindex @code{in} operator @table @code @item @var{x} < @var{y} --- 8432,8453 ---- operators}, which are a superset of those in C. Here is a table of them: ! @cindex @code{<} (left angle bracket), @code{<} operator ! @cindex left angle bracket (@code{<}), @code{<} operator ! @cindex @code{<} (left angle bracket), @code{<=} operator ! @cindex left angle bracket (@code{<}), @code{<=} operator ! @cindex @code{>} (right angle bracket), @code{>=} operator ! @cindex right angle bracket (@code{>}), @code{>=} operator ! @cindex @code{>} (right angle bracket), @code{>} operator ! @cindex right angle bracket (@code{>}), @code{>} operator ! @cindex @code{=} (equals sign), @code{==} operator ! @cindex equals sign (@code{=}), @code{==} operator ! @cindex @code{!} (exclamation point), @code{!=} operator ! @cindex exclamation point (@code{!}), @code{!=} operator ! @cindex @code{~} (tilde), @code{~} operator ! @cindex tilde (@code{~}), @code{~} operator ! @cindex @code{!} (exclamation point), @code{!~} operator ! @cindex exclamation point (@code{!}), @code{!~} operator @cindex @code{in} operator @table @code @item @var{x} < @var{y} *************** *** 8133,8141 **** strings where one is a prefix of the other, the shorter string is less than the longer one. Thus, @code{"abc"} is less than @code{"abcd"}. ! @cindex common mistakes ! @cindex mistakes, common ! @cindex errors, common It is very easy to accidentally mistype the @samp{==} operator and leave off one of the @samp{=} characters. The result is still valid @command{awk} code, but the program does not do what is intended: --- 8489,8495 ---- strings where one is a prefix of the other, the shorter string is less than the longer one. Thus, @code{"abc"} is less than @code{"abcd"}. ! @cindex troubleshooting, @code{==} operator It is very easy to accidentally mistype the @samp{==} operator and leave off one of the @samp{=} characters. The result is still valid @command{awk} code, but the program does not do what is intended: *************** *** 8153,8158 **** --- 8507,8513 ---- so similar, this kind of error is very difficult to spot when scanning the source code. + @cindex @command{gawk}, comparison operators and The following table of expressions illustrates the kind of comparison @command{gawk} performs, as well as what the result of the comparison is: *************** *** 8185,8193 **** @print{} false @end example ! @cindex comparisons, string vs. regexp ! @cindex string comparison vs. regexp comparison ! @cindex regexp comparison vs. string comparison @noindent the result is @samp{false} because both @code{$1} and @code{$2} are user input. They are numeric strings---therefore both have --- 8540,8548 ---- @print{} false @end example ! @cindex comparison expressions, string vs. regexp ! @c @cindex string comparison vs. regexp comparison ! @c @cindex regexp comparison vs. string comparison @noindent the result is @samp{false} because both @code{$1} and @code{$2} are user input. They are numeric strings---therefore both have *************** *** 8214,8226 **** has the value one if @code{x} contains @samp{foo}, such as @code{"Oh, what a fool am I!"}. The righthand operand of the @samp{~} and @samp{!~} operators may be either a regexp constant (@code{/@dots{}/}) or an ordinary expression. In the latter case, the value of the expression as a string is used as a dynamic regexp (@pxref{Regexp Usage, ,How to Use Regular Expressions}; also @pxref{Computed Regexps, ,Using Dynamic Regexps}). ! @cindex regexp as expression In modern implementations of @command{awk}, a constant regular expression in slashes by itself is also an expression. The regexp @code{/@var{regexp}/} is an abbreviation for the following comparison expression: --- 8569,8586 ---- has the value one if @code{x} contains @samp{foo}, such as @code{"Oh, what a fool am I!"}. + @cindex @code{~} (tilde), @code{~} operator + @cindex tilde (@code{~}), @code{~} operator + @cindex @code{!} (exclamation point), @code{!~} operator + @cindex exclamation point (@code{!}), @code{!~} operator The righthand operand of the @samp{~} and @samp{!~} operators may be either a regexp constant (@code{/@dots{}/}) or an ordinary expression. In the latter case, the value of the expression as a string is used as a dynamic regexp (@pxref{Regexp Usage, ,How to Use Regular Expressions}; also @pxref{Computed Regexps, ,Using Dynamic Regexps}). ! @cindex @command{awk}, regexp constants and ! @cindex regexp constants In modern implementations of @command{awk}, a constant regular expression in slashes by itself is also an expression. The regexp @code{/@var{regexp}/} is an abbreviation for the following comparison expression: *************** *** 8234,8256 **** @samp{!~}. @xref{Using Constant Regexps, ,Using Regular Expression Constants}, where this is discussed in more detail. @node Boolean Ops, Conditional Exp, Typing and Comparison, Expressions @section Boolean Expressions ! @cindex expression, boolean ! @cindex boolean expressions ! @cindex operators, boolean ! @cindex boolean operators ! @cindex logical operators ! @cindex operators, logical ! @cindex short-circuit operators ! @cindex operators, short-circuit ! @cindex AND logical operator ! @cindex OR logical operator ! @cindex NOT logical operator ! @cindex @code{&&} operator ! @cindex @code{||} operator ! @cindex @code{!} operator A @dfn{Boolean expression} is a combination of comparison expressions or matching expressions, using the Boolean operators ``or'' --- 8594,8617 ---- @samp{!~}. @xref{Using Constant Regexps, ,Using Regular Expression Constants}, where this is discussed in more detail. + @c ENDOFRANGE comex + @c ENDOFRANGE excom + @c ENDOFRANGE vartypc + @c ENDOFRANGE varting @node Boolean Ops, Conditional Exp, Typing and Comparison, Expressions @section Boolean Expressions ! @cindex and Boolean-logic operator ! @cindex or Boolean-logic operator ! @cindex not Boolean-logic operator ! @c STARTOFRANGE exbo ! @cindex expressions, Boolean ! @c STARTOFRANGE boex ! @cindex Boolean expressions ! @cindex operators, Boolean, See Boolean expressions ! @cindex Boolean operators, See Boolean expressions ! @cindex logical operators, See Boolean expressions ! @cindex operators, logical, See Boolean expressions A @dfn{Boolean expression} is a combination of comparison expressions or matching expressions, using the Boolean operators ``or'' *************** *** 8264,8270 **** expressions can be used. They can be used in @code{if}, @code{while}, @code{do}, and @code{for} statements (@pxref{Statements, ,Control Statements in Actions}). ! They have numeric values (one if true, zero if false), that come into play if the result of the Boolean expression is stored in a variable or used in arithmetic. --- 8625,8631 ---- expressions can be used. They can be used in @code{if}, @code{while}, @code{do}, and @code{for} statements (@pxref{Statements, ,Control Statements in Actions}). ! They have numeric values (one if true, zero if false) that come into play if the result of the Boolean expression is stored in a variable or used in arithmetic. *************** *** 8282,8288 **** if ($0 ~ /2400/ && $0 ~ /foo/) print @end example ! @cindex side effects The subexpression @var{boolean2} is evaluated only if @var{boolean1} is true. This can make a difference when @var{boolean2} contains expressions that have side effects. In the case of @samp{$0 ~ /foo/ && --- 8643,8649 ---- if ($0 ~ /2400/ && $0 ~ /foo/) print @end example ! @cindex side effects, Boolean operators The subexpression @var{boolean2} is evaluated only if @var{boolean1} is true. This can make a difference when @var{boolean2} contains expressions that have side effects. In the case of @samp{$0 ~ /foo/ && *************** *** 8318,8334 **** @ref{Reference to Elements, ,Referring to an Array Element}.) @end table The @samp{&&} and @samp{||} operators are called @dfn{short-circuit} operators because of the way they work. Evaluation of the full expression is ``short-circuited'' if the result can be determined part way through its evaluation. ! @cindex line continuation Statements that use @samp{&&} or @samp{||} can be continued simply by putting a newline after them. But you cannot put a newline in front of either of these operators without using backslash continuation (@pxref{Statements/Lines, ,@command{awk} Statements Versus Lines}). @cindex flag variables The actual value of an expression using the @samp{!} operator is either one or zero, depending upon the truth value of the expression it --- 8679,8705 ---- @ref{Reference to Elements, ,Referring to an Array Element}.) @end table + @cindex short-circuit operators + @cindex operators, short-circuit + @cindex @code{&} (ampersand), @code{&&} operator + @cindex ampersand (@code{&}), @code{&&} operator + @cindex @code{|} (vertical bar), @code{||} operator + @cindex vertical bar (@code{|}), @code{||} operator The @samp{&&} and @samp{||} operators are called @dfn{short-circuit} operators because of the way they work. Evaluation of the full expression is ``short-circuited'' if the result can be determined part way through its evaluation. ! @cindex line continuations Statements that use @samp{&&} or @samp{||} can be continued simply by putting a newline after them. But you cannot put a newline in front of either of these operators without using backslash continuation (@pxref{Statements/Lines, ,@command{awk} Statements Versus Lines}). + @cindex @code{!} (exclamation point), @code{!} operator + @cindex exclamation point (@code{!}), @code{!} operator + @cindex newlines + @cindex variables, flag @cindex flag variables The actual value of an expression using the @samp{!} operator is either one or zero, depending upon the truth value of the expression it *************** *** 8357,8373 **** so we'll leave well enough alone. @end ignore @strong{Note:} The @code{next} statement is discussed in @ref{Next Statement, ,The @code{next} Statement}. @code{next} tells @command{awk} to skip the rest of the rules, get the next record, and start processing the rules over again at the top. The reason it's there is to avoid printing the bracketing @samp{START} and @samp{END} lines. @node Conditional Exp, Function Calls, Boolean Ops, Expressions @section Conditional Expressions ! @cindex conditional expression ! @cindex expression, conditional A @dfn{conditional expression} is a special kind of expression that has three operands. It allows you to use one expression's value to select --- 8728,8748 ---- so we'll leave well enough alone. @end ignore + @cindex @code{next} statement @strong{Note:} The @code{next} statement is discussed in @ref{Next Statement, ,The @code{next} Statement}. @code{next} tells @command{awk} to skip the rest of the rules, get the next record, and start processing the rules over again at the top. The reason it's there is to avoid printing the bracketing @samp{START} and @samp{END} lines. + @c ENDOFRANGE exbo + @c ENDOFRANGE boex @node Conditional Exp, Function Calls, Boolean Ops, Expressions @section Conditional Expressions ! @cindex conditional expressions ! @cindex expressions, conditional ! @cindex expressions, selecting A @dfn{conditional expression} is a special kind of expression that has three operands. It allows you to use one expression's value to select *************** *** 8391,8397 **** x >= 0 ? x : -x @end example ! @cindex side effects Each time the conditional expression is computed, only one of @var{if-true-exp} and @var{if-false-exp} is used; the other is ignored. This is important when the expressions have side effects. For example, --- 8766,8772 ---- x >= 0 ? x : -x @end example ! @cindex side effects, conditional expressions Each time the conditional expression is computed, only one of @var{if-true-exp} and @var{if-false-exp} is used; the other is ignored. This is important when the expressions have side effects. For example, *************** *** 8409,8416 **** @xref{Arrays, ,Arrays in @command{awk}}, for more information about arrays. ! @cindex differences between @command{gawk} and @command{awk} ! @cindex line continuation As a minor @command{gawk} extension, a statement that uses @samp{?:} can be continued simply by putting a newline after either character. --- 8784,8792 ---- @xref{Arrays, ,Arrays in @command{awk}}, for more information about arrays. ! @cindex differences in @command{awk} and @command{gawk}, line continuations ! @cindex line continuations, @command{gawk} ! @cindex @command{gawk}, line continuation in As a minor @command{gawk} extension, a statement that uses @samp{?:} can be continued simply by putting a newline after either character. *************** *** 8422,8435 **** @node Function Calls, Precedence, Conditional Exp, Expressions @section Function Calls ! @cindex function call ! @cindex calling a function A @dfn{function} is a name for a particular calculation. This enables you to ask for it by name at any point in the program. For example, the function @code{sqrt} computes the square root of a number. A fixed set of functions are @dfn{built-in}, which means they are available in every @command{awk} program. The @code{sqrt} function is one of these. @xref{Built-in, ,Built-in Functions}, for a list of built-in --- 8798,8811 ---- @node Function Calls, Precedence, Conditional Exp, Expressions @section Function Calls ! @cindex function calls A @dfn{function} is a name for a particular calculation. This enables you to ask for it by name at any point in the program. For example, the function @code{sqrt} computes the square root of a number. + @cindex functions, built-in A fixed set of functions are @dfn{built-in}, which means they are available in every @command{awk} program. The @code{sqrt} function is one of these. @xref{Built-in, ,Built-in Functions}, for a list of built-in *************** *** 8438,8444 **** @xref{User-defined, ,User-Defined Functions}, for instructions on how to do this. ! @cindex arguments in function call The way to use a function is with a @dfn{function call} expression, which consists of the function name followed immediately by a list of @dfn{arguments} in parentheses. The arguments are expressions that --- 8814,8820 ---- @xref{User-defined, ,User-Defined Functions}, for instructions on how to do this. ! @cindex arguments, in function calls The way to use a function is with a @dfn{function call} expression, which consists of the function name followed immediately by a list of @dfn{arguments} in parentheses. The arguments are expressions that *************** *** 8453,8458 **** --- 8829,8835 ---- rand() @i{no arguments} @end example + @cindex troubleshooting, function call syntax @strong{Caution:} Do not put any space between the function name and the open-parenthesis! A user-defined function name looks just like the name of a *************** *** 8463,8469 **** it is best not to get into the habit of using space to avoid mistakes with user-defined functions. Each function expects a particular number of arguments. For example, the @code{sqrt} function must be called with ! a single argument: the number to take the square root of: @example sqrt(@var{argument}) --- 8840,8846 ---- it is best not to get into the habit of using space to avoid mistakes with user-defined functions. Each function expects a particular number of arguments. For example, the @code{sqrt} function must be called with ! a single argument, the number of which to take the square root: @example sqrt(@var{argument}) *************** *** 8478,8484 **** treated as local variables and initialized to the empty string (@pxref{User-defined, ,User-Defined Functions}). ! @cindex side effects Like every other expression, the function call has a value, which is computed by the function based on the arguments you give it. In this example, the value of @samp{sqrt(@var{argument})} is the square root of --- 8855,8861 ---- treated as local variables and initialized to the empty string (@pxref{User-defined, ,User-Defined Functions}). ! @cindex side effects, function calls Like every other expression, the function call has a value, which is computed by the function based on the arguments you give it. In this example, the value of @samp{sqrt(@var{argument})} is the square root of *************** *** 8495,8507 **** @print{} The square root of 3 is 1.73205 5 @print{} The square root of 5 is 2.23607 ! @kbd{Ctrl-d} @end example @node Precedence, , Function Calls, Expressions @section Operator Precedence (How Operators Nest) @cindex precedence ! @cindex operator precedence @dfn{Operator precedence} determines how operators are grouped when different operators appear close by in one expression. For example, --- 8872,8886 ---- @print{} The square root of 3 is 1.73205 5 @print{} The square root of 5 is 2.23607 ! @kbd{@value{CTL}-d} @end example @node Precedence, , Function Calls, Expressions @section Operator Precedence (How Operators Nest) + @c STARTOFRANGE prec @cindex precedence ! @c STARTOFRANGE oppr ! @cindex operators, precedence @dfn{Operator precedence} determines how operators are grouped when different operators appear close by in one expression. For example, *************** *** 8535,8597 **** @samp{-(x^2)}, because @samp{-} has lower precedence than @samp{^}, whereas @samp{$} has higher precedence. This table presents @command{awk}'s operators, in order of highest ! precedence to lowest: @page - @cindex @code{$} field operator - @cindex @code{+} operator - @cindex @code{-} operator - @cindex @code{!} operator - @cindex @code{*} operator - @cindex @code{/} operator - @cindex @code{%} operator - @cindex @code{^} operator - @cindex @code{**} operator - @cindex @code{++} operator - @cindex @code{--} operator - @cindex @code{<} operator - @cindex @code{<=} operator - @cindex @code{==} operator - @cindex @code{!=} operator - @cindex @code{>} operator - @cindex @code{>=} operator - @cindex @code{>>} I/O operator - @cindex @code{|} I/O operator - @cindex @code{|&} I/O operator - @cindex @code{~} operator - @cindex @code{!~} operator - @cindex @code{in} operator - @cindex @code{&&} operator - @cindex @code{||} operator - @cindex @code{?:} operator - @cindex @code{+=} operator - @cindex @code{-=} operator - @cindex @code{*=} operator - @cindex @code{/=} operator - @cindex @code{%=} operator - @cindex @code{^=} operator - @cindex @code{**=} operator @c use @code in the items, looks better in TeX w/o all the quotes @table @code @item (@dots{}) Grouping. @item $ Field. @item ++ -- Increment, decrement. @item ^ ** Exponentiation. These operators group right-to-left. @item + - ! Unary plus, minus, logical ``not.'' @item * / % Multiplication, division, modulus. @item + - Addition, subtraction. --- 8914,8969 ---- @samp{-(x^2)}, because @samp{-} has lower precedence than @samp{^}, whereas @samp{$} has higher precedence. This table presents @command{awk}'s operators, in order of highest ! to lowest precedence: @page @c use @code in the items, looks better in TeX w/o all the quotes @table @code @item (@dots{}) Grouping. + @cindex @code{$} (dollar sign), @code{$} field operator + @cindex dollar sign (@code{$}), @code{$} field operator @item $ Field. + @cindex @code{+} (plus sign), @code{++} operator + @cindex plus sign (@code{+}), @code{++} operator + @cindex @code{-} (hyphen), @code{--} (decrement/increment) operator + @cindex hyphen (@code{-}), @code{--} (decrement/increment) operators @item ++ -- Increment, decrement. + @cindex @code{^} (caret), @code{^} operator + @cindex caret (@code{^}), @code{^} operator + @cindex @code{*} (asterisk), @code{**} operator + @cindex asterisk (@code{*}), @code{**} operator @item ^ ** Exponentiation. These operators group right-to-left. + @cindex @code{+} (plus sign), @code{+} operator + @cindex plus sign (@code{+}), @code{+} operator + @cindex @code{-} (hyphen), @code{-} operator + @cindex hyphen (@code{-}), @code{-} operator + @cindex @code{!} (exclamation point), @code{!} operator + @cindex exclamation point (@code{!}), @code{!} operator @item + - ! Unary plus, minus, logical ``not.'' + @cindex @code{*} (asterisk), @code{*} operator, as multiplication operator + @cindex asterisk (@code{*}), @code{*} operator, as multiplication operator + @cindex @code{/} (forward slash), @code{/} operator + @cindex forward slash (@code{/}), @code{/} operator + @cindex @code{%} (percent sign), @code{%} operator + @cindex percent sign (@code{%}), @code{%} operator @item * / % Multiplication, division, modulus. + @cindex @code{+} (plus sign), @code{+} operator + @cindex plus sign (@code{+}), @code{+} operator + @cindex @code{-} (hyphen), @code{-} operator + @cindex hyphen (@code{-}), @code{-} operator @item + - Addition, subtraction. *************** *** 8600,8605 **** --- 8972,8998 ---- The operands are simply written side by side (@pxref{Concatenation, ,String Concatenation}). + @cindex @code{<} (left angle bracket), @code{<} operator + @cindex left angle bracket (@code{<}), @code{<} operator + @cindex @code{<} (left angle bracket), @code{<=} operator + @cindex left angle bracket (@code{<}), @code{<=} operator + @cindex @code{>} (right angle bracket), @code{>=} operator + @cindex right angle bracket (@code{>}), @code{>=} operator + @cindex @code{>} (right angle bracket), @code{>} operator + @cindex right angle bracket (@code{>}), @code{>} operator + @cindex @code{=} (equals sign), @code{==} operator + @cindex equals sign (@code{=}), @code{==} operator + @cindex @code{!} (exclamation point), @code{!=} operator + @cindex exclamation point (@code{!}), @code{!=} operator + @cindex @code{>} (right angle bracket), @code{>>} operator (I/O) + @cindex right angle bracket (@code{>}), @code{>>} operator (I/O) + @cindex operators, input/output + @cindex @code{|} (vertical bar), @code{|} operator (I/O) + @cindex vertical bar (@code{|}), @code{|} operator (I/O) + @cindex operators, input/output + @cindex @code{|} (vertical bar), @code{|&} operator (I/O) + @cindex vertical bar (@code{|}), @code{|&} operator (I/O) + @cindex operators, input/output @item < <= == != @itemx > >= >> | |& Relational and redirection. *************** *** 8607,8651 **** level. Characters such as @samp{>} serve both as relationals and as redirections; the context distinguishes between the two meanings. Note that the I/O redirection operators in @code{print} and @code{printf} statements belong to the statement level, not to expressions. The redirection does not produce an expression that could be the operand of another operator. As a result, it does not make sense to use a redirection operator near another operator of lower precedence without ! parentheses. Such combinations (for example @samp{print foo > a ? b : c}), result in syntax errors. The correct way to write this statement is @samp{print foo > (a ? b : c)}. @item ~ !~ ! Matching, non-matching. @item in Array membership. @item && Logical ``and''. @item || Logical ``or''. @item ?: Conditional. This operator groups right-to-left. @item = += -= *= @itemx /= %= ^= **= ! Assignment. These operators group right-to-left. @end table ! @cindex portability issues ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} @strong{Note:} The @samp{|&}, @samp{**}, and @samp{**=} operators are not specified by POSIX. For maximum portability, do not use them. @node Patterns and Actions, Arrays, Expressions, Top @chapter Patterns, Actions, and Variables ! @cindex pattern, definition of As you have already seen, each @command{awk} statement consists of a pattern with an associated action. This @value{CHAPTER} describes how --- 9000,9073 ---- level. Characters such as @samp{>} serve both as relationals and as redirections; the context distinguishes between the two meanings. + @cindex @code{print} statement, I/O operators in + @cindex @code{printf} statement, I/O operators in Note that the I/O redirection operators in @code{print} and @code{printf} statements belong to the statement level, not to expressions. The redirection does not produce an expression that could be the operand of another operator. As a result, it does not make sense to use a redirection operator near another operator of lower precedence without ! parentheses. Such combinations (for example, @samp{print foo > a ? b : c}), result in syntax errors. The correct way to write this statement is @samp{print foo > (a ? b : c)}. + @cindex @code{~} (tilde), @code{~} operator + @cindex tilde (@code{~}), @code{~} operator + @cindex @code{!} (exclamation point), @code{!~} operator + @cindex exclamation point (@code{!}), @code{!~} operator @item ~ !~ ! Matching, nonmatching. + @cindex @code{in} operator @item in Array membership. + @cindex @code{&} (ampersand), @code{&&} operator + @cindex ampersand (@code{&}), @code{&&}operator @item && Logical ``and''. + @cindex @code{|} (vertical bar), @code{||} operator + @cindex vertical bar (@code{|}), @code{||} operator @item || Logical ``or''. + @cindex @code{?} (question mark), @code{?:} operator + @cindex question mark (@code{?}), @code{?:} operator @item ?: Conditional. This operator groups right-to-left. + @cindex @code{+} (plus sign), @code{+=} operator + @cindex plus sign (@code{+}), @code{+=} operator + @cindex @code{-} (hyphen), @code{-=} operator + @cindex hyphen (@code{-}), @code{-=} operator + @cindex @code{*} (asterisk), @code{*=} operator + @cindex asterisk (@code{*}), @code{*=} operator + @cindex @code{*} (asterisk), @code{**=} operator + @cindex asterisk (@code{*}), @code{**=} operator + @cindex @code{/} (forward slash), @code{/=} operator + @cindex forward slash (@code{/}), @code{/=} operator + @cindex @code{%} (percent sign), @code{%=} operator + @cindex percent sign (@code{%}), @code{%=} operator + @cindex @code{^} (caret), @code{^=} operator + @cindex caret (@code{^}), @code{^=} operator @item = += -= *= @itemx /= %= ^= **= ! Assignment. These operators group right to left. @end table ! @cindex portability, operators, not in POSIX @command{awk} @strong{Note:} The @samp{|&}, @samp{**}, and @samp{**=} operators are not specified by POSIX. For maximum portability, do not use them. + @c ENDOFRANGE prec + @c ENDOFRANGE oppr + @c ENDOFRANGE exps @node Patterns and Actions, Arrays, Expressions, Top @chapter Patterns, Actions, and Variables ! @c STARTOFRANGE pat ! @cindex patterns As you have already seen, each @command{awk} statement consists of a pattern with an associated action. This @value{CHAPTER} describes how *************** *** 8682,8688 **** @cindex patterns, types of Patterns in @command{awk} control the execution of rules---a rule is executed when its pattern matches the current input record. ! The following is a summary of the types of patterns in @command{awk}: @table @code @item /@var{regular expression}/ --- 9104,9110 ---- @cindex patterns, types of Patterns in @command{awk} control the execution of rules---a rule is executed when its pattern matches the current input record. ! The following is a summary of the types of @command{awk} patterns: @table @code @item /@var{regular expression}/ *************** *** 8714,8719 **** --- 9136,9143 ---- @node Regexp Patterns, Expression Patterns, Pattern Overview, Pattern Overview @subsection Regular Expressions as Patterns + @cindex patterns, expressions as + @cindex regular expressions, as patterns Regular expressions are one of the first kinds of patterns presented in this book. *************** *** 8729,8748 **** @node Expression Patterns, Ranges, Regexp Patterns, Pattern Overview @subsection Expressions as Patterns Any @command{awk} expression is valid as an @command{awk} pattern. The pattern matches if the expression's value is nonzero (if a number) or non-null (if a string). The expression is reevaluated each time the rule is tested against a new input record. If the expression uses fields such as @code{$1}, the ! value depends directly on the new input record's text; otherwise it depends on only what has happened so far in the execution of the @command{awk} program. Comparison expressions, using the comparison operators described in @ref{Typing and Comparison, ,Variable Typing and Comparison Expressions}, ! are a very common kind of pattern. ! Regexp matching and non-matching are also very common expressions. The left operand of the @samp{~} and @samp{!~} operators is a string. The right operand is either a constant regular expression enclosed in slashes (@code{/@var{regexp}/}), or any expression whose string value --- 9153,9175 ---- @node Expression Patterns, Ranges, Regexp Patterns, Pattern Overview @subsection Expressions as Patterns + @cindex expressions, as patterns Any @command{awk} expression is valid as an @command{awk} pattern. The pattern matches if the expression's value is nonzero (if a number) or non-null (if a string). The expression is reevaluated each time the rule is tested against a new input record. If the expression uses fields such as @code{$1}, the ! value depends directly on the new input record's text; otherwise, it depends on only what has happened so far in the execution of the @command{awk} program. + @cindex comparison expressions, as patterns + @cindex patterns, comparison expressions as Comparison expressions, using the comparison operators described in @ref{Typing and Comparison, ,Variable Typing and Comparison Expressions}, ! are a very common kind of pattern. ! Regexp matching and nonmatching are also very common expressions. The left operand of the @samp{~} and @samp{!~} operators is a string. The right operand is either a constant regular expression enclosed in slashes (@code{/@var{regexp}/}), or any expression whose string value *************** *** 8751,8756 **** --- 9178,9189 ---- The following example prints the second field of each input record whose first field is precisely @samp{foo}: + @cindex @code{/} (forward slash), patterns and + @cindex forward slash (@code{/}), patterns and + @cindex @code{~} (tilde), @code{~} operator + @cindex tilde (@code{~}), @code{~} operator + @cindex @code{!} (exclamation point), @code{!~} operator + @cindex exclamation point (@code{!}), @code{!~} operator @example $ awk '$1 == "foo" @{ print $2 @}' BBS-list @end example *************** *** 8768,8778 **** --- 9201,9214 ---- @print{} 555-2127 @end example + @cindex regexp constants, as patterns + @cindex patterns, regexp constants as A regexp constant as a pattern is also a special case of an expression pattern. The expression @code{/foo/} has the value one if @samp{foo} appears in the current input record. Thus, as a pattern, @code{/foo/} matches any record containing @samp{foo}. + @cindex Boolean expressions, as patterns Boolean expressions are also commonly used as patterns. Whether the pattern matches an input record depends on whether its subexpressions match. *************** *** 8813,8818 **** --- 9249,9256 ---- @print{} sdace 555-3430 2400/1200/300 A @end example + @cindex @code{BEGIN} pattern, Boolean patterns and + @cindex @code{END} pattern, Boolean patterns and The subexpressions of a Boolean operator in a pattern can be constant regular expressions, comparisons, or any other @command{awk} expressions. Range patterns are not expressions, so they cannot appear inside Boolean *************** *** 8823,8831 **** @node Ranges, BEGIN/END, Expression Patterns, Pattern Overview @subsection Specifying Record Ranges with Patterns ! @cindex range pattern ! @cindex pattern, range ! @cindex matching ranges of lines A @dfn{range pattern} is made of two patterns separated by a comma, in the form @samp{@var{begpat}, @var{endpat}}. It is used to match ranges of consecutive input records. The first pattern, @var{begpat}, controls --- 9261,9271 ---- @node Ranges, BEGIN/END, Expression Patterns, Pattern Overview @subsection Specifying Record Ranges with Patterns ! @cindex range patterns ! @cindex patterns, ranges in ! @cindex lines, matching ranges of ! @cindex @code{,} (comma), in range patterns ! @cindex comma (@code{,}), in range patterns A @dfn{range pattern} is made of two patterns separated by a comma, in the form @samp{@var{begpat}, @var{endpat}}. It is used to match ranges of consecutive input records. The first pattern, @var{begpat}, controls *************** *** 8848,8853 **** --- 9288,9295 ---- for the following record. Then the range pattern goes back to checking @var{begpat} against each record. + @c last comma does NOT start a tertiary + @cindex @code{if} statement, actions, changing The record that turns on the range pattern and the one that turns it off both match the range pattern. If you don't want to operate on these records, you can write @code{if} statements in the rule's action *************** *** 8856,8862 **** It is possible for a pattern to be turned on and off by the same record. If the record satisfies both conditions, then the action is executed for just that record. ! For example, suppose there is text between two identical markers (say the @samp{%} symbol), each on its own line, that should be ignored. A first attempt would be to combine a range pattern that describes the delimited text with the --- 9298,9304 ---- It is possible for a pattern to be turned on and off by the same record. If the record satisfies both conditions, then the action is executed for just that record. ! For example, suppose there is text between two identical markers (e.g., the @samp{%} symbol), each on its own line, that should be ignored. A first attempt would be to combine a range pattern that describes the delimited text with the *************** *** 8872,8879 **** @end example @noindent ! @cindex skipping lines between markers ! @cindex flag variables This program fails because the range pattern is both turned on and turned off by the first line, which just has a @samp{%} on it. To accomplish this task, write the program in the following manner, using a flag: --- 9314,9321 ---- @end example @noindent ! @cindex lines, skipping between markers ! @c @cindex flag variables This program fails because the range pattern is both turned on and turned off by the first line, which just has a @samp{%} on it. To accomplish this task, write the program in the following manner, using a flag: *************** *** 8886,8892 **** In a range pattern, the comma (@samp{,}) has the lowest precedence of all the operators (i.e., it is evaluated last). Thus, the following ! program attempts to combine a range pattern with another simpler test: @example echo Yes | awk '/1/,/2/ || /Yes/' --- 9328,9334 ---- In a range pattern, the comma (@samp{,}) has the lowest precedence of all the operators (i.e., it is evaluated last). Thus, the following ! program attempts to combine a range pattern with another, simpler test: @example echo Yes | awk '/1/,/2/ || /Yes/' *************** *** 8908,8918 **** @node BEGIN/END, Empty, Ranges, Pattern Overview @subsection The @code{BEGIN} and @code{END} Special Patterns ! @cindex @code{BEGIN} special pattern ! @cindex pattern, @code{BEGIN} ! @cindex @code{END} special pattern ! @cindex pattern, @code{END} ! @cindex blocks, @code{BEGIN} and @code{END} All the patterns described so far are for matching input records. The @code{BEGIN} and @code{END} special patterns are different. They supply startup and cleanup actions for @command{awk} programs. --- 9350,9359 ---- @node BEGIN/END, Empty, Ranges, Pattern Overview @subsection The @code{BEGIN} and @code{END} Special Patterns ! @c STARTOFRANGE beg ! @cindex @code{BEGIN} pattern ! @c STARTOFRANGE end ! @cindex @code{END} pattern All the patterns described so far are for matching input records. The @code{BEGIN} and @code{END} special patterns are different. They supply startup and cleanup actions for @command{awk} programs. *************** *** 8943,8948 **** --- 9384,9391 ---- @print{} "foo" appears 4 times. @end example + @cindex @code{BEGIN} pattern, operators and + @cindex @code{END} pattern, operators and This program finds the number of records in the input file @file{BBS-list} that contain the string @samp{foo}. The @code{BEGIN} rule prints a title for the report. There is no need to use the @code{BEGIN} rule to *************** *** 8972,8988 **** @code{END} rule to do its own initialization and/or cleanup. The order in which library functions are named on the command line controls the order in which their @code{BEGIN} and @code{END} rules are ! executed. Therefore you have to be careful when writing such rules in library files so that the order in which they are executed doesn't matter. @xref{Options, ,Command-Line Options}, for more information on using library functions. @xref{Library Functions, ,A Library of @command{awk} Functions}, for a number of useful library functions. ! If an @command{awk} program only has a @code{BEGIN} rule and no other rules, then the program exits after the @code{BEGIN} rule is run.@footnote{The original version of @command{awk} used to keep ! reading and ignoring input until end of file was seen.} However, if an @code{END} rule exists, then the input is read, even if there are no other rules in the program. This is necessary in case the @code{END} rule checks the @code{FNR} and @code{NR} variables. --- 9415,9431 ---- @code{END} rule to do its own initialization and/or cleanup. The order in which library functions are named on the command line controls the order in which their @code{BEGIN} and @code{END} rules are ! executed. Therefore, you have to be careful when writing such rules in library files so that the order in which they are executed doesn't matter. @xref{Options, ,Command-Line Options}, for more information on using library functions. @xref{Library Functions, ,A Library of @command{awk} Functions}, for a number of useful library functions. ! If an @command{awk} program has only a @code{BEGIN} rule and no other rules, then the program exits after the @code{BEGIN} rule is run.@footnote{The original version of @command{awk} used to keep ! reading and ignoring input until the end of the file was seen.} However, if an @code{END} rule exists, then the input is read, even if there are no other rules in the program. This is necessary in case the @code{END} rule checks the @code{FNR} and @code{NR} variables. *************** *** 8990,8996 **** @node I/O And BEGIN/END, , Using BEGIN/END, BEGIN/END @subsubsection Input/Output from @code{BEGIN} and @code{END} Rules ! @cindex I/O, from @code{BEGIN} and @code{END} There are several (sometimes subtle) points to remember when doing I/O from a @code{BEGIN} or @code{END} rule. The first has to do with the value of @code{$0} in a @code{BEGIN} --- 9433,9439 ---- @node I/O And BEGIN/END, , Using BEGIN/END, BEGIN/END @subsubsection Input/Output from @code{BEGIN} and @code{END} Rules ! @cindex input/output, from @code{BEGIN} and @code{END} There are several (sometimes subtle) points to remember when doing I/O from a @code{BEGIN} or @code{END} rule. The first has to do with the value of @code{$0} in a @code{BEGIN} *************** *** 9000,9008 **** yield a null string or zero, depending upon the context. One way to give @code{$0} a real value is to execute a @code{getline} command without a variable (@pxref{Getline, ,Explicit Input with @code{getline}}). ! Another way is to simply assign a value to @code{$0}. ! @cindex differences between @command{gawk} and @command{awk} The second point is similar to the first but from the other direction. Traditionally, due largely to implementation issues, @code{$0} and @code{NF} were @emph{undefined} inside an @code{END} rule. --- 9443,9455 ---- yield a null string or zero, depending upon the context. One way to give @code{$0} a real value is to execute a @code{getline} command without a variable (@pxref{Getline, ,Explicit Input with @code{getline}}). ! Another way is simply to assign a value to @code{$0}. ! @cindex differences in @command{awk} and @command{gawk}, @code{BEGIN}/@code{END} patterns ! @cindex POSIX @command{awk}, @code{BEGIN}/@code{END} patterns ! @cindex @code{print} statement, @code{BEGIN}/@code{END} patterns and ! @cindex @code{BEGIN} pattern, @code{print} statement and ! @cindex @code{END} pattern, @code{print} statement and The second point is similar to the first but from the other direction. Traditionally, due largely to implementation issues, @code{$0} and @code{NF} were @emph{undefined} inside an @code{END} rule. *************** *** 9024,9042 **** at least in @command{gawk}. It is also poor style, since if an empty line is needed in the output, the program should print one explicitly. Finally, the @code{next} and @code{nextfile} statements are not allowed in a @code{BEGIN} rule, because the implicit read-a-record-and-match-against-the-rules loop has not started yet. Similarly, those statements are not valid in an @code{END} rule, since all the input has been read. (@xref{Next Statement, ,The @code{next} Statement}, and see @ref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}.) @node Empty, , BEGIN/END, Pattern Overview @subsection The Empty Pattern @cindex empty pattern ! @cindex pattern, empty ! An empty (i.e., non-existent) pattern is considered to match @emph{every} input record. For example, the program: @example --- 9471,9495 ---- at least in @command{gawk}. It is also poor style, since if an empty line is needed in the output, the program should print one explicitly. + @cindex @code{next} statement, @code{BEGIN}/@code{END} patterns and + @cindex @code{nextfile} statement, @code{BEGIN}/@code{END} patterns and + @cindex @code{BEGIN} pattern, @code{next}/@code{nextfile} statements and + @cindex @code{END} pattern, @code{next}/@code{nextfile} statements and Finally, the @code{next} and @code{nextfile} statements are not allowed in a @code{BEGIN} rule, because the implicit read-a-record-and-match-against-the-rules loop has not started yet. Similarly, those statements are not valid in an @code{END} rule, since all the input has been read. (@xref{Next Statement, ,The @code{next} Statement}, and see @ref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}.) + @c ENDOFRANGE beg + @c ENDOFRANGE end @node Empty, , BEGIN/END, Pattern Overview @subsection The Empty Pattern @cindex empty pattern ! @cindex patterns, empty ! An empty (i.e., nonexistent) pattern is considered to match @emph{every} input record. For example, the program: @example *************** *** 9045,9056 **** @noindent prints the first field of every record. @node Using Shell Variables, Action Overview, Pattern Overview, Patterns and Actions @section Using Shell Variables in Programs ! @cindex shell varibles, using in @command{awk} programs ! @cindex using shell variables in @command{awk} programs ! @cindex shell and @command{awk} interaction @command{awk} programs are often used as components in larger programs written in shell. --- 9498,9510 ---- @noindent prints the first field of every record. + @c ENDOFRANGE pat @node Using Shell Variables, Action Overview, Pattern Overview, Patterns and Actions @section Using Shell Variables in Programs ! @cindex shells, variables ! @cindex @command{awk} programs, shell variables in ! @c @cindex shell and @command{awk} interaction @command{awk} programs are often used as components in larger programs written in shell. *************** *** 9059,9064 **** --- 9513,9519 ---- There are two ways to get the value of the shell variable into the body of the @command{awk} program. + @cindex shells, quoting The most common method is to use shell quoting to substitute the variable's value into the program inside the script. For example, in the following program: *************** *** 9110,9119 **** @node Action Overview, Statements, Using Shell Variables, Patterns and Actions @section Actions ! @cindex action, definition of ! @cindex curly braces ! @cindex action, curly braces ! @cindex action, separating statements An @command{awk} program or script consists of a series of rules and function definitions interspersed. (Functions are --- 9565,9575 ---- @node Action Overview, Statements, Using Shell Variables, Patterns and Actions @section Actions ! @c @cindex action, definition of ! @c @cindex curly braces ! @c @cindex action, curly braces ! @c @cindex action, separating statements ! @cindex actions An @command{awk} program or script consists of a series of rules and function definitions interspersed. (Functions are *************** *** 9131,9138 **** @dots{} @end example An action consists of one or more @command{awk} @dfn{statements}, enclosed ! in curly braces (@samp{@{} and @samp{@}}). Each statement specifies one thing to do. The statements are separated by newlines or semicolons. The curly braces around an action must be used even if the action contains only one statement, or if it contains no statements at --- 9587,9600 ---- @dots{} @end example + @cindex @code{@{@}} (braces), actions and + @cindex braces (@code{@{@}}), actions and + @cindex separators, for statements in actions + @cindex newlines, separating statements in actions + @cindex @code{;} (semicolon), separating statements in actions + @cindex semicolon (@code{;}), separating statements in actions An action consists of one or more @command{awk} @dfn{statements}, enclosed ! in curly braces (@samp{@{@dots{}@}}). Each statement specifies one thing to do. The statements are separated by newlines or semicolons. The curly braces around an action must be used even if the action contains only one statement, or if it contains no statements at *************** *** 9146,9198 **** The following types of statements are supported in @command{awk}: ! @itemize @bullet ! @cindex side effects ! @item ! Expressions, which can call functions or assign values to variables (@pxref{Expressions}). Executing this kind of statement simply computes the value of the expression. This is useful when the expression has side effects (@pxref{Assignment Ops, ,Assignment Expressions}). ! @item ! Control statements, which specify the control flow of @command{awk} programs. The @command{awk} language gives you C-like constructs (@code{if}, @code{for}, @code{while}, and @code{do}) as well as a few special ones (@pxref{Statements, ,Control Statements in Actions}). ! @item ! Compound statements, which consist of one or more statements enclosed in curly braces. A compound statement is used in order to put several statements together in the body of an @code{if}, @code{while}, @code{do}, or @code{for} statement. ! @item ! Input statements using the @code{getline} command ! (@pxref{Getline, ,Explicit Input with @code{getline}}), the @code{next} statement (@pxref{Next Statement, ,The @code{next} Statement}), and the @code{nextfile} statement (@pxref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}). ! @item ! Output statements, such as @code{print} and @code{printf}. @xref{Printing, ,Printing Output}. ! @item ! Deletion statements for deleting array elements. @xref{Delete, ,The @code{delete} Statement}. ! @end itemize @node Statements, Built-in Variables, Action Overview, Patterns and Actions @section Control Statements in Actions ! @cindex control statement @dfn{Control statements}, such as @code{if}, @code{while}, and so on, control the flow of execution in @command{awk} programs. Most of the control statements in @command{awk} are patterned on similar statements in C. ! @cindex compound statement ! @cindex statement, compound All the control statements start with special keywords, such as @code{if} and @code{while}, to distinguish them from simple expressions. Many control statements contain other statements. For example, the --- 9608,9674 ---- The following types of statements are supported in @command{awk}: ! @table @asis ! @cindex side effects, statements ! @item Expressions ! Call functions or assign values to variables (@pxref{Expressions}). Executing this kind of statement simply computes the value of the expression. This is useful when the expression has side effects (@pxref{Assignment Ops, ,Assignment Expressions}). ! @item Control statements ! Specify the control flow of @command{awk} programs. The @command{awk} language gives you C-like constructs (@code{if}, @code{for}, @code{while}, and @code{do}) as well as a few special ones (@pxref{Statements, ,Control Statements in Actions}). ! @item Compound statements ! Consist of one or more statements enclosed in curly braces. A compound statement is used in order to put several statements together in the body of an @code{if}, @code{while}, @code{do}, or @code{for} statement. ! @item Input statements ! Use the @code{getline} command ! (@pxref{Getline, ,Explicit Input with @code{getline}}). ! Also supplied in @command{awk} are the @code{next} statement (@pxref{Next Statement, ,The @code{next} Statement}), and the @code{nextfile} statement (@pxref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}). ! @item Output statements ! Such as @code{print} and @code{printf}. @xref{Printing, ,Printing Output}. ! @item Deletion statements ! For deleting array elements. @xref{Delete, ,The @code{delete} Statement}. ! @end table @node Statements, Built-in Variables, Action Overview, Patterns and Actions @section Control Statements in Actions ! @c STARTOFRANGE csta ! @cindex control statements ! @c STARTOFRANGE acs ! @cindex statements, control, in actions ! @c STARTOFRANGE accs ! @cindex actions, control statements in @dfn{Control statements}, such as @code{if}, @code{while}, and so on, control the flow of execution in @command{awk} programs. Most of the control statements in @command{awk} are patterned on similar statements in C. ! @c the comma here does NOT start a secondary ! @cindex compound statements, control statements and ! @c the second comma here does NOT start a tertiary ! @cindex statements, compound, control statements and ! @cindex body, in actions ! @cindex @code{@{@}} (braces), statements, grouping ! @cindex braces (@code{@{@}}), statements, grouping ! @cindex newlines, separating statements in actions ! @cindex @code{;} (semicolon), separating statements in actions ! @cindex semicolon (@code{;}), separating statements in actions All the control statements start with special keywords, such as @code{if} and @code{while}, to distinguish them from simple expressions. Many control statements contain other statements. For example, the *************** *** 9221,9227 **** @node If Statement, While Statement, Statements, Statements @subsection The @code{if}-@code{else} Statement ! @cindex @code{if}-@code{else} statement The @code{if}-@code{else} statement is @command{awk}'s decision-making statement. It looks like this: --- 9697,9703 ---- @node If Statement, While Statement, Statements, Statements @subsection The @code{if}-@code{else} Statement ! @cindex @code{if} statement The @code{if}-@code{else} statement is @command{awk}'s decision-making statement. It looks like this: *************** *** 9235,9241 **** executed; otherwise, @var{else-body} is executed. The @code{else} part of the statement is optional. The condition is considered false if its value is zero or ! the null string; otherwise the condition is true. Refer to the following: @example --- 9711,9717 ---- executed; otherwise, @var{else-body} is executed. The @code{else} part of the statement is optional. The condition is considered false if its value is zero or ! the null string; otherwise, the condition is true. Refer to the following: @example *************** *** 9247,9253 **** In this example, if the expression @samp{x % 2 == 0} is true (that is, if the value of @code{x} is evenly divisible by two), then the first ! @code{print} statement is executed; otherwise the second @code{print} statement is executed. If the @code{else} keyword appears on the same line as @var{then-body} and @var{then-body} is not a compound statement (i.e., not surrounded by --- 9723,9729 ---- In this example, if the expression @samp{x % 2 == 0} is true (that is, if the value of @code{x} is evenly divisible by two), then the first ! @code{print} statement is executed; otherwise, the second @code{print} statement is executed. If the @code{else} keyword appears on the same line as @var{then-body} and @var{then-body} is not a compound statement (i.e., not surrounded by *************** *** 9269,9276 **** @node While Statement, Do Statement, If Statement, Statements @subsection The @code{while} Statement @cindex @code{while} statement ! @cindex loop ! @cindex body of a loop In programming, a @dfn{loop} is a part of a program that can be executed two or more times in succession. --- 9745,9752 ---- @node While Statement, Do Statement, If Statement, Statements @subsection The @code{while} Statement @cindex @code{while} statement ! @cindex loops ! @cindex loops, See Also @code{while} statement In programming, a @dfn{loop} is a part of a program that can be executed two or more times in succession. *************** *** 9283,9288 **** --- 9759,9765 ---- @var{body} @end example + @cindex body, in loops @noindent @var{body} is a statement called the @dfn{body} of the loop, and @var{condition} is an expression that controls how long the loop *************** *** 9364,9370 **** @end example @noindent ! This program prints each input record ten times. However, it isn't a very realistic example, since in this case an ordinary @code{while} would do just as well. This situation reflects actual experience; only occasionally is there a real use for a @code{do} statement. --- 9841,9847 ---- @end example @noindent ! This program prints each input record 10 times. However, it isn't a very realistic example, since in this case an ordinary @code{while} would do just as well. This situation reflects actual experience; only occasionally is there a real use for a @code{do} statement. *************** *** 9411,9417 **** are equal. (But it is possible to initialize additional variables by writing their assignments as separate statements preceding the @code{for} loop.) ! @cindex comma operator, not supported The same is true of the @var{increment} part. Incrementing additional variables requires separate statements at the end of the loop. The C compound expression, using C's comma operator, is useful in --- 9888,9894 ---- are equal. (But it is possible to initialize additional variables by writing their assignments as separate statements preceding the @code{for} loop.) ! @c @cindex comma operator, not supported The same is true of the @var{increment} part. Incrementing additional variables requires separate statements at the end of the loop. The C compound expression, using C's comma operator, is useful in *************** *** 9444,9449 **** --- 9921,9927 ---- @} @end example + @cindex loops, @code{continue} statements and @noindent The only exception is when the @code{continue} statement (@pxref{Continue Statement, ,The @code{continue} Statement}) is used *************** *** 9524,9534 **** @} @end example ! @cindex @code{break}, outside of loops ! @cindex historical features ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} ! @cindex dark corner The @code{break} statement has no meaning when used outside the body of a loop. However, although it was never documented, historical implementations of @command{awk} treated the @code{break} --- 10002,10013 ---- @} @end example ! @c @cindex @code{break}, outside of loops ! @c @cindex historical features ! @c @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk}, @code{break} statement and ! @cindex dark corner, @code{break} statement ! @cindex @command{gawk}, @code{break} statement in The @code{break} statement has no meaning when used outside the body of a loop. However, although it was never documented, historical implementations of @command{awk} treated the @code{break} *************** *** 9571,9579 **** @end example @noindent ! This program prints all the numbers from 0 to 20---except for five, for which the @code{printf} is skipped. Because the increment @samp{x++} ! is not skipped, @code{x} does not remain stuck at five. Contrast the @code{for} loop from the previous example with the following @code{while} loop: @example --- 10050,10058 ---- @end example @noindent ! This program prints all the numbers from 0 to 20---except for 5, for which the @code{printf} is skipped. Because the increment @samp{x++} ! is not skipped, @code{x} does not remain stuck at 5. Contrast the @code{for} loop from the previous example with the following @code{while} loop: @example *************** *** 9590,9602 **** @end example @noindent ! This program loops forever once @code{x} reaches five. ! @cindex @code{continue}, outside of loops ! @cindex historical features ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} ! @cindex dark corner The @code{continue} statement has no meaning when used outside the body of a loop. Historical versions of @command{awk} treated a @code{continue} statement outside a loop the same way they treated a @code{break} --- 10069,10082 ---- @end example @noindent ! This program loops forever once @code{x} reaches 5. ! @c @cindex @code{continue}, outside of loops ! @c @cindex historical features ! @c @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk}, @code{continue} statement and ! @cindex dark corner, @code{continue} statement ! @cindex @command{gawk}, @code{continue} statement in The @code{continue} statement has no meaning when used outside the body of a loop. Historical versions of @command{awk} treated a @code{continue} statement outside a loop the same way they treated a @code{break} *************** *** 9625,9630 **** --- 10105,10111 ---- flow of control in any way (i.e., the rest of the current action executes with a new input record). + @cindex @command{awk} programs, execution of At the highest level, @command{awk} program execution is a loop that reads an input record and then tests each rule's pattern against it. If you think of this loop as a @code{for} statement whose body contains the *************** *** 9650,9660 **** the program's subsequent rules won't see the bad record. The error message is redirected to the standard error output stream, as error messages should be. ! @xref{Special Files, ,Special @value{FFN}s in @command{gawk}}. ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} ! @cindex @code{next}, inside a user-defined function According to the POSIX standard, the behavior is undefined if the @code{next} statement is used in a @code{BEGIN} or @code{END} rule. @command{gawk} treats it as a syntax error. --- 10131,10146 ---- the program's subsequent rules won't see the bad record. The error message is redirected to the standard error output stream, as error messages should be. ! For more detail see ! @ref{Special Files, ,Special @value{FFN}s in @command{gawk}}. ! @c @cindex @command{awk} language, POSIX version ! @c @cindex @code{next}, inside a user-defined function ! @cindex @code{BEGIN} pattern, @code{next}/@code{nextfile} statements and ! @cindex @code{END} pattern, @code{next}/@code{nextfile} statements and ! @cindex POSIX @command{awk}, @code{next}/@code{nextfile} statements and ! @cindex @code{next} statement, user-defined functions and ! @cindex functions, user-defined, @code{next}/@code{nextfile} statements and According to the POSIX standard, the behavior is undefined if the @code{next} statement is used in a @code{BEGIN} or @code{END} rule. @command{gawk} treats it as a syntax error. *************** *** 9672,9678 **** @node Nextfile Statement, Exit Statement, Next Statement, Statements @subsection Using @command{gawk}'s @code{nextfile} Statement @cindex @code{nextfile} statement ! @cindex differences between @command{gawk} and @command{awk} @command{gawk} provides the @code{nextfile} statement, which is similar to the @code{next} statement. --- 10158,10164 ---- @node Nextfile Statement, Exit Statement, Next Statement, Statements @subsection Using @command{gawk}'s @code{nextfile} Statement @cindex @code{nextfile} statement ! @cindex differences in @command{awk} and @command{gawk}, @code{next}/@code{nextfile} statements @command{gawk} provides the @code{nextfile} statement, which is similar to the @code{next} statement. *************** *** 9713,9719 **** for a user-defined function that simulates the @code{nextfile} statement. ! @cindex @code{nextfile}, inside a user-defined function The current version of the Bell Laboratories @command{awk} (@pxref{Other Versions, ,Other Freely Available @command{awk} Implementations}) also supports @code{nextfile}. However, it doesn't allow the @code{nextfile} --- 10199,10206 ---- for a user-defined function that simulates the @code{nextfile} statement. ! @cindex functions, user-defined, @code{next}/@code{nextfile} statements and ! @cindex @code{nextfile} statement, user-defined functions and The current version of the Bell Laboratories @command{awk} (@pxref{Other Versions, ,Other Freely Available @command{awk} Implementations}) also supports @code{nextfile}. However, it doesn't allow the @code{nextfile} *************** *** 9723,9729 **** function body reads the next record and starts processing it with the first rule in the program, just as any other @code{nextfile} statement. ! @cindex @code{next file} statement @strong{Caution:} Versions of @command{gawk} prior to 3.0 used two words (@samp{next file}) for the @code{nextfile} statement. In @value{PVERSION} 3.0, this was changed --- 10210,10219 ---- function body reads the next record and starts processing it with the first rule in the program, just as any other @code{nextfile} statement. ! @cindex @code{next file} statement, in @command{gawk} ! @cindex @command{gawk}, @code{next file} statement in ! @cindex @code{nextfile} statement, in @command{gawk} ! @cindex @command{gawk}, @code{nextfile} statement in @strong{Caution:} Versions of @command{gawk} prior to 3.0 used two words (@samp{next file}) for the @code{nextfile} statement. In @value{PVERSION} 3.0, this was changed *************** *** 9744,9749 **** --- 10234,10241 ---- exit @r{[}@var{return code}@r{]} @end example + @cindex @code{BEGIN} pattern, @code{exit} statement and + @cindex @code{END} pattern, @code{exit} statement and When an @code{exit} statement is executed from a @code{BEGIN} rule, the program stops processing everything immediately. No input records are read. However, if an @code{END} rule is present, *************** *** 9765,9771 **** @xref{Assert Function, ,Assertions}, for an example that does this. ! @cindex dark corner If an argument is supplied to @code{exit}, its value is used as the exit status code for the @command{awk} process. If no argument is supplied, @code{exit} returns status zero (success). In the case where an argument --- 10257,10263 ---- @xref{Assert Function, ,Assertions}, for an example that does this. ! @cindex dark corner, @code{exit} statement If an argument is supplied to @code{exit}, its value is used as the exit status code for the @command{awk} process. If no argument is supplied, @code{exit} returns status zero (success). In the case where an argument *************** *** 9774,9781 **** @command{awk} uses the previously supplied exit value. @value{DARKCORNER} ! @cindex conventions, programming ! @cindex programming conventions For example, suppose an error condition occurs that is difficult or impossible to handle. Conventionally, programs report this by exiting with a nonzero status. An @command{awk} program can do this --- 10266,10272 ---- @command{awk} uses the previously supplied exit value. @value{DARKCORNER} ! @cindex programming conventions, @code{exit} statement For example, suppose an error condition occurs that is difficult or impossible to handle. Conventionally, programs report this by exiting with a nonzero status. An @command{awk} program can do this *************** *** 9792,9803 **** close("date") @} @end example @node Built-in Variables, , Statements, Patterns and Actions @section Built-in Variables @cindex built-in variables ! Most @command{awk} variables are available for you to use for your own purposes; they never change unless your program assigns values to them, and they never affect anything unless your program examines them. However, a few variables in @command{awk} have special built-in meanings. --- 10283,10300 ---- close("date") @} @end example + @c ENDOFRANGE csta + @c ENDOFRANGE acs + @c ENDOFRANGE accs @node Built-in Variables, , Statements, Patterns and Actions @section Built-in Variables + @c STARTOFRANGE bvar @cindex built-in variables + @c STARTOFRANGE varb + @cindex variables, built-in ! Most @command{awk} variables are available to use for your own purposes; they never change unless your program assigns values to them, and they never affect anything unless your program examines them. However, a few variables in @command{awk} have special built-in meanings. *************** *** 9806,9811 **** --- 10303,10309 ---- automatically by @command{awk}, so that they carry information from the internal workings of @command{awk} to your program. + @cindex @command{gawk}, built-in variables and This @value{SECTION} documents all the built-in variables of @command{gawk}, most of which are also documented in the chapters describing their areas of activity. *************** *** 9820,9826 **** @node User-modified, Auto-set, Built-in Variables, Built-in Variables @subsection Built-in Variables That Control @command{awk} ! @cindex built-in variables, user modifiable The following is an alphabetical list of variables that you can change to control how @command{awk} does certain things. The variables that are --- 10318,10327 ---- @node User-modified, Auto-set, Built-in Variables, Built-in Variables @subsection Built-in Variables That Control @command{awk} ! @c STARTOFRANGE bvaru ! @cindex built-in variables, user-modifiable ! @c STARTOFRANGE nmbv ! @cindex user-modifiable variables The following is an alphabetical list of variables that you can change to control how @command{awk} does certain things. The variables that are *************** *** 9828,9839 **** @table @code @cindex @code{BINMODE} variable ! @cindex binary I/O ! @cindex I/O, binary ! @cindex differences between @command{gawk} and @command{awk} @item BINMODE # ! On non-POSIX systems, this variable specifies use of ``binary'' mode for all I/O. ! Numeric values of one, two, or three, specify that input files, output files, or all files, respectively, should use binary I/O. Alternatively, string values of @code{"r"} or @code{"w"} specify that input files and --- 10329,10339 ---- @table @code @cindex @code{BINMODE} variable ! @cindex binary input/output ! @cindex input/output, binary @item BINMODE # ! On non-POSIX systems, this variable specifies use of binary mode for all I/O. ! Numeric values of one, two, or three specify that input files, output files, or all files, respectively, should use binary I/O. Alternatively, string values of @code{"r"} or @code{"w"} specify that input files and *************** *** 9845,9850 **** --- 10345,10351 ---- @code{BINMODE} is described in more detail in @ref{PC Using, ,Using @command{gawk} on PC Operating Systems}. + @cindex differences in @command{awk} and @command{gawk}, @code{BINMODE} variable This variable is a @command{gawk} extension. In other @command{awk} implementations (except @command{mawk}, *************** *** 9854,9861 **** it is not special. @cindex @code{CONVFMT} variable ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} @item CONVFMT This string controls conversion of numbers to strings (@pxref{Conversion, ,Conversion of Strings and Numbers}). --- 10355,10363 ---- it is not special. @cindex @code{CONVFMT} variable ! @cindex POSIX @command{awk}, @code{CONVFMT} variable and ! @cindex numbers, converting, to strings ! @cindex strings, converting, numbers to @item CONVFMT This string controls conversion of numbers to strings (@pxref{Conversion, ,Conversion of Strings and Numbers}). *************** *** 9866,9871 **** --- 10368,10376 ---- @code{CONVFMT} was introduced by the POSIX standard. @cindex @code{FIELDWIDTHS} variable + @cindex differences in @command{awk} and @command{gawk}, @code{FIELDWIDTHS} variable + @cindex field separators, @code{FIELDWIDTHS} variable and + @cindex separators, field, @code{FIELDWIDTHS} variable and @item FIELDWIDTHS # This is a space-separated list of columns that tells @command{gawk} how to split input with fixed columnar boundaries. *************** *** 9873,9884 **** --- 10378,10392 ---- overrides the use of @code{FS} for field splitting. @xref{Constant Size, ,Reading Fixed-Width Data}, for more information. + @cindex @command{gawk}, @code{FIELDWIDTHS} variable in If @command{gawk} is in compatibility mode (@pxref{Options, ,Command-Line Options}), then @code{FIELDWIDTHS} has no special meaning, and field-splitting operations occur based exclusively on the value of @code{FS}. @cindex @code{FS} variable + @cindex separators, field + @cindex field separators @item FS This is the input field separator (@pxref{Field Separators, ,Specifying How Fields Are Separated}). *************** *** 9890,9895 **** --- 10398,10404 ---- specify the behavior when @code{FS} is the null string.) @c NEXT ED: Mark as common extension + @cindex POSIX @command{awk}, @code{FS} variable and The default value is @w{@code{" "}}, a string consisting of a single space. As a special exception, this value means that any sequence of spaces, tabs, and/or newlines is a single separator.@footnote{In *************** *** 9903,9917 **** awk -F, '@var{program}' @var{input-files} @end example If @command{gawk} is using @code{FIELDWIDTHS} for field splitting, assigning a value to @code{FS} causes @command{gawk} to return to the normal, @code{FS}-based field splitting. An easy way to do this is to simply say @samp{FS = FS}, perhaps with an explanatory comment. @cindex @code{IGNORECASE} variable @item IGNORECASE # If @code{IGNORECASE} is nonzero or non-null, then all string comparisons ! and all regular expression matching are case-independent. Thus, regexp matching with @samp{~} and @samp{!~}, as well as the @code{gensub}, @code{gsub}, @code{index}, @code{match}, @code{split}, and @code{sub} functions, record termination with @code{RS}, and field splitting with --- 10412,10431 ---- awk -F, '@var{program}' @var{input-files} @end example + @cindex @command{gawk}, field separators and If @command{gawk} is using @code{FIELDWIDTHS} for field splitting, assigning a value to @code{FS} causes @command{gawk} to return to the normal, @code{FS}-based field splitting. An easy way to do this is to simply say @samp{FS = FS}, perhaps with an explanatory comment. @cindex @code{IGNORECASE} variable + @cindex differences in @command{awk} and @command{gawk}, @code{IGNORECASE} variable + @cindex case sensitivity, string comparisons and + @cindex case sensitivity, regexps and + @cindex regular expressions, case sensitivity @item IGNORECASE # If @code{IGNORECASE} is nonzero or non-null, then all string comparisons ! and all regular expression matching are case independent. Thus, regexp matching with @samp{~} and @samp{!~}, as well as the @code{gensub}, @code{gsub}, @code{index}, @code{match}, @code{split}, and @code{sub} functions, record termination with @code{RS}, and field splitting with *************** *** 9919,9940 **** However, the value of @code{IGNORECASE} does @emph{not} affect array subscripting. @xref{Case-sensitivity, ,Case Sensitivity in Matching}. If @command{gawk} is in compatibility mode (@pxref{Options, ,Command-Line Options}), then @code{IGNORECASE} has no special meaning. Thus, string and regexp operations are always case-sensitive. @cindex @code{LINT} variable ! @cindex differences between @command{gawk} and @command{awk} ! @cindex lint checks @item LINT # When this variable is true (nonzero or non-null), @command{gawk} behaves as if the @option{--lint} command-line option is in effect. (@pxref{Options, ,Command-Line Options}). With a value of @code{"fatal"}, lint warnings become fatal errors. ! Any other true value prints non-fatal warnings. Assigning a false value to @code{LINT} turns off the lint warnings. This variable is a @command{gawk} extension. It is not special in other @command{awk} implementations. Unlike the other special variables, changing @code{LINT} does affect the production of lint warnings, --- 10433,10456 ---- However, the value of @code{IGNORECASE} does @emph{not} affect array subscripting. @xref{Case-sensitivity, ,Case Sensitivity in Matching}. + @cindex @command{gawk}, @code{IGNORECASE} variable in If @command{gawk} is in compatibility mode (@pxref{Options, ,Command-Line Options}), then @code{IGNORECASE} has no special meaning. Thus, string and regexp operations are always case-sensitive. @cindex @code{LINT} variable ! @cindex differences in @command{awk} and @command{gawk}, @code{LINT} variable ! @cindex lint checking @item LINT # When this variable is true (nonzero or non-null), @command{gawk} behaves as if the @option{--lint} command-line option is in effect. (@pxref{Options, ,Command-Line Options}). With a value of @code{"fatal"}, lint warnings become fatal errors. ! Any other true value prints nonfatal warnings. Assigning a false value to @code{LINT} turns off the lint warnings. + @cindex @command{gawk}, @code{LINT} variable in This variable is a @command{gawk} extension. It is not special in other @command{awk} implementations. Unlike the other special variables, changing @code{LINT} does affect the production of lint warnings, *************** *** 9945,9950 **** --- 10461,10468 ---- of @command{awk} being executed. @cindex @code{OFMT} variable + @cindex numbers, converting, to strings + @cindex strings, converting, numbers to @item OFMT This string controls conversion of numbers to strings (@pxref{Conversion, ,Conversion of Strings and Numbers}) for *************** *** 9955,9961 **** --- 10473,10483 ---- also used @code{OFMT} to specify the format for converting numbers to strings in general expressions; this is now done by @code{CONVFMT}. + @cindex @code{sprintf} function, @code{OFMT} variable and + @cindex @code{print} statement, @code{OFMT} variable and @cindex @code{OFS} variable + @cindex separators, field + @cindex field separators @item OFS This is the output field separator (@pxref{Output Separators}). It is output between the fields printed by a @code{print} statement. Its *************** *** 9968,9973 **** --- 10490,10497 ---- character. (@xref{Output Separators}.) @cindex @code{RS} variable + @cindex separators, record + @cindex record separators @item RS This is @command{awk}'s input record separator. Its default value is a string containing a single newline character, which means that an input record *************** *** 9986,9991 **** --- 10510,10517 ---- just the first character of @code{RS}'s value is used. @cindex @code{SUBSEP} variable + @cindex separators, subscript + @cindex subscript separators @item SUBSEP This is the subscript separator. It has the default value of @code{"\034"} and is used to separate the parts of the indices of a *************** *** 9994,10005 **** (@pxref{Multi-dimensional, ,Multidimensional Arrays}). @cindex @code{TEXTDOMAIN} variable ! @cindex internationalization @item TEXTDOMAIN # This variable is used for internationalization of programs at the @command{awk} level. It sets the default text domain for specially marked string constants in the source text, as well as for the ! @code{dcgettext} and @code{bindtextdomain} functions (@pxref{Internationalization, ,Internationalization with @command{gawk}}). The default value of @code{TEXTDOMAIN} is @code{"messages"}. --- 10520,10532 ---- (@pxref{Multi-dimensional, ,Multidimensional Arrays}). @cindex @code{TEXTDOMAIN} variable ! @cindex differences in @command{awk} and @command{gawk}, @code{TEXTDOMAIN} variable ! @cindex internationalization, localization @item TEXTDOMAIN # This variable is used for internationalization of programs at the @command{awk} level. It sets the default text domain for specially marked string constants in the source text, as well as for the ! @code{dcgettext}, @code{dcngettext} and @code{bindtextdomain} functions (@pxref{Internationalization, ,Internationalization with @command{gawk}}). The default value of @code{TEXTDOMAIN} is @code{"messages"}. *************** *** 10009,10027 **** (@pxref{Options, ,Command-Line Options}), it is not special. @end table @node Auto-set, ARGC and ARGV, User-modified, Built-in Variables @subsection Built-in Variables That Convey Information - @cindex built-in variables, convey information The following is an alphabetical list of variables that @command{awk} sets automatically on certain occasions in order to provide information to your program. The variables that are specific to @command{gawk} are marked with an asterisk (@samp{*}). @table @code ! @cindex @code{ARGC} variable ! @cindex @code{ARGV} variable @item ARGC@r{,} ARGV The command-line arguments available to @command{awk} programs are stored in an array called @code{ARGV}. @code{ARGC} is the number of command-line --- 10536,10562 ---- (@pxref{Options, ,Command-Line Options}), it is not special. @end table + @c ENDOFRANGE bvar + @c ENDOFRANGE varb + @c ENDOFRANGE bvaru + @c ENDOFRANGE nmbv @node Auto-set, ARGC and ARGV, User-modified, Built-in Variables @subsection Built-in Variables That Convey Information + @c STARTOFRANGE bvconi + @cindex built-in variables, conveying information + @c STARTOFRANGE vbconi + @cindex variables, built-in, conveying information The following is an alphabetical list of variables that @command{awk} sets automatically on certain occasions in order to provide information to your program. The variables that are specific to @command{gawk} are marked with an asterisk (@samp{*}). @table @code ! @cindex @code{ARGC}/@code{ARGV} variables ! @cindex arguments, command-line ! @cindex command line, arguments @item ARGC@r{,} ARGV The command-line arguments available to @command{awk} programs are stored in an array called @code{ARGV}. @code{ARGC} is the number of command-line *************** *** 10042,10054 **** @noindent @code{ARGV[0]} contains @code{"awk"}, @code{ARGV[1]} ! contains @code{"inventory-shipped"} and @code{ARGV[2]} contains @code{"BBS-list"}. The value of @code{ARGC} is three, one more than the index of the last element in @code{ARGV}, because the elements are numbered from zero. ! @cindex conventions, programming ! @cindex programming conventions The names @code{ARGC} and @code{ARGV}, as well as the convention of indexing the array from 0 to @code{ARGC} @minus{} 1, are derived from the C language's method of accessing command-line arguments. --- 10577,10588 ---- @noindent @code{ARGV[0]} contains @code{"awk"}, @code{ARGV[1]} ! contains @code{"inventory-shipped"}, and @code{ARGV[2]} contains @code{"BBS-list"}. The value of @code{ARGC} is three, one more than the index of the last element in @code{ARGV}, because the elements are numbered from zero. ! @cindex programming conventions, @code{ARGC}/@code{ARGV} variables The names @code{ARGC} and @code{ARGV}, as well as the convention of indexing the array from 0 to @code{ARGC} @minus{} 1, are derived from the C language's method of accessing command-line arguments. *************** *** 10060,10076 **** about how @command{awk} uses these variables. @cindex @code{ARGIND} variable @item ARGIND # ! This is the index in @code{ARGV} of the current file being processed. Every time @command{gawk} opens a new @value{DF} for processing, it sets @code{ARGIND} to the index in @code{ARGV} of the @value{FN}. When @command{gawk} is processing the input files, @samp{FILENAME == ARGV[ARGIND]} is always true. This variable is useful in file processing; it allows you to tell how far along you are in the list of @value{DF}s as well as to distinguish between successive instances of the same @value{FN} on the command line. While you can change the value of @code{ARGIND} within your @command{awk} program, @command{gawk} automatically sets it to a new value when the next file is opened. --- 10594,10614 ---- about how @command{awk} uses these variables. @cindex @code{ARGIND} variable + @cindex differences in @command{awk} and @command{gawk}, @code{ARGIND} variable @item ARGIND # ! The index in @code{ARGV} of the current file being processed. Every time @command{gawk} opens a new @value{DF} for processing, it sets @code{ARGIND} to the index in @code{ARGV} of the @value{FN}. When @command{gawk} is processing the input files, @samp{FILENAME == ARGV[ARGIND]} is always true. + @c comma before ARGIND does NOT mark a tertiary + @cindex files, processing, @code{ARGIND} variable and This variable is useful in file processing; it allows you to tell how far along you are in the list of @value{DF}s as well as to distinguish between successive instances of the same @value{FN} on the command line. + @cindex @value{FN}s, distinguishing While you can change the value of @code{ARGIND} within your @command{awk} program, @command{gawk} automatically sets it to a new value when the next file is opened. *************** *** 10082,10087 **** --- 10620,10626 ---- it is not special. @cindex @code{ENVIRON} variable + @cindex environment variables @item ENVIRON An associative array that contains the values of the environment. The array indices are the environment variable names; the elements are the values of *************** *** 10097,10102 **** --- 10636,10643 ---- @pxref{AWKPATH Variable, ,The @env{AWKPATH} Environment Variable}). @cindex @code{ERRNO} variable + @cindex differences in @command{awk} and @command{gawk}, @code{ERRNO} variable + @cindex error handling, @code{ERRNO} variable and @item ERRNO # If a system error occurs during a redirection for @code{getline}, during a read for @code{getline}, or during a @code{close} operation, *************** *** 10108,10117 **** (@pxref{Options, ,Command-Line Options}), it is not special. - @cindex dark corner @cindex @code{FILENAME} variable @item FILENAME ! This is the name of the file that @command{awk} is currently reading. When no @value{DF}s are listed on the command line, @command{awk} reads from the standard input and @code{FILENAME} is set to @code{"-"}. @code{FILENAME} is changed each time a new file is read --- 10649,10658 ---- (@pxref{Options, ,Command-Line Options}), it is not special. @cindex @code{FILENAME} variable + @cindex dark corner, @code{FILENAME} variable @item FILENAME ! The name of the file that @command{awk} is currently reading. When no @value{DF}s are listed on the command line, @command{awk} reads from the standard input and @code{FILENAME} is set to @code{"-"}. @code{FILENAME} is changed each time a new file is read *************** *** 10123,10154 **** processed. This behavior was incorrect and should not be relied upon in your programs.} @value{DARKCORNER} ! Note though, that using @code{getline} (@pxref{Getline, ,Explicit Input with @code{getline}}) inside a @code{BEGIN} rule can give @code{FILENAME} a value. @cindex @code{FNR} variable @item FNR ! This is the current record number in the current file. @code{FNR} is incremented each time a new record is read (@pxref{Getline, ,Explicit Input with @code{getline}}). It is reinitialized to zero each time a new input file is started. @cindex @code{NF} variable @item NF ! This is the number of fields in the current input record. @code{NF} is set each time a new record is read, when a new field is created or when @code{$0} changes (@pxref{Fields, ,Examining Fields}). @cindex @code{NR} variable @item NR ! This is the number of input records @command{awk} has processed since the beginning of the program's execution (@pxref{Records, ,How Input Is Split into Records}). @code{NR} is incremented each time a new record is read. ! @cindex @code{PROCINFO} variable @item PROCINFO # The elements of this array provide access to information about the running @command{awk} program. --- 10664,10696 ---- processed. This behavior was incorrect and should not be relied upon in your programs.} @value{DARKCORNER} ! Note, though, that using @code{getline} (@pxref{Getline, ,Explicit Input with @code{getline}}) inside a @code{BEGIN} rule can give @code{FILENAME} a value. @cindex @code{FNR} variable @item FNR ! The current record number in the current file. @code{FNR} is incremented each time a new record is read (@pxref{Getline, ,Explicit Input with @code{getline}}). It is reinitialized to zero each time a new input file is started. @cindex @code{NF} variable @item NF ! The number of fields in the current input record. @code{NF} is set each time a new record is read, when a new field is created or when @code{$0} changes (@pxref{Fields, ,Examining Fields}). @cindex @code{NR} variable @item NR ! The number of input records @command{awk} has processed since the beginning of the program's execution (@pxref{Records, ,How Input Is Split into Records}). @code{NR} is incremented each time a new record is read. ! @cindex @code{PROCINFO} array ! @cindex differences in @command{awk} and @command{gawk}, @code{PROCINFO} array @item PROCINFO # The elements of this array provide access to information about the running @command{awk} program. *************** *** 10197,10203 **** @cindex @code{RLENGTH} variable @item RLENGTH ! This is the length of the substring matched by the @code{match} function (@pxref{String Functions, ,String Manipulation Functions}). @code{RLENGTH} is set by invoking the @code{match} function. Its value --- 10739,10745 ---- @cindex @code{RLENGTH} variable @item RLENGTH ! The length of the substring matched by the @code{match} function (@pxref{String Functions, ,String Manipulation Functions}). @code{RLENGTH} is set by invoking the @code{match} function. Its value *************** *** 10205,10211 **** @cindex @code{RSTART} variable @item RSTART ! This is the start-index in characters of the substring that is matched by the @code{match} function (@pxref{String Functions, ,String Manipulation Functions}). @code{RSTART} is set by invoking the @code{match} function. Its value --- 10747,10753 ---- @cindex @code{RSTART} variable @item RSTART ! The start-index in characters of the substring that is matched by the @code{match} function (@pxref{String Functions, ,String Manipulation Functions}). @code{RSTART} is set by invoking the @code{match} function. Its value *************** *** 10213,10218 **** --- 10755,10761 ---- if no match was found. @cindex @code{RT} variable + @cindex differences in @command{awk} and @command{gawk}, @code{RT} variable @item RT # This is set each time a record is read. It contains the input text that matched the text denoted by @code{RS}, the record separator. *************** *** 10223,10233 **** (@pxref{Options, ,Command-Line Options}), it is not special. @end table @c fakenode --- for prepinfo @subheading Advanced Notes: Changing @code{NR} and @code{FNR} ! @cindex advanced notes ! @cindex dark corner @command{awk} increments @code{NR} and @code{FNR} each time it reads a record, instead of setting them to the absolute value of the number of records read. This means that a program can --- 10766,10780 ---- (@pxref{Options, ,Command-Line Options}), it is not special. @end table + @c ENDOFRANGE bvconi + @c ENDOFRANGE vbconi @c fakenode --- for prepinfo @subheading Advanced Notes: Changing @code{NR} and @code{FNR} ! @cindex @code{NR} variable, changing ! @cindex @code{FNR} variable, changing ! @cindex advanced features, @code{FNR}/@code{NR} variables ! @cindex dark corner, @code{FNR}/@code{NR} variables @command{awk} increments @code{NR} and @code{FNR} each time it reads a record, instead of setting them to the absolute value of the number of records read. This means that a program can *************** *** 10257,10262 **** --- 10804,10812 ---- @node ARGC and ARGV, , Auto-set, Built-in Variables @subsection Using @code{ARGC} and @code{ARGV} + @cindex @code{ARGC}/@code{ARGV} variables + @cindex arguments, command-line + @cindex command line, arguments @ref{Auto-set, ,Built-in Variables That Convey Information}, presented the following program describing the information contained in @code{ARGC} *************** *** 10355,10361 **** awk -f myprog -- -v -d file1 file2 @dots{} @end example ! @cindex differences between @command{gawk} and @command{awk} This is not necessary in @command{gawk}. Unless @option{--posix} has been specified, @command{gawk} silently puts any unrecognized options into @code{ARGV} for the @command{awk} program to deal with. As soon --- 10905,10911 ---- awk -f myprog -- -v -d file1 file2 @dots{} @end example ! @cindex differences in @command{awk} and @command{gawk}, @code{ARGC}/@code{ARGV} variables This is not necessary in @command{gawk}. Unless @option{--posix} has been specified, @command{gawk} silently puts any unrecognized options into @code{ARGV} for the @command{awk} program to deal with. As soon *************** *** 10374,10379 **** --- 10924,10931 ---- @node Arrays, Functions, Patterns and Actions, Top @chapter Arrays in @command{awk} + @c STARTOFRANGE arrs + @cindex arrays An @dfn{array} is a table of values called @dfn{elements}. The elements of an array are distinguished by their indices. @dfn{Indices} *************** *** 10387,10394 **** The @value{CHAPTER} finishes with a discussion of @command{gawk}'s facility for sorting an array based on its indices. ! @cindex names, use of ! @cindex namespace issues in @command{awk} @command{awk} maintains a single set of names that may be used for naming variables, arrays, and functions (@pxref{User-defined, ,User-Defined Functions}). --- 10939,10949 ---- The @value{CHAPTER} finishes with a discussion of @command{gawk}'s facility for sorting an array based on its indices. ! @cindex variables, names of ! @cindex functions, names of ! @cindex arrays, names of ! @cindex names, arrays/variables ! @cindex namespace issues @command{awk} maintains a single set of names that may be used for naming variables, arrays, and functions (@pxref{User-defined, ,User-Defined Functions}). *************** *** 10417,10423 **** @node Array Intro, Reference to Elements, Arrays, Arrays @section Introduction to Arrays - @cindex arrays The @command{awk} language provides one-dimensional arrays for storing groups of related strings or numbers. Every @command{awk} array must have a name. Array names have the same --- 10972,10977 ---- *************** *** 10480,10493 **** @noindent Only the values are stored; the indices are implicit from the order of ! the values. 8 is the value at index zero, because 8 appears in the position with zero elements before it. ! @cindex arrays, definition of @cindex associative arrays @cindex arrays, associative Arrays in @command{awk} are different---they are @dfn{associative}. This means ! that each array is a collection of pairs: an index, and its corresponding array element value: @example --- 11034,11050 ---- @noindent Only the values are stored; the indices are implicit from the order of ! the values. Here, 8 is the value at index zero, because 8 appears in the position with zero elements before it. ! @c STARTOFRANGE arrin ! @cindex arrays, indexing ! @c STARTOFRANGE inarr ! @cindex indexing arrays @cindex associative arrays @cindex arrays, associative Arrays in @command{awk} are different---they are @dfn{associative}. This means ! that each array is a collection of pairs: an index and its corresponding array element value: @example *************** *** 10521,10527 **** Another consequence of associative arrays is that the indices don't have to be positive integers. Any number, or even a string, can be an index. For example, the following is an array that translates words from ! English into French: @example @r{Element} "dog" @r{Value} "chien" --- 11078,11084 ---- Another consequence of associative arrays is that the indices don't have to be positive integers. Any number, or even a string, can be an index. For example, the following is an array that translates words from ! English to French: @example @r{Element} "dog" @r{Value} "chien" *************** *** 10540,10548 **** Here, the number @code{1} isn't double-quoted, since @command{awk} automatically converts it to a string. ! @cindex arrays, subscripts, and @code{IGNORECASE} ! @cindex @code{IGNORECASE}, and array subscripts ! @cindex @code{IGNORECASE} variable The value of @code{IGNORECASE} has no effect upon array subscripting. The identical string value used to store an array element must be used to retrieve it. --- 11097,11105 ---- Here, the number @code{1} isn't double-quoted, since @command{awk} automatically converts it to a string. ! @cindex case sensitivity, array indices and ! @cindex arrays, @code{IGNORECASE} variable and ! @cindex @code{IGNORECASE} variable, array subscripts and The value of @code{IGNORECASE} has no effect upon array subscripting. The identical string value used to store an array element must be used to retrieve it. *************** *** 10553,10564 **** @command{awk}'s arrays are efficient---the time to access an element is independent of the number of elements in the array. @node Reference to Elements, Assigning Elements, Array Intro, Arrays @section Referring to an Array Element ! @cindex array reference ! @cindex element of array ! @cindex reference to array The principal way to use an array is to refer to one of its elements. An array reference is an expression as follows: --- 11110,11122 ---- @command{awk}'s arrays are efficient---the time to access an element is independent of the number of elements in the array. + @c ENDOFRANGE arrin + @c ENDOFRANGE inarr @node Reference to Elements, Assigning Elements, Array Intro, Arrays @section Referring to an Array Element ! @cindex arrays, elements, referencing ! @cindex elements in arrays The principal way to use an array is to refer to one of its elements. An array reference is an expression as follows: *************** *** 10583,10590 **** (In some cases, this is unfortunate, because it might waste memory inside @command{awk}.) ! @cindex arrays, presence of elements ! @cindex arrays, the @code{in} operator To determine whether an element exists in an array at a certain index, use the following expression: --- 11141,11148 ---- (In some cases, this is unfortunate, because it might waste memory inside @command{awk}.) ! @c @cindex arrays, @code{in} operator and ! @cindex @code{in} operator, arrays and To determine whether an element exists in an array at a certain index, use the following expression: *************** *** 10592,10600 **** @var{index} in @var{array} @end example ! @cindex side effects @noindent ! This expression tests whether or not the particular index exists, without the side effect of creating that element if it is not present. The expression has the value one (true) if @code{@var{array}[@var{index}]} exists and zero (false) if it does not exist. --- 11150,11158 ---- @var{index} in @var{array} @end example ! @cindex side effects, array indexing @noindent ! This expression tests whether the particular index exists, without the side effect of creating that element if it is not present. The expression has the value one (true) if @code{@var{array}[@var{index}]} exists and zero (false) if it does not exist. *************** *** 10619,10626 **** @node Assigning Elements, Array Example, Reference to Elements, Arrays @section Assigning Array Elements ! @cindex array assignment ! @cindex element assignment Array elements can be assigned values just like @command{awk} variables: --- 11177,11184 ---- @node Assigning Elements, Array Example, Reference to Elements, Arrays @section Assigning Array Elements ! @cindex arrays, elements, assigning ! @cindex elements in arrays, assigning Array elements can be assigned values just like @command{awk} variables: *************** *** 10680,10686 **** @end example @noindent ! its output is: @example 1 Who is number one? --- 11238,11244 ---- @end example @noindent ! Its output is: @example 1 Who is number one? *************** *** 10705,10714 **** @node Scanning an Array, Delete, Array Example, Arrays @section Scanning All Elements of an Array ! @cindex @code{for (x in @dots{})} statement ! @cindex arrays, special @code{for} statement ! @cindex scanning an array ! @cindex @code{in} operator In programs that use arrays, it is often necessary to use a loop that executes once for each element of an array. In other languages, where --- 11263,11270 ---- @node Scanning an Array, Delete, Array Example, Arrays @section Scanning All Elements of an Array ! @cindex elements in arrays, scanning ! @cindex arrays, scanning In programs that use arrays, it is often necessary to use a loop that executes once for each element of an array. In other languages, where *************** *** 10725,10733 **** --- 11281,11292 ---- @end example @noindent + @cindex @code{in} operator, arrays and This loop executes @var{body} once for each index in @var{array} that the program has previously used, with the variable @var{var} set to that index. + @cindex arrays, @code{for} statement and + @cindex @code{for} statement, in arrays The following program uses this form of the @code{for} statement. The first rule scans the input records and notes which words appear (at least once) in the input, by storing a one into the array @code{used} with *************** *** 10760,10779 **** @xref{Word Sorting, ,Generating Word Usage Counts}, for a more detailed example of this type. The order in which elements of the array are accessed by this statement is determined by the internal arrangement of the array elements within @command{awk} and cannot be controlled or changed. This can lead to problems if new elements are added to @var{array} by statements in ! the loop body; it is not predictable whether or not the @code{for} loop will reach them. Similarly, changing @var{var} inside the loop may produce strange results. It is best to avoid such things. @node Delete, Numeric Array Subscripts, Scanning an Array, Arrays @section The @code{delete} Statement @cindex @code{delete} statement ! @cindex deleting elements of arrays ! @cindex removing elements of arrays ! @cindex arrays, deleting an element To remove an individual element of an array, use the @code{delete} statement: --- 11319,11340 ---- @xref{Word Sorting, ,Generating Word Usage Counts}, for a more detailed example of this type. + @cindex arrays, elements, order of + @cindex elements in arrays, order of The order in which elements of the array are accessed by this statement is determined by the internal arrangement of the array elements within @command{awk} and cannot be controlled or changed. This can lead to problems if new elements are added to @var{array} by statements in ! the loop body; it is not predictable whether the @code{for} loop will reach them. Similarly, changing @var{var} inside the loop may produce strange results. It is best to avoid such things. @node Delete, Numeric Array Subscripts, Scanning an Array, Arrays @section The @code{delete} Statement @cindex @code{delete} statement ! @cindex deleting elements in arrays ! @cindex arrays, elements, deleting ! @cindex elements in arrays, deleting To remove an individual element of an array, use the @code{delete} statement: *************** *** 10804,10809 **** --- 11365,11371 ---- print "This will never be printed" @end example + @cindex null strings, array elements and It is important to note that deleting an element is @emph{not} the same as assigning it a null value (the empty string, @code{""}). For example: *************** *** 10814,10820 **** print "This is printed, even though foo[4] is empty" @end example ! @cindex lint checks It is not an error to delete an element that does not exist. If @option{--lint} is provided on the command line (@pxref{Options, ,Command-Line Options}), --- 11376,11382 ---- print "This is printed, even though foo[4] is empty" @end example ! @cindex lint checking, array elements It is not an error to delete an element that does not exist. If @option{--lint} is provided on the command line (@pxref{Options, ,Command-Line Options}), *************** *** 10823,10829 **** @cindex arrays, deleting entire contents @cindex deleting entire arrays ! @cindex differences between @command{gawk} and @command{awk} All the elements of an array may be deleted with a single statement by leaving off the subscript in the @code{delete} statement, as follows: --- 11385,11391 ---- @cindex arrays, deleting entire contents @cindex deleting entire arrays ! @cindex differences in @command{awk} and @command{gawk}, array elements, deleting All the elements of an array may be deleted with a single statement by leaving off the subscript in the @code{delete} statement, as follows: *************** *** 10839,10853 **** more efficient than the equivalent loop that deletes each element one at a time. ! @cindex portability issues @cindex Brennan, Michael ! The following statement provides a portable but non-obvious way to clear out an array:@footnote{Thanks to Michael Brennan for pointing this out.} @example split("", array) @end example The @code{split} function (@pxref{String Functions, ,String Manipulation Functions}) clears out the target array first. This call asks it to split --- 11401,11417 ---- more efficient than the equivalent loop that deletes each element one at a time. ! @cindex portability, deleting array elements @cindex Brennan, Michael ! The following statement provides a portable but nonobvious way to clear out an array:@footnote{Thanks to Michael Brennan for pointing this out.} @example split("", array) @end example + @c comma before deleting does NOT start a tertiary + @cindex @code{split} function, array elements, deleting The @code{split} function (@pxref{String Functions, ,String Manipulation Functions}) clears out the target array first. This call asks it to split *************** *** 10865,10873 **** @node Numeric Array Subscripts, Uninitialized Subscripts, Delete, Arrays @section Using Numbers to Subscript Arrays ! @cindex conversions, during subscripting ! @cindex numbers, used as subscripts ! @cindex @code{CONVFMT} variable An important aspect about arrays to remember is that @emph{array subscripts are always strings}. When a numeric value is used as a subscript, it is converted to a string value before being used for subscripting --- 11429,11438 ---- @node Numeric Array Subscripts, Uninitialized Subscripts, Delete, Arrays @section Using Numbers to Subscript Arrays ! @cindex numbers, as array subscripts ! @cindex arrays, subscripts ! @cindex subscripts in arrays, numbers as ! @cindex @code{CONVFMT} variable, array subscripts and An important aspect about arrays to remember is that @emph{array subscripts are always strings}. When a numeric value is used as a subscript, it is converted to a string value before being used for subscripting *************** *** 10897,10902 **** --- 11462,11468 ---- @code{CONVFMT} only allows two significant digits. This test fails, since @code{"12.15"} is a different string from @code{"12.153"}. + @cindex converting, during subscripting According to the rules for conversions (@pxref{Conversion, ,Conversion of Strings and Numbers}), integer values are always converted to strings as integers, no matter what the *************** *** 10911,10918 **** The ``integer values always convert to strings as integers'' rule has an additional consequence for array indexing. Octal and hexadecimal constants ! (@pxref{Non-decimal-numbers, ,Octal and Hexadecimal Numbers}) ! are converted internally into numbers and their original form is forgotten. This means, for example, that @code{array[17]}, --- 11477,11484 ---- The ``integer values always convert to strings as integers'' rule has an additional consequence for array indexing. Octal and hexadecimal constants ! (@pxref{Nondecimal-numbers, ,Octal and Hexadecimal Numbers}) ! are converted internally into numbers, and their original form is forgotten. This means, for example, that @code{array[17]}, *************** *** 10929,10936 **** @node Uninitialized Subscripts, Multi-dimensional, Numeric Array Subscripts, Arrays @section Using Uninitialized Variables as Subscripts @cindex uninitialized variables, as array subscripts ! @cindex arrays, subscripts, uninitialized variables Suppose it's necessary to write a program to print the input data in reverse order. A reasonable attempt to do so (with some test --- 11495,11505 ---- @node Uninitialized Subscripts, Multi-dimensional, Numeric Array Subscripts, Arrays @section Using Uninitialized Variables as Subscripts + @c last comma does NOT start a tertiary + @cindex variables, uninitialized, as array subscripts @cindex uninitialized variables, as array subscripts ! @cindex subscripts in arrays, uninitialized variables as ! @cindex arrays, subscripts, uninitialized variables as Suppose it's necessary to write a program to print the input data in reverse order. A reasonable attempt to do so (with some test *************** *** 10973,10981 **** the ``old value'' numeric zero. This is then converted to @code{"0"} as the array subscript. ! @cindex null string, as array subscript ! @cindex dark corner ! @cindex lint checks Even though it is somewhat unusual, the null string (@code{""}) is a valid array subscript. @value{DARKCORNER} --- 11542,11550 ---- the ``old value'' numeric zero. This is then converted to @code{"0"} as the array subscript. ! @cindex null strings, as array subscripts ! @cindex dark corner, array subscripts ! @cindex lint checking, array subscripts Even though it is somewhat unusual, the null string (@code{""}) is a valid array subscript. @value{DARKCORNER} *************** *** 10986,10994 **** @node Multi-dimensional, Multi-scanning, Uninitialized Subscripts, Arrays @section Multidimensional Arrays ! @cindex subscripts in arrays ! @cindex arrays, multidimensional subscripts ! @cindex multidimensional subscripts A multidimensional array is an array in which an element is identified by a sequence of indices instead of a single index. For example, a two-dimensional array requires two indices. The usual way (in most --- 11555,11562 ---- @node Multi-dimensional, Multi-scanning, Uninitialized Subscripts, Arrays @section Multidimensional Arrays ! @cindex subscripts in arrays, multidimensional ! @cindex arrays, multidimensional A multidimensional array is an array in which an element is identified by a sequence of indices instead of a single index. For example, a two-dimensional array requires two indices. The usual way (in most *************** *** 10996,11002 **** two-dimensional array named @code{grid} is with @code{grid[@var{x},@var{y}]}. ! @cindex @code{SUBSEP} variable Multidimensional arrays are supported in @command{awk} through concatenation of indices into one string. @command{awk} converts the indices into strings --- 11564,11570 ---- two-dimensional array named @code{grid} is with @code{grid[@var{x},@var{y}]}. ! @cindex @code{SUBSEP} variable, multidimensional arrays Multidimensional arrays are supported in @command{awk} through concatenation of indices into one string. @command{awk} converts the indices into strings *************** *** 11019,11025 **** equivalent. The default value of @code{SUBSEP} is the string @code{"\034"}, ! which contains a non-printing character that is unlikely to appear in an @command{awk} program or in most input data. The usefulness of choosing an unlikely character comes from the fact that index values that contain a string matching @code{SUBSEP} can lead to --- 11587,11593 ---- equivalent. The default value of @code{SUBSEP} is the string @code{"\034"}, ! which contains a nonprinting character that is unlikely to appear in an @command{awk} program or in most input data. The usefulness of choosing an unlikely character comes from the fact that index values that contain a string matching @code{SUBSEP} can lead to *************** *** 11029,11035 **** stored as @samp{foo["a@@b@@c"]}. To test whether a particular index sequence exists in a ! ``multidimensional'' array, use the same operator (@samp{in}) that is used for single dimensional arrays. Write the whole sequence of indices in parentheses, separated by commas, as the left operand: --- 11597,11603 ---- stored as @samp{foo["a@@b@@c"]}. To test whether a particular index sequence exists in a ! multidimensional array, use the same operator (@samp{in}) that is used for single dimensional arrays. Write the whole sequence of indices in parentheses, separated by commas, as the left operand: *************** *** 11040,11046 **** The following example treats its input as a two-dimensional array of fields; it rotates this array 90 degrees clockwise and prints the result. It assumes that all lines have the same number of ! elements. @example @{ --- 11608,11614 ---- The following example treats its input as a two-dimensional array of fields; it rotates this array 90 degrees clockwise and prints the result. It assumes that all lines have the same number of ! elements: @example @{ *************** *** 11086,11095 **** @section Scanning Multidimensional Arrays There is no special @code{for} statement for scanning a ! ``multidimensional'' array. There cannot be one, because in truth there are no multidimensional arrays or elements---there is only a multidimensional @emph{way of accessing} an array. However, if your program has an array that is always accessed as multidimensional, you can get the effect of scanning it by combining the scanning @code{for} statement --- 11654,11665 ---- @section Scanning Multidimensional Arrays There is no special @code{for} statement for scanning a ! ``multidimensional'' array. There cannot be one, because, in truth, there are no multidimensional arrays or elements---there is only a multidimensional @emph{way of accessing} an array. + @cindex subscripts in arrays, multidimensional, scanning + @cindex arrays, multidimensional, scanning However, if your program has an array that is always accessed as multidimensional, you can get the effect of scanning it by combining the scanning @code{for} statement *************** *** 11132,11138 **** @section Sorting Array Values and Indices with @command{gawk} @cindex arrays, sorting ! @cindex @code{asort} built-in function The order in which an array is scanned with a @samp{for (i in array)} loop is essentially arbitrary. In most @command{awk} implementations, sorting an array requires --- 11702,11711 ---- @section Sorting Array Values and Indices with @command{gawk} @cindex arrays, sorting ! @cindex @code{asort} function (@command{gawk}) ! @c last comma does NOT start a tertiary ! @cindex @code{asort} function (@command{gawk}), arrays, sorting ! @cindex sort function, arrays, sorting The order in which an array is scanned with a @samp{for (i in array)} loop is essentially arbitrary. In most @command{awk} implementations, sorting an array requires *************** *** 11158,11164 **** using @command{gawk}'s usual comparison rules (@pxref{Typing and Comparison, ,Variable Typing and Comparison Expressions}). ! @cindex side effects An important side effect of calling @code{asort} is that @emph{the array's original indices are irrevocably lost}. As this isn't always desirable, @code{asort} accepts a --- 11731,11737 ---- using @command{gawk}'s usual comparison rules (@pxref{Typing and Comparison, ,Variable Typing and Comparison Expressions}). ! @cindex side effects, @code{asort} function An important side effect of calling @code{asort} is that @emph{the array's original indices are irrevocably lost}. As this isn't always desirable, @code{asort} accepts a *************** *** 11197,11203 **** To traverse the elements in decreasing order, use a loop that goes from @var{n} down to 1, either over the elements or over the indices. ! @cindex reference counting Copying array indices and elements isn't expensive in terms of memory. Internally, @command{gawk} maintains @dfn{reference counts} to data. For example, when @code{asort} copies the first array to the second one, --- 11770,11776 ---- To traverse the elements in decreasing order, use a loop that goes from @var{n} down to 1, either over the elements or over the indices. ! @cindex reference counting, sorting arrays Copying array indices and elements isn't expensive in terms of memory. Internally, @command{gawk} maintains @dfn{reference counts} to data. For example, when @code{asort} copies the first array to the second one, *************** *** 11206,11225 **** @code{data} to @code{ind}, there is only one copy of the actual index strings. ! @cindex arrays, sorting and @code{IGNORECASE} ! @cindex @code{IGNORECASE}, and array sorting ! @cindex @code{IGNORECASE} variable As with array subscripts, the value of @code{IGNORECASE} does not affect array sorting. @node Functions, Internationalization, Arrays, Top @chapter Functions This @value{CHAPTER} describes @command{awk}'s built-in functions, which fall into three categories: numeric, string, and I/O. @command{gawk} provides additional groups of functions to work with values that represent time, do ! bit manipulation, and to internationalize and localize programs. Besides the built-in functions, @command{awk} has provisions for writing new functions that the rest of a program can use. --- 11779,11802 ---- @code{data} to @code{ind}, there is only one copy of the actual index strings. ! @cindex arrays, sorting, @code{IGNORECASE} variable and ! @cindex @code{IGNORECASE} variable, array sorting and As with array subscripts, the value of @code{IGNORECASE} does not affect array sorting. + @c ENDOFRANGE arrs @node Functions, Internationalization, Arrays, Top @chapter Functions + @c STARTOFRANGE funcbi + @cindex functions, built-in + @c STARTOFRANGE bifunc + @cindex built-in functions This @value{CHAPTER} describes @command{awk}'s built-in functions, which fall into three categories: numeric, string, and I/O. @command{gawk} provides additional groups of functions to work with values that represent time, do ! bit manipulation, and internationalize and localize programs. Besides the built-in functions, @command{awk} has provisions for writing new functions that the rest of a program can use. *************** *** 11235,11241 **** @section Built-in Functions @c 2e: USE TEXINFO-2 FUNCTION DEFINITION STUFF!!!!!!!!!!!!! - @cindex built-in functions @dfn{Built-in} functions are always available for your @command{awk} program to call. This @value{SECTION} defines all the built-in --- 11812,11817 ---- *************** *** 11260,11277 **** To call one of @command{awk}'s built-in functions, write the name of the function followed by arguments in parentheses. For example, @samp{atan2(y + z, 1)} ! is a call to the function @code{atan2}, and has two arguments. ! @cindex conventions, programming ! @cindex programming conventions Whitespace is ignored between the built-in function name and the open parenthesis, and it is good practice to avoid using whitespace there. User-defined functions do not permit whitespace in this way, and it is easier to avoid mistakes by following a simple convention that always works---no whitespace after a function name. ! @cindex fatal errors ! @cindex differences between @command{gawk} and @command{awk} Each built-in function accepts a certain number of arguments. In some cases, arguments can be omitted. The defaults for omitted arguments vary from function to function and are described under the --- 11836,11856 ---- To call one of @command{awk}'s built-in functions, write the name of the function followed by arguments in parentheses. For example, @samp{atan2(y + z, 1)} ! is a call to the function @code{atan2} and has two arguments. ! @cindex programming conventions, functions, calling ! @c last comma does NOT start a tertiary ! @cindex whitespace, functions, calling Whitespace is ignored between the built-in function name and the open parenthesis, and it is good practice to avoid using whitespace there. User-defined functions do not permit whitespace in this way, and it is easier to avoid mistakes by following a simple convention that always works---no whitespace after a function name. ! @c last comma is part of tertiary ! @cindex troubleshooting, @command{gawk}, fatal errors, function arguments ! @cindex @command{gawk}, function arguments and ! @cindex differences in @command{awk} and @command{gawk}, function arguments (@command{gawk}) Each built-in function accepts a certain number of arguments. In some cases, arguments can be omitted. The defaults for omitted arguments vary from function to function and are described under the *************** *** 11288,11295 **** j = sqrt(i++) @end example ! @cindex evaluation, order of ! @cindex order of evaluation @noindent the variable @code{i} is incremented to the value five before @code{sqrt} is called with a value of four for its actual parameter. --- 11867,11875 ---- j = sqrt(i++) @end example ! @cindex evaluation order, functions ! @cindex functions, built-in, evaluation order ! @cindex built-in functions, evaluation order @noindent the variable @code{i} is incremented to the value five before @code{sqrt} is called with a value of four for its actual parameter. *************** *** 11304,11310 **** @end example If the order of evaluation is left to right, then @code{i} first becomes ! six, and then 12, and @code{atan2} is called with the two arguments 6 and 12. But if the order of evaluation is right to left, @code{i} first becomes 10, then 11, and @code{atan2} is called with the two arguments 11 and 10. --- 11884,11890 ---- @end example If the order of evaluation is left to right, then @code{i} first becomes ! 6, and then 12, and @code{atan2} is called with the two arguments 6 and 12. But if the order of evaluation is right to left, @code{i} first becomes 10, then 11, and @code{atan2} is called with the two arguments 11 and 10. *************** *** 11314,11361 **** The following list describes all of the built-in functions that work with numbers. ! Optional parameters are enclosed in square brackets ([ and ]): @table @code @item int(@var{x}) ! @cindex @code{int} built-in function This returns the nearest integer to @var{x}, located between @var{x} and zero and truncated toward zero. ! For example, @code{int(3)} is three, @code{int(3.9)} is three, @code{int(-3.9)} is @minus{}3, and @code{int(-3)} is @minus{}3 as well. @item sqrt(@var{x}) ! @cindex @code{sqrt} built-in function This returns the positive square root of @var{x}. @command{gawk} reports an error ! if @var{x} is negative. Thus, @code{sqrt(4)} is two. @item exp(@var{x}) ! @cindex @code{exp} built-in function This returns the exponential of @var{x} (@code{e ^ @var{x}}) or reports an error if @var{x} is out of range. The range of values @var{x} can have depends on your machine's floating-point representation. @item log(@var{x}) ! @cindex @code{log} built-in function This returns the natural logarithm of @var{x}, if @var{x} is positive; otherwise, it reports an error. @item sin(@var{x}) ! @cindex @code{sin} built-in function This returns the sine of @var{x}, with @var{x} in radians. @item cos(@var{x}) ! @cindex @code{cos} built-in function This returns the cosine of @var{x}, with @var{x} in radians. @item atan2(@var{y}, @var{x}) ! @cindex @code{atan2} built-in function This returns the arctangent of @code{@var{y} / @var{x}} in radians. @item rand() ! @cindex @code{rand} built-in function This returns a random number. The values of @code{rand} are uniformly distributed between zero and one. The value is never zero and never one.@footnote{The C version of @code{rand} --- 11894,11942 ---- The following list describes all of the built-in functions that work with numbers. ! Optional parameters are enclosed in square brackets ([ ]): @table @code @item int(@var{x}) ! @cindex @code{int} function This returns the nearest integer to @var{x}, located between @var{x} and zero and truncated toward zero. ! For example, @code{int(3)} is 3, @code{int(3.9)} is 3, @code{int(-3.9)} is @minus{}3, and @code{int(-3)} is @minus{}3 as well. @item sqrt(@var{x}) ! @cindex @code{sqrt} function This returns the positive square root of @var{x}. @command{gawk} reports an error ! if @var{x} is negative. Thus, @code{sqrt(4)} is 2. @item exp(@var{x}) ! @cindex @code{exp} function This returns the exponential of @var{x} (@code{e ^ @var{x}}) or reports an error if @var{x} is out of range. The range of values @var{x} can have depends on your machine's floating-point representation. @item log(@var{x}) ! @cindex @code{log} function This returns the natural logarithm of @var{x}, if @var{x} is positive; otherwise, it reports an error. @item sin(@var{x}) ! @cindex @code{sin} function This returns the sine of @var{x}, with @var{x} in radians. @item cos(@var{x}) ! @cindex @code{cos} function This returns the cosine of @var{x}, with @var{x} in radians. @item atan2(@var{y}, @var{x}) ! @cindex @code{atan2} function This returns the arctangent of @code{@var{y} / @var{x}} in radians. @item rand() ! @cindex @code{rand} function ! @cindex random numbers, @code{rand}/@code{srand} functions This returns a random number. The values of @code{rand} are uniformly distributed between zero and one. The value is never zero and never one.@footnote{The C version of @code{rand} *************** *** 11381,11387 **** The following example uses a similar function to produce random integers between one and @var{n}. This program prints a new random number for ! each input record. @example # Function to roll a simulated die. --- 11962,11968 ---- The following example uses a similar function to produce random integers between one and @var{n}. This program prints a new random number for ! each input record: @example # Function to roll a simulated die. *************** *** 11395,11401 **** @} @end example ! @cindex seed for random numbers @cindex random numbers, seed of @c MAWK uses a different seed each time. @strong{Caution:} In most @command{awk} implementations, including @command{gawk}, --- 11976,11982 ---- @} @end example ! @cindex numbers, random @cindex random numbers, seed of @c MAWK uses a different seed each time. @strong{Caution:} In most @command{awk} implementations, including @command{gawk}, *************** *** 11409,11427 **** use @code{srand}. @item srand(@r{[}@var{x}@r{]}) ! @cindex @code{srand} built-in function The function @code{srand} sets the starting point, or seed, for generating random numbers to the value @var{x}. Each seed value leads to a particular sequence of random ! numbers.@footnote{Computer generated random numbers really are not truly ! random. They are technically known as ``pseudo-random.'' This means that while the numbers in a sequence appear to be random, you can in fact generate the same sequence of random numbers over and over again.} Thus, if the seed is set to the same value a second time, the same sequence of random numbers is produced again. ! Different @command{awk} implementations use different random number generators internally. Don't expect the same @command{awk} program to produce the same series of random numbers when executed by different versions of @command{awk}. --- 11990,12008 ---- use @code{srand}. @item srand(@r{[}@var{x}@r{]}) ! @cindex @code{srand} function The function @code{srand} sets the starting point, or seed, for generating random numbers to the value @var{x}. Each seed value leads to a particular sequence of random ! numbers.@footnote{Computer-generated random numbers really are not truly ! random. They are technically known as ``pseudorandom.'' This means that while the numbers in a sequence appear to be random, you can in fact generate the same sequence of random numbers over and over again.} Thus, if the seed is set to the same value a second time, the same sequence of random numbers is produced again. ! Different @command{awk} implementations use different random-number generators internally. Don't expect the same @command{awk} program to produce the same series of random numbers when executed by different versions of @command{awk}. *************** *** 11436,11446 **** @end table @node String Functions, I/O Functions, Numeric Functions, Built-in ! @subsection String Manipulation Functions The functions in this @value{SECTION} look at or change the text of one or more strings. ! Optional parameters are enclosed in square brackets ([ and ]). Those functions that are specific to @command{gawk} are marked with a pound sign (@samp{#}): --- 12017,12027 ---- @end table @node String Functions, I/O Functions, Numeric Functions, Built-in ! @subsection String-Manipulation Functions The functions in this @value{SECTION} look at or change the text of one or more strings. ! Optional parameters are enclosed in square brackets ([ ]). Those functions that are specific to @command{gawk} are marked with a pound sign (@samp{#}): *************** *** 11452,11458 **** @table @code @item asort(@var{source} @r{[}, @var{dest}@r{]}) # ! @cindex @code{asort} built-in function @code{asort} is a @command{gawk}-specific extension, returning the number of elements in the array @var{source}. The contents of @var{source} are sorted using @command{gawk}'s normal rules for comparing values, and the indices --- 12033,12040 ---- @table @code @item asort(@var{source} @r{[}, @var{dest}@r{]}) # ! @cindex arrays, elements, retrieving number of ! @cindex @code{asort} function (@command{gawk}) @code{asort} is a @command{gawk}-specific extension, returning the number of elements in the array @var{source}. The contents of @var{source} are sorted using @command{gawk}'s normal rules for comparing values, and the indices *************** *** 11484,11497 **** a[3] = "sac" @end example - @cindex differences between @command{gawk} and @command{awk} The @code{asort} function is described in more detail in @ref{Array Sorting, ,Sorting Array Values and Indices with @command{gawk}}. @code{asort} is a @command{gawk} extension; it is not available in compatibility mode (@pxref{Options, ,Command-Line Options}). @item index(@var{in}, @var{find}) ! @cindex @code{index} built-in function This searches the string @var{in} for the first occurrence of the string @var{find}, and returns the position in characters where that occurrence begins in the string @var{in}. Consider the following example: --- 12066,12079 ---- a[3] = "sac" @end example The @code{asort} function is described in more detail in @ref{Array Sorting, ,Sorting Array Values and Indices with @command{gawk}}. @code{asort} is a @command{gawk} extension; it is not available in compatibility mode (@pxref{Options, ,Command-Line Options}). @item index(@var{in}, @var{find}) ! @cindex @code{index} function ! @cindex searching This searches the string @var{in} for the first occurrence of the string @var{find}, and returns the position in characters where that occurrence begins in the string @var{in}. Consider the following example: *************** *** 11506,11512 **** (Remember that string indices in @command{awk} start at one.) @item length(@r{[}@var{string}@r{]}) ! @cindex @code{length} built-in function This returns the number of characters in @var{string}. If @var{string} is a number, the length of the digit string representing that number is returned. For example, @code{length("abcde")} is 5. By --- 12088,12094 ---- (Remember that string indices in @command{awk} start at one.) @item length(@r{[}@var{string}@r{]}) ! @cindex @code{length} function This returns the number of characters in @var{string}. If @var{string} is a number, the length of the digit string representing that number is returned. For example, @code{length("abcde")} is 5. By *************** *** 11516,11525 **** If no argument is supplied, @code{length} returns the length of @code{$0}. ! @cindex historical features ! @cindex portability issues ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} @strong{Note:} In older versions of @command{awk}, the @code{length} function could be called --- 12098,12106 ---- If no argument is supplied, @code{length} returns the length of @code{$0}. ! @c @cindex historical features ! @cindex portability, @code{length} function ! @cindex POSIX @command{awk}, functions and, @code{length} @strong{Note:} In older versions of @command{awk}, the @code{length} function could be called *************** *** 11530,11540 **** always supply the parentheses. @item match(@var{string}, @var{regexp} @r{[}, @var{array}@r{]}) ! @cindex @code{match} built-in function The @code{match} function searches @var{string} for the ! longest leftmost substring matched by the regular expression, @var{regexp}. It returns the character position, or @dfn{index}, ! where that substring begins (one, if it starts at the beginning of @var{string}). If no match is found, it returns zero. The order of the first two arguments is backwards from most other string --- 12111,12121 ---- always supply the parentheses. @item match(@var{string}, @var{regexp} @r{[}, @var{array}@r{]}) ! @cindex @code{match} function The @code{match} function searches @var{string} for the ! longest, leftmost substring matched by the regular expression, @var{regexp}. It returns the character position, or @dfn{index}, ! at which that substring begins (one, if it starts at the beginning of @var{string}). If no match is found, it returns zero. The order of the first two arguments is backwards from most other string *************** *** 11543,11550 **** for @code{match}, the order is the same as for the @samp{~} operator: @samp{@var{string} ~ @var{regexp}}. ! @cindex @code{RSTART} variable ! @cindex @code{RLENGTH} variable The @code{match} function sets the built-in variable @code{RSTART} to the index. It also sets the built-in variable @code{RLENGTH} to the length in characters of the matched substring. If no match is found, --- 12124,12132 ---- for @code{match}, the order is the same as for the @samp{~} operator: @samp{@var{string} ~ @var{regexp}}. ! @cindex @code{RSTART} variable, @code{match} function and ! @cindex @code{RLENGTH} variable, @code{match} function and ! @cindex @code{match} function, @code{RSTART}/@code{RLENGTH} variables The @code{match} function sets the built-in variable @code{RSTART} to the index. It also sets the built-in variable @code{RLENGTH} to the length in characters of the matched substring. If no match is found, *************** *** 11593,11632 **** Match of Melvin found at 1 in Melvin was here. @end example ! @cindex differences between @command{gawk} and @command{awk} ! If @var{array} is present, it is cleared, and then the 0'th element of @var{array} is set to the entire portion of @var{string} matched by @var{regexp}. If @var{regexp} contains parentheses, the integer-indexed elements of @var{array} are set to contain the portion of @var{string} matching the corresponding parenthesized ! sub-expression. For example: @example $ echo foooobazbarrrrr | ! > gawk '@{ match($0, /(fo+).+(ba*r)/, arr) > print arr[1], arr[2] @}' @print{} foooo barrrrr @end example ! @cindex fatal errors The @var{array} argument to @code{match} is a @command{gawk} extension. In compatibility mode (@pxref{Options, ,Command-Line Options}), using a third argument is a fatal error. @item split(@var{string}, @var{array} @r{[}, @var{fieldsep}@r{]}) ! @cindex @code{split} built-in function ! This function divides @var{string} into pieces separated by @var{fieldsep}, and stores the pieces in @var{array}. The first piece is stored in @code{@var{array}[1]}, the second piece in @code{@var{array}[2]}, and so forth. The string value of the third argument, @var{fieldsep}, is a regexp describing where to split @var{string} (much as @code{FS} can be a regexp describing where to split input records). If ! the @var{fieldsep} is omitted, the value of @code{FS} is used. @code{split} returns the number of elements created. - If @var{string} does not match @var{fieldsep}, @var{array} is empty - and @code{split} returns zero. The @code{split} function splits strings into pieces in a manner similar to the way input lines are split into fields. For example: --- 12175,12212 ---- Match of Melvin found at 1 in Melvin was here. @end example ! @cindex differences in @command{awk} and @command{gawk}, @code{match} function ! If @var{array} is present, it is cleared, and then the 0th element of @var{array} is set to the entire portion of @var{string} matched by @var{regexp}. If @var{regexp} contains parentheses, the integer-indexed elements of @var{array} are set to contain the portion of @var{string} matching the corresponding parenthesized ! subexpression. For example: @example $ echo foooobazbarrrrr | ! > gawk '@{ match($0, /(fo+).+(bar*)/, arr) > print arr[1], arr[2] @}' @print{} foooo barrrrr @end example ! @cindex troubleshooting, @code{match} function The @var{array} argument to @code{match} is a @command{gawk} extension. In compatibility mode (@pxref{Options, ,Command-Line Options}), using a third argument is a fatal error. @item split(@var{string}, @var{array} @r{[}, @var{fieldsep}@r{]}) ! @cindex @code{split} function ! This function divides @var{string} into pieces separated by @var{fieldsep} and stores the pieces in @var{array}. The first piece is stored in @code{@var{array}[1]}, the second piece in @code{@var{array}[2]}, and so forth. The string value of the third argument, @var{fieldsep}, is a regexp describing where to split @var{string} (much as @code{FS} can be a regexp describing where to split input records). If ! @var{fieldsep} is omitted, the value of @code{FS} is used. @code{split} returns the number of elements created. The @code{split} function splits strings into pieces in a manner similar to the way input lines are split into fields. For example: *************** *** 11636,11641 **** --- 12216,12222 ---- @end example @noindent + @cindex strings, splitting splits the string @samp{cul-de-sac} into three fields using @samp{-} as the separator. It sets the contents of the array @code{a} as follows: *************** *** 11648,11662 **** @noindent The value returned by this call to @code{split} is three. ! @cindex differences between @command{gawk} and @command{awk} As with input field-splitting, when the value of @var{fieldsep} is ! @w{@code{" "}}, leading and trailing whitespace is ignored and the elements are separated by runs of whitespace. Also as with input field-splitting, if @var{fieldsep} is the null string, each individual character in the string is split into its own array element. (This is a @command{gawk}-specific extension.) ! @cindex dark corner Modern implementations of @command{awk}, including @command{gawk}, allow the third argument to be a regexp constant (@code{/abc/}) as well as a string. --- 12229,12243 ---- @noindent The value returned by this call to @code{split} is three. ! @cindex differences in @command{awk} and @command{gawk}, @code{split} function As with input field-splitting, when the value of @var{fieldsep} is ! @w{@code{" "}}, leading and trailing whitespace is ignored, and the elements are separated by runs of whitespace. Also as with input field-splitting, if @var{fieldsep} is the null string, each individual character in the string is split into its own array element. (This is a @command{gawk}-specific extension.) ! @cindex dark corner, @code{split} function Modern implementations of @command{awk}, including @command{gawk}, allow the third argument to be a regexp constant (@code{/abc/}) as well as a string. *************** *** 11669,11675 **** one element only. The value of that element is the original @var{string}. @item sprintf(@var{format}, @var{expression1}, @dots{}) ! @cindex @code{sprintf} built-in function This returns (without printing) the string that @code{printf} would have printed out with the same arguments (@pxref{Printf, ,Using @code{printf} Statements for Fancier Printing}). --- 12250,12256 ---- one element only. The value of that element is the original @var{string}. @item sprintf(@var{format}, @var{expression1}, @dots{}) ! @cindex @code{sprintf} function This returns (without printing) the string that @code{printf} would have printed out with the same arguments (@pxref{Printf, ,Using @code{printf} Statements for Fancier Printing}). *************** *** 11682,11688 **** @noindent assigns the string @w{@code{"pi = 3.14 (approx.)"}} to the variable @code{pival}. ! @cindex @code{strtonum} built-in function @item strtonum(@var{str}) # Examines @var{str} and returns its numeric value. If @var{str} begins with a leading @samp{0}, @code{strtonum} assumes that @var{str} --- 12263,12270 ---- @noindent assigns the string @w{@code{"pi = 3.14 (approx.)"}} to the variable @code{pival}. ! @cindex differences in @command{awk} and @command{gawk}, @code{strtonum} function (@command{gawk}) ! @cindex @code{strtonum} function (@command{gawk}) @item strtonum(@var{str}) # Examines @var{str} and returns its numeric value. If @var{str} begins with a leading @samp{0}, @code{strtonum} assumes that @var{str} *************** *** 11700,11716 **** to a string value; the automatic coercion of strings to numbers works only for decimal data, not for octal or hexadecimal.@footnote{Unless you use the @option{--non-decimal-data} option, which isn't recommended. ! @xref{Non-decimal Data, ,Allowing Non-Decimal Input Data}, for more information.} ! @cindex differences between @command{gawk} and @command{awk} @code{strtonum} is a @command{gawk} extension; it is not available in compatibility mode (@pxref{Options, ,Command-Line Options}). @item sub(@var{regexp}, @var{replacement} @r{[}, @var{target}@r{]}) ! @cindex @code{sub} built-in function The @code{sub} function alters the value of @var{target}. It searches this value, which is treated as a string, for the ! leftmost longest substring matched by the regular expression @var{regexp}. Then the entire string is changed by replacing the matched text with @var{replacement}. The modified string becomes the new value of @var{target}. --- 12282,12298 ---- to a string value; the automatic coercion of strings to numbers works only for decimal data, not for octal or hexadecimal.@footnote{Unless you use the @option{--non-decimal-data} option, which isn't recommended. ! @xref{Nondecimal Data, ,Allowing Nondecimal Input Data}, for more information.} ! @cindex differences in @command{awk} and @command{gawk}, @code{strtonum} function (@command{gawk}) @code{strtonum} is a @command{gawk} extension; it is not available in compatibility mode (@pxref{Options, ,Command-Line Options}). @item sub(@var{regexp}, @var{replacement} @r{[}, @var{target}@r{]}) ! @cindex @code{sub} function The @code{sub} function alters the value of @var{target}. It searches this value, which is treated as a string, for the ! leftmost, longest substring matched by the regular expression @var{regexp}. Then the entire string is changed by replacing the matched text with @var{replacement}. The modified string becomes the new value of @var{target}. *************** *** 11758,11764 **** @end example @noindent ! This shows how @samp{&} can represent a non-constant string and also illustrates the ``leftmost, longest'' rule in regexp matching (@pxref{Leftmost Longest, ,How Much Text Matches?}). --- 12340,12346 ---- @end example @noindent ! This shows how @samp{&} can represent a nonconstant string and also illustrates the ``leftmost, longest'' rule in regexp matching (@pxref{Leftmost Longest, ,How Much Text Matches?}). *************** *** 11766,11780 **** backslash before it in the string. As usual, to insert one backslash in the string, you must write two backslashes. Therefore, write @samp{\\&} in a string constant to include a literal @samp{&} in the replacement. ! For example, following is shown how to replace the first @samp{|} on each line with an @samp{&}: @example @{ sub(/\|/, "\\&"); print @} @end example ! @cindex @code{sub}, third argument of ! @cindex @code{gsub}, third argument of As mentioned, the third argument to @code{sub} must be a variable, field or array reference. Some versions of @command{awk} allow the third argument to --- 12348,12362 ---- backslash before it in the string. As usual, to insert one backslash in the string, you must write two backslashes. Therefore, write @samp{\\&} in a string constant to include a literal @samp{&} in the replacement. ! For example, the following shows how to replace the first @samp{|} on each line with an @samp{&}: @example @{ sub(/\|/, "\\&"); print @} @end example ! @cindex @code{sub} function, arguments of ! @cindex @code{gsub} function, arguments of As mentioned, the third argument to @code{sub} must be a variable, field or array reference. Some versions of @command{awk} allow the third argument to *************** *** 11789,11797 **** @end example @noindent ! @cindex fatal errors For historical compatibility, @command{gawk} accepts erroneous code, ! such as in the previous example. However, using any other non-changeable object as the third parameter causes a fatal error and your program will not run. --- 12371,12379 ---- @end example @noindent ! @cindex troubleshooting, @code{gsub}/@code{sub} functions For historical compatibility, @command{gawk} accepts erroneous code, ! such as in the previous example. However, using any other nonchangeable object as the third parameter causes a fatal error and your program will not run. *************** *** 11799,11807 **** string, and then the value of that string is treated as the regexp to match. @item gsub(@var{regexp}, @var{replacement} @r{[}, @var{target}@r{]}) ! @cindex @code{gsub} built-in function This is similar to the @code{sub} function, except @code{gsub} replaces ! @emph{all} of the longest, leftmost, @emph{non-overlapping} matching substrings it can find. The @samp{g} in @code{gsub} stands for ``global,'' which means replace everywhere. For example: --- 12381,12389 ---- string, and then the value of that string is treated as the regexp to match. @item gsub(@var{regexp}, @var{replacement} @r{[}, @var{target}@r{]}) ! @cindex @code{gsub} function This is similar to the @code{sub} function, except @code{gsub} replaces ! @emph{all} of the longest, leftmost, @emph{nonoverlapping} matching substrings it can find. The @samp{g} in @code{gsub} stands for ``global,'' which means replace everywhere. For example: *************** *** 11820,11826 **** and the third argument must be assignable. @item gensub(@var{regexp}, @var{replacement}, @var{how} @r{[}, @var{target}@r{]}) # ! @cindex @code{gensub} built-in function @code{gensub} is a general substitution function. Like @code{sub} and @code{gsub}, it searches the target string @var{target} for matches of the regular expression @var{regexp}. Unlike @code{sub} and @code{gsub}, --- 12402,12408 ---- and the third argument must be assignable. @item gensub(@var{regexp}, @var{replacement}, @var{how} @r{[}, @var{target}@r{]}) # ! @cindex @code{gensub} function (@command{gawk}) @code{gensub} is a general substitution function. Like @code{sub} and @code{gsub}, it searches the target string @var{target} for matches of the regular expression @var{regexp}. Unlike @code{sub} and @code{gsub}, *************** *** 11851,11857 **** @noindent As with @code{sub}, you must type two backslashes in order to get one into the string. - In the replacement text, the sequence @samp{\0} represents the entire matched text, as does the character @samp{&}. --- 12433,12438 ---- *************** *** 11868,11875 **** @code{gensub} returns the new string as its result, which is passed directly to @code{print} for printing. ! @cindex automatic warnings ! @cindex warnings, automatic If the @var{how} argument is a string that does not begin with @samp{g} or @samp{G}, or if it is a number that is less than or equal to zero, only one substitution is performed. If @var{how} is zero, @command{gawk} issues --- 12449,12456 ---- @code{gensub} returns the new string as its result, which is passed directly to @code{print} for printing. ! @c @cindex automatic warnings ! @c @cindex warnings, automatic If the @var{how} argument is a string that does not begin with @samp{g} or @samp{G}, or if it is a number that is less than or equal to zero, only one substitution is performed. If @var{how} is zero, @command{gawk} issues *************** *** 11878,11893 **** If @var{regexp} does not match @var{target}, @code{gensub}'s return value is the original unchanged value of @var{target}. - @cindex differences between @command{gawk} and @command{awk} @code{gensub} is a @command{gawk} extension; it is not available in compatibility mode (@pxref{Options, ,Command-Line Options}). @item substr(@var{string}, @var{start} @r{[}, @var{length}@r{]}) ! @cindex @code{substr} built-in function This returns a @var{length}-character-long substring of @var{string}, starting at character number @var{start}. The first character of a string is character number one.@footnote{This is different from ! C and C++, where the first character is number zero.} For example, @code{substr("washington", 5, 3)} returns @code{"ing"}. If @var{length} is not present, this function returns the whole suffix of --- 12459,12473 ---- If @var{regexp} does not match @var{target}, @code{gensub}'s return value is the original unchanged value of @var{target}. @code{gensub} is a @command{gawk} extension; it is not available in compatibility mode (@pxref{Options, ,Command-Line Options}). @item substr(@var{string}, @var{start} @r{[}, @var{length}@r{]}) ! @cindex @code{substr} function This returns a @var{length}-character-long substring of @var{string}, starting at character number @var{start}. The first character of a string is character number one.@footnote{This is different from ! C and C++, in which the first character is number zero.} For example, @code{substr("washington", 5, 3)} returns @code{"ing"}. If @var{length} is not present, this function returns the whole suffix of *************** *** 11895,11905 **** @code{substr("washington", 5)} returns @code{"ington"}. The whole suffix is also returned if @var{length} is greater than the number of characters remaining ! in the string, counting from character number @var{start}. ! @cindex common mistakes ! @cindex mistakes, common ! @cindex errors, common The string returned by @code{substr} @emph{cannot} be assigned. Thus, it is a mistake to attempt to change a portion of a string, as shown in the following example: --- 12475,12488 ---- @code{substr("washington", 5)} returns @code{"ington"}. The whole suffix is also returned if @var{length} is greater than the number of characters remaining ! in the string, counting from character @var{start}. ! If @var{start} is less than one or greater than the number of characters ! in the string, @code{substr} returns the null string. ! Similarly, if @var{length} is present but less than or equal to zero, ! the null string is returned. ! ! @cindex troubleshooting, @code{substr} function The string returned by @code{substr} @emph{cannot} be assigned. Thus, it is a mistake to attempt to change a portion of a string, as shown in the following example: *************** *** 11918,11924 **** gsub(/xyz/, "pdq", substr($0, 5, 20)) # WRONG @end example ! @cindex portability issues (Some commercial versions of @command{awk} do in fact let you use @code{substr} this way, but doing so is not portable.) --- 12501,12507 ---- gsub(/xyz/, "pdq", substr($0, 5, 20)) # WRONG @end example ! @cindex portability, @code{substr} function (Some commercial versions of @command{awk} do in fact let you use @code{substr} this way, but doing so is not portable.) *************** *** 11931,11960 **** string = substr(string, 1, 2) "CDE" substr(string, 6) @end example ! @cindex case conversion ! @cindex conversion of case @item tolower(@var{string}) ! @cindex @code{tolower} built-in function This returns a copy of @var{string}, with each uppercase character in the string replaced with its corresponding lowercase character. ! Non-alphabetic characters are left unchanged. For example, @code{tolower("MiXeD cAsE 123")} returns @code{"mixed case 123"}. @item toupper(@var{string}) ! @cindex @code{toupper} built-in function This returns a copy of @var{string}, with each lowercase character in the string replaced with its corresponding uppercase character. ! Non-alphabetic characters are left unchanged. For example, @code{toupper("MiXeD cAsE 123")} returns @code{"MIXED CASE 123"}. @end table @node Gory Details, , String Functions, String Functions @subsubsection More About @samp{\} and @samp{&} with @code{sub}, @code{gsub}, and @code{gensub} ! @cindex escape processing, @code{sub} et. al. ! @cindex @code{sub}, escape processing ! @cindex @code{gsub}, escape processing ! @cindex @code{gensub}, escape processing When using @code{sub}, @code{gsub}, or @code{gensub}, and trying to get literal backslashes and ampersands into the replacement text, you need to remember that there are several levels of @dfn{escape processing} going on. --- 12514,12547 ---- string = substr(string, 1, 2) "CDE" substr(string, 6) @end example ! @cindex case sensitivity, converting case ! @cindex converting, case @item tolower(@var{string}) ! @cindex @code{tolower} function This returns a copy of @var{string}, with each uppercase character in the string replaced with its corresponding lowercase character. ! Nonalphabetic characters are left unchanged. For example, @code{tolower("MiXeD cAsE 123")} returns @code{"mixed case 123"}. @item toupper(@var{string}) ! @cindex @code{toupper} function This returns a copy of @var{string}, with each lowercase character in the string replaced with its corresponding uppercase character. ! Nonalphabetic characters are left unchanged. For example, @code{toupper("MiXeD cAsE 123")} returns @code{"MIXED CASE 123"}. @end table @node Gory Details, , String Functions, String Functions @subsubsection More About @samp{\} and @samp{&} with @code{sub}, @code{gsub}, and @code{gensub} ! @cindex escape processing, @code{gsub}/@code{gensub}/@code{sub} functions ! @cindex @code{sub} function, escape processing ! @cindex @code{gsub} function, escape processing ! @cindex @code{gensub} function (@command{gawk}), escape processing ! @cindex @code{\} (backslash), @code{gsub}/@code{gensub}/@code{sub} functions and ! @cindex backslash (@code{\}), @code{gsub}/@code{gensub}/@code{sub} functions and ! @cindex @code{&} (ampersand), @code{gsub}/@code{gensub}/@code{sub} functions and ! @cindex ampersand (@code{&}), @code{gsub}/@code{gensub}/@code{sub} functions and When using @code{sub}, @code{gsub}, or @code{gensub}, and trying to get literal backslashes and ampersands into the replacement text, you need to remember that there are several levels of @dfn{escape processing} going on. *************** *** 12021,12034 **** This table shows both the lexical-level processing, where an odd number of backslashes becomes an even number at the runtime level, as well as the runtime processing done by @code{sub}. ! (For the sake of simplicity, the rest of the tables below only show the case of even numbers of backslashes entered at the lexical level.) The problem with the historical approach is that there is no way to get a literal @samp{\} followed by the matched text. ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} The 1992 POSIX standard attempted to fix this problem. The standard says that @code{sub} and @code{gsub} look for either a @samp{\} or an @samp{&} after the @samp{\}. If either one follows a @samp{\}, that character is --- 12608,12621 ---- This table shows both the lexical-level processing, where an odd number of backslashes becomes an even number at the runtime level, as well as the runtime processing done by @code{sub}. ! (For the sake of simplicity, the rest of the following tables only show the case of even numbers of backslashes entered at the lexical level.) The problem with the historical approach is that there is no way to get a literal @samp{\} followed by the matched text. ! @c @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk}, functions and, @code{gsub}/@code{sub} The 1992 POSIX standard attempted to fix this problem. The standard says that @code{sub} and @code{gsub} look for either a @samp{\} or an @samp{&} after the @samp{\}. If either one follows a @samp{\}, that character is *************** *** 12136,12142 **** level, whenever @command{gawk} sees a @samp{\}, if the following character is a digit, then the text that matched the corresponding parenthesized subexpression is placed in the generated output. Otherwise, ! no matter what the character after the @samp{\} is, it appears in the generated text and the @samp{\} does not: @tex --- 12723,12729 ---- level, whenever @command{gawk} sees a @samp{\}, if the following character is a digit, then the text that matched the corresponding parenthesized subexpression is placed in the generated output. Otherwise, ! no matter what character follows the @samp{\}, it appears in the generated text and the @samp{\} does not: @tex *************** *** 12177,12184 **** @c fakenode --- for prepinfo @subheading Advanced Notes: Matching the Null String ! @cindex advanced notes ! @cindex matching, the null string In @command{awk}, the @samp{*} operator can match the null string. This is particularly important for the @code{sub}, @code{gsub}, --- 12764,12776 ---- @c fakenode --- for prepinfo @subheading Advanced Notes: Matching the Null String ! @c last comma does NOT start tertiary ! @cindex advanced features, null strings, matching ! @cindex matching, null strings ! @cindex null strings, matching ! @c last comma in next two is part of tertiary ! @cindex @code{*} (asterisk), @code{*} operator, null strings, matching ! @cindex asterisk (@code{*}), @code{*} operator, null strings, matching In @command{awk}, the @samp{*} operator can match the null string. This is particularly important for the @code{sub}, @code{gsub}, *************** *** 12195,12206 **** @node I/O Functions, Time Functions, String Functions, Built-in @subsection Input/Output Functions ! The following functions relate to Input/Output (I/O). ! Optional parameters are enclosed in square brackets ([ and ]): @table @code @item close(@var{filename} @r{[}, @var{how}@r{]}) ! @cindex @code{close} built-in function Close the file @var{filename} for input or output. Alternatively, the argument may be a shell command that was used for creating a coprocess, or for redirecting to or from a pipe; then the coprocess or pipe is closed. --- 12787,12799 ---- @node I/O Functions, Time Functions, String Functions, Built-in @subsection Input/Output Functions ! The following functions relate to input/output (I/O). ! Optional parameters are enclosed in square brackets ([ ]): @table @code @item close(@var{filename} @r{[}, @var{how}@r{]}) ! @cindex @code{close} function ! @cindex files, closing Close the file @var{filename} for input or output. Alternatively, the argument may be a shell command that was used for creating a coprocess, or for redirecting to or from a pipe; then the coprocess or pipe is closed. *************** *** 12208,12214 **** for more information. When closing a coprocess, it is occasionally useful to first close ! one end of the two-way pipe, and then to close the other. This is done by providing a second argument to @code{close}. This second argument should be one of the two string values @code{"to"} or @code{"from"}, indicating which end of the pipe to close. Case in the string does --- 12801,12807 ---- for more information. When closing a coprocess, it is occasionally useful to first close ! one end of the two-way pipe and then to close the other. This is done by providing a second argument to @code{close}. This second argument should be one of the two string values @code{"to"} or @code{"from"}, indicating which end of the pipe to close. Case in the string does *************** *** 12217,12234 **** which discusses this feature in more detail and gives an example. @item fflush(@r{[}@var{filename}@r{]}) ! @cindex @code{fflush} built-in function ! @cindex portability issues ! @cindex flushing buffers ! @cindex buffers, flushing ! @cindex buffering output ! @cindex output, buffering Flush any buffered output associated with @var{filename}, which is either a file opened for writing or a shell command for redirecting output to a pipe or coprocess. Many utility programs @dfn{buffer} their output; i.e., they save information ! to write to a disk file or terminal in memory, until there is enough for it to be worthwhile to send the data to the output device. This is often more efficient than writing every little bit of information as soon as it is ready. However, sometimes --- 12810,12825 ---- which discusses this feature in more detail and gives an example. @item fflush(@r{[}@var{filename}@r{]}) ! @cindex @code{fflush} function Flush any buffered output associated with @var{filename}, which is either a file opened for writing or a shell command for redirecting output to a pipe or coprocess. + @cindex portability, @code{fflush} function and + @cindex buffers, flushing + @cindex output, buffering Many utility programs @dfn{buffer} their output; i.e., they save information ! to write to a disk file or terminal in memory until there is enough for it to be worthwhile to send the data to the output device. This is often more efficient than writing every little bit of information as soon as it is ready. However, sometimes *************** *** 12243,12272 **** not available if @option{--posix} has been specified on the command line (@pxref{Options, ,Command-Line Options}). @command{gawk} extends the @code{fflush} function in two ways. The first is to allow no argument at all. In this case, the buffer for the standard output is flushed. The second is to allow the null string (@w{@code{""}}) as the argument. In this case, the buffers for @emph{all} open output files and pipes are flushed. ! @cindex automatic warnings ! @cindex warnings, automatic @code{fflush} returns zero if the buffer is successfully flushed; ! otherwise it returns @minus{}1. In the case where all buffers are flushed, the return value is zero only if all buffers were flushed successfully. Otherwise, it is ! @minus{}1, and @command{gawk} warns about the @var{filename} that had the problem. @command{gawk} also issues a warning message if you attempt to flush a file or pipe that was opened for reading (such as with @code{getline}), or if @var{filename} is not an open file, pipe, or coprocess. ! In such a case, @code{fflush} returns @minus{}1 as well. @item system(@var{command}) ! @cindex @code{system} built-in function ! @cindex interaction, @command{awk} and other programs ! The @code{system} function allows the user to execute operating system ! commands and then return to the @command{awk} program. The @code{system} function executes the command given by the string @var{command}. It returns the status returned by the command that was executed as its value. --- 12834,12865 ---- not available if @option{--posix} has been specified on the command line (@pxref{Options, ,Command-Line Options}). + @cindex @command{gawk}, @code{fflush} function in @command{gawk} extends the @code{fflush} function in two ways. The first is to allow no argument at all. In this case, the buffer for the standard output is flushed. The second is to allow the null string (@w{@code{""}}) as the argument. In this case, the buffers for @emph{all} open output files and pipes are flushed. ! @c @cindex automatic warnings ! @c @cindex warnings, automatic ! @cindex troubleshooting, @code{fflush} function @code{fflush} returns zero if the buffer is successfully flushed; ! otherwise, it returns @minus{}1. In the case where all buffers are flushed, the return value is zero only if all buffers were flushed successfully. Otherwise, it is ! @minus{}1, and @command{gawk} warns about the problem @var{filename}. @command{gawk} also issues a warning message if you attempt to flush a file or pipe that was opened for reading (such as with @code{getline}), or if @var{filename} is not an open file, pipe, or coprocess. ! In such a case, @code{fflush} returns @minus{}1, as well. @item system(@var{command}) ! @cindex @code{system} function ! @cindex interacting with other programs ! Executes operating-system ! commands and then returns to the @command{awk} program. The @code{system} function executes the command given by the string @var{command}. It returns the status returned by the command that was executed as its value. *************** *** 12295,12301 **** @end example @noindent ! @cindex fatal errors However, if your @command{awk} program is interactive, @code{system} is useful for cranking up large self-contained programs, such as a shell or an editor. --- 12888,12894 ---- @end example @noindent ! @cindex troubleshooting, @code{system} function However, if your @command{awk} program is interactive, @code{system} is useful for cranking up large self-contained programs, such as a shell or an editor. *************** *** 12304,12318 **** @end table @c fakenode --- for prepinfo ! @subheading Advanced Notes: Interactive Versus Non-Interactive Buffering ! @cindex advanced notes ! @cindex buffering, interactive vs. non-interactive ! @cindex buffering, non-interactive vs. interactive ! @cindex interactive buffering vs. non-interactive ! @cindex non-interactive buffering vs. interactive As a side point, buffering issues can be even more confusing, depending ! upon whether your program is @dfn{interactive}; i.e., communicating with a user sitting at a keyboard.@footnote{A program is interactive if the standard output is connected to a terminal device.} --- 12897,12908 ---- @end table @c fakenode --- for prepinfo ! @subheading Advanced Notes: Interactive Versus Noninteractive Buffering ! @cindex advanced features, buffering ! @cindex buffering, interactive vs. noninteractive As a side point, buffering issues can be even more confusing, depending ! upon whether your program is @dfn{interactive}, i.e., communicating with a user sitting at a keyboard.@footnote{A program is interactive if the standard output is connected to a terminal device.} *************** *** 12320,12326 **** @c Thanks to Walter.Mecky@dresdnerbank.de for this example, and for @c motivating me to write this section. Interactive programs generally @dfn{line buffer} their output; i.e., they ! write out every line. Non-interactive programs wait until they have a full buffer, which may be many lines of output. Here is an example of the difference: --- 12910,12916 ---- @c Thanks to Walter.Mecky@dresdnerbank.de for this example, and for @c motivating me to write this section. Interactive programs generally @dfn{line buffer} their output; i.e., they ! write out every line. Noninteractive programs wait until they have a full buffer, which may be many lines of output. Here is an example of the difference: *************** *** 12330,12336 **** @print{} 2 2 3 @print{} 5 ! @kbd{Ctrl-d} @end example @noindent --- 12920,12926 ---- @print{} 2 2 3 @print{} 5 ! @kbd{@value{CTL}-d} @end example @noindent *************** *** 12341,12361 **** $ awk '@{ print $1 + $2 @}' | cat 1 1 2 3 ! @kbd{Ctrl-d} @print{} 2 @print{} 5 @end example @noindent ! Here, no output is printed until after the @kbd{Ctrl-d} is typed, because it is all buffered and sent down the pipe to @command{cat} in one shot. @c fakenode --- for prepinfo @subheading Advanced Notes: Controlling Output Buffering with @code{system} ! @cindex advanced notes ! @cindex flushing buffers @cindex buffers, flushing ! @cindex buffering output @cindex output, buffering The @code{fflush} function provides explicit control over output buffering for --- 12931,12950 ---- $ awk '@{ print $1 + $2 @}' | cat 1 1 2 3 ! @kbd{@value{CTL}-d} @print{} 2 @print{} 5 @end example @noindent ! Here, no output is printed until after the @kbd{@value{CTL}-d} is typed, because it is all buffered and sent down the pipe to @command{cat} in one shot. @c fakenode --- for prepinfo @subheading Advanced Notes: Controlling Output Buffering with @code{system} ! @cindex advanced features, buffering @cindex buffers, flushing ! @cindex buffering, input/output @cindex output, buffering The @code{fflush} function provides explicit control over output buffering for *************** *** 12406,12445 **** second print @end example ! If @command{awk} did not flush its buffers before calling @code{system}, the ! latter (undesirable) output is what you see. @node Time Functions, Bitwise Functions, I/O Functions, Built-in @subsection Using @command{gawk}'s Timestamp Functions @cindex timestamps ! @cindex time of day ! A common use for @command{awk} programs is the processing of log files containing timestamp information, indicating when a particular log record was written. Many programs log their timestamp in the form returned by the @code{time} system call, which is the number of seconds since a particular epoch. On POSIX-compliant systems, it is the number of seconds since 1970-01-01 00:00:00 UTC, not counting leap seconds.@footnote{@xref{Glossary}, ! especially the entries for ``Epoch'' and ``UTC.''} All known POSIX-compliant systems support timestamps from 0 through @math{2^31 - 1}, which is sufficient to represent times through 2038-01-19 03:14:07 UTC. Many systems support a wider range of timestamps, including negative timestamps that represent times before the epoch. In order to make it easier to process such log files and to produce useful reports, @command{gawk} provides the following functions for working with timestamps. They are @command{gawk} extensions; they are not specified in the POSIX standard, nor are they in any other known version of @command{awk}.@footnote{The GNU @command{date} utility can ! also do many of the things described here. It's use may be preferable for simple time-related operations in shell scripts.} ! Optional parameters are enclosed in square brackets ([ and ]): @table @code @item systime() ! @cindex @code{systime} built-in function This function returns the current time as the number of seconds since the system epoch. On POSIX systems, this is the number of seconds since 1970-01-01 00:00:00 UTC, not counting leap seconds. --- 12995,13045 ---- second print @end example ! If @command{awk} did not flush its buffers before calling @code{system}, ! you would see the latter (undesirable) output. @node Time Functions, Bitwise Functions, I/O Functions, Built-in @subsection Using @command{gawk}'s Timestamp Functions + @c STARTOFRANGE tst @cindex timestamps ! @c STARTOFRANGE logftst ! @cindex log files, timestamps in ! @c last comma does NOT start tertiary ! @c STARTOFRANGE filogtst ! @cindex files, log, timestamps in ! @c STARTOFRANGE gawtst ! @cindex @command{gawk}, timestamps ! @cindex POSIX @command{awk}, timestamps and ! @code{awk} programs are commonly used to process log files containing timestamp information, indicating when a particular log record was written. Many programs log their timestamp in the form returned by the @code{time} system call, which is the number of seconds since a particular epoch. On POSIX-compliant systems, it is the number of seconds since 1970-01-01 00:00:00 UTC, not counting leap seconds.@footnote{@xref{Glossary}, ! especially the entries ``Epoch'' and ``UTC.''} All known POSIX-compliant systems support timestamps from 0 through @math{2^31 - 1}, which is sufficient to represent times through 2038-01-19 03:14:07 UTC. Many systems support a wider range of timestamps, including negative timestamps that represent times before the epoch. + @cindex @command{date} utility, GNU + @cindex time, retrieving In order to make it easier to process such log files and to produce useful reports, @command{gawk} provides the following functions for working with timestamps. They are @command{gawk} extensions; they are not specified in the POSIX standard, nor are they in any other known version of @command{awk}.@footnote{The GNU @command{date} utility can ! also do many of the things described here. Its use may be preferable for simple time-related operations in shell scripts.} ! Optional parameters are enclosed in square brackets ([ ]): @table @code @item systime() ! @cindex @code{systime} function (@command{gawk}) ! @cindex timestamps This function returns the current time as the number of seconds since the system epoch. On POSIX systems, this is the number of seconds since 1970-01-01 00:00:00 UTC, not counting leap seconds. *************** *** 12447,12453 **** other systems. @item mktime(@var{datespec}) ! @cindex @code{mktime} built-in function This function turns @var{datespec} into a timestamp in the same form as is returned by @code{systime}. It is similar to the function of the same name in ISO C. The argument, @var{datespec}, is a string of the form --- 13047,13053 ---- other systems. @item mktime(@var{datespec}) ! @cindex @code{mktime} function (@command{gawk}) This function turns @var{datespec} into a timestamp in the same form as is returned by @code{systime}. It is similar to the function of the same name in ISO C. The argument, @var{datespec}, is a string of the form *************** *** 12458,12471 **** 59, the second from 0 to 60,@footnote{Occasionally there are minutes in a year with a leap second, which is why the seconds can go up to 60.} ! and an optional daylight savings flag. The values of these numbers need not be within the ranges specified; for example, an hour of @minus{}1 means 1 hour before midnight. The origin-zero Gregorian calendar is assumed, with year 0 preceding year 1 and year @minus{}1 preceding year 0. The time is assumed to be in the local timezone. ! If the daylight savings flag is positive, the time is assumed to be daylight savings time; if zero, the time is assumed to be standard time; and if negative (the default), @code{mktime} attempts to determine whether daylight savings time is in effect for the specified time. --- 13058,13071 ---- 59, the second from 0 to 60,@footnote{Occasionally there are minutes in a year with a leap second, which is why the seconds can go up to 60.} ! and an optional daylight-savings flag. The values of these numbers need not be within the ranges specified; for example, an hour of @minus{}1 means 1 hour before midnight. The origin-zero Gregorian calendar is assumed, with year 0 preceding year 1 and year @minus{}1 preceding year 0. The time is assumed to be in the local timezone. ! If the daylight-savings flag is positive, the time is assumed to be daylight savings time; if zero, the time is assumed to be standard time; and if negative (the default), @code{mktime} attempts to determine whether daylight savings time is in effect for the specified time. *************** *** 12474,12480 **** is out of range, @code{mktime} returns @minus{}1. @item strftime(@r{[}@var{format} @r{[}, @var{timestamp}@r{]]}) ! @cindex @code{strftime} built-in function This function returns a string. It is similar to the function of the same name in ISO C. The time specified by @var{timestamp} is used to produce a string, based on the contents of the @var{format} string. --- 13074,13081 ---- is out of range, @code{mktime} returns @minus{}1. @item strftime(@r{[}@var{format} @r{[}, @var{timestamp}@r{]]}) ! @c STARTOFRANGE strf ! @cindex @code{strftime} function (@command{gawk}) This function returns a string. It is similar to the function of the same name in ISO C. The time specified by @var{timestamp} is used to produce a string, based on the contents of the @var{format} string. *************** *** 12492,12500 **** determine how long ago a particular record was logged. It also allows you to produce log records using the ``seconds since the epoch'' format. ! @cindex converting dates to timestamps @cindex dates, converting to timestamps ! @cindex timestamps, converting from dates The @code{mktime} function allows you to convert a textual representation of a date and time into a timestamp. This makes it easy to do before/after comparisons of dates and times, particularly when dealing with date and --- 13093,13101 ---- determine how long ago a particular record was logged. It also allows you to produce log records using the ``seconds since the epoch'' format. ! @cindex converting, dates to timestamps @cindex dates, converting to timestamps ! @cindex timestamps, converting dates to The @code{mktime} function allows you to convert a textual representation of a date and time into a timestamp. This makes it easy to do before/after comparisons of dates and times, particularly when dealing with date and *************** *** 12504,12519 **** into human-readable information. It is similar in nature to the @code{sprintf} function (@pxref{String Functions, ,String Manipulation Functions}), ! in that it copies non-format specification characters verbatim to the returned string, while substituting date and time values for format specifications in the @var{format} string. @code{strftime} is guaranteed by the 1999 ISO C standard@footnote{As this is a recent standard, not every system's @code{strftime} necessarily supports all of the conversions listed here.} to support the following date format specifications: - @cindex format specifier, @code{strftime} @table @code @item %a The locale's abbreviated weekday name. --- 13105,13120 ---- into human-readable information. It is similar in nature to the @code{sprintf} function (@pxref{String Functions, ,String Manipulation Functions}), ! in that it copies nonformat specification characters verbatim to the returned string, while substituting date and time values for format specifications in the @var{format} string. + @cindex format specifiers, @code{strftime} function (@command{gawk}) @code{strftime} is guaranteed by the 1999 ISO C standard@footnote{As this is a recent standard, not every system's @code{strftime} necessarily supports all of the conversions listed here.} to support the following date format specifications: @table @code @item %a The locale's abbreviated weekday name. *************** *** 12550,12558 **** @item %g The year modulo 100 of the ISO week number, as a decimal number (00--99). ! For example, January 1, 1993, is in week 53 of 1992. Thus, the year of its ISO week number is 1992, even though its year is 1993. ! Similarly, December 31, 1973, is in week 1 of 1974. Thus, the year of its ISO week number is 1974, even though its year is 1973. @item %G --- 13151,13159 ---- @item %g The year modulo 100 of the ISO week number, as a decimal number (00--99). ! For example, January 1, 1993 is in week 53 of 1992. Thus, the year of its ISO week number is 1992, even though its year is 1993. ! Similarly, December 31, 1973 is in week 1 of 1974. Thus, the year of its ISO week number is 1974, even though its year is 1973. @item %G *************** *** 12594,12600 **** The second as a decimal number (00--60). @item %t ! A tab character. @item %T Equivalent to specifying @samp{%H:%M:%S}. --- 13195,13201 ---- The second as a decimal number (00--60). @item %t ! A TAB character. @item %T Equivalent to specifying @samp{%H:%M:%S}. *************** *** 12606,12618 **** The week number of the year (the first Sunday as the first day of week one) as a decimal number (00--53). ! @cindex ISO 8601 @item %V The week number of the year (the first Monday as the first day of week one) as a decimal number (01--53). The method for determining the week number is as specified by ISO 8601. (To wit: if the week containing January 1 has four or more days in the ! new year, then it is week one, otherwise it is week 53 of the previous year and the next week is week one.) @item %w --- 13207,13219 ---- The week number of the year (the first Sunday as the first day of week one) as a decimal number (00--53). ! @c @cindex ISO 8601 @item %V The week number of the year (the first Monday as the first day of week one) as a decimal number (01--53). The method for determining the week number is as specified by ISO 8601. (To wit: if the week containing January 1 has four or more days in the ! new year, then it is week one; otherwise it is week 53 of the previous year and the next week is week one.) @item %w *************** *** 12636,12643 **** @item %Y The full year as a decimal number (e.g., 1995). ! @cindex RFC 822 ! @cindex RFC 1036 @item %z The timezone offset in a +HHMM format (e.g., the format necessary to produce RFC 822/RFC 1036 date headers). --- 13237,13244 ---- @item %Y The full year as a decimal number (e.g., 1995). ! @c @cindex RFC 822 ! @c @cindex RFC 1036 @item %z The timezone offset in a +HHMM format (e.g., the format necessary to produce RFC 822/RFC 1036 date headers). *************** *** 12648,12654 **** @item %Ec %EC %Ex %EX %Ey %EY %Od %Oe %OH @itemx %OI %Om %OM %OS %Ou %OU %OV %Ow %OW %Oy ! These are ``alternate representations'' for the specifications that use only the second letter (@samp{%c}, @samp{%C}, and so on).@footnote{If you don't understand any of this, don't worry about it; these facilities are meant to make it easier to ``internationalize'' --- 13249,13255 ---- @item %Ec %EC %Ex %EX %Ey %EY %Od %Oe %OH @itemx %OI %Om %OM %OS %Ou %OU %OV %Ow %OW %Oy ! ``Alternate representations'' for the specifications that use only the second letter (@samp{%c}, @samp{%C}, and so on).@footnote{If you don't understand any of this, don't worry about it; these facilities are meant to make it easier to ``internationalize'' *************** *** 12666,12674 **** behavior of the C version of @code{strftime} undefined and @command{gawk} uses the system's version of @code{strftime} if it's there. Typically, the conversion specifier either does not appear in the ! returned string or it appears literally.} ! @cindex locale, definition of Informally, a @dfn{locale} is the geographic place in which a program is meant to run. For example, a common way to abbreviate the date September 4, 1991 in the United States is ``9/4/91.'' --- 13267,13275 ---- behavior of the C version of @code{strftime} undefined and @command{gawk} uses the system's version of @code{strftime} if it's there. Typically, the conversion specifier either does not appear in the ! returned string or appears literally.} ! @c @cindex locale, definition of Informally, a @dfn{locale} is the geographic place in which a program is meant to run. For example, a common way to abbreviate the date September 4, 1991 in the United States is ``9/4/91.'' *************** *** 12689,12699 **** @table @code @item %k The hour (24-hour clock) as a decimal number (0--23). ! Single digit numbers are padded with a space. @item %l The hour (12-hour clock) as a decimal number (1--12). ! Single digit numbers are padded with a space. @item %N The ``Emperor/Era'' name. --- 13290,13300 ---- @table @code @item %k The hour (24-hour clock) as a decimal number (0--23). ! Single-digit numbers are padded with a space. @item %l The hour (12-hour clock) as a decimal number (1--12). ! Single-digit numbers are padded with a space. @item %N The ``Emperor/Era'' name. *************** *** 12709,12723 **** @item %v The date in VMS format (e.g., @samp{20-JUN-1991}). @end table Additionally, the alternate representations are recognized but their normal representations are used. This example is an @command{awk} implementation of the POSIX @command{date} utility. Normally, the @command{date} utility prints the current date and time of day in a well-known format. However, if you provide an argument to it that begins with a @samp{+}, @command{date} ! copies non-format specifier characters to the standard output and interprets the current time according to the format specifiers in the string. For example: --- 13310,13327 ---- @item %v The date in VMS format (e.g., @samp{20-JUN-1991}). @end table + @c ENDOFRANGE strf Additionally, the alternate representations are recognized but their normal representations are used. + @cindex @code{date} utility, POSIX + @cindex POSIX @command{awk}, @code{date} utility and This example is an @command{awk} implementation of the POSIX @command{date} utility. Normally, the @command{date} utility prints the current date and time of day in a well-known format. However, if you provide an argument to it that begins with a @samp{+}, @command{date} ! copies nonformat specifier characters to the standard output and interprets the current time according to the format specifiers in the string. For example: *************** *** 12758,12775 **** exit exitval @}' "$@@" @end example @node Bitwise Functions, I18N Functions, Time Functions, Built-in ! @subsection Using @command{gawk}'s Bit Manipulation Functions ! @cindex bitwise operations @quotation @i{I can explain it for you, but I can't understand it for you.}@* Anonymous @end quotation - @cindex AND bitwise operation - @cindex OR bitwise operation - @cindex XOR bitwise operation Many languages provide the ability to perform @dfn{bitwise} operations on two integer numbers. In other words, the operation is performed on each successive pair of bits in the operands. --- 13362,13389 ---- exit exitval @}' "$@@" @end example + @c ENDOFRANGE tst + @c ENDOFRANGE logftst + @c ENDOFRANGE filogtst + @c ENDOFRANGE gawtst @node Bitwise Functions, I18N Functions, Time Functions, Built-in ! @subsection Bit-Manipulation Functions of @command{gawk} ! @c STARTOFRANGE bit ! @cindex bitwise, operations ! @c STARTOFRANGE and ! @cindex AND bitwise operation ! @c STARTOFRANGE oro ! @cindex OR bitwise operation ! @c STARTOFRANGE xor ! @cindex XOR bitwise operation ! @c STARTOFRANGE opbit ! @cindex operations, bitwise @quotation @i{I can explain it for you, but I can't understand it for you.}@* Anonymous @end quotation Many languages provide the ability to perform @dfn{bitwise} operations on two integer numbers. In other words, the operation is performed on each successive pair of bits in the operands. *************** *** 12816,12822 **** }}} @end tex ! @cindex bitwise complement @cindex complement, bitwise As you can see, the result of an AND operation is 1 only when @emph{both} bits are 1. --- 13430,13436 ---- }}} @end tex ! @cindex bitwise, complement @cindex complement, bitwise As you can see, the result of an AND operation is 1 only when @emph{both} bits are 1. *************** *** 12827,12833 **** the complement of 0 is 1. Thus, this operation ``flips'' all the bits of a given value. ! @cindex bitwise shift @cindex left shift, bitwise @cindex right shift, bitwise @cindex shift, bitwise --- 13441,13447 ---- the complement of 0 is 1. Thus, this operation ``flips'' all the bits of a given value. ! @cindex bitwise, shift @cindex left shift, bitwise @cindex right shift, bitwise @cindex shift, bitwise *************** *** 12846,12901 **** @ignore @table @code ! @cindex @code{and} built-in function @item and(@var{v1}, @var{v2}) Return the bitwise AND of the values provided by @var{v1} and @var{v2}. ! @cindex @code{or} built-in function @item or(@var{v1}, @var{v2}) Return the bitwise OR of the values provided by @var{v1} and @var{v2}. ! @cindex @code{xor} built-in function @item xor(@var{v1}, @var{v2}) Return the bitwise XOR of the values provided by @var{v1} and @var{v2}. ! @cindex @code{compl} built-in function @item compl(@var{val}) Return the bitwise complement of @var{val}. ! @cindex @code{lshift} built-in function @item lshift(@var{val}, @var{count}) Return the value of @var{val}, shifted left by @var{count} bits. ! @cindex @code{rshift} built-in function @item rshift(@var{val}, @var{count}) Return the value of @var{val}, shifted right by @var{count} bits. @end table @end ignore @multitable {@code{rshift(@var{val}, @var{count})}} {Return the value of @var{val}, shifted right by @var{count} bits.} ! @cindex @code{and} built-in function @item @code{and(@var{v1}, @var{v2})} ! @tab Return the bitwise AND of the values provided by @var{v1} and @var{v2}. ! @cindex @code{or} built-in function @item @code{or(@var{v1}, @var{v2})} ! @tab Return the bitwise OR of the values provided by @var{v1} and @var{v2}. ! @cindex @code{xor} built-in function @item @code{xor(@var{v1}, @var{v2})} ! @tab Return the bitwise XOR of the values provided by @var{v1} and @var{v2}. ! @cindex @code{compl} built-in function @item @code{compl(@var{val})} ! @tab Return the bitwise complement of @var{val}. ! @cindex @code{lshift} built-in function @item @code{lshift(@var{val}, @var{count})} ! @tab Return the value of @var{val}, shifted left by @var{count} bits. ! @cindex @code{rshift} built-in function @item @code{rshift(@var{val}, @var{count})} ! @tab Return the value of @var{val}, shifted right by @var{count} bits. @end multitable For all of these functions, first the double-precision floating-point value is --- 13460,13516 ---- @ignore @table @code ! @cindex @code{and} function (@command{gawk}) @item and(@var{v1}, @var{v2}) Return the bitwise AND of the values provided by @var{v1} and @var{v2}. ! @cindex @code{or} function (@command{gawk}) @item or(@var{v1}, @var{v2}) Return the bitwise OR of the values provided by @var{v1} and @var{v2}. ! @cindex @code{xor} function (@command{gawk}) @item xor(@var{v1}, @var{v2}) Return the bitwise XOR of the values provided by @var{v1} and @var{v2}. ! @cindex @code{compl} function (@command{gawk}) @item compl(@var{val}) Return the bitwise complement of @var{val}. ! @cindex @code{lshift} function (@command{gawk}) @item lshift(@var{val}, @var{count}) Return the value of @var{val}, shifted left by @var{count} bits. ! @cindex @code{rshift} function (@command{gawk}) @item rshift(@var{val}, @var{count}) Return the value of @var{val}, shifted right by @var{count} bits. @end table @end ignore + @cindex @command{gawk}, bitwise operations in @multitable {@code{rshift(@var{val}, @var{count})}} {Return the value of @var{val}, shifted right by @var{count} bits.} ! @cindex @code{and} function (@command{gawk}) @item @code{and(@var{v1}, @var{v2})} ! @tab Returns the bitwise AND of the values provided by @var{v1} and @var{v2}. ! @cindex @code{or} function (@command{gawk}) @item @code{or(@var{v1}, @var{v2})} ! @tab Returns the bitwise OR of the values provided by @var{v1} and @var{v2}. ! @cindex @code{xor} function (@command{gawk}) @item @code{xor(@var{v1}, @var{v2})} ! @tab Returns the bitwise XOR of the values provided by @var{v1} and @var{v2}. ! @cindex @code{compl} function (@command{gawk}) @item @code{compl(@var{val})} ! @tab Returns the bitwise complement of @var{val}. ! @cindex @code{lshift} function (@command{gawk}) @item @code{lshift(@var{val}, @var{count})} ! @tab Returns the value of @var{val}, shifted left by @var{count} bits. ! @cindex @code{rshift} function (@command{gawk}) @item @code{rshift(@var{val}, @var{count})} ! @tab Returns the value of @var{val}, shifted right by @var{count} bits. @end multitable For all of these functions, first the double-precision floating-point value is *************** *** 12980,12990 **** @print{} rshift(0x99, 2) = 0x26 = 00100110 @end smallexample The @code{bits2str} function turns a binary number into a string. The number @code{1} represents a binary value where the rightmost bit is set to 1. Using this mask, the function repeatedly checks the rightmost bit. ! AND-ing the mask with the value indicates whether the rightmost bit is 1 or not. If so, a @code{"1"} is concatenated onto the front of the string. Otherwise, a @code{"0"} is added. --- 13595,13608 ---- @print{} rshift(0x99, 2) = 0x26 = 00100110 @end smallexample + @cindex numbers, converting, to strings + @cindex strings, converting, numbers to + @cindex converting, numbers, to strings The @code{bits2str} function turns a binary number into a string. The number @code{1} represents a binary value where the rightmost bit is set to 1. Using this mask, the function repeatedly checks the rightmost bit. ! ANDing the mask with the value indicates whether the rightmost bit is 1 or not. If so, a @code{"1"} is concatenated onto the front of the string. Otherwise, a @code{"0"} is added. *************** *** 12993,13047 **** If the initial value is zero it returns a simple @code{"0"}. Otherwise, at the end, it pads the value with zeros to represent multiples ! of eight-bit quantities. This is typical in modern computers. The main code in the @code{BEGIN} rule shows the difference between the decimal and octal values for the same numbers ! (@pxref{Non-decimal-numbers, ,Octal and Hexadecimal Numbers}), and then demonstrates the results of the @code{compl}, @code{lshift}, and @code{rshift} functions. @node I18N Functions, , Bitwise Functions, Built-in ! @subsection Using @command{gawk}'s String Translation Functions @command{gawk} provides facilities for internationalizing @command{awk} programs. These include the functions described in the following list. ! The description here is purposely brief. @xref{Internationalization, ,Internationalization with @command{gawk}}, for the full story. ! Optional parameters are enclosed in square brackets ([ and ]): @table @code ! @cindex @code{dcgettext} built-in function @item dcgettext(@var{string} @r{[}, @var{domain} @r{[}, @var{category}@r{]]}) This function returns the translation of @var{string} in text domain @var{domain} for locale category @var{category}. The default value for @var{domain} is the current value of @code{TEXTDOMAIN}. The default value for @var{category} is @code{"LC_MESSAGES"}. ! @cindex @code{bindtextdomain} built-in function @item bindtextdomain(@var{directory} @r{[}, @var{domain}@r{]}) ! This function allows you to specify the directory where @command{gawk} will look for message translation files, in case they will not or cannot be placed in the ``standard'' locations (e.g., during testing). ! It returns the directory where @var{domain} is ``bound.'' The default @var{domain} is the value of @code{TEXTDOMAIN}. If @var{directory} is the null string (@code{""}), then @code{bindtextdomain} returns the current binding for the given @var{domain}. @end table @node User-defined, , Built-in, Functions @section User-Defined Functions ! @cindex user-defined functions ! @cindex function, user-defined Complicated @command{awk} programs can often be simplified by defining your own functions. User-defined functions can be called just like built-in ones (@pxref{Function Calls}), but it is up to you to define ! them; i.e., to tell @command{awk} what they should do. @menu * Definition Syntax:: How to write definitions and what they mean. --- 13611,13688 ---- If the initial value is zero it returns a simple @code{"0"}. Otherwise, at the end, it pads the value with zeros to represent multiples ! of 8-bit quantities. This is typical in modern computers. The main code in the @code{BEGIN} rule shows the difference between the decimal and octal values for the same numbers ! (@pxref{Nondecimal-numbers, ,Octal and Hexadecimal Numbers}), and then demonstrates the results of the @code{compl}, @code{lshift}, and @code{rshift} functions. + @c ENDOFRANGE bit + @c ENDOFRANGE and + @c ENDOFRANGE oro + @c ENDOFRANGE xor + @c ENDOFRANGE opbit @node I18N Functions, , Bitwise Functions, Built-in ! @subsection Using @command{gawk}'s String-Translation Functions ! @cindex @command{gawk}, string-translation functions ! @cindex functions, string-translation ! @cindex internationalization ! @cindex @command{awk} programs, internationalizing @command{gawk} provides facilities for internationalizing @command{awk} programs. These include the functions described in the following list. ! The descriptions here are purposely brief. @xref{Internationalization, ,Internationalization with @command{gawk}}, for the full story. ! Optional parameters are enclosed in square brackets ([ ]): @table @code ! @cindex @code{dcgettext} function (@command{gawk}) @item dcgettext(@var{string} @r{[}, @var{domain} @r{[}, @var{category}@r{]]}) This function returns the translation of @var{string} in text domain @var{domain} for locale category @var{category}. The default value for @var{domain} is the current value of @code{TEXTDOMAIN}. The default value for @var{category} is @code{"LC_MESSAGES"}. ! @cindex @code{dcngettext} function (@command{gawk}) ! @item dcngettext(@var{string1}, @var{string2}, @var{number} @r{[}, @var{domain} @r{[}, @var{category}@r{]]}) ! This function returns the plural form used for @var{number} of the ! translation of @var{string1} and @var{string2} in text domain ! @var{domain} for locale category @var{category}. @var{string1} is the ! English singular variant of a message, and @var{string2} the English plural ! variant of the same message. ! The default value for @var{domain} is the current value of @code{TEXTDOMAIN}. ! The default value for @var{category} is @code{"LC_MESSAGES"}. ! ! @cindex @code{bindtextdomain} function (@command{gawk}) @item bindtextdomain(@var{directory} @r{[}, @var{domain}@r{]}) ! This function allows you to specify the directory in which @command{gawk} will look for message translation files, in case they will not or cannot be placed in the ``standard'' locations (e.g., during testing). ! It returns the directory in which @var{domain} is ``bound.'' The default @var{domain} is the value of @code{TEXTDOMAIN}. If @var{directory} is the null string (@code{""}), then @code{bindtextdomain} returns the current binding for the given @var{domain}. @end table + @c ENDOFRANGE funcbi + @c ENDOFRANGE bifunc @node User-defined, , Built-in, Functions @section User-Defined Functions ! @c STARTOFRANGE udfunc ! @cindex user-defined, functions ! @c STARTOFRANGE funcud ! @cindex functions, user-defined Complicated @command{awk} programs can often be simplified by defining your own functions. User-defined functions can be called just like built-in ones (@pxref{Function Calls}), but it is up to you to define ! them, i.e., to tell @command{awk} what they should do. @menu * Definition Syntax:: How to write definitions and what they mean. *************** *** 13054,13062 **** @node Definition Syntax, Function Example, User-defined, User-defined @subsection Function Definition Syntax - @cindex defining functions - @cindex function definition Definitions of functions can appear anywhere between the rules of an @command{awk} program. Thus, the general form of an @command{awk} program is extended to include sequences of rules @emph{and} user-defined function --- 13695,13703 ---- @node Definition Syntax, Function Example, User-defined, User-defined @subsection Function Definition Syntax + @c STARTOFRANGE fdef + @cindex functions, defining Definitions of functions can appear anywhere between the rules of an @command{awk} program. Thus, the general form of an @command{awk} program is extended to include sequences of rules @emph{and} user-defined function *************** *** 13075,13086 **** @} @end example ! @cindex names, use of ! @cindex namespace issues in @command{awk} @noindent @var{name} is the name of the function to define. A valid function name is like a valid variable name: a sequence of letters, digits, and ! underscores, that doesn't start with a digit. Within a single @command{awk} program, any particular name can only be used as a variable, array, or function. --- 13716,13728 ---- @} @end example ! @cindex names, functions ! @cindex functions, names of ! @cindex namespace issues, functions @noindent @var{name} is the name of the function to define. A valid function name is like a valid variable name: a sequence of letters, digits, and ! underscores that doesn't start with a digit. Within a single @command{awk} program, any particular name can only be used as a variable, array, or function. *************** *** 13110,13125 **** way to think of this is that omitted arguments default to the null string. ! @cindex conventions, programming ! @cindex programming conventions Usually when you write a function, you know how many names you intend to use for arguments and how many you intend to use as local variables. It is conventional to place some extra space between the arguments and the local variables, in order to document how your function is supposed to be used. ! @cindex variable shadowing During execution of the function body, the arguments and local variable ! values hide or @dfn{shadow} any variables of the same names used in the rest of the program. The shadowed variables are not accessible in the function definition, because there is no way to name them while their names have been taken away for the local variables. All other variables --- 13752,13766 ---- way to think of this is that omitted arguments default to the null string. ! @cindex programming conventions, functions, writing Usually when you write a function, you know how many names you intend to use for arguments and how many you intend to use as local variables. It is conventional to place some extra space between the arguments and the local variables, in order to document how your function is supposed to be used. ! @cindex variables, shadowing During execution of the function body, the arguments and local variable ! values hide, or @dfn{shadow}, any variables of the same names used in the rest of the program. The shadowed variables are not accessible in the function definition, because there is no way to name them while their names have been taken away for the local variables. All other variables *************** *** 13130,13144 **** is executing. Once the body finishes, you can once again access the variables that were shadowed while the function was running. ! @cindex recursive function ! @cindex function, recursive The function body can contain expressions that call functions. They can even call this function, either directly or by way of another function. When this happens, we say the function is @dfn{recursive}. The act of a function calling itself is called @dfn{recursion}. ! @cindex @command{awk} language, POSIX version ! @cindex POSIX @command{awk} In many @command{awk} implementations, including @command{gawk}, the keyword @code{function} may be abbreviated @code{func}. However, POSIX only specifies the use of --- 13771,13786 ---- is executing. Once the body finishes, you can once again access the variables that were shadowed while the function was running. ! @cindex recursive functions ! @cindex functions, recursive The function body can contain expressions that call functions. They can even call this function, either directly or by way of another function. When this happens, we say the function is @dfn{recursive}. The act of a function calling itself is called @dfn{recursion}. ! @c @cindex @command{awk} language, POSIX version ! @c @cindex POSIX @command{awk} ! @cindex POSIX @command{awk}, @code{function} keyword in In many @command{awk} implementations, including @command{gawk}, the keyword @code{function} may be abbreviated @code{func}. However, POSIX only specifies the use of *************** *** 13160,13166 **** in @command{awk} programs.) @c NEXT ED: This won't actually run, since foo() is undefined ... ! @cindex portability issues To ensure that your @command{awk} programs are portable, always use the keyword @code{function} when defining a function. --- 13802,13809 ---- in @command{awk} programs.) @c NEXT ED: This won't actually run, since foo() is undefined ... ! @c last comma does NOT start tertiary ! @cindex portability, functions, defining To ensure that your @command{awk} programs are portable, always use the keyword @code{function} when defining a function. *************** *** 13221,13234 **** to repeat this loop everywhere that you need to clear out an array, your program can just call @code{delarray}. (This guarantees portability. The use of @samp{delete @var{array}} to delete ! the contents of an entire array is a non-standard extension.) The following is an example of a recursive function. It takes a string as an input parameter and returns the string in backwards order. Recursive functions must always have a test that stops the recursion. In this case, the recursion terminates when the starting position ! is zero; i.e., when there are no more characters left in the string. @example function rev(str, start) @{ --- 13864,13878 ---- to repeat this loop everywhere that you need to clear out an array, your program can just call @code{delarray}. (This guarantees portability. The use of @samp{delete @var{array}} to delete ! the contents of an entire array is a nonstandard extension.) The following is an example of a recursive function. It takes a string as an input parameter and returns the string in backwards order. Recursive functions must always have a test that stops the recursion. In this case, the recursion terminates when the starting position ! is zero, i.e., when there are no more characters left in the string. + @cindex @code{rev} user-defined function @example function rev(str, start) @{ *************** *** 13254,13259 **** --- 13898,13904 ---- (@pxref{Time Functions, ,Using @command{gawk}'s Timestamp Functions}) to create an @command{awk} version of @code{ctime}: + @cindex @code{ctime} user-defined function @c FIXME: One day, change %d to %e, when C 99 is common. @example @c file eg/lib/ctime.awk *************** *** 13270,13281 **** @} @c endfile @end example @node Function Caveats, Return Statement, Function Example, User-defined @subsection Calling User-Defined Functions ! @cindex calling a function ! @cindex function call @dfn{Calling a function} means causing the function to run and do its job. A function call is an expression and its value is the value returned by the function. --- 13915,13927 ---- @} @c endfile @end example + @c ENDOFRANGE fdef @node Function Caveats, Return Statement, Function Example, User-defined @subsection Calling User-Defined Functions ! @c STARTOFRANGE fudc ! @cindex functions, user-defined, calling @dfn{Calling a function} means causing the function to run and do its job. A function call is an expression and its value is the value returned by the function. *************** *** 13328,13334 **** @end example @noindent ! to change its first argument variable @code{str}, it @emph{does not} change the value of @code{foo} in the caller. The role of @code{foo} in calling @code{myfunc} ended when its value (@code{"bar"}) was computed. If @code{str} also exists outside of @code{myfunc}, the function body --- 13974,13980 ---- @end example @noindent ! to change its first argument variable @code{str}, it does @emph{not} change the value of @code{foo} in the caller. The role of @code{foo} in calling @code{myfunc} ended when its value (@code{"bar"}) was computed. If @code{str} also exists outside of @code{myfunc}, the function body *************** *** 13336,13341 **** --- 13982,13989 ---- execution of @code{myfunc} and cannot be seen or changed from there. @cindex call by reference + @cindex arrays, as parameters to functions + @cindex functions, arrays as parameters to However, when arrays are the parameters to functions, they are @emph{not} copied. Instead, the array itself is made available for direct manipulation by the function. This is usually called @dfn{call by reference}. *************** *** 13361,13367 **** @end example @noindent ! This program prints @samp{a[1] = 1, a[2] = two, a[3] = 3}, because @code{changeit} stores @code{"two"} in the second element of @code{a}. @cindex undefined functions --- 14009,14015 ---- @end example @noindent ! prints @samp{a[1] = 1, a[2] = two, a[3] = 3}, because @code{changeit} stores @code{"two"} in the second element of @code{a}. @cindex undefined functions *************** *** 13383,13406 **** @noindent Because the @samp{if} statement will never be true, it is not really a ! problem that @code{foo} has not been defined. Usually though, it is a problem if a program calls an undefined function. ! @cindex lint checks If @option{--lint} is specified (@pxref{Options, ,Command-Line Options}), @command{gawk} reports calls to undefined functions. ! @cindex portability issues Some @command{awk} implementations generate a runtime error if you use the @code{next} statement (@pxref{Next Statement, , The @code{next} Statement}) inside a user-defined function. @command{gawk} does not have this limitation. @node Return Statement, Dynamic Typing, Function Caveats, User-defined @subsection The @code{return} Statement ! @cindex @code{return} statement The body of a user-defined function can contain a @code{return} statement. This statement returns control to the calling part of the @command{awk} program. It --- 14031,14056 ---- @noindent Because the @samp{if} statement will never be true, it is not really a ! problem that @code{foo} has not been defined. Usually, though, it is a problem if a program calls an undefined function. ! @cindex lint checking, undefined functions If @option{--lint} is specified (@pxref{Options, ,Command-Line Options}), @command{gawk} reports calls to undefined functions. ! @cindex portability, @code{next} statement in user-defined functions Some @command{awk} implementations generate a runtime error if you use the @code{next} statement (@pxref{Next Statement, , The @code{next} Statement}) inside a user-defined function. @command{gawk} does not have this limitation. + @c ENDOFRANGE fudc @node Return Statement, Dynamic Typing, Function Caveats, User-defined @subsection The @code{return} Statement ! @c comma does NOT start a secondary ! @cindex @code{return} statement, user-defined functions The body of a user-defined function can contain a @code{return} statement. This statement returns control to the calling part of the @command{awk} program. It *************** *** 13439,13454 **** @} @end example ! @cindex conventions, programming ! @cindex programming conventions @noindent You call @code{maxelt} with one argument, which is an array name. The local variables @code{i} and @code{ret} are not intended to be arguments; ! while there is nothing to stop you from passing two or three arguments to @code{maxelt}, the results would be strange. The extra space before @code{i} in the function parameter list indicates that @code{i} and ! @code{ret} are not supposed to be arguments. This is a convention that ! you should follow when you define functions. The following program uses the @code{maxelt} function. It loads an array, calls @code{maxelt}, and then reports the maximum number in that --- 14089,14103 ---- @} @end example ! @cindex programming conventions, function parameters @noindent You call @code{maxelt} with one argument, which is an array name. The local variables @code{i} and @code{ret} are not intended to be arguments; ! while there is nothing to stop you from passing more than one argument to @code{maxelt}, the results would be strange. The extra space before @code{i} in the function parameter list indicates that @code{i} and ! @code{ret} are not supposed to be arguments. ! You should follow this convention when defining functions. The following program uses the @code{maxelt} function. It loads an array, calls @code{maxelt}, and then reports the maximum number in that *************** *** 13490,13496 **** in the array. @node Dynamic Typing, , Return Statement, User-defined ! @subsection Functions and Their Effect on Variable Typing @command{awk} is a very fluid language. It is possible that @command{awk} can't tell if an identifier --- 14139,14145 ---- in the array. @node Dynamic Typing, , Return Statement, User-defined ! @subsection Functions and Their Effects on Variable Typing @command{awk} is a very fluid language. It is possible that @command{awk} can't tell if an identifier *************** *** 13514,13532 **** Usually, such things aren't a big issue, but it's worth being aware of them. @node Internationalization, Advanced Features, Functions, Top @chapter Internationalization with @command{gawk} Once upon a time, computer makers ! wrote software that only worked in English. Eventually, hardware and software vendors noticed that if their systems worked in the native languages of non-English-speaking countries, they were able to sell more systems. As a result, internationalization and localization of programs and software systems became a common practice. ! @cindex internationalization features in @command{gawk} Until recently, the ability to provide internationalization was largely restricted to programs written in C and C++. This @value{CHAPTER} describes the underlying library @command{gawk} --- 14163,14186 ---- Usually, such things aren't a big issue, but it's worth being aware of them. + @c ENDOFRANGE udfunc + @c ENDOFRANGE funcud @node Internationalization, Advanced Features, Functions, Top @chapter Internationalization with @command{gawk} Once upon a time, computer makers ! wrote software that worked only in English. Eventually, hardware and software vendors noticed that if their systems worked in the native languages of non-English-speaking countries, they were able to sell more systems. As a result, internationalization and localization of programs and software systems became a common practice. ! @c STARTOFRANGE inloc ! @cindex internationalization, localization ! @cindex @command{gawk}, internationalization and, See internationalization ! @cindex internationalization, localization, @command{gawk} and Until recently, the ability to provide internationalization was largely restricted to programs written in C and C++. This @value{CHAPTER} describes the underlying library @command{gawk} *************** *** 13551,13560 **** @section Internationalization and Localization @cindex internationalization @cindex localization @dfn{Internationalization} means writing (or modifying) a program once, in such a way that it can use multiple languages without requiring ! further source code changes. @dfn{Localization} means providing the data necessary for an internationalized program to work in a particular language. Most typically, these terms refer to features such as the language --- 14205,14216 ---- @section Internationalization and Localization @cindex internationalization + @c comma is part of see + @cindex localization, See internationalization, localization @cindex localization @dfn{Internationalization} means writing (or modifying) a program once, in such a way that it can use multiple languages without requiring ! further source-code changes. @dfn{Localization} means providing the data necessary for an internationalized program to work in a particular language. Most typically, these terms refer to features such as the language *************** *** 13565,13572 **** @node Explaining gettext, Programmer i18n, I18N and L10N, Internationalization @section GNU @code{gettext} - @cindex @code{gettext}, how it works @cindex internationalizing a program The facilities in GNU @code{gettext} focus on messages; strings printed by a program, either directly or via formatting with @code{printf} or @code{sprintf}.@footnote{For some operating systems, the @command{gawk} --- 14221,14229 ---- @node Explaining gettext, Programmer i18n, I18N and L10N, Internationalization @section GNU @code{gettext} @cindex internationalizing a program + @c STARTOFRANGE gettex + @cindex @code{gettext} library The facilities in GNU @code{gettext} focus on messages; strings printed by a program, either directly or via formatting with @code{printf} or @code{sprintf}.@footnote{For some operating systems, the @command{gawk} *************** *** 13574,13581 **** the PC operating systems. As such, these features are not available if you are using one of those operating systems. Sorry.} When using GNU @code{gettext}, each application has its own ! @dfn{text domain}. This is a unique name such as @samp{kpilot} or @samp{gawk}, that identifies the application. A complete application may have multiple components---programs written in C or C++, as well as scripts written in @command{sh} or @command{awk}. --- 14231,14239 ---- the PC operating systems. As such, these features are not available if you are using one of those operating systems. Sorry.} + @cindex portability, @code{gettext} library and When using GNU @code{gettext}, each application has its own ! @dfn{text domain}. This is a unique name, such as @samp{kpilot} or @samp{gawk}, that identifies the application. A complete application may have multiple components---programs written in C or C++, as well as scripts written in @command{sh} or @command{awk}. *************** *** 13595,13601 **** @option{--profile} option should remain the same, no matter what the local language). ! @cindex @code{textdomain} C library function @item The programmer indicates the application's text domain (@code{"guide"}) to the @code{gettext} library, --- 14253,14259 ---- @option{--profile} option should remain the same, no matter what the local language). ! @cindex @code{textdomain} function (C library) @item The programmer indicates the application's text domain (@code{"guide"}) to the @code{gettext} library, *************** *** 13603,13620 **** @item Messages from the application are extracted from the source code and ! collected into a Portable Object file (@file{guide.po}), which lists the strings and their translations. The translations are initially empty. The original (usually English) messages serve as the key for lookup of the translations. ! @cindex portable object files (@code{gettext}) @item For each language with a translator, @file{guide.po} is copied and translations are created and shipped with the application. ! @cindex message object files (@code{gettext}) @item Each language's @file{.po} file is converted into a binary message object (@file{.mo}) file. --- 14261,14284 ---- @item Messages from the application are extracted from the source code and ! collected into a portable object file (@file{guide.po}), which lists the strings and their translations. The translations are initially empty. The original (usually English) messages serve as the key for lookup of the translations. ! @cindex @code{.po} files ! @cindex files, @code{.po} ! @cindex portable object files ! @cindex files, portable object @item For each language with a translator, @file{guide.po} is copied and translations are created and shipped with the application. ! @cindex @code{.mo} files ! @cindex files, @code{.mo} ! @cindex message object files ! @cindex files, message object @item Each language's @file{.po} file is converted into a binary message object (@file{.mo}) file. *************** *** 13626,13637 **** When @command{guide} is built and installed, the binary translation files are installed in a standard place. ! @cindex @code{bindtextdomain} C library function @item For testing and development, it is possible to tell @code{gettext} to use @file{.mo} files in a different directory than the standard one by using the @code{bindtextdomain} function. @item At runtime, @command{guide} looks up each string via a call to @code{gettext}. The returned string is the translated string --- 14290,14305 ---- When @command{guide} is built and installed, the binary translation files are installed in a standard place. ! @cindex @code{bindtextdomain} function (C library) @item For testing and development, it is possible to tell @code{gettext} to use @file{.mo} files in a different directory than the standard one by using the @code{bindtextdomain} function. + @cindex @code{.mo} files, specifying directory of + @cindex files, @code{.mo}, specifying directory of + @cindex message object files, specifying directory of + @cindex files, message object, specifying directory of @item At runtime, @command{guide} looks up each string via a call to @code{gettext}. The returned string is the translated string *************** *** 13644,13650 **** and forth. @end enumerate ! @cindex @code{gettext} C library function In C (or C++), the string marking and dynamic translation lookup are accomplished by wrapping each string in a call to @code{gettext}: --- 14312,14318 ---- and forth. @end enumerate ! @cindex @code{gettext} function (C library) In C (or C++), the string marking and dynamic translation lookup are accomplished by wrapping each string in a call to @code{gettext}: *************** *** 13655,13661 **** The tools that extract messages from source code pull out all strings enclosed in calls to @code{gettext}. ! @cindex @code{_} C macro (@code{gettext}) The GNU @code{gettext} developers, recognizing that typing @samp{gettext} over and over again is both painful and ugly to look at, use the macro @samp{_} (an underscore) to make things easier: --- 14323,14330 ---- The tools that extract messages from source code pull out all strings enclosed in calls to @code{gettext}. ! @cindex @code{_} (underscore), @code{_} C macro ! @cindex underscore (@code{_}), @code{_} C macro The GNU @code{gettext} developers, recognizing that typing @samp{gettext} over and over again is both painful and ugly to look at, use the macro @samp{_} (an underscore) to make things easier: *************** *** 13668,13673 **** --- 14337,14344 ---- printf(_("Don't Panic!\n")); @end example + @cindex internationalization, localization, locale categories + @cindex @code{gettext} library, locale categories @cindex locale categories @noindent This reduces the typing overhead to just three extra characters per string *************** *** 13683,13702 **** operations, but it is possible to supply a different one explicitly, if necessary. (It is almost never necessary to supply a different category.) @cindex @code{LC_COLLATE} locale category @item LC_COLLATE ! Text collation information; i.e., how different characters and/or groups of characters sort in a given language. @cindex @code{LC_CTYPE} locale category @item LC_CTYPE ! Character type information (alphabetic, digit, upper- or lowercase, and so on). This information is accessed via the POSIX character classes in regular expressions, such as @code{/[[:alnum:]]/} (@pxref{Regexp Operators, ,Regular Expression Operators}). @cindex @code{LC_MONETARY} locale category @item LC_MONETARY Monetary information, such as the currency symbol, and whether the --- 14354,14376 ---- operations, but it is possible to supply a different one explicitly, if necessary. (It is almost never necessary to supply a different category.) + @cindex sorting characters in different languages @cindex @code{LC_COLLATE} locale category @item LC_COLLATE ! Text-collation information; i.e., how different characters and/or groups of characters sort in a given language. @cindex @code{LC_CTYPE} locale category @item LC_CTYPE ! Character-type information (alphabetic, digit, upper- or lowercase, and so on). This information is accessed via the POSIX character classes in regular expressions, such as @code{/[[:alnum:]]/} (@pxref{Regexp Operators, ,Regular Expression Operators}). + @cindex monetary information, localization + @cindex currency symbols, localization @cindex @code{LC_MONETARY} locale category @item LC_MONETARY Monetary information, such as the currency symbol, and whether the *************** *** 13708,13732 **** point and the thousands separator.@footnote{Americans use a comma every three decimal places and a period for the decimal point, while many Europeans do exactly the opposite: ! @code{1,234.56} vs.@: @code{1.234,56}.} @cindex @code{LC_RESPONSE} locale category @item LC_RESPONSE Response information, such as how ``yes'' and ``no'' appear in the local language, and possibly other information as well. @cindex @code{LC_TIME} locale category @item LC_TIME ! Time and date related information, such as 12- or 24-hour clock, month printed before or after day in a date, local month abbreviations, and so on. @cindex @code{LC_ALL} locale category @item LC_ALL All of the above. (Not too useful in the context of @code{gettext}.) @end table @node Programmer i18n, Translator i18n, Explaining gettext, Internationalization @section Internationalizing @command{awk} Programs @command{gawk} provides the following variables and functions for internationalization: --- 14382,14412 ---- point and the thousands separator.@footnote{Americans use a comma every three decimal places and a period for the decimal point, while many Europeans do exactly the opposite: ! @code{1,234.56} versus @code{1.234,56}.} @cindex @code{LC_RESPONSE} locale category @item LC_RESPONSE Response information, such as how ``yes'' and ``no'' appear in the local language, and possibly other information as well. + @cindex time, localization and + @c last comma does NOT start a tertiary + @cindex dates, information related to, localization @cindex @code{LC_TIME} locale category @item LC_TIME ! Time- and date-related information, such as 12- or 24-hour clock, month printed before or after day in a date, local month abbreviations, and so on. @cindex @code{LC_ALL} locale category @item LC_ALL All of the above. (Not too useful in the context of @code{gettext}.) @end table + @c ENDOFRANGE gettex @node Programmer i18n, Translator i18n, Explaining gettext, Internationalization @section Internationalizing @command{awk} Programs + @c STARTOFRANGE inap + @cindex @command{awk} programs, internationalizing @command{gawk} provides the following variables and functions for internationalization: *************** *** 13738,13751 **** For compatibility with GNU @code{gettext}, the default value is @code{"messages"}. ! @cindex internationalization, marked strings ! @cindex marked strings for internationalization @item _"your message here" String constants marked with a leading underscore are candidates for translation at runtime. String constants without a leading underscore are not translated. ! @cindex @code{dcgettext} built-in function @item dcgettext(@var{string} @r{[}, @var{domain} @r{[}, @var{category}@r{]]}) This built-in function returns the translation of @var{string} in text domain @var{domain} for locale category @var{category}. --- 14418,14431 ---- For compatibility with GNU @code{gettext}, the default value is @code{"messages"}. ! @cindex internationalization, localization, marked strings ! @cindex strings, for localization @item _"your message here" String constants marked with a leading underscore are candidates for translation at runtime. String constants without a leading underscore are not translated. ! @cindex @code{dcgettext} function (@command{gawk}) @item dcgettext(@var{string} @r{[}, @var{domain} @r{[}, @var{category}@r{]]}) This built-in function returns the translation of @var{string} in text domain @var{domain} for locale category @var{category}. *************** *** 13769,13781 **** chosen to be simple and to allow for reasonable @command{awk}-style default arguments. ! @cindex @code{bindtextdomain} built-in function @item bindtextdomain(@var{directory} @r{[}, @var{domain}@r{]}) ! This built-in function allows you to specify the directory where @code{gettext} looks for @file{.mo} files, in case they will not or cannot be placed in the standard locations (e.g., during testing). ! It returns the directory where @var{domain} is ``bound.'' The default @var{domain} is the value of @code{TEXTDOMAIN}. If @var{directory} is the null string (@code{""}), then --- 14449,14477 ---- chosen to be simple and to allow for reasonable @command{awk}-style default arguments. ! @cindex @code{dcngettext} function (@command{gawk}) ! @item dcngettext(@var{string1}, @var{string2}, @var{number} @r{[}, @var{domain} @r{[}, @var{category}@r{]]}) ! This built-in function returns the plural form used for @var{number} of the ! translation of @var{string1} and @var{string2} in text domain ! @var{domain} for locale category @var{category}. @var{string1} is the ! English singular variant of a message, and @var{string2} the English plural ! variant of the same message. ! The default value for @var{domain} is the current value of @code{TEXTDOMAIN}. ! The default value for @var{category} is @code{"LC_MESSAGES"}. ! ! The same remarks as for the @code{dcgettext} function apply. ! ! @cindex @code{.mo} files, specifying directory of ! @cindex files, @code{.mo}, specifying directory of ! @cindex message object files, specifying directory of ! @cindex files, message object, specifying directory of ! @cindex @code{bindtextdomain} function (@command{gawk}) @item bindtextdomain(@var{directory} @r{[}, @var{domain}@r{]}) ! This built-in function allows you to specify the directory in which @code{gettext} looks for @file{.mo} files, in case they will not or cannot be placed in the standard locations (e.g., during testing). ! It returns the directory in which @var{domain} is ``bound.'' The default @var{domain} is the value of @code{TEXTDOMAIN}. If @var{directory} is the null string (@code{""}), then *************** *** 13794,13799 **** --- 14490,14497 ---- like so: @enumerate + @cindex @code{BEGIN} pattern, @code{TEXTDOMAIN} variable and + @cindex @code{TEXTDOMAIN} variable, @code{BEGIN} pattern and @item Set the variable @code{TEXTDOMAIN} to the text domain of your program. This is best done in a @code{BEGIN} rule *************** *** 13808,13813 **** --- 14506,14513 ---- @} @end example + @cindex @code{_} (underscore), translatable string + @cindex underscore (@code{_}), translatable string @item Mark all translatable strings with a leading underscore (@samp{_}) character. It @emph{must} be adjacent to the opening *************** *** 13822,13828 **** @item If you are creating strings dynamically, you can still translate them, using the @code{dcgettext} ! built-in function. @example message = nusers " users logged in" --- 14522,14528 ---- @item If you are creating strings dynamically, you can still translate them, using the @code{dcgettext} ! built-in function: @example message = nusers " users logged in" *************** *** 13834,13839 **** --- 14534,14540 ---- text domain (@code{"adminprog"}) in which to find the message, but it uses the default @code{"LC_MESSAGES"} category. + @cindex @code{LC_MESSAGES} locale category, @code{bindtextdomain} function (@command{gawk}) @item During development, you might want to put the @file{.mo} file in a private directory for testing. This is done *************** *** 13855,13866 **** @end enumerate @xref{I18N Example, ,A Simple Internationalization Example}, ! for an example program showing the steps necessary to create and use translations from @command{awk}. @node Translator i18n, I18N Example, Programmer i18n, Internationalization @section Translating @command{awk} Programs Once a program's translatable strings have been marked, they must be extracted to create the initial @file{.po} file. As part of translation, it is often helpful to rearrange the order --- 14556,14571 ---- @end enumerate @xref{I18N Example, ,A Simple Internationalization Example}, ! for an example program showing the steps to create and use translations from @command{awk}. @node Translator i18n, I18N Example, Programmer i18n, Internationalization @section Translating @command{awk} Programs + @cindex @code{.po} files + @cindex files, @code{.po} + @cindex portable object files + @cindex files, portable object Once a program's translatable strings have been marked, they must be extracted to create the initial @file{.po} file. As part of translation, it is often helpful to rearrange the order *************** *** 13880,13891 **** @node String Extraction, Printf Ordering, Translator i18n, Translator i18n @subsection Extracting Marked Strings @cindex string extraction (internationalization) @cindex marked string extraction (internationalization) @cindex extraction, of marked strings (internationalization) @cindex @code{--gen-po} option - @cindex command-line option, @code{--gen-po} Once your @command{awk} program is working, and all the strings have been marked and you've set (and perhaps bound) the text domain, it is time to produce translations. --- 14585,14600 ---- @node String Extraction, Printf Ordering, Translator i18n, Translator i18n @subsection Extracting Marked Strings + @cindex strings, extracting + @c comma does NOT start secondary + @cindex marked strings, extracting + @cindex @code{--gen-po} option + @cindex command-line options, string extraction @cindex string extraction (internationalization) @cindex marked string extraction (internationalization) @cindex extraction, of marked strings (internationalization) @cindex @code{--gen-po} option Once your @command{awk} program is working, and all the strings have been marked and you've set (and perhaps bound) the text domain, it is time to produce translations. *************** *** 13901,13910 **** program. Instead, it parses it as usual and prints all marked strings to standard output in the format of a GNU @code{gettext} Portable Object file. Also included in the output are any constant strings that ! appear as the first argument to @code{dcgettext}.@footnote{Eventually, ! the @command{xgettext} utility that comes with GNU @code{gettext} will be ! taught to automatically run @samp{gawk --gen-po} for @file{.awk} files, ! freeing the translator from having to do it manually.} @xref{I18N Example, ,A Simple Internationalization Example}, for the full list of steps to go through to create and test translations for @command{guide}. --- 14610,14619 ---- program. Instead, it parses it as usual and prints all marked strings to standard output in the format of a GNU @code{gettext} Portable Object file. Also included in the output are any constant strings that ! appear as the first argument to @code{dcgettext} or as the first and ! second argument to @code{dcngettext}.@footnote{Starting with @code{gettext} ! version 0.11.1, the @command{xgettext} utility that comes with GNU ! @code{gettext} can handle @file{.awk} files.} @xref{I18N Example, ,A Simple Internationalization Example}, for the full list of steps to go through to create and test translations for @command{guide}. *************** *** 13912,13919 **** @node Printf Ordering, I18N Portability, String Extraction, Translator i18n @subsection Rearranging @code{printf} Arguments ! @cindex @code{printf}, positional specifier ! @cindex positional specifier, @code{printf} Format strings for @code{printf} and @code{sprintf} (@pxref{Printf, ,Using @code{printf} Statements for Fancier Printing}) present a special problem for translation. --- 14621,14629 ---- @node Printf Ordering, I18N Portability, String Extraction, Translator i18n @subsection Rearranging @code{printf} Arguments ! @cindex @code{printf} statement, positional specifiers ! @c comma does NOT start secondary ! @cindex positional specifiers, @code{printf} statement Format strings for @code{printf} and @code{sprintf} (@pxref{Printf, ,Using @code{printf} Statements for Fancier Printing}) present a special problem for translation. *************** *** 13949,13955 **** Here, the positional specifier consists of an integer count, which indicates which argument to use, and a @samp{$}. Counts are one-based, and the format string itself is @emph{not} included. Thus, in the following ! example, @samp{string} is the first argument and @samp{length(string)} is the second. @example $ gawk 'BEGIN @{ --- 14659,14665 ---- Here, the positional specifier consists of an integer count, which indicates which argument to use, and a @samp{$}. Counts are one-based, and the format string itself is @emph{not} included. Thus, in the following ! example, @samp{string} is the first argument and @samp{length(string)} is the second: @example $ gawk 'BEGIN @{ *************** *** 13978,13988 **** @noindent @strong{Note:} When using @samp{*} with a positional specifier, the @samp{*} comes first, then the integer position, and then the @samp{$}. ! This is somewhat counter-intutive. ! @cindex @code{printf}, mixing positional specifiers with regular formats ! @cindex positional specifiers, mixing with regular formats (@code{printf}) ! @cindex format specifiers, mixing regular with positional specifiers (@code{printf}) @command{gawk} does not allow you to mix regular format specifiers and those with positional specifiers in the same string: --- 14688,14699 ---- @noindent @strong{Note:} When using @samp{*} with a positional specifier, the @samp{*} comes first, then the integer position, and then the @samp{$}. ! This is somewhat counterintutive. ! @cindex @code{printf} statement, positional specifiers, mixing with regular formats ! @c first comma does is part of primary ! @cindex positional specifiers, @code{printf} statement, mixing with regular formats ! @cindex format specifiers, mixing regular with positional specifiers @command{gawk} does not allow you to mix regular format specifiers and those with positional specifiers in the same string: *************** *** 14004,14012 **** @node I18N Portability, , Printf Ordering, Translator i18n @subsection @command{awk} Portability Issues ! @cindex portability issues ! @cindex portability issues, internationalization of @command{awk} programs ! @cindex internationalization of @command{awk} programs, portability issues @command{gawk}'s internationalization features were purposely chosen to have as little impact as possible on the portability of @command{awk} programs that use them to other versions of @command{awk}. --- 14715,14722 ---- @node I18N Portability, , Printf Ordering, Translator i18n @subsection @command{awk} Portability Issues ! @cindex portability, internationalization and ! @cindex internationalization, localization, portability and @command{gawk}'s internationalization features were purposely chosen to have as little impact as possible on the portability of @command{awk} programs that use them to other versions of @command{awk}. *************** *** 14024,14032 **** @noindent As written, it won't work on other versions of @command{awk}. However, it is actually almost portable, requiring very little ! change. @itemize @bullet @item Assignments to @code{TEXTDOMAIN} won't have any effect, since @code{TEXTDOMAIN} is not special in other @command{awk} implementations. --- 14734,14743 ---- @noindent As written, it won't work on other versions of @command{awk}. However, it is actually almost portable, requiring very little ! change: @itemize @bullet + @cindex @code{TEXTDOMAIN} variable, portability and @item Assignments to @code{TEXTDOMAIN} won't have any effect, since @code{TEXTDOMAIN} is not special in other @command{awk} implementations. *************** *** 14040,14052 **** the result. @item ! By defining ``dummy'' functions to replace @code{dcgettext} and @code{bindtextdomain}, the @command{awk} program can be made to run, but all the messages are output in the original language. For example: ! @cindex @code{bindtextdomain} user-defined function ! @cindex @code{dcgettext} user-defined function @example @c file eg/lib/libintl.awk function bindtextdomain(dir, domain) --- 14751,14764 ---- the result. @item ! By defining ``dummy'' functions to replace @code{dcgettext}, @code{dcngettext} and @code{bindtextdomain}, the @command{awk} program can be made to run, but all the messages are output in the original language. For example: ! @cindex @code{bindtextdomain} function (@command{gawk}), portability and ! @cindex @code{dcgettext} function (@command{gawk}), portability and ! @cindex @code{dcngettext} function (@command{gawk}), portability and @example @c file eg/lib/libintl.awk function bindtextdomain(dir, domain) *************** *** 14058,14063 **** --- 14770,14780 ---- @{ return string @} + + function dcngettext(string1, string2, number, domain, category) + @{ + return (number == 1 ? string1 : string2) + @} @c endfile @end example *************** *** 14075,14080 **** --- 14792,14798 ---- @emph{translated} format strings, and since non-GNU @command{awk}s never retrieve the translated string, this should not be a problem in practice. @end itemize + @c ENDOFRANGE inap @node I18N Example, Gawk I18N, Translator i18n, Internationalization @section A Simple Internationalization Example *************** *** 14165,14170 **** --- 14883,14896 ---- $ mkdir en_US en_US/LC_MESSAGES @end example + @cindex @code{.po} files, converting to @code{.mo} + @cindex files, @code{.po}, converting to @code{.mo} + @cindex @code{.mo} files, converting from @code{.po} + @cindex files, @code{.mo}, converting from @code{.po} + @cindex portable object files, converting to message object files + @cindex files, portable object, converting to message object files + @cindex message object files, converting from portable object files + @cindex files, message object, converting from portable object files @cindex @command{msgfmt} utility The @command{msgfmt} utility does the conversion from human-readable @file{.po} file to machine-readable @file{.mo} file. *************** *** 14186,14192 **** @print{} Pardon me, Zaphod who? @end example ! If the two replacement functions for @code{dcgettext} and @code{bindtextdomain} (@pxref{I18N Portability, ,@command{awk} Portability Issues}) are in a file named @file{libintl.awk}, --- 14912,14918 ---- @print{} Pardon me, Zaphod who? @end example ! If the three replacement functions for @code{dcgettext}, @code{dcngettext} and @code{bindtextdomain} (@pxref{I18N Portability, ,@command{awk} Portability Issues}) are in a file named @file{libintl.awk}, *************** *** 14215,14221 **** @cite{GNU gettext tools}.) @end ifnotinfo As of this writing, the latest version of GNU @code{gettext} is ! @uref{ftp://gnudist.gnu.org/gnu/gettext/gettext-0.10.37.tar.gz, @value{PVERSION} 0.10.37}. If a translation of @command{gawk}'s messages exists, then @command{gawk} produces usage messages, warnings, --- 14941,14947 ---- @cite{GNU gettext tools}.) @end ifnotinfo As of this writing, the latest version of GNU @code{gettext} is ! @uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.11.1.tar.gz, @value{PVERSION} 0.11.1}. If a translation of @command{gawk}'s messages exists, then @command{gawk} produces usage messages, warnings, *************** *** 14228,14238 **** before compiling and installing it. @xref{Additional Configuration Options}, for more information. @node Advanced Features, Invoking Gawk, Internationalization, Top @chapter Advanced Features of @command{gawk} ! @cindex advanced features ! @cindex features, advanced @ignore Contributed by: Peter Langston --- 14954,14968 ---- before compiling and installing it. @xref{Additional Configuration Options}, for more information. + @c ENDOFRANGE inloc @node Advanced Features, Invoking Gawk, Internationalization, Top @chapter Advanced Features of @command{gawk} ! @cindex advanced features, network connections, See Also networks, connections ! @c STARTOFRANGE gawadv ! @cindex @command{gawk}, features, advanced ! @c STARTOFRANGE advgaw ! @cindex advanced features, @command{gawk} @ignore Contributed by: Peter Langston *************** *** 14251,14257 **** It's a bit of a ``grab bag'' of items that are otherwise unrelated to each other. First, a command-line option allows @command{gawk} to recognize ! non-decimal numbers in input data, not just in @command{awk} programs. Next, two-way I/O, discussed briefly in earlier parts of this @value{DOCUMENT}, is described in full detail, along with the basics of TCP/IP networking and BSD portal files. Finally, @command{gawk} --- 14981,14987 ---- It's a bit of a ``grab bag'' of items that are otherwise unrelated to each other. First, a command-line option allows @command{gawk} to recognize ! nondecimal numbers in input data, not just in @command{awk} programs. Next, two-way I/O, discussed briefly in earlier parts of this @value{DOCUMENT}, is described in full detail, along with the basics of TCP/IP networking and BSD portal files. Finally, @command{gawk} *************** *** 14264,14283 **** its description is relegated to an appendix. @menu ! * Non-decimal Data:: Allowing non-decimal input data. * Two-way I/O:: Two-way communications with another process. * TCP/IP Networking:: Using @command{gawk} for network programming. * Portal Files:: Using @command{gawk} with BSD portals. * Profiling:: Profiling your @command{awk} programs. @end menu ! @node Non-decimal Data, Two-way I/O, Advanced Features, Advanced Features ! @section Allowing Non-Decimal Input Data @cindex @code{--non-decimal-data} option ! @cindex command-line option, @code{--non-decimal-data} If you run @command{gawk} with the @option{--non-decimal-data} option, ! you can have non-decimal constants in your input data: @c line break here for small book format @example --- 14994,15016 ---- its description is relegated to an appendix. @menu ! * Nondecimal Data:: Allowing nondecimal input data. * Two-way I/O:: Two-way communications with another process. * TCP/IP Networking:: Using @command{gawk} for network programming. * Portal Files:: Using @command{gawk} with BSD portals. * Profiling:: Profiling your @command{awk} programs. @end menu ! @node Nondecimal Data, Two-way I/O, Advanced Features, Advanced Features ! @section Allowing Nondecimal Input Data @cindex @code{--non-decimal-data} option ! @cindex advanced features, @command{gawk}, nondecimal input data ! @c last comma does NOT start tertiary ! @cindex input, data, nondecimal ! @cindex constants, nondecimal If you run @command{gawk} with the @option{--non-decimal-data} option, ! you can have nondecimal constants in your input data: @c line break here for small book format @example *************** *** 14314,14333 **** using it could lead to surprising results, the default is to leave this facility disabled. If you want it, you must explicitly request it. ! @cindex conventions, programming ! @cindex programming conventions @strong{Caution:} @emph{Use of this option is not recommended.} It can break old programs very badly. Instead, use the @code{strtonum} function to convert your data ! (@pxref{Non-decimal-numbers, ,Octal and Hexadecimal Numbers}). This makes your programs easier to write and easier to read, and leads to less surprising results. ! @node Two-way I/O, TCP/IP Networking, Non-decimal Data, Advanced Features @section Two-Way Communications with Another Process @cindex Brennan, Michael ! @cindex sex, programmer attractiveness @smallexample @c Path: cssun.mathcs.emory.edu!gatech!newsxfer3.itd.umich.edu!news-peer.sprintlink.net!news-sea-19.sprintlink.net!news-in-west.sprintlink.net!news.sprintlink.net!Sprint!204.94.52.5!news.whidbey.com!brennan From: brennan@@whidbey.com (Mike Brennan) --- 15047,15067 ---- using it could lead to surprising results, the default is to leave this facility disabled. If you want it, you must explicitly request it. ! @cindex programming conventions, @code{--non-decimal-data} option ! @cindex @code{--non-decimal-data} option, @code{strtonum} function and ! @cindex @code{strtonum} function (@command{gawk}), @code{--non-decimal-data} option and @strong{Caution:} @emph{Use of this option is not recommended.} It can break old programs very badly. Instead, use the @code{strtonum} function to convert your data ! (@pxref{Nondecimal-numbers, ,Octal and Hexadecimal Numbers}). This makes your programs easier to write and easier to read, and leads to less surprising results. ! @node Two-way I/O, TCP/IP Networking, Nondecimal Data, Advanced Features @section Two-Way Communications with Another Process @cindex Brennan, Michael ! @cindex programmers, attractiveness of @smallexample @c Path: cssun.mathcs.emory.edu!gatech!newsxfer3.itd.umich.edu!news-peer.sprintlink.net!news-sea-19.sprintlink.net!news-in-west.sprintlink.net!news.sprintlink.net!Sprint!204.94.52.5!news.whidbey.com!brennan From: brennan@@whidbey.com (Mike Brennan) *************** *** 14356,14361 **** --- 15090,15098 ---- @c brennan@@whidbey.com @end smallexample + @c final comma is part of tertiary + @cindex advanced features, @command{gawk}, processes, communicating with + @cindex processes, two-way communications with It is often useful to be able to send data to a separate program for processing and then read the result. This can always be *************** *** 14378,14393 **** @noindent This works, but not elegantly. ! @cindex coprocess ! @cindex two-way I/O ! @cindex I/O, two-way ! @cindex @code{|&} I/O operator ! @cindex @command{csh} utility Starting with @value{PVERSION} 3.1 of @command{gawk}, it is possible to open a @emph{two-way} pipe to another process. The second process is termed a @dfn{coprocess}, since it runs in parallel with @command{gawk}. The two-way connection is created using the new @samp{|&} operator ! (borrowed from the Korn Shell, @command{ksh}):@footnote{This is very different from the same operator in the C shell, @command{csh}.} @example --- 15115,15130 ---- @noindent This works, but not elegantly. ! @cindex coprocesses ! @cindex input/output, two-way ! @cindex @code{|} (vertical bar), @code{|&} operator (I/O) ! @cindex vertical bar (@code{|}), @code{|&} I/O operator (I/O) ! @cindex @command{csh} utility, @code{|&} operator, comparison with Starting with @value{PVERSION} 3.1 of @command{gawk}, it is possible to open a @emph{two-way} pipe to another process. The second process is termed a @dfn{coprocess}, since it runs in parallel with @command{gawk}. The two-way connection is created using the new @samp{|&} operator ! (borrowed from the Korn shell, @command{ksh}):@footnote{This is very different from the same operator in the C shell, @command{csh}.} @example *************** *** 14417,14423 **** standard error goes. It is not possible to read the child's standard error separately. ! @cindex deadlock @item I/O buffering may be a problem. @command{gawk} automatically flushes all output down the pipe to the child process. --- 15154,15163 ---- standard error goes. It is not possible to read the child's standard error separately. ! @cindex deadlocks ! @cindex buffering, input/output ! @cindex @code{getline} command, deadlock and ! @item I/O buffering may be a problem. @command{gawk} automatically flushes all output down the pipe to the child process. *************** *** 14428,14433 **** --- 15168,15174 ---- other one to do something. @end itemize + @cindex @code{close} function, two-way pipes and It is possible to close just one end of the two-way pipe to a coprocess, by supplying a second argument to the @code{close} function of either @code{"to"} or @code{"from"} *************** *** 14436,14441 **** --- 15177,15183 ---- that sends data to the process or the end that reads from it, respectively. + @cindex @command{sort} utility, coprocesses and This is particularly necessary in order to use the system @command{sort} utility as part of a coprocess; @command{sort} must read @emph{all} of its input *************** *** 14475,14483 **** @node TCP/IP Networking, Portal Files, Two-way I/O, Advanced Features @section Using @command{gawk} for Network Programming ! @cindex networking, TCP/IP ! @cindex TCP/IP networking ! @cindex @file{/inet} special files @cindex @code{EMISTERED} @quotation @code{EMISTERED}: @i{A host is a host from coast to coast,@* --- 15217,15228 ---- @node TCP/IP Networking, Portal Files, Two-way I/O, Advanced Features @section Using @command{gawk} for Network Programming ! @cindex advanced features, @command{gawk}, network programming ! @cindex networks, programming ! @c STARTOFRANGE tcpip ! @cindex TCP/IP ! @cindex @code{/inet/} files (@command{gawk}) ! @cindex files, @code{/inet/} (@command{gawk}) @cindex @code{EMISTERED} @quotation @code{EMISTERED}: @i{A host is a host from coast to coast,@* *************** *** 14499,14505 **** The full syntax of the special @value{FN} is @file{/inet/@var{protocol}/@var{local-port}/@var{remote-host}/@var{remote-port}}. ! The meaning of the components are: @table @var @item protocol --- 15244,15250 ---- The full syntax of the special @value{FN} is @file{/inet/@var{protocol}/@var{local-port}/@var{remote-host}/@var{remote-port}}. ! The components are: @table @var @item protocol *************** *** 14507,14523 **** @samp{udp}, or @samp{raw}, for a TCP, UDP, or raw IP connection, respectively. The use of TCP is recommended for most applications. @strong{Caution:} The use of raw sockets is not currently supported in @value{PVERSION} 3.1 of @command{gawk}. @item local-port ! @cindex @code{getservbyname} C library function The local TCP or UDP port number to use. Use a port number of @samp{0} when you want the system to pick a port. This is what you should do when writing a TCP or UDP client. You may also use a well-known service name, such as @samp{smtp} or @samp{http}, in which case @command{gawk} attempts to determine ! the pre-defined port number using the C @code{getservbyname} function. @item remote-host The IP address or fully-qualified domain name of the Internet --- 15252,15270 ---- @samp{udp}, or @samp{raw}, for a TCP, UDP, or raw IP connection, respectively. The use of TCP is recommended for most applications. + @cindex raw sockets + @cindex sockets @strong{Caution:} The use of raw sockets is not currently supported in @value{PVERSION} 3.1 of @command{gawk}. @item local-port ! @cindex @code{getservbyname} function (C library) The local TCP or UDP port number to use. Use a port number of @samp{0} when you want the system to pick a port. This is what you should do when writing a TCP or UDP client. You may also use a well-known service name, such as @samp{smtp} or @samp{http}, in which case @command{gawk} attempts to determine ! the predefined port number using the C @code{getservbyname} function. @item remote-host The IP address or fully-qualified domain name of the Internet *************** *** 14558,14570 **** @node Portal Files, Profiling, TCP/IP Networking, Advanced Features @section Using @command{gawk} with BSD Portals @cindex portal files ! @cindex BSD portal files ! @cindex TCP/IP networking ! @cindex @file{/p} special files @cindex @code{--enable-portals} configuration option ! @cindex configuration option, @code{--enable-portals} ! @cindex BSD-based operating systems Similar to the @file{/inet} special files, if @command{gawk} is configured with the @option{--enable-portals} option --- 15305,15318 ---- @node Portal Files, Profiling, TCP/IP Networking, Advanced Features @section Using @command{gawk} with BSD Portals + @cindex advanced features, @command{gawk}, BSD portals @cindex portal files ! @cindex files, portal ! @cindex BSD portals ! @cindex @code{/p} files (@command{gawk}) ! @cindex files, @code{/p} (@command{gawk}) @cindex @code{--enable-portals} configuration option ! @cindex operating systems, BSD-based Similar to the @file{/inet} special files, if @command{gawk} is configured with the @option{--enable-portals} option *************** *** 14572,14600 **** then @command{gawk} treats files whose pathnames begin with @code{/p} as 4.4 BSD-style portals. When used with the @samp{|&} operator, @command{gawk} opens the file for two-way communications. The operating system's portal mechanism then manages creating the process associated with the portal and the corresponding communications with the portal's process. @node Profiling, , Portal Files, Advanced Features @section Profiling Your @command{awk} Programs @cindex profiling @command{awk} programs @cindex @command{pgawk} program Beginning with @value{PVERSION} 3.1 of @command{gawk}, you may produce execution traces of your @command{awk} programs. This is done with a specially compiled version of @command{gawk}, called @command{pgawk} (``profiling @command{gawk}''). ! @cindex @file{awkprof.out} profiling output file ! @cindex profiling output file (@file{awkprof.out}) @command{pgawk} is identical in every way to @command{gawk}, except that when it has finished running, it creates a profile of your program in a file named @file{awkprof.out}. ! Because it is profiling, it also executes up to 45 percent slower than @command{gawk} normally does. As shown in the following example, the @option{--profile} option can be used to change the name of the file where @command{pgawk} will write the profile: --- 15320,15358 ---- then @command{gawk} treats files whose pathnames begin with @code{/p} as 4.4 BSD-style portals. + @cindex @code{|} (vertical bar), @code{|&} operator (I/O), two-way communications + @cindex vertical bar (@code{|}), @code{|&} operator (I/O), two-way communications When used with the @samp{|&} operator, @command{gawk} opens the file for two-way communications. The operating system's portal mechanism then manages creating the process associated with the portal and the corresponding communications with the portal's process. + @c ENDOFRANGE tcpip @node Profiling, , Portal Files, Advanced Features @section Profiling Your @command{awk} Programs + @c STARTOFRANGE awkp + @cindex @command{awk} programs, profiling + @c STARTOFRANGE proawk @cindex profiling @command{awk} programs + @c STARTOFRANGE pgawk @cindex @command{pgawk} program + @cindex profiling @command{gawk}, See @command{pgawk} program Beginning with @value{PVERSION} 3.1 of @command{gawk}, you may produce execution traces of your @command{awk} programs. This is done with a specially compiled version of @command{gawk}, called @command{pgawk} (``profiling @command{gawk}''). ! @cindex @code{awkprof.out} file ! @cindex files, @code{awkprof.out} ! @cindex @command{pgawk} program, @code{awkprof.out} file @command{pgawk} is identical in every way to @command{gawk}, except that when it has finished running, it creates a profile of your program in a file named @file{awkprof.out}. ! Because it is profiling, it also executes up to 45% slower than @command{gawk} normally does. + @cindex @code{--profile} option As shown in the following example, the @option{--profile} option can be used to change the name of the file where @command{pgawk} will write the profile: *************** *** 14653,14662 **** @end example Here is the @file{awkprof.out} that results from running @command{pgawk} ! on this program and data. (This example also illustrates that @command{awk} ! programmers sometimes have to work late.): ! @cindex blocks, @code{BEGIN} and @code{END} @example # gawk profile, created Sun Aug 13 00:00:15 2000 --- 15411,15421 ---- @end example Here is the @file{awkprof.out} that results from running @command{pgawk} ! on this program and data (this example also illustrates that @command{awk} ! programmers sometimes have to work late): ! @cindex @code{BEGIN} pattern, @command{pgawk} program ! @cindex @code{END} pattern, @command{pgawk} program @example # gawk profile, created Sun Aug 13 00:00:15 2000 *************** *** 14699,14705 **** @} @end example ! The previous example illustrates many of the basic rules for profiling output. The rules are as follows: @itemize @bullet --- 15458,15464 ---- @} @end example ! This example illustrates many of the basic rules for profiling output. The rules are as follows: @itemize @bullet *************** *** 14709,14714 **** --- 15468,15474 ---- alphabetically. Multiple @code{BEGIN} and @code{END} rules are merged together. + @cindex patterns, counts @item Pattern-action rules have two counts. The first count, to the left of the rule, shows how many times *************** *** 14728,14733 **** --- 15488,15494 ---- The count for the @code{else} indicates how many times the test failed. + @cindex loops, count for header @item The count for a loop header (such as @code{for} or @code{while}) shows how many times the loop test was executed. *************** *** 14735,14751 **** statement in a rule to determine how many times the rule was executed. If the first statement is a loop, the count is misleading.) @item For user-defined functions, the count next to the @code{function} keyword indicates how many times the function was called. The counts next to the statements in the body show how many times those statements were executed. @item ! The layout uses ``K&R'' style using tabs. Braces are used everywhere, even when the body of an @code{if}, @code{else}, or loop is only a single statement. @item Parentheses are used only where needed, as indicated by the structure of the program and the precedence rules. --- 15496,15518 ---- statement in a rule to determine how many times the rule was executed. If the first statement is a loop, the count is misleading.) + @cindex functions, user-defined, counts + @cindex user-defined, functions, counts @item For user-defined functions, the count next to the @code{function} keyword indicates how many times the function was called. The counts next to the statements in the body show how many times those statements were executed. + @cindex @code{@{@}} (braces), @command{pgawk} program + @cindex braces (@code{@{@}}), @command{pgawk} program @item ! The layout uses ``K&R'' style with tabs. Braces are used everywhere, even when the body of an @code{if}, @code{else}, or loop is only a single statement. + @cindex @code{()} (parentheses), @command{pgawk} program + @cindex parentheses @code{()}, @command{pgawk} program @item Parentheses are used only where needed, as indicated by the structure of the program and the precedence rules. *************** *** 14776,14782 **** typed when you wrote it. This is because @command{pgawk} creates the profiled version by ``pretty printing'' its internal representation of the program. The advantage to this is that @command{pgawk} can produce ! a standard representation. The disadvantage is that all source code comments are lost, as are the distinctions among multiple @code{BEGIN} and @code{END} rules. Also, things such as: --- 15543,15549 ---- typed when you wrote it. This is because @command{pgawk} creates the profiled version by ``pretty printing'' its internal representation of the program. The advantage to this is that @command{pgawk} can produce ! a standard representation. The disadvantage is that all source-code comments are lost, as are the distinctions among multiple @code{BEGIN} and @code{END} rules. Also, things such as: *************** *** 14796,14803 **** @noindent which is correct, but possibly surprising. ! @cindex dynamic profiling ! @cindex profiling, dynamic Besides creating profiles when a program has completed, @command{pgawk} can produce a profile while it is running. This is useful if your @command{awk} program goes into an --- 15563,15570 ---- @noindent which is correct, but possibly surprising. ! @cindex profiling @command{awk} programs, dynamically ! @cindex @command{pgawk} program, dynamic profiling Besides creating profiles when a program has completed, @command{pgawk} can produce a profile while it is running. This is useful if your @command{awk} program goes into an *************** *** 14809,14820 **** [1] 13992 @end example ! @cindex @command{kill} command ! @cindex @code{SIGUSR1} signal @cindex @code{USR1} signal ! @cindex signals, @code{SIGUSR1} @noindent ! The shell prints a job number and process ID number, in this case, 13992. Use the @command{kill} command to send the @code{USR1} signal to @command{pgawk}: --- 15576,15587 ---- [1] 13992 @end example ! @c comma does NOT start secondary ! @cindex @command{kill} command, dynamic profiling @cindex @code{USR1} signal ! @cindex signals, @code{USR1}/@code{SIGUSR1} @noindent ! The shell prints a job number and process ID number; in this case, 13992. Use the @command{kill} command to send the @code{USR1} signal to @command{pgawk}: *************** *** 14843,14853 **** Each time, the profile and function call trace are appended to the output profile file. - @cindex @code{SIGHUP} signal @cindex @code{HUP} signal ! @cindex signals, @code{SIGHUP} If you use the @code{HUP} signal instead of the @code{USR1} signal, ! @command{pgawk} produces the profile and the function call trace, and then exits. @node Invoking Gawk, Library Functions, Advanced Features, Top @chapter Running @command{awk} and @command{gawk} --- 15610,15637 ---- Each time, the profile and function call trace are appended to the output profile file. @cindex @code{HUP} signal ! @cindex signals, @code{HUP}/@code{SIGHUP} If you use the @code{HUP} signal instead of the @code{USR1} signal, ! @command{pgawk} produces the profile and the function call trace and then exits. ! ! @cindex @code{INT} signal (MS-DOS) ! @cindex signals, @code{INT}/@code{SIGINT} (MS-DOS) ! @cindex @code{QUIT} signal (MS-DOS) ! @cindex signals, @code{QUIT}/@code{SIGQUIT} (MS-DOS) ! When @command{pgawk} runs on MS-DOS or MS-Windows, it uses the ! @code{INT} and @code{QUIT} signals for producing the profile and, in ! the case of the @code{INT} signal, @command{pgawk} exits. This is ! because these systems don't support the @command{kill} command, so the ! only signals you can deliver to a program are those generated by the ! keyboard. The @code{INT} signal is generated by the ! @kbd{@value{CTL}-@key{C}} or @kbd{@value{CTL}-@key{BREAK}} key, while the ! @code{QUIT} signal is generated by the @kbd{@value{CTL}-@key{\}} key. ! @c ENDOFRANGE advgaw ! @c ENDOFRANGE gawadv ! @c ENDOFRANGE pgawk ! @c ENDOFRANGE awkp ! @c ENDOFRANGE proawk @node Invoking Gawk, Library Functions, Advanced Features, Top @chapter Running @command{awk} and @command{gawk} *************** *** 14878,14889 **** @node Command Line, Options, Invoking Gawk, Invoking Gawk @section Invoking @command{awk} ! @cindex command line ! @cindex invocation of @command{gawk} ! @cindex arguments, command-line ! @cindex options, command-line ! @cindex long options ! @cindex options, long There are two ways to run @command{awk}---with an explicit program or with one or more program files. Here are templates for both of them; items --- 15662,15671 ---- @node Command Line, Options, Invoking Gawk, Invoking Gawk @section Invoking @command{awk} ! @cindex command line, invoking @command{awk} from ! @cindex @command{awk}, invoking ! @cindex arguments, command-line, invoking @command{awk} ! @cindex options, command-line, invoking @command{awk} There are two ways to run @command{awk}---with an explicit program or with one or more program files. Here are templates for both of them; items *************** *** 14894,14921 **** awk @r{[@var{options}]} @r{[@code{--}]} '@var{program}' @var{file} @dots{} @end example Besides traditional one-letter POSIX-style options, @command{gawk} also supports GNU long options. ! @cindex empty program ! @cindex dark corner ! @cindex lint checks It is possible to invoke @command{awk} with an empty program: @example awk '' datafile1 datafile2 @end example @noindent ! Doing so makes little sense though; @command{awk} exits silently when given an empty program. @value{DARKCORNER} If @option{--lint} has ! been specified on the command-line, @command{gawk} issues a warning that the program is empty. @node Options, Other Arguments, Command Line, Invoking Gawk @section Command-Line Options Options begin with a dash and consist of a single character. GNU-style long options consist of two dashes and a keyword. --- 15676,15714 ---- awk @r{[@var{options}]} @r{[@code{--}]} '@var{program}' @var{file} @dots{} @end example + @cindex GNU long options + @cindex long options + @cindex options, long Besides traditional one-letter POSIX-style options, @command{gawk} also supports GNU long options. ! @cindex dark corner, invoking @command{awk} ! @cindex lint checking, empty programs It is possible to invoke @command{awk} with an empty program: @example awk '' datafile1 datafile2 @end example + @cindex @code{--lint} option @noindent ! Doing so makes little sense, though; @command{awk} exits silently when given an empty program. @value{DARKCORNER} If @option{--lint} has ! been specified on the command line, @command{gawk} issues a warning that the program is empty. @node Options, Other Arguments, Command Line, Invoking Gawk @section Command-Line Options + @c STARTOFRANGE ocl + @cindex options, command-line + @c STARTOFRANGE clo + @cindex command line, options + @c STARTOFRANGE gnulo + @cindex GNU long options + @c STARTOFRANGE longo + @cindex options, long Options begin with a dash and consist of a single character. GNU-style long options consist of two dashes and a keyword. *************** *** 14927,14932 **** --- 15720,15726 ---- If a particular option with a value is given more than once, it is the last value that counts. + @cindex POSIX @command{awk}, GNU long options and Each long option for @command{gawk} has a corresponding POSIX-style option. The long and short options are *************** *** 14937,14963 **** @item -F @var{fs} @itemx --field-separator @var{fs} @cindex @code{-F} option - @cindex command-line option, @code{-F} @cindex @code{--field-separator} option ! @cindex command-line option, @code{--field-separator} Sets the @code{FS} variable to @var{fs} (@pxref{Field Separators, ,Specifying How Fields Are Separated}). @item -f @var{source-file} @itemx --file @var{source-file} @cindex @code{-f} option - @cindex command-line option, @code{-f} @cindex @code{--file} option ! @cindex command-line option, @code{--file} Indicates that the @command{awk} program is to be found in @var{source-file} instead of in the first non-option argument. @item -v @var{var}=@var{val} @itemx --assign @var{var}=@var{val} @cindex @code{-v} option - @cindex command-line option, @code{-v} @cindex @code{--assign} option ! @cindex command-line option, @code{--assign} Sets the variable @var{var} to the value @var{val} @emph{before} execution of the program begins. Such variable values are available inside the @code{BEGIN} rule --- 15731,15754 ---- @item -F @var{fs} @itemx --field-separator @var{fs} @cindex @code{-F} option @cindex @code{--field-separator} option ! @cindex @code{FS} variable, @code{--field-separator} option and Sets the @code{FS} variable to @var{fs} (@pxref{Field Separators, ,Specifying How Fields Are Separated}). @item -f @var{source-file} @itemx --file @var{source-file} @cindex @code{-f} option @cindex @code{--file} option ! @cindex @command{awk} programs, location of Indicates that the @command{awk} program is to be found in @var{source-file} instead of in the first non-option argument. @item -v @var{var}=@var{val} @itemx --assign @var{var}=@var{val} @cindex @code{-v} option @cindex @code{--assign} option ! @cindex variables, setting Sets the variable @var{var} to the value @var{val} @emph{before} execution of the program begins. Such variable values are available inside the @code{BEGIN} rule *************** *** 14967,14972 **** --- 15758,15767 ---- more than once, setting another variable each time, like this: @samp{awk @w{-v foo=1} @w{-v bar=2} @dots{}}. + @c last comma is part of secondary + @cindex built-in variables, @code{-v} option, setting with + @c last comma is part of tertiary + @cindex variables, built-in, @code{-v} option, setting with @strong{Caution:} Using @option{-v} to set the values of the built-in variables may lead to surprising results. @command{awk} will reset the values of those variables as it needs to, possibly ignoring any *************** *** 14974,14984 **** @item -mf @var{N} @itemx -mr @var{N} ! @cindex @code{-mf} option ! @cindex command-line option, @code{-mf} ! @cindex @code{-mr} option ! @cindex command-line option, @code{-mr} ! Set various memory limits to the value @var{N}. The @samp{f} flag sets the maximum number of fields and the @samp{r} flag sets the maximum record size. These two flags and the @option{-m} option are from the Bell Laboratories research version of Unix @command{awk}. They are provided --- 15769,15777 ---- @item -mf @var{N} @itemx -mr @var{N} ! @cindex @code{-mf}/@code{-mr} options ! @cindex memory, setting limits ! Sets various memory limits to the value @var{N}. The @samp{f} flag sets the maximum number of fields and the @samp{r} flag sets the maximum record size. These two flags and the @option{-m} option are from the Bell Laboratories research version of Unix @command{awk}. They are provided *************** *** 14989,14995 **** @item -W @var{gawk-opt} @cindex @code{-W} option - @cindex command-line option, @code{-W} Following the POSIX standard, implementation-specific options are supplied as arguments to the @option{-W} option. These options also have corresponding GNU-style long options. --- 15782,15787 ---- *************** *** 14998,15012 **** --- 15790,15810 ---- The full list of @command{gawk}-specific options is provided next. @item -- + @cindex command line, options, end of + @cindex options, command-line, end of Signals the end of the command-line options. The following arguments are not treated as options even if they begin with @samp{-}. This interpretation of @option{--} follows the POSIX argument parsing conventions. + @cindex @code{-} (hyphen), filenames beginning with + @cindex hyphen (@code{-}), filenames beginning with This is useful if you have @value{FN}s that start with @samp{-}, or in shell scripts, if you have @value{FN}s that will be specified by the user that could start with @samp{-}. @end table + @c ENDOFRANGE gnulo + @c ENDOFRANGE longo The previous list described options mandated by the POSIX standard, as well as options available in the Bell Laboratories version of @command{awk}. *************** *** 15018,15027 **** @itemx --compat @itemx --traditional @cindex @code{--compat} option - @cindex command-line option, @code{--compat} @cindex @code{--traditional} option ! @cindex command-line option, @code{--traditional} ! @cindex compatibility mode Specifies @dfn{compatibility mode}, in which the GNU extensions to the @command{awk} language are disabled, so that @command{gawk} behaves just like the Bell Laboratories research version of Unix @command{awk}. --- 15816,15823 ---- @itemx --compat @itemx --traditional @cindex @code{--compat} option @cindex @code{--traditional} option ! @cindex compatibility mode (@command{gawk}), specifying Specifies @dfn{compatibility mode}, in which the GNU extensions to the @command{awk} language are disabled, so that @command{gawk} behaves just like the Bell Laboratories research version of Unix @command{awk}. *************** *** 15033,15074 **** @item -W copyright @itemx --copyright @cindex @code{--copyright} option ! @cindex command-line option, @code{--copyright} Print the short version of the General Public License and then exit. @item -W copyleft @itemx --copyleft @cindex @code{--copyleft} option - @cindex command-line option, @code{--copyleft} Just like @option{--copyright}. This option may disappear in a future version of @command{gawk}. @cindex @code{--dump-variables} option ! @cindex command-line option, @code{--dump-variables} ! @cindex @file{awkvars.out} global variable list output file @item -W dump-variables@r{[}=@var{file}@r{]} @itemx --dump-variables@r{[}=@var{file}@r{]} ! Print a sorted list of global variables, their types, and final values to @var{file}. If no @var{file} is provided, @command{gawk} prints this ! list to a file named @file{awkvars.out} in the current directory. ! @cindex common mistakes ! @cindex mistakes, common ! @cindex errors, common ! Having a list of all the global variables is a good way to look for typographical errors in your programs. You would also use this option if you have a large program with a lot of functions, and you want to be sure that your functions don't inadvertently use global variables that you meant to be local. (This is a particularly easy mistake to make with simple variable ! names like @code{i}, @code{j}, and so on.) @item -W gen-po @itemx --gen-po @cindex @code{--gen-po} option ! @cindex command-line option, @code{--gen-po} ! Analyze the source program and ! generate a GNU @code{gettext} Portable Object file on standard output for all string constants that have been marked for translation. @xref{Internationalization, ,Internationalization with @command{gawk}}, for information about this option. --- 15829,15870 ---- @item -W copyright @itemx --copyright @cindex @code{--copyright} option ! @cindex GPL (General Public License), printing Print the short version of the General Public License and then exit. @item -W copyleft @itemx --copyleft @cindex @code{--copyleft} option Just like @option{--copyright}. This option may disappear in a future version of @command{gawk}. @cindex @code{--dump-variables} option ! @cindex @code{awkvars.out} file ! @cindex files, @code{awkvars.out} ! @cindex variables, global, printing list of @item -W dump-variables@r{[}=@var{file}@r{]} @itemx --dump-variables@r{[}=@var{file}@r{]} ! Prints a sorted list of global variables, their types, and final values to @var{file}. If no @var{file} is provided, @command{gawk} prints this ! list to the file named @file{awkvars.out} in the current directory. ! @c last comma is part of secondary ! @cindex troubleshooting, typographical errors, global variables ! Having a list of all global variables is a good way to look for typographical errors in your programs. You would also use this option if you have a large program with a lot of functions, and you want to be sure that your functions don't inadvertently use global variables that you meant to be local. (This is a particularly easy mistake to make with simple variable ! names like @code{i}, @code{j}, etc.) @item -W gen-po @itemx --gen-po @cindex @code{--gen-po} option ! @cindex portable object files, generating ! @cindex files, portable object, generating ! Analyzes the source program and ! generates a GNU @code{gettext} Portable Object file on standard output for all string constants that have been marked for translation. @xref{Internationalization, ,Internationalization with @command{gawk}}, for information about this option. *************** *** 15078,15140 **** @itemx --help @itemx --usage @cindex @code{--help} option - @cindex command-line option, @code{--help} @cindex @code{--usage} option ! @cindex command-line option, @code{--usage} ! Print a ``usage'' message summarizing the short and long style options that @command{gawk} accepts and then exit. @item -W lint@r{[}=fatal@r{]} @itemx --lint@r{[}=fatal@r{]} @cindex @code{--lint} option ! @cindex command-line option, @code{--lint} ! @cindex lint checks ! @cindex fatal errors ! Warn about constructs that are dubious or non-portable to other @command{awk} implementations. Some warnings are issued when @command{gawk} first reads your program. Others are issued at runtime, as your program executes. With an optional argument of @samp{fatal}, lint warnings become fatal errors. ! This may be drastic but its use will certainly encourage the development of cleaner @command{awk} programs. @item -W lint-old @itemx --lint-old @cindex @code{--lint-old} option ! @cindex command-line option, @code{--lint-old} ! @cindex lint checks ! Warn about constructs that are not available in the original version of @command{awk} from Version 7 Unix (@pxref{V7/SVR3.1, ,Major Changes Between V7 and SVR3.1}). @item -W non-decimal-data @itemx --non-decimal-data @cindex @code{--non-decimal-data} option ! @cindex command-line option, @code{--non-decimal-data} Enable automatic interpretation of octal and hexadecimal values in input data ! (@pxref{Non-decimal Data, ,Allowing Non-Decimal Input Data}). @strong{Caution:} This option can severely break old programs. Use with care. @item -W posix @itemx --posix @cindex @code{--posix} option - @cindex command-line option, @code{--posix} @cindex POSIX mode ! Operate in strict POSIX mode. This disables all @command{gawk} extensions (just like @option{--traditional}) and adds the following additional restrictions: @c IMPORTANT! Keep this list in sync with the one in node POSIX @itemize @bullet @item @code{\x} escape sequences are not recognized (@pxref{Escape Sequences}). @item Newlines do not act as whitespace to separate fields when @code{FS} is equal to a single space --- 15874,15941 ---- @itemx --help @itemx --usage @cindex @code{--help} option @cindex @code{--usage} option ! @cindex GNU long options, printing list of ! @cindex options, printing list of ! @cindex printing, list of options ! Prints a ``usage'' message summarizing the short and long style options that @command{gawk} accepts and then exit. @item -W lint@r{[}=fatal@r{]} @itemx --lint@r{[}=fatal@r{]} @cindex @code{--lint} option ! @cindex lint checking, issuing warnings ! @cindex warnings, issuing ! Warns about constructs that are dubious or nonportable to other @command{awk} implementations. Some warnings are issued when @command{gawk} first reads your program. Others are issued at runtime, as your program executes. With an optional argument of @samp{fatal}, lint warnings become fatal errors. ! This may be drastic, but its use will certainly encourage the development of cleaner @command{awk} programs. @item -W lint-old @itemx --lint-old @cindex @code{--lint-old} option ! Warns about constructs that are not available in the original version of @command{awk} from Version 7 Unix (@pxref{V7/SVR3.1, ,Major Changes Between V7 and SVR3.1}). @item -W non-decimal-data @itemx --non-decimal-data @cindex @code{--non-decimal-data} option ! @cindex hexadecimal, values, enabling interpretation of ! @c comma is part of primary ! @cindex octal values, enabling interpretation of Enable automatic interpretation of octal and hexadecimal values in input data ! (@pxref{Nondecimal Data, ,Allowing Nondecimal Input Data}). + @cindex troubleshooting, @code{--non-decimal-data} option @strong{Caution:} This option can severely break old programs. Use with care. @item -W posix @itemx --posix @cindex @code{--posix} option @cindex POSIX mode ! @c last comma is part of tertiary ! @cindex @command{gawk}, extensions, disabling ! Operates in strict POSIX mode. This disables all @command{gawk} extensions (just like @option{--traditional}) and adds the following additional restrictions: @c IMPORTANT! Keep this list in sync with the one in node POSIX @itemize @bullet + @cindex escape sequences, unrecognized @item @code{\x} escape sequences are not recognized (@pxref{Escape Sequences}). + @cindex newlines + @cindex whitespace, newlines as @item Newlines do not act as whitespace to separate fields when @code{FS} is equal to a single space *************** *** 15148,15178 **** The synonym @code{func} for the keyword @code{function} is not recognized (@pxref{Definition Syntax, ,Function Definition Syntax}). @item The @samp{**} and @samp{**=} operators cannot be used in place of @samp{^} and @samp{^=} (@pxref{Arithmetic Ops, ,Arithmetic Operators}, and also @pxref{Assignment Ops, ,Assignment Expressions}). @item Specifying @samp{-Ft} on the command-line does not set the value ! of @code{FS} to be a single tab character (@pxref{Field Separators, ,Specifying How Fields Are Separated}). @item The @code{fflush} built-in function is not supported (@pxref{I/O Functions, ,Input/Output Functions}). @end itemize ! @cindex automatic warnings ! @cindex warnings, automatic If you supply both @option{--traditional} and @option{--posix} on the ! command-line, @option{--posix} takes precedence. @command{gawk} also issues a warning if both options are supplied. @item -W profile@r{[}=@var{file}@r{]} @itemx --profile@r{[}=@var{file}@r{]} @cindex @code{--profile} option ! @cindex command-line option, @code{--profile} Enable profiling of @command{awk} programs (@pxref{Profiling, ,Profiling Your @command{awk} Programs}). By default, profiles are created in a file named @file{awkprof.out}. --- 15949,15992 ---- The synonym @code{func} for the keyword @code{function} is not recognized (@pxref{Definition Syntax, ,Function Definition Syntax}). + @cindex @code{*} (asterisk), @code{**} operator + @cindex asterisk (@code{*}), @code{**} operator + @cindex @code{*} (asterisk), @code{**=} operator + @cindex asterisk (@code{*}), @code{**=} operator + @cindex @code{^} (caret), @code{^} operator + @cindex caret (@code{^}), @code{^} operator + @cindex @code{^} (caret), @code{^=} operator + @cindex caret (@code{^}), @code{^=} operator @item The @samp{**} and @samp{**=} operators cannot be used in place of @samp{^} and @samp{^=} (@pxref{Arithmetic Ops, ,Arithmetic Operators}, and also @pxref{Assignment Ops, ,Assignment Expressions}). + @cindex @code{FS} variable, as TAB character @item Specifying @samp{-Ft} on the command-line does not set the value ! of @code{FS} to be a single TAB character (@pxref{Field Separators, ,Specifying How Fields Are Separated}). + @c comma does not start secondary + @cindex @code{fflush} function, unsupported @item The @code{fflush} built-in function is not supported (@pxref{I/O Functions, ,Input/Output Functions}). @end itemize ! @c @cindex automatic warnings ! @c @cindex warnings, automatic ! @cindex @code{--traditional} option, @code{--posix} option and ! @cindex @code{--posix} option, @code{--traditional} option and If you supply both @option{--traditional} and @option{--posix} on the ! command line, @option{--posix} takes precedence. @command{gawk} also issues a warning if both options are supplied. @item -W profile@r{[}=@var{file}@r{]} @itemx --profile@r{[}=@var{file}@r{]} @cindex @code{--profile} option ! @cindex @command{awk} programs, profiling, enabling Enable profiling of @command{awk} programs (@pxref{Profiling, ,Profiling Your @command{awk} Programs}). By default, profiles are created in a file named @file{awkprof.out}. *************** *** 15187,15194 **** @item -W re-interval @itemx --re-interval @cindex @code{--re-interval} option ! @cindex command-line option, @code{--re-interval} ! Allow interval expressions (@pxref{Regexp Operators, , Regular Expression Operators}) in regexps. Because interval expressions were traditionally not available in @command{awk}, --- 16001,16008 ---- @item -W re-interval @itemx --re-interval @cindex @code{--re-interval} option ! @cindex regular expressions, interval expressions and ! Allows interval expressions (@pxref{Regexp Operators, , Regular Expression Operators}) in regexps. Because interval expressions were traditionally not available in @command{awk}, *************** *** 15198,15215 **** @item -W source @var{program-text} @itemx --source @var{program-text} @cindex @code{--source} option ! @cindex command-line option, @code{--source} ! Program source code is taken from the @var{program-text}. This option ! allows you to mix source code in files with source ! code that you enter on the command-line. This is particularly useful when you have library functions that you want to use from your command-line programs (@pxref{AWKPATH Variable, ,The @env{AWKPATH} Environment Variable}). @item -W version @itemx --version @cindex @code{--version} option ! @cindex command-line option, @code{--version} ! Print version information for this particular copy of @command{gawk}. This allows you to determine if your copy of @command{gawk} is up to date with respect to whatever the Free Software Foundation is currently distributing. --- 16012,16031 ---- @item -W source @var{program-text} @itemx --source @var{program-text} @cindex @code{--source} option ! @cindex source code, mixing ! Allows you to mix source code in files with source ! code that you enter on the command line. ! Program source code is taken from the @var{program-text}. ! This is particularly useful when you have library functions that you want to use from your command-line programs (@pxref{AWKPATH Variable, ,The @env{AWKPATH} Environment Variable}). @item -W version @itemx --version @cindex @code{--version} option ! @c last comma is part of tertiary ! @cindex @command{gawk}, versions of, information about, printing ! Prints version information for this particular copy of @command{gawk}. This allows you to determine if your copy of @command{gawk} is up to date with respect to whatever the Free Software Foundation is currently distributing. *************** *** 15221,15233 **** any other options are flagged as invalid with a warning message but are otherwise ignored. In compatibility mode, as a special case, if the value of @var{fs} supplied ! to the @option{-F} option is @samp{t}, then @code{FS} is set to the tab ! character (@code{"\t"}). This is only true for @option{--traditional} and not for @option{--posix} (@pxref{Field Separators, ,Specifying How Fields Are Separated}). ! The @option{-f} option may be used more than once on the command-line. If it is, @command{awk} reads its program source from all of the named files, as if they had been concatenated together into one big file. This is useful for creating libraries of @command{awk} functions. These functions --- 16037,16051 ---- any other options are flagged as invalid with a warning message but are otherwise ignored. + @cindex @code{-F} option, @code{-Ft} sets @code{FS} to TAB In compatibility mode, as a special case, if the value of @var{fs} supplied ! to the @option{-F} option is @samp{t}, then @code{FS} is set to the TAB ! character (@code{"\t"}). This is true only for @option{--traditional} and not for @option{--posix} (@pxref{Field Separators, ,Specifying How Fields Are Separated}). ! @cindex @code{-f} option, on command line ! The @option{-f} option may be used more than once on the command line. If it is, @command{awk} reads its program source from all of the named files, as if they had been concatenated together into one big file. This is useful for creating libraries of @command{awk} functions. These functions *************** *** 15239,15245 **** Library functions can still be used, even if the program is entered at the terminal, by specifying @samp{-f /dev/tty}. After typing your program, ! type @kbd{Ctrl-d} (the end-of-file character) to terminate it. (You may also use @samp{-f -} to read program source from the standard input but then you will not be able to also use the standard input as a source of data.) --- 16057,16063 ---- Library functions can still be used, even if the program is entered at the terminal, by specifying @samp{-f /dev/tty}. After typing your program, ! type @kbd{@value{CTL}-d} (the end-of-file character) to terminate it. (You may also use @samp{-f -} to read program source from the standard input but then you will not be able to also use the standard input as a source of data.) *************** *** 15251,15268 **** and library source code (@pxref{AWKPATH Variable, ,The @env{AWKPATH} Environment Variable}). If no @option{-f} or @option{--source} option is specified, then @command{gawk} uses the first non-option command-line argument as the text of the program source code. @cindex @code{POSIXLY_CORRECT} environment variable ! @cindex environment variable, @code{POSIXLY_CORRECT} ! @cindex lint checks If the environment variable @env{POSIXLY_CORRECT} exists, then @command{gawk} behaves in strict POSIX mode, exactly as if you had supplied the @option{--posix} command-line option. Many GNU programs look for this environment variable to turn on ! strict POSIX mode. If @option{--lint} is supplied on the command-line and @command{gawk} turns on POSIX mode because of @env{POSIXLY_CORRECT}, then it issues a warning message indicating that POSIX mode is in effect. --- 16069,16087 ---- and library source code (@pxref{AWKPATH Variable, ,The @env{AWKPATH} Environment Variable}). + @cindex @code{--source} option If no @option{-f} or @option{--source} option is specified, then @command{gawk} uses the first non-option command-line argument as the text of the program source code. @cindex @code{POSIXLY_CORRECT} environment variable ! @cindex lint checking, @code{POSIXLY_CORRECT} environment variable ! @cindex POSIX mode If the environment variable @env{POSIXLY_CORRECT} exists, then @command{gawk} behaves in strict POSIX mode, exactly as if you had supplied the @option{--posix} command-line option. Many GNU programs look for this environment variable to turn on ! strict POSIX mode. If @option{--lint} is supplied on the command line and @command{gawk} turns on POSIX mode because of @env{POSIXLY_CORRECT}, then it issues a warning message indicating that POSIX mode is in effect. *************** *** 15275,15282 **** export POSIXLY_CORRECT @end example ! @cindex @command{csh} utility ! For a @command{csh} compatible shell,@footnote{Not recommended.} you would add this line to the @file{.login} file in your home directory: --- 16094,16101 ---- export POSIXLY_CORRECT @end example ! @cindex @command{csh} utility, @code{POSIXLY_CORRECT} environment variable ! For a @command{csh}-compatible shell,@footnote{Not recommended.} you would add this line to the @file{.login} file in your home directory: *************** *** 15284,15297 **** setenv POSIXLY_CORRECT true @end example Having @env{POSIXLY_CORRECT} set is not recommended for daily use, but it is good for testing the portability of your programs to other environments. @node Other Arguments, AWKPATH Variable, Options, Invoking Gawk @section Other Command-Line Arguments ! Any additional arguments on the command-line are normally treated as input files to be processed in the order specified. However, an argument that has the form @code{@var{var}=@var{value}}, assigns the value @var{value} to the variable @var{var}---it does not specify a --- 16103,16121 ---- setenv POSIXLY_CORRECT true @end example + @cindex portability, @code{POSIXLY_CORRECT} environment variable Having @env{POSIXLY_CORRECT} set is not recommended for daily use, but it is good for testing the portability of your programs to other environments. + @c ENDOFRANGE ocl + @c ENDOFRANGE clo @node Other Arguments, AWKPATH Variable, Options, Invoking Gawk @section Other Command-Line Arguments + @cindex command line, arguments + @cindex arguments, command-line ! Any additional arguments on the command line are normally treated as input files to be processed in the order specified. However, an argument that has the form @code{@var{var}=@var{value}}, assigns the value @var{value} to the variable @var{var}---it does not specify a *************** *** 15299,15306 **** (This was discussed earlier in @ref{Assignment Options, ,Assigning Variables on the Command Line}.) ! @cindex @code{ARGIND} variable ! @cindex @code{ARGV} variable All these arguments are made available to your @command{awk} program in the @code{ARGV} array (@pxref{Built-in Variables}). Command-line options and the program text (if present) are omitted from @code{ARGV}. --- 16123,16130 ---- (This was discussed earlier in @ref{Assignment Options, ,Assigning Variables on the Command Line}.) ! @cindex @code{ARGIND} variable, command-line arguments ! @cindex @code{ARGC}/@code{ARGV} variables, command-line arguments All these arguments are made available to your @command{awk} program in the @code{ARGV} array (@pxref{Built-in Variables}). Command-line options and the program text (if present) are omitted from @code{ARGV}. *************** *** 15309,15314 **** --- 16133,16139 ---- sets the variable @code{ARGIND} to the index in @code{ARGV} of the current element. + @cindex input files, variable assignments and The distinction between @value{FN} arguments and variable-assignment arguments is made when @command{awk} is about to open the next input file. At that point in execution, it checks the @value{FN} to see whether *************** *** 15322,15329 **** (@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}), because such rules are run before @command{awk} begins scanning the argument list. ! @cindex dark corner ! The variable values given on the command-line are processed for escape sequences (@pxref{Escape Sequences}). @value{DARKCORNER} --- 16147,16154 ---- (@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}), because such rules are run before @command{awk} begins scanning the argument list. ! @cindex dark corner, escape sequences ! The variable values given on the command line are processed for escape sequences (@pxref{Escape Sequences}). @value{DARKCORNER} *************** *** 15343,15350 **** controlling state if multiple passes are needed over a @value{DF}. For example: ! @cindex multiple passes over data ! @cindex passes, multiple @example awk 'pass == 1 @{ @var{pass 1 stuff} @} pass == 2 @{ @var{pass 2 stuff} @}' pass=1 mydata pass=2 mydata --- 16168,16174 ---- controlling state if multiple passes are needed over a @value{DF}. For example: ! @cindex files, multiple passes over @example awk 'pass == 1 @{ @var{pass 1 stuff} @} pass == 2 @{ @var{pass 2 stuff} @}' pass=1 mydata pass=2 mydata *************** *** 15357,15368 **** @node AWKPATH Variable, Obsolete, Other Arguments, Invoking Gawk @section The @env{AWKPATH} Environment Variable @cindex @env{AWKPATH} environment variable ! @cindex environment variable, @env{AWKPATH} ! @cindex search path ! @cindex directory search ! @cindex path, search ! @cindex search path, for source files ! @cindex differences between @command{gawk} and @command{awk} @ifinfo The previous @value{SECTION} described how @command{awk} program files can be named on the command-line with the @option{-f} option. --- 16181,16189 ---- @node AWKPATH Variable, Obsolete, Other Arguments, Invoking Gawk @section The @env{AWKPATH} Environment Variable @cindex @env{AWKPATH} environment variable ! @cindex directories, searching ! @cindex search paths, for source files ! @cindex differences in @command{awk} and @command{gawk}, @code{AWKPATH} environment variable @ifinfo The previous @value{SECTION} described how @command{awk} program files can be named on the command-line with the @option{-f} option. *************** *** 15378,15389 **** The search path is a string consisting of directory names separated by colons. @command{gawk} gets its search path from the @env{AWKPATH} environment variable. If that variable does not exist, ! @command{gawk} uses a default path, which is @samp{.:/usr/local/share/awk}.@footnote{Your version of @command{gawk} may use a different directory; it will depend upon how @command{gawk} was built and installed. The actual directory is the value of @samp{$(datadir)} generated when ! @command{gawk} was configured. You probably don't need to worry about this though.} (Programs written for use by system administrators should use an @env{AWKPATH} variable that does not include the current directory, @file{.}.) --- 16199,16210 ---- The search path is a string consisting of directory names separated by colons. @command{gawk} gets its search path from the @env{AWKPATH} environment variable. If that variable does not exist, ! @command{gawk} uses a default path, @samp{.:/usr/local/share/awk}.@footnote{Your version of @command{gawk} may use a different directory; it will depend upon how @command{gawk} was built and installed. The actual directory is the value of @samp{$(datadir)} generated when ! @command{gawk} was configured. You probably don't need to worry about this, though.} (Programs written for use by system administrators should use an @env{AWKPATH} variable that does not include the current directory, @file{.}.) *************** *** 15391,15402 **** The search path feature is particularly useful for building libraries of useful @command{awk} functions. The library files can be placed in a standard directory in the default path and then specified on ! the command-line with a short @value{FN}. Otherwise, the full @value{FN} would have to be typed for each file. By using both the @option{--source} and @option{-f} options, your command-line ! @command{awk} programs can use facilities in @command{awk} library files. ! @xref{Library Functions, , A Library of @command{awk} Functions}. Path searching is not done if @command{gawk} is in compatibility mode. This is true for both @option{--traditional} and @option{--posix}. @xref{Options, ,Command-Line Options}. --- 16212,16223 ---- The search path feature is particularly useful for building libraries of useful @command{awk} functions. The library files can be placed in a standard directory in the default path and then specified on ! the command line with a short @value{FN}. Otherwise, the full @value{FN} would have to be typed for each file. By using both the @option{--source} and @option{-f} options, your command-line ! @command{awk} programs can use facilities in @command{awk} library files ! (@pxref{Library Functions, , A Library of @command{awk} Functions}). Path searching is not done if @command{gawk} is in compatibility mode. This is true for both @option{--traditional} and @option{--posix}. @xref{Options, ,Command-Line Options}. *************** *** 15426,15434 **** @node Obsolete, Undocumented, AWKPATH Variable, Invoking Gawk @section Obsolete Options and/or Features ! @cindex deprecated options ! @cindex obsolete options ! @cindex deprecated features @cindex obsolete features This @value{SECTION} describes features and/or command-line options from previous releases of @command{gawk} that are either not available in the --- 16247,16255 ---- @node Obsolete, Undocumented, AWKPATH Variable, Invoking Gawk @section Obsolete Options and/or Features ! @cindex features, advanced, See advanced features ! @cindex options, deprecated ! @cindex features, deprecated @cindex obsolete features This @value{SECTION} describes features and/or command-line options from previous releases of @command{gawk} that are either not available in the *************** *** 15437,15449 **** @c update this section for each release! For @value{PVERSION} @value{VERSION} of @command{gawk}, there are no deprecated command-line options @c or other deprecated features from the previous version of @command{gawk}. The use of @samp{next file} (two words) for @code{nextfile} was deprecated in @command{gawk} 3.0 but still worked. Starting with @value{PVERSION} 3.1, the ! two word usage is no longer accepted. The process-related special files described in @ref{Special Process, ,Special Files for Process-Related Information}, --- 16258,16272 ---- @c update this section for each release! + @cindex @code{next file} statement, deprecated + @cindex @code{nextfile} statement, @code{next file} statement and For @value{PVERSION} @value{VERSION} of @command{gawk}, there are no deprecated command-line options @c or other deprecated features from the previous version of @command{gawk}. The use of @samp{next file} (two words) for @code{nextfile} was deprecated in @command{gawk} 3.0 but still worked. Starting with @value{PVERSION} 3.1, the ! two-word usage is no longer accepted. The process-related special files described in @ref{Special Process, ,Special Files for Process-Related Information}, *************** *** 15523,15528 **** --- 16346,16355 ---- You can insert newlines after the @samp{;} in @code{for} loops. This seems to have been a long-undocumented feature in Unix @command{awk}. + Similarly, you may use @code{print} or @code{printf} statements in the + @var{init} and @var{increment} parts of a @code{for} loop. This is another + long-undocumented ``feature'' of Unix @code{awk}. + If the environment variable @env{WHINY_USERS} exists when @command{gawk} is run, then the associative @code{for} loop will go through the array *************** *** 15531,15554 **** any non-English or non-ASCII locales are not taken into account. @code{IGNORECASE} does not affect the comparison either. @end ignore @node Known Bugs, , Undocumented, Invoking Gawk @section Known Bugs in @command{gawk} ! @cindex bugs, known in @command{gawk} ! @cindex known bugs @itemize @bullet @item The @option{-F} option for changing the value of @code{FS} (@pxref{Options, ,Command-Line Options}) is not necessary given the command-line variable ! assignment feature; it remains only for backwards compatibility. @item ! Syntactically invalid single character programs tend to overflow the parse stack, generating a rather unhelpful message. Such programs ! are surprisingly difficult to diagnose in the completely general case and the effort to do so really is not worth it. @end itemize --- 16358,16389 ---- any non-English or non-ASCII locales are not taken into account. @code{IGNORECASE} does not affect the comparison either. + In addition, if @env{WHINY_USERS} is set, the profiled version of a + program generated by @option{--profile} will print all 8-bit characters + verbatim, instead of using the octal equivalent. + @end ignore @node Known Bugs, , Undocumented, Invoking Gawk @section Known Bugs in @command{gawk} ! @cindex @command{gawk}, debugging ! @cindex debugging @command{gawk} ! @cindex troubleshooting, @command{gawk} @itemize @bullet + @cindex troubleshooting, @code{-F} option + @cindex @code{-F} option, troubleshooting + @cindex @code{FS} variable, changing value of @item The @option{-F} option for changing the value of @code{FS} (@pxref{Options, ,Command-Line Options}) is not necessary given the command-line variable ! assignment feature; it remains only for backward compatibility. @item ! Syntactically invalid single-character programs tend to overflow the parse stack, generating a rather unhelpful message. Such programs ! are surprisingly difficult to diagnose in the completely general case, and the effort to do so really is not worth it. @end itemize *************** *** 15579,15584 **** --- 16414,16425 ---- @node Library Functions, Sample Programs, Invoking Gawk, Top @chapter A Library of @command{awk} Functions + @c STARTOFRANGE libf + @cindex libraries of @command{awk} functions + @c STARTOFRANGE flib + @cindex functions, library + @c STARTOFRANGE fudlib + @cindex functions, user-defined, library of @ref{User-defined, ,User-Defined Functions}, describes how to write your own @command{awk} functions. Writing functions is important, because *************** *** 15605,15625 **** for this @value{DOCUMENT}. (This has already been done as part of the @command{gawk} distribution.) ! If you have written one or more useful, general purpose @command{awk} functions and would like to contribute them to the author's collection of @command{awk} programs, see @ref{How To Contribute, ,How to Contribute}, for more information. ! @cindex portability issues The programs in this @value{CHAPTER} and in @ref{Sample Programs, ,Practical @command{awk} Programs}, freely use features that are @command{gawk}-specific. ! It is straightforward to rewrite these programs for ! different implementations of @command{awk}. Diagnostic error messages are sent to @file{/dev/stderr}. ! Use @samp{| "cat 1>&2"} instead of @samp{> "/dev/stderr"}, if your system ! does not have a @file{/dev/stderr} or if you cannot use @command{gawk}. A number of programs use @code{nextfile} (@pxref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}) --- 16446,16465 ---- for this @value{DOCUMENT}. (This has already been done as part of the @command{gawk} distribution.) ! If you have written one or more useful, general-purpose @command{awk} functions and would like to contribute them to the author's collection of @command{awk} programs, see @ref{How To Contribute, ,How to Contribute}, for more information. ! @cindex portability, example programs The programs in this @value{CHAPTER} and in @ref{Sample Programs, ,Practical @command{awk} Programs}, freely use features that are @command{gawk}-specific. ! Rewriting these programs for different implementations of awk is pretty straightforward. Diagnostic error messages are sent to @file{/dev/stderr}. ! Use @samp{| "cat 1>&2"} instead of @samp{> "/dev/stderr"} if your system ! does not have a @file{/dev/stderr}, or if you cannot use @command{gawk}. A number of programs use @code{nextfile} (@pxref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}) *************** *** 15628,15633 **** --- 16468,16475 ---- shows you how to write a function that does the same thing. @c 12/2000: Thanks to Nelson Beebe for pointing out the output issue. + @cindex case sensitivity, example programs + @cindex @code{IGNORECASE} variable, in example programs Finally, some of the programs choose to ignore upper- and lowercase distinctions in their input. They do so by assigning one to @code{IGNORECASE}. You can achieve almost the same effect@footnote{The effects are *************** *** 15643,15649 **** @noindent Also, verify that all regexp and string constants used in ! comparisons only use lowercase letters. @menu * Library Names:: How to best name private global variables in --- 16485,16491 ---- @noindent Also, verify that all regexp and string constants used in ! comparisons use only lowercase letters. @menu * Library Names:: How to best name private global variables in *************** *** 15660,15674 **** @node Library Names, General Functions, Library Functions, Library Functions @section Naming Library Function Global Variables ! @cindex names, use of ! @cindex namespace issues in @command{awk} ! @cindex documenting @command{awk} programs ! @cindex programs, documenting Due to the way the @command{awk} language evolved, variables are either @dfn{global} (usable by the entire program) or @dfn{local} (usable just by a specific function). There is no intermediate state analogous to @code{static} variables in C. Library functions often need to have global variables that they can use to preserve state information between calls to the function---for example, @code{getopt}'s variable @code{_opti} --- 16502,16520 ---- @node Library Names, General Functions, Library Functions, Library Functions @section Naming Library Function Global Variables ! @cindex names, arrays/variables ! @cindex names, functions ! @cindex namespace issues ! @cindex @command{awk} programs, documenting ! @cindex documentation, of @command{awk} programs Due to the way the @command{awk} language evolved, variables are either @dfn{global} (usable by the entire program) or @dfn{local} (usable just by a specific function). There is no intermediate state analogous to @code{static} variables in C. + @cindex variables, global, for library functions + @cindex private variables + @cindex variables, private Library functions often need to have global variables that they can use to preserve state information between calls to the function---for example, @code{getopt}'s variable @code{_opti} *************** *** 15682,15695 **** name like @samp{i} or @samp{j} is not a good choice, because user programs often use variable names like these for their own purposes. ! @cindex conventions, programming ! @cindex programming conventions The example programs shown in this @value{CHAPTER} all start the names of their private variables with an underscore (@samp{_}). Users generally don't use leading underscores in their variable names, so this convention immediately decreases the chances that the variable name will be accidentally shared with the user's program. In addition, several of the library functions use a prefix that helps indicate what function or set of functions use the variables---for example, @code{_pw_byname} in the user database routines --- 16528,16542 ---- name like @samp{i} or @samp{j} is not a good choice, because user programs often use variable names like these for their own purposes. ! @cindex programming conventions, private variable names The example programs shown in this @value{CHAPTER} all start the names of their private variables with an underscore (@samp{_}). Users generally don't use leading underscores in their variable names, so this convention immediately decreases the chances that the variable name will be accidentally shared with the user's program. + @cindex @code{_} (underscore), in names of private variables + @cindex underscore (@code{_}), in names of private variables In addition, several of the library functions use a prefix that helps indicate what function or set of functions use the variables---for example, @code{_pw_byname} in the user database routines *************** *** 15699,15705 **** convention is used equally well for variable names and for private function names as well.@footnote{While all the library routines could have been rewritten to use this convention, this was not done, in order to ! show how my own @command{awk} programming style has evolved, and to provide some basis for this discussion.} As a final note on variable naming, if a function makes global variables --- 16546,16552 ---- convention is used equally well for variable names and for private function names as well.@footnote{While all the library routines could have been rewritten to use this convention, this was not done, in order to ! show how my own @command{awk} programming style has evolved and to provide some basis for this discussion.} As a final note on variable naming, if a function makes global variables *************** *** 15711,15716 **** --- 16558,16564 ---- the variable name is not all capital letters indicates that the variable is not one of @command{awk}'s built-in variables, such as @code{FS}. + @cindex @code{--dump-variables} option It is also important that @emph{all} variables in library functions that do not need to save state are, in fact, declared local.@footnote{@command{gawk}'s @option{--dump-variables} command-line *************** *** 15727,15732 **** --- 16575,16583 ---- @} @end example + @cindex arrays, associative, library functions and + @cindex libraries of @command{awk} functions, associative arrays and + @cindex functions, library, associative arrays and @cindex Tcl A different convention, common in the Tcl community, is to use a single associative array to hold the values needed by the library function(s), or *************** *** 15765,15773 **** @node Nextfile Function, Assert Function, General Functions, General Functions @subsection Implementing @code{nextfile} as a Function - @cindex skipping input files @cindex input files, skipping ! The @code{nextfile} statement presented in @ref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}, is a @command{gawk}-specific extension---it is not available in most other implementations of @command{awk}. This @value{SECTION} shows two versions of a --- 16616,16630 ---- @node Nextfile Function, Assert Function, General Functions, General Functions @subsection Implementing @code{nextfile} as a Function @cindex input files, skipping ! @c STARTOFRANGE libfnex ! @cindex libraries of @command{awk} functions, @code{nextfile} statement ! @c STARTOFRANGE flibnex ! @cindex functions, library, @code{nextfile} statement ! @c STARTOFRANGE nexim ! @cindex @code{nextfile} statement, implementing ! @cindex @command{gawk}, @code{nextfile} statement in ! The @code{nextfile} statement, presented in @ref{Nextfile Statement, ,Using @command{gawk}'s @code{nextfile} Statement}, is a @command{gawk}-specific extension---it is not available in most other implementations of @command{awk}. This @value{SECTION} shows two versions of a *************** *** 15784,15791 **** _abandon_ == FILENAME @{ next @} @end example ! @cindex conventions, programming ! @cindex programming conventions Because it supplies a rule that must be executed first, this file should be included before the main program. This rule compares the current @value{DF}'s name (which is always in the @code{FILENAME} variable) to --- 16641,16647 ---- _abandon_ == FILENAME @{ next @} @end example ! @cindex programming conventions, @code{nextfile} statement Because it supplies a rule that must be executed first, this file should be included before the main program. This rule compares the current @value{DF}'s name (which is always in the @code{FILENAME} variable) to *************** *** 15800,15806 **** The end of the file is eventually reached and a new @value{DF} is opened, changing the value of @code{FILENAME}. Once this happens, the comparison of @code{_abandon_} to @code{FILENAME} ! fails and execution continues with the first rule of the ``real'' program. The @code{nextfile} function itself simply sets the value of @code{_abandon_} and then executes a @code{next} statement to start the --- 16656,16662 ---- The end of the file is eventually reached and a new @value{DF} is opened, changing the value of @code{FILENAME}. Once this happens, the comparison of @code{_abandon_} to @code{FILENAME} ! fails, and execution continues with the first rule of the ``real'' program. The @code{nextfile} function itself simply sets the value of @code{_abandon_} and then executes a @code{next} statement to start the *************** *** 15819,15825 **** If the same @value{DF} is listed @emph{twice} on the commandline, one right after the other or even with just a variable assignment between them, ! this code skips right through the file, a second time, even though it should stop when it gets to the end of the first occurrence. A second version of @code{nextfile} that remedies this problem is shown here: --- 16675,16681 ---- If the same @value{DF} is listed @emph{twice} on the commandline, one right after the other or even with just a variable assignment between them, ! this code skips right through the file a second time, even though it should stop when it gets to the end of the first occurrence. A second version of @code{nextfile} that remedies this problem is shown here: *************** *** 15885,15896 **** @command{awk}, because @command{awk} programs are generally I/O-bound (i.e., they spend most of their time doing input and output, instead of performing computations). @node Assert Function, Round Function, Nextfile Function, General Functions @subsection Assertions @cindex assertions ! @cindex @code{assert} C library function When writing large programs, it is often useful to know that a condition or set of conditions is true. Before proceeding with a particular computation, you make a statement about what you believe to be --- 16741,16762 ---- @command{awk}, because @command{awk} programs are generally I/O-bound (i.e., they spend most of their time doing input and output, instead of performing computations). + @c ENDOFRANGE libfnex + @c ENDOFRANGE flibnex + @c ENDOFRANGE nexim @node Assert Function, Round Function, Nextfile Function, General Functions @subsection Assertions + @c STARTOFRANGE asse @cindex assertions ! @c STARTOFRANGE assef ! @cindex @code{assert} function (C library) ! @c STARTOFRANGE libfass ! @cindex libraries of @command{awk} functions, assertions ! @c STARTOFRANGE flibass ! @cindex functions, library, assertions ! @cindex @command{awk} programs, lengthy, assertions When writing large programs, it is often useful to know that a condition or set of conditions is true. Before proceeding with a particular computation, you make a statement about what you believe to be *************** *** 15963,15969 **** parameter to describe the failed condition. It then sets the variable @code{_assert_exit} to one and executes the @code{exit} statement. The @code{exit} statement jumps to the @code{END} rule. If the @code{END} ! rules finds @code{_assert_exit} to be true, it then exits immediately. The purpose of the test in the @code{END} rule is to keep any other @code{END} rules from running. When an assertion fails, the --- 16829,16835 ---- parameter to describe the failed condition. It then sets the variable @code{_assert_exit} to one and executes the @code{exit} statement. The @code{exit} statement jumps to the @code{END} rule. If the @code{END} ! rules finds @code{_assert_exit} to be true, it exits immediately. The purpose of the test in the @code{END} rule is to keep any other @code{END} rules from running. When an assertion fails, the *************** *** 15990,15995 **** --- 16856,16862 ---- mydata:1357: assertion failed: a <= 5 && b >= 17.1 @end example + @cindex @code{END} pattern, @code{assert} user-defined function and There is a small problem with this version of @code{assert}. An @code{END} rule is automatically added to the program calling @code{assert}. Normally, if a program consists *************** *** 15999,16012 **** --- 16866,16891 ---- (@pxref{Using BEGIN/END, , Startup and Cleanup Actions}), most likely causing the program to hang as it waits for input. + @cindex @code{BEGIN} pattern, @code{assert} user-defined function and There is a simple workaround to this: make sure the @code{BEGIN} rule always ends with an @code{exit} statement. + @c ENDOFRANGE asse + @c ENDOFRANGE assef + @c ENDOFRANGE flibass + @c ENDOFRANGE libfass @node Round Function, Cliff Random Function, Assert Function, General Functions @subsection Rounding Numbers @cindex rounding + @cindex rounding numbers + @cindex numbers, rounding + @cindex libraries of @command{awk} functions, rounding numbers + @cindex functions, library, rounding numbers + @cindex @code{print} statement, @code{sprintf} function and + @cindex @code{printf} statement, @code{sprintf} function and + @cindex @code{sprintf} function, @code{print}/@code{printf} statements and The way @code{printf} and @code{sprintf} (@pxref{Printf, , Using @code{printf} Statements for Fancier Printing}) perform rounding often depends upon the system's C @code{sprintf} *************** *** 16022,16028 **** @cindex @code{round} user-defined function @example @c file eg/lib/round.awk ! # round --- do normal rounding @c endfile @ignore @c file eg/lib/round.awk --- 16901,16907 ---- @cindex @code{round} user-defined function @example @c file eg/lib/round.awk ! # round.awk --- do normal rounding @c endfile @ignore @c file eg/lib/round.awk *************** *** 16067,16072 **** --- 16946,16953 ---- @subsection The Cliff Random Number Generator @cindex random numbers, Cliff @cindex Cliff random numbers + @cindex numbers, Cliff random + @cindex functions, library, Cliff random numbers The Cliff random number generator@footnote{@uref{http://mathworld.wolfram.com/CliffRandomNumberGenerator.hmtl}} *************** *** 16109,16116 **** @node Ordinal Functions, Join Function, Cliff Random Function, General Functions @subsection Translating Between Characters and Numbers ! @cindex numeric character values ! @cindex values of characters as numbers One commercial implementation of @command{awk} supplies a built-in function, @code{ord}, which takes a character and returns the numeric value for that character in the machine's character set. If the string passed to --- 16990,16999 ---- @node Ordinal Functions, Join Function, Cliff Random Function, General Functions @subsection Translating Between Characters and Numbers ! @cindex libraries of @command{awk} functions, character values as numbers ! @cindex functions, library, character values as numbers ! @cindex characters, values of as numbers ! @cindex numbers, as values of characters One commercial implementation of @command{awk} supplies a built-in function, @code{ord}, which takes a character and returns the numeric value for that character in the machine's character set. If the string passed to *************** *** 16166,16179 **** @c endfile @end example ! @cindex character sets (machine character encodings) @cindex character encodings @cindex ASCII @cindex EBCDIC @cindex mark parity Some explanation of the numbers used by @code{chr} is worthwhile. The most prominent character set in use today is ASCII. Although an ! eight-bit byte can hold 256 distinct values (from 0 to 255), ASCII only defines characters that use the values from 0 to 127.@footnote{ASCII has been extended in many countries to use the values from 128 to 255 for country-specific characters. If your system uses these extensions, --- 17049,17062 ---- @c endfile @end example ! @cindex character sets @cindex character encodings @cindex ASCII @cindex EBCDIC @cindex mark parity Some explanation of the numbers used by @code{chr} is worthwhile. The most prominent character set in use today is ASCII. Although an ! 8-bit byte can hold 256 distinct values (from 0 to 255), ASCII only defines characters that use the values from 0 to 127.@footnote{ASCII has been extended in many countries to use the values from 128 to 255 for country-specific characters. If your system uses these extensions, *************** *** 16227,16233 **** @node Join Function, Gettimeofday Function, Ordinal Functions, General Functions @subsection Merging an Array into a String ! @cindex merging strings When doing string processing, it is often useful to be able to join all the strings in an array into one long string. The following function, @code{join}, accomplishes this task. It is used later in several of --- 17110,17119 ---- @node Join Function, Gettimeofday Function, Ordinal Functions, General Functions @subsection Merging an Array into a String ! @cindex libraries of @command{awk} functions, merging arrays into strings ! @cindex functions, library, merging arrays into strings ! @cindex strings, merging arrays into ! @cindex arrays, merging into strings When doing string processing, it is often useful to be able to join all the strings in an array into one long string. The following function, @code{join}, accomplishes this task. It is used later in several of *************** *** 16270,16276 **** @end example An optional additional argument is the separator to use when joining the ! strings back together. If the caller supplies a non-empty value, @code{join} uses it; if it is not supplied, it has a null value. In this case, @code{join} uses a single blank as a default separator for the strings. If the value is equal to @code{SUBSEP}, --- 17156,17162 ---- @end example An optional additional argument is the separator to use when joining the ! strings back together. If the caller supplies a nonempty value, @code{join} uses it; if it is not supplied, it has a null value. In this case, @code{join} uses a single blank as a default separator for the strings. If the value is equal to @code{SUBSEP}, *************** *** 16284,16291 **** @node Gettimeofday Function, , Join Function, General Functions @subsection Managing the Time of Day ! @cindex formatted timestamps @cindex timestamps, formatted The @code{systime} and @code{strftime} functions described in @ref{Time Functions, ,Using @command{gawk}'s Timestamp Functions}, provide the minimum functionality necessary for dealing with the time of day --- 17170,17179 ---- @node Gettimeofday Function, , Join Function, General Functions @subsection Managing the Time of Day ! @cindex libraries of @command{awk} functions, managing, time ! @cindex functions, library, managing time @cindex timestamps, formatted + @cindex time, managing The @code{systime} and @code{strftime} functions described in @ref{Time Functions, ,Using @command{gawk}'s Timestamp Functions}, provide the minimum functionality necessary for dealing with the time of day *************** *** 16382,16389 **** @node Data File Management, Getopt Function, General Functions, Library Functions @section @value{DDF} Management This @value{SECTION} presents functions that are useful for managing ! command-line datafiles. @menu * Filetrans Function:: A function for handling data file transitions. --- 17270,17283 ---- @node Data File Management, Getopt Function, General Functions, Library Functions @section @value{DDF} Management + @c STARTOFRANGE dataf + @cindex files, managing + @c STARTOFRANGE libfdataf + @cindex libraries of @command{awk} functions, managing, @value{DF}s + @c STARTOFRANGE flibdataf + @cindex functions, library, managing @value{DF}s This @value{SECTION} presents functions that are useful for managing ! command-line @value{DF}s. @menu * Filetrans Function:: A function for handling data file transitions. *************** *** 16395,16402 **** @node Filetrans Function, Rewind Function, Data File Management, Data File Management @subsection Noting @value{DDF} Boundaries ! @cindex per file initialization and cleanup ! The @code{BEGIN} and @code{END} rules are each executed exactly once, at the beginning and end of your @command{awk} program, respectively (@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}). We (the @command{gawk} authors) once had a user who mistakenly thought that the --- 17289,17297 ---- @node Filetrans Function, Rewind Function, Data File Management, Data File Management @subsection Noting @value{DDF} Boundaries ! @cindex files, managing, @value{DF} boundaries ! @cindex files, initialization and cleanup ! The @code{BEGIN} and @code{END} rules are each executed exactly once at the beginning and end of your @command{awk} program, respectively (@pxref{BEGIN/END, ,The @code{BEGIN} and @code{END} Special Patterns}). We (the @command{gawk} authors) once had a user who mistakenly thought that the *************** *** 16500,16505 **** --- 17395,17401 ---- @node Rewind Function, File Checking, Filetrans Function, Data File Management @subsection Rereading the Current File + @cindex files, reading Another request for a new built-in function was for a @code{rewind} function that would make it possible to reread the current file. The requesting user didn't want to have to use @code{getline} *************** *** 16565,16575 **** @node File Checking, Ignoring Assigns, Rewind Function, Data File Management @subsection Checking for Readable @value{DDF}s ! @cindex fatal errors @cindex readable @value{DF}s, checking ! @cindex non-readable @value{DF}s, skipping ! @cindex @value{DF}s, non-readable, skipping ! @cindex @value{DF}s, readable, checking Normally, if you give @command{awk} a @value{DF} that isn't readable, it stops with a fatal error. There are times when you might want to just ignore such files and keep going. You can --- 17461,17470 ---- @node File Checking, Ignoring Assigns, Rewind Function, Data File Management @subsection Checking for Readable @value{DDF}s ! @cindex troubleshooting, readable @value{DF}s ! @c comma is part of primary @cindex readable @value{DF}s, checking ! @cindex files, skipping Normally, if you give @command{awk} a @value{DF} that isn't readable, it stops with a fatal error. There are times when you might want to just ignore such files and keep going. You can *************** *** 16604,16610 **** @c endfile @end example ! @cindex fatal errors In @command{gawk}, the @code{getline} won't be fatal (unless @option{--posix} is in force). Removing the element from @code{ARGV} with @code{delete} --- 17499,17505 ---- @c endfile @end example ! @cindex troubleshooting, @code{getline} function In @command{gawk}, the @code{getline} won't be fatal (unless @option{--posix} is in force). Removing the element from @code{ARGV} with @code{delete} *************** *** 16615,16620 **** --- 17510,17517 ---- @node Ignoring Assigns, , File Checking, Data File Management @subsection Treating Assignments as @value{FFN}s + @cindex assignments as filenames + @cindex filenames, assignments as Occasionally, you might not want @command{awk} to process command-line variable assignments (@pxref{Assignment Options, ,Assigning Variables on the Command Line}). *************** *** 16669,16681 **** assignments at invocation time, by giving the variable a true value. When not set, it is initially zero (i.e., false), so the command-line arguments are left alone. @node Getopt Function, Passwd Functions, Data File Management, Library Functions @section Processing Command-Line Options ! @cindex @code{getopt} C library function ! @cindex processing arguments ! @cindex argument processing Most utilities on POSIX compatible systems take options, or ``switches,'' on the command line that can be used to change the way a program behaves. @command{awk} is an example of such a program --- 17566,17589 ---- assignments at invocation time, by giving the variable a true value. When not set, it is initially zero (i.e., false), so the command-line arguments are left alone. + @c ENDOFRANGE dataf + @c ENDOFRANGE flibdataf + @c ENDOFRANGE libfdataf @node Getopt Function, Passwd Functions, Data File Management, Library Functions @section Processing Command-Line Options ! @c STARTOFRANGE libfclo ! @cindex libraries of @command{awk} functions, command-line options ! @c STARTOFRANGE flibclo ! @cindex functions, library, command-line options ! @c STARTOFRANGE clop ! @cindex command-line options, processing ! @c STARTOFRANGE oclp ! @cindex options, command-line, processing ! @c STARTOFRANGE clibf ! @cindex functions, library, C library ! @cindex arguments, processing Most utilities on POSIX compatible systems take options, or ``switches,'' on the command line that can be used to change the way a program behaves. @command{awk} is an example of such a program *************** *** 16686,16691 **** --- 17594,17600 ---- The first occurrence on the command line of either @option{--} or a string that does not begin with @samp{-} ends the options. + @cindex @code{getopt} function (C library) Modern Unix systems provide a C function named @code{getopt} for processing command-line arguments. The programmer provides a string describing the one-letter options. If an option requires an argument, it is followed in the *************** *** 16698,16704 **** When using @code{getopt}, options that do not take arguments can be grouped together. Furthermore, options that take arguments require that the ! argument is present. The argument can immediately follow the option letter or it can be a separate command-line argument. Given a hypothetical program that takes --- 17607,17613 ---- When using @code{getopt}, options that do not take arguments can be grouped together. Furthermore, options that take arguments require that the ! argument is present. The argument can immediately follow the option letter, or it can be a separate command-line argument. Given a hypothetical program that takes *************** *** 16723,16729 **** @table @code @item optind The index in the argument value array (@code{argv}) where the first ! non-option command-line argument can be found. @item optarg The string value of the argument to an option. --- 17632,17638 ---- @table @code @item optind The index in the argument value array (@code{argv}) where the first ! nonoption command-line argument can be found. @item optarg The string value of the argument to an option. *************** *** 16789,16794 **** --- 17698,17704 ---- The discussion that follows walks through the code a bit at a time: + @cindex @code{getopt} user-defined function @example @c file eg/lib/getopt.awk # getopt.awk --- do C library getopt(3) function in awk *************** *** 16805,16811 **** @end ignore @c file eg/lib/getopt.awk # External variables: ! # Optind -- index in ARGV of first non-option argument # Optarg -- string value of argument to current option # Opterr -- if nonzero, print our own diagnostic # Optopt -- current option letter --- 17715,17721 ---- @end ignore @c file eg/lib/getopt.awk # External variables: ! # Optind -- index in ARGV of first nonoption argument # Optarg -- string value of argument to current option # Opterr -- if nonzero, print our own diagnostic # Optopt -- current option letter *************** *** 16861,16867 **** perhaps a bit of overkill; it checks for a @samp{-} followed by anything that is not whitespace and not a colon. If the current command-line argument does not match this pattern, ! it is not an option, and it ends option processing. @example @c file eg/lib/getopt.awk --- 17771,17777 ---- perhaps a bit of overkill; it checks for a @samp{-} followed by anything that is not whitespace and not a colon. If the current command-line argument does not match this pattern, ! it is not an option, and it ends option processing: @example @c file eg/lib/getopt.awk *************** *** 16929,16935 **** in the @code{options} string. If there are remaining characters in the current command-line argument (@code{argv[Optind]}), then the rest of that string is assigned to @code{Optarg}. Otherwise, the next command-line ! argument is used (@samp{-xFOO} vs.@: @samp{@w{-x FOO}}). In either case, @code{_opti} is reset to zero, because there are no more characters left to examine in the current command-line argument. Continuing: --- 17839,17845 ---- in the @code{options} string. If there are remaining characters in the current command-line argument (@code{argv[Optind]}), then the rest of that string is assigned to @code{Optarg}. Otherwise, the next command-line ! argument is used (@samp{-xFOO} versus @samp{@w{-x FOO}}). In either case, @code{_opti} is reset to zero, because there are no more characters left to examine in the current command-line argument. Continuing: *************** *** 17005,17030 **** Several of the sample programs presented in @ref{Sample Programs, ,Practical @command{awk} Programs}, use @code{getopt} to process their arguments. @node Passwd Functions, Group Functions, Getopt Function, Library Functions @section Reading the User Database The @code{PROCINFO} array (@pxref{Built-in Variables}) ! provides access to the current user's real and effective user and group id numbers, and if available, the user's supplementary group set. However, because these are numbers, they do not provide very useful information to the average user. There needs to be some way to find the ! user information associated with the user and group numbers. This @value{SECTION} presents a suite of functions for retrieving information from the user database. @xref{Group Functions, ,Reading the Group Database}, for a similar suite that retrieves information from the group database. ! @cindex @code{getpwent} C library function ! @cindex user information @cindex login information @cindex account information @cindex password file The POSIX standard does not define the file where user information is kept. Instead, it provides the @code{} header file and several C language subroutines for obtaining user information. --- 17915,17957 ---- Several of the sample programs presented in @ref{Sample Programs, ,Practical @command{awk} Programs}, use @code{getopt} to process their arguments. + @c ENDOFRANGE libfclo + @c ENDOFRANGE flibclo + @c ENDOFRANGE clop + @c ENDOFRANGE oclp @node Passwd Functions, Group Functions, Getopt Function, Library Functions @section Reading the User Database + @c STARTOFRANGE libfudata + @cindex libraries of @command{awk} functions, user database, reading + @c STARTOFRANGE flibudata + @cindex functions, library, user database, reading + @c last comma is part of primary + @c STARTOFRANGE udatar + @cindex user database, reading + @c last comma is part of secondary + @c STARTOFRANGE dataur + @cindex database, users, reading + @cindex @code{PROCINFO} array The @code{PROCINFO} array (@pxref{Built-in Variables}) ! provides access to the current user's real and effective user and group ID numbers, and if available, the user's supplementary group set. However, because these are numbers, they do not provide very useful information to the average user. There needs to be some way to find the ! user information associated with the user and group ID numbers. This @value{SECTION} presents a suite of functions for retrieving information from the user database. @xref{Group Functions, ,Reading the Group Database}, for a similar suite that retrieves information from the group database. ! @cindex @code{getpwent} function (C library) ! @cindex @code{getpwent} user-defined function ! @cindex users, information about, retrieving @cindex login information @cindex account information @cindex password file + @cindex files, password The POSIX standard does not define the file where user information is kept. Instead, it provides the @code{} header file and several C language subroutines for obtaining user information. *************** *** 17044,17050 **** is called, it returns the next entry in the database. When there are no more entries, it returns @code{NULL}, the null pointer. When this happens, the C program should call @code{endpwent} to close the database. ! Following is @command{pwcat}, a C program that ``cats'' the password database. @c Use old style function header for portability to old systems (SunOS, HP/UX). --- 17971,17977 ---- is called, it returns the next entry in the database. When there are no more entries, it returns @code{NULL}, the null pointer. When this happens, the C program should call @code{endpwent} to close the database. ! Following is @command{pwcat}, a C program that ``cats'' the password database: @c Use old style function header for portability to old systems (SunOS, HP/UX). *************** *** 17100,17109 **** The user's encrypted password. This may not be available on some systems. @item User-ID ! The user's numeric user-id number. @item Group-ID ! The user's numeric group-id number. @item Full name The user's full name, and perhaps other information associated with the --- 18027,18036 ---- The user's encrypted password. This may not be available on some systems. @item User-ID ! The user's numeric user ID number. @item Group-ID ! The user's numeric group ID number. @item Full name The user's full name, and perhaps other information associated with the *************** *** 17124,17132 **** @item Encrypted password @tab The user's encrypted password. This may not be available on some systems. ! @item User-ID @tab The user's numeric user-id number. ! @item Group-ID @tab The user's numeric group-id number. @item Full name @tab The user's full name, and perhaps other information associated with the user. --- 18051,18059 ---- @item Encrypted password @tab The user's encrypted password. This may not be available on some systems. ! @item User-ID @tab The user's numeric user ID number. ! @item Group-ID @tab The user's numeric group ID number. @item Full name @tab The user's full name, and perhaps other information associated with the user. *************** *** 17213,17218 **** --- 18140,18146 ---- @c endfile @end example + @cindex @code{BEGIN} pattern, @code{pwcat} program The @code{BEGIN} rule sets a private variable to the directory where @command{pwcat} is stored. Because it is used to help out an @command{awk} library routine, we have chosen to put it in @file{/usr/local/libexec/awk}; *************** *** 17220,17230 **** The function @code{_pw_init} keeps three copies of the user information in three associative arrays. The arrays are indexed by username ! (@code{_pw_byname}), by user-id number (@code{_pw_byuid}), and by order of occurrence (@code{_pw_bycount}). The variable @code{_pw_inited} is used for efficiency; @code{_pw_init} needs only to be called once. Because this function uses @code{getline} to read information from @command{pwcat}, it first saves the values of @code{FS}, @code{RS}, and @code{$0}. It notes in the variable @code{using_fw} whether field splitting --- 18148,18159 ---- The function @code{_pw_init} keeps three copies of the user information in three associative arrays. The arrays are indexed by username ! (@code{_pw_byname}), by user ID number (@code{_pw_byuid}), and by order of occurrence (@code{_pw_bycount}). The variable @code{_pw_inited} is used for efficiency; @code{_pw_init} needs only to be called once. + @cindex @code{getline} command, @code{_pw_init} function Because this function uses @code{getline} to read information from @command{pwcat}, it first saves the values of @code{FS}, @code{RS}, and @code{$0}. It notes in the variable @code{using_fw} whether field splitting *************** *** 17250,17257 **** @c NEXT ED: All of these functions don't need the ... in ... test. Just @c return the array element, which will be "" if not already there. Duh. The @code{getpwnam} function takes a username as a string argument. If that ! user is in the database, it returns the appropriate line. Otherwise it returns the null string: @cindex @code{getpwnam} user-defined function --- 18179,18187 ---- @c NEXT ED: All of these functions don't need the ... in ... test. Just @c return the array element, which will be "" if not already there. Duh. + @cindex @code{getpwnam} function (C library) The @code{getpwnam} function takes a username as a string argument. If that ! user is in the database, it returns the appropriate line. Otherwise, it returns the null string: @cindex @code{getpwnam} user-defined function *************** *** 17269,17277 **** @end group @end example Similarly, ! the @code{getpwuid} function takes a user-id number argument. If that ! user number is in the database, it returns the appropriate line. Otherwise it returns the null string: @cindex @code{getpwuid} user-defined function --- 18199,18208 ---- @end group @end example + @cindex @code{getpwuid} function (C library) Similarly, ! the @code{getpwuid} function takes a user ID number argument. If that ! user number is in the database, it returns the appropriate line. Otherwise, it returns the null string: @cindex @code{getpwuid} user-defined function *************** *** 17287,17292 **** --- 18218,18224 ---- @c endfile @end example + @cindex @code{getpwent} function (C library) The @code{getpwent} function simply steps through the database, one entry at a time. It uses @code{_pw_count} to track its current position in the @code{_pw_bycount} array: *************** *** 17304,17309 **** --- 18236,18242 ---- @c endfile @end example + @cindex @code{endpwent} function (C library) The @code{@w{endpwent}} function resets @code{@w{_pw_count}} to zero, so that subsequent calls to @code{getpwent} start over again: *************** *** 17317,17323 **** @c endfile @end example ! A conscious design decision in this suite is that each subroutine calls @code{@w{_pw_init}} to initialize the database arrays. The overhead of running a separate process to generate the user database, and the I/O to scan it, are only incurred if the user's main program actually calls one of these --- 18250,18256 ---- @c endfile @end example ! A conscious design decision in this suite was made that each subroutine calls @code{@w{_pw_init}} to initialize the database arrays. The overhead of running a separate process to generate the user database, and the I/O to scan it, are only incurred if the user's main program actually calls one of these *************** *** 17337,17350 **** The @command{id} program in @ref{Id Program, ,Printing out User Information}, uses these functions. @node Group Functions, , Passwd Functions, Library Functions @section Reading the Group Database ! @cindex @code{getgrent} C library function ! @cindex group information @cindex account information @cindex group file Much of the discussion presented in @ref{Passwd Functions, ,Reading the User Database}, applies to the group database as well. Although there has traditionally --- 18270,18299 ---- The @command{id} program in @ref{Id Program, ,Printing out User Information}, uses these functions. + @c ENDOFRANGE libfudata + @c ENDOFRANGE flibudata + @c ENDOFRANGE udatar + @c ENDOFRANGE dataur @node Group Functions, , Passwd Functions, Library Functions @section Reading the Group Database ! @c STARTOFRANGE libfgdata ! @cindex libraries of @command{awk} functions, group database, reading ! @c STARTOFRANGE flibgdata ! @cindex functions, library, group database, reading ! @c STARTOFRANGE gdatar ! @cindex group database, reading ! @c STARTOFRANGE datagr ! @cindex database, group, reading ! @cindex @code{PROCINFO} array ! @cindex @code{getgrent} function (C library) ! @cindex @code{getgrent} user-defined function ! @c comma is part of primary ! @cindex groups, information about @cindex account information @cindex group file + @cindex files, group Much of the discussion presented in @ref{Passwd Functions, ,Reading the User Database}, applies to the group database as well. Although there has traditionally *************** *** 17375,17380 **** --- 18324,18337 ---- * Public Domain */ + /* For OS/2, do nothing. */ + #if HAVE_CONFIG_H + #include + #endif + + #ifndef HAVE_GETPGRENT + int main() { exit(0); } + #else @c endfile @end ignore @c file eg/lib/grcat.c *************** *** 17406,17411 **** --- 18363,18373 ---- @} @c endfile @end example + @ignore + @c file eg/lib/grcat.c + #endif /* HAVE_GETPGRENT */ + @c endfile + @end ignore Each line in the group database represents one group. The fields are separated with colons and represent the following information: *************** *** 17420,17433 **** usually empty or set to @samp{*}. @item Group ID Number ! The numeric group-id number. This number should be unique within the file. @item Group Member List A comma-separated list of usernames. These users are members of the group. Modern Unix systems allow users to be members of several groups simultaneously. If your system does, then there are elements @code{"group1"} through @code{"group@var{N}"} in @code{PROCINFO} ! for those group-id numbers. (Note that @code{PROCINFO} is a @command{gawk} extension; @pxref{Built-in Variables}.) @end table --- 18382,18395 ---- usually empty or set to @samp{*}. @item Group ID Number ! The numeric group ID number. This number is unique within the file. @item Group Member List A comma-separated list of usernames. These users are members of the group. Modern Unix systems allow users to be members of several groups simultaneously. If your system does, then there are elements @code{"group1"} through @code{"group@var{N}"} in @code{PROCINFO} ! for those group ID numbers. (Note that @code{PROCINFO} is a @command{gawk} extension; @pxref{Built-in Variables}.) @end table *************** *** 17440,17453 **** it is usually empty or set to @samp{*}. @item Group-ID @tab ! The group's numeric group-id number; this number should be unique within the file. @item Group member list @tab A comma-separated list of usernames. These users are members of the group. Modern Unix systems allow users to be members of several groups simultaneously. If your system does, then there are elements @code{"group1"} through @code{"group@var{N}"} in @code{PROCINFO} ! for those group-id numbers. (Note that @code{PROCINFO} is a @command{gawk} extension; @pxref{Built-in Variables}.) @end multitable --- 18402,18415 ---- it is usually empty or set to @samp{*}. @item Group-ID @tab ! The group's numeric group ID number; this number should be unique within the file. @item Group member list @tab A comma-separated list of usernames. These users are members of the group. Modern Unix systems allow users to be members of several groups simultaneously. If your system does, then there are elements @code{"group1"} through @code{"group@var{N}"} in @code{PROCINFO} ! for those group ID numbers. (Note that @code{PROCINFO} is a @command{gawk} extension; @pxref{Built-in Variables}.) @end multitable *************** *** 17468,17473 **** --- 18430,18436 ---- Here are the functions for obtaining information from the group database. There are several, modeled after the C library functions of the same names: + @cindex @code{getline} command, @code{_gr_init} user-defined function @cindex @code{_gr_init} user-defined function @example @c file eg/lib/groupawk.in *************** *** 17550,17559 **** scanning the group information. The group information is stored is several associative arrays. ! The arrays are indexed by group name (@code{@w{_gr_byname}}), by group-id number (@code{@w{_gr_bygid}}), and by position in the database (@code{@w{_gr_bycount}}). There is an additional array indexed by username (@code{@w{_gr_groupsbyuser}}), ! which is a space-separated list of groups that each user belongs to. Unlike the user database, it is possible to have multiple records in the database for the same group. This is common when a group has a large number --- 18513,18522 ---- scanning the group information. The group information is stored is several associative arrays. ! The arrays are indexed by group name (@code{@w{_gr_byname}}), by group ID number (@code{@w{_gr_bygid}}), and by position in the database (@code{@w{_gr_bycount}}). There is an additional array indexed by username (@code{@w{_gr_groupsbyuser}}), ! which is a space-separated list of groups to which each user belongs. Unlike the user database, it is possible to have multiple records in the database for the same group. This is common when a group has a large number *************** *** 17565,17571 **** @end example For this reason, @code{_gr_init} looks to see if a group name or ! group-id number is already seen. If it is, then the usernames are simply concatenated onto the previous list of users. (There is actually a subtle problem with the code just presented. Suppose that the first time there were no names. This code adds the names with --- 18528,18534 ---- @end example For this reason, @code{_gr_init} looks to see if a group name or ! group ID number is already seen. If it is, then the usernames are simply concatenated onto the previous list of users. (There is actually a subtle problem with the code just presented. Suppose that the first time there were no names. This code adds the names with *************** *** 17576,17581 **** --- 18539,18545 ---- initializes @code{_gr_count} to zero (it is used later), and makes @code{_gr_inited} nonzero. + @cindex @code{getgrnam} function (C library) The @code{getgrnam} function takes a group name as its argument, and if that group exists, it is returned. Otherwise, @code{getgrnam} returns the null string: *************** *** 17593,17600 **** @c endfile @end example ! The @code{getgrgid} function is similar, it takes a numeric group-id and ! looks up the information associated with that group-id: @cindex @code{getgrgid} user-defined function @example --- 18557,18565 ---- @c endfile @end example ! @cindex @code{getgrgid} function (C library) ! The @code{getgrgid} function is similar, it takes a numeric group ID and ! looks up the information associated with that group ID: @cindex @code{getgrgid} user-defined function @example *************** *** 17609,17618 **** @c endfile @end example The @code{getgruser} function does not have a C counterpart. It takes a username and returns the list of groups that have the user as a member: ! @cindex @code{getgruser} user-defined function @example @c file eg/lib/groupawk.in function getgruser(user) --- 18574,18584 ---- @c endfile @end example + @cindex @code{getgruser} function (C library) The @code{getgruser} function does not have a C counterpart. It takes a username and returns the list of groups that have the user as a member: ! @cindex @code{getgruser} function, user-defined @example @c file eg/lib/groupawk.in function getgruser(user) *************** *** 17625,17630 **** --- 18591,18597 ---- @c endfile @end example + @cindex @code{getgrent} function (C library) The @code{getgrent} function steps through the database one entry at a time. It uses @code{_gr_count} to track its position in the list: *************** *** 17640,17646 **** --- 18607,18615 ---- @} @c endfile @end example + @c ENDOFRANGE clibf + @cindex @code{endgrent} function (C library) The @code{endgrent} function resets @code{_gr_count} to zero so that @code{getgrent} can start over again: *************** *** 17665,17673 **** --- 18634,18651 ---- The @command{id} program in @ref{Id Program, ,Printing out User Information}, uses these functions. + @c ENDOFRANGE libfgdata + @c ENDOFRANGE flibgdata + @c ENDOFRANGE gdatar + @c ENDOFRANGE libf + @c ENDOFRANGE flib + @c ENDOFRANGE fudlib + @c ENDOFRANGE datagr @node Sample Programs, Language History, Library Functions, Top @chapter Practical @command{awk} Programs + @c STARTOFRANGE awkpex + @cindex @command{awk} programs, examples of @ref{Library Functions, ,A Library of @command{awk} Functions}, presents the idea that reading programs in a language contributes to *************** *** 17732,17737 **** --- 18710,18718 ---- @node Clones, Miscellaneous Programs, Running Examples, Sample Programs @section Reinventing Wheels for Fun and Profit + @c last comma is part of secondary + @c STARTOFRANGE posimawk + @cindex POSIX, programs, implementing in @command{awk} This @value{SECTION} presents a number of POSIX utilities that are implemented in @command{awk}. Reinventing these programs in @command{awk} is often enjoyable, *************** *** 17759,17769 **** @subsection Cutting out Fields and Columns @cindex @command{cut} utility The @command{cut} utility selects, or ``cuts,'' characters or fields from its standard input and sends them to its standard output. Fields are separated by tabs by default, but you may supply a command-line option to change the field ! @dfn{delimiter} (i.e., the field separator character). @command{cut}'s definition of fields is less general than @command{awk}'s. A common use of @command{cut} might be to pull out just the login name of --- 18740,18756 ---- @subsection Cutting out Fields and Columns @cindex @command{cut} utility + @c STARTOFRANGE cut + @cindex @command{cut} utility + @c STARTOFRANGE ficut + @cindex fields, cutting + @c STARTOFRANGE colcut + @cindex columns, cutting The @command{cut} utility selects, or ``cuts,'' characters or fields from its standard input and sends them to its standard output. Fields are separated by tabs by default, but you may supply a command-line option to change the field ! @dfn{delimiter} (i.e., the field-separator character). @command{cut}'s definition of fields is less general than @command{awk}'s. A common use of @command{cut} might be to pull out just the login name of *************** *** 17787,17793 **** Use @var{list} as the list of fields to cut out. @item -d @var{delim} ! Use @var{delim} as the field separator character instead of the tab character. @item -s --- 18774,18780 ---- Use @var{list} as the list of fields to cut out. @item -d @var{delim} ! Use @var{delim} as the field-separator character instead of the tab character. @item -s *************** *** 17850,17864 **** screen. @end ifnottex Next comes a @code{BEGIN} rule that parses the command-line options. ! It sets @code{FS} to a single tab character, because that is @command{cut}'s default field separator. The output field separator is also set to be the same as the input field separator. Then @code{getopt} is used to step ! through the command-line options. One or the other of the variables @code{by_fields} or @code{by_chars} is set to true, to indicate that processing should be done by fields or by characters, respectively. When cutting by characters, the output field separator is set to the null ! string. @example @c file eg/prog/cut.awk --- 18837,18853 ---- screen. @end ifnottex + @cindex @code{BEGIN} pattern, running @command{awk} programs and + @cindex @code{FS} variable, running @command{awk} programs and Next comes a @code{BEGIN} rule that parses the command-line options. ! It sets @code{FS} to a single TAB character, because that is @command{cut}'s default field separator. The output field separator is also set to be the same as the input field separator. Then @code{getopt} is used to step ! through the command-line options. Exactly one of the variables @code{by_fields} or @code{by_chars} is set to true, to indicate that processing should be done by fields or by characters, respectively. When cutting by characters, the output field separator is set to the null ! string: @example @c file eg/prog/cut.awk *************** *** 17895,17900 **** --- 18884,18890 ---- @c endfile @end example + @cindex field separators, spaces as Special care is taken when the field delimiter is a space. Using a single space (@code{@w{" "}}) for the value of @code{FS} is incorrect---@command{awk} would separate fields with runs of spaces, *************** *** 17931,17937 **** @c endfile @end example ! @code{set_fieldlist} is used to split the field list apart at the commas, and into an array. Then, for each element of the array, it looks to see if it is actually a range, and if so, splits it apart. The range is verified to make sure the first number is smaller than the second. --- 18921,18927 ---- @c endfile @end example ! @code{set_fieldlist} is used to split the field list apart at the commas and into an array. Then, for each element of the array, it looks to see if it is actually a range, and if so, splits it apart. The range is verified to make sure the first number is smaller than the second. *************** *** 17969,17975 **** The @code{set_charlist} function is more complicated than @code{set_fieldlist}. The idea here is to use @command{gawk}'s @code{FIELDWIDTHS} variable (@pxref{Constant Size, ,Reading Fixed-Width Data}), ! which describes constant width input. When using a character list, that is exactly what we have. Setting up @code{FIELDWIDTHS} is more complicated than simply listing the --- 18959,18965 ---- The @code{set_charlist} function is more complicated than @code{set_fieldlist}. The idea here is to use @command{gawk}'s @code{FIELDWIDTHS} variable (@pxref{Constant Size, ,Reading Fixed-Width Data}), ! which describes constant-width input. When using a character list, that is exactly what we have. Setting up @code{FIELDWIDTHS} is more complicated than simply listing the *************** *** 18069,18080 **** --- 19059,19079 ---- it is also extremely painful. The @code{FIELDWIDTHS} variable supplies an elegant solution to the problem of picking the input line apart by characters. + @c ENDOFRANGE cut + @c ENDOFRANGE ficut + @c ENDOFRANGE colcut @c Exercise: Rewrite using split with "". @node Egrep Program, Id Program, Cut Program, Clones @subsection Searching for Regular Expressions in Files + @c STARTOFRANGE regexps + @cindex regular expressions, searching for + @c STARTOFRANGE sfregexp + @cindex searching, files for regular expressions + @c STARTOFRANGE fsregexp + @cindex files, searching for regular expressions @cindex @command{egrep} utility The @command{egrep} utility searches files for patterns. It uses regular expressions that are almost identical to those available in @command{awk} *************** *** 18175,18181 **** @end example Next comes the code that handles the @command{egrep}-specific behavior. If no ! pattern is supplied with @option{-e}, the first non-option on the command line is used. The @command{awk} command-line arguments up to @code{ARGV[Optind]} are cleared, so that @command{awk} won't try to process them as files. If no files are specified, the standard input is used, and if multiple files are --- 19174,19180 ---- @end example Next comes the code that handles the @command{egrep}-specific behavior. If no ! pattern is supplied with @option{-e}, the first nonoption on the command line is used. The @command{awk} command-line arguments up to @code{ARGV[Optind]} are cleared, so that @command{awk} won't try to process them as files. If no files are specified, the standard input is used, and if multiple files are *************** *** 18227,18235 **** The @code{beginfile} function is called by the rule in @file{ftrans.awk} when each new file is processed. In this case, it is very simple; all it does is initialize a variable @code{fcount} to zero. @code{fcount} tracks ! how many lines in the current file matched the pattern. ! (Naming the parameter @code{junk} shows we know that @code{beginfile} ! is called with a parameter, but that we're not interested in its value.): @example @c file eg/prog/egrep.awk --- 19226,19234 ---- The @code{beginfile} function is called by the rule in @file{ftrans.awk} when each new file is processed. In this case, it is very simple; all it does is initialize a variable @code{fcount} to zero. @code{fcount} tracks ! how many lines in the current file matched the pattern ! (naming the parameter @code{junk} shows we know that @code{beginfile} ! is called with a parameter, but that we're not interested in its value): @example @c file eg/prog/egrep.awk *************** *** 18247,18253 **** therefore only prints line counts if printing and counting are enabled. The output format must be adjusted depending upon the number of files to process. Finally, @code{fcount} is added to @code{total}, so that we ! know how many lines altogether matched the pattern: @example @c file eg/prog/egrep.awk --- 19246,19252 ---- therefore only prints line counts if printing and counting are enabled. The output format must be adjusted depending upon the number of files to process. Finally, @code{fcount} is added to @code{total}, so that we ! know the total number of lines that matched the pattern: @example @c file eg/prog/egrep.awk *************** *** 18272,18277 **** --- 19271,19278 ---- successful or unsuccessful match. If the line does not match, the @code{next} statement just moves on to the next record. + @cindex @code{!} (exclamation point), @code{!} operator + @cindex exclamation point (@code{!}), @code{!} operator A number of additional tests are made, but they are only done if we are not counting lines. First, if the user only wants exit status (@code{no_print} is true), then it is enough to know that @emph{one} *************** *** 18313,18319 **** @end example The @code{END} rule takes care of producing the correct exit status. If ! there are no matches, the exit status is one, otherwise it is zero: @example @c file eg/prog/egrep.awk --- 19314,19320 ---- @end example The @code{END} rule takes care of producing the correct exit status. If ! there are no matches, the exit status is one; otherwise it is zero: @example @c file eg/prog/egrep.awk *************** *** 18344,18350 **** The variable @code{e} is used so that the function fits nicely on the printed page. ! @cindex backslash continuation Just a note on programming style: you may have noticed that the @code{END} rule uses backslash continuation, with the open brace on a line by itself. This is so that it more closely resembles the way functions --- 19345,19353 ---- The variable @code{e} is used so that the function fits nicely on the printed page. ! @cindex @code{END} pattern, backslash continuation and ! @cindex @code{\} (backslash), continuing lines and ! @cindex backslash (@code{\}), continuing lines and Just a note on programming style: you may have noticed that the @code{END} rule uses backslash continuation, with the open brace on a line by itself. This is so that it more closely resembles the way functions *************** *** 18353,18366 **** use this style. You can decide for yourself if you like writing your @code{BEGIN} and @code{END} rules this way or not. @node Id Program, Split Program, Egrep Program, Clones @subsection Printing out User Information @cindex @command{id} utility ! The @command{id} utility lists a user's real and effective user-id numbers, ! real and effective group-id numbers, and the user's group set, if any. ! @command{id} only prints the effective user-id and group-id if they are different from the real ones. If possible, @command{id} also supplies the corresponding user and group names. The output might look like this: --- 19356,19374 ---- use this style. You can decide for yourself if you like writing your @code{BEGIN} and @code{END} rules this way or not. + @c ENDOFRANGE regexps + @c ENDOFRANGE sfregexp + @c ENDOFRANGE fsregexp @node Id Program, Split Program, Egrep Program, Clones @subsection Printing out User Information + @cindex printing, user information + @cindex users, information about, printing @cindex @command{id} utility ! The @command{id} utility lists a user's real and effective user ID numbers, ! real and effective group ID numbers, and the user's group set, if any. ! @command{id} only prints the effective user ID and group ID if they are different from the real ones. If possible, @command{id} also supplies the corresponding user and group names. The output might look like this: *************** *** 18383,18392 **** The program is fairly straightforward. All the work is done in the @code{BEGIN} rule. The user and group ID numbers are obtained from @code{PROCINFO}. ! The code is repetitive. The entry in the user database for the real user-id number is split into parts at the @samp{:}. The name is the first field. ! Similar code is used for the effective user-id number and the group ! numbers. @cindex @code{id.awk} program @example --- 19391,19400 ---- The program is fairly straightforward. All the work is done in the @code{BEGIN} rule. The user and group ID numbers are obtained from @code{PROCINFO}. ! The code is repetitive. The entry in the user database for the real user ID number is split into parts at the @samp{:}. The name is the first field. ! Similar code is used for the effective user ID number and the group ! numbers: @cindex @code{id.awk} program @example *************** *** 18473,18480 **** The test in the @code{for} loop is worth noting. Any supplementary groups in the @code{PROCINFO} array have the indices @code{"group1"} through @code{"group@var{N}"} for some ! @var{N}; i.e., the total number of supplementary groups. ! The problem is, we don't know in advance how many of these groups there are. This loop works by starting at one, concatenating the value with --- 19481,19488 ---- The test in the @code{for} loop is worth noting. Any supplementary groups in the @code{PROCINFO} array have the indices @code{"group1"} through @code{"group@var{N}"} for some ! @var{N}, i.e., the total number of supplementary groups. ! However, we don't know in advance how many of these groups there are. This loop works by starting at one, concatenating the value with *************** *** 18496,18504 **** @node Split Program, Tee Program, Id Program, Clones @subsection Splitting a Large File into Pieces @cindex @code{split} utility The @code{split} program splits large text files into smaller pieces. ! The usage is as follows: @example split @r{[}-@var{count}@r{]} file @r{[} @var{prefix} @r{]} --- 19504,19514 ---- @node Split Program, Tee Program, Id Program, Clones @subsection Splitting a Large File into Pieces + @c STARTOFRANGE filspl + @cindex files, splitting @cindex @code{split} utility The @code{split} program splits large text files into smaller pieces. ! Usage is as follows: @example split @r{[}-@var{count}@r{]} file @r{[} @var{prefix} @r{]} *************** *** 18519,18525 **** The program first sets its defaults, and then tests to make sure there are not too many arguments. It then looks at each argument in turn. The ! first argument could be a minus followed by a number. If it is, this happens to look like a negative number, so it is made positive, and that is the count of lines. The data @value{FN} is skipped over and the final argument is used as the prefix for the output @value{FN}s: --- 19529,19535 ---- The program first sets its defaults, and then tests to make sure there are not too many arguments. It then looks at each argument in turn. The ! first argument could be a minus sign followed by a number. If it is, this happens to look like a negative number, so it is made positive, and that is the count of lines. The data @value{FN} is skipped over and the final argument is used as the prefix for the output @value{FN}s: *************** *** 18629,18643 **** page. @end ifnotinfo ! This program is a bit sloppy; it relies on @command{awk} to close the last file ! for it automatically, instead of doing it in an @code{END} rule. It also assumes that letters are contiguous in the character set, which isn't true for EBCDIC systems. @c BFD... @node Tee Program, Uniq Program, Split Program, Clones @subsection Duplicating Output into Multiple Files @cindex @code{tee} utility The @code{tee} program is known as a ``pipe fitting.'' @code{tee} copies its standard input to its standard output and also duplicates it to the --- 19639,19657 ---- page. @end ifnotinfo ! This program is a bit sloppy; it relies on @command{awk} to automatically close the last file ! instead of doing it in an @code{END} rule. It also assumes that letters are contiguous in the character set, which isn't true for EBCDIC systems. @c BFD... + @c ENDOFRANGE filspl @node Tee Program, Uniq Program, Split Program, Clones @subsection Duplicating Output into Multiple Files + @c last comma is part of secondary + @cindex files, multiple, duplicating output into + @cindex output, duplicating into files @cindex @code{tee} utility The @code{tee} program is known as a ``pipe fitting.'' @code{tee} copies its standard input to its standard output and also duplicates it to the *************** *** 18752,18759 **** @end example @node Uniq Program, Wc Program, Tee Program, Clones ! @subsection Printing Non-Duplicated Lines of Text @cindex @command{uniq} utility The @command{uniq} utility reads sorted lines of data on its standard input, and by default removes duplicate lines. In other words, it only --- 19766,19778 ---- @end example @node Uniq Program, Wc Program, Tee Program, Clones ! @subsection Printing Nonduplicated Lines of Text + @c STARTOFRANGE prunt + @cindex printing, unduplicated lines of text + @c first comma is part of primary + @c STARTOFRANGE tpul + @cindex text, printing, unduplicated lines of @cindex @command{uniq} utility The @command{uniq} utility reads sorted lines of data on its standard input, and by default removes duplicate lines. In other words, it only *************** *** 18764,18785 **** uniq @r{[}-udc @r{[}-@var{n}@r{]]} @r{[}+@var{n}@r{]} @r{[} @var{input file} @r{[} @var{output file} @r{]]} @end example ! The option meanings are: @table @code @item -d ! Only print repeated lines. @item -u ! Only print non-repeated lines. @item -c Count lines. This option overrides @option{-d} and @option{-u}. Both repeated ! and non-repeated lines are counted. @item -@var{n} Skip @var{n} fields before comparing lines. The definition of fields ! is similar to @command{awk}'s default: non-whitespace characters separated by runs of spaces and/or tabs. @item +@var{n} --- 19783,19804 ---- uniq @r{[}-udc @r{[}-@var{n}@r{]]} @r{[}+@var{n}@r{]} @r{[} @var{input file} @r{[} @var{output file} @r{]]} @end example ! The options for @command{uniq} are: @table @code @item -d ! Pnly print only repeated lines. @item -u ! Print only nonrepeated lines. @item -c Count lines. This option overrides @option{-d} and @option{-u}. Both repeated ! and nonrepeated lines are counted. @item -@var{n} Skip @var{n} fields before comparing lines. The definition of fields ! is similar to @command{awk}'s default: nonwhitespace characters separated by runs of spaces and/or tabs. @item +@var{n} *************** *** 18813,18824 **** like a number), @code{Optarg} is concatenated with the option digit and then the result is added to zero to make it into a number. If there is only one digit in the option, then ! @code{Optarg} is not needed. @code{Optind} must be decremented so that @code{getopt} processes it next time. This code is admittedly a bit tricky. If no options are supplied, then the default is taken, to print both ! repeated and non-repeated lines. The output file, if provided, is assigned to @code{outputfile}. Early on, @code{outputfile} is initialized to the standard output, @file{/dev/stdout}: --- 19832,19843 ---- like a number), @code{Optarg} is concatenated with the option digit and then the result is added to zero to make it into a number. If there is only one digit in the option, then ! @code{Optarg} is not needed. In this case, @code{Optind} must be decremented so that @code{getopt} processes it next time. This code is admittedly a bit tricky. If no options are supplied, then the default is taken, to print both ! repeated and nonrepeated lines. The output file, if provided, is assigned to @code{outputfile}. Early on, @code{outputfile} is initialized to the standard output, @file{/dev/stdout}: *************** *** 18948,18960 **** The second rule does the work. The variable @code{equal} is one or zero, depending upon the results of @code{are_equal}'s comparison. If @command{uniq} is counting repeated lines, and the lines are equal, then it increments the @code{count} variable. ! Otherwise it prints the line and resets @code{count}, since the two lines are not equal. If @command{uniq} is not counting, and if the lines are equal, @code{count} is incremented. Nothing is printed, since the point is to remove duplicates. Otherwise, if @command{uniq} is counting repeated lines and more than ! one line is seen, or if @command{uniq} is counting non-repeated lines and only one line is seen, then the line is printed, and @code{count} is reset. --- 19967,19979 ---- The second rule does the work. The variable @code{equal} is one or zero, depending upon the results of @code{are_equal}'s comparison. If @command{uniq} is counting repeated lines, and the lines are equal, then it increments the @code{count} variable. ! Otherwise, it prints the line and resets @code{count}, since the two lines are not equal. If @command{uniq} is not counting, and if the lines are equal, @code{count} is incremented. Nothing is printed, since the point is to remove duplicates. Otherwise, if @command{uniq} is counting repeated lines and more than ! one line is seen, or if @command{uniq} is counting nonrepeated lines and only one line is seen, then the line is printed, and @code{count} is reset. *************** *** 19002,19011 **** --- 20021,20042 ---- @} @c endfile @end example + @c ENDOFRANGE prunt + @c ENDOFRANGE tpul @node Wc Program, , Uniq Program, Clones @subsection Counting Things + @c STARTOFRANGE count + @cindex counting + @c STARTOFRANGE infco + @cindex input files, counting elements in + @c STARTOFRANGE woco + @cindex words, counting + @c STARTOFRANGE chco + @cindex characters, counting + @c STARTOFRANGE lico + @cindex lines, counting @cindex @command{wc} utility The @command{wc} (word count) utility counts lines, words, and characters in one or more input files. Its usage is as follows: *************** *** 19020,19035 **** @table @code @item -l ! Only count lines. @item -w ! Only count words. ! A ``word'' is a contiguous sequence of non-whitespace characters, separated ! by spaces and/or tabs. Happily, this is the normal way @command{awk} separates fields in its input data. @item -c ! Only count characters. @end table Implementing @command{wc} in @command{awk} is particularly elegant, --- 20051,20066 ---- @table @code @item -l ! Count only lines. @item -w ! Count only words. ! A ``word'' is a contiguous sequence of nonwhitespace characters, separated ! by spaces and/or tabs. Luckily, this is the normal way @command{awk} separates fields in its input data. @item -c ! Count only characters. @end table Implementing @command{wc} in @command{awk} is particularly elegant, *************** *** 19039,19045 **** This uses the @code{getopt} library function (@pxref{Getopt Function, ,Processing Command-Line Options}) ! and the file transition functions (@pxref{Filetrans Function, ,Noting @value{DDF} Boundaries}). This version has one notable difference from traditional versions of --- 20070,20076 ---- This uses the @code{getopt} library function (@pxref{Getopt Function, ,Processing Command-Line Options}) ! and the file-transition functions (@pxref{Filetrans Function, ,Noting @value{DDF} Boundaries}). This version has one notable difference from traditional versions of *************** *** 19114,19122 **** @end example The @code{endfile} function adds the current file's numbers to the running ! totals of lines, words, and characters. It then prints out those numbers for the file that was just read. It relies on @code{beginfile} to reset the numbers for the following @value{DF}: @c NEXT ED: make order for += be lines, words, chars @example --- 20145,20160 ---- @end example The @code{endfile} function adds the current file's numbers to the running ! totals of lines, words, and characters.@footnote{@command{wc} can't just use the value of ! @code{FNR} in @code{endfile}. If you examine ! the code in ! @ref{Filetrans Function, , Noting @value{DDF} Boundaries} ! you will see that ! @code{FNR} has already been reset by the time ! @code{endfile} is called.} It then prints out those numbers for the file that was just read. It relies on @code{beginfile} to reset the numbers for the following @value{DF}: + @c ONE DAY: make the above footnote an exercise, instead of giving away the answer. @c NEXT ED: make order for += be lines, words, chars @example *************** *** 19145,19156 **** of @code{RS}) is not part of the record itself, and thus not included in its length. Next, @code{lines} is incremented for each line read, and @code{words} is incremented by the value of @code{NF}, which is the ! number of ``words'' on this line:@footnote{@command{wc} can't just use ! the value of @code{FNR} in @code{endfile}. If you examine the code in ! @ref{Filetrans Function, ,Noting @value{DDF} Boundaries}, ! you will see that @code{FNR} has already been reset by the time ! @code{endfile} is called.} ! @c ONE DAY: make the above an exercise, instead of giving away the answer. @example @c file eg/prog/wc.awk --- 20183,20189 ---- of @code{RS}) is not part of the record itself, and thus not included in its length. Next, @code{lines} is incremented for each line read, and @code{words} is incremented by the value of @code{NF}, which is the ! number of ``words'' on this line: @example @c file eg/prog/wc.awk *************** *** 19163,19169 **** @c endfile @end example ! Finally, the @code{END} rule simply prints the totals for all the files. @example @c file eg/prog/wc.awk --- 20196,20202 ---- @c endfile @end example ! Finally, the @code{END} rule simply prints the totals for all the files: @example @c file eg/prog/wc.awk *************** *** 19180,19185 **** --- 20213,20224 ---- @} @c endfile @end example + @c ENDOFRANGE count + @c ENDOFRANGE infco + @c ENDOFRANGE lico + @c ENDOFRANGE woco + @c ENDOFRANGE chco + @c ENDOFRANGE posimawk @node Miscellaneous Programs, , Clones, Sample Programs @section A Grab Bag of @command{awk} Programs *************** *** 19205,19213 **** @node Dupword Program, Alarm Program, Miscellaneous Programs, Miscellaneous Programs @subsection Finding Duplicated Words in a Document A common error when writing large amounts of prose is to accidentally duplicate words. Typically you will see this in text as something like ``the ! the program does the following @dots{}.'' When the text is online, often the duplicated words occur at the end of one line and the beginning of another, making them very difficult to spot. @c as here! --- 20244,20257 ---- @node Dupword Program, Alarm Program, Miscellaneous Programs, Miscellaneous Programs @subsection Finding Duplicated Words in a Document + @c last comma is part of secondary + @cindex words, duplicate, searching for + @cindex searching, for words + @c first comma is part of primary + @cindex documents, searching A common error when writing large amounts of prose is to accidentally duplicate words. Typically you will see this in text as something like ``the ! the program does the following@dots{}'' When the text is online, often the duplicated words occur at the end of one line and the beginning of another, making them very difficult to spot. @c as here! *************** *** 19220,19232 **** @cindex Texinfo The first two statements make sure that the line is all lowercase, so that, for example, ``The'' and ``the'' compare equal to each other. ! The next statement replaces non-alphanumeric and non-whitespace characters with spaces, so that punctuation does not affect the comparison either. The characters are replaced with spaces so that formatting controls don't create nonsense words (e.g., the Texinfo @samp{@@code@{NF@}} becomes @samp{codeNF} if punctuation is simply deleted). The record is ! then re-split into fields, yielding just the actual words on the line, ! and insuring that there are no empty fields. If there are no fields left after removing all the punctuation, the current record is skipped. Otherwise, the program loops through each --- 20264,20276 ---- @cindex Texinfo The first two statements make sure that the line is all lowercase, so that, for example, ``The'' and ``the'' compare equal to each other. ! The next statement replaces nonalphanumeric and nonwhitespace characters with spaces, so that punctuation does not affect the comparison either. The characters are replaced with spaces so that formatting controls don't create nonsense words (e.g., the Texinfo @samp{@@code@{NF@}} becomes @samp{codeNF} if punctuation is simply deleted). The record is ! then resplit into fields, yielding just the actual words on the line, ! and ensuring that there are no empty fields. If there are no fields left after removing all the punctuation, the current record is skipped. Otherwise, the program loops through each *************** *** 19274,19279 **** --- 20318,20327 ---- Arnold Robbins @end quotation + @c STARTOFRANGE tialarm + @cindex time, alarm clock example program + @c STARTOFRANGE alaex + @cindex alarm clock example program The following program is a simple ``alarm clock'' program. You give it a time of day and an optional message. At the specified time, it prints the message on the standard output. In addition, you can give it *************** *** 19287,19295 **** checking and setting of defaults: the delay, the count, and the message to print. If the user supplied a message without the ASCII BEL character (known as the ``alert'' character, @code{"\a"}), then it is added to ! the message. (On many systems, printing the ASCII BEL generates some sort ! of audible alert. Thus when the alarm goes off, the system calls attention ! to itself in case the user is not looking at their computer or terminal.): @cindex @code{alarm.awk} program @example --- 20335,20344 ---- checking and setting of defaults: the delay, the count, and the message to print. If the user supplied a message without the ASCII BEL character (known as the ``alert'' character, @code{"\a"}), then it is added to ! the message. (On many systems, printing the ASCII BEL generates an ! audible alert. Thus when the alarm goes off, the system calls attention ! to itself in case the user is not looking at the computer or terminal.) ! Here is the program: @cindex @code{alarm.awk} program @example *************** *** 19415,19424 **** --- 20464,20477 ---- @} @c endfile @end example + @c ENDOFRANGE tialarm + @c ENDOFRANGE alaex @node Translate Program, Labels Program, Alarm Program, Miscellaneous Programs @subsection Transliterating Characters + @c STARTOFRANGE chtra + @cindex characters, transliterating @cindex @command{tr} utility The system @command{tr} utility transliterates characters. For example, it is often used to map uppercase letters into lowercase for further processing: *************** *** 19429,19434 **** --- 20482,20490 ---- @command{tr} requires two lists of characters.@footnote{On some older System V systems, + @ifset ORA + including Solaris, + @end ifset @command{tr} may require that the lists be written as range expressions enclosed in square brackets (@samp{[a-z]}) and quoted, to prevent the shell from attempting a @value{FN} expansion. This is *************** *** 19458,19476 **** program was written before @command{gawk} acquired the ability to split each character in a string into separate array elements.} @c Exercise: How might you use this new feature to simplify the program? - There are two functions. The first, @code{stranslate}, takes three arguments: @table @code @item from ! A list of characters to translate from. @item to ! A list of characters to translate to. @item target ! The string to do the translation on. @end table Associative arrays make the translation part fairly easy. @code{t_ar} holds --- 20514,20531 ---- program was written before @command{gawk} acquired the ability to split each character in a string into separate array elements.} @c Exercise: How might you use this new feature to simplify the program? There are two functions. The first, @code{stranslate}, takes three arguments: @table @code @item from ! A list of characters from which to translate. @item to ! A list of characters to which to translate. @item target ! The string on which to do the translation. @end table Associative arrays make the translation part fairly easy. @code{t_ar} holds *************** *** 19562,19578 **** @code{t_ar} array only once, in a @code{BEGIN} rule. However, this assumes that the ``from'' and ``to'' lists will never change throughout the lifetime of the program. @node Labels Program, Word Sorting, Translate Program, Miscellaneous Programs @subsection Printing Mailing Labels Here is a ``real world''@footnote{``Real world'' is defined as ``a program actually used to get something done.''} program. This script reads lists of names and addresses and generates mailing labels. Each page of labels has 20 labels ! on it, two across and ten down. The addresses are guaranteed to be no more ! than five lines of data. Each address is separated from the next by a blank line. The basic idea is to read 20 labels worth of data. Each line of each label --- 20617,20639 ---- @code{t_ar} array only once, in a @code{BEGIN} rule. However, this assumes that the ``from'' and ``to'' lists will never change throughout the lifetime of the program. + @c ENDOFRANGE chtra @node Labels Program, Word Sorting, Translate Program, Miscellaneous Programs @subsection Printing Mailing Labels + @c STARTOFRANGE prml + @cindex printing, mailing labels + @c comma is part of primary + @c STARTOFRANGE mlprint + @cindex mailing labels, printing Here is a ``real world''@footnote{``Real world'' is defined as ``a program actually used to get something done.''} program. This script reads lists of names and addresses and generates mailing labels. Each page of labels has 20 labels ! on it, 2 across and 10 down. The addresses are guaranteed to be no more ! than 5 lines of data. Each address is separated from the next by a blank line. The basic idea is to read 20 labels worth of data. Each line of each label *************** *** 19592,19598 **** accomplish this. The outer loop, controlled by @code{i}, steps through every 10 lines of data; this is each row of labels. The inner loop, controlled by @code{j}, goes through the lines within the row. ! As @code{j} goes from 0 to 4, @samp{i+j} is the @code{j}'th line in the row, and @samp{i+j+5} is the entry next to it. The output ends up looking something like this: --- 20653,20659 ---- accomplish this. The outer loop, controlled by @code{i}, steps through every 10 lines of data; this is each row of labels. The inner loop, controlled by @code{j}, goes through the lines within the row. ! As @code{j} goes from 0 to 4, @samp{i+j} is the @code{j}-th line in the row, and @samp{i+j+5} is the entry next to it. The output ends up looking something like this: *************** *** 19608,19614 **** As a final note, an extra blank line is printed at lines 21 and 61, to keep the output lined up on the labels. This is dependent on the particular brand of labels in use when the program was written. You will also note ! that there are two blank lines at the top and two blank lines at the bottom. The @code{END} rule arranges to flush the final page of labels; there may not have been an even multiple of 20 labels in the data: --- 20669,20675 ---- As a final note, an extra blank line is printed at lines 21 and 61, to keep the output lined up on the labels. This is dependent on the particular brand of labels in use when the program was written. You will also note ! that there are 2 blank lines at the top and 2 blank lines at the bottom. The @code{END} rule arranges to flush the final page of labels; there may not have been an even multiple of 20 labels in the data: *************** *** 19678,19687 **** @} @c endfile @end example @node Word Sorting, History Sorting, Labels Program, Miscellaneous Programs ! @subsection Generating Word Usage Counts @c NEXT ED: Rewrite this whole section and example The following @command{awk} program prints the number of occurrences of each word in its input. It illustrates the --- 20739,20753 ---- @} @c endfile @end example + @c ENDOFRANGE prml + @c ENDOFRANGE mlprint @node Word Sorting, History Sorting, Labels Program, Miscellaneous Programs ! @subsection Generating Word-Usage Counts + @c last comma is part of secondary + @c STARTOFRANGE worus + @cindex words, usage counts, generating @c NEXT ED: Rewrite this whole section and example The following @command{awk} program prints the number of occurrences of each word in its input. It illustrates the *************** *** 19773,19779 **** and that the data is in @file{file1}, the following pipeline: @example ! awk -f wordfreq.awk file1 | sort +1 -nr @end example @noindent --- 20839,20845 ---- and that the data is in @file{file1}, the following pipeline: @example ! awk -f wordfreq.awk file1 | sort -k 2nr @end example @noindent *************** *** 19794,19800 **** @example @c file eg/prog/wordfreq.awk END @{ ! sort = "sort +1 -nr" for (word in freq) printf "%s\t%d\n", word, freq[word] | sort close(sort) --- 20860,20866 ---- @example @c file eg/prog/wordfreq.awk END @{ ! sort = "sort -k 2nr" for (word in freq) printf "%s\t%d\n", word, freq[word] | sort close(sort) *************** *** 19806,19817 **** have true pipes at the command-line (or batch-file) level. See the general operating system documentation for more information on how to use the @command{sort} program. @node History Sorting, Extract Program, Word Sorting, Miscellaneous Programs @subsection Removing Duplicates from Unsorted Text The @command{uniq} program ! (@pxref{Uniq Program, ,Printing Non-Duplicated Lines of Text}), removes duplicate lines from @emph{sorted} data. Suppose, however, you need to remove duplicate lines from a @value{DF} but --- 20872,20887 ---- have true pipes at the command-line (or batch-file) level. See the general operating system documentation for more information on how to use the @command{sort} program. + @c ENDOFRANGE worus @node History Sorting, Extract Program, Word Sorting, Miscellaneous Programs @subsection Removing Duplicates from Unsorted Text + @c last comma is part of secondary + @c STARTOFRANGE lidu + @cindex lines, duplicate, removing The @command{uniq} program ! (@pxref{Uniq Program, ,Printing Nonduplicated Lines of Text}), removes duplicate lines from @emph{sorted} data. Suppose, however, you need to remove duplicate lines from a @value{DF} but *************** *** 19872,19881 **** --- 20942,20957 ---- This works because @code{data[$0]} is incremented each time a line is seen. + @c ENDOFRANGE lidu @node Extract Program, Simple Sed, History Sorting, Miscellaneous Programs @subsection Extracting Programs from Texinfo Source Files + @c STARTOFRANGE texse + @cindex Texinfo, extracting programs from source files + @c last comma is part of secondary + @c STARTOFRANGE fitex + @cindex files, Texinfo, extracting programs from @ifnotinfo Both this chapter and the previous chapter (@ref{Library Functions, ,A Library of @command{awk} Functions}) *************** *** 19919,19931 **** @item Comments start with either @samp{@@c} or @samp{@@comment}. ! The file extraction program works by using special comments that start at the beginning of a line. @item Lines containing @samp{@@group} and @samp{@@end group} commands bracket example text that should not be split across a page boundary. ! (Unfortunately, @TeX{} isn't always smart enough to do things exactly right and we have to give it some help.) @end itemize --- 20995,21007 ---- @item Comments start with either @samp{@@c} or @samp{@@comment}. ! The file-extraction program works by using special comments that start at the beginning of a line. @item Lines containing @samp{@@group} and @samp{@@end group} commands bracket example text that should not be split across a page boundary. ! (Unfortunately, @TeX{} isn't always smart enough to do things exactly right, and we have to give it some help.) @end itemize *************** *** 20131,20143 **** @} @c endfile @end example @node Simple Sed, Igawk Program, Extract Program, Miscellaneous Programs @subsection A Simple Stream Editor @cindex @command{sed} utility ! @cindex stream editor ! The @command{sed} utility is a ``stream editor,'' a program that reads a stream of data, makes changes to it, and passes it on. It is often used to make global changes to a large file or to a stream of data generated by a pipeline of commands. --- 21207,21221 ---- @} @c endfile @end example + @c ENDOFRANGE texse + @c ENDOFRANGE fitex @node Simple Sed, Igawk Program, Extract Program, Miscellaneous Programs @subsection A Simple Stream Editor @cindex @command{sed} utility ! @cindex stream editors ! The @command{sed} utility is a stream editor, a program that reads a stream of data, makes changes to it, and passes it on. It is often used to make global changes to a large file or to a stream of data generated by a pipeline of commands. *************** *** 20150,20156 **** Here, @samp{s/old/new/g} tells @command{sed} to look for the regexp @samp{old} on each input line and globally replace it with the text ! @samp{new}, (i.e., all the occurrences on a line). This is similar to @command{awk}'s @code{gsub} function (@pxref{String Functions, ,String Manipulation Functions}). --- 21228,21234 ---- Here, @samp{s/old/new/g} tells @command{sed} to look for the regexp @samp{old} on each input line and globally replace it with the text ! @samp{new}, i.e., all the occurrences on a line. This is similar to @command{awk}'s @code{gsub} function (@pxref{String Functions, ,String Manipulation Functions}). *************** *** 20161,20168 **** @cindex Brennan, Michael @cindex @command{awksed.awk} program ! @cindex simple stream editor ! @cindex stream editor, simple @example @c file eg/prog/awksed.awk # awksed.awk --- do s/foo/bar/g using just print --- 21239,21246 ---- @cindex Brennan, Michael @cindex @command{awksed.awk} program ! @c @cindex simple stream editor ! @c @cindex stream editor, simple @example @c file eg/prog/awksed.awk # awksed.awk --- do s/foo/bar/g using just print *************** *** 20249,20255 **** { gsub(pat, repl); print } ! Exercise: what are the advantages and disadvantages of this version vs. sed? Advantage: egrep regexps speed (?) Disadvantage: no & in replacement text --- 21327,21333 ---- { gsub(pat, repl); print } ! Exercise: what are the advantages and disadvantages of this version versus sed? Advantage: egrep regexps speed (?) Disadvantage: no & in replacement text *************** *** 20260,20265 **** --- 21338,21347 ---- @node Igawk Program, , Simple Sed, Miscellaneous Programs @subsection An Easy Way to Use Library Functions + @c STARTOFRANGE libfex + @cindex libraries of @command{awk} functions, example program for using + @c STARTOFRANGE flibex + @cindex functions, library, example program for using Using library functions in @command{awk} can be very beneficial. It encourages code reuse and the writing of general functions. Programs are smaller and therefore clearer. *************** *** 20297,20303 **** @option{-f}, and the ability to mix command-line and library source files. The program is written using the POSIX Shell (@command{sh}) command language. ! The way the program works is as follows: @enumerate @item --- 21379,21385 ---- @option{-f}, and the ability to mix command-line and library source files. The program is written using the POSIX Shell (@command{sh}) command language. ! It works as follows: @enumerate @item *************** *** 20315,20323 **** supplies a trailing newline. @item ! Source @value{FN}s provided with @option{-f}. We use a neat trick and echo ! @samp{@@include @var{filename}} into the temporary file. Since the file ! inclusion program works the way @command{gawk} does, this gets the text of the file included into the program at the correct point. @end enumerate --- 21397,21405 ---- supplies a trailing newline. @item ! Source @value{FN}s, provided with @option{-f}. We use a neat trick and echo ! @samp{@@include @var{filename}} into the temporary file. Since the file-inclusion ! program works the way @command{gawk} does, this gets the text of the file included into the program at the correct point. @end enumerate *************** *** 20372,20378 **** @end table If none of the @option{-f}, @option{--file}, @option{-Wfile}, @option{--source}, ! or @option{-Wsource} arguments are supplied, then the first non-option argument should be the @command{awk} program. If there are no command-line arguments left, @command{igawk} prints an error message and exits. Otherwise, the first argument is echoed into @file{/tmp/ig.s.$$}. --- 21454,21460 ---- @end table If none of the @option{-f}, @option{--file}, @option{-Wfile}, @option{--source}, ! or @option{-Wsource} arguments are supplied, then the first nonoption argument should be the @command{awk} program. If there are no command-line arguments left, @command{igawk} prints an error message and exits. Otherwise, the first argument is echoed into @file{/tmp/ig.s.$$}. *************** *** 20381,20387 **** program. @cindex @command{sed} utility ! @cindex stream editor The @samp{$$} in @command{sh} represents the current process ID number. It is often used in shell programs to generate unique temporary @value{FN}s. This allows multiple users to run @command{igawk} without worrying --- 21463,21469 ---- program. @cindex @command{sed} utility ! @cindex stream editors The @samp{$$} in @command{sh} represents the current process ID number. It is often used in shell programs to generate unique temporary @value{FN}s. This allows multiple users to run @command{igawk} without worrying *************** *** 20641,20649 **** @samp{@@include} processing can be done once. @item ! The @code{pathto} function doesn't try to save the line read with ! @code{getline} when testing for the file's accessibility. Trying to save ! this line for use with the main program complicates things considerably. @c what problem does this engender though - exercise @c answer, reading from "-" or /dev/stdin --- 21723,21732 ---- @samp{@@include} processing can be done once. @item ! Not trying to save the line read with @code{getline} ! in the @code{pathto} function when testing for the ! file's accessibility for use with the main program simplifies things ! considerably. @c what problem does this engender though - exercise @c answer, reading from "-" or /dev/stdin *************** *** 20664,20673 **** there is no real reason to build @samp{@@include} processing into @command{gawk} itself. ! @cindex search path ! @cindex directory search ! @cindex path, search ! @cindex search path, for source files As an additional example of this, consider the idea of having two files in a directory in the search path: --- 21747,21758 ---- there is no real reason to build @samp{@@include} processing into @command{gawk} itself. ! @cindex search paths, for source files ! @c comma is part of primary ! @cindex source files, search path for ! @c last comma is part of secondary ! @cindex files, source, search path for ! @cindex directories, searching As an additional example of this, consider the idea of having two files in a directory in the search path: *************** *** 20691,20696 **** --- 21776,21784 ---- to do this. Since @command{igawk} can process nested @samp{@@include} directives, @file{default.awk} could simply contain @samp{@@include} statements for the desired library functions. + @c ENDOFRANGE libfex + @c ENDOFRANGE flibex + @c ENDOFRANGE awkpex @c Exercise: make this change *************** *** 20741,20751 **** Many long-time @command{awk} users learned @command{awk} programming with the original @command{awk} implementation in Version 7 Unix. (This implementation was the basis for @command{awk} in Berkeley Unix, ! through 4.3--Reno. Subsequent versions of Berkeley Unix, and systems ! derived from 4.4BSD--Lite, use various versions of @command{gawk} for their @command{awk}.) This @value{CHAPTER} briefly describes the ! evolution of the @command{awk} language, with cross references to other parts of the @value{DOCUMENT} where you can find more information. @menu --- 21829,21839 ---- Many long-time @command{awk} users learned @command{awk} programming with the original @command{awk} implementation in Version 7 Unix. (This implementation was the basis for @command{awk} in Berkeley Unix, ! through 4.3-Reno. Subsequent versions of Berkeley Unix, and systems ! derived from 4.4BSD-Lite, use various versions of @command{gawk} for their @command{awk}.) This @value{CHAPTER} briefly describes the ! evolution of the @command{awk} language, with cross-references to other parts of the @value{DOCUMENT} where you can find more information. @menu *************** *** 20763,20768 **** --- 21851,21860 ---- @node V7/SVR3.1, SVR4, Language History, Language History @appendixsec Major Changes Between V7 and SVR3.1 + @c STARTOFRANGE gawkv + @cindex @command{awk}, versions of + @c STARTOFRANGE gawkv1 + @cindex @command{awk}, versions of, changes between V7 and SVR3.1 The @command{awk} language evolved considerably between the release of Version 7 Unix (1978) and the new version that was first made generally available in *************** *** 20843,20853 **** Multidimensional arrays (@pxref{Multi-dimensional, ,Multidimensional Arrays}). @end itemize @node SVR4, POSIX, V7/SVR3.1, Language History @appendixsec Changes Between SVR3.1 and SVR4 ! @cindex @command{awk} language, V.4 version The System V Release 4 (1989) version of Unix @command{awk} added these features (some of which originated in @command{gawk}): --- 21935,21946 ---- Multidimensional arrays (@pxref{Multi-dimensional, ,Multidimensional Arrays}). @end itemize + @c ENDOFRANGE gawkv1 @node SVR4, POSIX, V7/SVR3.1, Language History @appendixsec Changes Between SVR3.1 and SVR4 ! @cindex @command{awk}, versions of, changes between SVR3.1 and SVR4 The System V Release 4 (1989) version of Unix @command{awk} added these features (some of which originated in @command{gawk}): *************** *** 20905,20910 **** --- 21998,22005 ---- @node POSIX, BTL, SVR4, Language History @appendixsec Changes Between SVR4 and POSIX @command{awk} + @cindex @command{awk}, versions of, changes between SVR4 and POSIX @command{awk} + @cindex POSIX @command{awk}, changes in @command{awk} versions The POSIX Command Language and Utilities standard for @command{awk} (1992) introduced the following changes into the language: *************** *** 20957,20980 **** @item Specifying @samp{-Ft} on the command line does not set the value ! of @code{FS} to be a single tab character (@pxref{Field Separators, ,Specifying How Fields Are Separated}). @item The @code{fflush} built-in function is not supported (@pxref{I/O Functions, ,Input/Output Functions}). @end itemize @node BTL, POSIX/GNU, POSIX, Language History @appendixsec Extensions in the Bell Laboratories @command{awk} @cindex extensions, Bell Laboratories @command{awk} @cindex Kernighan, Brian Brian Kernighan, one of the original designers of Unix @command{awk}, has made his version available via his home page (@pxref{Other Versions, ,Other Freely Available @command{awk} Implementations}). This @value{SECTION} describes extensions in his version of @command{awk} that are ! not in POSIX @command{awk}. @itemize @bullet @item --- 22052,22078 ---- @item Specifying @samp{-Ft} on the command line does not set the value ! of @code{FS} to be a single TAB character (@pxref{Field Separators, ,Specifying How Fields Are Separated}). @item The @code{fflush} built-in function is not supported (@pxref{I/O Functions, ,Input/Output Functions}). @end itemize + @c ENDOFRANGE gawkv @node BTL, POSIX/GNU, POSIX, Language History @appendixsec Extensions in the Bell Laboratories @command{awk} + @cindex @command{awk}, versions of, See Also Bell Laboratories @command{awk} @cindex extensions, Bell Laboratories @command{awk} + @cindex Bell Laboratories @command{awk} extensions @cindex Kernighan, Brian Brian Kernighan, one of the original designers of Unix @command{awk}, has made his version available via his home page (@pxref{Other Versions, ,Other Freely Available @command{awk} Implementations}). This @value{SECTION} describes extensions in his version of @command{awk} that are ! not in POSIX @command{awk}: @itemize @bullet @item *************** *** 21051,21057 **** Within each category, be alphabetical. @end ignore ! @cindex compatibility mode The GNU implementation, @command{gawk}, adds a large number of features. This @value{SECTION} lists them in the order they were added to @command{gawk}. They can all be disabled with either the @option{--traditional} or --- 22149,22160 ---- Within each category, be alphabetical. @end ignore ! @c STARTOFRANGE fripls ! @cindex compatibility mode (@command{gawk}), extensions ! @c STARTOFRANGE exgnot ! @cindex extensions, in @command{gawk}, not in POSIX @command{awk} ! @c STARTOFRANGE posnot ! @cindex POSIX, @command{gawk} extensions not included in The GNU implementation, @command{gawk}, adds a large number of features. This @value{SECTION} lists them in the order they were added to @command{gawk}. They can all be disabled with either the @option{--traditional} or *************** *** 21119,21125 **** @item The @code{ERRNO} variable, which contains the system error message when ! @code{getline} returns @minus{}1 or when @code{close} fails (@pxref{Built-in Variables}). @item --- 22222,22228 ---- @item The @code{ERRNO} variable, which contains the system error message when ! @code{getline} returns @minus{}1 or @code{close} fails (@pxref{Built-in Variables}). @item *************** *** 21136,21143 **** (@pxref{Options, ,Command-Line Options}). @item ! The @option{--source} option for mixing command-line and library ! file source code (@pxref{Options, ,Command-Line Options}). @end itemize --- 22239,22246 ---- (@pxref{Options, ,Command-Line Options}). @item ! The @option{--source} option for mixing command-line and library-file ! source code (@pxref{Options, ,Command-Line Options}). @end itemize *************** *** 21236,21242 **** @item The ability to use octal and hexadecimal constants in @command{awk} program source code ! (@pxref{Non-decimal-numbers, ,Octal and Hexadecimal Numbers}). @item The @samp{|&} operator for two-way I/O to a coprocess --- 22339,22345 ---- @item The ability to use octal and hexadecimal constants in @command{awk} program source code ! (@pxref{Nondecimal-numbers, ,Octal and Hexadecimal Numbers}). @item The @samp{|&} operator for two-way I/O to a coprocess *************** *** 21309,21315 **** @item The @option{--non-decimal-data} option to allow non-decimal input data ! (@pxref{Non-decimal Data, ,Allowing Non-Decimal Input Data}). @item The @option{--profile} option and @command{pgawk}, the --- 22412,22418 ---- @item The @option{--non-decimal-data} option to allow non-decimal input data ! (@pxref{Nondecimal Data, ,Allowing Nondecimal Input Data}). @item The @option{--profile} option and @command{pgawk}, the *************** *** 21350,21358 **** @c XXX ADD MORE STUFF HERE @node Contributors, , POSIX/GNU, Language History @appendixsec Major Contributors to @command{gawk} ! @cindex contributors to @command{gawk} @quotation @i{Always give credit where credit is due.}@* Anonymous --- 22453,22465 ---- @c XXX ADD MORE STUFF HERE + @c ENDOFRANGE fripls + @c ENDOFRANGE exgnot + @c ENDOFRANGE posnot + @node Contributors, , POSIX/GNU, Language History @appendixsec Major Contributors to @command{gawk} ! @cindex @command{gawk}, list of contributors to @quotation @i{Always give credit where credit is due.}@* Anonymous *************** *** 21433,21439 **** @item @cindex Rommel, Kai Uwe Kai Uwe Rommel ! provided the port to OS/2 and its documentation. @item @cindex Jaegermann, Michal --- 22540,22546 ---- @item @cindex Rommel, Kai Uwe Kai Uwe Rommel ! provided the initial port to OS/2 and its documentation. @item @cindex Jaegermann, Michal *************** *** 21501,21506 **** --- 22608,22622 ---- as well as the code for the new optional third argument to the @code{match} function. @item + @cindex Buening, Andreas + Andreas Buening + updated the @command{gawk} port for OS/2. + + @cindex Hasegawa, Isamu + Isamu Hasegawa, + of IBM in Japan, contributed support for multibyte characters. + + @item @cindex Robbins, Arnold Arnold Robbins has been working on @command{gawk} since 1988, at first *************** *** 21510,21517 **** @node Installation, Notes, Language History, Top @appendix Installing @command{gawk} ! @cindex Linux ! @cindex GNU/Linux This appendix provides instructions for installing @command{gawk} on the various platforms that are supported by the developers. The primary developer supports GNU/Linux (and Unix), whereas the other ports are --- 22626,22637 ---- @node Installation, Notes, Language History, Top @appendix Installing @command{gawk} ! @c last two commas are part of see also ! @cindex operating systems, See Also GNU/Linux, PC operating systems, Unix ! @c STARTOFRANGE gligawk ! @cindex @command{gawk}, installing ! @c STARTOFRANGE ingawk ! @cindex installing @command{gawk} This appendix provides instructions for installing @command{gawk} on the various platforms that are supported by the developers. The primary developer supports GNU/Linux (and Unix), whereas the other ports are *************** *** 21533,21538 **** --- 22653,22659 ---- @node Gawk Distribution, Unix Installation, Installation, Installation @appendixsec The @command{gawk} Distribution + @cindex source code, @command{gawk} This @value{SECTION} describes how to get the @command{gawk} distribution, how to extract it, and then what is in the various files and *************** *** 21546,21568 **** @node Getting, Extracting, Gawk Distribution, Gawk Distribution @appendixsubsec Getting the @command{gawk} Distribution ! @cindex getting @command{gawk} ! @cindex anonymous @command{ftp} ! @cindex @command{ftp}, anonymous ! @cindex source code, @command{gawk} ! @cindex @command{gawk}, source code There are three ways to get GNU software: @itemize @bullet @item Copy it from someone else who already has it. ! @cindex FSF ! @cindex Free Software Foundation @item Order @command{gawk} directly from the Free Software Foundation. ! Software distributions are available for Unix, MS-DOS, and VMS, on ! tape and CD-ROM. Their address is: @display Free Software Foundation --- 22667,22687 ---- @node Getting, Extracting, Gawk Distribution, Gawk Distribution @appendixsubsec Getting the @command{gawk} Distribution ! @c last comma is part of secondary ! @cindex @command{gawk}, source code, obtaining There are three ways to get GNU software: @itemize @bullet @item Copy it from someone else who already has it. ! @cindex FSF (Free Software Foundation) ! @cindex Free Software Foundation (FSF) @item Order @command{gawk} directly from the Free Software Foundation. ! Software distributions are available for ! Gnu/Linux, Unix, and MS-Windows, in several CD packages. ! Their address is: @display Free Software Foundation *************** *** 21571,21577 **** Phone: +1-617-542-5942 Fax (including Japan): +1-617-542-2652 Email: @email{gnu@@gnu.org} ! URL: @uref{http://www.gnu.org/} @end display @noindent --- 22690,22696 ---- Phone: +1-617-542-5942 Fax (including Japan): +1-617-542-2652 Email: @email{gnu@@gnu.org} ! URL: @uref{http://www.gnu.org} @end display @noindent *************** *** 21580,21586 **** @item Retrieve @command{gawk} by using anonymous @command{ftp} to the Internet host ! @code{gnudist.gnu.org}, in the directory @file{/gnu/gawk}. @end itemize The GNU software archive is mirrored around the world. --- 22699,22705 ---- @item Retrieve @command{gawk} by using anonymous @command{ftp} to the Internet host ! @code{ftp.gnu.org}, in the directory @file{/gnu/gawk}. @end itemize The GNU software archive is mirrored around the world. *************** *** 21617,21623 **** been fixed in the release. The current patch level is @value{PATCHLEVEL}, but when retrieving distributions, you should get the version with the highest version, release, and patch level. (Note, however, that patch levels greater than ! or equal to 80 denote ``beta'' or non-production software; you might not want to retrieve such a version unless you don't mind experimenting.) If you are not on a Unix system, you need to make other arrangements for getting and extracting the @command{gawk} distribution. You should consult --- 22736,22742 ---- been fixed in the release. The current patch level is @value{PATCHLEVEL}, but when retrieving distributions, you should get the version with the highest version, release, and patch level. (Note, however, that patch levels greater than ! or equal to 80 denote ``beta'' or nonproduction software; you might not want to retrieve such a version unless you don't mind experimenting.) If you are not on a Unix system, you need to make other arrangements for getting and extracting the @command{gawk} distribution. You should consult *************** *** 21625,21630 **** --- 22744,22751 ---- @node Distribution contents, , Extracting, Gawk Distribution @appendixsubsec Contents of the @command{gawk} Distribution + @c STARTOFRANGE gawdis + @cindex @command{gawk}, distribution The @command{gawk} distribution has a number of C source files, documentation files, *************** *** 21634,21641 **** operating systems: @table @asis ! @item Various @samp{.c}, @samp{.y}, and @samp{.h} files: ! These files are the actual @command{gawk} source code. @end table @table @file --- 22755,22762 ---- operating systems: @table @asis ! @item Various @samp{.c}, @samp{.y}, and @samp{.h} files ! The actual @command{gawk} source code. @end table @table @file *************** *** 21663,21677 **** @item LIMITATIONS A list of those factors that limit @command{gawk}'s performance. ! Most of these depend on the hardware or operating system software, and are not limits in @command{gawk} itself. @item POSIX.STD ! A description of one area where the POSIX standard for @command{awk} is incorrect as well as how @command{gawk} handles the problem. ! @cindex artificial intelligence, using @command{gawk} ! @cindex AI programming, using @command{gawk} @item doc/awkforai.txt A short article describing why @command{gawk} is a good language for AI (Artificial Intelligence) programming. --- 22784,22798 ---- @item LIMITATIONS A list of those factors that limit @command{gawk}'s performance. ! Most of these depend on the hardware or operating system software and are not limits in @command{gawk} itself. @item POSIX.STD ! A description of one area in which the POSIX standard for @command{awk} is incorrect as well as how @command{gawk} handles the problem. ! @c comma is part of primary ! @cindex artificial intelligence, @command{gawk} and @item doc/awkforai.txt A short article describing why @command{gawk} is a good language for AI (Artificial Intelligence) programming. *************** *** 21797,21802 **** --- 22918,22924 ---- If @command{gawk} successfully passes @samp{make check}, then you can be confident of a successful port. @end table + @c ENDOFRANGE gawdis @node Unix Installation, Non-Unix Installation, Gawk Distribution, Installation @appendixsec Compiling and Installing @command{gawk} on Unix *************** *** 21814,21820 **** @node Quick Installation, Additional Configuration Options, Unix Installation, Unix Installation @appendixsubsec Compiling @command{gawk} for Unix ! @cindex installation, unix After you have extracted the @command{gawk} distribution, @command{cd} to @file{gawk-@value{VERSION}.@value{PATCHLEVEL}}. Like most GNU software, @command{gawk} is configured --- 22936,22942 ---- @node Quick Installation, Additional Configuration Options, Unix Installation, Unix Installation @appendixsubsec Compiling @command{gawk} for Unix ! @c @cindex installation, unix After you have extracted the @command{gawk} distribution, @command{cd} to @file{gawk-@value{VERSION}.@value{PATCHLEVEL}}. Like most GNU software, @command{gawk} is configured *************** *** 21877,21891 **** @node Additional Configuration Options, Configuration Philosophy, Quick Installation, Unix Installation @appendixsubsec Additional Configuration Options There are several additional options you may use on the @command{configure} ! command line when compiling @command{gawk} from scratch. @table @code @cindex @code{--enable-portals} configuration option @cindex configuration option, @code{--enable-portals} @item --enable-portals ! This option causes @command{gawk} to treat pathnames that begin with @file{/p} as BSD portal files when doing two-way I/O with the @samp{|&} operator (@pxref{Portal Files, , Using @command{gawk} with BSD Portals}). --- 22999,23016 ---- @node Additional Configuration Options, Configuration Philosophy, Quick Installation, Unix Installation @appendixsubsec Additional Configuration Options + @cindex @command{gawk}, configuring, options + @c comma is part of primary + @cindex configuration options, @command{gawk} There are several additional options you may use on the @command{configure} ! command line when compiling @command{gawk} from scratch, including: @table @code @cindex @code{--enable-portals} configuration option @cindex configuration option, @code{--enable-portals} @item --enable-portals ! Treat pathnames that begin with @file{/p} as BSD portal files when doing two-way I/O with the @samp{|&} operator (@pxref{Portal Files, , Using @command{gawk} with BSD Portals}). *************** *** 21893,21898 **** --- 23018,23024 ---- @cindex Linux @cindex GNU/Linux @cindex @code{--with-included-gettext} configuration option + @cindex @code{--with-included-gettext} configuration option, configuring @command{gawk} with @cindex configuration option, @code{--with-included-gettext} @item --with-included-gettext Use the version of the @code{gettext} library that comes with @command{gawk}. *************** *** 21903,21909 **** @cindex @code{--disable-nls} configuration option @cindex configuration option, @code{--disable-nls} @item --disable-nls ! Disable all message translation facilities. This is usually not desirable, but it may bring you some slight performance improvement. You should also use this option if @option{--with-included-gettext} --- 23029,23035 ---- @cindex @code{--disable-nls} configuration option @cindex configuration option, @code{--disable-nls} @item --disable-nls ! Disable all message-translation facilities. This is usually not desirable, but it may bring you some slight performance improvement. You should also use this option if @option{--with-included-gettext} *************** *** 21913,21919 **** @node Configuration Philosophy, , Additional Configuration Options, Unix Installation @appendixsubsec The Configuration Process ! @cindex configuring @command{gawk} This @value{SECTION} is of interest only if you know something about using the C language and the Unix operating system. --- 23039,23045 ---- @node Configuration Philosophy, , Additional Configuration Options, Unix Installation @appendixsubsec The Configuration Process ! @cindex @command{gawk}, configuring This @value{SECTION} is of interest only if you know something about using the C language and the Unix operating system. *************** *** 21938,21944 **** @code{st_blksize} element in the @code{stat} structure. In this case, @samp{HAVE_ST_BLKSIZE} is undefined. ! @cindex @code{custom.h} configuration file It is possible for your C compiler to lie to @command{configure}. It may do so by not exiting with an error when a library function is not available. To get around this, edit the file @file{custom.h}. --- 23064,23070 ---- @code{st_blksize} element in the @code{stat} structure. In this case, @samp{HAVE_ST_BLKSIZE} is undefined. ! @cindex @code{custom.h} file It is possible for your C compiler to lie to @command{configure}. It may do so by not exiting with an error when a library function is not available. To get around this, edit the file @file{custom.h}. *************** *** 22052,22058 **** @node PC Installation, VMS Installation, BeOS Installation, Non-Unix Installation @appendixsubsec Installation on PC Operating Systems ! @cindex installation, pc operating systems This @value{SECTION} covers installation and usage of @command{gawk} on x86 machines running DOS, any version of Windows, or OS/2. In this @value{SECTION}, the term ``Win32'' --- 23178,23187 ---- @node PC Installation, VMS Installation, BeOS Installation, Non-Unix Installation @appendixsubsec Installation on PC Operating Systems ! @c first comma is part of primary ! @cindex PC operating systems, @command{gawk} on, installing ! @c {PC, gawk on} is the secondary term ! @cindex operating systems, PC, @command{gawk} on, installing This @value{SECTION} covers installation and usage of @command{gawk} on x86 machines running DOS, any version of Windows, or OS/2. In this @value{SECTION}, the term ``Win32'' *************** *** 22071,22076 **** --- 23200,23207 ---- and OS/2. * PC Using:: Running @command{gawk} on MS-DOS, Win32 and OS/2. + * Cygwin:: Building and running @command{gawk} for + Cygwin. @end menu @node PC Binary Installation, PC Compiling, PC Installation, PC Installation *************** *** 22088,22095 **** The binary distribution contains a separate file describing the contents. In particular, it may include more than one version of the ! @command{gawk} executable. OS/2 binary distributions may have a ! different arrangement, but installation is similar. @node PC Compiling, PC Using, PC Binary Installation, PC Installation @appendixsubsubsec Compiling @command{gawk} for PC Operating Systems --- 23219,23246 ---- The binary distribution contains a separate file describing the contents. In particular, it may include more than one version of the ! @command{gawk} executable. ! ! OS/2 (32 bit, EMX) binary distributions are prepared for the @file{/usr} ! directory of your preferred drive. Set @env{UNIXROOT} to your installation ! drive (e.g., @samp{e:}) if you want to install @command{gawk} onto another drive ! than the hardcoded default @samp{c:}. Executables appear in @file{/usr/bin}, ! libraries under @file{/usr/share/awk}, manual pages under @file{/usr/man}, ! Texinfo documentation under @file{/usr/info} and NLS files under @file{/usr/share/locale}. ! If you already have a file @file{/usr/info/dir} from another package ! @emph{do not overwrite it!} Instead enter the following commands at your prompt ! (replace @samp{x:} by your installation drive): ! ! @example ! install-info --info-dir=x:/usr/info x:/usr/info/gawk.info ! install-info --info-dir=x:/usr/info x:/usr/info/gawkinet.info ! @end example ! ! However, the files can be installed anywhere provided @env{AWKPATH} is ! set properly. ! ! The binary distribution may contain a separate file containing additional ! or more detailed installation instructions. @node PC Compiling, PC Using, PC Binary Installation, PC Installation @appendixsubsubsec Compiling @command{gawk} for PC Operating Systems *************** *** 22103,22113 **** additional notes, and @file{pc/Makefile} contains important information on compilation options. ! To build @command{gawk}, copy the files in the @file{pc} directory ! (@emph{except} for @file{ChangeLog}) to the directory with the rest of ! the @command{gawk} sources. The @file{Makefile} contains a configuration ! section with comments and may need to be edited in order to work with ! your @command{make} utility. The @file{Makefile} contains a number of targets for building various MS-DOS, Win32, and OS/2 versions. A list of targets is printed if the @command{make} --- 23254,23264 ---- additional notes, and @file{pc/Makefile} contains important information on compilation options. ! To build @command{gawk} for MS-DOS, Win32, and OS/2 (16 bit; for 32 bit (EMX) ! see below), copy the files in the @file{pc} directory (@emph{except} for ! @file{ChangeLog}) to the directory with the rest of the @command{gawk} sources. ! The @file{Makefile} contains a configuration section with comments and may need ! to be edited in order to work with your @command{make} utility. The @file{Makefile} contains a number of targets for building various MS-DOS, Win32, and OS/2 versions. A list of targets is printed if the @command{make} *************** *** 22125,22142 **** replacement. Details can be found in @file{README_d/README.pc} and in the file @file{pc/Makefile.tst}. ! @node PC Using, , PC Compiling, PC Installation ! @appendixsubsubsec Using @command{gawk} on PC Operating Systems ! @cindex search path ! @cindex directory search ! @cindex path, search ! @cindex search path, for source files The OS/2 and MS-DOS versions of @command{gawk} search for program files as described in @ref{AWKPATH Variable, ,The @env{AWKPATH} Environment Variable}. However, semicolons (rather than colons) separate elements in the @env{AWKPATH} variable. If @env{AWKPATH} is not set or is empty, ! then the default search path is @code{@w{".;c:/lib/awk;c:/gnu/lib/awk"}}. An @command{sh}-like shell (as opposed to @command{command.com} under MS-DOS or @command{cmd.exe} under OS/2) may be useful for @command{awk} programming. --- 23276,23383 ---- replacement. Details can be found in @file{README_d/README.pc} and in the file @file{pc/Makefile.tst}. ! To build @command{gawk} for OS/2 (32 bit, EMX), there are three possibilities: ! @enumerate 1 ! @item ! Using the @command{configure} script included in the official @command{gawk} distribution. ! @command{configure} need not be recreated but a number of restrictions exist ! when using this choice: ! ! @itemize @bullet ! @item ! An external @code{gettext} library cannot be used. I.e. the @command{configure} option ! @option{--without-included-gettext} does not work. Unfortunately, ! the internal @code{gettext} library is seriuosly broken for OS/2. ! Therefore you have to use @option{--disable-nls}. ! ! @item ! Executables must be linked statically (@code{a.out} format only). ! @samp{make install} does not work. ! ! These restrictions are due to restrictions in Autoconf 2.13 and cannot be ! avoided. They will vanish as soon as @command{gawk} moves on to Autoconf 2.5x. ! Now enter the following commands at your @command{sh} prompt: ! ! @example ! $ CC="gcc"; export CC ! $ CFLAGS="-O2"; export CFLAGS ! $ AWK="awk"; export AWK ! $ LD="ld"; export LD ! $ LDFLAGS="-Zexe"; export LDFLAGS ! $ RANLIB="ranlib"; export RANLIB ! $ ac_cv_header_sys_socket_h="yes" ! $ export ac_cv_header_sys_socket_h ! $ ./configure --prefix=c:/usr --disable-nls ! $ make ! @end example ! @end itemize ! ! @item ! Using a special version of Autoconf 2.13 for OS/2 to recreate @command{configure}. ! Not tested. In principle this should work but the same restrictions ! apply as in 1, but the environment variables @env{CC}, @env{AWK}, ! @env{LDFLAGS} and @env{RANLIB} are not necessary. ! ! @item ! Using Autoconf 2.5x to recreate @command{configure} (2.52f or higher recommended). ! Some patches must be applied to @file{Makefile.am} and @file{test/Makefile.am} ! and @file{po/Makefile.in.in}. Currently not supported. ! @end enumerate ! ! @strong{Note:} Even if the compiled @command{gawk.exe} executable contains a DOS header ! (@code{a.out} format), it does @emph{not} work under DOS. To compile an executable ! that runs under DOS, @env{CPPFLAGS} must be set to @code{"-DPIPES_SIMULATED"}. ! But then some nonstandard extensions of @command{gawk} (e.g., @samp{|&}) do not work! ! ! After compilation the internal tests can be performed. Enter ! @samp{make check CMP="diff -a"} at your command prompt. All tests ! but the @code{pid} test are expected to work properly. The @code{pid} ! test might or might not work, no idea why. ! ! @strong{Note:} Most OS/2 ports of GNU @command{make} are not able to handle ! the Makefiles of this package. If you encounter any problems with @command{make} ! try GNU @command{make} 3.79.1. You should find the latest version on ! @uref{ftp://ftp.unixos2.org}. ! ! ! @node PC Using, Cygwin, PC Compiling, PC Installation ! @appendixsubsubsec Using @command{gawk} on PC Operating Systems ! @c STARTOFRANGE opgawx ! @cindex operating systems, PC, @command{gawk} on ! @c STARTOFRANGE pcgawon ! @cindex PC operating systems, @command{gawk} on ! ! With the exception of the Cygwin environment, ! the @samp{|&} operator and TCP/IP networking ! (@pxref{TCP/IP Networking, , Using @command{gawk} for Network Programming}) ! are not supported for MS-DOS or MS-Windows. EMX (OS/2 only) does support ! at least the @samp{|&} operator. ! ! @cindex search paths ! @cindex @command{gawk}, OS/2 version of ! @cindex @command{gawk}, MS-DOS version of ! @cindex @code{;} (semicolon), @code{AWKPATH} variable and ! @cindex semicolon (@code{;}), @code{AWKPATH} variable and ! @cindex @code{AWKPATH} environment variable The OS/2 and MS-DOS versions of @command{gawk} search for program files as described in @ref{AWKPATH Variable, ,The @env{AWKPATH} Environment Variable}. However, semicolons (rather than colons) separate elements in the @env{AWKPATH} variable. If @env{AWKPATH} is not set or is empty, ! then the default search path for OS/2 (16 bit) and MS-DOS versions is ! @code{@w{".;c:/lib/awk;c:/gnu/lib/awk"}}. ! ! The search path for OS/2 (32 bit, EMX) is determined by the prefix directory ! (most likely @file{/usr} or @file{c:/usr}) that has been specified as an option of ! the @command{configure} script like it is the case for the Unix versions. ! If @file{c:/usr} is the prefix directory then the default search path contains @file{.} ! and @file{c:/usr/share/awk}. ! Additionally, to support binary distributions of @command{gawk} for OS/2 ! systems whose drive @samp{c:} might not support long file names or might not exist ! at all, there is a special environment variable. If @env{UNIXROOT} specifies ! a drive then this specific drive is also searched for program files. ! E.g., if @env{UNIXROOT} is set to @file{e:} the complete default search path is ! @code{@w{".;c:/usr/share/awk;e:/usr/share/awk"}}. An @command{sh}-like shell (as opposed to @command{command.com} under MS-DOS or @command{cmd.exe} under OS/2) may be useful for @command{awk} programming. *************** *** 22149,22159 **** the setting for @command{gawk} in the shell configuration may need to be changed and the @code{ignoretype} option may also be of interest. @cindex @code{BINMODE} variable Under OS/2 and DOS, @command{gawk} (and many other text programs) silently translate end-of-line @code{"\r\n"} to @code{"\n"} on input and @code{"\n"} to @code{"\r\n"} on output. A special @code{BINMODE} variable allows ! control over these translations and is interpreted as follows. @itemize @bullet @item --- 23390,23401 ---- the setting for @command{gawk} in the shell configuration may need to be changed and the @code{ignoretype} option may also be of interest. + @cindex differences in @command{awk} and @command{gawk}, @code{BINMODE} variable @cindex @code{BINMODE} variable Under OS/2 and DOS, @command{gawk} (and many other text programs) silently translate end-of-line @code{"\r\n"} to @code{"\n"} on input and @code{"\n"} to @code{"\r\n"} on output. A special @code{BINMODE} variable allows ! control over these translations and is interpreted as follows: @itemize @bullet @item *************** *** 22200,22206 **** @command{mawk} uses @samp{RS = "\r\n"} if binary mode is set on read, which is appropriate for files with the DOS-style end-of-line. ! To Illustrate, the following examples set binary mode on writes for standard output and other files, and set @code{ORS} as the ``usual'' DOS-style end-of-line: --- 23442,23448 ---- @command{mawk} uses @samp{RS = "\r\n"} if binary mode is set on read, which is appropriate for files with the DOS-style end-of-line. ! To illustrate, the following examples set binary mode on writes for standard output and other files, and set @code{ORS} as the ``usual'' DOS-style end-of-line: *************** *** 22236,22241 **** --- 23478,23509 ---- With proper quoting, in the first example the setting of @code{RS} can be moved into the @code{BEGIN} rule. + @node Cygwin, , PC Using, PC Installation + @appendixsubsubsec Using @command{gawk} In The Cygwin Environment + + @command{gawk} can be used ``out of the box'' under Windows if you are + using the Cygwin environment.@footnote{@uref{http://www.cygwin.com}} + This environment provides an excellent simulation of Unix, using the + GNU tools, such as @command{bash}, the GNU Compiler Collection (GCC), + GNU Make, and other GNU tools. Compilation and installation for Cygwin + is the same as for a Unix system: + + @example + tar -xvpzf gawk-@value{VERSION}.@value{PATCHLEVEL}.tar.gz + cd gawk-@value{VERSION}.@value{PATCHLEVEL} + ./configure + make + @end example + + When compared to GNU/Linux on the same system, the @samp{configure} + step on Cygwin takes considerably longer. However, it does finish, + and then the @samp{make} proceeds as usual. + + @strong{Note:} The @samp{|&} operator and TCP/IP networking + (@pxref{TCP/IP Networking, , Using @command{gawk} for Network Programming}) + are fully supported in the Cygwin environment. This is not true + for any other environment for MS-DOS or MS-Windows. + @node VMS Installation, , PC Installation, Non-Unix Installation @appendixsubsec How to Compile and Install @command{gawk} on VMS *************** *** 22375,22384 **** other dash-type options (or multiple parameters such as @value{DF}s to process) are present, there is no ambiguity and @option{--} can be omitted. ! @cindex search path ! @cindex directory search ! @cindex path, search ! @cindex search path, for source files The default search path, when looking for @command{awk} program files specified by the @option{-f} option, is @code{"SYS$DISK:[],AWK_LIBRARY:"}. The logical name @samp{AWKPATH} can be used to override this default. The format --- 23643,23652 ---- other dash-type options (or multiple parameters such as @value{DF}s to process) are present, there is no ambiguity and @option{--} can be omitted. ! @c @cindex directory search ! @c @cindex path, search ! @cindex search paths ! @cindex search paths, for source files The default search path, when looking for @command{awk} program files specified by the @option{-f} option, is @code{"SYS$DISK:[],AWK_LIBRARY:"}. The logical name @samp{AWKPATH} can be used to override this default. The format *************** *** 22589,22594 **** --- 23857,23864 ---- has been ``stolen'' to enable Tandem users to process fixed-length records with no ``end-of-line'' character. That is, @samp{-mr 74} tells @command{gawk} to read the input file as fixed 74-byte records. + @c ENDOFRANGE opgawx + @c ENDOFRANGE pcgawon @node Bugs, Other Versions, Unsupported, Installation @appendixsec Reporting Problems and Bugs *************** *** 22599,22608 **** @end quotation @c the radio show, not the book. :-) ! @cindex bug reports ! @cindex problem reports ! @cindex reporting bugs ! @cindex reporting problems If you have problems with @command{gawk} or think that you have found a bug, please report it to the developers; we cannot promise to do anything but we might well want to fix it. --- 23869,23878 ---- @end quotation @c the radio show, not the book. :-) ! @c STARTOFRANGE dbugg ! @cindex debugging @command{gawk}, bug reports ! @c STARTOFRANGE tblgawb ! @cindex troubleshooting, @command{gawk}, bug reports If you have problems with @command{gawk} or think that you have found a bug, please report it to the developers; we cannot promise to do anything but we might well want to fix it. *************** *** 22621,22627 **** us decide whether the problem is really in the documentation. @cindex @code{bug-gawk@@gnu.org} bug reporting address ! @cindex emaill address for bug reports, @code{bug-gawk@@gnu.org} @cindex bug reports, email address, @code{bug-gawk@@gnu.org} Once you have a precise problem, send email to @email{bug-gawk@@gnu.org}. --- 23891,23897 ---- us decide whether the problem is really in the documentation. @cindex @code{bug-gawk@@gnu.org} bug reporting address ! @cindex email address for bug reports, @code{bug-gawk@@gnu.org} @cindex bug reports, email address, @code{bug-gawk@@gnu.org} Once you have a precise problem, send email to @email{bug-gawk@@gnu.org}. *************** *** 22634,22640 **** email list is archived at the GNU Project. @emph{All email should be in English, since that is my native language.} ! @cindex @code{comp.lang.awk} Usenet news group @strong{Caution:} Do @emph{not} try to report bugs in @command{gawk} by posting to the Usenet/Internet newsgroup @code{comp.lang.awk}. While the @command{gawk} developers do occasionally read this newsgroup, --- 23904,23910 ---- email list is archived at the GNU Project. @emph{All email should be in English, since that is my native language.} ! @cindex @code{comp.lang.awk} newsgroup @strong{Caution:} Do @emph{not} try to report bugs in @command{gawk} by posting to the Usenet/Internet newsgroup @code{comp.lang.awk}. While the @command{gawk} developers do occasionally read this newsgroup, *************** *** 22676,22684 **** @item MS-Windows Juan Grigera, @email{juan@@biophnet.unlp.edu.ar}. - @cindex Rommel, Kai Uwe @item OS/2 ! Kai Uwe Rommel, @email{rommel@@ars.de}. @cindex Davies, Stephen @item Tandem --- 23946,23953 ---- @item MS-Windows Juan Grigera, @email{juan@@biophnet.unlp.edu.ar}. @item OS/2 ! The Unix for OS/2 team, @email{gawk-maintainer@@unixos2.org}. @cindex Davies, Stephen @item Tandem *************** *** 22705,22712 **** @cindex Grigera, Juan @item MS-Windows @tab Juan Grigera, @email{juan@@biophnet.unlp.edu.ar}. ! @cindex Rommel, Kai Uwe ! @item OS/2 @tab Kai Uwe Rommel, @email{rommel@@ars.de}. @cindex Davies, Stephen @item Tandem @tab Stephen Davies, @email{scldad@@sdc.com.au}. --- 23974,23980 ---- @cindex Grigera, Juan @item MS-Windows @tab Juan Grigera, @email{juan@@biophnet.unlp.edu.ar}. ! @item OS/2 @tab The Unix for OS/2 team, @email{gawk-maintainer@@unixos2.org}. @cindex Davies, Stephen @item Tandem @tab Stephen Davies, @email{scldad@@sdc.com.au}. *************** *** 22717,22726 **** If your bug is also reproducible under Unix, please send a copy of your report to the @email{bug-gawk@@gnu.org} email list as well. @node Other Versions, , Bugs, Installation @appendixsec Other Freely Available @command{awk} Implementations ! @cindex other @command{awk} implementations @ignore From: emory!amc.com!brennan (Michael Brennan) Subject: C++ comments in awk programs --- 23985,23997 ---- If your bug is also reproducible under Unix, please send a copy of your report to the @email{bug-gawk@@gnu.org} email list as well. + @c ENDOFRANGE dbugg + @c ENDOFRANGE tblgawb @node Other Versions, , Bugs, Installation @appendixsec Other Freely Available @command{awk} Implementations ! @c STARTOFRANGE awkim ! @cindex @command{awk}, implementations @ignore From: emory!amc.com!brennan (Michael Brennan) Subject: C++ comments in awk programs *************** *** 22740,22747 **** @table @asis @cindex Kernighan, Brian ! @cindex Unix @command{awk}, source code ! @cindex source code, Unix @command{awk} @item Unix @command{awk} Brian Kernighan has made his implementation of @command{awk} freely available. --- 24011,24017 ---- @table @asis @cindex Kernighan, Brian ! @cindex source code, Bell Laboratories @command{awk} @item Unix @command{awk} Brian Kernighan has made his implementation of @command{awk} freely available. *************** *** 22768,22778 **** @xref{BTL, ,Extensions in the Bell Laboratories @command{awk}}, for a list of extensions in this @command{awk} that are not in POSIX @command{awk}. - @cindex GPL - @cindex General Public License - @cindex GNU General Public License @cindex Brennan, Michael ! @cindex @command{mawk}, source code @cindex source code, @command{mawk} @item @command{mawk} Michael Brennan has written an independent implementation of @command{awk}, --- 24038,24045 ---- @xref{BTL, ,Extensions in the Bell Laboratories @command{awk}}, for a list of extensions in this @command{awk} that are not in POSIX @command{awk}. @cindex Brennan, Michael ! @cindex @command{mawk} program @cindex source code, @command{mawk} @item @command{mawk} Michael Brennan has written an independent implementation of @command{awk}, *************** *** 22838,22845 **** The next version of @command{mawk} will support @code{nextfile}. @cindex Sumner, Andrew ! @cindex @command{awka} compiler for @command{awk} programs ! @cindex @command{awka}, source code @cindex source code, @command{awka} @item @command{awka} Written by Andrew Sumner, --- 24105,24111 ---- The next version of @command{mawk} will support @code{nextfile}. @cindex Sumner, Andrew ! @cindex @command{awka} compiler for @command{awk} @cindex source code, @command{awka} @item @command{awka} Written by Andrew Sumner, *************** *** 22848,22859 **** @command{awk} functionality. It also has a number of extensions. - @cindex GPL - @cindex General Public License - @cindex GNU General Public License - @cindex LGPL - @cindex Lesser General Public License - @cindex GNU Lesser General Public License The @command{awk} translator is released under the GPL, and the library is under the LGPL. --- 24114,24119 ---- *************** *** 22864,22872 **** --- 24124,24139 ---- To get @command{awka}, go to @uref{http://awka.sourceforge.net}. You can reach Andrew Sumner at @email{andrew_sumner@@bigfoot.com}. @end table + @c ENDOFRANGE gligawk + @c ENDOFRANGE ingawk + @c ENDOFRANGE awkim @node Notes, Basic Concepts, Installation, Top @appendix Implementation Notes + @c STARTOFRANGE gawii + @cindex @command{gawk}, implementation issues + @c STARTOFRANGE impis + @cindex implementation issues, @command{gawk} This appendix contains information mainly of interest to implementors and maintainers of @command{gawk}. Everything in it applies specifically to *************** *** 22883,22888 **** --- 24150,24160 ---- @node Compatibility Mode, Additions, Notes, Notes @appendixsec Downward Compatibility and Debugging + @cindex @command{gawk}, implementation issues, downward compatibility + @cindex @command{gawk}, implementation issues, debugging + @cindex troubleshooting, @command{gawk} + @c first comma is part of primary + @cindex implementation issues, @command{gawk}, debugging @xref{POSIX/GNU, ,Extensions in @command{gawk} Not in POSIX @command{awk}}, for a summary of the GNU extensions to the @command{awk} language and program. *************** *** 22895,22901 **** @table @code @item -W parsedebug @itemx --parsedebug ! Print out the parse stack information as the program is being parsed. @end table This option is intended only for serious @command{gawk} developers --- 24167,24173 ---- @table @code @item -W parsedebug @itemx --parsedebug ! Prints out the parse stack information as the program is being parsed. @end table This option is intended only for serious @command{gawk} developers *************** *** 22923,22930 **** @node Adding Code, New Ports, Additions, Additions @appendixsubsec Adding New Features ! @cindex adding new features @cindex features, adding to @command{gawk} You are free to add any new features you like to @command{gawk}. However, if you want your changes to be incorporated into the @command{gawk} distribution, there are several steps that you need to take in order to --- 24195,24206 ---- @node Adding Code, New Ports, Additions, Additions @appendixsubsec Adding New Features ! @c STARTOFRANGE adfgaw ! @cindex adding, features to @command{gawk} ! @c STARTOFRANGE fadgaw @cindex features, adding to @command{gawk} + @c STARTOFRANGE gawadf + @cindex @command{gawk}, features, adding You are free to add any new features you like to @command{gawk}. However, if you want your changes to be incorporated into the @command{gawk} distribution, there are several steps that you need to take in order to *************** *** 22958,22968 **** the GNU Project's @command{ftp} site, at ! @uref{ftp://gnudist.gnu.org/gnu/GNUInfo/standards.text}. Texinfo, Info, and DVI versions are also available.) ! @cindex @command{gawk}, coding style ! @cindex coding style used in @command{gawk} @item Use the @command{gawk} coding style. The C code for @command{gawk} follows the instructions in the --- 24234,24243 ---- the GNU Project's @command{ftp} site, at ! @uref{ftp://ftp.gnu.org/gnu/GNUInfo/standards.text}. Texinfo, Info, and DVI versions are also available.) ! @cindex @command{gawk}, coding style in @item Use the @command{gawk} coding style. The C code for @command{gawk} follows the instructions in the *************** *** 23085,23097 **** may write the new code, I have to maintain it and support it. If it isn't possible for me to do that with a minimum of extra work, then I probably will not. @node New Ports, , Adding Code, Additions @appendixsubsec Porting @command{gawk} to a New Operating System @cindex porting @command{gawk} If you want to port @command{gawk} to a new operating system, there are ! several steps to follow: @enumerate 1 @item --- 24360,24377 ---- may write the new code, I have to maintain it and support it. If it isn't possible for me to do that with a minimum of extra work, then I probably will not. + @c ENDOFRANGE adfgaw + @c ENDOFRANGE gawadf + @c ENDOFRANGE fadgaw @node New Ports, , Adding Code, Additions @appendixsubsec Porting @command{gawk} to a New Operating System + @cindex portability, @command{gawk} + @cindex operating systems, porting @command{gawk} to @cindex porting @command{gawk} If you want to port @command{gawk} to a new operating system, there are ! several steps: @enumerate 1 @item *************** *** 23105,23119 **** concerning coding style, submission of diffs, and so on. @item ! When doing a port, bear in mind that your code must co-exist peacefully with the rest of @command{gawk} and the other ports. Avoid gratuitous changes to the system-independent parts of the code. If at all possible, avoid sprinkling @samp{#ifdef}s just for your port throughout the code. - @cindex GPL - @cindex General Public License - @cindex GNU General Public License If the changes needed for a particular system affect too much of the code, I probably will not accept them. In such a case, you can, of course, distribute your changes on your own, as long as you comply --- 24385,24396 ---- concerning coding style, submission of diffs, and so on. @item ! When doing a port, bear in mind that your code must coexist peacefully with the rest of @command{gawk} and the other ports. Avoid gratuitous changes to the system-independent parts of the code. If at all possible, avoid sprinkling @samp{#ifdef}s just for your port throughout the code. If the changes needed for a particular system affect too much of the code, I probably will not accept them. In such a case, you can, of course, distribute your changes on your own, as long as you comply *************** *** 23182,23188 **** @end enumerate Following these steps makes it much easier to integrate your changes ! into @command{gawk} and have them co-exist happily with other operating systems' code that is already there. In the code that you supply and maintain, feel free to use a --- 24459,24465 ---- @end enumerate Following these steps makes it much easier to integrate your changes ! into @command{gawk} and have them coexist happily with other operating systems' code that is already there. In the code that you supply and maintain, feel free to use a *************** *** 23199,23206 **** The Robot @end quotation ! @cindex Linux ! @cindex GNU/Linux Beginning with @command{gawk} 3.1, it is possible to add new built-in functions to @command{gawk} using dynamically loaded libraries. This facility is available on systems (such as GNU/Linux) that support --- 24476,24487 ---- The Robot @end quotation ! @c STARTOFRANGE gladfgaw ! @cindex @command{gawk}, functions, adding ! @c STARTOFRANGE adfugaw ! @cindex adding, functions to @command{gawk} ! @c STARTOFRANGE fubadgaw ! @cindex functions, built-in, adding to @command{gawk} Beginning with @command{gawk} 3.1, it is possible to add new built-in functions to @command{gawk} using dynamically loaded libraries. This facility is available on systems (such as GNU/Linux) that support *************** *** 23222,23227 **** --- 24503,24510 ---- @node Internals, Sample Library, Dynamic Extensions, Dynamic Extensions @appendixsubsec A Minimal Introduction to @command{gawk} Internals + @c STARTOFRANGE gawint + @cindex @command{gawk}, internals The truth is that @command{gawk} was not designed for simple extensibility. The facilities for adding functions using shared libraries work, but *************** *** 23233,23279 **** Reading @file{awk.y} in order to see how the parse tree is built would also be of use. With the disclaimers out of the way, the following types, structure members, functions, and macros are declared in @file{awk.h} and are of use when writing extensions. The next @value{SECTION} shows how they are used: @table @code @cindex @code{AWKNUM} internal type - @cindex internal type, @code{AWKNUM} @item AWKNUM An @code{AWKNUM} is the internal type of @command{awk} floating-point numbers. Typically, it is a C @code{double}. @cindex @code{NODE} internal type ! @cindex internal type, @code{NODE} @item NODE Just about everything is done using objects of type @code{NODE}. These contain both strings and numbers, as well as variables and arrays. @cindex @code{force_number} internal function ! @cindex internal function, @code{force_number} @item AWKNUM force_number(NODE *n) This macro forces a value to be numeric. It returns the actual numeric value contained in the node. It may end up calling an internal @command{gawk} function. @cindex @code{force_string} internal function - @cindex internal function, @code{force_string} @item void force_string(NODE *n) This macro guarantees that a @code{NODE}'s string value is current. It may end up calling an internal @command{gawk} function. It also guarantees that the string is zero-terminated. @cindex @code{param_cnt} internal variable - @cindex internal variable, @code{param_cnt} @item n->param_cnt The number of parameters actually passed in a function call at runtime. @cindex @code{stptr} internal variable @cindex @code{stlen} internal variable - @cindex internal variable, @code{stptr} - @cindex internal variable, @code{stlen} @item n->stptr @itemx n->stlen The data and length of a @code{NODE}'s string value, respectively. --- 24516,24563 ---- Reading @file{awk.y} in order to see how the parse tree is built would also be of use. + @cindex @code{awk.h} file (internal) With the disclaimers out of the way, the following types, structure members, functions, and macros are declared in @file{awk.h} and are of use when writing extensions. The next @value{SECTION} shows how they are used: @table @code + @cindex floating-point, numbers, @code{AWKNUM} internal type + @cindex numbers, floating-point, @code{AWKNUM} internal type @cindex @code{AWKNUM} internal type @item AWKNUM An @code{AWKNUM} is the internal type of @command{awk} floating-point numbers. Typically, it is a C @code{double}. @cindex @code{NODE} internal type ! @cindex strings, @code{NODE} internal type ! @cindex numbers, @code{NODE} internal type @item NODE Just about everything is done using objects of type @code{NODE}. These contain both strings and numbers, as well as variables and arrays. @cindex @code{force_number} internal function ! @cindex numeric, values @item AWKNUM force_number(NODE *n) This macro forces a value to be numeric. It returns the actual numeric value contained in the node. It may end up calling an internal @command{gawk} function. @cindex @code{force_string} internal function @item void force_string(NODE *n) This macro guarantees that a @code{NODE}'s string value is current. It may end up calling an internal @command{gawk} function. It also guarantees that the string is zero-terminated. + @c comma is part of primary + @cindex parameters, number of @cindex @code{param_cnt} internal variable @item n->param_cnt The number of parameters actually passed in a function call at runtime. @cindex @code{stptr} internal variable @cindex @code{stlen} internal variable @item n->stptr @itemx n->stlen The data and length of a @code{NODE}'s string value, respectively. *************** *** 23283,23308 **** call the routine, and then restore the value. @cindex @code{type} internal variable - @cindex internal variable, @code{type} @item n->type The type of the @code{NODE}. This is a C @code{enum}. Values should be either @code{Node_var} or @code{Node_var_array} for function parameters. @cindex @code{vname} internal variable - @cindex internal variable, @code{vname} @item n->vname The ``variable name'' of a node. This is not of much use inside externally written extensions. @cindex @code{assoc_clear} internal function - @cindex internal function, @code{assoc_clear} @item void assoc_clear(NODE *n) Clears the associative array pointed to by @code{n}. Make sure that @samp{n->type == Node_var_array} first. @cindex @code{assoc_lookup} internal function - @cindex internal function, @code{assoc_lookup} @item NODE **assoc_lookup(NODE *symbol, NODE *subs, int reference) Finds, and installs if necessary, array elements. @code{symbol} is the array, @code{subs} is the subscript. --- 24567,24590 ---- call the routine, and then restore the value. @cindex @code{type} internal variable @item n->type The type of the @code{NODE}. This is a C @code{enum}. Values should be either @code{Node_var} or @code{Node_var_array} for function parameters. @cindex @code{vname} internal variable @item n->vname The ``variable name'' of a node. This is not of much use inside externally written extensions. + @cindex arrays, associative, clearing @cindex @code{assoc_clear} internal function @item void assoc_clear(NODE *n) Clears the associative array pointed to by @code{n}. Make sure that @samp{n->type == Node_var_array} first. + @cindex arrays, elements, installing @cindex @code{assoc_lookup} internal function @item NODE **assoc_lookup(NODE *symbol, NODE *subs, int reference) Finds, and installs if necessary, array elements. @code{symbol} is the array, @code{subs} is the subscript. *************** *** 23311,23325 **** value before it is created. Typically, @code{FALSE} is the correct value to use from extension functions. @cindex @code{make_string} internal function - @cindex internal function, @code{make_string} @item NODE *make_string(char *s, size_t len) Take a C string and turn it into a pointer to a @code{NODE} that can be stored appropriately. This is permanent storage; understanding of @command{gawk} memory management is helpful. @cindex @code{make_number} internal function - @cindex internal function, @code{make_number} @item NODE *make_number(AWKNUM val) Take an @code{AWKNUM} and turn it into a pointer to a @code{NODE} that can be stored appropriately. This is permanent storage; understanding --- 24593,24607 ---- value before it is created. Typically, @code{FALSE} is the correct value to use from extension functions. + @cindex strings @cindex @code{make_string} internal function @item NODE *make_string(char *s, size_t len) Take a C string and turn it into a pointer to a @code{NODE} that can be stored appropriately. This is permanent storage; understanding of @command{gawk} memory management is helpful. + @cindex numbers @cindex @code{make_number} internal function @item NODE *make_number(AWKNUM val) Take an @code{AWKNUM} and turn it into a pointer to a @code{NODE} that can be stored appropriately. This is permanent storage; understanding *************** *** 23327,23360 **** @cindex @code{tmp_string} internal function @item NODE *tmp_string(char *s, size_t len); - @cindex internal function, @code{tmp_string} Take a C string and turn it into a pointer to a @code{NODE} that can be stored appropriately. This is temporary storage; understanding of @command{gawk} memory management is helpful. @cindex @code{tmp_number} internal function @item NODE *tmp_number(AWKNUM val) - @cindex internal function, @code{tmp_number} Take an @code{AWKNUM} and turn it into a pointer to a @code{NODE} that can be stored appropriately. This is temporary storage; understanding of @command{gawk} memory management is helpful. @cindex @code{dupnode} internal function - @cindex internal function, @code{dupnode} @item NODE *dupnode(NODE *n) Duplicate a node. In most cases, this increments an internal reference count instead of actually duplicating the entire @code{NODE}; understanding of @command{gawk} memory management is helpful. @cindex @code{free_temp} internal macro - @cindex internal macro, @code{free_temp} @item void free_temp(NODE *n) This macro releases the memory associated with a @code{NODE} allocated with @code{tmp_string} or @code{tmp_number}. Understanding of @command{gawk} memory management is helpful. @cindex @code{make_builtin} internal function - @cindex internal function, @code{make_builtin} @item void make_builtin(char *name, NODE *(*func)(NODE *), int count) Register a C function pointed to by @code{func} as new built-in function @code{name}. @code{name} is a regular C string. @code{count} --- 24609,24640 ---- @cindex @code{tmp_string} internal function @item NODE *tmp_string(char *s, size_t len); Take a C string and turn it into a pointer to a @code{NODE} that can be stored appropriately. This is temporary storage; understanding of @command{gawk} memory management is helpful. @cindex @code{tmp_number} internal function @item NODE *tmp_number(AWKNUM val) Take an @code{AWKNUM} and turn it into a pointer to a @code{NODE} that can be stored appropriately. This is temporary storage; understanding of @command{gawk} memory management is helpful. + @c comma is part of primary + @cindex nodes, duplicating @cindex @code{dupnode} internal function @item NODE *dupnode(NODE *n) Duplicate a node. In most cases, this increments an internal reference count instead of actually duplicating the entire @code{NODE}; understanding of @command{gawk} memory management is helpful. + @cindex memory, releasing @cindex @code{free_temp} internal macro @item void free_temp(NODE *n) This macro releases the memory associated with a @code{NODE} allocated with @code{tmp_string} or @code{tmp_number}. Understanding of @command{gawk} memory management is helpful. @cindex @code{make_builtin} internal function @item void make_builtin(char *name, NODE *(*func)(NODE *), int count) Register a C function pointed to by @code{func} as new built-in function @code{name}. @code{name} is a regular C string. @code{count} *************** *** 23371,23394 **** @} @end example @cindex @code{get_argument} internal function - @cindex internal function, @code{get_argument} @item NODE *get_argument(NODE *tree, int i) This function is called from within a C extension function to get ! the @code{i}'th argument from the function call. The first argument is argument zero. @cindex @code{set_value} internal function @item void set_value(NODE *tree) - @cindex internal function, @code{set_value} This function is called from within a C extension function to set the return value from the extension function. This value is what the @command{awk} program sees as the return value from the new @command{awk} function. @cindex @code{update_ERRNO} internal function @item void update_ERRNO(void) - @cindex internal function, @code{update_ERRNO} This function is called from within a C extension function to set the value of @command{gawk}'s @code{ERRNO} variable, based on the current value of the C @code{errno} variable. --- 24651,24675 ---- @} @end example + @cindex arguments, retrieving @cindex @code{get_argument} internal function @item NODE *get_argument(NODE *tree, int i) This function is called from within a C extension function to get ! the @code{i}-th argument from the function call. The first argument is argument zero. + @c last comma is part of secondary + @cindex functions, return values, setting @cindex @code{set_value} internal function @item void set_value(NODE *tree) This function is called from within a C extension function to set the return value from the extension function. This value is what the @command{awk} program sees as the return value from the new @command{awk} function. + @cindex @code{ERRNO} variable @cindex @code{update_ERRNO} internal function @item void update_ERRNO(void) This function is called from within a C extension function to set the value of @command{gawk}'s @code{ERRNO} variable, based on the current value of the C @code{errno} variable. *************** *** 23398,23404 **** An argument that is supposed to be an array needs to be handled with some extra code, in case the array being passed in is actually from a function parameter. ! The following ``boiler plate'' code shows how to do this: @smallexample NODE *the_arg; --- 24679,24685 ---- An argument that is supposed to be an array needs to be handled with some extra code, in case the array being passed in is actually from a function parameter. ! The following boilerplate code shows how to do this: @smallexample NODE *the_arg; *************** *** 23424,23432 **** --- 24705,24725 ---- Again, you should spend time studying the @command{gawk} internals; don't just blindly copy this code. + @c ENDOFRANGE gawint @node Sample Library, , Internals, Dynamic Extensions @appendixsubsec Directory and File Operation Built-ins + @c comma is part of primary + @c STARTOFRANGE chdirg + @cindex @code{chdir} function, implementing in @command{gawk} + @c comma is part of primary + @c STARTOFRANGE statg + @cindex @code{stat} function, implementing in @command{gawk} + @c last comma is part of secondary + @c STARTOFRANGE filre + @cindex files, information about, retrieving + @c STARTOFRANGE dirch + @cindex directories, changing Two useful functions that are not in @command{awk} are @code{chdir} (so that an @command{awk} program can change its directory) and *************** *** 23586,23593 **** @node Internal File Ops, Using Internal File Ops, Internal File Description, Sample Library @appendixsubsubsec C Code for @code{chdir} and @code{stat} - @cindex Linux - @cindex GNU/Linux Here is the C code for these extensions. They were written for GNU/Linux. The code needs some more work for complete portability to other POSIX-compliant systems:@footnote{This version is edited --- 24879,24884 ---- *************** *** 23617,23624 **** for the @command{gawk} internals. It includes @code{} for access to the @code{major} and @code{minor} macros. ! @cindex conventions, programming ! @cindex programming conventions By convention, for an @command{awk} function @code{foo}, the function that implements it is called @samp{do_foo}. The function should take a @samp{NODE *} argument, usually called @code{tree}, that --- 24908,24914 ---- for the @command{gawk} internals. It includes @code{} for access to the @code{major} and @code{minor} macros. ! @cindex programming conventions, @command{gawk} internals By convention, for an @command{awk} function @code{foo}, the function that implements it is called @samp{do_foo}. The function should take a @samp{NODE *} argument, usually called @code{tree}, that *************** *** 23763,23770 **** @} @end example ! @cindex conventions, programming ! @cindex programming conventions Finally, it's necessary to provide the ``glue'' that loads the new function(s) into @command{gawk}. By convention, each library has a routine named @code{dlload} that does the job: --- 25053,25059 ---- @} @end example ! @cindex programming conventions, @command{gawk} internals Finally, it's necessary to provide the ``glue'' that loads the new function(s) into @command{gawk}. By convention, each library has a routine named @code{dlload} that does the job: *************** *** 23789,23796 **** @node Using Internal File Ops, , Internal File Ops, Sample Library @appendixsubsubsec Integrating the Extensions ! @cindex Linux ! @cindex GNU/Linux Now that the code is written, it must be possible to add it at runtime to the running @command{gawk} interpreter. First, the code must be compiled. Assuming that the functions are in --- 25078,25085 ---- @node Using Internal File Ops, , Internal File Ops, Sample Library @appendixsubsubsec Integrating the Extensions ! @c last comma is part of secondary ! @cindex @command{gawk}, interpreter, adding code to Now that the code is written, it must be possible to add it at runtime to the running @command{gawk} interpreter. First, the code must be compiled. Assuming that the functions are in *************** *** 23804,23810 **** $ ld -o filefuncs.so -shared filefuncs.o @end example ! @cindex @code{extension} built-in function Once the library exists, it is loaded by calling the @code{extension} built-in function. This function takes two arguments: the name of the --- 25093,25099 ---- $ ld -o filefuncs.so -shared filefuncs.o @end example ! @cindex @code{extension} function (@command{gawk}) Once the library exists, it is loaded by calling the @code{extension} built-in function. This function takes two arguments: the name of the *************** *** 23854,23859 **** --- 25143,25155 ---- @print{} data["uid"] = 2076 @print{} testff.awk modified: 07 19 99 08:25:36 @end example + @c ENDOFRANGE filre + @c ENDOFRANGE dirch + @c ENDOFRANGE statg + @c ENDOFRANGE chdirg + @c ENDOFRANGE gladfgaw + @c ENDOFRANGE adfugaw + @c ENDOFRANGE fubadgaw @node Future Extensions, , Dynamic Extensions, Notes @appendixsec Probable Future Extensions *************** *** 23912,23925 **** @c these are ordered by likelihood @table @asis ! @item Loadable Module Interface It is not clear that the @command{awk}-level interface to the modules facility is as good as it should be. The interface needs to be redesigned, particularly taking namespace issues into account, as well as possibly including issues such as library search path order and versioning. ! @item @code{RECLEN} variable for fixed length records Along with @code{FIELDWIDTHS}, this would speed up the processing of fixed-length records. @code{PROCINFO["RS"]} would be @code{"RS"} or @code{"RECLEN"}, --- 25208,25221 ---- @c these are ordered by likelihood @table @asis ! @item Loadable module interface It is not clear that the @command{awk}-level interface to the modules facility is as good as it should be. The interface needs to be redesigned, particularly taking namespace issues into account, as well as possibly including issues such as library search path order and versioning. ! @item @code{RECLEN} variable for fixed-length records Along with @code{FIELDWIDTHS}, this would speed up the processing of fixed-length records. @code{PROCINFO["RS"]} would be @code{"RS"} or @code{"RECLEN"}, *************** *** 23938,23944 **** @item Databases It may be possible to map a GDBM/NDBM/SDBM file into an @command{awk} array. ! @item Large Character Sets It would be nice if @command{gawk} could handle UTF-8 and other character sets that are larger than eight bits. --- 25234,25240 ---- @item Databases It may be possible to map a GDBM/NDBM/SDBM file into an @command{awk} array. ! @item Large character sets It would be nice if @command{gawk} could handle UTF-8 and other character sets that are larger than eight bits. *************** *** 23950,23956 **** source code easier to work with: @table @asis ! @item Loadable Module Mechanics The current extension mechanism works (@pxref{Dynamic Extensions, ,Adding New Built-in Functions to @command{gawk}}), but is rather primitive. It requires a fair amount of manual work --- 25246,25252 ---- source code easier to work with: @table @asis ! @item Loadable module mechanics The current extension mechanism works (@pxref{Dynamic Extensions, ,Adding New Built-in Functions to @command{gawk}}), but is rather primitive. It requires a fair amount of manual work *************** *** 23960,23976 **** would make using loadable modules much easier. @command{gawk} should be changed to use @command{libtool}. ! @item Loadable Module Internals The API to its internals that @command{gawk} ``exports'' should be revised. Too many things are needlessly exposed. A new API should be designed and implemented to make module writing easier. ! @item Better Array Subscript Management @command{gawk}'s management of array subscript storage could use revamping, so that using the same value to index multiple arrays only stores one copy of the index value. ! @item Integrating the DBUG Library Integrating Fred Fish's DBUG library would be helpful during development, but it's a lot of work to do. @end table --- 25256,25272 ---- would make using loadable modules much easier. @command{gawk} should be changed to use @command{libtool}. ! @item Loadable module internals The API to its internals that @command{gawk} ``exports'' should be revised. Too many things are needlessly exposed. A new API should be designed and implemented to make module writing easier. ! @item Better array subscript management @command{gawk}'s management of array subscript storage could use revamping, so that using the same value to index multiple arrays only stores one copy of the index value. ! @item Integrating the DBUG library Integrating Fred Fish's DBUG library would be helpful during development, but it's a lot of work to do. @end table *************** *** 23979,23985 **** perform better: @table @asis ! @item An Improved Version of @code{dfa} The @code{dfa} pattern matcher from GNU @command{grep} has some problems. Either a new version or a fixed one will deal with some important regexp matching issues. --- 25275,25281 ---- perform better: @table @asis ! @item An improved version of @code{dfa} The @code{dfa} pattern matcher from GNU @command{grep} has some problems. Either a new version or a fixed one will deal with some important regexp matching issues. *************** *** 23997,24002 **** --- 25293,25300 ---- C compiler and a special @command{gawk} library to provide all the needed functions (regexps, fields, associative arrays, type coercion, and so on). + @c last comma is part of secondary + @cindex @command{gawk}, interpreter, adding code to An easier possibility might be for an intermediate phase of @command{gawk} to convert the parse tree into a linear byte code form like the one used in GNU Emacs Lisp. The recursive evaluator would then be replaced by *************** *** 24010,24020 **** @xref{Additions, ,Making Additions to @command{gawk}}, if you are interested in tackling any of these projects. @node Basic Concepts, Glossary, Notes, Top @appendix Basic Programming Concepts ! @cindex basic programming concepts ! @cindex programming concepts, basic This @value{APPENDIX} attempts to define some of the basic concepts and terms that are used throughout the rest of this @value{DOCUMENT}. --- 25308,25321 ---- @xref{Additions, ,Making Additions to @command{gawk}}, if you are interested in tackling any of these projects. + @c ENDOFRANGE impis + @c ENDOFRANGE gawii @node Basic Concepts, Glossary, Notes, Top @appendix Basic Programming Concepts ! @cindex programming, concepts ! @c STARTOFRANGE procon ! @cindex programming, concepts This @value{APPENDIX} attempts to define some of the basic concepts and terms that are used throughout the rest of this @value{DOCUMENT}. *************** *** 24104,24112 **** @end ifnottex @cindex compiled programs - @cindex programs, compiled @cindex interpreted programs - @cindex programs, interpreted The ``program'' in the figure can be either a compiled program@footnote{Compiled programs are typically written in lower-level languages such as C, C++, Fortran, or Ada, --- 25405,25411 ---- *************** *** 24257,24273 **** After the cake comes out of the oven, you still have to wrap it in plastic wrap to keep anyone from tasting it, as well as wash ! the mixing bowls and other utensils. @end table ! @cindex algorithm, definition of An @dfn{algorithm} is a detailed set of instructions necessary to accomplish a task, or process data. It is much the same as a recipe for baking a cake. Programs implement algorithms. Often, it is up to you to design the algorithm and implement it, simultaneously. ! @cindex record, definition of ! @cindex fields, definition of The ``logical chunks'' we talked about previously are called @dfn{records}, similar to the records a company keeps on employees, a school keeps for students, or a doctor keeps for patients. --- 25556,25572 ---- After the cake comes out of the oven, you still have to wrap it in plastic wrap to keep anyone from tasting it, as well as wash ! the mixing bowls and utensils. @end table ! @cindex algorithms An @dfn{algorithm} is a detailed set of instructions necessary to accomplish a task, or process data. It is much the same as a recipe for baking a cake. Programs implement algorithms. Often, it is up to you to design the algorithm and implement it, simultaneously. ! @cindex records ! @cindex fields The ``logical chunks'' we talked about previously are called @dfn{records}, similar to the records a company keeps on employees, a school keeps for students, or a doctor keeps for patients. *************** *** 24277,24288 **** The act of reading data is termed @dfn{input}, and that of generating results, not too surprisingly, is termed @dfn{output}. ! They are often referred to together as ``Input/Output,'' and even more often, as ``I/O'' for short. (You will also see ``input'' and ``output'' used as verbs.) @cindex data-driven languages ! @cindex language, data-driven @command{awk} manages the reading of data for you, as well as the breaking it up into records and fields. Your program's job is to tell @command{awk} what to with the data. You do this by describing --- 25576,25588 ---- The act of reading data is termed @dfn{input}, and that of generating results, not too surprisingly, is termed @dfn{output}. ! They are often referred to together as ``input/output,'' and even more often, as ``I/O'' for short. (You will also see ``input'' and ``output'' used as verbs.) @cindex data-driven languages ! @c comma is part of primary ! @cindex languages, data-driven @command{awk} manages the reading of data for you, as well as the breaking it up into records and fields. Your program's job is to tell @command{awk} what to with the data. You do this by describing *************** *** 24294,24305 **** @node Basic Data Typing, Floating Point Issues, Basic High Level, Basic Concepts @appendixsec Data Values in a Computer ! @cindex variable, definition of In a program, you keep track of information and values in things called @dfn{variables}. A variable is just a name for a given value, such as @code{first_name}, @code{last_name}, @code{address}, and so on. ! @command{awk} has several pre-defined variables, and it has special names to refer to the current input record and the fields of the record. You may also group multiple --- 25594,25605 ---- @node Basic Data Typing, Floating Point Issues, Basic High Level, Basic Concepts @appendixsec Data Values in a Computer ! @cindex variables In a program, you keep track of information and values in things called @dfn{variables}. A variable is just a name for a given value, such as @code{first_name}, @code{last_name}, @code{address}, and so on. ! @command{awk} has several predefined variables, and it has special names to refer to the current input record and the fields of the record. You may also group multiple *************** *** 24307,24313 **** @cindex values, numeric @cindex values, string ! @cindex scalar, definition of Data, particularly in @command{awk}, consists of either numeric values, such as 42 or 3.1415927, or string values. String values are essentially anything that's not a number, such as a name. --- 25607,25613 ---- @cindex values, numeric @cindex values, string ! @cindex scalar values Data, particularly in @command{awk}, consists of either numeric values, such as 42 or 3.1415927, or string values. String values are essentially anything that's not a number, such as a name. *************** *** 24317,24325 **** referred to as @dfn{scalar} values. Groups of values, such as arrays, are not scalars. ! @cindex integer, definition of ! @cindex floating-point, definition of ! Within computers, there are two kinds of numeric values: @dfn{integers}, and @dfn{floating-point}. In school, integer values were referred to as ``whole'' numbers---that is, numbers without any fractional part, such as 1, 42, or @minus{}17. --- 25617,25626 ---- referred to as @dfn{scalar} values. Groups of values, such as arrays, are not scalars. ! @cindex integers ! @cindex floating-point, numbers ! @cindex numbers, floating-point ! Within computers, there are two kinds of numeric values: @dfn{integers} and @dfn{floating-point}. In school, integer values were referred to as ``whole'' numbers---that is, numbers without any fractional part, such as 1, 42, or @minus{}17. *************** *** 24328,24342 **** this range is @minus{}2,147,483,648 to 2,147,483,647. @cindex unsigned integers ! @cindex integer, unsigned Integer values come in two flavors: @dfn{signed} and @dfn{unsigned}. Signed values may be negative or positive, with the range of values just described. Unsigned values are always positive. On most modern systems, the range is from 0 to 4,294,967,295. ! @cindex double-precision floating-point, definition of ! @cindex single-precision floating-point, definition of Floating-point numbers represent what are called ``real'' numbers; i.e., those that do have a fractional part, such as 3.1415927. The advantage to floating-point numbers is that they --- 25629,25643 ---- this range is @minus{}2,147,483,648 to 2,147,483,647. @cindex unsigned integers ! @cindex integers, unsigned Integer values come in two flavors: @dfn{signed} and @dfn{unsigned}. Signed values may be negative or positive, with the range of values just described. Unsigned values are always positive. On most modern systems, the range is from 0 to 4,294,967,295. ! @cindex double-precision floating-point ! @cindex single-precision floating-point Floating-point numbers represent what are called ``real'' numbers; i.e., those that do have a fractional part, such as 3.1415927. The advantage to floating-point numbers is that they *************** *** 24354,24361 **** Advanced applications sometimes have to manipulate bits directly, and @command{gawk} provides functions for doing so. ! @cindex null string, definition of ! @cindex empty string, definition of While you are probably used to the idea of a number without a value (i.e., zero), it takes a bit more getting used to the idea of zero-length character data. Nevertheless, such a thing exists. --- 25655,25661 ---- Advanced applications sometimes have to manipulate bits directly, and @command{gawk} provides functions for doing so. ! @cindex null strings While you are probably used to the idea of a number without a value (i.e., zero), it takes a bit more getting used to the idea of zero-length character data. Nevertheless, such a thing exists. *************** *** 24375,24381 **** Thus, binary 1010 represents 1 times 8, plus 0 times 4, plus 1 times 2, plus 0 times 1, or decimal 10. Octal and hexadecimal are discussed more in ! @ref{Non-decimal-numbers, ,Octal and Hexadecimal Numbers}. Programs are written in programming languages. Hundreds, if not thousands, of programming languages exist. --- 25675,25681 ---- Thus, binary 1010 represents 1 times 8, plus 0 times 4, plus 1 times 2, plus 0 times 1, or decimal 10. Octal and hexadecimal are discussed more in ! @ref{Nondecimal-numbers, ,Octal and Hexadecimal Numbers}. Programs are written in programming languages. Hundreds, if not thousands, of programming languages exist. *************** *** 24390,24396 **** the authors of the first book on C. (Dennis Ritchie created the language, and Brian Kernighan was one of the creators of @command{awk}.) ! In the mid-1980's, an effort began to produce an international standard for C. This work culminated in 1989, with the production of the ANSI standard for C. This standard became an ISO standard in 1990. Where it makes sense, POSIX @command{awk} is compatible with 1990 ISO C. --- 25690,25696 ---- the authors of the first book on C. (Dennis Ritchie created the language, and Brian Kernighan was one of the creators of @command{awk}.) ! In the mid-1980s, an effort began to produce an international standard for C. This work culminated in 1989, with the production of the ANSI standard for C. This standard became an ISO standard in 1990. Where it makes sense, POSIX @command{awk} is compatible with 1990 ISO C. *************** *** 24403,24420 **** @appendixsec Floating-Point Number Caveats As mentioned earlier, floating-point numbers represent what are called ! ``real'' numbers; i.e., those that have a fractional part. @command{awk} uses double-precision floating-point numbers to represent all numeric values. This @value{SECTION} describes some of the issues involved in using floating-point numbers. There is a very nice paper on floating-point arithmetic by ! David Goldberg, @cite{What Every ! Computer Scientist Should Know About Floating-point Arithmetic}, @cite{ACM Computing Surveys} @strong{23}, 1 (1991-03), ! 5-48.@footnote{@uref{http://www.validgh.com/goldberg/paper.ps}} This is worth reading if you are interested in the details, ! but it does require a background in Computer Science. Internally, @command{awk} keeps both the numeric value (double-precision floating-point) and the string value for a variable. --- 25703,25720 ---- @appendixsec Floating-Point Number Caveats As mentioned earlier, floating-point numbers represent what are called ! ``real'' numbers, i.e., those that have a fractional part. @command{awk} uses double-precision floating-point numbers to represent all numeric values. This @value{SECTION} describes some of the issues involved in using floating-point numbers. There is a very nice paper on floating-point arithmetic by ! David Goldberg, ``What Every ! Computer Scientist Should Know About Floating-point Arithmetic,'' @cite{ACM Computing Surveys} @strong{23}, 1 (1991-03), ! 5-48.@footnote{@uref{http://www.validgh.com/goldberg/paper.ps}.} This is worth reading if you are interested in the details, ! but it does require a background in computer science. Internally, @command{awk} keeps both the numeric value (double-precision floating-point) and the string value for a variable. *************** *** 24469,24475 **** value exactly.@footnote{Pathological cases can require up to 752 digits (!), but we doubt that you need to worry about this.} ! @cindex floating-point, precision issues Unlike numbers in the abstract sense (such as what you studied in high school or college math), numbers stored in computers are limited in certain ways. They cannot represent an infinite number of digits, nor can they always --- 25769,25775 ---- value exactly.@footnote{Pathological cases can require up to 752 digits (!), but we doubt that you need to worry about this.} ! @cindex floating-point Unlike numbers in the abstract sense (such as what you studied in high school or college math), numbers stored in computers are limited in certain ways. They cannot represent an infinite number of digits, nor can they always *************** *** 24488,24494 **** @print{} 0000051580 515.82 @print{} 0000051582 ! @kbd{Ctrl-d} @end example @noindent --- 25788,25794 ---- @print{} 0000051580 515.82 @print{} 0000051582 ! @kbd{@value{CTL}-d} @end example @noindent *************** *** 24499,24506 **** @cindex negative zero @cindex positive zero @cindex zero, negative vs.@: positive - @cindex floating-point, positive and negative values for zero Another peculiarity of floating-point numbers on modern systems is that they often have more than one representation for the number zero! In particular, it is possible to represent ``minus zero'' as well as --- 25799,25806 ---- @cindex negative zero @cindex positive zero + @c comma is part of primary @cindex zero, negative vs.@: positive Another peculiarity of floating-point numbers on modern systems is that they often have more than one representation for the number zero! In particular, it is possible to represent ``minus zero'' as well as *************** *** 24522,24527 **** --- 25822,25828 ---- It helps to keep this in mind should you process numeric data that contains negative zero values; the fact that the zero is negative is noted and can affect comparisons. + @c ENDOFRANGE procon @node Glossary, Copying, Basic Concepts, Top @unnumbered Glossary *************** *** 24815,24821 **** See also ``GMT'' and ``UTC.'' @item Escape Sequences ! A special sequence of characters used for describing non-printing characters, such as @samp{\n} for newline or @samp{\033} for the ASCII ESC (Escape) character. (@xref{Escape Sequences}.) --- 26116,26122 ---- See also ``GMT'' and ``UTC.'' @item Escape Sequences ! A special sequence of characters used for describing nonprinting characters, such as @samp{\n} for newline or @samp{\033} for the ASCII ESC (Escape) character. (@xref{Escape Sequences}.) *************** *** 24833,24839 **** @ref{Constant Size, ,Reading Fixed-Width Data}.) @item Flag ! A variable whose truth value indicates the existence or non-existence of some condition. @item Floating-Point Number --- 26134,26140 ---- @ref{Constant Size, ,Reading Fixed-Width Data}.) @item Flag ! A variable whose truth value indicates the existence or nonexistence of some condition. @item Floating-Point Number *************** *** 24861,24871 **** @item FSF See ``Free Software Foundation.'' ! @cindex FSF ! @cindex Free Software Foundation @cindex Stallman, Richard @item Free Software Foundation ! A non-profit organization dedicated to the production and distribution of freely distributable software. It was founded by Richard M.@: Stallman, the author of the original Emacs editor. GNU Emacs is the most widely used version of Emacs today. --- 26162,26172 ---- @item FSF See ``Free Software Foundation.'' ! @cindex FSF (Free Software Foundation) ! @cindex Free Software Foundation (FSF) @cindex Stallman, Richard @item Free Software Foundation ! A nonprofit organization dedicated to the production and distribution of freely distributable software. It was founded by Richard M.@: Stallman, the author of the original Emacs editor. GNU Emacs is the most widely used version of Emacs today. *************** *** 24873,24880 **** @item @command{gawk} The GNU implementation of @command{awk}. ! @cindex GPL ! @cindex General Public License @cindex GNU General Public License @item General Public License This document describes the terms under which @command{gawk} and its source --- 26174,26181 ---- @item @command{gawk} The GNU implementation of @command{awk}. ! @cindex GPL (General Public License) ! @cindex General Public License (GPL) @cindex GNU General Public License @item General Public License This document describes the terms under which @command{gawk} and its source *************** *** 24886,24893 **** It is the time of day used as the epoch for Unix and POSIX systems. See also ``Epoch'' and ``UTC.'' ! @cindex FSF ! @cindex Free Software Foundation @cindex GNU Project @item GNU ``GNU's not Unix''. An on-going project of the Free Software Foundation --- 26187,26194 ---- It is the time of day used as the epoch for Unix and POSIX systems. See also ``Epoch'' and ``UTC.'' ! @cindex FSF (Free Software Foundation) ! @cindex Free Software Foundation (FSF) @cindex GNU Project @item GNU ``GNU's not Unix''. An on-going project of the Free Software Foundation *************** *** 24975,24982 **** and @code{exit}. ! @cindex LGPL ! @cindex Lesser General Public License @cindex GNU Lesser General Public License @item Lesser General Public License This document describes the terms under which binary library archives --- 26276,26283 ---- and @code{exit}. ! @cindex LGPL (Lesser General Public License) ! @cindex Lesser General Public License (LGPL) @cindex GNU Lesser General Public License @item Lesser General Public License This document describes the terms under which binary library archives *************** *** 25209,25215 **** See also ``Epoch'' and ``GMT.'' @item Whitespace ! A sequence of space, tab, or newline characters occurring inside an input record or a string. @end table --- 26510,26516 ---- See also ``Epoch'' and ``GMT.'' @item Whitespace ! A sequence of space, TAB, or newline characters occurring inside an input record or a string. @end table *************** *** 25617,25624 **** @node GNU Free Documentation License, Index, Copying, Top @unnumbered GNU Free Documentation License @center Version 1.1, March 2000 ! @cindex FDL ! @cindex Free Documentation License @cindex GNU Free Documentation License @display --- 26918,26925 ---- @node GNU Free Documentation License, Index, Copying, Top @unnumbered GNU Free Documentation License @center Version 1.1, March 2000 ! @cindex FDL (Free Documentation License) ! @cindex Free Documentation License (FDL) @cindex GNU Free Documentation License @display *************** *** 26037,26043 **** no @print before @dots values of expressions in the text (@code{x} has the value 15), should be in roman, not @code ! Use tab and not TAB Use ESC and not ESCAPE Use space and not blank to describe the space bar's character The term "blank" is thus basically reserved for "blank lines" etc. --- 27338,27344 ---- no @print before @dots values of expressions in the text (@code{x} has the value 15), should be in roman, not @code ! Use TAB and not tab Use ESC and not ESCAPE Use space and not blank to describe the space bar's character The term "blank" is thus basically reserved for "blank lines" etc. *************** *** 26045,26051 **** closing `.' of a sentence and after (pxref{...}). This is a change from earlier versions. " " should have an @w{} around it ! Use "non-" everywhere Use @command{ftp} when talking about anonymous ftp Use uppercase and lowercase, not "upper-case" and "lower-case" or "upper case" and "lower case" --- 27346,27352 ---- closing `.' of a sentence and after (pxref{...}). This is a change from earlier versions. " " should have an @w{} around it ! Use "non-" only with language names or acronyms, or the words bug and option Use @command{ftp} when talking about anonymous ftp Use uppercase and lowercase, not "upper-case" and "lower-case" or "upper case" and "lower case" *************** *** 26067,26072 **** --- 27368,27374 ---- Use "startup"/"cleanup", not "start-up"/"clean-up" Use @code{do}, and not @code{do}-@code{while}, except where actually discussing the do-while. + Use "versus" in text and "vs." in index entries The words "a", "and", "as", "between", "for", "from", "in", "of", "on", "that", "the", "to", "with", and "without", should not be capitalized in @chapter, @section etc. diff -crN gawk-3.1.0/doc/gawkinet.texi gawk-3.1.1/doc/gawkinet.texi *** gawk-3.1.0/doc/gawkinet.texi Sun May 13 18:18:25 2001 --- gawk-3.1.1/doc/gawkinet.texi Tue Apr 16 15:17:03 2002 *************** *** 3,8 **** --- 3,9 ---- @setfilename gawkinet.info @settitle TCP/IP Internetworking With @command{gawk} @c %**end of header (This is for running Texinfo on a region.) + @c FIXME: web vs. Web @c inside ifinfo for older versions of texinfo.tex @ifinfo *************** *** 64,83 **** @set TITLE TCP/IP Internetworking With @command{gawk} @set EDITION 1.1 ! @set UPDATE-MONTH March, 2001 @c gawk versions: @set VERSION 3.1 ! @set PATCHLEVEL 0 ! ! @ifinfo ! This file documents the networking features in GNU @command{awk}. This is Edition @value{EDITION} of @cite{@value{TITLE}}, for the @value{VERSION}.@value{PATCHLEVEL} (or later) version of the GNU implementation of AWK. ! ! Copyright (C) 2000, 2001 Free Software Foundation, Inc. ! 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 --- 65,82 ---- @set TITLE TCP/IP Internetworking With @command{gawk} @set EDITION 1.1 ! @set UPDATE-MONTH April, 2002 @c gawk versions: @set VERSION 3.1 ! @set PATCHLEVEL 1 + @copying This is Edition @value{EDITION} of @cite{@value{TITLE}}, for the @value{VERSION}.@value{PATCHLEVEL} (or later) version of the GNU implementation of AWK. ! @sp 2 ! Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. ! @sp 2 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 *************** *** 95,100 **** --- 94,105 ---- software. Copies published by the Free Software Foundation raise funds for GNU development.'' @end enumerate + @end copying + + @ifinfo + This file documents the networking features in GNU @command{awk}. + + @insertcopying @end ifinfo @setchapternewpage odd *************** *** 111,126 **** @page @vskip 0pt plus 1filll - Copyright @copyright{} 2000, 2001 Free Software Foundation, Inc. - @sp 1 - @b{User Friendly} Copyright @copyright{} 2000 J.D.@: ``Iliad'' Frazier. - Reprinted by permission. - @sp 2 - - This is Edition @value{EDITION} of @cite{@value{TITLE}}, - for the @value{VERSION}.@value{PATCHLEVEL} (or later) version of the GNU - implementation of AWK. - @sp 2 Published by: @sp 1 --- 116,121 ---- *************** *** 135,157 **** ISBN 1-882114-93-0 @* ! 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'', the Front-Cover ! texts being (a) (see below), and with the Back-Cover Texts being (b) ! (see below). A copy of the license is included in the section entitled ! ``GNU Free Documentation License''. ! ! @enumerate a ! @item ! ``A GNU Manual'' - @item - ``You have freedom to copy and modify this GNU Manual, like GNU - software. Copies published by the Free Software Foundation raise - funds for GNU development.'' - @end enumerate @c @sp 2 @c Cover art by ?????. @end titlepage --- 130,137 ---- ISBN 1-882114-93-0 @* ! @insertcopying @c @sp 2 @c Cover art by ?????. @end titlepage *************** *** 169,174 **** --- 149,156 ---- This file documents the networking features in GNU Awk (@command{gawk}) version 3.1 and later. + + @insertcopying @end ifinfo @menu *************** *** 192,198 **** * Special File Fields:: The fields in the special file name. * Comparing Protocols:: Differences between the protocols. * File /inet/tcp:: The TCP special file. ! * File /inet/udp:: The UDB special file. * File /inet/raw:: The RAW special file. * TCP Connecting:: Making a TCP connection. * Troubleshooting:: Troubleshooting TCP/IP connections. --- 174,180 ---- * Special File Fields:: The fields in the special file name. * Comparing Protocols:: Differences between the protocols. * File /inet/tcp:: The TCP special file. ! * File /inet/udp:: The UDP special file. * File /inet/raw:: The RAW special file. * TCP Connecting:: Making a TCP connection. * Troubleshooting:: Troubleshooting TCP/IP connections. *************** *** 414,422 **** All other user-level protocols use either TCP or UDP to do their basic communications. Examples are SMTP (Simple Mail Transfer Protocol), FTP (File Transfer Protocol) and HTTP (HyperText Transfer Protocol). ! @cindex SMTP ! @cindex FTP ! @cindex HTTP @node Ports, , Basic Protocols, The TCP/IP Protocols @subsection TCP and UDP Ports --- 396,404 ---- All other user-level protocols use either TCP or UDP to do their basic communications. Examples are SMTP (Simple Mail Transfer Protocol), FTP (File Transfer Protocol) and HTTP (HyperText Transfer Protocol). ! @cindex SMTP (Simple Mail Transfer Protocol) ! @cindex FTP (File Transfer Protocol) ! @cindex HTTP (Hypertext Transfer Protocol) @node Ports, , Basic Protocols, The TCP/IP Protocols @subsection TCP and UDP Ports *************** *** 456,462 **** server. Often, it turns out that the client and server are the same in both roles.) ! @cindex server The @dfn{server} is the system providing the service, such as the web server or email server. It is the @dfn{host} (system) which is @emph{connected to} in a transaction. --- 438,444 ---- server. Often, it turns out that the client and server are the same in both roles.) ! @cindex servers The @dfn{server} is the system providing the service, such as the web server or email server. It is the @dfn{host} (system) which is @emph{connected to} in a transaction. *************** *** 466,472 **** server process (usually) has to be started first and waiting for a connection. ! @cindex client The @dfn{client} is the system requesting the service. It is the system @emph{initiating the connection} in a transaction. (Just as when you pick up the phone to call an office or store.) --- 448,454 ---- server process (usually) has to be started first and waiting for a connection. ! @cindex clients The @dfn{client} is the system requesting the service. It is the system @emph{initiating the connection} in a transaction. (Just as when you pick up the phone to call an office or store.) *************** *** 522,528 **** @comment node-name, next, previous, up @chapter Networking With @command{gawk} ! @cindex network The @command{awk} programming language was originally developed as a pattern-matching language for writing short programs to perform data manipulation tasks. --- 504,513 ---- @comment node-name, next, previous, up @chapter Networking With @command{gawk} ! @c STARTOFRANGE netgawk ! @cindex networks, @command{gawk} and ! @c STARTOFRANGE gawknet ! @cindex @command{gawk}, networking The @command{awk} programming language was originally developed as a pattern-matching language for writing short programs to perform data manipulation tasks. *************** *** 547,561 **** features are available when programming in C or Perl. In fact, the network programming in this @value{CHAPTER} ! is very similar to what is described in books like @cite{Internet Programming with Python}, @cite{Advanced Perl Programming}, or @cite{Web Client Programming with Perl}. - But it's done here without first having to learn object-oriented ideology, underlying - languages such as Tcl/Tk, Perl, Python, or all of the libraries necessary to - extend these languages before they are ready for the Internet. This @value{CHAPTER} demonstrates how to use the TCP protocol. The other protocols are much less important for most users (UDP) or even untractable (RAW). --- 532,552 ---- features are available when programming in C or Perl. In fact, the network programming in this @value{CHAPTER} ! is very similar to what is described in books such as @cite{Internet Programming with Python}, @cite{Advanced Perl Programming}, or @cite{Web Client Programming with Perl}. + @cindex Perl, @command{gawk} networking and + @cindex Python, @command{gawk} networking and + @cindex Tcl/Tk, @command{gawk} and + However, you can do the programming here without first having to learn object-oriented + ideology; underlying languages such as Tcl/Tk, Perl, Python; or all of + the libraries necessary to extend these languages before they are ready for the Internet. + + @cindex Transmission Control Protocol, See TCP + @cindex TCP (Transmission Control Protocol) This @value{CHAPTER} demonstrates how to use the TCP protocol. The other protocols are much less important for most users (UDP) or even untractable (RAW). *************** *** 577,587 **** @node Gawk Special Files, TCP Connecting, Using Networking, Using Networking @comment node-name, next, previous, up ! @section @command{gawk} Networking Mechanisms ! @cindex network The @samp{|&} operator introduced in @command{gawk} 3.1 for use in ! communicating with a @dfn{co-process} is described in @ref{Two-way I/O, ,Two-way Communications With Another Process, gawk, GAWK: Effective AWK Programming}. It shows how to do two-way I/O to a separate process, sending it data with @code{print} or @code{printf} and --- 568,577 ---- @node Gawk Special Files, TCP Connecting, Using Networking, Using Networking @comment node-name, next, previous, up ! @section @command{gawk}'s Networking Mechanisms The @samp{|&} operator introduced in @command{gawk} 3.1 for use in ! communicating with a @dfn{coprocess} is described in @ref{Two-way I/O, ,Two-way Communications With Another Process, gawk, GAWK: Effective AWK Programming}. It shows how to do two-way I/O to a separate process, sending it data with @code{print} or @code{printf} and *************** *** 589,599 **** detour there to do so. @command{gawk} transparently extends the two-way I/O mechanism to simple networking through ! the use of special @value{FN}s. When a ``co-process'' is started that matches ! the special files we are about to describe, @command{gawk} creates the appropriate network connection, and then two-way I/O proceeds as usual. ! At the C, C++ (and basic Perl) level, networking is accomplished via @dfn{sockets}, an Application Programming Interface (API) originally developed at the University of California at Berkeley that is now used almost universally for TCP/IP networking. --- 579,593 ---- detour there to do so. @command{gawk} transparently extends the two-way I/O mechanism to simple networking through ! the use of special @value{FN}s. When a ``coprocess'' that matches ! the special files we are about to describe ! is started, @command{gawk} creates the appropriate network connection, and then two-way I/O proceeds as usual. ! @c last comma is part of see-also ! @cindex input/output, two-way, See Also @command{gawk}, networking ! @cindex TCP/IP, sockets and ! At the C, C++, and Perl level, networking is accomplished via @dfn{sockets}, an Application Programming Interface (API) originally developed at the University of California at Berkeley that is now used almost universally for TCP/IP networking. *************** *** 604,616 **** the programmer, making things much simpler and easier to use. @c Who sez we can't toot our own horn occasionally? The special @value{FN} for network access is made up of several fields, all ! of them mandatory, none of them optional: @example /inet/@var{protocol}/@var{localport}/@var{hostname}/@var{remoteport} @end example The @file{/inet/} field is, of course, constant when accessing the network. The @var{localport} and @var{remoteport} fields do not have a meaning when used with @file{/inet/raw} because ``ports'' only apply to --- 598,620 ---- the programmer, making things much simpler and easier to use. @c Who sez we can't toot our own horn occasionally? + @c STARTOFRANGE filenet + @cindex filenames, for network access + @c STARTOFRANGE gawnetf + @cindex @command{gawk}, networking, filenames + @c STARTOFRANGE netgawf + @cindex networks, @command{gawk} and, filenames The special @value{FN} for network access is made up of several fields, all ! of which are mandatory: @example /inet/@var{protocol}/@var{localport}/@var{hostname}/@var{remoteport} @end example + @cindex @code{/inet/} files (@command{gawk}) + @cindex files, @code{/inet/} (@command{gawk}) + @cindex localport field + @cindex remoteport field The @file{/inet/} field is, of course, constant when accessing the network. The @var{localport} and @var{remoteport} fields do not have a meaning when used with @file{/inet/raw} because ``ports'' only apply to *************** *** 627,635 **** This @value{SECTION} explains the meaning of all the other fields, as well as the range of values and the defaults. All of the fields are mandatory. To let the system pick a value, ! or if the field doesn't apply to the protocol, specify it as @samp{0}. @table @var @item protocol Determines which member of the TCP/IP family of protocols is selected to transport the data across the --- 631,642 ---- This @value{SECTION} explains the meaning of all the other fields, as well as the range of values and the defaults. All of the fields are mandatory. To let the system pick a value, ! or if the field doesn't apply to the protocol, specify it as @samp{0}: @table @var + @cindex protocol field + @c last comma is part of secondary + @cindex TCP/IP, protocols, selecting @item protocol Determines which member of the TCP/IP family of protocols is selected to transport the data across the *************** *** 638,660 **** explained later in this @value{SECTION}. @item localport Determines which port on the local machine is used to communicate across the network. It has no meaning ! with @file{/inet/raw} and must therefore be @samp{0}. Application level clients usually use @samp{0} to indicate they do not care which local port is used---instead they specify a remote port to connect to. It is vital for ! application level servers to use a number different from @samp{0} here ! because their service has to be available at a specific publicly-known port number. It is possible to use a name from @file{/etc/services} here. @item hostname Determines which remote host is to ! be at the other end of the connection. Application level servers must fill this field with a @samp{0} to indicate their being open for all other hosts to connect to them and enforce connection level server behavior this way. ! It is not possible for an application level server to restrict its availability to one remote host by entering a host name here. ! Application level clients must enter a name different from @samp{0}. The name can be either symbolic (e.g., @samp{jpl-devvax.jpl.nasa.gov}) or numeric (e.g., @samp{128.149.1.143}). --- 645,670 ---- explained later in this @value{SECTION}. @item localport + @cindex networks, ports, specifying Determines which port on the local machine is used to communicate across the network. It has no meaning ! with @file{/inet/raw} and must therefore be @samp{0}. Application-level clients usually use @samp{0} to indicate they do not care which local port is used---instead they specify a remote port to connect to. It is vital for ! application-level servers to use a number different from @samp{0} here ! because their service has to be available at a specific publicly known port number. It is possible to use a name from @file{/etc/services} here. @item hostname + @cindex hostname field + @cindex servers, as hosts Determines which remote host is to ! be at the other end of the connection. Application-level servers must fill this field with a @samp{0} to indicate their being open for all other hosts to connect to them and enforce connection level server behavior this way. ! It is not possible for an application-level server to restrict its availability to one remote host by entering a host name here. ! Application-level clients must enter a name different from @samp{0}. The name can be either symbolic (e.g., @samp{jpl-devvax.jpl.nasa.gov}) or numeric (e.g., @samp{128.149.1.143}). *************** *** 663,675 **** machine is used to communicate across the network. It has no meaning with @file{/inet/raw} and must therefore be 0. For @file{/inet/tcp} and @file{/inet/udp}, ! application level clients @emph{must} use a number ! other than @samp{0} to indicate which port on the remote machine ! they want to connect to. Application level servers must not fill this field with ! a @samp{0}. Instead they specify a local port for clients to connect to. It is possible to use a name from @file{/etc/services} here. @end table Experts in network programming will notice that the usual client/server asymmetry found at the level of the socket API is not visible here. This is for the sake of simplicity of the high-level concept. If this --- 673,687 ---- machine is used to communicate across the network. It has no meaning with @file{/inet/raw} and must therefore be 0. For @file{/inet/tcp} and @file{/inet/udp}, ! application-level clients @emph{must} use a number ! other than @samp{0} to indicate to which port on the remote machine ! they want to connect. Application-level servers must not fill this field with ! a @samp{0}. Instead they specify a local port to which clients connect. It is possible to use a name from @file{/etc/services} here. @end table + @cindex networks, @command{gawk} and, connections + @cindex @command{gawk}, networking, connections Experts in network programming will notice that the usual client/server asymmetry found at the level of the socket API is not visible here. This is for the sake of simplicity of the high-level concept. If this *************** *** 678,684 **** For @command{gawk}, it is more important to enable users to write a client program with a minimum of code. What happens when first accessing a network connection is seen ! in the following pseudo-code: @smallexample if ((name of remote host given) && (other side accepts connection)) @{ --- 690,696 ---- For @command{gawk}, it is more important to enable users to write a client program with a minimum of code. What happens when first accessing a network connection is seen ! in the following pseudocode: @smallexample if ((name of remote host given) && (other side accepts connection)) @{ *************** *** 705,711 **** @multitable {12345678901234} {123456} {123456} {1234567} {1234567890123456789012345} @item @sc{protocol} @tab @sc{local port} @tab @sc{host name} ! @tab @sc{remote port} @tab @sc{Resulting connection level behavior} @item @strong{tcp} @tab @strong{0} @tab @strong{x} @tab @strong{x} @tab @strong{Dedicated client, fails if immediately connecting to a server on the other side fails} --- 717,723 ---- @multitable {12345678901234} {123456} {123456} {1234567} {1234567890123456789012345} @item @sc{protocol} @tab @sc{local port} @tab @sc{host name} ! @tab @sc{remote port} @tab @sc{Resulting connection-level behavior} @item @strong{tcp} @tab @strong{0} @tab @strong{x} @tab @strong{x} @tab @strong{Dedicated client, fails if immediately connecting to a server on the other side fails} *************** *** 740,755 **** @menu * File /inet/tcp:: The TCP special file. ! * File /inet/udp:: The UDB special file. * File /inet/raw:: The RAW special file. @end menu @node File /inet/tcp, File /inet/udp, Comparing Protocols, Comparing Protocols @subsubsection @file{/inet/tcp} ! @cindex @file{/inet/tcp} special files ! @cindex TCP Once again, always use TCP. ! (Use UDP when low-overhead is a necessity, and use RAW for network experimentation.) The first example is the sender program: --- 752,768 ---- @menu * File /inet/tcp:: The TCP special file. ! * File /inet/udp:: The UDP special file. * File /inet/raw:: The RAW special file. @end menu @node File /inet/tcp, File /inet/udp, Comparing Protocols, Comparing Protocols @subsubsection @file{/inet/tcp} ! @cindex @code{/inet/tcp} special files (@command{gawk}) ! @cindex files, @code{/inet/tcp} (@command{gawk}) ! @cindex TCP (Transmission Control Protocol) Once again, always use TCP. ! (Use UDP when low overhead is a necessity, and use RAW for network experimentation.) The first example is the sender program: *************** *** 783,790 **** @node File /inet/udp, File /inet/raw, File /inet/tcp, Comparing Protocols @subsubsection @file{/inet/udp} ! @cindex @file{/inet/udp} special files ! @cindex UDP The server and client programs that use UDP are almost identical to their TCP counterparts; only the @var{protocol} has changed. As before, it does matter which side starts first. The receiving side blocks and waits for the sender. --- 796,805 ---- @node File /inet/udp, File /inet/raw, File /inet/tcp, Comparing Protocols @subsubsection @file{/inet/udp} ! @cindex @code{/inet/udp} special files (@command{gawk}) ! @cindex files, @code{/inet/udp} (@command{gawk}) ! @cindex UDP (User Datagram Protocol) ! @cindex User Datagram Protocol, See UDP The server and client programs that use UDP are almost identical to their TCP counterparts; only the @var{protocol} has changed. As before, it does matter which side starts first. The receiving side blocks and waits for the sender. *************** *** 818,835 **** @node File /inet/raw, , File /inet/udp, Comparing Protocols @subsubsection @file{/inet/raw} ! @cindex @file{/inet/raw} special files ! @cindex RAW This is an IP-level protocol. Only @code{root} is allowed to access this special file. It is meant to be the basis for implementing ! and experimenting with transport level protocols.@footnote{This special file is reserved, but not otherwise currently implemented.} In the most general case, the sender has to supply the encapsulating header bytes in front of the packet and the receiver has to strip the additional bytes from the message. ! @cindex dark corner RAW receivers cannot receive packets sent with TCP or UDP because the operating system does not deliver the packets to a RAW receiver. The operating system knows about some of the protocols on top of IP --- 833,851 ---- @node File /inet/raw, , File /inet/udp, Comparing Protocols @subsubsection @file{/inet/raw} ! @cindex @code{/inet/raw} special files (@command{gawk}) ! @cindex files, @code{/inet/raw} (@command{gawk}) ! @cindex RAW protocol This is an IP-level protocol. Only @code{root} is allowed to access this special file. It is meant to be the basis for implementing ! and experimenting with transport-level protocols.@footnote{This special file is reserved, but not otherwise currently implemented.} In the most general case, the sender has to supply the encapsulating header bytes in front of the packet and the receiver has to strip the additional bytes from the message. ! @cindex dark corner, RAW protocol RAW receivers cannot receive packets sent with TCP or UDP because the operating system does not deliver the packets to a RAW receiver. The operating system knows about some of the protocols on top of IP *************** *** 894,906 **** @node TCP Connecting, Troubleshooting, Gawk Special Files, Using Networking @section Establishing a TCP Connection Let's observe a network connection at work. Type in the following program and watch the output. Within a second, it connects via TCP (@file{/inet/tcp}) ! to the machine it is running on (@samp{localhost}), and asks the service @samp{daytime} on the machine what time it is: ! @cindex @code{|&} I/O operator ! @cindex @code{getline} built-in function @example BEGIN @{ "/inet/tcp/0/localhost/daytime" |& getline --- 910,927 ---- @node TCP Connecting, Troubleshooting, Gawk Special Files, Using Networking @section Establishing a TCP Connection + @c STARTOFRANGE tcpcon + @cindex TCP (Transmission Control Protocol), connection, establishing + @c STARTOFRANGE netcon + @cindex networks, @command{gawk} and, connections + @c STARTOFRANGE gawcon + @cindex @command{gawk}, networking, connections Let's observe a network connection at work. Type in the following program and watch the output. Within a second, it connects via TCP (@file{/inet/tcp}) ! to the machine it is running on (@samp{localhost}) and asks the service @samp{daytime} on the machine what time it is: ! @cindex @code{getline} command @example BEGIN @{ "/inet/tcp/0/localhost/daytime" |& getline *************** *** 920,931 **** --- 941,955 ---- "/inet/tcp/0/localhost/daytime")}. @item + @cindex @code{|} (vertical bar), @code{|&} operator (I/O) + @cindex vertical bar (@code{|}), @code{|&} operator (I/O) The operator @samp{|&} has not been part of any @command{awk} implementation (until now). It is actually the only extension of the @command{awk} language needed (apart from the special files) to introduce network access. @end itemize + @cindex pipes, networking and The @samp{|&} operator was introduced in @command{gawk} 3.1 in order to overcome the crucial restriction that access to files and pipes in @command{awk} is always unidirectional. It was formerly impossible to use *************** *** 951,979 **** read a line with the time, printed it, and closed the connection. (While we could just let @command{gawk} close the connection by finishing the program, in this @value{DOCUMENT} ! we are pedantic, and always explicitly close the connections.) @node Troubleshooting, Interacting, TCP Connecting, Using Networking @section Troubleshooting Connection Problems ! It may well be that for some reason the above program does not run on your machine. When looking at possible reasons for this, you will learn much about typical problems that arise in network programming. First of all, your implementation of @command{gawk} may not support network access because it is a pre-3.1 version or you do not have a network interface in your machine. ! Perhaps your machine uses some other protocol ! like DECnet or Novell's IPX. For the rest of this @value{CHAPTER}, we will assume ! you work on a Unix machine that supports TCP/IP. If the above program does ! not run on such a machine, it may help to replace the name @samp{localhost} with the name of your machine or its IP address. If it does, you could replace @samp{localhost} with the name of another machine ! in your vicinity. This way, the program connects to another machine. ! Now you should see the date and time being printed by the program. ! Otherwise your machine may not support the @samp{daytime} service. Try changing the service to @samp{chargen} or @samp{ftp}. This way, the program connects to other services that should give you some response. If you are ! curious, you should have a look at your file @file{/etc/services}. It could look like this: @ignore --- 975,1006 ---- read a line with the time, printed it, and closed the connection. (While we could just let @command{gawk} close the connection by finishing the program, in this @value{DOCUMENT} ! we are pedantic and always explicitly close the connections.) @node Troubleshooting, Interacting, TCP Connecting, Using Networking @section Troubleshooting Connection Problems ! @cindex advanced features, network connections ! @c last comma is part of secondary ! @cindex troubleshooting, networks, connections ! It may well be that for some reason the program shown in the previous example does not run on your machine. When looking at possible reasons for this, you will learn much about typical problems that arise in network programming. First of all, your implementation of @command{gawk} may not support network access because it is a pre-3.1 version or you do not have a network interface in your machine. ! Perhaps your machine uses some other protocol, such as ! DECnet or Novell's IPX. For the rest of this @value{CHAPTER}, we will assume ! you work on a Unix machine that supports TCP/IP. If the previous example program does ! not run on your machine, it may help to replace the name @samp{localhost} with the name of your machine or its IP address. If it does, you could replace @samp{localhost} with the name of another machine ! in your vicinity---this way, the program connects to another machine. ! Now you should see the date and time being printed by the program, ! otherwise your machine may not support the @samp{daytime} service. Try changing the service to @samp{chargen} or @samp{ftp}. This way, the program connects to other services that should give you some response. If you are ! curious, you should have a look at your @file{/etc/services} file. It could look like this: @ignore *************** *** 1035,1045 **** @cindex Linux @cindex GNU/Linux ! @cindex Microsoft Windows Here, you find a list of services that traditional Unix machines usually support. If your GNU/Linux machine does not do so, it may be that these services are switched off in some startup script. Systems running some ! flavor of Microsoft Windows usually do @emph{not} support such services. Nevertheless, it @emph{is} possible to do networking with @command{gawk} on Microsoft Windows.@footnote{Microsoft prefered to ignore the TCP/IP --- 1062,1072 ---- @cindex Linux @cindex GNU/Linux ! @cindex Microsoft Windows, networking Here, you find a list of services that traditional Unix machines usually support. If your GNU/Linux machine does not do so, it may be that these services are switched off in some startup script. Systems running some ! flavor of Microsoft Windows usually do @emph{not} support these services. Nevertheless, it @emph{is} possible to do networking with @command{gawk} on Microsoft Windows.@footnote{Microsoft prefered to ignore the TCP/IP *************** *** 1050,1057 **** a rather rudimentary and half-hearted implementation. Nevertheless, the equivalent of @file{/etc/services} resides under @file{c:\windows\services} on Microsoft Windows.} ! The first column of the file gives the name of the service, ! the second a unique number, and the protocol that one can use to connect to this service. The rest of the line is treated as a comment. You see that some services (@samp{echo}) support TCP as --- 1077,1084 ---- a rather rudimentary and half-hearted implementation. Nevertheless, the equivalent of @file{/etc/services} resides under @file{c:\windows\services} on Microsoft Windows.} ! The first column of the file gives the name of the service, and ! the second column gives a unique number and the protocol that one can use to connect to this service. The rest of the line is treated as a comment. You see that some services (@samp{echo}) support TCP as *************** *** 1086,1092 **** program also closes the connection. Try replacing @code{"@var{name}"} with your login name (or the name of someone else logged in). For a list of all users currently logged in, replace @var{name} with an empty string ! @code{""}. @cindex Linux @cindex GNU/Linux --- 1113,1119 ---- program also closes the connection. Try replacing @code{"@var{name}"} with your login name (or the name of someone else logged in). For a list of all users currently logged in, replace @var{name} with an empty string ! (@code{""}). @cindex Linux @cindex GNU/Linux *************** *** 1166,1173 **** Volume III of their series @cite{Internetworking With TCP} (page 14): ! @cindex TCP ! @cindex UDP @quotation When designing client-server applications, beginners are strongly advised to use TCP because it provides reliable, connection-oriented --- 1193,1201 ---- Volume III of their series @cite{Internetworking With TCP} (page 14): ! @cindex TCP (Transmission Control Protocol), UDP and ! @cindex UDP (User Datagram Protocol), TCP and ! @cindex Internet, See networks @quotation When designing client-server applications, beginners are strongly advised to use TCP because it provides reliable, connection-oriented *************** *** 1178,1188 **** @node Setting Up, Email, Interacting, Using Networking @section Setting Up a Service The preceding programs behaved as clients that connect to a server somewhere on the Internet and request a particular service. Now we set up such a service to mimic the behavior of the @samp{daytime} service. Such a server does not know in advance who is going to connect to it over ! the network. Therefore we cannot insert a name for the host to connect to in our special @value{FN}. Start the following program in one window. Notice that the service does --- 1206,1220 ---- @node Setting Up, Email, Interacting, Using Networking @section Setting Up a Service + @c last comma is part of tertiary + @cindex networks, @command{gawk} and, service, establishing + @c last comma is part of tertiary + @cindex @command{gawk}, networking, service, establishing The preceding programs behaved as clients that connect to a server somewhere on the Internet and request a particular service. Now we set up such a service to mimic the behavior of the @samp{daytime} service. Such a server does not know in advance who is going to connect to it over ! the network. Therefore, we cannot insert a name for the host to connect to in our special @value{FN}. Start the following program in one window. Notice that the service does *************** *** 1195,1201 **** of the special @value{FN} because we are setting up a server, not a client: @cindex @command{finger} utility ! @cindex server @example BEGIN @{ print strftime() |& "/inet/tcp/8888/0/0" --- 1227,1233 ---- of the special @value{FN} because we are setting up a server, not a client: @cindex @command{finger} utility ! @cindex servers @example BEGIN @{ print strftime() |& "/inet/tcp/8888/0/0" *************** *** 1217,1224 **** @noindent Both programs explicitly close the connection. ! @cindex Microsoft Windows ! @cindex reserved ports Now we will intentionally make a mistake to see what happens when the name @samp{8888} (the so-called port) is already used by another service. Start the server --- 1249,1258 ---- @noindent Both programs explicitly close the connection. ! @c first comma is part of primary ! @cindex Microsoft Windows, networking, ports ! @cindex networks, ports, reserved ! @cindex Unix, network ports and Now we will intentionally make a mistake to see what happens when the name @samp{8888} (the so-called port) is already used by another service. Start the server *************** *** 1226,1239 **** complains that it could not open the connection. Each port on a single machine can only be used by one server program at a time. Now terminate the server program and change the name @samp{8888} to @samp{echo}. After restarting it, ! the server program does not run any more and you know why: there already is an @samp{echo} service running on your machine. But even if this isn't true, you would not get your own @samp{echo} server running on a Unix machine, because the ports with numbers smaller than 1024 (@samp{echo} is at port 7) are reserved for @code{root}. On machines running some flavor of Microsoft Windows, there is no restriction ! that reserves ports 1 to 1024 for a privileged user; hence you can start an @samp{echo} server there. Turning this short server program into something really useful is simple. --- 1260,1273 ---- complains that it could not open the connection. Each port on a single machine can only be used by one server program at a time. Now terminate the server program and change the name @samp{8888} to @samp{echo}. After restarting it, ! the server program does not run any more, and you know why: there is already an @samp{echo} service running on your machine. But even if this isn't true, you would not get your own @samp{echo} server running on a Unix machine, because the ports with numbers smaller than 1024 (@samp{echo} is at port 7) are reserved for @code{root}. On machines running some flavor of Microsoft Windows, there is no restriction ! that reserves ports 1 to 1024 for a privileged user; hence, you can start an @samp{echo} server there. Turning this short server program into something really useful is simple. *************** *** 1265,1274 **** @node Email, Web page, Setting Up, Using Networking @section Reading Email ! @cindex POP ! @cindex SMTP ! @cindex RFC 1939 ! @cindex RFC 821 The distribution of email is usually done by dedicated email servers that communicate with your machine using special protocols. To receive email, we will use the Post Office Protocol (POP). Sending can be done with the much --- 1299,1312 ---- @node Email, Web page, Setting Up, Using Networking @section Reading Email ! @c @cindex RFC 1939 ! @c @cindex RFC 821 ! @cindex @command{gawk}, networking, See Also email ! @cindex networks, @command{gawk} and, See Also email ! @cindex POP (Post Office Protocol) ! @cindex SMTP (Simple Mail Transfer Protocol) ! @cindex Post Office Protocol (POP) ! @cindex Simple Mail Transfer Protocol (SMTP) The distribution of email is usually done by dedicated email servers that communicate with your machine using special protocols. To receive email, we will use the Post Office Protocol (POP). Sending can be done with the much *************** *** 1279,1284 **** --- 1317,1323 ---- @uref{http://rfc.fh-koeln.de/doc/rfc/html/rfc.html, RFCs in HTML}.} @end ignore + @cindex email When you type in the following program, replace the @var{emailhost} by the name of your local email server. Ask your administrator if the server has a POP service, and then use its name or number in the program below. *************** *** 1306,1312 **** @} @end example ! @cindex RFC 1939 The record separators @code{RS} and @code{ORS} are redefined because the protocol (POP) requires CR-LF to separate lines. After identifying yourself to the email service, the command @samp{retr 1} instructs the --- 1345,1355 ---- @} @end example ! @c @cindex RFC 1939 ! @cindex record separators, POP and ! @cindex @code{RS} variable, POP and ! @cindex @code{ORS} variable, POP and ! @cindex POP (Post Office Protocol) The record separators @code{RS} and @code{ORS} are redefined because the protocol (POP) requires CR-LF to separate lines. After identifying yourself to the email service, the command @samp{retr 1} instructs the *************** *** 1323,1331 **** @node Web page, Primitive Service, Email, Using Networking @section Reading a Web Page ! @cindex HTTP ! @cindex RFC 2068 ! @cindex RFC 2616 Retrieving a web page from a web server is as simple as retrieving email from an email server. We only have to use a --- 1366,1376 ---- @node Web page, Primitive Service, Email, Using Networking @section Reading a Web Page ! @cindex web pages ! @cindex HTTP (Hypertext Transfer Protocol) ! @cindex Hypertext Transfer Protocol, See HTTP ! @c @cindex RFC 2068 ! @c @cindex RFC 2616 Retrieving a web page from a web server is as simple as retrieving email from an email server. We only have to use a *************** *** 1387,1395 **** @} @end example ! @cindex RFC 1945 ! @cindex HTML ! @cindex Yahoo! Again, lines are separated by a redefined @code{RS} and @code{ORS}. The @code{GET} request that we send to the server is the only kind of HTTP request that existed when the web was created in the early 1990s. --- 1432,1444 ---- @} @end example ! @c @cindex RFC 1945 ! @cindex record separators, HTTP and ! @cindex @code{RS} variable, HTTP and ! @cindex @code{ORS} variable, HTTP and ! @cindex HTTP (Hypertext Transfer Protocol), record separators and ! @cindex HTML (Hypertext Markup Language) ! @cindex Hypertext Markup Language (HTML) Again, lines are separated by a redefined @code{RS} and @code{ORS}. The @code{GET} request that we send to the server is the only kind of HTTP request that existed when the web was created in the early 1990s. *************** *** 1398,1404 **** engine). Version 1.0 added the request methods @code{HEAD} and @code{POST}. The current version of HTTP is 1.1,@footnote{Version 1.0 of HTTP was defined in RFC 1945. HTTP 1.1 was initially specified in RFC ! 2068. In June 1999, RFC 2068 was made obsolete by RFC 2616. It is an update without any substantial changes.} and knows the additional request methods @code{OPTIONS}, @code{PUT}, @code{DELETE}, and @code{TRACE}. You can fill in any valid web address, and the program prints the --- 1447,1453 ---- engine). Version 1.0 added the request methods @code{HEAD} and @code{POST}. The current version of HTTP is 1.1,@footnote{Version 1.0 of HTTP was defined in RFC 1945. HTTP 1.1 was initially specified in RFC ! 2068. In June 1999, RFC 2068 was made obsolete by RFC 2616, an update without any substantial changes.} and knows the additional request methods @code{OPTIONS}, @code{PUT}, @code{DELETE}, and @code{TRACE}. You can fill in any valid web address, and the program prints the *************** *** 1410,1418 **** have the same form as in POP. There is the name of a parameter, then a colon, and finally the value of that parameter. ! @cindex CGI ! @cindex @file{gif} image format ! @cindex @file{png} image format Images (@file{.png} or @file{.gif} files) can also be retrieved this way, but then you get binary data that should be redirected into a file. Another --- 1459,1469 ---- have the same form as in POP. There is the name of a parameter, then a colon, and finally the value of that parameter. ! @cindex CGI (Common Gateway Interface), dynamic web pages and ! @cindex Common Gateway Interface, See CGI ! @cindex GIF image format ! @cindex PNG image format ! @cindex images, retrieving over networks Images (@file{.png} or @file{.gif} files) can also be retrieved this way, but then you get binary data that should be redirected into a file. Another *************** *** 1443,1448 **** --- 1494,1501 ---- @node Primitive Service, Interacting Service, Web page, Using Networking @section A Primitive Web Service + @c STARTOFRANGE webser + @cindex web service Now we know enough about HTTP to set up a primitive web service that just says @code{"Hello, world"} when someone connects to it with a browser. Compared *************** *** 1460,1466 **** @enumerate 1 @item Send a status line telling the web browser that everything ! is OK. @item Send a line to tell the browser how many bytes follow in the --- 1513,1519 ---- @enumerate 1 @item Send a status line telling the web browser that everything ! is okay. @item Send a line to tell the browser how many bytes follow in the *************** *** 1509,1515 **** @node Interacting Service, Simple Server, Primitive Service, Using Networking @section A Web Service with Interaction ! @cindex GUI @ifinfo This node shows how to set up a simple web server. The subnode is a library file that we will use with all the examples in --- 1562,1572 ---- @node Interacting Service, Simple Server, Primitive Service, Using Networking @section A Web Service with Interaction ! @cindex @command{gawk}, web and, See web service ! @cindex web browsers, See web service ! @c comma is part of primary ! @cindex HTTP server, core logic ! @cindex servers, HTTP @ifinfo This node shows how to set up a simple web server. The subnode is a library file that we will use with all the examples in *************** *** 1527,1533 **** graphical user interface (GUI). Each HTTP event that the user triggers by some action within the browser is received in this central procedure. Parameters and menu choices are ! extracted from this request and an appropriate measure is taken according to the user's choice. For example: --- 1584,1590 ---- graphical user interface (GUI). Each HTTP event that the user triggers by some action within the browser is received in this central procedure. Parameters and menu choices are ! extracted from this request, and an appropriate measure is taken according to the user's choice. For example: *************** *** 1615,1622 **** case selection over the method does nothing. Now that the home page is initialized, the server can start communicating to a client browser. ! @cindex RFC 2068 ! @cindex CGI It does so by printing the HTTP header into the network connection (@samp{print @dots{} |& HttpService}). This command blocks execution of the server script until a client connects. If this server --- 1672,1678 ---- case selection over the method does nothing. Now that the home page is initialized, the server can start communicating to a client browser. ! @c @cindex RFC 2068 It does so by printing the HTTP header into the network connection (@samp{print @dots{} |& HttpService}). This command blocks execution of the server script until a client connects. If this server *************** *** 1703,1709 **** @} @end example - @cindex CGI The disadvantage of this approach is that our server is slow and can handle only one request at a time. Its main advantage, however, is that the server --- 1759,1764 ---- *************** *** 1713,1720 **** This program can be started on the same host that runs your browser. Then let your browser point to @uref{http://localhost:8080}. ! @cindex @file{xbm} image format ! @cindex image format @cindex GNUPlot utility It is also possible to include images into the HTML pages. Most browsers support the not very well-known --- 1768,1776 ---- This program can be started on the same host that runs your browser. Then let your browser point to @uref{http://localhost:8080}. ! @cindex XBM image format ! @cindex images, in web pages ! @cindex web pages, images in @cindex GNUPlot utility It is also possible to include images into the HTML pages. Most browsers support the not very well-known *************** *** 1734,1746 **** @uref{http://www.netfunny.com/rhf/jokes/99/Mar/http.html} @end quotation In @ref{Interacting Service, ,A Web Service with Interaction}, we saw the function @code{CGI_setup} as part of the web server ``core logic'' framework. The code presented there handles almost everything necessary for CGI requests. One thing it doesn't do is handle encoded characters in the requests. For example, an @samp{&} is encoded as a percent sign followed by ! the hexadecimal value---@samp{%26}. These encoded values should be decoded. Following is a simple library to perform these tasks. This code is used for all web server examples --- 1790,1804 ---- @uref{http://www.netfunny.com/rhf/jokes/99/Mar/http.html} @end quotation + @c STARTOFRANGE cgilib + @cindex CGI (Common Gateway Interface), library In @ref{Interacting Service, ,A Web Service with Interaction}, we saw the function @code{CGI_setup} as part of the web server ``core logic'' framework. The code presented there handles almost everything necessary for CGI requests. One thing it doesn't do is handle encoded characters in the requests. For example, an @samp{&} is encoded as a percent sign followed by ! the hexadecimal value: @samp{%26}. These encoded values should be decoded. Following is a simple library to perform these tasks. This code is used for all web server examples *************** *** 1748,1761 **** If you want to use it for your own web server, store the source code into a file named @file{inetlib.awk}. Then you can include these functions into your code by placing the following statement ! into your program: @example @@include inetlib.awk @end example @noindent ! on the first line of your script. But beware, this mechanism is only possible if you invoke your web server script with @command{igawk} instead of the usual @command{awk} or @command{gawk}. Here is the code: --- 1806,1820 ---- If you want to use it for your own web server, store the source code into a file named @file{inetlib.awk}. Then you can include these functions into your code by placing the following statement ! into your program ! (on the first line of your script): @example @@include inetlib.awk @end example @noindent ! But beware, this mechanism is only possible if you invoke your web server script with @command{igawk} instead of the usual @command{awk} or @command{gawk}. Here is the code: *************** *** 1896,1902 **** @end example This works by splitting the string apart around an encoded character. ! The two digits are converted to lowercase and looked up in a string of hex digits. Note that @code{0} is not in the string on purpose; @code{index} returns zero when it's not found, automatically giving the correct value! Once the hexadecimal value is converted from --- 1955,1961 ---- @end example This works by splitting the string apart around an encoded character. ! The two digits are converted to lowercase characters and looked up in a string of hex digits. Note that @code{0} is not in the string on purpose; @code{index} returns zero when it's not found, automatically giving the correct value! Once the hexadecimal value is converted from *************** *** 1946,1961 **** @node Simple Server, Caveats, Interacting Service, Using Networking @section A Simple Web Server ! @cindex GUI ! In the preceding @value{SECTION}, we built the core logic for event driven GUIs. In this @value{SECTION}, we finally extend the core to a real application. No one would actually write a commercial web server in @command{gawk}, but it is instructive to see that it is feasible in principle. - @iftex - @image{uf002331,4in} - @end iftex - @cindex ELIZA program @cindex Weizenbaum, Joseph The application is ELIZA, the famous program by Joseph Weizenbaum that --- 2005,2019 ---- @node Simple Server, Caveats, Interacting Service, Using Networking @section A Simple Web Server ! @c STARTOFRANGE webserx ! @cindex web servers ! @c STARTOFRANGE serweb ! @cindex servers, web ! In the preceding @value{SECTION}, we built the core logic for event-driven GUIs. In this @value{SECTION}, we finally extend the core to a real application. No one would actually write a commercial web server in @command{gawk}, but it is instructive to see that it is feasible in principle. @cindex ELIZA program @cindex Weizenbaum, Joseph The application is ELIZA, the famous program by Joseph Weizenbaum that *************** *** 2005,2011 **** determine the way your HTML pages look (colors, titles, menu items, etc.). - @cindex GUI The function @code{HandleGET} is a nested case selection that decides which page the user wants to see next. Each nesting level refers to a menu level of the GUI. Each case implements a certain action of the menu. On the --- 2063,2068 ---- *************** *** 2049,2055 **** Now we are down to the heart of ELIZA, so you can see how it works. Initially the user does not say anything; then ELIZA resets its money counter and asks the user to tell what comes to mind open heartedly. ! The subsequent answers are converted to uppercase and stored for later comparison. ELIZA presents the bill when being confronted with a sentence that contains the phrase ``shut up.'' Otherwise, it looks for keywords in the sentence, conjugates the rest of the sentence, remembers --- 2106,2112 ---- Now we are down to the heart of ELIZA, so you can see how it works. Initially the user does not say anything; then ELIZA resets its money counter and asks the user to tell what comes to mind open heartedly. ! The subsequent answers are converted to uppercase characters and stored for later comparison. ELIZA presents the bill when being confronted with a sentence that contains the phrase ``shut up.'' Otherwise, it looks for keywords in the sentence, conjugates the rest of the sentence, remembers *************** *** 2315,2321 **** @cindex Humphrys, Mark @cindex ELIZA program - @cindex Yahoo! Some interesting remarks and details (including the original source code of ELIZA) are found on Mark Humphrys' home page. Yahoo! also has a page with a collection of ELIZA-like programs. Many of them are written --- 2372,2377 ---- *************** *** 2325,2349 **** @node Caveats, Challenges, Simple Server, Using Networking @section Network Programming Caveats By now it should be clear that debugging a networked application is more complicated than debugging a single-process single-hosted application. ! The behavior of a networked application sometimes looks non-causal because it is not reproducible in a strong sense. Whether a network application works or not sometimes depends on the following: @itemize @bullet @item ! How crowded the underlying network is. @item ! If the party at the other end is running or not. @item ! The state of the party at the other end. @end itemize ! @cindex network The most difficult problems for a beginner arise from the hidden states of the underlying network. After closing a TCP connection, it's often necessary to wait a short while before reopening the connection. Even more difficult is the --- 2381,2408 ---- @node Caveats, Challenges, Simple Server, Using Networking @section Network Programming Caveats + @cindex networks, @command{gawk} and, troubleshooting + @cindex @command{gawk}, networking, troubleshooting + @cindex troubleshooting, @command{gawk}, networks By now it should be clear that debugging a networked application is more complicated than debugging a single-process single-hosted application. ! The behavior of a networked application sometimes looks noncausal because it is not reproducible in a strong sense. Whether a network application works or not sometimes depends on the following: @itemize @bullet @item ! How crowded the underlying network is @item ! If the party at the other end is running or not @item ! The state of the party at the other end @end itemize ! @cindex troubleshooting, networks, timeouts The most difficult problems for a beginner arise from the hidden states of the underlying network. After closing a TCP connection, it's often necessary to wait a short while before reopening the connection. Even more difficult is the *************** *** 2357,2363 **** @section Where To Go From Here @cindex Loebner, Hugh ! @cindex Contest Now, you have learned enough to build your own application. You could, for example, take part in the Loebner Contest --- 2416,2422 ---- @section Where To Go From Here @cindex Loebner, Hugh ! @cindex contest Now, you have learned enough to build your own application. You could, for example, take part in the Loebner Contest *************** *** 2434,2440 **** @cindex AI @cindex PROLOG ! @cindex Loui, Ronald P. @cindex agent @quotation The GAWK manual can --- 2493,2499 ---- @cindex AI @cindex PROLOG ! @cindex Loui, Ronald @cindex agent @quotation The GAWK manual can *************** *** 2517,2538 **** We often refer to the site-independent core of the server that we built in @ref{Simple Server, ,A Simple Web Server}. ! When building new and non-trivial servers, we always copy this building block and append new instances of the two functions @code{SetUpServer} and @code{HandleGET}. This makes a lot of sense, since this scheme of event-driven execution provides @command{gawk} with an interface to the most widely ! accepted standard for GUIs: the web browser. Now, @command{gawk} can even rival Tcl/Tk. ! @cindex Tcl/Tk ! @cindex JavaScript Tcl and @command{gawk} have much in common. Both are simple scripting languages that allow us to quickly solve problems with short programs. But Tcl has Tk ! on top of it and @command{gawk} had nothing comparable up to now. While Tcl ! needs a large and ever changing library (Tk, which was bound to the X Window System until recently), @command{gawk} needs just the networking interface and some kind of browser on the client's side. Besides better portability, the most important advantage of this approach (embracing well-established --- 2576,2596 ---- We often refer to the site-independent core of the server that we built in @ref{Simple Server, ,A Simple Web Server}. ! When building new and nontrivial servers, we always copy this building block and append new instances of the two functions @code{SetUpServer} and @code{HandleGET}. This makes a lot of sense, since this scheme of event-driven execution provides @command{gawk} with an interface to the most widely ! accepted standard for GUIs: the web browser. Now, @command{gawk} can rival even Tcl/Tk. ! @cindex Tcl/Tk, @command{gawk} and Tcl and @command{gawk} have much in common. Both are simple scripting languages that allow us to quickly solve problems with short programs. But Tcl has Tk ! on top of it, and @command{gawk} had nothing comparable up to now. While Tcl ! needs a large and ever-changing library (Tk, which was bound to the X Window System until recently), @command{gawk} needs just the networking interface and some kind of browser on the client's side. Besides better portability, the most important advantage of this approach (embracing well-established *************** *** 2554,2561 **** @end menu @node PANIC, GETURL, Some Applications and Techniques, Some Applications and Techniques ! @section PANIC: an Emergency Web Server @cindex PANIC program At first glance, the @code{"Hello, world"} example in @ref{Primitive Service, ,A Primitive Web Service}, seems useless. By adding just a few lines, we can turn it into something useful. --- 2612,2621 ---- @end menu @node PANIC, GETURL, Some Applications and Techniques, Some Applications and Techniques ! @section PANIC: An Emergency Web Server @cindex PANIC program + @cindex networks, See Also web pages + @cindex web service At first glance, the @code{"Hello, world"} example in @ref{Primitive Service, ,A Primitive Web Service}, seems useless. By adding just a few lines, we can turn it into something useful. *************** *** 2599,2605 **** @node GETURL, REMCONF, PANIC, Some Applications and Techniques @section GETURL: Retrieving Web Pages @cindex GETURL program ! @cindex robot GETURL is a versatile building block for shell scripts that need to retrieve files from the Internet. It takes a web address as a command-line parameter and tries to retrieve the contents of this address. The contents are printed --- 2659,2665 ---- @node GETURL, REMCONF, PANIC, Some Applications and Techniques @section GETURL: Retrieving Web Pages @cindex GETURL program ! @cindex web pages, retrieving GETURL is a versatile building block for shell scripts that need to retrieve files from the Internet. It takes a web address as a command-line parameter and tries to retrieve the contents of this address. The contents are printed *************** *** 2995,3003 **** @cindex GNUPlot utility @cindex image format ! @cindex @file{gif} image format ! @cindex @file{png} image format ! @cindex @file{ps} image format @cindex Boutell, Thomas @iftex @image{statist,3in} --- 3055,3063 ---- @cindex GNUPlot utility @cindex image format ! @cindex GIF image format ! @cindex PNG image format ! @cindex PS image format @cindex Boutell, Thomas @iftex @image{statist,3in} *************** *** 3529,3535 **** we must not only write the agent program to start on the client side, but also the CGI script to receive the agent on the server side. ! @cindex CGI @cindex apache @item The @code{PUT} method can also be used for migration. HTTP does not --- 3589,3595 ---- we must not only write the agent program to start on the client side, but also the CGI script to receive the agent on the server side. ! @cindex CGI (Common Gateway Interface) @cindex apache @item The @code{PUT} method can also be used for migration. HTTP does not *************** *** 3822,3828 **** @node STOXPRED, PROTBASE, MOBAGWHO, Some Applications and Techniques @section STOXPRED: Stock Market Prediction As A Service @cindex STOXPRED program ! @cindex Yahoo @quotation @i{Far out in the uncharted backwaters of the unfashionable end of the Western Spiral arm of the Galaxy lies a small unregarded yellow sun.} --- 3882,3888 ---- @node STOXPRED, PROTBASE, MOBAGWHO, Some Applications and Techniques @section STOXPRED: Stock Market Prediction As A Service @cindex STOXPRED program ! @cindex Yahoo! @quotation @i{Far out in the uncharted backwaters of the unfashionable end of the Western Spiral arm of the Galaxy lies a small unregarded yellow sun.} *************** *** 3841,3847 **** Douglas Adams, @cite{The Hitch Hiker's Guide to the Galaxy} @end quotation ! @cindex @command{cron} Valuable services on the Internet are usually @emph{not} implemented as mobile agents. There are much simpler ways of implementing services. All Unix systems provide, for example, the @command{cron} service. --- 3901,3907 ---- Douglas Adams, @cite{The Hitch Hiker's Guide to the Galaxy} @end quotation ! @cindex @command{cron} utility Valuable services on the Internet are usually @emph{not} implemented as mobile agents. There are much simpler ways of implementing services. All Unix systems provide, for example, the @command{cron} service. diff -crN gawk-3.1.0/doc/texinfo.tex gawk-3.1.1/doc/texinfo.tex *** gawk-3.1.0/doc/texinfo.tex Wed Mar 28 18:45:05 2001 --- gawk-3.1.1/doc/texinfo.tex Tue Mar 26 18:29:26 2002 *************** *** 3,12 **** % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % ! \def\texinfoversion{2001-03-28.08} % % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, ! % 2000, 01 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 --- 3,12 ---- % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % ! \def\texinfoversion{2002-03-26.08} % % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, ! % 2000, 01, 02 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 *************** *** 30,43 **** % 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 --- 30,46 ---- % 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/texinfo/texinfo.tex ! % ftp://tug.org/tex/texinfo.tex ! % (and all CTAN mirrors, see http://www.ctan.org), ! % and /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/ and also ! % http://www.gnu.org/software/texinfo. % % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the *************** *** 50,62 **** % 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]:} --- 53,65 ---- % texindex foo.?? % tex foo.texi % tex foo.texi ! % dvips foo.dvi -o # or whatever; this makes foo.ps. ! % The extra TeX runs 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 the full Texinfo distribution. \message{Loading texinfo [version \texinfoversion]:} *************** *** 170,175 **** --- 173,188 ---- }% \fi + % add check for \lastpenalty to plain's definitions. If the last thing + % we did was a \nobreak, we don't want to insert more space. + % + \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount + \removelastskip\penalty-50\smallskip\fi\fi} + \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount + \removelastskip\penalty-100\medskip\fi\fi} + \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount + \removelastskip\penalty-200\bigskip\fi\fi} + % For @cropmarks command. % Do @cropmarks to get crop marks. % *************** *** 431,437 **** % environments. --karl, 6may93 %{\advance \baselineskip by -\singlespaceskip %\kern \baselineskip}% ! \setleading \singlespaceskip } %% Simple single-character @ commands --- 444,450 ---- % environments. --karl, 6may93 %{\advance \baselineskip by -\singlespaceskip %\kern \baselineskip}% ! \setleading\singlespaceskip } %% Simple single-character @ commands *************** *** 823,840 **** % \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} --- 836,878 ---- % \def\asis#1{#1} ! % @math outputs its argument in math mode. ! % We don't use $'s directly in the definition of \math because we need ! % to set catcodes according to plain TeX first, to allow for subscripts, ! % superscripts, special math chars, etc. ! % ! % @math does not do math typesetting in section titles, index ! % entries, and other such contexts where the catcodes are set before ! % @math gets a chance to work. This could perhaps be fixed, but for now ! % at least we can have real math in the main text, where it's needed most. ! % ! \let\implicitmath = $%$ font-lock fix ! % ! % One complication: _ usually means subscripts, but it could also mean ! % an actual _ character, as in @math{@var{some_variable} + 1}. So make ! % _ within @math be active (mathcode "8000), and distinguish by seeing ! % if the current family is \slfam, which is what @var uses. ! % ! {\catcode95 = \active % 95 = _ ! \gdef\mathunderscore{% ! \catcode95=\active ! \def_{\ifnum\fam=\slfam \_\else\sb\fi}% ! }} % ! % Another complication: we want \\ (and @\) to output a \ character. ! % FYI, plain.tex uses \\ as a temporary control sequence (why?), but ! % this is not advertised and we don't care. Texinfo does not ! % otherwise define @\. ! % ! % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. ! \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % ! \def\math{% ! \tex ! \mathcode`\_="8000 \mathunderscore ! \let\\ = \mathbackslash ! \implicitmath\finishmath} ! \def\finishmath#1{#1\implicitmath\Etex} % @bullet and @minus need the same treatment as @math, just above. \def\bullet{\implicitmath\ptexbullet\implicitmath} *************** *** 917,926 **** \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 --- 955,966 ---- \def\dopdfimage#1#2#3{% \def\imagewidth{#2}% \def\imageheight{#3}% + % without \immediate, pdftex seg faults when the same image is + % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 ! \immediate\pdfimage \else ! \immediate\pdfximage \fi \ifx\empty\imagewidth\else width \imagewidth \fi \ifx\empty\imageheight\else height \imageheight \fi *************** *** 932,939 **** \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 --- 972,979 ---- \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} ! \def\pdfmkdest#1{{\normalturnoffactive \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 *************** *** 945,951 **** \expandafter\xdef\csname#1\endcsname{\the\tempnum}} \def\pdfmakeoutlines{{% \openin 1 \jobname.toc ! \ifeof 1\else\bgroup \closein 1 \indexnofonts \def\tt{} --- 985,991 ---- \expandafter\xdef\csname#1\endcsname{\the\tempnum}} \def\pdfmakeoutlines{{% \openin 1 \jobname.toc ! \ifeof 1\else\begingroup \closein 1 \indexnofonts \def\tt{} *************** *** 955,986 **** \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}% --- 995,1028 ---- \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace % \def\chapentry ##1##2##3{} + \let\appendixentry = \chapentry \def\unnumbchapentry ##1##2{} \def\secentry ##1##2##3##4{\advancenumber{chap##2}} ! \def\unnumbsecentry ##1##2##3{\advancenumber{chap##2}} \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} ! \def\unnumbsubsecentry ##1##2##3##4{\advancenumber{sec##2.##3}} \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} ! \def\unnumbsubsubsecentry ##1##2##3##4##5{\advancenumber{subsec##2.##3.##4}} \input \jobname.toc \def\chapentry ##1##2##3{% \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} + \let\appendixentry = \chapentry \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##3{% ! \pdfoutline goto name{\pdfmkpgn{##3}}{##1}} \def\subsecentry ##1##2##3##4##5{% \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} ! \def\unnumbsubsecentry ##1##2##3##4{% ! \pdfoutline goto name{\pdfmkpgn{##4}}{##1}} \def\subsubsecentry ##1##2##3##4##5##6{% \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} ! \def\unnumbsubsubsecentry ##1##2##3##4##5{% ! \pdfoutline goto name{\pdfmkpgn{##5}}{##1}} \input \jobname.toc ! \endgroup\fi }} \def\makelinks #1,{% \def\params{#1}\def\E{END}% *************** *** 1030,1035 **** --- 1072,1078 ---- \def\pdfurl#1{% \begingroup \normalturnoffactive\def\@{@}% + \let\value=\expandablevalue \leavevmode\Red \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% *************** *** 1057,1065 **** \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 --- 1100,1107 ---- \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% ! \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \linkcolor #1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \fi % \ifx\pdfoutput *************** *** 1076,1084 **** % 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'). --- 1118,1143 ---- % We don't need math for this one. \def\ttsl{\tenttsl} ! % Default leading. ! \newdimen\textleading \textleading = 13.2pt ! ! % 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 ! }% ! } % Set the font macro #1 to the font named #2, adding on the % specified font prefix (normally `cm'). *************** *** 1108,1120 **** \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 --- 1167,1182 ---- \def\scshape{csc} \def\scbshape{csc} + \newcount\mainmagstep \ifx\bigger\relax ! % not really supported. ! \let\mainmagstep=\magstep1 ! \setfont\textrm\rmshape{12}{1000} ! \setfont\texttt\ttshape{12}{1000} \else ! \mainmagstep=\magstephalf ! \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 *************** *** 1145,1150 **** --- 1207,1224 ---- \font\smalli=cmmi9 \font\smallsy=cmsy9 + % Fonts for small examples (8pt). + \setfont\smallerrm\rmshape{8}{1000} + \setfont\smallertt\ttshape{8}{1000} + \setfont\smallerbf\bfshape{10}{800} + \setfont\smallerit\itshape{8}{1000} + \setfont\smallersl\slshape{8}{1000} + \setfont\smallersf\sfshape{8}{1000} + \setfont\smallersc\scshape{10}{800} + \setfont\smallerttsl\ttslshape{10}{800} + \font\smalleri=cmmi8 + \font\smallersy=cmsy8 + % Fonts for title page: \setfont\titlerm\rmbshape{12}{\magstep3} \setfont\titleit\itbshape{10}{\magstep4} *************** *** 1182,1201 **** \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} --- 1256,1261 ---- *************** *** 1212,1228 **** % 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 --- 1272,1287 ---- % 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 except ! % in the main text, 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 *************** *** 1233,1239 **** \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 --- 1292,1298 ---- \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 \setleading{\textleading}} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc *************** *** 1262,1268 **** \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. % --- 1321,1334 ---- \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy \let\tenttsl=\smallttsl ! \resetmathfonts \setleading{10.5pt}} ! \def\smallerfonts{% ! \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl ! \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc ! \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy ! \let\tenttsl=\smallerttsl ! \resetmathfonts \setleading{9.5pt}} ! \let\smallexamplefonts = \smallerfonts % Set up the default fonts, so we can use them for creating boxes. % *************** *** 1376,1386 **** \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. --- 1442,1460 ---- \def\realdash{-} \def\codedash{-\discretionary{}{}{}} ! \def\codeunder{% ! % this is all so @math{@code{var_name}+1} can work. In math mode, _ ! % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) ! % will therefore expand the active definition of _, which is us ! % (inside @code that is), therefore an endless loop. ! \ifusingtt{\ifmmode ! \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. ! \else\normalunderscore \fi ! \discretionary{}{}{}}% ! {\_}% ! } \def\codex #1{\tclose{#1}\endgroup} % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. *************** *** 1565,1570 **** --- 1639,1648 ---- \oldpage \endgroup % + % Need this before the \...aftertitlepage checks so that if they are + % in effect the toc pages will come out with page numbers. + \HEADINGSon + % % If they want short, they certainly want long too. \ifsetshortcontentsaftertitlepage \shortcontents *************** *** 1578,1587 **** \global\let\contents = \relax \global\let\shortcontents = \relax \fi - % - \ifpdf \pdfmakepagedesttrue \fi - % - \HEADINGSon } \def\finishtitlepage{% --- 1656,1661 ---- *************** *** 2339,2356 **** \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. --- 2413,2431 ---- \let\item = \relax } ! % Ignore @ignore, @ifhtml, @ifinfo, @ifplaintext, @ifnottex, @html, @menu, ! % @direntry, and @documentdescription. % \def\ignore{\doignore{ignore}} \def\ifhtml{\doignore{ifhtml}} + \def\ifinfo{\doignore{ifinfo}} + \def\ifplaintext{\doignore{ifplaintext}} \def\ifnottex{\doignore{ifnottex}} \def\html{\doignore{html}} \def\menu{\doignore{menu}} \def\direntry{\doignore{direntry}} + \def\documentdescription{\doignore{documentdescription}} + \def\documentdescriptionword{documentdescription} % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. *************** *** 2377,2390 **** % 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 } --- 2452,2472 ---- % We must not have @c interpreted as a control sequence. \catcode`\@ = 12 % ! \def\ignoreword{#1}% ! \ifx\ignoreword\documentdescriptionword ! % The c kludge breaks documentdescription, since ! % `documentdescription' contains a `c'. Means not everything will ! % be ignored inside @documentdescription, but oh well... ! \else ! % 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 ! \fi % ! % And now expand the command defined above. \doignoretext } *************** *** 2456,2465 **** \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 --- 2538,2551 ---- \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. \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont \let\smallsf=\nullfont + % Similarly for smallexample fonts. + \let\smallerrm=\nullfont \let\smallerit=\nullfont \let\smallersl=\nullfont + \let\smallerbf=\nullfont \let\smallertt=\nullfont \let\smallersc=\nullfont + \let\smallersf=\nullfont % % Don't complain when characters are missing from the fonts. \tracinglostchars = 0 *************** *** 2571,2589 **** \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 --- 2657,2677 ---- \def\ifclearfail{\nestedignore{ifclear}} \defineunmatchedend{ifclear} ! % @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext 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}} + \def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}} \defineunmatchedend{iftex} \defineunmatchedend{ifnothtml} \defineunmatchedend{ifnotinfo} + \defineunmatchedend{ifnotplaintext} ! % We can't just want to start a group at @iftex (etc.) 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 *************** *** 2696,2704 **** --- 2784,2806 ---- \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} + % Take care of texinfo commands likely to appear in an index entry. + % (Must be a way to avoid doing expansion at all, and thus not have to + % laboriously list every single command here.) + % \def\indexdummies{% \def\ { }% + \def\@{@}% change to @@ when we switch to @ as escape char in aux files. + % Need these in case \tex is in effect and \{ is a \delimiter again. + % But can't use \lbracecmd and \rbracecmd because texindex assumes + % braces and backslashes are used only as delimiters. + \let\{ = \mylbrace + \let\} = \myrbrace + \def\_{{\realbackslash _}}% + \normalturnoffactive + % % Take care of the plain tex accent commands. + \def\,##1{\realbackslash ,{##1}}% \def\"{\realbackslash "}% \def\`{\realbackslash `}% \def\'{\realbackslash '}% *************** *** 2711,2779 **** \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 --- 2813,2878 ---- \def\u{\realbackslash u}% \def\v{\realbackslash v}% \def\H{\realbackslash H}% + \def\dotless##1{\realbackslash dotless {##1}}% % Take care of the plain tex special European modified letters. \def\AA{\realbackslash AA}% ! \def\AE{\realbackslash AE}% ! \def\L{\realbackslash L}% ! \def\OE{\realbackslash OE}% \def\O{\realbackslash O}% + \def\aa{\realbackslash aa}% + \def\ae{\realbackslash ae}% \def\l{\realbackslash l}% ! \def\oe{\realbackslash oe}% ! \def\o{\realbackslash o}% \def\ss{\realbackslash ss}% ! % ! % Although these internals commands shouldn't show up, sometimes they do. \def\bf{\realbackslash bf }% + \def\gtr{\realbackslash gtr}% + \def\hat{\realbackslash hat}% + \def\less{\realbackslash less}% %\def\rm{\realbackslash rm }% \def\sf{\realbackslash sf}% + \def\sl{\realbackslash sl }% + \def\tclose##1{\realbackslash tclose {##1}}% \def\tt{\realbackslash tt}% ! % ! \def\b##1{\realbackslash b {##1}}% ! \def\i##1{\realbackslash i {##1}}% ! \def\sc##1{\realbackslash sc {##1}}% ! \def\t##1{\realbackslash t {##1}}% ! \def\r##1{\realbackslash r {##1}}% ! % \def\TeX{\realbackslash TeX}% ! \def\acronym##1{\realbackslash acronym {##1}}% ! \def\cite##1{\realbackslash cite {##1}}% \def\code##1{\realbackslash code {##1}}% \def\command##1{\realbackslash command {##1}}% + \def\dfn##1{\realbackslash dfn {##1}}% + \def\dots{\realbackslash dots }% + \def\emph##1{\realbackslash emph {##1}}% + \def\env##1{\realbackslash env {##1}}% + \def\file##1{\realbackslash file {##1}}% + \def\kbd##1{\realbackslash kbd {##1}}% + \def\key##1{\realbackslash key {##1}}% + \def\math##1{\realbackslash math {##1}}% \def\option##1{\realbackslash option {##1}}% \def\samp##1{\realbackslash samp {##1}}% ! \def\strong##1{\realbackslash strong {##1}}% ! \def\uref##1{\realbackslash uref {##1}}% ! \def\url##1{\realbackslash url {##1}}% \def\var##1{\realbackslash var {##1}}% ! \def\w{\realbackslash w }% ! % ! % These math commands don't seem likely to be used in index entries. ! \def\copyright{\realbackslash copyright}% ! \def\equiv{\realbackslash equiv}% ! \def\error{\realbackslash error}% ! \def\expansion{\realbackslash expansion}% ! \def\point{\realbackslash point}% ! \def\print{\realbackslash print}% ! \def\result{\realbackslash result}% % % Handle some cases of @value -- where the variable name does not % contain - or _, and the value does not contain any *************** *** 2787,2793 **** % 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}} --- 2886,2892 ---- % 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}} *************** *** 2798,2804 **** \def\indexdummydots{...} \def\indexnofonts{% ! % Just ignore accents. \let\,=\indexdummyfont \let\"=\indexdummyfont \let\`=\indexdummyfont --- 2897,2906 ---- \def\indexdummydots{...} \def\indexnofonts{% ! \def\@{@}% ! % how to handle braces? ! \def\_{\normalunderscore}% ! % \let\,=\indexdummyfont \let\"=\indexdummyfont \let\`=\indexdummyfont *************** *** 2814,2858 **** \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. --- 2916,2964 ---- \let\H=\indexdummyfont \let\dotless=\indexdummyfont % Take care of the plain tex special European modified letters. \def\AA{AA}% ! \def\AE{AE}% ! \def\L{L}% ! \def\OE{OE}% \def\O{O}% + \def\aa{aa}% + \def\ae{ae}% \def\l{l}% ! \def\oe{oe}% ! \def\o{o}% \def\ss{ss}% ! % ! % Don't no-op \tt, since it isn't a user-level command ! % and is used in the definitions of the active chars like <, >, |, etc. ! % Likewise with the other plain tex font commands. ! %\let\tt=\indexdummyfont ! % \let\b=\indexdummyfont ! \let\i=\indexdummyfont ! \let\r=\indexdummyfont \let\sc=\indexdummyfont ! \let\t=\indexdummyfont ! % ! \let\TeX=\indexdummytex \let\acronym=\indexdummyfont + \let\cite=\indexdummyfont + \let\code=\indexdummyfont \let\command=\indexdummyfont ! \let\dfn=\indexdummyfont ! \let\dots=\indexdummydots ! \let\emph=\indexdummyfont ! \let\env=\indexdummyfont \let\file=\indexdummyfont \let\kbd=\indexdummyfont \let\key=\indexdummyfont + \let\math=\indexdummyfont + \let\option=\indexdummyfont + \let\samp=\indexdummyfont + \let\strong=\indexdummyfont + \let\uref=\indexdummyfont + \let\url=\indexdummyfont \let\var=\indexdummyfont ! \let\w=\indexdummyfont } % To define \realbackslash, we must make \ not be an escape. *************** *** 3454,3461 **** \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 --- 3560,3567 ---- \gdef\thischaptername{#1}% \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% \toks0 = {#1}% ! \edef\temp{\noexpand\writetocentry{\realbackslash appendixentry{\the\toks0}% ! {\appendixletter}}}% \temp \appendixnoderef \global\let\section = \appendixsec *************** *** 3532,3538 **** \def\unnumberedseczzz #1{% \plainsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% ! \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}% \temp \unnumbnoderef \nobreak --- 3638,3645 ---- \def\unnumberedseczzz #1{% \plainsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% ! \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry% ! {\the\toks0}{\the\chapno}}}% \temp \unnumbnoderef \nobreak *************** *** 3571,3577 **** \plainsubsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% ! {\the\toks0}}}% \temp \unnumbnoderef \nobreak --- 3678,3684 ---- \plainsubsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% ! {\the\toks0}{\the\chapno}{\the\secno}}}% \temp \unnumbnoderef \nobreak *************** *** 3612,3618 **** \plainsubsubsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% ! {\the\toks0}}}% \temp \unnumbnoderef \nobreak --- 3719,3725 ---- \plainsubsubsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% ! {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}}}% \temp \unnumbnoderef \nobreak *************** *** 3824,3830 **** % 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{% --- 3931,3937 ---- % 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 ! % fixed time so that @contents can be put in the document anywhere. % \newif\iftocfileopened \def\writetocentry#1{% *************** *** 3833,3838 **** --- 3940,3953 ---- \global\tocfileopenedtrue \fi \iflinks \write\tocfile{#1{\folio}}\fi + % + % Tell \shipout to create a page destination if we're doing pdf, which + % will be the target of the links in the table of contents. We can't + % just do it on every page because the title pages are numbered 1 and + % 2 (the page numbers aren't printed), and so are the first two pages + % of the document. Thus, we'd have two destinations named `1', and + % two named `2'. + \ifpdf \pdfmakepagedesttrue \fi } \newskip\contentsrightmargin \contentsrightmargin=1in *************** *** 3888,3893 **** --- 4003,4009 ---- \startcontents{\putwordShortTOC}% % \let\chapentry = \shortchapentry + \let\appendixentry = \shortappendixentry \let\unnumbchapentry = \shortunnumberedentry % We want a true roman here for the page numbers. \secfonts *************** *** 3896,3906 **** \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 --- 4012,4022 ---- \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\secentry ##1##2##3##4{} ! \def\unnumbsecentry ##1##2##3{} \def\subsecentry ##1##2##3##4##5{} ! \def\unnumbsubsecentry ##1##2##3##4{} \def\subsubsecentry ##1##2##3##4##5##6{} ! \def\unnumbsubsubsecentry ##1##2##3##4##5{} \openin 1 \jobname.toc \ifeof 1 \else \closein 1 *************** *** 3923,3938 **** % 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. --- 4039,4061 ---- % The last argument is the page number. % The arguments in between are the chapter number, section number, ... ! % Chapters, in the main contents. \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} ! % ! % Chapters, in the short toc. ! % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3{% \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% } + % Appendices, in the main contents. + \def\appendixentry#1#2#3{\dochapentry{\putwordAppendix{} #2\labelspace#1}{#3}} + % + % Appendices, in the short toc. + \let\shortappendixentry = \shortchapentry + % Typeset the label for a chapter or appendix for the short contents. ! % 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. *************** *** 3940,3977 **** \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 --- 4063,4093 ---- \newdimen\shortappendixwidth % \def\shortchaplabel#1{% ! % This space should be enough, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. + % But use \hss just in case. % (This space doesn't include the extra space that gets added after % the label; that gets put in by \shortchapentry above.) ! \dimen0 = 1em ! \hbox to \dimen0{#1\hss}% } + % Unnumbered chapters. \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#3{\dosecentry{#1}{#3}} % Subsections. \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} ! \def\unnumbsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. \def\subsubsecentry#1#2#3#4#5#6{% \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} ! \def\unnumbsubsubsecentry#1#2#3#4#5{\dosubsubsecentry{#1}{#5}} % This parameter controls the indentation of the various levels. \newdimen\tocindent \tocindent = 3pc *************** *** 4012,4018 **** \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} --- 4128,4134 ---- \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, characters such as _ would come out wrong; we % have to do the usual translation tricks. \entry{#1}{#2}% \endgroup} *************** *** 4032,4067 **** \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. --- 4148,4174 ---- \message{environments,} % @foo ... @end foo. + % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. + % % 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. ! % \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}} + % The @error{} command. % Adapted from the TeXbook's \boxit. + % + \newbox\errorbox + % {\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. *************** *** 4072,4079 **** \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. --- 4179,4185 ---- \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} ! % \def\error{\leavevmode\lower.7ex\copy\errorbox} % @tex ... @end tex escapes into raw Tex temporarily. *************** *** 4113,4121 **** \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 --- 4219,4227 ---- \def\@{@}% \let\Etex=\endgroup} ! % Define @lisp ... @end lisp. % @lisp does a \begingroup so it can rebind things, ! % including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in *************** *** 4146,4154 **** % 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 --- 4252,4268 ---- % is reset to zero; thus the \afterenvbreak inserts no space -- but the % start of the next paragraph will insert \parskip % ! \def\aboveenvbreak{{% ! \ifnum\lastpenalty < 10000 ! \advance\envskipamount by \parskip ! \endgraf ! \ifdim\lastskip<\envskipamount ! \removelastskip ! \penalty-50 ! \vskip\envskipamount ! \fi ! \fi ! }} \let\afterenvbreak = \aboveenvbreak *************** *** 4280,4286 **** \def\smalllispx{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}% \def\Esmallexample{\nonfillfinish\endgroup}% ! \smallfonts \lisp } --- 4394,4400 ---- \def\smalllispx{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}% \def\Esmallexample{\nonfillfinish\endgroup}% ! \smallexamplefonts \lisp } *************** *** 4291,4302 **** \let\Edisplay = \nonfillfinish \gobble } ! % @smalldisplay (when @smallbook): @display plus smaller fonts. % \def\smalldisplayx{\begingroup \def\Esmalldisplay{\nonfillfinish\endgroup}% ! \smallfonts \rm \display } --- 4405,4416 ---- \let\Edisplay = \nonfillfinish \gobble } ! % % @smalldisplay (when @smallbook): @display plus smaller fonts. % \def\smalldisplayx{\begingroup \def\Esmalldisplay{\nonfillfinish\endgroup}% ! \smallexamplefonts \rm \display } *************** *** 4308,4319 **** \let\Eformat = \nonfillfinish \gobble } ! % @smallformat (when @smallbook): @format plus smaller fonts. % \def\smallformatx{\begingroup \def\Esmallformat{\nonfillfinish\endgroup}% ! \smallfonts \rm \format } --- 4422,4433 ---- \let\Eformat = \nonfillfinish \gobble } ! % % @smallformat (when @smallbook): @format plus smaller fonts. % \def\smallformatx{\begingroup \def\Esmallformat{\nonfillfinish\endgroup}% ! \smallexamplefonts \rm \format } *************** *** 4505,4510 **** --- 4619,4639 ---- \endgroup\nonfillfinish\endgroup } + % @copying ... @end copying. + % Save the text away for @insertcopying later. + % + \newbox\copyingbox + % + \def\copying{\begingroup + \parindent = 0pt % looks wrong on title page + \def\Ecopying{\egroup\endgroup}% + \global\setbox\copyingbox = \vbox\bgroup + } + + % @insertcopying. + % + \def\insertcopying{\unvcopy\copyingbox} + \message{defuns,} % @defun etc. *************** *** 4833,4839 **** % #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 } --- 4962,4968 ---- % #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 } *************** *** 4842,4850 **** \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} --- 4971,4979 ---- \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} *************** *** 4854,4860 **** \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 } --- 4983,4989 ---- \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 } *************** *** 4900,4906 **** \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 --- 5029,5035 ---- \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 *************** *** 4915,4921 **** \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 } --- 5044,5050 ---- \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 } *************** *** 4929,4935 **** \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 --- 5058,5064 ---- \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 *************** *** 5012,5018 **** % 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} --- 5141,5147 ---- % 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} *************** *** 5023,5029 **** \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} --- 5152,5158 ---- \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} *************** *** 5183,5189 **** \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 --- 5312,5318 ---- \message{Warning: redefining \the\macname}% \else \expandafter\ifx\csname \the\macname\endcsname \relax ! \else \errmessage{Macro name \the\macname\space already defined}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% % Add the macroname to \macrolist *************** *** 5464,5476 **** \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 % --- 5593,5607 ---- \ifpdf \leavevmode \getfilename{#4}% ! {\normalturnoffactive ! \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 % *************** *** 5732,5739 **** % \smallfonts \rm % ! % Hang the footnote text off the number. ! \hang \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this --- 5863,5877 ---- % \smallfonts \rm % ! % Because we use hanging indentation in footnotes, a @noindent appears ! % to exdent this text, so make it be a no-op. makeinfo does not use ! % hanging indentation so @noindent can still be needed within footnote ! % text after an @example or the like (not that this is good style). ! \let\noindent = \relax ! % ! % Hang the footnote text off the number. Use \everypar in case the ! % footnote extends for more than one paragraph. ! \everypar = {\hang}% \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this *************** *** 5750,5773 **** }%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 --- 5888,5893 ---- *************** *** 5832,5872 **** \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 ! \normalturnoffactive % allow _ et al. in names ! % If the image is by itself, center it. ! \ifvmode ! \nobreak\bigskip ! % Usually we'll have text after the image which will insert ! % \parskip glue, so insert it here too to equalize the space ! % above and below. ! \nobreak\vskip\parskip ! \nobreak ! \centerline{\epsfbox{#1.eps}}% ! \bigbreak ! \else ! % In the middle of a paragraph, no extra space. ! \epsfbox{#1.eps}% ! \fi ! \endgroup \fi ! } \message{localization,} --- 5952,5995 ---- \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 (ignored optional) html alt text. ! % #5 is (ignored optional) extension. ! % #6 is just the usual extra ignored arg for parsing this stuff. ! \newif\ifimagevmode ! \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup ! \catcode`\^^M = 5 % in case we're inside an example ! \normalturnoffactive % allow _ et al. in names ! % If the image is by itself, center it. ! \ifvmode ! \imagevmodetrue ! \nobreak\bigskip ! % Usually we'll have text after the image which will insert ! % \parskip glue, so insert it here too to equalize the space ! % above and below. ! \nobreak\vskip\parskip ! \nobreak ! \line\bgroup\hss ! \fi ! % ! % Output the image. \ifpdf ! \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 ! \epsfbox{#1.eps}% \fi ! % ! \ifimagevmode \hss \egroup \bigbreak \fi % space after the image ! \endgroup} \message{localization,} *************** *** 5935,5942 **** } % 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 --- 6058,6066 ---- } % Parameters in order: 1) textheight; 2) textwidth; 3) voffset; ! % 4) hoffset; 5) binding offset; 6) topskip. We also call ! % \setleading{\textleading}, so the caller should define \textleading. ! % The caller should also set \parskip. % \def\internalpagesizes#1#2#3#4#5#6{% \voffset = #3\relax *************** *** 5957,5962 **** --- 6081,6088 ---- \normaloffset = #4\relax \bindingoffset = #5\relax % + \setleading{\textleading} + % \parindent = \defaultparindent \setemergencystretch } *************** *** 5973,5979 **** % @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}% --- 6099,6105 ---- % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt ! \textleading = 13.2pt % % If page is nothing but text, make it come out even. \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% *************** *** 5982,5988 **** % 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}% % --- 6108,6114 ---- % Use @smallbook to reset parameters for 7x9.5 (or so) format. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt ! \textleading = 12pt % \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% % *************** *** 5997,6004 **** % 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}% % --- 6123,6130 ---- % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt + \textleading = 12pt % \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}% % *************** *** 6010,6017 **** % From romildo@urano.iceb.ufop.br, 2 July 2000. % He also recommends making @example and @lisp be small. \def\afivepaper{{\globaldefs = 1 - \setleading{12.5pt}% \parskip = 2pt plus 1pt minus 0.1pt % \internalpagesizes{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}% % --- 6136,6143 ---- % From romildo@urano.iceb.ufop.br, 2 July 2000. % He also recommends making @example and @lisp be small. \def\afivepaper{{\globaldefs = 1 \parskip = 2pt plus 1pt minus 0.1pt + \textleading = 12.5pt % \internalpagesizes{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}% % *************** *** 6029,6039 **** % 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 }} --- 6155,6167 ---- % 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 ! \textleading = 13.6pt % \afourpaper \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% % + % Must explicitly reset to 0 because we call \afourpaper, apparently, + % although this does not entirely make sense. \globaldefs = 0 }} *************** *** 6041,6048 **** \def\afourwide{% \afourpaper \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% - % - \globaldefs = 0 } % @pagesizes TEXTHEIGHT[,TEXTWIDTH] --- 6169,6174 ---- *************** *** 6056,6062 **** \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt ! \setleading{13.2pt}% % \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% }} --- 6182,6188 ---- \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt ! \setleading{\textleading}% % \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% }} *************** *** 6086,6092 **** \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, --- 6212,6218 ---- \def\normalless{<} \def\normalgreater{>} \def\normalplus{+} ! \def\normaldollar{$}%$ font-lock fix % 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, *************** *** 6135,6141 **** \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active ! \def${\ifusingit{{\sl\$}}\normaldollar} %\catcode 27=\active %\def^^[{$\diamondsuit$} --- 6261,6267 ---- \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active ! \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix %\catcode 27=\active %\def^^[{$\diamondsuit$} *************** *** 6180,6186 **** @let<=@normalless @let>=@normalgreater @let+=@normalplus ! @let$=@normaldollar} @def@normalturnoffactive{@let"=@normaldoublequote @let\=@normalbackslash --- 6306,6312 ---- @let<=@normalless @let>=@normalgreater @let+=@normalplus ! @let$=@normaldollar}%$ font-lock fix @def@normalturnoffactive{@let"=@normaldoublequote @let\=@normalbackslash *************** *** 6191,6197 **** @let<=@normalless @let>=@normalgreater @let+=@normalplus ! @let$=@normaldollar} % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. --- 6317,6323 ---- @let<=@normalless @let>=@normalgreater @let+=@normalplus ! @let$=@normaldollar}%$ font-lock fix % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. diff -crN gawk-3.1.0/eval.c gawk-3.1.1/eval.c *** gawk-3.1.0/eval.c Tue May 15 08:56:31 2001 --- gawk-3.1.1/eval.c Tue Apr 16 14:41:14 2002 *************** *** 3,9 **** */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. --- 3,9 ---- */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. *************** *** 224,229 **** --- 224,230 ---- "Node_func_call", "Node_cond_exp", "Node_regex", + "Node_dynregex", "Node_hashnode", "Node_ahash", "Node_array_ref", *************** *** 468,475 **** volatile size_t i; size_t j, num_elems; volatile int retval = 0; ! static int first = TRUE; ! static int sort_indices = FALSE; #define hakvar forloop->init #define arrvar forloop->incr --- 469,475 ---- volatile size_t i; size_t j, num_elems; volatile int retval = 0; ! int sort_indices = whiny_users; #define hakvar forloop->init #define arrvar forloop->incr *************** *** 504,513 **** } } - if (first) { - first = FALSE; - sort_indices = (getenv("WHINY_USERS") != 0); - } if (sort_indices) qsort(list, num_elems, sizeof(NODE *), comp_func); /* shazzam! */ --- 504,509 ---- *************** *** 810,815 **** --- 806,812 ---- case Node_match: case Node_nomatch: case Node_regex: + case Node_dynregex: return match_op(tree); case Node_func: *************** *** 949,957 **** break; /* handled below */ } ! /* evaluate subtrees in order to do binary operation, then keep going */ ! t1 = tree_eval(tree->lnode); ! t2 = tree_eval(tree->rnode); switch (tree->type) { case Node_geq: --- 946,958 ---- break; /* handled below */ } ! /* ! * Evaluate subtrees in order to do binary operation, then keep going. ! * Use dupnode to make sure that these values don't disappear out ! * from under us during recursive subexpression evaluation. ! */ ! t1 = dupnode(tree_eval(tree->lnode)); ! t2 = dupnode(tree_eval(tree->rnode)); switch (tree->type) { case Node_geq: *************** *** 961,968 **** case Node_notequal: case Node_equal: di = cmp_nodes(t1, t2); ! free_temp(t1); ! free_temp(t2); switch (tree->type) { case Node_equal: return tmp_number((AWKNUM) (di == 0)); --- 962,969 ---- case Node_notequal: case Node_equal: di = cmp_nodes(t1, t2); ! unref(t1); ! unref(t2); switch (tree->type) { case Node_equal: return tmp_number((AWKNUM) (di == 0)); *************** *** 985,993 **** } x1 = force_number(t1); - free_temp(t1); x2 = force_number(t2); ! free_temp(t2); switch (tree->type) { case Node_exp: if ((lx = x2) == x2 && lx >= 0) { /* integer exponent */ --- 986,994 ---- } x1 = force_number(t1); x2 = force_number(t2); ! unref(t1); ! unref(t2); switch (tree->type) { case Node_exp: if ((lx = x2) == x2 && lx >= 0) { /* integer exponent */ *************** *** 1137,1142 **** --- 1138,1150 ---- register unsigned char *cp1 = (unsigned char *) t1->stptr; register unsigned char *cp2 = (unsigned char *) t2->stptr; + #ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) { + mbstate_t mbs; + memset(&mbs, 0, sizeof(mbstate_t)); + ret = strncasecmpmbs(cp1, mbs, cp2, mbs, l); + } else + #endif for (ret = 0; l-- > 0 && ret == 0; cp1++, cp2++) ret = casetable[*cp1] - casetable[*cp2]; } else *************** *** 1321,1337 **** old_type = arg->type; /* ! * subtlety: if arg->type is Node_var but n->type ! * is Node_var_array, then the array routines noticed ! * that a variable name was really an array and ! * changed the type. But when v->name was pushed ! * on the stack, it came out of the varnames array, ! * and was not malloc'ed, so we shouldn't free it. ! * See the corresponding code in push_args(). ! * Thanks to Juergen Kahrs for finding a test case ! * that shows this. */ ! if (old_type == Node_var_array || old_type == Node_array_ref) free(n->vname); if (arg->type == Node_var) { --- 1329,1342 ---- old_type = arg->type; /* ! * We only free n->vname in the same cases in push_fcall() which ! * mallocs it. These are when passing a real array in; the ! * old type is array and the parameter "copy" is an array ref, ! * or when passing an array reference on to another function. ! * It helps to be awake when writing code. */ ! if ( (old_type == Node_var_array && n->type == Node_array_ref) ! || (old_type == Node_array_ref && n->type == Node_array_ref) ) free(n->vname); if (arg->type == Node_var) { *************** *** 2013,2019 **** if (fmt_hiwater >= fmt_num) { fmt_num *= 2; ! emalloc(fmt_list, NODE **, fmt_num, "fmt_index"); } fmt_list[fmt_hiwater] = dupnode(n); return fmt_hiwater++; --- 2018,2024 ---- if (fmt_hiwater >= fmt_num) { fmt_num *= 2; ! erealloc(fmt_list, NODE **, fmt_num * sizeof(*fmt_list), "fmt_index"); } fmt_list[fmt_hiwater] = dupnode(n); return fmt_hiwater++; *************** *** 2105,2110 **** --- 2110,2119 ---- save = *lhs_p; *lhs_p = dupnode(rhs); unref(save); + + /* this check really doesn't belong here, but I don't have a better place */ + if (lhs_p == & NF_node->var_value && NF_node->var_value->numbr < 0) + fatal(_("NF set to negative value")); } return *lhs_p; } diff -crN gawk-3.1.0/extension/arrayparm.c gawk-3.1.1/extension/arrayparm.c *** gawk-3.1.0/extension/arrayparm.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/extension/arrayparm.c Wed Oct 17 15:02:35 2001 *************** *** 0 **** --- 1,93 ---- + /* + * arrayparm.c --- figure out how to make a parameter be an array + * + * Arnold Robbins + * arnold@skeeve.com + * 10/2001 + */ + + /* + * Copyright (C) 2001 the Free Software Foundation, Inc. + * + * This file is part of GAWK, the GNU implementation of the + * AWK Programming Language. + * + * GAWK 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. + * + * GAWK 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 "awk.h" + + /* do_mkarray --- turn a variable into an array */ + + /* + * From awk, call + * + * mkarray(var, sub, val) + */ + + static NODE * + do_mkarray(tree) + NODE *tree; + { + int ret = -1; + NODE *var, *sub, *val; + NODE **elemval; + + if (do_lint && tree->param_cnt > 3) + lintwarn("mkarray: called with too many arguments"); + + var = get_argument(tree, 0); + if (var == NULL) + var = stack_ptr[0]; + sub = get_argument(tree, 1); + val = get_argument(tree, 2); + + printf("var->type = %s\n", nodetype2str(var->type)); + printf("sub->type = %s\n", nodetype2str(sub->type)); + printf("val->type = %s\n", nodetype2str(val->type)); + + if (var->var_array == NULL) { + if (var->type != Node_var_array) { + unref(var->var_value); + var->type = Node_var_array; + } + var->array_size = var->table_size = 0; /* sanity */ + var->flags &= ~ARRAYMAXED; + } + assoc_clear(var); + + elemval = assoc_lookup(var, sub, 0); + *elemval = dupnode(val); + ret = 0; + + + /* Set the return value */ + set_value(tmp_number((AWKNUM) ret)); + + /* Just to make the interpreter happy */ + return tmp_number((AWKNUM) 0); + } + + /* dlload --- load new builtins in this library */ + + NODE * + dlload(tree, dl) + NODE *tree; + void *dl; + { + make_builtin("mkarray", do_mkarray, 3); + + return tmp_number((AWKNUM) 0); + } diff -crN gawk-3.1.0/extension/ordchr.c gawk-3.1.1/extension/ordchr.c *** gawk-3.1.0/extension/ordchr.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/extension/ordchr.c Sun Aug 26 15:16:11 2001 *************** *** 0 **** --- 1,106 ---- + /* + * ordchr.c - Builtin functions that provide ord() and chr() functions. + * + * Arnold Robbins + * arnold@skeeve.com + * 8/2001 + */ + + /* + * Copyright (C) 2001 the Free Software Foundation, Inc. + * + * This file is part of GAWK, the GNU implementation of the + * AWK Programming Language. + * + * GAWK 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. + * + * GAWK 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 "awk.h" + + /* do_ord --- return numeric value of first char of string */ + + static NODE * + do_ord(tree) + NODE *tree; + { + NODE *str; + int ret = -1; + + if (do_lint && tree->param_cnt > 1) + lintwarn("ord: called with too many arguments"); + + str = get_argument(tree, 0); + if (str != NULL) { + (void) force_string(str); + ret = str->stptr[0]; + free_temp(str); + } else if (do_lint) + lintwarn("ord: called with no arguments"); + + + /* Set the return value */ + set_value(tmp_number((AWKNUM) ret)); + + /* Just to make the interpreter happy */ + return tmp_number((AWKNUM) 0); + } + + /* do_chr --- turn numeric value into a string */ + + static NODE * + do_chr(tree) + NODE *tree; + { + NODE *num; + unsigned int ret = 0; + AWKNUM val = 0.0; + char str[2]; + + str[0] = str[1] = '\0'; + + if (do_lint && tree->param_cnt > 1) + lintwarn("chr: called with too many arguments"); + + num = get_argument(tree, 0); + if (num != NULL) { + val = force_number(num); + ret = val; /* convert to int */ + free_temp(num); + ret &= 0xff; + str[0] = ret; + str[1] = '\0'; + } else if (do_lint) + lintwarn("chr: called with no arguments"); + + + /* Set the return value */ + set_value(tmp_string(str, 1)); + + /* Just to make the interpreter happy */ + return tmp_number((AWKNUM) 0); + } + + /* dlload --- load new builtins in this library */ + + NODE * + dlload(tree, dl) + NODE *tree; + void *dl; + { + make_builtin("ord", do_ord, 1); + make_builtin("chr", do_chr, 1); + + return tmp_number((AWKNUM) 0); + } diff -crN gawk-3.1.0/extension/readfile.c gawk-3.1.1/extension/readfile.c *** gawk-3.1.0/extension/readfile.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/extension/readfile.c Sun Apr 28 17:00:22 2002 *************** *** 0 **** --- 1,109 ---- + /* + * readfile.c - Read an entire file into a string. + * + * Arnold Robbins + * Tue Apr 23 17:43:30 IDT 2002 + */ + + /* + * Copyright (C) 2002 the Free Software Foundation, Inc. + * + * This file is part of GAWK, the GNU implementation of the + * AWK Programming Language. + * + * GAWK 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. + * + * GAWK 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 "awk.h" + #include + + /* do_readfile --- read a file into memory */ + + NODE * + do_readfile(tree) + NODE *tree; + { + NODE *filename; + int ret = -1; + struct stat sbuf; + char *text; + int fd; + + if (do_lint && tree->param_cnt > 1) + lintwarn("readfile: called with too many arguments"); + + filename = get_argument(tree, 0); + if (filename != NULL) { + (void) force_string(filename); + + ret = stat(filename->stptr, & sbuf); + if (ret < 0) { + update_ERRNO(); + free_temp(filename); + goto done; + } else if ((sbuf.st_mode & S_IFMT) != S_IFREG) { + errno = EINVAL; + ret = -1; + update_ERRNO(); + free_temp(filename); + goto done; + } + + if ((fd = open(filename->stptr, O_RDONLY)) < 0) { + ret = -1; + update_ERRNO(); + free_temp(filename); + goto done; + } + + emalloc(text, char *, sbuf.st_size + 2, "do_readfile"); + memset(text, '\0', sbuf.st_size + 2); + + if ((ret = read(fd, text, sbuf.st_size)) != sbuf.st_size) { + (void) close(fd); + ret = -1; + update_ERRNO(); + free_temp(filename); + goto done; + } + + close(fd); + free_temp(filename); + set_value(tmp_string(text, sbuf.st_size)); + return tmp_number((AWKNUM) 0); + } else if (do_lint) + lintwarn("filename: called with no arguments"); + + + done: + /* Set the return value */ + set_value(tmp_number((AWKNUM) ret)); + + /* Just to make the interpreter happy */ + return tmp_number((AWKNUM) 0); + } + + + /* dlload --- load new builtins in this library */ + + NODE * + dlload(tree, dl) + NODE *tree; + void *dl; + { + make_builtin("readfile", do_readfile, 1); + + return tmp_number((AWKNUM) 0); + } diff -crN gawk-3.1.0/extension/steps gawk-3.1.1/extension/steps *** gawk-3.1.0/extension/steps Thu Feb 4 13:23:52 1999 --- gawk-3.1.1/extension/steps Sun Apr 28 16:00:13 2002 *************** *** 1,9 **** --- 1,17 ---- # what to do under linux to make dl.so # Tue Nov 24 15:04:14 EST 1998 + # Sun Aug 26 16:03:58 IDT 2001 + # Sun Apr 28 15:59:57 IDT 2002 gcc -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. dl.c gcc -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. filefuncs.c gcc -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. fork.c + gcc -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. ordchr.c + gcc -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. arrayparm.c + gcc -shared -Wall -DHAVE_CONFIG_H -c -O -g -I.. readfile.c ld -o dl.so -shared dl.o ld -o filefuncs.so -shared filefuncs.o ld -o fork.so -shared fork.o + ld -o ordchr.so -shared ordchr.o + ld -o arrayparm.so -shared arrayparm.o + ld -o readfile.so -shared readfile.o diff -crN gawk-3.1.0/extension/testarrayparm.awk gawk-3.1.1/extension/testarrayparm.awk *** gawk-3.1.0/extension/testarrayparm.awk Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/extension/testarrayparm.awk Wed Oct 17 14:49:08 2001 *************** *** 0 **** --- 1,10 ---- + #! /bin/awk -f + + BEGIN { + extension("./arrayparm.so", "dlload") + + mkarray(newvar, "hi", "hello") + + for (i in newvar) + printf ("newvar[\"%s\"] = \"%s\"\n", i, newvar[i]) + } diff -crN gawk-3.1.0/extension/testordchr.awk gawk-3.1.1/extension/testordchr.awk *** gawk-3.1.0/extension/testordchr.awk Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/extension/testordchr.awk Sun Aug 26 15:17:16 2001 *************** *** 0 **** --- 1,6 ---- + BEGIN { + extension("./ordchr.so", "dlload") + + print "ord(\"a\") is", ord("a") + print "chr(65) is", chr(65) + } diff -crN gawk-3.1.0/field.c gawk-3.1.1/field.c *** gawk-3.1.0/field.c Sun Jan 21 17:45:57 2001 --- gawk-3.1.1/field.c Tue Apr 16 14:57:25 2002 *************** *** 3,9 **** */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. --- 3,9 ---- */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. *************** *** 315,331 **** assert(NF != -1); NF = (long) force_number(NF_node->var_value); if (NF > nf_high_water) grow_fields_arr(NF); if (parse_high_water < NF) { ! for (i = parse_high_water + 1; i <= NF; i++) { unref(fields_arr[i]); getnode(n); *n = *Null_field; fields_arr[i] = n; } } else if (parse_high_water > 0) { ! for (i = NF + 1; i <= parse_high_water; i++) { unref(fields_arr[i]); getnode(n); *n = *Null_field; --- 315,332 ---- assert(NF != -1); NF = (long) force_number(NF_node->var_value); + if (NF > nf_high_water) grow_fields_arr(NF); if (parse_high_water < NF) { ! for (i = parse_high_water + 1; i >= 0 && i <= NF; i++) { unref(fields_arr[i]); getnode(n); *n = *Null_field; fields_arr[i] = n; } } else if (parse_high_water > 0) { ! for (i = NF + 1; i >= 0 && i <= parse_high_water; i++) { unref(fields_arr[i]); getnode(n); *n = *Null_field; *************** *** 356,361 **** --- 357,368 ---- register long nf = parse_high_water; register char *field; register char *end = scan + len; + #ifdef MBS_SUPPORT + size_t mbclen = 0; + mbstate_t mbs; + if (MB_CUR_MAX > 1) + memset(&mbs, 0, sizeof(mbstate_t)); + #endif if (up_to == HUGE) nf = 0; *************** *** 370,375 **** --- 377,393 ---- && research(rp, scan, 0, (end - scan), TRUE) != -1 && nf < up_to) { if (REEND(rp, scan) == RESTART(rp, scan)) { /* null match */ + #ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) { + mbclen = mbrlen(scan, end-scan, &mbs); + if ((mbclen == 1) || (mbclen == (size_t) -1) + || (mbclen == (size_t) -2) || (mbclen == 0)) { + /* We treat it as a singlebyte character. */ + mbclen = 1; + } + scan += mbclen; + } else + #endif scan++; if (scan == end) { (*set)(++nf, field, (long)(scan - field), n); *************** *** 550,555 **** --- 568,589 ---- if (len == 0) return nf; + #ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) { + mbstate_t mbs; + memset(&mbs, 0, sizeof(mbstate_t)); + for (; nf < up_to && scan < end;) { + size_t mbclen = mbrlen(scan, end-scan, &mbs); + if ((mbclen == 1) || (mbclen == (size_t) -1) + || (mbclen == (size_t) -2) || (mbclen == 0)) { + /* We treat it as a singlebyte character. */ + mbclen = 1; + } + (*set)(++nf, scan, mbclen, n); + scan += mbclen; + } + } else + #endif for (; nf < up_to && scan < end; scan++) (*set)(++nf, scan, 1L, n); *************** *** 580,585 **** --- 614,625 ---- register char *end = scan + len; int onecase; char sav; + #ifdef MBS_SUPPORT + size_t mbclen = 0; + mbstate_t mbs; + if (MB_CUR_MAX > 1) + memset(&mbs, 0, sizeof(mbstate_t)); + #endif if (up_to == HUGE) nf = 0; *************** *** 604,612 **** --- 644,674 ---- field = scan; if (onecase) { while (casetable[(unsigned char) *scan] != fschar) + #ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) { + mbclen = mbrlen(scan, end-scan, &mbs); + if ((mbclen == 1) || (mbclen == (size_t) -1) + || (mbclen == (size_t) -2) || (mbclen == 0)) { + /* We treat it as a singlebyte character. */ + mbclen = 1; + } + scan += mbclen; + } else + #endif scan++; } else { while (*scan != fschar) + #ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) { + mbclen = mbrlen(scan, end-scan, &mbs); + if ((mbclen == 1) || (mbclen == (size_t) -1) + || (mbclen == (size_t) -2) || (mbclen == 0)) { + /* We treat it as a singlebyte character. */ + mbclen = 1; + } + scan += mbclen; + } else + #endif scan++; } (*set)(++nf, field, (long)(scan - field), n); diff -crN gawk-3.1.0/fixvers gawk-3.1.1/fixvers *** gawk-3.1.0/fixvers Sun Jan 21 17:55:06 2001 --- gawk-3.1.1/fixvers Sun Apr 28 17:19:58 2002 *************** *** 3,9 **** # fixvers --- make sure version.c and patchlev.h reflect # the reality in configure.in # ! # Copyright (C) 2001 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. --- 3,9 ---- # fixvers --- make sure version.c and patchlev.h reflect # the reality in configure.in # ! # Copyright (C) 2001, 2002 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. *************** *** 26,36 **** case $1 in -v) ! VERS=`echo $line | sed 's/.*, *\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\))/\1.\2/'` sed "s/X\.Y/$VERS/" < version.in > version.new ! if cmp version.c version.new then ! : else mv version.new version.c fi --- 26,36 ---- case $1 in -v) ! VERS=`echo $line | sed 's/.*, *\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9a-z]*\))/\1.\2/'` sed "s/X\.Y/$VERS/" < version.in > version.new ! if [ -f version.c ] && cmp version.c version.new then ! rm version.new else mv version.new version.c fi *************** *** 38,48 **** ;; -p) ! LEV=`echo $line | sed 's/.*, *\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\))/\3/'` echo "#define PATCHLEVEL $LEV" > patchlev.new ! if cmp patchlev.h patchlev.new then ! : else mv patchlev.new patchlev.h fi --- 38,48 ---- ;; -p) ! LEV=`echo $line | sed 's/.*, *\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9a-z]*\))/\"\3\"/'` echo "#define PATCHLEVEL $LEV" > patchlev.new ! if [ -f patchlev.h ] && cmp patchlev.h patchlev.new then ! rm patchlev.new else mv patchlev.new patchlev.h fi diff -crN gawk-3.1.0/gawkmisc.c gawk-3.1.1/gawkmisc.c *** gawk-3.1.0/gawkmisc.c Sun Jan 21 17:49:45 2001 --- gawk-3.1.1/gawkmisc.c Tue Apr 16 14:57:38 2002 *************** *** 3,9 **** */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. --- 3,9 ---- */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. *************** *** 31,36 **** --- 31,39 ---- /* some old compilers don't grok #elif. sigh */ + #ifdef __EMX__ + #include "pc/gawkmisc.pc" + #else /* not __EMX__ */ #if defined(MSDOS) || defined(OS2) || defined(WIN32) #include "gawkmisc.pc" #else /* not MSDOS, not OS2, not WIN32 */ *************** *** 48,53 **** --- 51,57 ---- #endif /* not atarist */ #endif /* not VMS */ #endif /* not MSDOS, not OS2, not WIN32 */ + #endif /* not __EMX__ */ /* xmalloc --- provide this so that other GNU library routines work */ diff -crN gawk-3.1.0/getopt.c gawk-3.1.1/getopt.c *** gawk-3.1.0/getopt.c Tue Nov 7 15:24:19 2000 --- gawk-3.1.1/getopt.c Sun Apr 28 18:26:18 2002 *************** *** 2,25 **** NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! ! ! Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 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. */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ --- 2,25 ---- NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! ! Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or ! modify it under the terms of the GNU Lesser General Public ! License as published by the Free Software Foundation; either ! version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! Lesser General Public License for more details. ! You should have received a copy of the GNU Lesser General Public ! License along with the GNU C Library; 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 . */ *************** *** 78,84 **** #ifndef _ /* This is for other GNU distributions with internationalized messages. */ ! # if defined HAVE_LIBINTL_H || defined _LIBC # include # ifndef _ # define _(msgid) gettext (msgid) --- 78,84 ---- #ifndef _ /* This is for other GNU distributions with internationalized messages. */ ! # if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC # include # ifndef _ # define _(msgid) gettext (msgid) *************** *** 86,91 **** --- 86,98 ---- # else # define _(msgid) (msgid) # endif + # if defined _LIBC && defined USE_IN_LIBIO + # include + # endif + #endif + + #ifndef attribute_hidden + # define attribute_hidden #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' *************** *** 131,137 **** 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. --- 138,144 ---- causes problems with re-calling getopt as programs generally don't know that. */ ! int __getopt_initialized attribute_hidden; /* The next char to be scanned in the option-element in which the last option character we returned was found. *************** *** 250,290 **** 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 */ --- 257,290 ---- static int last_nonopt; #ifdef _LIBC + /* Stored original parameters. + 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). */ + extern int __libc_argc; + extern char **__libc_argv; + /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ + # ifdef USE_NONOPTION_FLAGS /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; + # endif ! # ifdef USE_NONOPTION_FLAGS ! # 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 + # define SWAP_FLAGS(ch1, ch2) + # endif #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ *************** *** 316,322 **** 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. */ --- 316,322 ---- It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ ! #if defined _LIBC && defined USE_NONOPTION_FLAGS /* 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. */ *************** *** 420,428 **** else ordering = PERMUTE; ! #ifdef _LIBC if (posixly_correct == NULL ! && argc == original_argc && argv == original_argv) { if (nonoption_flags_max_len == 0) { --- 420,428 ---- else ordering = PERMUTE; ! #if defined _LIBC && defined USE_NONOPTION_FLAGS if (posixly_correct == NULL ! && argc == __libc_argc && argv == __libc_argv) { if (nonoption_flags_max_len == 0) { *************** *** 539,545 **** 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')) --- 539,545 ---- 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. */ ! #if defined _LIBC && defined USE_NONOPTION_FLAGS # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) *************** *** 685,692 **** if (ambig && !exact) { if (print_errors) ! fprintf (stderr, _("%s: option `%s' is ambiguous\n"), ! argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; optopt = 0; --- 685,710 ---- if (ambig && !exact) { if (print_errors) ! { ! #if defined _LIBC && defined USE_IN_LIBIO ! char *buf; ! ! if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), ! argv[0], argv[optind]) >= 0) ! { ! ! if (_IO_fwide (stderr, 0) > 0) ! __fwprintf (stderr, L"%s", buf); ! else ! fputs (buf, stderr); ! ! free (buf); ! } ! #else ! fprintf (stderr, _("%s: option `%s' is ambiguous\n"), ! argv[0], argv[optind]); ! #endif ! } nextchar += strlen (nextchar); optind++; optopt = 0; *************** *** 707,722 **** { if (print_errors) { 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); --- 725,774 ---- { if (print_errors) { + #if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; + #endif + if (argv[optind - 1][1] == '-') ! { ! /* --option */ ! #if defined _LIBC && defined USE_IN_LIBIO ! n = __asprintf (&buf, _("\ ! %s: option `--%s' doesn't allow an argument\n"), ! argv[0], pfound->name); ! #else ! fprintf (stderr, _("\ ! %s: option `--%s' doesn't allow an argument\n"), ! argv[0], pfound->name); ! #endif ! } else ! { ! /* +option or -option */ ! #if defined _LIBC && defined USE_IN_LIBIO ! n = __asprintf (&buf, _("\ ! %s: option `%c%s' doesn't allow an argument\n"), ! argv[0], argv[optind - 1][0], ! pfound->name); ! #else ! fprintf (stderr, _("\ ! %s: option `%c%s' doesn't allow an argument\n"), ! argv[0], argv[optind - 1][0], pfound->name); ! #endif ! } ! ! #if defined _LIBC && defined USE_IN_LIBIO ! if (n >= 0) ! { ! if (_IO_fwide (stderr, 0) > 0) ! __fwprintf (stderr, L"%s", buf); ! else ! fputs (buf, stderr); ! ! free (buf); ! } ! #endif } nextchar += strlen (nextchar); *************** *** 732,740 **** else { if (print_errors) ! fprintf (stderr, ! _("%s: option `%s' requires an argument\n"), ! argv[0], argv[optind - 1]); nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; --- 784,810 ---- else { if (print_errors) ! { ! #if defined _LIBC && defined USE_IN_LIBIO ! char *buf; ! ! if (__asprintf (&buf, _("\ ! %s: option `%s' requires an argument\n"), ! argv[0], argv[optind - 1]) >= 0) ! { ! if (_IO_fwide (stderr, 0) > 0) ! __fwprintf (stderr, L"%s", buf); ! else ! fputs (buf, stderr); ! ! free (buf); ! } ! #else ! fprintf (stderr, ! _("%s: option `%s' requires an argument\n"), ! argv[0], argv[optind - 1]); ! #endif ! } nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; *************** *** 760,773 **** { if (print_errors) { 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++; --- 830,874 ---- { if (print_errors) { + #if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; + #endif + if (argv[optind][1] == '-') ! { ! /* --option */ ! #if defined _LIBC && defined USE_IN_LIBIO ! n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), ! argv[0], nextchar); ! #else ! fprintf (stderr, _("%s: unrecognized option `--%s'\n"), ! argv[0], nextchar); ! #endif ! } else ! { ! /* +option or -option */ ! #if defined _LIBC && defined USE_IN_LIBIO ! n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), ! argv[0], argv[optind][0], nextchar); ! #else ! fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), ! argv[0], argv[optind][0], nextchar); ! #endif ! } ! ! #if defined _LIBC && defined USE_IN_LIBIO ! if (n >= 0) ! { ! if (_IO_fwide (stderr, 0) > 0) ! __fwprintf (stderr, L"%s", buf); ! else ! fputs (buf, stderr); ! ! free (buf); ! } ! #endif } nextchar = (char *) ""; optind++; *************** *** 790,802 **** { if (print_errors) { 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 '?'; --- 891,932 ---- { if (print_errors) { + #if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; + #endif + if (posixly_correct) ! { ! /* 1003.2 specifies the format of this message. */ ! #if defined _LIBC && defined USE_IN_LIBIO ! n = __asprintf (&buf, _("%s: illegal option -- %c\n"), ! argv[0], c); ! #else ! fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); ! #endif ! } else ! { ! #if defined _LIBC && defined USE_IN_LIBIO ! n = __asprintf (&buf, _("%s: invalid option -- %c\n"), ! argv[0], c); ! #else ! fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); ! #endif ! } ! ! #if defined _LIBC && defined USE_IN_LIBIO ! if (n >= 0) ! { ! if (_IO_fwide (stderr, 0) > 0) ! __fwprintf (stderr, L"%s", buf); ! else ! fputs (buf, stderr); ! ! free (buf); ! } ! #endif } optopt = c; return '?'; *************** *** 825,832 **** --- 955,978 ---- if (print_errors) { /* 1003.2 specifies the format of this message. */ + #if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, + _("%s: option requires an argument -- %c\n"), + argv[0], c) >= 0) + { + if (_IO_fwide (stderr, 0) > 0) + __fwprintf (stderr, L"%s", buf); + else + fputs (buf, stderr); + + free (buf); + } + #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); + #endif } optopt = c; if (optstring[0] == ':') *************** *** 872,879 **** if (ambig && !exact) { if (print_errors) ! fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), ! argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; return '?'; --- 1018,1042 ---- if (ambig && !exact) { if (print_errors) ! { ! #if defined _LIBC && defined USE_IN_LIBIO ! char *buf; ! ! if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), ! argv[0], argv[optind]) >= 0) ! { ! if (_IO_fwide (stderr, 0) > 0) ! __fwprintf (stderr, L"%s", buf); ! else ! fputs (buf, stderr); ! ! free (buf); ! } ! #else ! fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), ! argv[0], argv[optind]); ! #endif ! } nextchar += strlen (nextchar); optind++; return '?'; *************** *** 890,898 **** else { if (print_errors) ! fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), ! argv[0], pfound->name); nextchar += strlen (nextchar); return '?'; --- 1053,1079 ---- else { if (print_errors) ! { ! #if defined _LIBC && defined USE_IN_LIBIO ! char *buf; ! ! if (__asprintf (&buf, _("\ ! %s: option `-W %s' doesn't allow an argument\n"), ! argv[0], pfound->name) >= 0) ! { ! if (_IO_fwide (stderr, 0) > 0) ! __fwprintf (stderr, L"%s", buf); ! else ! fputs (buf, stderr); ! ! free (buf); ! } ! #else ! fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), ! argv[0], pfound->name); ! #endif ! } nextchar += strlen (nextchar); return '?'; *************** *** 905,913 **** else { if (print_errors) ! fprintf (stderr, ! _("%s: option `%s' requires an argument\n"), ! argv[0], argv[optind - 1]); nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } --- 1086,1112 ---- else { if (print_errors) ! { ! #if defined _LIBC && defined USE_IN_LIBIO ! char *buf; ! ! if (__asprintf (&buf, _("\ ! %s: option `%s' requires an argument\n"), ! argv[0], argv[optind - 1]) >= 0) ! { ! if (_IO_fwide (stderr, 0) > 0) ! __fwprintf (stderr, L"%s", buf); ! else ! fputs (buf, stderr); ! ! free (buf); ! } ! #else ! fprintf (stderr, ! _("%s: option `%s' requires an argument\n"), ! argv[0], argv[optind - 1]); ! #endif ! } nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } *************** *** 954,962 **** --- 1153,1177 ---- if (print_errors) { /* 1003.2 specifies the format of this message. */ + #if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ + %s: option requires an argument -- %c\n"), + argv[0], c) >= 0) + { + if (_IO_fwide (stderr, 0) > 0) + __fwprintf (stderr, L"%s", buf); + else + fputs (buf, stderr); + + free (buf); + } + #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); + #endif } optopt = c; if (optstring[0] == ':') diff -crN gawk-3.1.0/getopt.h gawk-3.1.1/getopt.h *** gawk-3.1.0/getopt.h Sun Jan 7 15:26:07 2001 --- gawk-3.1.1/getopt.h Sun Mar 3 16:38:52 2002 *************** *** 1,21 **** /* Declarations for getopt. ! Copyright (C) 1989,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or ! 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 _GETOPT_H --- 1,21 ---- /* Declarations for getopt. ! Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or ! modify it under the terms of the GNU Lesser General Public ! License as published by the Free Software Foundation; either ! version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! Lesser General Public License for more details. ! You should have received a copy of the GNU Lesser General Public ! License along with the GNU C Library; if not, write to the Free ! Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. */ #ifndef _GETOPT_H *************** *** 93,99 **** struct option { ! # if defined __STDC__ && __STDC__ const char *name; # else char *name; --- 93,99 ---- struct option { ! # if (defined __STDC__ && __STDC__) || defined __cplusplus const char *name; # else char *name; *************** *** 137,161 **** arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ ! #if defined __STDC__ && __STDC__ # 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, char *const *, const char *, ! const struct option *, int *); ! extern int getopt_long_only (int , char *const *, ! const char *, ! const struct option *, int *); /* 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); --- 137,162 ---- arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ ! #if (defined __STDC__ && __STDC__) || defined __cplusplus # 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); diff -crN gawk-3.1.0/getopt1.c gawk-3.1.1/getopt1.c *** gawk-3.1.0/getopt1.c Sun Mar 8 17:07:44 1998 --- gawk-3.1.1/getopt1.c Sun Mar 3 16:38:52 2002 *************** *** 4,22 **** This file is part of the GNU C Library. 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 --- 4,22 ---- This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or ! modify it under the terms of the GNU Lesser General Public ! License as published by the Free Software Foundation; either ! version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! Lesser General Public License for more details. ! You should have received a copy of the GNU Lesser General Public ! License along with the GNU C Library; if not, write to the Free ! Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ! 02111-1307 USA. */ #ifdef HAVE_CONFIG_H #include diff -crN gawk-3.1.0/gettext.h gawk-3.1.1/gettext.h *** gawk-3.1.0/gettext.h Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/gettext.h Tue Feb 19 18:36:34 2002 *************** *** 0 **** --- 1,60 ---- + /* Convenience header for conditional use of GNU . + 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. */ + + #ifndef _LIBGETTEXT_H + #define _LIBGETTEXT_H 1 + + /* NLS can be disabled through the configure --disable-nls option. */ + #if ENABLE_NLS + + /* Get declarations of GNU message catalog functions. */ + # include + + #else + + /* Disabled NLS. + The casts to 'const char *' serve the purpose of producing warnings + for invalid uses of the value returned from these functions. + On pre-ANSI systems without 'const', the config.h file is supposed to + contain "#define const". */ + /* ADR: BOGUS. Remove const. 19 Feb 2002 */ + # define gettext(Msgid) ((char *) (Msgid)) + # define dgettext(Domainname, Msgid) ((char *) (Msgid)) + # define dcgettext(Domainname, Msgid, Category) ((char *) (Msgid)) + # define ngettext(Msgid1, Msgid2, N) \ + ((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2)) + # define dngettext(Domainname, Msgid1, Msgid2, N) \ + ((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2)) + # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ + ((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2)) + # define textdomain(Domainname) ((char *) (Domainname)) + # define bindtextdomain(Domainname, Dirname) ((char *) (Dirname)) + # define bind_textdomain_codeset(Domainname, Codeset) ((char *) (Codeset)) + + #endif + + /* A pseudo function call that serves as a marker for the automated + extraction of messages, but does not call gettext(). The run-time + translation is done at a different place in the code. + The argument, String, should be a literal string. Concatenated strings + and other string expressions won't work. + The macro's expansion is not parenthesized, so that it is suitable as + initializer for static 'char[]' or 'const char[]' variables. */ + #define gettext_noop(String) String + + #endif /* _LIBGETTEXT_H */ diff -crN gawk-3.1.0/intl/ChangeLog gawk-3.1.1/intl/ChangeLog *** gawk-3.1.0/intl/ChangeLog Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/ChangeLog Wed May 1 16:41:58 2002 *************** *** 0 **** --- 1,8 ---- + Wed May 1 16:41:32 2002 Arnold D. Robbins + + * Release 3.1.1: Release tar file made. + + 2002-04-24 GNU + + * Version 0.11.2 released. + diff -crN gawk-3.1.0/intl/Makefile.in gawk-3.1.1/intl/Makefile.in *** gawk-3.1.0/intl/Makefile.in Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/Makefile.in Sun Apr 28 17:01:51 2002 *************** *** 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=1 + LTV_AGE=0 + + .SUFFIXES: + .SUFFIXES: .c .y .o .lo .sin .sed + .c.o: + $(COMPILE) $< + .c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) $< + + .y.c: + $(YACC) $(YFLAGS) --output $@ $< + rm -f $*.h + + .sin.sed: + sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@ + mv t-$@ $@ + + INCLUDES = -I.. -I. -I$(top_srcdir)/intl + + all: all-@USE_INCLUDED_LIBINTL@ + all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed + all-no: all-no-@BUILD_INCLUDED_LIBINTL@ + all-no-yes: libgnuintl.$la + all-no-no: + + libintl.a libgnuintl.a: $(OBJECTS) + rm -f $@ + $(AR) cru $@ $(OBJECTS) + $(RANLIB) $@ + + libintl.la libgnuintl.la: $(OBJECTS) + $(LIBTOOL) --mode=link \ + $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \ + $(OBJECTS) @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 -crN gawk-3.1.0/intl/VERSION gawk-3.1.1/intl/VERSION *** gawk-3.1.0/intl/VERSION Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/VERSION Sun Apr 28 17:01:51 2002 *************** *** 0 **** --- 1 ---- + GNU gettext library from gettext-0.11.2 diff -crN gawk-3.1.0/intl/bindtextdom.c gawk-3.1.1/intl/bindtextdom.c *** gawk-3.1.0/intl/bindtextdom.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/bindtextdom.c Sun Apr 28 17:01:51 2002 *************** *** 0 **** --- 1,369 ---- + /* Implementation of the bindtextdomain(3) function + Copyright (C) 1995-1998, 2000, 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. */ + + #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 attribute_hidden) + + + /* 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 -crN gawk-3.1.0/intl/config.charset gawk-3.1.1/intl/config.charset *** gawk-3.1.0/intl/config.charset Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/config.charset Sun Apr 28 17:01:51 2002 *************** *** 0 **** --- 1,454 ---- + #! /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" + ;; + netbsd*) + 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-15 ISO-8859-15" + echo "eucCN GB2312" + echo "eucJP EUC-JP" + echo "eucKR EUC-KR" + echo "eucTW EUC-TW" + echo "BIG5 BIG5" + echo "SJIS SHIFT_JIS" + ;; + 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 CP866" + echo "ru_RU 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 -crN gawk-3.1.0/intl/dcgettext.c gawk-3.1.1/intl/dcgettext.c *** gawk-3.1.0/intl/dcgettext.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/dcgettext.c Sun Apr 28 17:01:51 2002 *************** *** 0 **** --- 1,59 ---- + /* Implementation of the dcgettext(3) function. + Copyright (C) 1995-1999, 2000, 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. */ + + #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. */ + INTDEF(__dcgettext) + weak_alias (__dcgettext, dcgettext); + #endif diff -crN gawk-3.1.0/intl/dcigettext.c gawk-3.1.1/intl/dcigettext.c *** gawk-3.1.0/intl/dcigettext.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/dcigettext.c Sun Apr 28 17:01:51 2002 *************** *** 0 **** --- 1,1168 ---- + /* 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[] attribute_hidden = "messages"; + + /* Value used as the default domain for gettext(3). */ + const char *_nl_current_default_domain attribute_hidden + = _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 attribute_hidden) + #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 -crN gawk-3.1.0/intl/dcngettext.c gawk-3.1.1/intl/dcngettext.c *** gawk-3.1.0/intl/dcngettext.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/dcngettext.c Sun Apr 28 17:01:51 2002 *************** *** 0 **** --- 1,61 ---- + /* Implementation of the dcngettext(3) function. + Copyright (C) 1995-1999, 2000, 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. */ + + #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. */ + INTDEF(__dcngettext) + weak_alias (__dcngettext, dcngettext); + #endif diff -crN gawk-3.1.0/intl/dgettext.c gawk-3.1.1/intl/dgettext.c *** gawk-3.1.0/intl/dgettext.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/dgettext.c Sun Apr 28 17:01:51 2002 *************** *** 0 **** --- 1,59 ---- + /* Implementation of the dgettext(3) function. + Copyright (C) 1995-1997, 2000, 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. */ + + #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 INTUSE(__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 -crN gawk-3.1.0/intl/dngettext.c gawk-3.1.1/intl/dngettext.c *** gawk-3.1.0/intl/dngettext.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/dngettext.c Sun Apr 28 17:01:51 2002 *************** *** 0 **** --- 1,61 ---- + /* Implementation of the dngettext(3) function. + Copyright (C) 1995-1997, 2000, 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. */ + + #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 INTUSE(__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 -crN gawk-3.1.0/intl/eval-plural.h gawk-3.1.1/intl/eval-plural.h *** gawk-3.1.0/intl/eval-plural.h Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/eval-plural.h Sun Apr 28 17:01:51 2002 *************** *** 0 **** --- 1,106 ---- + /* Plural expression evaluation. + 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. */ + + #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 -crN gawk-3.1.0/intl/explodename.c gawk-3.1.1/intl/explodename.c *** gawk-3.1.0/intl/explodename.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/explodename.c Sun Apr 28 17:01:52 2002 *************** *** 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 -crN gawk-3.1.0/intl/finddomain.c gawk-3.1.1/intl/finddomain.c *** gawk-3.1.0/intl/finddomain.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/finddomain.c Sun Apr 28 17:01:52 2002 *************** *** 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 -crN gawk-3.1.0/intl/gettext.c gawk-3.1.1/intl/gettext.c *** gawk-3.1.0/intl/gettext.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/gettext.c Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,64 ---- + /* Implementation of gettext(3) function. + Copyright (C) 1995, 1997, 2000, 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. */ + + #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 INTUSE(__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 -crN gawk-3.1.0/intl/gettextP.h gawk-3.1.1/intl/gettextP.h *** gawk-3.1.0/intl/gettextP.h Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/gettextP.h Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,205 ---- + /* Header describing internals of libintl library. + Copyright (C) 1995-1999, 2000-2002 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 + + #ifndef attribute_hidden + # define attribute_hidden + #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 -crN gawk-3.1.0/intl/gmo.h gawk-3.1.1/intl/gmo.h *** gawk-3.1.0/intl/gmo.h Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/gmo.h Sun Apr 28 17:01:52 2002 *************** *** 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 -crN gawk-3.1.0/intl/hash-string.h gawk-3.1.1/intl/hash-string.h *** gawk-3.1.0/intl/hash-string.h Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/hash-string.h Sun Apr 28 17:01:52 2002 *************** *** 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 -crN gawk-3.1.0/intl/intl-compat.c gawk-3.1.1/intl/intl-compat.c *** gawk-3.1.0/intl/intl-compat.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/intl-compat.c Sun Apr 28 17:01:52 2002 *************** *** 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 -crN gawk-3.1.0/intl/l10nflist.c gawk-3.1.1/intl/l10nflist.c *** gawk-3.1.0/intl/l10nflist.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/l10nflist.c Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,409 ---- + /* Copyright (C) 1995-1999, 2000, 2001, 2002 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) + #else + # ifdef _LIBC + # define __argz_count(argz, len) INTUSE(__argz_count) (argz, len) + # endif + #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) + #else + # ifdef _LIBC + # define __argz_stringify(argz, len, sep) \ + INTUSE(__argz_stringify) (argz, len, sep) + # endif + #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 -crN gawk-3.1.0/intl/libgnuintl.h gawk-3.1.1/intl/libgnuintl.h *** gawk-3.1.0/intl/libgnuintl.h Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/libgnuintl.h Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,138 ---- + /* Message catalogs for internationalization. + Copyright (C) 1995-1997, 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. */ + + #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 (or _LOCALE_H in Solaris 2.5) + 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 || (defined _LOCALE_H && defined __sun)) + # 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 -crN gawk-3.1.0/intl/loadinfo.h gawk-3.1.1/intl/loadinfo.h *** gawk-3.1.0/intl/loadinfo.h Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/loadinfo.h Sun Apr 28 17:01:52 2002 *************** *** 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 -crN gawk-3.1.0/intl/loadmsgcat.c gawk-3.1.1/intl/loadmsgcat.c *** gawk-3.1.0/intl/loadmsgcat.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/loadmsgcat.c Sun Apr 28 17:01:52 2002 *************** *** 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 -crN gawk-3.1.0/intl/localcharset.c gawk-3.1.1/intl/localcharset.c *** gawk-3.1.0/intl/localcharset.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/localcharset.c Sun Apr 28 17:01:52 2002 *************** *** 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 -crN gawk-3.1.0/intl/locale.alias gawk-3.1.1/intl/locale.alias *** gawk-3.1.0/intl/locale.alias Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/locale.alias Sun Apr 28 17:01:52 2002 *************** *** 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 -crN gawk-3.1.0/intl/localealias.c gawk-3.1.1/intl/localealias.c *** gawk-3.1.0/intl/localealias.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/localealias.c Sun Apr 28 17:01:52 2002 *************** *** 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 -crN gawk-3.1.0/intl/localename.c gawk-3.1.1/intl/localename.c *** gawk-3.1.0/intl/localename.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/localename.c Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,694 ---- + /* Determine the current selected locale. + 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. */ + + /* 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 -crN gawk-3.1.0/intl/ngettext.c gawk-3.1.1/intl/ngettext.c *** gawk-3.1.0/intl/ngettext.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/ngettext.c Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,68 ---- + /* Implementation of ngettext(3) function. + Copyright (C) 1995, 1997, 2000, 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. */ + + #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 INTUSE(__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 -crN gawk-3.1.0/intl/os2compat.c gawk-3.1.1/intl/os2compat.c *** gawk-3.1.0/intl/os2compat.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/os2compat.c Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,98 ---- + /* 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 + #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; + } + + /* A fixed size buffer. */ + char _nl_default_dirname__[MAXPATHLEN+1]; + + char *_nlos2_libdir = NULL; + char *_nlos2_localealiaspath = NULL; + char *_nlos2_localedir = NULL; + + static __attribute__((constructor)) void + nlos2_initialize () + { + char *root = getenv ("UNIXROOT"); + char *gnulocaledir = getenv ("GNULOCALEDIR"); + + _nlos2_libdir = gnulocaledir; + if (!_nlos2_libdir) + { + if (root) + { + size_t sl = strlen (root); + _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1); + memcpy (_nlos2_libdir, root, sl); + memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1); + } + else + _nlos2_libdir = LIBDIR; + } + + _nlos2_localealiaspath = gnulocaledir; + if (!_nlos2_localealiaspath) + { + if (root) + { + size_t sl = strlen (root); + _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1); + memcpy (_nlos2_localealiaspath, root, sl); + memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1); + } + else + _nlos2_localealiaspath = LOCALE_ALIAS_PATH; + } + + _nlos2_localedir = gnulocaledir; + if (!_nlos2_localedir) + { + if (root) + { + size_t sl = strlen (root); + _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1); + memcpy (_nlos2_localedir, root, sl); + memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1); + } + else + _nlos2_localedir = LOCALEDIR; + } + + if (strlen (_nlos2_localedir) <= MAXPATHLEN) + strcpy (_nl_default_dirname__, _nlos2_localedir); + } diff -crN gawk-3.1.0/intl/os2compat.h gawk-3.1.1/intl/os2compat.h *** gawk-3.1.0/intl/os2compat.h Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/os2compat.h Sun Apr 28 17:01:52 2002 *************** *** 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 _nlos2_libdir + extern char *_nlos2_libdir; + + #undef LOCALEDIR + #define LOCALEDIR _nlos2_localedir + extern char *_nlos2_localedir; + + #undef LOCALE_ALIAS_PATH + #define LOCALE_ALIAS_PATH _nlos2_localealiaspath + extern char *_nlos2_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 -crN gawk-3.1.0/intl/osdep.c gawk-3.1.1/intl/osdep.c *** gawk-3.1.0/intl/osdep.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/osdep.c Sun Apr 28 17:01:52 2002 *************** *** 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 -crN gawk-3.1.0/intl/plural-exp.c gawk-3.1.1/intl/plural-exp.c *** gawk-3.1.0/intl/plural-exp.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/plural-exp.c Sun Apr 28 17:01:52 2002 *************** *** 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 -crN gawk-3.1.0/intl/plural-exp.h gawk-3.1.1/intl/plural-exp.h *** gawk-3.1.0/intl/plural-exp.h Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/plural-exp.h Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,126 ---- + /* Expression parsing and evaluation for plural form selection. + Copyright (C) 2000, 2001, 2002 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 + + #ifndef attribute_hidden + # define attribute_hidden + #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 attribute_hidden; + 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 -crN gawk-3.1.0/intl/plural.c gawk-3.1.1/intl/plural.c *** gawk-3.1.0/intl/plural.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/plural.c Sun Apr 28 17:01:54 2002 *************** *** 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 -crN gawk-3.1.0/intl/plural.y gawk-3.1.1/intl/plural.y *** gawk-3.1.0/intl/plural.y Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/plural.y Sun Apr 28 17:01:52 2002 *************** *** 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 -crN gawk-3.1.0/intl/ref-add.sin gawk-3.1.1/intl/ref-add.sin *** gawk-3.1.0/intl/ref-add.sin Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/ref-add.sin Sun Apr 28 17:01:52 2002 *************** *** 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 -crN gawk-3.1.0/intl/ref-del.sin gawk-3.1.1/intl/ref-del.sin *** gawk-3.1.0/intl/ref-del.sin Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/ref-del.sin Sun Apr 28 17:01:52 2002 *************** *** 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 -crN gawk-3.1.0/intl/textdomain.c gawk-3.1.1/intl/textdomain.c *** gawk-3.1.0/intl/textdomain.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/intl/textdomain.c Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,142 ---- + /* Implementation of the textdomain(3) function. + Copyright (C) 1995-1998, 2000, 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. */ + + #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[] attribute_hidden; + + /* Default text domain in which entries for gettext(3) are to be found. */ + extern const char *_nl_current_default_domain attribute_hidden; + + + /* 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 attribute_hidden) + + /* 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 -crN gawk-3.1.0/io.c gawk-3.1.1/io.c *** gawk-3.1.0/io.c Tue Apr 24 14:35:35 2001 --- gawk-3.1.1/io.c Tue Apr 16 14:57:44 2002 *************** *** 3,9 **** */ /* ! * Copyright (C) 1976, 1988, 1989, 1991-2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. --- 3,9 ---- */ /* ! * Copyright (C) 1976, 1988, 1989, 1991-2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. *************** *** 57,64 **** #endif /* HAVE_NETDB_H */ #endif /* HAVE_SOCKETS */ ! #if ! defined(S_ISREG) && defined(S_IFREG) ! #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif #ifndef ENFILE --- 57,64 ---- #endif /* HAVE_NETDB_H */ #endif /* HAVE_SOCKETS */ ! #ifdef __EMX__ ! #include #endif #ifndef ENFILE *************** *** 88,94 **** #include #endif ! #if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(TANDEM) #define PIPES_SIMULATED #endif --- 88,94 ---- #include #endif ! #if defined(MSDOS) || defined(WIN32) || defined(TANDEM) #define PIPES_SIMULATED #endif *************** *** 135,141 **** static jmp_buf filebuf; /* for do_nextfile() */ ! #if defined(MSDOS) || defined(OS2) static const char * binmode(char *mode) { --- 135,141 ---- static jmp_buf filebuf; /* for do_nextfile() */ ! #if defined(MSDOS) || defined(OS2) || defined(__EMX__) static const char * binmode(char *mode) { *************** *** 336,342 **** fields_arr[0] = t; reset_record(); } ! free(iop->buf); } if ((iop->flag & IOP_NOFREE_OBJ) == 0) free((char *) iop); --- 336,342 ---- fields_arr[0] = t; reset_record(); } ! free(iop->buf); } if ((iop->flag & IOP_NOFREE_OBJ) == 0) free((char *) iop); *************** *** 595,601 **** /* too many files open -- close one and try again */ if (errno == EMFILE || errno == ENFILE) close_one(); ! #if defined __MINGW32__ || defined solaris else if (errno == 0) /* HACK! */ close_one(); #endif --- 595,601 ---- /* too many files open -- close one and try again */ if (errno == EMFILE || errno == ENFILE) close_one(); ! #if defined __MINGW32__ || defined __sun else if (errno == 0) /* HACK! */ close_one(); #endif *************** *** 1223,1229 **** /* * The remote port ends the special file name. * This means there already is a 0 at the end of the string. ! * Therefore no need to patch any string ending. * * Here too, require a port, let them explicitly put 0 if * they don't care. --- 1223,1229 ---- /* * The remote port ends the special file name. * This means there already is a 0 at the end of the string. ! * Therefore no need to patch any string ending. * * Here too, require a port, let them explicitly put 0 if * they don't care. *************** *** 1355,1364 **** { char tbuf[BUFSIZ], *cp; int i; - #if defined(NGROUPS_MAX) && NGROUPS_MAX > 0 - GETGROUPS_T groupset[NGROUPS_MAX]; - int ngroups; - #endif warning(_("use `PROCINFO[...]' instead of `/dev/user'")); --- 1355,1360 ---- *************** *** 1366,1375 **** cp = tbuf + strlen(tbuf); #if defined(NGROUPS_MAX) && NGROUPS_MAX > 0 - ngroups = getgroups(NGROUPS_MAX, groupset); - if (ngroups == -1) - fatal(_("could not find groups: %s"), strerror(errno)); - for (i = 0; i < ngroups; i++) { *cp++ = ' '; sprintf(cp, "%d", (int) groupset[i]); --- 1362,1367 ---- *************** *** 1445,1451 **** if (os_isdir(openfd)) fatal(_("file `%s' is a directory"), name); ! os_close_on_exec(openfd, name, "file", ""); } return iop_alloc(openfd, name, iop); } --- 1437,1444 ---- if (os_isdir(openfd)) fatal(_("file `%s' is a directory"), name); ! if (openfd > fileno(stderr)) ! os_close_on_exec(openfd, name, "file", ""); } return iop_alloc(openfd, name, iop); } *************** *** 1519,1524 **** --- 1512,1520 ---- int ptoc[2], ctop[2]; int pid; int save_errno; + #ifdef __EMX__ + int save_stdout, save_stdin; + #endif if (pipe(ptoc) < 0) return FALSE; /* errno set, diagnostic from caller */ *************** *** 1531,1536 **** --- 1527,1591 ---- return FALSE; } + #ifdef __EMX__ + save_stdin = dup(0); /* duplicate stdin */ + save_stdout = dup(1); /* duplicate stdout */ + + if (save_stdout == -1 || save_stdin == -1) { + /* if an error occurrs close all open file handles */ + save_errno = errno; + if (save_stdin != -1) + close(save_stdin); + if (save_stdout != -1) + close(save_stdout); + close(ptoc[0]); close(ptoc[1]); + close(ctop[0]); close(ctop[1]); + errno = save_errno; + return FALSE; + } + + /* connect pipes to stdin and stdout */ + close(1); /* close stdout */ + if (dup(ctop[1]) != 1) /* connect pipe input to stdout */ + fatal(_("moving pipe to stdout in child failed (dup: %s)"), strerror(errno)); + + close(0); /* close stdin */ + if (dup(ptoc[0]) != 0) /* connect pipe output to stdin */ + fatal(_("moving pipe to stdin in child failed (dup: %s)"), strerror(errno)); + + /* none of these handles must be inherited by the child process */ + (void) close(ptoc[0]); /* close pipe output, child will use stdin instead */ + (void) close(ctop[1]); /* close pipe input, child will use stdout instead */ + + os_close_on_exec(ptoc[1], str, "pipe", "from"); /* pipe input: output of the parent process */ + os_close_on_exec(ctop[0], str, "pipe", "from"); /* pipe output: input of the parent process */ + os_close_on_exec(save_stdin, str, "pipe", "from"); /* saved stdin of the parent process */ + os_close_on_exec(save_stdout, str, "pipe", "from"); /* saved stdout of the parent process */ + + /* stderr does NOT get dup'ed onto child's stdout */ + pid = spawnl(P_NOWAIT, "/bin/sh", "sh", "-c", str, NULL); + + /* restore stdin and stdout */ + close(1); + if (dup(save_stdout) != 1) + fatal(_("restoring stdout in parent process failed\n")); + close(save_stdout); + + close(0); + if (dup(save_stdin) != 0) + fatal(_("restoring stdin in parent process failed\n")); + close(save_stdin); + + if (pid < 0) { /* spawnl() failed */ + save_errno = errno; + close(ptoc[1]); + close(ctop[0]); + + errno = save_errno; + return FALSE; + } + + #else /* NOT __EMX__ */ if ((pid = fork()) < 0) { save_errno = errno; close(ptoc[0]); close(ptoc[1]); *************** *** 1557,1562 **** --- 1612,1618 ---- execl("/bin/sh", "sh", "-c", str, NULL); _exit(127); } + #endif /* NOT __EMX__ */ /* parent */ rp->pid = pid; *************** *** 1567,1572 **** --- 1623,1629 ---- (void) close(ptoc[0]); (void) close(ptoc[1]); (void) kill(pid, SIGKILL); /* overkill? (pardon pun) */ + return FALSE; } rp->fp = fdopen(ptoc[1], "w"); *************** *** 1578,1595 **** (void) close(ptoc[0]); (void) close(ptoc[1]); (void) kill(pid, SIGKILL); /* overkill? (pardon pun) */ return FALSE; } ! if (fcntl(ctop[0], F_SETFD, 1) < 0) { ! warning(_("pipe from `%s': could not set close-on-exec (fcntl: %s)"), ! str, strerror(errno));; ! } ! if (fcntl(ptoc[1], F_SETFD, 1) < 0) { ! warning(_("pipe to `%s': could not set close-on-exec (fcntl: %s)"), ! str, strerror(errno));; ! } (void) close(ptoc[0]); (void) close(ctop[1]); return TRUE; } --- 1635,1652 ---- (void) close(ptoc[0]); (void) close(ptoc[1]); (void) kill(pid, SIGKILL); /* overkill? (pardon pun) */ + return FALSE; } ! ! #ifndef __EMX__ ! os_close_on_exec(ctop[0], str, "pipe", "from"); ! os_close_on_exec(ptoc[1], str, "pipe", "from"); ! (void) close(ptoc[0]); (void) close(ctop[1]); + #endif + return TRUE; } *************** *** 1650,1655 **** --- 1707,1715 ---- { int p[2]; register int pid; + #ifdef __EMX__ + int save_stdout; + #endif /* * used to wait for any children to synchronize input and output, *************** *** 1660,1665 **** --- 1720,1751 ---- if (pipe(p) < 0) fatal(_("cannot open pipe `%s' (%s)"), cmd, strerror(errno)); + + #ifdef __EMX__ + save_stdout = dup(1); /* save stdout */ + rp->iop = NULL; + if (save_stdout == -1) + return rp->iop; /* failed */ + + close(1); /* close stdout */ + if (dup(p[1]) != 1) + fatal(_("moving pipe to stdout in child failed (dup: %s)"), strerror(errno)); + + /* none of these handles must be inherited by the child process */ + close(p[1]); /* close pipe input */ + + os_close_on_exec(p[0], cmd, "pipe", "from"); /* pipe output: input of the parent process */ + os_close_on_exec(save_stdout, cmd, "pipe", "from"); /* saved stdout of the parent process */ + + pid = spawnl(P_NOWAIT, "/bin/sh", "sh", "-c", cmd, NULL); + + /* restore stdout */ + close(1); + if (dup(save_stdout) != 1) + fatal(_("restoring stdout in parent process failed\n")); + close(save_stdout); + + #else /* NOT __EMX__ */ if ((pid = fork()) == 0) { if (close(1) == -1) fatal(_("close of stdout in child failed (%s)"), *************** *** 1671,1685 **** --- 1757,1776 ---- execl("/bin/sh", "sh", "-c", cmd, NULL); _exit(127); } + #endif /* NOT __EMX__ */ + if (pid == -1) fatal(_("cannot create child process for `%s' (fork: %s)"), cmd, strerror(errno)); rp->pid = pid; + #ifndef __EMX__ if (close(p[1]) == -1) fatal(_("close of pipe failed (%s)"), strerror(errno)); + #endif os_close_on_exec(p[0], cmd, "pipe", "from"); rp->iop = iop_alloc(p[0], cmd, NULL); if (rp->iop == NULL) (void) close(p[0]); + return (rp->iop); } *************** *** 1707,1713 **** * except if popen() provides real pipes too */ ! #if defined(VMS) || defined(OS2) || defined (MSDOS) || defined(WIN32) || defined(TANDEM) /* gawk_popen --- open an IOBUF on a child process */ --- 1798,1804 ---- * except if popen() provides real pipes too */ ! #if defined(VMS) || defined(OS2) || defined (MSDOS) || defined(WIN32) || defined(TANDEM) || defined(__EMX__) /* gawk_popen --- open an IOBUF on a child process */ *************** *** 1923,1930 **** static const char *savepath = NULL; static int first = TRUE; const char *awkpath; ! char *cp, trypath[BUFSIZ]; int fd; if (STREQ(file, "-")) return (0); --- 2014,2022 ---- static const char *savepath = NULL; static int first = TRUE; const char *awkpath; ! char *cp, *trypath; int fd; + int len; if (STREQ(file, "-")) return (0); *************** *** 1945,1953 **** if (ispath(file)) return (devopen(file, "r")); do { trypath[0] = '\0'; ! /* this should take into account limits on size of trypath */ for (cp = trypath; *awkpath && *awkpath != envsep; ) *cp++ = *awkpath++; --- 2037,2049 ---- if (ispath(file)) return (devopen(file, "r")); + /* no arbitrary limits: */ + len = strlen(awkpath) + strlen(file) + 2; + emalloc(trypath, char *, len, "do_pathopen"); + do { trypath[0] = '\0'; ! for (cp = trypath; *awkpath && *awkpath != envsep; ) *cp++ = *awkpath++; *************** *** 1959,1971 **** strcpy(cp, file); } else strcpy(trypath, file); ! if ((fd = devopen(trypath, "r")) > INVALID_HANDLE) return (fd); /* no luck, keep going */ if(*awkpath == envsep && awkpath[1] != '\0') awkpath++; /* skip colon */ } while (*awkpath != '\0'); /* * You might have one of the awk paths defined, WITHOUT the current * working directory in it. Therefore try to open the file in the --- 2055,2071 ---- strcpy(cp, file); } else strcpy(trypath, file); ! if ((fd = devopen(trypath, "r")) > INVALID_HANDLE) { ! free(trypath); return (fd); + } /* no luck, keep going */ if(*awkpath == envsep && awkpath[1] != '\0') awkpath++; /* skip colon */ } while (*awkpath != '\0'); + free(trypath); + /* * You might have one of the awk paths defined, WITHOUT the current * working directory in it. Therefore try to open the file in the *************** *** 2053,2058 **** --- 2153,2162 ---- Regexp *rsre = NULL; int continuing = FALSE, continued = FALSE; /* used for re matching */ int onecase; + #ifdef MBS_SUPPORT + size_t mbclen = 0; + mbstate_t mbs; + #endif #ifdef TANDEM char *mend; *************** *** 2286,2291 **** --- 2390,2401 ---- */ while (*start == '\n' && start < iop->end) start++; + /* if file is nothing but newlines, no record found */ + if (iop->cnt == EOF && start >= iop->end) { + *out = NULL; + set_RT_to_null(); + return EOF; + } goto again; } bp = start + RESTART(rsre, start); *************** *** 2295,2300 **** --- 2405,2429 ---- break; } /* search for RS, #2, RS = */ + #ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1) { + int len = iop->end - bp + 1; + int found = 0; + memset(&mbs, 0, sizeof(mbstate_t)); + do { + if (onecase ? casetable[(int) *bp] == rs : *bp == rs) + found = 1; + mbclen = mbrlen(bp, len, &mbs); + if ((mbclen == 1) || (mbclen == (size_t) -1) + || (mbclen == (size_t) -2) || (mbclen == 0)) { + /* We treat it as a singlebyte character. */ + mbclen = 1; + } + len -= mbclen; + bp += mbclen; + } while (len > 0 && !found); + } else + #endif if (onecase) { while (casetable[(unsigned char) *bp++] != rs && not_past_end()) continue; diff -crN gawk-3.1.0/m4/ChangeLog gawk-3.1.1/m4/ChangeLog *** gawk-3.1.0/m4/ChangeLog Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/m4/ChangeLog Wed May 1 16:42:01 2002 *************** *** 0 **** --- 1,14 ---- + Wed May 1 16:41:32 2002 Arnold D. Robbins + + * Release 3.1.1: Release tar file made. + + 2002-04-28 gettextize + + * gettext.m4: Upgrade to gettext-0.11.2. + * isc-posix.m4: Upgrade to gettext-0.11.2. + * lib-link.m4: Upgrade to gettext-0.11.2. + + 2002-04-09 gettextize + + * gettext.m4: Upgrade to gettext-0.11.1. + diff -crN gawk-3.1.0/m4/codeset.m4 gawk-3.1.1/m4/codeset.m4 *** gawk-3.1.0/m4/codeset.m4 Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/m4/codeset.m4 Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,23 ---- + # codeset.m4 serial AM1 (gettext-0.10.40) + dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + + 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 -crN gawk-3.1.0/m4/gettext.m4 gawk-3.1.1/m4/gettext.m4 *** gawk-3.1.0/m4/gettext.m4 Sun Jan 28 15:56:08 2001 --- gawk-3.1.1/m4/gettext.m4 Sun Apr 28 17:01:52 2002 *************** *** 1,29 **** ! # 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 Public License ! # but which still want to provide support for the GNU gettext functionality. ! # Please note that the actual code is *not* freely available. ! ! # serial 107 ! ! AC_PREREQ(2.13) dnl Minimum Autoconf version required. ! ! 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) ! USE_INCLUDED_LIBINTL=no ! dnl If we use NLS figure out what method ! if test "$USE_NLS" = "yes"; then ! AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS 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], --- 1,100 ---- ! # gettext.m4 serial 14 (gettext-0.11.2) ! dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. ! dnl This file is free software, distributed under the terms of the GNU ! dnl General Public License. As a special exception to the GNU General ! dnl Public License, this file may be distributed as part of a program ! dnl that contains a configuration script generated by Autoconf, under ! dnl the same distribution terms as the rest of that program. ! dnl ! dnl This file can can be used in projects which are not available under ! dnl the GNU General Public License or the GNU Library General Public ! dnl License but which still want to provide support for the GNU gettext ! dnl functionality. ! dnl Please note that the actual code of the GNU gettext library is covered ! dnl by the GNU Library General Public License, and the rest of the GNU ! dnl gettext package package is covered by the GNU General Public License. ! dnl They are *not* in the public domain. ! ! dnl Authors: ! dnl Ulrich Drepper , 1995-2000. ! dnl Bruno Haible , 2000-2002. ! ! dnl Macro to add for using GNU gettext. ! ! dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). ! dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The ! dnl default (if it is not specified or empty) is 'no-libtool'. ! dnl INTLSYMBOL should be 'external' for packages with no intl directory, ! dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. ! dnl If INTLSYMBOL 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). If INTLSYMBOL is 'no-libtool', 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 INTLDIR 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 If INTLSYMBOL is 'external', only cases 2 and 3 can occur. ! 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_GNU_GETTEXT], ! [ ! dnl Argument checking. ! ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , ! [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ! ])])])])]) ! ifelse([$2], [], , [ifelse([$2], [need-ngettext], , ! [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ! ])])]) ! define(gt_included_intl, ifelse([$1], [external], [no], [yes])) ! define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) ! ! AC_REQUIRE([AM_PO_SUBDIRS])dnl ! ifelse(gt_included_intl, yes, [ ! AC_REQUIRE([AM_INTL_SUBDIR])dnl ! ]) ! dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. ! AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) ! AC_REQUIRE([AC_LIB_RPATH]) ! ! 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) ! ifelse(gt_included_intl, yes, [ ! BUILD_INCLUDED_LIBINTL=no ! USE_INCLUDED_LIBINTL=no ! ]) ! LIBINTL= ! LTLIBINTL= ! POSUB= ! ! dnl If we use NLS figure out what method ! if test "$USE_NLS" = "yes"; then ! gt_use_preinstalled_gnugettext=no ! ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH(included-gettext, [ --with-included-gettext use the GNU gettext library included here], *************** *** 33,322 **** 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 gettext or catgets are available (in this order) we ! dnl use this. Else we have to fall back to GNU NLS library. ! dnl catgets is only used if permitted by option --with-catgets. ! nls_cv_header_intl= ! nls_cv_header_libgt= ! CATOBJEXT=NONE ! ! AC_CHECK_HEADER(libintl.h, ! [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, ! [AC_TRY_LINK([#include ], [return (int) gettext ("")], ! gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) ! ! if test "$gt_cv_func_gettext_libc" != "yes"; then ! AC_CHECK_LIB(intl, bindtextdomain, ! [AC_CHECK_LIB(intl, gettext)]) ! fi ! ! if test "$gt_cv_func_gettext_libc" = "yes" \ ! || test "$ac_cv_lib_intl_gettext" = "yes"; then ! AC_DEFINE(HAVE_GETTEXT, 1, ! [Define to 1 if you have gettext and don't want to use GNU gettext.]) ! AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, ! [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl ! if test "$MSGFMT" != "no"; then ! AC_CHECK_FUNCS(dcgettext) ! AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) ! AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, ! [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) ! AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; ! return _nl_msg_cat_cntr], ! [CATOBJEXT=.gmo ! DATADIRNAME=share], ! [CATOBJEXT=.mo ! DATADIRNAME=lib]) ! INSTOBJEXT=.mo ! fi ! fi ! ]) ! ! if test "$CATOBJEXT" = "NONE"; then ! AC_MSG_CHECKING([whether catgets can be used]) ! AC_ARG_WITH(catgets, ! [ --with-catgets use catgets functions if available], ! nls_cv_use_catgets=$withval, nls_cv_use_catgets=no) ! AC_MSG_RESULT($nls_cv_use_catgets) ! ! if test "$nls_cv_use_catgets" = "yes"; then ! dnl No gettext in C library. Try catgets next. ! AC_CHECK_LIB(i, main) ! AC_CHECK_FUNC(catgets, ! [AC_DEFINE(HAVE_CATGETS, 1, ! [Define as 1 if you have catgets and don't want to use GNU gettext.]) ! INTLOBJS="\$(CATOBJS)" ! AC_PATH_PROG(GENCAT, gencat, no)dnl ! if test "$GENCAT" != "no"; then ! AC_PATH_PROG(GMSGFMT, gmsgfmt, no) ! if test "$GMSGFMT" = "no"; then ! AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt, ! [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no) ! fi ! AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, ! [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) ! USE_INCLUDED_LIBINTL=yes ! CATOBJEXT=.cat ! INSTOBJEXT=.cat ! DATADIRNAME=lib ! INTLDEPS='$(top_builddir)/intl/libintl.a' ! INTLLIBS=$INTLDEPS ! LIBS=`echo $LIBS | sed -e 's/-lintl//'` ! nls_cv_header_intl=intl/libintl.h ! nls_cv_header_libgt=intl/libgettext.h ! fi]) ! fi fi ! if (test "$gt_cv_func_gettext_libc" = "yes" \ ! || test "$gt_cv_func_gettext_libintl" = "yes") \ ! && test "$ac_cv_func_dcgettext" = no; then ! dnl gettext is there but dcgettext is not ! nls_cv_use_gnu_gettext=yes ! elif test "$CATOBJEXT" = "NONE"; then ! dnl Neither gettext nor catgets in included 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, ! [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) ! AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) ! AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, ! [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) ! AC_SUBST(MSGFMT) ! USE_INCLUDED_LIBINTL=yes ! CATOBJEXT=.gmo ! INSTOBJEXT=.mo ! DATADIRNAME=share ! INTLDEPS='$(top_builddir)/intl/libintl.a' ! INTLLIBS=$INTLDEPS ! LIBS=`echo $LIBS | sed -e 's/-lintl//'` ! nls_cv_header_intl=intl/libintl.h ! nls_cv_header_libgt=intl/libgettext.h fi ! 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 2> /dev/null; then ! : ; ! else ! AC_MSG_RESULT( ! [found xgettext program is not GNU xgettext; ignore it]) ! XGETTEXT=":" ! fi fi ! # We need to process the po/ directory. ! POSUB=po else ! DATADIRNAME=share ! nls_cv_header_intl=intl/libintl.h ! nls_cv_header_libgt=intl/libgettext.h fi ! if test -z "$nls_cv_header_intl"; then ! # Clean out junk possibly left behind by a previous configuration. ! rm -f intl/libintl.h ! fi ! AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) ! AC_OUTPUT_COMMANDS( ! [case "$CONFIG_FILES" in *po/Makefile.in*) ! sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile ! esac]) ! # If this is used in GNU gettext we have to set USE_NLS to `yes' ! # because some of the sources are only built for this goal. ! if test "$PACKAGE" = gettext; then ! USE_NLS=yes ! USE_INCLUDED_LIBINTL=yes 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(USE_INCLUDED_LIBINTL) - AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) AC_SUBST(DATADIRNAME) ! AC_SUBST(GMOFILES) AC_SUBST(INSTOBJEXT) - AC_SUBST(INTLDEPS) - AC_SUBST(INTLLIBS) - AC_SUBST(INTLOBJS) - AC_SUBST(POFILES) - AC_SUBST(POSUB) - ]) ! AC_DEFUN(AM_GNU_GETTEXT, ! [AC_REQUIRE([AC_PROG_MAKE_SET])dnl ! AC_REQUIRE([AC_PROG_CC])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_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ ! unistd.h sys/param.h]) ! AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ ! strdup __argz_count __argz_stringify __argz_next]) ! ! if test "${ac_cv_func_stpcpy+set}" != "set"; then ! AC_CHECK_FUNCS(stpcpy) ! fi ! if test "${ac_cv_func_stpcpy}" = "yes"; then ! AC_DEFINE(HAVE_STPCPY, 1, [Define to 1 if you have the stpcpy function.]) ! fi ! ! AM_LC_MESSAGES ! AM_WITH_NLS ! ! 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 lang in ${LINGUAS=$ALL_LINGUAS}; do ! case "$ALL_LINGUAS" in ! *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; ! esac ! 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 The reference to in the installed file ! dnl must be resolved because we cannot expect the users of this ! dnl to define HAVE_LOCALE_H. ! if test $ac_cv_header_locale_h = yes; then ! INCLUDE_LOCALE_H="#include " ! else ! INCLUDE_LOCALE_H="\ ! /* The system does not provide the header . Take care yourself. */" ! fi ! AC_SUBST(INCLUDE_LOCALE_H) ! ! dnl Determine which catalog format we have (if any is needed) ! dnl For now we know about two different formats: ! dnl Linux libc-5 and the normal X/Open format ! test -d intl || mkdir intl ! if test "$CATOBJEXT" = ".cat"; then ! AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) ! ! dnl Transform the SED scripts while copying because some dumb SEDs ! dnl cannot handle comments. ! sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed ! fi ! dnl po2tbl.sed is always needed. ! sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ ! $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed ! ! dnl In the intl/Makefile.in we have a special dependency which makes ! dnl only sense for gettext. We comment this out for non-gettext ! dnl packages. ! if test "$PACKAGE" = "gettext"; then ! GT_NO="#NO#" ! GT_YES= ! else ! GT_NO= ! GT_YES="#YES#" ! fi ! AC_SUBST(GT_NO) ! AC_SUBST(GT_YES) ! ! 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 *** For now the libtool support in intl/Makefile is not for real. ! l= ! AC_SUBST(l) ! ! dnl Generate list of files to be processed by xgettext which will ! dnl be included in po/Makefile. ! test -d po || mkdir po ! case "$srcdir" in ! .) ! posrcprefix="../" ;; ! /* | [[A-Za-z]]:*) ! posrcprefix="$srcdir/" ;; ! *) ! posrcprefix="../$srcdir/" ;; ! esac ! rm -f po/POTFILES ! sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ ! < $srcdir/po/POTFILES.in > po/POTFILES ]) --- 104,539 ---- 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. ! ! dnl Add a version number to the cache macros. ! define([gt_api_version], ifelse([$2], [need-ngettext], 2, 1)) ! define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) ! define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) ! ! AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, ! [AC_TRY_LINK([#include ! extern int _nl_msg_cat_cntr; ! extern int *_nl_domain_bindings;], ! [bindtextdomain ("", ""); ! return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], ! gt_cv_func_gnugettext_libc=yes, ! gt_cv_func_gnugettext_libc=no)]) ! ! if test "$gt_cv_func_gnugettext_libc" != "yes"; then ! dnl Sometimes libintl requires libiconv, so first search for libiconv. ! ifelse(gt_included_intl, yes, , [ ! AM_ICONV_LINK ! ]) ! dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL ! dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) ! dnl because that would add "-liconv" to LIBINTL and LTLIBINTL ! dnl even if libiconv doesn't exist. ! AC_LIB_LINKFLAGS_BODY([intl]) ! AC_CACHE_CHECK([for GNU gettext in libintl], ! gt_cv_func_gnugettext_libintl, ! [gt_save_CPPFLAGS="$CPPFLAGS" ! CPPFLAGS="$CPPFLAGS $INCINTL" ! gt_save_LIBS="$LIBS" ! LIBS="$LIBS $LIBINTL" ! dnl Now see whether libintl exists and does not depend on libiconv. ! AC_TRY_LINK([#include ! extern int _nl_msg_cat_cntr; ! extern ! #ifdef __cplusplus ! "C" ! #endif ! const char *_nl_expand_alias ();], ! [bindtextdomain ("", ""); ! return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], ! gt_cv_func_gnugettext_libintl=yes, ! gt_cv_func_gnugettext_libintl=no) ! dnl Now see whether libintl exists and depends on libiconv. ! if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then ! LIBS="$LIBS $LIBICONV" ! AC_TRY_LINK([#include ! extern int _nl_msg_cat_cntr; ! extern ! #ifdef __cplusplus ! "C" ! #endif ! const char *_nl_expand_alias ();], ! [bindtextdomain ("", ""); ! return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], ! [LIBINTL="$LIBINTL $LIBICONV" ! LTLIBINTL="$LTLIBINTL $LTLIBICONV" ! gt_cv_func_gnugettext_libintl=yes ! ]) ! fi ! CPPFLAGS="$gt_save_CPPFLAGS" ! 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 ! gt_use_preinstalled_gnugettext=yes ! else ! dnl Reset the values set by searching for libintl. ! LIBINTL= ! LTLIBINTL= ! INCINTL= fi ! ifelse(gt_included_intl, yes, [ ! if test "$gt_use_preinstalled_gnugettext" != "yes"; then ! dnl GNU gettext is not found in the C library. ! dnl Fall back on included 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)" ! BUILD_INCLUDED_LIBINTL=yes ! USE_INCLUDED_LIBINTL=yes ! LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" ! LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" ! LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi ! if test "$gt_use_preinstalled_gnugettext" = "yes" \ ! || test "$nls_cv_use_gnu_gettext" = "yes"; then ! dnl Mark actions to use GNU gettext tools. ! CATOBJEXT=.gmo fi + ]) ! if test "$gt_use_preinstalled_gnugettext" = "yes" \ ! || test "$nls_cv_use_gnu_gettext" = "yes"; then ! AC_DEFINE(ENABLE_NLS, 1, ! [Define to 1 if translation of program messages to the user's native language ! is requested.]) else ! USE_NLS=no fi ! fi + if test "$USE_NLS" = "yes"; then ! if test "$gt_use_preinstalled_gnugettext" = "yes"; then ! if test "$gt_cv_func_gnugettext_libintl" = "yes"; then ! AC_MSG_CHECKING([how to link with libintl]) ! AC_MSG_RESULT([$LIBINTL]) ! AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) ! fi ! ! dnl For backward compatibility. Some packages may be using this. ! AC_DEFINE(HAVE_GETTEXT, 1, ! [Define if the GNU gettext() function is already present or preinstalled.]) ! AC_DEFINE(HAVE_DCGETTEXT, 1, ! [Define if the GNU dcgettext() function is already present or preinstalled.]) fi ! dnl We need to process the po/ directory. ! POSUB=po ! fi ! ! ifelse(gt_included_intl, yes, [ ! 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 Make all variables we use known to autoconf. + AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATOBJEXT) + AC_SUBST(INTLOBJS) + + 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 Enable libtool support if the surrounding package wishes it. ! INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix ! AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) ]) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLLIBS="$LIBINTL" + AC_SUBST(INTLLIBS) + + dnl Make all documented variables known to autoconf. + AC_SUBST(LIBINTL) + AC_SUBST(LTLIBINTL) + AC_SUBST(POSUB) + ]) + + + dnl Checks for all prerequisites of the po subdirectory, + dnl except for USE_NLS. + AC_DEFUN([AM_PO_SUBDIRS], + [ + AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AM_MKINSTALLDIRS])dnl + + dnl Perform the following tests also if --disable-nls has been given, + dnl because they are needed for "make dist" to work. + + dnl Search for GNU msgfmt in the PATH. + dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. + dnl The second test excludes FreeBSD msgfmt. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + + dnl Search for GNU xgettext 0.11 or newer in the PATH. + dnl The first test excludes Solaris xgettext and early GNU xgettext versions. + dnl The second test excludes FreeBSD xgettext. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + + dnl Search for GNU msgmerge 0.11 or newer in the PATH. + AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, + [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) + + 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 && + (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` + AC_MSG_RESULT( + [found $GMSGFMT 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 --copyright-holder= /dev/null >/dev/null 2>&1 && + (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.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" + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend + # on $ac_dir but don't depend on user-specified configuration + # parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + fi + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac + POFILES= + GMOFILES= + UPDATEPOFILES= + DUMMYPOFILES= + for lang in $ALL_LINGUAS; do + POFILES="$POFILES $srcdirpre$lang.po" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" + DUMMYPOFILES="$DUMMYPOFILES $lang.nop" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "$LINGUAS"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; 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 + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do + if test -f "$f"; then + case "$f" in + *.orig | *.bak | *~) ;; + *) cat "$f" >> "$ac_dir/Makefile" ;; + esac + fi + done + fi + ;; + esac + done], + [# Capture the value of obsolete $ALL_LINGUAS because we need it to compute + # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it + # from automake. + eval 'ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of LINGUAS because we need it to compute CATALOGS. + LINGUAS="${LINGUAS-%UNSET%}" + ]) + ]) + + + dnl Checks for all prerequisites of the intl subdirectory, + dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, + dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. + AC_DEFUN([AM_INTL_SUBDIR], + [ + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AM_MKINSTALLDIRS])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 getc_unlocked getcwd getegid \ + geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \ + strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) + + AM_ICONV + AM_LANGINFO_CODESET + AM_LC_MESSAGES + + 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 + ]) + + + AC_DEFUN([AM_MKINSTALLDIRS], + [ + 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) + ]) diff -crN gawk-3.1.0/m4/glibc21.m4 gawk-3.1.1/m4/glibc21.m4 *** gawk-3.1.0/m4/glibc21.m4 Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/m4/glibc21.m4 Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,32 ---- + # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40) + dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + + # 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 -crN gawk-3.1.0/m4/iconv.m4 gawk-3.1.1/m4/iconv.m4 *** gawk-3.1.0/m4/iconv.m4 Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/m4/iconv.m4 Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,96 ---- + # iconv.m4 serial AM3 (gettext-0.11) + dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + + dnl From Bruno Haible. + + AC_DEFUN([AM_ICONV_LINK], + [ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([iconv]) + + dnl Add $INCICONV to CPPFLAGS before performing the following checks, + dnl because if the user has installed libiconv and not disabled its use + dnl via --without-libiconv-prefix, he wants to use it. The first + dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. + am_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) + + 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 $LIBICONV" + 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.]) + fi + if test "$am_cv_lib_iconv" = yes; then + AC_MSG_CHECKING([how to link with libiconv]) + AC_MSG_RESULT([$LIBICONV]) + else + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV + dnl either. + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + AC_SUBST(LIBICONV) + AC_SUBST(LTLIBICONV) + ]) + + AC_DEFUN([AM_ICONV], + [ + AC_REQUIRE([AM_ICONV_LINK]) + if test "$am_cv_func_iconv" = yes; then + 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 + ]) diff -crN gawk-3.1.0/m4/isc-posix.m4 gawk-3.1.1/m4/isc-posix.m4 *** gawk-3.1.0/m4/isc-posix.m4 Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/m4/isc-posix.m4 Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,26 ---- + # isc-posix.m4 serial 2 (gettext-0.11.2) + dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + + # This file is not needed with autoconf-2.53 and newer. Remove it in 2005. + + # 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 -crN gawk-3.1.0/m4/lcmessage.m4 gawk-3.1.1/m4/lcmessage.m4 *** gawk-3.1.0/m4/lcmessage.m4 Fri Jun 23 12:47:55 2000 --- gawk-3.1.1/m4/lcmessage.m4 Sun Apr 28 17:01:52 2002 *************** *** 1,22 **** ! # 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 Public License ! # but which still want to provide support for the GNU gettext functionality. ! # Please note that the actual code is *not* freely available. ! # serial 2 ! AC_PREREQ(2.13) dnl Minimum Autoconf version required. ! 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 locale.h file contains LC_MESSAGES.]) fi fi]) --- 1,32 ---- ! # lcmessage.m4 serial 2 (gettext-0.10.40) ! dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. ! dnl This file is free software, distributed under the terms of the GNU ! dnl General Public License. As a special exception to the GNU General ! dnl Public License, this file may be distributed as part of a program ! dnl that contains a configuration script generated by Autoconf, under ! dnl the same distribution terms as the rest of that program. ! dnl ! dnl This file can can be used in projects which are not available under ! dnl the GNU General Public License or the GNU Library General Public ! dnl License but which still want to provide support for the GNU gettext ! dnl functionality. ! dnl Please note that the actual code of the GNU gettext library is covered ! dnl by the GNU Library General Public License, and the rest of the GNU ! dnl gettext package package is covered by the GNU General Public License. ! dnl They are *not* in the public domain. ! dnl Authors: ! dnl Ulrich Drepper , 1995. ! # Check whether LC_MESSAGES is available in . ! 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 -crN gawk-3.1.0/m4/lib-ld.m4 gawk-3.1.1/m4/lib-ld.m4 *** gawk-3.1.0/m4/lib-ld.m4 Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/m4/lib-ld.m4 Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,97 ---- + # lib-ld.m4 serial 1 (gettext-0.11) + dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + + dnl Subroutines of libtool.m4, + dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision + dnl with libtool.m4. + + dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. + AC_DEFUN([AC_LIB_PROG_LD_GNU], + [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, + [# I'd rather use --version here, but apparently some GNU ld's only accept -v. + if $LD -v 2>&1 &5; then + acl_cv_prog_gnu_ld=yes + else + acl_cv_prog_gnu_ld=no + fi]) + with_gnu_ld=$acl_cv_prog_gnu_ld + ]) + + dnl From libtool-1.4. Sets the variable LD. + AC_DEFUN([AC_LIB_PROG_LD], + [AC_ARG_WITH(gnu-ld, + [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], + test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + ac_prog=ld + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]* | [A-Za-z]:[\\/]*)] + [re_direlt='/[^/][^/]*/\.\./'] + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) + else + AC_MSG_CHECKING([for non-GNU ld]) + fi + AC_CACHE_VAL(acl_cv_path_LD, + [if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" + else + acl_cv_path_LD="$LD" # Let the user override the test with a path. + fi]) + LD="$acl_cv_path_LD" + if test -n "$LD"; then + AC_MSG_RESULT($LD) + else + AC_MSG_RESULT(no) + fi + test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) + AC_LIB_PROG_LD_GNU + ]) diff -crN gawk-3.1.0/m4/lib-link.m4 gawk-3.1.1/m4/lib-link.m4 *** gawk-3.1.0/m4/lib-link.m4 Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/m4/lib-link.m4 Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,548 ---- + # lib-link.m4 serial 2 (gettext-0.11.2) + dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + + dnl From Bruno Haible. + + dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and + dnl the libraries corresponding to explicit and implicit dependencies. + dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and + dnl augments the CPPFLAGS variable. + AC_DEFUN([AC_LIB_LINKFLAGS], + [ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + ac_cv_lib[]Name[]_libs="$LIB[]NAME" + ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" + ac_cv_lib[]Name[]_cppflags="$INC[]NAME" + ]) + LIB[]NAME="$ac_cv_lib[]Name[]_libs" + LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" + INC[]NAME="$ac_cv_lib[]Name[]_cppflags" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the + dnl results of this search when this library appears as a dependency. + HAVE_LIB[]NAME=yes + undefine([Name]) + undefine([NAME]) + ]) + + dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) + dnl searches for libname and the libraries corresponding to explicit and + dnl implicit dependencies, together with the specified include files and + dnl the ability to compile and link the specified testcode. If found, it + dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and + dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and + dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs + dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. + AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], + [ + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + define([Name],[translit([$1],[./-], [___])]) + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + + dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([$1], [$2]) + + dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, + dnl because if the user has installed lib[]Name and not disabled its use + dnl via --without-lib[]Name-prefix, he wants to use it. + ac_save_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) + + AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ + ac_save_LIBS="$LIBS" + LIBS="$LIBS $LIB[]NAME" + AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) + LIBS="$ac_save_LIBS" + ]) + if test "$ac_cv_lib[]Name" = yes; then + HAVE_LIB[]NAME=yes + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) + AC_MSG_CHECKING([how to link with lib[]$1]) + AC_MSG_RESULT([$LIB[]NAME]) + else + HAVE_LIB[]NAME=no + dnl If $LIB[]NAME didn't lead to a usable library, we don't need + dnl $INC[]NAME either. + CPPFLAGS="$ac_save_CPPFLAGS" + LIB[]NAME= + LTLIB[]NAME= + fi + AC_SUBST([HAVE_LIB]NAME) + AC_SUBST([LIB]NAME) + AC_SUBST([LTLIB]NAME) + undefine([Name]) + undefine([NAME]) + ]) + + dnl Determine the platform dependent parameters needed to use rpath: + dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, + dnl hardcode_direct, hardcode_minus_L, + dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec. + AC_DEFUN([AC_LIB_RPATH], + [ + AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS + AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host + AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir + AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec" + sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec" + ]) + + dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and + dnl the libraries corresponding to explicit and implicit dependencies. + dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. + AC_DEFUN([AC_LIB_LINKFLAGS_BODY], + [ + define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_ARG_WITH([lib$1-prefix], + [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib + --without-lib$1-prefix don't search for lib$1 in includedir and libdir], + [ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + ]) + dnl Search the library and its dependencies in $additional_libdir and + dnl $LDFLAGS. Using breadth-first-seach. + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='$1 $2' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS + dnl or AC_LIB_HAVE_LINKFLAGS call. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" + else + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined + dnl that this library doesn't exist. So just drop it. + : + fi + else + dnl Search the library lib$name in $additional_libdir and $LDFLAGS + dnl and the already constructed $LIBNAME/$LTLIBNAME. + found_dir= + found_la= + found_so= + found_a= + if test $use_additional = yes; then + if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then + found_dir="$additional_libdir" + found_so="$additional_libdir/lib$name.$shlibext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + else + if test -f "$additional_libdir/lib$name.$libext"; then + found_dir="$additional_libdir" + found_a="$additional_libdir/lib$name.$libext" + if test -f "$additional_libdir/lib$name.la"; then + found_la="$additional_libdir/lib$name.la" + fi + fi + fi + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then + found_dir="$dir" + found_so="$dir/lib$name.$shlibext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + else + if test -f "$dir/lib$name.$libext"; then + found_dir="$dir" + found_a="$dir/lib$name.$libext" + if test -f "$dir/lib$name.la"; then + found_la="$dir/lib$name.la" + fi + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + dnl Found the library. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + dnl Linking with a shared library. We attempt to hardcode its + dnl directory into the executable's runpath, unless it's the + dnl standard /usr/lib. + if test "X$found_dir" = "X/usr/lib"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. + if test "$hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + dnl Rely on "-L$found_dir". + dnl But don't add it if it's already contained in the LDFLAGS + dnl or the already constructed $LIBNAME + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi + if test "$hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + dnl Linking with a static library. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" + else + dnl We shouldn't come here, but anyway it's good to have a + dnl fallback. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" + fi + fi + dnl Assume the include files are nearby. + additional_includedir= + case "$found_dir" in + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + dnl Potentially add $additional_includedir to $INCNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's /usr/local/include and we are using GCC on Linux, + dnl 3. if it's already present in $CPPFLAGS or the already + dnl constructed $INCNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INC[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $INCNAME. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + dnl Look for dependencies. + if test -n "$found_la"; then + dnl Read the .la file. It defines the variables + dnl dlname, library_names, old_library, dependency_libs, current, + dnl age, revision, installed, dlopen, dlpreopen, libdir. + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + dnl We use only dependency_libs. + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's /usr/local/lib and we are using GCC on Linux, + dnl 3. if it's already present in $LDFLAGS or the already + dnl constructed $LIBNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + ;; + -l*) + dnl Handle this in the next round. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + dnl Handle this in the next round. Throw away the .la's + dnl directory; it is already contained in a preceding -L + dnl option. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + dnl Most likely an immediate library name. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" + ;; + esac + done + fi + else + dnl Didn't find the library; assume it is in the system directories + dnl known to the linker and runtime loader. (All the system + dnl directories known to the linker should also be known to the + dnl runtime loader, otherwise the system is severely misconfigured.) + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" + done + dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + else + dnl The -rpath options are cumulative. + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + dnl When using libtool, the option that works for both libraries and + dnl executables is -R. The -R options are cumulative. + for found_dir in $ltrpathdirs; do + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" + done + fi + ]) + + dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, + dnl unless already present in VAR. + dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes + dnl contains two or three consecutive elements that belong together. + AC_DEFUN([AC_LIB_APPENDTOVAR], + [ + for element in [$2]; do + haveit= + for x in $[$1]; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + [$1]="${[$1]}${[$1]:+ }$element" + fi + done + ]) diff -crN gawk-3.1.0/m4/lib-prefix.m4 gawk-3.1.1/m4/lib-prefix.m4 *** gawk-3.1.0/m4/lib-prefix.m4 Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/m4/lib-prefix.m4 Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,148 ---- + # lib-prefix.m4 serial 1 (gettext-0.11) + dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. + dnl This file is free software, distributed under the terms of the GNU + dnl General Public License. As a special exception to the GNU General + dnl Public License, this file may be distributed as part of a program + dnl that contains a configuration script generated by Autoconf, under + dnl the same distribution terms as the rest of that program. + + dnl From Bruno Haible. + + dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed + dnl to access previously installed libraries. The basic assumption is that + dnl a user will want packages to use other packages he previously installed + dnl with the same --prefix option. + dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate + dnl libraries, but is otherwise very convenient. + AC_DEFUN([AC_LIB_PREFIX], + [ + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_ARG_WITH([lib-prefix], + [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir], + [ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/lib" + fi + fi + ]) + if test $use_additional = yes; then + dnl Potentially add $additional_includedir to $CPPFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's already present in $CPPFLAGS, + dnl 3. if it's /usr/local/include and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + for x in $CPPFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $CPPFLAGS. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" + fi + fi + fi + fi + dnl Potentially add $additional_libdir to $LDFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's already present in $LDFLAGS, + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/lib"; then + haveit= + for x in $LDFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_libdir" = "X/usr/local/lib"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LDFLAGS. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" + fi + fi + fi + fi + fi + ]) + + dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, + dnl acl_final_exec_prefix, containing the values to which $prefix and + dnl $exec_prefix will expand at the end of the configure script. + AC_DEFUN([AC_LIB_PREPARE_PREFIX], + [ + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" + ]) + + dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the + dnl variables prefix and exec_prefix bound to the values they will have + dnl at the end of the configure script. + AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], + [ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + $1 + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + ]) diff -crN gawk-3.1.0/m4/progtest.m4 gawk-3.1.1/m4/progtest.m4 *** gawk-3.1.0/m4/progtest.m4 Fri Jun 23 12:47:55 2000 --- gawk-3.1.1/m4/progtest.m4 Sun Apr 28 17:01:52 2002 *************** *** 1,16 **** ! # 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 Public License ! # but which still want to provide support for the GNU gettext functionality. ! # Please note that the actual code is *not* freely available. ! # serial 1 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]) --- 1,28 ---- ! # progtest.m4 serial 2 (gettext-0.10.40) ! dnl Copyright (C) 1996-2002 Free Software Foundation, Inc. ! dnl This file is free software, distributed under the terms of the GNU ! dnl General Public License. As a special exception to the GNU General ! dnl Public License, this file may be distributed as part of a program ! dnl that contains a configuration script generated by Autoconf, under ! dnl the same distribution terms as the rest of that program. ! dnl ! dnl This file can can be used in projects which are not available under ! dnl the GNU General Public License or the GNU Library General Public ! dnl License but which still want to provide support for the GNU gettext ! dnl functionality. ! dnl Please note that the actual code of the GNU gettext library is covered ! dnl by the GNU Library General Public License, and the rest of the GNU ! dnl gettext package package is covered by the GNU General Public License. ! dnl They are *not* in the public domain. ! ! dnl Authors: ! dnl Ulrich Drepper , 1996. ! # Search path for a program which passes the given test. 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]) *************** *** 38,44 **** ;; esac])dnl $1="$ac_cv_path_$1" ! if test -n "[$]$1"; then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) --- 50,56 ---- ;; 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) diff -crN gawk-3.1.0/m4/strtod.m4 gawk-3.1.1/m4/strtod.m4 *** gawk-3.1.0/m4/strtod.m4 Sun Jan 21 17:55:26 2001 --- gawk-3.1.1/m4/strtod.m4 Tue Apr 16 14:57:52 2002 *************** *** 1,7 **** dnl dnl strtod.m4 --- autoconf input file for gawk dnl ! dnl Copyright (C) 2001 the Free Software Foundation, Inc. dnl dnl This file is part of GAWK, the GNU implementation of the dnl AWK Progamming Language. --- 1,7 ---- dnl dnl strtod.m4 --- autoconf input file for gawk dnl ! dnl Copyright (C) 2001, 2002 the Free Software Foundation, Inc. dnl dnl This file is part of GAWK, the GNU implementation of the dnl AWK Progamming Language. *************** *** 49,54 **** --- 49,55 ---- exit (0); else exit (1); + #endif }], gawk_ac_cv_func_strtod_c89=yes, gawk_ac_cv_func_strtod_c89=no, gawk_ac_cv_func_strtod_c89=no)]) diff -crN gawk-3.1.0/main.c gawk-3.1.1/main.c *** gawk-3.1.0/main.c Tue May 15 19:48:53 2001 --- gawk-3.1.1/main.c Sun Apr 28 17:16:39 2002 *************** *** 3,9 **** */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. --- 3,9 ---- */ /* ! * Copyright (C) 1986, 1988, 1989, 1991-2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. *************** *** 54,59 **** --- 54,60 ---- static void nostalgia P((void)); static void version P((void)); static void init_fds P((void)); + static void init_groupset P((void)); /* These nodes store all the special variables AWK uses */ NODE *ARGC_node, *ARGIND_node, *ARGV_node, *BINMODE_node, *CONVFMT_node; *************** *** 119,129 **** --- 120,136 ---- int in_begin_rule = FALSE; /* we're in a BEGIN rule */ int in_end_rule = FALSE; /* we're in a END rule */ + int whiny_users = FALSE; /* do things that whiny users want */ int output_is_tty = FALSE; /* control flushing of output */ extern char *version_string; /* current version, for printing */ + #if defined (HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0 + GETGROUPS_T *groupset; /* current group set */ + int ngroups; /* size of said set */ + #endif + /* The parse tree is stored here. */ NODE *expression_value; *************** *** 179,184 **** --- 186,194 ---- if (getenv("TIDYMEM") != NULL) do_tidy_mem = TRUE; + if (getenv("WHINY_USERS") != NULL) + whiny_users = TRUE; + #ifdef HAVE_MCHECK_H if (do_tidy_mem) mtrace(); *************** *** 187,193 **** setlocale(LC_CTYPE, ""); setlocale(LC_COLLATE, ""); ! /* setlocale (LC_ALL, ""); */ bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); --- 197,205 ---- setlocale(LC_CTYPE, ""); setlocale(LC_COLLATE, ""); ! #if HAVE_LC_MESSAGES ! setlocale(LC_MESSAGES, ""); ! #endif bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); *************** *** 238,243 **** --- 250,258 ---- /* Robustness: check that 0, 1, 2, exist */ init_fds(); + /* load group set */ + init_groupset(); + /* worst case */ emalloc(srcfiles, struct src *, argc * sizeof(struct src), "main"); memset(srcfiles, '\0', argc * sizeof(struct src)); *************** *** 431,437 **** } if (do_lint && os_is_setuid()) ! warning(_("runing %s setuid root may be a security problem"), myname); /* * Tell the regex routines how they should work. --- 446,452 ---- } if (do_lint && os_is_setuid()) ! warning(_("running %s setuid root may be a security problem"), myname); /* * Tell the regex routines how they should work. *************** *** 536,543 **** static void usage(int exitval, FILE *fp) { - /* Not factoring out common stuff makes it easier to translate. */ fprintf(fp, _("Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"), myname); fprintf(fp, _("Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"), --- 551,558 ---- static void usage(int exitval, FILE *fp) { + /* Not factoring out common stuff makes it easier to translate. */ fprintf(fp, _("Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"), myname); fprintf(fp, _("Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"), *************** *** 572,579 **** fputs(_("\t-W traditional\t\t--traditional\n"), fp); fputs(_("\t-W usage\t\t--usage\n"), fp); fputs(_("\t-W version\t\t--version\n"), fp); ! fputs(_("\nTo report bugs, see node `Bugs' in `gawk.info', which is\n"), fp); ! fputs(_("section `Reporting Problems and Bugs' in the printed version.\n"), fp); exit(exitval); } --- 587,606 ---- fputs(_("\t-W traditional\t\t--traditional\n"), fp); fputs(_("\t-W usage\t\t--usage\n"), fp); fputs(_("\t-W version\t\t--version\n"), fp); ! ! ! /* This is one string to make things easier on translators. */ ! fputs(_("\nTo report bugs, see node `Bugs' in `gawk.info', which is\n\ ! section `Reporting Problems and Bugs' in the printed version.\n\n"), fp); ! ! /* ditto */ ! fputs(_("gawk is a pattern scanning and processing language.\n\ ! By default it reads standard input and writes standard output.\n\n"), fp); ! ! /* ditto */ ! fputs(_("Examples:\n\tgawk '{ sum += $1 }; END { print sum }' file\n\ ! \tgawk -F: '{ print $1 }' /etc/passwd\n"), fp); ! exit(exitval); } *************** *** 583,589 **** copyleft() { static char blurb_part1[] = ! N_("Copyright (C) 1989, 1991-2001 Free Software Foundation.\n\ \n\ This program is free software; you can redistribute it and/or modify\n\ it under the terms of the GNU General Public License as published by\n\ --- 610,616 ---- copyleft() { static char blurb_part1[] = ! N_("Copyright (C) 1989, 1991-%d Free Software Foundation.\n\ \n\ This program is free software; you can redistribute it and/or modify\n\ it under the terms of the GNU General Public License as published by\n\ *************** *** 602,608 **** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"); /* multiple blurbs are needed for some brain dead compilers. */ ! fputs(_(blurb_part1), stdout); fputs(_(blurb_part2), stdout); fputs(_(blurb_part3), stdout); fflush(stdout); --- 629,635 ---- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"); /* multiple blurbs are needed for some brain dead compilers. */ ! printf(_(blurb_part1), 2002); /* Last update year */ fputs(_(blurb_part2), stdout); fputs(_(blurb_part3), stdout); fflush(stdout); *************** *** 773,782 **** NODE **aptr; char name[100]; AWKNUM value; - #if defined(NGROUPS_MAX) && NGROUPS_MAX > 0 - GETGROUPS_T groupset[NGROUPS_MAX]; - int ngroups; - #endif PROCINFO_node = install("PROCINFO", node(Nnull_string, Node_var, (NODE *) NULL)); --- 800,805 ---- *************** *** 824,834 **** aptr = assoc_lookup(PROCINFO_node, tmp_string("FS", 2), FALSE); *aptr = make_string("FS", 2); ! #if defined(NGROUPS_MAX) && NGROUPS_MAX > 0 ! ngroups = getgroups(NGROUPS_MAX, groupset); ! if (ngroups == -1) ! fatal(_("could not find groups: %s"), strerror(errno)); ! for (i = 0; i < ngroups; i++) { sprintf(name, "group%d", i + 1); value = groupset[i]; --- 847,853 ---- aptr = assoc_lookup(PROCINFO_node, tmp_string("FS", 2), FALSE); *aptr = make_string("FS", 2); ! #if defined (HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0 for (i = 0; i < ngroups; i++) { sprintf(name, "group%d", i + 1); value = groupset[i]; *************** *** 969,975 **** static void version() { ! printf("%s.%d\n", version_string, PATCHLEVEL); /* * Per GNU coding standards, print copyright info, * then exit successfully, do nothing else. --- 988,994 ---- static void version() { ! printf("%s.%s\n", version_string, PATCHLEVEL); /* * Per GNU coding standards, print copyright info, * then exit successfully, do nothing else. *************** *** 1002,1004 **** --- 1021,1048 ---- } } } + + /* init_groupset --- initialize groupset */ + + static void + init_groupset() + { + #if defined(HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0 + /* + * If called with 0 for both args, return value is + * total number of groups. + */ + ngroups = getgroups(0, NULL); + if (ngroups == -1) + fatal(_("could not find groups: %s"), strerror(errno)); + else if (ngroups == 0) + return; + + /* fill in groups */ + emalloc(groupset, GETGROUPS_T *, ngroups * sizeof(GETGROUPS_T), "init_groupset"); + + ngroups = getgroups(ngroups, groupset); + if (ngroups == -1) + fatal(_("could not find groups: %s"), strerror(errno)); + #endif + } diff -crN gawk-3.1.0/missing_d/ChangeLog gawk-3.1.1/missing_d/ChangeLog *** gawk-3.1.0/missing_d/ChangeLog Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/missing_d/ChangeLog Wed May 1 16:42:04 2002 *************** *** 0 **** --- 1,15 ---- + Wed May 1 16:41:32 2002 Arnold D. Robbins + + * Release 3.1.1: Release tar file made. + + Tue Dec 4 17:56:46 2001 Arnold D. Robbins + + * strftime.c: Replaced with glibc version. + * strftime.3: Removed + + Fri Aug 3 09:01:19 2001 Arnold D. Robbins + + ChangeLog created. + + * strtod.c (strtod): Fixed test at end for failure to + be a little smarter. diff -crN gawk-3.1.0/missing_d/strftime.c gawk-3.1.1/missing_d/strftime.c *** gawk-3.1.0/missing_d/strftime.c Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/missing_d/strftime.c Mon Dec 24 14:00:59 2001 *************** *** 0 **** --- 1,1411 ---- + /* Copyright (C) 1991-1999, 2000, 2001 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 + Library 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 + + #ifdef _LIBC + # define HAVE_LIMITS_H 1 + # define HAVE_MBLEN 1 + # define HAVE_MBRLEN 1 + # define HAVE_STRUCT_ERA_ENTRY 1 + # define HAVE_TM_GMTOFF 1 + # define HAVE_TM_ZONE 1 + # define HAVE_TZNAME 1 + # define HAVE_TZSET 1 + # define MULTIBYTE_IS_FORMAT_SAFE 1 + # define STDC_HEADERS 1 + # include "../locale/localeinfo.h" + #endif + + #if defined emacs && !defined HAVE_BCOPY + # define HAVE_MEMCPY 1 + #endif + + #include + #ifdef TIME_T_IN_SYS_TYPES_H + #include /* Some systems define `time_t' here. */ + #endif /* HAVE_SYS_TYPES_H */ + + #ifdef TIME_WITH_SYS_TIME + # include + # include + #else + # ifdef HAVE_SYS_TIME_H + # include + # else + # include + # endif + #endif + #if HAVE_TZNAME + extern char *tzname[]; + #endif + + /* Do multibyte processing if multibytes are supported, unless + multibyte sequences are safe in formats. Multibyte sequences are + safe if they cannot contain byte sequences that look like format + conversion specifications. The GNU C Library uses UTF8 multibyte + encoding, which is safe for formats, but strftime.c can be used + with other C libraries that use unsafe encodings. */ + #define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE) + + #if DO_MULTIBYTE + # if HAVE_MBRLEN + # include + # else + /* Simulate mbrlen with mblen as best we can. */ + # define mbstate_t int + # define mbrlen(s, n, ps) mblen (s, n) + # define mbsinit(ps) (*(ps) == 0) + # endif + static const mbstate_t mbstate_zero; + #endif + + #if HAVE_LIMITS_H + # include + #endif + + #if STDC_HEADERS + # include + # include + # include + #else + # ifndef HAVE_MEMCPY + # define memcpy(d, s, n) bcopy ((s), (d), (n)) + # endif + #endif + + #undef TOUPPER + #undef TOLOWER + #undef ISDIGIT + #ifdef COMPILE_WIDE + # include + # define CHAR_T wchar_t + # define UCHAR_T unsigned int + # define L_(Str) L##Str + # define NLW(Sym) _NL_W##Sym + + # define MEMCPY(d, s, n) __wmemcpy (d, s, n) + # define STRLEN(s) __wcslen (s) + + #else + # define CHAR_T char + # define UCHAR_T unsigned char + # define L_(Str) Str + # define NLW(Sym) Sym + + # if !defined STDC_HEADERS && !defined HAVE_MEMCPY + # define MEMCPY(d, s, n) bcopy ((s), (d), (n)) + # else + # define MEMCPY(d, s, n) memcpy ((d), (s), (n)) + # endif + # define STRLEN(s) strlen (s) + + # ifdef _LIBC + # define MEMPCPY(d, s, n) __mempcpy (d, s, n) + # else + # ifndef HAVE_MEMPCPY + # define MEMPCPY(d, s, n) ((void *) ((char *) memcpy (d, s, n) + (n))) + # endif + # endif + #endif + + #ifndef __P + # if defined __GNUC__ || (defined __STDC__ && __STDC__) + # define __P(args) args + # else + # define __P(args) () + # endif /* GCC. */ + #endif /* Not __P. */ + + #ifndef PTR + # ifdef __STDC__ + # define PTR void * + # else + # define PTR char * + # endif + #endif + + #ifndef CHAR_BIT + # define CHAR_BIT 8 + #endif + + #ifndef NULL + # define NULL 0 + #endif + + #define TYPE_SIGNED(t) ((t) -1 < 0) + + /* Bound on length of the string representing an integer value of type t. + Subtract one for the sign bit if t is signed; + 302 / 1000 is log10 (2) rounded up; + add one for integer division truncation; + add one more for a minus sign if t is signed. */ + #define INT_STRLEN_BOUND(t) \ + ((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 + 1 + TYPE_SIGNED (t)) + + #define TM_YEAR_BASE 1900 + + #ifndef __isleap + /* Nonzero if YEAR is a leap year (every 4 years, + except every 100th isn't, and every 400th is). */ + # define __isleap(year) \ + ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) + #endif + + + #ifdef _LIBC + # define my_strftime_gmtime_r __gmtime_r + # define my_strftime_localtime_r __localtime_r + # define tzname __tzname + # define tzset __tzset + #else + + /* If we're a strftime substitute in a GNU program, then prefer gmtime + to gmtime_r, since many gmtime_r implementations are buggy. + Similarly for localtime_r. */ + + # if ! HAVE_TM_GMTOFF + static struct tm *my_strftime_gmtime_r __P ((const time_t *, struct tm *)); + static struct tm * + my_strftime_gmtime_r (t, tp) + const time_t *t; + struct tm *tp; + { + struct tm *l = gmtime (t); + if (! l) + return 0; + *tp = *l; + return tp; + } + # endif /* ! HAVE_TM_GMTOFF */ + + static struct tm *my_strftime_localtime_r __P ((const time_t *, struct tm *)); + static struct tm * + my_strftime_localtime_r (t, tp) + const time_t *t; + struct tm *tp; + { + struct tm *l = localtime (t); + if (! l) + return 0; + *tp = *l; + return tp; + } + #endif /* ! defined _LIBC */ + + + #if !defined memset && !defined HAVE_MEMSET && !defined _LIBC + /* Some systems lack the `memset' function and we don't want to + introduce additional dependencies. */ + /* The SGI compiler reportedly barfs on the trailing null + if we use a string constant as the initializer. 28 June 1997, rms. */ + static const CHAR_T spaces[16] = /* " " */ + { + L_(' '),L_(' '),L_(' '),L_(' '),L_(' '),L_(' '),L_(' '),L_(' '), + L_(' '),L_(' '),L_(' '),L_(' '),L_(' '),L_(' '),L_(' '),L_(' ') + }; + static const CHAR_T zeroes[16] = /* "0000000000000000" */ + { + L_('0'),L_('0'),L_('0'),L_('0'),L_('0'),L_('0'),L_('0'),L_('0'), + L_('0'),L_('0'),L_('0'),L_('0'),L_('0'),L_('0'),L_('0'),L_('0') + }; + + # define memset_space(P, Len) \ + do { \ + int _len = (Len); \ + \ + do \ + { \ + int _this = _len > 16 ? 16 : _len; \ + (P) = MEMPCPY ((P), spaces, _this * sizeof (CHAR_T)); \ + _len -= _this; \ + } \ + while (_len > 0); \ + } while (0) + + # define memset_zero(P, Len) \ + do { \ + int _len = (Len); \ + \ + do \ + { \ + int _this = _len > 16 ? 16 : _len; \ + (P) = MEMPCPY ((P), zeroes, _this * sizeof (CHAR_T)); \ + _len -= _this; \ + } \ + while (_len > 0); \ + } while (0) + #else + # ifdef COMPILE_WIDE + # define memset_space(P, Len) (wmemset ((P), L' ', (Len)), (P) += (Len)) + # define memset_zero(P, Len) (wmemset ((P), L'0', (Len)), (P) += (Len)) + # else + # define memset_space(P, Len) (memset ((P), ' ', (Len)), (P) += (Len)) + # define memset_zero(P, Len) (memset ((P), '0', (Len)), (P) += (Len)) + # endif + #endif + + #define add(n, f) \ + do \ + { \ + int _n = (n); \ + int _delta = width - _n; \ + int _incr = _n + (_delta > 0 ? _delta : 0); \ + if (i + _incr >= maxsize) \ + return 0; \ + if (p) \ + { \ + if (_delta > 0) \ + { \ + if (pad == L_('0')) \ + memset_zero (p, _delta); \ + else \ + memset_space (p, _delta); \ + } \ + f; \ + p += _n; \ + } \ + i += _incr; \ + } while (0) + + #define cpy(n, s) \ + add ((n), \ + if (to_lowcase) \ + memcpy_lowcase (p, (s), _n); \ + else if (to_uppcase) \ + memcpy_uppcase (p, (s), _n); \ + else \ + MEMCPY ((PTR) p, (const PTR) (s), _n)) + + #ifdef COMPILE_WIDE + # define widen(os, ws, l) \ + { \ + mbstate_t __st; \ + const char *__s = os; \ + memset (&__st, '\0', sizeof (__st)); \ + l = __mbsrtowcs (NULL, &__s, 0, &__st); \ + ws = alloca ((l + 1) * sizeof (wchar_t)); \ + (void) __mbsrtowcs (ws, &__s, l, &__st); \ + } + #endif + + + #ifdef COMPILE_WIDE + # define TOUPPER(Ch) towupper (Ch) + # define TOLOWER(Ch) towlower (Ch) + #else + # ifdef _LIBC + # define TOUPPER(Ch) toupper (Ch) + # define TOLOWER(Ch) tolower (Ch) + # else + # define TOUPPER(Ch) (islower (Ch) ? toupper (Ch) : (Ch)) + # define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) + # endif + #endif + /* We don't use `isdigit' here since the locale dependent + interpretation is not what we want here. We only need to accept + the arabic digits in the ASCII range. One day there is perhaps a + more reliable way to accept other sets of digits. */ + #define ISDIGIT(Ch) ((unsigned int) (Ch) - L_('0') <= 9) + + static CHAR_T *memcpy_lowcase __P ((CHAR_T *dest, const CHAR_T *src, + size_t len)); + + static CHAR_T * + memcpy_lowcase (dest, src, len) + CHAR_T *dest; + const CHAR_T *src; + size_t len; + { + while (len-- > 0) + dest[len] = TOLOWER ((UCHAR_T) src[len]); + return dest; + } + + static CHAR_T *memcpy_uppcase __P ((CHAR_T *dest, const CHAR_T *src, + size_t len)); + + static CHAR_T * + memcpy_uppcase (dest, src, len) + CHAR_T *dest; + const CHAR_T *src; + size_t len; + { + while (len-- > 0) + dest[len] = TOUPPER ((UCHAR_T) src[len]); + return dest; + } + + + #if ! HAVE_TM_GMTOFF + /* Yield the difference between *A and *B, + measured in seconds, ignoring leap seconds. */ + # define tm_diff ftime_tm_diff + static int tm_diff __P ((const struct tm *, const struct tm *)); + static int + tm_diff (a, b) + const struct tm *a; + const struct tm *b; + { + /* Compute intervening leap days correctly even if year is negative. + Take care to avoid int overflow in leap day calculations, + but it's OK to assume that A and B are close to each other. */ + int a4 = (a->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (a->tm_year & 3); + int b4 = (b->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (b->tm_year & 3); + int a100 = a4 / 25 - (a4 % 25 < 0); + int b100 = b4 / 25 - (b4 % 25 < 0); + int a400 = a100 >> 2; + int b400 = b100 >> 2; + int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); + int years = a->tm_year - b->tm_year; + int days = (365 * years + intervening_leap_days + + (a->tm_yday - b->tm_yday)); + return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour)) + + (a->tm_min - b->tm_min)) + + (a->tm_sec - b->tm_sec)); + } + #endif /* ! HAVE_TM_GMTOFF */ + + + + /* The number of days from the first day of the first ISO week of this + year to the year day YDAY with week day WDAY. ISO weeks start on + Monday; the first ISO week has the year's first Thursday. YDAY may + be as small as YDAY_MINIMUM. */ + #define ISO_WEEK_START_WDAY 1 /* Monday */ + #define ISO_WEEK1_WDAY 4 /* Thursday */ + #define YDAY_MINIMUM (-366) + static int iso_week_days __P ((int, int)); + #ifdef __GNUC__ + __inline__ + #endif + static int + iso_week_days (yday, wday) + int yday; + int wday; + { + /* Add enough to the first operand of % to make it nonnegative. */ + int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7; + return (yday + - (yday - wday + ISO_WEEK1_WDAY + big_enough_multiple_of_7) % 7 + + ISO_WEEK1_WDAY - ISO_WEEK_START_WDAY); + } + + + #if !(defined _NL_CURRENT || HAVE_STRFTIME) + static CHAR_T const weekday_name[][10] = + { + L_("Sunday"), L_("Monday"), L_("Tuesday"), L_("Wednesday"), + L_("Thursday"), L_("Friday"), L_("Saturday") + }; + static CHAR_T const month_name[][10] = + { + L_("January"), L_("February"), L_("March"), L_("April"), L_("May"), + L_("June"), L_("July"), L_("August"), L_("September"), L_("October"), + L_("November"), L_("December") + }; + #endif + + + /* When compiling this file, GNU applications can #define my_strftime + to a symbol (typically nstrftime) to get an extended strftime with + extra arguments UT and NS. Emacs is a special case for now, but + this Emacs-specific code can be removed once Emacs's config.h + defines my_strftime. */ + #if defined emacs && !defined my_strftime + # define my_strftime nstrftime + #endif + + #ifdef my_strftime + # define extra_args , ut, ns + # define extra_args_spec int ut; int ns; + # define extra_args_spec_iso , int ut, int ns + #else + # ifdef COMPILE_WIDE + # define my_strftime wcsftime + # else + # define my_strftime strftime + # endif + # define extra_args + # define extra_args_spec + # define extra_args_spec_iso + /* We don't have this information in general. */ + # define ut 0 + # define ns 0 + #endif + + #if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET + /* Solaris 2.5 tzset sometimes modifies the storage returned by localtime. + Work around this bug by copying *tp before it might be munged. */ + size_t _strftime_copytm __P ((char *, size_t, const char *, + const struct tm * extra_args_spec_iso)); + size_t + my_strftime (s, maxsize, format, tp extra_args) + CHAR_T *s; + size_t maxsize; + const CHAR_T *format; + const struct tm *tp; + extra_args_spec + { + struct tm tmcopy; + tmcopy = *tp; + return _strftime_copytm (s, maxsize, format, &tmcopy extra_args); + } + # undef my_strftime + # define my_strftime _strftime_copytm + #endif + + + /* Write information from TP into S according to the format + string FORMAT, writing no more that MAXSIZE characters + (including the terminating '\0') and returning number of + characters written. If S is NULL, nothing will be written + anywhere, so to determine how many characters would be + written, use NULL for S and (size_t) UINT_MAX for MAXSIZE. */ + size_t + my_strftime (s, maxsize, format, tp extra_args) + CHAR_T *s; + size_t maxsize; + const CHAR_T *format; + const struct tm *tp; + extra_args_spec + { + int hour12 = tp->tm_hour; + #ifdef _NL_CURRENT + /* We cannot make the following values variables since we must delay + the evaluation of these values until really needed since some + expressions might not be valid in every situation. The `struct tm' + might be generated by a strptime() call that initialized + only a few elements. Dereference the pointers only if the format + requires this. Then it is ok to fail if the pointers are invalid. */ + # define a_wkday \ + ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ABDAY_1) + tp->tm_wday)) + # define f_wkday \ + ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(DAY_1) + tp->tm_wday)) + # define a_month \ + ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ABMON_1) + tp->tm_mon)) + # define f_month \ + ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon)) + # define ampm \ + ((const CHAR_T *) _NL_CURRENT (LC_TIME, tp->tm_hour > 11 \ + ? NLW(PM_STR) : NLW(AM_STR))) + + # define aw_len STRLEN (a_wkday) + # define am_len STRLEN (a_month) + # define ap_len STRLEN (ampm) + #else + # if !HAVE_STRFTIME + # define f_wkday (weekday_name[tp->tm_wday]) + # define f_month (month_name[tp->tm_mon]) + # define a_wkday f_wkday + # define a_month f_month + # define ampm (L_("AMPM") + 2 * (tp->tm_hour > 11)) + + size_t aw_len = 3; + size_t am_len = 3; + size_t ap_len = 2; + # endif + #endif + const char *zone; + size_t i = 0; + CHAR_T *p = s; + const CHAR_T *f; + #if DO_MULTIBYTE && !defined COMPILE_WIDE + const char *format_end = NULL; + #endif + + zone = NULL; + #if HAVE_TM_ZONE + /* The POSIX test suite assumes that setting + the environment variable TZ to a new value before calling strftime() + will influence the result (the %Z format) even if the information in + TP is computed with a totally different time zone. + This is bogus: though POSIX allows bad behavior like this, + POSIX does not require it. Do the right thing instead. */ + zone = (const char *) tp->tm_zone; + #endif + #if HAVE_TZNAME + if (ut) + { + if (! (zone && *zone)) + zone = "GMT"; + } + else + { + /* POSIX.1 8.1.1 requires that whenever strftime() is called, the + time zone names contained in the external variable `tzname' shall + be set as if the tzset() function had been called. */ + # if HAVE_TZSET + tzset (); + # endif + } + #endif + + if (hour12 > 12) + hour12 -= 12; + else + if (hour12 == 0) + hour12 = 12; + + for (f = format; *f != '\0'; ++f) + { + int pad = 0; /* Padding for number ('-', '_', or 0). */ + int modifier; /* Field modifier ('E', 'O', or 0). */ + int digits; /* Max digits for numeric format. */ + int number_value; /* Numeric value to be printed. */ + int negative_number; /* 1 if the number is negative. */ + const CHAR_T *subfmt; + CHAR_T *bufp; + CHAR_T buf[1 + (sizeof (int) < sizeof (time_t) + ? INT_STRLEN_BOUND (time_t) + : INT_STRLEN_BOUND (int))]; + int width = -1; + int to_lowcase = 0; + int to_uppcase = 0; + int change_case = 0; + int format_char; + + #if DO_MULTIBYTE && !defined COMPILE_WIDE + switch (*f) + { + case L_('%'): + break; + + case L_('\b'): case L_('\t'): case L_('\n'): + case L_('\v'): case L_('\f'): case L_('\r'): + case L_(' '): case L_('!'): case L_('"'): case L_('#'): case L_('&'): + case L_('\''): case L_('('): case L_(')'): case L_('*'): case L_('+'): + case L_(','): case L_('-'): case L_('.'): case L_('/'): case L_('0'): + case L_('1'): case L_('2'): case L_('3'): case L_('4'): case L_('5'): + case L_('6'): case L_('7'): case L_('8'): case L_('9'): case L_(':'): + case L_(';'): case L_('<'): case L_('='): case L_('>'): case L_('?'): + case L_('A'): case L_('B'): case L_('C'): case L_('D'): case L_('E'): + case L_('F'): case L_('G'): case L_('H'): case L_('I'): case L_('J'): + case L_('K'): case L_('L'): case L_('M'): case L_('N'): case L_('O'): + case L_('P'): case L_('Q'): case L_('R'): case L_('S'): case L_('T'): + case L_('U'): case L_('V'): case L_('W'): case L_('X'): case L_('Y'): + case L_('Z'): case L_('['): case L_('\\'): case L_(']'): case L_('^'): + case L_('_'): case L_('a'): case L_('b'): case L_('c'): case L_('d'): + case L_('e'): case L_('f'): case L_('g'): case L_('h'): case L_('i'): + case L_('j'): case L_('k'): case L_('l'): case L_('m'): case L_('n'): + case L_('o'): case L_('p'): case L_('q'): case L_('r'): case L_('s'): + case L_('t'): case L_('u'): case L_('v'): case L_('w'): case L_('x'): + case L_('y'): case L_('z'): case L_('{'): case L_('|'): case L_('}'): + case L_('~'): + /* The C Standard requires these 98 characters (plus '%') to + be in the basic execution character set. None of these + characters can start a multibyte sequence, so they need + not be analyzed further. */ + add (1, *p = *f); + continue; + + default: + /* Copy this multibyte sequence until we reach its end, find + an error, or come back to the initial shift state. */ + { + mbstate_t mbstate = mbstate_zero; + size_t len = 0; + size_t fsize; + + if (! format_end) + format_end = f + strlen (f) + 1; + fsize = format_end - f; + + do + { + size_t bytes = mbrlen (f + len, fsize - len, &mbstate); + + if (bytes == 0) + break; + + if (bytes == (size_t) -2) + { + len += strlen (f + len); + break; + } + + if (bytes == (size_t) -1) + { + len++; + break; + } + + len += bytes; + } + while (! mbsinit (&mbstate)); + + cpy (len, f); + f += len - 1; + continue; + } + } + + #else /* ! DO_MULTIBYTE */ + + /* Either multibyte encodings are not supported, they are + safe for formats, so any non-'%' byte can be copied through, + or this is the wide character version. */ + if (*f != L_('%')) + { + add (1, *p = *f); + continue; + } + + #endif /* ! DO_MULTIBYTE */ + + /* Check for flags that can modify a format. */ + while (1) + { + switch (*++f) + { + /* This influences the number formats. */ + case L_('_'): + case L_('-'): + case L_('0'): + pad = *f; + continue; + + /* This changes textual output. */ + case L_('^'): + to_uppcase = 1; + continue; + case L_('#'): + change_case = 1; + continue; + + default: + break; + } + break; + } + + /* As a GNU extension we allow to specify the field width. */ + if (ISDIGIT (*f)) + { + width = 0; + do + { + width *= 10; + width += *f - L_('0'); + ++f; + } + while (ISDIGIT (*f)); + } + + /* Check for modifiers. */ + switch (*f) + { + case L_('E'): + case L_('O'): + modifier = *f++; + break; + + default: + modifier = 0; + break; + } + + /* Now do the specified format. */ + format_char = *f; + switch (format_char) + { + #define DO_NUMBER(d, v) \ + digits = width == -1 ? d : width; \ + number_value = v; goto do_number + #define DO_NUMBER_SPACEPAD(d, v) \ + digits = width == -1 ? d : width; \ + number_value = v; goto do_number_spacepad + + case L_('%'): + if (modifier != 0) + goto bad_format; + add (1, *p = *f); + break; + + case L_('a'): + if (modifier != 0) + goto bad_format; + if (change_case) + { + to_uppcase = 1; + to_lowcase = 0; + } + #if defined _NL_CURRENT || !HAVE_STRFTIME + cpy (aw_len, a_wkday); + break; + #else + goto underlying_strftime; + #endif + + case 'A': + if (modifier != 0) + goto bad_format; + if (change_case) + { + to_uppcase = 1; + to_lowcase = 0; + } + #if defined _NL_CURRENT || !HAVE_STRFTIME + cpy (STRLEN (f_wkday), f_wkday); + break; + #else + goto underlying_strftime; + #endif + + case L_('b'): + case L_('h'): /* POSIX.2 extension. */ + if (change_case) + { + to_uppcase = 1; + to_lowcase = 0; + } + if (modifier != 0) + goto bad_format; + #if defined _NL_CURRENT || !HAVE_STRFTIME + cpy (am_len, a_month); + break; + #else + goto underlying_strftime; + #endif + + case L_('B'): + if (modifier != 0) + goto bad_format; + if (change_case) + { + to_uppcase = 1; + to_lowcase = 0; + } + #if defined _NL_CURRENT || !HAVE_STRFTIME + cpy (STRLEN (f_month), f_month); + break; + #else + goto underlying_strftime; + #endif + + case L_('c'): + if (modifier == L_('O')) + goto bad_format; + #ifdef _NL_CURRENT + if (! (modifier == 'E' + && (*(subfmt = + (const CHAR_T *) _NL_CURRENT (LC_TIME, + NLW(ERA_D_T_FMT))) + != '\0'))) + subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_T_FMT)); + #else + # if HAVE_STRFTIME + goto underlying_strftime; + # else + subfmt = L_("%a %b %e %H:%M:%S %Y"); + # endif + #endif + + subformat: + { + CHAR_T *old_start = p; + size_t len = my_strftime (NULL, (size_t) -1, subfmt, + tp extra_args); + add (len, my_strftime (p, maxsize - i, subfmt, + tp extra_args)); + + if (to_uppcase) + while (old_start < p) + { + *old_start = TOUPPER ((UCHAR_T) *old_start); + ++old_start; + } + } + break; + + #if HAVE_STRFTIME && ! (defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY) + underlying_strftime: + { + /* The relevant information is available only via the + underlying strftime implementation, so use that. */ + char ufmt[4]; + char *u = ufmt; + char ubuf[1024]; /* enough for any single format in practice */ + size_t len; + /* Make sure we're calling the actual underlying strftime. + In some cases, config.h contains something like + "#define strftime rpl_strftime". */ + # ifdef strftime + # undef strftime + size_t strftime (); + # endif + + *u++ = '%'; + if (modifier != 0) + *u++ = modifier; + *u++ = format_char; + *u = '\0'; + len = strftime (ubuf, sizeof ubuf, ufmt, tp); + if (len == 0 && ubuf[0] != '\0') + return 0; + cpy (len, ubuf); + } + break; + #endif + + case L_('C'): /* POSIX.2 extension. */ + if (modifier == L_('O')) + goto bad_format; + if (modifier == L_('E')) + { + #if HAVE_STRUCT_ERA_ENTRY + struct era_entry *era = _nl_get_era_entry (tp); + if (era) + { + # ifdef COMPILE_WIDE + size_t len = __wcslen (era->era_wname); + cpy (len, era->era_wname); + # else + size_t len = strlen (era->era_name); + cpy (len, era->era_name); + # endif + break; + } + #else + # if HAVE_STRFTIME + goto underlying_strftime; + # endif + #endif + } + + { + int year = tp->tm_year + TM_YEAR_BASE; + DO_NUMBER (1, year / 100 - (year % 100 < 0)); + } + + case L_('x'): + if (modifier == L_('O')) + goto bad_format; + #ifdef _NL_CURRENT + if (! (modifier == L_('E') + && (*(subfmt = + (const CHAR_T *)_NL_CURRENT (LC_TIME, NLW(ERA_D_FMT))) + != L_('\0')))) + subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_FMT)); + goto subformat; + #else + # if HAVE_STRFTIME + goto underlying_strftime; + # else + /* Fall through. */ + # endif + #endif + case L_('D'): /* POSIX.2 extension. */ + if (modifier != 0) + goto bad_format; + subfmt = L_("%m/%d/%y"); + goto subformat; + + case L_('d'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (2, tp->tm_mday); + + case L_('e'): /* POSIX.2 extension. */ + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER_SPACEPAD (2, tp->tm_mday); + + /* All numeric formats set DIGITS and NUMBER_VALUE and then + jump to one of these two labels. */ + + do_number_spacepad: + /* Force `_' flag unless overwritten by `0' flag. */ + if (pad != L_('0')) + pad = L_('_'); + + do_number: + /* Format the number according to the MODIFIER flag. */ + + if (modifier == L_('O') && 0 <= number_value) + { + #ifdef _NL_CURRENT + /* Get the locale specific alternate representation of + the number NUMBER_VALUE. If none exist NULL is returned. */ + # ifdef COMPILE_WIDE + const wchar_t *cp = _nl_get_walt_digit (number_value); + # else + const char *cp = _nl_get_alt_digit (number_value); + # endif + + if (cp != NULL) + { + size_t digitlen = STRLEN (cp); + if (digitlen != 0) + { + cpy (digitlen, cp); + break; + } + } + #else + # if HAVE_STRFTIME + goto underlying_strftime; + # endif + #endif + } + { + unsigned int u = number_value; + + bufp = buf + sizeof (buf) / sizeof (buf[0]); + negative_number = number_value < 0; + + if (negative_number) + u = -u; + + do + *--bufp = u % 10 + L_('0'); + while ((u /= 10) != 0); + } + + do_number_sign_and_padding: + if (negative_number) + *--bufp = L_('-'); + + if (pad != L_('-')) + { + int padding = digits - (buf + (sizeof (buf) / sizeof (buf[0])) + - bufp); + + if (pad == L_('_')) + { + while (0 < padding--) + *--bufp = L_(' '); + } + else + { + bufp += negative_number; + while (0 < padding--) + *--bufp = L_('0'); + if (negative_number) + *--bufp = L_('-'); + } + } + + cpy (buf + sizeof (buf) / sizeof (buf[0]) - bufp, bufp); + break; + + case L_('F'): + if (modifier != 0) + goto bad_format; + subfmt = L_("%Y-%m-%d"); + goto subformat; + + case L_('H'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (2, tp->tm_hour); + + case L_('I'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (2, hour12); + + case L_('k'): /* GNU extension. */ + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER_SPACEPAD (2, tp->tm_hour); + + case L_('l'): /* GNU extension. */ + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER_SPACEPAD (2, hour12); + + case L_('j'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (3, 1 + tp->tm_yday); + + case L_('M'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (2, tp->tm_min); + + case L_('m'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (2, tp->tm_mon + 1); + + case L_('N'): /* GNU extension. */ + if (modifier == L_('E')) + goto bad_format; + + number_value = ns; + if (width != -1) + { + /* Take an explicit width less than 9 as a precision. */ + int j; + for (j = width; j < 9; j++) + number_value /= 10; + } + + DO_NUMBER (9, number_value); + + case L_('n'): /* POSIX.2 extension. */ + add (1, *p = L_('\n')); + break; + + case L_('P'): + to_lowcase = 1; + #if !defined _NL_CURRENT && HAVE_STRFTIME + format_char = L_('p'); + #endif + /* FALLTHROUGH */ + + case L_('p'): + if (change_case) + { + to_uppcase = 0; + to_lowcase = 1; + } + #if defined _NL_CURRENT || !HAVE_STRFTIME + cpy (ap_len, ampm); + break; + #else + goto underlying_strftime; + #endif + + case L_('R'): /* ISO C99 extension. */ + subfmt = L_("%H:%M"); + goto subformat; + + case L_('r'): /* POSIX.2 extension. */ + #ifdef _NL_CURRENT + if (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, + NLW(T_FMT_AMPM))) + == L_('\0')) + #endif + subfmt = L_("%I:%M:%S %p"); + goto subformat; + + case L_('S'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (2, tp->tm_sec); + + case L_('s'): /* GNU extension. */ + { + struct tm ltm; + time_t t; + + ltm = *tp; + t = mktime (<m); + + /* Generate string value for T using time_t arithmetic; + this works even if sizeof (long) < sizeof (time_t). */ + + bufp = buf + sizeof (buf) / sizeof (buf[0]); + negative_number = t < 0; + + do + { + int d = t % 10; + t /= 10; + + if (negative_number) + { + d = -d; + + /* Adjust if division truncates to minus infinity. */ + if (0 < -1 % 10 && d < 0) + { + t++; + d += 10; + } + } + + *--bufp = d + L_('0'); + } + while (t != 0); + + digits = 1; + goto do_number_sign_and_padding; + } + + case L_('X'): + if (modifier == L_('O')) + goto bad_format; + #ifdef _NL_CURRENT + if (! (modifier == L_('E') + && (*(subfmt = + (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ERA_T_FMT))) + != L_('\0')))) + subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT)); + goto subformat; + #else + # if HAVE_STRFTIME + goto underlying_strftime; + # else + /* Fall through. */ + # endif + #endif + case L_('T'): /* POSIX.2 extension. */ + subfmt = L_("%H:%M:%S"); + goto subformat; + + case L_('t'): /* POSIX.2 extension. */ + add (1, *p = L_('\t')); + break; + + case L_('u'): /* POSIX.2 extension. */ + DO_NUMBER (1, (tp->tm_wday - 1 + 7) % 7 + 1); + + case L_('U'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (2, (tp->tm_yday - tp->tm_wday + 7) / 7); + + case L_('V'): + case L_('g'): /* ISO C99 extension. */ + case L_('G'): /* ISO C99 extension. */ + if (modifier == L_('E')) + goto bad_format; + { + int year = tp->tm_year + TM_YEAR_BASE; + int days = iso_week_days (tp->tm_yday, tp->tm_wday); + + if (days < 0) + { + /* This ISO week belongs to the previous year. */ + year--; + days = iso_week_days (tp->tm_yday + (365 + __isleap (year)), + tp->tm_wday); + } + else + { + int d = iso_week_days (tp->tm_yday - (365 + __isleap (year)), + tp->tm_wday); + if (0 <= d) + { + /* This ISO week belongs to the next year. */ + year++; + days = d; + } + } + + switch (*f) + { + case L_('g'): + DO_NUMBER (2, (year % 100 + 100) % 100); + + case L_('G'): + DO_NUMBER (1, year); + + default: + DO_NUMBER (2, days / 7 + 1); + } + } + + case L_('W'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (2, (tp->tm_yday - (tp->tm_wday - 1 + 7) % 7 + 7) / 7); + + case L_('w'): + if (modifier == L_('E')) + goto bad_format; + + DO_NUMBER (1, tp->tm_wday); + + case L_('Y'): + if (modifier == 'E') + { + #if HAVE_STRUCT_ERA_ENTRY + struct era_entry *era = _nl_get_era_entry (tp); + if (era) + { + # ifdef COMPILE_WIDE + subfmt = era->era_wformat; + # else + subfmt = era->era_format; + # endif + goto subformat; + } + #else + # if HAVE_STRFTIME + goto underlying_strftime; + # endif + #endif + } + if (modifier == L_('O')) + goto bad_format; + else + DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE); + + case L_('y'): + if (modifier == L_('E')) + { + #if HAVE_STRUCT_ERA_ENTRY + struct era_entry *era = _nl_get_era_entry (tp); + if (era) + { + int delta = tp->tm_year - era->start_date[0]; + DO_NUMBER (1, (era->offset + + delta * era->absolute_direction)); + } + #else + # if HAVE_STRFTIME + goto underlying_strftime; + # endif + #endif + } + DO_NUMBER (2, (tp->tm_year % 100 + 100) % 100); + + case L_('Z'): + if (change_case) + { + to_uppcase = 0; + to_lowcase = 1; + } + + #if HAVE_TZNAME + /* The tzset() call might have changed the value. */ + if (!(zone && *zone) && tp->tm_isdst >= 0) + zone = tzname[tp->tm_isdst]; + #endif + if (! zone) + zone = ""; /* POSIX.2 requires the empty string here. */ + + #ifdef COMPILE_WIDE + { + /* The zone string is always given in multibyte form. We have + to transform it first. */ + wchar_t *wczone; + size_t len; + widen (zone, wczone, len); + cpy (len, wczone); + } + #else + cpy (strlen (zone), zone); + #endif + break; + + case L_('z'): /* ISO C99 extension. */ + if (tp->tm_isdst < 0) + break; + + { + int diff; + #if HAVE_TM_GMTOFF + diff = tp->tm_gmtoff; + #else + if (ut) + diff = 0; + else + { + struct tm gtm; + struct tm ltm; + time_t lt; + + ltm = *tp; + lt = mktime (<m); + + if (lt == (time_t) -1) + { + /* mktime returns -1 for errors, but -1 is also a + valid time_t value. Check whether an error really + occurred. */ + struct tm tm; + + if (! my_strftime_localtime_r (<, &tm) + || ((ltm.tm_sec ^ tm.tm_sec) + | (ltm.tm_min ^ tm.tm_min) + | (ltm.tm_hour ^ tm.tm_hour) + | (ltm.tm_mday ^ tm.tm_mday) + | (ltm.tm_mon ^ tm.tm_mon) + | (ltm.tm_year ^ tm.tm_year))) + break; + } + + if (! my_strftime_gmtime_r (<, >m)) + break; + + diff = tm_diff (<m, >m); + } + #endif + + if (diff < 0) + { + add (1, *p = L_('-')); + diff = -diff; + } + else + add (1, *p = L_('+')); + + diff /= 60; + DO_NUMBER (4, (diff / 60) * 100 + diff % 60); + } + + case L_('\0'): /* GNU extension: % at end of format. */ + --f; + /* Fall through. */ + default: + /* Unknown format; output the format, including the '%', + since this is most likely the right thing to do if a + multibyte string has been misparsed. */ + bad_format: + { + int flen; + for (flen = 1; f[1 - flen] != L_('%'); flen++) + continue; + cpy (flen, &f[1 - flen]); + } + break; + } + } + + if (p && maxsize != 0) + *p = L_('\0'); + return i; + } + + + #ifdef emacs + /* For Emacs we have a separate interface which corresponds to the normal + strftime function plus the ut argument, but without the ns argument. */ + size_t + emacs_strftimeu (s, maxsize, format, tp, ut) + char *s; + size_t maxsize; + const char *format; + const struct tm *tp; + int ut; + { + return my_strftime (s, maxsize, format, tp, ut, 0); + } + #endif diff -crN gawk-3.1.0/missing_d/strtod.c gawk-3.1.1/missing_d/strtod.c *** gawk-3.1.0/missing_d/strtod.c Tue Sep 19 14:16:14 2000 --- gawk-3.1.1/missing_d/strtod.c Fri Aug 3 08:57:42 2001 *************** *** 22,27 **** --- 22,30 ---- * * Fall 2000: Changed to enforce C89 semantics, so that 0x... returns 0. * C99 has hexadecimal floating point numbers. + * + * Summer 2001. Try to make it smarter, so that a string like "0000" + * doesn't look like we failed. Sigh. */ #if 0 *************** *** 36,43 **** register const char **ptr; { double ret = 0.0; ! const char *start = s; ! const char *begin = NULL; int success = 0; /* optional white space */ --- 39,46 ---- register const char **ptr; { double ret = 0.0; ! const char *start = s; /* save original start of string */ ! const char *begin = NULL; /* where the number really begins */ int success = 0; /* optional white space */ *************** *** 98,104 **** ret = atof(begin); out: ! if (! success) s = start; /* in case all we did was skip whitespace */ if (ptr) --- 101,107 ---- ret = atof(begin); out: ! if (! success && s == begin) s = start; /* in case all we did was skip whitespace */ if (ptr) diff -crN gawk-3.1.0/patchlev.h gawk-3.1.1/patchlev.h *** gawk-3.1.0/patchlev.h Tue May 15 19:46:46 2001 --- gawk-3.1.1/patchlev.h Tue Apr 30 18:54:24 2002 *************** *** 1 **** ! #define PATCHLEVEL 0 --- 1 ---- ! #define PATCHLEVEL "1" diff -crN gawk-3.1.0/pc/ChangeLog gawk-3.1.1/pc/ChangeLog *** gawk-3.1.0/pc/ChangeLog Sun Jun 3 13:05:23 2001 --- gawk-3.1.1/pc/ChangeLog Wed May 1 16:42:07 2002 *************** *** 1,3 **** --- 1,58 ---- + Wed May 1 16:41:32 2002 Arnold D. Robbins + + * Release 3.1.1: Release tar file made. + + Thu Apr 18 17:29:16 2002 Scott Deifik + + * Makefile.tst (strftime): Remove comment on call to $(CMP). + + Sun Mar 10 17:05:35 2002 Scott Deifik + + * Makefile.tst: More clean up and sync with ../test/Makefile. + + Thu Jan 3 15:20:17 2002 Scott Deifik + + * Makefile.tst: Minor clean up and sync with ../test/Makefile. + + Wed Dec 19 16:01:58 2001 Peter J. Farley III + + * gawkmisc.pc: Just use single quote for `quote' for all cases. + + Wed Dec 19 15:59:52 2001 Eli Zaretskii + + * install.awk: Install gawkinet.info as well. + * awklib/igawk.awk: Bring in sync with awklib/eg/prog/igawk.sh. + * makefile (PRSPFILE, PRSP, PLDRSP, DO_PLNK, DO_PBIND, PLDJG): New + variables. + (djgpp, djgpp-debug): Set PLNK and PBIND. + (PBIND): Define to EMPTY as default. + (PAWKOBJS1, PAWKOBJS2, PGAWKOBJS): New variables. + (all): Add pgawk.exe. + (pgawk.exe, $(PRSPFILE)): New rules. + ($(ALLOBJS)): Add eval_p.o and profile_p.o to the list of files + that are dependent on awk.h, dfa.h, regex.h, and config.h. + (eval_p$O, profile_p$O): New dependencies. + (clean): Add pgawk and $(PRSPFILE) to files that are to be cleaned + up. + + Tue Dec 4 16:44:07 2001 Andreas Buening + + Updated OS/2 support. + + * gawkmisc.pc (quote): Use single quote for __EMX__. + (os_arg_fixup): new OS/2 code. + (os_devopen): for OS/2 return -1. + (ispath): check for leading drive letter for __EMX__. + (os_close_on_exec): Add check for defined __EMX__. + (os_is_setuid): Add real code for __EMX__. + (_os2_is_abs_path): new function. + (_os2_unixroot): new function. + (_os2_unixroot_path): new function. + + Tue Sep 25 15:19:53 2001 Arnold D. Robbins + + * gawkmisc.pc (os_close_on_exec): If fd <= 2, return. + Sun Jun 3 13:04:44 2001 Arnold D. Robbins * Release 3.1.0: Release tar file made. And there was diff -crN gawk-3.1.0/pc/Makefile gawk-3.1.1/pc/Makefile *** gawk-3.1.0/pc/Makefile Wed Jan 3 06:01:34 2001 --- gawk-3.1.1/pc/Makefile Wed Dec 19 15:56:30 2001 *************** *** 37,42 **** --- 37,43 ---- #======================= Configuration ================================== RSPFILE = gawk.rsp + PRSPFILE = pgawk.rsp # # Choose method for passing arguments to the linker. # *************** *** 54,60 **** --- 55,63 ---- # # else use brain-dead approach (emxbnd will need 'tr'). RSP = $(RSPFILE) + PRSP = $(PRSPFILE) LDRSP = @$(RSP) + PLDRSP = @$(PRSP) LNKRSP = $(LDRSP) #------------------------------------------------------------------------ # Some makes do not define MAKE (and ndmake does not allow a define). *************** *** 84,89 **** --- 87,94 ---- # and then comment the following: DO_LNK = $($(LNK)) DO_BIND= $($(BIND)) + DO_PLNK = $($(PLNK)) + DO_PBIND= $($(PBIND)) #======================================================================== # End of general configuration. Some platform-specific configuration # notes appear below. *************** *** 93,111 **** #======================================================================== LDJG = $(CC) $(LF) -o gawk.exe $(LDRSP) $(LF2) BDJG = stubify -g awk.exe | stubedit awk.exe runfile=gawk djgpp: $(MAK) all \ CC=gcc O=.o CF=-O2 \ ! LNK=LDJG LF=-s LF2=-lm \ ! BIND=BDJG djgpp-debug: $(MAK) all \ CC=gcc O=.o CF='-O2 -g' \ ! LNK=LDJG LF2=-lm \ ! BIND=BDJG LDJGv1 = $(CC) $(LF) -o gawk $(LDRSP) $(LF2) #BDJGv1 = coff2exe -s /djgpp/bin/go32.exe gawk --- 98,117 ---- #======================================================================== LDJG = $(CC) $(LF) -o gawk.exe $(LDRSP) $(LF2) + PLDJG = $(CC) $(LF) -o pgawk.exe $(PLDRSP) $(LF2) BDJG = stubify -g awk.exe | stubedit awk.exe runfile=gawk djgpp: $(MAK) all \ CC=gcc O=.o CF=-O2 \ ! LNK=LDJG PLNK=PLDJG LF=-s LF2=-lm \ ! BIND=BDJG PBIND='' djgpp-debug: $(MAK) all \ CC=gcc O=.o CF='-O2 -g' \ ! LNK=LDJG PLNK=PLDJG LF2=-lm \ ! BIND=BDJG PBIND='' LDJGv1 = $(CC) $(LF) -o gawk $(LDRSP) $(LF2) #BDJGv1 = coff2exe -s /djgpp/bin/go32.exe gawk *************** *** 281,286 **** --- 287,293 ---- # Define BIND for BINDless compiles, otherwise $($(BIND)) may break. BIND = EMPTY + PBIND = EMPTY EMPTY= # bitwise operations (-DBITOPS) and non-decimal input data (-DNONDECDATA) are *************** *** 290,295 **** --- 297,304 ---- # object files AWKOBJS1 = array$O builtin$O eval$O field$O gawkmisc$O io$O main$O AWKOBJS2 = ext$O msg$O node$O profile$O re$O version$O + PAWKOBJS1 = array$O builtin$O eval_p$O field$O gawkmisc$O io$O main$O + PAWKOBJS2 = ext$O msg$O node$O profile_p$O re$O version$O AWKOBJS = $(AWKOBJS1) $(AWKOBJS2) ALLOBJS = $(AWKOBJS) awkgram$O getid$O $(OBJ) *************** *** 299,304 **** --- 308,314 ---- LIBOBJS= getopt$O getopt1$O regex$O dfa$O random$O GAWKOBJS = $(ALLOBJS) $(LIBOBJS) + PGAWKOBJS = $(PAWKOBJS1) $(PAWKOBJS2) awkgram$O getid$O $(OBJ) # clear out suffixes list # .SUFFIXES: *************** *** 308,325 **** $(CC) -c $(CFLAGS) $< # rules to build gawk ! all : gawk.exe gawk.exe:: $(GAWKOBJS) $(RSP) $(DO_LNK) $(DO_BIND) $(RSPFILE) : $(GAWKOBJS) echo $(AWKOBJS1)$P > $@ echo $(AWKOBJS2)$P >> $@ echo awkgram$O getid$O $(OBJ) $(LIBOBJS)$P >> $@ ! $(ALLOBJS): awk.h dfa.h regex.h config.h gawkmisc$O: pc/gawkmisc.pc --- 318,344 ---- $(CC) -c $(CFLAGS) $< # rules to build gawk ! all : gawk.exe pgawk.exe gawk.exe:: $(GAWKOBJS) $(RSP) $(DO_LNK) $(DO_BIND) + pgawk.exe:: $(PGAWKOBJS) $(PRSP) + $(DO_PLNK) + $(DO_PBIND) + $(RSPFILE) : $(GAWKOBJS) echo $(AWKOBJS1)$P > $@ echo $(AWKOBJS2)$P >> $@ echo awkgram$O getid$O $(OBJ) $(LIBOBJS)$P >> $@ ! $(PRSPFILE) : $(PGAWKOBJS) ! echo $(PAWKOBJS1)$P > $@ ! echo $(PAWKOBJS2)$P >> $@ ! echo awkgram$O getid$O $(OBJ) $(LIBOBJS)$P >> $@ ! ! $(ALLOBJS) eval_p$O profile_p$O: awk.h dfa.h regex.h config.h gawkmisc$O: pc/gawkmisc.pc *************** *** 329,334 **** --- 348,357 ---- main$O: patchlev.h + eval_p$O: eval.c + + profile_p$O: profile.c + # A bug in ndmake requires the following rule awkgram$O: awk.h awkgram.c $(CC) -c $(CFLAGS) awkgram.c *************** *** 358,364 **** gawk -v prefix=$(prefix) -f install.awk clean: ! rm -rf gawk gawk.exe gawk.map *.o *.obj core a.out $(RSPFILE) # cd doc && $(MAKE) clean # cd test && $(MAKE) clean # cd awklib && $(MAKE) clean --- 381,387 ---- gawk -v prefix=$(prefix) -f install.awk clean: ! rm -rf gawk pgawk *.exe gawk.map *.o *.obj core a.out $(RSPFILE) $(PRSPFILE) # cd doc && $(MAKE) clean # cd test && $(MAKE) clean # cd awklib && $(MAKE) clean diff -crN gawk-3.1.0/pc/Makefile.tst gawk-3.1.1/pc/Makefile.tst *** gawk-3.1.0/pc/Makefile.tst Wed Mar 7 10:04:36 2001 --- gawk-3.1.1/pc/Makefile.tst Thu Apr 18 17:28:55 2002 *************** *** 1,6 **** # Makefile for GNU Awk test suite. # ! # Copyright (C) 1988-2001 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. --- 1,6 ---- # Makefile for GNU Awk test suite. # ! # Copyright (C) 1988-2002 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. *************** *** 67,72 **** --- 67,74 ---- # Set your cmp command here (you can use most versions of diff instead of cmp # if you don't want to convert the .ok files to the DOS CR/LF format). + # This is also an issue for the "mmap8k" test. If it fails, make sure that + # mmap8k.in has CR/LFs or that you've used diff. # # The following comment is for users of OSs which support long file names # (such as Windows 95) for all versions of gawk (both 16 & 32-bit). *************** *** 79,86 **** # needs to be an environment variable. #CMP = cmp # See the comment above for why you might want to set CMP to "env LFN=n diff" ! CMP = env LFN=n diff ! #CMP = diff #CMP = diff -c #CMP = gcmp --- 81,88 ---- # needs to be an environment variable. #CMP = cmp # See the comment above for why you might want to set CMP to "env LFN=n diff" ! #CMP = env LFN=n diff ! CMP = diff #CMP = diff -c #CMP = gcmp *************** *** 105,112 **** srcdir = . - bigtest: basic unix-tests gawk-extensions - # message stuff is to make it a little easier to follow check: msg \ basic-msg-start basic basic-msg-end \ --- 107,112 ---- *************** *** 115,133 **** # try to keep these sorted basic: addcomma anchgsub argarray arrayparm arrayref arynasty arynocls \ ! arysubnm asgext awkpath back89 backgsub childin clobber clsflnam \ ! compare convfmt datanonl defref delarprm dynlj eofsplit fldchg \ ! fldchgnf fnamedat fnarray fnarydel fnaryscl fnasgnm fnparydl \ ! fsbs fsrs fstabplus funsmnam funstack getline getlnbuf getnr2tb \ ! getnr2tm gsubasgn gsubtest hsprint intest intprec leaddig litoct \ ! longwrds math messages mmap8k nasty nasty2 negexp nfldstr nfset \ ! nlfldsep nlinstr nlstrina noeffect nofmtch nonl noparms nors \ ! numindex numsubstr octsub ofmt ofmtbig ofmts opasnidx opasnslf \ ! paramdup paramtyp parseme pcntplus prdupval printf1 prmarscl \ ! prmreuse prt1eval prtoeval psx96sub rand rebt8b1 rebt8b2 redfilnm \ ! regeq reindops reparse resplit rs rsnul1nl rswhite sclforin \ ! sclifin splitargv splitdef splitvar splitwht sprintfc strtod \ ! subslash substr swaplns tradanch tweakfld zeroflag unix-tests: fflush getlnhd pid pipeio1 pipeio2 poundba strftlng --- 115,134 ---- # try to keep these sorted basic: addcomma anchgsub argarray arrayparm arrayref arynasty arynocls \ ! arysubnm arrymem1 asgext awkpath back89 backgsub childin clobber \ ! clsflnam compare compare2 concat1 convfmt datanonl defref delarprm dynlj eofsplit \ ! fldchg fldchgnf fnamedat fnarray fnarydel fnaryscl fnasgnm \ ! fnparydl forsimp fsbs fsrs fstabplus funsemnl funsmnam funstack getline \ ! getlnbuf getnr2tb getnr2tm gsubasgn gsubtest hsprint intest \ ! intprec leaddig leadnl litoct longsub longwrds math membug1 messages minusstr \ ! mmap8k nasty nasty2 negexp nfldstr nfset nlfldsep nlinstr nlstrina \ ! noeffect nofmtch nonl noparms nors numindex numsubstr octsub \ ! ofmt ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf paramdup paramtyp \ ! parseme pcntplus prdupval printf1 prmarscl prmreuse prt1eval \ ! prtoeval psx96sub rand rebt8b1 rebt8b2 redfilnm regeq reindops \ ! reparse resplit rs rsnul1nl rswhite sclforin sclifin splitargv \ ! splitdef splitvar splitwht sprintfc strtod subslash substr \ ! swaplns tradanch tweakfld zeroflag unix-tests: fflush getlnhd pid pipeio1 pipeio2 poundba strftlng *************** *** 186,193 **** @rm -f /tmp/gawk.exe swaplns:: - @echo 'If swaplns fails make sure that all of the .ok files have CR/LFs.' - @echo 'Or, set CMP to use diff.' @$(AWK) -f $(srcdir)/swaplns.awk $(srcdir)/swaplns.in >_$@ -$(CMP) $(srcdir)/swaplns.ok _$@ && rm -f _$@ --- 187,192 ---- *************** *** 231,238 **** @echo 'Some of the output from regtest is very system specific, do not' @echo 'be distressed if your output differs from that distributed.' @echo 'Manual inspection is called for.' ! # AWK=`pwd`/$(AWK) $(srcdir)/regtest.awk ! AWK=`pwd`/$(AWK) CMP="$(CMP)" $(srcdir)/regtest posix:: @echo 'posix test may fail due to 1.500000e+000 not being equal to' --- 230,237 ---- @echo 'Some of the output from regtest is very system specific, do not' @echo 'be distressed if your output differs from that distributed.' @echo 'Manual inspection is called for.' ! # AWK=`pwd`/$(AWK) $(srcdir)/regtest.sh ! AWK=`pwd`/$(AWK) CMP="$(CMP)" $(srcdir)/regtest.sh posix:: @echo 'posix test may fail due to 1.500000e+000 not being equal to' *************** *** 249,255 **** @echo 'If manyfiles says "junk/*: No such file or directory",' @echo 'use the line on test/Makefile which invokes wc' @echo 'without quoting the "junk/*" argument.' - # @echo "This number better be 1 ->" | tr -d '\012' @echo "This number better be 1 ->" | tr -d '\012\015' @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l # @wc -l "junk/*" | $(AWK) '$$1 != 2' | wc -l --- 248,253 ---- *************** *** 359,369 **** strftime:: : this test could fail on slow machines or on a second boundary, : so if it does, double check the actual results ! @echo 'It will also fail using DJGPP because DJGPP does not' ! @echo 'have a default timezone.' # @LC_ALL=C; export LC_ALL; LANG=C; export LANG; \ # date | $(AWK) -v OUTPUT=_$@ -f $(srcdir)/strftime.awk @LC_ALL=C; export LC_ALL; LANG=C; export LANG; \ $(DATE) | $(AWK) -v OUTPUT=_$@ -f $(srcdir)/strftime.awk -$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0 --- 357,368 ---- strftime:: : this test could fail on slow machines or on a second boundary, : so if it does, double check the actual results ! # We set TZ to make sure that we properly set the timezone. # @LC_ALL=C; export LC_ALL; LANG=C; export LANG; \ + # TZ=GMT0; export TZ; \ # date | $(AWK) -v OUTPUT=_$@ -f $(srcdir)/strftime.awk @LC_ALL=C; export LC_ALL; LANG=C; export LANG; \ + TZ=GMT0; export TZ; \ $(DATE) | $(AWK) -v OUTPUT=_$@ -f $(srcdir)/strftime.awk -$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0 *************** *** 468,474 **** -$(CMP) $(srcdir)/clsflnam.ok _$@ && rm -f _$@ mmap8k:: - @echo 'If mmap8k fails make sure that mmap8k.in has CR/LFs.' @$(AWK) '{ print }' $(srcdir)/mmap8k.in >_$@ -$(CMP) $(srcdir)/mmap8k.in _$@ && rm -f _$@ --- 467,472 ---- *************** *** 551,558 **** -$(CMP) $(srcdir)/nfldstr.ok _$@ && rm -f _$@ nors:: ! # @echo A B C D E | tr -d '\12' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@ ! @echo A B C D E | tr -d '\15\12' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@ -$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@ fnarydel:: --- 549,555 ---- -$(CMP) $(srcdir)/nfldstr.ok _$@ && rm -f _$@ nors:: ! @echo A B C D E | tr -d '\12\15' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@ -$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@ fnarydel:: *************** *** 832,838 **** addcomma:: @echo 'If addcomma fails, set try setting LFN=n in your environment' @echo "before running make. If that still doesn't work, read the" ! @echo 'the comment in this makefile about setting CMP for information' @echo 'about what may be happenning.' @$(AWK) -f $(srcdir)/addcomma.awk $(srcdir)/addcomma.in >_$@ -$(CMP) $(srcdir)/addcomma.ok _$@ && rm -f _$@ --- 829,835 ---- addcomma:: @echo 'If addcomma fails, set try setting LFN=n in your environment' @echo "before running make. If that still doesn't work, read the" ! @echo 'comment in this makefile about setting CMP for information' @echo 'about what may be happenning.' @$(AWK) -f $(srcdir)/addcomma.awk $(srcdir)/addcomma.in >_$@ -$(CMP) $(srcdir)/addcomma.ok _$@ && rm -f _$@ *************** *** 849,854 **** --- 846,895 ---- @$(AWK) -f $(srcdir)/rebt8b2.awk >_$@ -$(CMP) $(srcdir)/rebt8b2.ok _$@ && rm -f _$@ + leadnl:: + @$(AWK) -f $(srcdir)/leadnl.awk $(srcdir)/leadnl.in >_$@ + -$(CMP) $(srcdir)/leadnl.ok _$@ && rm -f _$@ + + funsemnl:: + @$(AWK) -f $(srcdir)/funsemnl.awk >_$@ + -$(CMP) $(srcdir)/funsemnl.ok _$@ && rm -f _$@ + + ofmtfidl:: + @$(AWK) -f $(srcdir)/ofmtfidl.awk $(srcdir)/ofmtfidl.in >_$@ + -$(CMP) $(srcdir)/ofmtfidl.ok _$@ && rm -f _$@ + + onlynl:: + @$(AWK) -f $(srcdir)/onlynl.awk $(srcdir)/onlynl.in >_$@ + -$(CMP) $(srcdir)/onlynl.ok _$@ && rm -f _$@ + + arrymem1:: + @$(AWK) -f $(srcdir)/arrymem1.awk >_$@ + -$(CMP) $(srcdir)/arrymem1.ok _$@ && rm -f _$@ + + compare2:: + @$(AWK) -f $(srcdir)/compare2.awk >_$@ + -$(CMP) $(srcdir)/compare2.ok _$@ && rm -f _$@ + + minusstr:: + @$(AWK) -f $(srcdir)/minusstr.awk >_$@ + -$(CMP) $(srcdir)/minusstr.ok _$@ && rm -f _$@ + + membug1:: + @$(AWK) -f $(srcdir)/membug1.awk $(srcdir)/membug1.in >_$@ + -$(CMP) $(srcdir)/membug1.ok _$@ && rm -f _$@ + + forsimp:: + @$(AWK) -f $(srcdir)/forsimp.awk >_$@ + -$(CMP) $(srcdir)/forsimp.ok _$@ && rm -f _$@ + + concat1:: + @$(AWK) -f $(srcdir)/concat1.awk $(srcdir)/concat1.in >_$@ + -$(CMP) $(srcdir)/concat1.ok _$@ && rm -f _$@ + + longsub:: + @$(AWK) -f $(srcdir)/longsub.awk $(srcdir)/longsub.in >_$@ + -$(CMP) $(srcdir)/longsub.ok _$@ && rm -f _$@ + clean: rm -fr _* core junk out1 out2 out3 strftime.ok test1 test2 seq *~ diff -crN gawk-3.1.0/pc/awklib/igawk.awk gawk-3.1.1/pc/awklib/igawk.awk *** gawk-3.1.0/pc/awklib/igawk.awk Fri Dec 15 20:09:45 1995 --- gawk-3.1.1/pc/awklib/igawk.awk Wed Dec 19 15:56:30 2001 *************** *** 34,49 **** } fpath = pathto($2) if (fpath == "") { ! printf("igawk:%s:%d: cannot find %s\n", \ input[stackptr], FNR, $2) > "/dev/stderr" continue } if (! (fpath in processed)) { processed[fpath] = input[stackptr] ! input[++stackptr] = fpath } else ! print $2, "included in", input[stackptr], \ ! "already included in", \ processed[fpath] > "/dev/stderr" } close(input[stackptr]) --- 34,49 ---- } fpath = pathto($2) if (fpath == "") { ! printf("igawk:%s:%d: cannot find %s\n", input[stackptr], FNR, $2) > "/dev/stderr" continue } if (! (fpath in processed)) { processed[fpath] = input[stackptr] ! input[++stackptr] = fpath # push onto stack } else ! print $2, "included in", input[stackptr], ! "already included in", processed[fpath] > "/dev/stderr" } close(input[stackptr]) diff -crN gawk-3.1.0/pc/config.h gawk-3.1.1/pc/config.h *** gawk-3.1.0/pc/config.h Tue Jan 30 10:56:00 2001 --- gawk-3.1.1/pc/config.h Tue Apr 16 14:59:38 2002 *************** *** 5,11 **** */ /* ! * Copyright (C) 1995-2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. --- 5,11 ---- */ /* ! * Copyright (C) 1995-2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. diff -crN gawk-3.1.0/pc/gawkmisc.pc gawk-3.1.1/pc/gawkmisc.pc *** gawk-3.1.0/pc/gawkmisc.pc Sun Jan 28 15:49:25 2001 --- gawk-3.1.1/pc/gawkmisc.pc Tue Apr 16 14:58:11 2002 *************** *** 1,9 **** /* ! * gawkmisc.c --- miscellanious gawk routines that are OS specific. */ /* ! * Copyright (C) 1986, 1988, 1989, 1991 - 2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Progamming Language. --- 1,9 ---- /* ! * gawkmisc.c --- miscellaneous gawk routines that are OS specific. */ /* ! * Copyright (C) 1986, 1988, 1989, 1991 - 2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Progamming Language. *************** *** 23,34 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ ! char quote = '"'; ! char envsep = ';'; ! #ifdef DEFPATH char *defpath = DEFPATH; ! #else char *defpath = ".;c:\\lib\\awk;c:\\gnu\\lib\\awk"; #endif /* gawk_name --- pull out the "gawk" part from how the OS called us */ --- 23,41 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ ! char quote = '\''; ! char envsep = ';'; ! ! # ifdef DEFPATH char *defpath = DEFPATH; ! # else char *defpath = ".;c:\\lib\\awk;c:\\gnu\\lib\\awk"; + # endif + + #ifdef __EMX__ + static int _os2_is_abs_path(const char *dirname); + static char* _os2_unixroot(const char *path); + static const char* _os2_unixroot_path(const char *path); #endif /* gawk_name --- pull out the "gawk" part from how the OS called us */ *************** *** 60,69 **** char ***argvp; { #ifdef __EMX__ ! _response(argcp, argvp); _wildcard(argcp, argvp); setvbuf(stdout, NULL, _IOLBF, BUFSIZ); ! #endif return; } --- 67,82 ---- char ***argvp; { #ifdef __EMX__ ! # ifdef initialize_main ! initialize_main(argcp, argvp); ! # else _wildcard(argcp, argvp); + _response(argcp, argvp); + # endif + setvbuf(stdout, NULL, _IOLBF, BUFSIZ); ! defpath = (char*) _os2_unixroot_path(defpath); ! #endif /* __EMX__ */ return; } *************** *** 74,79 **** --- 87,96 ---- const char *name; int flag; { + #ifdef __EMX__ + /* do not use open(name, flag) here !!! */ + return -1; + #else if (strcmp(name, "/dev/null") == 0) return open("NUL", flag); /* FIXME: */ *************** *** 81,86 **** --- 98,104 ---- * return open("???", flag); */ return -1; + #endif } /* optimal_bufsize --- determine optimal buffer size */ *************** *** 101,113 **** */ #define DEFBLKSIZE BUFSIZ - if (isatty(fd)) - return BUFSIZ; if (fstat(fd, stb) == -1) fatal("can't stat fd %d (%s)", fd, strerror(errno)); ! if (lseek(fd, (off_t)0, 0) == -1) /* not a regular file */ ! return DEFBLKSIZE; ! if (stb->st_size > 0 && stb->st_size < DEFBLKSIZE) /* small file */ return stb->st_size; return DEFBLKSIZE; } --- 119,128 ---- */ #define DEFBLKSIZE BUFSIZ if (fstat(fd, stb) == -1) fatal("can't stat fd %d (%s)", fd, strerror(errno)); ! if (S_ISREG(stb->st_mode) ! && 0 < stb->st_size && stb->st_size < DEFBLKSIZE) /* small file */ return stb->st_size; return DEFBLKSIZE; } *************** *** 118,123 **** --- 133,142 ---- ispath(file) const char *file; { + #ifdef __EMX__ + return (strpbrk(file, "/\\") != NULL || + (toupper(file[0]) >= 'A' && toupper(file[0]) <= 'Z' && file[1] == ':')); + #else for (; *file; file++) { switch (*file) { case '/': *************** *** 127,132 **** --- 146,152 ---- } } return 0; + #endif } /* isdirpunct --- return true if char is a directory separator */ *************** *** 146,156 **** const char *name, *what, *dir; { #if ! defined(_MSC_VER) && ! defined(__MINGW32__) ! #if defined(__DJGPP__) && (__DJGPP__ > 2 || __DJGPP_MINOR__ >= 4) if (fcntl(fd, F_SETFD, 1) < 0) warning("%s %s `%s': could not set close-on-exec: %s", what, dir, name, strerror(errno)); ! #endif #endif } --- 166,179 ---- const char *name, *what, *dir; { #if ! defined(_MSC_VER) && ! defined(__MINGW32__) ! # if (defined(__DJGPP__) && (__DJGPP__ > 2 || __DJGPP_MINOR__ >= 4)) || defined __EMX__ ! if (fd <= 2) /* sanity */ ! return; ! if (fcntl(fd, F_SETFD, 1) < 0) warning("%s %s `%s': could not set close-on-exec: %s", what, dir, name, strerror(errno)); ! # endif #endif } *************** *** 174,180 **** --- 197,212 ---- int os_is_setuid() { + #ifdef __EMX__ + long uid, euid; + + uid = getuid(); + euid = geteuid(); + + return (euid == 0 && euid != uid); + #else return 0; + #endif } /* os_setbinmode --- set binary mode on file */ *************** *** 210,212 **** --- 242,417 ---- setmode(fd, orig_tty_mode); } } + + + #ifdef __EMX__ + # ifndef PATH_SEPARATOR + # define PATH_SEPARATOR ';' + # endif + + /* result is 0 if dirname is no absolute path, 1 otherwise */ + + static int + _os2_is_abs_path(const char *dirname) + { + int result = 0; + if (dirname != NULL && dirname[0] != '\0') { + /* if dirname contains a valid drive letter like "c:" */ + if (((dirname[0] >= 'A' && dirname[0] <= 'Z') || (dirname[0] >= 'a' && dirname[0] <= 'z')) + && dirname[1] == ':') dirname += 2; /* remove the drive letter */ + + if (dirname[0] == '/' || dirname[0] == '\\') result = 1; /* asbolute path */ + } + + return result; + } + + + /* path is assumed to be a list of directories separated by PATH_SEPARATOR. + This function determines if the first directory of path is on the + drive specified by the environment variable UNIXROOT. + If it is the case, NULL is returned, otherwise a new directory name + is allocated using the drive letter from UNIXROOT and returned as result. + If the first directory is a relative path NULL is returned, too. + The new directory name is allocated by malloc(). + Example (UNIXROOT is set to "e:"): + "c:/usr/share" -> "e:/usr/share" + "e:/usr/share" -> NULL (already on the $UNIXROOT drive) + "/usr/share" -> "e:/usr/share" + "." -> NULL (not an absolute path) + "usr/share" -> NULL (not an absolute path) + "c:usr/share" -> NULL (not an absolute path) + "c:/usr/share;d:/etc" -> "e:/usr/share" (only the first directory in path is used) */ + + static char* + _os2_unixroot(const char *path) + { + static const char *unixroot = NULL; + static int unixroot_init = 0; + char *result = NULL; + + if (unixroot_init == 0) { + /* get $UNIXROOT only one time */ + unixroot = getenv("UNIXROOT"); + + /* check whether unixroot is valid (must be "x:") */ + if (unixroot != NULL) { + int drive = toupper(unixroot[0]); + if (drive < 'A' || drive > 'Z' || unixroot[1] != ':' || unixroot[2] != '\0') + unixroot = NULL; /* unixroot not valid */ + } + + unixroot_init = 1; /* initialized */ + } + + /* note: if unixroot != NULL then it contains a valid drive letter */ + if (unixroot != NULL && _os2_is_abs_path(path)) { + /* dirname is an absolute path and unixroot is a drive letter, "c:" for example */ + size_t old_path_len = strlen(path); + + /* end points to the first ';' in path or to NULL */ + const char *end = strchr(path, PATH_SEPARATOR); + + /* dir_len is the length of the first directory in path */ + size_t dir_len = (end) ? end - path : old_path_len; + + if (toupper(unixroot[0]) != toupper(path[0]) || path[1] != ':') { + /* the first directory of path does not start with the string $UNIXROOT */ + if (path[1] == ':') { + /* if there is a drive letter remove it */ + dir_len -= 2; + path += 2; + } + + result = malloc(dir_len + 3); + if (result) { /* do nothing if we are out of memory */ + result[0] = unixroot[0]; + result[1] = unixroot[1]; + memcpy(result + 2, path, dir_len); + result[dir_len + 2] = '\0'; + } + } + } + return result; + } + + /* path is assumed to be a list of directories separated by PATH_SEPARATOR. + Every directory is processed. _os2_unixroot() is used to find out whether + these directories are on the drive specified by the environment variable + UNIXROOT. If this is not the case the same directory on the UNIXROOT drive + is added to the end of path. If path is a valid path this function returns a valid path, too. + Example ($UNIXROOT is set to "e:"): + ".;c:/usr/local;d:/usr/local;d:/etc;e:/etc" + -> ".;c:/usr/local;d:/usr/local;d:/etc;e:/etc;e:/usr/local;e:/usr/local;e:/etc" */ + + static const char* + _os2_unixroot_path(const char *path) + { + char *result = NULL; + const char *p = path; + unsigned dir_count = 1; + + if (path == NULL || path[0] == '\0') return NULL; /* empty path */ + + /* save number of path components in dir_count */ + while(*p) { + if (*p++ == PATH_SEPARATOR && *p != '\0' && *p != PATH_SEPARATOR) + dir_count += 1; + } + + { + const char *list[dir_count]; /* list of char pointers */ + size_t dir_len[dir_count]; /* the according directory length */ + size_t old_path_len = strlen(path); /* the old path length */ + size_t total_len; + unsigned i = 0; + + if (path[old_path_len - 1] == PATH_SEPARATOR) /* last character is ';' */ + old_path_len--; + + list[0] = p = path; /* first directory */ + + while(*p) { + if (*p++ == PATH_SEPARATOR && *p != '\0' && *p != PATH_SEPARATOR) + list[++i] = p; + } + /* now list[i] contains the ith directory of path (no 0-terminated strings!!!) */ + + /* determine the total length for the new path */ + total_len = old_path_len; + + for(i = 0; i < dir_count; i++) { + list[i] = _os2_unixroot(list[i]); + if (list[i] != NULL) { + dir_len[i] = strlen(list[i]); + total_len += dir_len[i] + 1; /* one character for ';' or '\0' */ + } + else dir_len[i] = 0; + } + /* now list[] contains the according directories on the UNIXROOT drive or NULL + total_len contains the total length for the new path */ + result = malloc(total_len + 1); + + if (result) { + /* copy the old path and the new directories into the new path */ + char *q = result; + memcpy(q, path, old_path_len); + q += old_path_len; + + for(i = 0; i < dir_count; i++) { + if (dir_len[i] != 0) { + *q++ = PATH_SEPARATOR; + memcpy(q, list[i], dir_len[i]); + q += dir_len[i]; + } + } + + *q = '\0'; /* terminating '\0' */ + } + + for(i = 0; i++; i < dir_count) free((void*) list[i]); + } + + return (result) ? (const char*) result : path; + } + #endif /* __EMX__ */ diff -crN gawk-3.1.0/pc/install.awk gawk-3.1.1/pc/install.awk *** gawk-3.1.0/pc/install.awk Wed Jun 4 19:38:03 1997 --- gawk-3.1.1/pc/install.awk Wed Dec 19 15:56:30 2001 *************** *** 58,61 **** --- 58,62 ---- cp("awklib/eg/lib/* pc/awklib/igawk.awk " prefix "/lib/awk"); cp("doc/*.1 " prefix "/man/man1"); cp("doc/gawk.info " prefix "/info"); + cp("doc/gawkinet.info " prefix "/info"); } diff -crN gawk-3.1.0/po/ChangeLog gawk-3.1.1/po/ChangeLog *** gawk-3.1.0/po/ChangeLog Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/ChangeLog Wed May 1 16:42:09 2002 *************** *** 0 **** --- 1,9 ---- + Wed May 1 16:41:32 2002 Arnold D. Robbins + + * Release 3.1.1: Release tar file made. + + 2002-04-09 gettextize + + * Makefile.in.in: Upgrade to gettext-0.11.1. + * remove-potcdate.sin: New file, from gettext-0.11.1. + diff -crN gawk-3.1.0/po/LINGUAS gawk-3.1.1/po/LINGUAS *** gawk-3.1.0/po/LINGUAS Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/LINGUAS Mon Apr 22 14:50:16 2002 *************** *** 0 **** --- 1,7 ---- + es + fr + he + it + sv + tr + de diff -crN gawk-3.1.0/po/Makefile.in.in gawk-3.1.1/po/Makefile.in.in *** gawk-3.1.0/po/Makefile.in.in Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/Makefile.in.in Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,317 ---- + # Makefile for PO directory in any package using GNU gettext. + # Copyright (C) 1995-1997, 2000-2002 by Ulrich Drepper + # + # 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 but which still want to provide support for the GNU gettext + # functionality. + # Please note that the actual code of GNU gettext is covered by the GNU + # General Public License and is *not* in the public domain. + + PACKAGE = @PACKAGE@ + VERSION = @VERSION@ + + SHELL = /bin/sh + @SET_MAKE@ + + srcdir = @srcdir@ + top_srcdir = @top_srcdir@ + VPATH = @srcdir@ + + prefix = @prefix@ + exec_prefix = @exec_prefix@ + datadir = @datadir@ + localedir = $(datadir)/locale + gettextsrcdir = $(datadir)/gettext/po + + INSTALL = @INSTALL@ + INSTALL_DATA = @INSTALL_DATA@ + MKINSTALLDIRS = @MKINSTALLDIRS@ + mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` + + GMSGFMT = @GMSGFMT@ + MSGFMT = @MSGFMT@ + XGETTEXT = @XGETTEXT@ + MSGMERGE = msgmerge + MSGMERGE_UPDATE = @MSGMERGE@ --update + MSGINIT = msginit + MSGCONV = msgconv + MSGFILTER = msgfilter + + POFILES = @POFILES@ + GMOFILES = @GMOFILES@ + UPDATEPOFILES = @UPDATEPOFILES@ + DUMMYPOFILES = @DUMMYPOFILES@ + DISTFILES.common = Makefile.in.in Makevars remove-potcdate.sin \ + $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) + DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot \ + $(POFILES) $(GMOFILES) \ + $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) + + POTFILES = \ + + CATALOGS = @CATALOGS@ + + # Makevars gets inserted here. (Don't remove this line!) + + .SUFFIXES: + .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update + + .po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + + .po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + + .sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + + all: all-@USE_NLS@ + + all-yes: $(CATALOGS) + all-no: + + # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', + # otherwise packages like GCC can not be built if only parts of the source + # have been downloaded. + + $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + + $(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + + $(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + + install: install-exec install-data + install-exec: + install-data: install-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + for file in $(DISTFILES.common); do \ + $(INSTALL_DATA) $(srcdir)/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi + install-data-no: all + install-data-yes: all + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + + install-strip: install + + installdirs: installdirs-exec installdirs-data + installdirs-exec: + installdirs-data: installdirs-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext"; then \ + $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + else \ + : ; \ + fi + installdirs-data-no: + installdirs-data-yes: + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + + # Define this as empty until I found a useful application. + installcheck: + + uninstall: uninstall-exec uninstall-data + uninstall-exec: + uninstall-data: uninstall-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext"; then \ + for file in $(DISTFILES.common); do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi + uninstall-data-no: + uninstall-data-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + + check: all + + dvi info tags TAGS ID: + + mostlyclean: + rm -f remove-potcdate.sed + rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po + rm -fr *.o + + clean: mostlyclean + + distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo + + 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 = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + dist distdir: + $(MAKE) update-po + @$(MAKE) dist2 + # This is a separate target because 'update-po' must be executed before. + dist2: $(DISTFILES) + dists="$(DISTFILES)"; \ + if test -f $(srcdir)/ChangeLog; then dists="$$dists ChangeLog"; fi; \ + if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ + for file in $$dists; do \ + if test -f $$file; then \ + cp -p $$file $(distdir); \ + else \ + cp -p $(srcdir)/$$file $(distdir); \ + fi; \ + done + + update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + + # General rule for updating PO files. + + .nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + + $(DUMMYPOFILES): + + update-gmo: Makefile $(GMOFILES) + @: + + Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ + $(SHELL) ./config.status + + force: + + # 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 -crN gawk-3.1.0/po/Makevars gawk-3.1.1/po/Makevars *** gawk-3.1.0/po/Makevars Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/Makevars Tue Feb 19 18:06:29 2002 *************** *** 0 **** --- 1,25 ---- + # Makefile variables for PO directory in any package using GNU gettext. + + # Usually the message domain is the same as the package name. + DOMAIN = $(PACKAGE) + + # These two variables depend on the location of this directory. + subdir = po + top_builddir = .. + + # These options get passed to xgettext. + XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ + + # This is the copyright holder that gets inserted into the header of the + # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding + # package. (Note that the msgstr strings, extracted from the package's + # sources, belong to the copyright holder of the package.) Translators are + # expected to transfer the copyright for their translations to this person + # or entity, or to disclaim their copyright. The empty string stands for + # the public domain; in this case the translators are expected to disclaim + # their copyright. + COPYRIGHT_HOLDER = Free Software Foundation, Inc. + + # This is the list of locale categories, beyond LC_MESSAGES, for which the + # message catalogs shall be used. It is usually empty. + EXTRA_LOCALE_CATEGORIES = diff -crN gawk-3.1.0/po/Rules-quot gawk-3.1.1/po/Rules-quot *** gawk-3.1.0/po/Rules-quot Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/Rules-quot Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,42 ---- + # Special Makefile rules for English message catalogs with quotation marks. + + DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot + + .SUFFIXES: .insert-header .po-update-en + + en@quot.po-update: en@quot.po-update-en + en@boldquot.po-update: en@boldquot.po-update-en + + .insert-header.po-update-en: + @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ + if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + ll=`echo $$lang | sed -e 's/@.*//'`; \ + LC_ALL=C; export LC_ALL; \ + cd $(srcdir); \ + if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "creation of $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + + en@quot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header + + en@boldquot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header + + mostlyclean: mostlyclean-quot + mostlyclean-quot: + rm -f *.insert-header diff -crN gawk-3.1.0/po/boldquot.sed gawk-3.1.1/po/boldquot.sed *** gawk-3.1.0/po/boldquot.sed Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/boldquot.sed Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,10 ---- + s/"\([^"]*\)"/“\1â€/g + s/`\([^`']*\)'/‘\1’/g + s/ '\([^`']*\)' / ‘\1’ /g + s/ '\([^`']*\)'$/ ‘\1’/g + s/^'\([^`']*\)' /‘\1’ /g + s/“â€/""/g + s/“/“/g + s/â€/â€/g + s/‘/‘/g + s/’/’/g diff -crN gawk-3.1.0/po/de.po gawk-3.1.1/po/de.po *** gawk-3.1.0/po/de.po Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/de.po Wed May 1 16:41:00 2002 *************** *** 0 **** --- 1,1778 ---- + # GNU awk message strings + # Copyright (C) 2000 Free Software Foundation, Inc. + # Unknown Author, , 2000 + # + msgid "" + msgstr "" + "Project-Id-Version: gawk 3.1.0\n" + "POT-Creation-Date: 2002-05-01 16:40+0300\n" + "PO-Revision-Date: 2002-04-03 18:55+02:00\n" + "Last-Translator: Christian Kirsch \n" + "Language-Team: German \n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=iso-8859-1\n" + "Content-Transfer-Encoding: 8bit\n" + + #: array.c:243 array.c:275 array.c:280 eval.c:483 + #, c-format + msgid "attempt to use scalar `%s' as array" + msgstr "Versuch, Skalar '%s' als Array zu verwenden." + + #: array.c:304 + #, c-format + msgid "reference to uninitialized element `%s[\"%s\"]'" + msgstr "Bezug auf nicht-initialisiertes Element »%s[\"%s\"]«" + + #: array.c:310 + #, c-format + msgid "subscript of array `%s' is null string" + msgstr "Index in Array »%s« ist Nullstring." + + #: array.c:373 array.c:456 + #, c-format + msgid "delete: illegal use of variable `%s' as array" + msgstr "delete: Benutzung der Variablen »%s« als Array ist nicht zulässig." + + #: array.c:406 + #, c-format + msgid "delete: index `%s' not in array `%s'" + msgstr "delete: Index »%s« nicht in Feld »%s« vorhanden." + + #: array.c:571 + #, c-format + msgid "%s: empty (null)\n" + msgstr "%s: leer (Null)\n" + + #: array.c:576 + #, c-format + msgid "%s: empty (zero)\n" + msgstr "%s: leer (0)\n" + + #: array.c:580 + #, c-format + msgid "%s: table_size = %d, array_size = %d\n" + msgstr "%s: Table_size = %d, array_size = %d\n" + + #: array.c:612 + #, fuzzy, c-format + msgid "%s: is parameter\n" + msgstr "%s: ist ein Parameter\n" + + #: array.c:617 + #, c-format + msgid "%s: array_ref to %s\n" + msgstr "%s: Array-Referenz auf %s\n" + + #: array.c:844 + msgid "asort: first argument is not an array" + msgstr "asort: Erstes Argument ist kein Array." + + #: array.c:853 + msgid "asort: second argument is not an array" + msgstr "asort: Zweites Argument ist kein array." + + #: builtin.c:107 + #, c-format + msgid "%s to \"%s\" failed (%s)" + msgstr "%s to \"%s\" fehlgeschlagen (%s)" + + #: builtin.c:108 + msgid "standard output" + msgstr "Standardausgabe" + + #: builtin.c:109 + msgid "reason unknown" + msgstr "Unbekannte Ursache" + + #: builtin.c:122 + msgid "exp: received non-numeric argument" + msgstr "exp: Argument ist keine Zahl." + + #: builtin.c:128 + #, c-format + msgid "exp: argument %g is out of range" + msgstr "exp: Argument %g außerhalb des gültigen Zahlenbereichs." + + #: builtin.c:186 + #, c-format + msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" + msgstr "" + "fflush: Leeren der Puffer nicht möglich, Pipe »%s« ist nur zum Lesen " + "geöffnet." + + #: builtin.c:189 + #, c-format + msgid "fflush: cannot flush: file `%s' opened for reading, not writing" + msgstr "" + "fflush: Leeren der Puffer nicht möglich, Datei »%s« ist nur zum Lesen " + "geöffnet." + + #: builtin.c:201 + #, c-format + msgid "fflush: `%s' is not an open file, pipe or co-process" + msgstr "fflush: »%s« ist keine geöffnete Datei, Pipe oder Prozess." + + #: builtin.c:295 + msgid "index: received non-string first argument" + msgstr "index: Erstes Argument ist kein String." + + #: builtin.c:297 + msgid "index: received non-string second argument" + msgstr "index: Zweites Argument ist kein string." + + #: builtin.c:407 + msgid "int: received non-numeric argument" + msgstr "Argument ist keine Zahl." + + #: builtin.c:424 + msgid "length: received non-string argument" + msgstr "length: Argument ist kein String." + + #: builtin.c:440 + msgid "log: received non-numeric argument" + msgstr "log: Argument ist keine Zahl." + + #: builtin.c:443 + #, c-format + msgid "log: received negative argument %g" + msgstr "log: Negatives Argument %g." + + #: builtin.c:605 builtin.c:608 + msgid "must use `count$' on all formats or none" + msgstr "" + + #: builtin.c:703 + msgid "`$' is not permitted in awk formats" + msgstr "»$« ist in awk-Formaten nicht zulässig." + + #: builtin.c:709 + msgid "arg count with `$' must be > 0" + msgstr "Argumentnummer bei »$« muss > 0 sein." + + #: builtin.c:711 + #, c-format + msgid "arg count %d greater than total number of supplied arguments" + msgstr "Argumentnummer %d ist größer als Anzahl angegebener Argumente." + + #: builtin.c:713 + msgid "`$' not permitted after period in format" + msgstr "»$« nach Punkt in Formatangabe nicht zulässig." + + #: builtin.c:726 + msgid "no `$' supplied for positional field width or precision" + msgstr "»$« fehlt in positionsabhängiger Feldbreite oder Genauigkeit." + + # + #: builtin.c:784 + msgid "`l' is meaningless in awk formats; ignored" + msgstr "»l« ist in awk-Formaten bedeutungslos, ignoriert." + + #: builtin.c:788 + msgid "`l' is not permitted in POSIX awk formats" + msgstr "»l« in POSIX-awk-Formaten nicht zulässig." + + #: builtin.c:799 + msgid "`L' is meaningless in awk formats; ignored" + msgstr "»L« ist in awk-Formaten bedeutungslos, ignoriert." + + #: builtin.c:803 + msgid "`L' is not permitted in POSIX awk formats" + msgstr "»L« in POSIX-awk-Formaten nicht zulässig." + + #: builtin.c:814 + msgid "`h' is meaningless in awk formats; ignored" + msgstr "»h« ist in awk-Formaten bedeutungslos, ignoriert." + + #: builtin.c:818 + msgid "`h' is not permitted in POSIX awk formats" + msgstr "»h« in POSIX-awk-Formaten nicht zulässig.<" + + #: builtin.c:1067 + msgid "not enough arguments to satisfy format string" + msgstr "Nicht genügend Argumente für Formatangabe." + + #: builtin.c:1069 + msgid "^ ran out for this one" + msgstr "^ ran out for this one" + + #: builtin.c:1074 + msgid "[s]printf: format specifier does not have control letter" + msgstr "[s]printf: Format-Specifier hat keinen Controlcode." + + #: builtin.c:1077 + msgid "too many arguments supplied for format string" + msgstr "Zu viele Argumente für Formatstring." + + #: builtin.c:1120 builtin.c:1123 + msgid "printf: no arguments" + msgstr "printf: Keine Argumente" + + #: builtin.c:1156 + msgid "sqrt: received non-numeric argument" + msgstr "sqrt: Argument ist keine Zahl." + + #: builtin.c:1160 + #, c-format + msgid "sqrt: called with negative argument %g" + msgstr "sqrt: Argument %g ist negativ." + + #: builtin.c:1182 + #, c-format + msgid "substr: start index %g is invalid, using 1" + msgstr "substr: Start-Index %g ist ungültig, 1 wird benutzt." + + #: builtin.c:1187 + #, c-format + msgid "substr: non-integer start index %g will be truncated" + msgstr "substr: Start-Wert %g wird abgeschnitten." + + #: builtin.c:1201 + #, c-format + msgid "substr: length %g is <= 0" + msgstr "substr: Länge %g ist kleiner oder gleich 0." + + #: builtin.c:1207 + #, c-format + msgid "substr: non-integer length %g will be truncated" + msgstr "substr: Länge %g wird abgeschnitten." + + #: builtin.c:1214 + msgid "substr: source string is zero length" + msgstr "substr: String ist leer." + + #: builtin.c:1221 + #, c-format + msgid "" + "substr: length %d at start index %d exceeds length of first argument (%d)" + msgstr "" + "substr: Länge %d am Start-Wert %d überschreitet Länge des ersten Arguments (%" + "d)." + + #: builtin.c:1227 + #, c-format + msgid "substr: start index %d is past end of string" + msgstr "substr: Start-Wert %d liegt hinter dem Ende des Strings." + + #: builtin.c:1263 + #, fuzzy + msgid "strftime: received non-string first argument" + msgstr "strftime: Erstes Argument ist kein String." + + #: builtin.c:1269 + msgid "strftime: received empty format string" + msgstr "strftime: Format-String ist leer." + + #: builtin.c:1278 + #, fuzzy + msgid "strftime: received non-numeric second argument" + msgstr "strftime. Zweites Argument ist keine Zahl." + + #: builtin.c:1341 + msgid "mktime: received non-string argument" + msgstr "mktime: Argument ist kein String." + + #: builtin.c:1386 + #, fuzzy + msgid "system: received non-string argument" + msgstr "system: Argument ist kein String." + + #: builtin.c:1512 + #, fuzzy + msgid "tolower: received non-string argument" + msgstr "tolower: Argument ist kein String." + + #: builtin.c:1561 + #, fuzzy + msgid "toupper: received non-string argument" + msgstr "toupper: Argument ist kein String." + + #: builtin.c:1606 + msgid "atan2: received non-numeric first argument" + msgstr "atan2: Erstes Argument ist keine Zahl." + + #: builtin.c:1608 + msgid "atan2: received non-numeric second argument" + msgstr "atan2: Zweites Argument ist keine Zahl." + + #: builtin.c:1627 + msgid "sin: received non-numeric argument" + msgstr "sin: Argument istk eine Zahl." + + #: builtin.c:1643 + msgid "cos: received non-numeric argument" + msgstr "cos: Argument ist keine Zahl." + + #: builtin.c:1687 + msgid "srand: received non-numeric argument" + msgstr "srand: Argument ist keine Zahl." + + #: builtin.c:1721 + msgid "match: third argument is not an array" + msgstr "match: Drittes Argument ist kein Array." + + #: builtin.c:2157 + msgid "gensub: 3rd argument of 0 treated as 1" + msgstr "gensub: Drittes Argument 0 als 1 interpretiert" + + #: builtin.c:2268 builtin.c:2270 + msgid "lshift: received non-numeric first argument" + msgstr "lshift: Erstes Argument ist keine Zahl." + + #: builtin.c:2272 + #, c-format + msgid "lshift(%lf, %lf): negative values will give strange results" + msgstr "" + "lshift(%lf, %lf): Negative Werte werden merkwürdige Ergebnisse liefern." + + #: builtin.c:2274 + #, c-format + msgid "lshift(%lf, %lf): fractional values will be truncated" + msgstr "lshift(%lf, %lf): Dezimalteil wird abgeschnitten." + + #: builtin.c:2276 + #, c-format + msgid "lshift(%lf, %lf): too large shift value will give strange results" + msgstr "" + "lshift(%lf, %lf): Zu große Shift-Werte werden merkwürdige Ergebnisse liefern." + + #: builtin.c:2305 builtin.c:2307 + msgid "rshift: received non-numeric first argument" + msgstr "rshift: Erstes Argument ist keine Zahl." + + #: builtin.c:2309 + #, c-format + msgid "rshift(%lf, %lf): negative values will give strange results" + msgstr "" + "rshift (%lf, %lf): Negative Werte werden merkwürdige Ergebnisse liefern." + + #: builtin.c:2311 + #, c-format + msgid "rshift(%lf, %lf): fractional values will be truncated" + msgstr "rshift(%lf, %lf): Dezimalteil wird abgeschnitten." + + #: builtin.c:2313 + #, c-format + msgid "rshift(%lf, %lf): too large shift value will give strange results" + msgstr "" + "rshift(%lf, %lf): Zu große Shift-Werte werden merkwürdige Ergebnisse liefern." + + #: builtin.c:2342 builtin.c:2344 + msgid "and: received non-numeric first argument" + msgstr "and: Erstes Argument ist keine Zahl." + + #: builtin.c:2346 + #, c-format + msgid "and(%lf, %lf): negative values will give strange results" + msgstr "and(%lf, %lf): Negative Werte werden merkwürdige Ergebnisse liefern." + + #: builtin.c:2348 + #, c-format + msgid "and(%lf, %lf): fractional values will be truncated" + msgstr "and(%lf, %lf): Dezimalteil wird abgeschnitten." + + #: builtin.c:2377 builtin.c:2379 + msgid "or: received non-numeric first argument" + msgstr "or: Erstes Argument ist keine Zahl." + + #: builtin.c:2381 + #, c-format + msgid "or(%lf, %lf): negative values will give strange results" + msgstr "or(%lf, %lf): Negative Werte werden merkwürdige Ergebnisse liefern." + + #: builtin.c:2383 + #, c-format + msgid "or(%lf, %lf): fractional values will be truncated" + msgstr "or(%lf, %lf): Dezimalteil wird abgeschnitten." + + #: builtin.c:2412 builtin.c:2414 + msgid "xor: received non-numeric first argument" + msgstr "xor: Erstes Argument ist keine Zahl." + + #: builtin.c:2416 + #, c-format + msgid "xor(%lf, %lf): negative values will give strange results" + msgstr "xor(%lf, %lf: Negative Werte werden merkwürdige Ergebnisse liefern." + + #: builtin.c:2418 + #, c-format + msgid "xor(%lf, %lf): fractional values will be truncated" + msgstr "xor(%lf, %lf): Dezimalteil wird abgeschnitten." + + #: builtin.c:2446 + msgid "compl: received non-numeric argument" + msgstr "compl: Erstes Argument ist keine Zahl." + + #: builtin.c:2448 + #, c-format + msgid "compl(%lf): negative value will give strange results" + msgstr "compl(%lf): Negativer Wert wird merkwürdige Ergebnisse liefern." + + #: builtin.c:2450 + #, c-format + msgid "compl(%lf): fractional value will be truncated" + msgstr "compl(%lf): Dezimalteil wird abgeschnitten." + + #: builtin.c:2621 + #, c-format + msgid "dcgettext: `%s' is not a valid locale category" + msgstr "dcgettext: '%s' ist keine gültige Locale-Kategorie." + + #: ext.c:60 ext.c:64 + msgid "`extension' is a gawk extension" + msgstr "'extension' ist eine gawk-Erweiterung." + + #: ext.c:74 + #, c-format + msgid "extension: cannot open `%s' (%s)\n" + msgstr "extension: Kann '%s' nicht öffnen (%s)\n" + + #: ext.c:82 + #, c-format + msgid "extension: library `%s': cannot call function `%s' (%s)\n" + msgstr "extension: Bibliothek '%s': kann Funktion '%s' nicht aufrufen (%s)\n" + + #: ext.c:180 + msgid "Operation Not Supported" + msgstr "Operation nicht möglich." + + #: getopt.c:692 getopt.c:704 + #, c-format + msgid "%s: option `%s' is ambiguous\n" + msgstr "%s: Option '%s' ist mehrdeutig.\n" + + #: getopt.c:737 getopt.c:741 + #, c-format + msgid "%s: option `--%s' doesn't allow an argument\n" + msgstr "%s: Option '--%s' erlaubt kein Argument.\n" + + #: getopt.c:750 getopt.c:755 + #, c-format + msgid "%s: option `%c%s' doesn't allow an argument\n" + msgstr "%s: Option '%c%s\" erlaubt kein Argument.\n" + + #: getopt.c:791 getopt.c:804 getopt.c:1093 getopt.c:1106 + #, c-format + msgid "%s: option `%s' requires an argument\n" + msgstr "%s: Option '%s' erfordert ein Argument.\n" + + #: getopt.c:842 getopt.c:845 + #, c-format + msgid "%s: unrecognized option `--%s'\n" + msgstr "%s: Unbekannte Option '--%s'.\n" + + #: getopt.c:853 getopt.c:856 + #, c-format + msgid "%s: unrecognized option `%c%s'\n" + msgstr "%s: Unbekannte Option '%c%s'.\n" + + #: getopt.c:903 getopt.c:906 + #, c-format + msgid "%s: illegal option -- %c\n" + msgstr "%s: Illegale Option -- %c.\n" + + #: getopt.c:912 getopt.c:915 + #, c-format + msgid "%s: invalid option -- %c\n" + msgstr "%s: Ungültige Option -- %c.\n" + + #: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412 + #, c-format + msgid "%s: option requires an argument -- %c\n" + msgstr "%s Option erfordert ein Argument -- %c.\n" + + #: getopt.c:1025 getopt.c:1036 + #, c-format + msgid "%s: option `-W %s' is ambiguous\n" + msgstr "%s: Option '-W %s' ist mehrdeutig.\n" + + #: getopt.c:1060 getopt.c:1072 + #, c-format + msgid "%s: option `-W %s' doesn't allow an argument\n" + msgstr "%s. Option '-W %s' erlaubt kein Argument.\n" + + #: main.c:307 + msgid "`-m[fr]' option irrelevant in gawk" + msgstr "Option '-m[fr]' ist in gawk bedeutungslos." + + #: main.c:309 + msgid "-m option usage: `-m[fr] nnn'" + msgstr "Anwendung der Option -m: '-m[fr] nnn'" + + #: main.c:326 + #, c-format + msgid "%s: option `-W %s' unrecognized, ignored\n" + msgstr "%s: Option '-W %s' unbekannt, ignoriert.\n" + + #: main.c:357 + msgid "empty argument to `--source' ignored" + msgstr "Leeres Argument für '--source' ignoriert." + + #: main.c:429 + msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" + msgstr "" + "Umgebungsvariable 'POSIXLY_CORRECT' ist gesetzt: '--posix' angeschaltet." + + #: main.c:434 + msgid "`--posix' overrides `--traditional'" + msgstr "'--posix' hat Vorrang vor '--traditional'" + + #: main.c:445 + msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" + msgstr "'--posix' /'--traditional' hat Vorrang vor '--non-decimal-data'." + + #: main.c:449 + #, fuzzy, c-format + msgid "running %s setuid root may be a security problem" + msgstr "%s als setuid root auszuführen, kann zu Sicherheitsproblemen führen." + + #: main.c:478 + #, c-format + msgid "can't set mode on stdin (%s)" + msgstr "Kann Mode für stdin nicht setzen (%s)." + + #: main.c:481 + #, c-format + msgid "can't set mode on stdout (%s)" + msgstr "Kann Mode für stdout nicht setzen (%s)." + + #: main.c:483 + #, c-format + msgid "can't set mode on stderr (%s)" + msgstr "Kann Mode für stderr nicht setzen (%s)." + + #: main.c:512 + msgid "no program text at all!" + msgstr "Kein Programmtext." + + #: main.c:556 + #, c-format + msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" + msgstr "Anwendung: %s [POSIX- oder GNU-Optionen] -f PROGRAM [--] Datei ...\n" + + #: main.c:558 + #, c-format + msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" + msgstr "Anwendung: %s [POSIX- oder GNU-Optionen] -- %cPROGRAM%c Datei ...\n" + + #: main.c:563 + msgid "POSIX options:\t\tGNU long options:\n" + msgstr "POSIX-Optionen\t\tGNU-Optionen (lang):\n" + + #: main.c:564 + msgid "\t-f progfile\t\t--file=progfile\n" + msgstr "\t-f PROGRAM\t\t--file=PROGRAM\n" + + #: main.c:565 + msgid "\t-F fs\t\t\t--field-separator=fs\n" + msgstr "\t-F Feldtrenner\t\t\t--field-separator=Feldtrenner\n" + + #: main.c:566 + msgid "\t-v var=val\t\t--assign=var=val\n" + msgstr "\t-v var=Wert\t\t--assign=var=Wert\n" + + #: main.c:567 + msgid "\t-m[fr] val\n" + msgstr "\t-m[fr] Wert\n" + + #: main.c:568 + msgid "\t-W compat\t\t--compat\n" + msgstr "\t-W compat\t\t--compat\n" + + #: main.c:569 + msgid "\t-W copyleft\t\t--copyleft\n" + msgstr "\t-W copyleft\t\t--copyleft\n" + + #: main.c:570 + msgid "\t-W copyright\t\t--copyright\n" + msgstr "\t-W copyright\t\t--copyright\n" + + #: main.c:571 + msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" + msgstr "\t-W dump-variables[=Datei]\t--dump-variables[=Datei]\n" + + #: main.c:572 + msgid "\t-W gen-po\t\t--gen-po\n" + msgstr "\t-W gen-po\t\t--gen-po\n" + + #: main.c:573 + msgid "\t-W help\t\t\t--help\n" + msgstr "\t-W help\t\t\t--help\n" + + #: main.c:574 + msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" + msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n" + + #: main.c:575 + msgid "\t-W lint-old\t\t--lint-old\n" + msgstr "\t-W lint-old\t\t--lint-old\n" + + #: main.c:576 + msgid "\t-W non-decimal-data\t--non-decimal-data\n" + msgstr "\t-W non-decimal-data\t--non-decimal-data\n" + + #: main.c:578 + msgid "\t-W nostalgia\t\t--nostalgia\n" + msgstr "\t-W nostalgia\t\t--nostalgia\n" + + #: main.c:581 + msgid "\t-W parsedebug\t\t--parsedebug\n" + msgstr "\t-W parsedebug\t\t--parsedebug\n" + + #: main.c:583 + msgid "\t-W profile[=file]\t--profile[=file]\n" + msgstr "\t-W profile[=Datei]\t--profile[=Datei]\n" + + #: main.c:584 + msgid "\t-W posix\t\t--posix\n" + msgstr "\t-W posix\t\t--posix\n" + + #: main.c:585 + msgid "\t-W re-interval\t\t--re-interval\n" + msgstr "\t-W re-interval\t\t--re-interval\n" + + #: main.c:586 + msgid "\t-W source=program-text\t--source=program-text\n" + msgstr "\t-W source=Programmtext\t--source=Programmtext\n" + + #: main.c:587 + msgid "\t-W traditional\t\t--traditional\n" + msgstr "\t-W traditional\t\t--traditional\n" + + #: main.c:588 + msgid "\t-W usage\t\t--usage\n" + msgstr "\t-W usage\t\t--usage\n" + + #: main.c:589 + msgid "\t-W version\t\t--version\n" + msgstr "\t-W version\t\t--version\n" + + #: main.c:593 + #, fuzzy + msgid "" + "\n" + "To report bugs, see node `Bugs' in `gawk.info', which is\n" + "section `Reporting Problems and Bugs' in the printed version.\n" + "\n" + msgstr "" + "den Sie im Kapitel 'Reporting Problems and Bugs' in der \n" + "gedruckten Version finden.\n" + + #: main.c:597 + msgid "" + "gawk is a pattern scanning and processing language.\n" + "By default it reads standard input and writes standard output.\n" + "\n" + msgstr "" + + #: main.c:601 + msgid "" + "Examples:\n" + "\tgawk '{ sum += $1 }; END { print sum }' file\n" + "\tgawk -F: '{ print $1 }' /etc/passwd\n" + msgstr "" + + #: main.c:613 + #, fuzzy, c-format + msgid "" + "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" + "\n" + "This program is free software; you can redistribute it and/or modify\n" + "it under the terms of the GNU General Public License as published by\n" + "the Free Software Foundation; either version 2 of the License, or\n" + "(at your option) any later version.\n" + "\n" + msgstr "" + "Copyright (C) 1989, 1991-2001 Free Software Foundation.\n" + "\n" + "Dieses Programm ist Freie Software. Sie können es unter den Bedingungen\n" + "der von der Free Software Foundation veröffentlichten GNU \n" + "General Public License weitergeben und/oder ändern.\n" + "Es gilt Version 2 dieser Lizenz oder (nach Ihrer Wahl) irgendeine\n" + "spätere Version.\n" + "\n" + + #: main.c:621 + msgid "" + "This program is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "GNU General Public License for more details.\n" + "\n" + msgstr "" + "This program is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "GNU General Public License for more details.\n" + "\n" + + #: main.c:627 + msgid "" + "You should have received a copy of the GNU General Public License\n" + "along with this program; if not, write to the Free Software\n" + "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + msgstr "" + "Sie sollten eine Kopie der GNU General Publice License zusammen mit\n" + "diesem Programm erhalten haben. Wenn nicht, schreiben Sie an die Free \n" + "Software Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-" + "1307, USA.\n" + + #: main.c:657 + msgid "-Ft does not set FS to tab in POSIX awk" + msgstr "-Ft setzt FS im POSIX-awk nicht auf Tab." + + #: main.c:888 + #, c-format + msgid "invalid syntax in name `%s' for variable assignment" + msgstr "Ungültige Syntax im Namen '%s' für Variablenzuweisung." + + #: main.c:957 + msgid "floating point exception" + msgstr "Floating point exception" + + #: main.c:964 + msgid "fatal error: internal error" + msgstr "Fataler Fehler: interner Fehler" + + #: main.c:1014 + #, c-format + msgid "no pre-opened fd %d" + msgstr "Kein geöffneter Dateideskriptor %d" + + #: main.c:1019 + #, c-format + msgid "could not pre-open /dev/null for fd %d" + msgstr "Konnte /dev/null nicht für Dateideskriptor %d öffnen." + + #: main.c:1037 main.c:1046 + #, c-format + msgid "could not find groups: %s" + msgstr "Konnte Gruppen nicht finden: %s" + + #: profile.c:94 + #, c-format + msgid "could not open `%s' for writing: %s" + msgstr "Konnte '%s' nicht zum Schreiben öffnen: %s" + + #: profile.c:96 awkgram.y:2465 + msgid "sending profile to standard error" + msgstr "Schicke Profile auf Stadard-Fehlerausgabe." + + #: profile.c:409 + msgid "internal error: Node_var with null vname" + msgstr "Interner Fehler: Node_var with null vname." + + #: profile.c:524 + msgid "internal error: Node_var_array with null vname" + msgstr "Interner Fehler: Node_var_array with null vname." + + #: profile.c:554 eval.c:813 + #, c-format + msgid "" + "function `%s' called with space between name and `(',\n" + "%s" + msgstr "" + "Funktion '%s' mit Leerzeichen zwischen Name und '(' aufgerufen, \n" + "%s" + + #: profile.c:556 eval.c:815 + msgid "or used in other expression context" + msgstr "or in anderem Kontext benutzt" + + #: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741 + #, c-format + msgid "attempt to use array `%s' in a scalar context" + msgstr "Versuch, das Array '%s' in Skalarkontext zu verwenden." + + #: profile.c:637 eval.c:1047 + #, c-format + msgid "illegal type (%s) in tree_eval" + msgstr "Illegaler Typ (%s) in tree_eval" + + #: profile.c:842 eval.c:1790 + #, c-format + msgid "attempt to use function `%s' as array" + msgstr "Versuch, die Funktion '%s' als Array zu verwenden." + + #: profile.c:856 eval.c:1797 + #, c-format + msgid "`%s' is a function, assignment is not allowed" + msgstr "'%s' ist eine Funktion, Zuweisungen sind nicht erlaubt." + + #: profile.c:860 eval.c:1803 eval.c:1810 + msgid "assignment is not allowed to result of builtin function" + msgstr "" + "Zuweisungen an das Ergebnis einer eingebauten Funktion sind nicht erlaubt." + + #: profile.c:1108 + #, c-format + msgid "\t# gawk profile, created %s\n" + msgstr "\t# gawk-Profil, erzeugt %s\n" + + #: profile.c:1111 + msgid "" + "\t# BEGIN block(s)\n" + "\n" + msgstr "" + "\t# BEGIN block(s)\n" + "\n" + + #: profile.c:1121 + msgid "" + "\t# Rule(s)\n" + "\n" + msgstr "" + "\t# Rule(s)\n" + "\n" + + #: profile.c:1127 + msgid "" + "\t# END block(s)\n" + "\n" + msgstr "" + "\t# END block(s)\n" + "\n" + + #: profile.c:1147 + msgid "" + "\n" + "\t# Functions, listed alphabetically\n" + msgstr "" + "\n" + "\t# Functionen, alphabetisch sortiert\n" + + #: profile.c:1357 + #, c-format + msgid "unexpected type %s in prec_level" + msgstr "Unerwarteter Typ %s in prec_level." + + #: regex.c:1322 + msgid "Success" + msgstr "Erfolg" + + #: regex.c:1323 + msgid "No match" + msgstr "Kein Treffer" + + #: regex.c:1324 + msgid "Invalid regular expression" + msgstr "Ungültiger Regulärer Ausdruck." + + #: regex.c:1325 + msgid "Invalid collation character" + msgstr "Ungültiges Zeichen." + + #: regex.c:1326 + msgid "Invalid character class name" + msgstr "Ungültier Name für Zeichenklasse." + + #: regex.c:1327 + msgid "Trailing backslash" + msgstr "Angehängter Backslash" + + #: regex.c:1328 + msgid "Invalid back reference" + msgstr "Ungültige Referenze" + + #: regex.c:1329 + msgid "Unmatched [ or [^" + msgstr "[ oder [^ nicht geschlossen" + + #: regex.c:1330 + msgid "Unmatched ( or \\(" + msgstr "( oder \\( nicht geschlossen" + + #: regex.c:1331 + msgid "Unmatched \\{" + msgstr "\\{ nicht geschlossen" + + #: regex.c:1332 + msgid "Invalid content of \\{\\}" + msgstr "Ungültiger Inhalt von \\{\\}" + + #: regex.c:1333 + msgid "Invalid range end" + msgstr "Ungültiges Bereichsende" + + #: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204 + msgid "Memory exhausted" + msgstr "Kein Speicher mehr." + + #: regex.c:1335 + msgid "Invalid preceding regular expression" + msgstr "Vorangehender Regulärer Ausdruck ist ungültig." + + #: regex.c:1336 + msgid "Premature end of regular expression" + msgstr "Vorzeitiges Ende des Regulären Ausdrucks." + + #: regex.c:1337 + msgid "Regular expression too big" + msgstr "Regulärer Ausdruck zu groß." + + #: regex.c:1338 + msgid "Unmatched ) or \\)" + msgstr ") oder \\) nicht geöffnet" + + #: regex.c:7365 + msgid "No previous regular expression" + msgstr "Kein vorangehender Regulärer Ausdruck." + + #: awkgram.y:232 + msgid "BEGIN blocks must have an action part" + msgstr "BEGIN-Blöcke müssen einen Aktionsteil haben." + + #: awkgram.y:238 + msgid "END blocks must have an action part" + msgstr "END-Blöcke müssen einen Aktionsteil haben." + + #: awkgram.y:274 + #, c-format + msgid "`%s' is a built-in function, it cannot be redefined" + msgstr "'%s' ist eine eingebaute Funktion und kann nicht umdefiniert werden." + + #: awkgram.y:362 + msgid "statement may have no effect" + msgstr "Statement möglicherweise ohne Effekt." + + #: awkgram.y:455 + msgid "`next' used in BEGIN or END action" + msgstr "'next' in BEGIN- oder END-Aktion benutzt." + + #: awkgram.y:462 awkgram.y:469 + msgid "`nextfile' is a gawk extension" + msgstr "'nextfile' ist eine gawk-Erweiterung." + + #: awkgram.y:474 + msgid "`nextfile' used in BEGIN or END action" + msgstr "'nextfile' in BEGIN- oder END-Aktion benutzt." + + #: awkgram.y:483 + msgid "`return' used outside function context" + msgstr "'return' außerhalb einer Funktion benutzt." + + #: awkgram.y:519 + msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" + msgstr "" + "Einfaches 'print' in BEGIN- oder END-Regel soll vermutlich 'print \"\"' sein." + + #: awkgram.y:532 awkgram.y:539 + msgid "`delete array' is a gawk extension" + msgstr "'delete array' ist eine gawk-Erweiterung." + + #: awkgram.y:604 + msgid "multistage two-way pipelines don't work" + msgstr "'multistage' Zweiwege-Pipes funktionieren nicht." + + #: awkgram.y:695 + msgid "regular expression on right of assignment" + msgstr "Regulärer Ausdruck auf der rechten Seite einer Zuweisung." + + #: awkgram.y:713 + msgid "non-redirected `getline' undefined inside END action" + msgstr "" + "Nicht-umgelenktes 'getline' ist innerhalb der END-Aktion nicht definiert." + + #: awkgram.y:723 + msgid "regular expression on left of `~' or `!~' operator" + msgstr "Regulärer Ausdruck links vom '~'- oder '!~'-Operator." + + #: awkgram.y:733 + #, c-format + msgid "regexp constant `/%s/' looks like a C comment, but is not" + msgstr "" + "Konstanter Regulärer Ausdruck '/%s' sieht wie ein C-Kommentar aus, ist aber " + "keiner." + + #: awkgram.y:749 + msgid "regular expression on right of comparison" + msgstr "Regulärer Ausdruck rechts von einem Vergleich." + + #: awkgram.y:776 + msgid "non-redirected `getline' undefined inside BEGIN or END action" + msgstr "" + "Nicht-umgelenktes 'getline' ist innerhalb der BEGIN- und END-Aktion nicht " + "definiert." + + #: awkgram.y:831 + msgid "call of `length' without parentheses is not portable" + msgstr "Aufruf von 'length' ohne Klammern ist nicht portabel." + + #: awkgram.y:834 + msgid "call of `length' without parentheses is deprecated by POSIX" + msgstr "Aufruf von 'length' ohne Klammern ist in POSIX-Mode veraltet." + + #: awkgram.y:884 + msgid "invalid subscript expression" + msgstr "Ungültiger Index-Ausdruck." + + #: awkgram.y:1033 + #, c-format + msgid "fptr %x not in tokentab\n" + msgstr "fptr %x nicht in tokentab\n" + + #: awkgram.y:1068 + msgid "unexpected newline" + msgstr "Unerwartetes Zeilenende" + + #: awkgram.y:1152 + msgid "empty program text on command line" + msgstr "Kein Programmtext auf der Kommandozeile." + + #: awkgram.y:1209 + #, c-format + msgid "can't open source file `%s' for reading (%s)" + msgstr "Kann Quelldatei '%s' nicht zum Lesen öffnen (%s)." + + #: awkgram.y:1244 + #, c-format + msgid "can't read sourcefile `%s' (%s)" + msgstr "Kann Quelldatei '%s' nicht lesen (%s)." + + #: awkgram.y:1252 + #, c-format + msgid "source file `%s' is empty" + msgstr "Quelldatei '%s' ist leer." + + #: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011 + msgid "source file does not end in newline" + msgstr "Quelldatei hört nicht mit Zeilenende auf." + + #: awkgram.y:1518 + msgid "unterminated regexp ends with `\\' at end of file" + msgstr "" + "Nicht-beendeter Regulärer Ausdruck (hört mit '\\' auf) am Ende der Datei." + + #: awkgram.y:1539 + msgid "unterminated regexp" + msgstr "Nicht-beendeter Regulärer Ausdruck" + + #: awkgram.y:1542 + msgid "unterminated regexp at end of file" + msgstr "Nicht-beendeter Regulärer Ausdruck am Dateiende." + + #: awkgram.y:1609 + msgid "use of `\\ #...' line continuation is not portable" + msgstr "" + "Die Verwendung von '\\#...' zur Fortsetzung von Zeilen ist nicht portabel." + + #: awkgram.y:1621 + msgid "backslash not last character on line" + msgstr "Backslash ist nicht letztes Zeichen auf der Zeile." + + #: awkgram.y:1662 + msgid "POSIX does not allow operator `**='" + msgstr "POSIX erlaubt den Operator '**=' nicht." + + #: awkgram.y:1664 + msgid "old awk does not support operator `**='" + msgstr "Das alte awk erlaubt den Operator '**=' nicht." + + #: awkgram.y:1673 + msgid "POSIX does not allow operator `**'" + msgstr "POSIX erlaubt den Operator '**' nicht." + + #: awkgram.y:1675 + msgid "old awk does not support operator `**'" + msgstr "Das alte awk erlaubt den Operator '**' nicht." + + #: awkgram.y:1708 + msgid "operator `^=' is not supported in old awk" + msgstr "Das alte awk kennt den Operator '^=' nicht." + + #: awkgram.y:1716 + msgid "operator `^' is not supported in old awk" + msgstr "Das alte awk kennt den Operator '^' nicht." + + #: awkgram.y:1798 awkgram.y:1815 + msgid "unterminated string" + msgstr "Nicht-beendeter String" + + #: awkgram.y:1972 + #, c-format + msgid "invalid char '%c' in expression" + msgstr "Ungültiges Zeichen '%c' in einem Ausdruck." + + #: awkgram.y:2032 + #, c-format + msgid "`%s' is a gawk extension" + msgstr "'%s' ist eine gawk-Erweiterung" + + #: awkgram.y:2035 + #, c-format + msgid "`%s' is a Bell Labs extension" + msgstr "'%s' ist eine Erweiterung der Bell Labs." + + #: awkgram.y:2038 + #, c-format + msgid "POSIX does not allow `%s'" + msgstr "POSIX gestattet '%s' nicht." + + #: awkgram.y:2042 + #, c-format + msgid "`%s' is not supported in old awk" + msgstr "Das alte awk gestattet '%s' nicht." + + #: awkgram.y:2070 + msgid "`goto' considered harmful!\n" + msgstr "'goto' gilt als schlechter Stil!\n" + + #: awkgram.y:2134 + #, c-format + msgid "%d is invalid as number of arguments for %s" + msgstr "Unzulässige Argumentzahl %d für %s." + + #: awkgram.y:2153 awkgram.y:2156 + msgid "match: third argument is a gawk extension" + msgstr "match: Das dritte Argument ist eine gawk-Erweiterung." + + #: awkgram.y:2172 + #, c-format + msgid "%s: string literal as last arg of substitute has no effect" + msgstr "%s: Ein String als letztes Argument von substitute hat keinen Effekt." + + #: awkgram.y:2176 + msgid "sub third parameter is not a changeable object" + msgstr "Der dritte Parameter von sub ist ein unveränderliches Objekt." + + #: awkgram.y:2178 + msgid "gsub third parameter is not a changeable object" + msgstr "Der dritte Parameter von gsub ist ein unveränderliches Objekt." + + #: awkgram.y:2204 awkgram.y:2207 + msgid "close: second argument is a gawk extension" + msgstr "close: Das zweite Argument ist eine gawk-Erweiterung." + + #: awkgram.y:2217 + msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" + msgstr "" + "Fehlerhafte Verwendung von dcgettext(_\"...\"): \n" + "Entfernen Sie den führenden Unterstrich." + + #: awkgram.y:2232 + #, fuzzy + msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" + msgstr "" + "Fehlerhafte Verwendung von dcgettext(_\"...\"): \n" + "Entfernen Sie den führenden Unterstrich." + + #: awkgram.y:2323 + #, c-format + msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" + msgstr "Funktion '%s': Parameter #%d, '%s' wiederholt Parameter #%d." + + #: awkgram.y:2355 + #, c-format + msgid "function `%s': parameter `%s' shadows global variable" + msgstr "Funktion '%s': Parameter '%s' verdeckt eine globale Variable." + + #: awkgram.y:2464 + #, c-format + msgid "could not open `%s' for writing (%s)" + msgstr "Kann '%s' nicht zum Schreiben öffnen (%s)." + + #: awkgram.y:2495 + #, c-format + msgid "%s: close failed (%s)" + msgstr "%s: close gescheitert (%s)." + + #: awkgram.y:2605 + msgid "shadow_funcs() called twice!" + msgstr "shadow_funcs() zweimal aufgerufen!" + + #: awkgram.y:2680 + #, c-format + msgid "function `%s': can't use function name as parameter name" + msgstr "Funktion '%s': Kann Funktionsnamen nicht als Parameternamen benutzen." + + #: awkgram.y:2690 + #, c-format + msgid "function name `%s' previously defined" + msgstr "Funktion '%s' ist bereits definiert." + + #: awkgram.y:2838 awkgram.y:2844 + #, c-format + msgid "function `%s' called but never defined" + msgstr "Aufgerufene funktion '%s' ist nirgends definiert." + + #: awkgram.y:2847 + #, c-format + msgid "function `%s' defined but never called" + msgstr "Funktion '%s' wird nirgends aufgerufen." + + #: awkgram.y:2874 + #, c-format + msgid "regexp constant for parameter #%d yields boolean value" + msgstr "" + "Konstanter Regulärer Ausdruck für Parameter #%d ergibt einen logischen Wert." + + #: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649 + #: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078 + #: dfa.c:1081 dfa.c:1094 dfa.c:1095 + msgid "Unbalanced [" + msgstr "[ wird nicht geschlossen." + + #: dfa.c:783 + msgid "Unfinished \\ escape" + msgstr "Nicht-beendetes \\\\-Escape." + + #: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955 + msgid "unfinished repeat count" + msgstr "Nicht-beendeter Wiederholungszähler." + + #: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958 + msgid "malformed repeat count" + msgstr "Fehlerhafter Wiederholungszähler." + + #: dfa.c:1285 + msgid "Unbalanced (" + msgstr "( wird nicht geschlossen." + + #: dfa.c:1407 + msgid "No regexp syntax bits specified" + msgstr "Kein Regulärer Ausdruck angegeben." + + #: dfa.c:1415 + msgid "Unbalanced )" + msgstr ") wird nicht geöffnet." + + #: dfa.c:3014 + msgid "out of memory" + msgstr "Kein Speicher mehr." + + #: field.c:849 + msgid "split: second argument is not an array" + msgstr "split: Zweites Argument ist kein Array." + + #: field.c:876 + msgid "split: null string for third arg is a gawk extension" + msgstr "split: Null-String als drittes Argument ist eine gawk-Erweiterung." + + #: field.c:916 + msgid "`FIELDWIDTHS' is a gawk extension" + msgstr "'FIELDWIDTHS' ist eine gawk-Erweiterung." + + #: field.c:943 + #, c-format + msgid "field %d in FIELDWIDTHS, must be > 0" + msgstr "Feld %d in FIELDWIDTHS muss > 0 sein." + + #: field.c:997 + msgid "null string for `FS' is a gawk extension" + msgstr "Null-String für 'FS' ist eine gawk-Erweiterung." + + #: msg.c:57 + msgid "cmd. line:" + msgstr "Kommandozeile:" + + #: msg.c:123 + msgid "warning: " + msgstr "Warnung: " + + #: msg.c:145 + msgid "error: " + msgstr "Fehler: " + + #: msg.c:178 + msgid "fatal: " + msgstr "Fatal: " + + #: eval.c:259 + #, c-format + msgid "unknown nodetype %d" + msgstr "Unbekannter Knotentyp %d" + + #: eval.c:307 + msgid "buffer overflow in genflags2str" + msgstr "Pufferüberlauf in genflags2str." + + #: eval.c:541 + #, c-format + msgid "for loop: array `%s' changed size from %d to %d during loop execution" + msgstr "" + "for-Schleife: Array '%s' ändert Größse von %d zu %d innerhalb der Schleife." + + #: eval.c:565 + msgid "`break' outside a loop is not portable" + msgstr "'break' außerhalb einer Schleife ist nicht portabel." + + #: eval.c:569 + msgid "`break' outside a loop is not allowed" + msgstr "'break' außerhalb einer Schleife ist nicht zulässig." + + #: eval.c:588 + msgid "`continue' outside a loop is not portable" + msgstr "'continue' außerhalb einer Schleife ist nicht portabel." + + #: eval.c:592 + msgid "`continue' outside a loop is not allowed" + msgstr "'continue' außerhalb einer Schleife ist nicht zulässig." + + #: eval.c:622 + msgid "`next' cannot be called from a BEGIN rule" + msgstr "'next' kann nicht in einer BEGIN-Regel benutzt werden." + + #: eval.c:624 + msgid "`next' cannot be called from an END rule" + msgstr "'next' kann nicht in einer END-Regel benutzt werden." + + #: eval.c:636 + msgid "`nextfile' cannot be called from a BEGIN rule" + msgstr "'nextfile' kann nicht in einer BEGIN-Regel benutzt werden." + + #: eval.c:638 + msgid "`nextfile' cannot be called from an END rule" + msgstr "'nextfile' kann nicht in einer END-Regel benutzt werden." + + #: eval.c:679 + msgid "statement has no effect" + msgstr "Anweisung hat keinen Effekt." + + #: eval.c:713 eval.c:743 eval.c:1622 + #, c-format + msgid "reference to uninitialized variable `%s'" + msgstr "Referenz auf die nicht-initialisierte Variable '%s'." + + #: eval.c:721 eval.c:1608 + #, c-format + msgid "can't use function name `%s' as variable or array" + msgstr "Kann Funktion '%s' nicht als Variable oder Array verwenden." + + #: eval.c:728 eval.c:734 eval.c:1747 + #, c-format + msgid "reference to uninitialized argument `%s'" + msgstr "Referenz auf nicht-initialisiertes Argument '%s'." + + #: eval.c:823 + msgid "assignment used in conditional context" + msgstr "Zuweisung in einer Bedingung." + + #: eval.c:914 + msgid "" + "concatenation: side effects in one expression have changed the length of " + "another!" + msgstr "" + "Konkatenierung: Seiteneffekte in einem Ausdruck haben die Länge des anderen\n" + "geändert!" + + #: eval.c:1013 + msgid "division by zero attempted" + msgstr "Division durch Null versucht." + + #: eval.c:1028 + #, c-format + msgid "division by zero attempted in `%%'" + msgstr "Division durch Null versucht in '%%'." + + #: eval.c:1236 + msgid "division by zero attempted in `/='" + msgstr "Division durch Null versucht in '/='." + + #: eval.c:1254 + #, c-format + msgid "division by zero attempted in `%%='" + msgstr "Division durch Null versucht in '%%='." + + #: eval.c:1424 + #, c-format + msgid "%s (from %s)" + msgstr "%s (von %s)" + + #: eval.c:1472 + #, c-format + msgid "function `%s' called with more arguments than declared" + msgstr "Funktion '%s' mit zu vielen Argumenten aufgerufen." + + #: eval.c:1519 + #, c-format + msgid "function `%s' not defined" + msgstr "Funktion '%s' ist nicht definiert." + + #: eval.c:1521 + #, c-format + msgid "function %s called\n" + msgstr "Funktion %s aufgerufen\n" + + #: eval.c:1580 + msgid "" + "\n" + "\t# Function Call Stack:\n" + "\n" + msgstr "" + "\n" + "\t# Funktion Aufruf-Stack\n" + "\n" + + #: eval.c:1583 + msgid "\t# -- main --\n" + msgstr "\t# -- main --\n" + + #: eval.c:1759 + msgid "attempt to field reference from non-numeric value" + msgstr "Nicht-numerischer Wert für Feldreferenz verwendet." + + #: eval.c:1761 + msgid "attempt to reference from null string" + msgstr "Referenz von einem Null-String" + + #: eval.c:1767 + #, c-format + msgid "attempt to access field %d" + msgstr "Versuch des Zugriffs auf Feld %d." + + #: eval.c:1783 + #, c-format + msgid "attempt to use scalar parameter `%s' as an array" + msgstr "Versuch den skalaren Parameter '%s' als Array zu benutzen." + + #: eval.c:1874 + msgid "`IGNORECASE' is a gawk extension" + msgstr "'IGNORECASE' ist eine gawk-Erweiterung" + + #: eval.c:1902 + msgid "`BINMODE' is a gawk extension" + msgstr "'BINMODE' ist eine gawk-Erweiterung." + + #: eval.c:2014 + #, c-format + msgid "bad `%sFMT' specification `%s'" + msgstr "Falsche '%sFMT'-Angabe '%s'" + + #: eval.c:2080 + msgid "turning off `--lint' due to assignment to `LINT'" + msgstr "'--lint' wird abgeschaltet, da 'LINT' gesetzt ist." + + #: eval.c:2116 + msgid "NF set to negative value" + msgstr "" + + #: io.c:240 + #, c-format + msgid "cannot open file `%s' for reading (%s)" + msgstr "Kann Datei '%s' nicht zum Lesen öffnen (%s)." + + #: io.c:320 + #, c-format + msgid "close of fd %d (`%s') failed (%s)" + msgstr "Schließen von Dateideskriptor %d ('%s') gescheitert (%s)." + + #: io.c:432 + #, c-format + msgid "invalid tree type %s in redirect()" + msgstr "Ungültiger Tree-Typ %s in redirect()." + + #: io.c:438 + #, c-format + msgid "expression in `%s' redirection only has numeric value" + msgstr "Ausdruck in '%s' Umlenkung hat nur einen numerischen Wert." + + #: io.c:444 + #, c-format + msgid "expression for `%s' redirection has null string value" + msgstr "Ausdruck für '%s' Umlenkung ist ein leerer String." + + #: io.c:449 + #, c-format + msgid "filename `%s' for `%s' redirection may be result of logical expression" + msgstr "" + "Dateiname '%s' für '%s' Umlenkung kann Ergebnis eines logischen Ausdrucks " + "sein." + + #: io.c:471 + #, c-format + msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" + msgstr "Unnötige Kombination von '>' und '>>' für Datei '%.*s'." + + #: io.c:523 + #, c-format + msgid "can't open pipe `%s' for output (%s)" + msgstr "Kann Pipe '%s' nicht für Ausgabe öffnen (%s)." + + #: io.c:532 + #, c-format + msgid "can't open pipe `%s' for input (%s)" + msgstr "Kann Pipe '%s' nicht für Eingabe öffnen (%s)." + + #: io.c:545 + #, c-format + msgid "can't open two way socket `%s' for input/output (%s)" + msgstr "Kann bidirektionalen Socket '%s' nicht für Ein-/Ausgabe öffnen (%s)." + + #: io.c:549 + #, c-format + msgid "can't open two way pipe `%s' for input/output (%s)" + msgstr "Kann bidirektionale Pipe '%s' nicht für Ein-/Ausgabe öffnen (%s)." + + #: io.c:625 + #, c-format + msgid "can't redirect from `%s' (%s)" + msgstr "Kann nicht von '%s' umlenken (%s)." + + #: io.c:628 + #, c-format + msgid "can't redirect to `%s' (%s)" + msgstr "Kann nicht auf '%s' umlenken (%s)." + + #: io.c:667 + msgid "" + "reached system limit for open files: starting to multiplex file descriptors" + msgstr "" + "Systemgrenze offener Dateien erreicht; beginne mit Multiplexing von " + "Dateideskriptoren." + + #: io.c:679 + #, c-format + msgid "close of `%s' failed (%s)." + msgstr "Schließen von '%s' gescheitert (%s)." + + #: io.c:686 + msgid "too many pipes or input files open" + msgstr "Zu viele Pipes oder Eingabedateien offen." + + #: io.c:709 + msgid "close: second argument must be `to' or `from'" + msgstr "close: Zweites Argument muss 'to' oder 'from' sein." + + #: io.c:723 + #, c-format + msgid "close: `%.*s' is not an open file, pipe or co-process" + msgstr "close: '%.*s' ist keine offene Datei, Pipe oder Ko-Prozess." + + #: io.c:727 + msgid "close of redirection that was never opened" + msgstr "'close' für eine Umlenkung, die nie geöffnet wurde." + + #: io.c:754 + #, c-format + msgid "close: redirection `%s' not opened with `|&', second argument ignored" + msgstr "" + "close: Umlenkung '%s' nicht mit '[&' geöffnet, zweites Argument wird " + "ignoriert." + + #: io.c:811 + #, c-format + msgid "failure status (%d) on pipe close of `%s' (%s)" + msgstr "Fehlerstatus (%d) beim Schließen der Pipe '%s' (%s)." + + #: io.c:814 + #, c-format + msgid "failure status (%d) on file close of `%s' (%s)" + msgstr "Fehlerstatus (%d) beim Schließen de rDatei '%s' (%s)." + + #: io.c:833 + #, c-format + msgid "no explicit close of socket `%s' provided" + msgstr "Das explizite des Sockets '%s' fehlt." + + #: io.c:836 + #, c-format + msgid "no explicit close of co-process `%s' provided" + msgstr "Das explizite Schließen des Ko-Prozesses '%s' fehlt." + + #: io.c:839 + #, c-format + msgid "no explicit close of pipe `%s' provided" + msgstr "Das explizite Schließen der Pipe '%s' fehlt." + + #: io.c:842 + #, c-format + msgid "no explicit close of file `%s' provided" + msgstr "Das explizite Schließen der Datei '%s' fehlt." + + #: io.c:871 io.c:925 + #, c-format + msgid "error writing standard output (%s)" + msgstr "Fehler beim Schreiben auf stdout (%s)." + + #: io.c:875 io.c:929 + #, c-format + msgid "error writing standard error (%s)" + msgstr "Fehler beim Schreiben auf stderr (%s)." + + #: io.c:883 + #, c-format + msgid "pipe flush of `%s' failed (%s)." + msgstr "Leeren der Pipe '%s' gescheitert (%s)." + + #: io.c:886 + #, c-format + msgid "co-process flush of pipe to `%s' failed (%s)." + msgstr "Ko-Prozess: Leeren der Pipe zu '%s' gescheitert (%s)." + + #: io.c:889 + #, c-format + msgid "file flush of `%s' failed (%s)." + msgstr "Flush der Datei '%s' gescheitert (%s)." + + #: io.c:1048 + msgid "/inet/raw client not ready yet, sorry" + msgstr "/inet/raw Client noch nicht fertig." + + #: io.c:1050 io.c:1087 + msgid "only root may use `/inet/raw'." + msgstr "Nur root darf '/inet/raw' benutzen" + + #: io.c:1085 + msgid "/inet/raw server not ready yet, sorry" + msgstr "'/inet/raw'-Server noch nicht fertig." + + #: io.c:1175 + #, c-format + msgid "no (known) protocol supplied in special filename `%s'" + msgstr "Kein bekanntes Protokoll in Dateinamen '%s' angegeben." + + #: io.c:1193 + #, c-format + msgid "special file name `%s' is incomplete" + msgstr "Dateiname '%s' ist unvollständig." + + #: io.c:1205 + #, c-format + msgid "local port invalid in `%s'" + msgstr "Lokaler Port in '%s' ist ungültig." + + #: io.c:1217 + msgid "must supply a remote hostname to `/inet'" + msgstr "Sie müssen einen Rechnernamen in '/inet' angeben." + + #: io.c:1232 + msgid "must supply a remote port to `/inet'" + msgstr "Sie müssen einen Port in '/inet' angeben." + + #: io.c:1238 + #, c-format + msgid "remote port invalid in `%s'" + msgstr "Port-Angabe in '%s' ist ungültig." + + #: io.c:1248 + msgid "TCP/IP communications are not supported" + msgstr "TCP/IP-Verbindungen sind nicht möglich." + + #: io.c:1257 io.c:1438 + #, c-format + msgid "file `%s' is a directory" + msgstr "Datei '%s' ist ein Verzeichnis." + + #: io.c:1327 + #, c-format + msgid "use `PROCINFO[\"%s\"]' instead of `%s'" + msgstr "Benutzen Sie 'PROCINFO[\"%s\"]' statt '%s'" + + #: io.c:1359 + msgid "use `PROCINFO[...]' instead of `/dev/user'" + msgstr "Benutzen Sie 'PROCINFO[...] statt '/dev/user'." + + #: io.c:1424 + #, c-format + msgid "could not open `%s', mode `%s'" + msgstr "Konnte '%s' nicht öffnen, Mode '%s'." + + #: io.c:1550 io.c:1602 io.c:1732 io.c:1754 + #, c-format + msgid "moving pipe to stdout in child failed (dup: %s)" + msgstr "Verschieben der Pipe zu stdout in Kindprozess gescheitert (dup: %s)." + + #: io.c:1554 io.c:1607 + #, c-format + msgid "moving pipe to stdin in child failed (dup: %s)" + msgstr "Verschieben der Pipe zu stdin in Kindprozess gescheitert (dup: %s)." + + #: io.c:1571 io.c:1745 + msgid "restoring stdout in parent process failed\n" + msgstr "" + + #: io.c:1576 + msgid "restoring stdin in parent process failed\n" + msgstr "" + + #: io.c:1599 io.c:1751 + #, c-format + msgid "close of stdout in child failed (%s)" + msgstr "Schließen von stdout in Kindprozess gescheitert (%s)." + + #: io.c:1604 + #, c-format + msgid "close of stdin in child failed (%s)" + msgstr "Schließen von stdin im Kindprozess gescheitert (%s)." + + #: io.c:1610 io.c:1756 io.c:1767 + #, c-format + msgid "close of pipe failed (%s)" + msgstr "Schließen der Pipe gescheitert (%s)." + + #: io.c:1655 + msgid "`|&' not supported" + msgstr "'|&' nicht möglich." + + #: io.c:1722 + #, c-format + msgid "cannot open pipe `%s' (%s)" + msgstr "Kann Pipe '%s' nicht öffnen (%s)." + + #: io.c:1763 + #, c-format + msgid "cannot create child process for `%s' (fork: %s)" + msgstr "Kann Kindprozess für '%s' nicht erzeugen (fork: %s)." + + #: io.c:2104 + #, c-format + msgid "data file `%s' is empty" + msgstr "Datei '%s' ist leer." + + #: io.c:2175 + #, c-format + msgid "internal error: file `%s', line %d\n" + msgstr "Interner Fehler: Datei '%s', Zeile %d\n" + + #: io.c:2277 + #, c-format + msgid "error reading input file `%s': %s" + msgstr "Fehler beim Lesen der Eingabedatei '%s': %s." + + #: io.c:2521 + msgid "multicharacter value of `RS' is a gawk extension" + msgstr "Multicharacter-Wert von 'RS' ist eine gawk-Erweiterung." + + #: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 + msgid "can't convert string to float" + msgstr "Kann String nicht in Gleitkommazahl konvertieren." + + #: node.c:342 + msgid "backslash at end of string" + msgstr "Backslash am String-Ende." + + #: node.c:524 + msgid "POSIX does not allow `\\x' escapes" + msgstr "POSIX erlabut keine '\\x'-Escapes." + + #: node.c:530 + msgid "no hex digits in `\\x' escape sequence" + msgstr "Keine Hex-Ziffern in '\\x'-Escape." + + #: node.c:564 + #, c-format + msgid "escape sequence `\\%c' treated as plain `%c'" + msgstr "Escape-Sequenz '\\%c' als '%c' behandelt." + + #: re.c:208 + #, c-format + msgid "regex match failed, not enough memory to match string \"%.*s%s\"" + msgstr "" + + #: posix/gawkmisc.c:122 + #, fuzzy, c-format + msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)" + msgstr "%s %s '%s': Konnte close-on-exec nicht setzen: %s" + + #~ msgid "" + #~ "\n" + #~ "To report bugs, see node `Bugs' in `gawk.info', which is\n" + #~ msgstr "" + #~ "\n" + #~ "Um Fehler zu melden, lesen Sie bitte den Abschnitt 'Bugs' in " + #~ "'gawk_info',\n" + + #~ msgid "pipe from `%s': could not set close-on-exec (fcntl: %s)" + #~ msgstr "Pipe von '%s': Konnte close-on-exec nicht setzen (fcntl: %s)." + + #~ msgid "pipe to `%s': could not set close-on-exec (fcntl: %s)" + #~ msgstr "Pipe zu '%s': Konnte close-on-exec nicht setzen (fcntl: %s)." diff -crN gawk-3.1.0/po/en@boldquot.header gawk-3.1.1/po/en@boldquot.header *** gawk-3.1.0/po/en@boldquot.header Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/en@boldquot.header Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,25 ---- + # All this catalog "translates" are quotation characters. + # The msgids must be ASCII and therefore cannot contain real quotation + # characters, only substitutes like grave accent (0x60), apostrophe (0x27) + # and double quote (0x22). These substitutes look strange; see + # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html + # + # This catalog translates grave accent (0x60) and apostrophe (0x27) to + # left single quotation mark (U+2018) and right single quotation mark (U+2019). + # It also translates pairs of apostrophe (0x27) to + # left single quotation mark (U+2018) and right single quotation mark (U+2019) + # and pairs of quotation mark (0x22) to + # left double quotation mark (U+201C) and right double quotation mark (U+201D). + # + # When output to an UTF-8 terminal, the quotation characters appear perfectly. + # When output to an ISO-8859-1 terminal, the single quotation marks are + # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to + # grave/acute accent (by libiconv), and the double quotation marks are + # transliterated to 0x22. + # When output to an ASCII terminal, the single quotation marks are + # transliterated to apostrophes, and the double quotation marks are + # transliterated to 0x22. + # + # This catalog furthermore displays the text between the quotation marks in + # bold face, assuming the VT100/XTerm escape sequences. + # diff -crN gawk-3.1.0/po/en@quot.header gawk-3.1.1/po/en@quot.header *** gawk-3.1.0/po/en@quot.header Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/en@quot.header Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,22 ---- + # All this catalog "translates" are quotation characters. + # The msgids must be ASCII and therefore cannot contain real quotation + # characters, only substitutes like grave accent (0x60), apostrophe (0x27) + # and double quote (0x22). These substitutes look strange; see + # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html + # + # This catalog translates grave accent (0x60) and apostrophe (0x27) to + # left single quotation mark (U+2018) and right single quotation mark (U+2019). + # It also translates pairs of apostrophe (0x27) to + # left single quotation mark (U+2018) and right single quotation mark (U+2019) + # and pairs of quotation mark (0x22) to + # left double quotation mark (U+201C) and right double quotation mark (U+201D). + # + # When output to an UTF-8 terminal, the quotation characters appear perfectly. + # When output to an ISO-8859-1 terminal, the single quotation marks are + # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to + # grave/acute accent (by libiconv), and the double quotation marks are + # transliterated to 0x22. + # When output to an ASCII terminal, the single quotation marks are + # transliterated to apostrophes, and the double quotation marks are + # transliterated to 0x22. + # diff -crN gawk-3.1.0/po/es.po gawk-3.1.1/po/es.po *** gawk-3.1.0/po/es.po Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/es.po Wed May 1 16:40:58 2002 *************** *** 0 **** --- 1,1792 ---- + # Mensajes en español para gawk-3.1.1a. + # Copyright (C) 2001, 2002 Free Software Foundation, Inc. + # Cristian Othón Martínez Vera , 2001, 2002. + # + msgid "" + msgstr "" + "Project-Id-Version: gawk 3.1.1a\n" + "POT-Creation-Date: 2002-05-01 16:40+0300\n" + "PO-Revision-Date: 2002-04-28 14:16-0600\n" + "Last-Translator: Cristian Othón Martínez Vera \n" + "Language-Team: Spanish \n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=ISO-8859-1\n" + "Content-Transfer-Encoding: 8bit\n" + + #: array.c:243 array.c:275 array.c:280 eval.c:483 + #, c-format + msgid "attempt to use scalar `%s' as array" + msgstr "se intentó usar el dato escalar `%s' como un arreglo" + + #: array.c:304 + #, c-format + msgid "reference to uninitialized element `%s[\"%s\"]'" + msgstr "referencia al elemento sin valor inicial `%s[\"%s\"]'" + + #: array.c:310 + #, c-format + msgid "subscript of array `%s' is null string" + msgstr "el subíndice de la matriz `%s' es la cadena nula" + + #: array.c:373 array.c:456 + #, c-format + msgid "delete: illegal use of variable `%s' as array" + msgstr "delete: uso ilegal de la variable `%s' como una matriz" + + #: array.c:406 + #, c-format + msgid "delete: index `%s' not in array `%s'" + msgstr "delete: el índice `%s' no está en la matriz `%s'" + + #: array.c:571 + #, c-format + msgid "%s: empty (null)\n" + msgstr "%s: vacío (nulo)\n" + + #: array.c:576 + #, c-format + msgid "%s: empty (zero)\n" + msgstr "%s: vacío (cero)\n" + + #: array.c:580 + #, c-format + msgid "%s: table_size = %d, array_size = %d\n" + msgstr "%s: tamaño_tabla = %d, tamaño_matriz = %d\n" + + #: array.c:612 + #, c-format + msgid "%s: is parameter\n" + msgstr "%s: es un parámetro\n" + + #: array.c:617 + #, c-format + msgid "%s: array_ref to %s\n" + msgstr "%s: array_ref a %s\n" + + #: array.c:844 + msgid "asort: first argument is not an array" + msgstr "asort: el primer argumento no es una matriz" + + #: array.c:853 + msgid "asort: second argument is not an array" + msgstr "asort: el segundo argumento no es una matriz" + + #: builtin.c:107 + #, c-format + msgid "%s to \"%s\" failed (%s)" + msgstr "falló %s a \"%s\" (%s)" + + #: builtin.c:108 + msgid "standard output" + msgstr "salida estándar" + + #: builtin.c:109 + msgid "reason unknown" + msgstr "razón desconocida" + + #: builtin.c:122 + msgid "exp: received non-numeric argument" + msgstr "exp: se recibió un argumento que no es un numéro" + + #: builtin.c:128 + #, c-format + msgid "exp: argument %g is out of range" + msgstr "exp: el argumento %g está fuera de rango" + + #: builtin.c:186 + #, c-format + msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" + msgstr "" + "fflush: no se puede limpiar: se abrió la tubería `%s' para lectura, no para " + "escritura" + + #: builtin.c:189 + #, c-format + msgid "fflush: cannot flush: file `%s' opened for reading, not writing" + msgstr "" + "fflush: no se puede limpiar: se abrió el fichero `%s' para lectura, no para " + "escritura" + + #: builtin.c:201 + #, c-format + msgid "fflush: `%s' is not an open file, pipe or co-process" + msgstr "fflush: `%s' no es un fichero abierto, tubería o co-proceso" + + #: builtin.c:295 + msgid "index: received non-string first argument" + msgstr "index: el primer argumento recibido no es una cadena" + + #: builtin.c:297 + msgid "index: received non-string second argument" + msgstr "index: el segundo argumento recibido no es una cadena" + + #: builtin.c:407 + msgid "int: received non-numeric argument" + msgstr "int: se recibió un argumento que no es un numéro" + + #: builtin.c:424 + msgid "length: received non-string argument" + msgstr "length: se recibió un argumento que no es una cadena" + + #: builtin.c:440 + msgid "log: received non-numeric argument" + msgstr "log: se recibió un argumento que no es un numéro" + + #: builtin.c:443 + #, c-format + msgid "log: received negative argument %g" + msgstr "log: se recibió el argumento negativo %g" + + #: builtin.c:605 builtin.c:608 + msgid "must use `count$' on all formats or none" + msgstr "se debe utilizar `count$' en todos los formatos o en ninguno" + + #: builtin.c:703 + msgid "`$' is not permitted in awk formats" + msgstr "no se permite `$' en los formatos de awk" + + #: builtin.c:709 + msgid "arg count with `$' must be > 0" + msgstr "la cuenta de argumentos con `$' debe ser > 0" + + #: builtin.c:711 + #, c-format + msgid "arg count %d greater than total number of supplied arguments" + msgstr "" + "la cuenta de argumentos %d es mayor que el número total de argumentos " + "proporcionados" + + #: builtin.c:713 + msgid "`$' not permitted after period in format" + msgstr "no se permite `$' después de un punto en el formato" + + #: builtin.c:726 + msgid "no `$' supplied for positional field width or precision" + msgstr "" + "no se proporciona `$' para el ancho o la precisión del campo posicional" + + #: builtin.c:784 + msgid "`l' is meaningless in awk formats; ignored" + msgstr "`l' no tiene significado en los formatos de awk; ignorado" + + #: builtin.c:788 + msgid "`l' is not permitted in POSIX awk formats" + msgstr "no se permite `l' en los formatos POSIX de awk" + + #: builtin.c:799 + msgid "`L' is meaningless in awk formats; ignored" + msgstr "`L' no tiene significado en los formatos de awk; ignorado" + + #: builtin.c:803 + msgid "`L' is not permitted in POSIX awk formats" + msgstr "no se permite `L' en los formatos POSIX de awk" + + #: builtin.c:814 + msgid "`h' is meaningless in awk formats; ignored" + msgstr "`h' no tiene significado en los formatos de awk; ignorado" + + #: builtin.c:818 + msgid "`h' is not permitted in POSIX awk formats" + msgstr "no se permite `h' en los formatos POSIX de awk" + + #: builtin.c:1067 + msgid "not enough arguments to satisfy format string" + msgstr "no hay suficientes argumentos para satisfacer a la cadena de formato" + + #: builtin.c:1069 + msgid "^ ran out for this one" + msgstr "se acabó ^ para éste" + + #: builtin.c:1074 + msgid "[s]printf: format specifier does not have control letter" + msgstr "[s]printf: el especificador de formato no tiene letras de control" + + #: builtin.c:1077 + msgid "too many arguments supplied for format string" + msgstr "se proporcionaron demasiados argumentos para la cadena de formato" + + #: builtin.c:1120 builtin.c:1123 + msgid "printf: no arguments" + msgstr "printf: sin argumentos" + + #: builtin.c:1156 + msgid "sqrt: received non-numeric argument" + msgstr "sqrt: se recibió un argumento que no es un numéro" + + #: builtin.c:1160 + #, c-format + msgid "sqrt: called with negative argument %g" + msgstr "sqrt: llamado con el argumento negativo %g" + + #: builtin.c:1182 + #, c-format + msgid "substr: start index %g is invalid, using 1" + msgstr "substr: el índice de inicio %g es inválido, usando 1" + + #: builtin.c:1187 + #, c-format + msgid "substr: non-integer start index %g will be truncated" + msgstr "substr: el índice de inicio no entero %g será truncado" + + #: builtin.c:1201 + #, c-format + msgid "substr: length %g is <= 0" + msgstr "substr: la longitud %g es <= 0" + + #: builtin.c:1207 + #, c-format + msgid "substr: non-integer length %g will be truncated" + msgstr "substr: la longitud no entera %g será truncada" + + #: builtin.c:1214 + msgid "substr: source string is zero length" + msgstr "substr: la cadena de origen es de longitud cero" + + #: builtin.c:1221 + #, c-format + msgid "" + "substr: length %d at start index %d exceeds length of first argument (%d)" + msgstr "" + "substr: la cadena %d en el índice de inicio %d excede la longitud del primer " + "argumento (%d)" + + #: builtin.c:1227 + #, c-format + msgid "substr: start index %d is past end of string" + msgstr "substr: el índice de inicio %d está después del fin de la cadena" + + #: builtin.c:1263 + msgid "strftime: received non-string first argument" + msgstr "strftime: el primer argumento que se recibió no es una cadena" + + #: builtin.c:1269 + msgid "strftime: received empty format string" + msgstr "strftime: se recibió una cadena de formato vacía" + + #: builtin.c:1278 + msgid "strftime: received non-numeric second argument" + msgstr "strftime: el segundo argumento que se recibió no es un numéro" + + #: builtin.c:1341 + msgid "mktime: received non-string argument" + msgstr "mktime: se recibió un argumento que no es una cadena" + + #: builtin.c:1386 + msgid "system: received non-string argument" + msgstr "system: se recibió un argumento que no es una cadena" + + #: builtin.c:1512 + msgid "tolower: received non-string argument" + msgstr "tolower: se recibió un argumento que no es una cadena" + + #: builtin.c:1561 + msgid "toupper: received non-string argument" + msgstr "toupper: se recibió un argumento que no es una cadena" + + #: builtin.c:1606 + msgid "atan2: received non-numeric first argument" + msgstr "atan2: el primer argumento recibido no es un numéro" + + #: builtin.c:1608 + msgid "atan2: received non-numeric second argument" + msgstr "atan2: el segundo argumento recibido no es un numéro" + + #: builtin.c:1627 + msgid "sin: received non-numeric argument" + msgstr "sin: se recibió un argumento que no es un numéro" + + #: builtin.c:1643 + msgid "cos: received non-numeric argument" + msgstr "cos: se recibió un argumento que no es un numéro" + + #: builtin.c:1687 + msgid "srand: received non-numeric argument" + msgstr "srand: se recibió un argumento que no es un numéro" + + #: builtin.c:1721 + msgid "match: third argument is not an array" + msgstr "match: el tercer argumento no es una matriz" + + #: builtin.c:2157 + msgid "gensub: 3rd argument of 0 treated as 1" + msgstr "gensub: el tercer argumento en 0 es tratado como 1" + + #: builtin.c:2268 builtin.c:2270 + msgid "lshift: received non-numeric first argument" + msgstr "lshift: el primer argumento recibido no es un numéro" + + #: builtin.c:2272 + #, c-format + msgid "lshift(%lf, %lf): negative values will give strange results" + msgstr "lshift(%lf, %lf): los valores negativos darán resultados extraños" + + #: builtin.c:2274 + #, c-format + msgid "lshift(%lf, %lf): fractional values will be truncated" + msgstr "lshift(%lf, %lf): los valores fraccionarios serán truncados" + + #: builtin.c:2276 + #, c-format + msgid "lshift(%lf, %lf): too large shift value will give strange results" + msgstr "" + "lshift(%lf, %lf): un valor de desplazamiento muy grande dará resultados " + "extraños" + + #: builtin.c:2305 builtin.c:2307 + msgid "rshift: received non-numeric first argument" + msgstr "rshift: el primer argumento recibido no es un numéro" + + #: builtin.c:2309 + #, c-format + msgid "rshift(%lf, %lf): negative values will give strange results" + msgstr "rshift(%lf, %lf): los valores negativos darán resultados extraños" + + #: builtin.c:2311 + #, c-format + msgid "rshift(%lf, %lf): fractional values will be truncated" + msgstr "rshift(%lf, %lf): los valores fraccionarios serán truncados" + + #: builtin.c:2313 + #, c-format + msgid "rshift(%lf, %lf): too large shift value will give strange results" + msgstr "" + "rshift(%lf, %lf): un valor de desplazamiento muy grande dará resultados " + "extraños" + + #: builtin.c:2342 builtin.c:2344 + msgid "and: received non-numeric first argument" + msgstr "and: el primer argumento recibido no es un número" + + #: builtin.c:2346 + #, c-format + msgid "and(%lf, %lf): negative values will give strange results" + msgstr "and(%lf, %lf): los valores negativos darán resultados extraños" + + #: builtin.c:2348 + #, c-format + msgid "and(%lf, %lf): fractional values will be truncated" + msgstr "and(%lf, %lf): los valores fraccionarios serán truncados" + + #: builtin.c:2377 builtin.c:2379 + msgid "or: received non-numeric first argument" + msgstr "or: el primer argumento recibido no es un número" + + #: builtin.c:2381 + #, c-format + msgid "or(%lf, %lf): negative values will give strange results" + msgstr "or(%lf, %lf): los valores negativos darán resultados extraños" + + #: builtin.c:2383 + #, c-format + msgid "or(%lf, %lf): fractional values will be truncated" + msgstr "or(%lf, %lf): los valores fraccionarios serán truncados" + + #: builtin.c:2412 builtin.c:2414 + msgid "xor: received non-numeric first argument" + msgstr "xor: el primer argumento recibido no es un número" + + #: builtin.c:2416 + #, c-format + msgid "xor(%lf, %lf): negative values will give strange results" + msgstr "xor(%lf, %lf): los valores negativos darán resultados extraños" + + #: builtin.c:2418 + #, c-format + msgid "xor(%lf, %lf): fractional values will be truncated" + msgstr "xor(%lf, %lf): los valores fraccionarios serán truncados" + + #: builtin.c:2446 + msgid "compl: received non-numeric argument" + msgstr "compl: se recibió un argumento que no es un número" + + #: builtin.c:2448 + #, c-format + msgid "compl(%lf): negative value will give strange results" + msgstr "compl(%lf): el valor negativo dará resultados extraños" + + #: builtin.c:2450 + #, c-format + msgid "compl(%lf): fractional value will be truncated" + msgstr "compl(%lf): el valor fraccionario será truncado" + + #: builtin.c:2621 + #, c-format + msgid "dcgettext: `%s' is not a valid locale category" + msgstr "dcgettext: `%s' no es una categoría local válida" + + #: ext.c:60 ext.c:64 + msgid "`extension' is a gawk extension" + msgstr "`extension' es una extensión de gawk" + + #: ext.c:74 + #, c-format + msgid "extension: cannot open `%s' (%s)\n" + msgstr "extension: no se puede abrir `%s' (%s)\n" + + #: ext.c:82 + #, c-format + msgid "extension: library `%s': cannot call function `%s' (%s)\n" + msgstr "" + "extension: biblioteca `%s': no se puede llamar a la función `%s' (%s)\n" + + #: ext.c:180 + msgid "Operation Not Supported" + msgstr "No Se Da Soporte A La Operación" + + #: getopt.c:692 getopt.c:704 + #, c-format + msgid "%s: option `%s' is ambiguous\n" + msgstr "%s: la opción `%s' es ambigua\n" + + #: getopt.c:737 getopt.c:741 + #, c-format + msgid "%s: option `--%s' doesn't allow an argument\n" + msgstr "%s: la opción `--%s' no admite ningún argumento\n" + + #: getopt.c:750 getopt.c:755 + #, 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" + + #: getopt.c:791 getopt.c:804 getopt.c:1093 getopt.c:1106 + #, c-format + msgid "%s: option `%s' requires an argument\n" + msgstr "%s: la opción `%s' requiere un argumento\n" + + #: getopt.c:842 getopt.c:845 + #, c-format + msgid "%s: unrecognized option `--%s'\n" + msgstr "%s: no se reconoce la opción `--%s'\n" + + #: getopt.c:853 getopt.c:856 + #, c-format + msgid "%s: unrecognized option `%c%s'\n" + msgstr "%s: no se reconoce la opción `%c%s'\n" + + #: getopt.c:903 getopt.c:906 + #, c-format + msgid "%s: illegal option -- %c\n" + msgstr "%s: opción ilegal -- %c\n" + + #: getopt.c:912 getopt.c:915 + #, c-format + msgid "%s: invalid option -- %c\n" + msgstr "%s: opción inválida -- %c\n" + + #: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412 + #, c-format + msgid "%s: option requires an argument -- %c\n" + msgstr "%s: la opción requiere un argumento -- %c\n" + + #: getopt.c:1025 getopt.c:1036 + #, c-format + msgid "%s: option `-W %s' is ambiguous\n" + msgstr "%s: la opción `-W %s' es ambigua\n" + + #: getopt.c:1060 getopt.c:1072 + #, 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" + + #: main.c:307 + msgid "`-m[fr]' option irrelevant in gawk" + msgstr "la opción -m[fr] es irrelevante en gawk" + + #: main.c:309 + msgid "-m option usage: `-m[fr] nnn'" + msgstr "uso de la opción -m: `-m[fr]' nnn" + + #: main.c:326 + #, c-format + msgid "%s: option `-W %s' unrecognized, ignored\n" + msgstr "%s: no se reconoce la opción `-W %s', ignorada\n" + + #: main.c:357 + msgid "empty argument to `--source' ignored" + msgstr "se ignora el argumento vacío para `--source'" + + #: main.c:429 + msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" + msgstr "" + "la variable de ambiente `POSIXLY_CORRECT' está establecida: activando `--" + "posix'" + + #: main.c:434 + msgid "`--posix' overrides `--traditional'" + msgstr "`--posix' se impone a `--traditional'" + + #: main.c:445 + msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" + msgstr "`--posix'/`--traditional' se imponen a `--non-decimal-data'" + + #: main.c:449 + #, c-format + msgid "running %s setuid root may be a security problem" + msgstr "ejecutar %s como setuid root puede ser un problema de seguridad" + + #: main.c:478 + #, c-format + msgid "can't set mode on stdin (%s)" + msgstr "no se puede establecer el modo en la entrada estándar (%s)" + + #: main.c:481 + #, c-format + msgid "can't set mode on stdout (%s)" + msgstr "no se puede establecer el modo en la salida estándar (%s)" + + #: main.c:483 + #, c-format + msgid "can't set mode on stderr (%s)" + msgstr "no se puede establecer el modo en la salida estándar de error (%s)" + + #: main.c:512 + msgid "no program text at all!" + msgstr "¡No hay ningún programa de texto!" + + #: main.c:556 + #, c-format + msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" + msgstr "" + "Modo de empleo: %s [opciones estilo POSIX o GNU] -f fichprog [--] " + "fichero ...\n" + + #: main.c:558 + #, c-format + msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" + msgstr "" + "Modo de empleo: %s [opciones estilo POSIX o GNU] [--] %cprograma%c " + "fichero ...\n" + + #: main.c:563 + msgid "POSIX options:\t\tGNU long options:\n" + msgstr "Opciones POSIX:\t\tOpciones largas GNU:\n" + + #: main.c:564 + msgid "\t-f progfile\t\t--file=progfile\n" + msgstr "\t-f fichprog\t\t--file=fichprog\n" + + #: main.c:565 + msgid "\t-F fs\t\t\t--field-separator=fs\n" + msgstr "\t-F sc\t\t\t--field-separator=sc\n" + + #: main.c:566 + msgid "\t-v var=val\t\t--assign=var=val\n" + msgstr "\t-v var=valor\t\t--assign=var=valor\n" + + #: main.c:567 + msgid "\t-m[fr] val\n" + msgstr "\t-m[fr] valor\n" + + #: main.c:568 + msgid "\t-W compat\t\t--compat\n" + msgstr "\t-W compat\t\t--compat\n" + + #: main.c:569 + msgid "\t-W copyleft\t\t--copyleft\n" + msgstr "\t-W copyleft\t\t--copyleft\n" + + #: main.c:570 + msgid "\t-W copyright\t\t--copyright\n" + msgstr "\t-W copyright\t\t--copyright\n" + + #: main.c:571 + msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" + msgstr "\t-W dump-variables[=fichero]\t--dump-variables[=fichero]\n" + + #: main.c:572 + msgid "\t-W gen-po\t\t--gen-po\n" + msgstr "\t-W gen-po\t\t--gen-po\n" + + #: main.c:573 + msgid "\t-W help\t\t\t--help\n" + msgstr "\t-W help\t\t\t--help\n" + + #: main.c:574 + msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" + msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n" + + #: main.c:575 + msgid "\t-W lint-old\t\t--lint-old\n" + msgstr "\t-W lint-old\t\t--lint-old\n" + + #: main.c:576 + msgid "\t-W non-decimal-data\t--non-decimal-data\n" + msgstr "\t-W non-decimal-data\t--non-decimal-data\n" + + #: main.c:578 + msgid "\t-W nostalgia\t\t--nostalgia\n" + msgstr "\t-W nostalgia\t\t--nostalgia\n" + + #: main.c:581 + msgid "\t-W parsedebug\t\t--parsedebug\n" + msgstr "\t-W parsedebug\t\t--parsedebug\n" + + #: main.c:583 + msgid "\t-W profile[=file]\t--profile[=file]\n" + msgstr "\t-W profile[=fichero]\t--profile[=fichero]\n" + + #: main.c:584 + msgid "\t-W posix\t\t--posix\n" + msgstr "\t-W posix\t\t--posix\n" + + #: main.c:585 + msgid "\t-W re-interval\t\t--re-interval\n" + msgstr "\t-W re-interval\t\t--re-interval\n" + + # Esta es la línea más larga de la lista de argumentos. + # Probar con gawk para revisar tabuladores. cfuga + #: main.c:586 + msgid "\t-W source=program-text\t--source=program-text\n" + msgstr "\t-W source=texto-prog\t--source=texto-prog\n" + + #: main.c:587 + msgid "\t-W traditional\t\t--traditional\n" + msgstr "\t-W traditional\t\t--traditional\n" + + #: main.c:588 + msgid "\t-W usage\t\t--usage\n" + msgstr "\t-W usage\t\t--usage\n" + + #: main.c:589 + msgid "\t-W version\t\t--version\n" + msgstr "\t-W version\t\t--version\n" + + #: main.c:593 + msgid "" + "\n" + "To report bugs, see node `Bugs' in `gawk.info', which is\n" + "section `Reporting Problems and Bugs' in the printed version.\n" + "\n" + msgstr "" + "\n" + "Para reportar bichos, consulte el nodo `Bugs' en `gawk.info', el cual\n" + "corresponde a la sección `Reporting Problems and Bugs' en la versión " + "impresa.\n" + "\n" + + #: main.c:597 + msgid "" + "gawk is a pattern scanning and processing language.\n" + "By default it reads standard input and writes standard output.\n" + "\n" + msgstr "" + "gawk es un lenguaje de reconocimiento y procesamiento de patrones.\n" + "Por omisión lee la entrada estándar y escribe en la salida estándar.\n" + "\n" + + #: main.c:601 + msgid "" + "Examples:\n" + "\tgawk '{ sum += $1 }; END { print sum }' file\n" + "\tgawk -F: '{ print $1 }' /etc/passwd\n" + msgstr "" + "Ejemplos:\n" + "\tgawk '{ sum += $1 }; END { print sum }' fichero\n" + "\tgawk -F: '{ print $1 }' /etc/passwd\n" + + #: main.c:613 + #, c-format + msgid "" + "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" + "\n" + "This program is free software; you can redistribute it and/or modify\n" + "it under the terms of the GNU General Public License as published by\n" + "the Free Software Foundation; either version 2 of the License, or\n" + "(at your option) any later version.\n" + "\n" + msgstr "" + "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" + "\n" + "Este programa es software libre; puede redistribuirse y/o ser modificado\n" + "bajo los términos de la Licencia Pública General de GNU tal como es " + "publicada\n" + "por la Free Software Foundation; ya sea por la versión 2 de la Licencia, o\n" + "(a su elección) cualquier versión posterior.\n" + "\n" + + #: main.c:621 + msgid "" + "This program is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "GNU General Public License for more details.\n" + "\n" + msgstr "" + "Este programa se distribuye con la esperanza que será útil,\n" + "pero SIN NINGUNA GARANTÍA; aún sin la garantía implícita de\n" + "COMERCIABILIDAD o IDONEIDAD PARA UN FIN DETERMINADO. Vea la\n" + "Licencia Pública General de GNU para más detalles.\n" + "\n" + + #: main.c:627 + msgid "" + "You should have received a copy of the GNU General Public License\n" + "along with this program; if not, write to the Free Software\n" + "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + msgstr "" + "Debió haber recibido una copia de la Licencia Pública General de GNU\n" + "junto con este programa; si no es así, escriba a la Free Software\n" + "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + + #: main.c:657 + msgid "-Ft does not set FS to tab in POSIX awk" + msgstr "-Ft no establece FS a tabulador en el awk de POSIX" + + #: main.c:888 + #, c-format + msgid "invalid syntax in name `%s' for variable assignment" + msgstr "sintaxis inválida en el nombre `%s' para la asignación de variable" + + #: main.c:957 + msgid "floating point exception" + msgstr "excepción de coma flotante" + + #: main.c:964 + msgid "fatal error: internal error" + msgstr "error fatal: error interno" + + #: main.c:1014 + #, c-format + msgid "no pre-opened fd %d" + msgstr "no existe el df %d abierto previamente" + + #: main.c:1019 + #, c-format + msgid "could not pre-open /dev/null for fd %d" + msgstr "no se puede abrir previamente /dev/null para el df %d" + + #: main.c:1037 main.c:1046 + #, c-format + msgid "could not find groups: %s" + msgstr "no se pueden encontrar los grupos: %s" + + #: profile.c:94 + #, c-format + msgid "could not open `%s' for writing: %s" + msgstr "no se puede abrir `%s' para escritura: %s" + + #: profile.c:96 awkgram.y:2465 + msgid "sending profile to standard error" + msgstr "enviando perfil a la salida estándar de error" + + #: profile.c:409 + msgid "internal error: Node_var with null vname" + msgstr "error interno: Node_var con vname nulo" + + #: profile.c:524 + msgid "internal error: Node_var_array with null vname" + msgstr "error interno: Node_var_array con vname nulo" + + #: profile.c:554 eval.c:813 + #, c-format + msgid "" + "function `%s' called with space between name and `(',\n" + "%s" + msgstr "" + "se llamó la función `%s' con espacio entre el nombre y el `(',\n" + "%s" + + #: profile.c:556 eval.c:815 + msgid "or used in other expression context" + msgstr "se usó or en otro contexto de la expresión" + + #: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741 + #, c-format + msgid "attempt to use array `%s' in a scalar context" + msgstr "se intentó usar la matriz `%s' en un contexto escalar" + + #: profile.c:637 eval.c:1047 + #, c-format + msgid "illegal type (%s) in tree_eval" + msgstr "tipo ilegal (%s) en tree_eval" + + #: profile.c:842 eval.c:1790 + #, c-format + msgid "attempt to use function `%s' as array" + msgstr "se intentó usar la función `%s' como una matriz" + + #: profile.c:856 eval.c:1797 + #, c-format + msgid "`%s' is a function, assignment is not allowed" + msgstr "`%s' es una función, no se permite asignación" + + #: profile.c:860 eval.c:1803 eval.c:1810 + msgid "assignment is not allowed to result of builtin function" + msgstr "no se permite asignación como resultado de una función interna" + + #: profile.c:1108 + #, c-format + msgid "\t# gawk profile, created %s\n" + msgstr "\t# perfil de gawk, creado %s\n" + + #: profile.c:1111 + msgid "" + "\t# BEGIN block(s)\n" + "\n" + msgstr "" + "\t# bloque(s) BEGIN\n" + "\n" + + #: profile.c:1121 + msgid "" + "\t# Rule(s)\n" + "\n" + msgstr "" + "\t# Regla(s)\n" + "\n" + + #: profile.c:1127 + msgid "" + "\t# END block(s)\n" + "\n" + msgstr "" + "\t# bloque(s) END\n" + "\n" + + #: profile.c:1147 + msgid "" + "\n" + "\t# Functions, listed alphabetically\n" + msgstr "" + "\n" + "\t# Funciones, enumeradas alfabéticamente\n" + + #: profile.c:1357 + #, c-format + msgid "unexpected type %s in prec_level" + msgstr "tipo %s inesperado en prec_level" + + #: regex.c:1322 + msgid "Success" + msgstr "Éxito" + + #: regex.c:1323 + msgid "No match" + msgstr "No hay coincidencia" + + #: regex.c:1324 + msgid "Invalid regular expression" + msgstr "Expresión regular inválida" + + #: regex.c:1325 + msgid "Invalid collation character" + msgstr "Caracter de ordenación inválido" + + #: regex.c:1326 + msgid "Invalid character class name" + msgstr "Nombre de clase de caracter inválido" + + #: regex.c:1327 + msgid "Trailing backslash" + msgstr "Barra invertida extra al final" + + #: regex.c:1328 + msgid "Invalid back reference" + msgstr "Referencia hacia atrás inválida" + + #: regex.c:1329 + msgid "Unmatched [ or [^" + msgstr "[ o [^ desemparejados" + + #: regex.c:1330 + msgid "Unmatched ( or \\(" + msgstr "( o \\( desemparejados" + + #: regex.c:1331 + msgid "Unmatched \\{" + msgstr "\\{ desemparejado" + + #: regex.c:1332 + msgid "Invalid content of \\{\\}" + msgstr "Contenido inválido de \\{\\}" + + #: regex.c:1333 + msgid "Invalid range end" + msgstr "Final de rango inválido" + + #: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204 + msgid "Memory exhausted" + msgstr "Memoria agotada" + + #: regex.c:1335 + msgid "Invalid preceding regular expression" + msgstr "Expresión regular precedente inválida" + + #: regex.c:1336 + msgid "Premature end of regular expression" + msgstr "Fin prematuro de la expresión regular" + + #: regex.c:1337 + msgid "Regular expression too big" + msgstr "La expresión regular es demasiado grande" + + #: regex.c:1338 + msgid "Unmatched ) or \\)" + msgstr ") o \\) desemparejados" + + #: regex.c:7365 + msgid "No previous regular expression" + msgstr "No hay una expresión regular previa" + + #: awkgram.y:232 + msgid "BEGIN blocks must have an action part" + msgstr "Los bloques BEGIN deben tener una parte de acción" + + #: awkgram.y:238 + msgid "END blocks must have an action part" + msgstr "Los bloques END deben tener una parte de acción" + + #: awkgram.y:274 + #, c-format + msgid "`%s' is a built-in function, it cannot be redefined" + msgstr "`%s' es una función interna, no puede ser redefinida" + + #: awkgram.y:362 + msgid "statement may have no effect" + msgstr "la sentencia puede no tener efecto" + + #: awkgram.y:455 + msgid "`next' used in BEGIN or END action" + msgstr "`next' es usado en la acción de BEGIN o END" + + #: awkgram.y:462 awkgram.y:469 + msgid "`nextfile' is a gawk extension" + msgstr "`nextfile' es una extensión de gawk" + + #: awkgram.y:474 + msgid "`nextfile' used in BEGIN or END action" + msgstr "`nextfile' es usado en la acción de BEGIN o END" + + #: awkgram.y:483 + msgid "`return' used outside function context" + msgstr "`return' es usado fuera del contexto de la función" + + #: awkgram.y:519 + msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" + msgstr "" + " el `print' simple en la regla BEGIN o END probablemente debe ser `print " + "\"\"'" + + #: awkgram.y:532 awkgram.y:539 + msgid "`delete array' is a gawk extension" + msgstr "`delete array' es una extensión de gawk" + + #: awkgram.y:604 + msgid "multistage two-way pipelines don't work" + msgstr "las líneas de trabajo de dos vías multiestado no funcionan" + + #: awkgram.y:695 + msgid "regular expression on right of assignment" + msgstr "expresión regular del lado derecho de una asignación" + + #: awkgram.y:713 + msgid "non-redirected `getline' undefined inside END action" + msgstr "`getline' no redirigido indefinido dentro de la acción de END" + + #: awkgram.y:723 + msgid "regular expression on left of `~' or `!~' operator" + msgstr "expresión regular a la izquierda del operador `~' o `!~'" + + #: awkgram.y:733 + #, c-format + msgid "regexp constant `/%s/' looks like a C comment, but is not" + msgstr "" + "la constante de expresión regular `/%s/' parece un comentario de C, pero no " + "lo es" + + #: awkgram.y:749 + msgid "regular expression on right of comparison" + msgstr "expresión regular a la derecha de una comparación" + + #: awkgram.y:776 + msgid "non-redirected `getline' undefined inside BEGIN or END action" + msgstr "`getline' no redirigido indefinido dentro de la acción de BEGIN o END" + + #: awkgram.y:831 + msgid "call of `length' without parentheses is not portable" + msgstr "la llamada de `length' sin paréntesis no es transportable" + + #: awkgram.y:834 + msgid "call of `length' without parentheses is deprecated by POSIX" + msgstr "la llamada de `length' sin paréntesis está obsoleta por POSIX" + + #: awkgram.y:884 + msgid "invalid subscript expression" + msgstr "expresión de subíndice inválida" + + # tokentab? cfuga + #: awkgram.y:1033 + #, c-format + msgid "fptr %x not in tokentab\n" + msgstr "fptr %x no está en tokentab\n" + + #: awkgram.y:1068 + msgid "unexpected newline" + msgstr "nueva línea inesperada" + + #: awkgram.y:1152 + msgid "empty program text on command line" + msgstr "texto de programa vacío en la linea de comando" + + #: awkgram.y:1209 + #, c-format + msgid "can't open source file `%s' for reading (%s)" + msgstr "no se puede abrir el fichero fuente `%s' para lectura (%s)" + + #: awkgram.y:1244 + #, c-format + msgid "can't read sourcefile `%s' (%s)" + msgstr "no se puede leer el fichero fuente `%s' (%s)" + + #: awkgram.y:1252 + #, c-format + msgid "source file `%s' is empty" + msgstr "el fichero fuente `%s' está vacío" + + #: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011 + msgid "source file does not end in newline" + msgstr "el fichero fuente no termina con línea nueva" + + #: awkgram.y:1518 + msgid "unterminated regexp ends with `\\' at end of file" + msgstr "expresión regular sin terminar termina con `\\` en el fin del fichero" + + #: awkgram.y:1539 + msgid "unterminated regexp" + msgstr "expresión regular sin terminar" + + #: awkgram.y:1542 + msgid "unterminated regexp at end of file" + msgstr "expresión regular sin terminar en el fin del fichero" + + #: awkgram.y:1609 + msgid "use of `\\ #...' line continuation is not portable" + msgstr "el uso de la continuación de línea `\\ #...' no es transportable" + + #: awkgram.y:1621 + msgid "backslash not last character on line" + msgstr "la barra invertida no es el último caracter en la línea" + + #: awkgram.y:1662 + msgid "POSIX does not allow operator `**='" + msgstr "POSIX no permite el operador `**='" + + #: awkgram.y:1664 + msgid "old awk does not support operator `**='" + msgstr "el awk antiguo no da soporte al operador `**='" + + #: awkgram.y:1673 + msgid "POSIX does not allow operator `**'" + msgstr "POSIX no permite el operador `**'" + + #: awkgram.y:1675 + msgid "old awk does not support operator `**'" + msgstr "el awk antiguo no da soporte al operador `**='" + + #: awkgram.y:1708 + msgid "operator `^=' is not supported in old awk" + msgstr "el operador `^=' no tiene soporte en el awk antiguo" + + #: awkgram.y:1716 + msgid "operator `^' is not supported in old awk" + msgstr "el operador `^' no tiene soporte en el awk antiguo" + + #: awkgram.y:1798 awkgram.y:1815 + msgid "unterminated string" + msgstr "cadena sin terminar" + + #: awkgram.y:1972 + #, c-format + msgid "invalid char '%c' in expression" + msgstr "caracter '%c' inválido en la expresión" + + #: awkgram.y:2032 + #, c-format + msgid "`%s' is a gawk extension" + msgstr "`%s' es una extensión de gawk" + + #: awkgram.y:2035 + #, c-format + msgid "`%s' is a Bell Labs extension" + msgstr "`%s' es una extensión de Bell Labs" + + #: awkgram.y:2038 + #, c-format + msgid "POSIX does not allow `%s'" + msgstr "POSIX no permite `%s'" + + #: awkgram.y:2042 + #, c-format + msgid "`%s' is not supported in old awk" + msgstr "`%s' no tiene soporte en el awk antiguo" + + #: awkgram.y:2070 + msgid "`goto' considered harmful!\n" + msgstr "¡`goto' se considera dañino!\n" + + #: awkgram.y:2134 + #, c-format + msgid "%d is invalid as number of arguments for %s" + msgstr "%d es inválido como número de argumentos para %s" + + #: awkgram.y:2153 awkgram.y:2156 + msgid "match: third argument is a gawk extension" + msgstr "match: el tercer argumento es una extensión de gawk" + + #: awkgram.y:2172 + #, c-format + msgid "%s: string literal as last arg of substitute has no effect" + msgstr "" + "%s: la literal de cadena como último argumento de substitute no tiene efecto" + + #: awkgram.y:2176 + msgid "sub third parameter is not a changeable object" + msgstr "el tercer argumento de sub no es un objecto que se puede cambiar" + + #: awkgram.y:2178 + msgid "gsub third parameter is not a changeable object" + msgstr "el tercer argumento de gsub no es un objecto que se puede cambiar" + + #: awkgram.y:2204 awkgram.y:2207 + msgid "close: second argument is a gawk extension" + msgstr "close: el segundo argumento es una extensión de gawk" + + #: awkgram.y:2217 + msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" + msgstr "" + "el uso de dcgettext(_\"...\") es incorrecto: quite el subrayado inicial" + + #: awkgram.y:2232 + msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" + msgstr "" + "el uso de dcngettext(_\"...\") es incorrecto: quite el subrayado inicial" + + #: awkgram.y:2323 + #, c-format + msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" + msgstr "función `%s': parámetro #%d, `%s', duplica el parámetro #%d" + + #: awkgram.y:2355 + #, c-format + msgid "function `%s': parameter `%s' shadows global variable" + msgstr "función `%s': parámetro `%s' obscurece la variable global" + + #: awkgram.y:2464 + #, c-format + msgid "could not open `%s' for writing (%s)" + msgstr "no se puede abrir `%s' para escritura (%s)" + + #: awkgram.y:2495 + #, c-format + msgid "%s: close failed (%s)" + msgstr "%s: falló close (%s)" + + #: awkgram.y:2605 + msgid "shadow_funcs() called twice!" + msgstr "¡shadow_funcs() llamada dos veces!" + + #: awkgram.y:2680 + #, c-format + msgid "function `%s': can't use function name as parameter name" + msgstr "" + "función `%s': no se puede usar un nombre de función como nombre de parámetro" + + #: awkgram.y:2690 + #, c-format + msgid "function name `%s' previously defined" + msgstr "el nombre de función `%s' fue previamente definida" + + #: awkgram.y:2838 awkgram.y:2844 + #, c-format + msgid "function `%s' called but never defined" + msgstr "se llama a la función `%s' pero nunca se definió" + + #: awkgram.y:2847 + #, c-format + msgid "function `%s' defined but never called" + msgstr "la función `%s' está definida pero nunca se llamó" + + #: awkgram.y:2874 + #, c-format + msgid "regexp constant for parameter #%d yields boolean value" + msgstr "" + "la constante de expresión regular para el parámetro #%d da un valor booleano" + + #: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649 + #: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078 + #: dfa.c:1081 dfa.c:1094 dfa.c:1095 + msgid "Unbalanced [" + msgstr "[ desbalanceado" + + #: dfa.c:783 + msgid "Unfinished \\ escape" + msgstr "Escape \\ sin terminar" + + #: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955 + msgid "unfinished repeat count" + msgstr "cuenta de repetición sin terminar" + + #: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958 + msgid "malformed repeat count" + msgstr "cuenta de repetición malformada" + + #: dfa.c:1285 + msgid "Unbalanced (" + msgstr "( desbalanceado" + + #: dfa.c:1407 + msgid "No regexp syntax bits specified" + msgstr "No se especifican los bits de sintaxis de la expresión regular" + + #: dfa.c:1415 + msgid "Unbalanced )" + msgstr ") desbalanceado" + + #: dfa.c:3014 + msgid "out of memory" + msgstr "memoria agotada" + + #: field.c:849 + msgid "split: second argument is not an array" + msgstr "split: el segundo argumento no es una matriz" + + #: field.c:876 + msgid "split: null string for third arg is a gawk extension" + msgstr "" + "split: la cadena nula para el tercer argumento es una extensión de gawk" + + #: field.c:916 + msgid "`FIELDWIDTHS' is a gawk extension" + msgstr "`FIELDWIDTHS' es una extensión gawk" + + #: field.c:943 + #, c-format + msgid "field %d in FIELDWIDTHS, must be > 0" + msgstr "el campo %d en FIELDWIDTHS, debe ser > 0" + + #: field.c:997 + msgid "null string for `FS' is a gawk extension" + msgstr "la cadena nula para `FS' es una extensión de gawk" + + #: msg.c:57 + msgid "cmd. line:" + msgstr "línea ord.:" + + #: msg.c:123 + msgid "warning: " + msgstr "aviso: " + + #: msg.c:145 + msgid "error: " + msgstr "error: " + + #: msg.c:178 + msgid "fatal: " + msgstr "fatal: " + + #: eval.c:259 + #, c-format + msgid "unknown nodetype %d" + msgstr "tipo de nodo %d desconocido" + + #: eval.c:307 + msgid "buffer overflow in genflags2str" + msgstr "desbordamiento de almacenamiento temporal en genflags2str" + + #: eval.c:541 + #, c-format + msgid "for loop: array `%s' changed size from %d to %d during loop execution" + msgstr "" + "ciclo for: la matriz `%s' cambió de tamaño de %d a %d durante la ejecución " + "del ciclo" + + #: eval.c:565 + msgid "`break' outside a loop is not portable" + msgstr "`break' fuera de un ciclo no es transportable" + + #: eval.c:569 + msgid "`break' outside a loop is not allowed" + msgstr "no se permite `break' fuera de un ciclo" + + #: eval.c:588 + msgid "`continue' outside a loop is not portable" + msgstr "`continue' fuera de un ciclo no es transportable" + + #: eval.c:592 + msgid "`continue' outside a loop is not allowed" + msgstr "no se permite `continue' fuera de un ciclo" + + #: eval.c:622 + msgid "`next' cannot be called from a BEGIN rule" + msgstr "`next' no puede ser llamado desde una regla BEGIN" + + #: eval.c:624 + msgid "`next' cannot be called from an END rule" + msgstr "`next' no puede ser llamado desde una regla END" + + #: eval.c:636 + msgid "`nextfile' cannot be called from a BEGIN rule" + msgstr "`nextfile' no puede ser llamado desde una regla BEGIN" + + #: eval.c:638 + msgid "`nextfile' cannot be called from an END rule" + msgstr "`nextfile' no puede ser llamado desde una regla END" + + #: eval.c:679 + msgid "statement has no effect" + msgstr "la sentencia no tiene efecto" + + #: eval.c:713 eval.c:743 eval.c:1622 + #, c-format + msgid "reference to uninitialized variable `%s'" + msgstr "referencia a la variable sin iniciar `%s'" + + #: eval.c:721 eval.c:1608 + #, c-format + msgid "can't use function name `%s' as variable or array" + msgstr "no se puede usar el nombre de la función `%s' como variable o matriz" + + #: eval.c:728 eval.c:734 eval.c:1747 + #, c-format + msgid "reference to uninitialized argument `%s'" + msgstr "referencia al argumento sin iniciar `%s'" + + #: eval.c:823 + msgid "assignment used in conditional context" + msgstr "asignación usada en contexto condicional" + + #: eval.c:914 + msgid "" + "concatenation: side effects in one expression have changed the length of " + "another!" + msgstr "" + "concatenación: ¡Los efectos laterales en una expresión han cambiado la " + "longitud de otra!" + + #: eval.c:1013 + msgid "division by zero attempted" + msgstr "se intentó una división por cero" + + #: eval.c:1028 + #, c-format + msgid "division by zero attempted in `%%'" + msgstr "se intentó una división por cero en `%%'" + + #: eval.c:1236 + msgid "division by zero attempted in `/='" + msgstr "se intentó una división por cero en `/='" + + #: eval.c:1254 + #, c-format + msgid "division by zero attempted in `%%='" + msgstr "se intentó una división por cero en `%%='" + + #: eval.c:1424 + #, c-format + msgid "%s (from %s)" + msgstr "%s (de %s)" + + #: eval.c:1472 + #, c-format + msgid "function `%s' called with more arguments than declared" + msgstr "se llamó a la función `%s' con más argumentos de los declarados" + + #: eval.c:1519 + #, c-format + msgid "function `%s' not defined" + msgstr "la función `%s' no está definida" + + #: eval.c:1521 + #, c-format + msgid "function %s called\n" + msgstr "la función %s fue llamada\n" + + #: eval.c:1580 + msgid "" + "\n" + "\t# Function Call Stack:\n" + "\n" + msgstr "" + "\n" + "\t# Pila de Llamadas de Funciones:\n" + "\n" + + #: eval.c:1583 + msgid "\t# -- main --\n" + msgstr "\t# -- principal --\n" + + #: eval.c:1759 + msgid "attempt to field reference from non-numeric value" + msgstr "se intentó una referencia de campo desde un valor que no es un número" + + #: eval.c:1761 + msgid "attempt to reference from null string" + msgstr "se intentó una referencia desde una cadena nula" + + #: eval.c:1767 + #, c-format + msgid "attempt to access field %d" + msgstr "se intentó accesar al campo %d" + + #: eval.c:1783 + #, c-format + msgid "attempt to use scalar parameter `%s' as an array" + msgstr "se intentó usar el parámetro escalar `%s como una matriz'" + + #: eval.c:1874 + msgid "`IGNORECASE' is a gawk extension" + msgstr "`IGNORECASE' es una extensión de gawk" + + #: eval.c:1902 + msgid "`BINMODE' is a gawk extension" + msgstr "`BINMODE' es una extensión de gawk" + + #: eval.c:2014 + #, c-format + msgid "bad `%sFMT' specification `%s'" + msgstr "especificación `%sFMT' `%s' errónea" + + #: eval.c:2080 + msgid "turning off `--lint' due to assignment to `LINT'" + msgstr "desactivando `--lint' debido a una asignación a `LINT'" + + #: eval.c:2116 + msgid "NF set to negative value" + msgstr "NF con un valor negativo" + + #: io.c:240 + #, c-format + msgid "cannot open file `%s' for reading (%s)" + msgstr "no se puede abrir el fichero `%s' para lectura (%s)" + + #: io.c:320 + #, c-format + msgid "close of fd %d (`%s') failed (%s)" + msgstr "falló el cerrado del df %d (`%s') (%s)" + + #: io.c:432 + #, c-format + msgid "invalid tree type %s in redirect()" + msgstr "tipo de árbol %s inválido en redirect()" + + #: io.c:438 + #, c-format + msgid "expression in `%s' redirection only has numeric value" + msgstr "la expresión en la redirección `%s' sólo tiene un valor numérico" + + #: io.c:444 + #, c-format + msgid "expression for `%s' redirection has null string value" + msgstr "la expresión para la redirección `%s' tiene un valor de cadena nula" + + #: io.c:449 + #, c-format + msgid "filename `%s' for `%s' redirection may be result of logical expression" + msgstr "" + "el fichero `%s' para la redirección `%s' puede ser resultado de una " + "expresión lógica" + + #: io.c:471 + #, c-format + msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" + msgstr "mezcla innecesaria de `>' y `>>' para el fichero `%.*s'" + + #: io.c:523 + #, c-format + msgid "can't open pipe `%s' for output (%s)" + msgstr "no se puede abrir la tubería `%s' para la salida (%s)" + + #: io.c:532 + #, c-format + msgid "can't open pipe `%s' for input (%s)" + msgstr "no se puede abrir la tubería `%s' para la entrada (%s)" + + #: io.c:545 + #, c-format + msgid "can't open two way socket `%s' for input/output (%s)" + msgstr "" + "no se puede abrir el `socket' de dos vías `%s' para entrada/salida (%s)" + + #: io.c:549 + #, c-format + msgid "can't open two way pipe `%s' for input/output (%s)" + msgstr "no se puede abrir la tubería de dos vías `%s' para entrada/salida (%s)" + + #: io.c:625 + #, c-format + msgid "can't redirect from `%s' (%s)" + msgstr "no se puede redirigir desde `%s' (%s)" + + #: io.c:628 + #, c-format + msgid "can't redirect to `%s' (%s)" + msgstr "no se puede redirigir a `%s' (%s)" + + #: io.c:667 + msgid "" + "reached system limit for open files: starting to multiplex file descriptors" + msgstr "" + "se alcanzó el límite del sistema para ficheros abiertos: comenzando a " + "multiplexar los descriptores de fichero" + + #: io.c:679 + #, c-format + msgid "close of `%s' failed (%s)." + msgstr "falló el cerrado de `%s' (%s)." + + #: io.c:686 + msgid "too many pipes or input files open" + msgstr "demasiadas tuberías o ficheros de entrada abiertos" + + #: io.c:709 + msgid "close: second argument must be `to' or `from'" + msgstr "close: el segundo argumento debe ser `to' o `from'" + + #: io.c:723 + #, c-format + msgid "close: `%.*s' is not an open file, pipe or co-process" + msgstr "close: `%.*s' no es un fichero abierto, tubería o co-proceso" + + #: io.c:727 + msgid "close of redirection that was never opened" + msgstr "cerrado de una redirección que nunca fue abierta" + + #: io.c:754 + #, c-format + msgid "close: redirection `%s' not opened with `|&', second argument ignored" + msgstr "" + "close: la redirección `%s' no se abre con `|&', se ignoró el segundo " + "argumento" + + #: io.c:811 + #, c-format + msgid "failure status (%d) on pipe close of `%s' (%s)" + msgstr "estado de fallo (%d) en el cerrado de la tubería de `%s' (%s)" + + #: io.c:814 + #, c-format + msgid "failure status (%d) on file close of `%s' (%s)" + msgstr "estado de fallo (%d) en el cerrado del fichero de `%s' (%s)" + + #: io.c:833 + #, c-format + msgid "no explicit close of socket `%s' provided" + msgstr "no se provee el cerrado explícito del `socket' `%s'" + + #: io.c:836 + #, c-format + msgid "no explicit close of co-process `%s' provided" + msgstr "no se provee el cerrado explícito del co-proceso `%s'" + + #: io.c:839 + #, c-format + msgid "no explicit close of pipe `%s' provided" + msgstr "no se provee el cerrado explícito del la tubería `%s'" + + #: io.c:842 + #, c-format + msgid "no explicit close of file `%s' provided" + msgstr "no se provee el cerrado explícito del fichero `%s'" + + #: io.c:871 io.c:925 + #, c-format + msgid "error writing standard output (%s)" + msgstr "error al escribir en la salida estándar (%s)" + + #: io.c:875 io.c:929 + #, c-format + msgid "error writing standard error (%s)" + msgstr "error al escribir en la salida estándar de error (%s)" + + #: io.c:883 + #, c-format + msgid "pipe flush of `%s' failed (%s)." + msgstr "falló la limpieza de la tubería de `%s' (%s)." + + #: io.c:886 + #, c-format + msgid "co-process flush of pipe to `%s' failed (%s)." + msgstr "falló la limpieza del co-proceso de la tubería a `%s' (%s)." + + #: io.c:889 + #, c-format + msgid "file flush of `%s' failed (%s)." + msgstr "falló la limpieza del fichero de `%s' (%s)." + + #: io.c:1048 + msgid "/inet/raw client not ready yet, sorry" + msgstr "el cliente /inet/raw no está listo aún, perdón" + + #: io.c:1050 io.c:1087 + msgid "only root may use `/inet/raw'." + msgstr "sólo root puede utilizar `/inet/raw'." + + #: io.c:1085 + msgid "/inet/raw server not ready yet, sorry" + msgstr "el servidor /inet/raw no está listo aún, perdón" + + #: io.c:1175 + #, c-format + msgid "no (known) protocol supplied in special filename `%s'" + msgstr "" + "no se proporciona algún protocolo (conocido) en el nombre de fichero " + "especial `%s'" + + #: io.c:1193 + #, c-format + msgid "special file name `%s' is incomplete" + msgstr "el nombre de fichero especial `%s' está incompleto" + + #: io.c:1205 + #, c-format + msgid "local port invalid in `%s'" + msgstr "puerto local inválido en `%s'" + + #: io.c:1217 + msgid "must supply a remote hostname to `/inet'" + msgstr "se debe proporcionar a `/inet' un nombre de anfitrión remoto" + + #: io.c:1232 + msgid "must supply a remote port to `/inet'" + msgstr "se debe proporcionar a `/inet' un puerto remoto" + + #: io.c:1238 + #, c-format + msgid "remote port invalid in `%s'" + msgstr "puerto remoto inválido en `%s'" + + #: io.c:1248 + msgid "TCP/IP communications are not supported" + msgstr "No tienen soporte las comunicaciones TCP/IP" + + #: io.c:1257 io.c:1438 + #, c-format + msgid "file `%s' is a directory" + msgstr "el fichero `%s' es un directorio" + + #: io.c:1327 + #, c-format + msgid "use `PROCINFO[\"%s\"]' instead of `%s'" + msgstr "use `PROCINFO[\"%s\"]' en lugar de `%s'" + + #: io.c:1359 + msgid "use `PROCINFO[...]' instead of `/dev/user'" + msgstr "use `PROCINFO[...]' en lugar de `/dev/user'" + + #: io.c:1424 + #, c-format + msgid "could not open `%s', mode `%s'" + msgstr "no se puede abrir `%s', modo `%s'" + + #: io.c:1550 io.c:1602 io.c:1732 io.c:1754 + #, c-format + msgid "moving pipe to stdout in child failed (dup: %s)" + msgstr "falló el movimiento a la salida estándar en el hijo (dup: %s)" + + #: io.c:1554 io.c:1607 + #, c-format + msgid "moving pipe to stdin in child failed (dup: %s)" + msgstr "" + "falló el movimiento de la tubería a la entrada estándar en el hijo (dup: %s)" + + #: io.c:1571 io.c:1745 + msgid "restoring stdout in parent process failed\n" + msgstr "falló la restauración de la salida estándar en el proceso padre\n" + + #: io.c:1576 + msgid "restoring stdin in parent process failed\n" + msgstr "falló la restauración de la entrada estándar en el proceso padre\n" + + #: io.c:1599 io.c:1751 + #, c-format + msgid "close of stdout in child failed (%s)" + msgstr "falló el cerrado de la salida estándar en el hijo (%s)" + + #: io.c:1604 + #, c-format + msgid "close of stdin in child failed (%s)" + msgstr "falló el cerrado de la entrada estándar en el hijo (%s)" + + #: io.c:1610 io.c:1756 io.c:1767 + #, c-format + msgid "close of pipe failed (%s)" + msgstr "falló el cerrado de la tubería (%s)" + + #: io.c:1655 + msgid "`|&' not supported" + msgstr "`|&' no tiene soporte" + + #: io.c:1722 + #, c-format + msgid "cannot open pipe `%s' (%s)" + msgstr "no se puede abrir la tubería `%s' (%s)" + + #: io.c:1763 + #, c-format + msgid "cannot create child process for `%s' (fork: %s)" + msgstr "no se puede crear el proceso hijo para `%s' (fork: %s)" + + #: io.c:2104 + #, c-format + msgid "data file `%s' is empty" + msgstr "el fichero de datos `%s' está vacío" + + #: io.c:2175 + #, c-format + msgid "internal error: file `%s', line %d\n" + msgstr "error interno: fichero `%s', línea %d\n" + + #: io.c:2277 + #, c-format + msgid "error reading input file `%s': %s" + msgstr "error al leer el fichero de entrada `%s': %s" + + #: io.c:2521 + msgid "multicharacter value of `RS' is a gawk extension" + msgstr "el valor multicaracter de `RS' es una extensión de gawk" + + #: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 + msgid "can't convert string to float" + msgstr "no se puede convertir una cadena a coma flotante" + + #: node.c:342 + msgid "backslash at end of string" + msgstr "barra invertida al final de la cadena" + + #: node.c:524 + msgid "POSIX does not allow `\\x' escapes" + msgstr "POSIX no permite escapes `\\x'" + + #: node.c:530 + msgid "no hex digits in `\\x' escape sequence" + msgstr "no hay dígitos hexadecimales en la secuencia de escape `\\x'" + + #: node.c:564 + #, c-format + msgid "escape sequence `\\%c' treated as plain `%c'" + msgstr "la secuencia de escape `\\%c' tratada como una simple `%c'" + + #: re.c:208 + #, c-format + msgid "regex match failed, not enough memory to match string \"%.*s%s\"" + msgstr "" + "falló la coincidencia de la expresión regular, no hay suficiente memoria " + "para que coincida la cadena \"%.*s%s\"" + + #: posix/gawkmisc.c:122 + #, c-format + msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)" + msgstr "%s %s `%s': no se puede establecer close-on-exec: (fcntl: %s)" + + #~ msgid "" + #~ "\n" + #~ "To report bugs, see node `Bugs' in `gawk.info', which is\n" + #~ msgstr "" + #~ "\n" + #~ "Para reportar `bugs', vea el nodo `Bugs' en gawk.info, que es\n" + + #~ msgid "pipe from `%s': could not set close-on-exec (fcntl: %s)" + #~ msgstr "tubería de `%s': no se puede establecer close-on-exec (fcntl: %s)" + + #~ msgid "pipe to `%s': could not set close-on-exec (fcntl: %s)" + #~ msgstr "tubería a `%s': no se puede establecer close-on-exec (fcntl: %s)" diff -crN gawk-3.1.0/po/fr.po gawk-3.1.1/po/fr.po *** gawk-3.1.0/po/fr.po Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/fr.po Wed May 1 16:40:58 2002 *************** *** 0 **** --- 1,1788 ---- + # Messages français pour gawk. + # Copyright © 1996 Free Software Foundation, Inc. + # Michel Robitaille , since 1996. + # + msgid "" + msgstr "" + "Project-Id-Version: gawk 3.1.1a\n" + "POT-Creation-Date: 2002-05-01 16:40+0300\n" + "PO-Revision-Date: 2002-04-29 20: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: 8bit\n" + + #: array.c:243 array.c:275 array.c:280 eval.c:483 + #, c-format + msgid "attempt to use scalar `%s' as array" + msgstr "tentative d'utilisation du scalaire « %s » comme un tableau" + + #: array.c:304 + #, c-format + msgid "reference to uninitialized element `%s[\"%s\"]'" + msgstr "référence à un élément non initialisé « %s[\"%s\"] »" + + #: array.c:310 + #, c-format + msgid "subscript of array `%s' is null string" + msgstr "sous-description du tableau « %s » contient une chaîne nulle" + + #: array.c:373 array.c:456 + #, c-format + msgid "delete: illegal use of variable `%s' as array" + msgstr "destruction: utilisation illégale d'une variable « %s » comme tableau" + + #: array.c:406 + #, c-format + msgid "delete: index `%s' not in array `%s'" + msgstr "destruction: index « %s » n'est pas dans le tableau « %s »" + + #: array.c:571 + #, c-format + msgid "%s: empty (null)\n" + msgstr "%s: vide (null)\n" + + #: array.c:576 + #, c-format + msgid "%s: empty (zero)\n" + msgstr "%s: vide (zéro)\n" + + #: array.c:580 + #, c-format + msgid "%s: table_size = %d, array_size = %d\n" + msgstr "%s: table_size = %d, array_size = %d\n" + + #: array.c:612 + #, c-format + msgid "%s: is parameter\n" + msgstr "%s: est un paramètre\n" + + #: array.c:617 + #, c-format + msgid "%s: array_ref to %s\n" + msgstr "%s: array_ref de %s\n" + + #: array.c:844 + msgid "asort: first argument is not an array" + msgstr "asort(): le premier argument fourni n'est pas dans le tableau" + + #: array.c:853 + msgid "asort: second argument is not an array" + msgstr "asort(): le second argument fourni n'est pas dans le tableau" + + #: builtin.c:107 + #, c-format + msgid "%s to \"%s\" failed (%s)" + msgstr "%s vers « %s » échec (%s)" + + #: builtin.c:108 + msgid "standard output" + msgstr "sortie standard" + + #: builtin.c:109 + msgid "reason unknown" + msgstr "raison inconnue" + + #: builtin.c:122 + msgid "exp: received non-numeric argument" + msgstr "exp: argument fourni n'est pas numérique" + + #: builtin.c:128 + #, c-format + msgid "exp: argument %g is out of range" + msgstr "exp: argument fourni %g est hors gamme" + + #: builtin.c:186 + #, c-format + msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" + msgstr "" + "fflush: ne peut vider: le pipe « %s » est oouvert en lecture, pas en écriture" + + #: builtin.c:189 + #, c-format + msgid "fflush: cannot flush: file `%s' opened for reading, not writing" + msgstr "" + "fflush: ne peut vider: fichier « %s » ouvert en lecture, pas en écriture" + + #: builtin.c:201 + #, c-format + msgid "fflush: `%s' is not an open file, pipe or co-process" + msgstr "" + "fflush: « %s » n'est pas ni un fichier ouvert, un pipe ou un co-processus" + + #: builtin.c:295 + msgid "index: received non-string first argument" + msgstr "index: premier argument fourni n'est pas une chaîne" + + #: builtin.c:297 + msgid "index: received non-string second argument" + msgstr "index: second argument fourni n'est pas une chaîne" + + #: builtin.c:407 + msgid "int: received non-numeric argument" + msgstr "int: argument fourni n'est pas numérique" + + #: builtin.c:424 + msgid "length: received non-string argument" + msgstr "length: argument fourni n'est pas une chaîne" + + #: builtin.c:440 + msgid "log: received non-numeric argument" + msgstr "log: argument fourni n'est pas numérique" + + #: builtin.c:443 + #, c-format + msgid "log: received negative argument %g" + msgstr "log: argument fourni négatif %g" + + #: builtin.c:605 builtin.c:608 + msgid "must use `count$' on all formats or none" + msgstr "doit utiliser « count$ » pour tous les formats ou aucun" + + #: builtin.c:703 + msgid "`$' is not permitted in awk formats" + msgstr "« $ » n'est pas permis dans les formats awk" + + #: builtin.c:709 + msgid "arg count with `$' must be > 0" + msgstr "décompte d'arguments avec « $ » doit être > 0" + + #: builtin.c:711 + #, c-format + msgid "arg count %d greater than total number of supplied arguments" + msgstr "compteur d'arguments %d est > que le nombre total fournis d'arguments" + + #: builtin.c:713 + msgid "`$' not permitted after period in format" + msgstr "« $ » n'est pas permis après le point" + + #: builtin.c:726 + msgid "no `$' supplied for positional field width or precision" + msgstr "aucun « $ » fourni dans le champ positionnel (longueur ou précision)" + + #: builtin.c:784 + msgid "`l' is meaningless in awk formats; ignored" + msgstr "« l » n'a aucun sens dans les formats de awk; ignoré" + + #: builtin.c:788 + msgid "`l' is not permitted in POSIX awk formats" + msgstr "« l » n'est pas permis dans les format POSIX de awk" + + #: builtin.c:799 + msgid "`L' is meaningless in awk formats; ignored" + msgstr "« L » n'a aucun sens dans les formats s de awk; ignoré" + + #: builtin.c:803 + msgid "`L' is not permitted in POSIX awk formats" + msgstr "« L » n'est pas permis dans les formats POSIX de awk" + + #: builtin.c:814 + msgid "`h' is meaningless in awk formats; ignored" + msgstr "« h » n'a aucun send dans les formats de awk; ignoré" + + #: builtin.c:818 + msgid "`h' is not permitted in POSIX awk formats" + msgstr "« h » n'est pas permis dans les formats POSIX de awk" + + #: builtin.c:1067 + msgid "not enough arguments to satisfy format string" + msgstr "pas assez d'arguments pour satisfaire le format d'une chaîne" + + #: builtin.c:1069 + msgid "^ ran out for this one" + msgstr "^ débordement pour celle-ci" + + #: builtin.c:1074 + msgid "[s]printf: format specifier does not have control letter" + msgstr "" + "[s]printf: spécificateur de format ne contient pas de lettre de contrôle" + + #: builtin.c:1077 + msgid "too many arguments supplied for format string" + msgstr "trop d'arguments pour la chaîne de format" + + #: builtin.c:1120 builtin.c:1123 + msgid "printf: no arguments" + msgstr "printf: aucun argument" + + #: builtin.c:1156 + msgid "sqrt: received non-numeric argument" + msgstr "sqrt: argument fourni n'est pas numérique" + + #: builtin.c:1160 + #, c-format + msgid "sqrt: called with negative argument %g" + msgstr "sqrt: appelé avec un argument négatif %g" + + #: builtin.c:1182 + #, c-format + msgid "substr: start index %g is invalid, using 1" + msgstr "substr: début de l'index %g est invalide, utilise 1" + + #: builtin.c:1187 + #, c-format + msgid "substr: non-integer start index %g will be truncated" + msgstr "substr: début avec un nombre non entier %g sera tronqué" + + #: builtin.c:1201 + #, c-format + msgid "substr: length %g is <= 0" + msgstr "substr: longueur %g est <= 0" + + #: builtin.c:1207 + #, c-format + msgid "substr: non-integer length %g will be truncated" + msgstr "substr: longueur avec un nombre non entier %g sera tronqué" + + #: builtin.c:1214 + msgid "substr: source string is zero length" + msgstr "substr: chaîne de départ est de longueur zéro" + + #: builtin.c:1221 + #, c-format + msgid "" + "substr: length %d at start index %d exceeds length of first argument (%d)" + msgstr "" + "substr: longueur %d début avec l'index %d déborde la longueur du 1er " + "argument (%d)" + + #: builtin.c:1227 + #, c-format + msgid "substr: start index %d is past end of string" + msgstr "substr: début de l'index %d dépasse la fin de la chaîne" + + #: builtin.c:1263 + msgid "strftime: received non-string first argument" + msgstr "strftime: premier argument fourni n'est pas une chaîne" + + #: builtin.c:1269 + msgid "strftime: received empty format string" + msgstr "strftime: chaîne de format vide" + + #: builtin.c:1278 + msgid "strftime: received non-numeric second argument" + msgstr "strftime: second argument fourni n'est pas numérique" + + #: builtin.c:1341 + msgid "mktime: received non-string argument" + msgstr "mktime: argument fourni n'est pas une chaîne" + + #: builtin.c:1386 + msgid "system: received non-string argument" + msgstr "system: argument fourni n'est pas une chaîne" + + #: builtin.c:1512 + msgid "tolower: received non-string argument" + msgstr "tolower: argument fourni n'est pas une chaîne" + + #: builtin.c:1561 + msgid "toupper: received non-string argument" + msgstr "toupper: argument fourni n'est pas une chaîne" + + #: builtin.c:1606 + msgid "atan2: received non-numeric first argument" + msgstr "atan2: premier argument fourni n'est pas numérique" + + #: builtin.c:1608 + msgid "atan2: received non-numeric second argument" + msgstr "atan2: second argument fourni n'est pas numérique" + + #: builtin.c:1627 + msgid "sin: received non-numeric argument" + msgstr "sin: argument fourni n'est pas numérique" + + #: builtin.c:1643 + msgid "cos: received non-numeric argument" + msgstr "cos: argument fourni n'est pas numérique" + + #: builtin.c:1687 + msgid "srand: received non-numeric argument" + msgstr "srand: argument fourni n'est pas numérique" + + #: builtin.c:1721 + msgid "match: third argument is not an array" + msgstr "match: le 3e argument fourni n'est pas un tableau" + + #: builtin.c:2157 + msgid "gensub: 3rd argument of 0 treated as 1" + msgstr "gensub: le 3e argument fourni de 0 traité comme un 1" + + #: builtin.c:2268 builtin.c:2270 + msgid "lshift: received non-numeric first argument" + msgstr "lshift: premier argument fourni n'est pas numérique" + + #: builtin.c:2272 + #, c-format + msgid "lshift(%lf, %lf): negative values will give strange results" + msgstr "lshift(%lf, %lf): valeurs négatives donneront d'étranges résultats" + + #: builtin.c:2274 + #, c-format + msgid "lshift(%lf, %lf): fractional values will be truncated" + msgstr "lshift(%lf, %lf): valeurs fractionnaires seront tronquées" + + #: builtin.c:2276 + #, c-format + msgid "lshift(%lf, %lf): too large shift value will give strange results" + msgstr "lshift(%lf, %lf): trop grand déplacement donnera d'étranges résultats" + + #: builtin.c:2305 builtin.c:2307 + msgid "rshift: received non-numeric first argument" + msgstr "rshift: premier argument fourni n'est pas numérique" + + #: builtin.c:2309 + #, c-format + msgid "rshift(%lf, %lf): negative values will give strange results" + msgstr "rshift(%lf, %lf): valeurs négatives donneront d'étranges résultats" + + #: builtin.c:2311 + #, c-format + msgid "rshift(%lf, %lf): fractional values will be truncated" + msgstr "rshift(%lf, %lf): valeurs fractionnaires seront tronquées" + + #: builtin.c:2313 + #, c-format + msgid "rshift(%lf, %lf): too large shift value will give strange results" + msgstr "rshift(%lf, %lf): trop grand déplacement donnera d'étranges résultats" + + #: builtin.c:2342 builtin.c:2344 + msgid "and: received non-numeric first argument" + msgstr "and: premier argument fourni n'est pas numérique" + + #: builtin.c:2346 + #, c-format + msgid "and(%lf, %lf): negative values will give strange results" + msgstr "and(%lf, %lf): valeurs négatives donneront d'étranges résultats" + + #: builtin.c:2348 + #, c-format + msgid "and(%lf, %lf): fractional values will be truncated" + msgstr "and(%lf, %lf): valeurs fractionnaires seront tronquées" + + #: builtin.c:2377 builtin.c:2379 + msgid "or: received non-numeric first argument" + msgstr "or: premier argument fourni n'est pas numérique" + + #: builtin.c:2381 + #, c-format + msgid "or(%lf, %lf): negative values will give strange results" + msgstr "or(%lf, %lf): valeurs négatives donneront d'étranges résultats" + + #: builtin.c:2383 + #, c-format + msgid "or(%lf, %lf): fractional values will be truncated" + msgstr "or(%lf, %lf): valeurs fractionnaires seront tronquées" + + #: builtin.c:2412 builtin.c:2414 + msgid "xor: received non-numeric first argument" + msgstr "xor: premier argument fourni n'est pas numérique" + + #: builtin.c:2416 + #, c-format + msgid "xor(%lf, %lf): negative values will give strange results" + msgstr "xor(%lf, %lf): valeurs négatives donneront d'étranges résultats" + + #: builtin.c:2418 + #, c-format + msgid "xor(%lf, %lf): fractional values will be truncated" + msgstr "xor(%lf, %lf): valeurs fractionnaires seront tronquées" + + #: builtin.c:2446 + msgid "compl: received non-numeric argument" + msgstr "compl: argument fourni n'est pas numérique" + + #: builtin.c:2448 + #, c-format + msgid "compl(%lf): negative value will give strange results" + msgstr "compl(%lf): valeurs négatives donneront d'étranges résultats" + + #: builtin.c:2450 + #, c-format + msgid "compl(%lf): fractional value will be truncated" + msgstr "compl(%lf): valeurs fractionnaires seront tronquées" + + #: builtin.c:2621 + #, c-format + msgid "dcgettext: `%s' is not a valid locale category" + msgstr "dcgettext: « %s » n'est pas dans un catégorie de localisation valide" + + #: ext.c:60 ext.c:64 + msgid "`extension' is a gawk extension" + msgstr "« extension » est une extension de gawk" + + #: ext.c:74 + #, c-format + msgid "extension: cannot open `%s' (%s)\n" + msgstr "extension: ne peut ouvrir « %s » (%s)\n" + + #: ext.c:82 + #, c-format + msgid "extension: library `%s': cannot call function `%s' (%s)\n" + msgstr "extension: librairie « %s »: ne peut appeler la fonction « %s » (%s)\n" + + #: ext.c:180 + msgid "Operation Not Supported" + msgstr "Opération non supportée" + + #: getopt.c:692 getopt.c:704 + #, c-format + msgid "%s: option `%s' is ambiguous\n" + msgstr "%s: option « %s » est ambiguë\n" + + #: getopt.c:737 getopt.c:741 + #, c-format + msgid "%s: option `--%s' doesn't allow an argument\n" + msgstr "%s: option « --%s » n'admet pas d'argument\n" + + #: getopt.c:750 getopt.c:755 + #, c-format + msgid "%s: option `%c%s' doesn't allow an argument\n" + msgstr "%s: l'option « %c%s » ne requiert pas d'argument\n" + + #: getopt.c:791 getopt.c:804 getopt.c:1093 getopt.c:1106 + #, c-format + msgid "%s: option `%s' requires an argument\n" + msgstr "%s: l'option « %s » requiert un argument\n" + + #: getopt.c:842 getopt.c:845 + #, c-format + msgid "%s: unrecognized option `--%s'\n" + msgstr "%s: option non reconnue « --%s »\n" + + #: getopt.c:853 getopt.c:856 + #, c-format + msgid "%s: unrecognized option `%c%s'\n" + msgstr "%s: option non reconnue « %c%s »\n" + + #: getopt.c:903 getopt.c:906 + #, c-format + msgid "%s: illegal option -- %c\n" + msgstr "%s: option illégale -- %c\n" + + #: getopt.c:912 getopt.c:915 + #, c-format + msgid "%s: invalid option -- %c\n" + msgstr "%s: option invalide -- %c\n" + + #: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412 + #, c-format + msgid "%s: option requires an argument -- %c\n" + msgstr "%s: l'option requiert un argument -- %c\n" + + #: getopt.c:1025 getopt.c:1036 + #, c-format + msgid "%s: option `-W %s' is ambiguous\n" + msgstr "%s: l'option « -W %s » est ambiguë\n" + + #: getopt.c:1060 getopt.c:1072 + #, c-format + msgid "%s: option `-W %s' doesn't allow an argument\n" + msgstr "%s: l'option « -W %s » ne requiert pas d'argument\n" + + #: main.c:307 + msgid "`-m[fr]' option irrelevant in gawk" + msgstr "« -m[fr] » est une option non pertinente en gawk" + + #: main.c:309 + msgid "-m option usage: `-m[fr] nnn'" + msgstr "-m usage de l'option: « -m[fr] nnn »" + + #: main.c:326 + #, c-format + msgid "%s: option `-W %s' unrecognized, ignored\n" + msgstr "%s: l'option « -W %s » n'est pas reconnue, ignorée\n" + + #: main.c:357 + msgid "empty argument to `--source' ignored" + msgstr "argument vide à l'option « --source », ignorée" + + #: main.c:429 + msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" + msgstr "" + "variable d'environnement « POSIXLY__CORRECT » initialisée: utilisation de « " + "--posix »" + + #: main.c:434 + msgid "`--posix' overrides `--traditional'" + msgstr "« --posix » écrase « --traditional »" + + #: main.c:445 + msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" + msgstr "« --posix »/« --traditional » écrase « --non-decimal-data »" + + #: main.c:449 + #, c-format + msgid "running %s setuid root may be a security problem" + msgstr "" + "l'exécution de %s en mode setuid root peut causer un problème de sécurité" + + #: main.c:478 + #, c-format + msgid "can't set mode on stdin (%s)" + msgstr "ne peut initialiser le mode sur stdin (%s)" + + #: main.c:481 + #, c-format + msgid "can't set mode on stdout (%s)" + msgstr "ne peut initialiser le mode sur stdout (%s)" + + #: main.c:483 + #, c-format + msgid "can't set mode on stderr (%s)" + msgstr "ne peut initialiser le mode sur stderr (%s)" + + #: main.c:512 + msgid "no program text at all!" + msgstr "aucun programme!" + + #: main.c:556 + #, c-format + msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" + msgstr "" + "Usage: %s [style des options POSIX ou GNU] -f fichierprog [--] fichier ...\n" + + #: main.c:558 + #, c-format + msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" + msgstr "" + "Usage: %s [style des options POSIX ou GNU] [--] %cprogram%c fichier ...\n" + + #: main.c:563 + msgid "POSIX options:\t\tGNU long options:\n" + msgstr "Options POSIX:\t\toptions de long format GNU:\n" + + #: main.c:564 + msgid "\t-f progfile\t\t--file=progfile\n" + msgstr "\t-f fichierprog\t\t--file=fichierprog\n" + + #: main.c:565 + msgid "\t-F fs\t\t\t--field-separator=fs\n" + msgstr "#t-F fs\t\t\t--field-separator=fs\n" + + #: main.c:566 + msgid "\t-v var=val\t\t--assign=var=val\n" + msgstr "#t-v var=valeur\t\t--assign=var=valeur\n" + + #: main.c:567 + msgid "\t-m[fr] val\n" + msgstr "\t-m[fr] valeur\n" + + #: main.c:568 + msgid "\t-W compat\t\t--compat\n" + msgstr "\t-W compat\t\t--compat\n" + + #: main.c:569 + msgid "\t-W copyleft\t\t--copyleft\n" + msgstr "\t-W copyleft\t\t--copyleft\n" + + #: main.c:570 + msgid "\t-W copyright\t\t--copyright\n" + msgstr "\t-W copyright\t\t--copyright\n" + + #: main.c:571 + msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" + msgstr "\t-W dump-variables[=fichier]\t--dump-variables[=fichier]\n" + + #: main.c:572 + msgid "\t-W gen-po\t\t--gen-po\n" + msgstr "\t-W gen-po\t\t--gen-po\n" + + #: main.c:573 + msgid "\t-W help\t\t\t--help\n" + msgstr "\t-W help\t\t\t--help\n" + + #: main.c:574 + msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" + msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n" + + #: main.c:575 + msgid "\t-W lint-old\t\t--lint-old\n" + msgstr "\t-W lint-old\t\t--lint-old\n" + + #: main.c:576 + msgid "\t-W non-decimal-data\t--non-decimal-data\n" + msgstr "\t-W non-decimal-data\t--non-decimal-data\n" + + #: main.c:578 + msgid "\t-W nostalgia\t\t--nostalgia\n" + msgstr "\t-W nostalgia\t\t--nostalgia\n" + + #: main.c:581 + msgid "\t-W parsedebug\t\t--parsedebug\n" + msgstr "\t-W parsedebug\t\t--parsedebug\n" + + #: main.c:583 + msgid "\t-W profile[=file]\t--profile[=file]\n" + msgstr "\t-W profile[=fichier]\t--profile[=fichier]\n" + + #: main.c:584 + msgid "\t-W posix\t\t--posix\n" + msgstr "\t-W posix\t\t--posix\n" + + #: main.c:585 + msgid "\t-W re-interval\t\t--re-interval\n" + msgstr "\t-W re-interval\t\t--re-interval\n" + + #: main.c:586 + msgid "\t-W source=program-text\t--source=program-text\n" + msgstr "\t-W source=program-text\t--source=program-text\n" + + #: main.c:587 + msgid "\t-W traditional\t\t--traditional\n" + msgstr "\t-W traditional\t\t--traditional\n" + + #: main.c:588 + msgid "\t-W usage\t\t--usage\n" + msgstr "\t-W usage\t\t--usage\n" + + #: main.c:589 + msgid "\t-W version\t\t--version\n" + msgstr "\t-W version\t\t--version\n" + + #: main.c:593 + msgid "" + "\n" + "To report bugs, see node `Bugs' in `gawk.info', which is\n" + "section `Reporting Problems and Bugs' in the printed version.\n" + "\n" + msgstr "" + "\n" + "Pour rapporter une anomalie, voir la rubrique « Bugs » dans « gawk.info »\n" + "dans la section « Reporting Problems and Bugs » de la version imprimée.\n" + + #: main.c:597 + msgid "" + "gawk is a pattern scanning and processing language.\n" + "By default it reads standard input and writes standard output.\n" + "\n" + msgstr "" + "gawk est un analyseur de patron et un traitement de langage.\n" + "Par défaut, il lit de l'entrée standard et écrit sur la sortie standard.\n" + "\n" + + #: main.c:601 + msgid "" + "Examples:\n" + "\tgawk '{ sum += $1 }; END { print sum }' file\n" + "\tgawk -F: '{ print $1 }' /etc/passwd\n" + msgstr "" + "Exemples:\n" + "\tgawk '{ sum += $1 }; END { print sum }' fichier\n" + "\tgawk -F: '{ print $1 }' /etc/passwd\n" + + #: main.c:613 + #, c-format + msgid "" + "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" + "\n" + "This program is free software; you can redistribute it and/or modify\n" + "it under the terms of the GNU General Public License as published by\n" + "the Free Software Foundation; either version 2 of the License, or\n" + "(at your option) any later version.\n" + "\n" + msgstr "" + "Copyright © 1998, 1991-%d Free Software Foundation, Inc.\n" + "\n" + "Ce programme est un logiciel libre; vous pouvez le redistribuer ou le\n" + "modifier selon les termes de la License Publique Générale de GNU, publiée\n" + "par la Free Software Foundation; soit la version 2 de la Licence ou,\n" + "soit (selon vos préférences) toute version ultérieure.\n" + "\n" + + #: main.c:621 + msgid "" + "This program is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "GNU General Public License for more details.\n" + "\n" + msgstr "" + "Ce logiciel est distribué en espérant qu'il soit utile,\n" + "mais sans AUCUNE garantie; sans la garantie liée à des raisons\n" + "COMMERCIALES ou pour RÉPONDRE À UN BESOIN PARTICULIER.\n" + "selon les termes de la « GNU General Public License ».\n" + "Pour plus d'informations à ce sujet, consulter la « GNU General Public " + "License ».\n" + + #: main.c:627 + msgid "" + "You should have received a copy of the GNU General Public License\n" + "along with this program; if not, write to the Free Software\n" + "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + msgstr "" + "Vous devriez avoir reçu copie de la Licence Publique Générale de GNU\n" + "avec ce programme; sinon, écrire à la Free Software Foundation, Inc.,\n" + "59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + + #: main.c:657 + msgid "-Ft does not set FS to tab in POSIX awk" + msgstr "" + "-Ft ne permet pas d'initialiser FS à un tabulateur dans la version POSIX de " + "awk" + + #: main.c:888 + #, c-format + msgid "invalid syntax in name `%s' for variable assignment" + msgstr "syntaxe invalide dans le nom « %s » pour l'affectation de variable" + + #: main.c:957 + msgid "floating point exception" + msgstr "exception de la virgule flottante" + + #: main.c:964 + msgid "fatal error: internal error" + msgstr "erreur fatale: erreur interne" + + #: main.c:1014 + #, c-format + msgid "no pre-opened fd %d" + msgstr "aucun fd pré-ouvert pour %d" + + #: main.c:1019 + #, c-format + msgid "could not pre-open /dev/null for fd %d" + msgstr "ne peut pré-ouvrir /dev/null pour le descripteud fd %d" + + #: main.c:1037 main.c:1046 + #, c-format + msgid "could not find groups: %s" + msgstr "n'a pu trouvé les groupes: %s" + + #: profile.c:94 + #, c-format + msgid "could not open `%s' for writing: %s" + msgstr "ne peut ouvrir « %s » en écriture: %s" + + #: profile.c:96 awkgram.y:2465 + msgid "sending profile to standard error" + msgstr "redirection du profile vers stderr" + + #: profile.c:409 + msgid "internal error: Node_var with null vname" + msgstr "erreur interne: Node_var avec un vname nul" + + #: profile.c:524 + msgid "internal error: Node_var_array with null vname" + msgstr "erreur interne: Node_var_array avec un vname nul" + + #: profile.c:554 eval.c:813 + #, c-format + msgid "" + "function `%s' called with space between name and `(',\n" + "%s" + msgstr "" + "fonction « %s » appelée avec un espace entre le nom et « ( »,\n" + "%s" + + #: profile.c:556 eval.c:815 + msgid "or used in other expression context" + msgstr "ou utilisée dans un autre contexte d'expression" + + #: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741 + #, c-format + msgid "attempt to use array `%s' in a scalar context" + msgstr "tentative d'utilisation du tableau « %s » dans un contexte scalaire" + + #: profile.c:637 eval.c:1047 + #, c-format + msgid "illegal type (%s) in tree_eval" + msgstr "type illégal (%s) dans tree_eval" + + #: profile.c:842 eval.c:1790 + #, c-format + msgid "attempt to use function `%s' as array" + msgstr "tentative d'utilisation de la fonction « %s » dans le tableau" + + #: profile.c:856 eval.c:1797 + #, c-format + msgid "`%s' is a function, assignment is not allowed" + msgstr "« %s » est une fonction, l'affectation n'est pas permise" + + #: profile.c:860 eval.c:1803 eval.c:1810 + msgid "assignment is not allowed to result of builtin function" + msgstr "" + "l'affectation n'est pas permise pour obtenir un résultat d'une fonction " + "interne" + + #: profile.c:1108 + #, c-format + msgid "\t# gawk profile, created %s\n" + msgstr "\t# profile gawk, créé %s\n" + + #: profile.c:1111 + msgid "" + "\t# BEGIN block(s)\n" + "\n" + msgstr "" + "#t# DÉBUT de bloc(s)\n" + "\n" + + #: profile.c:1121 + msgid "" + "\t# Rule(s)\n" + "\n" + msgstr "" + "\t# Règle(s)\n" + "\n" + + #: profile.c:1127 + msgid "" + "\t# END block(s)\n" + "\n" + msgstr "" + "\t# FIN de bloc(s)\n" + "\n" + + #: profile.c:1147 + msgid "" + "\n" + "\t# Functions, listed alphabetically\n" + msgstr "" + "\n" + "\t# Liste alphabétique des fonctions\n" + + #: profile.c:1357 + #, c-format + msgid "unexpected type %s in prec_level" + msgstr "type %s inattendu dans prec_level" + + #: regex.c:1322 + msgid "Success" + msgstr "Succès" + + #: regex.c:1323 + msgid "No match" + msgstr "Aucune concordance" + + #: regex.c:1324 + msgid "Invalid regular expression" + msgstr "Expression régulière invalide" + + #: regex.c:1325 + msgid "Invalid collation character" + msgstr "Caractère de collation invalide" + + #: regex.c:1326 + msgid "Invalid character class name" + msgstr "Nom de classe de caractères invalide" + + #: regex.c:1327 + msgid "Trailing backslash" + msgstr "Barre oblique inverse de terminaison" + + #: regex.c:1328 + msgid "Invalid back reference" + msgstr "Mauvaise référence arrière" + + #: regex.c:1329 + msgid "Unmatched [ or [^" + msgstr "Non appariement de [ ou [^" + + #: regex.c:1330 + msgid "Unmatched ( or \\(" + msgstr "Non appariement de ( ou \\(" + + #: regex.c:1331 + msgid "Unmatched \\{" + msgstr "Non appariement de \\{" + + #: regex.c:1332 + msgid "Invalid content of \\{\\}" + msgstr "Contenu invalide de \\{\\}" + + #: regex.c:1333 + msgid "Invalid range end" + msgstr "Borne finale invalide" + + #: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204 + msgid "Memory exhausted" + msgstr "Mémoire épuisée" + + #: regex.c:1335 + msgid "Invalid preceding regular expression" + msgstr "Expression régulière précédente invalide" + + #: regex.c:1336 + msgid "Premature end of regular expression" + msgstr "Fin prématurée de l'expression régulière" + + #: regex.c:1337 + msgid "Regular expression too big" + msgstr "Expression régulière trop grande" + + #: regex.c:1338 + msgid "Unmatched ) or \\)" + msgstr "Non appariement de ) ou \\)" + + #: regex.c:7365 + msgid "No previous regular expression" + msgstr "Aucune expression régulière antérieure" + + #: awkgram.y:232 + msgid "BEGIN blocks must have an action part" + msgstr "Les blocs de DÉBUT doitvent avoir une partie action" + + #: awkgram.y:238 + msgid "END blocks must have an action part" + msgstr "Les blocs de FIN doivent avoir une partie action" + + #: awkgram.y:274 + #, c-format + msgid "`%s' is a built-in function, it cannot be redefined" + msgstr "« %s » est une fonction interne, elle ne peut être redéfinie" + + #: awkgram.y:362 + msgid "statement may have no effect" + msgstr "la déclaration peut n'avoir aucun effet" + + #: awkgram.y:455 + msgid "`next' used in BEGIN or END action" + msgstr "« next » utilisé dans l'action BEGIN ou END" + + #: awkgram.y:462 awkgram.y:469 + msgid "`nextfile' is a gawk extension" + msgstr "« nextfile » est une extension de gawk" + + #: awkgram.y:474 + msgid "`nextfile' used in BEGIN or END action" + msgstr "« nextfile » utilisé dans l'action BEGIN ou END" + + #: awkgram.y:483 + msgid "`return' used outside function context" + msgstr "« return » utilisé en dehors du contexte d'une fonction" + + #: awkgram.y:519 + msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" + msgstr "" + "utilisation de « print » dans une règle BEGIN ou END doit être probablement " + "« print \"\" »" + + #: awkgram.y:532 awkgram.y:539 + msgid "`delete array' is a gawk extension" + msgstr "« delete array » est une extension de gawk" + + #: awkgram.y:604 + msgid "multistage two-way pipelines don't work" + msgstr "pipelines bidirectionnel à multi-étapes ne fonctionnent pas" + + #: awkgram.y:695 + msgid "regular expression on right of assignment" + msgstr "expression régulière à la droite de l'affectation" + + #: awkgram.y:713 + msgid "non-redirected `getline' undefined inside END action" + msgstr "« getline » non redirigé indéfini à l'intérieur de l'action END" + + #: awkgram.y:723 + msgid "regular expression on left of `~' or `!~' operator" + msgstr "expression régulière sur la gauche de l'opérateur « ~ » ou « !~ »" + + #: awkgram.y:733 + #, c-format + msgid "regexp constant `/%s/' looks like a C comment, but is not" + msgstr "" + "la constante d'expression régulière « /%s/ » ressemble à un commentaire en " + "C, mais ne l'est pas" + + #: awkgram.y:749 + msgid "regular expression on right of comparison" + msgstr "expression régulière sur la droite de la comparaison" + + #: awkgram.y:776 + msgid "non-redirected `getline' undefined inside BEGIN or END action" + msgstr "" + "« getline » non redirigé indéfini à l'intérieur de l'action BEGIN ou END" + + #: awkgram.y:831 + msgid "call of `length' without parentheses is not portable" + msgstr "l'appel de « length » sans les parenthèses n'est pas portable" + + #: awkgram.y:834 + msgid "call of `length' without parentheses is deprecated by POSIX" + msgstr "l'appel de « length » sans les parenthèses est déprécié par POSIX" + + #: awkgram.y:884 + msgid "invalid subscript expression" + msgstr "sous-expression invalide" + + #: awkgram.y:1033 + #, c-format + msgid "fptr %x not in tokentab\n" + msgstr "fptr %x n'est pas dans la table des jetons\n" + + #: awkgram.y:1068 + msgid "unexpected newline" + msgstr "nouvelle ligne inattendue" + + #: awkgram.y:1152 + msgid "empty program text on command line" + msgstr "texte du programme sur la ligne de commande est vide" + + #: awkgram.y:1209 + #, c-format + msgid "can't open source file `%s' for reading (%s)" + msgstr "ne peut ouvrir le fichier source « %s » pour lecture (%s)" + + #: awkgram.y:1244 + #, c-format + msgid "can't read sourcefile `%s' (%s)" + msgstr "ne peut lire le fichier source « %s » (%s)" + + #: awkgram.y:1252 + #, c-format + msgid "source file `%s' is empty" + msgstr "fichier source « %s » est vide" + + #: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011 + msgid "source file does not end in newline" + msgstr "fichier source ne se termine pas par un retour de chariot" + + #: awkgram.y:1518 + msgid "unterminated regexp ends with `\\' at end of file" + msgstr "" + "expression régulière non termineé se terminant par « \\ » à la fin du fichier" + + #: awkgram.y:1539 + msgid "unterminated regexp" + msgstr "expression régulière non terminée" + + #: awkgram.y:1542 + msgid "unterminated regexp at end of file" + msgstr "expression régulière non terminée à la fin du fichier" + + #: awkgram.y:1609 + msgid "use of `\\ #...' line continuation is not portable" + msgstr "" + "utilisation de « \\ #... » comme continuation de ligne n'est pas portable" + + #: awkgram.y:1621 + msgid "backslash not last character on line" + msgstr "la barre oblique inverse n'est pas le dernier caractère sur la ligne" + + #: awkgram.y:1662 + msgid "POSIX does not allow operator `**='" + msgstr "POSIX ne permet un opérateur « **= »" + + #: awkgram.y:1664 + msgid "old awk does not support operator `**='" + msgstr "l'ancien awk ne supporte pas l'opérateur « **= »" + + #: awkgram.y:1673 + msgid "POSIX does not allow operator `**'" + msgstr "POSIX ne permet pas l'opérateur « ** »" + + #: awkgram.y:1675 + msgid "old awk does not support operator `**'" + msgstr "l'ancien awk ne supporte pas l'opérateur « ** »" + + #: awkgram.y:1708 + msgid "operator `^=' is not supported in old awk" + msgstr "l'opérateur « ^= » n'est pas supporté dans l'ancien awk" + + #: awkgram.y:1716 + msgid "operator `^' is not supported in old awk" + msgstr "l'opérateur « ^ » n'est pas supporté dans l'ancien awk" + + #: awkgram.y:1798 awkgram.y:1815 + msgid "unterminated string" + msgstr "chaîne non complétée" + + #: awkgram.y:1972 + #, c-format + msgid "invalid char '%c' in expression" + msgstr "caractère invalide « %c » dans l'expression" + + #: awkgram.y:2032 + #, c-format + msgid "`%s' is a gawk extension" + msgstr "« %s » est une extension de gawk" + + #: awkgram.y:2035 + #, c-format + msgid "`%s' is a Bell Labs extension" + msgstr "« %s » est une extension de Bell Labs" + + #: awkgram.y:2038 + #, c-format + msgid "POSIX does not allow `%s'" + msgstr "POSIX ne permet pas « %s »" + + #: awkgram.y:2042 + #, c-format + msgid "`%s' is not supported in old awk" + msgstr "« %s » n'est pas supporté dans l'ancien awk" + + #: awkgram.y:2070 + msgid "`goto' considered harmful!\n" + msgstr "« goto » considéré néfaste!\n" + + #: awkgram.y:2134 + #, c-format + msgid "%d is invalid as number of arguments for %s" + msgstr "%d est invalide comme nombre d'arguments pour %s" + + #: awkgram.y:2153 awkgram.y:2156 + msgid "match: third argument is a gawk extension" + msgstr "match: 3e argument est une extension de gawk" + + #: awkgram.y:2172 + #, c-format + msgid "%s: string literal as last arg of substitute has no effect" + msgstr "" + "%s: la chaîne litérale comme dernier argument d'une substitution n'a aucun " + "effet" + + #: awkgram.y:2176 + msgid "sub third parameter is not a changeable object" + msgstr "sub: 3e paramètre n'est pas un objet interchangeable" + + #: awkgram.y:2178 + msgid "gsub third parameter is not a changeable object" + msgstr "gsub: 3e paramètre n'est pas un objet interchangeable" + + #: awkgram.y:2204 awkgram.y:2207 + msgid "close: second argument is a gawk extension" + msgstr "close: 2e argument est une extension de gawk" + + #: awkgram.y:2217 + msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" + msgstr "" + "utilisation de dcgettext(_\"...\") est incorrect: enlever les soulignés en " + "en-tête" + + #: awkgram.y:2232 + msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" + msgstr "" + "utilisation de dcgettext(_\"...\") est incorrecte: enlever les soulignés de " + "l'en-tête" + + #: awkgram.y:2323 + #, c-format + msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" + msgstr "fonction « %s »: paramètre #%d, « %s » est un double du paramètre #%d" + + #: awkgram.y:2355 + #, c-format + msgid "function `%s': parameter `%s' shadows global variable" + msgstr "fonction « %s »: paramètre « %s » porte ombrage à la variable globale" + + #: awkgram.y:2464 + #, c-format + msgid "could not open `%s' for writing (%s)" + msgstr "ne peut ourvrir « %s » en écriture (%s)" + + #: awkgram.y:2495 + #, c-format + msgid "%s: close failed (%s)" + msgstr "%s: échec de fermeture (%s)" + + #: awkgram.y:2605 + msgid "shadow_funcs() called twice!" + msgstr "shadows_funcs() appelé deux fois!" + + #: awkgram.y:2680 + #, c-format + msgid "function `%s': can't use function name as parameter name" + msgstr "fonction « %s »: ne peut utilise le nom de la fonction comme paramètre" + + #: awkgram.y:2690 + #, c-format + msgid "function name `%s' previously defined" + msgstr "nom de la fonction « %s » définie précédemment" + + #: awkgram.y:2838 awkgram.y:2844 + #, c-format + msgid "function `%s' called but never defined" + msgstr "fonction « %s » appelé mais jamais définie" + + #: awkgram.y:2847 + #, c-format + msgid "function `%s' defined but never called" + msgstr "fonction « %s » définie mais jamais utilisée" + + #: awkgram.y:2874 + #, c-format + msgid "regexp constant for parameter #%d yields boolean value" + msgstr "" + "expression régulière constante pour le paramètre #%d conduit à une valeur " + "booléenne" + + #: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649 + #: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078 + #: dfa.c:1081 dfa.c:1094 dfa.c:1095 + msgid "Unbalanced [" + msgstr "Non appariement de [" + + #: dfa.c:783 + msgid "Unfinished \\ escape" + msgstr "séquence d'échappement \\ non terminée" + + #: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955 + msgid "unfinished repeat count" + msgstr "répétition de compteur non terminé" + + #: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958 + msgid "malformed repeat count" + msgstr "compteur de répétition mal composé" + + #: dfa.c:1285 + msgid "Unbalanced (" + msgstr "Non appariement de (" + + #: dfa.c:1407 + msgid "No regexp syntax bits specified" + msgstr "Aucune syntaxe d'expression régulière des bits fournie" + + #: dfa.c:1415 + msgid "Unbalanced )" + msgstr "Non appariement de )" + + #: dfa.c:3014 + msgid "out of memory" + msgstr "Mémoire épuisée" + + #: field.c:849 + msgid "split: second argument is not an array" + msgstr "split: 2e argument n'est pas un tableau" + + #: field.c:876 + msgid "split: null string for third arg is a gawk extension" + msgstr "split: chaîne vide pour le 3e argument est une extension de gawk" + + #: field.c:916 + msgid "`FIELDWIDTHS' is a gawk extension" + msgstr "« FIELDWIDTHS » est une extension de gawk" + + #: field.c:943 + #, c-format + msgid "field %d in FIELDWIDTHS, must be > 0" + msgstr "champ %d dans FIELDWIDTHS, doit être > 0" + + #: field.c:997 + msgid "null string for `FS' is a gawk extension" + msgstr "chaîne vide pour « FS » est une extension de gawk" + + #: msg.c:57 + msgid "cmd. line:" + msgstr "cmd. ligne:" + + #: msg.c:123 + msgid "warning: " + msgstr "AVERTISSEMENT:" + + #: msg.c:145 + msgid "error: " + msgstr "Erreur: " + + #: msg.c:178 + msgid "fatal: " + msgstr "Fatal: " + + #: eval.c:259 + #, c-format + msgid "unknown nodetype %d" + msgstr "type de noeud inconnu %d" + + #: eval.c:307 + msgid "buffer overflow in genflags2str" + msgstr "débordement de tampo dans genflag2str" + + #: eval.c:541 + #, c-format + msgid "for loop: array `%s' changed size from %d to %d during loop execution" + msgstr "" + "for loop: tableau « %s » a changé de taille de %d à %d durant l'exécution de " + "la boucle" + + #: eval.c:565 + msgid "`break' outside a loop is not portable" + msgstr "« break » en dehors de la boucle n'est pas portable" + + #: eval.c:569 + msgid "`break' outside a loop is not allowed" + msgstr "« break » en dehors de la boucle n'est pas permis" + + #: eval.c:588 + msgid "`continue' outside a loop is not portable" + msgstr "« continue » en dehors de la boucle n'est pas portable" + + #: eval.c:592 + msgid "`continue' outside a loop is not allowed" + msgstr "« continue » en dehors de la boucle n'est pas permis" + + #: eval.c:622 + msgid "`next' cannot be called from a BEGIN rule" + msgstr "« next » ne peut être appelé depuis une règle BEGIN" + + #: eval.c:624 + msgid "`next' cannot be called from an END rule" + msgstr "« next » ne peut être appelé depuis une règle END" + + #: eval.c:636 + msgid "`nextfile' cannot be called from a BEGIN rule" + msgstr "« nextfile » ne peut être appelé depuis une règle BEGIN" + + #: eval.c:638 + msgid "`nextfile' cannot be called from an END rule" + msgstr "« nextfile » ne peut être appelé depuis une règle END" + + #: eval.c:679 + msgid "statement has no effect" + msgstr "la déclaration n'a aucun effet" + + #: eval.c:713 eval.c:743 eval.c:1622 + #, c-format + msgid "reference to uninitialized variable `%s'" + msgstr "référence à une variable non initialisée « %s »" + + #: eval.c:721 eval.c:1608 + #, c-format + msgid "can't use function name `%s' as variable or array" + msgstr "" + "ne peut utiliser le nom de la fonction « %s » comme variable ou tableau" + + #: eval.c:728 eval.c:734 eval.c:1747 + #, c-format + msgid "reference to uninitialized argument `%s'" + msgstr "référence à un argument non initialisé « %s »" + + #: eval.c:823 + msgid "assignment used in conditional context" + msgstr "affectation utilisé dans un contexte conditionnel" + + #: eval.c:914 + msgid "" + "concatenation: side effects in one expression have changed the length of " + "another!" + msgstr "" + "concaténation: effects de bord dans une expression a modifié la longueur " + "d'une autre!" + + #: eval.c:1013 + msgid "division by zero attempted" + msgstr "tentative de division par zéro" + + #: eval.c:1028 + #, c-format + msgid "division by zero attempted in `%%'" + msgstr "tentative de division par zéro dans « %% »" + + #: eval.c:1236 + msgid "division by zero attempted in `/='" + msgstr "tentative de division par zéro dans « /= »" + + #: eval.c:1254 + #, c-format + msgid "division by zero attempted in `%%='" + msgstr "tentative de division par zéro dans « %%= »" + + #: eval.c:1424 + #, c-format + msgid "%s (from %s)" + msgstr "%s (de %s)" + + #: eval.c:1472 + #, c-format + msgid "function `%s' called with more arguments than declared" + msgstr "fonction « %s » appelée avec plus d'arguments que déclarées" + + #: eval.c:1519 + #, c-format + msgid "function `%s' not defined" + msgstr "fonction « %s » non définie" + + #: eval.c:1521 + #, c-format + msgid "function %s called\n" + msgstr "fonction %s appelée\n" + + #: eval.c:1580 + msgid "" + "\n" + "\t# Function Call Stack:\n" + "\n" + msgstr "" + "\n" + "\t# Appel d'une fonction sur la pile:\n" + "\n" + + #: eval.c:1583 + msgid "\t# -- main --\n" + msgstr "#t# -- main --\n" + + #: eval.c:1759 + msgid "attempt to field reference from non-numeric value" + msgstr "tentative de référence un champ à partir d'une valeur non numérique" + + #: eval.c:1761 + msgid "attempt to reference from null string" + msgstr "tentative de référence à partir d'une chaîne nulle" + + #: eval.c:1767 + #, c-format + msgid "attempt to access field %d" + msgstr "tentative d'accès du champ %d" + + #: eval.c:1783 + #, c-format + msgid "attempt to use scalar parameter `%s' as an array" + msgstr "" + "tentative d'utilisation d'un paramètre scalaire « %s » comme un tableau" + + #: eval.c:1874 + msgid "`IGNORECASE' is a gawk extension" + msgstr "« IGNORECASE » est une extension de gawk" + + #: eval.c:1902 + msgid "`BINMODE' is a gawk extension" + msgstr "« BINMODE » est une extension de gawk" + + #: eval.c:2014 + #, c-format + msgid "bad `%sFMT' specification `%s'" + msgstr "« %sFMT » spécification erronée « %s »" + + #: eval.c:2080 + msgid "turning off `--lint' due to assignment to `LINT'" + msgstr "désactivation « --lint » en raison d'une affectation à « LINT »" + + #: eval.c:2116 + msgid "NF set to negative value" + msgstr "NF initialisé avec une valeur négative" + + #: io.c:240 + #, c-format + msgid "cannot open file `%s' for reading (%s)" + msgstr "ne peut ouvrir le fichier « %s » en lecture (%s)" + + #: io.c:320 + #, c-format + msgid "close of fd %d (`%s') failed (%s)" + msgstr "fermeture de fd %d (« %s ») en échec (%s)" + + #: io.c:432 + #, c-format + msgid "invalid tree type %s in redirect()" + msgstr "type d'arbre invalide %s dans redirect()" + + #: io.c:438 + #, c-format + msgid "expression in `%s' redirection only has numeric value" + msgstr "" + "l'expression de la redirection de « %s » a seulement une valeur numérique" + + #: io.c:444 + #, c-format + msgid "expression for `%s' redirection has null string value" + msgstr "" + "l'expression de la redirection de « %s » a une valeur nulle pour la chaîne" + + #: io.c:449 + #, c-format + msgid "filename `%s' for `%s' redirection may be result of logical expression" + msgstr "" + "nom de fichier « %s » pour le redirection « %s » peut être le résultat d'une " + "expression logique" + + #: io.c:471 + #, c-format + msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" + msgstr "mélange non nécessaire de « > » et de « >> » pour le fichier « %.*s »" + + #: io.c:523 + #, c-format + msgid "can't open pipe `%s' for output (%s)" + msgstr "ne peut ouvrir un pipe « %s » en sortie (%s)" + + #: io.c:532 + #, c-format + msgid "can't open pipe `%s' for input (%s)" + msgstr "ne peut ouvrir un pipe « %s » en entrée (%s)" + + #: io.c:545 + #, c-format + msgid "can't open two way socket `%s' for input/output (%s)" + msgstr "" + "ne peut ouvrir un socket bidirectionnel « %s » pour les entrées/sorties (%s)" + + #: io.c:549 + #, c-format + msgid "can't open two way pipe `%s' for input/output (%s)" + msgstr "" + "ne peut ouvrir un pipe bidirectionnel « %s » pour les entrées/sorties (%s)" + + #: io.c:625 + #, c-format + msgid "can't redirect from `%s' (%s)" + msgstr "ne peut rediriger de « %s » (%s)" + + #: io.c:628 + #, c-format + msgid "can't redirect to `%s' (%s)" + msgstr "ne peut rediriger vers « %s » (%s)" + + #: io.c:667 + msgid "" + "reached system limit for open files: starting to multiplex file descriptors" + msgstr "" + "limite système atteinte pour l'ouverture des fichiers: début du multiplexage " + "des descripteurs de fichiers" + + #: io.c:679 + #, c-format + msgid "close of `%s' failed (%s)." + msgstr "fermeture de « %s » en échec (%s)" + + #: io.c:686 + msgid "too many pipes or input files open" + msgstr "trop de pipes ou de fichiers en lecture ouverts" + + #: io.c:709 + msgid "close: second argument must be `to' or `from'" + msgstr "close: 2e argument doit être « to » ou « from »" + + #: io.c:723 + #, c-format + msgid "close: `%.*s' is not an open file, pipe or co-process" + msgstr "close: « %.*s » n'est pas ni un fichier ouvert, pipe ou co-processus" + + #: io.c:727 + msgid "close of redirection that was never opened" + msgstr "fermeture de la redirection qui n'a jamais été ouverte" + + #: io.c:754 + #, c-format + msgid "close: redirection `%s' not opened with `|&', second argument ignored" + msgstr "" + "close: redirection « %s » n'a pas été ouverte ave « |& » 2e argument ignoré" + + #: io.c:811 + #, c-format + msgid "failure status (%d) on pipe close of `%s' (%s)" + msgstr "constat d'échec (%d) lors de la fermeture du pipe « %s » (%s)" + + #: io.c:814 + #, c-format + msgid "failure status (%d) on file close of `%s' (%s)" + msgstr "constat d'échec (%d) lors de la fermeture du fichier « %s » (%s)" + + #: io.c:833 + #, c-format + msgid "no explicit close of socket `%s' provided" + msgstr "aucune fermeture explicite du socket « %s » fournie" + + #: io.c:836 + #, c-format + msgid "no explicit close of co-process `%s' provided" + msgstr "aucune fermeture explicite du co-processus « %s » fournie" + + #: io.c:839 + #, c-format + msgid "no explicit close of pipe `%s' provided" + msgstr "aucune fermeture explicite du pipe « %s » fournie" + + #: io.c:842 + #, c-format + msgid "no explicit close of file `%s' provided" + msgstr "aucune fermeture explicite du fichier « %s » fournie" + + #: io.c:871 io.c:925 + #, c-format + msgid "error writing standard output (%s)" + msgstr "erreur lors de l'écriture vers stdout (%s)" + + #: io.c:875 io.c:929 + #, c-format + msgid "error writing standard error (%s)" + msgstr "erreur lors de l'écriture vers stderr (%s)" + + #: io.c:883 + #, c-format + msgid "pipe flush of `%s' failed (%s)." + msgstr "vidange du pipie de « %s » en échec (%s)" + + #: io.c:886 + #, c-format + msgid "co-process flush of pipe to `%s' failed (%s)." + msgstr "vidange du pipe par le co-processus vers « %s » en échec (%s)" + + #: io.c:889 + #, c-format + msgid "file flush of `%s' failed (%s)." + msgstr "vidange du fichier « %s » en échec (%s)" + + #: io.c:1048 + msgid "/inet/raw client not ready yet, sorry" + msgstr "le client /inet/raw n'est pas encore prêt, désolé" + + #: io.c:1050 io.c:1087 + msgid "only root may use `/inet/raw'." + msgstr "seul root peut utiliser « /inet/raw »" + + #: io.c:1085 + msgid "/inet/raw server not ready yet, sorry" + msgstr "le serveur /inet/raw n'est pas encore prêt, désolé" + + #: io.c:1175 + #, c-format + msgid "no (known) protocol supplied in special filename `%s'" + msgstr "aucun protocole (connu) fourni dans le nom de fichier spécial « %s »" + + #: io.c:1193 + #, c-format + msgid "special file name `%s' is incomplete" + msgstr "nom spécial de fichier « %s » est incomplet" + + #: io.c:1205 + #, c-format + msgid "local port invalid in `%s'" + msgstr "port local invalide dans « %s »" + + #: io.c:1217 + msgid "must supply a remote hostname to `/inet'" + msgstr "un nom de hôte distant doit être fourni à « /inet »" + + #: io.c:1232 + msgid "must supply a remote port to `/inet'" + msgstr "un port distant doit être fournis à « /inet »" + + #: io.c:1238 + #, c-format + msgid "remote port invalid in `%s'" + msgstr "port distant invalide dans « %s »" + + #: io.c:1248 + msgid "TCP/IP communications are not supported" + msgstr "les communications TCP/IP ne sont pas supportées" + + #: io.c:1257 io.c:1438 + #, c-format + msgid "file `%s' is a directory" + msgstr "le fichier « %s » est un répertoire" + + #: io.c:1327 + #, c-format + msgid "use `PROCINFO[\"%s\"]' instead of `%s'" + msgstr "utliser « PROCINFO[\"%s\"] » au lieu de « %s »" + + #: io.c:1359 + msgid "use `PROCINFO[...]' instead of `/dev/user'" + msgstr "utliser « PROCINFO[\"%s\"] » au lieu de « /dev/user »" + + #: io.c:1424 + #, c-format + msgid "could not open `%s', mode `%s'" + msgstr "ne peut ouvrir « %s », mode « %s »" + + #: io.c:1550 io.c:1602 io.c:1732 io.c:1754 + #, c-format + msgid "moving pipe to stdout in child failed (dup: %s)" + msgstr "échec de redirection du pipe vers stdout du processus fils (dup: %s)" + + #: io.c:1554 io.c:1607 + #, c-format + msgid "moving pipe to stdin in child failed (dup: %s)" + msgstr "échec de redirection du pipe vers stdin du processus fils (dup: %s)" + + #: io.c:1571 io.c:1745 + msgid "restoring stdout in parent process failed\n" + msgstr "restauration de stdout par le processus parent a échoué\n" + + #: io.c:1576 + msgid "restoring stdin in parent process failed\n" + msgstr "restauration de stdin par le processus parent a échoué\n" + + #: io.c:1599 io.c:1751 + #, c-format + msgid "close of stdout in child failed (%s)" + msgstr "échec de fermeture de stdout du processus fils (%s)" + + #: io.c:1604 + #, c-format + msgid "close of stdin in child failed (%s)" + msgstr "échec de fermeture de stdin du processus fils (%s)" + + #: io.c:1610 io.c:1756 io.c:1767 + #, c-format + msgid "close of pipe failed (%s)" + msgstr "échec de la fermeture du pipe (%s)" + + #: io.c:1655 + msgid "`|&' not supported" + msgstr "« |& » non supporté" + + #: io.c:1722 + #, c-format + msgid "cannot open pipe `%s' (%s)" + msgstr "ne ouvrir un pipe « %s » (%s)" + + #: io.c:1763 + #, c-format + msgid "cannot create child process for `%s' (fork: %s)" + msgstr "ne créer le processus fils pour « %s » (fork: %s)" + + #: io.c:2104 + #, c-format + msgid "data file `%s' is empty" + msgstr "le fichier de données « %s » est vide" + + #: io.c:2175 + #, c-format + msgid "internal error: file `%s', line %d\n" + msgstr "erreur interne: fichier « %s », ligne %d\n" + + #: io.c:2277 + #, c-format + msgid "error reading input file `%s': %s" + msgstr "erreur lors de la lecture du fichier source « %s »: %s" + + #: io.c:2521 + msgid "multicharacter value of `RS' is a gawk extension" + msgstr "valeur de « RS » avec multiple caractères est une extension gawk" + + #: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 + msgid "can't convert string to float" + msgstr "ne peut convertir la chaîne en nombre flottant" + + #: node.c:342 + msgid "backslash at end of string" + msgstr "barre oblique inverse à la fin de la chaîne" + + #: node.c:524 + msgid "POSIX does not allow `\\x' escapes" + msgstr "POSIX ne permet pas de séquence d'échappement « \\x »" + + #: node.c:530 + msgid "no hex digits in `\\x' escape sequence" + msgstr "aucun chiffre hexadécimal dans la séquence d'échappement « \\x » " + + #: node.c:564 + #, c-format + msgid "escape sequence `\\%c' treated as plain `%c'" + msgstr "séquence d'échappement « \\%c » traitée simplement comme « %c »" + + #: re.c:208 + #, c-format + msgid "regex match failed, not enough memory to match string \"%.*s%s\"" + msgstr "" + "échec de concordance de regex, pas assez de mémoire pour traiter la chaîne " + "\"%.*s%s\"" + + #: posix/gawkmisc.c:122 + #, c-format + msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)" + msgstr "%s %s « %s »: ne peut initialiser close-on-exec: (fcntl: %s)" + + #~ msgid "" + #~ "\n" + #~ "To report bugs, see node `Bugs' in `gawk.info', which is\n" + #~ msgstr "" + #~ "\n" + #~ "Pour rapporter une anomalie, voir « Bugs » dans « gawk.info », dans la\n" + + #~ msgid "pipe from `%s': could not set close-on-exec (fcntl: %s)" + #~ msgstr "pipe de `%s': ne peut initialiser close-on-exec (fcntl: %s)" + + #~ msgid "pipe to `%s': could not set close-on-exec (fcntl: %s)" + #~ msgstr "pipe vers «%s»: ne peut initialiser close-on-exec (fcntl: %s)" diff -crN gawk-3.1.0/po/gawk.pot gawk-3.1.1/po/gawk.pot *** gawk-3.1.0/po/gawk.pot Tue May 15 19:48:58 2001 --- gawk-3.1.1/po/gawk.pot Wed May 1 16:40:58 2002 *************** *** 1,74 **** # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" ! "POT-Creation-Date: 2001-05-15 19:48+0300\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: ENCODING\n" ! #: array.c:243 array.c:278 eval.c:483 #, c-format msgid "attempt to use scalar `%s' as array" msgstr "" ! #: array.c:302 #, c-format msgid "reference to uninitialized element `%s[\"%s\"]'" msgstr "" ! #: array.c:308 #, c-format msgid "subscript of array `%s' is null string" msgstr "" ! #: array.c:371 array.c:454 #, c-format msgid "delete: illegal use of variable `%s' as array" msgstr "" ! #: array.c:404 #, c-format msgid "delete: index `%s' not in array `%s'" msgstr "" ! #: array.c:569 #, c-format msgid "%s: empty (null)\n" msgstr "" ! #: array.c:574 #, c-format msgid "%s: empty (zero)\n" msgstr "" ! #: array.c:578 #, c-format msgid "%s: table_size = %d, array_size = %d\n" msgstr "" ! #: array.c:610 #, c-format ! msgid "%s: is paramater\n" msgstr "" ! #: array.c:615 #, c-format msgid "%s: array_ref to %s\n" msgstr "" ! #: array.c:842 msgid "asort: first argument is not an array" msgstr "" ! #: array.c:851 msgid "asort: second argument is not an array" msgstr "" --- 1,75 ---- # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. + # 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-05-01 16:40+0300\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" ! #: array.c:243 array.c:275 array.c:280 eval.c:483 #, c-format msgid "attempt to use scalar `%s' as array" msgstr "" ! #: array.c:304 #, c-format msgid "reference to uninitialized element `%s[\"%s\"]'" msgstr "" ! #: array.c:310 #, c-format msgid "subscript of array `%s' is null string" msgstr "" ! #: array.c:373 array.c:456 #, c-format msgid "delete: illegal use of variable `%s' as array" msgstr "" ! #: array.c:406 #, c-format msgid "delete: index `%s' not in array `%s'" msgstr "" ! #: array.c:571 #, c-format msgid "%s: empty (null)\n" msgstr "" ! #: array.c:576 #, c-format msgid "%s: empty (zero)\n" msgstr "" ! #: array.c:580 #, c-format msgid "%s: table_size = %d, array_size = %d\n" msgstr "" ! #: array.c:612 #, c-format ! msgid "%s: is parameter\n" msgstr "" ! #: array.c:617 #, c-format msgid "%s: array_ref to %s\n" msgstr "" ! #: array.c:844 msgid "asort: first argument is not an array" msgstr "" ! #: array.c:853 msgid "asort: second argument is not an array" msgstr "" *************** *** 109,400 **** msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "" ! #: builtin.c:222 msgid "index: received non-string first argument" msgstr "" ! #: builtin.c:224 msgid "index: received non-string second argument" msgstr "" ! #: builtin.c:287 msgid "int: received non-numeric argument" msgstr "" ! #: builtin.c:304 msgid "length: received non-string argument" msgstr "" ! #: builtin.c:320 msgid "log: received non-numeric argument" msgstr "" ! #: builtin.c:323 #, c-format msgid "log: received negative argument %g" msgstr "" ! #: builtin.c:583 msgid "`$' is not permitted in awk formats" msgstr "" ! #: builtin.c:589 msgid "arg count with `$' must be > 0" msgstr "" ! #: builtin.c:591 #, c-format msgid "arg count %d greater than total number of supplied arguments" msgstr "" ! #: builtin.c:593 msgid "`$' not permitted after period in format" msgstr "" ! #: builtin.c:606 msgid "no `$' supplied for positional field width or precision" msgstr "" ! #: builtin.c:664 msgid "`l' is meaningless in awk formats; ignored" msgstr "" ! #: builtin.c:668 msgid "`l' is not permitted in POSIX awk formats" msgstr "" ! #: builtin.c:679 msgid "`L' is meaningless in awk formats; ignored" msgstr "" ! #: builtin.c:683 msgid "`L' is not permitted in POSIX awk formats" msgstr "" ! #: builtin.c:694 msgid "`h' is meaningless in awk formats; ignored" msgstr "" ! #: builtin.c:698 msgid "`h' is not permitted in POSIX awk formats" msgstr "" ! #: builtin.c:947 msgid "not enough arguments to satisfy format string" msgstr "" ! #: builtin.c:949 msgid "^ ran out for this one" msgstr "" ! #: builtin.c:954 msgid "[s]printf: format specifier does not have control letter" msgstr "" ! #: builtin.c:957 msgid "too many arguments supplied for format string" msgstr "" ! #: builtin.c:1000 builtin.c:1003 msgid "printf: no arguments" msgstr "" ! #: builtin.c:1036 msgid "sqrt: received non-numeric argument" msgstr "" ! #: builtin.c:1040 #, c-format msgid "sqrt: called with negative argument %g" msgstr "" ! #: builtin.c:1062 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "" ! #: builtin.c:1067 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "" ! #: builtin.c:1081 #, c-format msgid "substr: length %g is <= 0" msgstr "" ! #: builtin.c:1087 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "" ! #: builtin.c:1094 msgid "substr: source string is zero length" msgstr "" ! #: builtin.c:1101 #, c-format msgid "" "substr: length %d at start index %d exceeds length of first argument (%d)" msgstr "" ! #: builtin.c:1107 #, c-format msgid "substr: start index %d is past end of string" msgstr "" ! #: builtin.c:1143 ! msgid "strftime: recieved non-string first argument" msgstr "" ! #: builtin.c:1149 msgid "strftime: received empty format string" msgstr "" ! #: builtin.c:1158 ! msgid "strftime: recieved non-numeric second argument" msgstr "" ! #: builtin.c:1221 msgid "mktime: received non-string argument" msgstr "" ! #: builtin.c:1266 ! msgid "system: recieved non-string argument" msgstr "" ! #: builtin.c:1386 ! msgid "tolower: recieved non-string argument" msgstr "" ! #: builtin.c:1407 ! msgid "toupper: recieved non-string argument" msgstr "" ! #: builtin.c:1430 msgid "atan2: received non-numeric first argument" msgstr "" ! #: builtin.c:1432 msgid "atan2: received non-numeric second argument" msgstr "" ! #: builtin.c:1451 msgid "sin: received non-numeric argument" msgstr "" ! #: builtin.c:1467 msgid "cos: received non-numeric argument" msgstr "" ! #: builtin.c:1511 msgid "srand: received non-numeric argument" msgstr "" ! #: builtin.c:1545 msgid "match: third argument is not an array" msgstr "" ! #: builtin.c:1942 msgid "gensub: 3rd argument of 0 treated as 1" msgstr "" ! #: builtin.c:2053 builtin.c:2055 msgid "lshift: received non-numeric first argument" msgstr "" ! #: builtin.c:2057 #, c-format msgid "lshift(%lf, %lf): negative values will give strange results" msgstr "" ! #: builtin.c:2059 #, c-format msgid "lshift(%lf, %lf): fractional values will be truncated" msgstr "" ! #: builtin.c:2061 #, c-format msgid "lshift(%lf, %lf): too large shift value will give strange results" msgstr "" ! #: builtin.c:2090 builtin.c:2092 msgid "rshift: received non-numeric first argument" msgstr "" ! #: builtin.c:2094 #, c-format msgid "rshift(%lf, %lf): negative values will give strange results" msgstr "" ! #: builtin.c:2096 #, c-format msgid "rshift(%lf, %lf): fractional values will be truncated" msgstr "" ! #: builtin.c:2098 #, c-format msgid "rshift(%lf, %lf): too large shift value will give strange results" msgstr "" ! #: builtin.c:2127 builtin.c:2129 msgid "and: received non-numeric first argument" msgstr "" ! #: builtin.c:2131 #, c-format msgid "and(%lf, %lf): negative values will give strange results" msgstr "" ! #: builtin.c:2133 #, c-format msgid "and(%lf, %lf): fractional values will be truncated" msgstr "" ! #: builtin.c:2162 builtin.c:2164 msgid "or: received non-numeric first argument" msgstr "" ! #: builtin.c:2166 #, c-format msgid "or(%lf, %lf): negative values will give strange results" msgstr "" ! #: builtin.c:2168 #, c-format msgid "or(%lf, %lf): fractional values will be truncated" msgstr "" ! #: builtin.c:2197 builtin.c:2199 msgid "xor: received non-numeric first argument" msgstr "" ! #: builtin.c:2201 #, c-format msgid "xor(%lf, %lf): negative values will give strange results" msgstr "" ! #: builtin.c:2203 #, c-format msgid "xor(%lf, %lf): fractional values will be truncated" msgstr "" ! #: builtin.c:2231 msgid "compl: received non-numeric argument" msgstr "" ! #: builtin.c:2233 #, c-format msgid "compl(%lf): negative value will give strange results" msgstr "" ! #: builtin.c:2235 #, c-format msgid "compl(%lf): fractional value will be truncated" msgstr "" ! #. not there ! #: builtin.c:2429 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "" --- 110,404 ---- msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "" ! #: builtin.c:295 msgid "index: received non-string first argument" msgstr "" ! #: builtin.c:297 msgid "index: received non-string second argument" msgstr "" ! #: builtin.c:407 msgid "int: received non-numeric argument" msgstr "" ! #: builtin.c:424 msgid "length: received non-string argument" msgstr "" ! #: builtin.c:440 msgid "log: received non-numeric argument" msgstr "" ! #: builtin.c:443 #, c-format msgid "log: received negative argument %g" msgstr "" ! #: builtin.c:605 builtin.c:608 ! msgid "must use `count$' on all formats or none" ! msgstr "" ! ! #: builtin.c:703 msgid "`$' is not permitted in awk formats" msgstr "" ! #: builtin.c:709 msgid "arg count with `$' must be > 0" msgstr "" ! #: builtin.c:711 #, c-format msgid "arg count %d greater than total number of supplied arguments" msgstr "" ! #: builtin.c:713 msgid "`$' not permitted after period in format" msgstr "" ! #: builtin.c:726 msgid "no `$' supplied for positional field width or precision" msgstr "" ! #: builtin.c:784 msgid "`l' is meaningless in awk formats; ignored" msgstr "" ! #: builtin.c:788 msgid "`l' is not permitted in POSIX awk formats" msgstr "" ! #: builtin.c:799 msgid "`L' is meaningless in awk formats; ignored" msgstr "" ! #: builtin.c:803 msgid "`L' is not permitted in POSIX awk formats" msgstr "" ! #: builtin.c:814 msgid "`h' is meaningless in awk formats; ignored" msgstr "" ! #: builtin.c:818 msgid "`h' is not permitted in POSIX awk formats" msgstr "" ! #: builtin.c:1067 msgid "not enough arguments to satisfy format string" msgstr "" ! #: builtin.c:1069 msgid "^ ran out for this one" msgstr "" ! #: builtin.c:1074 msgid "[s]printf: format specifier does not have control letter" msgstr "" ! #: builtin.c:1077 msgid "too many arguments supplied for format string" msgstr "" ! #: builtin.c:1120 builtin.c:1123 msgid "printf: no arguments" msgstr "" ! #: builtin.c:1156 msgid "sqrt: received non-numeric argument" msgstr "" ! #: builtin.c:1160 #, c-format msgid "sqrt: called with negative argument %g" msgstr "" ! #: builtin.c:1182 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "" ! #: builtin.c:1187 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "" ! #: builtin.c:1201 #, c-format msgid "substr: length %g is <= 0" msgstr "" ! #: builtin.c:1207 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "" ! #: builtin.c:1214 msgid "substr: source string is zero length" msgstr "" ! #: builtin.c:1221 #, c-format msgid "" "substr: length %d at start index %d exceeds length of first argument (%d)" msgstr "" ! #: builtin.c:1227 #, c-format msgid "substr: start index %d is past end of string" msgstr "" ! #: builtin.c:1263 ! msgid "strftime: received non-string first argument" msgstr "" ! #: builtin.c:1269 msgid "strftime: received empty format string" msgstr "" ! #: builtin.c:1278 ! msgid "strftime: received non-numeric second argument" msgstr "" ! #: builtin.c:1341 msgid "mktime: received non-string argument" msgstr "" ! #: builtin.c:1386 ! msgid "system: received non-string argument" msgstr "" ! #: builtin.c:1512 ! msgid "tolower: received non-string argument" msgstr "" ! #: builtin.c:1561 ! msgid "toupper: received non-string argument" msgstr "" ! #: builtin.c:1606 msgid "atan2: received non-numeric first argument" msgstr "" ! #: builtin.c:1608 msgid "atan2: received non-numeric second argument" msgstr "" ! #: builtin.c:1627 msgid "sin: received non-numeric argument" msgstr "" ! #: builtin.c:1643 msgid "cos: received non-numeric argument" msgstr "" ! #: builtin.c:1687 msgid "srand: received non-numeric argument" msgstr "" ! #: builtin.c:1721 msgid "match: third argument is not an array" msgstr "" ! #: builtin.c:2157 msgid "gensub: 3rd argument of 0 treated as 1" msgstr "" ! #: builtin.c:2268 builtin.c:2270 msgid "lshift: received non-numeric first argument" msgstr "" ! #: builtin.c:2272 #, c-format msgid "lshift(%lf, %lf): negative values will give strange results" msgstr "" ! #: builtin.c:2274 #, c-format msgid "lshift(%lf, %lf): fractional values will be truncated" msgstr "" ! #: builtin.c:2276 #, c-format msgid "lshift(%lf, %lf): too large shift value will give strange results" msgstr "" ! #: builtin.c:2305 builtin.c:2307 msgid "rshift: received non-numeric first argument" msgstr "" ! #: builtin.c:2309 #, c-format msgid "rshift(%lf, %lf): negative values will give strange results" msgstr "" ! #: builtin.c:2311 #, c-format msgid "rshift(%lf, %lf): fractional values will be truncated" msgstr "" ! #: builtin.c:2313 #, c-format msgid "rshift(%lf, %lf): too large shift value will give strange results" msgstr "" ! #: builtin.c:2342 builtin.c:2344 msgid "and: received non-numeric first argument" msgstr "" ! #: builtin.c:2346 #, c-format msgid "and(%lf, %lf): negative values will give strange results" msgstr "" ! #: builtin.c:2348 #, c-format msgid "and(%lf, %lf): fractional values will be truncated" msgstr "" ! #: builtin.c:2377 builtin.c:2379 msgid "or: received non-numeric first argument" msgstr "" ! #: builtin.c:2381 #, c-format msgid "or(%lf, %lf): negative values will give strange results" msgstr "" ! #: builtin.c:2383 #, c-format msgid "or(%lf, %lf): fractional values will be truncated" msgstr "" ! #: builtin.c:2412 builtin.c:2414 msgid "xor: received non-numeric first argument" msgstr "" ! #: builtin.c:2416 #, c-format msgid "xor(%lf, %lf): negative values will give strange results" msgstr "" ! #: builtin.c:2418 #, c-format msgid "xor(%lf, %lf): fractional values will be truncated" msgstr "" ! #: builtin.c:2446 msgid "compl: received non-numeric argument" msgstr "" ! #: builtin.c:2448 #, c-format msgid "compl(%lf): negative value will give strange results" msgstr "" ! #: builtin.c:2450 #, c-format msgid "compl(%lf): fractional value will be truncated" msgstr "" ! #: builtin.c:2621 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "" *************** *** 417,653 **** msgid "Operation Not Supported" msgstr "" ! #: getopt.c:688 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "" ! #: getopt.c:713 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" ! #: getopt.c:718 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" ! #: getopt.c:736 getopt.c:909 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "" ! #. --option ! #: getopt.c:765 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "" ! #. +option or -option ! #: getopt.c:769 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "" ! #. 1003.2 specifies the format of this message. ! #: getopt.c:795 #, c-format msgid "%s: illegal option -- %c\n" msgstr "" ! #: getopt.c:798 #, c-format msgid "%s: invalid option -- %c\n" msgstr "" ! #. 1003.2 specifies the format of this message. ! #: getopt.c:828 getopt.c:958 main.c:397 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "" ! #: getopt.c:875 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "" ! #: getopt.c:893 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "" ! #: main.c:292 msgid "`-m[fr]' option irrelevant in gawk" msgstr "" ! #: main.c:294 msgid "-m option usage: `-m[fr] nnn'" msgstr "" ! #. gawk specific options - now in getopt_long ! #: main.c:311 #, c-format msgid "%s: option `-W %s' unrecognized, ignored\n" msgstr "" ! #: main.c:342 msgid "empty argument to `--source' ignored" msgstr "" ! #: main.c:414 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" ! #. both on command line ! #: main.c:419 msgid "`--posix' overrides `--traditional'" msgstr "" ! #: main.c:430 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" ! #: main.c:434 #, c-format ! msgid "runing %s setuid root may be a security problem" msgstr "" ! #: main.c:463 #, c-format msgid "can't set mode on stdin (%s)" msgstr "" ! #: main.c:466 #, c-format msgid "can't set mode on stdout (%s)" msgstr "" ! #: main.c:468 #, c-format msgid "can't set mode on stderr (%s)" msgstr "" ! #: main.c:497 msgid "no program text at all!" msgstr "" ! #. Not factoring out common stuff makes it easier to translate. ! #: main.c:541 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" ! #: main.c:543 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" ! #. GNU long options info. This is too many options. ! #: main.c:548 msgid "POSIX options:\t\tGNU long options:\n" msgstr "" ! #: main.c:549 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "" ! #: main.c:550 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "" ! #: main.c:551 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "" ! #: main.c:552 msgid "\t-m[fr] val\n" msgstr "" ! #: main.c:553 msgid "\t-W compat\t\t--compat\n" msgstr "" ! #: main.c:554 msgid "\t-W copyleft\t\t--copyleft\n" msgstr "" ! #: main.c:555 msgid "\t-W copyright\t\t--copyright\n" msgstr "" ! #: main.c:556 msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" msgstr "" ! #: main.c:557 msgid "\t-W gen-po\t\t--gen-po\n" msgstr "" ! #: main.c:558 msgid "\t-W help\t\t\t--help\n" msgstr "" ! #: main.c:559 msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" msgstr "" ! #: main.c:560 msgid "\t-W lint-old\t\t--lint-old\n" msgstr "" ! #: main.c:561 msgid "\t-W non-decimal-data\t--non-decimal-data\n" msgstr "" ! #: main.c:563 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "" ! #: main.c:566 msgid "\t-W parsedebug\t\t--parsedebug\n" msgstr "" ! #: main.c:568 msgid "\t-W profile[=file]\t--profile[=file]\n" msgstr "" ! #: main.c:569 msgid "\t-W posix\t\t--posix\n" msgstr "" ! #: main.c:570 msgid "\t-W re-interval\t\t--re-interval\n" msgstr "" ! #: main.c:571 msgid "\t-W source=program-text\t--source=program-text\n" msgstr "" ! #: main.c:572 msgid "\t-W traditional\t\t--traditional\n" msgstr "" ! #: main.c:573 msgid "\t-W usage\t\t--usage\n" msgstr "" ! #: main.c:574 msgid "\t-W version\t\t--version\n" msgstr "" ! #: main.c:575 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" msgstr "" ! #: main.c:576 ! msgid "section `Reporting Problems and Bugs' in the printed version.\n" msgstr "" ! #: main.c:586 msgid "" ! "Copyright (C) 1989, 1991-2001 Free Software Foundation.\n" "\n" "This program is free software; you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" --- 421,662 ---- msgid "Operation Not Supported" msgstr "" ! #: getopt.c:692 getopt.c:704 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "" ! #: getopt.c:737 getopt.c:741 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" ! #: getopt.c:750 getopt.c:755 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" ! #: getopt.c:791 getopt.c:804 getopt.c:1093 getopt.c:1106 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "" ! #: getopt.c:842 getopt.c:845 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "" ! #: getopt.c:853 getopt.c:856 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "" ! #: getopt.c:903 getopt.c:906 #, c-format msgid "%s: illegal option -- %c\n" msgstr "" ! #: getopt.c:912 getopt.c:915 #, c-format msgid "%s: invalid option -- %c\n" msgstr "" ! #: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "" ! #: getopt.c:1025 getopt.c:1036 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "" ! #: getopt.c:1060 getopt.c:1072 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "" ! #: main.c:307 msgid "`-m[fr]' option irrelevant in gawk" msgstr "" ! #: main.c:309 msgid "-m option usage: `-m[fr] nnn'" msgstr "" ! #: main.c:326 #, c-format msgid "%s: option `-W %s' unrecognized, ignored\n" msgstr "" ! #: main.c:357 msgid "empty argument to `--source' ignored" msgstr "" ! #: main.c:429 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "" ! #: main.c:434 msgid "`--posix' overrides `--traditional'" msgstr "" ! #: main.c:445 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "" ! #: main.c:449 #, c-format ! msgid "running %s setuid root may be a security problem" msgstr "" ! #: main.c:478 #, c-format msgid "can't set mode on stdin (%s)" msgstr "" ! #: main.c:481 #, c-format msgid "can't set mode on stdout (%s)" msgstr "" ! #: main.c:483 #, c-format msgid "can't set mode on stderr (%s)" msgstr "" ! #: main.c:512 msgid "no program text at all!" msgstr "" ! #: main.c:556 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" ! #: main.c:558 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" ! #: main.c:563 msgid "POSIX options:\t\tGNU long options:\n" msgstr "" ! #: main.c:564 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "" ! #: main.c:565 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "" ! #: main.c:566 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "" ! #: main.c:567 msgid "\t-m[fr] val\n" msgstr "" ! #: main.c:568 msgid "\t-W compat\t\t--compat\n" msgstr "" ! #: main.c:569 msgid "\t-W copyleft\t\t--copyleft\n" msgstr "" ! #: main.c:570 msgid "\t-W copyright\t\t--copyright\n" msgstr "" ! #: main.c:571 msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" msgstr "" ! #: main.c:572 msgid "\t-W gen-po\t\t--gen-po\n" msgstr "" ! #: main.c:573 msgid "\t-W help\t\t\t--help\n" msgstr "" ! #: main.c:574 msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" msgstr "" ! #: main.c:575 msgid "\t-W lint-old\t\t--lint-old\n" msgstr "" ! #: main.c:576 msgid "\t-W non-decimal-data\t--non-decimal-data\n" msgstr "" ! #: main.c:578 msgid "\t-W nostalgia\t\t--nostalgia\n" msgstr "" ! #: main.c:581 msgid "\t-W parsedebug\t\t--parsedebug\n" msgstr "" ! #: main.c:583 msgid "\t-W profile[=file]\t--profile[=file]\n" msgstr "" ! #: main.c:584 msgid "\t-W posix\t\t--posix\n" msgstr "" ! #: main.c:585 msgid "\t-W re-interval\t\t--re-interval\n" msgstr "" ! #: main.c:586 msgid "\t-W source=program-text\t--source=program-text\n" msgstr "" ! #: main.c:587 msgid "\t-W traditional\t\t--traditional\n" msgstr "" ! #: main.c:588 msgid "\t-W usage\t\t--usage\n" msgstr "" ! #: main.c:589 msgid "\t-W version\t\t--version\n" msgstr "" ! #: main.c:593 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" + "section `Reporting Problems and Bugs' in the printed version.\n" + "\n" msgstr "" ! #: main.c:597 ! msgid "" ! "gawk is a pattern scanning and processing language.\n" ! "By default it reads standard input and writes standard output.\n" ! "\n" msgstr "" ! #: main.c:601 msgid "" ! "Examples:\n" ! "\tgawk '{ sum += $1 }; END { print sum }' file\n" ! "\tgawk -F: '{ print $1 }' /etc/passwd\n" ! msgstr "" ! ! #: main.c:613 ! #, c-format ! msgid "" ! "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" "\n" "This program is free software; you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" *************** *** 656,662 **** "\n" msgstr "" ! #: main.c:594 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" --- 665,671 ---- "\n" msgstr "" ! #: main.c:621 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" *************** *** 665,1210 **** "\n" msgstr "" ! #: main.c:600 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" msgstr "" ! #: main.c:630 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "" ! #: io.c:1371 main.c:830 ! #, c-format ! msgid "could not find groups: %s" ! msgstr "" ! ! #: main.c:869 #, c-format msgid "invalid syntax in name `%s' for variable assignment" msgstr "" ! #: main.c:938 msgid "floating point exception" msgstr "" ! #: main.c:945 msgid "fatal error: internal error" msgstr "" ! #: main.c:995 #, c-format msgid "no pre-opened fd %d" msgstr "" ! #: main.c:1000 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "" #: profile.c:94 #, c-format msgid "could not open `%s' for writing: %s" msgstr "" ! #: awkgram.y:2281 profile.c:96 msgid "sending profile to standard error" msgstr "" ! #: profile.c:402 msgid "internal error: Node_var with null vname" msgstr "" ! #: profile.c:508 msgid "internal error: Node_var_array with null vname" msgstr "" ! #: eval.c:816 profile.c:531 #, c-format msgid "" "function `%s' called with space between name and `(',\n" "%s" msgstr "" ! #: eval.c:818 profile.c:533 msgid "or used in other expression context" msgstr "" ! #: eval.c:796 eval.c:1042 eval.c:1610 eval.c:1736 profile.c:610 profile.c:738 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "" ! #: eval.c:1046 profile.c:614 #, c-format msgid "illegal type (%s) in tree_eval" msgstr "" ! #: eval.c:1785 profile.c:815 #, c-format msgid "attempt to use function `%s' as array" msgstr "" ! #: eval.c:1792 profile.c:829 #, c-format msgid "`%s' is a function, assignment is not allowed" msgstr "" ! #. in gawk for a while ! #: eval.c:1798 eval.c:1805 profile.c:833 msgid "assignment is not allowed to result of builtin function" msgstr "" ! #. \n on purpose, with \n in ctime() output ! #: profile.c:1083 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "" ! #: profile.c:1086 msgid "" "\t# BEGIN block(s)\n" "\n" msgstr "" ! #: profile.c:1096 msgid "" "\t# Rule(s)\n" "\n" msgstr "" ! #: profile.c:1102 msgid "" "\t# END block(s)\n" "\n" msgstr "" ! #: profile.c:1122 msgid "" "\n" "\t# Functions, listed alphabetically\n" msgstr "" ! #: profile.c:1325 #, c-format msgid "unexpected type %s in prec_level" msgstr "" ! #: regex.c:1017 msgid "Success" msgstr "" ! #. REG_NOERROR ! #: regex.c:1018 msgid "No match" msgstr "" ! #. REG_NOMATCH ! #: regex.c:1019 msgid "Invalid regular expression" msgstr "" ! #. REG_BADPAT ! #: regex.c:1020 msgid "Invalid collation character" msgstr "" ! #. REG_ECOLLATE ! #: regex.c:1021 msgid "Invalid character class name" msgstr "" ! #. REG_ECTYPE ! #: regex.c:1022 msgid "Trailing backslash" msgstr "" ! #. REG_EESCAPE ! #: regex.c:1023 msgid "Invalid back reference" msgstr "" ! #. REG_ESUBREG ! #: regex.c:1024 msgid "Unmatched [ or [^" msgstr "" ! #. REG_EBRACK ! #: regex.c:1025 msgid "Unmatched ( or \\(" msgstr "" ! #. REG_EPAREN ! #: regex.c:1026 msgid "Unmatched \\{" msgstr "" ! #. REG_EBRACE ! #: regex.c:1027 msgid "Invalid content of \\{\\}" msgstr "" ! #. REG_BADBR ! #: regex.c:1028 msgid "Invalid range end" msgstr "" ! #. REG_ERANGE ! #: dfa.c:167 dfa.c:178 dfa.c:189 regex.c:1029 msgid "Memory exhausted" msgstr "" ! #. REG_ESPACE ! #: regex.c:1030 msgid "Invalid preceding regular expression" msgstr "" ! #. REG_BADRPT ! #: regex.c:1031 msgid "Premature end of regular expression" msgstr "" ! #. REG_EEND ! #: regex.c:1032 msgid "Regular expression too big" msgstr "" ! #. REG_ESIZE ! #: regex.c:1033 msgid "Unmatched ) or \\)" msgstr "" ! #: regex.c:5531 msgid "No previous regular expression" msgstr "" ! #: awkgram.y:230 msgid "BEGIN blocks must have an action part" msgstr "" ! #: awkgram.y:236 msgid "END blocks must have an action part" msgstr "" ! #: awkgram.y:272 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "" ! #: awkgram.y:360 msgid "statement may have no effect" msgstr "" ! #: awkgram.y:457 ! msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" ! msgstr "" ! ! #: awkgram.y:469 msgid "`next' used in BEGIN or END action" msgstr "" ! #: awkgram.y:476 awkgram.y:483 msgid "`nextfile' is a gawk extension" msgstr "" ! #: awkgram.y:488 msgid "`nextfile' used in BEGIN or END action" msgstr "" ! #: awkgram.y:497 msgid "`return' used outside function context" msgstr "" ! #: awkgram.y:506 awkgram.y:513 msgid "`delete array' is a gawk extension" msgstr "" ! #: awkgram.y:571 msgid "multistage two-way pipelines don't work" msgstr "" ! #: awkgram.y:662 msgid "regular expression on right of assignment" msgstr "" ! #: awkgram.y:680 msgid "non-redirected `getline' undefined inside END action" msgstr "" ! #: awkgram.y:690 msgid "regular expression on left of `~' or `!~' operator" msgstr "" ! #: awkgram.y:700 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" ! #: awkgram.y:716 msgid "regular expression on right of comparison" msgstr "" ! #: awkgram.y:743 msgid "non-redirected `getline' undefined inside BEGIN or END action" msgstr "" ! #: awkgram.y:798 msgid "call of `length' without parentheses is not portable" msgstr "" ! #: awkgram.y:801 msgid "call of `length' without parentheses is deprecated by POSIX" msgstr "" ! #: awkgram.y:851 msgid "invalid subscript expression" msgstr "" ! #: awkgram.y:985 #, c-format msgid "fptr %x not in tokentab\n" msgstr "" ! #: awkgram.y:1019 msgid "unexpected newline" msgstr "" ! #: awkgram.y:1098 msgid "empty program text on command line" msgstr "" ! #: awkgram.y:1155 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "" ! #: awkgram.y:1190 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "" ! #: awkgram.y:1198 #, c-format msgid "source file `%s' is empty" msgstr "" ! #: awkgram.y:1312 awkgram.y:1417 awkgram.y:1435 awkgram.y:1778 awkgram.y:1840 msgid "source file does not end in newline" msgstr "" ! #: awkgram.y:1373 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" ! #: awkgram.y:1394 msgid "unterminated regexp" msgstr "" ! #: awkgram.y:1397 msgid "unterminated regexp at end of file" msgstr "" ! #: awkgram.y:1461 msgid "use of `\\ #...' line continuation is not portable" msgstr "" ! #: awkgram.y:1473 msgid "backslash not last character on line" msgstr "" ! #: awkgram.y:1514 msgid "POSIX does not allow operator `**='" msgstr "" ! #: awkgram.y:1516 msgid "old awk does not support operator `**='" msgstr "" ! #: awkgram.y:1525 msgid "POSIX does not allow operator `**'" msgstr "" ! #: awkgram.y:1527 msgid "old awk does not support operator `**'" msgstr "" ! #: awkgram.y:1560 msgid "operator `^=' is not supported in old awk" msgstr "" ! #: awkgram.y:1568 msgid "operator `^' is not supported in old awk" msgstr "" ! #: awkgram.y:1650 awkgram.y:1664 msgid "unterminated string" msgstr "" ! #: awkgram.y:1815 #, c-format msgid "invalid char '%c' in expression" msgstr "" ! #: awkgram.y:1861 #, c-format msgid "`%s' is a gawk extension" msgstr "" ! #: awkgram.y:1864 #, c-format msgid "`%s' is a Bell Labs extension" msgstr "" ! #: awkgram.y:1867 #, c-format msgid "POSIX does not allow `%s'" msgstr "" ! #: awkgram.y:1871 #, c-format msgid "`%s' is not supported in old awk" msgstr "" ! #: awkgram.y:1899 msgid "`goto' considered harmful!\n" msgstr "" ! #: awkgram.y:1963 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "" ! #: awkgram.y:1982 awkgram.y:1985 msgid "match: third argument is a gawk extension" msgstr "" ! #: awkgram.y:2001 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" ! #: awkgram.y:2005 msgid "sub third parameter is not a changeable object" msgstr "" ! #: awkgram.y:2007 msgid "gsub third parameter is not a changeable object" msgstr "" ! #: awkgram.y:2033 awkgram.y:2036 msgid "close: second argument is a gawk extension" msgstr "" ! #: awkgram.y:2046 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" ! #: awkgram.y:2139 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "" ! #: awkgram.y:2171 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "" ! #: awkgram.y:2280 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "" ! #: awkgram.y:2311 #, c-format msgid "%s: close failed (%s)" msgstr "" ! #: awkgram.y:2421 msgid "shadow_funcs() called twice!" msgstr "" ! #: awkgram.y:2496 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "" ! #: awkgram.y:2506 #, c-format msgid "function name `%s' previously defined" msgstr "" ! #: awkgram.y:2654 awkgram.y:2660 #, c-format msgid "function `%s' called but never defined" msgstr "" ! #: awkgram.y:2663 #, c-format msgid "function `%s' defined but never called" msgstr "" ! #: awkgram.y:2690 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" ! #: dfa.c:451 msgid "Unfinished \\ escape" msgstr "" ! #. Cases: ! #. {M} - exact count ! #. {M,} - minimum count, maximum is infinity ! #. {M,N} - M through N ! #: dfa.c:584 dfa.c:590 dfa.c:600 dfa.c:608 dfa.c:623 msgid "unfinished repeat count" msgstr "" ! #: dfa.c:597 dfa.c:614 dfa.c:622 dfa.c:626 msgid "malformed repeat count" msgstr "" ! #: dfa.c:691 dfa.c:694 dfa.c:721 dfa.c:725 dfa.c:726 dfa.c:729 dfa.c:742 ! #: dfa.c:743 ! msgid "Unbalanced [" ! msgstr "" ! ! #: dfa.c:889 msgid "Unbalanced (" msgstr "" ! #: dfa.c:1003 msgid "No regexp syntax bits specified" msgstr "" ! #: dfa.c:1011 msgid "Unbalanced )" msgstr "" ! #: dfa.c:2002 msgid "out of memory" msgstr "" ! #: field.c:787 msgid "split: second argument is not an array" msgstr "" ! #: field.c:814 msgid "split: null string for third arg is a gawk extension" msgstr "" ! #: field.c:854 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "" ! #: field.c:881 #, c-format msgid "field %d in FIELDWIDTHS, must be > 0" msgstr "" ! #: field.c:935 msgid "null string for `FS' is a gawk extension" msgstr "" --- 674,1202 ---- "\n" msgstr "" ! #: main.c:627 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" msgstr "" ! #: main.c:657 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "" ! #: main.c:888 #, c-format msgid "invalid syntax in name `%s' for variable assignment" msgstr "" ! #: main.c:957 msgid "floating point exception" msgstr "" ! #: main.c:964 msgid "fatal error: internal error" msgstr "" ! #: main.c:1014 #, c-format msgid "no pre-opened fd %d" msgstr "" ! #: main.c:1019 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "" + #: main.c:1037 main.c:1046 + #, c-format + msgid "could not find groups: %s" + msgstr "" + #: profile.c:94 #, c-format msgid "could not open `%s' for writing: %s" msgstr "" ! #: profile.c:96 awkgram.y:2465 msgid "sending profile to standard error" msgstr "" ! #: profile.c:409 msgid "internal error: Node_var with null vname" msgstr "" ! #: profile.c:524 msgid "internal error: Node_var_array with null vname" msgstr "" ! #: profile.c:554 eval.c:813 #, c-format msgid "" "function `%s' called with space between name and `(',\n" "%s" msgstr "" ! #: profile.c:556 eval.c:815 msgid "or used in other expression context" msgstr "" ! #: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "" ! #: profile.c:637 eval.c:1047 #, c-format msgid "illegal type (%s) in tree_eval" msgstr "" ! #: profile.c:842 eval.c:1790 #, c-format msgid "attempt to use function `%s' as array" msgstr "" ! #: profile.c:856 eval.c:1797 #, c-format msgid "`%s' is a function, assignment is not allowed" msgstr "" ! #: profile.c:860 eval.c:1803 eval.c:1810 msgid "assignment is not allowed to result of builtin function" msgstr "" ! #: profile.c:1108 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "" ! #: profile.c:1111 msgid "" "\t# BEGIN block(s)\n" "\n" msgstr "" ! #: profile.c:1121 msgid "" "\t# Rule(s)\n" "\n" msgstr "" ! #: profile.c:1127 msgid "" "\t# END block(s)\n" "\n" msgstr "" ! #: profile.c:1147 msgid "" "\n" "\t# Functions, listed alphabetically\n" msgstr "" ! #: profile.c:1357 #, c-format msgid "unexpected type %s in prec_level" msgstr "" ! #: regex.c:1322 msgid "Success" msgstr "" ! #: regex.c:1323 msgid "No match" msgstr "" ! #: regex.c:1324 msgid "Invalid regular expression" msgstr "" ! #: regex.c:1325 msgid "Invalid collation character" msgstr "" ! #: regex.c:1326 msgid "Invalid character class name" msgstr "" ! #: regex.c:1327 msgid "Trailing backslash" msgstr "" ! #: regex.c:1328 msgid "Invalid back reference" msgstr "" ! #: regex.c:1329 msgid "Unmatched [ or [^" msgstr "" ! #: regex.c:1330 msgid "Unmatched ( or \\(" msgstr "" ! #: regex.c:1331 msgid "Unmatched \\{" msgstr "" ! #: regex.c:1332 msgid "Invalid content of \\{\\}" msgstr "" ! #: regex.c:1333 msgid "Invalid range end" msgstr "" ! #: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204 msgid "Memory exhausted" msgstr "" ! #: regex.c:1335 msgid "Invalid preceding regular expression" msgstr "" ! #: regex.c:1336 msgid "Premature end of regular expression" msgstr "" ! #: regex.c:1337 msgid "Regular expression too big" msgstr "" ! #: regex.c:1338 msgid "Unmatched ) or \\)" msgstr "" ! #: regex.c:7365 msgid "No previous regular expression" msgstr "" ! #: awkgram.y:232 msgid "BEGIN blocks must have an action part" msgstr "" ! #: awkgram.y:238 msgid "END blocks must have an action part" msgstr "" ! #: awkgram.y:274 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "" ! #: awkgram.y:362 msgid "statement may have no effect" msgstr "" ! #: awkgram.y:455 msgid "`next' used in BEGIN or END action" msgstr "" ! #: awkgram.y:462 awkgram.y:469 msgid "`nextfile' is a gawk extension" msgstr "" ! #: awkgram.y:474 msgid "`nextfile' used in BEGIN or END action" msgstr "" ! #: awkgram.y:483 msgid "`return' used outside function context" msgstr "" ! #: awkgram.y:519 ! msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" ! msgstr "" ! ! #: awkgram.y:532 awkgram.y:539 msgid "`delete array' is a gawk extension" msgstr "" ! #: awkgram.y:604 msgid "multistage two-way pipelines don't work" msgstr "" ! #: awkgram.y:695 msgid "regular expression on right of assignment" msgstr "" ! #: awkgram.y:713 msgid "non-redirected `getline' undefined inside END action" msgstr "" ! #: awkgram.y:723 msgid "regular expression on left of `~' or `!~' operator" msgstr "" ! #: awkgram.y:733 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "" ! #: awkgram.y:749 msgid "regular expression on right of comparison" msgstr "" ! #: awkgram.y:776 msgid "non-redirected `getline' undefined inside BEGIN or END action" msgstr "" ! #: awkgram.y:831 msgid "call of `length' without parentheses is not portable" msgstr "" ! #: awkgram.y:834 msgid "call of `length' without parentheses is deprecated by POSIX" msgstr "" ! #: awkgram.y:884 msgid "invalid subscript expression" msgstr "" ! #: awkgram.y:1033 #, c-format msgid "fptr %x not in tokentab\n" msgstr "" ! #: awkgram.y:1068 msgid "unexpected newline" msgstr "" ! #: awkgram.y:1152 msgid "empty program text on command line" msgstr "" ! #: awkgram.y:1209 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "" ! #: awkgram.y:1244 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "" ! #: awkgram.y:1252 #, c-format msgid "source file `%s' is empty" msgstr "" ! #: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011 msgid "source file does not end in newline" msgstr "" ! #: awkgram.y:1518 msgid "unterminated regexp ends with `\\' at end of file" msgstr "" ! #: awkgram.y:1539 msgid "unterminated regexp" msgstr "" ! #: awkgram.y:1542 msgid "unterminated regexp at end of file" msgstr "" ! #: awkgram.y:1609 msgid "use of `\\ #...' line continuation is not portable" msgstr "" ! #: awkgram.y:1621 msgid "backslash not last character on line" msgstr "" ! #: awkgram.y:1662 msgid "POSIX does not allow operator `**='" msgstr "" ! #: awkgram.y:1664 msgid "old awk does not support operator `**='" msgstr "" ! #: awkgram.y:1673 msgid "POSIX does not allow operator `**'" msgstr "" ! #: awkgram.y:1675 msgid "old awk does not support operator `**'" msgstr "" ! #: awkgram.y:1708 msgid "operator `^=' is not supported in old awk" msgstr "" ! #: awkgram.y:1716 msgid "operator `^' is not supported in old awk" msgstr "" ! #: awkgram.y:1798 awkgram.y:1815 msgid "unterminated string" msgstr "" ! #: awkgram.y:1972 #, c-format msgid "invalid char '%c' in expression" msgstr "" ! #: awkgram.y:2032 #, c-format msgid "`%s' is a gawk extension" msgstr "" ! #: awkgram.y:2035 #, c-format msgid "`%s' is a Bell Labs extension" msgstr "" ! #: awkgram.y:2038 #, c-format msgid "POSIX does not allow `%s'" msgstr "" ! #: awkgram.y:2042 #, c-format msgid "`%s' is not supported in old awk" msgstr "" ! #: awkgram.y:2070 msgid "`goto' considered harmful!\n" msgstr "" ! #: awkgram.y:2134 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "" ! #: awkgram.y:2153 awkgram.y:2156 msgid "match: third argument is a gawk extension" msgstr "" ! #: awkgram.y:2172 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "" ! #: awkgram.y:2176 msgid "sub third parameter is not a changeable object" msgstr "" ! #: awkgram.y:2178 msgid "gsub third parameter is not a changeable object" msgstr "" ! #: awkgram.y:2204 awkgram.y:2207 msgid "close: second argument is a gawk extension" msgstr "" ! #: awkgram.y:2217 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "" ! #: awkgram.y:2232 ! msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" ! msgstr "" ! ! #: awkgram.y:2323 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "" ! #: awkgram.y:2355 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "" ! #: awkgram.y:2464 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "" ! #: awkgram.y:2495 #, c-format msgid "%s: close failed (%s)" msgstr "" ! #: awkgram.y:2605 msgid "shadow_funcs() called twice!" msgstr "" ! #: awkgram.y:2680 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "" ! #: awkgram.y:2690 #, c-format msgid "function name `%s' previously defined" msgstr "" ! #: awkgram.y:2838 awkgram.y:2844 #, c-format msgid "function `%s' called but never defined" msgstr "" ! #: awkgram.y:2847 #, c-format msgid "function `%s' defined but never called" msgstr "" ! #: awkgram.y:2874 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "" ! #: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649 ! #: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078 ! #: dfa.c:1081 dfa.c:1094 dfa.c:1095 ! msgid "Unbalanced [" ! msgstr "" ! ! #: dfa.c:783 msgid "Unfinished \\ escape" msgstr "" ! #: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955 msgid "unfinished repeat count" msgstr "" ! #: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958 msgid "malformed repeat count" msgstr "" ! #: dfa.c:1285 msgid "Unbalanced (" msgstr "" ! #: dfa.c:1407 msgid "No regexp syntax bits specified" msgstr "" ! #: dfa.c:1415 msgid "Unbalanced )" msgstr "" ! #: dfa.c:3014 msgid "out of memory" msgstr "" ! #: field.c:849 msgid "split: second argument is not an array" msgstr "" ! #: field.c:876 msgid "split: null string for third arg is a gawk extension" msgstr "" ! #: field.c:916 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "" ! #: field.c:943 #, c-format msgid "field %d in FIELDWIDTHS, must be > 0" msgstr "" ! #: field.c:997 msgid "null string for `FS' is a gawk extension" msgstr "" *************** *** 1224,1386 **** msgid "fatal: " msgstr "" ! #: eval.c:258 #, c-format msgid "unknown nodetype %d" msgstr "" ! #: eval.c:306 msgid "buffer overflow in genflags2str" msgstr "" ! #: eval.c:545 #, c-format msgid "for loop: array `%s' changed size from %d to %d during loop execution" msgstr "" ! #: eval.c:569 msgid "`break' outside a loop is not portable" msgstr "" ! #: eval.c:573 msgid "`break' outside a loop is not allowed" msgstr "" ! #: eval.c:592 msgid "`continue' outside a loop is not portable" msgstr "" ! #: eval.c:596 msgid "`continue' outside a loop is not allowed" msgstr "" ! #: eval.c:626 msgid "`next' cannot be called from a BEGIN rule" msgstr "" ! #: eval.c:628 msgid "`next' cannot be called from an END rule" msgstr "" ! #: eval.c:640 msgid "`nextfile' cannot be called from a BEGIN rule" msgstr "" ! #: eval.c:642 msgid "`nextfile' cannot be called from an END rule" msgstr "" ! #: eval.c:683 msgid "statement has no effect" msgstr "" ! #: eval.c:717 eval.c:747 eval.c:1617 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "" ! #: eval.c:725 eval.c:1603 #, c-format msgid "can't use function name `%s' as variable or array" msgstr "" ! #: eval.c:732 eval.c:738 eval.c:1742 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "" ! #: eval.c:826 msgid "assignment used in conditional context" msgstr "" ! #: eval.c:917 msgid "" "concatenation: side effects in one expression have changed the length of " "another!" msgstr "" ! #: eval.c:1012 msgid "division by zero attempted" msgstr "" ! #: eval.c:1027 msgid "division by zero attempted in `%%'" msgstr "" ! #: eval.c:1228 msgid "division by zero attempted in `/='" msgstr "" ! #: eval.c:1246 msgid "division by zero attempted in `%%='" msgstr "" ! #: eval.c:1419 #, c-format msgid "%s (from %s)" msgstr "" ! #: eval.c:1467 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "" ! #: eval.c:1514 #, c-format msgid "function `%s' not defined" msgstr "" ! #: eval.c:1516 #, c-format msgid "function %s called\n" msgstr "" ! #: eval.c:1575 msgid "" "\n" "\t# Function Call Stack:\n" "\n" msgstr "" ! #: eval.c:1578 msgid "\t# -- main --\n" msgstr "" ! #: eval.c:1754 msgid "attempt to field reference from non-numeric value" msgstr "" ! #: eval.c:1756 msgid "attempt to reference from null string" msgstr "" ! #: eval.c:1762 #, c-format msgid "attempt to access field %d" msgstr "" ! #: eval.c:1778 #, c-format msgid "attempt to use scalar parameter `%s' as an array" msgstr "" ! #: eval.c:1869 msgid "`IGNORECASE' is a gawk extension" msgstr "" ! #: eval.c:1897 msgid "`BINMODE' is a gawk extension" msgstr "" ! #: eval.c:2009 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "" ! #: eval.c:2075 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "" #: io.c:240 #, c-format msgid "cannot open file `%s' for reading (%s)" --- 1216,1384 ---- msgid "fatal: " msgstr "" ! #: eval.c:259 #, c-format msgid "unknown nodetype %d" msgstr "" ! #: eval.c:307 msgid "buffer overflow in genflags2str" msgstr "" ! #: eval.c:541 #, c-format msgid "for loop: array `%s' changed size from %d to %d during loop execution" msgstr "" ! #: eval.c:565 msgid "`break' outside a loop is not portable" msgstr "" ! #: eval.c:569 msgid "`break' outside a loop is not allowed" msgstr "" ! #: eval.c:588 msgid "`continue' outside a loop is not portable" msgstr "" ! #: eval.c:592 msgid "`continue' outside a loop is not allowed" msgstr "" ! #: eval.c:622 msgid "`next' cannot be called from a BEGIN rule" msgstr "" ! #: eval.c:624 msgid "`next' cannot be called from an END rule" msgstr "" ! #: eval.c:636 msgid "`nextfile' cannot be called from a BEGIN rule" msgstr "" ! #: eval.c:638 msgid "`nextfile' cannot be called from an END rule" msgstr "" ! #: eval.c:679 msgid "statement has no effect" msgstr "" ! #: eval.c:713 eval.c:743 eval.c:1622 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "" ! #: eval.c:721 eval.c:1608 #, c-format msgid "can't use function name `%s' as variable or array" msgstr "" ! #: eval.c:728 eval.c:734 eval.c:1747 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "" ! #: eval.c:823 msgid "assignment used in conditional context" msgstr "" ! #: eval.c:914 msgid "" "concatenation: side effects in one expression have changed the length of " "another!" msgstr "" ! #: eval.c:1013 msgid "division by zero attempted" msgstr "" ! #: eval.c:1028 ! #, c-format msgid "division by zero attempted in `%%'" msgstr "" ! #: eval.c:1236 msgid "division by zero attempted in `/='" msgstr "" ! #: eval.c:1254 ! #, c-format msgid "division by zero attempted in `%%='" msgstr "" ! #: eval.c:1424 #, c-format msgid "%s (from %s)" msgstr "" ! #: eval.c:1472 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "" ! #: eval.c:1519 #, c-format msgid "function `%s' not defined" msgstr "" ! #: eval.c:1521 #, c-format msgid "function %s called\n" msgstr "" ! #: eval.c:1580 msgid "" "\n" "\t# Function Call Stack:\n" "\n" msgstr "" ! #: eval.c:1583 msgid "\t# -- main --\n" msgstr "" ! #: eval.c:1759 msgid "attempt to field reference from non-numeric value" msgstr "" ! #: eval.c:1761 msgid "attempt to reference from null string" msgstr "" ! #: eval.c:1767 #, c-format msgid "attempt to access field %d" msgstr "" ! #: eval.c:1783 #, c-format msgid "attempt to use scalar parameter `%s' as an array" msgstr "" ! #: eval.c:1874 msgid "`IGNORECASE' is a gawk extension" msgstr "" ! #: eval.c:1902 msgid "`BINMODE' is a gawk extension" msgstr "" ! #: eval.c:2014 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "" ! #: eval.c:2080 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "" + #: eval.c:2116 + msgid "NF set to negative value" + msgstr "" + #: io.c:240 #, c-format msgid "cannot open file `%s' for reading (%s)" *************** *** 1451,1463 **** "reached system limit for open files: starting to multiplex file descriptors" msgstr "" - #. do_lint && #: io.c:679 #, c-format msgid "close of `%s' failed (%s)." msgstr "" - #. surely this is the only reason ??? #: io.c:686 msgid "too many pipes or input files open" msgstr "" --- 1449,1459 ---- *************** *** 1471,1477 **** msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "" - #. update ERRNO manually, using errno = ENOENT is a stretch. #: io.c:727 msgid "close of redirection that was never opened" msgstr "" --- 1467,1472 ---- *************** *** 1536,1542 **** msgid "file flush of `%s' failed (%s)." msgstr "" - #. /inet/raw client not ready yet #: io.c:1048 msgid "/inet/raw client not ready yet, sorry" msgstr "" --- 1531,1536 ---- *************** *** 1545,1551 **** msgid "only root may use `/inet/raw'." msgstr "" - #. /inet/raw server not ready yet #: io.c:1085 msgid "/inet/raw server not ready yet, sorry" msgstr "" --- 1539,1544 ---- *************** *** 1582,1588 **** msgid "TCP/IP communications are not supported" msgstr "" ! #: io.c:1257 io.c:1446 #, c-format msgid "file `%s' is a directory" msgstr "" --- 1575,1581 ---- msgid "TCP/IP communications are not supported" msgstr "" ! #: io.c:1257 io.c:1438 #, c-format msgid "file `%s' is a directory" msgstr "" *************** *** 1592,1671 **** msgid "use `PROCINFO[\"%s\"]' instead of `%s'" msgstr "" ! #: io.c:1363 msgid "use `PROCINFO[...]' instead of `/dev/user'" msgstr "" ! #: io.c:1432 #, c-format msgid "could not open `%s', mode `%s'" msgstr "" ! #: io.c:1544 io.c:1665 #, c-format ! msgid "close of stdout in child failed (%s)" msgstr "" ! #: io.c:1547 io.c:1668 #, c-format ! msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" ! #: io.c:1549 ! #, c-format ! msgid "close of stdin in child failed (%s)" msgstr "" ! #: io.c:1552 ! #, c-format ! msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" ! #: io.c:1555 io.c:1670 io.c:1678 #, c-format ! msgid "close of pipe failed (%s)" msgstr "" ! #: io.c:1584 #, c-format ! msgid "pipe from `%s': could not set close-on-exec (fcntl: %s)" msgstr "" ! #: io.c:1588 #, c-format ! msgid "pipe to `%s': could not set close-on-exec (fcntl: %s)" msgstr "" ! #: io.c:1598 msgid "`|&' not supported" msgstr "" ! #: io.c:1662 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "" ! #: io.c:1675 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "" ! #: io.c:2004 #, c-format msgid "data file `%s' is empty" msgstr "" ! #: io.c:2071 #, c-format msgid "internal error: file `%s', line %d\n" msgstr "" ! #: io.c:2173 #, c-format msgid "error reading input file `%s': %s" msgstr "" ! #: io.c:2392 msgid "multicharacter value of `RS' is a gawk extension" msgstr "" --- 1585,1662 ---- msgid "use `PROCINFO[\"%s\"]' instead of `%s'" msgstr "" ! #: io.c:1359 msgid "use `PROCINFO[...]' instead of `/dev/user'" msgstr "" ! #: io.c:1424 #, c-format msgid "could not open `%s', mode `%s'" msgstr "" ! #: io.c:1550 io.c:1602 io.c:1732 io.c:1754 #, c-format ! msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "" ! #: io.c:1554 io.c:1607 #, c-format ! msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "" ! #: io.c:1571 io.c:1745 ! msgid "restoring stdout in parent process failed\n" msgstr "" ! #: io.c:1576 ! msgid "restoring stdin in parent process failed\n" msgstr "" ! #: io.c:1599 io.c:1751 #, c-format ! msgid "close of stdout in child failed (%s)" msgstr "" ! #: io.c:1604 #, c-format ! msgid "close of stdin in child failed (%s)" msgstr "" ! #: io.c:1610 io.c:1756 io.c:1767 #, c-format ! msgid "close of pipe failed (%s)" msgstr "" ! #: io.c:1655 msgid "`|&' not supported" msgstr "" ! #: io.c:1722 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "" ! #: io.c:1763 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "" ! #: io.c:2104 #, c-format msgid "data file `%s' is empty" msgstr "" ! #: io.c:2175 #, c-format msgid "internal error: file `%s', line %d\n" msgstr "" ! #: io.c:2277 #, c-format msgid "error reading input file `%s': %s" msgstr "" ! #: io.c:2521 msgid "multicharacter value of `RS' is a gawk extension" msgstr "" *************** *** 1690,1696 **** msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "" #: posix/gawkmisc.c:122 #, c-format ! msgid "%s %s `%s': could not set close-on-exec: %s" msgstr "" --- 1681,1692 ---- msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "" + #: re.c:208 + #, c-format + msgid "regex match failed, not enough memory to match string \"%.*s%s\"" + msgstr "" + #: posix/gawkmisc.c:122 #, c-format ! msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)" msgstr "" diff -crN gawk-3.1.0/po/he.po gawk-3.1.1/po/he.po *** gawk-3.1.0/po/he.po Sun Jun 3 12:42:57 2001 --- gawk-3.1.1/po/he.po Wed May 1 16:40:59 2002 *************** *** 1,73 **** # Hebrew messages for GNU Awk -*- coding: hebrew-iso-8bit -*- # Copyright (C) 2001 Free Software Foundation, Inc. ! # Eli Zaretskii , 2001. # msgid "" msgstr "" ! "Project-Id-Version: gawk 3.0.97\n" ! "POT-Creation-Date: 2001-05-15 19:48+0300\n" ! "PO-Revision-Date: 2001-05-19 12:36:42 IDT\n" "Last-Translator: Eli Zaretskii \n" "Language-Team: Hebrew \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-8\n" "Content-Transfer-Encoding: 8-bit\n" ! #: array.c:243 array.c:278 eval.c:483 #, c-format msgid "attempt to use scalar `%s' as array" msgstr "êøòîë `%s' øàì÷ñá éåâù ùåîéù" ! #: array.c:302 #, c-format msgid "reference to uninitialized element `%s[\"%s\"]'" msgstr "ìçåúî åðéàù `%s[\"%s\"]' èðîìàì äééðô" ! #: array.c:308 #, c-format msgid "subscript of array `%s' is null string" msgstr "`%s' êøòî ïééöîë ä÷éø úæåøçîá ùåîéù" ! #: array.c:371 array.c:454 #, c-format msgid "delete: illegal use of variable `%s' as array" msgstr "êøòîë `%s' äðúùîá éåâù ùåîéù :delete" ! #: array.c:404 #, c-format msgid "delete: index `%s' not in array `%s'" msgstr "`%s' ïééöî ìéëî åðéà `%s' êøòî :delete" ! #: array.c:569 #, c-format msgid "%s: empty (null)\n" msgstr "%s: (ñôåàî) ÷éø\n" ! #: array.c:574 #, c-format msgid "%s: empty (zero)\n" msgstr "%s: (ä÷éø hash úìáè) ÷éø\n" ! #: array.c:578 #, c-format msgid "%s: table_size = %d, array_size = %d\n" ! msgstr "" ! #: array.c:610 #, c-format ! msgid "%s: is paramater\n" msgstr "øèîøô åðéä %s\n" ! #: array.c:615 #, c-format msgid "%s: array_ref to %s\n" msgstr "%s: %s-ì (array_ref) äéðôä\n" ! #: array.c:842 msgid "asort: first argument is not an array" msgstr "êøòî åðéà ïåùàø èðîåâøà :asort" ! #: array.c:851 msgid "asort: second argument is not an array" msgstr "êøòî åðéà éðù èðîåâøà :asort" --- 1,73 ---- # Hebrew messages for GNU Awk -*- coding: hebrew-iso-8bit -*- # Copyright (C) 2001 Free Software Foundation, Inc. ! # Eli Zaretskii , 2001, 2002. # msgid "" msgstr "" ! "Project-Id-Version: gawk 3.1.1a\n" ! "POT-Creation-Date: 2002-05-01 16:40+0300\n" ! "PO-Revision-Date: 2002-04-28 21:46+0300\n" "Last-Translator: Eli Zaretskii \n" "Language-Team: Hebrew \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-8\n" "Content-Transfer-Encoding: 8-bit\n" ! #: array.c:243 array.c:275 array.c:280 eval.c:483 #, c-format msgid "attempt to use scalar `%s' as array" msgstr "êøòîë `%s' øàì÷ñá éåâù ùåîéù" ! #: array.c:304 #, c-format msgid "reference to uninitialized element `%s[\"%s\"]'" msgstr "ìçåúî åðéàù `%s[\"%s\"]' èðîìàì äééðô" ! #: array.c:310 #, c-format msgid "subscript of array `%s' is null string" msgstr "`%s' êøòî ïééöîë ä÷éø úæåøçîá ùåîéù" ! #: array.c:373 array.c:456 #, c-format msgid "delete: illegal use of variable `%s' as array" msgstr "êøòîë `%s' äðúùîá éåâù ùåîéù :delete" ! #: array.c:406 #, c-format msgid "delete: index `%s' not in array `%s'" msgstr "`%s' ïééöî ìéëî åðéà `%s' êøòî :delete" ! #: array.c:571 #, c-format msgid "%s: empty (null)\n" msgstr "%s: (ñôåàî) ÷éø\n" ! #: array.c:576 #, c-format msgid "%s: empty (zero)\n" msgstr "%s: (ä÷éø hash úìáè) ÷éø\n" ! #: array.c:580 #, c-format msgid "%s: table_size = %d, array_size = %d\n" ! msgstr "%s: table_size = %d, array_size = %d\n" ! #: array.c:612 #, c-format ! msgid "%s: is parameter\n" msgstr "øèîøô åðéä %s\n" ! #: array.c:617 #, c-format msgid "%s: array_ref to %s\n" msgstr "%s: %s-ì (array_ref) äéðôä\n" ! #: array.c:844 msgid "asort: first argument is not an array" msgstr "êøòî åðéà ïåùàø èðîåâøà :asort" ! #: array.c:853 msgid "asort: second argument is not an array" msgstr "êøòî åðéà éðù èðîåâøà :asort" *************** *** 108,400 **** msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "ìéá÷î êéìäú åà çåúô ÷éôà ,çåúô õáå÷ åðéà `%s' :fflush" ! #: builtin.c:222 msgid "index: received non-string first argument" msgstr "úæåøçî åðéà ïåùàø èðîåâøà :index" ! #: builtin.c:224 msgid "index: received non-string second argument" msgstr "úæåøçî åðéà éðù èðîåâøà :index" ! #: builtin.c:287 msgid "int: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :int" ! #: builtin.c:304 msgid "length: received non-string argument" msgstr "úæåøçî åðéà èðîåâøà :length" ! #: builtin.c:320 msgid "log: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :log" ! #: builtin.c:323 #, c-format msgid "log: received negative argument %g" msgstr "%g éìéìù èðîåâøà íò àø÷ð :log" ! #: builtin.c:583 msgid "`$' is not permitted in awk formats" msgstr "awk ìù íéèîøåôá ùåîéùì øåñà `$'" ! #: builtin.c:589 msgid "arg count with `$' must be > 0" msgstr "0-î ìåãâ úåéäì áééç `$' ãéì èðîåâøàä äðåî" ! #: builtin.c:591 #, c-format msgid "arg count %d greater than total number of supplied arguments" msgstr "íéèðîåâøàä ìù ììåëä íøôñîî ìåãâ %d èðîåâøàä äðåî" ! #: builtin.c:593 msgid "`$' not permitted after period in format" msgstr "èîøåôá äãå÷ðä éøçà òéôåäì ìåëé åðéà `$'" ! #: builtin.c:606 msgid "no `$' supplied for positional field width or precision" msgstr "å÷åéã åà äãù áçåø ïééöîá èðîåâøàä äðåî øåáò `$' àöîð àì" ! #: builtin.c:664 msgid "`l' is meaningless in awk formats; ignored" msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `l'" ! #: builtin.c:668 msgid "`l' is not permitted in POSIX awk formats" msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `l'" ! #: builtin.c:679 msgid "`L' is meaningless in awk formats; ignored" msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `L'" ! #: builtin.c:683 msgid "`L' is not permitted in POSIX awk formats" msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `L'" ! #: builtin.c:694 msgid "`h' is meaningless in awk formats; ignored" msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `h'" ! #: builtin.c:698 msgid "`h' is not permitted in POSIX awk formats" msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `h'" ! #: builtin.c:947 msgid "not enough arguments to satisfy format string" msgstr "èîøåôä øåáò íéèðîåâøà ÷éôñî ïéà" ! #: builtin.c:949 msgid "^ ran out for this one" msgstr "^ íéèðîåâøàä éì åøîâð ïàë" ! #: builtin.c:954 msgid "[s]printf: format specifier does not have control letter" msgstr "äøîää úø÷á úåà ìéëî åðéà èîøåôä :[s]printf" ! #: builtin.c:957 msgid "too many arguments supplied for format string" msgstr "èîøåôä øåáò íéèðîåâøà éãî øúåé" ! #: builtin.c:1000 builtin.c:1003 msgid "printf: no arguments" msgstr "èðîåâøà óà ïéà :printf" ! #: builtin.c:1036 msgid "sqrt: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :sqrt" ! #: builtin.c:1040 #, c-format msgid "sqrt: called with negative argument %g" msgstr "%g éìéìù èðîåâøà íò àø÷ð :sqrt" ! #: builtin.c:1062 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "1-á óìçåä ,éåâù åðéä %g äìçúä ïééöî :substr" ! #: builtin.c:1067 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "õöå÷é ,íìù øôñî åðéàù, %g äìçúä ïééöî ìù åëøò :substr" ! #: builtin.c:1081 #, c-format msgid "substr: length %g is <= 0" msgstr "0-î ìåãâ øôñî åððéà %g êøåà :substr" ! #: builtin.c:1087 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "õöå÷é ,íìù øôñî åðéàù ,%g êøåà :substr" ! #: builtin.c:1094 msgid "substr: source string is zero length" msgstr "ñôà êøåàá äðéä øå÷îä úæåøçî :substr" ! #: builtin.c:1101 #, c-format msgid "" "substr: length %d at start index %d exceeds length of first argument (%d)" msgstr "" "%d äëøåàå %d ïééöîá äúìéçúù úæåøçî-úúì ÷éôñî åðéà (%d) úæåøçî êøåà :substr" ! #: builtin.c:1107 #, c-format msgid "substr: start index %d is past end of string" msgstr "úæåøçîä óåñì øáòî åðéä %d äìçúä ïééöî :substr" ! #: builtin.c:1143 ! msgid "strftime: recieved non-string first argument" msgstr "úæåøçî åðéà ïåùàø èðîåâøà :strftime" ! #: builtin.c:1149 msgid "strftime: received empty format string" msgstr "ä÷éø èîøåô úæåøçî :strftime" ! #: builtin.c:1158 ! msgid "strftime: recieved non-numeric second argument" msgstr "øôñî åðéà éðù èðîåâøà :strftime" ! #: builtin.c:1221 msgid "mktime: received non-string argument" msgstr "úæåøçî åðéà èðîåâøà :mktime" ! #: builtin.c:1266 ! msgid "system: recieved non-string argument" msgstr "úæåøçî åðéà èðîåâøà :system" ! #: builtin.c:1386 ! msgid "tolower: recieved non-string argument" msgstr "úæåøçî åðéà èðîåâøà :tolower" ! #: builtin.c:1407 ! msgid "toupper: recieved non-string argument" msgstr "úæåøçî åðéà èðîåâøà :toupper" ! #: builtin.c:1430 msgid "atan2: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :atan2" ! #: builtin.c:1432 msgid "atan2: received non-numeric second argument" msgstr "øôñî åðéà éðù èðîåâøà :atan2" ! #: builtin.c:1451 msgid "sin: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :sin" ! #: builtin.c:1467 msgid "cos: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :cos" ! #: builtin.c:1511 msgid "srand: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :srand" ! #: builtin.c:1545 msgid "match: third argument is not an array" msgstr "êøòî åðéà éùéìù èðîåâøà :match" ! #: builtin.c:1942 msgid "gensub: 3rd argument of 0 treated as 1" msgstr "1-á óìçåä 0 åëøòù éùéìù èðîåâøà :gensub" ! #: builtin.c:2053 builtin.c:2055 msgid "lshift: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :lshift" ! #: builtin.c:2057 #, c-format msgid "lshift(%lf, %lf): negative values will give strange results" msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :lshift(%lf, %lf)" ! #: builtin.c:2059 #, c-format msgid "lshift(%lf, %lf): fractional values will be truncated" msgstr "åööå÷é íéøåáù íéëøò :lshift(%lf, %lf)" ! #: builtin.c:2061 #, c-format msgid "lshift(%lf, %lf): too large shift value will give strange results" msgstr "úåéåôö-éúìá úåàöåú áéðé éãî ìåãâ äææä øåòéù :lshift(%lf, %lf)" ! #: builtin.c:2090 builtin.c:2092 msgid "rshift: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :rshift" ! #: builtin.c:2094 #, c-format msgid "rshift(%lf, %lf): negative values will give strange results" msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :rshift(%lf, %lf)" ! #: builtin.c:2096 #, c-format msgid "rshift(%lf, %lf): fractional values will be truncated" msgstr "åööå÷é íéøåáù íéëøò :rshift(%lf, %lf)" ! #: builtin.c:2098 #, c-format msgid "rshift(%lf, %lf): too large shift value will give strange results" msgstr "úåéåôö-éúìá úåàöåú áéðé éãî ìåãâ äææä øåòéù :rshift(%lf, %lf)" ! #: builtin.c:2127 builtin.c:2129 msgid "and: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :and" ! #: builtin.c:2131 #, c-format msgid "and(%lf, %lf): negative values will give strange results" msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :and(%lf, %lf)" ! #: builtin.c:2133 #, c-format msgid "and(%lf, %lf): fractional values will be truncated" msgstr "åööå÷é íéøåáù íéëøò :and(%lf, %lf)" ! #: builtin.c:2162 builtin.c:2164 msgid "or: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :or" ! #: builtin.c:2166 #, c-format msgid "or(%lf, %lf): negative values will give strange results" msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :or(%lf, %lf)" ! #: builtin.c:2168 #, c-format msgid "or(%lf, %lf): fractional values will be truncated" msgstr "åööå÷é íéøåáù íéëøò :or(%lf, %lf)" ! #: builtin.c:2197 builtin.c:2199 msgid "xor: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :xor" ! #: builtin.c:2201 #, c-format msgid "xor(%lf, %lf): negative values will give strange results" msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :xor(%lf, %lf)" ! #: builtin.c:2203 #, c-format msgid "xor(%lf, %lf): fractional values will be truncated" msgstr "åööå÷é íéøåáù íéëøò :xor(%lf, %lf)" ! #: builtin.c:2231 msgid "compl: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :compl" ! #: builtin.c:2233 #, c-format msgid "compl(%lf): negative value will give strange results" msgstr "úåéåôö-éúìá úåàöåú áéðé éìéìù êøò :compl(%lf)" ! #: builtin.c:2235 #, c-format msgid "compl(%lf): fractional value will be truncated" msgstr "õöå÷é øåáù êøò :compl(%lf)" ! #. not there ! #: builtin.c:2429 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "äðé÷ú íå÷éî úééøåâè÷ åðéà `%s' :dcgettext" --- 108,403 ---- msgid "fflush: `%s' is not an open file, pipe or co-process" msgstr "ìéá÷î êéìäú åà çåúô ÷éôà ,çåúô õáå÷ åðéà `%s' :fflush" ! #: builtin.c:295 msgid "index: received non-string first argument" msgstr "úæåøçî åðéà ïåùàø èðîåâøà :index" ! #: builtin.c:297 msgid "index: received non-string second argument" msgstr "úæåøçî åðéà éðù èðîåâøà :index" ! #: builtin.c:407 msgid "int: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :int" ! #: builtin.c:424 msgid "length: received non-string argument" msgstr "úæåøçî åðéà èðîåâøà :length" ! #: builtin.c:440 msgid "log: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :log" ! #: builtin.c:443 #, c-format msgid "log: received negative argument %g" msgstr "%g éìéìù èðîåâøà íò àø÷ð :log" ! #: builtin.c:605 builtin.c:608 ! msgid "must use `count$' on all formats or none" ! msgstr "ãçà óàá åà íéèîøåôä ìëá åà øúåî `count$'-á ùåîéù" ! ! #: builtin.c:703 msgid "`$' is not permitted in awk formats" msgstr "awk ìù íéèîøåôá ùåîéùì øåñà `$'" ! #: builtin.c:709 msgid "arg count with `$' must be > 0" msgstr "0-î ìåãâ úåéäì áééç `$' ãéì èðîåâøàä äðåî" ! #: builtin.c:711 #, c-format msgid "arg count %d greater than total number of supplied arguments" msgstr "íéèðîåâøàä ìù ììåëä íøôñîî ìåãâ %d èðîåâøàä äðåî" ! #: builtin.c:713 msgid "`$' not permitted after period in format" msgstr "èîøåôá äãå÷ðä éøçà òéôåäì ìåëé åðéà `$'" ! #: builtin.c:726 msgid "no `$' supplied for positional field width or precision" msgstr "å÷åéã åà äãù áçåø ïééöîá èðîåâøàä äðåî øåáò `$' àöîð àì" ! #: builtin.c:784 msgid "`l' is meaningless in awk formats; ignored" msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `l'" ! #: builtin.c:788 msgid "`l' is not permitted in POSIX awk formats" msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `l'" ! #: builtin.c:799 msgid "`L' is meaningless in awk formats; ignored" msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `L'" ! #: builtin.c:803 msgid "`L' is not permitted in POSIX awk formats" msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `L'" ! #: builtin.c:814 msgid "`h' is meaningless in awk formats; ignored" msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `h'" ! #: builtin.c:818 msgid "`h' is not permitted in POSIX awk formats" msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `h'" ! #: builtin.c:1067 msgid "not enough arguments to satisfy format string" msgstr "èîøåôä øåáò íéèðîåâøà ÷éôñî ïéà" ! #: builtin.c:1069 msgid "^ ran out for this one" msgstr "^ íéèðîåâøàä éì åøîâð ïàë" ! #: builtin.c:1074 msgid "[s]printf: format specifier does not have control letter" msgstr "äøîää úø÷á úåà ìéëî åðéà èîøåôä :[s]printf" ! #: builtin.c:1077 msgid "too many arguments supplied for format string" msgstr "èîøåôä øåáò íéèðîåâøà éãî øúåé" ! #: builtin.c:1120 builtin.c:1123 msgid "printf: no arguments" msgstr "èðîåâøà óà ïéà :printf" ! #: builtin.c:1156 msgid "sqrt: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :sqrt" ! #: builtin.c:1160 #, c-format msgid "sqrt: called with negative argument %g" msgstr "%g éìéìù èðîåâøà íò àø÷ð :sqrt" ! #: builtin.c:1182 #, c-format msgid "substr: start index %g is invalid, using 1" msgstr "1-á óìçåä ,éåâù åðéä %g äìçúä ïééöî :substr" ! #: builtin.c:1187 #, c-format msgid "substr: non-integer start index %g will be truncated" msgstr "õöå÷é ,íìù øôñî åðéàù, %g äìçúä ïééöî ìù åëøò :substr" ! #: builtin.c:1201 #, c-format msgid "substr: length %g is <= 0" msgstr "0-î ìåãâ øôñî åððéà %g êøåà :substr" ! #: builtin.c:1207 #, c-format msgid "substr: non-integer length %g will be truncated" msgstr "õöå÷é ,íìù øôñî åðéàù ,%g êøåà :substr" ! #: builtin.c:1214 msgid "substr: source string is zero length" msgstr "ñôà êøåàá äðéä øå÷îä úæåøçî :substr" ! #: builtin.c:1221 #, c-format msgid "" "substr: length %d at start index %d exceeds length of first argument (%d)" msgstr "" "%d äëøåàå %d ïééöîá äúìéçúù úæåøçî-úúì ÷éôñî åðéà (%d) úæåøçî êøåà :substr" ! #: builtin.c:1227 #, c-format msgid "substr: start index %d is past end of string" msgstr "úæåøçîä óåñì øáòî åðéä %d äìçúä ïééöî :substr" ! #: builtin.c:1263 ! msgid "strftime: received non-string first argument" msgstr "úæåøçî åðéà ïåùàø èðîåâøà :strftime" ! #: builtin.c:1269 msgid "strftime: received empty format string" msgstr "ä÷éø èîøåô úæåøçî :strftime" ! #: builtin.c:1278 ! msgid "strftime: received non-numeric second argument" msgstr "øôñî åðéà éðù èðîåâøà :strftime" ! #: builtin.c:1341 msgid "mktime: received non-string argument" msgstr "úæåøçî åðéà èðîåâøà :mktime" ! #: builtin.c:1386 ! msgid "system: received non-string argument" msgstr "úæåøçî åðéà èðîåâøà :system" ! #: builtin.c:1512 ! msgid "tolower: received non-string argument" msgstr "úæåøçî åðéà èðîåâøà :tolower" ! #: builtin.c:1561 ! msgid "toupper: received non-string argument" msgstr "úæåøçî åðéà èðîåâøà :toupper" ! #: builtin.c:1606 msgid "atan2: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :atan2" ! #: builtin.c:1608 msgid "atan2: received non-numeric second argument" msgstr "øôñî åðéà éðù èðîåâøà :atan2" ! #: builtin.c:1627 msgid "sin: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :sin" ! #: builtin.c:1643 msgid "cos: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :cos" ! #: builtin.c:1687 msgid "srand: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :srand" ! #: builtin.c:1721 msgid "match: third argument is not an array" msgstr "êøòî åðéà éùéìù èðîåâøà :match" ! #: builtin.c:2157 msgid "gensub: 3rd argument of 0 treated as 1" msgstr "1-á óìçåä 0 åëøòù éùéìù èðîåâøà :gensub" ! #: builtin.c:2268 builtin.c:2270 msgid "lshift: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :lshift" ! #: builtin.c:2272 #, c-format msgid "lshift(%lf, %lf): negative values will give strange results" msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :lshift(%lf, %lf)" ! #: builtin.c:2274 #, c-format msgid "lshift(%lf, %lf): fractional values will be truncated" msgstr "åööå÷é íéøåáù íéëøò :lshift(%lf, %lf)" ! #: builtin.c:2276 #, c-format msgid "lshift(%lf, %lf): too large shift value will give strange results" msgstr "úåéåôö-éúìá úåàöåú áéðé éãî ìåãâ äææä øåòéù :lshift(%lf, %lf)" ! #: builtin.c:2305 builtin.c:2307 msgid "rshift: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :rshift" ! #: builtin.c:2309 #, c-format msgid "rshift(%lf, %lf): negative values will give strange results" msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :rshift(%lf, %lf)" ! #: builtin.c:2311 #, c-format msgid "rshift(%lf, %lf): fractional values will be truncated" msgstr "åööå÷é íéøåáù íéëøò :rshift(%lf, %lf)" ! #: builtin.c:2313 #, c-format msgid "rshift(%lf, %lf): too large shift value will give strange results" msgstr "úåéåôö-éúìá úåàöåú áéðé éãî ìåãâ äææä øåòéù :rshift(%lf, %lf)" ! #: builtin.c:2342 builtin.c:2344 msgid "and: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :and" ! #: builtin.c:2346 #, c-format msgid "and(%lf, %lf): negative values will give strange results" msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :and(%lf, %lf)" ! #: builtin.c:2348 #, c-format msgid "and(%lf, %lf): fractional values will be truncated" msgstr "åööå÷é íéøåáù íéëøò :and(%lf, %lf)" ! #: builtin.c:2377 builtin.c:2379 msgid "or: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :or" ! #: builtin.c:2381 #, c-format msgid "or(%lf, %lf): negative values will give strange results" msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :or(%lf, %lf)" ! #: builtin.c:2383 #, c-format msgid "or(%lf, %lf): fractional values will be truncated" msgstr "åööå÷é íéøåáù íéëøò :or(%lf, %lf)" ! #: builtin.c:2412 builtin.c:2414 msgid "xor: received non-numeric first argument" msgstr "øôñî åðéà ïåùàø èðîåâøà :xor" ! #: builtin.c:2416 #, c-format msgid "xor(%lf, %lf): negative values will give strange results" msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :xor(%lf, %lf)" ! #: builtin.c:2418 #, c-format msgid "xor(%lf, %lf): fractional values will be truncated" msgstr "åööå÷é íéøåáù íéëøò :xor(%lf, %lf)" ! #: builtin.c:2446 msgid "compl: received non-numeric argument" msgstr "øôñî åðéà èðîåâøà :compl" ! #: builtin.c:2448 #, c-format msgid "compl(%lf): negative value will give strange results" msgstr "úåéåôö-éúìá úåàöåú áéðé éìéìù êøò :compl(%lf)" ! #: builtin.c:2450 #, c-format msgid "compl(%lf): fractional value will be truncated" msgstr "õöå÷é øåáù êøò :compl(%lf)" ! #: builtin.c:2621 #, c-format msgid "dcgettext: `%s' is not a valid locale category" msgstr "äðé÷ú íå÷éî úééøåâè÷ åðéà `%s' :dcgettext" *************** *** 419,662 **** # The way the leading "%s:" is translated is a terrible kludge, # but what can I do? FIXME. ! #: getopt.c:688 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s úéðëú øåáò éòîùî-ãç åðéà `%s' ïééôàî\n" ! #: getopt.c:713 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s úéðëú øåáò èðîåâøà ìá÷î åðéà `--%s' ïééôàî\n" ! #: getopt.c:718 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s úéðëú øåáò èðîåâøà ìá÷î åðéà `%c%s' ïééôàî\n" ! #: getopt.c:736 getopt.c:909 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s úéðëú øåáò èðîåâøà áééçî `%s' ïééôàî\n" ! #. --option ! #: getopt.c:765 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s úéðëú øåáò `--%s' ääåæî-éúìá ïééôàî\n" ! #. +option or -option ! #: getopt.c:769 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s úéðëú øåáò `%c%s' ääåæî-éúìá ïééôàî\n" # "Illegal" is against GNU coding standards, but since Posix requires # it (see the comment below), let's say that in Hebrew as well... ! #. 1003.2 specifies the format of this message. ! #: getopt.c:795 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: é÷åç-éúìá ïééôàî -- %c\n" ! #: getopt.c:798 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s úéðëú øåáò éåâù ïééôàî -- %c\n" ! #. 1003.2 specifies the format of this message. ! #: getopt.c:828 getopt.c:958 main.c:397 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: èðîåâøà áééçî ïééôàî -- %c\n" ! #: getopt.c:875 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s úéðëú øåáò éòîùî-ãç åðéà `-W %s' ïééôàî\n" ! #: getopt.c:893 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s úéðëú øåáò èðîåâøà ìá÷î åðéà `-W %s' ïééôàî\n" ! #: main.c:292 msgid "`-m[fr]' option irrelevant in gawk" msgstr "gawk øåáò éèðååìø åðéà `-m[fr]' ïééôàî" ! #: main.c:294 msgid "-m option usage: `-m[fr] nnn'" msgstr "`-m[fr] nnn' :-m ïééôàîá ùåîéù ïôåà" ! #. gawk specific options - now in getopt_long ! #: main.c:311 #, c-format msgid "%s: option `-W %s' unrecognized, ignored\n" msgstr "çðæåä ,%s úéðëú øåáò øëåî åðéà `-W %s' ïééôàî\n" ! #: main.c:342 msgid "empty argument to `--source' ignored" msgstr "çðæåä `--source'-ì ÷éø èðîåâøà" ! #: main.c:414 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "`--posix' ìéòôî :øãâåî `POSIXLY_CORRECT' äáéáñ äðúùî" ! #. both on command line ! #: main.c:419 msgid "`--posix' overrides `--traditional'" msgstr "`--traditional' ìò øáåâ `--posix'" ! #: main.c:430 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "`--non-decimal-data' ìò øáåâ `--posix'/`--traditional'" ! #: main.c:434 #, c-format ! msgid "runing %s setuid root may be a security problem" msgstr "òãéî úçèáàá òåâôì äìåìò setuid root-ë %s úöøä" ! #: main.c:463 #, c-format msgid "can't set mode on stdin (%s)" msgstr "stdin úìåòô ïôåà úòéá÷á (%s) äì÷ú" ! #: main.c:466 #, c-format msgid "can't set mode on stdout (%s)" msgstr "stdout úìåòô ïôåà úòéá÷á (%s) äì÷ú" ! #: main.c:468 #, c-format msgid "can't set mode on stderr (%s)" msgstr "stderr úìåòô ïôåà úòéá÷á (%s) äì÷ú" ! #: main.c:497 msgid "no program text at all!" msgstr "!ììë àöîðá äéä àì úéðëú ìù èñ÷è" ! #. Not factoring out common stuff makes it easier to translate. ! #: main.c:541 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "%s [GNU åà POSIX ïåðâñá íéðééôàî] -f úéðëú-íù [--] õáå÷-íù ... :ùåîéù ïôåà\n" ! #: main.c:543 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" "%s [GNU åà POSIX ïåðâñá íéðééôàî] [--] %cúéðëú%c õáå÷-íù ... :ùåîéù ïôåà\n" ! #. GNU long options info. This is too many options. ! #: main.c:548 msgid "POSIX options:\t\tGNU long options:\n" msgstr ":POSIX éðééôàî\t\t:íéëåøà GNU éðééôàî\n" ! #: main.c:549 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f úéðëú-õáå÷\t\t--file=úéðëú-õáå÷\n" ! #: main.c:550 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F úåãù-ãéøôî\t\t--field-separator=úåãù-ãéøôî\n" ! #: main.c:551 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v äðúùî=êøò\t\t--assign=äðúùî=êøò\n" ! #: main.c:552 msgid "\t-m[fr] val\n" msgstr "\t-m[fr] êøò\n" ! #: main.c:553 msgid "\t-W compat\t\t--compat\n" ! msgstr "" ! #: main.c:554 msgid "\t-W copyleft\t\t--copyleft\n" ! msgstr "" ! #: main.c:555 msgid "\t-W copyright\t\t--copyright\n" ! msgstr "" ! #: main.c:556 msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" msgstr "\t-W dump-variables[=õáå÷-íù]\t--dump-variables[=õáå÷-íù]\n" ! #: main.c:557 msgid "\t-W gen-po\t\t--gen-po\n" ! msgstr "" ! #: main.c:558 msgid "\t-W help\t\t\t--help\n" ! msgstr "" ! #: main.c:559 msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" ! msgstr "" ! #: main.c:560 msgid "\t-W lint-old\t\t--lint-old\n" ! msgstr "" ! #: main.c:561 msgid "\t-W non-decimal-data\t--non-decimal-data\n" ! msgstr "" ! #: main.c:563 msgid "\t-W nostalgia\t\t--nostalgia\n" ! msgstr "" ! #: main.c:566 msgid "\t-W parsedebug\t\t--parsedebug\n" ! msgstr "" ! #: main.c:568 msgid "\t-W profile[=file]\t--profile[=file]\n" msgstr "\t-W profile[=õáå÷-íù]\t--profile[=õáå÷-íù]\n" ! #: main.c:569 msgid "\t-W posix\t\t--posix\n" ! msgstr "" ! #: main.c:570 msgid "\t-W re-interval\t\t--re-interval\n" ! msgstr "" ! #: main.c:571 msgid "\t-W source=program-text\t--source=program-text\n" msgstr "\t-W source=úéðëú-èñ÷è\t--source=úéðëú-èñ÷è\n" ! #: main.c:572 msgid "\t-W traditional\t\t--traditional\n" ! msgstr "" ! #: main.c:573 msgid "\t-W usage\t\t--usage\n" ! msgstr "" ! #: main.c:574 msgid "\t-W version\t\t--version\n" ! msgstr "" ! #: main.c:575 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" msgstr "" "\n" "àåäù ,`gawk.info' õáå÷á `Bugs' úîåö äàø ,úåì÷ú ìò çååéãì\n" ! #: main.c:576 ! msgid "section `Reporting Problems and Bugs' in the printed version.\n" ! msgstr ".ñôãåîä êéøãîá `Reporting Problems and Bugs' ä÷ñô\n" ! #: main.c:586 ! #, fuzzy msgid "" ! "Copyright (C) 1989, 1991-2001 Free Software Foundation.\n" "\n" "This program is free software; you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" --- 422,676 ---- # The way the leading "%s:" is translated is a terrible kludge, # but what can I do? FIXME. ! #: getopt.c:692 getopt.c:704 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s úéðëú øåáò éòîùî-ãç åðéà `%s' ïééôàî\n" ! #: getopt.c:737 getopt.c:741 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s úéðëú øåáò èðîåâøà ìá÷î åðéà `--%s' ïééôàî\n" ! #: getopt.c:750 getopt.c:755 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s úéðëú øåáò èðîåâøà ìá÷î åðéà `%c%s' ïééôàî\n" ! #: getopt.c:791 getopt.c:804 getopt.c:1093 getopt.c:1106 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s úéðëú øåáò èðîåâøà áééçî `%s' ïééôàî\n" ! #: getopt.c:842 getopt.c:845 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s úéðëú øåáò `--%s' ääåæî-éúìá ïééôàî\n" ! #: getopt.c:853 getopt.c:856 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s úéðëú øåáò `%c%s' ääåæî-éúìá ïééôàî\n" # "Illegal" is against GNU coding standards, but since Posix requires # it (see the comment below), let's say that in Hebrew as well... ! #: getopt.c:903 getopt.c:906 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: é÷åç-éúìá ïééôàî -- %c\n" ! #: getopt.c:912 getopt.c:915 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s úéðëú øåáò éåâù ïééôàî -- %c\n" ! #: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: èðîåâøà áééçî ïééôàî -- %c\n" ! #: getopt.c:1025 getopt.c:1036 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s úéðëú øåáò éòîùî-ãç åðéà `-W %s' ïééôàî\n" ! #: getopt.c:1060 getopt.c:1072 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s úéðëú øåáò èðîåâøà ìá÷î åðéà `-W %s' ïééôàî\n" ! #: main.c:307 msgid "`-m[fr]' option irrelevant in gawk" msgstr "gawk øåáò éèðååìø åðéà `-m[fr]' ïééôàî" ! #: main.c:309 msgid "-m option usage: `-m[fr] nnn'" msgstr "`-m[fr] nnn' :-m ïééôàîá ùåîéù ïôåà" ! #: main.c:326 #, c-format msgid "%s: option `-W %s' unrecognized, ignored\n" msgstr "çðæåä ,%s úéðëú øåáò øëåî åðéà `-W %s' ïééôàî\n" ! #: main.c:357 msgid "empty argument to `--source' ignored" msgstr "çðæåä `--source'-ì ÷éø èðîåâøà" ! #: main.c:429 msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" msgstr "`--posix' ìéòôî :øãâåî `POSIXLY_CORRECT' äáéáñ äðúùî" ! #: main.c:434 msgid "`--posix' overrides `--traditional'" msgstr "`--traditional' ìò øáåâ `--posix'" ! #: main.c:445 msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" msgstr "`--non-decimal-data' ìò øáåâ `--posix'/`--traditional'" ! #: main.c:449 #, c-format ! msgid "running %s setuid root may be a security problem" msgstr "òãéî úçèáàá òåâôì äìåìò setuid root-ë %s úöøä" ! #: main.c:478 #, c-format msgid "can't set mode on stdin (%s)" msgstr "stdin úìåòô ïôåà úòéá÷á (%s) äì÷ú" ! #: main.c:481 #, c-format msgid "can't set mode on stdout (%s)" msgstr "stdout úìåòô ïôåà úòéá÷á (%s) äì÷ú" ! #: main.c:483 #, c-format msgid "can't set mode on stderr (%s)" msgstr "stderr úìåòô ïôåà úòéá÷á (%s) äì÷ú" ! #: main.c:512 msgid "no program text at all!" msgstr "!ììë àöîðá äéä àì úéðëú ìù èñ÷è" ! #: main.c:556 #, c-format msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" msgstr "" "%s [GNU åà POSIX ïåðâñá íéðééôàî] -f úéðëú-íù [--] õáå÷-íù ... :ùåîéù ïôåà\n" ! #: main.c:558 #, c-format msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" msgstr "" "%s [GNU åà POSIX ïåðâñá íéðééôàî] [--] %cúéðëú%c õáå÷-íù ... :ùåîéù ïôåà\n" ! #: main.c:563 msgid "POSIX options:\t\tGNU long options:\n" msgstr ":POSIX éðééôàî\t\t:íéëåøà GNU éðééôàî\n" ! #: main.c:564 msgid "\t-f progfile\t\t--file=progfile\n" msgstr "\t-f úéðëú-õáå÷\t\t--file=úéðëú-õáå÷\n" ! #: main.c:565 msgid "\t-F fs\t\t\t--field-separator=fs\n" msgstr "\t-F úåãù-ãéøôî\t\t--field-separator=úåãù-ãéøôî\n" ! #: main.c:566 msgid "\t-v var=val\t\t--assign=var=val\n" msgstr "\t-v äðúùî=êøò\t\t--assign=äðúùî=êøò\n" ! #: main.c:567 msgid "\t-m[fr] val\n" msgstr "\t-m[fr] êøò\n" ! #: main.c:568 msgid "\t-W compat\t\t--compat\n" ! msgstr "\t-W compat\t\t--compat\n" ! #: main.c:569 msgid "\t-W copyleft\t\t--copyleft\n" ! msgstr "\t-W copyleft\t\t--copyleft\n" ! #: main.c:570 msgid "\t-W copyright\t\t--copyright\n" ! msgstr "\t-W copyright\t\t--copyright\n" ! #: main.c:571 msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" msgstr "\t-W dump-variables[=õáå÷-íù]\t--dump-variables[=õáå÷-íù]\n" ! #: main.c:572 msgid "\t-W gen-po\t\t--gen-po\n" ! msgstr "\t-W gen-po\t\t--gen-po\n" ! #: main.c:573 msgid "\t-W help\t\t\t--help\n" ! msgstr "\t-W help\t\t\t--help\n" ! #: main.c:574 msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" ! msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n" ! #: main.c:575 msgid "\t-W lint-old\t\t--lint-old\n" ! msgstr "\t-W lint-old\t\t--lint-old\n" ! #: main.c:576 msgid "\t-W non-decimal-data\t--non-decimal-data\n" ! msgstr "\t-W non-decimal-data\t--non-decimal-data\n" ! #: main.c:578 msgid "\t-W nostalgia\t\t--nostalgia\n" ! msgstr "\t-W nostalgia\t\t--nostalgia\n" ! #: main.c:581 msgid "\t-W parsedebug\t\t--parsedebug\n" ! msgstr "\t-W parsedebug\t\t--parsedebug\n" ! #: main.c:583 msgid "\t-W profile[=file]\t--profile[=file]\n" msgstr "\t-W profile[=õáå÷-íù]\t--profile[=õáå÷-íù]\n" ! #: main.c:584 msgid "\t-W posix\t\t--posix\n" ! msgstr "\t-W posix\t\t--posix\n" ! #: main.c:585 msgid "\t-W re-interval\t\t--re-interval\n" ! msgstr "\t-W re-interval\t\t--re-interval\n" ! #: main.c:586 msgid "\t-W source=program-text\t--source=program-text\n" msgstr "\t-W source=úéðëú-èñ÷è\t--source=úéðëú-èñ÷è\n" ! #: main.c:587 msgid "\t-W traditional\t\t--traditional\n" ! msgstr "\t-W traditional\t\t--traditional\n" ! #: main.c:588 msgid "\t-W usage\t\t--usage\n" ! msgstr "\t-W usage\t\t--usage\n" ! #: main.c:589 msgid "\t-W version\t\t--version\n" ! msgstr "\t-W version\t\t--version\n" ! #: main.c:593 msgid "" "\n" "To report bugs, see node `Bugs' in `gawk.info', which is\n" + "section `Reporting Problems and Bugs' in the printed version.\n" + "\n" msgstr "" "\n" "àåäù ,`gawk.info' õáå÷á `Bugs' úîåö äàø ,úåì÷ú ìò çååéãì\n" + " .ñôãåîä êéøãîá `Reporting Problems and Bugs' ä÷ñô\n" + "\n" ! #: main.c:597 ! msgid "" ! "gawk is a pattern scanning and processing language.\n" ! "By default it reads standard input and writes standard output.\n" ! "\n" ! msgstr "" ! ".èñ÷è úåéðáú ìù ãåáéòå äé÷øñì äôù åðéä gawk\n" ! ".éð÷ú èìôì áúåëå éð÷ú èì÷ õåøò àøå÷ àåä ìãçî úøéøáë\n" ! #: main.c:601 msgid "" ! "Examples:\n" ! "\tgawk '{ sum += $1 }; END { print sum }' file\n" ! "\tgawk -F: '{ print $1 }' /etc/passwd\n" ! msgstr "" ! " :úåàîâåã\n" ! "\tgawk '{ sum += $1 }; END { print sum }' file\n" ! "\tgawk -F: '{ print $1 }' /etc/passwd\n" ! ! #: main.c:613 ! #, c-format ! msgid "" ! "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" "\n" "This program is free software; you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" *************** *** 664,677 **** "(at your option) any later version.\n" "\n" msgstr "" ! "Free Software Foundation-ì úåøåîù úåéåëæä ìë (C) 1989, 1991-2000\n" "\n" "óåôëá äúåðùì åà/å äöéôäì íëúåëæ ;úéùôç äðëú äðéä åæ úéðëú\n" ! "é\"ò øåàì àöåéä ,GNU General Public License ïåéùøä éàðúì\n" ! "íàå ,ïåéùøä ìù 2 àñøâá íà ;Free Software Foundation\n" ! " .øúåé úøçåàî àñøâ ìëá (íëì äøåîùä äéöôåàë)\n" ! #: main.c:594 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" --- 678,691 ---- "(at your option) any later version.\n" "\n" msgstr "" ! "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" "\n" "óåôëá äúåðùì åà/å äöéôäì íëúåëæ ;úéùôç äðëú äðéä åæ úéðëú\n" ! " é\"ò øåàì àöåéä ,GNU General Public License ïåéùøä éàðúì\n" ! " íàå ,ïåéùøä ìù 2 àñøâá íà ;Free Software Foundation\n" ! " .øúåé úøçåàî àñøâ ìëá (íëì äøåîùä äéöôåàë)\n" ! #: main.c:621 msgid "" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" *************** *** 684,690 **** ",íéèøôì .úîéåñî úéìëú åæéàì äîàúä åà úåøéçñ ìù\n" " .GNU General Public License-á åðééò àðà\n" ! #: main.c:600 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" --- 698,704 ---- ",íéèøôì .úîéåñî úéìëú åæéàì äîàúä åà úåøéçñ ìù\n" " .GNU General Public License-á åðééò àðà\n" ! #: main.c:627 msgid "" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" *************** *** 694,751 **** "Free Software Foundation, Inc.-ì åáúë àðà ,åúåà íúìáé÷ àì íà\n" ".59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\n" ! #: main.c:630 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "awk ìù POSIX úñøâá TAB úåéäì FS-ì íøåâ åðéà -Ft" ! #: io.c:1371 main.c:830 ! #, c-format ! msgid "could not find groups: %s" ! msgstr "%s :úëøòîá íéùîúùî úåöåá÷ ìò òãéî ïéà" ! ! #: main.c:869 #, c-format msgid "invalid syntax in name `%s' for variable assignment" msgstr "êøò úîùäá `%s' äðúùî íù ìù éåâù øéáçú" ! #: main.c:938 msgid "floating point exception" msgstr "äôö äãå÷ð éáåùéçá äâéøç" ! #: main.c:945 msgid "fatal error: internal error" msgstr "úéîéðô äðëú úàéâù :äøåîç äì÷ú" # FIXME: I wonder how many people will understand what "fd 2" means. ! #: main.c:995 #, c-format msgid "no pre-opened fd %d" msgstr "ùàøî çåúô åðéà %d èìô/èì÷ õåøò" # FIXME: /dev/null might not be known to all. ! #: main.c:1000 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "/dev/null-ì %d èìô/èì÷ õåøò çåúôì ïúéð àì" #: profile.c:94 #, c-format msgid "could not open `%s' for writing: %s" msgstr "äáéúë êøåöì `%s' úçéúô úòá (%s) äì÷ú" ! #: awkgram.y:2281 profile.c:96 msgid "sending profile to standard error" msgstr "éð÷ú úåàéâù õåøòì çìùð òåöéá ìéôåøô" ! #: profile.c:402 msgid "internal error: Node_var with null vname" msgstr "ñôåàî åìù vname-äù Node_var :úéîéðô äðëú úàéâù" ! #: profile.c:508 msgid "internal error: Node_var_array with null vname" msgstr "ñôåàî åìù vname-äù Node_var_array :úéîéðô äðëú úàéâù" ! #: eval.c:816 profile.c:531 #, c-format msgid "" "function `%s' called with space between name and `(',\n" --- 708,765 ---- "Free Software Foundation, Inc.-ì åáúë àðà ,åúåà íúìáé÷ àì íà\n" ".59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\n" ! #: main.c:657 msgid "-Ft does not set FS to tab in POSIX awk" msgstr "awk ìù POSIX úñøâá TAB úåéäì FS-ì íøåâ åðéà -Ft" ! #: main.c:888 #, c-format msgid "invalid syntax in name `%s' for variable assignment" msgstr "êøò úîùäá `%s' äðúùî íù ìù éåâù øéáçú" ! #: main.c:957 msgid "floating point exception" msgstr "äôö äãå÷ð éáåùéçá äâéøç" ! #: main.c:964 msgid "fatal error: internal error" msgstr "úéîéðô äðëú úàéâù :äøåîç äì÷ú" # FIXME: I wonder how many people will understand what "fd 2" means. ! #: main.c:1014 #, c-format msgid "no pre-opened fd %d" msgstr "ùàøî çåúô åðéà %d èìô/èì÷ õåøò" # FIXME: /dev/null might not be known to all. ! #: main.c:1019 #, c-format msgid "could not pre-open /dev/null for fd %d" msgstr "/dev/null-ì %d èìô/èì÷ õåøò çåúôì ïúéð àì" + #: main.c:1037 main.c:1046 + #, c-format + msgid "could not find groups: %s" + msgstr "%s :úëøòîá íéùîúùî úåöåá÷ ìò òãéî ïéà" + #: profile.c:94 #, c-format msgid "could not open `%s' for writing: %s" msgstr "äáéúë êøåöì `%s' úçéúô úòá (%s) äì÷ú" ! #: profile.c:96 awkgram.y:2465 msgid "sending profile to standard error" msgstr "éð÷ú úåàéâù õåøòì çìùð òåöéá ìéôåøô" ! #: profile.c:409 msgid "internal error: Node_var with null vname" msgstr "ñôåàî åìù vname-äù Node_var :úéîéðô äðëú úàéâù" ! #: profile.c:524 msgid "internal error: Node_var_array with null vname" msgstr "ñôåàî åìù vname-äù Node_var_array :úéîéðô äðëú úàéâù" ! #: profile.c:554 eval.c:813 #, c-format msgid "" "function `%s' called with space between name and `(',\n" *************** *** 754,795 **** ",`(' ïéáì äîù ïéá íéçååø íò `%s' äéö÷ðåôì äàéø÷\n" "%s" ! #: eval.c:818 profile.c:533 msgid "or used in other expression context" msgstr "øçà éåèéá ìù èñ÷èðå÷á äá ùåîéù åà" ! #: eval.c:796 eval.c:1042 eval.c:1610 eval.c:1736 profile.c:610 profile.c:738 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "øàì÷ñ ùøåãä èñ÷èðå÷á `%s' êøòîá ùåîéù ïåéñð" ! #: eval.c:1046 profile.c:614 #, c-format msgid "illegal type (%s) in tree_eval" msgstr "tree_eval-á (%s) éåâù âåñ" ! #: eval.c:1785 profile.c:815 #, c-format msgid "attempt to use function `%s' as array" msgstr "êøòîë `%s' äéö÷ðåôá ùåîéù ïåéñð" ! #: eval.c:1792 profile.c:829 #, c-format msgid "`%s' is a function, assignment is not allowed" msgstr "äøåñà äá êøò úîùä ,äéö÷ðåô àéä `%s'" ! #. in gawk for a while ! #: eval.c:1798 eval.c:1805 profile.c:833 msgid "assignment is not allowed to result of builtin function" msgstr "úéðáåî äéö÷ðåô ìù äàöåúá êøò áéöäì ïéà" ! #. \n on purpose, with \n in ctime() output ! #: profile.c:1083 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# %s êéøàúî gawk ìù ìéôåøô\n" ! #: profile.c:1086 msgid "" "\t# BEGIN block(s)\n" "\n" --- 768,807 ---- ",`(' ïéáì äîù ïéá íéçååø íò `%s' äéö÷ðåôì äàéø÷\n" "%s" ! #: profile.c:556 eval.c:815 msgid "or used in other expression context" msgstr "øçà éåèéá ìù èñ÷èðå÷á äá ùåîéù åà" ! #: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741 #, c-format msgid "attempt to use array `%s' in a scalar context" msgstr "øàì÷ñ ùøåãä èñ÷èðå÷á `%s' êøòîá ùåîéù ïåéñð" ! #: profile.c:637 eval.c:1047 #, c-format msgid "illegal type (%s) in tree_eval" msgstr "tree_eval-á (%s) éåâù âåñ" ! #: profile.c:842 eval.c:1790 #, c-format msgid "attempt to use function `%s' as array" msgstr "êøòîë `%s' äéö÷ðåôá ùåîéù ïåéñð" ! #: profile.c:856 eval.c:1797 #, c-format msgid "`%s' is a function, assignment is not allowed" msgstr "äøåñà äá êøò úîùä ,äéö÷ðåô àéä `%s'" ! #: profile.c:860 eval.c:1803 eval.c:1810 msgid "assignment is not allowed to result of builtin function" msgstr "úéðáåî äéö÷ðåô ìù äàöåúá êøò áéöäì ïéà" ! #: profile.c:1108 #, c-format msgid "\t# gawk profile, created %s\n" msgstr "\t# %s êéøàúî gawk ìù ìéôåøô\n" ! #: profile.c:1111 msgid "" "\t# BEGIN block(s)\n" "\n" *************** *** 797,803 **** "\t# BEGIN ÷åìá\n" "\n" ! #: profile.c:1096 msgid "" "\t# Rule(s)\n" "\n" --- 809,815 ---- "\t# BEGIN ÷åìá\n" "\n" ! #: profile.c:1121 msgid "" "\t# Rule(s)\n" "\n" *************** *** 805,811 **** "\t# (íé)ììë\n" "\n" ! #: profile.c:1102 msgid "" "\t# END block(s)\n" "\n" --- 817,823 ---- "\t# (íé)ììë\n" "\n" ! #: profile.c:1127 msgid "" "\t# END block(s)\n" "\n" *************** *** 813,819 **** "\t# END ÷åìá\n" "\n" ! #: profile.c:1122 msgid "" "\n" "\t# Functions, listed alphabetically\n" --- 825,831 ---- "\t# END ÷åìá\n" "\n" ! #: profile.c:1147 msgid "" "\n" "\t# Functions, listed alphabetically\n" *************** *** 821,1244 **** "\n" "\t# úéá-óìà øãñá ,úåéö÷ðåô\n" ! #: profile.c:1325 #, c-format msgid "unexpected type %s in prec_level" msgstr "prec_level-á %s éåâù âåñ" ! #: regex.c:1017 msgid "Success" msgstr "äçìöä" ! #. REG_NOERROR ! #: regex.c:1018 msgid "No match" msgstr "äîéàúî úæåøçî äàöîð àì" ! #. REG_NOMATCH ! #: regex.c:1019 msgid "Invalid regular expression" msgstr "éåâù éøìåâø éåèéá" ! #. REG_BADPAT ! #: regex.c:1020 msgid "Invalid collation character" msgstr "øãâåî-éúìá øåãéñ åú" ! #. REG_ECOLLATE ! #: regex.c:1021 msgid "Invalid character class name" msgstr "íéåú úöåá÷ ìù øãâåî-éúìá íù" ! #. REG_ECTYPE ! #: regex.c:1022 msgid "Trailing backslash" msgstr "`\\' éøåçà ïñëåìá íééúñî éøìåâø éåèéá" ! #. REG_EESCAPE ! #: regex.c:1023 msgid "Invalid back reference" msgstr "íãå÷ éåèéá-úúì äéåâù äééðôä" ! #. REG_ESUBREG ! #: regex.c:1024 msgid "Unmatched [ or [^" msgstr "âåæ-ïá åì ïéàù [^ åà [" ! #. REG_EBRACK ! #: regex.c:1025 msgid "Unmatched ( or \\(" msgstr "âåæ-ïá åì ïéàù \\( åà (" ! #. REG_EPAREN ! #: regex.c:1026 msgid "Unmatched \\{" msgstr "âåæ-ïá åì ïéàù \\{" ! #. REG_EBRACE ! #: regex.c:1027 msgid "Invalid content of \\{\\}" msgstr "\\{\\} êåúá éåâù äðáî" ! #. REG_BADBR ! #: regex.c:1028 msgid "Invalid range end" msgstr "íéåú íåçú ìù äéåâù äøãâä" ! #. REG_ERANGE ! #: dfa.c:167 dfa.c:178 dfa.c:189 regex.c:1029 msgid "Memory exhausted" msgstr "ïåøëæä øîâð" ! #. REG_ESPACE ! #: regex.c:1030 msgid "Invalid preceding regular expression" msgstr "íéé÷ åðéà åà éåâù íãå÷ éøìåâø éåèéá" ! #. REG_BADRPT ! #: regex.c:1031 msgid "Premature end of regular expression" msgstr "éãî íã÷åî íééúñî éøìåâø éåèéá" ! #. REG_EEND ! #: regex.c:1032 msgid "Regular expression too big" msgstr "éãî áëøåî åà ìåãâ éøìåâø éåèéá" ! #. REG_ESIZE ! #: regex.c:1033 msgid "Unmatched ) or \\)" msgstr "âåæ-ïá åì ïéàù \\) åà )" ! #: regex.c:5531 msgid "No previous regular expression" msgstr "íãå÷ éøìåâø éåèéá ïéà" ! #: awkgram.y:230 msgid "BEGIN blocks must have an action part" msgstr "äìåòô úøãâä ìåìëì áééç BEGIN ÷åìá" ! #: awkgram.y:236 msgid "END blocks must have an action part" msgstr "äìåòô úøãâä ìåìëì áééç END ÷åìá" ! #: awkgram.y:272 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "äúøãâä úà úåðùì ïéà ,úéðáåî äéö÷ðåô äðéä `%s'" ! #: awkgram.y:360 msgid "statement may have no effect" msgstr "úéìëú íåù äéäú àì äæ éåèéáìù ïëúé" ! #: awkgram.y:457 ! msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" ! msgstr "`print \"\"' úåéäì íúñä ïî êéøö END åà BEGIN éììëá èåùô `print'" ! ! #: awkgram.y:469 msgid "`next' used in BEGIN or END action" msgstr "END åà BEGIN ìù äìåòô úøãâäá `next'-á ùåîéù" ! #: awkgram.y:476 awkgram.y:483 msgid "`nextfile' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `nextfile'" ! #: awkgram.y:488 msgid "`nextfile' used in BEGIN or END action" msgstr "END åà BEGIN ìù äìåòô úøãâäá `nextfile'-á ùåîéù" ! #: awkgram.y:497 msgid "`return' used outside function context" msgstr "äéö÷ðåô ìù èñ÷èðå÷á àìù `return'-á ùåîéù" ! #: awkgram.y:506 awkgram.y:513 msgid "`delete array' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `delete array'" ! #: awkgram.y:571 msgid "multistage two-way pipelines don't work" msgstr "íéãáåò íðéà íéáìù éáåøî íééðååéë-åã íé÷éôà" ! #: awkgram.y:662 msgid "regular expression on right of assignment" msgstr "êøò úîùä úàøåä ìù ïéîé ãöá éøìåâø éåèéá" ! #: awkgram.y:680 msgid "non-redirected `getline' undefined inside END action" msgstr "END úìåòô êåúá øãâåî åðéà äééðôä àìì `getline'" ! #: awkgram.y:690 msgid "regular expression on left of `~' or `!~' operator" msgstr "`!~' åà `~' øåèøôåàì ìàîùî éøìåâø éåèéá" ! #: awkgram.y:700 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "äøòä åðéà êà ,C úôùá äøòä åîë äàøð `/%s/' éøìåâø éåèéá" ! #: awkgram.y:716 msgid "regular expression on right of comparison" msgstr "äàååùä ìù ïéîé ãöá éøìåâø éåèéá" ! #: awkgram.y:743 msgid "non-redirected `getline' undefined inside BEGIN or END action" msgstr "END åà BEGIN úìåòô êåúá øãâåî åðéà äééðôä àìì `getline'" ! #: awkgram.y:798 msgid "call of `length' without parentheses is not portable" msgstr "úéìéáèøåô äðéà íééøâåñ àìì `length'-ì äàéø÷" ! #: awkgram.y:801 msgid "call of `length' without parentheses is deprecated by POSIX" msgstr "POSIX ï÷úì ãåâéðá äðéä íééøâåñ àìì `length'-ì äàéø÷" ! #: awkgram.y:851 msgid "invalid subscript expression" msgstr "êøòî ïééöîá éåâù øéáçú ìòá éåèéá" ! #: awkgram.y:985 #, c-format msgid "fptr %x not in tokentab\n" msgstr "tokentab-á àöîð àì fptr %x\n" ! #: awkgram.y:1019 msgid "unexpected newline" msgstr "éåôö-éúìá íå÷îá äøåù óåñ" ! #: awkgram.y:1098 msgid "empty program text on command line" msgstr "äãå÷ôä úøåùî äìá÷úä ä÷éø úéðëú" ! #: awkgram.y:1155 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "åúàéø÷ íùì `%s' øå÷î õáå÷ úçéúôá (%s) äì÷ú" ! #: awkgram.y:1190 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "`%s' øå÷î õáå÷î äàéø÷á (%s) äì÷ú" ! #: awkgram.y:1198 #, c-format msgid "source file `%s' is empty" msgstr "÷éø åðéä `%s' øå÷î õáå÷" ! #: awkgram.y:1312 awkgram.y:1417 awkgram.y:1435 awkgram.y:1778 awkgram.y:1840 msgid "source file does not end in newline" msgstr "äøåù-óåñ åúá íééúñî åðéà øå÷îä õáå÷" ! #: awkgram.y:1373 msgid "unterminated regexp ends with `\\' at end of file" msgstr "õáå÷ä óñá `\\'-á íééúñî øåîâ-éúìá éøìåâø éåèéá" ! #: awkgram.y:1394 msgid "unterminated regexp" msgstr "øåîâ-éúìá éøìåâø éåèéá" ! #: awkgram.y:1397 msgid "unterminated regexp at end of file" msgstr "õáå÷ä óåñá øåîâ-éúìá éøìåâø éåèéá" ! #: awkgram.y:1461 msgid "use of `\\ #...' line continuation is not portable" msgstr "éìéáèøåô åðéà äøåù êùîäì ïîéñë `\\ #...'-á ùåîéù" ! #: awkgram.y:1473 msgid "backslash not last character on line" msgstr "äøåùá ïåøçà åú åðéàù êåôä ïñëåì" ! #: awkgram.y:1514 msgid "POSIX does not allow operator `**='" msgstr "`**=' øåèøôåà äùøî åðéà POSIX" ! #: awkgram.y:1516 msgid "old awk does not support operator `**='" msgstr "`**=' øåèøôåàá êîåú åðéà ïùé awk" ! #: awkgram.y:1525 msgid "POSIX does not allow operator `**'" msgstr "`**' øåèøôåà äùøî åðéà POSIX" ! #: awkgram.y:1527 msgid "old awk does not support operator `**'" msgstr "`**' øåèøôåàá êîåú åðéà ïùé awk" ! #: awkgram.y:1560 msgid "operator `^=' is not supported in old awk" msgstr "ïùé awk-á êîúð åðéà `^=' øåèøôåà" ! #: awkgram.y:1568 msgid "operator `^' is not supported in old awk" msgstr "ïùé awk-á êîúð åðéà `^' øåèøôåà" ! #: awkgram.y:1650 awkgram.y:1664 msgid "unterminated string" msgstr "äøåîâ-éúìá úæåøçî" ! #: awkgram.y:1815 #, c-format msgid "invalid char '%c' in expression" msgstr "éåèéáá '%c' éåâù åú" ! #: awkgram.y:1861 #, c-format msgid "`%s' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä äðéä `%s'" ! #: awkgram.y:1864 #, c-format msgid "`%s' is a Bell Labs extension" msgstr "Bell úåãáòî úñøâá awk-ì úéôéöôñ äáçøä åðéä `%s'" ! #: awkgram.y:1867 #, c-format msgid "POSIX does not allow `%s'" msgstr "`%s' äùøî åðéà POSIX" ! #: awkgram.y:1871 #, c-format msgid "`%s' is not supported in old awk" msgstr "ïùé awk-á êîúð åðéà `%s'" ! #: awkgram.y:1899 msgid "`goto' considered harmful!\n" msgstr "!òø-òâô áùçð `goto'\n" ! #: awkgram.y:1963 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "íéèðîåâøà øôñîë %d ìá÷ì ìåëé åðéà %s" ! #: awkgram.y:1982 awkgram.y:1985 msgid "match: third argument is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `match' ìù éùéìù èðîåâøà" ! #: awkgram.y:2001 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "úéìëú íåù äì ïéà `%s' ìù ïåøçà èðîåâøàë äòåá÷ úæåøçî" ! #: awkgram.y:2005 msgid "sub third parameter is not a changeable object" msgstr "éåðéù-øá è÷ééáåà åðéà `sub' ìù éùéìù èðîåâøà" ! #: awkgram.y:2007 msgid "gsub third parameter is not a changeable object" msgstr "éåðéù-øá è÷ééáåà åðéà `gsub' ìù éùéìù èðîåâøà" ! #: awkgram.y:2033 awkgram.y:2036 msgid "close: second argument is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `close' ìù éðù èðîåâøà" ! #: awkgram.y:2046 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "èðîåâøà úîã÷áù ïåúçú-ó÷î ÷ìñì ùé :dcgettext(_\"...\")-á éåâù ùåîéù" ! #: awkgram.y:2139 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "`%s' äéö÷ðåôá %d 'ñî øèîøôì ääæ ,`%s' ,%d 'ñî øèîøô ìù åîù" ! #: awkgram.y:2171 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "éìáåìâ äðúùî ìò ìéôàî `%s' äéö÷ðåôá `%s' øèîøô" ! #: awkgram.y:2280 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "äáéúë íùì `%s' úçéúôá (%s) äì÷ú" ! #: awkgram.y:2311 #, c-format msgid "%s: close failed (%s)" msgstr "`%s' úøéâñ úòá (%s) äì÷ú" ! #: awkgram.y:2421 msgid "shadow_funcs() called twice!" msgstr "!íééîòô äàø÷ð shadow_funcs()" ! #: awkgram.y:2496 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "øèîøô íùë ùîùì ìåëé åðéà äéö÷ðåô íù :`%s' äéö÷ðåôá" ! #: awkgram.y:2506 #, c-format msgid "function name `%s' previously defined" msgstr "úøãâåî øáë `%s' íùá äéö÷ðåô" ! #: awkgram.y:2654 awkgram.y:2660 #, c-format msgid "function `%s' called but never defined" msgstr "úøãâåî äðéàù `%s' äéö÷ðåôì äàéø÷" ! #: awkgram.y:2663 #, c-format msgid "function `%s' defined but never called" msgstr "úàø÷ð àì êà ,äøãâåä `%s' äéö÷ðåô" ! #: awkgram.y:2690 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "éðàéìåá êøò áéðî %d 'ñî øèîøôë òåá÷ éøìåâø éåèéá" ! #: dfa.c:451 msgid "Unfinished \\ escape" msgstr "äøåîâ-éúìá \\ äø÷á úøãñ" ! #. Cases: ! #. {M} - exact count ! #. {M,} - minimum count, maximum is infinity ! #. {M,N} - M through N ! #: dfa.c:584 dfa.c:590 dfa.c:600 dfa.c:608 dfa.c:623 msgid "unfinished repeat count" msgstr "äøåîâ-éúìá úåðùéä äðåî úøãâä" ! #: dfa.c:597 dfa.c:614 dfa.c:622 dfa.c:626 msgid "malformed repeat count" msgstr "úåðùéä äðåî úøãâäá éåâù øéáçú" ! #: dfa.c:691 dfa.c:694 dfa.c:721 dfa.c:725 dfa.c:726 dfa.c:729 dfa.c:742 ! #: dfa.c:743 ! msgid "Unbalanced [" ! msgstr "âåæ-ïá åì ïéàù [" ! ! #: dfa.c:889 msgid "Unbalanced (" msgstr "âåæ-ïá åì ïéàù (" ! #: dfa.c:1003 msgid "No regexp syntax bits specified" msgstr "íééøìåâø íééåèéá ìù øéáçú úøãâä ïéà" ! #: dfa.c:1011 msgid "Unbalanced )" msgstr "âåæ-ïá åì ïéàù )" ! #: dfa.c:2002 msgid "out of memory" msgstr "ïåøëæä øîâð" ! #: field.c:787 msgid "split: second argument is not an array" msgstr "êøòî åðéà `split' ìù éðùä èðîåâøàä" ! #: field.c:814 msgid "split: null string for third arg is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä äðéä `split'-ì éùéìù èðåîâøàë úñôåàî úæåøçî" ! #: field.c:854 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `FIELDWIDTHS'" ! #: field.c:881 #, c-format msgid "field %d in FIELDWIDTHS, must be > 0" msgstr "0-î ìåãâ úåéäì áééç FIELDWIDTHS-á %d 'ñî äãù" ! #: field.c:935 msgid "null string for `FS' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä äðéä `FS'-ë úñôåàî úæåøçî" --- 833,1241 ---- "\n" "\t# úéá-óìà øãñá ,úåéö÷ðåô\n" ! #: profile.c:1357 #, c-format msgid "unexpected type %s in prec_level" msgstr "prec_level-á %s éåâù âåñ" ! #: regex.c:1322 msgid "Success" msgstr "äçìöä" ! #: regex.c:1323 msgid "No match" msgstr "äîéàúî úæåøçî äàöîð àì" ! #: regex.c:1324 msgid "Invalid regular expression" msgstr "éåâù éøìåâø éåèéá" ! #: regex.c:1325 msgid "Invalid collation character" msgstr "øãâåî-éúìá øåãéñ åú" ! #: regex.c:1326 msgid "Invalid character class name" msgstr "íéåú úöåá÷ ìù øãâåî-éúìá íù" ! #: regex.c:1327 msgid "Trailing backslash" msgstr "`\\' éøåçà ïñëåìá íééúñî éøìåâø éåèéá" ! #: regex.c:1328 msgid "Invalid back reference" msgstr "íãå÷ éåèéá-úúì äéåâù äééðôä" ! #: regex.c:1329 msgid "Unmatched [ or [^" msgstr "âåæ-ïá åì ïéàù [^ åà [" ! #: regex.c:1330 msgid "Unmatched ( or \\(" msgstr "âåæ-ïá åì ïéàù \\( åà (" ! #: regex.c:1331 msgid "Unmatched \\{" msgstr "âåæ-ïá åì ïéàù \\{" ! #: regex.c:1332 msgid "Invalid content of \\{\\}" msgstr "\\{\\} êåúá éåâù äðáî" ! #: regex.c:1333 msgid "Invalid range end" msgstr "íéåú íåçú ìù äéåâù äøãâä" ! #: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204 msgid "Memory exhausted" msgstr "ïåøëæä øîâð" ! #: regex.c:1335 msgid "Invalid preceding regular expression" msgstr "íéé÷ åðéà åà éåâù íãå÷ éøìåâø éåèéá" ! #: regex.c:1336 msgid "Premature end of regular expression" msgstr "éãî íã÷åî íééúñî éøìåâø éåèéá" ! #: regex.c:1337 msgid "Regular expression too big" msgstr "éãî áëøåî åà ìåãâ éøìåâø éåèéá" ! #: regex.c:1338 msgid "Unmatched ) or \\)" msgstr "âåæ-ïá åì ïéàù \\) åà )" ! #: regex.c:7365 msgid "No previous regular expression" msgstr "íãå÷ éøìåâø éåèéá ïéà" ! #: awkgram.y:232 msgid "BEGIN blocks must have an action part" msgstr "äìåòô úøãâä ìåìëì áééç BEGIN ÷åìá" ! #: awkgram.y:238 msgid "END blocks must have an action part" msgstr "äìåòô úøãâä ìåìëì áééç END ÷åìá" ! #: awkgram.y:274 #, c-format msgid "`%s' is a built-in function, it cannot be redefined" msgstr "äúøãâä úà úåðùì ïéà ,úéðáåî äéö÷ðåô äðéä `%s'" ! #: awkgram.y:362 msgid "statement may have no effect" msgstr "úéìëú íåù äéäú àì äæ éåèéáìù ïëúé" ! #: awkgram.y:455 msgid "`next' used in BEGIN or END action" msgstr "END åà BEGIN ìù äìåòô úøãâäá `next'-á ùåîéù" ! #: awkgram.y:462 awkgram.y:469 msgid "`nextfile' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `nextfile'" ! #: awkgram.y:474 msgid "`nextfile' used in BEGIN or END action" msgstr "END åà BEGIN ìù äìåòô úøãâäá `nextfile'-á ùåîéù" ! #: awkgram.y:483 msgid "`return' used outside function context" msgstr "äéö÷ðåô ìù èñ÷èðå÷á àìù `return'-á ùåîéù" ! #: awkgram.y:519 ! msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" ! msgstr "`print \"\"' úåéäì íúñä ïî êéøö END åà BEGIN éììëá èåùô `print'" ! ! #: awkgram.y:532 awkgram.y:539 msgid "`delete array' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `delete array'" ! #: awkgram.y:604 msgid "multistage two-way pipelines don't work" msgstr "íéãáåò íðéà íéáìù éáåøî íééðååéë-åã íé÷éôà" ! #: awkgram.y:695 msgid "regular expression on right of assignment" msgstr "êøò úîùä úàøåä ìù ïéîé ãöá éøìåâø éåèéá" ! #: awkgram.y:713 msgid "non-redirected `getline' undefined inside END action" msgstr "END úìåòô êåúá øãâåî åðéà äééðôä àìì `getline'" ! #: awkgram.y:723 msgid "regular expression on left of `~' or `!~' operator" msgstr "`!~' åà `~' øåèøôåàì ìàîùî éøìåâø éåèéá" ! #: awkgram.y:733 #, c-format msgid "regexp constant `/%s/' looks like a C comment, but is not" msgstr "äøòä åðéà êà ,C úôùá äøòä åîë äàøð `/%s/' éøìåâø éåèéá" ! #: awkgram.y:749 msgid "regular expression on right of comparison" msgstr "äàååùä ìù ïéîé ãöá éøìåâø éåèéá" ! #: awkgram.y:776 msgid "non-redirected `getline' undefined inside BEGIN or END action" msgstr "END åà BEGIN úìåòô êåúá øãâåî åðéà äééðôä àìì `getline'" ! #: awkgram.y:831 msgid "call of `length' without parentheses is not portable" msgstr "úéìéáèøåô äðéà íééøâåñ àìì `length'-ì äàéø÷" ! #: awkgram.y:834 msgid "call of `length' without parentheses is deprecated by POSIX" msgstr "POSIX ï÷úì ãåâéðá äðéä íééøâåñ àìì `length'-ì äàéø÷" ! #: awkgram.y:884 msgid "invalid subscript expression" msgstr "êøòî ïééöîá éåâù øéáçú ìòá éåèéá" ! #: awkgram.y:1033 #, c-format msgid "fptr %x not in tokentab\n" msgstr "tokentab-á àöîð àì fptr %x\n" ! #: awkgram.y:1068 msgid "unexpected newline" msgstr "éåôö-éúìá íå÷îá äøåù óåñ" ! #: awkgram.y:1152 msgid "empty program text on command line" msgstr "äãå÷ôä úøåùî äìá÷úä ä÷éø úéðëú" ! #: awkgram.y:1209 #, c-format msgid "can't open source file `%s' for reading (%s)" msgstr "åúàéø÷ íùì `%s' øå÷î õáå÷ úçéúôá (%s) äì÷ú" ! #: awkgram.y:1244 #, c-format msgid "can't read sourcefile `%s' (%s)" msgstr "`%s' øå÷î õáå÷î äàéø÷á (%s) äì÷ú" ! #: awkgram.y:1252 #, c-format msgid "source file `%s' is empty" msgstr "÷éø åðéä `%s' øå÷î õáå÷" ! #: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011 msgid "source file does not end in newline" msgstr "äøåù-óåñ åúá íééúñî åðéà øå÷îä õáå÷" ! #: awkgram.y:1518 msgid "unterminated regexp ends with `\\' at end of file" msgstr "õáå÷ä óñá `\\'-á íééúñî øåîâ-éúìá éøìåâø éåèéá" ! #: awkgram.y:1539 msgid "unterminated regexp" msgstr "øåîâ-éúìá éøìåâø éåèéá" ! #: awkgram.y:1542 msgid "unterminated regexp at end of file" msgstr "õáå÷ä óåñá øåîâ-éúìá éøìåâø éåèéá" ! #: awkgram.y:1609 msgid "use of `\\ #...' line continuation is not portable" msgstr "éìéáèøåô åðéà äøåù êùîäì ïîéñë `\\ #...'-á ùåîéù" ! #: awkgram.y:1621 msgid "backslash not last character on line" msgstr "äøåùá ïåøçà åú åðéàù êåôä ïñëåì" ! #: awkgram.y:1662 msgid "POSIX does not allow operator `**='" msgstr "`**=' øåèøôåà äùøî åðéà POSIX" ! #: awkgram.y:1664 msgid "old awk does not support operator `**='" msgstr "`**=' øåèøôåàá êîåú åðéà ïùé awk" ! #: awkgram.y:1673 msgid "POSIX does not allow operator `**'" msgstr "`**' øåèøôåà äùøî åðéà POSIX" ! #: awkgram.y:1675 msgid "old awk does not support operator `**'" msgstr "`**' øåèøôåàá êîåú åðéà ïùé awk" ! #: awkgram.y:1708 msgid "operator `^=' is not supported in old awk" msgstr "ïùé awk-á êîúð åðéà `^=' øåèøôåà" ! #: awkgram.y:1716 msgid "operator `^' is not supported in old awk" msgstr "ïùé awk-á êîúð åðéà `^' øåèøôåà" ! #: awkgram.y:1798 awkgram.y:1815 msgid "unterminated string" msgstr "äøåîâ-éúìá úæåøçî" ! #: awkgram.y:1972 #, c-format msgid "invalid char '%c' in expression" msgstr "éåèéáá '%c' éåâù åú" ! #: awkgram.y:2032 #, c-format msgid "`%s' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä äðéä `%s'" ! #: awkgram.y:2035 #, c-format msgid "`%s' is a Bell Labs extension" msgstr "Bell úåãáòî úñøâá awk-ì úéôéöôñ äáçøä åðéä `%s'" ! #: awkgram.y:2038 #, c-format msgid "POSIX does not allow `%s'" msgstr "`%s' äùøî åðéà POSIX" ! #: awkgram.y:2042 #, c-format msgid "`%s' is not supported in old awk" msgstr "ïùé awk-á êîúð åðéà `%s'" ! #: awkgram.y:2070 msgid "`goto' considered harmful!\n" msgstr "!òø-òâô áùçð `goto'\n" ! #: awkgram.y:2134 #, c-format msgid "%d is invalid as number of arguments for %s" msgstr "íéèðîåâøà øôñîë %d ìá÷ì ìåëé åðéà %s" ! #: awkgram.y:2153 awkgram.y:2156 msgid "match: third argument is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `match' ìù éùéìù èðîåâøà" ! #: awkgram.y:2172 #, c-format msgid "%s: string literal as last arg of substitute has no effect" msgstr "úéìëú íåù äì ïéà `%s' ìù ïåøçà èðîåâøàë äòåá÷ úæåøçî" ! #: awkgram.y:2176 msgid "sub third parameter is not a changeable object" msgstr "éåðéù-øá è÷ééáåà åðéà `sub' ìù éùéìù èðîåâøà" ! #: awkgram.y:2178 msgid "gsub third parameter is not a changeable object" msgstr "éåðéù-øá è÷ééáåà åðéà `gsub' ìù éùéìù èðîåâøà" ! #: awkgram.y:2204 awkgram.y:2207 msgid "close: second argument is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `close' ìù éðù èðîåâøà" ! #: awkgram.y:2217 msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" msgstr "èðîåâøà úîã÷áù ïåúçú-ó÷î ÷ìñì ùé :dcgettext(_\"...\")-á éåâù ùåîéù" ! #: awkgram.y:2232 ! msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" ! msgstr "èðîåâøà úîã÷áù ïåúçú-ó÷î ÷ìñì ùé :dncgettext(_\"...\")-á éåâù ùåîéù" ! ! #: awkgram.y:2323 #, c-format msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" msgstr "`%s' äéö÷ðåôá %d 'ñî øèîøôì ääæ ,`%s' ,%d 'ñî øèîøô ìù åîù" ! #: awkgram.y:2355 #, c-format msgid "function `%s': parameter `%s' shadows global variable" msgstr "éìáåìâ äðúùî ìò ìéôàî `%s' äéö÷ðåôá `%s' øèîøô" ! #: awkgram.y:2464 #, c-format msgid "could not open `%s' for writing (%s)" msgstr "äáéúë íùì `%s' úçéúôá (%s) äì÷ú" ! #: awkgram.y:2495 #, c-format msgid "%s: close failed (%s)" msgstr "`%s' úøéâñ úòá (%s) äì÷ú" ! #: awkgram.y:2605 msgid "shadow_funcs() called twice!" msgstr "!íééîòô äàø÷ð shadow_funcs()" ! #: awkgram.y:2680 #, c-format msgid "function `%s': can't use function name as parameter name" msgstr "øèîøô íùë ùîùì ìåëé åðéà äéö÷ðåô íù :`%s' äéö÷ðåôá" ! #: awkgram.y:2690 #, c-format msgid "function name `%s' previously defined" msgstr "úøãâåî øáë `%s' íùá äéö÷ðåô" ! #: awkgram.y:2838 awkgram.y:2844 #, c-format msgid "function `%s' called but never defined" msgstr "úøãâåî äðéàù `%s' äéö÷ðåôì äàéø÷" ! #: awkgram.y:2847 #, c-format msgid "function `%s' defined but never called" msgstr "úàø÷ð àì êà ,äøãâåä `%s' äéö÷ðåô" ! #: awkgram.y:2874 #, c-format msgid "regexp constant for parameter #%d yields boolean value" msgstr "éðàéìåá êøò áéðî %d 'ñî øèîøôë òåá÷ éøìåâø éåèéá" ! #: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649 ! #: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078 ! #: dfa.c:1081 dfa.c:1094 dfa.c:1095 ! msgid "Unbalanced [" ! msgstr "âåæ-ïá åì ïéàù [" ! ! #: dfa.c:783 msgid "Unfinished \\ escape" msgstr "äøåîâ-éúìá \\ äø÷á úøãñ" ! #: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955 msgid "unfinished repeat count" msgstr "äøåîâ-éúìá úåðùéä äðåî úøãâä" ! #: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958 msgid "malformed repeat count" msgstr "úåðùéä äðåî úøãâäá éåâù øéáçú" ! #: dfa.c:1285 msgid "Unbalanced (" msgstr "âåæ-ïá åì ïéàù (" ! #: dfa.c:1407 msgid "No regexp syntax bits specified" msgstr "íééøìåâø íééåèéá ìù øéáçú úøãâä ïéà" ! #: dfa.c:1415 msgid "Unbalanced )" msgstr "âåæ-ïá åì ïéàù )" ! #: dfa.c:3014 msgid "out of memory" msgstr "ïåøëæä øîâð" ! #: field.c:849 msgid "split: second argument is not an array" msgstr "êøòî åðéà `split' ìù éðùä èðîåâøàä" ! #: field.c:876 msgid "split: null string for third arg is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä äðéä `split'-ì éùéìù èðåîâøàë úñôåàî úæåøçî" ! #: field.c:916 msgid "`FIELDWIDTHS' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `FIELDWIDTHS'" ! #: field.c:943 #, c-format msgid "field %d in FIELDWIDTHS, must be > 0" msgstr "0-î ìåãâ úåéäì áééç FIELDWIDTHS-á %d 'ñî äãù" ! #: field.c:997 msgid "null string for `FS' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä äðéä `FS'-ë úñôåàî úæåøçî" *************** *** 1248,1382 **** # Hebrew, due to changed directionality. #: msg.c:57 msgid "cmd. line:" ! msgstr "" #: msg.c:123 msgid "warning: " ! msgstr "" #: msg.c:145 msgid "error: " ! msgstr "" #: msg.c:178 msgid "fatal: " ! msgstr "" ! #: eval.c:258 #, c-format msgid "unknown nodetype %d" msgstr "%d ääåæî-éúìá âåñ ìòá node" ! #: eval.c:306 msgid "buffer overflow in genflags2str" msgstr "genflags2str-á õöåç úùéìâ" ! #: eval.c:545 #, c-format msgid "for loop: array `%s' changed size from %d to %d during loop execution" msgstr "(`%s' êøòî) äàìåìä òåöéá êìäîá %d-î %d-ì äðåù êøòî ìù åìãåâ :for úàìåì" ! #: eval.c:569 msgid "`break' outside a loop is not portable" msgstr "éìéáèøåô åðéà äàìåìì õåçî `break'" ! #: eval.c:573 msgid "`break' outside a loop is not allowed" msgstr "äàìåìì õåçî `break'-á ùîúùäì ïéà" ! #: eval.c:592 msgid "`continue' outside a loop is not portable" msgstr "éìéáèøåô åðéà äàìåìì õåçî `continue'" ! #: eval.c:596 msgid "`continue' outside a loop is not allowed" msgstr "äàìåìì õåçî `continue'-á ùîúùäì ïéà" ! #: eval.c:626 msgid "`next' cannot be called from a BEGIN rule" msgstr "BEGIN éììë êåúî `next'-ì àåø÷ì ïéà" ! #: eval.c:628 msgid "`next' cannot be called from an END rule" msgstr "END éììë êåúî `next'-ì àåø÷ì ïéà" ! #: eval.c:640 msgid "`nextfile' cannot be called from a BEGIN rule" msgstr "BEGIN éììë êåúî `nextfile'-ì àåø÷ì ïéà" ! #: eval.c:642 msgid "`nextfile' cannot be called from an END rule" msgstr "END éììë êåúî `nextfile'-ì àåø÷ì ïéà" ! #: eval.c:683 msgid "statement has no effect" msgstr "úéìëú-úìåèð äàøåä" ! #: eval.c:717 eval.c:747 eval.c:1617 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "`%s' ìçåúî-éúìá äðúùîì äéðôä" ! #: eval.c:725 eval.c:1603 #, c-format msgid "can't use function name `%s' as variable or array" msgstr "êøòî åà äðúùîë `%s' äéö÷ðåô íùá ùîúùäì ïéà" ! #: eval.c:732 eval.c:738 eval.c:1742 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "`%s' ìçåúî-éúìá èðîåâøàì äéðôä" ! #: eval.c:826 msgid "assignment used in conditional context" msgstr "éàðú ìù èñ÷èðå÷á äîùäá ùåîéù" ! #: eval.c:917 msgid "" "concatenation: side effects in one expression have changed the length of " "another!" msgstr "" "!øçà éåèéá ìù åëøåà éåðéùì åîøâ ãçà éåèéá áåùéç ìù éàåì-úåòôåú :concatenation" ! #: eval.c:1012 msgid "division by zero attempted" msgstr "ñôàá ä÷åìç ïåéñð" ! #: eval.c:1027 msgid "division by zero attempted in `%%'" msgstr "`%%'-á ñôàá ä÷åìç ïåéñð" ! #: eval.c:1228 msgid "division by zero attempted in `/='" msgstr "`/='-á ñôàá ä÷åìç ïåéñð" ! #: eval.c:1246 msgid "division by zero attempted in `%%='" msgstr "`%%='-á ñôàá ä÷åìç ïåéñð" # This is not translated because it cannot be reworded in Hebrew # without looking awkward. ! #: eval.c:1419 #, c-format msgid "%s (from %s)" ! msgstr "" ! #: eval.c:1467 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "äúæøëäá øùàî íéèðîåâøà øúåé íò `%s' äéö÷ðåôì äàéø÷" ! #: eval.c:1514 #, c-format msgid "function `%s' not defined" msgstr "úøãâåî äðéà `%s' äéö÷ðåô" ! #: eval.c:1516 #, c-format msgid "function %s called\n" msgstr "`%s' äéö÷ðåôì äàéø÷\n" ! #: eval.c:1575 msgid "" "\n" "\t# Function Call Stack:\n" --- 1245,1381 ---- # Hebrew, due to changed directionality. #: msg.c:57 msgid "cmd. line:" ! msgstr "cmd. line:" #: msg.c:123 msgid "warning: " ! msgstr "warning: " #: msg.c:145 msgid "error: " ! msgstr "error: " #: msg.c:178 msgid "fatal: " ! msgstr "fatal: " ! #: eval.c:259 #, c-format msgid "unknown nodetype %d" msgstr "%d ääåæî-éúìá âåñ ìòá node" ! #: eval.c:307 msgid "buffer overflow in genflags2str" msgstr "genflags2str-á õöåç úùéìâ" ! #: eval.c:541 #, c-format msgid "for loop: array `%s' changed size from %d to %d during loop execution" msgstr "(`%s' êøòî) äàìåìä òåöéá êìäîá %d-î %d-ì äðåù êøòî ìù åìãåâ :for úàìåì" ! #: eval.c:565 msgid "`break' outside a loop is not portable" msgstr "éìéáèøåô åðéà äàìåìì õåçî `break'" ! #: eval.c:569 msgid "`break' outside a loop is not allowed" msgstr "äàìåìì õåçî `break'-á ùîúùäì ïéà" ! #: eval.c:588 msgid "`continue' outside a loop is not portable" msgstr "éìéáèøåô åðéà äàìåìì õåçî `continue'" ! #: eval.c:592 msgid "`continue' outside a loop is not allowed" msgstr "äàìåìì õåçî `continue'-á ùîúùäì ïéà" ! #: eval.c:622 msgid "`next' cannot be called from a BEGIN rule" msgstr "BEGIN éììë êåúî `next'-ì àåø÷ì ïéà" ! #: eval.c:624 msgid "`next' cannot be called from an END rule" msgstr "END éììë êåúî `next'-ì àåø÷ì ïéà" ! #: eval.c:636 msgid "`nextfile' cannot be called from a BEGIN rule" msgstr "BEGIN éììë êåúî `nextfile'-ì àåø÷ì ïéà" ! #: eval.c:638 msgid "`nextfile' cannot be called from an END rule" msgstr "END éììë êåúî `nextfile'-ì àåø÷ì ïéà" ! #: eval.c:679 msgid "statement has no effect" msgstr "úéìëú-úìåèð äàøåä" ! #: eval.c:713 eval.c:743 eval.c:1622 #, c-format msgid "reference to uninitialized variable `%s'" msgstr "`%s' ìçåúî-éúìá äðúùîì äéðôä" ! #: eval.c:721 eval.c:1608 #, c-format msgid "can't use function name `%s' as variable or array" msgstr "êøòî åà äðúùîë `%s' äéö÷ðåô íùá ùîúùäì ïéà" ! #: eval.c:728 eval.c:734 eval.c:1747 #, c-format msgid "reference to uninitialized argument `%s'" msgstr "`%s' ìçåúî-éúìá èðîåâøàì äéðôä" ! #: eval.c:823 msgid "assignment used in conditional context" msgstr "éàðú ìù èñ÷èðå÷á äîùäá ùåîéù" ! #: eval.c:914 msgid "" "concatenation: side effects in one expression have changed the length of " "another!" msgstr "" "!øçà éåèéá ìù åëøåà éåðéùì åîøâ ãçà éåèéá áåùéç ìù éàåì-úåòôåú :concatenation" ! #: eval.c:1013 msgid "division by zero attempted" msgstr "ñôàá ä÷åìç ïåéñð" ! #: eval.c:1028 ! #, c-format msgid "division by zero attempted in `%%'" msgstr "`%%'-á ñôàá ä÷åìç ïåéñð" ! #: eval.c:1236 msgid "division by zero attempted in `/='" msgstr "`/='-á ñôàá ä÷åìç ïåéñð" ! #: eval.c:1254 ! #, c-format msgid "division by zero attempted in `%%='" msgstr "`%%='-á ñôàá ä÷åìç ïåéñð" # This is not translated because it cannot be reworded in Hebrew # without looking awkward. ! #: eval.c:1424 #, c-format msgid "%s (from %s)" ! msgstr "%s (from %s)" ! #: eval.c:1472 #, c-format msgid "function `%s' called with more arguments than declared" msgstr "äúæøëäá øùàî íéèðîåâøà øúåé íò `%s' äéö÷ðåôì äàéø÷" ! #: eval.c:1519 #, c-format msgid "function `%s' not defined" msgstr "úøãâåî äðéà `%s' äéö÷ðåô" ! #: eval.c:1521 #, c-format msgid "function %s called\n" msgstr "`%s' äéö÷ðåôì äàéø÷\n" ! #: eval.c:1580 msgid "" "\n" "\t# Function Call Stack:\n" *************** *** 1386,1430 **** "\t# :úåéö÷ðåôì úåàéø÷ä úéðñçî\n" "\n" ! #: eval.c:1578 msgid "\t# -- main --\n" ! msgstr "" ! #: eval.c:1754 msgid "attempt to field reference from non-numeric value" msgstr "øôñî åðéàù êøò úåòöîàá äãùì äéðôä ïåéñð" ! #: eval.c:1756 msgid "attempt to reference from null string" msgstr "ä÷éø úæåøçî úåòöîàá äãùì äéðôä ïåéñð" ! #: eval.c:1762 #, c-format msgid "attempt to access field %d" msgstr "%d 'ñî äãùì äùéâ ïåéñð" ! #: eval.c:1778 #, c-format msgid "attempt to use scalar parameter `%s' as an array" msgstr "êøòî äéä åìéàë `%s' éøì÷ñ øèîøôá ùåîéù ïåéñð" ! #: eval.c:1869 msgid "`IGNORECASE' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `IGNORECASE'" ! #: eval.c:1897 msgid "`BINMODE' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `BINMODE'" ! #: eval.c:2009 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "äðé÷ú `%sFMT' úøãâä åðéà `%s'" ! #: eval.c:2075 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "`LINT'-ì êøò úîùä á÷ò `--lint' ìèáî" #: io.c:240 #, c-format msgid "cannot open file `%s' for reading (%s)" --- 1385,1433 ---- "\t# :úåéö÷ðåôì úåàéø÷ä úéðñçî\n" "\n" ! #: eval.c:1583 msgid "\t# -- main --\n" ! msgstr "\t# -- main --\n" ! #: eval.c:1759 msgid "attempt to field reference from non-numeric value" msgstr "øôñî åðéàù êøò úåòöîàá äãùì äéðôä ïåéñð" ! #: eval.c:1761 msgid "attempt to reference from null string" msgstr "ä÷éø úæåøçî úåòöîàá äãùì äéðôä ïåéñð" ! #: eval.c:1767 #, c-format msgid "attempt to access field %d" msgstr "%d 'ñî äãùì äùéâ ïåéñð" ! #: eval.c:1783 #, c-format msgid "attempt to use scalar parameter `%s' as an array" msgstr "êøòî äéä åìéàë `%s' éøì÷ñ øèîøôá ùåîéù ïåéñð" ! #: eval.c:1874 msgid "`IGNORECASE' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `IGNORECASE'" ! #: eval.c:1902 msgid "`BINMODE' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä åðéä `BINMODE'" ! #: eval.c:2014 #, c-format msgid "bad `%sFMT' specification `%s'" msgstr "äðé÷ú `%sFMT' úøãâä åðéà `%s'" ! #: eval.c:2080 msgid "turning off `--lint' due to assignment to `LINT'" msgstr "`LINT'-ì êøò úîùä á÷ò `--lint' ìèáî" + #: eval.c:2116 + msgid "NF set to negative value" + msgstr "éìéìù êøò ìáé÷ NF" + #: io.c:240 #, c-format msgid "cannot open file `%s' for reading (%s)" *************** *** 1495,1507 **** "reached system limit for open files: starting to multiplex file descriptors" msgstr "èìô/èì÷ éöåøò áåáéø úìéçú ;íéçåúô íéöá÷ øôñî ìù úëøòî úìáâîì äòâä" - #. do_lint && #: io.c:679 #, c-format msgid "close of `%s' failed (%s)." msgstr "`%s' úøéâñá (%s) äì÷ú" - #. surely this is the only reason ??? #: io.c:686 msgid "too many pipes or input files open" msgstr "úéðîæ-åá íéçåúô èì÷ éöá÷ åà (pipes) íé÷éôà éãî øúåé" --- 1498,1508 ---- *************** *** 1515,1521 **** msgid "close: `%.*s' is not an open file, pipe or co-process" msgstr "ìéá÷î êéìäú åà çåúô ÷éôà ,çåúô õáå÷ åðéà `%.*s' :close" - #. update ERRNO manually, using errno = ENOENT is a stretch. #: io.c:727 msgid "close of redirection that was never opened" msgstr "íìåòî äçúôð àìù äééðôä úøéâñ" --- 1516,1521 ---- *************** *** 1580,1586 **** msgid "file flush of `%s' failed (%s)." msgstr "`%s' ìù õáå÷ éðåúð õöåç ïå÷éøá (%s) äì÷ú" - #. /inet/raw client not ready yet #: io.c:1048 msgid "/inet/raw client not ready yet, sorry" msgstr "ïëåî íøè /inet/raw çå÷ì ,íéøòèöî" --- 1580,1585 ---- *************** *** 1589,1595 **** msgid "only root may use `/inet/raw'." msgstr "ãáìá root ùîúùîì øúåî `inet/raw'-á ùåîéù" - #. /inet/raw server not ready yet #: io.c:1085 msgid "/inet/raw server not ready yet, sorry" msgstr "ïëåî íøè /inet/raw úøù ,íéøòèöî" --- 1588,1593 ---- *************** *** 1626,1632 **** msgid "TCP/IP communications are not supported" msgstr "TCP/IP úøåù÷úá äëéîú ïéà" ! #: io.c:1257 io.c:1446 #, c-format msgid "file `%s' is a directory" msgstr "äé÷éú åðéä `%s' õáå÷" --- 1624,1630 ---- msgid "TCP/IP communications are not supported" msgstr "TCP/IP úøåù÷úá äëéîú ïéà" ! #: io.c:1257 io.c:1438 #, c-format msgid "file `%s' is a directory" msgstr "äé÷éú åðéä `%s' õáå÷" *************** *** 1636,1717 **** msgid "use `PROCINFO[\"%s\"]' instead of `%s'" msgstr "`PROCINFO[\"%s\"]'-á ùîúùäì óéãò `%s' íå÷îá" ! #: io.c:1363 msgid "use `PROCINFO[...]' instead of `/dev/user'" msgstr "`/dev/user' éðô-ìò óéãò `PROCINFO[...]'-á ùåîéù" # This probably sounds nonsensical in Hebrew, but what can I do, # given the original message text? ! #: io.c:1432 #, c-format msgid "could not open `%s', mode `%s'" msgstr "`%s' øåáò `%s' äìåòô ïôåà úçéúôá ïåìùë" ! #: io.c:1544 io.c:1665 ! #, c-format ! msgid "close of stdout in child failed (%s)" ! msgstr "úá-úéðëúá stdout úøéâñá (%s) äì÷ú" ! ! #: io.c:1547 io.c:1668 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "úá-úéðëúá stdout-ì ÷éôà ìåôëùá (dup: %s) äì÷ú" ! #: io.c:1549 ! #, c-format ! msgid "close of stdin in child failed (%s)" ! msgstr "úá-úéðëúá stdin úøéâñá (%s) äì÷ú" ! ! #: io.c:1552 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "úá-úéðëúá stdin-ì ÷éôà ìåôëùá (dup: %s) äì÷ú" ! #: io.c:1555 io.c:1670 io.c:1678 #, c-format ! msgid "close of pipe failed (%s)" ! msgstr "÷éôà úøéâñá (%s) äì÷ú" ! #: io.c:1584 #, c-format ! msgid "pipe from `%s': could not set close-on-exec (fcntl: %s)" ! msgstr "`%s'-î èì÷ ÷éôà øåáò close-on-exec ïééôàî úìòôäá (fcntl: %s) äì÷ú" ! #: io.c:1588 #, c-format ! msgid "pipe to `%s': could not set close-on-exec (fcntl: %s)" ! msgstr "`%s'-ì èìô ÷éôà øåáò close-on-exec ïééôàî úìòôäá (fcntl: %s) äì÷ú" ! #: io.c:1598 msgid "`|&' not supported" msgstr "`|&'-á äëéîú ïéà" ! #: io.c:1662 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "`%s' ÷éôà úçéúôá (%s) äì÷ú" ! #: io.c:1675 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "`%s' úá-úéðëúì êéìäú úøéöéá (fork: %s) äì÷ú" ! #: io.c:2004 #, c-format msgid "data file `%s' is empty" msgstr "÷éø åðéä `%s' íéðåúð õáå÷" ! #: io.c:2071 #, c-format msgid "internal error: file `%s', line %d\n" msgstr "`%s' õáå÷ ìù %d äøåùá úéîéðô äðëú äàéâù\n" ! #: io.c:2173 #, c-format msgid "error reading input file `%s': %s" msgstr "`%s' õáå÷ úàéø÷á (%s) äì÷ú" ! #: io.c:2392 msgid "multicharacter value of `RS' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä äðéä `RS' ìù êøòá íéåú øôñîá äëéîú" --- 1634,1713 ---- msgid "use `PROCINFO[\"%s\"]' instead of `%s'" msgstr "`PROCINFO[\"%s\"]'-á ùîúùäì óéãò `%s' íå÷îá" ! #: io.c:1359 msgid "use `PROCINFO[...]' instead of `/dev/user'" msgstr "`/dev/user' éðô-ìò óéãò `PROCINFO[...]'-á ùåîéù" # This probably sounds nonsensical in Hebrew, but what can I do, # given the original message text? ! #: io.c:1424 #, c-format msgid "could not open `%s', mode `%s'" msgstr "`%s' øåáò `%s' äìåòô ïôåà úçéúôá ïåìùë" ! #: io.c:1550 io.c:1602 io.c:1732 io.c:1754 #, c-format msgid "moving pipe to stdout in child failed (dup: %s)" msgstr "úá-úéðëúá stdout-ì ÷éôà ìåôëùá (dup: %s) äì÷ú" ! #: io.c:1554 io.c:1607 #, c-format msgid "moving pipe to stdin in child failed (dup: %s)" msgstr "úá-úéðëúá stdin-ì ÷éôà ìåôëùá (dup: %s) äì÷ú" ! #: io.c:1571 io.c:1745 ! msgid "restoring stdout in parent process failed\n" ! msgstr "áà-úéðëúá stdout ÷éôà øåæçùá äì÷ú\n" ! ! #: io.c:1576 ! msgid "restoring stdin in parent process failed\n" ! msgstr "áà-úéðëúá stdin ÷éôà øåæçùá äì÷ú\n" ! ! #: io.c:1599 io.c:1751 #, c-format ! msgid "close of stdout in child failed (%s)" ! msgstr "úá-úéðëúá stdout úøéâñá (%s) äì÷ú" ! #: io.c:1604 #, c-format ! msgid "close of stdin in child failed (%s)" ! msgstr "úá-úéðëúá stdin úøéâñá (%s) äì÷ú" ! #: io.c:1610 io.c:1756 io.c:1767 #, c-format ! msgid "close of pipe failed (%s)" ! msgstr "÷éôà úøéâñá (%s) äì÷ú" ! #: io.c:1655 msgid "`|&' not supported" msgstr "`|&'-á äëéîú ïéà" ! #: io.c:1722 #, c-format msgid "cannot open pipe `%s' (%s)" msgstr "`%s' ÷éôà úçéúôá (%s) äì÷ú" ! #: io.c:1763 #, c-format msgid "cannot create child process for `%s' (fork: %s)" msgstr "`%s' úá-úéðëúì êéìäú úøéöéá (fork: %s) äì÷ú" ! #: io.c:2104 #, c-format msgid "data file `%s' is empty" msgstr "÷éø åðéä `%s' íéðåúð õáå÷" ! #: io.c:2175 #, c-format msgid "internal error: file `%s', line %d\n" msgstr "`%s' õáå÷ ìù %d äøåùá úéîéðô äðëú äàéâù\n" ! #: io.c:2277 #, c-format msgid "error reading input file `%s': %s" msgstr "`%s' õáå÷ úàéø÷á (%s) äì÷ú" ! #: io.c:2521 msgid "multicharacter value of `RS' is a gawk extension" msgstr "gawk-ì úéôéöôñ äáçøä äðéä `RS' ìù êøòá íéåú øôñîá äëéîú" *************** *** 1736,1745 **** msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "éìåìéî åúë ìôåè `\\%c' äø÷á úøãñá `%c' åú" ! # Not translated because it's impossible to reword this in Hebrew: ! # the leading "%s %s `%s'" gets converted to "pipe from `foo'", where ! # both "file" and "from" are in English. FIXME. #: posix/gawkmisc.c:122 #, c-format ! msgid "%s %s `%s': could not set close-on-exec: %s" ! msgstr "" --- 1732,1743 ---- msgid "escape sequence `\\%c' treated as plain `%c'" msgstr "éìåìéî åúë ìôåè `\\%c' äø÷á úøãñá `%c' åú" ! #: re.c:208 ! #, c-format ! msgid "regex match failed, not enough memory to match string \"%.*s%s\"" ! msgstr "\"%.*s%s\" úæåøçî úîàúäì ïåøëæ éã ïéà ,ìùëð éøìåâø éåèéáì äîàúä ùåôéç" ! #: posix/gawkmisc.c:122 #, c-format ! msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)" ! msgstr "%s %s `%s' øåáò close-on-exec ïééôàî úìòôäá (fcntl: %s) äì÷ú" diff -crN gawk-3.1.0/po/insert-header.sin gawk-3.1.1/po/insert-header.sin *** gawk-3.1.0/po/insert-header.sin Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/insert-header.sin Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,23 ---- + # Sed script that inserts the file called HEADER before the header entry. + # + # At each occurrence of a line starting with "msgid ", we execute the following + # commands. At the first occurrence, insert the file. At the following + # occurrences, do nothing. The distinction between the first and the following + # occurrences is achieved by looking at the hold space. + /^msgid /{ + x + # Test if the hold space is empty. + s/m/m/ + ta + # Yes it was empty. First occurrence. Read the file. + r HEADER + # Output the file's contents by reading the next line. But don't lose the + # current line while doing this. + g + N + bb + :a + # The hold space was nonempty. Following occurrences. Do nothing. + x + :b + } diff -crN gawk-3.1.0/po/it.po gawk-3.1.1/po/it.po *** gawk-3.1.0/po/it.po Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/it.po Wed May 1 16:40:59 2002 *************** *** 0 **** --- 1,1749 ---- + # Italian messages for GNU Awk + # Copyright (C) 2002 Free Software Foundation, Inc. + # Antonio Colombo , 2002. + # + msgid "" + msgstr "" + "Project-Id-Version: gawk 3.1.35\n" + "POT-Creation-Date: 2002-05-01 16:40+0300\n" + "PO-Revision-Date: 2002-04-21 22:22+0100\n" + "Last-Translator: Antonio Colombo \n" + "Language-Team: Italian \n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=ISO-8859-8\n" + "Content-Transfer-Encoding: 8-bit\n" + + #: array.c:243 array.c:275 array.c:280 eval.c:483 + #, c-format + msgid "attempt to use scalar `%s' as array" + msgstr "tentativo di usare scalare '%s' come vettore" + + #: array.c:304 + #, c-format + msgid "reference to uninitialized element `%s[\"%s\"]'" + msgstr "referenza a elemento non inizializzato `%s[\"%s\"]'" + + #: array.c:310 + #, c-format + msgid "subscript of array `%s' is null string" + msgstr "l'indice del vettore '%s' è una stringa nulla" + + #: array.c:373 array.c:456 + #, c-format + msgid "delete: illegal use of variable `%s' as array" + msgstr "delete: use non permesso della variabile `%s' come vettore" + + #: array.c:406 + #, c-format + msgid "delete: index `%s' not in array `%s'" + msgstr "delete: indice `%s' non presente nel vettore `%s'" + + #: array.c:571 + #, c-format + msgid "%s: empty (null)\n" + msgstr "%s: vuoto (nullo)\n" + + #: array.c:576 + #, c-format + msgid "%s: empty (zero)\n" + msgstr "%s: vuoto (zero)\n" + + #: array.c:580 + #, c-format + msgid "%s: table_size = %d, array_size = %d\n" + msgstr "%s: dimensione_tabella = %d, dimensione_vettore = %d\n" + + #: array.c:612 + #, c-format + msgid "%s: is parameter\n" + msgstr "%s: è parametro\n" + + #: array.c:617 + #, c-format + msgid "%s: array_ref to %s\n" + msgstr "%s: referenza_vettoriale a %s\n" + + #: array.c:844 + msgid "asort: first argument is not an array" + msgstr "asort: il primo argomento non è un vettore" + + #: array.c:853 + msgid "asort: second argument is not an array" + msgstr "asort: il secondo argomento non è un vettore" + + #: builtin.c:107 + #, c-format + msgid "%s to \"%s\" failed (%s)" + msgstr "%s a \"%s\" fallita (%s)" + + #: builtin.c:108 + msgid "standard output" + msgstr "standard output" + + #: builtin.c:109 + msgid "reason unknown" + msgstr "ragione indeterminata" + + #: builtin.c:122 + msgid "exp: received non-numeric argument" + msgstr "exp: argomento non numerico" + + #: builtin.c:128 + #, c-format + msgid "exp: argument %g is out of range" + msgstr "exp: argomento %g non accettabile" + + #: builtin.c:186 + #, c-format + msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" + msgstr "" + "fflush: non posso scaricare: 'pipe' `%s' aperta in lettura, non in scrittura" + + #: builtin.c:189 + #, c-format + msgid "fflush: cannot flush: file `%s' opened for reading, not writing" + msgstr "" + "fflush: non posso scaricare: file `%s' aperto in lettura, non in scrittura" + + #: builtin.c:201 + #, c-format + msgid "fflush: `%s' is not an open file, pipe or co-process" + msgstr "fflush: `%s' non è un file aperto, una 'pipe' o un co-processo" + + #: builtin.c:295 + msgid "index: received non-string first argument" + msgstr "index: il primo argomento non è una stringa" + + #: builtin.c:297 + msgid "index: received non-string second argument" + msgstr "index: il secondo argomento non è una stringa" + + #: builtin.c:407 + msgid "int: received non-numeric argument" + msgstr "int: argomento non numerico" + + #: builtin.c:424 + msgid "length: received non-string argument" + msgstr "length: l'argomento non è una stringa" + + #: builtin.c:440 + msgid "log: received non-numeric argument" + msgstr "log: argomento non numerico" + + #: builtin.c:443 + #, c-format + msgid "log: received negative argument %g" + msgstr "log: argomento negativo %g" + + #: builtin.c:605 builtin.c:608 + msgid "must use `count$' on all formats or none" + msgstr "'count$' va usato per tutti i formati o per nessuno" + + #: builtin.c:703 + msgid "`$' is not permitted in awk formats" + msgstr "`$' non permesso nei 'format' awk" + + #: builtin.c:709 + msgid "arg count with `$' must be > 0" + msgstr "il numero di argomento con `$' deve essere > 0" + + #: builtin.c:711 + #, c-format + msgid "arg count %d greater than total number of supplied arguments" + msgstr "" + "numero di argomento %d maggiore del numero totale di argomenti specificati" + + #: builtin.c:713 + msgid "`$' not permitted after period in format" + msgstr "`$' non permesso dopo un punto nel 'format'" + + #: builtin.c:726 + msgid "no `$' supplied for positional field width or precision" + msgstr "" + "nessun `$' specificato per larghezza o precisione di un campo posizionale" + + #: builtin.c:784 + msgid "`l' is meaningless in awk formats; ignored" + msgstr "`l' non ha senso nei 'format' awk; ignorata" + + #: builtin.c:788 + msgid "`l' is not permitted in POSIX awk formats" + msgstr "`l' non permessa nei 'format' awk POSIX" + + #: builtin.c:799 + msgid "`L' is meaningless in awk formats; ignored" + msgstr "`L' non ha senso nei 'format' awk; ignorata" + + #: builtin.c:803 + msgid "`L' is not permitted in POSIX awk formats" + msgstr "`L' non permessa nei 'format' awk POSIX" + + #: builtin.c:814 + msgid "`h' is meaningless in awk formats; ignored" + msgstr "`h' non ha senso nei 'format' awk; ignorata" + + #: builtin.c:818 + msgid "`h' is not permitted in POSIX awk formats" + msgstr "`h' non permessa nei 'format' awk POSIX" + + #: builtin.c:1067 + msgid "not enough arguments to satisfy format string" + msgstr "mancano argomenti per completare il 'format'" + + #: builtin.c:1069 + msgid "^ ran out for this one" + msgstr "^ uscito per questo" + + #: builtin.c:1074 + msgid "[s]printf: format specifier does not have control letter" + msgstr "[s]printf: il designatore di 'format' non ha una lettera di controllo" + + #: builtin.c:1077 + msgid "too many arguments supplied for format string" + msgstr "troppi argomenti specificati per il 'format'" + + #: builtin.c:1120 builtin.c:1123 + msgid "printf: no arguments" + msgstr "printf: manca argomento" + + #: builtin.c:1156 + msgid "sqrt: received non-numeric argument" + msgstr "sqrt: argomento non numerico" + + #: builtin.c:1160 + #, c-format + msgid "sqrt: called with negative argument %g" + msgstr "sqrt: chiamata con argomento negativo %g" + + #: builtin.c:1182 + #, c-format + msgid "substr: start index %g is invalid, using 1" + msgstr "substr: indice di partenza %g invalido, uso 1" + + #: builtin.c:1187 + #, c-format + msgid "substr: non-integer start index %g will be truncated" + msgstr "substr: indice di partenza non intero %g: sarà troncato" + + #: builtin.c:1201 + #, c-format + msgid "substr: length %g is <= 0" + msgstr "substr: lunghezza %g <= 0" + + #: builtin.c:1207 + #, c-format + msgid "substr: non-integer length %g will be truncated" + msgstr "substr: lunghezza non intera %g: sarà truncata" + + #: builtin.c:1214 + msgid "substr: source string is zero length" + msgstr "substr: stringa di partenza lunga zero" + + #: builtin.c:1221 + #, c-format + msgid "" + "substr: length %d at start index %d exceeds length of first argument (%d)" + msgstr "" + "substr: lunghezza %d dell'indice di partenza %d supera lunghezza del primo " + "argomento (%d)" + + #: builtin.c:1227 + #, c-format + msgid "substr: start index %d is past end of string" + msgstr "substr: indice di partenza %d supera la fine della stringa" + + #: builtin.c:1263 + msgid "strftime: received non-string first argument" + msgstr "strftime: il primo argomento non è una stringa" + + #: builtin.c:1269 + msgid "strftime: received empty format string" + msgstr "strftime: 'format' è una stringa nulla" + + #: builtin.c:1278 + msgid "strftime: received non-numeric second argument" + msgstr "strftime: il secondo argomento non è numerico" + + #: builtin.c:1341 + msgid "mktime: received non-string argument" + msgstr "mktime: l'argomento non è una stringa" + + #: builtin.c:1386 + msgid "system: received non-string argument" + msgstr "system: l'argomento non è una stringa" + + #: builtin.c:1512 + msgid "tolower: received non-string argument" + msgstr "tolower: l'argomento non è una stringa" + + #: builtin.c:1561 + msgid "toupper: received non-string argument" + msgstr "toupper: l'argomento non è una stringa" + + #: builtin.c:1606 + msgid "atan2: received non-numeric first argument" + msgstr "atan2: il primo argomento non è numerico" + + #: builtin.c:1608 + msgid "atan2: received non-numeric second argument" + msgstr "atan2: il secondo argomento non è numerico" + + #: builtin.c:1627 + msgid "sin: received non-numeric argument" + msgstr "sin: l'argomento non è numerico" + + #: builtin.c:1643 + msgid "cos: received non-numeric argument" + msgstr "cos: l'argomento non è numerico" + + #: builtin.c:1687 + msgid "srand: received non-numeric argument" + msgstr "srand: l'argomento non è numerico" + + #: builtin.c:1721 + msgid "match: third argument is not an array" + msgstr "match: il terzo argomento non è un vettore" + + #: builtin.c:2157 + msgid "gensub: 3rd argument of 0 treated as 1" + msgstr "gensub: il terzo argomento è 0, trattato come 1" + + #: builtin.c:2268 builtin.c:2270 + msgid "lshift: received non-numeric first argument" + msgstr "lshift: il primo argomento non è numerico" + + #: builtin.c:2272 + #, c-format + msgid "lshift(%lf, %lf): negative values will give strange results" + msgstr "lshift(%lf, %lf): valori negativi daranno risultati strani" + + #: builtin.c:2274 + #, c-format + msgid "lshift(%lf, %lf): fractional values will be truncated" + msgstr "lshift(%lf, %lf): valori con decimali verranno troncati" + + #: builtin.c:2276 + #, c-format + msgid "lshift(%lf, %lf): too large shift value will give strange results" + msgstr "lshift(%lf, %lf): valori troppo alti daranno risultati strani" + + #: builtin.c:2305 builtin.c:2307 + msgid "rshift: received non-numeric first argument" + msgstr "rshift: il primo argomento non è numerico" + + #: builtin.c:2309 + #, c-format + msgid "rshift(%lf, %lf): negative values will give strange results" + msgstr "rshift(%lf, %lf): valori negativi daranno risultati strani" + + #: builtin.c:2311 + #, c-format + msgid "rshift(%lf, %lf): fractional values will be truncated" + msgstr "rshift(%lf, %lf): valori con decimali verranno troncati" + + #: builtin.c:2313 + #, c-format + msgid "rshift(%lf, %lf): too large shift value will give strange results" + msgstr "rshift(%lf, %lf): valori troppo alti daranno risultati strani" + + #: builtin.c:2342 builtin.c:2344 + msgid "and: received non-numeric first argument" + msgstr "and: il primo argomento non è numerico" + + #: builtin.c:2346 + #, c-format + msgid "and(%lf, %lf): negative values will give strange results" + msgstr "and(%lf, %lf): valori negativi daranno risultati strani" + + #: builtin.c:2348 + #, c-format + msgid "and(%lf, %lf): fractional values will be truncated" + msgstr "and(%lf, %lf): valori con decimali verranno troncati" + + #: builtin.c:2377 builtin.c:2379 + msgid "or: received non-numeric first argument" + msgstr "or: il primo argomento non è numerico" + + #: builtin.c:2381 + #, c-format + msgid "or(%lf, %lf): negative values will give strange results" + msgstr "or(%lf, %lf): valori negativi daranno risultati strani" + + #: builtin.c:2383 + #, c-format + msgid "or(%lf, %lf): fractional values will be truncated" + msgstr "or(%lf, %lf): valori con decimali verranno troncati" + + #: builtin.c:2412 builtin.c:2414 + msgid "xor: received non-numeric first argument" + msgstr "xor: il primo argomento non è numerico" + + #: builtin.c:2416 + #, c-format + msgid "xor(%lf, %lf): negative values will give strange results" + msgstr "xor(%lf, %lf): valori negativi daranno risultati strani" + + #: builtin.c:2418 + #, c-format + msgid "xor(%lf, %lf): fractional values will be truncated" + msgstr "xor(%lf, %lf): valori con decimali verranno troncati" + + #: builtin.c:2446 + msgid "compl: received non-numeric argument" + msgstr "compl: l'argomento non è numerico" + + #: builtin.c:2448 + #, c-format + msgid "compl(%lf): negative value will give strange results" + msgstr "compl(%lf): valore negativo darà risultati strani" + + #: builtin.c:2450 + #, c-format + msgid "compl(%lf): fractional value will be truncated" + msgstr "compl(%lf): valore con decimali verrà troncato" + + #: builtin.c:2621 + #, c-format + msgid "dcgettext: `%s' is not a valid locale category" + msgstr "dcgettext: `%s' non è una categoria 'locale' valida" + + #: ext.c:60 ext.c:64 + msgid "`extension' is a gawk extension" + msgstr "`extension' è un'estensione gawk" + + #: ext.c:74 + #, c-format + msgid "extension: cannot open `%s' (%s)\n" + msgstr "extension: non riesco ad aprire `%s' (%s)\n" + + #: ext.c:82 + #, c-format + msgid "extension: library `%s': cannot call function `%s' (%s)\n" + msgstr "extension: biblioteca `%s': non riesco a chiamare funzione `%s' (%s)\n" + + #: ext.c:180 + msgid "Operation Not Supported" + msgstr "Operazione Non Supportata" + + #: getopt.c:692 getopt.c:704 + #, c-format + msgid "%s: option `%s' is ambiguous\n" + msgstr "%s: opzione `%s' ambigua\n" + + #: getopt.c:737 getopt.c:741 + #, c-format + msgid "%s: option `--%s' doesn't allow an argument\n" + msgstr "%s: opzione `--%s' non prevede un argomento\n" + + #: getopt.c:750 getopt.c:755 + #, c-format + msgid "%s: option `%c%s' doesn't allow an argument\n" + msgstr "%s: opzione `%c%s' non prevede un argomento\n" + + #: getopt.c:791 getopt.c:804 getopt.c:1093 getopt.c:1106 + #, c-format + msgid "%s: option `%s' requires an argument\n" + msgstr "%s: opzione `%s' richiede un argomento\n" + + #: getopt.c:842 getopt.c:845 + #, c-format + msgid "%s: unrecognized option `--%s'\n" + msgstr "%s: opzione sconosciuta `--%s'\n" + + #: getopt.c:853 getopt.c:856 + #, c-format + msgid "%s: unrecognized option `%c%s'\n" + msgstr "%s: opzione sconosciuta `%c%s'\n" + + #: getopt.c:903 getopt.c:906 + #, c-format + msgid "%s: illegal option -- %c\n" + msgstr "%s: opzione non permessa -- %c\n" + + #: getopt.c:912 getopt.c:915 + #, c-format + msgid "%s: invalid option -- %c\n" + msgstr "%s: opzione non valida -- %c\n" + + #: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412 + #, c-format + msgid "%s: option requires an argument -- %c\n" + msgstr "%s: l'opzione richiede un argomento -- %c\n" + + #: getopt.c:1025 getopt.c:1036 + #, c-format + msgid "%s: option `-W %s' is ambiguous\n" + msgstr "%s: opzione `-W %s' ambigua\n" + + #: getopt.c:1060 getopt.c:1072 + #, c-format + msgid "%s: option `-W %s' doesn't allow an argument\n" + msgstr "%s: opzione `-W %s' non prevede un argomento\n" + + #: main.c:307 + msgid "`-m[fr]' option irrelevant in gawk" + msgstr "`-m[fr]' opzione irrilevante per gawk" + + #: main.c:309 + msgid "-m option usage: `-m[fr] nnn'" + msgstr "-m uso opzione: `-m[fr] nnn'" + + #: main.c:326 + #, c-format + msgid "%s: option `-W %s' unrecognized, ignored\n" + msgstr "%s: opzione `-W %s' non riconosciuta, ignorata\n" + + #: main.c:357 + msgid "empty argument to `--source' ignored" + msgstr "argomento di `--source' mancante, comando ignorato" + + #: main.c:429 + msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" + msgstr "variable d'ambiente `POSIXLY_CORRECT' impostata: attivo `--posix'" + + #: main.c:434 + msgid "`--posix' overrides `--traditional'" + msgstr "`--posix' annulla `--traditional'" + + #: main.c:445 + msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" + msgstr "`--posix'/`--traditional' annulla `--non-decimal-data'" + + #: main.c:449 + #, c-format + msgid "running %s setuid root may be a security problem" + msgstr "eseguire %s con 'setuid' root può essere un rischio per la sicurezza" + + #: main.c:478 + #, c-format + msgid "can't set mode on stdin (%s)" + msgstr "non posso impostare mode su 'stdin'(%s)" + + #: main.c:481 + #, c-format + msgid "can't set mode on stdout (%s)" + msgstr "non posso impostare mode su 'stdout'(%s)" + + #: main.c:483 + #, c-format + msgid "can't set mode on stderr (%s)" + msgstr "non posso impostare mode su 'stderr'(%s)" + + #: main.c:512 + msgid "no program text at all!" + msgstr "manca del tutto il testo del programma!" + + #: main.c:556 + #, c-format + msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" + msgstr "Uso: %s [opzioni in stile POSIX o GNU] -f fileprog [--] file ...\n" + + #: main.c:558 + #, c-format + msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" + msgstr "Usage: %s [opzioni in stile POSIX o GNU] [--] %cprogramma%c file ...\n" + + #: main.c:563 + msgid "POSIX options:\t\tGNU long options:\n" + msgstr "Opzioni POSIX:\t\topzioni lunghe GNU:\n" + + #: main.c:564 + msgid "\t-f progfile\t\t--file=progfile\n" + msgstr "\t-f fileprog\t\t--file=fileprog\n" + + #: main.c:565 + msgid "\t-F fs\t\t\t--field-separator=fs\n" + msgstr "\t-F fs\t\t\t--field-separator=fs\n" + + #: main.c:566 + msgid "\t-v var=val\t\t--assign=var=val\n" + msgstr "\t-v var=valore\t\t--assign=var=valore\n" + + #: main.c:567 + msgid "\t-m[fr] val\n" + msgstr "\t-m[fr] valore\n" + + #: main.c:568 + msgid "\t-W compat\t\t--compat\n" + msgstr "\t-W compat\t\t--compat\n" + + #: main.c:569 + msgid "\t-W copyleft\t\t--copyleft\n" + msgstr "\t-W copyleft\t\t--copyleft\n" + + #: main.c:570 + msgid "\t-W copyright\t\t--copyright\n" + msgstr "\t-W copyright\t\t--copyright\n" + + #: main.c:571 + msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" + msgstr "\t-W dump-variables[=file]\t--dump-variables[=file]\n" + + #: main.c:572 + msgid "\t-W gen-po\t\t--gen-po\n" + msgstr "\t-W gen-po\t\t--gen-po\n" + + #: main.c:573 + msgid "\t-W help\t\t\t--help\n" + msgstr "\t-W help\t\t\t--help\n" + + #: main.c:574 + msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" + msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n" + + #: main.c:575 + msgid "\t-W lint-old\t\t--lint-old\n" + msgstr "\t-W lint-old\t\t--lint-old\n" + + #: main.c:576 + msgid "\t-W non-decimal-data\t--non-decimal-data\n" + msgstr "\t-W non-decimal-data\t--non-decimal-data\n" + + #: main.c:578 + msgid "\t-W nostalgia\t\t--nostalgia\n" + msgstr "\t-W nostalgia\t\t--nostalgia\n" + + #: main.c:581 + msgid "\t-W parsedebug\t\t--parsedebug\n" + msgstr "\t-W parsedebug\t\t--parsedebug\n" + + #: main.c:583 + msgid "\t-W profile[=file]\t--profile[=file]\n" + msgstr "\t-W profile[=file]\t--profile[=file]\n" + + #: main.c:584 + msgid "\t-W posix\t\t--posix\n" + msgstr "\t-W posix\t\t--posix\n" + + #: main.c:585 + msgid "\t-W re-interval\t\t--re-interval\n" + msgstr "\t-W re-interval\t\t--re-interval\n" + + #: main.c:586 + msgid "\t-W source=program-text\t--source=program-text\n" + msgstr "\t-W source=testo-programma\t--source=testo-programma\n" + + #: main.c:587 + msgid "\t-W traditional\t\t--traditional\n" + msgstr "\t-W traditional\t\t--traditional\n" + + #: main.c:588 + msgid "\t-W usage\t\t--usage\n" + msgstr "\t-W usage\t\t--usage\n" + + #: main.c:589 + msgid "\t-W version\t\t--version\n" + msgstr "\t-W version\t\t--version\n" + + #: main.c:593 + msgid "" + "\n" + "To report bugs, see node `Bugs' in `gawk.info', which is\n" + "section `Reporting Problems and Bugs' in the printed version.\n" + "\n" + msgstr "" + "\n" + "Per segnalare problemi, vedi nodo `Bugs' in `gawk.info', oppure la\n" + "sezione `Reporting Problems and Bugs' nella versione a stampa.\n" + "\n" + + #: main.c:597 + msgid "" + "gawk is a pattern scanning and processing language.\n" + "By default it reads standard input and writes standard output.\n" + "\n" + msgstr "" + "gawk è un linguaggio per scandire e processare espressioni.\n" + "Senza parametri, legge da 'standard input' e scrive su 'standard output'.\n" + "\n" + + #: main.c:601 + msgid "" + "Examples:\n" + "\tgawk '{ sum += $1 }; END { print sum }' file\n" + "\tgawk -F: '{ print $1 }' /etc/passwd\n" + msgstr "" + "Esempi:\n" + "\tgawk '{ sum += $1 }; END { print sum }' file\n" + "\tgawk -F: '{ print $1 }' /etc/passwd\n" + + #: main.c:613 + #, c-format + msgid "" + "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" + "\n" + "This program is free software; you can redistribute it and/or modify\n" + "it under the terms of the GNU General Public License as published by\n" + "the Free Software Foundation; either version 2 of the License, or\n" + "(at your option) any later version.\n" + "\n" + msgstr "" + "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" + "\n" + "Questo programma è libero software; lo puoi distribuire e/o modificare\n" + "alle condizioni stabilite nella 'GNU General Public License' pubblicata\n" + "dalla Free Software Foundation; fai riferimento alla versione 2 della\n" + "Licenza, o (a tua scelta) a una qualsiasi versione successiva.\n" + "\n" + + #: main.c:621 + msgid "" + "This program is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "GNU General Public License for more details.\n" + "\n" + msgstr "" + "Questo programma è distribuito con la speranza che sia utile,\n" + "ma SENZA ALCUNA GARANZIA; senza neppure la garanzia implicita\n" + "di COMMERCIABILITA' o UTILITA' per UNO SCOPO PARTICOLARE.\n" + "Vedi la 'GNU General Public License' per ulteriori dettagli.\n" + "\n" + + #: main.c:627 + msgid "" + "You should have received a copy of the GNU General Public License\n" + "along with this program; if not, write to the Free Software\n" + "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + msgstr "" + "Dovresti aver ricevuto una copia della 'GNU General Public License'\n" + "assieme a questo programma; se non è così, scrivi alla Free Software\n" + "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + + #: main.c:657 + msgid "-Ft does not set FS to tab in POSIX awk" + msgstr "-Ft non imposta FS a 'tab' nell'awk POSIX" + + #: main.c:888 + #, c-format + msgid "invalid syntax in name `%s' for variable assignment" + msgstr "sintassi invalida nel nome di variabile `%s'" + + #: main.c:957 + msgid "floating point exception" + msgstr "eccezione floating point" + + #: main.c:964 + msgid "fatal error: internal error" + msgstr "errore fatale: errore interno" + + #: main.c:1014 + #, c-format + msgid "no pre-opened fd %d" + msgstr "manca 'fd' predefinita %d" + + #: main.c:1019 + #, c-format + msgid "could not pre-open /dev/null for fd %d" + msgstr "non riesco a predefinire /dev/null per 'fd' %d" + + #: main.c:1037 main.c:1046 + #, c-format + msgid "could not find groups: %s" + msgstr "non riesco a trovare gruppi: %s" + + #: profile.c:94 + #, c-format + msgid "could not open `%s' for writing: %s" + msgstr "non riesco ad aprire `%s' in scrittura: %s" + + #: profile.c:96 awkgram.y:2465 + msgid "sending profile to standard error" + msgstr "mando profilo a 'standard error'" + + #: profile.c:409 + msgid "internal error: Node_var with null vname" + msgstr "errore interno: 'Node_var' con 'vname' nullo" + + #: profile.c:524 + msgid "internal error: Node_var_array with null vname" + msgstr "errore interno: 'Node_var_array' con 'vname' nullo" + + #: profile.c:554 eval.c:813 + #, c-format + msgid "" + "function `%s' called with space between name and `(',\n" + "%s" + msgstr "" + "funzione `%s' chiamata con spazio tra il nome e `(',\n" + "%s" + + #: profile.c:556 eval.c:815 + msgid "or used in other expression context" + msgstr "o usata nel contesto di altra espressione" + + #: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741 + #, c-format + msgid "attempt to use array `%s' in a scalar context" + msgstr "tentativo di usare vettore `%s' in un contesto scalare" + + #: profile.c:637 eval.c:1047 + #, c-format + msgid "illegal type (%s) in tree_eval" + msgstr "tipo non ammesso (%s) in 'tree_eval'" + + #: profile.c:842 eval.c:1790 + #, c-format + msgid "attempt to use function `%s' as array" + msgstr "tentativo di usare funzione `%s' come vettore" + + #: profile.c:856 eval.c:1797 + #, c-format + msgid "`%s' is a function, assignment is not allowed" + msgstr "`%s' è una funzione, assegnamento non permesso" + + #: profile.c:860 eval.c:1803 eval.c:1810 + msgid "assignment is not allowed to result of builtin function" + msgstr "assegnamento non permesso al risultato di una funzione interna" + + #: profile.c:1108 + #, c-format + msgid "\t# gawk profile, created %s\n" + msgstr "\t# profilo gawk, creato %s\n" + + #: profile.c:1111 + msgid "" + "\t# BEGIN block(s)\n" + "\n" + msgstr "" + "\t# blocco(hi) BEGIN\n" + "\n" + + #: profile.c:1121 + msgid "" + "\t# Rule(s)\n" + "\n" + msgstr "" + "\t# Regola(e)\n" + "\n" + + #: profile.c:1127 + msgid "" + "\t# END block(s)\n" + "\n" + msgstr "" + "\t# blocco(hi) END\n" + "\n" + + #: profile.c:1147 + msgid "" + "\n" + "\t# Functions, listed alphabetically\n" + msgstr "" + "\n" + "\t# Funzioni, listate in ordine alfabetico\n" + + #: profile.c:1357 + #, c-format + msgid "unexpected type %s in prec_level" + msgstr "tipo non previsto %s in 'prec_level'" + + #: regex.c:1322 + msgid "Success" + msgstr "Successo" + + #: regex.c:1323 + msgid "No match" + msgstr "Nessuna corrispondenza" + + #: regex.c:1324 + msgid "Invalid regular expression" + msgstr "Espressione regolare invalida" + + #: regex.c:1325 + msgid "Invalid collation character" + msgstr "Carattere di ordinamento non valido" + + #: regex.c:1326 + msgid "Invalid character class name" + msgstr "Nome di 'classe di caratteri' invalido" + + #: regex.c:1327 + msgid "Trailing backslash" + msgstr "'\\' finale" + + #: regex.c:1328 + msgid "Invalid back reference" + msgstr "Riferimento indietro invalido" + + #: regex.c:1329 + msgid "Unmatched [ or [^" + msgstr "[ or [^ non chiusa" + + #: regex.c:1330 + msgid "Unmatched ( or \\(" + msgstr "( or \\( non chiusa" + + #: regex.c:1331 + msgid "Unmatched \\{" + msgstr "\\{ non chiusa" + + #: regex.c:1332 + msgid "Invalid content of \\{\\}" + msgstr "Contenuto di \\{\\} invalido" + + #: regex.c:1333 + msgid "Invalid range end" + msgstr "Fine di intervallo invalido" + + #: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204 + msgid "Memory exhausted" + msgstr "Memoria esaurita" + + #: regex.c:1335 + msgid "Invalid preceding regular expression" + msgstr "Espressione regolare precedente invalida" + + #: regex.c:1336 + msgid "Premature end of regular expression" + msgstr "Fine di expressione regolare inaspettata" + + #: regex.c:1337 + msgid "Regular expression too big" + msgstr "Espressione regolare troppo complessa" + + #: regex.c:1338 + msgid "Unmatched ) or \\)" + msgstr ") or \\) non aperta" + + #: regex.c:7365 + msgid "No previous regular expression" + msgstr "Nessuna espressione regolare precedente" + + #: awkgram.y:232 + msgid "BEGIN blocks must have an action part" + msgstr "blocchi BEGIN richiedono una 'azione'" + + #: awkgram.y:238 + msgid "END blocks must have an action part" + msgstr "blocchi END richiedono una 'azione'" + + #: awkgram.y:274 + #, c-format + msgid "`%s' is a built-in function, it cannot be redefined" + msgstr "`%s' è una funzione interna, non si può ridefinire" + + #: awkgram.y:362 + msgid "statement may have no effect" + msgstr "istruzione che può non aver alcun effetto" + + #: awkgram.y:455 + msgid "`next' used in BEGIN or END action" + msgstr "`next' usato in 'azione' BEGIN o END" + + #: awkgram.y:462 awkgram.y:469 + msgid "`nextfile' is a gawk extension" + msgstr "`nextfile' è un'estensione gawk" + + #: awkgram.y:474 + msgid "`nextfile' used in BEGIN or END action" + msgstr "`nextfile' usato in 'azione' BEGIN o END" + + #: awkgram.y:483 + msgid "`return' used outside function context" + msgstr "`return' usato fuori da una funzione" + + #: awkgram.y:519 + msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" + msgstr "`print' da solo in BEGIN o END dovrebbe forse essere `print \"\"'" + + #: awkgram.y:532 awkgram.y:539 + msgid "`delete array' is a gawk extension" + msgstr "`delete array' è un'estensione gawk" + + #: awkgram.y:604 + msgid "multistage two-way pipelines don't work" + msgstr "'pipelines' multistadio bidirezionali non funzionano" + + #: awkgram.y:695 + msgid "regular expression on right of assignment" + msgstr "espressione regolare usata per assegnare un valore" + + #: awkgram.y:713 + msgid "non-redirected `getline' undefined inside END action" + msgstr "`getline' non re-diretta indefinita dentro 'azione' END" + + #: awkgram.y:723 + msgid "regular expression on left of `~' or `!~' operator" + msgstr "espressione regolare prima di operatore `~' o `!~'" + + #: awkgram.y:733 + #, c-format + msgid "regexp constant `/%s/' looks like a C comment, but is not" + msgstr "costante 'regexp' `/%s/' sembra un commento commento C, ma non lo è" + + #: awkgram.y:749 + msgid "regular expression on right of comparison" + msgstr "espressione regolare a destra in un confronto" + + #: awkgram.y:776 + msgid "non-redirected `getline' undefined inside BEGIN or END action" + msgstr "`getline' non re-diretta indefinita dentro 'azione' BEGIN o END" + + #: awkgram.y:831 + msgid "call of `length' without parentheses is not portable" + msgstr "chiamata a `length' senza parentesi non portabile" + + #: awkgram.y:834 + msgid "call of `length' without parentheses is deprecated by POSIX" + msgstr "chiamata a `length' senza parentesi sconsigliata da POSIX" + + #: awkgram.y:884 + msgid "invalid subscript expression" + msgstr "espressione indice invalida" + + #: awkgram.y:1033 + #, c-format + msgid "fptr %x not in tokentab\n" + msgstr "puntatore a funzione %x non in tabella\n" + + #: awkgram.y:1068 + msgid "unexpected newline" + msgstr "carattere 'a capo' inaspettato" + + #: awkgram.y:1152 + msgid "empty program text on command line" + msgstr "programma nullo sulla linea comandi" + + #: awkgram.y:1209 + #, c-format + msgid "can't open source file `%s' for reading (%s)" + msgstr "non riesco ad aprire file sorgente `%s' in lettura (%s)" + + #: awkgram.y:1244 + #, c-format + msgid "can't read sourcefile `%s' (%s)" + msgstr "non riesco a leggere file sorgente `%s' (%s)" + + #: awkgram.y:1252 + #, c-format + msgid "source file `%s' is empty" + msgstr "file sorgente `%s' vuoto" + + #: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011 + msgid "source file does not end in newline" + msgstr "file sorgente non termina con carattere 'a capo'" + + #: awkgram.y:1518 + msgid "unterminated regexp ends with `\\' at end of file" + msgstr "espressione regolare non completata termina con `\\' a fine file" + + #: awkgram.y:1539 + msgid "unterminated regexp" + msgstr "espressione regolare non completata" + + #: awkgram.y:1542 + msgid "unterminated regexp at end of file" + msgstr "espressione regolare non completata a fine file" + + #: awkgram.y:1609 + msgid "use of `\\ #...' line continuation is not portable" + msgstr "uso di `\\ #...' continuazione linea non portabile" + + #: awkgram.y:1621 + msgid "backslash not last character on line" + msgstr "'\\' non è l'ultimo carattere della linea" + + #: awkgram.y:1662 + msgid "POSIX does not allow operator `**='" + msgstr "POSIX non permette l'operatore `**='" + + #: awkgram.y:1664 + msgid "old awk does not support operator `**='" + msgstr "il vecchio awk non supporta l'operatore `**='" + + #: awkgram.y:1673 + msgid "POSIX does not allow operator `**'" + msgstr "POSIX non permette l'operatore `**'" + + #: awkgram.y:1675 + msgid "old awk does not support operator `**'" + msgstr "il vecchio awk non supporta l'operatore `**'" + + #: awkgram.y:1708 + msgid "operator `^=' is not supported in old awk" + msgstr "l'operatore `^=' non è supportato nel vecchio awk" + + #: awkgram.y:1716 + msgid "operator `^' is not supported in old awk" + msgstr "l'operatore `^' non è supportato nel vecchio awk" + + #: awkgram.y:1798 awkgram.y:1815 + msgid "unterminated string" + msgstr "stringa non terminata" + + #: awkgram.y:1972 + #, c-format + msgid "invalid char '%c' in expression" + msgstr "carattere '%c' invalido in un'espressione" + + #: awkgram.y:2032 + #, c-format + msgid "`%s' is a gawk extension" + msgstr "`%s' è un'estensione gawk" + + #: awkgram.y:2035 + #, c-format + msgid "`%s' is a Bell Labs extension" + msgstr "`%s' è un'estensione Bell Labs" + + #: awkgram.y:2038 + #, c-format + msgid "POSIX does not allow `%s'" + msgstr "POSIX non permette `%s'" + + #: awkgram.y:2042 + #, c-format + msgid "`%s' is not supported in old awk" + msgstr "`%s' non è supportato nel vecchio awk" + + #: awkgram.y:2070 + msgid "`goto' considered harmful!\n" + msgstr "`goto' considerato pericoloso!\n" + + #: awkgram.y:2134 + #, c-format + msgid "%d is invalid as number of arguments for %s" + msgstr "%d invalido come numero di argomenti per %s" + + #: awkgram.y:2153 awkgram.y:2156 + msgid "match: third argument is a gawk extension" + msgstr "match: il terzo argomento è un'estensione gawk" + + #: awkgram.y:2172 + #, c-format + msgid "%s: string literal as last arg of substitute has no effect" + msgstr "%s: una stringa come ultimo argomento di 'substitute' non ha effetto" + + #: awkgram.y:2176 + msgid "sub third parameter is not a changeable object" + msgstr "il terzo parametro di 'sub' non è un oggetto modificabile" + + #: awkgram.y:2178 + msgid "gsub third parameter is not a changeable object" + msgstr "il terzo parametro di 'gsub' non è un oggetto modificabile" + + #: awkgram.y:2204 awkgram.y:2207 + msgid "close: second argument is a gawk extension" + msgstr "close: il secondo argomento è un'estensione gawk" + + #: awkgram.y:2217 + msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" + msgstr "" + "uso scorretto di dcgettext(_\"...\"): togliere il carattere '_' iniziale" + + #: awkgram.y:2232 + msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" + msgstr "" + "uso scorretto di dcngettext(_\"...\"): togliere il carattere '_' iniziale" + + #: awkgram.y:2323 + #, c-format + msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" + msgstr "funzione `%s': parametro #%d, `%s', duplica parametro #%d" + + #: awkgram.y:2355 + #, c-format + msgid "function `%s': parameter `%s' shadows global variable" + msgstr "funzione `%s': parametro `%s' nasconde variabile globale" + + #: awkgram.y:2464 + #, c-format + msgid "could not open `%s' for writing (%s)" + msgstr "non riesco ad aprire `%s' in scrittura (%s)" + + #: awkgram.y:2495 + #, c-format + msgid "%s: close failed (%s)" + msgstr "%s: 'close' fallita (%s)" + + #: awkgram.y:2605 + msgid "shadow_funcs() called twice!" + msgstr "shadow_funcs() chiamata due volte!" + + #: awkgram.y:2680 + #, c-format + msgid "function `%s': can't use function name as parameter name" + msgstr "funzione `%s': non posso usare nome della funzione come nome parametro" + + #: awkgram.y:2690 + #, c-format + msgid "function name `%s' previously defined" + msgstr "funzione di nome `%s' definita in precedenza" + + #: awkgram.y:2838 awkgram.y:2844 + #, c-format + msgid "function `%s' called but never defined" + msgstr "funzione `%s' chiamata ma mai definita" + + #: awkgram.y:2847 + #, c-format + msgid "function `%s' defined but never called" + msgstr "funzione `%s' definita ma mai chiamata" + + #: awkgram.y:2874 + #, c-format + msgid "regexp constant for parameter #%d yields boolean value" + msgstr "" + "espressione regolare di valore costante per parametro #%d genera valore " + "booleano" + + #: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649 + #: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078 + #: dfa.c:1081 dfa.c:1094 dfa.c:1095 + msgid "Unbalanced [" + msgstr "[ sbilanciata" + + #: dfa.c:783 + msgid "Unfinished \\ escape" + msgstr "Escape \\ non terminato" + + #: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955 + msgid "unfinished repeat count" + msgstr "contatore di ripetizioni potenzialmente infinito" + + #: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958 + msgid "malformed repeat count" + msgstr "contatore di ripetizioni non valido" + + #: dfa.c:1285 + msgid "Unbalanced (" + msgstr "( sbilanciata" + + #: dfa.c:1407 + msgid "No regexp syntax bits specified" + msgstr "Nessun'espressione regolare di bits sintattici specificata" + + #: dfa.c:1415 + msgid "Unbalanced )" + msgstr ") sbilanciata" + + #: dfa.c:3014 + msgid "out of memory" + msgstr "non c'è più memoria" + + #: field.c:849 + msgid "split: second argument is not an array" + msgstr "split: il secondo argomento non è un vettore" + + #: field.c:876 + msgid "split: null string for third arg is a gawk extension" + msgstr "split: la stringa nulla come terzo arg. è un'estensione gawk" + + #: field.c:916 + msgid "`FIELDWIDTHS' is a gawk extension" + msgstr "`FIELDWIDTHS' è un'estensione gawk" + + #: field.c:943 + #, c-format + msgid "field %d in FIELDWIDTHS, must be > 0" + msgstr "campo %d in FIELDWIDTHS, deve essere > 0" + + #: field.c:997 + msgid "null string for `FS' is a gawk extension" + msgstr "la stringa nulla usata come `FS' è un'estensione gawk" + + #: msg.c:57 + msgid "cmd. line:" + msgstr "linea progr.:" + + #: msg.c:123 + msgid "warning: " + msgstr "attenzione: " + + #: msg.c:145 + msgid "error: " + msgstr "errore: " + + #: msg.c:178 + msgid "fatal: " + msgstr "fatale: " + + #: eval.c:259 + #, c-format + msgid "unknown nodetype %d" + msgstr "tipo nodo sconosciuto %d" + + #: eval.c:307 + msgid "buffer overflow in genflags2str" + msgstr "superament limiti buffer in 'genflags2str'" + + #: eval.c:541 + #, c-format + msgid "for loop: array `%s' changed size from %d to %d during loop execution" + msgstr "" + "ciclo for: vettore `%s' ha cambiato dimensione da %d a %d durante " + "l'esecuzione del ciclo" + + #: eval.c:565 + msgid "`break' outside a loop is not portable" + msgstr "`break' all'esterno di un ciclo non è portabile" + + #: eval.c:569 + msgid "`break' outside a loop is not allowed" + msgstr "`break' all'esterno di un ciclo non è consentito" + + #: eval.c:588 + msgid "`continue' outside a loop is not portable" + msgstr "`continue' all'esterno di un ciclo non è portabile" + + #: eval.c:592 + msgid "`continue' outside a loop is not allowed" + msgstr "`continue' all'esterno di un ciclo non è consentito" + + #: eval.c:622 + msgid "`next' cannot be called from a BEGIN rule" + msgstr "`next' non può essere chiamato da una regola BEGIN" + + #: eval.c:624 + msgid "`next' cannot be called from an END rule" + msgstr "`next' non può essere chiamato da una regola END" + + #: eval.c:636 + msgid "`nextfile' cannot be called from a BEGIN rule" + msgstr "`nextfile' non può essere chiamato da una regola BEGIN" + + #: eval.c:638 + msgid "`nextfile' cannot be called from an END rule" + msgstr "`nextfile' non può essere chiamato da una regola END" + + #: eval.c:679 + msgid "statement has no effect" + msgstr "istruzione che non fa nulla" + + #: eval.c:713 eval.c:743 eval.c:1622 + #, c-format + msgid "reference to uninitialized variable `%s'" + msgstr "referenza a variabile non inizializzata `%s'" + + #: eval.c:721 eval.c:1608 + #, c-format + msgid "can't use function name `%s' as variable or array" + msgstr "non posso usare nome di funzione `%s' come variabile o vettore" + + #: eval.c:728 eval.c:734 eval.c:1747 + #, c-format + msgid "reference to uninitialized argument `%s'" + msgstr "referenza ad argomento non inizializzato `%s'" + + #: eval.c:823 + msgid "assignment used in conditional context" + msgstr "assegnamento usato nel contesto di un test condizionale" + + #: eval.c:914 + msgid "" + "concatenation: side effects in one expression have changed the length of " + "another!" + msgstr "" + "concatenatione: effetti secondari in una espressione hanno modificato la " + "lunghezza di un'altra espressione!" + + #: eval.c:1013 + msgid "division by zero attempted" + msgstr "tentativo di dividere per zero" + + #: eval.c:1028 + #, c-format + msgid "division by zero attempted in `%%'" + msgstr "divisione per zero tentata in `%%'" + + #: eval.c:1236 + msgid "division by zero attempted in `/='" + msgstr "divisione per zero tentata in `/='" + + #: eval.c:1254 + #, c-format + msgid "division by zero attempted in `%%='" + msgstr "divisione per zero tentata in `%%='" + + #: eval.c:1424 + #, c-format + msgid "%s (from %s)" + msgstr "%s (da %s)" + + #: eval.c:1472 + #, c-format + msgid "function `%s' called with more arguments than declared" + msgstr "funzione `%s' chiamata con più argomenti di quelli previsti" + + #: eval.c:1519 + #, c-format + msgid "function `%s' not defined" + msgstr "funzione `%s' non definita" + + #: eval.c:1521 + #, c-format + msgid "function %s called\n" + msgstr "funzione %s chiamata\n" + + #: eval.c:1580 + msgid "" + "\n" + "\t# Function Call Stack:\n" + "\n" + msgstr "" + "\n" + "\t# 'Stack' (Pila) Chiamate Funzione:\n" + "\n" + + #: eval.c:1583 + msgid "\t# -- main --\n" + msgstr "\t# -- principale --\n" + + #: eval.c:1759 + msgid "attempt to field reference from non-numeric value" + msgstr "tentativo di referenziare campo da valore non numerico" + + #: eval.c:1761 + msgid "attempt to reference from null string" + msgstr "tentativo to referenziare da stringa nulla" + + #: eval.c:1767 + #, c-format + msgid "attempt to access field %d" + msgstr "tentativo di accedere al campo %d" + + #: eval.c:1783 + #, c-format + msgid "attempt to use scalar parameter `%s' as an array" + msgstr "tentativo di unare il parametro scalare `%s' come un vettore" + + #: eval.c:1874 + msgid "`IGNORECASE' is a gawk extension" + msgstr "`IGNORECASE' è un'estensione gawk" + + #: eval.c:1902 + msgid "`BINMODE' is a gawk extension" + msgstr "`BINMODE' è un'estensione gawk" + + #: eval.c:2014 + #, c-format + msgid "bad `%sFMT' specification `%s'" + msgstr "specificazione invalida `%sFMT' `%s'" + + #: eval.c:2080 + msgid "turning off `--lint' due to assignment to `LINT'" + msgstr "disabilito `--lint' a causa di assegnamento a `LINT'" + + #: eval.c:2116 + msgid "NF set to negative value" + msgstr "NF impostato a un valore negativo" + + #: io.c:240 + #, c-format + msgid "cannot open file `%s' for reading (%s)" + msgstr "non riesco ad aprire file `%s' in lettura (%s)" + + #: io.c:320 + #, c-format + msgid "close of fd %d (`%s') failed (%s)" + msgstr "chiusura di fd %d (`%s') fallita (%s)" + + #: io.c:432 + #, c-format + msgid "invalid tree type %s in redirect()" + msgstr "tipo di albero invalido %s in redirect()" + + #: io.c:438 + #, c-format + msgid "expression in `%s' redirection only has numeric value" + msgstr "espressione nella re-direzione `%s' ha solo un valore numerico" + + #: io.c:444 + #, c-format + msgid "expression for `%s' redirection has null string value" + msgstr "espressione nella re-direzione `%s' ha per valore la stringa nulla" + + #: io.c:449 + #, c-format + msgid "filename `%s' for `%s' redirection may be result of logical expression" + msgstr "" + "nome file `%s' per la re-direzione `%s' può essere il risultato di una " + "espressione logica" + + #: io.c:471 + #, c-format + msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" + msgstr "mistura non necessaria di `>' e `>>' per il file `%.*s'" + + #: io.c:523 + #, c-format + msgid "can't open pipe `%s' for output (%s)" + msgstr "non posso aprire 'pipe' `%s' in scrittura (%s)" + + #: io.c:532 + #, c-format + msgid "can't open pipe `%s' for input (%s)" + msgstr "non posso aprire 'pipe' `%s' in lettura (%s)" + + #: io.c:545 + #, c-format + msgid "can't open two way socket `%s' for input/output (%s)" + msgstr "" + "non posso aprire 'socket' bidirezionale `%s' per lettura/scrittura (%s)" + + #: io.c:549 + #, c-format + msgid "can't open two way pipe `%s' for input/output (%s)" + msgstr "non posso aprire 'pipe' bidirezionale `%s' per lettura/scrittura (%s)" + + #: io.c:625 + #, c-format + msgid "can't redirect from `%s' (%s)" + msgstr "non posso re-dirigere da `%s' (%s)" + + #: io.c:628 + #, c-format + msgid "can't redirect to `%s' (%s)" + msgstr "non posso re-dirigere a `%s' (%s)" + + #: io.c:667 + msgid "" + "reached system limit for open files: starting to multiplex file descriptors" + msgstr "" + "numero massimo consentito di file aperti raggiunto: comincio a riutilizzare " + "i descrittori di file" + + #: io.c:679 + #, c-format + msgid "close of `%s' failed (%s)." + msgstr "chiusura di `%s' fallita (%s)." + + #: io.c:686 + msgid "too many pipes or input files open" + msgstr "troppe 'pipe' o file di input aperti" + + #: io.c:709 + msgid "close: second argument must be `to' or `from'" + msgstr "close: il secondo argomento deve essere `a' o `da'" + + #: io.c:723 + #, c-format + msgid "close: `%.*s' is not an open file, pipe or co-process" + msgstr "close: `%.*s' non è un file aperto, una 'pipe' o un co-processo" + + #: io.c:727 + msgid "close of redirection that was never opened" + msgstr "chiusura di una re-direzione mai aperta" + + #: io.c:754 + #, c-format + msgid "close: redirection `%s' not opened with `|&', second argument ignored" + msgstr "close: re-direzione `%s' non aperta con `|&', ignoro secondo argomento" + + #: io.c:811 + #, c-format + msgid "failure status (%d) on pipe close of `%s' (%s)" + msgstr "errore ritornato (%d) dalla chiusura della 'pipe' `%s' (%s)" + + #: io.c:814 + #, c-format + msgid "failure status (%d) on file close of `%s' (%s)" + msgstr "errore ritornato (%d) dalla chiusura del file `%s' (%s)" + + #: io.c:833 + #, c-format + msgid "no explicit close of socket `%s' provided" + msgstr "nessuna chiusura esplicita richiesta per 'socket' `%s'" + + #: io.c:836 + #, c-format + msgid "no explicit close of co-process `%s' provided" + msgstr "nessuna chiusura esplicita richiesta per co-processo `%s'" + + #: io.c:839 + #, c-format + msgid "no explicit close of pipe `%s' provided" + msgstr "nessuna chiusura esplicita richiesta per 'pipe' `%s'" + + #: io.c:842 + #, c-format + msgid "no explicit close of file `%s' provided" + msgstr "nessuna chiusura esplicita richiesta per file `%s'" + + #: io.c:871 io.c:925 + #, c-format + msgid "error writing standard output (%s)" + msgstr "errore scrivendo 'standard output' (%s)" + + #: io.c:875 io.c:929 + #, c-format + msgid "error writing standard error (%s)" + msgstr "errore scrivendo 'standard error' (%s)" + + #: io.c:883 + #, c-format + msgid "pipe flush of `%s' failed (%s)." + msgstr "scaricamento di 'pipe' `%s' fallita (%s)." + + #: io.c:886 + #, c-format + msgid "co-process flush of pipe to `%s' failed (%s)." + msgstr "scaricamento da co-processo di 'pipe' a `%s' fallita (%s)." + + #: io.c:889 + #, c-format + msgid "file flush of `%s' failed (%s)." + msgstr "scaricamento di file `%s' fallita (%s)." + + #: io.c:1048 + msgid "/inet/raw client not ready yet, sorry" + msgstr "spiacente, 'client' /inet/raw non ancora pronto" + + #: io.c:1050 io.c:1087 + msgid "only root may use `/inet/raw'." + msgstr "solo root può usare `/inet/raw'." + + #: io.c:1085 + msgid "/inet/raw server not ready yet, sorry" + msgstr "spiacente, 'server' /inet/raw non ancora pronto" + + #: io.c:1175 + #, c-format + msgid "no (known) protocol supplied in special filename `%s'" + msgstr "nessuno protocollo (conosciuto) specificato nel filename speciale `%s'" + + #: io.c:1193 + #, c-format + msgid "special file name `%s' is incomplete" + msgstr "nome file speciale `%s' incompleto" + + #: io.c:1205 + #, c-format + msgid "local port invalid in `%s'" + msgstr "porta locale invalida in `%s'" + + #: io.c:1217 + msgid "must supply a remote hostname to `/inet'" + msgstr "va fornito nome di 'host' remoto a `/inet'" + + #: io.c:1232 + msgid "must supply a remote port to `/inet'" + msgstr "va fornita porta remota a `/inet'" + + #: io.c:1238 + #, c-format + msgid "remote port invalid in `%s'" + msgstr "porta remota invalida in `%s'" + + #: io.c:1248 + msgid "TCP/IP communications are not supported" + msgstr "comunicazioni TCP/IP non supportate" + + #: io.c:1257 io.c:1438 + #, c-format + msgid "file `%s' is a directory" + msgstr "file `%s' è una 'directory'" + + #: io.c:1327 + #, c-format + msgid "use `PROCINFO[\"%s\"]' instead of `%s'" + msgstr "usa `PROCINFO[\"%s\"]' invece che `%s'" + + #: io.c:1359 + msgid "use `PROCINFO[...]' instead of `/dev/user'" + msgstr "usa `PROCINFO[...]' invece che `/dev/user'" + + #: io.c:1424 + #, c-format + msgid "could not open `%s', mode `%s'" + msgstr "non riesco ad aprire `%s', modo `%s'" + + #: io.c:1550 io.c:1602 io.c:1732 io.c:1754 + #, c-format + msgid "moving pipe to stdout in child failed (dup: %s)" + msgstr "fallito passaggio di 'pipe' a 'stdout' nel processo-figlio (dup: %s)" + + #: io.c:1554 io.c:1607 + #, c-format + msgid "moving pipe to stdin in child failed (dup: %s)" + msgstr "fallito passaggio di pipe a 'stdin' nel processo-figlio (dup: %s)" + + #: io.c:1571 io.c:1745 + msgid "restoring stdout in parent process failed\n" + msgstr "fallito ripristino di 'stdout' nel processo-padre\n" + + #: io.c:1576 + msgid "restoring stdin in parent process failed\n" + msgstr "fallito ripristino di 'stdin' nel processo-padre\n" + + #: io.c:1599 io.c:1751 + #, c-format + msgid "close of stdout in child failed (%s)" + msgstr "fallita chiusura di 'stdout' nel processo-figlio (%s)" + + #: io.c:1604 + #, c-format + msgid "close of stdin in child failed (%s)" + msgstr "fallita chiusura di 'stdin' nel processo-figlio (%s)" + + #: io.c:1610 io.c:1756 io.c:1767 + #, c-format + msgid "close of pipe failed (%s)" + msgstr "fallita chiusura di 'pipe' (%s)" + + #: io.c:1655 + msgid "`|&' not supported" + msgstr "`|&' non supportato" + + #: io.c:1722 + #, c-format + msgid "cannot open pipe `%s' (%s)" + msgstr "non riesco ad aprire 'pipe' `%s' (%s)" + + #: io.c:1763 + #, c-format + msgid "cannot create child process for `%s' (fork: %s)" + msgstr "non riesco a creare processo-figlio per `%s' (fork: %s)" + + #: io.c:2104 + #, c-format + msgid "data file `%s' is empty" + msgstr "file dati `%s' vuoto" + + #: io.c:2175 + #, c-format + msgid "internal error: file `%s', line %d\n" + msgstr "errore interno: file `%s', linea %d\n" + + #: io.c:2277 + #, c-format + msgid "error reading input file `%s': %s" + msgstr "errore leggendo file di input `%s': %s" + + #: io.c:2521 + msgid "multicharacter value of `RS' is a gawk extension" + msgstr "valore multicarattere per `RS' è un'estensione gawk" + + #: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 + msgid "can't convert string to float" + msgstr "non riesco a convertire stringa a valore in virgola mobile" + + #: node.c:342 + msgid "backslash at end of string" + msgstr "'\\' a fine stringa" + + #: node.c:524 + msgid "POSIX does not allow `\\x' escapes" + msgstr "POSIX non permette formato `\\x'" + + #: node.c:530 + msgid "no hex digits in `\\x' escape sequence" + msgstr "niente cifre esadecimanli nel formato `\\x'" + + #: node.c:564 + #, c-format + msgid "escape sequence `\\%c' treated as plain `%c'" + msgstr " sequenza in formato `\\%c' considerata come semplice `%c'" + + #: re.c:208 + #, c-format + msgid "regex match failed, not enough memory to match string \"%.*s%s\"" + msgstr "" + "fallita ricerca di 'espressione regolare', non c'è memoria sufficiente a " + "ricercare la stringa \"%.*s%s\"" + + #: posix/gawkmisc.c:122 + #, c-format + msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)" + msgstr "%s %s `%s': non riesco a impostare 'close-on-exec': (fcntl: %s)" diff -crN gawk-3.1.0/po/quot.sed gawk-3.1.1/po/quot.sed *** gawk-3.1.0/po/quot.sed Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/quot.sed Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,6 ---- + s/"\([^"]*\)"/“\1â€/g + s/`\([^`']*\)'/‘\1’/g + s/ '\([^`']*\)' / ‘\1’ /g + s/ '\([^`']*\)'$/ ‘\1’/g + s/^'\([^`']*\)' /‘\1’ /g + s/“â€/""/g diff -crN gawk-3.1.0/po/remove-potcdate.sin gawk-3.1.1/po/remove-potcdate.sin *** gawk-3.1.0/po/remove-potcdate.sin Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/remove-potcdate.sin Sun Apr 28 17:01:52 2002 *************** *** 0 **** --- 1,19 ---- + # Sed script that remove the POT-Creation-Date line in the header entry + # from a POT file. + # + # The distinction between the first and the following occurrences of the + # pattern is achieved by looking at the hold space. + /^"POT-Creation-Date: .*"$/{ + x + # Test if the hold space is empty. + s/P/P/ + ta + # Yes it was empty. First occurrence. Remove the line. + g + d + bb + :a + # The hold space was nonempty. Following occurrences. Do nothing. + x + :b + } diff -crN gawk-3.1.0/po/sv.po gawk-3.1.1/po/sv.po *** gawk-3.1.0/po/sv.po Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/sv.po Wed May 1 16:40:59 2002 *************** *** 0 **** --- 1,1757 ---- + # Swedish translation of gawk + # Copyright (C) 2001 Free Software Foundation, Inc. + # Martin Sjögren , 2001. + # + # $Id: sv.po,v 1.18 2002/01/14 09:09:22 martin Exp $ + # + msgid "" + msgstr "" + "Project-Id-Version: gawk 3.1.31\n" + "POT-Creation-Date: 2002-05-01 16:40+0300\n" + "PO-Revision-Date: 2002-01-14 10:09+0100\n" + "Last-Translator: Martin Sjögren \n" + "Language-Team: Swedish \n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=iso-8859-1\n" + "Content-Transfer-Encoding: 8bit\n" + + #: array.c:243 array.c:275 array.c:280 eval.c:483 + #, c-format + msgid "attempt to use scalar `%s' as array" + msgstr "försök att använda skalären \"%s\" som vektor" + + #: array.c:304 + #, c-format + msgid "reference to uninitialized element `%s[\"%s\"]'" + msgstr "referens till ickeinitierat element \"%s[\"%s\"]\"" + + #: array.c:310 + #, c-format + msgid "subscript of array `%s' is null string" + msgstr "index i vektorn \"%s\" är en tom sträng" + + #: array.c:373 array.c:456 + #, c-format + msgid "delete: illegal use of variable `%s' as array" + msgstr "delete: otillåten användning av variabeln \"%s\" som vektor" + + #: array.c:406 + #, c-format + msgid "delete: index `%s' not in array `%s'" + msgstr "delete: index \"%s\" finns inte i vektorn \"%s\"" + + #: array.c:571 + #, c-format + msgid "%s: empty (null)\n" + msgstr "%s: tom (null)\n" + + #: array.c:576 + #, c-format + msgid "%s: empty (zero)\n" + msgstr "%s: tom (noll)\n" + + #: array.c:580 + #, c-format + msgid "%s: table_size = %d, array_size = %d\n" + msgstr "%s: tabellstorlek = %d, vektorstorlek = %d\n" + + #: array.c:612 + #, fuzzy, c-format + msgid "%s: is parameter\n" + msgstr "%s: är en parameter\n" + + #: array.c:617 + #, c-format + msgid "%s: array_ref to %s\n" + msgstr "%s: vektorreferens till %s\n" + + #: array.c:844 + msgid "asort: first argument is not an array" + msgstr "asort: första argumentet är inte en vektor" + + #: array.c:853 + msgid "asort: second argument is not an array" + msgstr "asort: andra argumentet är inte en vektor" + + #: builtin.c:107 + #, c-format + msgid "%s to \"%s\" failed (%s)" + msgstr "%s till \"%s\" misslyckades (%s)" + + #: builtin.c:108 + msgid "standard output" + msgstr "standard ut" + + #: builtin.c:109 + msgid "reason unknown" + msgstr "okänd anledning" + + #: builtin.c:122 + msgid "exp: received non-numeric argument" + msgstr "exp: fick ett ickenumeriskt argument" + + #: builtin.c:128 + #, c-format + msgid "exp: argument %g is out of range" + msgstr "exp: argumentet %g är inte inom tillåten gräns" + + #: builtin.c:186 + #, c-format + msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" + msgstr "" + "fflush: kan inte spola: röret \"%s\" öppnat för läsning, inte skrivning" + + #: builtin.c:189 + #, c-format + msgid "fflush: cannot flush: file `%s' opened for reading, not writing" + msgstr "" + "fflush: kan inte spola: filen \"%s\" öppnad för läsning, inte skrivning" + + #: builtin.c:201 + #, c-format + msgid "fflush: `%s' is not an open file, pipe or co-process" + msgstr "fflush: \"%s\" är inte en öppen fil, rör eller koprocess" + + #: builtin.c:295 + msgid "index: received non-string first argument" + msgstr "index: första argumentet är inte en sträng" + + #: builtin.c:297 + msgid "index: received non-string second argument" + msgstr "index: andra argumentet är inte en sträng" + + #: builtin.c:407 + msgid "int: received non-numeric argument" + msgstr "int: fick ett ickenumeriskt argument" + + #: builtin.c:424 + msgid "length: received non-string argument" + msgstr "length: fick ett argument som inte är en sträng" + + #: builtin.c:440 + msgid "log: received non-numeric argument" + msgstr "log: fick ett ickenumeriskt argument" + + #: builtin.c:443 + #, c-format + msgid "log: received negative argument %g" + msgstr "log: fick ett negativt argumentet %g" + + #: builtin.c:605 builtin.c:608 + msgid "must use `count$' on all formats or none" + msgstr "" + + #: builtin.c:703 + msgid "`$' is not permitted in awk formats" + msgstr "\"$\" tillåts inte i awkformat" + + #: builtin.c:709 + msgid "arg count with `$' must be > 0" + msgstr "argumentantalet med \"$\" måste vara > 0" + + #: builtin.c:711 + #, c-format + msgid "arg count %d greater than total number of supplied arguments" + msgstr "argumentantalet %d är större än antalet givna argument" + + #: builtin.c:713 + msgid "`$' not permitted after period in format" + msgstr "\"$\" tillåts inte efter en punkt i formatet" + + #: builtin.c:726 + msgid "no `$' supplied for positional field width or precision" + msgstr "inget \"$\" bifogat för positionsangiven fältbredd eller precision" + + #: builtin.c:784 + msgid "`l' is meaningless in awk formats; ignored" + msgstr "\"l\" är meningslös i awk-format, ignorerad" + + #: builtin.c:788 + msgid "`l' is not permitted in POSIX awk formats" + msgstr "\"l\" tillåts inte i POSIX awk-format" + + #: builtin.c:799 + msgid "`L' is meaningless in awk formats; ignored" + msgstr "\"L\" är meningslös i awk-format, ignorerad" + + #: builtin.c:803 + msgid "`L' is not permitted in POSIX awk formats" + msgstr "\"L\" tillåts inte i POSIX awk-format" + + #: builtin.c:814 + msgid "`h' is meaningless in awk formats; ignored" + msgstr "\"h\" är meningslös i awk-format, ignorerad" + + #: builtin.c:818 + msgid "`h' is not permitted in POSIX awk formats" + msgstr "\"h\" tillåts inte i POSIX awk-format" + + #: builtin.c:1067 + msgid "not enough arguments to satisfy format string" + msgstr "för få argument för formatsträngen" + + #: builtin.c:1069 + msgid "^ ran out for this one" + msgstr "^ tog slut här" + + #: builtin.c:1074 + msgid "[s]printf: format specifier does not have control letter" + msgstr "[s]printf: formatspecifieraren har ingen kommandobokstav" + + #: builtin.c:1077 + msgid "too many arguments supplied for format string" + msgstr "för många argument för formatsträngen" + + #: builtin.c:1120 builtin.c:1123 + msgid "printf: no arguments" + msgstr "printf: inga argument" + + #: builtin.c:1156 + msgid "sqrt: received non-numeric argument" + msgstr "sqrt: fick ickenumeriskt argument" + + #: builtin.c:1160 + #, c-format + msgid "sqrt: called with negative argument %g" + msgstr "sqrt: anropad med negativt argument %g" + + #: builtin.c:1182 + #, c-format + msgid "substr: start index %g is invalid, using 1" + msgstr "substr: startindex %g är ogiltigt, använder 1" + + #: builtin.c:1187 + #, c-format + msgid "substr: non-integer start index %g will be truncated" + msgstr "substr: startindex %g som inte är ett heltal kommer trunkeras" + + #: builtin.c:1201 + #, c-format + msgid "substr: length %g is <= 0" + msgstr "substr: längden %g är <= 0" + + #: builtin.c:1207 + #, c-format + msgid "substr: non-integer length %g will be truncated" + msgstr "substr: längden %g som inte är ett heltal kommer trunkeras" + + #: builtin.c:1214 + msgid "substr: source string is zero length" + msgstr "substr: källsträngen är tom" + + #: builtin.c:1221 + #, c-format + msgid "" + "substr: length %d at start index %d exceeds length of first argument (%d)" + msgstr "" + "substr: längden %d vid startindex %d överskrider längden av första " + "argumentet (%d)" + + #: builtin.c:1227 + #, c-format + msgid "substr: start index %d is past end of string" + msgstr "substr: startindex %d är bortom slutet på strängen" + + #: builtin.c:1263 + #, fuzzy + msgid "strftime: received non-string first argument" + msgstr "strftime: fick ett första argument som inte är en sträng" + + #: builtin.c:1269 + msgid "strftime: received empty format string" + msgstr "strftime: fick en tom formatsträng" + + #: builtin.c:1278 + #, fuzzy + msgid "strftime: received non-numeric second argument" + msgstr "strftime: fick ett ickenumeriskt andra argument" + + #: builtin.c:1341 + msgid "mktime: received non-string argument" + msgstr "mktime: fick ett argument som inte är en sträng" + + #: builtin.c:1386 + #, fuzzy + msgid "system: received non-string argument" + msgstr "system: fick ett argument som inte är en sträng" + + #: builtin.c:1512 + #, fuzzy + msgid "tolower: received non-string argument" + msgstr "tolower: fick ett argument som inte är en sträng" + + #: builtin.c:1561 + #, fuzzy + msgid "toupper: received non-string argument" + msgstr "toupper: fick ett argument som inte är en sträng" + + #: builtin.c:1606 + msgid "atan2: received non-numeric first argument" + msgstr "atan2: fick ett ickenumeriskt första argument" + + #: builtin.c:1608 + msgid "atan2: received non-numeric second argument" + msgstr "atan2: fick ett ickenumeriskt andra argument" + + #: builtin.c:1627 + msgid "sin: received non-numeric argument" + msgstr "sin: fick ett ickenumeriskt argument" + + #: builtin.c:1643 + msgid "cos: received non-numeric argument" + msgstr "cos: fick ett ickenumeriskt argument" + + #: builtin.c:1687 + msgid "srand: received non-numeric argument" + msgstr "srand: fick ett ickenumeriskt argument" + + #: builtin.c:1721 + msgid "match: third argument is not an array" + msgstr "match: tredje argumentet är inte en vektor" + + #: builtin.c:2157 + msgid "gensub: 3rd argument of 0 treated as 1" + msgstr "gensub: Nollan i tredje argumentet behandlad som en etta" + + #: builtin.c:2268 builtin.c:2270 + msgid "lshift: received non-numeric first argument" + msgstr "lshift: fick ett ickenumeriskt första argument" + + #: builtin.c:2272 + #, c-format + msgid "lshift(%lf, %lf): negative values will give strange results" + msgstr "lshift(%lf, %lf): negativa värden kommer ge konstiga resultat" + + #: builtin.c:2274 + #, c-format + msgid "lshift(%lf, %lf): fractional values will be truncated" + msgstr "lshift(%lf, %lf): flyttalsvärden kommer trunkeras" + + #: builtin.c:2276 + #, c-format + msgid "lshift(%lf, %lf): too large shift value will give strange results" + msgstr "lshift(%lf, %lf): för stora skiftvärden kommer ge konstiga resultat" + + #: builtin.c:2305 builtin.c:2307 + msgid "rshift: received non-numeric first argument" + msgstr "rshift: fick ett ickenumeriskt första argument" + + #: builtin.c:2309 + #, c-format + msgid "rshift(%lf, %lf): negative values will give strange results" + msgstr "rshift(%lf, %lf): negativa värden kommer ge konstiga resultat" + + #: builtin.c:2311 + #, c-format + msgid "rshift(%lf, %lf): fractional values will be truncated" + msgstr "rshift(%lf, %lf): flyttalsvärden kommer trunkeras" + + #: builtin.c:2313 + #, c-format + msgid "rshift(%lf, %lf): too large shift value will give strange results" + msgstr "rshift(%lf, %lf): för stora skiftvärden kommer ge konstiga resultat" + + #: builtin.c:2342 builtin.c:2344 + msgid "and: received non-numeric first argument" + msgstr "and: fick ett ickenumeriskt första argument" + + #: builtin.c:2346 + #, c-format + msgid "and(%lf, %lf): negative values will give strange results" + msgstr "and(%lf, %lf): negativa värden kommer ge konstiga resultat" + + #: builtin.c:2348 + #, c-format + msgid "and(%lf, %lf): fractional values will be truncated" + msgstr "and(%lf, %lf): flyttalsvärden kommer trunkeras" + + #: builtin.c:2377 builtin.c:2379 + msgid "or: received non-numeric first argument" + msgstr "or: fick ett ickenumeriskt första argument" + + #: builtin.c:2381 + #, c-format + msgid "or(%lf, %lf): negative values will give strange results" + msgstr "or(%lf, %lf): negativa värden kommer ge konstiga resultat" + + #: builtin.c:2383 + #, c-format + msgid "or(%lf, %lf): fractional values will be truncated" + msgstr "or(%lf, %lf): flyttalsvärden kommer trunkeras" + + #: builtin.c:2412 builtin.c:2414 + msgid "xor: received non-numeric first argument" + msgstr "xor: fick ett ickenumeriskt första argument" + + #: builtin.c:2416 + #, c-format + msgid "xor(%lf, %lf): negative values will give strange results" + msgstr "xor(%lf, %lf): negativa värden kommer ge konstiga resultat" + + #: builtin.c:2418 + #, c-format + msgid "xor(%lf, %lf): fractional values will be truncated" + msgstr "xor(%lf, %lf): flyttalsvärden kommer trunkeras" + + #: builtin.c:2446 + msgid "compl: received non-numeric argument" + msgstr "compl: fick ett ickenumeriskt argument" + + #: builtin.c:2448 + #, c-format + msgid "compl(%lf): negative value will give strange results" + msgstr "compl(%lf): negativa värden kommer ge konstiga resultat" + + #: builtin.c:2450 + #, c-format + msgid "compl(%lf): fractional value will be truncated" + msgstr "compl(%lf): flyttalsvärden kommer trunkeras" + + #: builtin.c:2621 + #, c-format + msgid "dcgettext: `%s' is not a valid locale category" + msgstr "dcgettext: \"%s\" är inte en giltig lokalkategori" + + #: ext.c:60 ext.c:64 + msgid "`extension' is a gawk extension" + msgstr "\"extension\" är en gawk-utökning" + + #: ext.c:74 + #, c-format + msgid "extension: cannot open `%s' (%s)\n" + msgstr "extension: kan inte öppna \"%s\" (%s)\n" + + #: ext.c:82 + #, c-format + msgid "extension: library `%s': cannot call function `%s' (%s)\n" + msgstr "extension: bibliotek \"%s\": kan inte anropa funktionen \"%s\" (%s)\n" + + #: ext.c:180 + msgid "Operation Not Supported" + msgstr "Operationen stöds inte" + + #: getopt.c:692 getopt.c:704 + #, c-format + msgid "%s: option `%s' is ambiguous\n" + msgstr "%s: flaggan \"%s\" är tvetydig\n" + + #: getopt.c:737 getopt.c:741 + #, c-format + msgid "%s: option `--%s' doesn't allow an argument\n" + msgstr "%s: flaggan \"--%s\" tillåter inte argument\n" + + #: getopt.c:750 getopt.c:755 + #, c-format + msgid "%s: option `%c%s' doesn't allow an argument\n" + msgstr "%s: flaggan \"%c%s\" tillåter inte argument\n" + + #: getopt.c:791 getopt.c:804 getopt.c:1093 getopt.c:1106 + #, c-format + msgid "%s: option `%s' requires an argument\n" + msgstr "%s: flaggan \"%s\" kräver ett argument\n" + + #: getopt.c:842 getopt.c:845 + #, c-format + msgid "%s: unrecognized option `--%s'\n" + msgstr "%s: okänd flagga \"--%s\"\n" + + #: getopt.c:853 getopt.c:856 + #, c-format + msgid "%s: unrecognized option `%c%s'\n" + msgstr "%s: okänd flagga \"%c%s\"\n" + + #: getopt.c:903 getopt.c:906 + #, c-format + msgid "%s: illegal option -- %c\n" + msgstr "%s: otillåten flagga -- %c\n" + + #: getopt.c:912 getopt.c:915 + #, c-format + msgid "%s: invalid option -- %c\n" + msgstr "%s: ogiltig flagga -- %c\n" + + #: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412 + #, c-format + msgid "%s: option requires an argument -- %c\n" + msgstr "%s: flaggan kräver ett argument -- %c\n" + + #: getopt.c:1025 getopt.c:1036 + #, c-format + msgid "%s: option `-W %s' is ambiguous\n" + msgstr "%s: flaggan \"-W %s\" är tvetydig\n" + + #: getopt.c:1060 getopt.c:1072 + #, c-format + msgid "%s: option `-W %s' doesn't allow an argument\n" + msgstr "%s: flaggan \"-W %s\" tillåter inte något argument\n" + + #: main.c:307 + msgid "`-m[fr]' option irrelevant in gawk" + msgstr "\"-m[fr]\"-flaggan är irrelevant i gawk" + + #: main.c:309 + msgid "-m option usage: `-m[fr] nnn'" + msgstr "-m-flaggans användning: \"-m[fr] nnn\"" + + #: main.c:326 + #, c-format + msgid "%s: option `-W %s' unrecognized, ignored\n" + msgstr "%s: flaggan \"-W %s\" okänd, ignorerad\n" + + #: main.c:357 + msgid "empty argument to `--source' ignored" + msgstr "tomt argument till \"--source\" ignorerat" + + #: main.c:429 + msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" + msgstr "miljövariabeln \"POSIXLY_CORRECT\" satt: slår på \"--posix\"" + + #: main.c:434 + msgid "`--posix' overrides `--traditional'" + msgstr "\"--posix\" åsidosätter \"--traditional\"" + + #: main.c:445 + msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" + msgstr "\"--posix\"/\"--traditional\" åsidosätter \"--non-decimal-data\"" + + #: main.c:449 + #, fuzzy, c-format + msgid "running %s setuid root may be a security problem" + msgstr "att köra av %s setuid root kan vara ett säkerhetsproblem" + + #: main.c:478 + #, c-format + msgid "can't set mode on stdin (%s)" + msgstr "kan inte sätta läge på standard in (%s)" + + #: main.c:481 + #, c-format + msgid "can't set mode on stdout (%s)" + msgstr "kan inte sätta läge på standard ut (%s)" + + #: main.c:483 + #, c-format + msgid "can't set mode on stderr (%s)" + msgstr "kan inte sätta läge på standard fel (%s)" + + #: main.c:512 + msgid "no program text at all!" + msgstr "ingen programtext alls!" + + #: main.c:556 + #, c-format + msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" + msgstr "" + "Användning: %s [POSIX- eller GNU-stilsflaggor] -f progfil [--] fil ...\n" + + #: main.c:558 + #, c-format + msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" + msgstr "Användning: %s [POSIX- eller GNU-stilsflaggor] %cprogram%c fil ...\n" + + #: main.c:563 + msgid "POSIX options:\t\tGNU long options:\n" + msgstr "POSIX-flaggor:\t\tGNU långa flaggor:\n" + + #: main.c:564 + msgid "\t-f progfile\t\t--file=progfile\n" + msgstr "\t-f progfil\t\t--file=progfil\n" + + #: main.c:565 + msgid "\t-F fs\t\t\t--field-separator=fs\n" + msgstr "\t-F fs\t\t\t--field-separator=fs\n" + + #: main.c:566 + msgid "\t-v var=val\t\t--assign=var=val\n" + msgstr "\t-v var=värde\t\t--assign=var=värde\n" + + #: main.c:567 + msgid "\t-m[fr] val\n" + msgstr "\t-m[fr] värde\n" + + #: main.c:568 + msgid "\t-W compat\t\t--compat\n" + msgstr "\t-W compat\t\t--compat\n" + + #: main.c:569 + msgid "\t-W copyleft\t\t--copyleft\n" + msgstr "\t-W copyleft\t\t--copyleft\n" + + #: main.c:570 + msgid "\t-W copyright\t\t--copyright\n" + msgstr "\t-W copyright\t\t--copyright\n" + + #: main.c:571 + msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" + msgstr "\t-W dump-variables[=fil]\t--dump-variables[=fil]\n" + + #: main.c:572 + msgid "\t-W gen-po\t\t--gen-po\n" + msgstr "\t-W gen-po\t\t--gen-po\n" + + #: main.c:573 + msgid "\t-W help\t\t\t--help\n" + msgstr "\t-W help\t\t\t--help\n" + + #: main.c:574 + msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" + msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n" + + #: main.c:575 + msgid "\t-W lint-old\t\t--lint-old\n" + msgstr "\t-W lint-old\t\t--lint-old\n" + + #: main.c:576 + msgid "\t-W non-decimal-data\t--non-decimal-data\n" + msgstr "\t-W non-decimal-data\t--non-decimal-data\n" + + #: main.c:578 + msgid "\t-W nostalgia\t\t--nostalgia\n" + msgstr "\t-W nostalgia\t\t--nostalgia\n" + + #: main.c:581 + msgid "\t-W parsedebug\t\t--parsedebug\n" + msgstr "\t-W parsedebug\t\t--parsedebug\n" + + #: main.c:583 + msgid "\t-W profile[=file]\t--profile[=file]\n" + msgstr "\t-W profile[=fil]\t--profile[=fil]\n" + + #: main.c:584 + msgid "\t-W posix\t\t--posix\n" + msgstr "\t-W posix\t\t--posix\n" + + #: main.c:585 + msgid "\t-W re-interval\t\t--re-interval\n" + msgstr "\t-W re-interval\t\t--re-interval\n" + + #: main.c:586 + msgid "\t-W source=program-text\t--source=program-text\n" + msgstr "\t-W source=programtext\t--source=programtext\n" + + #: main.c:587 + msgid "\t-W traditional\t\t--traditional\n" + msgstr "\t-W traditional\t\t--traditional\n" + + #: main.c:588 + msgid "\t-W usage\t\t--usage\n" + msgstr "\t-W usage\t\t--usage\n" + + #: main.c:589 + msgid "\t-W version\t\t--version\n" + msgstr "\t-W version\t\t--version\n" + + #: main.c:593 + #, fuzzy + msgid "" + "\n" + "To report bugs, see node `Bugs' in `gawk.info', which is\n" + "section `Reporting Problems and Bugs' in the printed version.\n" + "\n" + msgstr "" + "sektionen \"Reporting Problems and Bugs\" i den utskrivna versionen.\n" + "Rapportera synpunkter på översättningen till .\n" + + #: main.c:597 + msgid "" + "gawk is a pattern scanning and processing language.\n" + "By default it reads standard input and writes standard output.\n" + "\n" + msgstr "" + + #: main.c:601 + msgid "" + "Examples:\n" + "\tgawk '{ sum += $1 }; END { print sum }' file\n" + "\tgawk -F: '{ print $1 }' /etc/passwd\n" + msgstr "" + + #: main.c:613 + #, c-format + msgid "" + "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" + "\n" + "This program is free software; you can redistribute it and/or modify\n" + "it under the terms of the GNU General Public License as published by\n" + "the Free Software Foundation; either version 2 of the License, or\n" + "(at your option) any later version.\n" + "\n" + msgstr "" + "Copyright © 1989, 1991-%d Free Software Foundation.\n" + "\n" + "Detta program är fri programvara. Du kan distribuera det och/eller\n" + "modifiera det under villkoren i GNU General Public License, publicerad\n" + "av Free Software Foundation, antingen version 2 eller (om du så vill)\n" + "någon senare version.\n" + "\n" + + #: main.c:621 + msgid "" + "This program is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "GNU General Public License for more details.\n" + "\n" + msgstr "" + "Detta program distribueras i hopp om att det ska vara användbart,\n" + "men UTAN NÅGON SOM HELST GARANTI, även utan underförstådd garanti\n" + "om SÄLJBARHET eller LÄMPLIGHET FÖR NÅGOT SPECIELLT ÄNDAMÅL. Se GNU\n" + "General Public License för ytterligare information.\n" + "\n" + + #: main.c:627 + msgid "" + "You should have received a copy of the GNU General Public License\n" + "along with this program; if not, write to the Free Software\n" + "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + msgstr "" + "Du bör ha fått en kopia av GNU General Public License tillsammans\n" + "med detta program. Om inte, skriv till Free Software Foundation,\n" + "Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + + #: main.c:657 + msgid "-Ft does not set FS to tab in POSIX awk" + msgstr "-Ft sätter inte FS till tab i POSIX-awk" + + #: main.c:888 + #, c-format + msgid "invalid syntax in name `%s' for variable assignment" + msgstr "ogiltig syntax i namnet \"%s\" för variabeltilldelning" + + #: main.c:957 + msgid "floating point exception" + msgstr "flyttalsundantag" + + #: main.c:964 + msgid "fatal error: internal error" + msgstr "ödesdigert fel: internt fel" + + #: main.c:1014 + #, c-format + msgid "no pre-opened fd %d" + msgstr "ingen föröppnad fd %d" + + #: main.c:1019 + #, c-format + msgid "could not pre-open /dev/null for fd %d" + msgstr "kunde inte föröppna /dev/null för fd %d" + + #: main.c:1037 main.c:1046 + #, c-format + msgid "could not find groups: %s" + msgstr "kunde inte hitta grupper: %s" + + #: profile.c:94 + #, c-format + msgid "could not open `%s' for writing: %s" + msgstr "kunde inte öppna \"%s\" för skrivning: %s" + + #: profile.c:96 awkgram.y:2465 + msgid "sending profile to standard error" + msgstr "skickar profilen till standard fel" + + #: profile.c:409 + msgid "internal error: Node_var with null vname" + msgstr "internt fel: Node_var med null vname" + + #: profile.c:524 + msgid "internal error: Node_var_array with null vname" + msgstr "internt fel: Node_var_vektor med null vname" + + #: profile.c:554 eval.c:813 + #, c-format + msgid "" + "function `%s' called with space between name and `(',\n" + "%s" + msgstr "" + "funktionen \"%s\" anropad med blanktecken mellan namnet och \"(\",\n" + "%s" + + #: profile.c:556 eval.c:815 + msgid "or used in other expression context" + msgstr "eller använt i andra uttryckssammanhang" + + #: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741 + #, c-format + msgid "attempt to use array `%s' in a scalar context" + msgstr "försök att använda vektorn \"%s\" i skalärsammanhang" + + #: profile.c:637 eval.c:1047 + #, c-format + msgid "illegal type (%s) in tree_eval" + msgstr "otillåten typ (%s) i tree_eval" + + #: profile.c:842 eval.c:1790 + #, c-format + msgid "attempt to use function `%s' as array" + msgstr "försök att använda funktionen \"%s\" som vektor" + + #: profile.c:856 eval.c:1797 + #, c-format + msgid "`%s' is a function, assignment is not allowed" + msgstr "\"%s\" är en funktion, tilldelning är inte tillåtet" + + #: profile.c:860 eval.c:1803 eval.c:1810 + msgid "assignment is not allowed to result of builtin function" + msgstr "det är inte tillåtet att tilldela resultatet från en inbyggd funktion" + + #: profile.c:1108 + #, c-format + msgid "\t# gawk profile, created %s\n" + msgstr "\t# gawkprofil, skapad %s\n" + + #: profile.c:1111 + msgid "" + "\t# BEGIN block(s)\n" + "\n" + msgstr "" + "\t# BEGIN-block\n" + "\n" + + #: profile.c:1121 + msgid "" + "\t# Rule(s)\n" + "\n" + msgstr "" + "\t# Regel/regler\n" + "\n" + + #: profile.c:1127 + msgid "" + "\t# END block(s)\n" + "\n" + msgstr "" + "\t# END-block\n" + "\n" + + #: profile.c:1147 + msgid "" + "\n" + "\t# Functions, listed alphabetically\n" + msgstr "" + "\n" + "\t# Funktioner, listade alfabetiskt\n" + + #: profile.c:1357 + #, c-format + msgid "unexpected type %s in prec_level" + msgstr "oväntad typ %s i prec_level" + + #: regex.c:1322 + msgid "Success" + msgstr "Lyckades" + + #: regex.c:1323 + msgid "No match" + msgstr "Misslyckades" + + #: regex.c:1324 + msgid "Invalid regular expression" + msgstr "Ogiltigt reguljärt uttryck" + + #: regex.c:1325 + msgid "Invalid collation character" + msgstr "Ogiltigt kollationeringstecken" + + #: regex.c:1326 + msgid "Invalid character class name" + msgstr "Ogiltigt teckenklassnamn" + + #: regex.c:1327 + msgid "Trailing backslash" + msgstr "Eftersläpande omvänt snedstreck" + + #: regex.c:1328 + msgid "Invalid back reference" + msgstr "Ogiltig bakåtrerefens" + + #: regex.c:1329 + msgid "Unmatched [ or [^" + msgstr "Obalanserad [ eller [^" + + #: regex.c:1330 + msgid "Unmatched ( or \\(" + msgstr "Obalanserad ( eller \\(" + + #: regex.c:1331 + msgid "Unmatched \\{" + msgstr "Obalanserad \\{" + + #: regex.c:1332 + msgid "Invalid content of \\{\\}" + msgstr "Ogiltigt innehåll i \\{\\}" + + #: regex.c:1333 + msgid "Invalid range end" + msgstr "Ogiltigt omfångsslut" + + #: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204 + msgid "Memory exhausted" + msgstr "Minnet slut" + + #: regex.c:1335 + msgid "Invalid preceding regular expression" + msgstr "Ogiltigt föregående reguljärt uttryck" + + #: regex.c:1336 + msgid "Premature end of regular expression" + msgstr "För tidigt slut på reguljärt uttryck" + + #: regex.c:1337 + msgid "Regular expression too big" + msgstr "Reguljärt uttryck för stort" + + #: regex.c:1338 + msgid "Unmatched ) or \\)" + msgstr "Obalanserad ) eller \\)" + + #: regex.c:7365 + msgid "No previous regular expression" + msgstr "Inget föregående reguljärt uttryck" + + #: awkgram.y:232 + msgid "BEGIN blocks must have an action part" + msgstr "BEGIN-block måste ha en åtgärdsdel" + + #: awkgram.y:238 + msgid "END blocks must have an action part" + msgstr "END-block måste ha en åtgärdsdel" + + #: awkgram.y:274 + #, c-format + msgid "`%s' is a built-in function, it cannot be redefined" + msgstr "\"%s\" är en inbyggd funktion, den kan inte definieras om" + + #: awkgram.y:362 + msgid "statement may have no effect" + msgstr "kommandot kanske inte har någon effekt" + + #: awkgram.y:455 + msgid "`next' used in BEGIN or END action" + msgstr "\"next\" använd i BEGIN- eller END-åtgärd" + + #: awkgram.y:462 awkgram.y:469 + msgid "`nextfile' is a gawk extension" + msgstr "\"nextfile\" är en gawk-utökning" + + #: awkgram.y:474 + msgid "`nextfile' used in BEGIN or END action" + msgstr "\"nextfile\" använd i BEGIN- eller END-åtgärd" + + #: awkgram.y:483 + msgid "`return' used outside function context" + msgstr "\"return\" använd utanför funktion" + + #: awkgram.y:519 + msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" + msgstr "" + "ensamt \"print\" i BEGIN eller END-regel bör troligen vara 'print \"\"'" + + #: awkgram.y:532 awkgram.y:539 + msgid "`delete array' is a gawk extension" + msgstr "\"delete array\" är en gawk-utökning" + + #: awkgram.y:604 + msgid "multistage two-way pipelines don't work" + msgstr "flerstegs dubbelriktade rör fungerar inte" + + #: awkgram.y:695 + msgid "regular expression on right of assignment" + msgstr "reguljärt uttryck i högerledet av en tilldelning" + + #: awkgram.y:713 + msgid "non-redirected `getline' undefined inside END action" + msgstr "icke omdirigerad \"getline\" odefinierad inuti END-åtgärd" + + #: awkgram.y:723 + msgid "regular expression on left of `~' or `!~' operator" + msgstr "reguljärt uttryck på vänster sida om en \"~\"- eller \"!~\"-operator" + + #: awkgram.y:733 + #, c-format + msgid "regexp constant `/%s/' looks like a C comment, but is not" + msgstr "regexp-konstanten \"/%s/\" ser ut som en C-kommentar men är inte det" + + #: awkgram.y:749 + msgid "regular expression on right of comparison" + msgstr "reguljärt uttryck i högerledet av en jämförelse" + + #: awkgram.y:776 + msgid "non-redirected `getline' undefined inside BEGIN or END action" + msgstr "" + "icke omdirigerad \"getline\" odefinierade inuti BEGIN- eller END-åtgärd" + + #: awkgram.y:831 + msgid "call of `length' without parentheses is not portable" + msgstr "anrop av \"length\" utan parenteser är inte portabelt" + + #: awkgram.y:834 + msgid "call of `length' without parentheses is deprecated by POSIX" + msgstr "anrop av \"length\" utan parenteser är föråldrat enligt POSIX" + + #: awkgram.y:884 + msgid "invalid subscript expression" + msgstr "ogiltig indexuttryck" + + #: awkgram.y:1033 + #, c-format + msgid "fptr %x not in tokentab\n" + msgstr "fptr %x är inte i tokentab\n" + + #: awkgram.y:1068 + msgid "unexpected newline" + msgstr "oväntat nyradstecken" + + #: awkgram.y:1152 + msgid "empty program text on command line" + msgstr "tom programtext på kommandoraden" + + #: awkgram.y:1209 + #, c-format + msgid "can't open source file `%s' for reading (%s)" + msgstr "kan inte öppna källfilen \"%s\" för läsning (%s)" + + #: awkgram.y:1244 + #, c-format + msgid "can't read sourcefile `%s' (%s)" + msgstr "kan inte läsa källfilen \"%s\" (%s)" + + #: awkgram.y:1252 + #, c-format + msgid "source file `%s' is empty" + msgstr "källfilen \"%s\" är tom" + + #: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011 + msgid "source file does not end in newline" + msgstr "källfilen slutar inte med en ny rad" + + #: awkgram.y:1518 + msgid "unterminated regexp ends with `\\' at end of file" + msgstr "oavslutat reguljärt uttryck slutar med \"\\\" i slutet av filen" + + #: awkgram.y:1539 + msgid "unterminated regexp" + msgstr "oavslutat reguljärt uttryck" + + #: awkgram.y:1542 + msgid "unterminated regexp at end of file" + msgstr "oavslutat reguljärt uttryck i slutet av filen" + + #: awkgram.y:1609 + msgid "use of `\\ #...' line continuation is not portable" + msgstr "Användning av \"\\ #...\" för radfortsättning är inte portabelt" + + #: awkgram.y:1621 + msgid "backslash not last character on line" + msgstr "sista tecknet på raden är inte ett omvänt snedstreck" + + #: awkgram.y:1662 + msgid "POSIX does not allow operator `**='" + msgstr "POSIX tillåter inte operatorn \"**=\"" + + #: awkgram.y:1664 + msgid "old awk does not support operator `**='" + msgstr "gamla awk stöder inte operatorn \"**=\"" + + #: awkgram.y:1673 + msgid "POSIX does not allow operator `**'" + msgstr "POSIX tillåter inte operatorn \"**\"" + + #: awkgram.y:1675 + msgid "old awk does not support operator `**'" + msgstr "gamla awk stöder inte operatorn \"**\"" + + #: awkgram.y:1708 + msgid "operator `^=' is not supported in old awk" + msgstr "operatorn \"^=\" stöds inte i gamla awk" + + #: awkgram.y:1716 + msgid "operator `^' is not supported in old awk" + msgstr "operatorn \"^\" stöds inte i gamla awk" + + #: awkgram.y:1798 awkgram.y:1815 + msgid "unterminated string" + msgstr "oavslutad sträng" + + #: awkgram.y:1972 + #, c-format + msgid "invalid char '%c' in expression" + msgstr "ogiltigt tecken \"%c\" i uttryck" + + #: awkgram.y:2032 + #, c-format + msgid "`%s' is a gawk extension" + msgstr "\"%s\" är en gawk-utökning" + + #: awkgram.y:2035 + #, c-format + msgid "`%s' is a Bell Labs extension" + msgstr "\"%s\" är en Bell Labs-utökning" + + #: awkgram.y:2038 + #, c-format + msgid "POSIX does not allow `%s'" + msgstr "POSIX tillåter inte \"%s\"" + + #: awkgram.y:2042 + #, c-format + msgid "`%s' is not supported in old awk" + msgstr "\"%s\" stöds inte i gamla awk" + + #: awkgram.y:2070 + msgid "`goto' considered harmful!\n" + msgstr "\"goto\" anses skadlig!\n" + + #: awkgram.y:2134 + #, c-format + msgid "%d is invalid as number of arguments for %s" + msgstr "%d är ett ogiltigt antal argument för %s" + + #: awkgram.y:2153 awkgram.y:2156 + msgid "match: third argument is a gawk extension" + msgstr "match: tredje argumentet är en gawk-utökning" + + #: awkgram.y:2172 + #, c-format + msgid "%s: string literal as last arg of substitute has no effect" + msgstr "" + "%s: bokstavlig sträng som sista argument till ersättning har ingen effekt" + + #: awkgram.y:2176 + msgid "sub third parameter is not a changeable object" + msgstr "sub: tredje argumentet är inte ett ändringsbart objekt" + + #: awkgram.y:2178 + msgid "gsub third parameter is not a changeable object" + msgstr "gsub: tredje argumentet är inte ett ändringsbart objekt" + + #: awkgram.y:2204 awkgram.y:2207 + msgid "close: second argument is a gawk extension" + msgstr "close: andra argumentet är en gawk-utökning" + + #: awkgram.y:2217 + msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" + msgstr "" + "användandet av dcgettext(_\"...\") är felaktigt: ta bort det inledande " + "understrykningstecknet" + + #: awkgram.y:2232 + #, fuzzy + msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" + msgstr "" + "användandet av dcgettext(_\"...\") är felaktigt: ta bort det inledande " + "understrykningstecknet" + + #: awkgram.y:2323 + #, c-format + msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" + msgstr "funktionen \"%s\": parameter %d, \"%s\", är samma som parameter %d" + + #: awkgram.y:2355 + #, c-format + msgid "function `%s': parameter `%s' shadows global variable" + msgstr "funktionen \"%s\": parametern \"%s\" överskuggar en global variabel" + + #: awkgram.y:2464 + #, c-format + msgid "could not open `%s' for writing (%s)" + msgstr "kunde inte öpnna \"%s\" för skrivning (%s)" + + #: awkgram.y:2495 + #, c-format + msgid "%s: close failed (%s)" + msgstr "%s: misslyckades att stänga (%s)" + + #: awkgram.y:2605 + msgid "shadow_funcs() called twice!" + msgstr "shadow_funcs() anropad två gånger!" + + #: awkgram.y:2680 + #, c-format + msgid "function `%s': can't use function name as parameter name" + msgstr "funktionen \"%s\": kan inte använda funktionsnamn som parameternamn" + + #: awkgram.y:2690 + #, c-format + msgid "function name `%s' previously defined" + msgstr "funktionsnamnet \"%s\" är definierat sedan tidigare" + + #: awkgram.y:2838 awkgram.y:2844 + #, c-format + msgid "function `%s' called but never defined" + msgstr "funktionen \"%s\" anropad men aldrig definierad" + + #: awkgram.y:2847 + #, c-format + msgid "function `%s' defined but never called" + msgstr "funktionen \"%s\" definierad men aldrig anropad" + + #: awkgram.y:2874 + #, c-format + msgid "regexp constant for parameter #%d yields boolean value" + msgstr "konstant reguljärt uttryck för parameter %d ger ett booleskt värde" + + #: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649 + #: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078 + #: dfa.c:1081 dfa.c:1094 dfa.c:1095 + msgid "Unbalanced [" + msgstr "Obalanserad [" + + #: dfa.c:783 + msgid "Unfinished \\ escape" + msgstr "Oavslutad \\-kontrollsekvens" + + #: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955 + msgid "unfinished repeat count" + msgstr "oavslutat upprepningsantal" + + #: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958 + msgid "malformed repeat count" + msgstr "felaktigt utformat upprepningsantal" + + #: dfa.c:1285 + msgid "Unbalanced (" + msgstr "Obalanserad (" + + #: dfa.c:1407 + msgid "No regexp syntax bits specified" + msgstr "Inga syntaxbitar för reguljära uttryck angivna" + + #: dfa.c:1415 + msgid "Unbalanced )" + msgstr "Obalanserad )" + + #: dfa.c:3014 + msgid "out of memory" + msgstr "slut på minne" + + #: field.c:849 + msgid "split: second argument is not an array" + msgstr "split: andra argumentet är inte en vektor" + + #: field.c:876 + msgid "split: null string for third arg is a gawk extension" + msgstr "split: tom sträng som tredje argument är en gawk-utökning" + + #: field.c:916 + msgid "`FIELDWIDTHS' is a gawk extension" + msgstr "\"FIELDWIDTHS\" är en gawk-utökning" + + #: field.c:943 + #, c-format + msgid "field %d in FIELDWIDTHS, must be > 0" + msgstr "fält %d i FIELDWIDTHS måste vara > 0" + + #: field.c:997 + msgid "null string for `FS' is a gawk extension" + msgstr "tom sträng som \"FS\" är en gawk-utökning" + + #: msg.c:57 + msgid "cmd. line:" + msgstr "kommandorad:" + + #: msg.c:123 + msgid "warning: " + msgstr "varning: " + + #: msg.c:145 + msgid "error: " + msgstr "fel: " + + #: msg.c:178 + msgid "fatal: " + msgstr "ödesdigert: " + + #: eval.c:259 + #, c-format + msgid "unknown nodetype %d" + msgstr "okänd nodtyp %d" + + #: eval.c:307 + msgid "buffer overflow in genflags2str" + msgstr "buffertöverflöd i genflags2str" + + #: eval.c:541 + #, c-format + msgid "for loop: array `%s' changed size from %d to %d during loop execution" + msgstr "" + "forslinga: vektorn \"%s\" ändrade storlek från %d till %d under " + "slingexekvering" + + #: eval.c:565 + msgid "`break' outside a loop is not portable" + msgstr "\"break\" utanför en slinga är inte portabelt" + + #: eval.c:569 + msgid "`break' outside a loop is not allowed" + msgstr "\"break\" utanför en slinga är inte tillåtet" + + #: eval.c:588 + msgid "`continue' outside a loop is not portable" + msgstr "\"continue\" utanför en slinga är inte portabelt" + + #: eval.c:592 + msgid "`continue' outside a loop is not allowed" + msgstr "\"continue\" utanför en slinga är inte tillåtet" + + #: eval.c:622 + msgid "`next' cannot be called from a BEGIN rule" + msgstr "\"next\" kan inte anropas från en BEGIN-regel" + + #: eval.c:624 + msgid "`next' cannot be called from an END rule" + msgstr "\"next\" kan inte anropas från en END-regel" + + #: eval.c:636 + msgid "`nextfile' cannot be called from a BEGIN rule" + msgstr "\"nextfile\" kan inte anropas från en BEGIN-regel" + + #: eval.c:638 + msgid "`nextfile' cannot be called from an END rule" + msgstr "\"nextfile\" kan inte anropas från en END-regel" + + #: eval.c:679 + msgid "statement has no effect" + msgstr "kommandot har ingen effekt" + + #: eval.c:713 eval.c:743 eval.c:1622 + #, c-format + msgid "reference to uninitialized variable `%s'" + msgstr "referens till icke initierad variabel \"%s\"" + + #: eval.c:721 eval.c:1608 + #, c-format + msgid "can't use function name `%s' as variable or array" + msgstr "kan inte använda funktionsnamnet \"%s\" som variabel eller vektor" + + #: eval.c:728 eval.c:734 eval.c:1747 + #, c-format + msgid "reference to uninitialized argument `%s'" + msgstr "referens till icke initierat argument \"%s\"" + + #: eval.c:823 + msgid "assignment used in conditional context" + msgstr "tilldelning använt i jämförelsesammanhang" + + #: eval.c:914 + msgid "" + "concatenation: side effects in one expression have changed the length of " + "another!" + msgstr "" + "concatenation: sidoeffekter i ett uttryck har ändrat längden av ett annat!" + + #: eval.c:1013 + msgid "division by zero attempted" + msgstr "försökte dividera med noll" + + #: eval.c:1028 + #, c-format + msgid "division by zero attempted in `%%'" + msgstr "försökte dividera med noll i \"%%\"" + + #: eval.c:1236 + msgid "division by zero attempted in `/='" + msgstr "försökte dividera med noll i \"/=\"" + + #: eval.c:1254 + #, c-format + msgid "division by zero attempted in `%%='" + msgstr "försökte dividera med noll i \"%%=\"" + + #: eval.c:1424 + #, c-format + msgid "%s (from %s)" + msgstr "%s (från %s)" + + #: eval.c:1472 + #, c-format + msgid "function `%s' called with more arguments than declared" + msgstr "funktionen \"%s\" anropad med fler argument än vad som deklarerats" + + #: eval.c:1519 + #, c-format + msgid "function `%s' not defined" + msgstr "funktionen \"%s\" är inte definierad" + + #: eval.c:1521 + #, c-format + msgid "function %s called\n" + msgstr "funktionen %s anropad\n" + + #: eval.c:1580 + msgid "" + "\n" + "\t# Function Call Stack:\n" + "\n" + msgstr "" + "\n" + "\t# Funktionsanropsstack:\n" + "\n" + + #: eval.c:1583 + msgid "\t# -- main --\n" + msgstr "\t# -- main --\n" + + #: eval.c:1759 + msgid "attempt to field reference from non-numeric value" + msgstr "försök att fältreferera från ickenumeriskt värde" + + #: eval.c:1761 + msgid "attempt to reference from null string" + msgstr "försök att referera från tom sträng" + + #: eval.c:1767 + #, c-format + msgid "attempt to access field %d" + msgstr "försök att komma åt fält nummer %d" + + #: eval.c:1783 + #, c-format + msgid "attempt to use scalar parameter `%s' as an array" + msgstr "försök att använda skalärparametern \"%s\" som en vektor" + + #: eval.c:1874 + msgid "`IGNORECASE' is a gawk extension" + msgstr "\"IGNORECASE\" är en gawk-utökning" + + #: eval.c:1902 + msgid "`BINMODE' is a gawk extension" + msgstr "\"BINMODE\" är en gawk-utökning" + + #: eval.c:2014 + #, c-format + msgid "bad `%sFMT' specification `%s'" + msgstr "felaktig \"%sFMT\"-specifikation \"%s\"" + + #: eval.c:2080 + msgid "turning off `--lint' due to assignment to `LINT'" + msgstr "slår av \"--lint\" på grund av en tilldelning till \"LINT\"" + + #: eval.c:2116 + msgid "NF set to negative value" + msgstr "NF satt till ett negativt värde" + + #: io.c:240 + #, c-format + msgid "cannot open file `%s' for reading (%s)" + msgstr "kan inte öppna filen \"%s\" för läsning (%s)" + + #: io.c:320 + #, c-format + msgid "close of fd %d (`%s') failed (%s)" + msgstr "stängning av fd %d (\"%s\") misslyckades (%s)" + + #: io.c:432 + #, c-format + msgid "invalid tree type %s in redirect()" + msgstr "ogiltig trädtyp %s i redirect()" + + #: io.c:438 + #, c-format + msgid "expression in `%s' redirection only has numeric value" + msgstr "uttrycket i \"%s\"-omdirigering har bara numeriskt värde" + + #: io.c:444 + #, c-format + msgid "expression for `%s' redirection has null string value" + msgstr "uttrycket för \"%s\"-omdirigering har en tom sträng som värde" + + #: io.c:449 + #, c-format + msgid "filename `%s' for `%s' redirection may be result of logical expression" + msgstr "" + "filnamnet \"%s\" för \"%s\"-omdirigering kan vara resultatet av ett logiskt " + "uttryck" + + #: io.c:471 + #, c-format + msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" + msgstr "onödig blandning av \">\" och \">>\" för filen \"%.*s\"" + + #: io.c:523 + #, c-format + msgid "can't open pipe `%s' for output (%s)" + msgstr "kan inte öppna röret \"%s\" för utmatning (%s)" + + #: io.c:532 + #, c-format + msgid "can't open pipe `%s' for input (%s)" + msgstr "kan inte öppna röret \"%s\" för inmatning (%s)" + + #: io.c:545 + #, c-format + msgid "can't open two way socket `%s' for input/output (%s)" + msgstr "kan inte öppna tvåvägsuttaget \"%s\" för in-/utmatning (%s)" + + #: io.c:549 + #, c-format + msgid "can't open two way pipe `%s' for input/output (%s)" + msgstr "kan inte öppna tvåvägsröret \"%s\" för in-/utmatning (%s)" + + #: io.c:625 + #, c-format + msgid "can't redirect from `%s' (%s)" + msgstr "kan inte dirigera om från \"%s\" (%s)" + + #: io.c:628 + #, c-format + msgid "can't redirect to `%s' (%s)" + msgstr "kan inte dirigera om till \"%s\" (%s)" + + #: io.c:667 + msgid "" + "reached system limit for open files: starting to multiplex file descriptors" + msgstr "" + "nådde systembegränsningen för öppna filer: börjar multiplexa fildeskriptorer" + + #: io.c:679 + #, c-format + msgid "close of `%s' failed (%s)." + msgstr "stängning av \"%s\" misslyckades (%s)" + + #: io.c:686 + msgid "too many pipes or input files open" + msgstr "för många rör eller indatafiler öppna" + + #: io.c:709 + msgid "close: second argument must be `to' or `from'" + msgstr "close: andra argumentet måste vara \"to\" eller \"from\"" + + #: io.c:723 + #, c-format + msgid "close: `%.*s' is not an open file, pipe or co-process" + msgstr "close: \"%.*s\" är inte en öppen fil, rör eller koprocess" + + #: io.c:727 + msgid "close of redirection that was never opened" + msgstr "stängning av omdirigering som aldrig öppnades" + + #: io.c:754 + #, c-format + msgid "close: redirection `%s' not opened with `|&', second argument ignored" + msgstr "" + "close: omdirigeringen \"%s\" öppnades inte med \"|&\", andra argumentet " + "ignorerat" + + #: io.c:811 + #, c-format + msgid "failure status (%d) on pipe close of `%s' (%s)" + msgstr "felstatus (%d) från rörstängning av \"%s\" (%s)" + + #: io.c:814 + #, c-format + msgid "failure status (%d) on file close of `%s' (%s)" + msgstr "felstatus (%d) från filstängning av \"%s\" (%s)" + + #: io.c:833 + #, c-format + msgid "no explicit close of socket `%s' provided" + msgstr "ingen explicit stängning av uttaget \"%s\" tillhandahållen" + + #: io.c:836 + #, c-format + msgid "no explicit close of co-process `%s' provided" + msgstr "ingen explicit stängning av koprocessen \"%s\" tillhandahållen" + + #: io.c:839 + #, c-format + msgid "no explicit close of pipe `%s' provided" + msgstr "ingen explicit stängning av röret \"%s\" tillhandahållen" + + #: io.c:842 + #, c-format + msgid "no explicit close of file `%s' provided" + msgstr "ingen explicit stängning av filen \"%s\" tillhandahållen" + + #: io.c:871 io.c:925 + #, c-format + msgid "error writing standard output (%s)" + msgstr "fel vid skrivning till standard ut (%s)" + + #: io.c:875 io.c:929 + #, c-format + msgid "error writing standard error (%s)" + msgstr "fel vid skrivning till standard fel (%s)" + + #: io.c:883 + #, c-format + msgid "pipe flush of `%s' failed (%s)." + msgstr "rörspolning av \"%s\" misslyckades (%s)" + + #: io.c:886 + #, c-format + msgid "co-process flush of pipe to `%s' failed (%s)." + msgstr "koprocesspolning av röret till \"%s\" misslyckades (%s)" + + #: io.c:889 + #, c-format + msgid "file flush of `%s' failed (%s)." + msgstr "filspolning av \"%s\" misslyckades (%s)" + + #: io.c:1048 + msgid "/inet/raw client not ready yet, sorry" + msgstr "/inet/raw-klient är tyvärr inte klar än" + + #: io.c:1050 io.c:1087 + msgid "only root may use `/inet/raw'." + msgstr "bara root kan använda \"/inet/raw\"." + + #: io.c:1085 + msgid "/inet/raw server not ready yet, sorry" + msgstr "/inet/raw-server inte redo än, ledsen" + + #: io.c:1175 + #, c-format + msgid "no (known) protocol supplied in special filename `%s'" + msgstr "" + "inget (känt) protokoll tillhandahållet i det speciella filnamnet \"%s\"" + + #: io.c:1193 + #, c-format + msgid "special file name `%s' is incomplete" + msgstr "speciellt filnamn \"%s\" är ofullständigt" + + #: io.c:1205 + #, c-format + msgid "local port invalid in `%s'" + msgstr "lokal port ogiltig i \"%s\"" + + #: io.c:1217 + msgid "must supply a remote hostname to `/inet'" + msgstr "måste tillhandahålla ett fjärrdatornamn till \"/inet\"" + + #: io.c:1232 + msgid "must supply a remote port to `/inet'" + msgstr "måste tillhandahålla en fjärrport till \"/inet\"" + + #: io.c:1238 + #, c-format + msgid "remote port invalid in `%s'" + msgstr "fjärrporten ogiltig i \"%s\"" + + #: io.c:1248 + msgid "TCP/IP communications are not supported" + msgstr "TCP/IP-kommunikation stöds inte" + + #: io.c:1257 io.c:1438 + #, c-format + msgid "file `%s' is a directory" + msgstr "filen \"%s\" är en katalog" + + #: io.c:1327 + #, c-format + msgid "use `PROCINFO[\"%s\"]' instead of `%s'" + msgstr "använd \"PROCINFO[\"%s\"]\" istället för \"%s\"" + + #: io.c:1359 + msgid "use `PROCINFO[...]' instead of `/dev/user'" + msgstr "använd \"PROCINFO[...]\" istället för \"dev/user\"" + + #: io.c:1424 + #, c-format + msgid "could not open `%s', mode `%s'" + msgstr "kunde inte öppna \"%s\", läge \"%s\"" + + #: io.c:1550 io.c:1602 io.c:1732 io.c:1754 + #, c-format + msgid "moving pipe to stdout in child failed (dup: %s)" + msgstr "flyttande av rör till standard ut i barnet misslyckades (dup: %s)" + + #: io.c:1554 io.c:1607 + #, c-format + msgid "moving pipe to stdin in child failed (dup: %s)" + msgstr "flyttande av rör till standard in i barnet misslyckades (dup: %s)" + + #: io.c:1571 io.c:1745 + msgid "restoring stdout in parent process failed\n" + msgstr "återställande av standard ut i förälderprocessen misslyckades\n" + + #: io.c:1576 + msgid "restoring stdin in parent process failed\n" + msgstr "återställande av standard in i förälderprocessen misslyckades\n" + + #: io.c:1599 io.c:1751 + #, c-format + msgid "close of stdout in child failed (%s)" + msgstr "stängning av standard ut i barnet misslyckades (%s)" + + #: io.c:1604 + #, c-format + msgid "close of stdin in child failed (%s)" + msgstr "stängning av standard in i barnet misslyckades (%s)" + + #: io.c:1610 io.c:1756 io.c:1767 + #, c-format + msgid "close of pipe failed (%s)" + msgstr "stängning av röret misslyckades (%s)" + + #: io.c:1655 + msgid "`|&' not supported" + msgstr "\"|&\" stöds inte" + + #: io.c:1722 + #, c-format + msgid "cannot open pipe `%s' (%s)" + msgstr "kan inte öppna röret \"%s\" (%s)" + + #: io.c:1763 + #, c-format + msgid "cannot create child process for `%s' (fork: %s)" + msgstr "kan inte skapa barnprocess för \"%s\" (fork: %s)" + + #: io.c:2104 + #, c-format + msgid "data file `%s' is empty" + msgstr "datafilen \"%s\" är tom" + + #: io.c:2175 + #, c-format + msgid "internal error: file `%s', line %d\n" + msgstr "internt fel: filen \"%s\", rad %d\n" + + #: io.c:2277 + #, c-format + msgid "error reading input file `%s': %s" + msgstr "fel vid läsning av indatafilen \"%s\": %s" + + #: io.c:2521 + msgid "multicharacter value of `RS' is a gawk extension" + msgstr "flerteckensvärdet av \"RS\" är en gawk-utökning" + + #: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 + msgid "can't convert string to float" + msgstr "kan inte konvertera en sträng till flyttal" + + #: node.c:342 + msgid "backslash at end of string" + msgstr "omvänt snedstreck i slutet av strängen" + + #: node.c:524 + msgid "POSIX does not allow `\\x' escapes" + msgstr "POSIX tillåter inte \"\\x\"-kontrollsekvenser" + + #: node.c:530 + msgid "no hex digits in `\\x' escape sequence" + msgstr "inga hexadecimala siffror i \"\\x\"-kontrollsekvenser" + + #: node.c:564 + #, c-format + msgid "escape sequence `\\%c' treated as plain `%c'" + msgstr "kontrollsekvensen \"\\%c\" behandlad som bara \"%c\"" + + #: re.c:208 + #, c-format + msgid "regex match failed, not enough memory to match string \"%.*s%s\"" + msgstr "" + + #: posix/gawkmisc.c:122 + #, c-format + msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)" + msgstr "%s %s \"%s\": kunde inte sätta stäng-vid-exec (fcntl: %s)" + + #~ msgid "" + #~ "\n" + #~ "To report bugs, see node `Bugs' in `gawk.info', which is\n" + #~ msgstr "" + #~ "\n" + #~ "För att rapportera fel, se noden \"Bugs\" i \"gawk.info\" som är\n" diff -crN gawk-3.1.0/po/tr.po gawk-3.1.1/po/tr.po *** gawk-3.1.0/po/tr.po Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/po/tr.po Wed May 1 16:41:00 2002 *************** *** 0 **** --- 1,1761 ---- + # Turkish translations for GNU awk messages + # Copyright (C) 2002 Free Software Foundation, Inc. + # Nilgün Belma Bugüner , 2001, 2002. + # + msgid "" + msgstr "" + "Project-Id-Version: gawk 3.1.1a\n" + "POT-Creation-Date: 2002-05-01 16:40+0300\n" + "PO-Revision-Date: 2002-04-29 18:03+0300\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.6\n" + + # ÖNEMLİ: Türkçe iletileri elde edebilmek için 3.1.0 sürümünde + # paketi yapılandırırken --with-included-gettext seçeneÄŸi + # kullanılmalıdır.(GNU-TR - 07.07.2001) + #: array.c:243 array.c:275 array.c:280 eval.c:483 + #, c-format + msgid "attempt to use scalar `%s' as array" + msgstr "sayısal `%s' dizi olarak kullanılmaya çalışılıyor" + + #: array.c:304 + #, c-format + msgid "reference to uninitialized element `%s[\"%s\"]'" + msgstr "ön deÄŸer atanmamış öğeye ( %s[\"%s\"] ) baÅŸvuru yapılıyor" + + #: array.c:310 + #, c-format + msgid "subscript of array `%s' is null string" + msgstr "dizinin indisi `%s' bir null dizge" + + #: array.c:373 array.c:456 + #, c-format + msgid "delete: illegal use of variable `%s' as array" + msgstr "delete: `%s' deÄŸiÅŸkeninin dizi olarak kullanımı kuraldışı" + + #: array.c:406 + #, c-format + msgid "delete: index `%s' not in array `%s'" + msgstr "delete: `%s' indeksi `%s' dizisinde deÄŸil" + + #: array.c:571 + #, c-format + msgid "%s: empty (null)\n" + msgstr "%s: boÅŸ (null)\n" + + #: array.c:576 + #, c-format + msgid "%s: empty (zero)\n" + msgstr "%s: boÅŸ (sıfır)\n" + + #: array.c:580 + #, c-format + msgid "%s: table_size = %d, array_size = %d\n" + msgstr "%s: tablo_uzunluÄŸu = %d, dizi_indisi = %d\n" + + #: array.c:612 + #, c-format + msgid "%s: is parameter\n" + msgstr "%s: parametredir\n" + + #: array.c:617 + #, c-format + msgid "%s: array_ref to %s\n" + msgstr "%s: %s için dizi baÅŸvurusu\n" + + #: array.c:844 + msgid "asort: first argument is not an array" + msgstr "asort: ilk argüman bir dizi deÄŸil" + + #: array.c:853 + msgid "asort: second argument is not an array" + msgstr "asort: ikinci argüman bir dizi deÄŸil" + + #: builtin.c:107 + #, c-format + msgid "%s to \"%s\" failed (%s)" + msgstr "%s \"%s\"ya yazılamadı (%s)" + + #: builtin.c:108 + msgid "standard output" + msgstr "standart çıktı" + + #: builtin.c:109 + msgid "reason unknown" + msgstr "sebebi bilinmiyor" + + #: builtin.c:122 + msgid "exp: received non-numeric argument" + msgstr "exp: sayısal olmayan argüman alındı" + + #: builtin.c:128 + #, c-format + msgid "exp: argument %g is out of range" + msgstr "exp: %g kapsamdışı" + + #: builtin.c:186 + #, c-format + msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing" + msgstr "" + "fflush: kanala yazılamadı: veriyolu `%s' okumak için açıldı, yazmak için " + "deÄŸil" + + #: builtin.c:189 + #, c-format + msgid "fflush: cannot flush: file `%s' opened for reading, not writing" + msgstr "" + "fflush: kanala yazılamadı: dosya `%s' okumak için açıldı, yazmak için deÄŸil" + + #: builtin.c:201 + #, c-format + msgid "fflush: `%s' is not an open file, pipe or co-process" + msgstr "fflush: `%s' bir açık dosya, veriyolu ya da bir yan iÅŸlem deÄŸil" + + #: builtin.c:295 + msgid "index: received non-string first argument" + msgstr "index: ilk argüman dizge olmayan türde alındı" + + #: builtin.c:297 + msgid "index: received non-string second argument" + msgstr "index: ikinci argüman dizge olmayan türde alındı" + + #: builtin.c:407 + msgid "int: received non-numeric argument" + msgstr "int: sayısal olmayan argüman alındı" + + #: builtin.c:424 + msgid "length: received non-string argument" + msgstr "length: dizge olmayan argüman alındı" + + #: builtin.c:440 + msgid "log: received non-numeric argument" + msgstr "log: sayısal olmayan argüman alındı" + + #: builtin.c:443 + #, c-format + msgid "log: received negative argument %g" + msgstr "log: negatif argüman %g alındı" + + #: builtin.c:605 builtin.c:608 + msgid "must use `count$' on all formats or none" + msgstr "tüm biçemlerde ya `count$' kullanmalısınız ya da hiçbir ÅŸey" + + #: builtin.c:703 + msgid "`$' is not permitted in awk formats" + msgstr "`$' awk biçemlerde kullanılmaz" + + #: builtin.c:709 + msgid "arg count with `$' must be > 0" + msgstr "`$' ile birlikte verilen argüman sayısı > 0 olmalıdır" + + #: builtin.c:711 + #, c-format + msgid "arg count %d greater than total number of supplied arguments" + msgstr "argüman sayısı %d saÄŸlanmış toplam argüman sayısından büyük olmalıdır" + + #: builtin.c:713 + msgid "`$' not permitted after period in format" + msgstr "`$' biçem içinde noktadan sonra kullanılmaz" + + #: builtin.c:726 + msgid "no `$' supplied for positional field width or precision" + msgstr "konumsal alan geniÅŸliÄŸi ya da duyarlığı için `$' kullanılmamış" + + #: builtin.c:784 + msgid "`l' is meaningless in awk formats; ignored" + msgstr "`l' awk biçemlerde anlamsız; yoksayıldı" + + #: builtin.c:788 + msgid "`l' is not permitted in POSIX awk formats" + msgstr "`l' POSIX awk biçemlerde kullanılmaz" + + #: builtin.c:799 + msgid "`L' is meaningless in awk formats; ignored" + msgstr "`L' awk biçemlerde anlamsız; yoksayıldı" + + #: builtin.c:803 + msgid "`L' is not permitted in POSIX awk formats" + msgstr "`L' POSIX awk biçemlerde kullanılmaz" + + #: builtin.c:814 + msgid "`h' is meaningless in awk formats; ignored" + msgstr "`h' awk biçemlerde anlamsız; yoksayıldı" + + #: builtin.c:818 + msgid "`h' is not permitted in POSIX awk formats" + msgstr "`h' POSIX awk biçemlerde kullanılmaz" + + #: builtin.c:1067 + msgid "not enough arguments to satisfy format string" + msgstr "biçem dizgesini oluÅŸturacak yeterli argüman yok" + + #: builtin.c:1069 + msgid "^ ran out for this one" + msgstr "bir bunun için ^ tükendi" + + #: builtin.c:1074 + msgid "[s]printf: format specifier does not have control letter" + msgstr "[s]printf: biçem belirteci denetim karakteri içermiyor" + + #: builtin.c:1077 + msgid "too many arguments supplied for format string" + msgstr "biçem dizgesi için çok fazla argüman saÄŸlanmış" + + #: builtin.c:1120 builtin.c:1123 + msgid "printf: no arguments" + msgstr "printf: argüman yok" + + #: builtin.c:1156 + msgid "sqrt: received non-numeric argument" + msgstr "sqrt: sayısal olmayan argüman alındı" + + #: builtin.c:1160 + #, c-format + msgid "sqrt: called with negative argument %g" + msgstr "sqrt: negatif argüman %g ile çaÄŸrıldı" + + #: builtin.c:1182 + #, c-format + msgid "substr: start index %g is invalid, using 1" + msgstr "substr: baÅŸlangıç indeksi olarak %g geçersiz, 1 kullanılıyor" + + #: builtin.c:1187 + #, c-format + msgid "substr: non-integer start index %g will be truncated" + msgstr "" + "substr: tamsayı olmayan baÅŸlangıç indeksi %g den ondalık kısım çıkarılacak" + + #: builtin.c:1201 + #, c-format + msgid "substr: length %g is <= 0" + msgstr "substr: uzunluk %g <= 0 dır" + + #: builtin.c:1207 + #, c-format + msgid "substr: non-integer length %g will be truncated" + msgstr "substr: tamsayı olmayan uzunluk %g den ondalık kısım çıkarılacak" + + #: builtin.c:1214 + msgid "substr: source string is zero length" + msgstr "substr: kaynak dizge sıfır uzunlukta" + + #: builtin.c:1221 + #, c-format + msgid "" + "substr: length %d at start index %d exceeds length of first argument (%d)" + msgstr "" + "substr: uzunluk %d, %d baÅŸlangıç indeksinde ilk argümanın uzunluÄŸunu (%d) " + "aÅŸar" + + #: builtin.c:1227 + #, c-format + msgid "substr: start index %d is past end of string" + msgstr "substr: baÅŸlangıç indeksi %d dizgenin sonundan sonra" + + #: builtin.c:1263 + msgid "strftime: received non-string first argument" + msgstr "strftime: ilk argüman dizge olmayan türde alındı" + + #: builtin.c:1269 + msgid "strftime: received empty format string" + msgstr "strftime: boÅŸ biçem dizgesi alındı" + + #: builtin.c:1278 + msgid "strftime: received non-numeric second argument" + msgstr "strftime: ikinci argüman sayısal olmayan türde alındı" + + #: builtin.c:1341 + msgid "mktime: received non-string argument" + msgstr "mktime: dizge olmayan argüman alındı" + + #: builtin.c:1386 + msgid "system: received non-string argument" + msgstr "system: dizge olmayan argüman alındı" + + #: builtin.c:1512 + msgid "tolower: received non-string argument" + msgstr "tolower: dizge olmayan argüman alındı" + + #: builtin.c:1561 + msgid "toupper: received non-string argument" + msgstr "toupper: dizge olmayan argüman alındı" + + #: builtin.c:1606 + msgid "atan2: received non-numeric first argument" + msgstr "atan2: ilk argüman sayısal olmayan türde alındı" + + #: builtin.c:1608 + msgid "atan2: received non-numeric second argument" + msgstr "atan2: ikinci argüman sayısal olmayan türde alındı" + + #: builtin.c:1627 + msgid "sin: received non-numeric argument" + msgstr "sin: sayısal olmayan argüman alındı" + + #: builtin.c:1643 + msgid "cos: received non-numeric argument" + msgstr "cos: sayısal olmayan argüman alındı" + + #: builtin.c:1687 + msgid "srand: received non-numeric argument" + msgstr "srand: sayısal olmayan argüman alındı" + + #: builtin.c:1721 + msgid "match: third argument is not an array" + msgstr "match: üçüncü argüman bir dizi deÄŸil" + + #: builtin.c:2157 + msgid "gensub: 3rd argument of 0 treated as 1" + msgstr "gensub: 0 olan 3. argüman 1 kabul edildi" + + #: builtin.c:2268 builtin.c:2270 + msgid "lshift: received non-numeric first argument" + msgstr "lshift: ilk argüman sayısal olmayan türde alındı" + + #: builtin.c:2272 + #, c-format + msgid "lshift(%lf, %lf): negative values will give strange results" + msgstr "lshift(%lf, %lf): negatif deÄŸerler tuhaf sonuçlar verecek" + + #: builtin.c:2274 + #, c-format + msgid "lshift(%lf, %lf): fractional values will be truncated" + msgstr "lshift(%lf, %lf): tamsayı kısım kalacak ÅŸekilde kalanı atılacak" + + #: builtin.c:2276 + #, c-format + msgid "lshift(%lf, %lf): too large shift value will give strange results" + msgstr "lshift(%lf, %lf): çok büyük kaydırma deÄŸeri tuhaf sonuçlar verecek" + + #: builtin.c:2305 builtin.c:2307 + msgid "rshift: received non-numeric first argument" + msgstr "rshift: ilk argüman sayısal olmayan türde alındı" + + #: builtin.c:2309 + #, c-format + msgid "rshift(%lf, %lf): negative values will give strange results" + msgstr "rshift(%lf, %lf): negatif deÄŸerler tuhaf sonuçlar verecek" + + #: builtin.c:2311 + #, c-format + msgid "rshift(%lf, %lf): fractional values will be truncated" + msgstr "rshift(%lf, %lf): tamsayı kısım kalacak ÅŸekilde kalanı atılacak" + + #: builtin.c:2313 + #, c-format + msgid "rshift(%lf, %lf): too large shift value will give strange results" + msgstr "rshift(%lf, %lf): çok büyük kaydırma deÄŸeri tuhaf sonuçlar verecek" + + #: builtin.c:2342 builtin.c:2344 + msgid "and: received non-numeric first argument" + msgstr "and: ilk argüman sayısal olmayan türde alındı" + + #: builtin.c:2346 + #, c-format + msgid "and(%lf, %lf): negative values will give strange results" + msgstr "and(%lf, %lf): negatif deÄŸerler tuhaf sonuçlar verecek" + + #: builtin.c:2348 + #, c-format + msgid "and(%lf, %lf): fractional values will be truncated" + msgstr "and(%lf, %lf): tamsayı kısım kalacak ÅŸekilde kalanı atılacak" + + #: builtin.c:2377 builtin.c:2379 + msgid "or: received non-numeric first argument" + msgstr "or: ilk argüman sayısal olmayan türde alındı" + + #: builtin.c:2381 + #, c-format + msgid "or(%lf, %lf): negative values will give strange results" + msgstr "or(%lf, %lf): negatif deÄŸerler tuhaf sonuçlar verecek" + + #: builtin.c:2383 + #, c-format + msgid "or(%lf, %lf): fractional values will be truncated" + msgstr "or(%lf, %lf): tamsayı kısım kalacak ÅŸekilde kalanı atılacak" + + #: builtin.c:2412 builtin.c:2414 + msgid "xor: received non-numeric first argument" + msgstr "xor: ilk argüman sayısal olmayan türde alındı" + + #: builtin.c:2416 + #, c-format + msgid "xor(%lf, %lf): negative values will give strange results" + msgstr "xor(%lf, %lf): negatif deÄŸerler tuhaf sonuçlar verecek" + + #: builtin.c:2418 + #, c-format + msgid "xor(%lf, %lf): fractional values will be truncated" + msgstr "xor(%lf, %lf): tamsayı kısım kalacak ÅŸekilde kalanı atılacak" + + #: builtin.c:2446 + msgid "compl: received non-numeric argument" + msgstr "compl: sayısal olmayan argüman alındı" + + #: builtin.c:2448 + #, c-format + msgid "compl(%lf): negative value will give strange results" + msgstr "compl(%lf): negatif deÄŸerler tuhaf sonuçlar verecek" + + #: builtin.c:2450 + #, c-format + msgid "compl(%lf): fractional value will be truncated" + msgstr "compl(%lf): tamsayı kısım kalacak ÅŸekilde kalanı atılacak" + + #: builtin.c:2621 + #, c-format + msgid "dcgettext: `%s' is not a valid locale category" + msgstr "dcgettext: `%s' geçerli bir yerel kategori deÄŸil" + + #: ext.c:60 ext.c:64 + msgid "`extension' is a gawk extension" + msgstr "`extension' bir gawk uzantısıdır" + + #: ext.c:74 + #, c-format + msgid "extension: cannot open `%s' (%s)\n" + msgstr "extension: `%s' açılamıyor (%s)\n" + + #: ext.c:82 + #, c-format + msgid "extension: library `%s': cannot call function `%s' (%s)\n" + msgstr "extension: kitaplık `%s': `%s' iÅŸlevi çaÄŸrılamıyor (%s)\n" + + #: ext.c:180 + msgid "Operation Not Supported" + msgstr "İşlem Desteklenmiyor" + + #: getopt.c:692 getopt.c:704 + #, c-format + msgid "%s: option `%s' is ambiguous\n" + msgstr "%s: `%s' seçeneÄŸi belirsiz\n" + + #: getopt.c:737 getopt.c:741 + #, 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" + + #: getopt.c:750 getopt.c:755 + #, 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" + + #: getopt.c:791 getopt.c:804 getopt.c:1093 getopt.c:1106 + #, c-format + msgid "%s: option `%s' requires an argument\n" + msgstr "%s: `%s' seçeneÄŸi bir argümanla kullanılır\n" + + #: getopt.c:842 getopt.c:845 + #, c-format + msgid "%s: unrecognized option `--%s'\n" + msgstr "%s: `--%s' seçeneÄŸi bilinmiyor\n" + + #: getopt.c:853 getopt.c:856 + #, c-format + msgid "%s: unrecognized option `%c%s'\n" + msgstr "%s: `%c%s' seçeneÄŸi bilinmiyor\n" + + #: getopt.c:903 getopt.c:906 + #, c-format + msgid "%s: illegal option -- %c\n" + msgstr "%s: kuraldışı seçenek -- %c\n" + + #: getopt.c:912 getopt.c:915 + #, c-format + msgid "%s: invalid option -- %c\n" + msgstr "%s: geçersiz seçenek -- %c\n" + + #: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412 + #, c-format + msgid "%s: option requires an argument -- %c\n" + msgstr "%s: seçenek bir argümanla kullanılır -- %c\n" + + #: getopt.c:1025 getopt.c:1036 + #, c-format + msgid "%s: option `-W %s' is ambiguous\n" + msgstr "%s: `-W %s' seçeneÄŸi belirsiz\n" + + #: getopt.c:1060 getopt.c:1072 + #, 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" + + #: main.c:307 + msgid "`-m[fr]' option irrelevant in gawk" + msgstr "`-m[fr]' seçeneÄŸi gawk'da böyle kullanılmaz" + + #: main.c:309 + msgid "-m option usage: `-m[fr] nnn'" + msgstr "-m seçeneÄŸinin kullanımı: `-m[fr] nnn'" + + #: main.c:326 + #, c-format + msgid "%s: option `-W %s' unrecognized, ignored\n" + msgstr "%s: `-W %s' seçeneÄŸi tanımlı deÄŸil, yok sayıldı\n" + + #: main.c:357 + msgid "empty argument to `--source' ignored" + msgstr "`--source' seçeneÄŸi için boÅŸ argüman yoksayıldı" + + #: main.c:429 + msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'" + msgstr "ortam deÄŸiÅŸkeni `POSIXLY_CORRECT' var: `--posix' kullanılıyor" + + #: main.c:434 + msgid "`--posix' overrides `--traditional'" + msgstr "`--posix' seçeneÄŸi `--traditional' seçeneÄŸini etkisiz kılar" + + #: main.c:445 + msgid "`--posix'/`--traditional' overrides `--non-decimal-data'" + msgstr "" + "`--posix'/`--traditional' seçenekleri `--non-decimal-data' seçeneÄŸini " + "etkisiz kılar" + + #: main.c:449 + #, c-format + msgid "running %s setuid root may be a security problem" + msgstr "%s root yetkileriyle çalıştırıldığında güvenlik sorunları olabilir" + + #: main.c:478 + #, c-format + msgid "can't set mode on stdin (%s)" + msgstr "standart girdide kip belirlenemiyor (%s)" + + #: main.c:481 + #, c-format + msgid "can't set mode on stdout (%s)" + msgstr "standart çıktıda kip belirlenemiyor (%s)" + + #: main.c:483 + #, c-format + msgid "can't set mode on stderr (%s)" + msgstr "standart hatada kip belirlenemiyor (%s)" + + #: main.c:512 + msgid "no program text at all!" + msgstr "program metni hiç yok!" + + #: main.c:556 + #, c-format + msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n" + msgstr "" + "Kullanımı: %s [POSIX veya GNU tarzı seçenekler] -f progdosyası [--] " + "dosya ...\n" + + #: main.c:558 + #, c-format + msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n" + msgstr "" + "Kullanımı: %s [POSIX veya GNU tarzı seçenekler] %cprogram%c dosya ...\n" + + #: main.c:563 + msgid "POSIX options:\t\tGNU long options:\n" + msgstr "POSIX seçenekleri: GNU uzun seçenekleri:\n" + + #: main.c:564 + msgid "\t-f progfile\t\t--file=progfile\n" + msgstr " -f progDosyası --file=progDosyası\n" + + #: main.c:565 + msgid "\t-F fs\t\t\t--field-separator=fs\n" + msgstr " -F ayraç --field-separator=ayraç\n" + + #: main.c:566 + msgid "\t-v var=val\t\t--assign=var=val\n" + msgstr " -v var=deÄŸer --assign=var=deÄŸer\n" + + #: main.c:567 + msgid "\t-m[fr] val\n" + msgstr " -m[fr] deÄŸer\n" + + #: main.c:568 + msgid "\t-W compat\t\t--compat\n" + msgstr " -W compat --compat\n" + + #: main.c:569 + msgid "\t-W copyleft\t\t--copyleft\n" + msgstr " -W copyleft --copyleft\n" + + #: main.c:570 + msgid "\t-W copyright\t\t--copyright\n" + msgstr " -W copyright --copyright\n" + + #: main.c:571 + msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n" + msgstr " -W dump-variables[=dosya] --dump-variables[=dosya]\n" + + #: main.c:572 + msgid "\t-W gen-po\t\t--gen-po\n" + msgstr " -W gen-po --gen-po\n" + + #: main.c:573 + msgid "\t-W help\t\t\t--help\n" + msgstr " -W help --help\n" + + #: main.c:574 + msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n" + msgstr " -W lint[=ölümcül] --lint[=ölümcül]\n" + + #: main.c:575 + msgid "\t-W lint-old\t\t--lint-old\n" + msgstr " -W lint-old --lint-old\n" + + #: main.c:576 + msgid "\t-W non-decimal-data\t--non-decimal-data\n" + msgstr " -W non-decimal-data --non-decimal-data\n" + + #: main.c:578 + msgid "\t-W nostalgia\t\t--nostalgia\n" + msgstr " -W nostalgia --nostalgia\n" + + #: main.c:581 + msgid "\t-W parsedebug\t\t--parsedebug\n" + msgstr " -W parsedebug --parsedebug\n" + + #: main.c:583 + msgid "\t-W profile[=file]\t--profile[=file]\n" + msgstr " -W profile[=dosya] --profile[=dosya]\n" + + #: main.c:584 + msgid "\t-W posix\t\t--posix\n" + msgstr " -W posix --posix\n" + + #: main.c:585 + msgid "\t-W re-interval\t\t--re-interval\n" + msgstr " -W re-interval --re-interval\n" + + #: main.c:586 + msgid "\t-W source=program-text\t--source=program-text\n" + msgstr " -W source=program-metni --source=program-metni\n" + + #: main.c:587 + msgid "\t-W traditional\t\t--traditional\n" + msgstr " -W traditional --traditional\n" + + #: main.c:588 + msgid "\t-W usage\t\t--usage\n" + msgstr " -W usage --usage\n" + + #: main.c:589 + msgid "\t-W version\t\t--version\n" + msgstr " -W version --version\n" + + #: main.c:593 + msgid "" + "\n" + "To report bugs, see node `Bugs' in `gawk.info', which is\n" + "section `Reporting Problems and Bugs' in the printed version.\n" + "\n" + msgstr "" + "\n" + "Hataları raporlarken, `gawk.info' içindeki `Reporting Problems and Bugs'\n" + "kısmının `Bugs' baÅŸlıklı bölümünden gerekli bilgileri alabilirsiniz.\n" + "\n" + "Çeviri hatalarını adresine bildiriniz.\n" + "\n" + + #: main.c:597 + msgid "" + "gawk is a pattern scanning and processing language.\n" + "By default it reads standard input and writes standard output.\n" + "\n" + msgstr "" + "gawk bir dizge kalıplarını tarama ve iÅŸleme dilidir.\n" + "Öntanımlı olarak standart girdiyi okur ve standart çıktıya yazar.\n" + "\n" + + #: main.c:601 + msgid "" + "Examples:\n" + "\tgawk '{ sum += $1 }; END { print sum }' file\n" + "\tgawk -F: '{ print $1 }' /etc/passwd\n" + msgstr "" + "Örnekler:\n" + "\tgawk '{ sum += $1 }; END { print sum }' dosya\n" + "\tgawk -F: '{ print $1 }' /etc/passwd\n" + + #: main.c:613 + #, c-format + msgid "" + "Copyright (C) 1989, 1991-%d Free Software Foundation.\n" + "\n" + "This program is free software; you can redistribute it and/or modify\n" + "it under the terms of the GNU General Public License as published by\n" + "the Free Software Foundation; either version 2 of the License, or\n" + "(at your option) any later version.\n" + "\n" + msgstr "" + "Telif hakkı (C) 1989, 1991-%d Free Software Foundation.\n" + "\n" + "Bu program bir serbest yazılımdır. Bu yazılımı Free Software Foundation\n" + "tarafından yayınlanmış olan GNU Genel Kamu Lisansının 2. ya da daha sonraki\n" + "bir sürümünün koÅŸulları altında kopyalayabilir, dağıtabilir ve/veya\n" + "üzerinde deÄŸiÅŸiklik yapabilirsiniz.\n" + "\n" + + #: main.c:621 + msgid "" + "This program is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "GNU General Public License for more details.\n" + "\n" + msgstr "" + "Bu program kullanışlı olabileceÄŸi umularak dağıtılmaktadır. Ancak,\n" + "hiçbir GARANTİSİ YOKTUR; hatta SATILABİLİRLİĞİ veya HERHANGİ BİR\n" + "AMACA UYGUNLUÄžU için bile garanti verilmez. Daha ayrıntılı bilgi\n" + "edinmek için GNU Genel Kamu Lisansına bakınız.\n" + "\n" + + #: main.c:627 + msgid "" + "You should have received a copy of the GNU General Public License\n" + "along with this program; if not, write to the Free Software\n" + "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + msgstr "" + "GNU Genel Kamu Lisansının bir kopyasını bu programla birlikte almış\n" + "olacaksınız; yoksa Free Software Foundation, Inc., 59 Temple Place\n" + "Suite 330, Boston, MA 02111-1307, USA. adresinden isteyebilirsiniz.\n" + + #: main.c:657 + msgid "-Ft does not set FS to tab in POSIX awk" + msgstr "POSIX awk -Ft ile dosya sistemini belirlemez" + + #: main.c:888 + #, c-format + msgid "invalid syntax in name `%s' for variable assignment" + msgstr "deÄŸiÅŸken ismi `%s' de sözdizimi hatası" + + #: main.c:957 + msgid "floating point exception" + msgstr "Gerçel sayı istisnası" + + #: main.c:964 + msgid "fatal error: internal error" + msgstr "ölümcül iç hata" + + #: main.c:1014 + #, c-format + msgid "no pre-opened fd %d" + msgstr "ön açılışlı bir %d dosya tanımlayıcısı yok" + + #: main.c:1019 + #, c-format + msgid "could not pre-open /dev/null for fd %d" + msgstr "%d dosya tanımlayıcısı için /dev/null ön açılışı yapılamadı" + + #: main.c:1037 main.c:1046 + #, c-format + msgid "could not find groups: %s" + msgstr "gruplar bulunamadı: %s" + + #: profile.c:94 + #, c-format + msgid "could not open `%s' for writing: %s" + msgstr "`%s' yazmak için açılamadı: %s" + + #: profile.c:96 awkgram.y:2465 + msgid "sending profile to standard error" + msgstr "profil standart hataya gönderiliyor" + + #: profile.c:409 + msgid "internal error: Node_var with null vname" + msgstr "iç hata: null vname'li node_var" + + #: profile.c:524 + msgid "internal error: Node_var_array with null vname" + msgstr "iç hata: null vname'li node_var_array" + + #: profile.c:554 eval.c:813 + #, c-format + msgid "" + "function `%s' called with space between name and `(',\n" + "%s" + msgstr "" + "`%s' iÅŸlevi `(' ile isim arasında boÅŸlukla çaÄŸrılmış,\n" + "%s" + + #: profile.c:556 eval.c:815 + msgid "or used in other expression context" + msgstr "ya da diÄŸer ifadenin içeriÄŸinde kullanılmış" + + #: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741 + #, c-format + msgid "attempt to use array `%s' in a scalar context" + msgstr "`%s' dizisi bir sayısal baÄŸlamda kullanılmaya çalışılıyor" + + #: profile.c:637 eval.c:1047 + #, c-format + msgid "illegal type (%s) in tree_eval" + msgstr "tree_eval içinde kuraldışı tür (%s)" + + #: profile.c:842 eval.c:1790 + #, c-format + msgid "attempt to use function `%s' as array" + msgstr "`%s' iÅŸlevi dizi olarak kullanılmaya çalışılıyor" + + #: profile.c:856 eval.c:1797 + #, c-format + msgid "`%s' is a function, assignment is not allowed" + msgstr "`%s' bir iÅŸlevdir, bir deÄŸiÅŸken ismi olarak kullanılamaz" + + #: profile.c:860 eval.c:1803 eval.c:1810 + msgid "assignment is not allowed to result of builtin function" + msgstr "deÄŸiÅŸken ismine yerleÅŸik iÅŸlevin sonucu atanamaz" + + #: profile.c:1108 + #, c-format + msgid "\t# gawk profile, created %s\n" + msgstr "\t# gawk profili, oluÅŸturuldu: %s\n" + + #: profile.c:1111 + msgid "" + "\t# BEGIN block(s)\n" + "\n" + msgstr "" + "\t# BEGIN blokları\n" + "\n" + + #: profile.c:1121 + msgid "" + "\t# Rule(s)\n" + "\n" + msgstr "" + "\t# Kurallar\n" + "\n" + + #: profile.c:1127 + msgid "" + "\t# END block(s)\n" + "\n" + msgstr "" + "\t# END blokları\n" + "\n" + + #: profile.c:1147 + msgid "" + "\n" + "\t# Functions, listed alphabetically\n" + msgstr "" + "\n" + "\t# İşlevler, alfabetik sırayla\n" + + #: profile.c:1357 + #, c-format + msgid "unexpected type %s in prec_level" + msgstr "prec_level'da anlaşılamayan tür %s" + + #: regex.c:1322 + msgid "Success" + msgstr "BaÅŸarılı" + + #: regex.c:1323 + msgid "No match" + msgstr "EÅŸleÅŸmez" + + #: regex.c:1324 + msgid "Invalid regular expression" + msgstr "Düzenli ifade geçersiz" + + #: regex.c:1325 + msgid "Invalid collation character" + msgstr "KarşılaÅŸtırma karakteri geçersiz" + + #: regex.c:1326 + msgid "Invalid character class name" + msgstr "Karakter sınıf ismi geçersiz" + + #: regex.c:1327 + msgid "Trailing backslash" + msgstr "İzleyen tersbölü" + + #: regex.c:1328 + msgid "Invalid back reference" + msgstr "Geriye baÅŸvuru geçersiz" + + #: regex.c:1329 + msgid "Unmatched [ or [^" + msgstr "[ ya da [^ eÅŸleÅŸmiyor" + + #: regex.c:1330 + msgid "Unmatched ( or \\(" + msgstr "( ya da \\( eÅŸleÅŸmiyor" + + #: regex.c:1331 + msgid "Unmatched \\{" + msgstr "\\{ eÅŸleÅŸmiyor" + + #: regex.c:1332 + msgid "Invalid content of \\{\\}" + msgstr "\\{\\} içeriÄŸi geçersiz" + + #: regex.c:1333 + msgid "Invalid range end" + msgstr "Kapsam sonu geçersiz" + + #: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204 + msgid "Memory exhausted" + msgstr "Bellek tükendi" + + #: regex.c:1335 + msgid "Invalid preceding regular expression" + msgstr "düzenli ifade önceliÄŸi geçersiz" + + #: regex.c:1336 + msgid "Premature end of regular expression" + msgstr "Düzenli ifade sonu eksik kalmış" + + #: regex.c:1337 + msgid "Regular expression too big" + msgstr "Düzenli ifade çok büyük" + + #: regex.c:1338 + msgid "Unmatched ) or \\)" + msgstr ") ya da \\) eÅŸleÅŸmiyor" + + #: regex.c:7365 + msgid "No previous regular expression" + msgstr "Daha önce düzenli ifade yok" + + #: awkgram.y:232 + msgid "BEGIN blocks must have an action part" + msgstr "BEGIN blokları bir eylem bölümü içermeli" + + #: awkgram.y:238 + msgid "END blocks must have an action part" + msgstr "END blokları bir eylem bölümü içermeli" + + #: awkgram.y:274 + #, c-format + msgid "`%s' is a built-in function, it cannot be redefined" + msgstr "`%s' bir yerleÅŸik iÅŸlevdir, yeniden atanamaz" + + #: awkgram.y:362 + msgid "statement may have no effect" + msgstr "deyim bir etkiye sahip olmayabilir" + + #: awkgram.y:455 + msgid "`next' used in BEGIN or END action" + msgstr "`next' BEGIN ya da END eyleminde kullanılmış" + + #: awkgram.y:462 awkgram.y:469 + msgid "`nextfile' is a gawk extension" + msgstr "`nextfile' bir gawk uzantısıdır" + + #: awkgram.y:474 + msgid "`nextfile' used in BEGIN or END action" + msgstr "`nextfile' BEGIN ya da END eyleminde kullanılmış" + + #: awkgram.y:483 + msgid "`return' used outside function context" + msgstr "`return' iÅŸlev baÄŸlamının dışında kullanılmış" + + #: awkgram.y:519 + msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'" + msgstr "BEGIN veya END kuralındaki `print' aslında `print \"\"' olmalıydı" + + #: awkgram.y:532 awkgram.y:539 + msgid "`delete array' is a gawk extension" + msgstr "`delete array' bir gawk uzantısıdır" + + #: awkgram.y:604 + msgid "multistage two-way pipelines don't work" + msgstr "çok katlı iki yönlü veriyolları çalışmaz" + + #: awkgram.y:695 + msgid "regular expression on right of assignment" + msgstr "düzenli ifade atamanın sağında" + + #: awkgram.y:713 + msgid "non-redirected `getline' undefined inside END action" + msgstr "END eyleminin içinde yönlendirme yapmayan `getline' tanımsız" + + #: awkgram.y:723 + msgid "regular expression on left of `~' or `!~' operator" + msgstr "düzenli ifade `~' ya da `!~' iÅŸlemiminin solunda" + + #: awkgram.y:733 + #, c-format + msgid "regexp constant `/%s/' looks like a C comment, but is not" + msgstr "düzenli ifade sabiti `/%s/' bir C açıklaması gibi görünüyor ama deÄŸil" + + #: awkgram.y:749 + msgid "regular expression on right of comparison" + msgstr "düzenli ifade karşılaÅŸtırmanın sağında" + + #: awkgram.y:776 + msgid "non-redirected `getline' undefined inside BEGIN or END action" + msgstr "" + "BEGIN ya da END eyleminin içinde yönlendirme yapmayan `getline' tanımsız" + + #: awkgram.y:831 + msgid "call of `length' without parentheses is not portable" + msgstr "parantezsiz `length' çaÄŸrısı taşınabilir deÄŸil" + + #: awkgram.y:834 + msgid "call of `length' without parentheses is deprecated by POSIX" + msgstr "parantezsiz `length' çaÄŸrısı POSIX'e uygun deÄŸil" + + #: awkgram.y:884 + msgid "invalid subscript expression" + msgstr "indis ifadesi geçersiz" + + #: awkgram.y:1033 + #, c-format + msgid "fptr %x not in tokentab\n" + msgstr "iÅŸlev imleyicisi %x iÅŸlev isim listesinde bulunamadı\n" + + #: awkgram.y:1068 + msgid "unexpected newline" + msgstr "beklenmeyen satırsonu" + + #: awkgram.y:1152 + msgid "empty program text on command line" + msgstr "komut satırında boÅŸ program metni" + + #: awkgram.y:1209 + #, c-format + msgid "can't open source file `%s' for reading (%s)" + msgstr "kaynak dosyası `%s' okumak için açılamıyor (%s)" + + #: awkgram.y:1244 + #, c-format + msgid "can't read sourcefile `%s' (%s)" + msgstr "kaynak dosyası `%s' okunamıyor (%s)" + + #: awkgram.y:1252 + #, c-format + msgid "source file `%s' is empty" + msgstr "kaynak dosyası `%s' boÅŸ" + + #: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011 + msgid "source file does not end in newline" + msgstr "kaynak dosyasının sonunda satırsonu eksik" + + #: awkgram.y:1518 + msgid "unterminated regexp ends with `\\' at end of file" + msgstr "sonlandırılmamış düzenli ifade dosya sonunda `\\' ile bitiyor" + + #: awkgram.y:1539 + msgid "unterminated regexp" + msgstr "sonlandırılmamış düzenli ifade" + + #: awkgram.y:1542 + msgid "unterminated regexp at end of file" + msgstr "dosya sonunda sonlandırılmamış düzenli ifade" + + #: awkgram.y:1609 + msgid "use of `\\ #...' line continuation is not portable" + msgstr "`\\ #...' satır uzatma kullanımı taşınabilir deÄŸil" + + #: awkgram.y:1621 + msgid "backslash not last character on line" + msgstr "tersbölü satırdaki son karakter deÄŸil" + + #: awkgram.y:1662 + msgid "POSIX does not allow operator `**='" + msgstr "`**=' iÅŸlemimi POSIX uyumlu deÄŸil" + + #: awkgram.y:1664 + msgid "old awk does not support operator `**='" + msgstr "`**=' iÅŸlemimini eski awk desteklemiyor" + + #: awkgram.y:1673 + msgid "POSIX does not allow operator `**'" + msgstr "`**' iÅŸlemimi POSIX uyumlu deÄŸil" + + #: awkgram.y:1675 + msgid "old awk does not support operator `**'" + msgstr "`**' iÅŸlemimini eski awk desteklemiyor" + + #: awkgram.y:1708 + msgid "operator `^=' is not supported in old awk" + msgstr "`^=' iÅŸlemimini eski awk desteklemiyor" + + #: awkgram.y:1716 + msgid "operator `^' is not supported in old awk" + msgstr "`^' iÅŸlemimini eski awk desteklemiyor" + + #: awkgram.y:1798 awkgram.y:1815 + msgid "unterminated string" + msgstr "sonlandırılmamış dizge" + + #: awkgram.y:1972 + #, c-format + msgid "invalid char '%c' in expression" + msgstr "ifade içinde '%c' karakteri geçersiz" + + #: awkgram.y:2032 + #, c-format + msgid "`%s' is a gawk extension" + msgstr "`%s' bir gawk uzantısıdır" + + #: awkgram.y:2035 + #, c-format + msgid "`%s' is a Bell Labs extension" + msgstr "`%s' bir Bell Laboratuarları uzantısıdır" + + #: awkgram.y:2038 + #, c-format + msgid "POSIX does not allow `%s'" + msgstr "`%s' POSIX uyumlu deÄŸil" + + #: awkgram.y:2042 + #, c-format + msgid "`%s' is not supported in old awk" + msgstr "`%s' eski awk tarafından desteklemiyor" + + #: awkgram.y:2070 + msgid "`goto' considered harmful!\n" + msgstr "`goto' zararlı sayılır!\n" + + #: awkgram.y:2134 + #, c-format + msgid "%d is invalid as number of arguments for %s" + msgstr "%d argüman sayısı olarak %s için geçersiz" + + #: awkgram.y:2153 awkgram.y:2156 + msgid "match: third argument is a gawk extension" + msgstr "match: üçüncü argüman bir gawk uzantısı" + + #: awkgram.y:2172 + #, c-format + msgid "%s: string literal as last arg of substitute has no effect" + msgstr "%s: yerine kullanılan son argüman olarak dizge sabiti etkisiz" + + #: awkgram.y:2176 + msgid "sub third parameter is not a changeable object" + msgstr "üçüncü sub parametresi deÄŸiÅŸtirilebilir bir nesne deÄŸil" + + #: awkgram.y:2178 + msgid "gsub third parameter is not a changeable object" + msgstr "üçüncü gsub parametresi deÄŸiÅŸtirilebilir bir nesne deÄŸil" + + #: awkgram.y:2204 awkgram.y:2207 + msgid "close: second argument is a gawk extension" + msgstr "close: ikinci argüman bir gawk uzantısı" + + #: awkgram.y:2217 + msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore" + msgstr "dcgettext(_\"...\") kullanımı yanlış: altçizgiyi kaldırın" + + #: awkgram.y:2232 + msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore" + msgstr "dcngettext(_\"...\") kullanımı yanlış: altçizgiyi kaldırın" + + #: awkgram.y:2323 + #, c-format + msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d" + msgstr "`%s' iÅŸlevi: %d. parametre, `%s', %d. parametrenin tekrarı" + + #: awkgram.y:2355 + #, c-format + msgid "function `%s': parameter `%s' shadows global variable" + msgstr "`%s' iÅŸlevi: parametre, `%s'global deÄŸiÅŸkeni gölgeliyor" + + #: awkgram.y:2464 + #, c-format + msgid "could not open `%s' for writing (%s)" + msgstr "`%s' yazmak için açılamadı (%s)" + + #: awkgram.y:2495 + #, c-format + msgid "%s: close failed (%s)" + msgstr "%s: kapatma baÅŸarısız (%s)" + + #: awkgram.y:2605 + msgid "shadow_funcs() called twice!" + msgstr "shadow_funcs() iki kere çaÄŸrıldı!" + + #: awkgram.y:2680 + #, c-format + msgid "function `%s': can't use function name as parameter name" + msgstr "iÅŸlev `%s': iÅŸlev ismi parametre ismi olarak kullanılamaz" + + #: awkgram.y:2690 + #, c-format + msgid "function name `%s' previously defined" + msgstr "iÅŸlev ismi `%s' önceden atanmış" + + #: awkgram.y:2838 awkgram.y:2844 + #, c-format + msgid "function `%s' called but never defined" + msgstr "`%s' iÅŸlevi çaÄŸrıldı ama hiç atanmamış" + + #: awkgram.y:2847 + #, c-format + msgid "function `%s' defined but never called" + msgstr "`%s' iÅŸlevi atanmış ama hiç çaÄŸrılmadı" + + #: awkgram.y:2874 + #, c-format + msgid "regexp constant for parameter #%d yields boolean value" + msgstr "%d numaralı argüman bir düzenli ifade sabiti" + + #: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649 + #: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078 + #: dfa.c:1081 dfa.c:1094 dfa.c:1095 + msgid "Unbalanced [" + msgstr "Dengesiz [" + + #: dfa.c:783 + msgid "Unfinished \\ escape" + msgstr "Tamamlanmamış \\ escape" + + #: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955 + msgid "unfinished repeat count" + msgstr "Tamamlanmamış tekrar sayısı" + + #: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958 + msgid "malformed repeat count" + msgstr "Tekrar sayısı hatalı" + + #: dfa.c:1285 + msgid "Unbalanced (" + msgstr "Dengesiz (" + + #: dfa.c:1407 + msgid "No regexp syntax bits specified" + msgstr "Düzenli ifade sözdizimi bitleri belirtilmemiÅŸ" + + #: dfa.c:1415 + msgid "Unbalanced )" + msgstr "Karşılıksız )" + + #: dfa.c:3014 + msgid "out of memory" + msgstr "bellek yetersiz" + + #: field.c:849 + msgid "split: second argument is not an array" + msgstr "split: ikinci argüman bir dizi deÄŸil" + + #: field.c:876 + msgid "split: null string for third arg is a gawk extension" + msgstr "split: üçüncü argüman olan null dizge bir gawk uzantısı" + + #: field.c:916 + msgid "`FIELDWIDTHS' is a gawk extension" + msgstr "`FIELDWIDTHS' bir gawk uzantısıdır" + + #: field.c:943 + #, c-format + msgid "field %d in FIELDWIDTHS, must be > 0" + msgstr "FIELDWIDTHS içindeki %d. alan > 0 olmalı" + + #: field.c:997 + msgid "null string for `FS' is a gawk extension" + msgstr "`FS' için null dizge bir gawk uzantısıdır" + + #: msg.c:57 + msgid "cmd. line:" + msgstr "komut satırı:" + + #: msg.c:123 + msgid "warning: " + msgstr "uyarı: " + + #: msg.c:145 + msgid "error: " + msgstr "hata: " + + #: msg.c:178 + msgid "fatal: " + msgstr "ölümcül: " + + #: eval.c:259 + #, c-format + msgid "unknown nodetype %d" + msgstr "%d. düğümtürü bilinmiyor" + + #: eval.c:307 + msgid "buffer overflow in genflags2str" + msgstr "genflags2str içinde tampon taÅŸtı" + + #: eval.c:541 + #, c-format + msgid "for loop: array `%s' changed size from %d to %d during loop execution" + msgstr "for loop: `%s' dizisinin indisi döngü sırasında %d iken %d oldu" + + #: eval.c:565 + msgid "`break' outside a loop is not portable" + msgstr "döngü dışında `break' kullanımı taşınabilir deÄŸil" + + #: eval.c:569 + msgid "`break' outside a loop is not allowed" + msgstr "döngü dışında `break' kullanımı yasak" + + #: eval.c:588 + msgid "`continue' outside a loop is not portable" + msgstr "döngü dışında `continue' kullanımı taşınabilir deÄŸil" + + #: eval.c:592 + msgid "`continue' outside a loop is not allowed" + msgstr "döngü dışında `continue' kullanımı yasak" + + #: eval.c:622 + msgid "`next' cannot be called from a BEGIN rule" + msgstr "`next' bir BEGIN kuralından çaÄŸrılamaz" + + #: eval.c:624 + msgid "`next' cannot be called from an END rule" + msgstr "`next' bir END kuralından çaÄŸrılamaz" + + #: eval.c:636 + msgid "`nextfile' cannot be called from a BEGIN rule" + msgstr "`nextfile' bir BEGIN kuralından çaÄŸrılamaz" + + #: eval.c:638 + msgid "`nextfile' cannot be called from an END rule" + msgstr "`nextfile' bir END kuralından çaÄŸrılamaz" + + #: eval.c:679 + msgid "statement has no effect" + msgstr "deyim etkisiz" + + #: eval.c:713 eval.c:743 eval.c:1622 + #, c-format + msgid "reference to uninitialized variable `%s'" + msgstr "öndeÄŸer ataması yapılmamış `%s' deÄŸiÅŸkenine baÅŸvuru" + + #: eval.c:721 eval.c:1608 + #, c-format + msgid "can't use function name `%s' as variable or array" + msgstr "`%s' iÅŸlev ismi bir deÄŸiÅŸken ya da dizi olarak kullanılamaz" + + #: eval.c:728 eval.c:734 eval.c:1747 + #, c-format + msgid "reference to uninitialized argument `%s'" + msgstr "baÅŸlangıç deÄŸeri olmayan `%s' argümanına baÅŸvuru" + + #: eval.c:823 + msgid "assignment used in conditional context" + msgstr "koÅŸul baÄŸlamında atama yapılmış" + + #: eval.c:914 + msgid "" + "concatenation: side effects in one expression have changed the length of " + "another!" + msgstr "" + "bitiÅŸtirme: bir ifadenin yan etkileri diÄŸerinin uzunluÄŸunu deÄŸiÅŸtirmiÅŸ!" + + #: eval.c:1013 + msgid "division by zero attempted" + msgstr "sıfırla bölme hatası" + + #: eval.c:1028 + #, c-format + msgid "division by zero attempted in `%%'" + msgstr "`%%'de sıfırla bölme hatası" + + #: eval.c:1236 + msgid "division by zero attempted in `/='" + msgstr "`/='de sıfırla bölme hatası" + + #: eval.c:1254 + #, c-format + msgid "division by zero attempted in `%%='" + msgstr "`%%='de sıfırla bölme hatası" + + #: eval.c:1424 + #, c-format + msgid "%s (from %s)" + msgstr "%s (%s'den)" + + #: eval.c:1472 + #, c-format + msgid "function `%s' called with more arguments than declared" + msgstr "`%s' iÅŸlevi bildirilenden daha fazla argümanla çaÄŸrıldı" + + #: eval.c:1519 + #, c-format + msgid "function `%s' not defined" + msgstr "`%s' iÅŸlevi tanımsız" + + #: eval.c:1521 + #, c-format + msgid "function %s called\n" + msgstr "%s iÅŸlevi çaÄŸrıldı\n" + + #: eval.c:1580 + msgid "" + "\n" + "\t# Function Call Stack:\n" + "\n" + msgstr "" + "\n" + "\t# İşlev ÇaÄŸrı Yığını:\n" + "\n" + + #: eval.c:1583 + msgid "\t# -- main --\n" + msgstr "\t# -- main --\n" + + #: eval.c:1759 + msgid "attempt to field reference from non-numeric value" + msgstr "sayısal olmayan deÄŸerden alan baÅŸvurusu" + + #: eval.c:1761 + msgid "attempt to reference from null string" + msgstr "null dizgeden alan baÅŸvurusu" + + #: eval.c:1767 + #, c-format + msgid "attempt to access field %d" + msgstr "%d. alana eriÅŸilmeye çalışılıyor" + + #: eval.c:1783 + #, c-format + msgid "attempt to use scalar parameter `%s' as an array" + msgstr "sayısal paramaetre `%s' bir dizi olarak kullanılmaya çalışılıyor" + + #: eval.c:1874 + msgid "`IGNORECASE' is a gawk extension" + msgstr "`IGNORECASE' bir gawk uzantısıdır" + + #: eval.c:1902 + msgid "`BINMODE' is a gawk extension" + msgstr "`BINMODE' bir gawk uzantısıdır" + + #: eval.c:2014 + #, c-format + msgid "bad `%sFMT' specification `%s'" + msgstr "`%sFMT' özelliÄŸi `%s' hatalı" + + #: eval.c:2080 + msgid "turning off `--lint' due to assignment to `LINT'" + msgstr "`LINT' atamasından dolayı `--lint' kapatılıyor" + + #: eval.c:2116 + msgid "NF set to negative value" + msgstr "NF negatif deÄŸere ayarlı" + + #: io.c:240 + #, c-format + msgid "cannot open file `%s' for reading (%s)" + msgstr "`%s' okumak için açılamıyor (%s)" + + #: io.c:320 + #, c-format + msgid "close of fd %d (`%s') failed (%s)" + msgstr "dosya tanımlayıcı %d (`%s') baÅŸarısız (%s)" + + #: io.c:432 + #, c-format + msgid "invalid tree type %s in redirect()" + msgstr "redirect() içindeki aÄŸaç türü %s geçersiz" + + #: io.c:438 + #, c-format + msgid "expression in `%s' redirection only has numeric value" + msgstr "`%s' yönlendirmesi içindeki ifade sadece sayısal deÄŸer içeriyor" + + #: io.c:444 + #, c-format + msgid "expression for `%s' redirection has null string value" + msgstr "`%s' yönlendirmesi içindeki ifade null dizge deÄŸeri içeriyor" + + #: io.c:449 + #, c-format + msgid "filename `%s' for `%s' redirection may be result of logical expression" + msgstr "" + "`%s' dosya ismi (`%s' yönlendirmesi için) mantıksal ifadenin sonucu olabilir" + + #: io.c:471 + #, c-format + msgid "unnecessary mixing of `>' and `>>' for file `%.*s'" + msgstr "`%.*s' dosyası için `>' ve `>>' karışımı gereksiz" + + #: io.c:523 + #, c-format + msgid "can't open pipe `%s' for output (%s)" + msgstr "`%s' veriyolu çıktı için açılamadı (%s)" + + #: io.c:532 + #, c-format + msgid "can't open pipe `%s' for input (%s)" + msgstr "`%s' veriyolu girdi için açılamadı (%s)" + + #: io.c:545 + #, c-format + msgid "can't open two way socket `%s' for input/output (%s)" + msgstr "iki yönlü `%s' soketi G/Ç için açılamıyor (%s)" + + #: io.c:549 + #, c-format + msgid "can't open two way pipe `%s' for input/output (%s)" + msgstr "iki yönlü `%s' veriyolu G/Ç için açılamıyor (%s)" + + #: io.c:625 + #, c-format + msgid "can't redirect from `%s' (%s)" + msgstr "`%s'den yönlendirilemiyor (%s)" + + #: io.c:628 + #, c-format + msgid "can't redirect to `%s' (%s)" + msgstr "`%s'e yönlendirilemiyor (%s)" + + #: io.c:667 + msgid "" + "reached system limit for open files: starting to multiplex file descriptors" + msgstr "" + "açık dosyalar için sistem sınırı aşıldı: çoÄŸul dosya tanımlayıcılara " + "baÅŸlarken" + + #: io.c:679 + #, c-format + msgid "close of `%s' failed (%s)." + msgstr "`%s' kapatılamadı (%s)." + + #: io.c:686 + msgid "too many pipes or input files open" + msgstr "çok fazla veriyolu ya da dosya açık" + + #: io.c:709 + msgid "close: second argument must be `to' or `from'" + msgstr "close: ikinci argüman `to' ya da `from' olmalı" + + #: io.c:723 + #, c-format + msgid "close: `%.*s' is not an open file, pipe or co-process" + msgstr "close: `%.*s' bir açık dosya, veriyolu ya da alt-iÅŸlem deÄŸil" + + #: io.c:727 + msgid "close of redirection that was never opened" + msgstr "hiç açılmamış bir yönlendirmenin kapatılması" + + #: io.c:754 + #, c-format + msgid "close: redirection `%s' not opened with `|&', second argument ignored" + msgstr "" + "close: `%s' yönlendirmesi bir `|&' ile açılmamış, ikinci argüman yoksayıldı" + + #: io.c:811 + #, c-format + msgid "failure status (%d) on pipe close of `%s' (%s)" + msgstr "baÅŸarısızlık durumu (%d): `%s' veriyolunun kapatılması (%s)" + + #: io.c:814 + #, c-format + msgid "failure status (%d) on file close of `%s' (%s)" + msgstr "baÅŸarısızlık durumu (%d): `%s' dosyasının kapatılması (%s)" + + #: io.c:833 + #, c-format + msgid "no explicit close of socket `%s' provided" + msgstr "`%s' soketinin açıkça kapatılması istenmedi" + + #: io.c:836 + #, c-format + msgid "no explicit close of co-process `%s' provided" + msgstr "`%s' alt-iÅŸleminin açıkça kapatılması istenmedi" + + #: io.c:839 + #, c-format + msgid "no explicit close of pipe `%s' provided" + msgstr "`%s' veriyolunun açıkça kapatılması istenmedi" + + #: io.c:842 + #, c-format + msgid "no explicit close of file `%s' provided" + msgstr "`%s' dosyasının açıkça kapatılması istenmedi" + + #: io.c:871 io.c:925 + #, c-format + msgid "error writing standard output (%s)" + msgstr "standart çıktıya yazarken hata (%s)" + + #: io.c:875 io.c:929 + #, c-format + msgid "error writing standard error (%s)" + msgstr "standart hataya yazarken hata (%s)" + + #: io.c:883 + #, c-format + msgid "pipe flush of `%s' failed (%s)." + msgstr "`%s'in veriyolu ile veri aktarımı baÅŸarısız (%s)." + + #: io.c:886 + #, c-format + msgid "co-process flush of pipe to `%s' failed (%s)." + msgstr "`%s'e veriyolunun alt-iÅŸlemi ile veri aktarımı baÅŸarısız (%s)." + + #: io.c:889 + #, c-format + msgid "file flush of `%s' failed (%s)." + msgstr "`%s'in dosya ile veri aktarımı baÅŸarısız (%s)." + + #: io.c:1048 + msgid "/inet/raw client not ready yet, sorry" + msgstr "/inet/raw istemci henüz hazır deÄŸil" + + #: io.c:1050 io.c:1087 + msgid "only root may use `/inet/raw'." + msgstr "`/inet/raw' sadece root tarafından kullanılabilir" + + #: io.c:1085 + msgid "/inet/raw server not ready yet, sorry" + msgstr "/inet/raw sunucu henüz hazır deÄŸil" + + #: io.c:1175 + #, c-format + msgid "no (known) protocol supplied in special filename `%s'" + msgstr "özel dosya ismi `%s' içinde (bilinen) bir protokol saÄŸlanmamış" + + #: io.c:1193 + #, c-format + msgid "special file name `%s' is incomplete" + msgstr "özel dosya ismi `%s' tamamlanmamış" + + #: io.c:1205 + #, c-format + msgid "local port invalid in `%s'" + msgstr "`%s' deki yerel port geçersiz" + + #: io.c:1217 + msgid "must supply a remote hostname to `/inet'" + msgstr "`/inet' e bir karşı makina ismi saÄŸlanmalı" + + #: io.c:1232 + msgid "must supply a remote port to `/inet'" + msgstr "`/inet' e bir karşı port saÄŸlanmalı" + + #: io.c:1238 + #, c-format + msgid "remote port invalid in `%s'" + msgstr "`%s' de karşı port geçersiz" + + #: io.c:1248 + msgid "TCP/IP communications are not supported" + msgstr "TCP/IP haberleÅŸmesi desteklenmiyor" + + #: io.c:1257 io.c:1438 + #, c-format + msgid "file `%s' is a directory" + msgstr "`%s' dosya deÄŸil dizin" + + #: io.c:1327 + #, c-format + msgid "use `PROCINFO[\"%s\"]' instead of `%s'" + msgstr "`PROCINFO[\"%s\"]' kullanın (`%s' yerine)" + + #: io.c:1359 + msgid "use `PROCINFO[...]' instead of `/dev/user'" + msgstr "`/dev/user' yerine `PROCINFO[...]' kullanın" + + #: io.c:1424 + #, c-format + msgid "could not open `%s', mode `%s'" + msgstr "`%s', `%s' kipinde açılamadı" + + #: io.c:1550 io.c:1602 io.c:1732 io.c:1754 + #, c-format + msgid "moving pipe to stdout in child failed (dup: %s)" + msgstr "ast süreçte veriyolu standart çıktıya taşınamadı (dup: %s)" + + #: io.c:1554 io.c:1607 + #, c-format + msgid "moving pipe to stdin in child failed (dup: %s)" + msgstr "ast süreçte veriyolu standart girdiye taşınamadı (dup: %s)" + + #: io.c:1571 io.c:1745 + msgid "restoring stdout in parent process failed\n" + msgstr "üst süreçte stdÇ eski durumuna getirilemedi\n" + + #: io.c:1576 + msgid "restoring stdin in parent process failed\n" + msgstr "üst süreçte stdG eski durumuna getirilemedi\n" + + #: io.c:1599 io.c:1751 + #, c-format + msgid "close of stdout in child failed (%s)" + msgstr "ast süreçte stdÇ kapatılamadı (%s)" + + #: io.c:1604 + #, c-format + msgid "close of stdin in child failed (%s)" + msgstr "ast süreçte stdG kapatılamadı (%s)" + + #: io.c:1610 io.c:1756 io.c:1767 + #, c-format + msgid "close of pipe failed (%s)" + msgstr "veriyolu kapatılamadı (%s)" + + #: io.c:1655 + msgid "`|&' not supported" + msgstr "`|&' desteklenmiyor" + + #: io.c:1722 + #, c-format + msgid "cannot open pipe `%s' (%s)" + msgstr "`%s' veriyolu açılamıyor (%s)" + + #: io.c:1763 + #, c-format + msgid "cannot create child process for `%s' (fork: %s)" + msgstr "`%s' için ast süreç oluÅŸturulamıyor (fork: %s)" + + #: io.c:2104 + #, c-format + msgid "data file `%s' is empty" + msgstr "veri dosyası `%s' boÅŸ" + + #: io.c:2175 + #, c-format + msgid "internal error: file `%s', line %d\n" + msgstr "iç hata: dosya `%s', satır %d\n" + + #: io.c:2277 + #, c-format + msgid "error reading input file `%s': %s" + msgstr "`%s' girdi dosyası okunurken hata: %s" + + #: io.c:2521 + msgid "multicharacter value of `RS' is a gawk extension" + msgstr "`RS' çoklu karakter deÄŸeri bir gawk uzantısıdır" + + #: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116 + msgid "can't convert string to float" + msgstr "dizge gerçel sayıya dönüştürülemiyor" + + #: node.c:342 + msgid "backslash at end of string" + msgstr "dizge sonunda tersbölü" + + #: node.c:524 + msgid "POSIX does not allow `\\x' escapes" + msgstr "POSIX `\\x' öncelemelerine izin vermez" + + #: node.c:530 + msgid "no hex digits in `\\x' escape sequence" + msgstr "`\\x' önceleme dizgesinde onaltılık rakamlar yok" + + #: node.c:564 + #, c-format + msgid "escape sequence `\\%c' treated as plain `%c'" + msgstr "`\\%c' önceleme dizgesi `%c' olarak kullanıldı" + + #: re.c:208 + #, c-format + msgid "regex match failed, not enough memory to match string \"%.*s%s\"" + msgstr "" + "düzenli ifade eÅŸleÅŸmesi saÄŸlanamadı, \"%.*s%s\" dizgesini eÅŸleÅŸtirmek için " + "yeterli bellek yok" + + #: posix/gawkmisc.c:122 + #, c-format + msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)" + msgstr "%s %s `%s': close-on-exec belirlenemedi: (fcntl: %s)" + + #~ msgid "" + #~ "\n" + #~ "To report bugs, see node `Bugs' in `gawk.info', which is\n" + #~ msgstr "" + #~ "\n" + #~ "Yazılım hatalarını bildirmek için `gawk.info' içindeki `Bugs' " + #~ "bölümündeki\n" diff -crN gawk-3.1.0/posix/ChangeLog gawk-3.1.1/posix/ChangeLog *** gawk-3.1.0/posix/ChangeLog Sun Jun 3 13:05:17 2001 --- gawk-3.1.1/posix/ChangeLog Wed May 1 16:42:12 2002 *************** *** 1,3 **** --- 1,11 ---- + Wed May 1 16:41:32 2002 Arnold D. Robbins + + * Release 3.1.1: Release tar file made. + + Tue Sep 25 15:19:53 2001 Arnold D. Robbins + + * gawkmisc.c (os_close_on_exec): If fd <= 2, return. + Sun Jun 3 13:04:44 2001 Arnold D. Robbins * Release 3.1.0: Release tar file made. And there was diff -crN gawk-3.1.0/posix/gawkmisc.c gawk-3.1.1/posix/gawkmisc.c *** gawk-3.1.0/posix/gawkmisc.c Sun Jan 28 15:49:24 2001 --- gawk-3.1.1/posix/gawkmisc.c Tue Apr 16 14:58:41 2002 *************** *** 1,6 **** ! /* gawkmisc.c --- miscellanious gawk routines that are OS specific. ! Copyright (C) 1986, 1988, 1989, 1991 - 98, 2001 the 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 --- 1,6 ---- ! /* gawkmisc.c --- miscellaneous gawk routines that are OS specific. ! Copyright (C) 1986, 1988, 1989, 1991 - 1998, 2001, 2002 the 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 *************** *** 82,94 **** #define DEFBLKSIZE BUFSIZ #endif - if (isatty(fd)) - return BUFSIZ; if (fstat(fd, stb) == -1) fatal("can't stat fd %d (%s)", fd, strerror(errno)); ! if (lseek(fd, (off_t)0, 0) == -1) /* not a regular file */ ! return DEFBLKSIZE; ! if (stb->st_size > 0 && stb->st_size < DEFBLKSIZE) /* small file */ return stb->st_size; return DEFBLKSIZE; } --- 82,91 ---- #define DEFBLKSIZE BUFSIZ #endif if (fstat(fd, stb) == -1) fatal("can't stat fd %d (%s)", fd, strerror(errno)); ! if (S_ISREG(stb->st_mode) ! && 0 < stb->st_size && stb->st_size < DEFBLKSIZE) /* small file */ return stb->st_size; return DEFBLKSIZE; } *************** *** 118,125 **** int fd; const char *name, *what, *dir; { if (fcntl(fd, F_SETFD, 1) < 0) ! warning(_("%s %s `%s': could not set close-on-exec: %s"), what, dir, name, strerror(errno)); } --- 115,125 ---- int fd; const char *name, *what, *dir; { + if (fd <= 2) /* sanity */ + return; + if (fcntl(fd, F_SETFD, 1) < 0) ! warning(_("%s %s `%s': could not set close-on-exec: (fcntl: %s)"), what, dir, name, strerror(errno)); } diff -crN gawk-3.1.0/profile.c gawk-3.1.1/profile.c *** gawk-3.1.0/profile.c Tue Feb 27 12:05:01 2001 --- gawk-3.1.1/profile.c Tue Apr 16 14:58:49 2002 *************** *** 3,9 **** */ /* ! * Copyright (C) 1999-2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. --- 3,9 ---- */ /* ! * Copyright (C) 1999-2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. *************** *** 98,114 **** } } void init_profiling_signals() { #ifdef PROFILING #ifdef SIGHUP signal(SIGHUP, dump_and_exit); #endif #ifdef SIGUSR1 signal(SIGUSR1, just_dump); #endif ! #endif } /* indent --- print out enough tabs */ --- 98,121 ---- } } + /* init_profiling_signals --- set up signal handling for pgawk */ + void init_profiling_signals() { #ifdef PROFILING + #ifdef __DJGPP__ + signal(SIGINT, dump_and_exit); + signal(SIGQUIT, just_dump); + #else /* !__DJGPP__ */ #ifdef SIGHUP signal(SIGHUP, dump_and_exit); #endif #ifdef SIGUSR1 signal(SIGUSR1, just_dump); #endif ! #endif /* !__DJGPP__ */ ! #endif /* PROFILING */ } /* indent --- print out enough tabs */ *************** *** 403,409 **** return; case Node_val: ! if ((tree->flags & (NUM|NUMBER)) != 0) fprintf(prof_fp, "%g", tree->numbr); else { if ((tree->flags & INTLSTR) != 0) --- 410,416 ---- return; case Node_val: ! if ((tree->flags & NUMBER) != 0) fprintf(prof_fp, "%g", tree->numbr); else { if ((tree->flags & INTLSTR) != 0) *************** *** 447,452 **** --- 454,464 ---- pp_getline(tree); return; + case Node_K_delete_loop: + fprintf(prof_fp, "delete "); + tree_eval(tree->lnode); + return; + /* unary operations */ case Node_NR: fprintf(prof_fp, "NR"); *************** *** 496,501 **** --- 508,517 ---- fprintf(prof_fp, "BINMODE"); return; + case Node_TEXTDOMAIN: + fprintf(prof_fp, "TEXTDOMAIN"); + return; + case Node_field_spec: case Node_subscript: pp_lhs(tree); *************** *** 510,516 **** case Node_unary_minus: fprintf(prof_fp, " -"); ! tree_eval(tree->subnode); return; case Node_cond_exp: --- 526,538 ---- case Node_unary_minus: fprintf(prof_fp, " -"); ! if (is_scalar(tree->subnode->type)) ! tree_eval(tree->subnode); ! else { ! fprintf(prof_fp, "("); ! tree_eval(tree->subnode); ! fprintf(prof_fp, ")"); ! } return; case Node_cond_exp: *************** *** 524,529 **** --- 546,552 ---- case Node_match: case Node_nomatch: case Node_regex: + case Node_dynregex: pp_match_op(tree); return; *************** *** 794,799 **** --- 817,826 ---- fprintf(prof_fp, "OFS"); break; + case Node_TEXTDOMAIN: + fprintf(prof_fp, "TEXTDOMAIN"); + break; + case Node_param_list: fprintf(prof_fp, "%s", fparms[ptr->param_cnt]); break; *************** *** 848,873 **** size_t relen; NODE *text = NULL; ! if (tree->type == Node_regex) ! re = tree->re_exp; ! else { ! re = tree->rnode->re_exp; ! text = tree->lnode; } ! if ((re->re_flags & CONST) != 0) { ! restr = re->stptr; ! relen = re->stlen; ! } else { restr = re->stptr; relen = re->stlen; - } - - if (tree->type == Node_regex) { pp_string(restr, relen, '/'); return; } if (tree->type == Node_nomatch) op = "!~"; else if (tree->type == Node_match) --- 875,898 ---- size_t relen; NODE *text = NULL; ! if (tree->type == Node_dynregex) { ! tree_eval(tree->re_exp); ! return; } ! if (tree->type == Node_regex) { ! re = tree->re_exp; restr = re->stptr; relen = re->stlen; pp_string(restr, relen, '/'); return; } + /* at this point, have either ~ or !~ */ + + text = tree->lnode; + re = tree->rnode; + if (tree->type == Node_nomatch) op = "!~"; else if (tree->type == Node_match) *************** *** 877,883 **** tree_eval(text); fprintf(prof_fp, " %s ", op); ! fprintf(prof_fp, "/%.*s/", (int) relen, restr); } /* pp_redir --- print a redirection */ --- 902,908 ---- tree_eval(text); fprintf(prof_fp, " %s ", op); ! tree_eval(re); } /* pp_redir --- print a redirection */ *************** *** 1192,1198 **** } else { char buf[10]; ! sprintf(buf, "\\%03o", *str & 0xff); count += strlen(buf) - 1; fprintf(fp, "%s", buf); } --- 1217,1227 ---- } else { char buf[10]; ! /* print 'em as they came if for whiny users */ ! if (whiny_users) ! sprintf(buf, "%c", *str & 0xff); ! else ! sprintf(buf, "\\%03o", *str & 0xff); count += strlen(buf) - 1; fprintf(fp, "%s", buf); } *************** *** 1222,1227 **** --- 1251,1257 ---- case Node_OFS: case Node_ORS: case Node_RS: + case Node_TEXTDOMAIN: case Node_subscript: return TRUE; default: *************** *** 1240,1245 **** --- 1270,1276 ---- case Node_param_list: case Node_subscript: case Node_func_call: + case Node_K_delete_loop: case Node_val: case Node_builtin: case Node_BINMODE: *************** *** 1255,1260 **** --- 1286,1292 ---- case Node_OFS: case Node_ORS: case Node_RS: + case Node_TEXTDOMAIN: return 15; case Node_field_spec: diff -crN gawk-3.1.0/protos.h gawk-3.1.1/protos.h *** gawk-3.1.0/protos.h Sun Jan 21 17:47:18 2001 --- gawk-3.1.1/protos.h Tue Apr 16 14:58:54 2002 *************** *** 3,9 **** */ /* ! * Copyright (C) 1991 - 2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. --- 3,9 ---- */ /* ! * Copyright (C) 1991 - 2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. *************** *** 102,108 **** extern int fstat P((int, struct stat *)); extern int stat P((const char *, struct stat *)); extern off_t lseek P((int, off_t, int)); - extern int fseek P((FILE *, long, int)); extern int close P((int)); extern int creat P((const char *, mode_t)); extern int open P((const char *, int, ...)); --- 102,107 ---- diff -crN gawk-3.1.0/random.c gawk-3.1.1/random.c *** gawk-3.1.0/random.c Thu Apr 19 16:33:49 2001 --- gawk-3.1.1/random.c Sun Nov 18 11:55:29 2001 *************** *** 40,51 **** --- 40,57 ---- #include "random.h" /* gawk addition */ + /* + * srandomdev() isn't used by gawk, and it causes numerous + * compile headaches, so just blow it away. + */ + #if 0 #if !defined (_MSC_VER) && !defined (__MINGW32__) && !defined (VMS) #include /* for srandomdev() */ #else #include /* for clock() */ #define ssize_t size_t #endif /* !defined (_MSC_VER) && !defined (__MINGW32__) && !defined (VMS) */ + #endif #include *************** *** 54,65 **** --- 60,74 ---- #include #endif + /* same thing here: */ + #if 0 #ifdef HAVE_UNISTD_H #include /* for srandomdev() */ #endif #ifdef HAVE_FCNTL_H #include /* for srandomdev() */ #endif + #endif /* * random.c: *************** *** 303,308 **** --- 312,318 ---- * state buffer are no longer derived from the LC algorithm applied to * a fixed seed. */ + #if 0 void srandomdev() { *************** *** 349,354 **** --- 359,365 ---- rptr = &state[0]; } } + #endif /* * initstate: diff -crN gawk-3.1.0/re.c gawk-3.1.1/re.c *** gawk-3.1.0/re.c Sun Jan 28 21:06:38 2001 --- gawk-3.1.1/re.c Tue Apr 16 14:58:58 2002 *************** *** 3,9 **** */ /* ! * Copyright (C) 1991-2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. --- 3,9 ---- */ /* ! * Copyright (C) 1991-2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. *************** *** 39,44 **** --- 39,52 ---- char *end = s + len; register char *dest; register int c, c2; + #ifdef MBS_SUPPORT + /* The number of bytes in the current multbyte character. + It is 0, when the current character is a singlebyte character. */ + size_t is_multibyte = 0; + mbstate_t mbs; + if (MB_CUR_MAX > 1) + memset(&mbs, 0, sizeof(mbstate_t)); /* Initialize. */ + #endif /* Handle escaped characters first. */ *************** *** 51,57 **** --- 59,84 ---- temp = dest; while (src < end) { + #ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1 && !is_multibyte) { + /* The previous byte is a singlebyte character, or last byte + of a multibyte character. We check the next character. */ + is_multibyte = mbrlen(src, end - src, &mbs); + if ((is_multibyte == 1) || (is_multibyte == (size_t) -1) + || (is_multibyte == (size_t) -2 || (is_multibyte == 0))) { + /* We treat it as a singlebyte character. */ + is_multibyte = 0; + } + } + #endif + + #ifdef MBS_SUPPORT + /* We skip multibyte character, since it must not be a special + character. */ + if ((MB_CUR_MAX == 1 || !is_multibyte) && (*src == '\\')) { + #else if (*src == '\\') { + #endif c = *++src; switch (c) { case 'a': *************** *** 105,110 **** --- 132,141 ---- } /* switch */ } else *dest++ = *src++; /* not '\\' */ + #ifdef MBS_SUPPORT + if (MB_CUR_MAX > 1 && is_multibyte) + is_multibyte--; + #endif } /* for */ *dest = '\0' ; /* Only necessary if we print dest ? */ *************** *** 163,168 **** --- 194,214 ---- if (need_start || rp->dfa == FALSE || try_backref) { int res = re_search(&(rp->pat), str, start+len, start, len, &(rp->regs)); + + /* + * A return of -2 indicates that a heuristic in + * regex decided it might allocate too much memory + * on the C stack. This doesn't apply to gawk, which + * uses REGEX_MALLOC. This is dealt with by the + * assignment to re_max_failures in resetup(). + * Naetheless, we keep this code here as a fallback. + */ + if (res == -2) { + /* the 10 here is arbitrary */ + fatal(_("regex match failed, not enough memory to match string \"%.*s%s\""), + len > 10 ? 10 : len, str + start, + len > 10 ? "..." : ""); + } return res; } else return 1; *************** *** 202,209 **** NODE *t1; if ((t->re_flags & CASE) == IGNORECASE) { ! if ((t->re_flags & CONST) != 0) return t->re_reg; t1 = force_string(tree_eval(t->re_exp)); if (t->re_text != NULL) { if (cmp_nodes(t->re_text, t1) == 0) { --- 248,257 ---- NODE *t1; if ((t->re_flags & CASE) == IGNORECASE) { ! if ((t->re_flags & CONST) != 0) { ! assert(t->type == Node_regex); return t->re_reg; + } t1 = force_string(tree_eval(t->re_exp)); if (t->re_text != NULL) { if (cmp_nodes(t->re_text, t1) == 0) { diff -crN gawk-3.1.0/regex.c gawk-3.1.1/regex.c *** gawk-3.1.0/regex.c Tue Feb 6 18:13:53 2001 --- gawk-3.1.1/regex.c Wed Apr 17 14:42:40 2002 *************** *** 2,8 **** version 0.12. (Implements POSIX draft P1003.2/D11.2, except for some of the internationalization features.) ! Copyright (C) 1993, 94, 95, 96, 97, 98, 99, 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 --- 2,8 ---- version 0.12. (Implements POSIX draft P1003.2/D11.2, except for some of the internationalization features.) ! Copyright (C) 1993, 94, 95, 96, 97, 98, 99, 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 General Public License as published by *************** *** 38,43 **** --- 38,49 ---- # endif /* GCC. */ #endif /* Not PARAMS. */ + #ifndef INSIDE_RECURSION + + #if !defined __GNUC__ + # define __alignof__(type) sizeof(type) + #endif + #if defined STDC_HEADERS && !defined emacs # include #else *************** *** 45,51 **** --- 51,71 ---- # include #endif + #if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC + /* We can handle multibyte string. */ + # define MBS_SUPPORT + # if !WIDE_CHAR_SUPPORT + # define WIDE_CHAR_SUPPORT 1 + # endif + #else #define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC) + #endif + + /* Activate this if definition of alignof() for non-GNU C is good. + #if !defined __GNUC__ + # undef MBS_SUPPORT + #endif + */ /* For platform which support the ISO C amendement 1 functionality we support user defined character classes. */ *************** *** 80,88 **** #define btowc __btowc #endif /* This is for other GNU distributions with internationalized messages. */ ! #if HAVE_LIBINTL_H || defined _LIBC ! # include #else # define gettext(msgid) (msgid) #endif --- 100,113 ---- #define btowc __btowc #endif + /* Don't use gettext if ENABLE_NLS is not defined */ + #ifdef ENABLE_NLS /* This is for other GNU distributions with internationalized messages. */ ! # if HAVE_LIBINTL_H || defined _LIBC ! # include ! # else ! # define gettext(msgid) (msgid) ! # endif #else # define gettext(msgid) (msgid) #endif *************** *** 165,170 **** --- 190,203 ---- #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 *************** *** 374,385 **** #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 --- 407,452 ---- #define false 0 #define true 1 ! static reg_errcode_t byte_regex_compile _RE_ARGS ((const char *pattern, size_t size, ! reg_syntax_t syntax, ! struct re_pattern_buffer *bufp)); ! ! static int byte_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)); + static int byte_re_search_2 PARAMS ((struct re_pattern_buffer *bufp, + const char *string1, int size1, + const char *string2, int size2, + int startpos, int range, + struct re_registers *regs, int stop)); + static int byte_re_compile_fastmap PARAMS ((struct re_pattern_buffer *bufp)); + + #ifdef MBS_SUPPORT + static reg_errcode_t wcs_regex_compile _RE_ARGS ((const char *pattern, size_t size, + reg_syntax_t syntax, + struct re_pattern_buffer *bufp)); + + + static int wcs_re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp, + const char *cstring1, int csize1, + const char *cstring2, int csize2, + int pos, + struct re_registers *regs, + int stop, + wchar_t *string1, int size1, + wchar_t *string2, int size2, + int *mbs_offset1, int *mbs_offset2)); + static int wcs_re_search_2 PARAMS ((struct re_pattern_buffer *bufp, + const char *string1, int size1, + const char *string2, int size2, + int startpos, int range, + struct re_registers *regs, int stop)); + static int wcs_re_compile_fastmap PARAMS ((struct re_pattern_buffer *bufp)); + #endif + /* These are the command codes that appear in compiled regular expressions. Some opcodes are followed by argument bytes. A *************** *** 396,401 **** --- 463,473 ---- /* 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, *************** *** 405,410 **** --- 477,489 ---- 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 *************** *** 454,459 **** --- 533,539 ---- /* Followed by two-byte relative address of place to resume at in case of failure. */ + /* ifdef WCHAR, the size of address is 1. */ on_failure_jump, /* Like on_failure_jump, but pushes a placeholder instead of the *************** *** 462,467 **** --- 542,548 ---- /* Throw away latest failure point and then jump to following two-byte relative address. */ + /* ifdef WCHAR, the size of address is 1. */ pop_failure_jump, /* Change to pop_failure_jump if know won't have to backtrack to *************** *** 471,476 **** --- 552,558 ---- 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 WCHAR, the size of address is 1. */ maybe_pop_jump, /* Jump to following two-byte address, and push a dummy failure *************** *** 478,483 **** --- 560,566 ---- 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 WCHAR, the size of address is 1. */ dummy_failure_jump, /* Push a dummy failure point and continue. Used at the end of *************** *** 486,500 **** --- 569,586 ---- /* Followed by two-byte relative address and two-byte number n. After matching N times, jump to the address upon failure. */ + /* ifdef WCHAR, 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 WCHAR, 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 WCHAR, the size of address is 1. */ set_number_at, wordchar, /* Matches any word-constituent character. */ *************** *** 519,569 **** notsyntaxspec #endif /* emacs */ } re_opcode_t; /* Common operations on the compiled pattern. */ /* Store NUMBER in two contiguous bytes starting at DESTINATION. */ ! #define STORE_NUMBER(destination, number) \ do { \ (destination)[0] = (number) & 0377; \ (destination)[1] = (number) >> 8; \ } while (0) /* Same as STORE_NUMBER, except increment DESTINATION to the byte after where the number is stored. Therefore, DESTINATION must be an lvalue. */ #define STORE_NUMBER_AND_INCR(destination, number) \ do { \ STORE_NUMBER (destination, number); \ ! (destination) += 2; \ } while (0) /* Put into DESTINATION a number stored in two contiguous bytes starting at SOURCE. */ ! #define EXTRACT_NUMBER(destination, source) \ do { \ (destination) = *(source) & 0377; \ (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \ } while (0) #ifdef DEBUG ! static void extract_number _RE_ARGS ((int *dest, unsigned char *source)); static void ! extract_number (dest, source) int *dest; ! unsigned char *source; { int temp = SIGN_EXTEND_CHAR (*(source + 1)); *dest = *source & 0377; *dest += temp << 8; } # 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 */ --- 605,735 ---- notsyntaxspec #endif /* emacs */ } re_opcode_t; + #endif /* not INSIDE_RECURSION */ + + #ifdef BYTE + # define CHAR_T char + # define UCHAR_T unsigned char + # define COMPILED_BUFFER_VAR bufp->buffer + /* Offset address size in compiled pattern. */ + # define OFFSET_ADDRESS_SIZE 2 + #ifdef HAVE_STRINGIZE /* if it supports #, it probably supports ## too */ + # define PREFIX(name) byte_##name + #else + # define PREFIX(name) byte_/**/name + #endif + # define ARG_PREFIX(name) name + # define PUT_CHAR(c) putchar (c) + #else + #ifdef WCHAR + # define CHAR_T wchar_t + # define CHAR_T_SIGN (1 << (sizeof(CHAR_T) * 8 - 1)) + # if defined _AIX + # define WCHAR_T_NEED_SIGNEXTEND 1 + # endif /* _AIX */ + # define UCHAR_T wchar_t + # define COMPILED_BUFFER_VAR wc_buffer + /* Offset address size in compiled pattern. */ + # define OFFSET_ADDRESS_SIZE 1 + # define CHAR_CLASS_SIZE ((__alignof__(wctype_t)+sizeof(wctype_t))/sizeof(CHAR_T)+1) + #ifdef HAVE_STRINGIZE /* if it supports #, it probably supports ## too */ + # define PREFIX(name) wcs_##name + #else + # define PREFIX(name) wcs_/**/name + #endif + # define ARG_PREFIX(name) c##name + /* Should we use wide stream?? */ + # define PUT_CHAR(c) printf ("%C", c); + # define TRUE 1 + # define FALSE 0 + #else + # ifdef MBS_SUPPORT + # define WCHAR + # define INSIDE_RECURSION + # include "regex.c" + # undef INSIDE_RECURSION + # endif /* MBS_SUPPORT */ + # define BYTE + # define INSIDE_RECURSION + # include "regex.c" + # undef INSIDE_RECURSION + #endif /* WCHAR */ + #endif /* BYTE */ + + #ifdef INSIDE_RECURSION /* Common operations on the compiled pattern. */ /* Store NUMBER in two contiguous bytes starting at DESTINATION. */ + /* ifdef WCHAR, we store NUMBER in 1 element. */ ! # ifdef WCHAR ! # define STORE_NUMBER(destination, number) \ ! do { \ ! *(destination) = (UCHAR_T)(number); \ ! } while (0) ! # else /* BYTE */ ! # define STORE_NUMBER(destination, number) \ do { \ (destination)[0] = (number) & 0377; \ (destination)[1] = (number) >> 8; \ } while (0) + # endif /* WCHAR */ /* Same as STORE_NUMBER, except increment DESTINATION to the byte after where the number is stored. Therefore, DESTINATION must be an lvalue. */ + /* ifdef WCHAR, 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 WCHAR, we store NUMBER in 1 element. */ ! # ifdef WCHAR ! # ifdef WCHAR_T_NEED_SIGNEXTEND ! # define EXTRACT_NUMBER(destination, source) \ ! (destination) = (*(source) ^ CHAR_T_SIGN) - CHAR_T_SIGN; ! # else ! # define EXTRACT_NUMBER(destination, source) \ ! (destination) = *(source) ! # endif /* WCHAR_T_NEED_SIGNEXTEND */ ! # else /* BYTE */ ! # define EXTRACT_NUMBER(destination, source) \ do { \ (destination) = *(source) & 0377; \ (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \ } while (0) + # endif #ifdef DEBUG ! static void PREFIX(extract_number) _RE_ARGS ((int *dest, UCHAR_T *source)); static void ! PREFIX(extract_number) (dest, source) int *dest; ! UCHAR_T *source; { + # ifdef WCHAR + # ifdef WCHAR_T_NEED_SIGNEXTEND + *dest = (*source ^ CHAR_T_SIGN) - CHAR_T_SIGN; + # else + *dest = *source; + # endif /* WCHAR_T_NEED_SIGNEXTEND */ + # else /* BYTE */ 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) PREFIX(extract_number) (&dest, src) # endif /* not EXTRACT_MACROS */ #endif /* DEBUG */ *************** *** 574,598 **** #define EXTRACT_NUMBER_AND_INCR(destination, source) \ do { \ EXTRACT_NUMBER (destination, source); \ ! (source) += 2; \ } while (0) #ifdef DEBUG ! static void extract_number_and_incr _RE_ARGS ((int *destination, ! unsigned char **source)); static void ! extract_number_and_incr (destination, source) int *destination; ! unsigned char **source; { ! extract_number (destination, *source); ! *source += 2; } # 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 */ --- 740,764 ---- #define EXTRACT_NUMBER_AND_INCR(destination, source) \ do { \ EXTRACT_NUMBER (destination, source); \ ! (source) += OFFSET_ADDRESS_SIZE; \ } while (0) #ifdef DEBUG ! static void PREFIX(extract_number_and_incr) _RE_ARGS ((int *destination, ! UCHAR_T **source)); static void ! PREFIX(extract_number_and_incr) (destination, source) int *destination; ! UCHAR_T **source; { ! PREFIX(extract_number) (destination, *source); ! *source += OFFSET_ADDRESS_SIZE; } # ifndef EXTRACT_MACROS # undef EXTRACT_NUMBER_AND_INCR # define EXTRACT_NUMBER_AND_INCR(dest, src) \ ! PREFIX(extract_number_and_incr) (&dest, &src) # endif /* not EXTRACT_MACROS */ #endif /* DEBUG */ *************** *** 605,610 **** --- 771,778 ---- #ifdef DEBUG + #ifndef DEFINED_ONCE + /* We use standard I/O for debugging. */ # include *************** *** 618,631 **** # 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; --- 786,802 ---- # 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) + #endif /* not DEFINED_ONCE */ + # define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \ ! if (debug) PREFIX(print_partial_compiled_pattern) (s, e) # define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \ ! if (debug) PREFIX(print_double_string) (w, s1, sz1, s2, sz2) /* Print the fastmap in human-readable form. */ + #ifndef DEFINED_ONCE void print_fastmap (fastmap) char *fastmap; *************** *** 653,672 **** } 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) ! unsigned char *start; ! unsigned char *end; { int mcnt, mcnt2; ! unsigned char *p1; ! unsigned char *p = start; ! unsigned char *pend = end; if (start == NULL) { --- 824,844 ---- } putchar ('\n'); } + #endif /* not DEFINED_ONCE */ /* Print a compiled pattern string in human-readable form, starting at the START pointer into it and ending just before the pointer END. */ void ! PREFIX(print_partial_compiled_pattern) (start, end) ! UCHAR_T *start; ! UCHAR_T *end; { int mcnt, mcnt2; ! UCHAR_T *p1; ! UCHAR_T *p = start; ! UCHAR_T *pend = end; if (start == NULL) { *************** *** 691,700 **** do { putchar ('/'); ! putchar (*p++); } while (--mcnt); break; case start_memory: mcnt = *p++; --- 863,884 ---- 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++; *************** *** 717,722 **** --- 901,945 ---- case charset: case charset_not: { + # ifdef WCHAR + 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); printf ("%ld bytes used/%ld bytes allocated.\n", bufp->used, bufp->allocated); --- 1118,1130 ---- void ! PREFIX(print_compiled_pattern) (bufp) struct re_pattern_buffer *bufp; { ! UCHAR_T *buffer = (UCHAR_T*) bufp->buffer; ! PREFIX(print_partial_compiled_pattern) (buffer, buffer ! + bufp->used / sizeof(UCHAR_T)); printf ("%ld bytes used/%ld bytes allocated.\n", bufp->used, bufp->allocated); *************** *** 922,931 **** void ! print_double_string (where, string1, size1, string2, size2) ! const char *where; ! const char *string1; ! const char *string2; int size1; int size2; { --- 1147,1156 ---- void ! PREFIX(print_double_string) (where, string1, size1, string2, size2) ! const CHAR_T *where; ! const CHAR_T *string1; ! const CHAR_T *string2; int size1; int size2; { *************** *** 938,962 **** if (FIRST_STRING_P (where)) { for (this_char = where - string1; this_char < size1; this_char++) ! putchar (string1[this_char]); where = string2; } for (this_char = where - string2; this_char < size2; this_char++) ! putchar (string2[this_char]); } } void printchar (c) int c; { putc (c, stderr); } #else /* not DEBUG */ # undef assert # define assert(e) --- 1163,1190 ---- 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]); } } + # ifndef DEFINED_ONCE void printchar (c) int c; { putc (c, stderr); } + #endif #else /* not DEBUG */ + #ifndef DEFINED_ONCE # undef assert # define assert(e) *************** *** 965,975 **** --- 1193,1280 ---- # define DEBUG_PRINT2(x1, x2) # define DEBUG_PRINT3(x1, x2, x3) # define DEBUG_PRINT4(x1, x2, x3, x4) + #endif /* not DEFINED_ONCE */ # define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) # define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) #endif /* not DEBUG */ + # ifdef WCHAR + /* 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_T *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_T *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; + + mbstate_t mbs; + int i, 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; + } + + /* Fill remain of the buffer with sentinel. */ + for (i = wc_count + 1 ; i <= len ; i++) + offset_buffer[i] = mb_count + 1; + + return wc_count; + } + # endif /* WCHAR */ + + #else /* not INSIDE_RECURSION */ /* 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. */ *************** *** 1033,1038 **** --- 1338,1346 ---- gettext_noop ("Unmatched ) or \\)"), /* REG_ERPAREN */ }; + #endif /* INSIDE_RECURSION */ + + #ifndef DEFINED_ONCE /* Avoiding alloca during matching, to placate r_alloc. */ /* Define MATCH_MAY_ALLOCATE unless we need to make sure that the *************** *** 1069,1076 **** --- 1377,1386 ---- #if (defined C_ALLOCA || defined REGEX_MALLOC) && defined emacs # undef MATCH_MAY_ALLOCATE #endif + #endif /* not DEFINED_ONCE */ + #ifdef INSIDE_RECURSION /* 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. */ *************** *** 1090,1148 **** #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 { ! unsigned char *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 = 20000; ! # else int re_max_failures = 2000; ! # endif ! union fail_stack_elt { ! unsigned char *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. --- 1400,1492 ---- #ifdef INT_IS_16BIT ! #ifndef DEFINED_ONCE ! ! # ifdef REGEX_MALLOC ! /* ! * Set RE_MAX_FAILURES to the largest reasonable value, ! * to avoid spurious "not enough memory" messages. ! * The '80' is computed as follows: ! * regex.c's MAX_FAILURE_ITEMS is at most 20. ! * regex.c computes 2 * MAX_FAILURE_ITEMS, giving us 40. ! * re_max_failures is signed, not unsigned, for another factor of 2, ! * giving us 80. ! */ ! long int re_max_failures = ((unsigned) -1) / 80; ! # else /* ! not REGEX_MALLOC */ ! # 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 ! # endif /* ! not REGEX_MALLOC */ ! #endif /* ! DEFINED_ONCE */ ! union PREFIX(fail_stack_elt) { ! UCHAR_T *pointer; long int integer; }; ! typedef union PREFIX(fail_stack_elt) PREFIX(fail_stack_elt_t); typedef struct { ! PREFIX(fail_stack_elt_t) *stack; unsigned long int size; unsigned long int avail; /* Offset of next open position. */ ! } PREFIX(fail_stack_type); #else /* not INT_IS_16BIT */ ! #ifndef DEFINED_ONCE ! ! # ifdef REGEX_MALLOC ! /* ! * Set RE_MAX_FAILURES to the largest reasonable value, ! * to avoid spurious "not enough memory" messages. ! * The '80' is computed as follows: ! * regex.c's MAX_FAILURE_ITEMS is at most 20. ! * regex.c computes 2 * MAX_FAILURE_ITEMS, giving us 40. ! * re_max_failures is signed, not unsigned, for another factor of 2, ! * giving us 80. ! */ ! long int re_max_failures = ((unsigned) -1) / 80; ! # else /* ! not REGEX_MALLOC */ ! # 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 = 20000; ! # else int re_max_failures = 2000; ! # endif ! # endif /* ! not REGEX_MALLOC */ ! #endif ! union PREFIX(fail_stack_elt) { ! UCHAR_T *pointer; int integer; }; ! typedef union PREFIX(fail_stack_elt) PREFIX(fail_stack_elt_t); typedef struct { ! PREFIX(fail_stack_elt_t) *stack; unsigned size; unsigned avail; /* Offset of next open position. */ ! } PREFIX(fail_stack_type); #endif /* INT_IS_16BIT */ + #ifndef DEFINED_ONCE #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) + #endif /* Define macros to initialize and free the failure stack. *************** *** 1151,1158 **** #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; \ --- 1495,1502 ---- #ifdef MATCH_MAY_ALLOCATE # define INIT_FAIL_STACK() \ do { \ ! fail_stack.stack = (PREFIX(fail_stack_elt_t) *) \ ! REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (PREFIX(fail_stack_elt_t))); \ \ if (fail_stack.stack == NULL) \ return -2; \ *************** *** 1182,1191 **** #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 \ --- 1526,1535 ---- #define DOUBLE_FAIL_STACK(fail_stack) \ ((fail_stack).size > (unsigned) (re_max_failures * MAX_FAILURE_ITEMS) \ ? 0 \ ! : ((fail_stack).stack = (PREFIX(fail_stack_elt_t) *) \ REGEX_REALLOCATE_STACK ((fail_stack).stack, \ ! (fail_stack).size * sizeof (PREFIX(fail_stack_elt_t)), \ ! ((fail_stack).size << 1) * sizeof (PREFIX(fail_stack_elt_t))),\ \ (fail_stack).stack == NULL \ ? 0 \ *************** *** 1207,1213 **** 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 = (unsigned char *) (item) /* This pushes an integer-valued item onto the failure stack. Assumes the variable `fail_stack'. Probably should only --- 1551,1557 ---- 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 = (UCHAR_T *) (item) /* This pushes an integer-valued item onto the failure stack. Assumes the variable `fail_stack'. Probably should only *************** *** 1325,1330 **** --- 1669,1675 ---- DEBUG_PUSH (failure_id); \ } while (0) + #ifndef DEFINED_ONCE /* This is the number of items that are pushed and popped on the stack for each register. */ #define NUM_REG_ITEMS 3 *************** *** 1351,1356 **** --- 1696,1702 ---- /* How many items can still be added to the stack without overflowing it. */ #define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail) + #endif /* not DEFINED_ONCE */ /* Pops what PUSH_FAIL_STACK pushes. *************** *** 1369,1375 **** { \ DEBUG_STATEMENT (unsigned failure_id;) \ active_reg_t this_reg; \ ! const unsigned char *string_temp; \ \ assert (!FAIL_STACK_EMPTY ()); \ \ --- 1715,1721 ---- { \ DEBUG_STATEMENT (unsigned failure_id;) \ active_reg_t this_reg; \ ! const UCHAR_T *string_temp; \ \ assert (!FAIL_STACK_EMPTY ()); \ \ *************** *** 1388,1400 **** saved NULL, thus retaining our current position in the string. */ \ string_temp = POP_FAILURE_POINTER (); \ if (string_temp != NULL) \ ! str = (const char *) string_temp; \ \ DEBUG_PRINT2 (" Popping string %p: `", str); \ DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \ DEBUG_PRINT1 ("'\n"); \ \ ! pat = (unsigned char *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" Popping pattern %p:\n", pat); \ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \ \ --- 1734,1746 ---- saved NULL, thus retaining our current position in the string. */ \ string_temp = POP_FAILURE_POINTER (); \ if (string_temp != NULL) \ ! str = (const CHAR_T *) string_temp; \ \ DEBUG_PRINT2 (" Popping string %p: `", str); \ DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \ DEBUG_PRINT1 ("'\n"); \ \ ! pat = (UCHAR_T *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" Popping pattern %p:\n", pat); \ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \ \ *************** *** 1414,1423 **** DEBUG_PRINT2 (" info: %p\n", \ reg_info[this_reg].word.pointer); \ \ ! regend[this_reg] = (const char *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \ \ ! regstart[this_reg] = (const char *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \ } \ else \ --- 1760,1769 ---- DEBUG_PRINT2 (" info: %p\n", \ reg_info[this_reg].word.pointer); \ \ ! regend[this_reg] = (const CHAR_T *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \ \ ! regstart[this_reg] = (const CHAR_T *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \ } \ else \ *************** *** 1453,1459 **** typedef union { ! fail_stack_elt_t word; struct { /* This field is one if this group can match the empty string, --- 1799,1805 ---- typedef union { ! PREFIX(fail_stack_elt_t) word; struct { /* This field is one if this group can match the empty string, *************** *** 1464,1471 **** 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) --- 1810,1818 ---- unsigned matched_something : 1; unsigned ever_matched_something : 1; } bits; ! } PREFIX(register_info_type); + #ifndef DEFINED_ONCE #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) *************** *** 1491,1541 **** } \ } \ while (0) /* Registers are set to a sentinel when they haven't yet matched. */ ! static char 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, unsigned char *loc, int arg)); ! static void store_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg1, int arg2)); ! static void insert_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, ! int arg, unsigned char *end)); ! static void insert_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc, ! int arg1, int arg2, unsigned char *end)); ! static boolean at_begline_loc_p _RE_ARGS ((const char *pattern, const char *p, reg_syntax_t syntax)); ! static boolean at_endline_loc_p _RE_ARGS ((const char *p, const char *pend, reg_syntax_t syntax)); ! static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr, ! const char *pend, ! char *translate, ! reg_syntax_t syntax, ! unsigned char *b)); /* 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'). */ #ifndef PATFETCH ! # define PATFETCH(c) \ do {if (p == pend) return REG_EEND; \ c = (unsigned char) *p++; \ if (translate) c = (unsigned char) translate[c]; \ } while (0) #endif /* Fetch the next character in the uncompiled pattern, with no translation. */ #define PATFETCH_RAW(c) \ do {if (p == pend) return REG_EEND; \ ! c = (unsigned char) *p++; \ } while (0) /* Go backwards one character in the pattern. */ --- 1838,1908 ---- } \ } \ while (0) + #endif /* not DEFINED_ONCE */ /* Registers are set to a sentinel when they haven't yet matched. */ ! static CHAR_T PREFIX(reg_unset_dummy); ! #define REG_UNSET_VALUE (&PREFIX(reg_unset_dummy)) #define REG_UNSET(e) ((e) == REG_UNSET_VALUE) /* Subroutine declarations and macros for regex_compile. */ ! static void PREFIX(store_op1) _RE_ARGS ((re_opcode_t op, UCHAR_T *loc, int arg)); ! static void PREFIX(store_op2) _RE_ARGS ((re_opcode_t op, UCHAR_T *loc, int arg1, int arg2)); ! static void PREFIX(insert_op1) _RE_ARGS ((re_opcode_t op, UCHAR_T *loc, ! int arg, UCHAR_T *end)); ! static void PREFIX(insert_op2) _RE_ARGS ((re_opcode_t op, UCHAR_T *loc, ! int arg1, int arg2, UCHAR_T *end)); ! static boolean PREFIX(at_begline_loc_p) _RE_ARGS ((const CHAR_T *pattern, const CHAR_T *p, reg_syntax_t syntax)); ! static boolean PREFIX(at_endline_loc_p) _RE_ARGS ((const CHAR_T *p, const CHAR_T *pend, reg_syntax_t syntax)); ! # ifdef WCHAR ! static reg_errcode_t wcs_compile_range _RE_ARGS ((CHAR_T range_start, ! const CHAR_T **p_ptr, ! const CHAR_T *pend, ! char *translate, ! reg_syntax_t syntax, ! UCHAR_T *b, ! CHAR_T *char_set)); ! static void insert_space _RE_ARGS ((int num, CHAR_T *loc, CHAR_T *end)); ! # else /* BYTE */ ! static reg_errcode_t byte_compile_range _RE_ARGS ((unsigned int range_start, ! const char **p_ptr, ! const char *pend, ! char *translate, ! reg_syntax_t syntax, ! unsigned char *b)); ! # endif /* WCHAR */ /* 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 WCHAR, 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 WCHAR ! # define PATFETCH(c) \ ! do {if (p == pend) return REG_EEND; \ ! c = (UCHAR_T) *p++; \ ! if (translate && (c <= 0xff)) c = (UCHAR_T) translate[c]; \ ! } while (0) ! # else /* BYTE */ ! # define PATFETCH(c) \ do {if (p == pend) return REG_EEND; \ c = (unsigned char) *p++; \ if (translate) c = (unsigned char) translate[c]; \ } while (0) + # endif /* WCHAR */ #endif /* Fetch the next character in the uncompiled pattern, with no translation. */ #define PATFETCH_RAW(c) \ do {if (p == pend) return REG_EEND; \ ! c = (UCHAR_T) *p++; \ } while (0) /* Go backwards one character in the pattern. */ *************** *** 1546,1572 **** 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. */ #ifndef TRANSLATE ! # define TRANSLATE(d) \ (translate ? (char) translate[(unsigned char) (d)] : (d)) #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 /* Make sure we have at least N more bytes of space in buffer. */ ! #define GET_BUFFER_SPACE(n) \ while ((unsigned long) (b - bufp->buffer + (n)) > bufp->allocated) \ EXTEND_BUFFER () /* 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++ = (unsigned char) (c); \ } while (0) --- 1913,1955 ---- 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 WCHAR, 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 WCHAR ! # define TRANSLATE(d) \ ! ((translate && ((UCHAR_T) (d)) <= 0xff) \ ! ? (char) translate[(unsigned char) (d)] : (d)) ! # else /* BYTE */ ! # define TRANSLATE(d) \ (translate ? (char) translate[(unsigned char) (d)] : (d)) + # endif /* WCHAR */ #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(UCHAR_T)) /* Make sure we have at least N more bytes of space in buffer. */ ! # ifdef WCHAR ! # define GET_BUFFER_SPACE(n) \ ! while (((unsigned long)b - (unsigned long)COMPILED_BUFFER_VAR \ ! + (n)*sizeof(CHAR_T)) > bufp->allocated) \ ! EXTEND_BUFFER () ! # else /* BYTE */ ! # define GET_BUFFER_SPACE(n) \ while ((unsigned long) (b - bufp->buffer + (n)) > bufp->allocated) \ EXTEND_BUFFER () + # endif /* WCHAR */ /* 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++ = (UCHAR_T) (c); \ } while (0) *************** *** 1574,1581 **** #define BUF_PUSH_2(c1, c2) \ do { \ GET_BUFFER_SPACE (2); \ ! *b++ = (unsigned char) (c1); \ ! *b++ = (unsigned char) (c2); \ } while (0) --- 1957,1964 ---- #define BUF_PUSH_2(c1, c2) \ do { \ GET_BUFFER_SPACE (2); \ ! *b++ = (UCHAR_T) (c1); \ ! *b++ = (UCHAR_T) (c2); \ } while (0) *************** *** 1583,1610 **** #define BUF_PUSH_3(c1, c2, c3) \ do { \ GET_BUFFER_SPACE (3); \ ! *b++ = (unsigned char) (c1); \ ! *b++ = (unsigned char) (c2); \ ! *b++ = (unsigned char) (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) - 3)) /* Likewise, for a two-argument jump. */ #define STORE_JUMP2(op, loc, to, arg) \ ! store_op2 (op, loc, (int) ((to) - (loc) - 3), 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) - 3), 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) - 3), arg, b) /* This is not an arbitrary limit: the arguments which represent offsets --- 1966,1993 ---- #define BUF_PUSH_3(c1, c2, c3) \ do { \ GET_BUFFER_SPACE (3); \ ! *b++ = (UCHAR_T) (c1); \ ! *b++ = (UCHAR_T) (c2); \ ! *b++ = (UCHAR_T) (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) \ ! PREFIX(store_op1) (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE))) /* Likewise, for a two-argument jump. */ #define STORE_JUMP2(op, loc, to, arg) \ ! PREFIX(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) \ ! PREFIX(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) \ ! PREFIX(insert_op2) (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)), arg, b) /* This is not an arbitrary limit: the arguments which represent offsets *************** *** 1615,1620 **** --- 1998,2004 ---- 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!! */ + #ifndef DEFINED_ONCE #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, *************** *** 1650,1683 **** # define MOVE_BUFFER_POINTER(P) (P) += incr # define ELSE_EXTEND_BUFFER_HIGH_BOUND #endif ! #define EXTEND_BUFFER() \ ! do { \ ! unsigned char *old_buffer = bufp->buffer; \ ! 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 = (unsigned char *) REALLOC (bufp->buffer, bufp->allocated);\ ! if (bufp->buffer == NULL) \ return REG_ESPACE; \ /* If the buffer moved, move all the pointers into it. */ \ ! if (old_buffer != bufp->buffer) \ { \ ! int incr = bufp->buffer - 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) ! /* 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. */ --- 2034,2105 ---- # define MOVE_BUFFER_POINTER(P) (P) += incr # define ELSE_EXTEND_BUFFER_HIGH_BOUND #endif ! #endif /* not DEFINED_ONCE */ ! # ifdef WCHAR ! # define EXTEND_BUFFER() \ ! do { \ ! UCHAR_T *old_buffer = COMPILED_BUFFER_VAR; \ ! int wchar_count; \ ! if (bufp->allocated + sizeof(UCHAR_T) > 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(UCHAR_T); \ ! if (wchar_count == 0) wchar_count = 1; \ ! /* Truncate the buffer to CHAR_T align. */ \ ! bufp->allocated = wchar_count * sizeof(UCHAR_T); \ ! RETALLOC (COMPILED_BUFFER_VAR, wchar_count, UCHAR_T); \ ! 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 /* BYTE */ ! # define EXTEND_BUFFER() \ ! do { \ ! UCHAR_T *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 = (UCHAR_T *) 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 /* WCHAR */ ! #ifndef DEFINED_ONCE /* 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. */ *************** *** 1721,1732 **** --- 2143,2157 ---- /* The next available element. */ #define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail]) + #endif /* not DEFINED_ONCE */ /* Set the bit for character C in a list. */ + #ifndef DEFINED_ONCE #define SET_LIST_BIT(c) \ (b[((unsigned char) (c)) / BYTEWIDTH] \ |= 1 << (((unsigned char) c) % BYTEWIDTH)) + #endif /* DEFINED_ONCE */ /* Get the next unsigned number in the uncompiled pattern. */ #define GET_UNSIGNED_NUMBER(num) \ *************** *** 1745,1750 **** --- 2170,2176 ---- } \ } + #ifndef DEFINED_ONCE #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. */ *************** *** 1772,1777 **** --- 2198,2204 ---- || STREQ (string, "punct") || STREQ (string, "graph") \ || STREQ (string, "cntrl") || STREQ (string, "blank")) #endif + #endif /* DEFINED_ONCE */ #ifndef MATCH_MAY_ALLOCATE *************** *** 1782,1806 **** 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) --- 2209,2236 ---- The register vectors, we adjust in size each time we compile a regexp, according to the number of registers it needs. */ ! static PREFIX(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. */ + #ifdef DEFINED_ONCE 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 const char **reg_dummy; ! #endif /* DEFINED_ONCE */ ! ! static PREFIX(register_info_type) *PREFIX(reg_info); ! static PREFIX(register_info_type) *PREFIX(reg_info_dummy); /* Make the register vectors big enough for NUM_REGS registers, but don't make them smaller. */ ! static void ! PREFIX(regex_grow_registers) (num_regs) int num_regs; { if (num_regs > regs_allocated_size) *************** *** 1811,1819 **** 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; } --- 2241,2249 ---- 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 (PREFIX(reg_info), num_regs, PREFIX(register_info_type)); RETALLOC_IF (reg_dummy, num_regs, const char *); ! RETALLOC_IF (PREFIX(reg_info_dummy), num_regs, PREFIX(register_info_type)); regs_allocated_size = num_regs; } *************** *** 1821,1829 **** --- 2251,2261 ---- #endif /* not MATCH_MAY_ALLOCATE */ + #ifndef DEFINED_ONCE static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type compile_stack, regnum_t regnum)); + #endif /* not DEFINED_ONCE */ /* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX. Returns one of error codes defined in `regex.h', or zero for success. *************** *** 1844,1876 **** examined nor set. */ /* Return, freeing storage we allocated. */ ! #define FREE_STACK_RETURN(value) \ return (free (compile_stack.stack), value) static reg_errcode_t ! regex_compile (pattern, size, syntax, bufp) ! const char *pattern; ! size_t size; 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 unsigned char c, c1; /* A random temporary spot in PATTERN. */ ! const char *p1; /* Points to the end of the buffer, where we should append. */ ! register unsigned char *b; /* Keeps track of unclosed groups. */ compile_stack_type compile_stack; /* Points to the current (ending) position in the pattern. */ ! const char *p = pattern; ! const char *pend = pattern + size; /* How to translate the characters in the pattern. */ RE_TRANSLATE_TYPE translate = bufp->translate; --- 2276,2330 ---- examined nor set. */ /* Return, freeing storage we allocated. */ ! # ifdef WCHAR ! # 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 /* WCHAR */ static reg_errcode_t ! PREFIX(regex_compile) (ARG_PREFIX(pattern), ARG_PREFIX(size), syntax, bufp) ! const char *ARG_PREFIX(pattern); ! size_t ARG_PREFIX(size); 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 UCHAR_T c, c1; ! ! #ifdef WCHAR ! /* A temporary space to keep wchar_t pattern and compiled pattern. */ ! CHAR_T *pattern, *COMPILED_BUFFER_VAR; ! size_t size; ! /* offset buffer for optimization. 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 /* WCHAR */ /* A random temporary spot in PATTERN. */ ! const CHAR_T *p1; /* Points to the end of the buffer, where we should append. */ ! register UCHAR_T *b; /* Keeps track of unclosed groups. */ compile_stack_type compile_stack; /* Points to the current (ending) position in the pattern. */ ! #ifdef WCHAR ! const CHAR_T *p; ! const CHAR_T *pend; ! #else /* BYTE */ ! const CHAR_T *p = pattern; ! const CHAR_T *pend = pattern + size; ! #endif /* WCHAR */ /* How to translate the characters in the pattern. */ RE_TRANSLATE_TYPE translate = bufp->translate; *************** *** 1879,1908 **** 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. */ ! unsigned char *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. */ ! unsigned char *laststart = 0; /* Address of beginning of regexp, or inside of last group. */ ! unsigned char *begalt; /* Place in the uncompiled pattern (i.e., the {) to which to go back if the interval is invalid. */ ! const char *beg_interval; /* 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. */ ! unsigned char *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 DEBUG DEBUG_PRINT1 ("\nCompiling pattern: "); if (debug) --- 2333,2386 ---- 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. */ ! UCHAR_T *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. */ ! UCHAR_T *laststart = 0; /* Address of beginning of regexp, or inside of last group. */ ! UCHAR_T *begalt; /* Place in the uncompiled pattern (i.e., the {) to which to go back if the interval is invalid. */ ! const CHAR_T *beg_interval; /* 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. */ ! UCHAR_T *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 WCHAR + /* Initialize the wchar_t PATTERN and offset_buffer. */ + p = pend = pattern = TALLOC(csize + 1, CHAR_T); + mbs_offset = TALLOC(csize + 1, int); + is_binary = TALLOC(csize + 1, char); + if (pattern == NULL || mbs_offset == NULL || is_binary == NULL) + { + free(pattern); + free(mbs_offset); + free(is_binary); + return REG_ESPACE; + } + pattern[csize] = L'\0'; /* sentinel */ + size = convert_mbs_to_wcs(pattern, cpattern, csize, mbs_offset, is_binary); + pend = p + size; + if (size < 0) + { + free(pattern); + free(mbs_offset); + free(is_binary); + return REG_BADPAT; + } + #endif + #ifdef DEBUG DEBUG_PRINT1 ("\nCompiling pattern: "); if (debug) *************** *** 1910,1916 **** unsigned debug_count; for (debug_count = 0; debug_count < size; debug_count++) ! putchar (pattern[debug_count]); putchar ('\n'); } #endif /* DEBUG */ --- 2388,2394 ---- unsigned debug_count; for (debug_count = 0; debug_count < size; debug_count++) ! PUT_CHAR (pattern[debug_count]); putchar ('\n'); } #endif /* DEBUG */ *************** *** 1918,1924 **** /* Initialize the compile stack. */ compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t); if (compile_stack.stack == NULL) ! return REG_ESPACE; compile_stack.size = INIT_COMPILE_STACK_SIZE; compile_stack.avail = 0; --- 2396,2410 ---- /* Initialize the compile stack. */ compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t); if (compile_stack.stack == NULL) ! { ! #ifdef WCHAR ! free(pattern); ! free(mbs_offset); ! free(is_binary); ! #endif ! return REG_ESPACE; ! } ! compile_stack.size = INIT_COMPILE_STACK_SIZE; compile_stack.avail = 0; *************** *** 1947,1964 **** { /* 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. */ ! RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char); } else { /* Caller did not allocate a buffer. Do it for them. */ ! bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char); } ! if (!bufp->buffer) FREE_STACK_RETURN (REG_ESPACE); bufp->allocated = INIT_BUF_SIZE; } ! begalt = b = bufp->buffer; /* Loop through the uncompiled pattern until we're at the end. */ while (p != pend) --- 2433,2466 ---- { /* 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 WCHAR ! /* Free bufp->buffer and allocate an array for wchar_t pattern ! buffer. */ ! free(bufp->buffer); ! COMPILED_BUFFER_VAR = TALLOC (INIT_BUF_SIZE/sizeof(UCHAR_T), ! UCHAR_T); ! #else ! RETALLOC (COMPILED_BUFFER_VAR, INIT_BUF_SIZE, UCHAR_T); ! #endif /* WCHAR */ } else { /* Caller did not allocate a buffer. Do it for them. */ ! COMPILED_BUFFER_VAR = TALLOC (INIT_BUF_SIZE / sizeof(UCHAR_T), ! UCHAR_T); } ! if (!COMPILED_BUFFER_VAR) FREE_STACK_RETURN (REG_ESPACE); ! #ifdef WCHAR ! bufp->buffer = (char*)COMPILED_BUFFER_VAR; ! #endif /* WCHAR */ bufp->allocated = INIT_BUF_SIZE; } + #ifdef WCHAR + else + COMPILED_BUFFER_VAR = (UCHAR_T*) bufp->buffer; + #endif ! begalt = b = COMPILED_BUFFER_VAR; /* Loop through the uncompiled pattern until we're at the end. */ while (p != pend) *************** *** 1974,1980 **** /* 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; --- 2476,2482 ---- /* If context independent, it's an operator. */ || syntax & RE_CONTEXT_INDEP_ANCHORS /* Otherwise, depends on what's come before. */ ! || PREFIX(at_begline_loc_p) (pattern, p, syntax)) BUF_PUSH (begline); else goto normal_char; *************** *** 1989,1995 **** /* 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; --- 2491,2497 ---- /* If context independent, it's an operator. */ || syntax & RE_CONTEXT_INDEP_ANCHORS /* Otherwise, depends on what's next. */ ! || PREFIX(at_endline_loc_p) (p, pend, syntax)) BUF_PUSH (endline); else goto normal_char; *************** *** 2083,2089 **** assert (p - 1 > pattern); /* Allocate the space for the jump. */ ! GET_BUFFER_SPACE (3); /* We know we are not at the first character of the pattern, because laststart was nonzero. And we've already --- 2585,2591 ---- 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 *************** *** 2100,2119 **** } else /* Anything else. */ ! STORE_JUMP (maybe_pop_jump, b, laststart - 3); /* We've added more stuff to the buffer. */ ! b += 3; } /* On failure, jump from laststart to b + 3, which will be the end of the buffer after this jump is inserted. */ ! GET_BUFFER_SPACE (3); INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump : on_failure_jump, ! laststart, b + 3); pending_exact = 0; ! b += 3; if (!zero_times_ok) { --- 2602,2624 ---- } 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 WCHAR, '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) { *************** *** 2122,2130 **** `on_failure_jump' instruction of the loop. This effects a skip over that instruction the first time we hit that loop. */ ! GET_BUFFER_SPACE (3); ! INSERT_JUMP (dummy_failure_jump, laststart, laststart + 6); ! b += 3; } } break; --- 2627,2636 ---- `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; *************** *** 2139,2147 **** case '[': { boolean had_char_class = false; ! if (p == pend) FREE_STACK_RETURN (REG_EBRACK); /* 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); --- 2645,2987 ---- case '[': { boolean had_char_class = false; ! #ifdef WCHAR ! CHAR_T range_start = 0xffffffff; ! #else ! unsigned int range_start = 0xffffffff; ! #endif if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + #ifdef WCHAR + /* 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 = wcs_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 = wcs_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; + unsigned long int 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 = ((unsigned long int)(laststart + 6 + laststart[1]) + + __alignof__(wctype_t) - 1) + & ~(unsigned long int)(__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_T str[128]; /* Should be large enough. */ + CHAR_T delim = *p; /* '=' or '.' */ + 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; + + if (c1 != 1) + FREE_STACK_RETURN (REG_ECOLLATE); + + /* 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 /* BYTE */ /* 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); *************** *** 2182,2187 **** --- 3022,3028 ---- PATFETCH (c1); SET_LIST_BIT (c1); + range_start = c1; continue; } *************** *** 2206,2213 **** && *p != ']') { reg_errcode_t ret ! = compile_range (&p, pend, translate, syntax, b); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); } else if (p[0] == '-' && p[1] != ']') --- 3047,3056 ---- && *p != ']') { reg_errcode_t ret ! = byte_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] != ']') *************** *** 2217,2224 **** /* Move past the `-'. */ PATFETCH (c1); ! ret = compile_range (&p, pend, translate, syntax, b); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); } /* See if we're at the beginning of a possible character --- 3060,3068 ---- /* Move past the `-'. */ PATFETCH (c1); ! ret = byte_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 *************** *** 2341,2346 **** --- 3185,3303 ---- 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]; + + 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. */ + { + 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]); + } + 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. */ + + 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. */ + { + 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]; + } + had_char_class = false; + } + else + { + c1++; + while (c1--) + PATUNFETCH; + SET_LIST_BIT ('['); + SET_LIST_BIT ('.'); + range_start = '.'; had_char_class = false; } } *************** *** 2348,2353 **** --- 3305,3311 ---- { had_char_class = false; SET_LIST_BIT (c); + range_start = c; } } *************** *** 2356,2361 **** --- 3314,3320 ---- while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) b[-1]--; b += b[-1]; + #endif /* WCHAR */ } break; *************** *** 2426,2435 **** 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 - bufp->buffer; COMPILE_STACK_TOP.fixup_alt_jump ! = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0; ! COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer; COMPILE_STACK_TOP.regnum = regnum; /* We will eventually replace the 0 with the number of --- 3385,3394 ---- 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 *************** *** 2438,2444 **** represent in the compiled pattern. */ if (regnum <= MAX_REGNUM) { ! COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2; BUF_PUSH_3 (start_memory, regnum, 0); } --- 3397,3404 ---- 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); } *************** *** 2497,2508 **** regnum_t this_group_regnum; compile_stack.avail--; ! begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset; fixup_alt_jump = COMPILE_STACK_TOP.fixup_alt_jump ! ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1 : 0; ! laststart = bufp->buffer + 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 --- 3457,3468 ---- 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 *************** *** 2513,2520 **** groups were inside this one. */ if (this_group_regnum <= MAX_REGNUM) { ! unsigned char *inner_group_loc ! = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset; *inner_group_loc = regnum - this_group_regnum; BUF_PUSH_3 (stop_memory, this_group_regnum, --- 3473,3480 ---- groups were inside this one. */ if (this_group_regnum <= MAX_REGNUM) { ! UCHAR_T *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, *************** *** 2533,2542 **** /* Insert before the previous alternative a jump which jumps to this alternative if the former fails. */ ! GET_BUFFER_SPACE (3); ! INSERT_JUMP (on_failure_jump, begalt, b + 6); pending_exact = 0; ! b += 3; /* The alternative before this one has a jump after it which gets executed if it gets matched. Adjust that --- 3493,3503 ---- /* 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 *************** *** 2561,2568 **** 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 (3); ! b += 3; laststart = 0; begalt = b; --- 3522,3529 ---- 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; *************** *** 2646,2656 **** /* 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. */ if (upper_bound == 0) { ! GET_BUFFER_SPACE (3); ! INSERT_JUMP (jump, laststart, b + 3); ! b += 3; } /* Otherwise, we have a nontrivial interval. When --- 3607,3619 ---- /* 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 WCHAR, '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 *************** *** 2665,2671 **** else { /* If the upper bound is > 1, we need to insert more at the end of the loop. */ ! unsigned nbytes = 10 + (upper_bound > 1) * 10; GET_BUFFER_SPACE (nbytes); --- 3628,3635 ---- 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); *************** *** 2675,2690 **** because `re_compile_fastmap' needs to know. Jump to the `jump_n' we might insert below. */ INSERT_JUMP2 (succeed_n, laststart, ! b + 5 + (upper_bound > 1) * 5, lower_bound); ! b += 5; /* 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'. */ ! insert_op2 (set_number_at, laststart, 5, lower_bound, b); ! b += 5; if (upper_bound > 1) { /* More than one repetition is allowed, so --- 3639,3659 ---- 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 WCHAR, The '1+2*OFFSET_ADDRESS_SIZE' ! is the 'set_number_at', plus '1+OFFSET_ADDRESS_SIZE' ! of the following `succeed_n'. */ ! PREFIX(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 *************** *** 2694,2702 **** 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 + 5, upper_bound - 1); ! b += 5; /* The location we want to set is the second parameter of the `jump_n'; that is `b-2' as --- 3663,3672 ---- 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 + ! 1 + 2 * OFFSET_ADDRESS_SIZE, 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 *************** *** 2712,2720 **** 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 += 5; } } pending_exact = 0; --- 3682,3691 ---- We insert this at the beginning of the loop so that if we fail during matching, we'll reinitialize the bounds. */ ! PREFIX(insert_op2) (set_number_at, laststart, ! b - laststart, ! upper_bound - 1, b); ! b += 1 + 2 * OFFSET_ADDRESS_SIZE; } } pending_exact = 0; *************** *** 2853,2858 **** --- 3824,3834 ---- normal_char: /* If no exactn currently being built. */ if (!pending_exact + #ifdef WCHAR + /* If last exactn handle binary(or character) and + new exactn handle character(or binary). */ + || is_exactn_bin != is_binary[p - 1 - pattern] + #endif /* WCHAR */ /* If last exactn not at current position. */ || pending_exact + *pending_exact + 1 != b *************** *** 2874,2880 **** --- 3850,3865 ---- laststart = b; + #ifdef WCHAR + /* 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 /* WCHAR */ pending_exact = b - 1; } *************** *** 2898,2913 **** if (syntax & RE_NO_POSIX_BACKTRACKING) BUF_PUSH (succeed); free (compile_stack.stack); /* We have succeeded; set the length of the buffer. */ bufp->used = b - bufp->buffer; #ifdef DEBUG if (debug) { DEBUG_PRINT1 ("\nCompiled pattern: \n"); ! print_compiled_pattern (bufp); } #endif /* DEBUG */ --- 3883,3907 ---- if (syntax & RE_NO_POSIX_BACKTRACKING) BUF_PUSH (succeed); + #ifdef WCHAR + free (pattern); + free (mbs_offset); + free (is_binary); + #endif free (compile_stack.stack); /* We have succeeded; set the length of the buffer. */ + #ifdef WCHAR + bufp->used = (unsigned long int) b - (unsigned long int) COMPILED_BUFFER_VAR; + #else bufp->used = b - bufp->buffer; + #endif #ifdef DEBUG if (debug) { DEBUG_PRINT1 ("\nCompiled pattern: \n"); ! PREFIX(print_compiled_pattern) (bufp); } #endif /* DEBUG */ *************** *** 2928,2954 **** # 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 */ --- 3922,3948 ---- # ifdef emacs if (! fail_stack.stack) fail_stack.stack ! = (PREFIX(fail_stack_elt_t) *) xmalloc (fail_stack.size ! * sizeof (PREFIX(fail_stack_elt_t))); else fail_stack.stack ! = (PREFIX(fail_stack_elt_t) *) xrealloc (fail_stack.stack, (fail_stack.size ! * sizeof (PREFIX(fail_stack_elt_t)))); # else /* not emacs */ if (! fail_stack.stack) fail_stack.stack ! = (PREFIX(fail_stack_elt_t) *) malloc (fail_stack.size ! * sizeof (PREFIX(fail_stack_elt_t))); else fail_stack.stack ! = (PREFIX(fail_stack_elt_t) *) realloc (fail_stack.stack, (fail_stack.size ! * sizeof (PREFIX(fail_stack_elt_t)))); # endif /* not emacs */ } ! PREFIX(regex_grow_registers (num_regs)); } #endif /* not MATCH_MAY_ALLOCATE */ *************** *** 2958,3025 **** /* Subroutines for `regex_compile'. */ /* Store OP at LOC followed by two-byte integer parameter ARG. */ static void ! store_op1 (op, loc, arg) re_opcode_t op; ! unsigned char *loc; int arg; { ! *loc = (unsigned char) op; STORE_NUMBER (loc + 1, arg); } /* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */ static void ! store_op2 (op, loc, arg1, arg2) re_opcode_t op; ! unsigned char *loc; int arg1, arg2; { ! *loc = (unsigned char) op; STORE_NUMBER (loc + 1, arg1); ! STORE_NUMBER (loc + 3, 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. */ static void ! insert_op1 (op, loc, arg, end) re_opcode_t op; ! unsigned char *loc; int arg; ! unsigned char *end; { ! register unsigned char *pfrom = end; ! register unsigned char *pto = end + 3; while (pfrom != loc) *--pto = *--pfrom; ! store_op1 (op, loc, arg); } /* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */ static void ! insert_op2 (op, loc, arg1, arg2, end) re_opcode_t op; ! unsigned char *loc; int arg1, arg2; ! unsigned char *end; { ! register unsigned char *pfrom = end; ! register unsigned char *pto = end + 5; while (pfrom != loc) *--pto = *--pfrom; ! store_op2 (op, loc, arg1, arg2); } --- 3952,4023 ---- /* Subroutines for `regex_compile'. */ /* Store OP at LOC followed by two-byte integer parameter ARG. */ + /* ifdef WCHAR, integer parameter is 1 wchar_t. */ static void ! PREFIX(store_op1) (op, loc, arg) re_opcode_t op; ! UCHAR_T *loc; int arg; { ! *loc = (UCHAR_T) op; STORE_NUMBER (loc + 1, arg); } /* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */ + /* ifdef WCHAR, integer parameter is 1 wchar_t. */ static void ! PREFIX(store_op2) (op, loc, arg1, arg2) re_opcode_t op; ! UCHAR_T *loc; int arg1, arg2; { ! *loc = (UCHAR_T) 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 WCHAR, integer parameter is 1 wchar_t. */ static void ! PREFIX(insert_op1) (op, loc, arg, end) re_opcode_t op; ! UCHAR_T *loc; int arg; ! UCHAR_T *end; { ! register UCHAR_T *pfrom = end; ! register UCHAR_T *pto = end + 1 + OFFSET_ADDRESS_SIZE; while (pfrom != loc) *--pto = *--pfrom; ! PREFIX(store_op1) (op, loc, arg); } /* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */ + /* ifdef WCHAR, integer parameter is 1 wchar_t. */ static void ! PREFIX(insert_op2) (op, loc, arg1, arg2, end) re_opcode_t op; ! UCHAR_T *loc; int arg1, arg2; ! UCHAR_T *end; { ! register UCHAR_T *pfrom = end; ! register UCHAR_T *pto = end + 1 + 2 * OFFSET_ADDRESS_SIZE; while (pfrom != loc) *--pto = *--pfrom; ! PREFIX(store_op2) (op, loc, arg1, arg2); } *************** *** 3028,3038 **** least one character before the ^. */ static boolean ! at_begline_loc_p (pattern, p, syntax) ! const char *pattern, *p; reg_syntax_t syntax; { ! const char *prev = p - 2; boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; return --- 4026,4036 ---- least one character before the ^. */ static boolean ! PREFIX(at_begline_loc_p) (pattern, p, syntax) ! const CHAR_T *pattern, *p; reg_syntax_t syntax; { ! const CHAR_T *prev = p - 2; boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; return *************** *** 3047,3059 **** at least one character after the $, i.e., `P < PEND'. */ static boolean ! at_endline_loc_p (p, pend, syntax) ! const char *p, *pend; reg_syntax_t syntax; { ! const char *next = p; boolean next_backslash = *next == '\\'; ! const char *next_next = p + 1 < pend ? p + 1 : 0; return /* Before a subexpression? */ --- 4045,4057 ---- at least one character after the $, i.e., `P < PEND'. */ static boolean ! PREFIX(at_endline_loc_p) (p, pend, syntax) ! const CHAR_T *p, *pend; reg_syntax_t syntax; { ! const CHAR_T *next = p; boolean next_backslash = *next == '\\'; ! const CHAR_T *next_next = p + 1 < pend ? p + 1 : 0; return /* Before a subexpression? */ *************** *** 3064,3069 **** --- 4062,4068 ---- : next_backslash && next_next && *next_next == '|'); } + #else /* not INSIDE_RECURSION */ /* Returns true if REGNUM is in one of COMPILE_STACK's elements and false if it's not. */ *************** *** 3084,3090 **** --- 4083,4145 ---- return false; } + #endif /* not INSIDE_RECURSION */ + + #ifdef INSIDE_RECURSION + + #ifdef WCHAR + /* 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_T *loc; + CHAR_T *end; + { + register CHAR_T *pto = end; + register CHAR_T *pfrom = end - num; + + while (pfrom >= loc) + *pto-- = *pfrom--; + } + #endif /* WCHAR */ + + #ifdef WCHAR + static reg_errcode_t + wcs_compile_range (range_start_char, p_ptr, pend, translate, syntax, b, + char_set) + CHAR_T range_start_char; + const CHAR_T **p_ptr, *pend; + CHAR_T *char_set, *b; + RE_TRANSLATE_TYPE translate; + reg_syntax_t syntax; + { + const CHAR_T *p = *p_ptr; + CHAR_T range_start, range_end; + reg_errcode_t ret; + if (p == pend) + return REG_ERANGE; + + 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 /* BYTE */ /* 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 `-'.) *************** *** 3095,3146 **** We use these short variable names so we can use the same macros as `regex_compile' itself. */ - static reg_errcode_t ! compile_range (p_ptr, pend, translate, syntax, b) ! const char **p_ptr, *pend; ! RE_TRANSLATE_TYPE translate; ! reg_syntax_t syntax; ! unsigned char *b; { unsigned this_char; const char *p = *p_ptr; ! unsigned int range_start, range_end; if (p == pend) return REG_ERANGE; - /* Even though the pattern is a signed `char *', we need to fetch - with unsigned char *'s; if the high bit of the pattern character - is set, the range endpoints will be negative if we fetch using a - signed char *. - - We also want to fetch the endpoints without translating them; the - appropriate translation is done in the bit-setting loop below. */ - /* The SVR4 compiler on the 3B2 had trouble with unsigned const char *. */ - range_start = ((const unsigned char *) p)[-2]; - range_end = ((const unsigned char *) p)[0]; - /* Have to increment the pointer into the pattern string, so the caller isn't still at the ending character. */ (*p_ptr)++; ! /* If the start is after the end, the range is empty. */ ! if (range_start > range_end) ! return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR; /* Here we see why `this_char' has to be larger than an `unsigned ! char' -- the range is inclusive, so if `range_end' == 0xff ! (assuming 8-bit characters), we would otherwise go into an infinite ! loop, since all characters <= 0xff. */ ! for (this_char = range_start; this_char <= range_end; this_char++) { SET_LIST_BIT (TRANSLATE (this_char)); } ! return REG_NOERROR; } /* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible --- 4150,4200 ---- We use these short variable names so we can use the same macros as `regex_compile' itself. */ static reg_errcode_t ! byte_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; ! unsigned end_char; ! 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; /* 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; } ! return ret; } + # endif /* WCHAR */ /* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible *************** *** 3155,3181 **** Returns 0 if we succeed, -2 if an internal error. */ ! 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; ! unsigned char *pattern = bufp->buffer; ! unsigned char *p = pattern; ! register unsigned char *pend = pattern + bufp->used; #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 --- 4209,4258 ---- Returns 0 if we succeed, -2 if an internal error. */ ! #ifdef WCHAR ! /* local function for re_compile_fastmap. ! truncate wchar_t character to char. */ ! static unsigned char truncate_wchar (CHAR_T c); ! ! static unsigned char ! truncate_wchar (c) ! CHAR_T c; ! { ! unsigned char buf[MB_LEN_MAX]; ! int retval = wctomb(buf, c); ! return retval > 0 ? buf[0] : (unsigned char)c; ! } ! #endif /* WCHAR */ ! ! static int ! PREFIX(re_compile_fastmap) (bufp) struct re_pattern_buffer *bufp; { int j, k; #ifdef MATCH_MAY_ALLOCATE ! PREFIX(fail_stack_type) fail_stack; #endif #ifndef REGEX_MALLOC char *destination; #endif register char *fastmap = bufp->fastmap; ! ! #ifdef WCHAR ! /* We need to cast pattern to (wchar_t*), because we casted this compiled ! pattern to (char*) in regex_compile. */ ! UCHAR_T *pattern = (UCHAR_T*)bufp->buffer; ! register UCHAR_T *pend = (UCHAR_T*) (bufp->buffer + bufp->used); ! #else /* BYTE */ ! UCHAR_T *pattern = bufp->buffer; ! register UCHAR_T *pend = pattern + bufp->used; ! #endif /* WCHAR */ ! UCHAR_T *p = pattern; #ifdef REL_ALLOC /* This holds the pointer to the failure stack, when it is allocated relocatably. */ ! PREFIX(fail_stack_elt_t) *failure_stack_ptr; #endif /* Assume that each path through the pattern can be null until *************** *** 3233,3243 **** --- 4310,4341 ---- /* Following are the cases which match a character. These end with `break'. */ + #ifdef WCHAR + case exactn: + fastmap[truncate_wchar(p[1])] = 1; + break; + #else /* BYTE */ case exactn: fastmap[p[1]] = 1; break; + #endif /* WCHAR */ + #ifdef MBS_SUPPORT + case exactn_bin: + fastmap[p[1]] = 1; + break; + #endif + #ifdef WCHAR + /* 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 /* BYTE */ case charset: for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))) *************** *** 3268,3273 **** --- 4366,4372 ---- if (SYNTAX (j) != Sword) fastmap[j] = 1; break; + #endif /* WCHAR */ case anychar: *************** *** 3398,3410 **** case succeed_n: /* Get to the number of times to succeed. */ ! p += 2; /* Increment p past the n for when k != 0. */ EXTRACT_NUMBER_AND_INCR (k, p); if (k == 0) { ! p -= 4; succeed_n_p = true; /* Spaghetti code alert. */ goto handle_on_failure_jump; } --- 4497,4509 ---- 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; } *************** *** 3412,3418 **** case set_number_at: ! p += 4; continue; --- 4511,4517 ---- case set_number_at: ! p += 2 * OFFSET_ADDRESS_SIZE; continue; *************** *** 3443,3448 **** --- 4542,4561 ---- done: RESET_FAIL_STACK (); return 0; + } + + #else /* not INSIDE_RECURSION */ + + int + re_compile_fastmap (bufp) + struct re_pattern_buffer *bufp; + { + # ifdef MBS_SUPPORT + if (MB_CUR_MAX != 1) + return wcs_re_compile_fastmap(bufp); + else + # endif + return byte_re_compile_fastmap(bufp); } /* re_compile_fastmap */ #ifdef _LIBC weak_alias (__re_compile_fastmap, re_compile_fastmap) *************** *** 3537,3547 **** --- 4650,4733 ---- struct re_registers *regs; int stop; { + # ifdef MBS_SUPPORT + if (MB_CUR_MAX != 1) + return wcs_re_search_2 (bufp, string1, size1, string2, size2, startpos, + range, regs, stop); + else + # endif + return byte_re_search_2 (bufp, string1, size1, string2, size2, startpos, + range, regs, stop); + } /* re_search_2 */ + #ifdef _LIBC + weak_alias (__re_search_2, re_search_2) + #endif + + #endif /* not INSIDE_RECURSION */ + + #ifdef INSIDE_RECURSION + + #ifdef MATCH_MAY_ALLOCATE + # define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL + #else + # define FREE_VAR(var) if (var) free (var); var = NULL + #endif + + #ifdef WCHAR + # define MAX_ALLOCA_SIZE 2000 + + # define FREE_WCS_BUFFERS() \ + do { \ + if (size1 > MAX_ALLOCA_SIZE) \ + { \ + free (wcs_string1); \ + free (mbs_offset1); \ + } \ + else \ + { \ + FREE_VAR (wcs_string1); \ + FREE_VAR (mbs_offset1); \ + } \ + if (size2 > MAX_ALLOCA_SIZE) \ + { \ + free (wcs_string2); \ + free (mbs_offset2); \ + } \ + else \ + { \ + FREE_VAR (wcs_string2); \ + FREE_VAR (mbs_offset2); \ + } \ + } while (0) + + #endif + + static int + PREFIX(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; + #ifdef WCHAR + /* We need wchar_t* buffers correspond to cstring1, cstring2. */ + wchar_t *wcs_string1 = NULL, *wcs_string2 = NULL; + /* We need the size of wchar_t buffers correspond to csize1, csize2. */ + int wcs_size1 = 0, wcs_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 /* WCHAR */ /* Check for out-of-range STARTPOS. */ if (startpos < 0 || startpos > total_size) *************** *** 3585,3590 **** --- 4771,4850 ---- if (re_compile_fastmap (bufp) == -2) return -2; + #ifdef WCHAR + /* Allocate wchar_t array for wcs_string1 and wcs_string2 and + fill them with converted string. */ + if (size1 != 0) + { + if (size1 > MAX_ALLOCA_SIZE) + { + wcs_string1 = TALLOC (size1 + 1, CHAR_T); + mbs_offset1 = TALLOC (size1 + 1, int); + is_binary = TALLOC (size1 + 1, char); + } + else + { + wcs_string1 = REGEX_TALLOC (size1 + 1, CHAR_T); + mbs_offset1 = REGEX_TALLOC (size1 + 1, int); + is_binary = REGEX_TALLOC (size1 + 1, char); + } + if (!wcs_string1 || !mbs_offset1 || !is_binary) + { + if (size1 > MAX_ALLOCA_SIZE) + { + free (wcs_string1); + free (mbs_offset1); + free (is_binary); + } + else + { + FREE_VAR (wcs_string1); + FREE_VAR (mbs_offset1); + FREE_VAR (is_binary); + } + return -2; + } + wcs_size1 = convert_mbs_to_wcs(wcs_string1, string1, size1, + mbs_offset1, is_binary); + wcs_string1[wcs_size1] = L'\0'; /* for a sentinel */ + if (size1 > MAX_ALLOCA_SIZE) + free (is_binary); + else + FREE_VAR (is_binary); + } + if (size2 != 0) + { + if (size2 > MAX_ALLOCA_SIZE) + { + wcs_string2 = TALLOC (size2 + 1, CHAR_T); + mbs_offset2 = TALLOC (size2 + 1, int); + is_binary = TALLOC (size2 + 1, char); + } + else + { + wcs_string2 = REGEX_TALLOC (size2 + 1, CHAR_T); + mbs_offset2 = REGEX_TALLOC (size2 + 1, int); + is_binary = REGEX_TALLOC (size2 + 1, char); + } + if (!wcs_string2 || !mbs_offset2 || !is_binary) + { + FREE_WCS_BUFFERS (); + if (size2 > MAX_ALLOCA_SIZE) + free (is_binary); + else + FREE_VAR (is_binary); + return -2; + } + wcs_size2 = convert_mbs_to_wcs(wcs_string2, string2, size2, + mbs_offset2, is_binary); + wcs_string2[wcs_size2] = L'\0'; /* for a sentinel */ + if (size2 > MAX_ALLOCA_SIZE) + free (is_binary); + else + FREE_VAR (is_binary); + } + #endif /* WCHAR */ + /* Loop through the string, looking for a place to start matching. */ for (;;) { *************** *** 3620,3628 **** } else /* Searching backwards. */ { ! register char c = (size1 == 0 || startpos >= size1 ! ? string2[startpos - size1] ! : string1[startpos]); if (!fastmap[(unsigned char) TRANSLATE (c)]) goto advance; --- 4880,4888 ---- } else /* Searching backwards. */ { ! register CHAR_T c = (size1 == 0 || startpos >= size1 ! ? string2[startpos - size1] ! : string1[startpos]); if (!fastmap[(unsigned char) TRANSLATE (c)]) goto advance; *************** *** 3632,3641 **** /* 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); --- 4892,4915 ---- /* 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) ! { ! #ifdef WCHAR ! FREE_WCS_BUFFERS (); ! #endif ! return -1; ! } ! ! #ifdef WCHAR ! val = wcs_re_match_2_internal (bufp, string1, size1, string2, ! size2, startpos, regs, stop, ! wcs_string1, wcs_size1, ! wcs_string2, wcs_size2, ! mbs_offset1, mbs_offset2); ! #else /* BYTE */ ! val = byte_re_match_2_internal (bufp, string1, size1, string2, ! size2, startpos, regs, stop); ! #endif /* BYTE */ #ifndef REGEX_MALLOC # ifdef C_ALLOCA alloca (0); *************** *** 3643,3652 **** #endif if (val >= 0) ! return startpos; if (val == -2) ! return -2; advance: if (!range) --- 4917,4936 ---- #endif if (val >= 0) ! { ! #ifdef WCHAR ! FREE_WCS_BUFFERS (); ! #endif ! return startpos; ! } if (val == -2) ! { ! #ifdef WCHAR ! FREE_WCS_BUFFERS (); ! #endif ! return -2; ! } advance: if (!range) *************** *** 3662,3679 **** startpos--; } } return -1; } /* re_search_2 */ ! #ifdef _LIBC ! weak_alias (__re_search_2, re_search_2) ! #endif ! /* 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))) /* Macros for dealing with the split strings in re_match_2. */ --- 4946,4976 ---- startpos--; } } + #ifdef WCHAR + FREE_WCS_BUFFERS (); + #endif return -1; + } /* re_search_2 */ ! ! #ifdef WCHAR ! /* 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 /* BYTE */ /* 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 /* WCHAR */ /* Macros for dealing with the split strings in re_match_2. */ *************** *** 3703,3712 **** --- 5000,5018 ---- 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 WCHAR + /* Use internationalized API instead of SYNTAX. */ + # define WORDCHAR_P(d) \ + (iswalnum ((wint_t)((d) == end1 ? *string2 \ + : (d) == string2 - 1 ? *(end1 - 1) : *(d))) != 0 \ + || ((d) == end1 ? *string2 \ + : (d) == string2 - 1 ? *(end1 - 1) : *(d)) == L'_') + #else /* BYTE */ #define WORDCHAR_P(d) \ (SYNTAX ((d) == end1 ? *string2 \ : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \ == Sword) + #endif /* WCHAR */ /* Disabled due to a compiler bug -- see comment at case wordbound */ #if 0 *************** *** 3719,3725 **** /* Free everything we malloc. */ #ifdef MATCH_MAY_ALLOCATE ! # define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL # define FREE_VARIABLES() \ do { \ REGEX_FREE_STACK (fail_stack.stack); \ --- 5025,5031 ---- /* Free everything we malloc. */ #ifdef MATCH_MAY_ALLOCATE ! # ifdef WCHAR # define FREE_VARIABLES() \ do { \ REGEX_FREE_STACK (fail_stack.stack); \ *************** *** 3732,3740 **** --- 5038,5081 ---- FREE_VAR (reg_info); \ FREE_VAR (reg_dummy); \ FREE_VAR (reg_info_dummy); \ + if (!cant_free_wcs_buf) \ + { \ + FREE_VAR (string1); \ + FREE_VAR (string2); \ + FREE_VAR (mbs_offset1); \ + FREE_VAR (mbs_offset2); \ + } \ + } while (0) + # else /* BYTE */ + # 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 /* WCHAR */ #else + # ifdef WCHAR + # define FREE_VARIABLES() \ + do { \ + if (!cant_free_wcs_buf) \ + { \ + FREE_VAR (string1); \ + FREE_VAR (string2); \ + FREE_VAR (mbs_offset1); \ + FREE_VAR (mbs_offset2); \ + } \ + } while (0) + # else /* BYTE */ # define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */ + # endif /* WCHAR */ #endif /* not MATCH_MAY_ALLOCATE */ /* These values must meet several constraints. They must not be valid *************** *** 3746,3751 **** --- 5087,5093 ---- 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) + #else /* not INSIDE_RECURSION */ /* Matching routines. */ *************** *** 3759,3765 **** 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 --- 5101,5115 ---- int size, pos; struct re_registers *regs; { ! int result; ! # ifdef MBS_SUPPORT ! if (MB_CUR_MAX != 1) ! result = wcs_re_match_2_internal (bufp, NULL, 0, string, size, ! pos, regs, size, ! NULL, 0, NULL, 0, NULL, NULL); ! else ! # endif ! result = byte_re_match_2_internal (bufp, NULL, 0, string, size, pos, regs, size); # ifndef REGEX_MALLOC # ifdef C_ALLOCA *************** *** 3773,3789 **** # endif #endif /* not emacs */ ! static boolean group_match_null_string_p _RE_ARGS ((unsigned char **p, ! unsigned char *end, ! register_info_type *reg_info)); ! static boolean alt_match_null_string_p _RE_ARGS ((unsigned char *p, ! unsigned char *end, ! register_info_type *reg_info)); ! static boolean common_op_match_null_string_p _RE_ARGS ((unsigned char **p, ! unsigned char *end, ! register_info_type *reg_info)); ! static int bcmp_translate _RE_ARGS ((const char *s1, const char *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 --- 5123,5143 ---- # endif #endif /* not emacs */ ! #endif /* not INSIDE_RECURSION */ ! ! #ifdef INSIDE_RECURSION ! static boolean PREFIX(group_match_null_string_p) _RE_ARGS ((UCHAR_T **p, ! UCHAR_T *end, ! PREFIX(register_info_type) *reg_info)); ! static boolean PREFIX(alt_match_null_string_p) _RE_ARGS ((UCHAR_T *p, ! UCHAR_T *end, ! PREFIX(register_info_type) *reg_info)); ! static boolean PREFIX(common_op_match_null_string_p) _RE_ARGS ((UCHAR_T **p, ! UCHAR_T *end, ! PREFIX(register_info_type) *reg_info)); ! static int PREFIX(bcmp_translate) _RE_ARGS ((const CHAR_T *s1, const CHAR_T *s2, int len, char *translate)); + #else /* not INSIDE_RECURSION */ /* re_match_2 matches the compiled pattern in BUFP against the the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1 *************** *** 3807,3814 **** 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); --- 5161,5176 ---- struct re_registers *regs; int stop; { ! int result; ! # ifdef MBS_SUPPORT ! if (MB_CUR_MAX != 1) ! result = wcs_re_match_2_internal (bufp, string1, size1, string2, size2, ! pos, regs, stop, ! NULL, 0, NULL, 0, NULL, NULL); ! else ! # endif ! result = byte_re_match_2_internal (bufp, string1, size1, string2, size2, ! pos, regs, stop); #ifndef REGEX_MALLOC # ifdef C_ALLOCA alloca (0); *************** *** 3820,3857 **** weak_alias (__re_match_2, re_match_2) #endif /* This is a separate function so that we can force an alloca cleanup afterwards. */ static int ! re_match_2_internal (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; { /* General temporaries. */ int mcnt; ! unsigned char *p1; /* Just past the end of the corresponding string. */ ! const char *end1, *end2; /* Pointers into string1 and string2, just past the last characters in each to consider matching. */ ! const char *end_match_1, *end_match_2; /* Where we are in the data, and the end of the current string. */ ! const char *d, *dend; /* Where we are in the pattern, and the end of the pattern. */ ! unsigned char *p = bufp->buffer; ! register unsigned char *pend = p + bufp->used; /* Mark the opcode just after a start_memory, so we can test for an empty subpattern when we get to the stop_memory. */ ! unsigned char *just_past_start_mem = 0; /* We use this to map every character in the string. */ RE_TRANSLATE_TYPE translate = bufp->translate; --- 5182,5304 ---- weak_alias (__re_match_2, re_match_2) #endif + #endif /* not INSIDE_RECURSION */ + + #ifdef INSIDE_RECURSION + + #ifdef WCHAR + 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 upper, lower; + + /* Check whether the size is valid. */ + if (length < 0) + return -1; + + if (offset_buffer == NULL) + return 0; + + /* If there are no multibyte character, offset_buffer[i] == i. + Optmize for this case. */ + if (offset_buffer[length] == length) + return length; + + /* Set up upper with length. (because for all i, offset_buffer[i] >= i) */ + upper = length; + lower = 0; + + while (true) + { + int middle = (lower + upper) / 2; + if (middle == lower || middle == upper) + break; + if (offset_buffer[middle] > length) + upper = middle; + else if (offset_buffer[middle] < length) + lower = middle; + else + return middle; + } + + return -1; + } + #endif /* WCHAR */ + /* This is a separate function so that we can force an alloca cleanup afterwards. */ + #ifdef WCHAR static int ! wcs_re_match_2_internal (bufp, cstring1, csize1, cstring2, csize2, pos, ! regs, stop, string1, size1, string2, size2, ! mbs_offset1, mbs_offset2) ! struct re_pattern_buffer *bufp; ! const char *cstring1, *cstring2; ! int csize1, csize2; ! int pos; ! struct re_registers *regs; ! int stop; ! /* string1 == string2 == NULL means string1/2, size1/2 and ! mbs_offset1/2 need seting up in this function. */ ! /* We need wchar_t* buffers correspond to cstring1, cstring2. */ ! wchar_t *string1, *string2; ! /* We need the size of wchar_t buffers correspond to csize1, csize2. */ ! int size1, size2; ! /* offset buffer for optimizatoin. See convert_mbs_to_wc. */ ! int *mbs_offset1, *mbs_offset2; ! #else /* BYTE */ ! static int ! byte_re_match_2_internal (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; + #endif /* BYTE */ { /* General temporaries. */ int mcnt; ! UCHAR_T *p1; ! #ifdef WCHAR ! /* They hold whether each wchar_t is binary data or not. */ ! char *is_binary = NULL; ! /* If true, we can't free string1/2, mbs_offset1/2. */ ! int cant_free_wcs_buf = 1; ! #endif /* WCHAR */ /* Just past the end of the corresponding string. */ ! const CHAR_T *end1, *end2; /* Pointers into string1 and string2, just past the last characters in each to consider matching. */ ! const CHAR_T *end_match_1, *end_match_2; /* Where we are in the data, and the end of the current string. */ ! const CHAR_T *d, *dend; /* Where we are in the pattern, and the end of the pattern. */ ! #ifdef WCHAR ! UCHAR_T *pattern, *p; ! register UCHAR_T *pend; ! #else /* BYTE */ ! UCHAR_T *p = bufp->buffer; ! register UCHAR_T *pend = p + bufp->used; ! #endif /* WCHAR */ /* Mark the opcode just after a start_memory, so we can test for an empty subpattern when we get to the stop_memory. */ ! UCHAR_T *just_past_start_mem = 0; /* We use this to map every character in the string. */ RE_TRANSLATE_TYPE translate = bufp->translate; *************** *** 3866,3872 **** 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; --- 5313,5319 ---- 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. */ ! PREFIX(fail_stack_type) fail_stack; #endif #ifdef DEBUG static unsigned failure_id; *************** *** 3896,3902 **** 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 **regstart, **regend; #endif /* If a group that's operated upon by a repetition operator fails to --- 5343,5349 ---- 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_T **regstart, **regend; #endif /* If a group that's operated upon by a repetition operator fails to *************** *** 3905,3911 **** 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 **old_regstart, **old_regend; #endif /* The is_active field of reg_info helps us keep track of which (possibly --- 5352,5358 ---- 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_T **old_regstart, **old_regend; #endif /* The is_active field of reg_info helps us keep track of which (possibly *************** *** 3915,3921 **** 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 --- 5362,5368 ---- subexpression. These two fields get reset each time through any loop their register is in. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ ! PREFIX(register_info_type) *reg_info; #endif /* The following record the register info as found in the above *************** *** 3924,3930 **** 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 **best_regstart, **best_regend; #endif /* Logically, this is `best_regend[0]'. But we don't want to have to --- 5371,5377 ---- 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_T **best_regstart, **best_regend; #endif /* Logically, this is `best_regend[0]'. But we don't want to have to *************** *** 3935,3949 **** 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 *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 **reg_dummy; ! register_info_type *reg_info_dummy; #endif #ifdef DEBUG --- 5382,5396 ---- 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_T *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_T **reg_dummy; ! PREFIX(register_info_type) *reg_info_dummy; #endif #ifdef DEBUG *************** *** 3963,3977 **** array indexing. We should fix this. */ if (bufp->re_nsub) { ! regstart = REGEX_TALLOC (num_regs, const char *); ! regend = REGEX_TALLOC (num_regs, const char *); ! old_regstart = REGEX_TALLOC (num_regs, const char *); ! old_regend = REGEX_TALLOC (num_regs, const char *); ! best_regstart = REGEX_TALLOC (num_regs, const char *); ! best_regend = REGEX_TALLOC (num_regs, const char *); ! reg_info = REGEX_TALLOC (num_regs, register_info_type); ! reg_dummy = REGEX_TALLOC (num_regs, const char *); ! 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)) --- 5410,5424 ---- array indexing. We should fix this. */ if (bufp->re_nsub) { ! regstart = REGEX_TALLOC (num_regs, const CHAR_T *); ! regend = REGEX_TALLOC (num_regs, const CHAR_T *); ! old_regstart = REGEX_TALLOC (num_regs, const CHAR_T *); ! old_regend = REGEX_TALLOC (num_regs, const CHAR_T *); ! best_regstart = REGEX_TALLOC (num_regs, const CHAR_T *); ! best_regend = REGEX_TALLOC (num_regs, const CHAR_T *); ! reg_info = REGEX_TALLOC (num_regs, PREFIX(register_info_type)); ! reg_dummy = REGEX_TALLOC (num_regs, const CHAR_T *); ! reg_info_dummy = REGEX_TALLOC (num_regs, PREFIX(register_info_type)); if (!(regstart && regend && old_regstart && old_regend && reg_info && best_regstart && best_regend && reg_dummy && reg_info_dummy)) *************** *** 3986,4002 **** `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. */ if (pos < 0 || pos > size1 + size2) { FREE_VARIABLES (); return -1; } /* 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. */ --- 5433,5504 ---- `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 = (PREFIX(register_info_type) *) NULL; } #endif /* MATCH_MAY_ALLOCATE */ /* The starting position is bogus. */ + #ifdef WCHAR + if (pos < 0 || pos > csize1 + csize2) + #else /* BYTE */ if (pos < 0 || pos > size1 + size2) + #endif { FREE_VARIABLES (); return -1; } + #ifdef WCHAR + /* Allocate wchar_t array for string1 and string2 and + fill them with converted string. */ + if (string1 == NULL && string2 == NULL) + { + /* We need seting up buffers here. */ + + /* We must free wcs buffers in this function. */ + cant_free_wcs_buf = 0; + + if (csize1 != 0) + { + string1 = REGEX_TALLOC (csize1 + 1, CHAR_T); + 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; + } + } + if (csize2 != 0) + { + string2 = REGEX_TALLOC (csize2 + 1, CHAR_T); + 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_T*)bufp->buffer; + pend = (CHAR_T*)(bufp->buffer + bufp->used); + + #endif /* WCHAR */ + /* 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. */ *************** *** 4019,4029 **** --- 5521,5558 ---- size2 = size1; string1 = 0; size1 = 0; + #ifdef WCHAR + mbs_offset2 = mbs_offset1; + csize2 = csize1; + mbs_offset1 = NULL; + csize1 = 0; + #endif } end1 = string1 + size1; end2 = string2 + size2; /* Compute where to stop matching, within the two strings. */ + #ifdef WCHAR + if (stop <= csize1) + { + mcnt = count_mbs_length(mbs_offset1, stop); + end_match_1 = string1 + mcnt; + end_match_2 = string2; + } + else + { + if (stop > csize1 + csize2) + stop = csize1 + csize2; + 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; *************** *** 4034,4039 **** --- 5563,5569 ---- end_match_1 = end1; end_match_2 = string2 + stop - size1; } + #endif /* WCHAR */ /* `p' scans through the pattern as `d' scans through the data. `dend' is the end of the input string that `d' points within. `d' *************** *** 4041,4046 **** --- 5571,5596 ---- 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 WCHAR + 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; *************** *** 4051,4056 **** --- 5601,5607 ---- d = string2 + pos - size1; dend = end_match_2; } + #endif /* WCHAR */ DEBUG_PRINT1 ("The compiled pattern is:\n"); DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend); *************** *** 4188,4196 **** --- 5739,5756 ---- if (regs->num_regs > 0) { regs->start[0] = pos; + #ifdef WCHAR + 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 /* WCHAR */ } /* Go through the first `min (num_regs, regs->num_regs)' *************** *** 4223,4231 **** --- 5783,5800 ---- nfailure_points_pushed - nfailure_points_popped); DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed); + #ifdef WCHAR + 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 /* WCHAR */ DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt); *************** *** 4250,4255 **** --- 5819,5827 ---- 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); *************** *** 4260,4268 **** do { PREFETCH (); ! if ((unsigned char) translate[(unsigned char) *d++] ! != (unsigned char) *p++) goto fail; } while (--mcnt); } --- 5832,5854 ---- do { PREFETCH (); ! #ifdef WCHAR ! if (*d <= 0xff) ! { ! if ((UCHAR_T) translate[(unsigned char) *d++] ! != (UCHAR_T) *p++) ! goto fail; ! } ! else ! { ! if (*d++ != (CHAR_T) *p++) ! goto fail; ! } ! #else ! if ((UCHAR_T) translate[(unsigned char) *d++] ! != (UCHAR_T) *p++) goto fail; + #endif /* WCHAR */ } while (--mcnt); } *************** *** 4271,4277 **** do { PREFETCH (); ! if (*d++ != (char) *p++) goto fail; } while (--mcnt); } --- 5857,5863 ---- do { PREFETCH (); ! if (*d++ != (CHAR_T) *p++) goto fail; } while (--mcnt); } *************** *** 4298,4304 **** case charset: case charset_not: { ! register unsigned char c; boolean not = (re_opcode_t) *(p - 1) == charset_not; DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : ""); --- 5884,5897 ---- case charset: case charset_not: { ! #ifdef WCHAR ! unsigned int i, char_class_length, coll_symbol_length, ! equiv_class_length, ranges_length, chars_length, length; ! CHAR_T *workp, *workp2, *charset_top; ! # define WORK_BUFFER_SIZE 128 ! CHAR_T str_buf[WORK_BUFFER_SIZE]; ! #endif /* WCHAR */ ! register UCHAR_T c; boolean not = (re_opcode_t) *(p - 1) == charset_not; DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : ""); *************** *** 4306,4311 **** --- 5899,6097 ---- PREFETCH (); c = TRANSLATE (*d); /* The character to match. */ + #ifdef WCHAR + 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; + unsigned long int alignedp = ((unsigned long int)workp + + __alignof__(wctype_t) - 1) + & ~(unsigned long int)(__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? */ + /* If we can't look up collation data, we use wcscoll + instead. */ + for (workp2 = workp + coll_symbol_length ; workp < workp2 ;) + { + const CHAR_T *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? */ + /* If we can't look up collation data, we use wcscoll + instead. */ + for (workp2 = workp + equiv_class_length ; workp < workp2 ;) + { + const CHAR_T *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? */ + /* 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) *************** *** 4315,4321 **** p += 1 + *p; if (!not) goto fail; ! SET_REGS_MATCHED (); d++; break; --- 6101,6108 ---- p += 1 + *p; if (!not) goto fail; ! #undef WORK_BUFFER_SIZE ! #endif /* WCHAR */ SET_REGS_MATCHED (); d++; break; *************** *** 4335,4341 **** 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 --- 6122,6128 ---- if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE) REG_MATCH_NULL_STRING_P (reg_info[*p]) ! = PREFIX(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 *************** *** 4410,4416 **** 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. */ ! unsigned char r = *p - 1; while (r > 0 && !IS_ACTIVE (reg_info[r])) r--; --- 6197,6203 ---- 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. */ ! UCHAR_T r = *p - 1; while (r > 0 && !IS_ACTIVE (reg_info[r])) r--; *************** *** 4453,4459 **** case dummy_failure_jump: EXTRACT_NUMBER_AND_INCR (mcnt, p1); if (is_a_jump_n) ! p1 += 2; break; default: --- 6240,6246 ---- case dummy_failure_jump: EXTRACT_NUMBER_AND_INCR (mcnt, p1); if (is_a_jump_n) ! p1 += OFFSET_ADDRESS_SIZE; break; default: *************** *** 4467,4473 **** 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[3] == start_memory && p1[4] == *p) { /* If this group ever matched anything, then restore what its registers were before trying this last --- 6254,6261 ---- 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 *************** *** 4513,4519 **** followed by the numeric value of as the register number. */ case duplicate: { ! register const char *d2, *dend2; int regno = *p++; /* Get which register to match against. */ DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno); --- 6301,6307 ---- followed by the numeric value of as the register number. */ case duplicate: { ! register const CHAR_T *d2, *dend2; int regno = *p++; /* Get which register to match against. */ DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno); *************** *** 4562,4569 **** /* Compare that many; failure if mismatch, else move past them. */ if (translate ! ? bcmp_translate (d, d2, mcnt, translate) ! : memcmp (d, d2, mcnt)) goto fail; d += mcnt, d2 += mcnt; --- 6350,6357 ---- /* Compare that many; failure if mismatch, else move past them. */ if (translate ! ? PREFIX(bcmp_translate) (d, d2, mcnt, translate) ! : memcmp (d, d2, mcnt*sizeof(UCHAR_T))) goto fail; d += mcnt, d2 += mcnt; *************** *** 4719,4725 **** EXTRACT_NUMBER_AND_INCR (mcnt, p); DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt); { ! register unsigned char *p2 = p; /* Compare the beginning of the repeat with what in the pattern follows its end. If we can establish that there --- 6507,6513 ---- EXTRACT_NUMBER_AND_INCR (mcnt, p); DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt); { ! register UCHAR_T *p2 = p; /* Compare the beginning of the repeat with what in the pattern follows its end. If we can establish that there *************** *** 4744,4752 **** && ((re_opcode_t) *p2 == stop_memory || (re_opcode_t) *p2 == start_memory)) p2 += 3; ! else if (p2 + 6 < pend && (re_opcode_t) *p2 == dummy_failure_jump) ! p2 += 6; else break; } --- 6532,6540 ---- && ((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; } *************** *** 4762,4785 **** /* Consider what happens when matching ":\(.*\)" against ":/". I don't really understand this code yet. */ ! p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" End of pattern: change to `pop_failure_jump'.\n"); } else if ((re_opcode_t) *p2 == exactn || (bufp->newline_anchor && (re_opcode_t) *p2 == endline)) { ! register unsigned char c ! = *p2 == (unsigned char) endline ? '\n' : p2[2]; ! if ((re_opcode_t) p1[3] == exactn && p1[5] != c) { ! p[-3] = (unsigned char) pop_failure_jump; ! DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n", ! c, p1[5]); } else if ((re_opcode_t) p1[3] == charset || (re_opcode_t) p1[3] == charset_not) { --- 6550,6588 ---- /* Consider what happens when matching ":\(.*\)" against ":/". I don't really understand this code yet. */ ! p[-(1 + OFFSET_ADDRESS_SIZE)] = (UCHAR_T) 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 UCHAR_T c ! = *p2 == (UCHAR_T) 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)] = (UCHAR_T) pop_failure_jump; ! #ifdef WCHAR ! DEBUG_PRINT3 (" %C != %C => pop_failure_jump.\n", ! (wint_t) c, ! (wint_t) p1[3+OFFSET_ADDRESS_SIZE]); ! #else ! DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n", ! (char) c, ! (char) p1[3+OFFSET_ADDRESS_SIZE]); ! #endif } + #ifndef WCHAR else if ((re_opcode_t) p1[3] == charset || (re_opcode_t) p1[3] == charset_not) { *************** *** 4797,4803 **** --- 6600,6608 ---- DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); } } + #endif /* not WCHAR */ } + #ifndef WCHAR else if ((re_opcode_t) *p2 == charset) { /* We win if the first character of the loop is not part *************** *** 4846,4856 **** } } } } ! p -= 2; /* Point at relative address again. */ if ((re_opcode_t) p[-1] != pop_failure_jump) { ! p[-1] = (unsigned char) jump; DEBUG_PRINT1 (" Match => jump.\n"); goto unconditional_jump; } --- 6651,6662 ---- } } } + #endif /* not WCHAR */ } ! p -= OFFSET_ADDRESS_SIZE; /* Point at relative address again. */ if ((re_opcode_t) p[-1] != pop_failure_jump) { ! p[-1] = (UCHAR_T) jump; DEBUG_PRINT1 (" Match => jump.\n"); goto unconditional_jump; } *************** *** 4871,4878 **** register from the stack, since lowest will == highest in `pop_failure_point'. */ active_reg_t dummy_low_reg, dummy_high_reg; ! unsigned char *pdummy; ! const char *sdummy; DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n"); POP_FAILURE_POINT (sdummy, pdummy, --- 6677,6684 ---- register from the stack, since lowest will == highest in `pop_failure_point'. */ active_reg_t dummy_low_reg, dummy_high_reg; ! UCHAR_T *pdummy = NULL; ! const CHAR_T *sdummy = NULL; DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n"); POP_FAILURE_POINT (sdummy, pdummy, *************** *** 4937,4943 **** /* Have to succeed matching what follows at least n times. After that, handle like `on_failure_jump'. */ case succeed_n: ! EXTRACT_NUMBER (mcnt, p + 2); DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt); assert (mcnt >= 0); --- 6743,6749 ---- /* 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); *************** *** 4945,4990 **** if (mcnt > 0) { mcnt--; ! p += 2; STORE_NUMBER_AND_INCR (p, mcnt); #ifdef _LIBC ! DEBUG_PRINT3 (" Setting %p to %d.\n", p - 2, mcnt); #else ! DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p - 2, mcnt); #endif } else if (mcnt == 0) { #ifdef _LIBC ! DEBUG_PRINT2 (" Setting two bytes from %p to no_op.\n", p+2); #else ! DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", p+2); #endif ! p[2] = (unsigned char) no_op; ! p[3] = (unsigned char) no_op; goto on_failure; } break; case jump_n: ! EXTRACT_NUMBER (mcnt, p + 2); DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt); /* Originally, this is how many times we CAN jump. */ if (mcnt) { mcnt--; ! STORE_NUMBER (p + 2, mcnt); #ifdef _LIBC ! DEBUG_PRINT3 (" Setting %p to %d.\n", p + 2, mcnt); #else ! DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p + 2, mcnt); #endif goto unconditional_jump; } /* If don't have to jump any more, skip over the rest of command. */ else ! p += 4; break; case set_number_at: --- 6751,6807 ---- 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 ! ! #ifdef WCHAR ! p[1] = (UCHAR_T) no_op; ! #else ! p[2] = (UCHAR_T) no_op; ! p[3] = (UCHAR_T) no_op; ! #endif /* WCHAR */ 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 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: *************** *** 5215,5227 **** We don't handle duplicates properly (yet). */ static boolean ! group_match_null_string_p (p, end, reg_info) ! unsigned char **p, *end; ! register_info_type *reg_info; { int mcnt; /* Point to after the args to the start_memory. */ ! unsigned char *p1 = *p + 2; while (p1 < end) { --- 7032,7044 ---- We don't handle duplicates properly (yet). */ static boolean ! PREFIX(group_match_null_string_p) (p, end, reg_info) ! UCHAR_T **p, *end; ! PREFIX(register_info_type) *reg_info; { int mcnt; /* Point to after the args to the start_memory. */ ! UCHAR_T *p1 = *p + 2; while (p1 < end) { *************** *** 5259,5272 **** with an on_failure_jump (see above) that jumps to right past a jump_past_alt. */ ! while ((re_opcode_t) p1[mcnt-3] == 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 - 3, ! reg_info)) return false; /* Move to right after this alternative, including the --- 7076,7091 ---- 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 (!PREFIX(alt_match_null_string_p) (p1, p1 + mcnt - ! (1 + OFFSET_ADDRESS_SIZE), ! reg_info)) return false; /* Move to right after this alternative, including the *************** *** 5282,5291 **** alternative that starts with an on_failure_jump. */ p1++; EXTRACT_NUMBER_AND_INCR (mcnt, p1); ! if ((re_opcode_t) p1[mcnt-3] != jump_past_alt) { /* Get to the beginning of the n-th alternative. */ ! p1 -= 3; break; } } --- 7101,7111 ---- 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; } } *************** *** 5293,5301 **** /* 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 - 2); ! if (!alt_match_null_string_p (p1, p1 + mcnt, reg_info)) return false; p1 += mcnt; /* Get past the n-th alternative. */ --- 7113,7121 ---- /* 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 (!PREFIX(alt_match_null_string_p) (p1, p1 + mcnt, reg_info)) return false; p1 += mcnt; /* Get past the n-th alternative. */ *************** *** 5310,5316 **** default: ! if (!common_op_match_null_string_p (&p1, end, reg_info)) return false; } } /* while p1 < end */ --- 7130,7136 ---- default: ! if (!PREFIX(common_op_match_null_string_p) (&p1, end, reg_info)) return false; } } /* while p1 < end */ *************** *** 5324,5335 **** byte past the last. The alternative can contain groups. */ static boolean ! alt_match_null_string_p (p, end, reg_info) ! unsigned char *p, *end; ! register_info_type *reg_info; { int mcnt; ! unsigned char *p1 = p; while (p1 < end) { --- 7144,7155 ---- byte past the last. The alternative can contain groups. */ static boolean ! PREFIX(alt_match_null_string_p) (p, end, reg_info) ! UCHAR_T *p, *end; ! PREFIX(register_info_type) *reg_info; { int mcnt; ! UCHAR_T *p1 = p; while (p1 < end) { *************** *** 5346,5352 **** break; default: ! if (!common_op_match_null_string_p (&p1, end, reg_info)) return false; } } /* while p1 < end */ --- 7166,7172 ---- break; default: ! if (!PREFIX(common_op_match_null_string_p) (&p1, end, reg_info)) return false; } } /* while p1 < end */ *************** *** 5361,5374 **** Sets P to one after the op and its arguments, if any. */ static boolean ! common_op_match_null_string_p (p, end, reg_info) ! unsigned char **p, *end; ! register_info_type *reg_info; { int mcnt; boolean ret; int reg_no; ! unsigned char *p1 = *p; switch ((re_opcode_t) *p1++) { --- 7181,7194 ---- Sets P to one after the op and its arguments, if any. */ static boolean ! PREFIX(common_op_match_null_string_p) (p, end, reg_info) ! UCHAR_T **p, *end; ! PREFIX(register_info_type) *reg_info; { int mcnt; boolean ret; int reg_no; ! UCHAR_T *p1 = *p; switch ((re_opcode_t) *p1++) { *************** *** 5391,5397 **** 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. */ --- 7211,7217 ---- case start_memory: reg_no = *p1; assert (reg_no > 0 && reg_no <= MAX_REGNUM); ! ret = PREFIX(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. */ *************** *** 5414,5425 **** case succeed_n: /* Get to the number of times to succeed. */ ! p1 += 2; EXTRACT_NUMBER_AND_INCR (mcnt, p1); if (mcnt == 0) { ! p1 -= 4; EXTRACT_NUMBER_AND_INCR (mcnt, p1); p1 += mcnt; } --- 7234,7245 ---- 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; } *************** *** 5433,5439 **** break; case set_number_at: ! p1 += 4; default: /* All other opcodes mean we cannot match the empty string. */ --- 7253,7259 ---- break; case set_number_at: ! p1 += 2 * OFFSET_ADDRESS_SIZE; default: /* All other opcodes mean we cannot match the empty string. */ *************** *** 5449,5469 **** bytes; nonzero otherwise. */ static int ! bcmp_translate (s1, s2, len, translate) ! const char *s1, *s2; register int len; RE_TRANSLATE_TYPE translate; { ! register const unsigned char *p1 = (const unsigned char *) s1; ! register const unsigned char *p2 = (const unsigned char *) s2; while (len) { if (translate[*p1++] != translate[*p2++]) return 1; len--; } return 0; } /* Entry points for GNU code. */ /* re_compile_pattern is the GNU regular expression compiler: it --- 7269,7298 ---- bytes; nonzero otherwise. */ static int ! PREFIX(bcmp_translate) (s1, s2, len, translate) ! const CHAR_T *s1, *s2; register int len; RE_TRANSLATE_TYPE translate; { ! register const UCHAR_T *p1 = (const UCHAR_T *) s1; ! register const UCHAR_T *p2 = (const UCHAR_T *) s2; while (len) { + #ifdef WCHAR + if (((*p1<=0xff)?translate[*p1++]:*p1++) + != ((*p2<=0xff)?translate[*p2++]:*p2++)) + return 1; + #else /* BYTE */ if (translate[*p1++] != translate[*p2++]) return 1; + #endif /* WCHAR */ len--; } return 0; } + + #else /* not INSIDE_RECURSION */ + /* Entry points for GNU code. */ /* re_compile_pattern is the GNU regular expression compiler: it *************** *** 5495,5501 **** /* Match anchors at newline. */ bufp->newline_anchor = 1; ! ret = regex_compile (pattern, length, re_syntax_options, bufp); if (!ret) return NULL; --- 7324,7335 ---- /* Match anchors at newline. */ bufp->newline_anchor = 1; ! # ifdef MBS_SUPPORT ! if (MB_CUR_MAX != 1) ! ret = wcs_regex_compile (pattern, length, re_syntax_options, bufp); ! else ! # endif ! ret = byte_regex_compile (pattern, length, re_syntax_options, bufp); if (!ret) return NULL; *************** *** 5550,5556 **** /* 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; --- 7384,7395 ---- /* Match anchors at newlines. */ re_comp_buf.newline_anchor = 1; ! # ifdef MBS_SUPPORT ! if (MB_CUR_MAX != 1) ! ret = wcs_regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); ! else ! # endif ! ret = byte_regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); if (!ret) return NULL; *************** *** 5667,5673 **** /* 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. */ --- 7506,7517 ---- /* POSIX says a null character in the pattern terminates it, so we can use strlen here in compiling the pattern. */ ! # ifdef MBS_SUPPORT ! if (MB_CUR_MAX != 1) ! ret = wcs_regex_compile (pattern, strlen (pattern), syntax, preg); ! else ! # endif ! ret = byte_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. */ *************** *** 5852,5854 **** --- 7696,7768 ---- #endif #endif /* not emacs */ + + #endif /* not INSIDE_RECURSION */ + + #undef STORE_NUMBER + #undef STORE_NUMBER_AND_INCR + #undef EXTRACT_NUMBER + #undef EXTRACT_NUMBER_AND_INCR + + #undef DEBUG_PRINT_COMPILED_PATTERN + #undef DEBUG_PRINT_DOUBLE_STRING + + #undef INIT_FAIL_STACK + #undef RESET_FAIL_STACK + #undef DOUBLE_FAIL_STACK + #undef PUSH_PATTERN_OP + #undef PUSH_FAILURE_POINTER + #undef PUSH_FAILURE_INT + #undef PUSH_FAILURE_ELT + #undef POP_FAILURE_POINTER + #undef POP_FAILURE_INT + #undef POP_FAILURE_ELT + #undef DEBUG_PUSH + #undef DEBUG_POP + #undef PUSH_FAILURE_POINT + #undef POP_FAILURE_POINT + + #undef REG_UNSET_VALUE + #undef REG_UNSET + + #undef PATFETCH + #undef PATFETCH_RAW + #undef PATUNFETCH + #undef TRANSLATE + + #undef INIT_BUF_SIZE + #undef GET_BUFFER_SPACE + #undef BUF_PUSH + #undef BUF_PUSH_2 + #undef BUF_PUSH_3 + #undef STORE_JUMP + #undef STORE_JUMP2 + #undef INSERT_JUMP + #undef INSERT_JUMP2 + #undef EXTEND_BUFFER + #undef GET_UNSIGNED_NUMBER + #undef FREE_STACK_RETURN + + #undef POINTER_TO_OFFSET + #undef MATCHING_IN_FRST_STRING + #undef PREFETCH + #undef AT_STRINGS_BEG + #undef AT_STRINGS_END + #undef WORDCHAR_P + #undef FREE_VAR + #undef FREE_VARIABLES + #undef NO_HIGHEST_ACTIVE_REG + #undef NO_LOWEST_ACTIVE_REG + + #undef CHAR_T + #undef UCHAR_T + #undef COMPILED_BUFFER_VAR + #undef OFFSET_ADDRESS_SIZE + #undef CHAR_CLASS_SIZE + #undef PREFIX + #undef ARG_PREFIX + #undef PUT_CHAR + #undef BYTE + #undef WCHAR + + #define DEFINED_ONCE diff -crN gawk-3.1.0/regex.h gawk-3.1.1/regex.h *** gawk-3.1.0/regex.h Tue Oct 24 13:16:01 2000 --- gawk-3.1.1/regex.h Tue Apr 16 14:59:19 2002 *************** *** 1,6 **** /* Definitions for data structures and routines for the regular expression library, version 0.12. ! Copyright (C) 1985,89,90,91,92,93,95,96,97,98 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 --- 1,6 ---- /* Definitions for data structures and routines for the regular expression library, version 0.12. ! Copyright (C) 1985,89,90,91,92,93,95,96,97,98,2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -crN gawk-3.1.0/test/ChangeLog gawk-3.1.1/test/ChangeLog *** gawk-3.1.0/test/ChangeLog Sun Jun 3 13:05:30 2001 --- gawk-3.1.1/test/ChangeLog Wed May 1 16:42:14 2002 *************** *** 1,3 **** --- 1,83 ---- + Wed May 1 16:41:32 2002 Arnold D. Robbins + + * Release 3.1.1: Release tar file made. + + Tue Apr 16 17:07:25 2002 Arnold D. Robbins + + * Makefile.am (pass-fail): New target that prints an + `all passed' or `x tests failed' message, for use in + grep-ing build logs. + (check): Add pass-fail as last dependency. + + Thanks to Nelson Beebe for the thought, beebe@math.utah.edu. + + Sun Mar 10 17:00:51 2002 Scott Deifik + + * Makefile.am (strftime): Add TZ=GMT0 into environment, to + regularize things, esp. for some DJGPP systems. + + Mon Feb 18 14:55:19 2002 Arnold D. Robbins + + * Makefile.am (longsub): new test case. + * longsub.awk, longsub.in, longsub.ok: new files. + + Wed Jan 23 15:03:36 2002 Andreas Buening + + * Makefile.am (PATH_SEPARATOR): Added. + (awkpath): Make use of PATH_SEPARATOR. + + Wed Jan 23 14:50:38 2002 Arnold D. Robbins + + * Makefile.am (concat1): new test case. + * concat1.awk, concat1.in, concat1.ok: new files. + + Mon Jan 7 22:21:25 2002 Arnold D. Robbins + + * Makefile.am (forsimp): new test case. + * forsimp.awk, forsimp.ok: new files. + + Wed Dec 26 22:01:52 2001 Arnold D. Robbins + + * Makefile.am (inftest): Add sed to fix case issues between + different libc versions. Ugh. + + Wed Dec 19 16:01:58 2001 Peter J. Farley III + + * Makefile.am (manyfiles): Also delete \15 in tr. + + Tue Dec 18 20:56:07 2001 Andreas Buening + + * Makefile.am (nors): Add \15 to list of chars to delete so + test will run on OS/2 also. + + Thu Oct 4 18:34:49 2001 Arnold D. Robbins + + * Makefile.am (membug1): new test case. + * membug1.awk, membug1.in, membug1.ok: new files. + + Thu Aug 23 14:04:10 2001 Arnold D. Robbins + + * Makefile.am (minusstr): new test case. + * minusstr.awk, minusstr.ok: new files. + + Sat Aug 4 23:42:37 2001 Arnold D. Robbins + + * Makefile.am (arrymem1): new test case. + (compare2): new test case. + (regtest): Make test work, use regtest.sh, not .awk. + * arrymem1.awk, arrymem1.ok: new files. + * compare2.awk, compare2.ok: new files. + + Mon Jul 23 17:32:03 2001 Arnold D. Robbins + + * Makefile.am (onlynl): new test case. + * onlynl.awk, onlynl.in, onlynl.ok: new files. + + Wed Jun 13 18:12:43 2001 Arnold D. Robbins + + * Makefile.am (ofmtfidl): new test case. + * ofmtfidl.awk, ofmtfidl.in, ofmtfidl.ok: new files. + Sun Jun 3 13:04:44 2001 Arnold D. Robbins * Release 3.1.0: Release tar file made. And there was diff -crN gawk-3.1.0/test/Makefile.am gawk-3.1.1/test/Makefile.am *** gawk-3.1.0/test/Makefile.am Tue Mar 20 11:09:43 2001 --- gawk-3.1.1/test/Makefile.am Tue Apr 16 17:07:16 2002 *************** *** 1,7 **** # # test/Makefile.am --- automake input file for gawk # ! # Copyright (C) 1988-2001 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. --- 1,7 ---- # # test/Makefile.am --- automake input file for gawk # ! # Copyright (C) 1988-2002 the Free Software Foundation, Inc. # # This file is part of GAWK, the GNU implementation of the # AWK Programming Language. *************** *** 49,54 **** --- 49,56 ---- arynocls.ok \ arysubnm.awk \ arysubnm.ok \ + arrymem1.awk \ + arrymem1.ok \ asgext.awk \ asgext.in \ asgext.ok \ *************** *** 70,75 **** --- 72,82 ---- compare.awk \ compare.in \ compare.ok \ + compare2.awk \ + compare2.ok \ + concat1.awk \ + concat1.in \ + concat1.ok \ convfmt.awk \ convfmt.ok \ datanonl.awk \ *************** *** 106,111 **** --- 113,120 ---- fnasgnm.ok \ fnparydl.awk \ fnparydl.ok \ + forsimp.awk \ + forsimp.ok \ fsbs.in \ fsbs.ok \ fsfwfs.awk \ *************** *** 172,184 **** --- 181,201 ---- lint.ok \ litoct.awk \ litoct.ok \ + longsub.awk \ + longsub.in \ + longsub.ok \ longwrds.awk \ longwrds.ok \ manpage \ manyfiles.awk \ math.awk \ math.ok \ + membug1.awk \ + membug1.in \ + membug1.ok \ messages.awk \ + minusstr.awk \ + minusstr.ok \ mmap8k.in \ nasty.awk \ nasty.ok \ *************** *** 223,231 **** --- 240,254 ---- ofmtbig.awk \ ofmtbig.in \ ofmtbig.ok \ + ofmtfidl.awk \ + ofmtfidl.in \ + ofmtfidl.ok \ ofmts.awk \ ofmts.in \ ofmts.ok \ + onlynl.awk \ + onlynl.in \ + onlynl.ok \ opasnidx.awk \ opasnidx.ok \ opasnslf.awk \ *************** *** 350,376 **** CMP = cmp AWK = ../gawk # message stuff is to make it a little easier to follow check: msg \ basic-msg-start basic basic-msg-end \ unix-msg-start unix-tests unix-msg-end \ ! extend-msg-start gawk-extensions extend-msg-end # try to keep these sorted basic: addcomma anchgsub argarray arrayparm arrayref arynasty arynocls \ ! arysubnm asgext awkpath back89 backgsub childin clobber clsflnam \ ! compare convfmt datanonl defref delarprm dynlj eofsplit fldchg \ ! fldchgnf fnamedat fnarray fnarydel fnaryscl fnasgnm fnparydl \ ! fsbs fsrs fstabplus funsemnl funsmnam funstack getline getlnbuf getnr2tb \ ! getnr2tm gsubasgn gsubtest hsprint intest intprec leaddig leadnl litoct \ ! longwrds math messages mmap8k nasty nasty2 negexp nfldstr nfset \ ! nlfldsep nlinstr nlstrina noeffect nofmtch nonl noparms nors \ ! numindex numsubstr octsub ofmt ofmtbig ofmts opasnidx opasnslf \ ! paramdup paramtyp parseme pcntplus prdupval printf1 prmarscl \ ! prmreuse prt1eval prtoeval psx96sub rand rebt8b1 rebt8b2 redfilnm \ ! regeq reindops reparse resplit rs rsnul1nl rswhite sclforin \ ! sclifin splitargv splitdef splitvar splitwht sprintfc strtod \ ! subslash substr swaplns tradanch tweakfld zeroflag unix-tests: fflush getlnhd pid pipeio1 pipeio2 poundbang strftlng --- 373,404 ---- CMP = cmp AWK = ../gawk + # Special stuff for OS/2 + PATH_SEPARATOR = @PATH_SEPARATOR@ + # message stuff is to make it a little easier to follow check: msg \ basic-msg-start basic basic-msg-end \ unix-msg-start unix-tests unix-msg-end \ ! extend-msg-start gawk-extensions extend-msg-end \ ! pass-fail # try to keep these sorted basic: addcomma anchgsub argarray arrayparm arrayref arynasty arynocls \ ! arysubnm arrymem1 asgext awkpath back89 backgsub childin clobber \ ! clsflnam compare compare2 concat1 convfmt datanonl defref delarprm dynlj eofsplit \ ! fldchg fldchgnf fnamedat fnarray fnarydel fnaryscl fnasgnm \ ! fnparydl forsimp fsbs fsrs fstabplus funsemnl funsmnam funstack getline \ ! getlnbuf getnr2tb getnr2tm gsubasgn gsubtest hsprint intest \ ! intprec leaddig leadnl litoct longsub longwrds math membug1 messages minusstr \ ! mmap8k nasty nasty2 negexp nfldstr nfset nlfldsep nlinstr nlstrina \ ! noeffect nofmtch nonl noparms nors numindex numsubstr octsub \ ! ofmt ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf paramdup paramtyp \ ! parseme pcntplus prdupval printf1 prmarscl prmreuse prt1eval \ ! prtoeval psx96sub rand rebt8b1 rebt8b2 redfilnm regeq reindops \ ! reparse resplit rs rsnul1nl rswhite sclforin sclifin splitargv \ ! splitdef splitvar splitwht sprintfc strtod subslash substr \ ! swaplns tradanch tweakfld zeroflag unix-tests: fflush getlnhd pid pipeio1 pipeio2 poundbang strftlng *************** *** 464,470 **** @echo 'Some of the output from regtest is very system specific, do not' @echo 'be distressed if your output differs from that distributed.' @echo 'Manual inspection is called for.' ! AWK=`pwd`/$(AWK) $(srcdir)/regtest.awk posix:: @echo '1:2,3 4' | $(AWK) -f $(srcdir)/posix.awk >_$@ --- 492,498 ---- @echo 'Some of the output from regtest is very system specific, do not' @echo 'be distressed if your output differs from that distributed.' @echo 'Manual inspection is called for.' ! AWK=`pwd`/$(AWK) $(srcdir)/regtest.sh posix:: @echo '1:2,3 4' | $(AWK) -f $(srcdir)/posix.awk >_$@ *************** *** 475,481 **** @mkdir junk @$(AWK) 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >_$@ @$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@ ! @echo "This number better be 1 ->" | tr -d '\012' @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l @rm -rf junk _$@ --- 503,509 ---- @mkdir junk @$(AWK) 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >_$@ @$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@ ! @echo "This number better be 1 ->" | tr -d '\012\015' @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l @rm -rf junk _$@ *************** *** 497,503 **** inftest:: @echo This test is very machine specific... ! @$(AWK) -f $(srcdir)/inftest.awk >_$@ -$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@ getline:: --- 525,531 ---- inftest:: @echo This test is very machine specific... ! @$(AWK) -f $(srcdir)/inftest.awk | sed 's/inf/Inf/g' >_$@ -$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@ getline:: *************** *** 525,531 **** -$(CMP) $(srcdir)/splitargv.ok _$@ && rm -f _$@ awkpath:: ! @AWKPATH="$(srcdir):$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@ -$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@ nfset:: --- 553,559 ---- -$(CMP) $(srcdir)/splitargv.ok _$@ && rm -f _$@ awkpath:: ! @AWKPATH="$(srcdir)$(PATH_SEPARATOR)$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@ -$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@ nfset:: *************** *** 572,577 **** --- 600,606 ---- : this test could fail on slow machines or on a second boundary, : so if it does, double check the actual results @LC_ALL=C; export LC_ALL; LANG=C; export LANG; \ + TZ=GMT0; export TZ; \ date | $(AWK) -v OUTPUT=_$@ -f $(srcdir)/strftime.awk -$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0 *************** *** 750,756 **** -$(CMP) $(srcdir)/nfldstr.ok _$@ && rm -f _$@ nors:: ! @echo A B C D E | tr -d '\12' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@ -$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@ fnarydel:: --- 779,785 ---- -$(CMP) $(srcdir)/nfldstr.ok _$@ && rm -f _$@ nors:: ! @echo A B C D E | tr -d '\12\15' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@ -$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@ fnarydel:: *************** *** 1024,1032 **** --- 1053,1105 ---- @$(AWK) -f $(srcdir)/funsemnl.awk >_$@ -$(CMP) $(srcdir)/funsemnl.ok _$@ && rm -f _$@ + ofmtfidl:: + @$(AWK) -f $(srcdir)/ofmtfidl.awk $(srcdir)/ofmtfidl.in >_$@ + -$(CMP) $(srcdir)/ofmtfidl.ok _$@ && rm -f _$@ + + onlynl:: + @$(AWK) -f $(srcdir)/onlynl.awk $(srcdir)/onlynl.in >_$@ + -$(CMP) $(srcdir)/onlynl.ok _$@ && rm -f _$@ + + arrymem1:: + @$(AWK) -f $(srcdir)/arrymem1.awk >_$@ + -$(CMP) $(srcdir)/arrymem1.ok _$@ && rm -f _$@ + + compare2:: + @$(AWK) -f $(srcdir)/compare2.awk >_$@ + -$(CMP) $(srcdir)/compare2.ok _$@ && rm -f _$@ + + minusstr:: + @$(AWK) -f $(srcdir)/minusstr.awk >_$@ + -$(CMP) $(srcdir)/minusstr.ok _$@ && rm -f _$@ + + membug1:: + @$(AWK) -f $(srcdir)/membug1.awk $(srcdir)/membug1.in >_$@ + -$(CMP) $(srcdir)/membug1.ok _$@ && rm -f _$@ + + forsimp:: + @$(AWK) -f $(srcdir)/forsimp.awk >_$@ + -$(CMP) $(srcdir)/forsimp.ok _$@ && rm -f _$@ + + concat1:: + @$(AWK) -f $(srcdir)/concat1.awk $(srcdir)/concat1.in >_$@ + -$(CMP) $(srcdir)/concat1.ok _$@ && rm -f _$@ + + longsub:: + @$(AWK) -f $(srcdir)/longsub.awk $(srcdir)/longsub.in >_$@ + -$(CMP) $(srcdir)/longsub.ok _$@ && rm -f _$@ + clean: rm -fr _* core junk out1 out2 out3 strftime.ok test1 test2 seq *~ + # An attempt to print something that can be grepped for in build logs + pass-fail: + @COUNT=`ls _* 2>/dev/null | wc -l` ; \ + if test $$COUNT = 0 ; \ + then echo ALL TESTS PASSED ; \ + else echo $$COUNT TESTS FAILED ; \ + fi + # This target for my convenience to look at all the results diffout: for i in _* ; \ diff -crN gawk-3.1.0/test/Makefile.in gawk-3.1.1/test/Makefile.in *** gawk-3.1.0/test/Makefile.in Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/Makefile.in Mon Apr 29 17:36:56 2002 *************** *** 0 **** --- 1,1325 ---- + # 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@ + + # + # test/Makefile.am --- automake input file for gawk + # + # Copyright (C) 1988-2002 the Free Software Foundation, Inc. + # + # This file is part of GAWK, the GNU implementation of the + # AWK Programming Language. + # + # GAWK 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. + # + # GAWK 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 + # + + 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@ + CATOBJEXT = @CATOBJEXT@ + CC = @CC@ + CFLAGS = @CFLAGS@ + CPP = @CPP@ + DATADIRNAME = @DATADIRNAME@ + DEPDIR = @DEPDIR@ + EXEEXT = @EXEEXT@ + GENCAT = @GENCAT@ + GLIBC21 = @GLIBC21@ + GMSGFMT = @GMSGFMT@ + HAVE_LIB = @HAVE_LIB@ + INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ + INSTOBJEXT = @INSTOBJEXT@ + INTLBISON = @INTLBISON@ + INTLLIBS = @INTLLIBS@ + INTLOBJS = @INTLOBJS@ + INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ + LIB = @LIB@ + LIBICONV = @LIBICONV@ + LIBINTL = @LIBINTL@ + LN_S = @LN_S@ + LTLIB = @LTLIB@ + LTLIBICONV = @LTLIBICONV@ + LTLIBINTL = @LTLIBINTL@ + MKINSTALLDIRS = @MKINSTALLDIRS@ + OBJEXT = @OBJEXT@ + PACKAGE = @PACKAGE@ + POSUB = @POSUB@ + RANLIB = @RANLIB@ + SOCKET_LIBS = @SOCKET_LIBS@ + U = @U@ + USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ + USE_NLS = @USE_NLS@ + VERSION = @VERSION@ + YACC = @YACC@ + am__include = @am__include@ + am__quote = @am__quote@ + install_sh = @install_sh@ + AWK = ../gawk + + # Special stuff for OS/2 + PATH_SEPARATOR = @PATH_SEPARATOR@ + + EXTRA_DIST = \ + reg \ + lib \ + README \ + addcomma.awk \ + addcomma.in \ + addcomma.ok \ + anchgsub.awk \ + anchgsub.in \ + anchgsub.ok \ + argarray.awk \ + argarray.in \ + argarray.ok \ + argtest.awk \ + argtest.ok \ + arrayparm.awk \ + arrayparm.ok \ + arrayref.awk \ + arrayref.ok \ + arynasty.awk \ + arynasty.ok \ + arynocls.awk \ + arynocls.in \ + arynocls.ok \ + arysubnm.awk \ + arysubnm.ok \ + arrymem1.awk \ + arrymem1.ok \ + asgext.awk \ + asgext.in \ + asgext.ok \ + awkpath.ok \ + back89.in \ + back89.ok \ + backgsub.awk \ + backgsub.in \ + backgsub.ok \ + badargs.ok \ + childin.ok \ + clobber.awk \ + clobber.ok \ + clos1way.awk \ + clos1way.ok \ + clsflnam.awk \ + clsflnam.in \ + clsflnam.ok \ + compare.awk \ + compare.in \ + compare.ok \ + compare2.awk \ + compare2.ok \ + concat1.awk \ + concat1.in \ + concat1.ok \ + convfmt.awk \ + convfmt.ok \ + datanonl.awk \ + datanonl.in \ + datanonl.ok \ + defref.awk \ + defref.ok \ + delarprm.awk \ + delarprm.ok \ + dynlj.awk \ + dynlj.ok \ + eofsplit.awk \ + eofsplit.ok \ + fflush.ok \ + fflush.sh \ + fieldwdth.ok \ + fldchg.awk \ + fldchg.in \ + fldchg.ok \ + fldchgnf.awk \ + fldchgnf.in \ + fldchgnf.ok \ + fnamedat.awk \ + fnamedat.in \ + fnamedat.ok \ + fnarray.awk \ + fnarray.ok \ + fnarydel.awk \ + fnarydel.ok \ + fnaryscl.awk \ + fnaryscl.ok \ + fnasgnm.awk \ + fnasgnm.in \ + fnasgnm.ok \ + fnparydl.awk \ + fnparydl.ok \ + forsimp.awk \ + forsimp.ok \ + fsbs.in \ + fsbs.ok \ + fsfwfs.awk \ + fsfwfs.in \ + fsfwfs.ok \ + fsrs.awk \ + fsrs.in \ + fsrs.ok \ + fstabplus.awk \ + fstabplus.ok \ + funsemnl.awk \ + funsemnl.ok \ + funsmnam.awk \ + funsmnam.ok \ + funstack.awk \ + funstack.in \ + funstack.ok \ + gensub.awk \ + gensub.in \ + gensub.ok \ + getline.awk \ + getline.ok \ + getlnbuf.awk \ + getlnbuf.in \ + getlnbuf.ok \ + getlnhd.awk \ + getlnhd.ok \ + getnr2tb.awk \ + getnr2tb.in \ + getnr2tb.ok \ + getnr2tm.awk \ + getnr2tm.in \ + getnr2tm.ok \ + gnuops2.awk \ + gnuops2.ok \ + gnureops.awk \ + gnureops.ok \ + gsubasgn.awk \ + gsubasgn.ok \ + gsubtest.awk \ + gsubtest.ok \ + gtlnbufv.awk \ + hsprint.awk \ + hsprint.ok \ + igncdym.awk \ + igncdym.in \ + igncdym.ok \ + igncfs.awk \ + igncfs.in \ + igncfs.ok \ + ignrcase.ok \ + inftest.awk \ + inftest.ok \ + intest.awk \ + intest.ok \ + intprec.awk \ + intprec.ok \ + leaddig.awk \ + leaddig.ok \ + leadnl.awk \ + leadnl.in \ + leadnl.ok \ + lint.awk \ + lint.ok \ + litoct.awk \ + litoct.ok \ + longsub.awk \ + longsub.in \ + longsub.ok \ + longwrds.awk \ + longwrds.ok \ + manpage \ + manyfiles.awk \ + math.awk \ + math.ok \ + membug1.awk \ + membug1.in \ + membug1.ok \ + messages.awk \ + minusstr.awk \ + minusstr.ok \ + mmap8k.in \ + nasty.awk \ + nasty.ok \ + nasty2.awk \ + nasty2.ok \ + negexp.ok \ + nfldstr.ok \ + nfset.awk \ + nfset.in \ + nfset.ok \ + nlfldsep.awk \ + nlfldsep.in \ + nlfldsep.ok \ + nlinstr.awk \ + nlinstr.in \ + nlinstr.ok \ + nlstrina.awk \ + nlstrina.ok \ + noeffect.awk \ + noeffect.ok \ + nofmtch.awk \ + nofmtch.ok \ + nondec.awk \ + nondec.ok \ + nonl.awk \ + nonl.ok \ + noparms.awk \ + noparms.ok \ + nors.in \ + nors.ok \ + numindex.awk \ + numindex.in \ + numindex.ok \ + numsubstr.awk \ + numsubstr.in \ + numsubstr.ok \ + octsub.awk \ + octsub.ok \ + ofmt.awk \ + ofmt.in \ + ofmt.ok \ + ofmtbig.awk \ + ofmtbig.in \ + ofmtbig.ok \ + ofmtfidl.awk \ + ofmtfidl.in \ + ofmtfidl.ok \ + ofmts.awk \ + ofmts.in \ + ofmts.ok \ + onlynl.awk \ + onlynl.in \ + onlynl.ok \ + opasnidx.awk \ + opasnidx.ok \ + opasnslf.awk \ + opasnslf.ok \ + out1.ok \ + out2.ok \ + out3.ok \ + paramdup.awk \ + paramdup.ok \ + paramtyp.awk \ + paramtyp.ok \ + parseme.awk \ + parseme.ok \ + pcntplus.awk \ + pcntplus.ok \ + pid.awk \ + pid.ok \ + pid.sh \ + pipeio1.awk \ + pipeio1.ok \ + pipeio2.awk \ + pipeio2.in \ + pipeio2.ok \ + posix.awk \ + posix.ok \ + poundbang.awk \ + poundbang.ok \ + prdupval.awk \ + prdupval.in \ + prdupval.ok \ + printf1.awk \ + printf1.ok \ + printfloat.awk \ + prmarscl.awk \ + prmarscl.ok \ + prmreuse.awk \ + prmreuse.ok \ + procinfs.awk \ + procinfs.ok \ + prt1eval.awk \ + prt1eval.ok \ + prtoeval.awk \ + prtoeval.ok \ + psx96sub.awk \ + psx96sub.ok \ + rand.awk \ + rand.ok \ + rebt8b1.awk \ + rebt8b1.ok \ + rebt8b2.awk \ + rebt8b2.ok \ + redfilnm.awk \ + redfilnm.in \ + redfilnm.ok \ + regeq.awk \ + regeq.in \ + regeq.ok \ + regtest.sh \ + regx8bit.awk \ + regx8bit.ok \ + reindops.awk \ + reindops.in \ + reindops.ok \ + reint.awk \ + reint.in \ + reint.ok \ + reparse.awk \ + reparse.in \ + reparse.ok \ + resplit.ok \ + rs.in \ + rs.ok \ + rsnul1nl.awk \ + rsnul1nl.in \ + rsnul1nl.ok \ + rswhite.awk \ + rswhite.in \ + rswhite.ok \ + sclforin.awk \ + sclforin.ok \ + sclifin.awk \ + sclifin.ok \ + shadow.awk \ + shadow.ok \ + sort1.awk \ + sort1.ok \ + splitargv.awk \ + splitargv.in \ + splitargv.ok \ + splitdef.awk \ + splitdef.ok \ + splitvar.awk \ + splitvar.in \ + splitvar.ok \ + splitwht.awk \ + splitwht.ok \ + sprintfc.awk \ + sprintfc.in \ + sprintfc.ok \ + strtod.awk \ + strtod.in \ + strtod.ok \ + strftime.awk \ + strftlng.awk \ + strftlng.ok \ + subslash.awk \ + subslash.ok \ + substr.awk \ + substr.ok \ + swaplns.awk \ + swaplns.in \ + swaplns.ok \ + tradanch.awk \ + tradanch.in \ + tradanch.ok \ + tweakfld.awk \ + tweakfld.in \ + tweakfld.ok \ + zeroflag.awk \ + zeroflag.ok + + + CMP = cmp + subdir = test + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = $(top_builddir)/config.h + CONFIG_CLEAN_FILES = + DIST_SOURCES = + DIST_COMMON = README ChangeLog Makefile.am Makefile.in + all: all-am + + .SUFFIXES: + $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu test/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 + + + # message stuff is to make it a little easier to follow + check: msg \ + basic-msg-start basic basic-msg-end \ + unix-msg-start unix-tests unix-msg-end \ + extend-msg-start gawk-extensions extend-msg-end \ + pass-fail + + # try to keep these sorted + basic: addcomma anchgsub argarray arrayparm arrayref arynasty arynocls \ + arysubnm arrymem1 asgext awkpath back89 backgsub childin clobber \ + clsflnam compare compare2 concat1 convfmt datanonl defref delarprm dynlj eofsplit \ + fldchg fldchgnf fnamedat fnarray fnarydel fnaryscl fnasgnm \ + fnparydl forsimp fsbs fsrs fstabplus funsemnl funsmnam funstack getline \ + getlnbuf getnr2tb getnr2tm gsubasgn gsubtest hsprint intest \ + intprec leaddig leadnl litoct longsub longwrds math membug1 messages minusstr \ + mmap8k nasty nasty2 negexp nfldstr nfset nlfldsep nlinstr nlstrina \ + noeffect nofmtch nonl noparms nors numindex numsubstr octsub \ + ofmt ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf paramdup paramtyp \ + parseme pcntplus prdupval printf1 prmarscl prmreuse prt1eval \ + prtoeval psx96sub rand rebt8b1 rebt8b2 redfilnm regeq reindops \ + reparse resplit rs rsnul1nl rswhite sclforin sclifin splitargv \ + splitdef splitvar splitwht sprintfc strtod subslash substr \ + swaplns tradanch tweakfld zeroflag + + unix-tests: fflush getlnhd pid pipeio1 pipeio2 poundbang strftlng + + gawk-extensions: argtest badargs clos1way fieldwdth fsfwfs gensub \ + gnuops2 gnureops igncdym igncfs ignrcase lint manyfiles nondec \ + posix procinfs regx8bit reint shadow sort1 strftime + + extra: regtest inftest inet + + inet: inetmesg inetechu inetecht inetdayu inetdayt + + msg:: + @echo 'Any output from "cmp" is bad news, although some differences' + @echo 'in floating point values are probably benign -- in particular,' + @echo 'some systems may omit a leading zero and the floating point' + @echo 'precision may lead to slightly different output in a few cases.' + + basic-msg-start: + @echo "======== Starting basic tests ========" + + basic-msg-end: + @echo "======== Done with basic tests ========" + + unix-msg-start: + @echo "======== Starting Unix tests ========" + + unix-msg-end: + @echo "======== Done with Unix tests ========" + + extend-msg-start: + @echo "======== Starting gawk extension tests ========" + + extend-msg-end: + @echo "======== Done with gawk extension tests ========" + + # This test is a PITA because increasingly, /tmp is getting + # mounted noexec. So, we'll test it. Sigh. + poundbang:: + @cp $(AWK) /tmp/gawk + @if /tmp/gawk 'BEGIN { print "OK" }' | grep OK > /dev/null ; \ + then \ + $(srcdir)/poundbang.awk $(srcdir)/poundbang.awk >_`basename $@` ; \ + $(CMP) $(srcdir)/poundbang.ok _`basename $@` && rm -f _`basename $@` && echo poundbang is ok ; \ + else \ + echo "*** /tmp is apparently mounted noexec, skipping poundbang test." ; \ + fi + @rm -f /tmp/gawk + + swaplns:: + @$(AWK) -f $(srcdir)/swaplns.awk $(srcdir)/swaplns.in >_$@ + -$(CMP) $(srcdir)/swaplns.ok _$@ && rm -f _$@ + + messages:: + @$(AWK) -f $(srcdir)/messages.awk >out2 2>out3 + -$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3 + + argarray:: + @case $(srcdir) in \ + .) : ;; \ + *) cp $(srcdir)/argarray.in . ;; \ + esac + @TEST=test echo just a test | $(AWK) -f $(srcdir)/argarray.awk ./argarray.in - >_$@ + -$(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@ + + fstabplus:: + @echo '1 2' | $(AWK) -f $(srcdir)/fstabplus.awk >_$@ + -$(CMP) $(srcdir)/fstabplus.ok _$@ && rm -f _$@ + + fsrs:: + @$(AWK) -f $(srcdir)/fsrs.awk $(srcdir)/fsrs.in >_$@ + -$(CMP) $(srcdir)/fsrs.ok _$@ && rm -f _$@ + + igncfs:: + @$(AWK) -f $(srcdir)/igncfs.awk $(srcdir)/igncfs.in >_$@ + -$(CMP) $(srcdir)/igncfs.ok _$@ && rm -f _$@ + + longwrds:: + @$(AWK) -f $(srcdir)/longwrds.awk $(srcdir)/manpage | (LC_ALL=C sort) >_$@ + -$(CMP) $(srcdir)/longwrds.ok _$@ && rm -f _$@ + + fieldwdth:: + @echo '123456789' | $(AWK) -v FIELDWIDTHS="2 3 4" '{ print $$2}' >_$@ + -$(CMP) $(srcdir)/fieldwdth.ok _$@ && rm -f _$@ + + ignrcase:: + @echo xYz | $(AWK) -v IGNORECASE=1 '{ sub(/y/, ""); print}' >_$@ + -$(CMP) $(srcdir)/ignrcase.ok _$@ && rm -f _$@ + + regtest:: + @echo 'Some of the output from regtest is very system specific, do not' + @echo 'be distressed if your output differs from that distributed.' + @echo 'Manual inspection is called for.' + AWK=`pwd`/$(AWK) $(srcdir)/regtest.sh + + posix:: + @echo '1:2,3 4' | $(AWK) -f $(srcdir)/posix.awk >_$@ + -$(CMP) $(srcdir)/posix.ok _$@ && rm -f _$@ + + manyfiles:: + @rm -rf junk + @mkdir junk + @$(AWK) 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >_$@ + @$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@ + @echo "This number better be 1 ->" | tr -d '\012\015' + @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l + @rm -rf junk _$@ + + compare:: + @$(AWK) -f $(srcdir)/compare.awk 0 1 $(srcdir)/compare.in >_$@ + -$(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@ + + arrayref:: + @$(AWK) -f $(srcdir)/arrayref.awk >_$@ + -$(CMP) $(srcdir)/arrayref.ok _$@ && rm -f _$@ + + rs:: + @$(AWK) -v RS="" '{ print $$1, $$2}' $(srcdir)/rs.in >_$@ + -$(CMP) $(srcdir)/rs.ok _$@ && rm -f _$@ + + fsbs:: + @$(AWK) -v FS='\' '{ print $$1, $$2 }' $(srcdir)/fsbs.in >_$@ + -$(CMP) $(srcdir)/fsbs.ok _$@ && rm -f _$@ + + inftest:: + @echo This test is very machine specific... + @$(AWK) -f $(srcdir)/inftest.awk | sed 's/inf/Inf/g' >_$@ + -$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@ + + getline:: + @$(AWK) -f $(srcdir)/getline.awk $(srcdir)/getline.awk $(srcdir)/getline.awk >_$@ + -$(CMP) $(srcdir)/getline.ok _$@ && rm -f _$@ + + rand:: + @$(AWK) -f $(srcdir)/rand.awk >_$@ + -$(CMP) $(srcdir)/rand.ok _$@ && rm -f _$@ + + negexp:: + @$(AWK) 'BEGIN { a = -2; print 10^a }' >_$@ + -$(CMP) $(srcdir)/negexp.ok _$@ && rm -f _$@ + + asgext:: + @$(AWK) -f $(srcdir)/asgext.awk $(srcdir)/asgext.in >_$@ + -$(CMP) $(srcdir)/asgext.ok _$@ && rm -f _$@ + + anchgsub:: + @$(AWK) -f $(srcdir)/anchgsub.awk $(srcdir)/anchgsub.in >_$@ + -$(CMP) $(srcdir)/anchgsub.ok _$@ && rm -f _$@ + + splitargv:: + @$(AWK) -f $(srcdir)/splitargv.awk $(srcdir)/splitargv.in >_$@ + -$(CMP) $(srcdir)/splitargv.ok _$@ && rm -f _$@ + + awkpath:: + @AWKPATH="$(srcdir)$(PATH_SEPARATOR)$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@ + -$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@ + + nfset:: + @$(AWK) -f $(srcdir)/nfset.awk $(srcdir)/nfset.in >_$@ + -$(CMP) $(srcdir)/nfset.ok _$@ && rm -f _$@ + + reparse:: + @$(AWK) -f $(srcdir)/reparse.awk $(srcdir)/reparse.in >_$@ + -$(CMP) $(srcdir)/reparse.ok _$@ && rm -f _$@ + + argtest:: + @$(AWK) -f $(srcdir)/argtest.awk -x -y abc >_$@ + -$(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@ + + badargs:: + @-$(AWK) -f 2>&1 | grep -v patchlevel >_$@ + -$(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@ + + convfmt:: + @$(AWK) -f $(srcdir)/convfmt.awk >_$@ + -$(CMP) $(srcdir)/convfmt.ok _$@ && rm -f _$@ + + arrayparm:: + @-AWKPATH=$(srcdir) $(AWK) -f arrayparm.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/arrayparm.ok _$@ && rm -f _$@ + + paramdup:: + @-AWKPATH=$(srcdir) $(AWK) -f paramdup.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/paramdup.ok _$@ && rm -f _$@ + + nonl:: + @-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1 + -$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@ + + defref:: + @-AWKPATH=$(srcdir) $(AWK) --lint -f defref.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/defref.ok _$@ && rm -f _$@ + + nofmtch:: + @-AWKPATH=$(srcdir) $(AWK) --lint -f nofmtch.awk >_$@ 2>&1 + -$(CMP) $(srcdir)/nofmtch.ok _$@ && rm -f _$@ + + strftime:: + : this test could fail on slow machines or on a second boundary, + : so if it does, double check the actual results + @LC_ALL=C; export LC_ALL; LANG=C; export LANG; \ + TZ=GMT0; export TZ; \ + date | $(AWK) -v OUTPUT=_$@ -f $(srcdir)/strftime.awk + -$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0 + + litoct:: + @echo ab | $(AWK) --traditional -f $(srcdir)/litoct.awk >_$@ + -$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@ + + gensub:: + @$(AWK) -f $(srcdir)/gensub.awk $(srcdir)/gensub.in >_$@ + -$(CMP) $(srcdir)/gensub.ok _$@ && rm -f _$@ + + resplit:: + @echo a:b:c d:e:f | $(AWK) '{ FS = ":"; $$0 = $$0; print $$2 }' > _$@ + -$(CMP) $(srcdir)/resplit.ok _$@ && rm -f _$@ + + rswhite:: + @$(AWK) -f $(srcdir)/rswhite.awk $(srcdir)/rswhite.in > _$@ + -$(CMP) $(srcdir)/rswhite.ok _$@ && rm -f _$@ + + prmarscl:: + @-AWKPATH=$(srcdir) $(AWK) -f prmarscl.awk > _$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/prmarscl.ok _$@ && rm -f _$@ + + sclforin:: + @-AWKPATH=$(srcdir) $(AWK) -f sclforin.awk > _$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/sclforin.ok _$@ && rm -f _$@ + + sclifin:: + @-AWKPATH=$(srcdir) $(AWK) -f sclifin.awk > _$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/sclifin.ok _$@ && rm -f _$@ + + intprec:: + @-$(AWK) -f $(srcdir)/intprec.awk > _$@ 2>&1 + -$(CMP) $(srcdir)/intprec.ok _$@ && rm -f _$@ + + childin:: + @echo hi | $(AWK) 'BEGIN { "cat" | getline; print; close("cat") }' > _$@ + -$(CMP) $(srcdir)/childin.ok _$@ && rm -f _$@ + + noeffect:: + @-AWKPATH=$(srcdir) $(AWK) --lint -f noeffect.awk > _$@ 2>&1 + -$(CMP) $(srcdir)/noeffect.ok _$@ && rm -f _$@ + + numsubstr:: + @-AWKPATH=$(srcdir) $(AWK) -f numsubstr.awk $(srcdir)/numsubstr.in >_$@ + -$(CMP) $(srcdir)/numsubstr.ok _$@ && rm -f _$@ + + gnureops:: + @$(AWK) -f $(srcdir)/gnureops.awk >_$@ + -$(CMP) $(srcdir)/gnureops.ok _$@ && rm -f _$@ + + pcntplus:: + @$(AWK) -f $(srcdir)/pcntplus.awk >_$@ + -$(CMP) $(srcdir)/pcntplus.ok _$@ && rm -f _$@ + + prmreuse:: + @$(AWK) -f $(srcdir)/prmreuse.awk >_$@ + -$(CMP) $(srcdir)/prmreuse.ok _$@ && rm -f _$@ + + math:: + @$(AWK) -f $(srcdir)/math.awk >_$@ + -$(CMP) $(srcdir)/math.ok _$@ && rm -f _$@ + + fflush:: + @$(srcdir)/fflush.sh >_$@ + -$(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@ + + fldchg:: + @$(AWK) -f $(srcdir)/fldchg.awk $(srcdir)/fldchg.in >_$@ + -$(CMP) $(srcdir)/fldchg.ok _$@ && rm -f _$@ + + fldchgnf:: + @$(AWK) -f $(srcdir)/fldchgnf.awk $(srcdir)/fldchgnf.in >_$@ + -$(CMP) $(srcdir)/fldchgnf.ok _$@ && rm -f _$@ + + reindops:: + @$(AWK) -f $(srcdir)/reindops.awk $(srcdir)/reindops.in >_$@ + -$(CMP) $(srcdir)/reindops.ok _$@ && rm -f _$@ + + sprintfc:: + @$(AWK) -f $(srcdir)/sprintfc.awk $(srcdir)/sprintfc.in >_$@ + -$(CMP) $(srcdir)/sprintfc.ok _$@ && rm -f _$@ + + getlnhd:: + @$(AWK) -f $(srcdir)/getlnhd.awk >_$@ + -$(CMP) $(srcdir)/getlnhd.ok _$@ && rm -f _$@ + + backgsub:: + @$(AWK) -f $(srcdir)/backgsub.awk $(srcdir)/backgsub.in >_$@ + -$(CMP) $(srcdir)/backgsub.ok _$@ && rm -f _$@ + + tweakfld:: + @$(AWK) -f $(srcdir)/tweakfld.awk $(srcdir)/tweakfld.in >_$@ + @rm -f errors.cleanup + -$(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@ + + clsflnam:: + @$(AWK) -f $(srcdir)/clsflnam.awk $(srcdir)/clsflnam.in >_$@ 2>&1 + -$(CMP) $(srcdir)/clsflnam.ok _$@ && rm -f _$@ + + mmap8k:: + @$(AWK) '{ print }' $(srcdir)/mmap8k.in >_$@ + -$(CMP) $(srcdir)/mmap8k.in _$@ && rm -f _$@ + + fnarray:: + @-AWKPATH=$(srcdir) $(AWK) -f fnarray.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/fnarray.ok _$@ && rm -f _$@ + + dynlj:: + @$(AWK) -f $(srcdir)/dynlj.awk >_$@ + -$(CMP) $(srcdir)/dynlj.ok _$@ && rm -f _$@ + + substr:: + @$(AWK) -f $(srcdir)/substr.awk >_$@ + -$(CMP) $(srcdir)/substr.ok _$@ && rm -f _$@ + + eofsplit:: + @$(AWK) -f $(srcdir)/eofsplit.awk >_$@ + -$(CMP) $(srcdir)/eofsplit.ok _$@ && rm -f _$@ + + prt1eval:: + @$(AWK) -f $(srcdir)/prt1eval.awk >_$@ + -$(CMP) $(srcdir)/prt1eval.ok _$@ && rm -f _$@ + + gsubasgn:: + @-AWKPATH=$(srcdir) $(AWK) -f gsubasgn.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/gsubasgn.ok _$@ && rm -f _$@ + + prtoeval:: + @$(AWK) -f $(srcdir)/prtoeval.awk >_$@ + -$(CMP) $(srcdir)/prtoeval.ok _$@ && rm -f _$@ + + gsubtest:: + @$(AWK) -f $(srcdir)/gsubtest.awk >_$@ + -$(CMP) $(srcdir)/gsubtest.ok _$@ && rm -f _$@ + + splitwht:: + @$(AWK) -f $(srcdir)/splitwht.awk >_$@ + -$(CMP) $(srcdir)/splitwht.ok _$@ && rm -f _$@ + + back89:: + @$(AWK) '/a\8b/' $(srcdir)/back89.in >_$@ + -$(CMP) $(srcdir)/back89.ok _$@ && rm -f _$@ + + tradanch:: + @$(AWK) --traditional -f $(srcdir)/tradanch.awk $(srcdir)/tradanch.in >_$@ + -$(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@ + + nlfldsep:: + @$(AWK) -f $(srcdir)/nlfldsep.awk $(srcdir)/nlfldsep.in > _$@ + -$(CMP) $(srcdir)/nlfldsep.ok _$@ && rm -f _$@ + + splitvar:: + @$(AWK) -f $(srcdir)/splitvar.awk $(srcdir)/splitvar.in >_$@ + -$(CMP) $(srcdir)/splitvar.ok _$@ && rm -f _$@ + + intest:: + @$(AWK) -f $(srcdir)/intest.awk >_$@ + -$(CMP) $(srcdir)/intest.ok _$@ && rm -f _$@ + + # AIX /bin/sh exec's the last command in a list, therefore issue a ":" + # command so that pid.sh is fork'ed as a child before being exec'ed. + pid:: + @AWKPATH=$(srcdir) AWK=$(AWK) $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; : + -$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in + + strftlng:: + @TZ=UTC; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ + @if $(CMP) -s $(srcdir)/strftlng.ok _$@ ; then : ; else \ + TZ=UTC0; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \ + fi + -$(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@ + + nfldstr:: + @echo | $(AWK) '$$1 == 0 { print "bug" }' > _$@ + -$(CMP) $(srcdir)/nfldstr.ok _$@ && rm -f _$@ + + nors:: + @echo A B C D E | tr -d '\12\15' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@ + -$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@ + + fnarydel:: + @$(AWK) -f $(srcdir)/fnarydel.awk >_$@ + -$(CMP) $(srcdir)/fnarydel.ok _$@ && rm -f _$@ + + reint:: + @$(AWK) --re-interval -f $(srcdir)/reint.awk $(srcdir)/reint.in >_$@ + -$(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@ + + noparms:: + @-AWKPATH=$(srcdir) $(AWK) -f noparms.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/noparms.ok _$@ && rm -f _$@ + + pipeio1:: + @$(AWK) -f $(srcdir)/pipeio1.awk >_$@ + @rm -f test1 test2 + -$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@ + + pipeio2:: + @$(AWK) -v SRCDIR=$(srcdir) -f $(srcdir)/pipeio2.awk >_$@ + -$(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@ + + funstack:: + @$(AWK) -f $(srcdir)/funstack.awk $(srcdir)/funstack.in >_$@ + -$(CMP) $(srcdir)/funstack.ok _$@ && rm -f _$@ + + clobber:: + @$(AWK) -f $(srcdir)/clobber.awk >_$@ + -$(CMP) $(srcdir)/clobber.ok seq && $(CMP) $(srcdir)/clobber.ok _$@ && rm -f _$@ + @rm -f seq + + delarprm:: + @$(AWK) -f $(srcdir)/delarprm.awk >_$@ + -$(CMP) $(srcdir)/delarprm.ok _$@ && rm -f _$@ + + prdupval:: + @$(AWK) -f $(srcdir)/prdupval.awk $(srcdir)/prdupval.in >_$@ + -$(CMP) $(srcdir)/prdupval.ok _$@ && rm -f _$@ + + nondec:: + @if grep BITOP ../config.h | grep define > /dev/null; \ + then \ + $(AWK) -f $(srcdir)/nondec.awk >_$@; \ + else \ + cp $(srcdir)/nondec.ok _$@; \ + fi + -$(CMP) $(srcdir)/nondec.ok _$@ && rm -f _$@ + + nasty:: + @$(AWK) -f $(srcdir)/nasty.awk >_$@ + -$(CMP) $(srcdir)/nasty.ok _$@ && rm -f _$@ + + nasty2:: + @$(AWK) -f $(srcdir)/nasty2.awk >_$@ + -$(CMP) $(srcdir)/nasty2.ok _$@ && rm -f _$@ + + zeroflag:: + @$(AWK) -f $(srcdir)/zeroflag.awk >_$@ + -$(CMP) $(srcdir)/zeroflag.ok _$@ && rm -f _$@ + + getnr2tm:: + @$(AWK) -f $(srcdir)/getnr2tm.awk $(srcdir)/getnr2tm.in >_$@ + -$(CMP) $(srcdir)/getnr2tm.ok _$@ && rm -f _$@ + + getnr2tb:: + @$(AWK) -f $(srcdir)/getnr2tb.awk $(srcdir)/getnr2tb.in >_$@ + -$(CMP) $(srcdir)/getnr2tb.ok _$@ && rm -f _$@ + + printf1:: + @$(AWK) -f $(srcdir)/printf1.awk >_$@ + -$(CMP) $(srcdir)/printf1.ok _$@ && rm -f _$@ + + funsmnam:: + @-AWKPATH=$(srcdir) $(AWK) -f funsmnam.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/funsmnam.ok _$@ && rm -f _$@ + + fnamedat:: + @-AWKPATH=$(srcdir) $(AWK) -f fnamedat.awk < $(srcdir)/fnamedat.in >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/fnamedat.ok _$@ && rm -f _$@ + + numindex:: + @-AWKPATH=$(srcdir) $(AWK) -f numindex.awk < $(srcdir)/numindex.in >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/numindex.ok _$@ && rm -f _$@ + + subslash:: + @-AWKPATH=$(srcdir) $(AWK) -f subslash.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/subslash.ok _$@ && rm -f _$@ + + opasnslf:: + @-AWKPATH=$(srcdir) $(AWK) -f opasnslf.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/opasnslf.ok _$@ && rm -f _$@ + + opasnidx:: + @-AWKPATH=$(srcdir) $(AWK) -f opasnidx.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/opasnidx.ok _$@ && rm -f _$@ + + arynocls:: + @-AWKPATH=$(srcdir) $(AWK) -v INPUT=$(srcdir)/arynocls.in -f arynocls.awk >_$@ + -$(CMP) $(srcdir)/arynocls.ok _$@ && rm -f _$@ + + igncdym:: + @-AWKPATH=$(srcdir) $(AWK) -f igncdym.awk $(srcdir)/igncdym.in >_$@ + -$(CMP) $(srcdir)/igncdym.ok _$@ && rm -f _$@ + + getlnbuf:: + @-AWKPATH=$(srcdir) $(AWK) -f getlnbuf.awk $(srcdir)/getlnbuf.in > _$@ + @-AWKPATH=$(srcdir) $(AWK) -f gtlnbufv.awk $(srcdir)/getlnbuf.in > _2$@ + -$(CMP) $(srcdir)/getlnbuf.ok _$@ && $(CMP) $(srcdir)/getlnbuf.ok _2$@ && rm -f _$@ _2$@ + + arysubnm:: + @-AWKPATH=$(srcdir) $(AWK) -f arysubnm.awk >_$@ + -$(CMP) $(srcdir)/arysubnm.ok _$@ && rm -f _$@ + + fnparydl:: + @-AWKPATH=$(srcdir) $(AWK) -f fnparydl.awk >_$@ + -$(CMP) $(srcdir)/fnparydl.ok _$@ && rm -f _$@ + + nlstrina:: + @-AWKPATH=$(srcdir) $(AWK) -f nlstrina.awk >_$@ + -$(CMP) $(srcdir)/nlstrina.ok _$@ && rm -f _$@ + + octsub:: + @-AWKPATH=$(srcdir) $(AWK) -f octsub.awk >_$@ + -$(CMP) $(srcdir)/octsub.ok _$@ && rm -f _$@ + + nlinstr:: + @$(AWK) -f $(srcdir)/nlinstr.awk $(srcdir)/nlinstr.in >_$@ + -$(CMP) $(srcdir)/nlinstr.ok _$@ && rm -f _$@ + + ofmt:: + @$(AWK) -f $(srcdir)/ofmt.awk $(srcdir)/ofmt.in >_$@ + -$(CMP) $(srcdir)/ofmt.ok _$@ && rm -f _$@ + + hsprint:: + @$(AWK) -f $(srcdir)/hsprint.awk >_$@ + -$(CMP) $(srcdir)/hsprint.ok _$@ && rm -f _$@ + + fsfwfs:: + @$(AWK) -f $(srcdir)/fsfwfs.awk $(srcdir)/fsfwfs.in >_$@ + -$(CMP) $(srcdir)/fsfwfs.ok _$@ && rm -f _$@ + + ofmts:: + @$(AWK) -f $(srcdir)/ofmts.awk $(srcdir)/ofmts.in >_$@ + -$(CMP) $(srcdir)/ofmts.ok _$@ && rm -f _$@ + + parseme:: + @-AWKPATH=$(srcdir) $(AWK) -f parseme.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/parseme.ok _$@ && rm -f _$@ + + splitdef:: + @$(AWK) -f $(srcdir)/splitdef.awk >_$@ + -$(CMP) $(srcdir)/splitdef.ok _$@ && rm -f _$@ + + fnaryscl:: + @-AWKPATH=$(srcdir) $(AWK) -f fnaryscl.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/fnaryscl.ok _$@ && rm -f _$@ + + fnasgnm:: + @-AWKPATH=$(srcdir) $(AWK) -f fnasgnm.awk < $(srcdir)/fnasgnm.in >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/fnasgnm.ok _$@ && rm -f _$@ + + lint:: + @-AWKPATH=$(srcdir) $(AWK) -f lint.awk > _$@ 2>&1 + -$(CMP) $(srcdir)/lint.ok _$@ && rm -f _$@ + + procinfs:: + @-$(AWK) -f $(srcdir)/procinfs.awk > _$@ + -$(CMP) $(srcdir)/procinfs.ok _$@ && rm -f _$@ + + sort1:: + @-$(AWK) -f $(srcdir)/sort1.awk > _$@ + -$(CMP) $(srcdir)/sort1.ok _$@ && rm -f _$@ + + ofmtbig:: + @$(AWK) -f $(srcdir)/ofmtbig.awk $(srcdir)/ofmtbig.in >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/ofmtbig.ok _$@ && rm -f _$@ + + inetmesg:: + @echo These tests only work if your system supports the services + @echo "'discard'" at port 9 and "'daytimed" at port 13. Check your + @echo file /etc/services and do "'netstat -a'". + + inetechu:: + @echo This test is for establishing UDP connections + @$(AWK) 'BEGIN {print "" |& "/inet/udp/0/127.0.0.1/9"}' + + inetecht:: + @echo This test is for establishing TCP connections + @$(AWK) 'BEGIN {print "" |& "/inet/tcp/0/127.0.0.1/9"}' + + inetdayu:: + @echo This test is for bidirectional UDP transmission + @$(AWK) 'BEGIN { print "" |& "/inet/udp/0/127.0.0.1/13"; \ + "/inet/udp/0/127.0.0.1/13" |& getline; print $0}' + + inetdayt:: + @echo This test is for bidirectional TCP transmission + @$(AWK) 'BEGIN { print "" |& "/inet/tcp/0/127.0.0.1/13"; \ + "/inet/tcp/0/127.0.0.1/13" |& getline; print $0}' + + paramtyp:: + @$(AWK) -f $(srcdir)/paramtyp.awk >_$@ + -$(CMP) $(srcdir)/paramtyp.ok _$@ && rm -f _$@ + + rsnul1nl:: + @$(AWK) -f $(srcdir)/rsnul1nl.awk $(srcdir)/rsnul1nl.in >_$@ + -$(CMP) $(srcdir)/rsnul1nl.ok _$@ && rm -f _$@ + + datanonl:: + @$(AWK) -f $(srcdir)/datanonl.awk $(srcdir)/datanonl.in >_$@ + -$(CMP) $(srcdir)/datanonl.ok _$@ && rm -f _$@ + + regeq:: + @$(AWK) -f $(srcdir)/regeq.awk $(srcdir)/regeq.in >_$@ + -$(CMP) $(srcdir)/regeq.ok _$@ && rm -f _$@ + + redfilnm:: + @$(AWK) -f $(srcdir)/redfilnm.awk srcdir=$(srcdir) $(srcdir)/redfilnm.in >_$@ + -$(CMP) $(srcdir)/redfilnm.ok _$@ && rm -f _$@ + + strtod:: + @$(AWK) -f $(srcdir)/strtod.awk $(srcdir)/strtod.in >_$@ + -$(CMP) $(srcdir)/strtod.ok _$@ && rm -f _$@ + + leaddig:: + @$(AWK) -v x=2E -f $(srcdir)/leaddig.awk >_$@ + -$(CMP) $(srcdir)/leaddig.ok _$@ && rm -f _$@ + + clos1way:: + @$(AWK) -f $(srcdir)/clos1way.awk >_$@ + -$(CMP) $(srcdir)/clos1way.ok _$@ && rm -f _$@ + + arynasty:: + @$(AWK) -f $(srcdir)/arynasty.awk >_$@ + -$(CMP) $(srcdir)/arynasty.ok _$@ && rm -f _$@ + + shadow:: + @-AWKPATH=$(srcdir) $(AWK) --lint -f shadow.awk >_$@ 2>&1 || exit 0 + -$(CMP) $(srcdir)/shadow.ok _$@ && rm -f _$@ + + regx8bit:: + @$(AWK) -f $(srcdir)/regx8bit.awk >_$@ + -$(CMP) $(srcdir)/regx8bit.ok _$@ && rm -f _$@ + + psx96sub:: + @$(AWK) -f $(srcdir)/psx96sub.awk >_$@ + -$(CMP) $(srcdir)/psx96sub.ok _$@ && rm -f _$@ + + addcomma:: + @$(AWK) -f $(srcdir)/addcomma.awk $(srcdir)/addcomma.in >_$@ + -$(CMP) $(srcdir)/addcomma.ok _$@ && rm -f _$@ + + gnuops2:: + @$(AWK) -f $(srcdir)/gnuops2.awk >_$@ + -$(CMP) $(srcdir)/gnuops2.ok _$@ && rm -f _$@ + + rebt8b1:: + @$(AWK) -f $(srcdir)/rebt8b1.awk >_$@ + -$(CMP) $(srcdir)/rebt8b1.ok _$@ && rm -f _$@ + + rebt8b2:: + @$(AWK) -f $(srcdir)/rebt8b2.awk >_$@ + -$(CMP) $(srcdir)/rebt8b2.ok _$@ && rm -f _$@ + + leadnl:: + @$(AWK) -f $(srcdir)/leadnl.awk $(srcdir)/leadnl.in >_$@ + -$(CMP) $(srcdir)/leadnl.ok _$@ && rm -f _$@ + + funsemnl:: + @$(AWK) -f $(srcdir)/funsemnl.awk >_$@ + -$(CMP) $(srcdir)/funsemnl.ok _$@ && rm -f _$@ + + ofmtfidl:: + @$(AWK) -f $(srcdir)/ofmtfidl.awk $(srcdir)/ofmtfidl.in >_$@ + -$(CMP) $(srcdir)/ofmtfidl.ok _$@ && rm -f _$@ + + onlynl:: + @$(AWK) -f $(srcdir)/onlynl.awk $(srcdir)/onlynl.in >_$@ + -$(CMP) $(srcdir)/onlynl.ok _$@ && rm -f _$@ + + arrymem1:: + @$(AWK) -f $(srcdir)/arrymem1.awk >_$@ + -$(CMP) $(srcdir)/arrymem1.ok _$@ && rm -f _$@ + + compare2:: + @$(AWK) -f $(srcdir)/compare2.awk >_$@ + -$(CMP) $(srcdir)/compare2.ok _$@ && rm -f _$@ + + minusstr:: + @$(AWK) -f $(srcdir)/minusstr.awk >_$@ + -$(CMP) $(srcdir)/minusstr.ok _$@ && rm -f _$@ + + membug1:: + @$(AWK) -f $(srcdir)/membug1.awk $(srcdir)/membug1.in >_$@ + -$(CMP) $(srcdir)/membug1.ok _$@ && rm -f _$@ + + forsimp:: + @$(AWK) -f $(srcdir)/forsimp.awk >_$@ + -$(CMP) $(srcdir)/forsimp.ok _$@ && rm -f _$@ + + concat1:: + @$(AWK) -f $(srcdir)/concat1.awk $(srcdir)/concat1.in >_$@ + -$(CMP) $(srcdir)/concat1.ok _$@ && rm -f _$@ + + longsub:: + @$(AWK) -f $(srcdir)/longsub.awk $(srcdir)/longsub.in >_$@ + -$(CMP) $(srcdir)/longsub.ok _$@ && rm -f _$@ + + clean: + rm -fr _* core junk out1 out2 out3 strftime.ok test1 test2 seq *~ + + # An attempt to print something that can be grepped for in build logs + pass-fail: + @COUNT=`ls _* 2>/dev/null | wc -l` ; \ + if test $$COUNT = 0 ; \ + then echo ALL TESTS PASSED ; \ + else echo $$COUNT TESTS FAILED ; \ + fi + + # This target for my convenience to look at all the results + diffout: + for i in _* ; \ + do \ + echo ============== $$i ============= ; \ + diff -c $${i#_}.ok $$i ; \ + done | more + # 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 -crN gawk-3.1.0/test/arrymem1.awk gawk-3.1.1/test/arrymem1.awk *** gawk-3.1.0/test/arrymem1.awk Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/arrymem1.awk Sat Aug 4 23:40:30 2001 *************** *** 0 **** --- 1,75 ---- + # From spcecdt@armory.com Thu Jun 14 13:24:32 2001 + # Received: from mail.actcom.co.il [192.114.47.13] + # by localhost with POP3 (fetchmail-5.5.0) + # for arnold@localhost (single-drop); Thu, 14 Jun 2001 13:24:32 +0300 (IDT) + # Received: by actcom.co.il (mbox arobbins) + # (with Cubic Circle's cucipop (v1.31 1998/05/13) Thu Jun 14 13:25:13 2001) + # X-From_: spcecdt@armory.com Thu Jun 14 06:34:47 2001 + # Received: from lmail.actcom.co.il by actcom.co.il with ESMTP + # (8.9.1a/actcom-0.2) id GAA29661 for ; + # Thu, 14 Jun 2001 06:34:46 +0300 (EET DST) + # (rfc931-sender: lmail.actcom.co.il [192.114.47.13]) + # Received: from billohost.com (www.billohost.com [209.196.35.10]) + # by lmail.actcom.co.il (8.11.2/8.11.2) with ESMTP id f5E3YiO27337 + # for ; Thu, 14 Jun 2001 06:34:45 +0300 + # Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164]) + # by billohost.com (8.9.3/8.9.3) with ESMTP id XAA02681 + # for ; Wed, 13 Jun 2001 23:33:57 -0400 + # Received: from deepthought.armory.com ([192.122.209.42]) + # by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian)) + # id 15ANu2-00005C-00 + # for ; Wed, 13 Jun 2001 23:34:38 -0400 + # Date: Wed, 13 Jun 2001 20:32:42 -0700 + # From: "John H. DuBois III" + # To: bug-gawk@gnu.org + # Subject: gawk 3.1.0 bug + # Message-ID: <20010613203242.A29975@armory.com> + # Mime-Version: 1.0 + # Content-Type: text/plain; charset=us-ascii + # X-Mailer: Mutt 1.0.1i + # X-Www: http://www.armory.com./~spcecdt/ + # Sender: spcecdt@armory.com + # Status: RO + # + # Under SCO OpenServer 5.0.6a using gawk 3.1.0 compiled with gcc 2.95.2, this + # program: + + BEGIN { + f1(Procs,b) + print "test" + } + + function f1(Procs,a) { + a[""] + f2() + } + + function f2() { + b[""] + } + + # gives: + # + # gawk: ./gtest:5: fatal error: internal error + # + # and dumps core. + # + # gdb gives me this stack backtrace: + # + # #0 0x80019943 in kill () from /usr/lib/libc.so.1 + # #1 0x8003e754 in abort () from /usr/lib/libc.so.1 + # #2 0x8062a87 in catchsig (sig=0, code=0) at main.c:947 + # #3 0x80053a0c in _sigreturn () from /usr/lib/libc.so.1 + # #4 0x80023d36 in cleanfree () from /usr/lib/libc.so.1 + # #5 0x80023156 in _real_malloc () from /usr/lib/libc.so.1 + # #6 0x80023019 in malloc () from /usr/lib/libc.so.1 + # #7 0x8053b95 in do_print (tree=0x0) at builtin.c:1336 + # #8 0x806b47c in interpret (tree=0x8084ee4) at eval.c:606 + # #9 0x806ad8d in interpret (tree=0x8084f0c) at eval.c:384 + # #10 0x806ad21 in interpret (tree=0x8084f5c) at eval.c:367 + # #11 0x8061d5b in main (argc=4, argv=0x80478ac) at main.c:506 + # + # John + # -- + # John DuBois spcecdt@armory.com. KC6QKZ/AE http://www.armory.com./~spcecdt/ + # diff -crN gawk-3.1.0/test/arrymem1.ok gawk-3.1.1/test/arrymem1.ok *** gawk-3.1.0/test/arrymem1.ok Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/arrymem1.ok Sat Aug 4 23:40:46 2001 *************** *** 0 **** --- 1 ---- + test diff -crN gawk-3.1.0/test/badargs.ok gawk-3.1.1/test/badargs.ok *** gawk-3.1.0/test/badargs.ok Sun Jan 21 18:00:37 2001 --- gawk-3.1.1/test/badargs.ok Thu Apr 11 21:38:13 2002 *************** *** 25,27 **** --- 25,34 ---- To report bugs, see node `Bugs' in `gawk.info', which is section `Reporting Problems and Bugs' in the printed version. + + gawk is a pattern scanning and processing language. + By default it reads standard input and writes standard output. + + Examples: + gawk '{ sum += $1 }; END { print sum }' file + gawk -F: '{ print $1 }' /etc/passwd diff -crN gawk-3.1.0/test/compare2.awk gawk-3.1.1/test/compare2.awk *** gawk-3.1.0/test/compare2.awk Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/compare2.awk Sun Aug 5 00:48:31 2001 *************** *** 0 **** --- 1,165 ---- + # From beebe@math.utah.edu Thu Aug 2 15:35:07 2001 + # Received: from mail.actcom.co.il [192.114.47.13] + # by localhost with POP3 (fetchmail-5.7.4) + # for arnold@localhost (single-drop); Thu, 02 Aug 2001 15:35:07 +0300 (IDT) + # Received: by actcom.co.il (mbox arobbins) + # (with Cubic Circle's cucipop (v1.31 1998/05/13) Thu Aug 2 16:02:36 2001) + # X-From_: beebe@sunshine.math.utah.edu Thu Aug 2 15:41:13 2001 + # Received: from lmail.actcom.co.il by actcom.co.il with ESMTP + # (8.9.1a/actcom-0.2) id PAA01349 for ; + # Thu, 2 Aug 2001 15:41:06 +0300 (EET DST) + # (rfc931-sender: mail.actcom.co.il [192.114.47.13]) + # Received: from billohost.com (www.billohost.com [209.196.35.10]) + # by lmail.actcom.co.il (8.11.2/8.11.2) with ESMTP id f72Cf3I21032 + # for ; Thu, 2 Aug 2001 15:41:05 +0300 + # Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164]) + # by billohost.com (8.9.3/8.9.3) with ESMTP id IAA28585 + # for ; Thu, 2 Aug 2001 08:34:38 -0400 + # Received: from sunshine.math.utah.edu ([128.110.198.2]) + # by fencepost.gnu.org with esmtp (Exim 3.22 #1 (Debian)) + # id 15SHjG-00036x-00 + # for ; Thu, 02 Aug 2001 08:37:30 -0400 + # Received: from suncore.math.utah.edu (IDENT:GsUbUdUYCtFLRE4HvnnvhN4JsjooYcfR@suncore0.math.utah.edu [128.110.198.5]) + # by sunshine.math.utah.edu (8.9.3/8.9.3) with ESMTP id GAA00190; + # Thu, 2 Aug 2001 06:37:04 -0600 (MDT) + # Received: (from beebe@localhost) + # by suncore.math.utah.edu (8.9.3/8.9.3) id GAA20469; + # Thu, 2 Aug 2001 06:37:03 -0600 (MDT) + # Date: Thu, 2 Aug 2001 06:37:03 -0600 (MDT) + # From: "Nelson H. F. Beebe" + # To: arnold@gnu.org + # Cc: beebe@math.utah.edu + # X-US-Mail: "Center for Scientific Computing, Department of Mathematics, 322 + # INSCC, University of Utah, 155 S 1400 E RM 233, Salt Lake City, UT + # 84112-0090, USA" + # X-Telephone: +1 801 581 5254 + # X-FAX: +1 801 585 1640, +1 801 581 4148 + # X-URL: http://www.math.utah.edu/~beebe + # Subject: awk implementations: a bug, or new dark corner? + # Message-ID: + # Status: RO + # + # Consider the following program: + # + # % cat bug.awk + BEGIN { + split("00/00/00",mdy,"/") + if ((mdy[1] == 0) && (mdy[2] == 0) && (mdy[3] == 0)) + { + print "OK: zero strings compare equal to number zero" + exit(0) + } + else + { + print "ERROR: zero strings compare unequal to number zero" + exit(1) + } + } + # + # Here are the awk implementation versions (on Sun Solaris 2.7): + # + # % awk -V + # awk version 19990416 + # + # % mawk -W version + # mawk 1.3.3 Nov 1996, Copyright (C) Michael D. Brennan + # + # % nawk -V + # awk version 20001115 + # + # % gawk --version + # GNU Awk 3.1.10 + # ... + # + # Here's what they say about the test program: + # + # foreach f (awk mawk nawk gawk gawk-*) + # echo ======== $f + # $f -f ~/bug.awk + # end + # + # ======== awk + # OK: zero strings compare equal to number zero + # ======== mawk + # OK: zero strings compare equal to number zero + # ======== nawk + # OK: zero strings compare equal to number zero + # ======== gawk + # ERROR: zero strings compare unequal to number zero + # ======== gawk-3.0.0 + # OK: zero strings compare equal to number zero + # ======== gawk-3.0.1 + # OK: zero strings compare equal to number zero + # ======== gawk-3.0.3 + # OK: zero strings compare equal to number zero + # ======== gawk-3.0.4 + # OK: zero strings compare equal to number zero + # ======== gawk-3.0.5 + # OK: zero strings compare equal to number zero + # ======== gawk-3.0.6 + # OK: zero strings compare equal to number zero + # ======== gawk-3.0.60 + # OK: zero strings compare equal to number zero + # ======== gawk-3.0.90 + # ERROR: zero strings compare unequal to number zero + # ======== gawk-3.0.91 + # ERROR: zero strings compare unequal to number zero + # ======== gawk-3.0.92 + # ERROR: zero strings compare unequal to number zero + # ======== gawk-3.0.93 + # ERROR: zero strings compare unequal to number zero + # ======== gawk-3.0.94 + # ERROR: zero strings compare unequal to number zero + # ======== gawk-3.0.95 + # ERROR: zero strings compare unequal to number zero + # ======== gawk-3.0.96 + # ERROR: zero strings compare unequal to number zero + # ======== gawk-3.0.97 + # ERROR: zero strings compare unequal to number zero + # ======== gawk-3.1.0 + # ERROR: zero strings compare unequal to number zero + # ======== gawk-3.1.10 + # ERROR: zero strings compare unequal to number zero + # + # Identical results were obtained on Apple Rhapsody, Apple Darwin, + # Compaq/DEC Alpha OSF/1, Intel x86 GNU/Linux, SGI IRIX 6.5, DEC Alpha + # GNU/Linux, and Sun SPARC GNU/Linux, so it definitely is not a C + # compiler problem. + # + # However, the gray awk book, p. 44, says: + # + # In a comparison expression like: + # x == y + # if both operands have a numeric type, the comparison is numeric; + # otherwise, any numeric operand is converted to a string and the + # comparison is made on the string values. + # + # and the new green gawk book, p. 95, says: + # + # When comparing operands of mixed types, numeric operands are + # converted to strings using the value of `CONVFMT' + # + # This suggests that the OK response in bug.awk is wrong, and the ERROR + # response is correct. Only recent gawk releases do the right thing, + # and it is awk, mawk, and nawk that have a bug. + # + # If I change the test program from "00/00/00" to "0/0/0", all versions + # tested produce the OK response. + # + # Comments? + # + # After reading the two book excerpts, I changed my code to read + # + # if (((0 + mdy[1]) == 0) && ((0 + mdy[2]) == 0) && ((0 + mdy[3]) == 0)) + # + # and output from all implementations now agrees. + # + # ------------------------------------------------------------------------------- + # - Nelson H. F. Beebe Tel: +1 801 581 5254 - + # - Center for Scientific Computing FAX: +1 801 585 1640, +1 801 581 4148 - + # - University of Utah Internet e-mail: beebe@math.utah.edu - + # - Department of Mathematics, 322 INSCC beebe@acm.org beebe@computer.org - + # - 155 S 1400 E RM 233 beebe@ieee.org - + # - Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe - + # ------------------------------------------------------------------------------- + # diff -crN gawk-3.1.0/test/compare2.ok gawk-3.1.1/test/compare2.ok *** gawk-3.1.0/test/compare2.ok Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/compare2.ok Sun Aug 5 00:49:00 2001 *************** *** 0 **** --- 1 ---- + OK: zero strings compare equal to number zero diff -crN gawk-3.1.0/test/concat1.awk gawk-3.1.1/test/concat1.awk *** gawk-3.1.0/test/concat1.awk Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/concat1.awk Wed Jan 23 14:48:45 2002 *************** *** 0 **** --- 1,78 ---- + #From deep@cicada-semi.com Wed Jan 23 13:15:52 2002 + #X-From_: deep@cicada-semi.com Wed Jan 23 01:24:54 2002 + #From: "Mandeep Chadha" + #To: + #Subject: gawk version 3.1.0 will not print a ";" + #Date: Tue, 22 Jan 2002 17:23:57 -0600 + #Message-ID: + #MIME-Version: 1.0 + #Content-Type: text/plain; + # charset="iso-8859-1" + #Content-Transfer-Encoding: 7bit + #X-Priority: 3 (Normal) + #X-MSMail-Priority: Normal + #X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) + #Importance: Normal + #X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 + # + # + #The file "tmp" contains the following lines: + # + #A + #B + #C + #D + # + #and when I run the command: + # + # gawk '{print "Input = "$_" ; "}' tmp + {print "Input = "$_" ; "} + # + #I get the following output: + # + #Input = A + #Input = B + #Input = C + #Input = D + # + #while I expect the following output: + # + #Input = A ; + #Input = B ; + #Input = C ; + #Input = D ; + # + #Running gawk --version produces the following output: + # + #GNU Awk 3.1.0 + #Copyright (C) 1989, 1991-2001 Free Software Foundation. + # + #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. + # + #I am running this on a i686 machine that is running RedHat 7.2 (out of the box). + # + #Thanks, + # + #Mandeep Chadha + # + #---------------------------------------- + #Mandeep Chadha + #Cicada Semiconductor Corp. + #811 Barton Springs Road, Suite 550 + #Austin, TX 78704 + #Ph: (512) 327-3500 x111 + #E-mail: deep@cicada-semi.com + #URL: http://www.cicada-semi.com + #---------------------------------------- diff -crN gawk-3.1.0/test/concat1.in gawk-3.1.1/test/concat1.in *** gawk-3.1.0/test/concat1.in Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/concat1.in Wed Jan 23 14:48:56 2002 *************** *** 0 **** --- 1,4 ---- + A + B + C + D diff -crN gawk-3.1.0/test/concat1.ok gawk-3.1.1/test/concat1.ok *** gawk-3.1.0/test/concat1.ok Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/concat1.ok Wed Jan 23 14:49:18 2002 *************** *** 0 **** --- 1,4 ---- + Input = A ; + Input = B ; + Input = C ; + Input = D ; diff -crN gawk-3.1.0/test/forsimp.awk gawk-3.1.1/test/forsimp.awk *** gawk-3.1.0/test/forsimp.awk Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/forsimp.awk Mon Jan 7 22:20:06 2002 *************** *** 0 **** --- 1 ---- + BEGIN { for (print 9; 0;); } diff -crN gawk-3.1.0/test/forsimp.ok gawk-3.1.1/test/forsimp.ok *** gawk-3.1.0/test/forsimp.ok Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/forsimp.ok Mon Jan 7 22:20:16 2002 *************** *** 0 **** --- 1 ---- + 9 diff -crN gawk-3.1.0/test/lint.ok gawk-3.1.1/test/lint.ok *** gawk-3.1.0/test/lint.ok Wed Jan 3 19:47:37 2001 --- gawk-3.1.1/test/lint.ok Mon Jan 7 22:22:31 2002 *************** *** 1,5 **** ! gawk: lint.awk:7: warning: delete: index `2' not in array `a' gawk: lint.awk:7: warning: turning off `--lint' due to assignment to `LINT' ! gawk: lint.awk:11: warning: delete: index `4' not in array `a' gawk: lint.awk:11: warning: turning off `--lint' due to assignment to `LINT' done --- 1,5 ---- ! gawk: lint.awk:6: warning: delete: index `2' not in array `a' gawk: lint.awk:7: warning: turning off `--lint' due to assignment to `LINT' ! gawk: lint.awk:10: warning: delete: index `4' not in array `a' gawk: lint.awk:11: warning: turning off `--lint' due to assignment to `LINT' done diff -crN gawk-3.1.0/test/longsub.awk gawk-3.1.1/test/longsub.awk *** gawk-3.1.0/test/longsub.awk Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/longsub.awk Sun Feb 17 14:25:26 2002 *************** *** 0 **** --- 1 ---- + {sub( "^.*AA", "BB"); print} diff -crN gawk-3.1.0/test/longsub.in gawk-3.1.1/test/longsub.in *** gawk-3.1.0/test/longsub.in Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/longsub.in Sun Feb 17 14:25:13 2002 *************** *** 0 **** --- 1 ---- + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 diff -crN gawk-3.1.0/test/longsub.ok gawk-3.1.1/test/longsub.ok *** gawk-3.1.0/test/longsub.ok Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/longsub.ok Mon Feb 18 14:53:58 2002 *************** *** 0 **** --- 1 ---- + BB000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 diff -crN gawk-3.1.0/test/membug1.awk gawk-3.1.1/test/membug1.awk *** gawk-3.1.0/test/membug1.awk Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/membug1.awk Thu Oct 4 15:29:30 2001 *************** *** 0 **** --- 1 ---- + { one != one = $1 } diff -crN gawk-3.1.0/test/membug1.in gawk-3.1.1/test/membug1.in *** gawk-3.1.0/test/membug1.in Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/membug1.in Thu Oct 4 15:29:18 2001 *************** *** 0 **** --- 1,2 ---- + yes + yes diff -crN gawk-3.1.0/test/minusstr.awk gawk-3.1.1/test/minusstr.awk *** gawk-3.1.0/test/minusstr.awk Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/minusstr.awk Thu Aug 23 14:02:33 2001 *************** *** 0 **** --- 1 ---- + BEGIN { print-"6" } diff -crN gawk-3.1.0/test/minusstr.ok gawk-3.1.1/test/minusstr.ok *** gawk-3.1.0/test/minusstr.ok Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/minusstr.ok Thu Aug 23 14:02:43 2001 *************** *** 0 **** --- 1 ---- + -6 diff -crN gawk-3.1.0/test/noeffect.ok gawk-3.1.1/test/noeffect.ok *** gawk-3.1.0/test/noeffect.ok Wed Nov 25 02:22:35 1998 --- gawk-3.1.1/test/noeffect.ok Mon Jan 7 22:22:29 2002 *************** *** 1,4 **** gawk: noeffect.awk:3: warning: statement may have no effect gawk: noeffect.awk:2: warning: reference to uninitialized variable `s' ! gawk: noeffect.awk:4: warning: reference to uninitialized variable `s' --- 1,4 ---- gawk: noeffect.awk:3: warning: statement may have no effect gawk: noeffect.awk:2: warning: reference to uninitialized variable `s' ! gawk: noeffect.awk:3: warning: reference to uninitialized variable `s' diff -crN gawk-3.1.0/test/ofmtfidl.awk gawk-3.1.1/test/ofmtfidl.awk *** gawk-3.1.0/test/ofmtfidl.awk Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/ofmtfidl.awk Wed Jun 13 18:11:17 2001 *************** *** 0 **** --- 1,85 ---- + # From djones@zoonami.com Wed Jun 13 17:46:27 2001 + # Received: from mail.actcom.co.il [192.114.47.13] + # by localhost with POP3 (fetchmail-5.5.0) + # for arnold@localhost (single-drop); Wed, 13 Jun 2001 17:46:27 +0300 (IDT) + # Received: by actcom.co.il (mbox arobbins) + # (with Cubic Circle's cucipop (v1.31 1998/05/13) Wed Jun 13 17:47:09 2001) + # X-From_: djones@zoonami.com Wed Jun 13 17:45:40 2001 + # Received: from lmail.actcom.co.il by actcom.co.il with ESMTP + # (8.9.1a/actcom-0.2) id RAA07057 for ; + # Wed, 13 Jun 2001 17:45:34 +0300 (EET DST) + # (rfc931-sender: mail.actcom.co.il [192.114.47.13]) + # Received: from billohost.com (www.billohost.com [209.196.35.10]) + # by lmail.actcom.co.il (8.11.2/8.11.2) with ESMTP id f5DEjSO24028 + # for ; Wed, 13 Jun 2001 17:45:33 +0300 + # Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164]) + # by billohost.com (8.9.3/8.9.3) with ESMTP id KAA24625 + # for ; Wed, 13 Jun 2001 10:44:43 -0400 + # Received: from topcat.zoonami.com ([193.112.141.198]) + # by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian)) + # id 15ABtZ-0000FQ-00 + # for ; Wed, 13 Jun 2001 10:45:21 -0400 + # Received: from topcat.zoonami.com (localhost [127.0.0.1]) + # by topcat.zoonami.com (8.9.3/8.9.3) with ESMTP id OAA28329; + # Wed, 13 Jun 2001 14:45:54 GMT + # (envelope-from djones@topcat.zoonami.com) + # Message-Id: <200106131445.OAA28329@topcat.zoonami.com> + # To: bug-gawk@gnu.org + # cc: David Jones + # Subject: 3.1.0 core dumps. Fiddling with OFMT? + # Date: Wed, 13 Jun 2001 14:45:54 +0000 + # From: David Jones + # Status: R + # + # The following program causes gawk to dump core: + # + # jot 10|./gawk '{OFMT="%."NR"f";print NR}' + # + # 'jot 10', if you didn't know, produces the numbers 1 to 10 each on its + # own line (ie it's like awk 'BEGIN{for(i=1;i<=10;++i)print i}') + # + # Here's an example run: + # + # -- run being + # 1 + # 2 + # 3 + # 4 + # gawk: cmd. line:1: (FILENAME=- FNR=5) fatal error: internal error + # Abort trap - core dumped + # -- run end + # + # Ah. print NR appears to be not interesting. The following program also + # has the same problem: + # + # jot 10|./gawk '{OFMT="%."NR"f"}' + # + # Cheers, + # djones + # (version info follows) + # + # I'm running on FreeBSD 4.1, here's the output of uname -a + # + # FreeBSD topcat.zoonami.com 4.1-RELEASE FreeBSD 4.1-RELEASE #0: Fri Jul 28 14:30:31 GMT 2000 jkh@ref4.freebsd.org:/usr/src/sys/compile/GENERIC i386 + # + # And ./gnu --version + # + # GNU Awk 3.1.0 + # Copyright (C) 1989, 1991-2001 Free Software Foundation. + # + # 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. + # + # + { OFMT="%."NR"f"; print NR } diff -crN gawk-3.1.0/test/ofmtfidl.in gawk-3.1.1/test/ofmtfidl.in *** gawk-3.1.0/test/ofmtfidl.in Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/ofmtfidl.in Wed Jun 13 18:11:30 2001 *************** *** 0 **** --- 1,10 ---- + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 diff -crN gawk-3.1.0/test/ofmtfidl.ok gawk-3.1.1/test/ofmtfidl.ok *** gawk-3.1.0/test/ofmtfidl.ok Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/ofmtfidl.ok Wed Jun 13 18:13:27 2001 *************** *** 0 **** --- 1,10 ---- + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 diff -crN gawk-3.1.0/test/onlynl.awk gawk-3.1.1/test/onlynl.awk *** gawk-3.1.0/test/onlynl.awk Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/onlynl.awk Tue Jul 24 01:47:55 2001 *************** *** 0 **** --- 1,2 ---- + BEGIN { RS = "" } + { print "got", $0 } diff -crN gawk-3.1.0/test/onlynl.in gawk-3.1.1/test/onlynl.in *** gawk-3.1.0/test/onlynl.in Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/test/onlynl.in Tue Jul 24 01:48:00 2001 *************** *** 0 **** --- 1,4 ---- + + + + diff -crN gawk-3.1.0/test/prmarscl.ok gawk-3.1.1/test/prmarscl.ok *** gawk-3.1.0/test/prmarscl.ok Sat Dec 13 21:24:22 1997 --- gawk-3.1.1/test/prmarscl.ok Mon Jan 7 22:22:30 2002 *************** *** 1 **** ! gawk: prmarscl.awk:4: fatal: attempt to use scalar parameter `a' as an array --- 1 ---- ! gawk: prmarscl.awk:3: fatal: attempt to use scalar parameter `a' as an array diff -crN gawk-3.1.0/test/reg/func2.good gawk-3.1.1/test/reg/func2.good *** gawk-3.1.0/test/reg/func2.good Wed Oct 20 02:07:56 1993 --- gawk-3.1.1/test/reg/func2.good Sat Aug 4 23:23:30 2001 *************** *** 1,2 **** ! gawk: reg/func2.awk:2: fatal: function `dummy' called with space between name and (, or used in other expression context --- 1,2 ---- ! gawk: reg/func2.awk:2: fatal: function `dummy' called with space between name and `(', or used in other expression context diff -crN gawk-3.1.0/unsupported/atari/ChangeLog gawk-3.1.1/unsupported/atari/ChangeLog *** gawk-3.1.0/unsupported/atari/ChangeLog Sun Jun 3 13:05:35 2001 --- gawk-3.1.1/unsupported/atari/ChangeLog Wed May 1 16:42:16 2002 *************** *** 1,3 **** --- 1,7 ---- + Wed May 1 16:41:32 2002 Arnold D. Robbins + + * Release 3.1.1: Release tar file made. + Sun Jun 3 13:04:44 2001 Arnold D. Robbins * Release 3.1.0: Release tar file made. And there was diff -crN gawk-3.1.0/unsupported/atari/gawkmisc.atr gawk-3.1.1/unsupported/atari/gawkmisc.atr *** gawk-3.1.0/unsupported/atari/gawkmisc.atr Sun Jan 28 15:49:25 2001 --- gawk-3.1.1/unsupported/atari/gawkmisc.atr Thu Aug 16 12:07:48 2001 *************** *** 1,5 **** /* ! * gawkmisc.atr --- miscellanious gawk routines that are OS specific. */ /* --- 1,5 ---- /* ! * gawkmisc.atr --- miscellaneous gawk routines that are OS specific. */ /* *************** *** 94,106 **** * On ST redirected stdin does not have a name attached * (this could be hard to do to) and fstat would fail */ ! if (fd == 0 || isatty(fd)) return BUFSIZ; if (fstat(fd, stb) == -1) fatal("can't stat fd %d (%s)", fd, strerror(errno)); ! if (lseek(fd, (off_t)0, 0) == -1) /* not a regular file */ ! return DEFBLKSIZE; ! if (stb->st_size > 0 && stb->st_size < DEFBLKSIZE) /* small file */ return stb->st_size; return DEFBLKSIZE; } --- 94,105 ---- * On ST redirected stdin does not have a name attached * (this could be hard to do to) and fstat would fail */ ! if (fd == 0) return BUFSIZ; if (fstat(fd, stb) == -1) fatal("can't stat fd %d (%s)", fd, strerror(errno)); ! if (S_ISREG(stb->st_mode) ! && 0 < stb->st_size && stb->st_size < DEFBLKSIZE) /* small file */ return stb->st_size; return DEFBLKSIZE; } diff -crN gawk-3.1.0/unsupported/tandem/ChangeLog gawk-3.1.1/unsupported/tandem/ChangeLog *** gawk-3.1.0/unsupported/tandem/ChangeLog Sun Jun 3 13:05:43 2001 --- gawk-3.1.1/unsupported/tandem/ChangeLog Wed May 1 16:42:18 2002 *************** *** 1,3 **** --- 1,7 ---- + Wed May 1 16:41:32 2002 Arnold D. Robbins + + * Release 3.1.1: Release tar file made. + Sun Jun 3 13:04:44 2001 Arnold D. Robbins * Release 3.1.0: Release tar file made. And there was diff -crN gawk-3.1.0/vms/ChangeLog gawk-3.1.1/vms/ChangeLog *** gawk-3.1.0/vms/ChangeLog Sun Jun 3 13:05:25 2001 --- gawk-3.1.1/vms/ChangeLog Wed May 1 16:42:20 2002 *************** *** 1,3 **** --- 1,16 ---- + Wed May 1 16:41:32 2002 Arnold D. Robbins + + * Release 3.1.1: Release tar file made. + + Wed Apr 17 15:57:30 2002 Pat Rankin + + * vmstest.com (forsimp, concat1, longsub): New Tests. + (strftime): Revamp test to avoid use of defunct %v extension. + + Sat Dec 22 19:18:31 2001 Pat Rankin + + * redirect.h (tzset): Declare. + Sun Jun 3 13:04:44 2001 Arnold D. Robbins * Release 3.1.0: Release tar file made. And there was diff -crN gawk-3.1.0/vms/descrip.mms gawk-3.1.1/vms/descrip.mms *** gawk-3.1.0/vms/descrip.mms Wed Apr 18 15:23:56 2001 --- gawk-3.1.1/vms/descrip.mms Tue Apr 16 13:59:46 2002 *************** *** 120,126 **** # Release of gawk REL=3.1 ! PATCHLVL=0 # generic target all : gawk --- 120,126 ---- # Release of gawk REL=3.1 ! PATCHLVL=1 # generic target all : gawk diff -crN gawk-3.1.0/vms/redirect.h gawk-3.1.1/vms/redirect.h *** gawk-3.1.0/vms/redirect.h Wed Apr 18 15:19:14 2001 --- gawk-3.1.1/vms/redirect.h Mon Dec 24 14:01:57 2001 *************** *** 115,120 **** --- 115,121 ---- extern int dup2 P((int, int)); extern int read P((int, void *, int)); extern int getpgrp P((void)); + extern void tzset P((void)); #endif /* not VMS_POSIX and not IN_CONFIG_H */ diff -crN gawk-3.1.0/vms/vms-conf.h gawk-3.1.1/vms/vms-conf.h *** gawk-3.1.0/vms/vms-conf.h Wed Apr 18 15:19:56 2001 --- gawk-3.1.1/vms/vms-conf.h Tue Apr 16 14:59:47 2002 *************** *** 7,13 **** */ /* ! * Copyright (C) 1991-1992, 1995-1996, 1999, 2001 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. --- 7,13 ---- */ /* ! * Copyright (C) 1991-1992, 1995-1996, 1999, 2001, 2002 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. *************** *** 298,304 **** #define PACKAGE "gawk" /* Version number of package */ ! #define VERSION "3.0.93" /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS --- 298,304 ---- #define PACKAGE "gawk" /* Version number of package */ ! #define VERSION "3.1.1" /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS diff -crN gawk-3.1.0/vms/vmsbuild.com gawk-3.1.1/vms/vmsbuild.com *** gawk-3.1.0/vms/vmsbuild.com Mon Apr 9 13:29:31 2001 --- gawk-3.1.1/vms/vmsbuild.com Tue Apr 16 13:59:15 2002 *************** *** 6,14 **** $! gawk 3.0 revised, Dec'95 $! gawk 3.0.1 revised, Nov'96 $! gawk 3.1.0 revised, Mar'01 $! $ REL = "3.1" !release version number ! $ PATCHLVL = "0" $! $! $ CCFLAGS = "/noList" ! "/noOpt/Debug" --- 6,15 ---- $! gawk 3.0 revised, Dec'95 $! gawk 3.0.1 revised, Nov'96 $! gawk 3.1.0 revised, Mar'01 + $! gawk 3.1.1 revised, Apr'02 $! $ REL = "3.1" !release version number ! $ PATCHLVL = "1" $! $! $ CCFLAGS = "/noList" ! "/noOpt/Debug" diff -crN gawk-3.1.0/vms/vmstest.com gawk-3.1.1/vms/vmstest.com *** gawk-3.1.0/vms/vmstest.com Wed Apr 18 15:23:56 2001 --- gawk-3.1.1/vms/vmstest.com Mon Apr 22 14:22:27 2002 *************** *** 49,54 **** --- 49,57 ---- + " splitdef fnaryscl fnasgnm ofmtbig paramtyp rsnul1nl" - + " datanonl regeq redfilnm strtod leaddig arynasty" - + " psx96sub addcomma" + $ basic_lst3 = "rebt8b1 rebt8b2 leadnl funsemnl ofmtfidl" - + + " onlynl arrymem1 compare2 minusstr membug1 forsimp" - + + " concat1 longsub" $ echo "basic" $basic_loop1: basic_test = f$element(0," ",basic_lst1) $ basic_lst1 = basic_lst1 - basic_test - " " *************** *** 58,63 **** --- 61,70 ---- $ basic_lst2 = basic_lst2 - basic_test - " " $ if basic_test.nes." " then gosub 'basic_test' $ if basic_lst2.nes."" then goto basic_loop2 + $basic_loop3: basic_test = f$element(0," ",basic_lst3) + $ basic_lst3 = basic_lst3 - basic_test - " " + $ if basic_test.nes." " then gosub 'basic_test' + $ if basic_lst3.nes."" then goto basic_loop3 $ return $ $unix_tests: unix_tst_list = "fflush getlnhd pid pipeio1" - *************** *** 374,385 **** $ ! this test could fail on slow machines or on a second boundary, $ ! so if it does, double check the actual results $!! date | gawk -v "OUTPUT"=tmp. -f strftime.awk ! $ ! note: this test is simpler to implement for VMS ! $ gawk -v "OUTPUT"=tmp. - ! "BEGIN {""show time"" | getline; print >""strftime.ok""; print strftime("" %v %T"") >OUTPUT}" $ set noOn $ cmp strftime.ok tmp. ! $ if $status then rm tmp.;,strftime.ok;* $ set On $ return $ --- 381,402 ---- $ ! this test could fail on slow machines or on a second boundary, $ ! so if it does, double check the actual results $!! date | gawk -v "OUTPUT"=tmp. -f strftime.awk ! $ now = f$time() ! $ wkd = f$extract(0,3,f$cvtime(now,,"WEEKDAY")) ! $ mon = f$cvtime(now,"ABSOLUTE","MONTH") ! $ mon = f$extract(0,1,mon) + f$edit(f$extract(1,2,mon),"LOWERCASE") ! $ day = f$cvtime(now,,"DAY") ! $ tim = f$extract(0,8,f$cvtime(now,,"TIME")) ! $ tz = "" ! $ yr = f$cvtime(now,,"YEAR") ! $ if f$trnlnm("FTMP").nes."" then close/noLog ftmp ! $ open/Write ftmp strftime.in ! $ write ftmp wkd," ",mon," ",day," ",tim," ",tz," ",yr ! $ close ftmp ! $ gawk -v "OUTPUT"=tmp. -f strftime.awk strftime.in $ set noOn $ cmp strftime.ok tmp. ! $ if $status then rm tmp.;,strftime.ok;*,strftime.in;* $ set On $ return $ *************** *** 636,641 **** --- 653,659 ---- $ $pid: echo "pid" $ if f$search("pid.ok").eqs."" then create pid.ok + $ if f$trnlnm("FTMP").nes."" then close/noLog ftmp $ open/Write ftmp _pid.in $ write ftmp f$integer("%x" + f$getjpi("","PID")) $ write ftmp f$integer("%x" + f$getjpi("","OWNER")) *************** *** 997,1003 **** $ set On $ return $ ! $inetdayt: echo "netdayt" $ echo "this test is for bidirectional TCP transmission" $ set noOn $ gawk -f - nl: --- 1015,1021 ---- $ set On $ return $ ! $inetdayt: echo "inetdayt" $ echo "this test is for bidirectional TCP transmission" $ set noOn $ gawk -f - nl: *************** *** 1096,1101 **** --- 1114,1201 ---- $ if $status then rm tmp.; $ return $ + $rebt8b1: echo "rebt8b1" + $ gawk -f rebt8b1.awk >tmp. + $ cmp rebt8b1.ok tmp. + $ if $status then rm tmp.; + $ return + $ + $rebt8b2: echo "rebt8b2" + $ gawk -f rebt8b2.awk >tmp. + $ cmp rebt8b2.ok tmp. + $ if $status then rm tmp.; + $ return + $ + $leadnl: echo "leadnl" + $ gawk -f leadnl.awk leadnl.in >tmp. + $ cmp leadnl.ok tmp. + $ if $status then rm tmp.; + $ return + $ + $funsemnl: echo "funsemnl" + $ gawk -f funsemnl.awk >tmp. + $ cmp funsemnl.ok tmp. + $ if $status then rm tmp.; + $ return + $ + $ofmtfidl: echo "ofmtfidl" + $ gawk -f ofmtfidl.awk ofmtfidl.in >tmp. + $ cmp ofmtfidl.ok tmp. + $ if $status then rm tmp.; + $ return + $ + $onlynl: echo "onlynl" + $ gawk -f onlynl.awk onlynl.in >tmp. + $ cmp onlynl.ok tmp. + $ if $status then rm tmp.; + $ return + $ + $arrymem1: echo "arrymem1" + $ gawk -f arrymem1.awk >tmp. + $ cmp arrymem1.ok tmp. + $ if $status then rm tmp.; + $ return + $ + $compare2: echo "compare2" + $ gawk -f compare2.awk >tmp. + $ cmp compare2.ok tmp. + $ if $status then rm tmp.; + $ return + $ + $minusstr: echo "minusstr" + $ gawk -f minusstr.awk >tmp. + $ cmp minusstr.ok tmp. + $ if $status then rm tmp.; + $ return + $ + $membug1: echo "membug1" + $ gawk -f membug1.awk membug1.in >tmp. + $ cmp membug1.ok tmp. + $ if $status then rm tmp.; + $ return + $ + $forsimp: echo "forsimp" + $ gawk -f forsimp.awk >tmp. + $ cmp forsimp.ok tmp. + $ if $status then rm tmp.; + $ return + $ + $concat1: echo "concat1" + $ gawk -f concat1.awk concat1.in >tmp. + $ cmp concat1.ok tmp. + $ if $status then rm tmp.; + $ return + $ + $longsub: echo "longsub" + $ gawk -f longsub.awk longsub.in >tmp. + $!! the records here are too long for DIFF to handle + $!! so assume success as long as gawk doesn't crash + $!! call fixup_LRL longsub.ok + $!! call fixup_LRL tmp. "purge" + $!! cmp longsub.ok tmp. + $ if $status then rm tmp.; + $ return + $ $vms_io1: echo "vms_io1" $ if f$search("vms_io1.ok").eqs."" $ then create vms_io1.ok diff -crN gawk-3.1.0/ylwrap gawk-3.1.1/ylwrap *** gawk-3.1.0/ylwrap Thu Jan 1 02:00:00 1970 --- gawk-3.1.1/ylwrap Tue Feb 19 18:17:37 2002 *************** *** 0 **** --- 1,143 ---- + #! /bin/sh + # ylwrap - wrapper for lex/yacc invocations. + # Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + # Written by Tom Tromey . + # + # 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. + + # Usage: + # ylwrap INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... + # * INPUT is the input file + # * OUTPUT is file PROG generates + # * DESIRED is file we actually want + # * PROGRAM is program to run + # * ARGS are passed to PROG + # Any number of OUTPUT,DESIRED pairs may be used. + + # The input. + input="$1" + shift + case "$input" in + [\\/]* | ?:[\\/]*) + # Absolute path; do nothing. + ;; + *) + # Relative path. Make it absolute. + input="`pwd`/$input" + ;; + esac + + # The directory holding the input. + input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` + # Quote $INPUT_DIR so we can use it in a regexp. + # FIXME: really we should care about more than `.' and `\'. + input_rx=`echo "$input_dir" | sed -e 's,\\\\,\\\\\\\\,g' -e 's,\\.,\\\\.,g'` + + echo "got $input_rx" + + pairlist= + while test "$#" -ne 0; do + if test "$1" = "--"; then + shift + break + fi + pairlist="$pairlist $1" + shift + done + + # The program to run. + prog="$1" + shift + # Make any relative path in $prog absolute. + case "$prog" in + [\\/]* | ?:[\\/]*) ;; + *[\\/]*) prog="`pwd`/$prog" ;; + esac + + # FIXME: add hostname here for parallel makes that run commands on + # other machines. But that might take us over the 14-char limit. + dirname=ylwrap$$ + trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 + mkdir $dirname || exit 1 + + cd $dirname + + $prog ${1+"$@"} "$input" + status=$? + + if test $status -eq 0; then + set X $pairlist + shift + first=yes + # Since DOS filename conventions don't allow two dots, + # the DOS version of Bison writes out y_tab.c instead of y.tab.c + # and y_tab.h instead of y.tab.h. Test to see if this is the case. + y_tab_nodot="no" + if test -f y_tab.c || test -f y_tab.h; then + y_tab_nodot="yes" + fi + + while test "$#" -ne 0; do + from="$1" + # Handle y_tab.c and y_tab.h output by DOS + if test $y_tab_nodot = "yes"; then + if test $from = "y.tab.c"; then + from="y_tab.c" + else + if test $from = "y.tab.h"; then + from="y_tab.h" + fi + fi + fi + if test -f "$from"; then + # If $2 is an absolute path name, then just use that, + # otherwise prepend `../'. + case "$2" in + [\\/]* | ?:[\\/]*) target="$2";; + *) target="../$2";; + esac + + # Edit out `#line' or `#' directives. We don't want the + # resulting debug information to point at an absolute srcdir; + # it is better for it to just mention the .y file with no + # path. + sed -e "/^#/ s,$input_rx,," "$from" > "$target" || status=$? + else + # A missing file is only an error for the first file. This + # is a blatant hack to let us support using "yacc -d". If -d + # is not specified, we don't want an error when the header + # file is "missing". + if test $first = yes; then + status=1 + fi + fi + shift + shift + first=no + done + else + status=$? + fi + + # Remove the directory. + cd .. + rm -rf $dirname + + exit $status EOF # Final cleanup: echo Doing final cleanup, this will take a few seconds touch test/membug1.ok test/onlynl.ok # 0-length files chmod +x configure config.guess config.sub config.rpath ylwrap touch configure acconfig.h aclocal.m4 ; sleep 1 touch configh.in ; sleep 1 touch stamp-h.in ; sleep 1 find . -name Makefile.in | xargs touch touch */*.in.in