summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ABOUT-NLS389
-rw-r--r--ChangeLog653
-rw-r--r--FUTURES2
-rw-r--r--Makefile.am27
-rw-r--r--Makefile.in727
-rw-r--r--NEWS49
-rw-r--r--README7
-rw-r--r--README_d/README.VMS26
-rw-r--r--README_d/README.ia644
-rw-r--r--README_d/README.pc21
-rw-r--r--README_d/README.solaris9
-rw-r--r--acconfig.h2
-rw-r--r--aclocal.m42262
-rw-r--r--array.c8
-rw-r--r--awk.h65
-rw-r--r--awkgram.c1925
-rw-r--r--awkgram.y336
-rw-r--r--awklib/ChangeLog12
-rw-r--r--awklib/Makefile.am8
-rw-r--r--awklib/Makefile.in385
-rw-r--r--awklib/eg/lib/getopt.awk2
-rw-r--r--awklib/eg/lib/grcat.c9
-rw-r--r--awklib/eg/lib/libintl.awk5
-rw-r--r--awklib/eg/lib/round.awk2
-rw-r--r--awklib/eg/prog/wordfreq.awk2
-rw-r--r--builtin.c379
-rwxr-xr-xconfig.guess1321
-rwxr-xr-xconfig.rpath513
-rwxr-xr-xconfig.sub1443
-rw-r--r--configh.in80
-rwxr-xr-xconfigure3437
-rw-r--r--configure.in40
-rw-r--r--custom.h6
-rw-r--r--dfa.c1076
-rw-r--r--dfa.h63
-rw-r--r--doc/ChangeLog52
-rw-r--r--doc/Makefile.am7
-rw-r--r--doc/Makefile.in374
-rw-r--r--doc/awkcard.in206
-rw-r--r--doc/gawk.150
-rw-r--r--doc/gawk.info5214
-rw-r--r--doc/gawk.texi4774
-rw-r--r--doc/gawkinet.info522
-rw-r--r--doc/gawkinet.texi376
-rw-r--r--doc/texinfo.tex734
-rw-r--r--doc/uf002331.eps1155
-rw-r--r--doc/uf002331.jpgbin36796 -> 0 bytes
-rw-r--r--eval.c59
-rw-r--r--extension/arrayparm.c93
-rw-r--r--extension/ordchr.c106
-rw-r--r--extension/readfile.c109
-rwxr-xr-xextension/steps8
-rw-r--r--extension/testarrayparm.awk10
-rw-r--r--extension/testordchr.awk6
-rw-r--r--field.c68
-rwxr-xr-xfixvers14
-rw-r--r--gawkmisc.c6
-rw-r--r--getopt.c349
-rw-r--r--getopt.h37
-rw-r--r--getopt1.c16
-rw-r--r--gettext.h60
-rw-r--r--intl/ChangeLog1086
-rw-r--r--intl/Makefile.in277
-rw-r--r--intl/VERSION2
-rw-r--r--intl/bindtextdom.c336
-rw-r--r--intl/cat-compat.c262
-rwxr-xr-xintl/config.charset454
-rw-r--r--intl/dcgettext.c626
-rw-r--r--intl/dcigettext.c1168
-rw-r--r--intl/dcngettext.c61
-rw-r--r--intl/dgettext.c30
-rw-r--r--intl/dngettext.c61
-rw-r--r--intl/eval-plural.h106
-rw-r--r--intl/explodename.c30
-rw-r--r--intl/finddomain.c68
-rw-r--r--intl/gettext.c38
-rw-r--r--intl/gettextP.h150
-rw-r--r--intl/gmo.h (renamed from intl/gettext.h)31
-rw-r--r--intl/hash-string.h22
-rw-r--r--intl/intl-compat.c134
-rw-r--r--intl/l10nflist.c76
-rw-r--r--intl/libgettext.h182
-rw-r--r--intl/libgnuintl.h138
-rw-r--r--intl/linux-msg.sed100
-rw-r--r--intl/loadinfo.h63
-rw-r--r--intl/loadmsgcat.c290
-rw-r--r--intl/localcharset.c345
-rw-r--r--intl/locale.alias78
-rw-r--r--intl/localealias.c185
-rw-r--r--intl/localename.c694
-rw-r--r--intl/ngettext.c68
-rw-r--r--intl/os2compat.c98
-rw-r--r--intl/os2compat.h46
-rw-r--r--intl/osdep.c24
-rw-r--r--intl/plural-exp.c156
-rw-r--r--intl/plural-exp.h126
-rw-r--r--intl/plural.c1322
-rw-r--r--intl/plural.y409
-rw-r--r--intl/po2tbl.sed.in102
-rw-r--r--intl/ref-add.sin31
-rw-r--r--intl/ref-del.sin26
-rw-r--r--intl/textdomain.c102
-rw-r--r--intl/xopen-msg.sed104
-rw-r--r--io.c187
-rw-r--r--m4/ChangeLog14
-rw-r--r--m4/codeset.m423
-rw-r--r--m4/gettext.m4783
-rw-r--r--m4/glibc21.m432
-rw-r--r--m4/iconv.m496
-rw-r--r--m4/isc-posix.m426
-rw-r--r--m4/lcmessage.m432
-rw-r--r--m4/lib-ld.m497
-rw-r--r--m4/lib-link.m4548
-rw-r--r--m4/lib-prefix.m4148
-rw-r--r--m4/progtest.m432
-rw-r--r--m4/strtod.m43
-rw-r--r--main.c80
-rw-r--r--missing_d/ChangeLog15
-rw-r--r--missing_d/strftime.3359
-rw-r--r--missing_d/strftime.c2123
-rw-r--r--missing_d/strtod.c9
-rw-r--r--patchlev.h2
-rw-r--r--pc/ChangeLog55
-rw-r--r--pc/Makefile37
-rw-r--r--pc/Makefile.tst99
-rw-r--r--pc/awklib/igawk.awk8
-rw-r--r--pc/config.h2
-rw-r--r--pc/gawkmisc.pc235
-rw-r--r--pc/install.awk1
-rw-r--r--po/ChangeLog9
-rw-r--r--po/LINGUAS7
-rw-r--r--po/Makefile.in.in382
-rw-r--r--po/Makevars25
-rw-r--r--po/Rules-quot42
-rw-r--r--po/boldquot.sed10
-rw-r--r--po/cat-id-tbl.c411
-rw-r--r--po/de.gmobin0 -> 36731 bytes
-rw-r--r--po/de.po1778
-rw-r--r--po/en@boldquot.header25
-rw-r--r--po/en@quot.header22
-rw-r--r--po/es.gmobin0 -> 40996 bytes
-rw-r--r--po/es.po1792
-rw-r--r--po/fr.gmobin0 -> 41261 bytes
-rw-r--r--po/fr.po1788
-rw-r--r--po/gawk.pot730
-rw-r--r--po/he.gmobin33953 -> 37053 bytes
-rw-r--r--po/he.po810
-rw-r--r--po/insert-header.sin23
-rw-r--r--po/it.gmobin0 -> 39661 bytes
-rw-r--r--po/it.po1749
-rw-r--r--po/quot.sed6
-rw-r--r--po/remove-potcdate.sin19
-rw-r--r--po/stamp-cat-id1
-rw-r--r--po/sv.gmobin0 -> 37031 bytes
-rw-r--r--po/sv.po1757
-rw-r--r--po/tr.gmobin0 -> 40615 bytes
-rw-r--r--po/tr.po1761
-rw-r--r--posix/ChangeLog8
-rw-r--r--posix/gawkmisc.c16
-rw-r--r--profile.c68
-rw-r--r--protos.h3
-rw-r--r--random.c11
-rw-r--r--re.c52
-rw-r--r--regex.c2692
-rw-r--r--regex.h2
-rw-r--r--test/ChangeLog80
-rw-r--r--test/Makefile.am113
-rw-r--r--test/Makefile.in327
-rw-r--r--test/arrymem1.awk75
-rw-r--r--test/arrymem1.ok1
-rw-r--r--test/badargs.ok7
-rw-r--r--test/compare2.awk165
-rw-r--r--test/compare2.ok1
-rw-r--r--test/concat1.awk78
-rw-r--r--test/concat1.in4
-rw-r--r--test/concat1.ok4
-rw-r--r--test/forsimp.awk1
-rw-r--r--test/forsimp.ok1
-rw-r--r--test/lint.ok4
-rw-r--r--test/longsub.awk1
-rw-r--r--test/longsub.in1
-rw-r--r--test/longsub.ok1
-rw-r--r--test/membug1.awk1
-rw-r--r--test/membug1.in2
-rw-r--r--test/membug1.ok0
-rw-r--r--test/minusstr.awk1
-rw-r--r--test/minusstr.ok1
-rw-r--r--test/noeffect.ok2
-rw-r--r--test/ofmtfidl.awk85
-rw-r--r--test/ofmtfidl.in10
-rw-r--r--test/ofmtfidl.ok10
-rw-r--r--test/onlynl.awk2
-rw-r--r--test/onlynl.in4
-rw-r--r--test/onlynl.ok0
-rw-r--r--test/prmarscl.ok2
-rw-r--r--test/reg/func2.good2
-rw-r--r--unsupported/atari/ChangeLog4
-rw-r--r--unsupported/atari/gawkmisc.atr9
-rw-r--r--unsupported/tandem/ChangeLog4
-rw-r--r--vms/ChangeLog13
-rw-r--r--vms/descrip.mms2
-rw-r--r--vms/redirect.h1
-rw-r--r--vms/vms-conf.h4
-rw-r--r--vms/vmsbuild.com3
-rw-r--r--vms/vmstest.com110
-rwxr-xr-xylwrap143
206 files changed, 45542 insertions, 16189 deletions
diff --git a/ABOUT-NLS b/ABOUT-NLS
index 28d38c76..224f72c5 100644
--- a/ABOUT-NLS
+++ b/ABOUT-NLS
@@ -8,7 +8,7 @@ A few packages already provide translations for their messages.
If you found this `ABOUT-NLS' file inside a distribution, you may
assume that the distributed package does use GNU `gettext' internally,
-itself available at your nearest GNU archive site. But you do *not*
+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,8 +22,8 @@ related to internationalization, you should tell about the version of
`gettext' which is used. The information can be found in the
`intl/VERSION' file, in internationalized packages.
-One advise in advance
-=====================
+Quick configuration advice
+==========================
If you want to exploit the full power of internationalization, you
should configure it using
@@ -34,13 +34,14 @@ to force usage of internationalizing routines provided within this
package, despite the existence of internationalizing capabilities in the
operating system where this package is being installed. So far, only
the `gettext' implementation in the GNU C library version 2 provides as
-many features (such as locale alias or message inheritance) as the
-implementation here. It is also not possible to offer this additional
-functionality on top of a `catgets' implementation. Future versions of
-GNU `gettext' will very likely convey even more functionality. So it
-might be a good idea to change to GNU `gettext' as soon as possible.
-
- So you need not provide this option if you are using GNU libc 2 or
+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,23 +54,20 @@ Most such packages use GNU `gettext'. Other packages have their own
ways to internationalization, predating GNU `gettext'.
By default, this package will be installed to allow translation of
-messages. It will automatically detect whether the system provides
-usable `catgets' (if using this is selected by the installer) or
-`gettext' functions. If neither is available, the GNU `gettext' own
+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
+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.
+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,18 +81,10 @@ package is more recent, you should use
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.
+ 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,22 +100,42 @@ Using This Package
As a user, if your language has been installed for this package, you
only have to set the `LANG' environment variable to the appropriate
-ISO 639 `LL' two-letter code prior to using the programs in the
-package. For example, let's suppose that you speak German. At the
-shell prompt, merely execute `setenv LANG de' (in `csh'),
-`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This
-can be done from your `.login' or `.profile' file, once and for all.
-
- An operating system might already offer message localization for
-many of its programs, while other programs have been installed locally
-with the full capabilities of GNU `gettext'. Just using `gettext'
-extended syntax for `LANG' would break proper localization of already
-available operating system programs. In this case, users should set
-both `LANGUAGE' and `LANG' variables in their environment, as programs
-using GNU `gettext' give preference to `LANGUAGE'. For example, some
-Swedish users would rather read translations in German than English for
-when Swedish is not available. This is easily accomplished by setting
-`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'.
+`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,33 +143,21 @@ Translating Teams
For the Free Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
-Each translation team has its own mailing list, courtesy of Linux
-International. You may reach your translation team at the address
-`LL@li.org', replacing LL by the two-letter ISO 639 code for your
-language. Language codes are *not* the same as the country codes given
-in ISO 3166. The following translation teams exist, as of December
-1997:
-
- Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
- Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
- `hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja',
- Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish
- `pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es',
- Swedish `sv', and Turkish `tr'.
-
-For example, you may reach the Chinese translation team by writing to
-`zh@li.org'.
-
- If you'd like to volunteer to *work* at translating messages, you
+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
+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,
+_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,42 +171,202 @@ Available Packages
==================
Languages are not equally supported in all packages. The following
-matrix shows the current state of internationalization, as of December
-1997. The matrix shows, in regard of each package, for which languages
-PO files have been submitted to translation coordination.
-
- Ready PO files cs da de en es fi fr it ja ko nl no pl pt ru sl sv
- .----------------------------------------------------.
- bash | [] [] [] | 3
- bison | [] [] [] | 3
- clisp | [] [] [] [] | 4
- cpio | [] [] [] [] [] [] | 6
- diffutils | [] [] [] [] [] | 5
- enscript | [] [] [] [] [] [] | 6
- fileutils | [] [] [] [] [] [] [] [] [] [] | 10
- findutils | [] [] [] [] [] [] [] [] [] | 9
- flex | [] [] [] [] | 4
- gcal | [] [] [] [] [] | 5
- gettext | [] [] [] [] [] [] [] [] [] [] [] | 12
- grep | [] [] [] [] [] [] [] [] [] [] | 10
- hello | [] [] [] [] [] [] [] [] [] [] [] | 11
- id-utils | [] [] [] | 3
- indent | [] [] [] [] [] | 5
- libc | [] [] [] [] [] [] [] | 7
- m4 | [] [] [] [] [] [] | 6
- make | [] [] [] [] [] [] | 6
- music | [] [] | 2
- ptx | [] [] [] [] [] [] [] [] | 8
- recode | [] [] [] [] [] [] [] [] [] | 9
- sh-utils | [] [] [] [] [] [] [] [] | 8
- sharutils | [] [] [] [] [] [] | 6
- tar | [] [] [] [] [] [] [] [] [] [] [] | 11
- texinfo | [] [] [] | 3
- textutils | [] [] [] [] [] [] [] [] [] | 9
- wdiff | [] [] [] [] [] [] [] [] | 8
- `----------------------------------------------------'
- 17 languages cs da de en es fi fr it ja ko nl no pl pt ru sl sv
- 27 packages 6 4 25 1 18 1 26 2 1 12 20 9 19 7 4 7 17 179
+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,6 +379,27 @@ distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
distribution.
- If December 1997 seems to be old, you may fetch a more recent copy
-of this `ABOUT-NLS' file on most GNU archive sites.
+ 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 --git a/ChangeLog b/ChangeLog
index ec85759b..14b5c446 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,656 @@
+Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.1: Release tar file made.
+
+Wed May 1 16:07:49 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * getopt.c: Installed latest version from glibc.
+
+Sun Apr 28 17:19:07 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ 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 <arnold@skeeve.com>
+
+ * 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 <isamu@yamato.ibm.com>
+
+ * regex.c (__alignof__): Definition for non-GCC compilers.
+
+Sun Mar 17 17:41:55 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * 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 <scottd@amgen.com>
+
+ * awk.h (LOCALEDIR): Provide a definition in case not using
+ i18n stuff.
+
+Wed Mar 6 18:14:44 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * main.c (usage): Add some explanatory text and examples at end.
+
+Sun Mar 3 16:42:50 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * getopt.h, getopt.c, getopt1.c: Update to current version
+ from glibc CVS.
+
+Fri Feb 22 15:53:38 2002 Isamu Hasegawa <isamu@yamato.ibm.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <isamu@yamato.ibm.com>
+
+ * builtin.c (sub_common): Avoid index_multibyte_buffer invocation
+ in single byte character environments.
+
+Thu Feb 21 10:08:56 2002 Isamu Hasegawa <isamu@yamato.ibm.com>
+
+ * 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 <arnold@skeeve.com>
+
+ 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 <arnold@skeeve.com>
+
+ * builtin.c (nondec2awknum): Change assert to runtime check
+ in case user passed in bad data.
+
+2002-02-17 Paul Eggert <eggert@twinsun.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <bruno@clisp.org>
+
+ * 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 <bruno@clisp.org>
+
+ * 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 <andreas.buening@nexgo.de>
+
+ * 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 <arnold@skeeve.com>
+
+ * awkgram.y (yylex): Add test for lasttok != '$' when looking
+ at _"...". See comments in code.
+
+Wed Aug 15 07:43:10 2001 Isamu Hasegawa <isamu@yamato.ibm.com>
+
+ * 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 <isamu@yamato.ibm.com>
+
+ * regex.c : Implements the codes for charset/charset_not to
+ work in multibyte environments.
+
+Wed Aug 15 05:04:34 2001 Isamu Hasegawa <isamu@yamato.ibm.com>
+
+ * regex.c : Add some comments.
+
+Wed Aug 15 05:04:15 2001 Isamu Hasegawa <isamu@yamato.ibm.com>
+
+ * 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 <isamu@yamato.ibm.com>
+
+ * 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 <isamu@yamato.ibm.com>
+
+ * 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 <isamu@yamato.ibm.com>
+
+ * 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 <isamu@yamato.ibm.com>
+
+ * 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 <isamu@yamato.ibm.com>
+
+ 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 <isamu@yamato.ibm.com>
+
+ 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 <isamu@yamato.ibm.com>
+
+ 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 <isamu@yamato.ibm.com>
+
+ 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 <isamu@yamato.ibm.com>
+
+ * 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 <isamu@yamato.ibm.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <pjfarley@dorsai.org>
+
+ * 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 <eliz@is.elta.co.il>
+
+ * 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 <andreas.buening@nexgo.de>
+
+ 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 <arnold@skeeve.com>
+
+ 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 <andreas.buening@nexgo.de>
+
+ 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 <arnold@skeeve.com>
+
+ 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 <arnold@skeeve.com>
+
+ * 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 <rankin@eql.caltech.edu>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * m4/strtod.m4: Add missing `#endif'. Oops.
+
+Mon Oct 29 14:53:57 2001 Arnold D. Robbins <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * io.c (iop_open): Only call os_close_on_exec() for
+ fd > fileno(stderr).
+
+2001-09-07 Paul Eggert <eggert@twinsun.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * configure.in (ALL_LINGUAS): Added `fr' and `tr'.
+ * po/fr.po, po/tr.fo: New files.
+
+2001-08-13 Paul Eggert <eggert@twinsun.com>
+
+ 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * io.c (get_a_record): Handle case where RS = "" and input file
+ is only newlines. See test/onlynl. Bug report by
+ Michel Jouvin <jouvin@lal.in2p3.fr>.
+
+Wed Jul 4 18:34:19 2001 Arnold D. Robbins <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * builtin.c (do_index): If second string is "", return 1.
+
+Mon Jun 25 19:34:24 2001 Arnold D. Robbins <arnold@skeeve.com>
+
+ 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * profile.c (pp_match_op): Rationalized the code.
+
+Thu Jun 7 11:54:36 2001 Arnold D. Robbins <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
* Release 3.1.0: Release tar file made. And there was
diff --git a/FUTURES b/FUTURES
index b2f7575f..fabebb58 100644
--- a/FUTURES
+++ b/FUTURES
@@ -17,8 +17,6 @@ In 3.1
======
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.
diff --git a/Makefile.am b/Makefile.am
index 08809d32..0a0c7019 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
#
# Makefile.am --- automake input file for gawk
#
-# Copyright (C) 2000-2001 the Free Software Foundation, Inc.
+# Copyright (C) 2000-2002 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
@@ -45,6 +45,9 @@ EXTRA_DIST = \
PROBLEMS \
README_d \
bisonfix.sed \
+ config.guess \
+ config.rpath \
+ config.sub \
depcomp \
extension \
fixvers \
@@ -54,7 +57,8 @@ EXTRA_DIST = \
pc \
posix \
unsupported \
- vms
+ vms \
+ ylwrap
# The order to do things in.
# Build in intl first in case we need the local gettext version.
@@ -86,6 +90,7 @@ base_sources = \
getopt.c \
getopt.h \
getopt1.c \
+ gettext.h \
io.c \
main.c \
msg.c \
@@ -105,24 +110,34 @@ gawk_SOURCES = $(base_sources) eval.c profile.c
pgawk_SOURCES = $(base_sources) eval_p.c profile_p.c
# Get extra libs as needed
-LDADD = @INTLLIBS@ @SOCKET_LIBS@
+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="\".:$(datadir)\""
+DEFPATH="\".$(PATH_SEPARATOR)$(awkdatadir)\""
DEFS= -DDEFPATH=$(DEFPATH) -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR="\"$(datadir)/locale\""
-INCLUDES = -I. -I$(srcdir) -I$(srcdir)/intl
+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,7 +147,7 @@ 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; exit 0)
+ rm -f $$fullname p$$fullname; exit 0)
uninstall-recursive: uninstall-links
diff --git a/Makefile.in b/Makefile.in
index c4a7bce7..d1680573 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4a from Makefile.am
+# Makefile.in generated automatically by automake 1.5 from Makefile.am.
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# 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,
@@ -11,6 +11,33 @@
# 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@
@@ -21,8 +48,6 @@ exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
@@ -31,11 +56,9 @@ infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-
top_builddir = .
ACLOCAL = @ACLOCAL@
@@ -47,45 +70,46 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_FLAG =
+INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
-
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-
-@SET_MAKE@
-AMDEP = @AMDEP@
+host_alias = @host_alias@
+host_triplet = @host@
AMTAR = @AMTAR@
AWK = @AWK@
-CATALOGS = @CATALOGS@
+BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CFLAGS = @CFLAGS@
CPP = @CPP@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
+EXEEXT = @EXEEXT@
GENCAT = @GENCAT@
-GMOFILES = @GMOFILES@
+GLIBC21 = @GLIBC21@
GMSGFMT = @GMSGFMT@
-GT_NO = @GT_NO@
-GT_YES = @GT_YES@
-INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
+HAVE_LIB = @HAVE_LIB@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
-INTLDEPS = @INTLDEPS@
+INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
+LIB = @LIB@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
LN_S = @LN_S@
-MAKEINFO = @MAKEINFO@
+LTLIB = @LTLIB@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
+OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
-POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
SOCKET_LIBS = @SOCKET_LIBS@
@@ -94,34 +118,16 @@ 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@
-l = @l@
-
-#
-# 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.
-#
-# 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
-#
+libexecdir = @libexecdir@/awk
-# Automatic de-ANSI-fication if needed
+# 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
@@ -144,6 +150,9 @@ EXTRA_DIST = \
PROBLEMS \
README_d \
bisonfix.sed \
+ config.guess \
+ config.rpath \
+ config.sub \
depcomp \
extension \
fixvers \
@@ -153,7 +162,8 @@ EXTRA_DIST = \
pc \
posix \
unsupported \
- vms
+ vms \
+ ylwrap
# The order to do things in.
@@ -187,6 +197,7 @@ base_sources = \
getopt.c \
getopt.h \
getopt1.c \
+ gettext.h \
io.c \
main.c \
msg.c \
@@ -207,14 +218,15 @@ gawk_SOURCES = $(base_sources) eval.c profile.c
pgawk_SOURCES = $(base_sources) eval_p.c profile_p.c
# Get extra libs as needed
-LDADD = @INTLLIBS@ @SOCKET_LIBS@
+LDADD = @LIBINTL@ @SOCKET_LIBS@
+awkdatadir = @datadir@/awk
# stuff for compiling gawk/pgawk
-DEFPATH = "\".:$(datadir)\""
+DEFPATH = "\".$(PATH_SEPARATOR)$(awkdatadir)\""
DEFS = -DDEFPATH=$(DEFPATH) -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR="\"$(datadir)/locale\""
-INCLUDES = -I. -I$(srcdir) -I$(srcdir)/intl
+INCLUDES = -I$(srcdir)/intl
# We want hard links for install-exec-hook, below
LN = ln
@@ -222,74 +234,88 @@ subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =
-PROGRAMS = $(bin_PROGRAMS)
-
+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@
-ANSI2KNR = @ANSI2KNR@
-am_gawk_OBJECTS = array$U.o awkgram$U.o builtin$U.o dfa$U.o ext$U.o \
-field$U.o gawkmisc$U.o getopt$U.o getopt1$U.o io$U.o main$U.o msg$U.o \
-node$U.o random$U.o re$U.o regex$U.o replace$U.o version$U.o eval$U.o \
-profile$U.o
-gawk_OBJECTS = $(am_gawk_OBJECTS)
-gawk_LDADD = $(LDADD)
-gawk_DEPENDENCIES =
-gawk_LDFLAGS =
-am_pgawk_OBJECTS = array$U.o awkgram$U.o builtin$U.o dfa$U.o ext$U.o \
-field$U.o gawkmisc$U.o getopt$U.o getopt1$U.o io$U.o main$U.o msg$U.o \
-node$U.o random$U.o re$U.o regex$U.o replace$U.o version$U.o eval_p$U.o \
-profile_p$U.o
-pgawk_OBJECTS = $(am_pgawk_OBJECTS)
-pgawk_LDADD = $(LDADD)
-pgawk_DEPENDENCIES =
-pgawk_LDFLAGS =
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+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 $@
-DIST_SOURCES = $(gawk_SOURCES) $(pgawk_SOURCES)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-DEP_FILES = @AMDEP@ $(DEPDIR)/array$U.Po $(DEPDIR)/awkgram$U.Po \
-$(DEPDIR)/builtin$U.Po $(DEPDIR)/dfa$U.Po $(DEPDIR)/eval$U.Po \
-$(DEPDIR)/eval_p$U.Po $(DEPDIR)/ext$U.Po $(DEPDIR)/field$U.Po \
-$(DEPDIR)/gawkmisc$U.Po $(DEPDIR)/getopt$U.Po $(DEPDIR)/getopt1$U.Po \
-$(DEPDIR)/io$U.Po $(DEPDIR)/main$U.Po $(DEPDIR)/msg$U.Po \
-$(DEPDIR)/node$U.Po $(DEPDIR)/profile$U.Po $(DEPDIR)/profile_p$U.Po \
-$(DEPDIR)/random$U.Po $(DEPDIR)/re$U.Po $(DEPDIR)/regex$U.Po \
-$(DEPDIR)/replace$U.Po $(DEPDIR)/version$U.Po
-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 configh.in configure configure.in \
-depcomp install-sh missing mkinstalldirs
-
-
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-GZIP_ENV = --best
+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)
-OBJECTS = $(am_gawk_OBJECTS) $(am_pgawk_OBJECTS)
-all: all-redirect
-.SUFFIXES:
-.SUFFIXES: .c .h .o .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_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-$(ACLOCAL_M4): configure.in acinclude.m4 m4/arch.m4 m4/gettext.m4 \
- m4/jm-mktime.m4 m4/largefile.m4 m4/lcmessage.m4 \
- m4/progtest.m4 m4/socket.m4 m4/ssize_t.m4 m4/strtod.m4
- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
-config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+.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)
+$(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; \
@@ -302,147 +328,160 @@ stamp-h: $(srcdir)/configh.in $(top_builddir)/config.status
&& CONFIG_FILES= CONFIG_HEADERS=config.h:configh.in \
$(SHELL) ./config.status
@mv stamp-hT stamp-h
-$(srcdir)/configh.in: $(srcdir)/./stamp-h.in
+$(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) acconfig.h
+$(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
-mostlyclean-hdr:
-
-clean-hdr:
-
distclean-hdr:
-rm -f config.h
-
-maintainer-clean-hdr:
-
-mostlyclean-binPROGRAMS:
-
-clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-
-distclean-binPROGRAMS:
-
-maintainer-clean-binPROGRAMS:
-
+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 \
- if test -f $$p; then \
- f="`echo $$p|sed -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \
- echo " $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(bindir)/$$f"; \
- $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(bindir)/$$f; \
+ 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 -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
rm -f $(DESTDIR)$(bindir)/$$f; \
done
-mostlyclean-compile:
- -rm -f *.o core *.core
+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)
-clean-compile:
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
-maintainer-clean-compile:
-
-mostlyclean-krextra:
+ANSI2KNR = @ANSI2KNR@
+ansi2knr: ansi2knr.$(OBJEXT)
+ $(LINK) ansi2knr.$(OBJEXT) $(LIBS)
+ansi2knr.$(OBJEXT): $(CONFIG_HEADER)
clean-krextra:
-rm -f ansi2knr
-distclean-krextra:
-
-maintainer-clean-krextra:
-ansi2knr: ansi2knr.o
- $(LINK) ansi2knr.o $(LIBS)
-ansi2knr.o: $(CONFIG_HEADER)
-
-
mostlyclean-kr:
-rm -f *_.c
-clean-kr:
-
-distclean-kr:
-
-maintainer-clean-kr:
+@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@
-gawk: $(gawk_OBJECTS) $(gawk_DEPENDENCIES)
- @rm -f gawk
- $(LINK) $(gawk_LDFLAGS) $(gawk_OBJECTS) $(gawk_LDADD) $(LIBS)
+distclean-depend:
+ -rm -rf $(DEPDIR)
-pgawk: $(pgawk_OBJECTS) $(pgawk_DEPENDENCIES)
- @rm -f pgawk
- $(LINK) $(pgawk_LDFLAGS) $(pgawk_OBJECTS) $(pgawk_LDADD) $(LIBS)
+.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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
+ $(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) $(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
-array_.o awkgram_.o builtin_.o dfa_.o eval_.o eval_p_.o ext_.o field_.o \
-gawkmisc_.o getopt_.o getopt1_.o io_.o main_.o msg_.o node_.o \
-profile_.o profile_p_.o random_.o re_.o regex_.o replace_.o version_.o \
-: $(ANSI2KNR)
-.y.c:
- $(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*.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
+ $(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.
@@ -450,10 +489,7 @@ profile_.o profile_p_.o random_.o re_.o regex_.o replace_.o version_.o \
# (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.
-
-all-recursive install-data-recursive install-exec-recursive \
-installdirs-recursive install-recursive uninstall-recursive \
-check-recursive installcheck-recursive info-recursive dvi-recursive:
+$(RECURSIVE_TARGETS):
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
@@ -476,7 +512,11 @@ mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
- rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ 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; \
@@ -514,9 +554,9 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) configh.in $(TAGS_DEPENDENCIES) \
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
+ if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
- fi; \
+ fi; \
done; \
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
@@ -527,59 +567,65 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) configh.in $(TAGS_DEPENDENCIES) \
test -z "$(ETAGS_ARGS)configh.in$$unique$(LISP)$$tags" \
|| etags $(ETAGS_ARGS) $$tags configh.in $$unique $(LISP)
-mostlyclean-tags:
-
-clean-tags:
+GTAGS:
+ here=`CDPATH=: && cd $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-@AMDEP@include $(DEPDIR)/array$U.Po
-@AMDEP@include $(DEPDIR)/awkgram$U.Po
-@AMDEP@include $(DEPDIR)/builtin$U.Po
-@AMDEP@include $(DEPDIR)/dfa$U.Po
-@AMDEP@include $(DEPDIR)/eval$U.Po
-@AMDEP@include $(DEPDIR)/eval_p$U.Po
-@AMDEP@include $(DEPDIR)/ext$U.Po
-@AMDEP@include $(DEPDIR)/field$U.Po
-@AMDEP@include $(DEPDIR)/gawkmisc$U.Po
-@AMDEP@include $(DEPDIR)/getopt$U.Po
-@AMDEP@include $(DEPDIR)/getopt1$U.Po
-@AMDEP@include $(DEPDIR)/io$U.Po
-@AMDEP@include $(DEPDIR)/main$U.Po
-@AMDEP@include $(DEPDIR)/msg$U.Po
-@AMDEP@include $(DEPDIR)/node$U.Po
-@AMDEP@include $(DEPDIR)/profile$U.Po
-@AMDEP@include $(DEPDIR)/profile_p$U.Po
-@AMDEP@include $(DEPDIR)/random$U.Po
-@AMDEP@include $(DEPDIR)/re$U.Po
-@AMDEP@include $(DEPDIR)/regex$U.Po
-@AMDEP@include $(DEPDIR)/replace$U.Po
-@AMDEP@include $(DEPDIR)/version$U.Po
-
-mostlyclean-depend:
-
-clean-depend:
-
-distclean-depend:
- -rm -rf $(DEPDIR)
-
-maintainer-clean-depend:
-
-@AMDEP@CCDEPMODE = @CCDEPMODE@
-
-.c.o:
-@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+top_distdir = .
+# Avoid unsightly `./'.
distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
+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
@@ -601,160 +647,120 @@ distcheck: dist
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
- && test `find $$dc_install_base -type f -print | wc -l` -le 1 \
+ && (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
+ && (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)
- @banner="$(distdir).tar.gz is ready for distribution"; \
- dashes=`echo "$$banner" | sed s/./=/g`; \
- echo "$$dashes"; \
- echo "$$banner"; \
- echo "$$dashes"
-dist: distdir
- -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)
- $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
- -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
-dist-all: distdir
- -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)
- $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
- -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
-distdir: $(DISTFILES)
- -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
- mkdir $(distdir)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- 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=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
- || exit 1; \
- fi; \
- done
- $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
-info-am:
-info: info-recursive
-dvi-am:
-dvi: dvi-recursive
+ @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
-installcheck-am:
-installcheck: installcheck-recursive
-all-recursive-am: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
+all-am: Makefile $(ANSI2KNR) $(PROGRAMS) config.h
+installdirs: installdirs-recursive
+installdirs-am:
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
-install-exec-am: install-binPROGRAMS
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install: install-recursive
install-exec: install-exec-recursive
-
-install-data-am:
install-data: install-data-recursive
+uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-recursive
-uninstall-am: uninstall-binPROGRAMS
-uninstall: uninstall-recursive
-all-am: Makefile $(ANSI2KNR) $(PROGRAMS) config.h
-all-redirect: all-recursive-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
-installdirs: installdirs-recursive
-installdirs-am:
- $(mkinstalldirs) $(DESTDIR)$(bindir)
-
+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)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
maintainer-clean-generic:
- -rm -f Makefile.in
- -test -z "awkgram.c" || rm -f awkgram.c
-mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \
- mostlyclean-compile mostlyclean-krextra mostlyclean-kr \
- mostlyclean-tags mostlyclean-depend mostlyclean-generic
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
-mostlyclean: mostlyclean-recursive
+clean-am: clean-binPROGRAMS clean-generic clean-krextra mostlyclean-am
-clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-krextra \
- clean-kr clean-tags clean-depend clean-generic \
- mostlyclean-am
+dist-all: distdir
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+distclean: distclean-recursive
+ -rm -f config.status config.cache config.log
+distclean-am: clean-am distclean-compile distclean-depend \
+ distclean-generic distclean-hdr distclean-tags
-clean: clean-recursive
+dvi: dvi-recursive
-distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \
- distclean-krextra distclean-kr distclean-tags \
- distclean-depend distclean-generic clean-am
+dvi-am:
-distclean: distclean-recursive
- -rm -f config.status
-
-maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \
- maintainer-clean-compile maintainer-clean-krextra \
- maintainer-clean-kr maintainer-clean-tags \
- maintainer-clean-depend maintainer-clean-generic \
- distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+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
- -rm -f config.status
-
-.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
-mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
-maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile mostlyclean-krextra distclean-krextra \
-clean-krextra maintainer-clean-krextra mostlyclean-kr distclean-kr \
-clean-kr maintainer-clean-kr install-recursive uninstall-recursive \
-install-data-recursive uninstall-data-recursive install-exec-recursive \
-uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
-all-recursive check-recursive installcheck-recursive info-recursive \
-dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
-maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags mostlyclean-depend \
-distclean-depend clean-depend maintainer-clean-depend distdir info-am \
-info dvi-am dvi check-local check check-am installcheck-am installcheck \
-all-recursive-am install-exec-am install-exec install-data-am \
-install-data install-am install uninstall-am uninstall all-redirect \
-all-am all install-strip installdirs-am installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+
+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)
@@ -764,7 +770,7 @@ 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; exit 0)
+ rm -f $$fullname p$$fullname; exit 0)
uninstall-recursive: uninstall-links
@@ -791,7 +797,6 @@ patchlev.h: configure.in
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 --git a/NEWS b/NEWS
index ab0aa847..0a9e8c45 100644
--- a/NEWS
+++ b/NEWS
@@ -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 --git a/README b/README
index a07db517..3781fb9e 100644
--- a/README
+++ b/README
@@ -1,10 +1,10 @@
README:
-This is GNU Awk 3.1.0. It is upwardly compatible with the Bell Labs
+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.)
-There are lots of new features -- see NEWS and ChangeLog for details.
+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,8 +92,7 @@ MS-Windows:
juan@biophnet.unlp.edu.ar
OS/2:
- Kai Uwe Rommel
- rommel@ars.de
+ gawk-maintainer@unixos2.org
Tandem:
Stephen Davies
diff --git a/README_d/README.VMS b/README_d/README.VMS
index 40442b14..4d193981 100644
--- a/README_d/README.VMS
+++ b/README_d/README.VMS
@@ -19,9 +19,8 @@ GNU C -- use `@vmsbuild GNUC' or `MMS/MACRO=("GNUC")'. On a system
`@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.
+ 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,24 +79,3 @@ separated list of directory specifications. When defining it, the
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.
-
diff --git a/README_d/README.ia64 b/README_d/README.ia64
index f93df876..439f9f3c 100644
--- a/README_d/README.ia64
+++ b/README_d/README.ia64
@@ -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 --git a/README_d/README.pc b/README_d/README.pc
index bbd51e31..066b1ae8 100644
--- a/README_d/README.pc
+++ b/README_d/README.pc
@@ -8,6 +8,20 @@ DOS, and Win32 with rsxnt), and Jan-Jaap van der Heijden and Mumit Khan
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,6 +344,8 @@ FPU after a program exits, so if Make has SIGFPE unmasked, it crashes."
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,11 +366,10 @@ please send bug reports (along with the version and compiler used) to
Scott Deifik, scottd@amgen.com (DOS versions)
or
- Kai Uwe Rommel, rommel@ars.de (OS/2 or bound versions)
+ gawk-maintainer@unixos2.org (OS/2 version)
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
+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 --git a/README_d/README.solaris b/README_d/README.solaris
index 24adee88..205f7634 100644
--- a/README_d/README.solaris
+++ b/README_d/README.solaris
@@ -53,8 +53,13 @@ IMHO this is Sun's problem, not mine.
Arnold Robbins
arnold@gnu.org
-Solution to Problem #1:
-=======================
+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 <nevai@math.ohio-state.edu>
Subject: Re: gawk-3.0.4
To: arnold@skeeve.com (Aharon Robbins)
diff --git a/acconfig.h b/acconfig.h
index 10ad23a0..dce2b0c6 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -33,6 +33,8 @@
#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 --git a/aclocal.m4 b/aclocal.m4
index 0b5a5506..3cb24057 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# aclocal.m4 generated automatically by aclocal 1.4a
+# aclocal.m4 generated automatically by aclocal 1.5
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# 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,
@@ -24,8 +24,16 @@ sinclude(strtod.m4)dnl
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
-# serial 3
+# 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)
@@ -45,12 +53,11 @@ ifdef([AC_PROVIDE_IFELSE],
# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
# ----------------------------------------------
AC_DEFUN([AM_INIT_AUTOMAKE],
-[dnl We require 2.13 because we rely on SHELL being computed by configure.
-AC_REQUIRE([AC_PROG_INSTALL])dnl
+[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])
+ AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
fi
# Define the identity of the package.
@@ -62,6 +69,20 @@ 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
@@ -71,45 +92,51 @@ AM_MISSING_PROG(AUTOMAKE, automake)
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_MISSING_PROG(AMTAR, tar)
-AM_MISSING_INSTALL_SH
+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
+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 > conftestfile
+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 conftestfile 2> /dev/null`
- if test "[$]*" = "X"; then
+ 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 conftestfile`
+ set X `ls -t $srcdir/configure conftest.file`
fi
- if test "[$]*" != "X $srcdir/configure conftestfile" \
- && test "[$]*" != "X conftestfile $srcdir/configure"; then
+ 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
@@ -119,7 +146,7 @@ if (
alias in your environment])
fi
- test "[$]2" = conftestfile
+ test "$[2]" = conftest.file
)
then
# Ok.
@@ -128,37 +155,28 @@ else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
-rm -f conftest*
AC_MSG_RESULT(yes)])
+
+# serial 2
+
# AM_MISSING_PROG(NAME, PROGRAM)
-AC_DEFUN([AM_MISSING_PROG], [
-AC_REQUIRE([AM_MISSING_HAS_RUN])
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
-# Like AM_MISSING_PROG, but only looks for install-sh.
-# AM_MISSING_INSTALL_SH()
-AC_DEFUN([AM_MISSING_INSTALL_SH], [
-AC_REQUIRE([AM_MISSING_HAS_RUN])
-if test -z "$install_sh"; then
- install_sh="$ac_aux_dir/install-sh"
- test -f "$install_sh" || install_sh="$ac_aux_dir/install.sh"
- test -f "$install_sh" || install_sh="${am_missing_run}${ac_auxdir}/install-sh"
- dnl FIXME: an evil hack: we remove the SHELL invocation from
- dnl install_sh because automake adds it back in. Sigh.
- install_sh="`echo $install_sh | sed -e 's/\${SHELL}//'`"
-fi
-AC_SUBST(install_sh)])
-# AM_MISSING_HAS_RUN.
+# 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], [
-test x"${MISSING+set}" = xset || \
- MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
+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 :"; then
+if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
@@ -167,38 +185,132 @@ else
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.
-# Usage:
-# AM_DEPENDENCIES(NAME)
# 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
-AC_DEFUN([AM_DEPENDENCIES],[
-AC_REQUIRE([AM_SET_DEPDIR])
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])
-ifelse([$1],CC,[
-AC_REQUIRE([AC_PROG_CC])
-AC_REQUIRE([AC_PROG_CPP])
-depcc="$CC"
-depcpp="$CPP"],[$1],CXX,[
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([AC_PROG_CXXCPP])
-depcc="$CXX"
-depcpp="$CXXCPP"],[$1],OBJC,[
-am_cv_OBJC_dependencies_compiler_type=gcc],[
-AC_REQUIRE([AC_PROG_][$1])
-depcc="$[$1]"
-depcpp=""])
-AC_MSG_CHECKING([dependency style of $depcc])
-AC_CACHE_VAL(am_cv_[$1]_dependencies_compiler_type,[
-if test -z "$AMDEP"; then
- echo '#include "conftest.h"' > conftest.c
- echo 'int i;' > conftest.h
-
- am_cv_[$1]_dependencies_compiler_type=none
- for depmode in `sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_depcomp"`; do
- case "$depmode" in
+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
@@ -213,58 +325,57 @@ if test -z "$AMDEP"; then
# 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" \
+ if depmode=$depmode \
source=conftest.c object=conftest.o \
depfile=conftest.Po tmpdepfile=conftest.TPo \
- $SHELL $am_depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
- grep conftest.h conftest.Po > /dev/null 2>&1; then
- am_cv_[$1]_dependencies_compiler_type="$depmode"
+ $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
- rm -f conftest.*
+ cd ..
+ rm -rf conftest.dir
else
- am_cv_[$1]_dependencies_compiler_type=none
+ am_cv_$1_dependencies_compiler_type=none
fi
])
-AC_MSG_RESULT($am_cv_[$1]_dependencies_compiler_type)
-[$1]DEPMODE="depmode=$am_cv_[$1]_dependencies_compiler_type"
-AC_SUBST([$1]DEPMODE)
+$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
+AC_SUBST([$1DEPMODE])
])
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],[
-if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
+# 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)
])
-AC_DEFUN([AM_DEP_TRACK],[
-AC_ARG_ENABLE(dependency-tracking,
+
+# 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
- AMDEP="#"
-else
+if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
- if test ! -f "$am_depcomp"; then
- AMDEP="#"
- else
- AMDEP=
- fi
-fi
-AC_SUBST(AMDEP)
-if test -z "$AMDEP"; then
AMDEPBACKSLASH='\'
-else
- AMDEPBACKSLASH=
fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
pushdef([subst], defn([AC_SUBST]))
subst(AMDEPBACKSLASH)
popdef([subst])
@@ -281,7 +392,7 @@ popdef([subst])
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
AC_OUTPUT_COMMANDS([
-test x"$AMDEP" != x"" ||
+test x"$AMDEP_TRUE" != x"" ||
for mf in $CONFIG_FILES; do
case "$mf" in
Makefile) dirpart=.;;
@@ -318,9 +429,77 @@ for mf in $CONFIG_FILES; do
echo '# dummy' > "$dirpart/$file"
done
done
-], [AMDEP="$AMDEP"
+], [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
@@ -333,22 +512,87 @@ ac_aux_dir="$ac_aux_dir"])])
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]),
- [am_indx=1
- for am_file in $1; do
- case " $CONFIG_HEADERS " in
- *" $am_file "*)
- echo timestamp > `echo $am_file | sed 's%:.*%%;s%[^/]*$%%'`stamp-h$am_indx
- ;;
- esac
- am_indx=\`expr \$am_indx + 1\`
- done])
-])
+ 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
@@ -606,40 +850,111 @@ if test "$am_cv_prog_cc_stdc" != no; then
else
AC_MSG_RESULT(no)
U=_ ANSI2KNR=./ansi2knr
- # Ensure some checks needed by ansi2knr itself.
- AC_HEADER_STDC
- AC_CHECK_HEADERS(string.h)
fi
+# Ensure some checks needed by ansi2knr itself.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(string.h)
AC_SUBST(U)dnl
AC_SUBST(ANSI2KNR)dnl
])
-# Macro to add for using GNU gettext.
-# Ulrich Drepper <drepper@cygnus.com>, 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
+# 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 <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 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
+ ])
-AC_PREREQ(2.13) dnl Minimum Autoconf version required.
+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
-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)
+ 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
-
- 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.])
+ ])
+ 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],
@@ -649,307 +964,1358 @@ AC_DEFUN(AM_WITH_NLS,
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 <libintl.h>], [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
+ 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 <libintl.h>
+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 <libintl.h>
+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 <libintl.h>
+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
- 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
+ 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)"
- 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
+ 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
- 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
+ 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
+ ])
- # We need to process the po/ directory.
- POSUB=po
+ 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
- DATADIRNAME=share
- nls_cv_header_intl=intl/libintl.h
- nls_cv_header_libgt=intl/libgettext.h
+ USE_NLS=no
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
+
+ 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
- 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])
+ dnl We need to process the po/ directory.
+ POSUB=po
+ fi
- # 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.
+ 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
- USE_NLS=yes
- USE_INCLUDED_LIBINTL=yes
+ BUILD_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(BUILD_INCLUDED_LIBINTL)
AC_SUBST(USE_INCLUDED_LIBINTL)
- AC_SUBST(CATALOGS)
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)
- AC_SUBST(GMOFILES)
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INSTOBJEXT=.mo
AC_SUBST(INSTOBJEXT)
- AC_SUBST(INTLDEPS)
- AC_SUBST(INTLLIBS)
- AC_SUBST(INTLOBJS)
- AC_SUBST(POFILES)
- AC_SUBST(POSUB)
+
+ 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)
])
-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
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INTLLIBS="$LIBINTL"
+ AC_SUBST(INTLLIBS)
- 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 Make all documented variables known to autoconf.
+ AC_SUBST(LIBINTL)
+ AC_SUBST(LTLIBINTL)
+ AC_SUBST(POSUB)
+])
- 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 <locale.h> in the installed <libintl.h> 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 <locale.h>"
- else
- INCLUDE_LOCALE_H="\
-/* The system does not provide the header <locale.h>. 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
+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
+])
-# Search path for a program which passes the given test.
-# Ulrich Drepper <drepper@cygnus.com>, 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.
+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"
+])
-# serial 1
+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 </dev/null | egrep '(GNU|with BFD)' 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 <stdlib.h>
+#include <iconv.h>],
+ [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 <stdlib.h>
+#include <iconv.h>],
+ [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 <stdlib.h>
+#include <iconv.h>
+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 <drepper@cygnus.com>, 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,
+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])
@@ -977,7 +2343,7 @@ ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
;;
esac])dnl
$1="$ac_cv_path_$1"
-if test -n "[$]$1"; then
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
@@ -985,26 +2351,93 @@ fi
AC_SUBST($1)dnl
])
-# Check whether LC_MESSAGES is available in <locale.h>.
-# Ulrich Drepper <drepper@cygnus.com>, 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.
+# 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.
-# serial 2
+# Test for the GNU C Library, version 2.1 or newer.
+# From Bruno Haible.
-AC_PREREQ(2.13) dnl Minimum Autoconf version required.
+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 <features.h>
+#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 <langinfo.h>],
+ [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 <langinfo.h> 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 <drepper@cygnus.com>, 1995.
+
+# Check whether LC_MESSAGES is available in <locale.h>.
-AC_DEFUN(AM_LC_MESSAGES,
+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 <locale.h>], [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.])
+ [Define if your <locale.h> file defines LC_MESSAGES.])
fi
fi])
@@ -1036,7 +2469,7 @@ AC_DEFUN(GAWK_AC_TYPE_SSIZE_T,
dnl
dnl strtod.m4 --- autoconf input file for gawk
dnl
-dnl Copyright (C) 2001 the Free Software Foundation, Inc.
+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.
@@ -1084,6 +2517,7 @@ main ()
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 --git a/array.c b/array.c
index 905f3bad..1186b929 100644
--- a/array.c
+++ b/array.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc.
+ * 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,7 +270,9 @@ assoc_lookup(NODE *symbol, NODE *subs, int reference)
register int hash1;
register NODE *bucket;
- assert(symbol->type == Node_var_array || symbol->type == Node_var);
+ /* 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,7 +609,7 @@ do_adump(NODE *tree)
a = tree->lnode;
if (a->type == Node_param_list) {
- printf(_("%s: is paramater\n"), a->vname);
+ printf(_("%s: is parameter\n"), a->vname);
a = stack_ptr[a->param_cnt];
}
diff --git a/awk.h b/awk.h
index 9e872a7a..d3c19c9e 100644
--- a/awk.h
+++ b/awk.h
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc.
+ * 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,21 +49,15 @@
#include <ctype.h>
#include <setjmp.h>
-#if defined(HAVE_LIBINTL_H) && defined(ENABLE_NLS) && ENABLE_NLS > 0
-#include <libintl.h>
-#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 */
+#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 /* ! (HAVE_LOCALE_H && defined(ENABLE_NLS) && ENABLE_LS > 0) */
-#define _(msgid) gettext(msgid)
-#define N_(msgid) msgid
+#endif
#ifdef HAVE_LOCALE_H
#include <locale.h>
@@ -82,6 +76,12 @@ extern int errno;
#ifdef HAVE_SIGNUM_H
#include <signum.h>
#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 <wchar.h>
+#include <wctype.h>
+#endif
/* ----------------- System dependencies (with more includes) -----------*/
@@ -116,9 +116,12 @@ extern int errno;
#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,6 +142,10 @@ extern int errno;
#include <file.h> /* avoid <fcntl.h> 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 <stdlib.h>
#else /* not STDC_HEADERS */
@@ -169,7 +176,7 @@ extern int errno;
#include <unixlib.h>
#endif /* atarist || VMS */
-#if ! defined(MSDOS) && ! defined(OS2) && ! defined(WIN32)
+#if ! defined(MSDOS) && ! defined(OS2) && ! defined(WIN32) && ! defined(__EMX__) && ! defined(O_BINARY) /*duh*/
#define O_BINARY 0
#endif
@@ -368,6 +375,7 @@ typedef enum nodevals {
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,6 +649,12 @@ extern int do_dump_vars;
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,20 +744,20 @@ extern char casetable[]; /* for case-independent regexp matching */
#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))
+ (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 memory (%s)",\
- (str), #var, strerror(errno)),0))
+ (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 memory (%s)",\
- (str), "var", strerror(errno)),0))
+ (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 memory (%s)",\
- (str), "var", strerror(errno)),0))
+ (fatal(_("%s: %s: can't allocate %d bytes of memory (%s)"),\
+ (str), "var", x, strerror(errno)),0))
#endif /* HAVE_STRINGIZE */
#ifdef GAWKDEBUG
@@ -852,7 +866,12 @@ extern NODE *do_compl P((NODE *tree));
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 --git a/awkgram.c b/awkgram.c
index f8b93ad9..4a7d4af5 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -78,6 +78,7 @@ static void parms_shadow P((const char *fname, NODE *func));
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 };
@@ -114,7 +115,7 @@ extern int errcount;
extern NODE *begin_block;
extern NODE *end_block;
-#line 96 "awkgram.y"
+#line 97 "awkgram.y"
typedef union {
long lval;
AWKNUM fval;
@@ -133,11 +134,11 @@ typedef union {
-#define YYFINAL 320
+#define YYFINAL 318
#define YYFLAG -32768
#define YYNTBASE 63
-#define YYTRANSLATE(x) ((unsigned)(x) <= 295 ? yytranslate[x] : 108)
+#define YYTRANSLATE(x) ((unsigned)(x) <= 295 ? yytranslate[x] : 110)
static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -178,100 +179,100 @@ static const short yyprhs[] = { 0,
25, 28, 31, 34, 36, 39, 42, 44, 46, 48,
50, 52, 53, 61, 67, 72, 74, 78, 79, 84,
90, 95, 97, 100, 102, 105, 107, 110, 113, 116,
- 120, 122, 129, 138, 147, 160, 172, 175, 178, 185,
- 190, 193, 196, 200, 201, 206, 213, 217, 220, 222,
- 224, 231, 241, 243, 246, 247, 249, 250, 253, 254,
- 257, 260, 263, 266, 267, 269, 271, 275, 277, 280,
- 284, 285, 287, 288, 290, 292, 296, 298, 301, 305,
- 309, 310, 312, 314, 318, 320, 323, 327, 331, 332,
- 337, 343, 348, 353, 357, 361, 365, 369, 371, 374,
- 378, 382, 386, 390, 396, 398, 401, 402, 407, 411,
- 415, 419, 421, 424, 428, 432, 436, 442, 444, 447,
- 449, 453, 457, 461, 465, 469, 473, 476, 479, 482,
- 486, 491, 496, 498, 503, 505, 508, 511, 513, 515,
- 518, 521, 522, 524, 526, 531, 534, 537, 540, 542,
- 543, 545, 547
+ 120, 122, 129, 138, 147, 160, 172, 175, 178, 181,
+ 184, 188, 189, 194, 197, 203, 207, 213, 216, 218,
+ 219, 221, 223, 225, 232, 242, 244, 247, 248, 250,
+ 251, 254, 255, 258, 261, 264, 267, 268, 270, 272,
+ 276, 278, 281, 285, 286, 288, 289, 291, 293, 297,
+ 299, 302, 306, 310, 311, 313, 315, 319, 321, 324,
+ 328, 332, 333, 338, 344, 349, 354, 358, 362, 366,
+ 370, 372, 375, 379, 383, 387, 391, 397, 399, 402,
+ 403, 408, 412, 416, 420, 422, 425, 429, 433, 437,
+ 443, 445, 448, 450, 454, 458, 462, 466, 470, 474,
+ 477, 480, 483, 487, 492, 497, 499, 504, 506, 509,
+ 512, 514, 516, 519, 522, 523, 525, 527, 532, 535,
+ 538, 541, 543, 544, 546, 548
};
-static const short yyrhs[] = { 84,
- 64, 84, 0, 65, 0, 64, 65, 0, 1, 0,
+static const short yyrhs[] = { 86,
+ 64, 86, 0, 65, 0, 64, 65, 0, 1, 0,
64, 1, 0, 0, 0, 15, 66, 76, 0, 0,
16, 67, 76, 0, 15, 78, 0, 16, 78, 0,
73, 76, 0, 76, 0, 73, 78, 0, 70, 72,
0, 4, 0, 3, 0, 69, 0, 38, 0, 39,
- 0, 0, 30, 71, 68, 56, 87, 104, 84, 0,
- 102, 77, 103, 105, 84, 0, 102, 103, 105, 84,
- 0, 94, 0, 94, 42, 94, 0, 0, 50, 75,
- 5, 50, 0, 102, 77, 103, 105, 84, 0, 102,
- 103, 105, 84, 0, 79, 0, 77, 79, 0, 1,
- 0, 77, 1, 0, 83, 0, 106, 84, 0, 106,
- 84, 0, 102, 103, 0, 102, 77, 103, 0, 82,
- 0, 21, 56, 94, 104, 84, 79, 0, 22, 84,
- 79, 21, 56, 94, 104, 84, 0, 23, 56, 4,
- 33, 4, 104, 84, 79, 0, 23, 56, 89, 106,
- 84, 94, 106, 84, 89, 104, 84, 79, 0, 23,
- 56, 89, 106, 84, 106, 84, 89, 104, 84, 79,
- 0, 24, 78, 0, 25, 78, 0, 81, 56, 93,
- 104, 86, 78, 0, 81, 90, 86, 78, 0, 28,
- 78, 0, 32, 78, 0, 29, 89, 78, 0, 0,
- 19, 80, 89, 78, 0, 20, 4, 58, 93, 59,
- 78, 0, 20, 4, 78, 0, 94, 78, 0, 26,
- 0, 27, 0, 17, 56, 94, 104, 84, 79, 0,
- 17, 56, 94, 104, 84, 79, 18, 84, 79, 0,
- 13, 0, 83, 13, 0, 0, 83, 0, 0, 43,
- 98, 0, 0, 44, 94, 0, 10, 94, 0, 45,
- 94, 0, 46, 94, 0, 0, 88, 0, 4, 0,
- 88, 107, 4, 0, 1, 0, 88, 1, 0, 88,
- 107, 1, 0, 0, 94, 0, 0, 91, 0, 96,
- 0, 91, 107, 96, 0, 1, 0, 91, 1, 0,
- 91, 1, 96, 0, 91, 107, 1, 0, 0, 93,
- 0, 94, 0, 93, 107, 94, 0, 1, 0, 93,
- 1, 0, 93, 1, 94, 0, 93, 107, 1, 0,
- 0, 101, 11, 95, 94, 0, 56, 93, 104, 33,
- 4, 0, 94, 45, 31, 100, 0, 94, 46, 31,
- 100, 0, 31, 100, 85, 0, 94, 34, 94, 0,
- 94, 35, 94, 0, 94, 12, 94, 0, 74, 0,
- 52, 74, 0, 94, 33, 4, 0, 94, 9, 94,
- 0, 94, 43, 94, 0, 94, 44, 94, 0, 94,
- 40, 94, 41, 94, 0, 98, 0, 94, 98, 0,
- 0, 101, 11, 97, 96, 0, 96, 34, 96, 0,
- 96, 35, 96, 0, 31, 100, 85, 0, 74, 0,
- 52, 74, 0, 96, 12, 96, 0, 96, 33, 4,
- 0, 96, 9, 96, 0, 96, 40, 96, 41, 96,
- 0, 98, 0, 96, 98, 0, 99, 0, 98, 54,
- 98, 0, 98, 49, 98, 0, 98, 50, 98, 0,
- 98, 51, 98, 0, 98, 47, 98, 0, 98, 48,
- 98, 0, 101, 36, 0, 101, 37, 0, 52, 98,
- 0, 56, 94, 104, 0, 38, 56, 92, 104, 0,
- 39, 56, 92, 104, 0, 39, 0, 3, 56, 92,
- 104, 0, 101, 0, 36, 101, 0, 37, 101, 0,
- 7, 0, 8, 0, 48, 98, 0, 47, 98, 0,
- 0, 101, 0, 4, 0, 4, 58, 93, 59, 0,
- 55, 99, 0, 60, 84, 0, 61, 84, 0, 57,
- 0, 0, 106, 0, 62, 0, 42, 84, 0
+ 0, 0, 30, 71, 68, 56, 89, 106, 86, 0,
+ 104, 77, 105, 107, 86, 0, 104, 105, 107, 86,
+ 0, 96, 0, 96, 42, 96, 0, 0, 50, 75,
+ 5, 50, 0, 104, 77, 105, 107, 86, 0, 104,
+ 105, 107, 86, 0, 79, 0, 77, 79, 0, 1,
+ 0, 77, 1, 0, 85, 0, 108, 86, 0, 108,
+ 86, 0, 104, 105, 0, 104, 77, 105, 0, 84,
+ 0, 21, 56, 96, 106, 86, 79, 0, 22, 86,
+ 79, 21, 56, 96, 106, 86, 0, 23, 56, 4,
+ 33, 4, 106, 86, 79, 0, 23, 56, 82, 108,
+ 86, 96, 108, 86, 82, 106, 86, 79, 0, 23,
+ 56, 82, 108, 86, 108, 86, 82, 106, 86, 79,
+ 0, 24, 78, 0, 25, 78, 0, 28, 78, 0,
+ 32, 78, 0, 29, 91, 78, 0, 0, 19, 80,
+ 91, 78, 0, 81, 78, 0, 83, 56, 95, 106,
+ 88, 0, 83, 92, 88, 0, 20, 4, 58, 95,
+ 59, 0, 20, 4, 0, 96, 0, 0, 81, 0,
+ 26, 0, 27, 0, 17, 56, 96, 106, 86, 79,
+ 0, 17, 56, 96, 106, 86, 79, 18, 86, 79,
+ 0, 13, 0, 85, 13, 0, 0, 85, 0, 0,
+ 43, 100, 0, 0, 44, 96, 0, 10, 96, 0,
+ 45, 96, 0, 46, 96, 0, 0, 90, 0, 4,
+ 0, 90, 109, 4, 0, 1, 0, 90, 1, 0,
+ 90, 109, 1, 0, 0, 96, 0, 0, 93, 0,
+ 98, 0, 93, 109, 98, 0, 1, 0, 93, 1,
+ 0, 93, 1, 98, 0, 93, 109, 1, 0, 0,
+ 95, 0, 96, 0, 95, 109, 96, 0, 1, 0,
+ 95, 1, 0, 95, 1, 96, 0, 95, 109, 1,
+ 0, 0, 103, 11, 97, 96, 0, 56, 95, 106,
+ 33, 4, 0, 96, 45, 31, 102, 0, 96, 46,
+ 31, 102, 0, 31, 102, 87, 0, 96, 34, 96,
+ 0, 96, 35, 96, 0, 96, 12, 96, 0, 74,
+ 0, 52, 74, 0, 96, 33, 4, 0, 96, 9,
+ 96, 0, 96, 43, 96, 0, 96, 44, 96, 0,
+ 96, 40, 96, 41, 96, 0, 100, 0, 96, 100,
+ 0, 0, 103, 11, 99, 98, 0, 98, 34, 98,
+ 0, 98, 35, 98, 0, 31, 102, 87, 0, 74,
+ 0, 52, 74, 0, 98, 12, 98, 0, 98, 33,
+ 4, 0, 98, 9, 98, 0, 98, 40, 98, 41,
+ 98, 0, 100, 0, 98, 100, 0, 101, 0, 100,
+ 54, 100, 0, 100, 49, 100, 0, 100, 50, 100,
+ 0, 100, 51, 100, 0, 100, 47, 100, 0, 100,
+ 48, 100, 0, 103, 36, 0, 103, 37, 0, 52,
+ 100, 0, 56, 96, 106, 0, 38, 56, 94, 106,
+ 0, 39, 56, 94, 106, 0, 39, 0, 3, 56,
+ 94, 106, 0, 103, 0, 36, 103, 0, 37, 103,
+ 0, 7, 0, 8, 0, 48, 100, 0, 47, 100,
+ 0, 0, 103, 0, 4, 0, 4, 58, 95, 59,
+ 0, 55, 101, 0, 60, 86, 0, 61, 86, 0,
+ 57, 0, 0, 108, 0, 62, 0, 42, 86, 0
};
#endif
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 157, 165, 173, 189, 190, 191, 195, 197, 211, 213,
- 228, 234, 240, 242, 244, 257, 266, 268, 270, 280,
- 281, 285, 289, 304, 309, 318, 320, 329, 331, 349,
- 351, 356, 362, 370, 372, 377, 378, 382, 384, 386,
- 388, 390, 392, 394, 422, 426, 431, 434, 437, 443,
- 465, 473, 492, 494, 499, 501, 503, 517, 522, 524,
- 529, 534, 541, 543, 547, 548, 552, 554, 559, 561,
- 563, 565, 567, 577, 579, 584, 586, 588, 590, 592,
- 598, 600, 605, 607, 612, 614, 620, 622, 624, 626,
- 631, 633, 638, 640, 646, 648, 650, 652, 657, 660,
- 665, 667, 672, 677, 683, 685, 687, 693, 703, 711,
- 713, 719, 721, 723, 725, 727, 732, 735, 736, 738,
- 740, 746, 748, 750, 752, 754, 756, 758, 760, 765,
- 767, 769, 771, 773, 775, 777, 779, 781, 786, 788,
- 790, 793, 795, 803, 810, 811, 813, 815, 817, 820,
- 828, 839, 841, 846, 848, 858, 863, 867, 871, 875,
- 876, 880, 883
+ 159, 167, 175, 191, 192, 193, 197, 199, 213, 215,
+ 230, 236, 242, 244, 246, 259, 268, 270, 272, 282,
+ 283, 287, 291, 306, 311, 320, 322, 331, 333, 351,
+ 353, 358, 364, 372, 374, 379, 380, 384, 386, 388,
+ 390, 392, 394, 396, 436, 440, 445, 448, 451, 459,
+ 478, 480, 485, 487, 499, 505, 527, 529, 543, 548,
+ 550, 555, 557, 562, 567, 574, 576, 580, 581, 585,
+ 587, 592, 594, 596, 598, 600, 610, 612, 617, 619,
+ 621, 623, 625, 631, 633, 638, 640, 645, 647, 653,
+ 655, 657, 659, 664, 666, 671, 673, 679, 681, 683,
+ 685, 690, 693, 698, 700, 705, 710, 716, 718, 720,
+ 726, 736, 744, 746, 752, 754, 756, 758, 760, 765,
+ 768, 769, 771, 773, 779, 781, 783, 785, 787, 789,
+ 791, 793, 798, 800, 802, 804, 806, 808, 810, 812,
+ 814, 819, 821, 823, 826, 828, 836, 843, 844, 846,
+ 848, 850, 853, 861, 872, 874, 879, 881, 891, 896,
+ 900, 904, 908, 909, 913, 916
};
#endif
@@ -288,10 +289,11 @@ static const char * const yytname[] = { "$","error","$undefined.","FUNC_CALL",
"'!'","UNARY","'^'","'$'","'('","')'","'['","']'","'{'","'}'","';'","start",
"program","rule","@1","@2","func_name","lex_builtin","function_prologue","@3",
"function_body","pattern","regexp","@4","action","statements","statement_term",
-"statement","@5","print","if_statement","nls","opt_nls","input_redir","output_redir",
-"opt_param_list","param_list","opt_exp","opt_rexpression_list","rexpression_list",
-"opt_expression_list","expression_list","exp","@6","rexp","@7","simp_exp","non_post_simp_exp",
-"opt_variable","variable","l_brace","r_brace","r_paren","opt_semi","semi","comma", NULL
+"statement","@5","simple_stmt","opt_simple_stmt","print","if_statement","nls",
+"opt_nls","input_redir","output_redir","opt_param_list","param_list","opt_exp",
+"opt_rexpression_list","rexpression_list","opt_expression_list","expression_list",
+"exp","@6","rexp","@7","simp_exp","non_post_simp_exp","opt_variable","variable",
+"l_brace","r_brace","r_paren","opt_semi","semi","comma", NULL
};
#endif
@@ -301,18 +303,18 @@ static const short yyr1[] = { 0,
69, 71, 70, 72, 72, 73, 73, 75, 74, 76,
76, 77, 77, 77, 77, 78, 78, 79, 79, 79,
79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 79, 79, 80, 79, 79, 79, 79, 81, 81,
- 82, 82, 83, 83, 84, 84, 85, 85, 86, 86,
- 86, 86, 86, 87, 87, 88, 88, 88, 88, 88,
- 89, 89, 90, 90, 91, 91, 91, 91, 91, 91,
- 92, 92, 93, 93, 93, 93, 93, 93, 95, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 97, 96, 96, 96,
- 96, 96, 96, 96, 96, 96, 96, 96, 96, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 100, 100, 101, 101, 101, 102, 103, 104, 105,
- 105, 106, 107
+ 79, 80, 79, 79, 81, 81, 81, 81, 81, 82,
+ 82, 83, 83, 84, 84, 85, 85, 86, 86, 87,
+ 87, 88, 88, 88, 88, 88, 89, 89, 90, 90,
+ 90, 90, 90, 91, 91, 92, 92, 93, 93, 93,
+ 93, 93, 93, 94, 94, 95, 95, 95, 95, 95,
+ 95, 97, 96, 96, 96, 96, 96, 96, 96, 96,
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 99,
+ 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
+ 98, 98, 100, 100, 100, 100, 100, 100, 100, 100,
+ 100, 101, 101, 101, 101, 101, 101, 101, 101, 101,
+ 101, 101, 101, 101, 102, 102, 103, 103, 103, 104,
+ 105, 106, 107, 107, 108, 109
};
static const short yyr2[] = { 0,
@@ -320,505 +322,489 @@ static const short yyr2[] = { 0,
2, 2, 2, 1, 2, 2, 1, 1, 1, 1,
1, 0, 7, 5, 4, 1, 3, 0, 4, 5,
4, 1, 2, 1, 2, 1, 2, 2, 2, 3,
- 1, 6, 8, 8, 12, 11, 2, 2, 6, 4,
- 2, 2, 3, 0, 4, 6, 3, 2, 1, 1,
- 6, 9, 1, 2, 0, 1, 0, 2, 0, 2,
- 2, 2, 2, 0, 1, 1, 3, 1, 2, 3,
- 0, 1, 0, 1, 1, 3, 1, 2, 3, 3,
- 0, 1, 1, 3, 1, 2, 3, 3, 0, 4,
- 5, 4, 4, 3, 3, 3, 3, 1, 2, 3,
- 3, 3, 3, 5, 1, 2, 0, 4, 3, 3,
- 3, 1, 2, 3, 3, 3, 5, 1, 2, 1,
- 3, 3, 3, 3, 3, 3, 2, 2, 2, 3,
- 4, 4, 1, 4, 1, 2, 2, 1, 1, 2,
- 2, 0, 1, 1, 4, 2, 2, 2, 1, 0,
- 1, 1, 2
+ 1, 6, 8, 8, 12, 11, 2, 2, 2, 2,
+ 3, 0, 4, 2, 5, 3, 5, 2, 1, 0,
+ 1, 1, 1, 6, 9, 1, 2, 0, 1, 0,
+ 2, 0, 2, 2, 2, 2, 0, 1, 1, 3,
+ 1, 2, 3, 0, 1, 0, 1, 1, 3, 1,
+ 2, 3, 3, 0, 1, 1, 3, 1, 2, 3,
+ 3, 0, 4, 5, 4, 4, 3, 3, 3, 3,
+ 1, 2, 3, 3, 3, 3, 5, 1, 2, 0,
+ 4, 3, 3, 3, 1, 2, 3, 3, 3, 5,
+ 1, 2, 1, 3, 3, 3, 3, 3, 3, 2,
+ 2, 2, 3, 4, 4, 1, 4, 1, 2, 2,
+ 1, 1, 2, 2, 0, 1, 1, 4, 2, 2,
+ 2, 1, 0, 1, 1, 2
};
-static const short yydefact[] = { 65,
- 63, 66, 0, 64, 4, 0, 154, 148, 149, 7,
- 9, 22, 152, 0, 0, 0, 143, 0, 0, 28,
- 0, 0, 0, 65, 0, 2, 0, 0, 108, 14,
- 26, 115, 130, 145, 0, 0, 0, 162, 0, 11,
- 36, 65, 0, 12, 0, 67, 153, 146, 147, 0,
- 0, 0, 0, 151, 145, 150, 0, 109, 139, 156,
- 145, 95, 0, 93, 157, 5, 3, 1, 16, 0,
+static const short yydefact[] = { 68,
+ 66, 69, 0, 67, 4, 0, 157, 151, 152, 7,
+ 9, 22, 155, 0, 0, 0, 146, 0, 0, 28,
+ 0, 0, 0, 68, 0, 2, 0, 0, 111, 14,
+ 26, 118, 133, 148, 0, 0, 0, 165, 0, 11,
+ 36, 68, 0, 12, 0, 70, 156, 149, 150, 0,
+ 0, 0, 0, 154, 148, 153, 0, 112, 142, 159,
+ 148, 98, 0, 96, 160, 5, 3, 1, 16, 0,
13, 15, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 116, 0, 0, 0, 0, 0, 0,
- 99, 137, 138, 34, 0, 54, 0, 0, 65, 0,
- 0, 0, 59, 60, 0, 81, 0, 65, 0, 32,
- 0, 41, 0, 0, 160, 65, 0, 0, 93, 0,
- 8, 37, 10, 18, 17, 20, 21, 0, 19, 0,
- 104, 0, 0, 0, 0, 96, 65, 159, 0, 0,
- 140, 0, 160, 111, 107, 110, 105, 106, 0, 27,
- 112, 113, 152, 152, 135, 136, 132, 133, 134, 131,
- 0, 0, 81, 0, 0, 0, 81, 47, 48, 51,
- 0, 82, 52, 158, 35, 33, 160, 87, 152, 0,
- 0, 122, 69, 0, 85, 128, 145, 58, 0, 39,
- 65, 161, 38, 144, 155, 0, 68, 141, 142, 29,
- 97, 163, 0, 98, 94, 160, 65, 0, 102, 103,
- 100, 0, 0, 0, 57, 0, 0, 154, 0, 53,
- 65, 67, 123, 0, 0, 0, 0, 0, 0, 88,
- 0, 0, 0, 0, 0, 0, 0, 129, 117, 40,
- 31, 78, 76, 0, 0, 101, 65, 25, 114, 65,
- 55, 0, 65, 0, 0, 65, 30, 121, 69, 71,
- 70, 72, 73, 50, 89, 90, 86, 126, 124, 125,
- 119, 120, 0, 0, 65, 79, 0, 24, 0, 0,
- 0, 0, 0, 0, 0, 0, 118, 23, 80, 77,
- 61, 56, 42, 0, 65, 0, 65, 49, 127, 65,
- 65, 0, 65, 81, 0, 43, 44, 81, 0, 62,
- 0, 65, 65, 0, 0, 46, 45, 0, 0, 0
+ 0, 0, 0, 119, 0, 0, 0, 0, 0, 0,
+ 102, 140, 141, 34, 0, 52, 0, 0, 68, 0,
+ 0, 0, 62, 63, 0, 84, 0, 68, 0, 32,
+ 0, 0, 41, 59, 0, 163, 68, 0, 0, 96,
+ 0, 8, 37, 10, 18, 17, 20, 21, 0, 19,
+ 0, 107, 0, 0, 0, 0, 99, 68, 162, 0,
+ 0, 143, 0, 163, 114, 110, 113, 108, 109, 0,
+ 27, 115, 116, 155, 155, 138, 139, 135, 136, 137,
+ 134, 0, 0, 84, 58, 0, 0, 60, 47, 48,
+ 49, 0, 85, 50, 161, 35, 33, 163, 54, 90,
+ 155, 0, 0, 125, 72, 0, 88, 131, 148, 0,
+ 39, 68, 164, 38, 147, 158, 0, 71, 144, 145,
+ 29, 100, 166, 0, 101, 97, 163, 68, 0, 105,
+ 106, 103, 0, 0, 0, 0, 0, 157, 61, 0,
+ 51, 68, 70, 126, 0, 0, 0, 0, 0, 56,
+ 91, 0, 0, 0, 0, 0, 0, 0, 132, 120,
+ 40, 31, 81, 79, 0, 0, 104, 68, 25, 117,
+ 68, 53, 0, 68, 0, 0, 68, 30, 124, 72,
+ 74, 73, 75, 76, 92, 93, 89, 129, 127, 128,
+ 122, 123, 0, 0, 68, 82, 0, 24, 0, 57,
+ 0, 0, 0, 0, 55, 0, 121, 23, 83, 80,
+ 64, 42, 0, 68, 0, 68, 130, 68, 68, 0,
+ 68, 60, 0, 43, 44, 60, 0, 65, 0, 68,
+ 68, 0, 0, 46, 45, 0, 0, 0
};
-static const short yydefgoto[] = { 318,
- 25, 26, 39, 43, 128, 129, 27, 45, 69, 28,
- 29, 57, 30, 109, 40, 110, 163, 111, 112, 2,
- 3, 131, 229, 244, 245, 171, 183, 184, 117, 118,
- 113, 161, 185, 274, 32, 33, 46, 34, 114, 115,
- 141, 191, 42, 140
+static const short yydefgoto[] = { 316,
+ 25, 26, 39, 43, 129, 130, 27, 45, 69, 28,
+ 29, 57, 30, 109, 40, 110, 164, 111, 220, 112,
+ 113, 2, 3, 132, 230, 245, 246, 172, 185, 186,
+ 118, 119, 114, 162, 187, 274, 32, 33, 46, 34,
+ 115, 116, 142, 192, 117, 141
};
-static const short yypact[] = { 2,
--32768, 4, 840,-32768,-32768, -33, -32,-32768,-32768, -4,
- -4,-32768, -1, -1, -1, -27, 34, 1832, 1832,-32768,
- 1811, 1832, 1158, 2, 898,-32768, 29, 33,-32768,-32768,
- 1322, 103,-32768, 72, 630, 1136, 1158,-32768, 29,-32768,
- 4, 2, 29,-32768, 84, 54,-32768,-32768,-32768, 1136,
- 1136, 1832, 1715, 53, 31, 53, 120,-32768, 53,-32768,
--32768,-32768, 39, 1267,-32768,-32768,-32768,-32768,-32768, 630,
--32768,-32768, 1715, 1715, 128, 1715, 1715, 1715, 1715, 1715,
- 1715, 104, 105, 103, 1832, 1832, 1832, 1832, 1832, 1832,
--32768,-32768,-32768,-32768, 88,-32768, 130, 89, 2, 90,
- -4, -4,-32768,-32768, -4, 1715, -4, 2, 721,-32768,
- 783,-32768, 1008, 630, 86, 2, 111, 43, 1422, 10,
--32768,-32768,-32768,-32768,-32768,-32768,-32768, 100,-32768, 1832,
--32768, 111, 111, 1267, 119, 1715, 2,-32768, 122, 1208,
--32768, 721, 86, 1886, 1869,-32768, 1522, 1472, 1372, 1422,
- 1886, 1886, -1, -1, 116, 116, 53, 53, 53, 53,
- 1715, 1715, 1715, 36, 1715, 948, 1752,-32768,-32768,-32768,
- -4, 1422,-32768,-32768,-32768,-32768, 86,-32768, -1, 1811,
- 1158,-32768, 95, 17, 1614, 103, 93,-32768, 721,-32768,
- 2,-32768,-32768,-32768,-32768, 9, 103,-32768,-32768,-32768,
- 1422,-32768, 167,-32768, 1422, 86, 2, 1715,-32768,-32768,
- 1422, 1267, -4, 1158,-32768, 1267, 151, -5, 86,-32768,
- 2, 54,-32768, 39, 1715, 1715, 1715, 1715, -4, 1774,
- 1230, 1774, 1774, 169, 1774, 1774, 1774, 103,-32768,-32768,
--32768,-32768,-32768, 111, 44,-32768, 2,-32768, 1422, 2,
--32768, 13, 2, 121, 171, 2,-32768,-32768, 95, 1422,
- 1422, 1422, 1422,-32768, 1614,-32768, 1614, 1280, 390,-32768,
- 1693, 1656, 1572, 1774, 2,-32768, 20,-32768, 948, -4,
- 948, 1715, 111, 1086, -4, 1774, 1614,-32768,-32768,-32768,
- 158,-32768,-32768, 1267, 2, 1064, 2,-32768, 1614, 2,
- 2, 948, 2, 1715, 948,-32768,-32768, 1715, 111,-32768,
- 111, 2, 2, 948, 948,-32768,-32768, 179, 180,-32768
+static const short yypact[] = { 4,
+-32768, 26, 848,-32768,-32768, -13, -17,-32768,-32768, 12,
+ 12,-32768, 15, 15, 15, -11, 11, 1772, 1772,-32768,
+ 1735, 1772, 1065, 4, 906,-32768, 56, -3,-32768,-32768,
+ 1229, 198,-32768, 17, 676, 1043, 1065,-32768, 56,-32768,
+ 26, 4, 56,-32768, 82, 35,-32768,-32768,-32768, 1043,
+ 1043, 1772, 1677, 53, 51, 53, 106,-32768, 53,-32768,
+-32768,-32768, 19, 1174,-32768,-32768,-32768,-32768,-32768, 676,
+-32768,-32768, 1677, 1677, 120, 1677, 1677, 1677, 1677, 1677,
+ 1677, 94, 99, 198, 1772, 1772, 1772, 1772, 1772, 1772,
+-32768,-32768,-32768,-32768, 75,-32768, 129, 79, 4, 83,
+ 12, 12,-32768,-32768, 12, 1677, 12, 4, 726,-32768,
+ 12, 788,-32768, 1329, 676, 78, 4, 89, 37, 1329,
+ 13,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 97,-32768,
+ 1772,-32768, 89, 89, 1174, 100, 1677, 4,-32768, 124,
+ 1115,-32768, 726, 78, 1814, 1789,-32768, 1429, 1379, 1279,
+ 1329, 1814, 1814, 15, 15, -14, -14, 53, 53, 53,
+ 53, 1677, 1677, 1677, 102, 1677, 956, 1544,-32768,-32768,
+-32768, 12, 1329,-32768,-32768,-32768,-32768, 78,-32768,-32768,
+ 15, 1735, 1065,-32768, 73, 20, 1521, 198, 118, 726,
+-32768, 4,-32768,-32768,-32768,-32768, 43, 198,-32768,-32768,
+-32768, 1329,-32768, 157,-32768, 1329, 78, 4, 1677,-32768,
+-32768, 1329, 1174, 12, 1065, 1174, 142, -7,-32768, 78,
+-32768, 4, 35,-32768, 19, 1677, 1677, 1677, 1677,-32768,
+ 1714, 1137, 1714, 1714, 160, 1714, 1714, 1714, 198,-32768,
+-32768,-32768,-32768,-32768, 89, 47,-32768, 4,-32768, 1329,
+ 4,-32768, 14, 4, 109, 165, 4,-32768,-32768, 73,
+ 1329, 1329, 1329, 1329, 1521,-32768, 1521, 1006, 1187,-32768,
+ 1655, 1618, 1479, 1714, 4,-32768, 59,-32768, 956,-32768,
+ 956, 1677, 89, 524,-32768, 1714, 1521,-32768,-32768,-32768,
+ 153,-32768, 1174, 4, 993, 4, 1521, 4, 4, 956,
+ 4, 1581, 956,-32768,-32768, 1581, 89,-32768, 89, 4,
+ 4, 956, 956,-32768,-32768, 175, 176,-32768
};
static const short yypgoto[] = {-32768,
--32768, 156,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
- 245,-32768, 78, -54, 403, 98,-32768,-32768,-32768, 210,
- -17, -34, -70,-32768,-32768, -161,-32768,-32768, 63, -18,
- -3,-32768, -194,-32768, 321, 170, -122, 97, 99, -58,
- 204, -142, 421, -180
+-32768, 152,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+ -15,-32768, 70, -57, 21, -75,-32768, -165, -275,-32768,
+-32768, 1, -24, -45, -81,-32768,-32768, 16,-32768,-32768,
+ 40, -21, 309,-32768, -89,-32768, 395, 166, -131, 168,
+ 131, -63, 18, -136, -6, -177
};
-#define YYLAST 1942
-
-
-static const short yytable[] = { 31,
- 207, 213, 7, 231, 63, 219, 65, 68, 1, 242,
- 136, 143, 243, 136, 1, 142, 4, 230, 120, 64,
- 289, 31, 36, 290, 122, 37, -84, 255, 50, -84,
- 209, 210, 119, 119, 221, 265, 267, 268, 269, 136,
- 271, 272, 273, 136, 276, 1, 119, 119, 1, 134,
- 177, 137, 37, 22, 137, 190, 222, 38, 137, 189,
- -84, -84, -84, 247, 277, -74, 92, 93, 195, 144,
- 145, 280, 147, 148, 149, 150, 151, 152, -84, 287,
- 137, 166, 91, 206, 137, 137, 124, 125, 24, 51,
- 174, 299, 24, 214, 38, 138, 130, 38, 193, -92,
- -75, 35, 172, 239, 225, 71, 90, 92, 93, 47,
- 48, 49, 132, 133, 55, 55, 121, 55, 61, 202,
- 123, 126, 127, 35, 135, 70, 35, 55, 92, 93,
- 240, 146, 201, 164, 153, 154, 205, 35, 226, 227,
- 228, 35, 309, 162, 165, 167, 311, 38, 55, 85,
- 86, 87, 88, 89, 203, 196, 90, 211, 212, 172,
- 55, 216, 224, 172, 87, 88, 89, 138, 200, 90,
- 246, 254, 270, 241, 283, 300, 282, 64, 319, 320,
- 67, 55, 55, 55, 55, 55, 55, 258, 285, 248,
- 0, 60, 0, 0, 0, 252, 0, 0, 0, 0,
- 0, 0, 0, 257, 249, 0, 176, 187, 0, 55,
- 119, 0, 0, 0, 0, 55, 0, 0, 0, 41,
- 41, 260, 261, 262, 263, 0, 55, 0, 0, 278,
- 55, 0, 279, 0, 0, 281, 0, 41, 284, 176,
- 55, 55, 0, 55, 55, 55, 55, 55, 55, 47,
- 47, 0, 0, 0, 0, 0, 0, 288, 0, 0,
- 0, 0, 0, 217, 0, 58, 139, 0, 55, 0,
- 0, 0, 0, 0, 0, 47, 55, 302, 294, 304,
- 296, 55, 305, 306, 0, 308, 176, 0, 0, 0,
- 0, 0, 0, 0, 314, 315, 0, 55, 0, 0,
- 172, 55, 0, 0, 172, 0, 0, 55, 55, 0,
- 41, 41, 55, 0, 41, 0, 41, 0, 0, 0,
- 194, 0, 41, 0, 0, 0, 187, 187, 187, 187,
- 0, 187, 187, 187, 0, 198, 199, 0, 54, 56,
- 0, 59, 0, 0, 0, 55, 0, 0, 0, 0,
- 0, 84, 0, 0, 0, 182, 55, 55, 55, 55,
- 0, 55, 0, 55, 55, 55, 0, 55, 55, 55,
- 187, 0, 59, 41, 0, 0, 291, 0, 293, 0,
- 41, 0, 187, 55, 84, 0, 0, 0, 0, 0,
- 55, 0, 55, 7, 0, 55, 8, 9, 232, 307,
- 0,-32768, 310, 0, 0, 155, 156, 157, 158, 159,
- 160, 316, 317, 44, 0, 250, 0, 0, 0, 253,
- 0, 0, 41, 0, 223, 14, 15, 259, 0, 0,
- 72, 186, 0, 84, 0, 0, 18, 19, 41, 84,
- 0, 52, 0, 0, 22, 53, 0, 275, 0, 0,
- 197, 0, 0, 0, 84, 116, 0, 0, 0, 0,
- 0, 0, 0, 0, 84, 84, 0, 84, 84, 84,
- 84, 84, 84, 0, 182, 182, 182, 182, 0, 182,
- 182, 182, 0, 0, 0, 0, 295, 0, 0, 41,
- 116, 0, 84, 0, 41, 0, 0, 301, 0, 0,
- 59, 0, 0, 168, 169, 238, 0, 170, 0, 173,
- 0, 0, 312, 0, 313, 188, 0, 0, 182, 0,
- 0, 84, 0, 0, 0, 84, 0, 0, 0, 116,
- 182, 84, 84, 0, 116, 192, 84, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 186, 186, 186, 186, 0, 186, 186, 186, 0, 0,
- 0, 0, 116, 192, 0, 0, 215, 0, 0, 84,
- 0, 0, 0, 220, 0, 0, 0, 0, 0, 0,
- 84, 84, 84, 84, 0, 238, 116, 238, 238, 238,
- 0, 238, 238, 238, 186, 0, 0, 192, 0, 0,
- 0, 0, 0, 0, 0, 0, 186, 238, 0, 116,
- 0, 0, 0, 0, 84, 251, 84, 0, 0, 238,
- 0, 0, 0, 0, 0, 0, 192, 0, 0, 0,
- 94, 264, 6, 7, 0, 0, 8, 9, 0, 256,
- 0, 0, 0, 0, 0, 0, 95, 0, 96, 97,
- 98, 99, 100, 101, 102, 103, 104, 105, 106, 0,
- 13, 107, 0, 0, 0, 14, 15, 16, 17, 0,
- 0, 0, 0, 0, 0, 0, 18, 19, 0, 20,
- 0, 21, 292, 0, 22, 23, 0, 298, 0, 24,
- 108, 38, 0, 0, 0, 0, 0, 0, 0, 116,
- 0, 116, 0, 0, 297, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 303, 0, 0, 0,
- 0, 175, 116, 6, 7, 116, 0, 8, 9, 0,
- 0, 0, 0, 0, 116, 116, 0, 95, 0, 96,
- 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
- 0, 13, 107, 0, 0, 0, 14, 15, 16, 17,
- 0, 0, 0, 0, 0, 0, 0, 18, 19, 0,
- 20, 0, 21, 0, 0, 22, 23, 0, 0, 0,
- 24, 108, 38, 178, 0, 6, 7, 0, 0, 8,
- 9, 0, -83, 0, 0, -83, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 179, 0, 0, 0, 0, 14, 15,
- 16, 17, 0, 0, 0, 0, -83, -83, -83, 18,
- 19, 0, 20, 0, 180, 0, 0, 22, 181, -6,
- 5, 0, 6, 7, -83, 0, 8, 9, 0, 0,
- 0, 0, -6, 0, 10, 11, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,
- 13, 0, 0, 0, 0, 14, 15, 16, 17, 0,
- 0, 0, 0, 0, 0, 0, 18, 19, 0, 20,
- 0, 21, 0, 0, 22, 23, 0, -65, 66, 24,
+#define YYLAST 1870
+
+
+static const short yytable[] = { 65,
+ 68, 63, 219, 42, 42, 58, 144, 208, 232, 1,
+ 41, 41, 143, 137, 137, 121, 1, 123, 7, 137,
+ 231, 42, 210, 211, 1, 256, 307, 91, 41, -87,
+ 309, 44, -87, 177, 87, 88, 89, 137, 4, 90,
+ 37, 222, 36, 243, 50, 178, 244, 276, 72, 223,
+ 37, 191, 92, 93, 138, 138, 24, 190, 38, 289,
+ 138, 138, 290, -87, -87, -87, 51, 177, 277, 22,
+ 248, 196, 280, 38, 167, 139, -87, 131, 138, 207,
+ 140, -87, 226, 175, 125, 126, 92, 93, 138, 133,
+ 134, 217, 194, -95, 42, 42, 184, 71, 42, -77,
+ 42, 41, 41, -78, 42, 41, 90, 41, 122, 193,
+ 136, 41, 124, 203, 177, 24, 227, 228, 229, 127,
+ 128, 169, 170, 147, 154, 171, 241, 174, 240, 155,
+ 163, 179, 165, 35, 166, 195, 219, 193, 168, 38,
+ 219, 265, 267, 268, 269, 139, 271, 272, 273, 201,
+ 199, 200, 197, 92, 93, 35, 204, 70, 35, 215,
+ 247, 225, 255, 270, 282, 42, 224, 242, 283, 35,
+ 298, 193, 41, 35, 317, 318, 67, 259, 285, 214,
+ 47, 48, 49, 249, 287, 55, 55, 60, 55, 61,
+ 0, 0, 221, 253, 0, 0, 297, 258, 55, 0,
+ 193, 0, 0, 291, 0, 292, 0, 42, 0, 0,
+ 0, 0, 0, 257, 41, 184, 184, 184, 184, 55,
+ 184, 184, 184, 278, 305, 0, 279, 308, 0, 281,
+ 251, 55, 284, 254, 252, 0, 314, 315, 0, 0,
+ 0, 0, 260, 0, 85, 86, 87, 88, 89, 0,
+ 288, 90, 55, 55, 55, 55, 55, 55, 184, 0,
+ 0, 0, 275, 0, 0, 0, 0, 0, 0, 300,
+ 184, 302, 0, 303, 304, 0, 306, 296, 0, 189,
+ 0, 55, 0, 0, 0, 312, 313, 55, 301, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 55, 0,
+ 294, 0, 55, 0, 0, 0, 0, 0, 0, 0,
+ 299, 31, 55, 55, 0, 55, 55, 55, 55, 55,
+ 55, 47, 47, 0, 310, 0, 311, 0, 0, 0,
+ 0, 64, 0, 31, 0, 0, 0, 0, 0, 0,
+ 55, 0, 0, 0, 120, 120, 0, 0, 47, 55,
+ 0, 0, 0, 0, 55, 0, 0, 0, 120, 120,
+ 0, 135, 0, 0, 0, 0, 0, 0, 0, 55,
+ 0, 0, 0, 55, 0, 0, 0, 0, 0, 55,
+ 55, 145, 146, 55, 148, 149, 150, 151, 152, 153,
+ 0, 0, 0, 0, 0, 0, 0, 0, 189, 189,
+ 189, 189, 0, 189, 189, 189, 0, 0, 0, 0,
+ 0, 0, 54, 56, 173, 59, 0, 55, 0, 0,
+ 0, 0, 0, 0, 0, 84, 0, 0, 55, 55,
+ 55, 55, 55, 0, 55, 55, 55, 0, 55, 55,
+ 55, 189, 0, 0, 0, 202, 59, 0, 0, 206,
+ 0, 0, 0, 189, 55, 0, 0, 0, 84, 0,
+ 55, 0, 55, 0, 55, 0, 0, 0, 0, 0,
+ 212, 213, 173, 0, 216, 0, 0, 0, 0, 156,
+ 157, 158, 159, 160, 161, 0, 0, 0, 0, 0,
+ 0, 64, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 188, 0, 84, 0,
+ 0, 0, 0, 0, 84, 0, 0, 250, 0, 0,
+ 0, 0, 0, 120, 0, 198, 6, 7, 0, 84,
+ 8, 9, 0, 0, 261, 262, 263, 264, 0, 84,
+ 84, 0, 84, 84, 84, 84, 84, 84, 0, 0,
+ 0, 0, 0, 0, 13, 0, 0, 0, 0, 14,
+ 15, 16, 17, 0, 0, 0, 0, 84, 0, 0,
+ 18, 19, 0, 20, 0, 21, 59, 0, 22, 23,
+ 0, 239, 0, 0, 0, 38, 0, 0, 0, 0,
+ 293, 0, 295, 0, 0, 0, 84, 0, 0, 0,
+ 84, 0, 0, 0, 0, 0, 84, 84, 0, 0,
+ 84, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 188, 188, 188, 188, 0,
+ 188, 188, 188, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 84, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 84, 84, 84, 84, 239,
+ 0, 239, 239, 239, 0, 239, 239, 239, 188, 0,
+ 0, 0, 0, 0, 0, 0, 94, 0, 6, 7,
+ 188, 239, 8, 9, 0, 0, 0, 84, 0, 84,
+ 0, 239, 95, 0, 96, 97, 98, 99, 100, 101,
+ 102, 103, 104, 105, 106, 0, 13, 107, 0, 0,
+ 0, 14, 15, 16, 17, 0, 0, 0, 0, 0,
+ 0, 0, 18, 19, 0, 20, 176, 21, 6, 7,
+ 22, 23, 8, 9, 0, 24, 108, 38, 0, 0,
+ 0, 0, 95, 0, 96, 97, 98, 99, 100, 101,
+ 102, 103, 104, 105, 106, 0, 13, 107, 0, 0,
+ 0, 14, 15, 16, 17, 0, 0, 0, 0, 0,
+ 0, 0, 18, 19, 0, 20, 0, 21, 0, 0,
+ 22, 23, 0, 0, 0, 24, 108, 38, 180, 0,
+ 6, 7, 0, 0, 8, 9, 0, -86, 0, 0,
+ -86, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 181, 0,
+ 0, 0, 0, 14, 15, 16, 17, 0, 0, 0,
+ 0, -86, -86, -86, 18, 19, 0, 20, 0, 182,
+ 0, 0, 22, 183, -86, 0, 0, -6, 5, -86,
6, 7, 0, 0, 8, 9, 0, 0, 0, 0,
- 1, 0, 10, 11, 0, 0, 0, 0, 0, 0,
+ -6, 0, 10, 11, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 12, 13, 0,
0, 0, 0, 14, 15, 16, 17, 0, 0, 0,
0, 0, 0, 0, 18, 19, 0, 20, 0, 21,
- 6, 7, 22, 23, 8, 9, 0, 24, 0, 0,
- 0, 0, 0, 0, 95, 0, 96, 97, 98, 99,
- 100, 101, 102, 103, 104, 105, 106, 0, 13, 107,
- 0, 0, 0, 14, 15, 16, 17, 0, 0, 0,
- 0, 0, 0, 0, 18, 19, 0, 20, 0, 21,
- 0, 0, 22, 23, 0, 0, 0, 24, 0, 38,
- 6, 7, 0, 0, 8, 9, 73, 0, 0, 74,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 75, 76, 77, 14, 15, 16, 17, 78, 0, 0,
- 80, 81, 82, 83, 18, 19, 0, 0, 0, 52,
- 0, 0, 22, 53, 0, 0, 6, 7, 0, 38,
- 8, 9, 73, 0, 0, 74, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 6, 7,
- 0, 0, 8, 9, 0, 0, 75, 76, 77, 14,
- 15, 16, 17, 78, 0, 0, 80, 81, 82, 83,
- 18, 19, 0, 0, 0, 52, 13, 0, 22, 53,
- 0, 14, 15, 16, 17, 38, 0, 0, 0, 0,
- 0, 0, 18, 19, 0, 20, 62, 21, 6, 7,
- 22, 23, 8, 9, 0, 0, 0, 38, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 62, 0,
- 6, 7, 0, 0, 8, 9, 13, 0, 0, 0,
+ 0, 0, 22, 23, 0, -68, 66, 24, 6, 7,
+ 0, 0, 8, 9, 0, 0, 0, 0, 1, 0,
+ 10, 11, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 12, 13, 0, 0, 0,
0, 14, 15, 16, 17, 0, 0, 0, 0, 0,
- 0, 0, 18, 19, 0, 20, 0, 21, 13, 0,
- 22, 23, -91, 14, 15, 16, 17, 0, 0, 0,
- 0, 0, 0, 0, 18, 19, 0, 20, 204, 21,
- 6, 7, 22, 23, 8, 9, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 266, 0, 6, 7, 0, 0, 8, 9, 13, 0,
- 0, 0, 0, 14, 15, 16, 17, 0, 0, 0,
- 0, 0, 0, 0, 18, 19, 0, 20, 0, 21,
- 179, 0, 22, 23, 0, 14, 15, 16, 17, 6,
- 7, 0, 0, 8, 9, 73, 18, 19, 74, 20,
- 0, 180, 0, 7, 22, 53, 8, 9,-32768, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 75,
- 76, 77, 14, 15, 16, 17, 78, 0, 0, 80,
- 81, 82, 83, 18, 19, 14, 15, 0, 52, 0,
- 0, 22, 53, 138, 6, 7, 18, 19, 8, 9,
- 73, 52, 0, 74, 22, 53, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 75, 76, 77, 14, 15, 16,
- 17, 78, 0, 79, 80, 81, 82, 83, 18, 19,
- 0, 0, 0, 52, 6, 7, 22, 53, 8, 9,
- 73, 0, 0, 74, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 75, 76, 77, 14, 15, 16,
- 17, 78, 208, 0, 80, 81, 82, 83, 18, 19,
- 0, 0, 0, 52, 6, 7, 22, 53, 8, 9,
- 73, 0, 0, 74, 0, 0, 0, 0, 0, 0,
+ 0, 0, 18, 19, 0, 20, 0, 21, 6, 7,
+ 22, 23, 8, 9, 0, 24, 0, 0, 0, 0,
+ 0, 0, 95, 0, 96, 97, 98, 99, 100, 101,
+ 102, 103, 104, 105, 106, 0, 13, 107, 0, 0,
+ 0, 14, 15, 16, 17, 6, 7, 0, 0, 8,
+ 9, 73, 18, 19, 74, 20, 0, 21, 0, 7,
+ 22, 23, 8, 9,-32768, 24, 0, 38, 0, 0,
+ 0, 0, 0, 0, 0, 75, 76, 77, 14, 15,
+ 16, 17, 78, 0, 0, 80, 81, 82, 83, 18,
+ 19, 14, 15, 62, 52, 6, 7, 22, 53, 8,
+ 9, 0, 18, 19, 38, 0, 0, 52, 0, 0,
+ 22, 53, 0, 0, 0, 62, 0, 6, 7, 0,
+ 0, 8, 9, 13, 0, 0, 0, 0, 14, 15,
+ 16, 17, 0, 0, 0, 0, 0, 0, 0, 18,
+ 19, 0, 20, 0, 21, 13, 0, 22, 23, -94,
+ 14, 15, 16, 17, 0, 0, 0, 0, 0, 0,
+ 0, 18, 19, 0, 20, 205, 21, 6, 7, 22,
+ 23, 8, 9, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 266, 0, 6,
+ 7, 0, 0, 8, 9, 13, 0, 0, 0, 0,
+ 14, 15, 16, 17, 0, 0, 0, 0, 0, 0,
+ 0, 18, 19, 0, 20, 0, 21, 181, 0, 22,
+ 23, 0, 14, 15, 16, 17, 6, 7, 0, 0,
+ 8, 9, 73, 18, 19, 74, 20, 0, 182, 0,
+ 7, 22, 53, 8, 9, 233, 0, 0,-32768, 0,
+ 0, 0, 0, 0, 0, 0, 75, 76, 77, 14,
+ 15, 16, 17, 78, 0, 0, 80, 81, 82, 83,
+ 18, 19, 14, 15, 0, 52, 0, 0, 22, 53,
+ 139, 6, 7, 18, 19, 8, 9, 73, 52, 0,
+ 74, 22, 53, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 75, 76, 77, 14, 15, 16,
- 17, 78, 0, 0, 80, 81, 82, 83, 18, 19,
- 0, 0, 0, 52, 6, 7, 22, 53, 8, 9,
- 73, 0, 0, 74, 0, 0, 0, 0, 0, 0,
+ 0, 75, 76, 77, 14, 15, 16, 17, 78, 0,
+ 79, 80, 81, 82, 83, 18, 19, 0, 0, 0,
+ 52, 6, 7, 22, 53, 8, 9, 73, 0, 0,
+ 74, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 75, 76, 0, 14, 15, 16,
- 17, 0, 0, 0, 80, 81, 82, 83, 18, 19,
- 0, 0, 0, 52, 6, 7, 22, 53, 8, 9,
- 73, 0, 0, 74, 0, 0, 0, 0, 0, 0,
+ 0, 75, 76, 77, 14, 15, 16, 17, 78, 209,
+ 0, 80, 81, 82, 83, 18, 19, 0, 0, 0,
+ 52, 6, 7, 22, 53, 8, 9, 73, 0, 0,
+ 74, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 75, 0, 0, 14, 15, 16,
- 17, 0, 0, 0, 80, 81, 82, 83, 18, 19,
- 0, 0, 0, 52, 6, 7, 22, 53, 8, 9,
- 232, 0, 0, 233, 0, 0, 0, 0, 0, 0,
+ 0, 75, 76, 77, 14, 15, 16, 17, 78, 0,
+ 0, 80, 81, 82, 83, 18, 19, 0, 0, 0,
+ 52, 6, 7, 22, 53, 8, 9, 73, 0, 0,
+ 74, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 234, 235, 236, 14, 15, 16,
- 17, 237, 286, 0, 0, 0, 6, 7, 18, 19,
- 8, 9, 232, 52, 0, 233, 22, 53, 0, 0,
+ 0, 75, 76, 0, 14, 15, 16, 17, 0, 0,
+ 0, 80, 81, 82, 83, 18, 19, 0, 0, 0,
+ 52, 6, 7, 22, 53, 8, 9, 73, 0, 0,
+ 74, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 234, 235, 236, 14,
- 15, 16, 17, 237, 0, 0, 0, 0, 6, 7,
- 18, 19, 8, 9, 232, 52, 0, 233, 22, 53,
+ 0, 75, 0, 0, 14, 15, 16, 17, 0, 0,
+ 0, 80, 81, 82, 83, 18, 19, 0, 0, 0,
+ 52, 6, 7, 22, 53, 8, 9, 233, 0, 0,
+ 234, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 234, 235,
- 0, 14, 15, 16, 17, 6, 7, 0, 0, 8,
- 9, 232, 18, 19, 233, 0, 0, 52, 0, 0,
- 22, 53, 0, 0, 0, 0, 0, 6, 7, 0,
- 0, 8, 9, 0, 0, 234, 0, 0, 14, 15,
- 16, 17, 0, 0, 0, 0, 0, 0, 0, 18,
- 19, 0, 0, 0, 52, 13, 0, 22, 53, 0,
- 14, 15, 16, 17, 6, 218, 0, 0, 8, 9,
- 0, 18, 19, 0, 20, 0, 21, 0, 0, 22,
- 23, 0, 0, 0, 0, 0, 6, 7, 0, 0,
- 8, 9, 13, 0, 0, 0, 0, 14, 15, 16,
- 17, 0, 0, 0, 0, 0, 0, 0, 18, 19,
- 0, 20, 0, 21, 179, 0, 22, 23, 0, 14,
+ 0, 235, 236, 237, 14, 15, 16, 17, 238, 286,
+ 0, 0, 0, 6, 7, 18, 19, 8, 9, 233,
+ 52, 0, 234, 22, 53, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 6, 218, 0, 0,
+ 8, 9, 0, 235, 236, 237, 14, 15, 16, 17,
+ 238, 0, 0, 97, 0, 0, 0, 18, 19, 103,
+ 104, 0, 52, 0, 13, 22, 53, 0, 0, 14,
15, 16, 17, 6, 7, 0, 0, 8, 9, 0,
- 18, 19, 0, 20, 0, 180, 0, 0, 22, 53,
- 0, 0, 0, 0, 6, 7, 0, 0, 8, 9,
- 0, 0, 0, 0, 0, 0, 14, 15, 16, 17,
- 0, 0, 0, 0, 0, 0, 0, 18, 19, 0,
- 20, 0, 52, 0, 0, 22, 53, 14, 15, 16,
- 17, 0, 7, 0, 0, 8, 9, 73, 18, 19,
--32768, 0, 0, 52, 0, 0, 22, 53, 0, 7,
- 0, 0, 8, 9,-32768, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 14, 15, 0, 0, 0, 0,
+ 18, 19, 0, 20, 0, 21, 0, 0, 22, 23,
+ 97, 0, 0, 0, 0, 0, 103, 104, 0, 0,
+ 0, 13, 0, 0, 0, 0, 14, 15, 16, 17,
+ 6, 7, 0, 0, 8, 9, 233, 18, 19, 234,
+ 20, 0, 21, 0, 0, 22, 23, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 235, 236, 0, 14, 15, 16, 17, 6, 7, 0,
+ 0, 8, 9, 233, 18, 19, 234, 0, 0, 52,
+ 0, 0, 22, 53, 0, 0, 0, 0, 0, 6,
+ 7, 0, 0, 8, 9, 0, 0, 235, 0, 0,
+ 14, 15, 16, 17, 0, 0, 0, 0, 0, 0,
+ 0, 18, 19, 0, 0, 0, 52, 13, 0, 22,
+ 53, 0, 14, 15, 16, 17, 6, 7, 0, 0,
+ 8, 9, 0, 18, 19, 0, 20, 0, 21, 0,
+ 0, 22, 23, 0, 0, 0, 0, 6, 7, 0,
+ 0, 8, 9, 0, 181, 0, 0, 0, 0, 14,
+ 15, 16, 17, 0, 0, 0, 0, 0, 0, 0,
+ 18, 19, 0, 20, 0, 182, 0, 0, 22, 53,
+ 14, 15, 16, 17, 6, 7, 0, 0, 8, 9,
+ 0, 18, 19, 0, 20, 0, 52, 0, 0, 22,
+ 53, 0, 7, 0, 0, 8, 9, 73, 0, 0,
+-32768, 0, 0, 0, 0, 0, 0, 14, 15, 16,
+ 17, 0, 0, 0, 0, 0, 0, 7, 18, 19,
+ 8, 9,-32768, 52, 14, 15, 22, 53, 0, 0,
0, 80, 81, 82, 83, 18, 19, 0, 0, 0,
- 52, 14, 15, 22, 53, 0, 0, 0,-32768,-32768,
--32768,-32768, 18, 19, 0, 0, 0, 52, 0, 0,
- 22, 53
+ 52, 0, 0, 22, 53, 0, 0, 0, 0, 14,
+ 15, 0, 0, 0, 0, 0,-32768,-32768,-32768,-32768,
+ 18, 19, 0, 0, 0, 52, 0, 0, 22, 53
};
-static const short yycheck[] = { 3,
- 143, 163, 4, 184, 23, 167, 24, 25, 13, 1,
- 1, 70, 4, 1, 13, 70, 13, 1, 37, 23,
- 1, 25, 56, 4, 42, 58, 10, 33, 56, 13,
- 153, 154, 36, 37, 177, 230, 231, 232, 233, 1,
- 235, 236, 237, 1, 1, 13, 50, 51, 13, 53,
- 109, 42, 58, 55, 42, 114, 179, 62, 42, 114,
- 44, 45, 46, 206, 245, 57, 36, 37, 59, 73,
- 74, 59, 76, 77, 78, 79, 80, 81, 62, 274,
- 42, 99, 11, 142, 42, 42, 3, 4, 60, 56,
- 108, 286, 60, 58, 62, 57, 43, 62, 116, 57,
- 57, 3, 106, 11, 10, 28, 54, 36, 37, 13,
- 14, 15, 50, 51, 18, 19, 39, 21, 22, 137,
- 43, 38, 39, 25, 5, 27, 28, 31, 36, 37,
- 189, 4, 136, 4, 31, 31, 140, 39, 44, 45,
- 46, 43, 304, 56, 56, 56, 308, 62, 52, 47,
- 48, 49, 50, 51, 33, 56, 54, 161, 162, 163,
- 64, 165, 181, 167, 49, 50, 51, 57, 50, 54,
- 4, 21, 4, 191, 4, 18, 56, 181, 0, 0,
- 25, 85, 86, 87, 88, 89, 90, 222, 259, 207,
- -1, 22, -1, -1, -1, 214, -1, -1, -1, -1,
- -1, -1, -1, 221, 208, -1, 109, 111, -1, 113,
- 214, -1, -1, -1, -1, 119, -1, -1, -1, 10,
- 11, 225, 226, 227, 228, -1, 130, -1, -1, 247,
- 134, -1, 250, -1, -1, 253, -1, 28, 256, 142,
- 144, 145, -1, 147, 148, 149, 150, 151, 152, 153,
- 154, -1, -1, -1, -1, -1, -1, 275, -1, -1,
- -1, -1, -1, 166, -1, 21, 63, -1, 172, -1,
- -1, -1, -1, -1, -1, 179, 180, 295, 282, 297,
- 284, 185, 300, 301, -1, 303, 189, -1, -1, -1,
- -1, -1, -1, -1, 312, 313, -1, 201, -1, -1,
- 304, 205, -1, -1, 308, -1, -1, 211, 212, -1,
- 101, 102, 216, -1, 105, -1, 107, -1, -1, -1,
- 117, -1, 113, -1, -1, -1, 230, 231, 232, 233,
- -1, 235, 236, 237, -1, 132, 133, -1, 18, 19,
- -1, 21, -1, -1, -1, 249, -1, -1, -1, -1,
- -1, 31, -1, -1, -1, 111, 260, 261, 262, 263,
- -1, 265, -1, 267, 268, 269, -1, 271, 272, 273,
- 274, -1, 52, 164, -1, -1, 279, -1, 281, -1,
- 171, -1, 286, 287, 64, -1, -1, -1, -1, -1,
- 294, -1, 296, 4, -1, 299, 7, 8, 9, 302,
- -1, 12, 305, -1, -1, 85, 86, 87, 88, 89,
- 90, 314, 315, 11, -1, 212, -1, -1, -1, 216,
- -1, -1, 213, -1, 180, 36, 37, 224, -1, -1,
- 28, 111, -1, 113, -1, -1, 47, 48, 229, 119,
- -1, 52, -1, -1, 55, 56, -1, 244, -1, -1,
- 130, -1, -1, -1, 134, 35, -1, -1, -1, -1,
- -1, -1, -1, -1, 144, 145, -1, 147, 148, 149,
- 150, 151, 152, -1, 230, 231, 232, 233, -1, 235,
- 236, 237, -1, -1, -1, -1, 283, -1, -1, 280,
- 70, -1, 172, -1, 285, -1, -1, 294, -1, -1,
- 180, -1, -1, 101, 102, 185, -1, 105, -1, 107,
- -1, -1, 309, -1, 311, 113, -1, -1, 274, -1,
- -1, 201, -1, -1, -1, 205, -1, -1, -1, 109,
- 286, 211, 212, -1, 114, 115, 216, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 230, 231, 232, 233, -1, 235, 236, 237, -1, -1,
- -1, -1, 142, 143, -1, -1, 164, -1, -1, 249,
- -1, -1, -1, 171, -1, -1, -1, -1, -1, -1,
- 260, 261, 262, 263, -1, 265, 166, 267, 268, 269,
- -1, 271, 272, 273, 274, -1, -1, 177, -1, -1,
- -1, -1, -1, -1, -1, -1, 286, 287, -1, 189,
- -1, -1, -1, -1, 294, 213, 296, -1, -1, 299,
- -1, -1, -1, -1, -1, -1, 206, -1, -1, -1,
- 1, 229, 3, 4, -1, -1, 7, 8, -1, 219,
- -1, -1, -1, -1, -1, -1, 17, -1, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28, 29, -1,
- 31, 32, -1, -1, -1, 36, 37, 38, 39, -1,
- -1, -1, -1, -1, -1, -1, 47, 48, -1, 50,
- -1, 52, 280, -1, 55, 56, -1, 285, -1, 60,
- 61, 62, -1, -1, -1, -1, -1, -1, -1, 279,
- -1, 281, -1, -1, 284, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 296, -1, -1, -1,
- -1, 1, 302, 3, 4, 305, -1, 7, 8, -1,
- -1, -1, -1, -1, 314, 315, -1, 17, -1, 19,
- 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- -1, 31, 32, -1, -1, -1, 36, 37, 38, 39,
- -1, -1, -1, -1, -1, -1, -1, 47, 48, -1,
- 50, -1, 52, -1, -1, 55, 56, -1, -1, -1,
- 60, 61, 62, 1, -1, 3, 4, -1, -1, 7,
- 8, -1, 10, -1, -1, 13, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 31, -1, -1, -1, -1, 36, 37,
- 38, 39, -1, -1, -1, -1, 44, 45, 46, 47,
- 48, -1, 50, -1, 52, -1, -1, 55, 56, 0,
- 1, -1, 3, 4, 62, -1, 7, 8, -1, -1,
- -1, -1, 13, -1, 15, 16, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 30,
- 31, -1, -1, -1, -1, 36, 37, 38, 39, -1,
- -1, -1, -1, -1, -1, -1, 47, 48, -1, 50,
- -1, 52, -1, -1, 55, 56, -1, 0, 1, 60,
+static const short yycheck[] = { 24,
+ 25, 23, 168, 10, 11, 21, 70, 144, 186, 13,
+ 10, 11, 70, 1, 1, 37, 13, 42, 4, 1,
+ 1, 28, 154, 155, 13, 33, 302, 11, 28, 10,
+ 306, 11, 13, 109, 49, 50, 51, 1, 13, 54,
+ 58, 178, 56, 1, 56, 109, 4, 1, 28, 181,
+ 58, 115, 36, 37, 42, 42, 60, 115, 62, 1,
+ 42, 42, 4, 44, 45, 46, 56, 143, 246, 55,
+ 207, 59, 59, 62, 99, 57, 57, 43, 42, 143,
+ 63, 62, 10, 108, 3, 4, 36, 37, 42, 50,
+ 51, 167, 117, 57, 101, 102, 112, 28, 105, 57,
+ 107, 101, 102, 57, 111, 105, 54, 107, 39, 116,
+ 5, 111, 43, 138, 190, 60, 44, 45, 46, 38,
+ 39, 101, 102, 4, 31, 105, 190, 107, 11, 31,
+ 56, 111, 4, 3, 56, 118, 302, 144, 56, 62,
+ 306, 231, 232, 233, 234, 57, 236, 237, 238, 50,
+ 133, 134, 56, 36, 37, 25, 33, 27, 28, 58,
+ 4, 183, 21, 4, 56, 172, 182, 192, 4, 39,
+ 18, 178, 172, 43, 0, 0, 25, 223, 260, 164,
+ 13, 14, 15, 208, 274, 18, 19, 22, 21, 22,
+ -1, -1, 172, 215, -1, -1, 286, 222, 31, -1,
+ 207, -1, -1, 279, -1, 281, -1, 214, -1, -1,
+ -1, -1, -1, 220, 214, 231, 232, 233, 234, 52,
+ 236, 237, 238, 248, 300, -1, 251, 303, -1, 254,
+ 213, 64, 257, 216, 214, -1, 312, 313, -1, -1,
+ -1, -1, 225, -1, 47, 48, 49, 50, 51, -1,
+ 275, 54, 85, 86, 87, 88, 89, 90, 274, -1,
+ -1, -1, 245, -1, -1, -1, -1, -1, -1, 294,
+ 286, 296, -1, 298, 299, -1, 301, 284, -1, 112,
+ -1, 114, -1, -1, -1, 310, 311, 120, 295, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 131, -1,
+ 283, -1, 135, -1, -1, -1, -1, -1, -1, -1,
+ 293, 3, 145, 146, -1, 148, 149, 150, 151, 152,
+ 153, 154, 155, -1, 307, -1, 309, -1, -1, -1,
+ -1, 23, -1, 25, -1, -1, -1, -1, -1, -1,
+ 173, -1, -1, -1, 36, 37, -1, -1, 181, 182,
+ -1, -1, -1, -1, 187, -1, -1, -1, 50, 51,
+ -1, 53, -1, -1, -1, -1, -1, -1, -1, 202,
+ -1, -1, -1, 206, -1, -1, -1, -1, -1, 212,
+ 213, 73, 74, 216, 76, 77, 78, 79, 80, 81,
+ -1, -1, -1, -1, -1, -1, -1, -1, 231, 232,
+ 233, 234, -1, 236, 237, 238, -1, -1, -1, -1,
+ -1, -1, 18, 19, 106, 21, -1, 250, -1, -1,
+ -1, -1, -1, -1, -1, 31, -1, -1, 261, 262,
+ 263, 264, 265, -1, 267, 268, 269, -1, 271, 272,
+ 273, 274, -1, -1, -1, 137, 52, -1, -1, 141,
+ -1, -1, -1, 286, 287, -1, -1, -1, 64, -1,
+ 293, -1, 295, -1, 297, -1, -1, -1, -1, -1,
+ 162, 163, 164, -1, 166, -1, -1, -1, -1, 85,
+ 86, 87, 88, 89, 90, -1, -1, -1, -1, -1,
+ -1, 183, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 112, -1, 114, -1,
+ -1, -1, -1, -1, 120, -1, -1, 209, -1, -1,
+ -1, -1, -1, 215, -1, 131, 3, 4, -1, 135,
+ 7, 8, -1, -1, 226, 227, 228, 229, -1, 145,
+ 146, -1, 148, 149, 150, 151, 152, 153, -1, -1,
+ -1, -1, -1, -1, 31, -1, -1, -1, -1, 36,
+ 37, 38, 39, -1, -1, -1, -1, 173, -1, -1,
+ 47, 48, -1, 50, -1, 52, 182, -1, 55, 56,
+ -1, 187, -1, -1, -1, 62, -1, -1, -1, -1,
+ 282, -1, 284, -1, -1, -1, 202, -1, -1, -1,
+ 206, -1, -1, -1, -1, -1, 212, 213, -1, -1,
+ 216, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 231, 232, 233, 234, -1,
+ 236, 237, 238, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 250, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 261, 262, 263, 264, 265,
+ -1, 267, 268, 269, -1, 271, 272, 273, 274, -1,
+ -1, -1, -1, -1, -1, -1, 1, -1, 3, 4,
+ 286, 287, 7, 8, -1, -1, -1, 293, -1, 295,
+ -1, 297, 17, -1, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, -1, 31, 32, -1, -1,
+ -1, 36, 37, 38, 39, -1, -1, -1, -1, -1,
+ -1, -1, 47, 48, -1, 50, 1, 52, 3, 4,
+ 55, 56, 7, 8, -1, 60, 61, 62, -1, -1,
+ -1, -1, 17, -1, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, -1, 31, 32, -1, -1,
+ -1, 36, 37, 38, 39, -1, -1, -1, -1, -1,
+ -1, -1, 47, 48, -1, 50, -1, 52, -1, -1,
+ 55, 56, -1, -1, -1, 60, 61, 62, 1, -1,
+ 3, 4, -1, -1, 7, 8, -1, 10, -1, -1,
+ 13, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 31, -1,
+ -1, -1, -1, 36, 37, 38, 39, -1, -1, -1,
+ -1, 44, 45, 46, 47, 48, -1, 50, -1, 52,
+ -1, -1, 55, 56, 57, -1, -1, 0, 1, 62,
3, 4, -1, -1, 7, 8, -1, -1, -1, -1,
13, -1, 15, 16, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 30, 31, -1,
-1, -1, -1, 36, 37, 38, 39, -1, -1, -1,
-1, -1, -1, -1, 47, 48, -1, 50, -1, 52,
- 3, 4, 55, 56, 7, 8, -1, 60, -1, -1,
- -1, -1, -1, -1, 17, -1, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, -1, 31, 32,
- -1, -1, -1, 36, 37, 38, 39, -1, -1, -1,
- -1, -1, -1, -1, 47, 48, -1, 50, -1, 52,
- -1, -1, 55, 56, -1, -1, -1, 60, -1, 62,
- 3, 4, -1, -1, 7, 8, 9, -1, -1, 12,
- 13, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 33, 34, 35, 36, 37, 38, 39, 40, -1, -1,
- 43, 44, 45, 46, 47, 48, -1, -1, -1, 52,
- -1, -1, 55, 56, -1, -1, 3, 4, -1, 62,
- 7, 8, 9, -1, -1, 12, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
- -1, -1, 7, 8, -1, -1, 33, 34, 35, 36,
- 37, 38, 39, 40, -1, -1, 43, 44, 45, 46,
- 47, 48, -1, -1, -1, 52, 31, -1, 55, 56,
- -1, 36, 37, 38, 39, 62, -1, -1, -1, -1,
- -1, -1, 47, 48, -1, 50, 1, 52, 3, 4,
- 55, 56, 7, 8, -1, -1, -1, 62, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 1, -1,
- 3, 4, -1, -1, 7, 8, 31, -1, -1, -1,
+ -1, -1, 55, 56, -1, 0, 1, 60, 3, 4,
+ -1, -1, 7, 8, -1, -1, -1, -1, 13, -1,
+ 15, 16, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 30, 31, -1, -1, -1,
-1, 36, 37, 38, 39, -1, -1, -1, -1, -1,
- -1, -1, 47, 48, -1, 50, -1, 52, 31, -1,
- 55, 56, 57, 36, 37, 38, 39, -1, -1, -1,
- -1, -1, -1, -1, 47, 48, -1, 50, 1, 52,
- 3, 4, 55, 56, 7, 8, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 1, -1, 3, 4, -1, -1, 7, 8, 31, -1,
- -1, -1, -1, 36, 37, 38, 39, -1, -1, -1,
- -1, -1, -1, -1, 47, 48, -1, 50, -1, 52,
- 31, -1, 55, 56, -1, 36, 37, 38, 39, 3,
- 4, -1, -1, 7, 8, 9, 47, 48, 12, 50,
- -1, 52, -1, 4, 55, 56, 7, 8, 9, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 33,
- 34, 35, 36, 37, 38, 39, 40, -1, -1, 43,
- 44, 45, 46, 47, 48, 36, 37, -1, 52, -1,
- -1, 55, 56, 57, 3, 4, 47, 48, 7, 8,
- 9, 52, -1, 12, 55, 56, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 33, 34, 35, 36, 37, 38,
- 39, 40, -1, 42, 43, 44, 45, 46, 47, 48,
- -1, -1, -1, 52, 3, 4, 55, 56, 7, 8,
- 9, -1, -1, 12, -1, -1, -1, -1, -1, -1,
+ -1, -1, 47, 48, -1, 50, -1, 52, 3, 4,
+ 55, 56, 7, 8, -1, 60, -1, -1, -1, -1,
+ -1, -1, 17, -1, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, -1, 31, 32, -1, -1,
+ -1, 36, 37, 38, 39, 3, 4, -1, -1, 7,
+ 8, 9, 47, 48, 12, 50, -1, 52, -1, 4,
+ 55, 56, 7, 8, 9, 60, -1, 62, -1, -1,
+ -1, -1, -1, -1, -1, 33, 34, 35, 36, 37,
+ 38, 39, 40, -1, -1, 43, 44, 45, 46, 47,
+ 48, 36, 37, 1, 52, 3, 4, 55, 56, 7,
+ 8, -1, 47, 48, 62, -1, -1, 52, -1, -1,
+ 55, 56, -1, -1, -1, 1, -1, 3, 4, -1,
+ -1, 7, 8, 31, -1, -1, -1, -1, 36, 37,
+ 38, 39, -1, -1, -1, -1, -1, -1, -1, 47,
+ 48, -1, 50, -1, 52, 31, -1, 55, 56, 57,
+ 36, 37, 38, 39, -1, -1, -1, -1, -1, -1,
+ -1, 47, 48, -1, 50, 1, 52, 3, 4, 55,
+ 56, 7, 8, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 1, -1, 3,
+ 4, -1, -1, 7, 8, 31, -1, -1, -1, -1,
+ 36, 37, 38, 39, -1, -1, -1, -1, -1, -1,
+ -1, 47, 48, -1, 50, -1, 52, 31, -1, 55,
+ 56, -1, 36, 37, 38, 39, 3, 4, -1, -1,
+ 7, 8, 9, 47, 48, 12, 50, -1, 52, -1,
+ 4, 55, 56, 7, 8, 9, -1, -1, 12, -1,
+ -1, -1, -1, -1, -1, -1, 33, 34, 35, 36,
+ 37, 38, 39, 40, -1, -1, 43, 44, 45, 46,
+ 47, 48, 36, 37, -1, 52, -1, -1, 55, 56,
+ 57, 3, 4, 47, 48, 7, 8, 9, 52, -1,
+ 12, 55, 56, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 33, 34, 35, 36, 37, 38,
- 39, 40, 41, -1, 43, 44, 45, 46, 47, 48,
- -1, -1, -1, 52, 3, 4, 55, 56, 7, 8,
- 9, -1, -1, 12, -1, -1, -1, -1, -1, -1,
+ -1, 33, 34, 35, 36, 37, 38, 39, 40, -1,
+ 42, 43, 44, 45, 46, 47, 48, -1, -1, -1,
+ 52, 3, 4, 55, 56, 7, 8, 9, -1, -1,
+ 12, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 33, 34, 35, 36, 37, 38,
- 39, 40, -1, -1, 43, 44, 45, 46, 47, 48,
- -1, -1, -1, 52, 3, 4, 55, 56, 7, 8,
- 9, -1, -1, 12, -1, -1, -1, -1, -1, -1,
+ -1, 33, 34, 35, 36, 37, 38, 39, 40, 41,
+ -1, 43, 44, 45, 46, 47, 48, -1, -1, -1,
+ 52, 3, 4, 55, 56, 7, 8, 9, -1, -1,
+ 12, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 33, 34, -1, 36, 37, 38,
- 39, -1, -1, -1, 43, 44, 45, 46, 47, 48,
- -1, -1, -1, 52, 3, 4, 55, 56, 7, 8,
- 9, -1, -1, 12, -1, -1, -1, -1, -1, -1,
+ -1, 33, 34, 35, 36, 37, 38, 39, 40, -1,
+ -1, 43, 44, 45, 46, 47, 48, -1, -1, -1,
+ 52, 3, 4, 55, 56, 7, 8, 9, -1, -1,
+ 12, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 33, -1, -1, 36, 37, 38,
- 39, -1, -1, -1, 43, 44, 45, 46, 47, 48,
- -1, -1, -1, 52, 3, 4, 55, 56, 7, 8,
- 9, -1, -1, 12, -1, -1, -1, -1, -1, -1,
+ -1, 33, 34, -1, 36, 37, 38, 39, -1, -1,
+ -1, 43, 44, 45, 46, 47, 48, -1, -1, -1,
+ 52, 3, 4, 55, 56, 7, 8, 9, -1, -1,
+ 12, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 33, 34, 35, 36, 37, 38,
- 39, 40, 41, -1, -1, -1, 3, 4, 47, 48,
- 7, 8, 9, 52, -1, 12, 55, 56, -1, -1,
+ -1, 33, -1, -1, 36, 37, 38, 39, -1, -1,
+ -1, 43, 44, 45, 46, 47, 48, -1, -1, -1,
+ 52, 3, 4, 55, 56, 7, 8, 9, -1, -1,
+ 12, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 33, 34, 35, 36,
- 37, 38, 39, 40, -1, -1, -1, -1, 3, 4,
- 47, 48, 7, 8, 9, 52, -1, 12, 55, 56,
+ -1, 33, 34, 35, 36, 37, 38, 39, 40, 41,
+ -1, -1, -1, 3, 4, 47, 48, 7, 8, 9,
+ 52, -1, 12, 55, 56, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 3, 4, -1, -1,
+ 7, 8, -1, 33, 34, 35, 36, 37, 38, 39,
+ 40, -1, -1, 20, -1, -1, -1, 47, 48, 26,
+ 27, -1, 52, -1, 31, 55, 56, -1, -1, 36,
+ 37, 38, 39, 3, 4, -1, -1, 7, 8, -1,
+ 47, 48, -1, 50, -1, 52, -1, -1, 55, 56,
+ 20, -1, -1, -1, -1, -1, 26, 27, -1, -1,
+ -1, 31, -1, -1, -1, -1, 36, 37, 38, 39,
+ 3, 4, -1, -1, 7, 8, 9, 47, 48, 12,
+ 50, -1, 52, -1, -1, 55, 56, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 33, 34,
- -1, 36, 37, 38, 39, 3, 4, -1, -1, 7,
- 8, 9, 47, 48, 12, -1, -1, 52, -1, -1,
- 55, 56, -1, -1, -1, -1, -1, 3, 4, -1,
- -1, 7, 8, -1, -1, 33, -1, -1, 36, 37,
- 38, 39, -1, -1, -1, -1, -1, -1, -1, 47,
- 48, -1, -1, -1, 52, 31, -1, 55, 56, -1,
+ 33, 34, -1, 36, 37, 38, 39, 3, 4, -1,
+ -1, 7, 8, 9, 47, 48, 12, -1, -1, 52,
+ -1, -1, 55, 56, -1, -1, -1, -1, -1, 3,
+ 4, -1, -1, 7, 8, -1, -1, 33, -1, -1,
+ 36, 37, 38, 39, -1, -1, -1, -1, -1, -1,
+ -1, 47, 48, -1, -1, -1, 52, 31, -1, 55,
+ 56, -1, 36, 37, 38, 39, 3, 4, -1, -1,
+ 7, 8, -1, 47, 48, -1, 50, -1, 52, -1,
+ -1, 55, 56, -1, -1, -1, -1, 3, 4, -1,
+ -1, 7, 8, -1, 31, -1, -1, -1, -1, 36,
+ 37, 38, 39, -1, -1, -1, -1, -1, -1, -1,
+ 47, 48, -1, 50, -1, 52, -1, -1, 55, 56,
36, 37, 38, 39, 3, 4, -1, -1, 7, 8,
-1, 47, 48, -1, 50, -1, 52, -1, -1, 55,
- 56, -1, -1, -1, -1, -1, 3, 4, -1, -1,
- 7, 8, 31, -1, -1, -1, -1, 36, 37, 38,
- 39, -1, -1, -1, -1, -1, -1, -1, 47, 48,
- -1, 50, -1, 52, 31, -1, 55, 56, -1, 36,
- 37, 38, 39, 3, 4, -1, -1, 7, 8, -1,
- 47, 48, -1, 50, -1, 52, -1, -1, 55, 56,
- -1, -1, -1, -1, 3, 4, -1, -1, 7, 8,
- -1, -1, -1, -1, -1, -1, 36, 37, 38, 39,
- -1, -1, -1, -1, -1, -1, -1, 47, 48, -1,
- 50, -1, 52, -1, -1, 55, 56, 36, 37, 38,
- 39, -1, 4, -1, -1, 7, 8, 9, 47, 48,
- 12, -1, -1, 52, -1, -1, 55, 56, -1, 4,
- -1, -1, 7, 8, 9, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 36, 37, -1, -1, -1, -1,
+ 56, -1, 4, -1, -1, 7, 8, 9, -1, -1,
+ 12, -1, -1, -1, -1, -1, -1, 36, 37, 38,
+ 39, -1, -1, -1, -1, -1, -1, 4, 47, 48,
+ 7, 8, 9, 52, 36, 37, 55, 56, -1, -1,
-1, 43, 44, 45, 46, 47, 48, -1, -1, -1,
- 52, 36, 37, 55, 56, -1, -1, -1, 43, 44,
- 45, 46, 47, 48, -1, -1, -1, 52, -1, -1,
- 55, 56
+ 52, -1, -1, 55, 56, -1, -1, -1, -1, 36,
+ 37, -1, -1, -1, -1, -1, 43, 44, 45, 46,
+ 47, 48, -1, -1, -1, 52, -1, -1, 55, 56
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/lib/bison.simple"
@@ -1366,14 +1352,14 @@ yyreduce:
switch (yyn) {
case 1:
-#line 158 "awkgram.y"
+#line 160 "awkgram.y"
{
expression_value = yyvsp[-1].nodeval;
check_funcs();
;
break;}
case 2:
-#line 166 "awkgram.y"
+#line 168 "awkgram.y"
{
if (yyvsp[0].nodeval != NULL)
yyval.nodeval = yyvsp[0].nodeval;
@@ -1383,7 +1369,7 @@ case 2:
;
break;}
case 3:
-#line 175 "awkgram.y"
+#line 177 "awkgram.y"
{
if (yyvsp[0].nodeval == NULL)
yyval.nodeval = yyvsp[-1].nodeval;
@@ -1400,23 +1386,23 @@ case 3:
;
break;}
case 4:
-#line 189 "awkgram.y"
+#line 191 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
case 5:
-#line 190 "awkgram.y"
+#line 192 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
case 6:
-#line 191 "awkgram.y"
+#line 193 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
case 7:
-#line 195 "awkgram.y"
+#line 197 "awkgram.y"
{ io_allowed = FALSE; ;
break;}
case 8:
-#line 197 "awkgram.y"
+#line 199 "awkgram.y"
{
if (begin_block != NULL) {
if (begin_block->type != Node_rule_list)
@@ -1433,11 +1419,11 @@ case 8:
;
break;}
case 9:
-#line 211 "awkgram.y"
+#line 213 "awkgram.y"
{ io_allowed = FALSE; parsing_end_rule = TRUE; ;
break;}
case 10:
-#line 213 "awkgram.y"
+#line 215 "awkgram.y"
{
if (end_block != NULL) {
if (end_block->type != Node_rule_list)
@@ -1455,7 +1441,7 @@ case 10:
;
break;}
case 11:
-#line 229 "awkgram.y"
+#line 231 "awkgram.y"
{
warning(_("BEGIN blocks must have an action part"));
errcount++;
@@ -1463,7 +1449,7 @@ case 11:
;
break;}
case 12:
-#line 235 "awkgram.y"
+#line 237 "awkgram.y"
{
warning(_("END blocks must have an action part"));
errcount++;
@@ -1471,15 +1457,15 @@ case 12:
;
break;}
case 13:
-#line 241 "awkgram.y"
+#line 243 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_rule_node, yyvsp[0].nodeval); yyerrok; ;
break;}
case 14:
-#line 243 "awkgram.y"
+#line 245 "awkgram.y"
{ yyval.nodeval = node((NODE *) NULL, Node_rule_node, yyvsp[0].nodeval); yyerrok; ;
break;}
case 15:
-#line 245 "awkgram.y"
+#line 247 "awkgram.y"
{
yyval.nodeval = node(yyvsp[-1].nodeval,
Node_rule_node,
@@ -1494,7 +1480,7 @@ case 15:
;
break;}
case 16:
-#line 258 "awkgram.y"
+#line 260 "awkgram.y"
{
func_install(yyvsp[-1].nodeval, yyvsp[0].nodeval);
yyval.nodeval = NULL;
@@ -1502,15 +1488,15 @@ case 16:
;
break;}
case 17:
-#line 267 "awkgram.y"
+#line 269 "awkgram.y"
{ yyval.sval = yyvsp[0].sval; ;
break;}
case 18:
-#line 269 "awkgram.y"
+#line 271 "awkgram.y"
{ yyval.sval = yyvsp[0].sval; ;
break;}
case 19:
-#line 271 "awkgram.y"
+#line 273 "awkgram.y"
{
yyerror(_("`%s' is a built-in function, it cannot be redefined"),
tokstart);
@@ -1519,13 +1505,13 @@ case 19:
;
break;}
case 22:
-#line 286 "awkgram.y"
+#line 288 "awkgram.y"
{
param_counter = 0;
;
break;}
case 23:
-#line 290 "awkgram.y"
+#line 292 "awkgram.y"
{
NODE *t;
@@ -1539,33 +1525,33 @@ case 23:
;
break;}
case 24:
-#line 305 "awkgram.y"
+#line 307 "awkgram.y"
{
yyval.nodeval = yyvsp[-3].nodeval;
can_return = FALSE;
;
break;}
case 25:
-#line 310 "awkgram.y"
+#line 312 "awkgram.y"
{
yyval.nodeval = node((NODE *) NULL, Node_K_return, (NODE *) NULL);
can_return = FALSE;
;
break;}
case 26:
-#line 319 "awkgram.y"
+#line 321 "awkgram.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 27:
-#line 321 "awkgram.y"
+#line 323 "awkgram.y"
{ yyval.nodeval = mkrangenode(node(yyvsp[-2].nodeval, Node_cond_pair, yyvsp[0].nodeval)); ;
break;}
case 28:
-#line 330 "awkgram.y"
+#line 332 "awkgram.y"
{ ++want_regexp; ;
break;}
case 29:
-#line 332 "awkgram.y"
+#line 334 "awkgram.y"
{
NODE *n;
size_t len;
@@ -1582,15 +1568,15 @@ case 29:
;
break;}
case 30:
-#line 350 "awkgram.y"
+#line 352 "awkgram.y"
{ yyval.nodeval = yyvsp[-3].nodeval; ;
break;}
case 31:
-#line 352 "awkgram.y"
+#line 354 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
case 32:
-#line 357 "awkgram.y"
+#line 359 "awkgram.y"
{
yyval.nodeval = yyvsp[0].nodeval;
if (do_lint && isnoeffect(yyval.nodeval->type))
@@ -1598,7 +1584,7 @@ case 32:
;
break;}
case 33:
-#line 363 "awkgram.y"
+#line 365 "awkgram.y"
{
if (yyvsp[-1].nodeval == NULL || yyvsp[-1].nodeval->type != Node_statement_list)
yyvsp[-1].nodeval = node(yyvsp[-1].nodeval, Node_statement_list, (NODE *) NULL);
@@ -1608,39 +1594,39 @@ case 33:
;
break;}
case 34:
-#line 371 "awkgram.y"
+#line 373 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
case 35:
-#line 373 "awkgram.y"
+#line 375 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
case 38:
-#line 383 "awkgram.y"
+#line 385 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
case 39:
-#line 385 "awkgram.y"
+#line 387 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
case 40:
-#line 387 "awkgram.y"
+#line 389 "awkgram.y"
{ yyval.nodeval = yyvsp[-1].nodeval; ;
break;}
case 41:
-#line 389 "awkgram.y"
+#line 391 "awkgram.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 42:
-#line 391 "awkgram.y"
+#line 393 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-3].nodeval, Node_K_while, yyvsp[0].nodeval); ;
break;}
case 43:
-#line 393 "awkgram.y"
+#line 395 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_K_do, yyvsp[-5].nodeval); ;
break;}
case 44:
-#line 395 "awkgram.y"
+#line 397 "awkgram.y"
{
/*
* Efficiency hack. Recognize the special case of
@@ -1655,14 +1641,26 @@ case 44:
* Check that the body is a `delete a[i]' statement,
* and that both the loop var and array names match.
*/
- if (yyvsp[0].nodeval != NULL && yyvsp[0].nodeval->type == Node_K_delete
- && yyvsp[0].nodeval->rnode != NULL
- && (yyvsp[0].nodeval->rnode->type == Node_var || yyvsp[0].nodeval->rnode->type == Node_param_list)
- && strcmp(yyvsp[-5].sval, yyvsp[0].nodeval->rnode->var_value->vname) == 0
- && strcmp(yyvsp[-3].sval, yyvsp[0].nodeval->lnode->vname) == 0) {
- yyvsp[0].nodeval->type = Node_K_delete_loop;
- yyval.nodeval = yyvsp[0].nodeval;
+ if (yyvsp[0].nodeval != NULL && yyvsp[0].nodeval->type == Node_K_delete) {
+ NODE *arr, *sub;
+
+ assert(yyvsp[0].nodeval->rnode->type == Node_expression_list);
+ arr = yyvsp[0].nodeval->lnode; /* array var */
+ sub = yyvsp[0].nodeval->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(yyvsp[-5].sval, sub->vname) == 0
+ && strcmp(yyvsp[-3].sval, arr->vname) == 0) {
+ yyvsp[0].nodeval->type = Node_K_delete_loop;
+ yyval.nodeval = yyvsp[0].nodeval;
+ }
+ else
+ goto regular_loop;
} else {
+ regular_loop:
yyval.nodeval = node(yyvsp[0].nodeval, Node_K_arrayfor,
make_for_loop(variable(yyvsp[-5].sval, CAN_FREE, Node_var),
(NODE *) NULL, variable(yyvsp[-3].sval, CAN_FREE, Node_var_array)));
@@ -1670,60 +1668,28 @@ case 44:
;
break;}
case 45:
-#line 423 "awkgram.y"
+#line 437 "awkgram.y"
{
yyval.nodeval = node(yyvsp[0].nodeval, Node_K_for, (NODE *) make_for_loop(yyvsp[-9].nodeval, yyvsp[-6].nodeval, yyvsp[-3].nodeval));
;
break;}
case 46:
-#line 427 "awkgram.y"
+#line 441 "awkgram.y"
{
yyval.nodeval = node(yyvsp[0].nodeval, Node_K_for,
(NODE *) make_for_loop(yyvsp[-8].nodeval, (NODE *) NULL, yyvsp[-3].nodeval));
;
break;}
case 47:
-#line 433 "awkgram.y"
+#line 447 "awkgram.y"
{ yyval.nodeval = node((NODE *) NULL, Node_K_break, (NODE *) NULL); ;
break;}
case 48:
-#line 436 "awkgram.y"
+#line 450 "awkgram.y"
{ yyval.nodeval = node((NODE *) NULL, Node_K_continue, (NODE *) NULL); ;
break;}
case 49:
-#line 438 "awkgram.y"
-{
- yyval.nodeval = node(yyvsp[-3].nodeval, yyvsp[-5].nodetypeval, yyvsp[-1].nodeval);
- if (yyval.nodeval->type == Node_K_printf)
- count_args(yyval.nodeval)
- ;
- break;}
-case 50:
-#line 444 "awkgram.y"
-{
- if (yyvsp[-3].nodetypeval == Node_K_print && yyvsp[-2].nodeval == NULL) {
- static int warned = FALSE;
-
- yyvsp[-2].nodeval = 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 \"\"'"));
- }
- }
-
- yyval.nodeval = node(yyvsp[-2].nodeval, yyvsp[-3].nodetypeval, yyvsp[-1].nodeval);
- if (yyval.nodeval->type == Node_K_printf)
- count_args(yyval.nodeval)
- ;
- break;}
-case 51:
-#line 466 "awkgram.y"
+#line 452 "awkgram.y"
{ NODETYPE type;
if (! io_allowed)
@@ -1732,8 +1698,8 @@ case 51:
yyval.nodeval = node((NODE *) NULL, type, (NODE *) NULL);
;
break;}
-case 52:
-#line 474 "awkgram.y"
+case 50:
+#line 460 "awkgram.y"
{
if (do_lint)
lintwarn(_("`nextfile' is a gawk extension"));
@@ -1753,27 +1719,59 @@ case 52:
yyval.nodeval = node((NODE *) NULL, Node_K_nextfile, (NODE *) NULL);
;
break;}
-case 53:
-#line 493 "awkgram.y"
+case 51:
+#line 479 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_exit, (NODE *) NULL); ;
break;}
-case 54:
-#line 495 "awkgram.y"
+case 52:
+#line 481 "awkgram.y"
{
if (! can_return)
yyerror(_("`return' used outside function context"));
;
break;}
+case 53:
+#line 486 "awkgram.y"
+{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_return, (NODE *) NULL); ;
+ break;}
case 55:
#line 500 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_return, (NODE *) NULL); ;
+{
+ yyval.nodeval = node(yyvsp[-2].nodeval, yyvsp[-4].nodetypeval, yyvsp[0].nodeval);
+ if (yyval.nodeval->type == Node_K_printf)
+ count_args(yyval.nodeval);
+ ;
break;}
case 56:
-#line 502 "awkgram.y"
-{ yyval.nodeval = node(variable(yyvsp[-4].sval, CAN_FREE, Node_var_array), Node_K_delete, yyvsp[-2].nodeval); ;
+#line 506 "awkgram.y"
+{
+ if (yyvsp[-2].nodetypeval == Node_K_print && yyvsp[-1].nodeval == NULL) {
+ static int warned = FALSE;
+
+ yyvsp[-1].nodeval = 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 \"\"'"));
+ }
+ }
+
+ yyval.nodeval = node(yyvsp[-1].nodeval, yyvsp[-2].nodetypeval, yyvsp[0].nodeval);
+ if (yyval.nodeval->type == Node_K_printf)
+ count_args(yyval.nodeval);
+ ;
break;}
case 57:
-#line 504 "awkgram.y"
+#line 528 "awkgram.y"
+{ yyval.nodeval = node(variable(yyvsp[-3].sval, CAN_FREE, Node_var_array), Node_K_delete, yyvsp[-1].nodeval); ;
+ break;}
+case 58:
+#line 530 "awkgram.y"
{
if (do_lint)
lintwarn(_("`delete array' is a gawk extension"));
@@ -1785,63 +1783,71 @@ case 57:
errcount++;
error(_("`delete array' is a gawk extension"));
}
- yyval.nodeval = node(variable(yyvsp[-1].sval, CAN_FREE, Node_var_array), Node_K_delete, (NODE *) NULL);
+ yyval.nodeval = node(variable(yyvsp[0].sval, CAN_FREE, Node_var_array), Node_K_delete, (NODE *) NULL);
;
break;}
-case 58:
-#line 518 "awkgram.y"
-{ yyval.nodeval = yyvsp[-1].nodeval; ;
- break;}
case 59:
-#line 523 "awkgram.y"
-{ yyval.nodetypeval = yyvsp[0].nodetypeval; ;
+#line 544 "awkgram.y"
+{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
case 60:
-#line 525 "awkgram.y"
-{ yyval.nodetypeval = yyvsp[0].nodetypeval; ;
+#line 549 "awkgram.y"
+{ yyval.nodeval = NULL; ;
break;}
case 61:
-#line 530 "awkgram.y"
+#line 551 "awkgram.y"
+{ yyval.nodeval = yyvsp[0].nodeval; ;
+ break;}
+case 62:
+#line 556 "awkgram.y"
+{ yyval.nodetypeval = yyvsp[0].nodetypeval; ;
+ break;}
+case 63:
+#line 558 "awkgram.y"
+{ yyval.nodetypeval = yyvsp[0].nodetypeval; ;
+ break;}
+case 64:
+#line 563 "awkgram.y"
{
yyval.nodeval = node(yyvsp[-3].nodeval, Node_K_if,
node(yyvsp[0].nodeval, Node_if_branches, (NODE *) NULL));
;
break;}
-case 62:
-#line 536 "awkgram.y"
+case 65:
+#line 569 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-6].nodeval, Node_K_if,
node(yyvsp[-3].nodeval, Node_if_branches, yyvsp[0].nodeval)); ;
break;}
-case 63:
-#line 542 "awkgram.y"
+case 66:
+#line 575 "awkgram.y"
{ want_assign = FALSE; ;
break;}
-case 67:
-#line 553 "awkgram.y"
+case 70:
+#line 586 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 68:
-#line 555 "awkgram.y"
+case 71:
+#line 588 "awkgram.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_input, (NODE *) NULL); ;
break;}
-case 69:
-#line 560 "awkgram.y"
+case 72:
+#line 593 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 70:
-#line 562 "awkgram.y"
+case 73:
+#line 595 "awkgram.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_output, (NODE *) NULL); ;
break;}
-case 71:
-#line 564 "awkgram.y"
+case 74:
+#line 597 "awkgram.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_append, (NODE *) NULL); ;
break;}
-case 72:
-#line 566 "awkgram.y"
+case 75:
+#line 599 "awkgram.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_pipe, (NODE *) NULL); ;
break;}
-case 73:
-#line 568 "awkgram.y"
+case 76:
+#line 601 "awkgram.y"
{
if (yyvsp[0].nodeval->type == Node_K_getline
&& yyvsp[0].nodeval->rnode->type == Node_redirect_twoway)
@@ -1849,170 +1855,170 @@ case 73:
yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_twoway, (NODE *) NULL);
;
break;}
-case 74:
-#line 578 "awkgram.y"
+case 77:
+#line 611 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 75:
-#line 580 "awkgram.y"
+case 78:
+#line 613 "awkgram.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
-case 76:
-#line 585 "awkgram.y"
+case 79:
+#line 618 "awkgram.y"
{ yyval.nodeval = make_param(yyvsp[0].sval); ;
break;}
-case 77:
-#line 587 "awkgram.y"
+case 80:
+#line 620 "awkgram.y"
{ yyval.nodeval = append_right(yyvsp[-2].nodeval, make_param(yyvsp[0].sval)); yyerrok; ;
break;}
-case 78:
-#line 589 "awkgram.y"
+case 81:
+#line 622 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 79:
-#line 591 "awkgram.y"
+case 82:
+#line 624 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 80:
-#line 593 "awkgram.y"
+case 83:
+#line 626 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 81:
-#line 599 "awkgram.y"
+case 84:
+#line 632 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 82:
-#line 601 "awkgram.y"
+case 85:
+#line 634 "awkgram.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
-case 83:
-#line 606 "awkgram.y"
+case 86:
+#line 639 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 84:
-#line 608 "awkgram.y"
+case 87:
+#line 641 "awkgram.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
-case 85:
-#line 613 "awkgram.y"
+case 88:
+#line 646 "awkgram.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL); ;
break;}
-case 86:
-#line 615 "awkgram.y"
+case 89:
+#line 648 "awkgram.y"
{
yyval.nodeval = append_right(yyvsp[-2].nodeval,
node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL));
yyerrok;
;
break;}
-case 87:
-#line 621 "awkgram.y"
+case 90:
+#line 654 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 88:
-#line 623 "awkgram.y"
+case 91:
+#line 656 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 89:
-#line 625 "awkgram.y"
+case 92:
+#line 658 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 90:
-#line 627 "awkgram.y"
+case 93:
+#line 660 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 91:
-#line 632 "awkgram.y"
+case 94:
+#line 665 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 92:
-#line 634 "awkgram.y"
+case 95:
+#line 667 "awkgram.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
-case 93:
-#line 639 "awkgram.y"
+case 96:
+#line 672 "awkgram.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL); ;
break;}
-case 94:
-#line 641 "awkgram.y"
+case 97:
+#line 674 "awkgram.y"
{
yyval.nodeval = append_right(yyvsp[-2].nodeval,
node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL));
yyerrok;
;
break;}
-case 95:
-#line 647 "awkgram.y"
+case 98:
+#line 680 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 96:
-#line 649 "awkgram.y"
+case 99:
+#line 682 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 97:
-#line 651 "awkgram.y"
+case 100:
+#line 684 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 98:
-#line 653 "awkgram.y"
+case 101:
+#line 686 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 99:
-#line 658 "awkgram.y"
+case 102:
+#line 691 "awkgram.y"
{ want_assign = FALSE; ;
break;}
-case 100:
-#line 660 "awkgram.y"
+case 103:
+#line 693 "awkgram.y"
{
if (do_lint && yyvsp[0].nodeval->type == Node_regex)
lintwarn(_("regular expression on right of assignment"));
yyval.nodeval = node(yyvsp[-3].nodeval, yyvsp[-2].nodetypeval, yyvsp[0].nodeval);
;
break;}
-case 101:
-#line 666 "awkgram.y"
+case 104:
+#line 699 "awkgram.y"
{ yyval.nodeval = node(variable(yyvsp[0].sval, CAN_FREE, Node_var_array), Node_in_array, yyvsp[-3].nodeval); ;
break;}
-case 102:
-#line 668 "awkgram.y"
+case 105:
+#line 701 "awkgram.y"
{
yyval.nodeval = node(yyvsp[0].nodeval, Node_K_getline,
node(yyvsp[-3].nodeval, Node_redirect_pipein, (NODE *) NULL));
;
break;}
-case 103:
-#line 673 "awkgram.y"
+case 106:
+#line 706 "awkgram.y"
{
yyval.nodeval = node(yyvsp[0].nodeval, Node_K_getline,
node(yyvsp[-3].nodeval, Node_redirect_twoway, (NODE *) NULL));
;
break;}
-case 104:
-#line 678 "awkgram.y"
+case 107:
+#line 711 "awkgram.y"
{
if (do_lint && ! io_allowed && parsing_end_rule && yyvsp[0].nodeval == NULL)
lintwarn(_("non-redirected `getline' undefined inside END action"));
yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_getline, yyvsp[0].nodeval);
;
break;}
-case 105:
-#line 684 "awkgram.y"
+case 108:
+#line 717 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_and, yyvsp[0].nodeval); ;
break;}
-case 106:
-#line 686 "awkgram.y"
+case 109:
+#line 719 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_or, yyvsp[0].nodeval); ;
break;}
-case 107:
-#line 688 "awkgram.y"
+case 110:
+#line 721 "awkgram.y"
{
if (yyvsp[-2].nodeval->type == Node_regex)
warning(_("regular expression on left of `~' or `!~' operator"));
yyval.nodeval = node(yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, mk_rexp(yyvsp[0].nodeval));
;
break;}
-case 108:
-#line 694 "awkgram.y"
+case 111:
+#line 727 "awkgram.y"
{
yyval.nodeval = yyvsp[0].nodeval;
if (do_lint && tokstart[0] == '*') {
@@ -2023,8 +2029,8 @@ case 108:
}
;
break;}
-case 109:
-#line 704 "awkgram.y"
+case 112:
+#line 737 "awkgram.y"
{
yyval.nodeval = node(node(make_number(0.0),
Node_field_spec,
@@ -2033,144 +2039,144 @@ case 109:
yyvsp[0].nodeval);
;
break;}
-case 110:
-#line 712 "awkgram.y"
+case 113:
+#line 745 "awkgram.y"
{ yyval.nodeval = node(variable(yyvsp[0].sval, CAN_FREE, Node_var_array), Node_in_array, yyvsp[-2].nodeval); ;
break;}
-case 111:
-#line 714 "awkgram.y"
+case 114:
+#line 747 "awkgram.y"
{
if (do_lint && yyvsp[0].nodeval->type == Node_regex)
lintwarn(_("regular expression on right of comparison"));
yyval.nodeval = node(yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, yyvsp[0].nodeval);
;
break;}
-case 112:
-#line 720 "awkgram.y"
+case 115:
+#line 753 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_less, yyvsp[0].nodeval); ;
break;}
-case 113:
-#line 722 "awkgram.y"
+case 116:
+#line 755 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_greater, yyvsp[0].nodeval); ;
break;}
-case 114:
-#line 724 "awkgram.y"
+case 117:
+#line 757 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-4].nodeval, Node_cond_exp, node(yyvsp[-2].nodeval, Node_if_branches, yyvsp[0].nodeval));;
break;}
-case 115:
-#line 726 "awkgram.y"
+case 118:
+#line 759 "awkgram.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
-case 116:
-#line 728 "awkgram.y"
+case 119:
+#line 761 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_concat, yyvsp[0].nodeval); ;
break;}
-case 117:
-#line 733 "awkgram.y"
+case 120:
+#line 766 "awkgram.y"
{ want_assign = FALSE; ;
break;}
-case 118:
-#line 735 "awkgram.y"
+case 121:
+#line 768 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-3].nodeval, yyvsp[-2].nodetypeval, yyvsp[0].nodeval); ;
break;}
-case 119:
-#line 737 "awkgram.y"
+case 122:
+#line 770 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_and, yyvsp[0].nodeval); ;
break;}
-case 120:
-#line 739 "awkgram.y"
+case 123:
+#line 772 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_or, yyvsp[0].nodeval); ;
break;}
-case 121:
-#line 741 "awkgram.y"
+case 124:
+#line 774 "awkgram.y"
{
if (do_lint && ! io_allowed && yyvsp[0].nodeval == NULL)
lintwarn(_("non-redirected `getline' undefined inside BEGIN or END action"));
yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_getline, yyvsp[0].nodeval);
;
break;}
-case 122:
-#line 747 "awkgram.y"
+case 125:
+#line 780 "awkgram.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
-case 123:
-#line 749 "awkgram.y"
+case 126:
+#line 782 "awkgram.y"
{ yyval.nodeval = node((NODE *) NULL, Node_nomatch, yyvsp[0].nodeval); ;
break;}
-case 124:
-#line 751 "awkgram.y"
+case 127:
+#line 784 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, mk_rexp(yyvsp[0].nodeval)); ;
break;}
-case 125:
-#line 753 "awkgram.y"
+case 128:
+#line 786 "awkgram.y"
{ yyval.nodeval = node(variable(yyvsp[0].sval, CAN_FREE, Node_var_array), Node_in_array, yyvsp[-2].nodeval); ;
break;}
-case 126:
-#line 755 "awkgram.y"
+case 129:
+#line 788 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, yyvsp[0].nodeval); ;
break;}
-case 127:
-#line 757 "awkgram.y"
+case 130:
+#line 790 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-4].nodeval, Node_cond_exp, node(yyvsp[-2].nodeval, Node_if_branches, yyvsp[0].nodeval));;
break;}
-case 128:
-#line 759 "awkgram.y"
+case 131:
+#line 792 "awkgram.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
-case 129:
-#line 761 "awkgram.y"
+case 132:
+#line 794 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_concat, yyvsp[0].nodeval); ;
break;}
-case 131:
-#line 768 "awkgram.y"
+case 134:
+#line 801 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_exp, yyvsp[0].nodeval); ;
break;}
-case 132:
-#line 770 "awkgram.y"
+case 135:
+#line 803 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_times, yyvsp[0].nodeval); ;
break;}
-case 133:
-#line 772 "awkgram.y"
+case 136:
+#line 805 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_quotient, yyvsp[0].nodeval); ;
break;}
-case 134:
-#line 774 "awkgram.y"
+case 137:
+#line 807 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_mod, yyvsp[0].nodeval); ;
break;}
-case 135:
-#line 776 "awkgram.y"
+case 138:
+#line 809 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_plus, yyvsp[0].nodeval); ;
break;}
-case 136:
-#line 778 "awkgram.y"
+case 139:
+#line 811 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_minus, yyvsp[0].nodeval); ;
break;}
-case 137:
-#line 780 "awkgram.y"
+case 140:
+#line 813 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_postincrement, (NODE *) NULL); ;
break;}
-case 138:
-#line 782 "awkgram.y"
+case 141:
+#line 815 "awkgram.y"
{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_postdecrement, (NODE *) NULL); ;
break;}
-case 139:
-#line 787 "awkgram.y"
+case 142:
+#line 820 "awkgram.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_not, (NODE *) NULL); ;
break;}
-case 140:
-#line 789 "awkgram.y"
+case 143:
+#line 822 "awkgram.y"
{ yyval.nodeval = yyvsp[-1].nodeval; ;
break;}
-case 141:
-#line 792 "awkgram.y"
+case 144:
+#line 825 "awkgram.y"
{ yyval.nodeval = snode(yyvsp[-1].nodeval, Node_builtin, (int) yyvsp[-3].lval); ;
break;}
-case 142:
-#line 794 "awkgram.y"
+case 145:
+#line 827 "awkgram.y"
{ yyval.nodeval = snode(yyvsp[-1].nodeval, Node_builtin, (int) yyvsp[-3].lval); ;
break;}
-case 143:
-#line 796 "awkgram.y"
+case 146:
+#line 829 "awkgram.y"
{
if (do_lint)
lintwarn(_("call of `length' without parentheses is not portable"));
@@ -2179,8 +2185,8 @@ case 143:
warning(_("call of `length' without parentheses is deprecated by POSIX"));
;
break;}
-case 144:
-#line 804 "awkgram.y"
+case 147:
+#line 837 "awkgram.y"
{
yyval.nodeval = node(yyvsp[-1].nodeval, Node_func_call, make_string(yyvsp[-3].sval, strlen(yyvsp[-3].sval)));
func_use(yyvsp[-3].sval, FUNC_USE);
@@ -2188,34 +2194,34 @@ case 144:
free(yyvsp[-3].sval);
;
break;}
-case 146:
-#line 812 "awkgram.y"
+case 149:
+#line 845 "awkgram.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_preincrement, (NODE *) NULL); ;
break;}
-case 147:
-#line 814 "awkgram.y"
+case 150:
+#line 847 "awkgram.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_predecrement, (NODE *) NULL); ;
break;}
-case 148:
-#line 816 "awkgram.y"
+case 151:
+#line 849 "awkgram.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
-case 149:
-#line 818 "awkgram.y"
+case 152:
+#line 851 "awkgram.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
-case 150:
-#line 821 "awkgram.y"
+case 153:
+#line 854 "awkgram.y"
{
- if (yyvsp[0].nodeval->type == Node_val) {
+ if (yyvsp[0].nodeval->type == Node_val && (yyvsp[0].nodeval->flags & (STR|STRING)) == 0) {
yyvsp[0].nodeval->numbr = -(force_number(yyvsp[0].nodeval));
yyval.nodeval = yyvsp[0].nodeval;
} else
yyval.nodeval = node(yyvsp[0].nodeval, Node_unary_minus, (NODE *) NULL);
;
break;}
-case 151:
-#line 829 "awkgram.y"
+case 154:
+#line 862 "awkgram.y"
{
/*
* was: $$ = $2
@@ -2224,20 +2230,20 @@ case 151:
yyval.nodeval = node (make_number(0.0), Node_plus, yyvsp[0].nodeval);
;
break;}
-case 152:
-#line 840 "awkgram.y"
+case 155:
+#line 873 "awkgram.y"
{ yyval.nodeval = NULL; ;
break;}
-case 153:
-#line 842 "awkgram.y"
+case 156:
+#line 875 "awkgram.y"
{ yyval.nodeval = yyvsp[0].nodeval; ;
break;}
-case 154:
-#line 847 "awkgram.y"
+case 157:
+#line 880 "awkgram.y"
{ yyval.nodeval = variable(yyvsp[0].sval, CAN_FREE, Node_var); ;
break;}
-case 155:
-#line 849 "awkgram.y"
+case 158:
+#line 882 "awkgram.y"
{
if (yyvsp[-1].nodeval == NULL) {
fatal(_("invalid subscript expression"));
@@ -2248,24 +2254,24 @@ case 155:
yyval.nodeval = node(variable(yyvsp[-3].sval, CAN_FREE, Node_var_array), Node_subscript, yyvsp[-1].nodeval);
;
break;}
-case 156:
-#line 859 "awkgram.y"
+case 159:
+#line 892 "awkgram.y"
{ yyval.nodeval = node(yyvsp[0].nodeval, Node_field_spec, (NODE *) NULL); ;
break;}
-case 158:
-#line 867 "awkgram.y"
+case 161:
+#line 900 "awkgram.y"
{ yyerrok; ;
break;}
-case 159:
-#line 871 "awkgram.y"
+case 162:
+#line 904 "awkgram.y"
{ yyerrok; ;
break;}
-case 162:
-#line 880 "awkgram.y"
+case 165:
+#line 913 "awkgram.y"
{ yyerrok; want_assign = FALSE; ;
break;}
-case 163:
-#line 883 "awkgram.y"
+case 166:
+#line 916 "awkgram.y"
{ yyerrok; ;
break;}
}
@@ -2490,7 +2496,7 @@ yyerrhandle:
}
return 1;
}
-#line 886 "awkgram.y"
+#line 919 "awkgram.y"
struct token {
@@ -2527,6 +2533,7 @@ static struct token tokentab[] = {
{"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},
@@ -2577,6 +2584,20 @@ static struct token tokentab[] = {
{"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 *
@@ -2614,7 +2635,8 @@ static void
const char *mesg = NULL;
register char *bp, *cp;
char *scan;
- char buf[120];
+ char *buf;
+ int count;
static char end_of_file_line[] = "(END OF FILE)";
errcount++;
@@ -2641,11 +2663,24 @@ static void
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;
- cp = buf + sizeof(buf) - 24; /* 24 more than longest msg. input */
+
if (lexptr != NULL) {
scan = thisline;
- while (bp < cp && scan < lexeme)
+ while (scan < lexeme)
if (*scan++ == '\t')
*bp++ = '\t';
else
@@ -2653,18 +2688,10 @@ static void
*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);
+ free(buf);
}
/* get_src_buf --- read the next buffer of source program */
@@ -2845,6 +2872,75 @@ tokexpand()
/* 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()
@@ -2867,10 +2963,29 @@ nextc()
)
#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
@@ -2925,7 +3040,7 @@ yylex()
return 0;
}
pushback();
-#ifdef OS2
+#if defined OS2 || defined __EMX__
/*
* added for OS/2's extproc feature of cmd.exe
* (like #! in BSD sh)
@@ -2960,6 +3075,9 @@ yylex()
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 */
@@ -3017,6 +3135,9 @@ retry:
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) {
@@ -3258,6 +3379,9 @@ retry:
yyerror(_("unterminated string"));
exit(1);
}
+#ifdef MBS_SUPPORT
+ if (MB_CUR_MAX == 1 || nextc_is_1stbyte)
+#endif
if (c == '\\') {
c = nextc();
if (c == '\n') {
@@ -3387,9 +3511,15 @@ retry:
eof_warned = TRUE;
}
tokadd('\0');
- if (! do_traditional && isnondecimal(tokstart))
+ 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
+ } else
yylval.nodeval = make_number(atof(tokstart));
yylval.nodeval->flags |= PERM;
return lasttok = YNUMBER;
@@ -3424,7 +3554,21 @@ retry:
exit(1);
}
- if (! do_traditional && c == '_') {
+ /*
+ * 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;
@@ -3561,7 +3705,7 @@ snode(NODE *subn, NODETYPE op, int idx)
/* traverse expression list to see how many args. given */
for (n = subn; n != NULL; n = n->rnode) {
nexp++;
- if (nexp > 3)
+ if (nexp > 5)
break;
}
@@ -3655,9 +3799,22 @@ snode(NODE *subn, NODETYPE op, int idx)
/* 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) {
count_args(r);
@@ -4334,7 +4491,7 @@ mk_rexp(NODE *exp)
return exp;
getnode(n);
- n->type = Node_regex;
+ n->type = Node_dynregex;
n->re_exp = exp;
n->re_text = NULL;
n->re_reg = NULL;
@@ -4436,7 +4593,7 @@ isassignable(register NODE *n)
NODE *
stopme(NODE *tree)
{
- return tmp_number((AWKNUM) 0.0);
+ return 0;
}
/* dumpintlstr --- write out an initial .po file entry for the string */
@@ -4456,10 +4613,36 @@ dumpintlstr(char *str, size_t len)
}
printf("msgid ");
- fflush(stdout);
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 --git a/awkgram.y b/awkgram.y
index 649ccac4..63de4e90 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc.
+ * 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,6 +56,7 @@ static void parms_shadow P((const char *fname, NODE *func));
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,6 +111,7 @@ extern NODE *end_block;
%type <nodeval> rexpression_list opt_rexpression_list
%type <nodeval> expression_list opt_expression_list
%type <nodeval> statements statement if_statement opt_param_list
+%type <nodeval> simple_stmt opt_simple_stmt
%type <nodeval> opt_exp opt_variable regexp
%type <nodeval> input_redir output_redir
%type <nodetypeval> print
@@ -406,24 +408,36 @@ statement
* 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;
+ 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_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement
+ | 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_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement
+ | 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,34 +448,6 @@ statement
| 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;
@@ -498,9 +484,49 @@ statement
}
opt_exp statement_term
{ $$ = node($3, Node_K_return, (NODE *) NULL); }
- | LEX_DELETE NAME '[' expression_list ']' statement_term
+ | 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 statement_term
+ | LEX_DELETE NAME
{
if (do_lint)
lintwarn(_("`delete array' is a gawk extension"));
@@ -514,7 +540,14 @@ statement
}
$$ = node(variable($2, CAN_FREE, Node_var_array), Node_K_delete, (NODE *) NULL);
}
- | exp statement_term
+ | exp
+ { $$ = $1; }
+ ;
+
+opt_simple_stmt
+ : /* empty */
+ { $$ = NULL; }
+ | simple_stmt
{ $$ = $1; }
;
@@ -819,7 +852,7 @@ non_post_simp_exp
| '-' simp_exp %prec UNARY
{
- if ($2->type == Node_val) {
+ if ($2->type == Node_val && ($2->flags & (STR|STRING)) == 0) {
$2->numbr = -(force_number($2));
$$ = $2;
} else
@@ -919,6 +952,7 @@ static struct token tokentab[] = {
{"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,6 +1003,20 @@ static struct token tokentab[] = {
{"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,7 +1054,8 @@ static void
const char *mesg = NULL;
register char *bp, *cp;
char *scan;
- char buf[120];
+ char *buf;
+ int count;
static char end_of_file_line[] = "(END OF FILE)";
errcount++;
@@ -1033,11 +1082,24 @@ static void
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;
- cp = buf + sizeof(buf) - 24; /* 24 more than longest msg. input */
+
if (lexptr != NULL) {
scan = thisline;
- while (bp < cp && scan < lexeme)
+ while (scan < lexeme)
if (*scan++ == '\t')
*bp++ = '\t';
else
@@ -1045,18 +1107,10 @@ static void
*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);
+ free(buf);
}
/* get_src_buf --- read the next buffer of source program */
@@ -1237,6 +1291,75 @@ tokexpand()
/* 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,10 +1382,29 @@ nextc()
)
#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,7 +1459,7 @@ yylex()
return 0;
}
pushback();
-#ifdef OS2
+#if defined OS2 || defined __EMX__
/*
* added for OS/2's extproc feature of cmd.exe
* (like #! in BSD sh)
@@ -1352,6 +1494,9 @@ yylex()
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,6 +1554,9 @@ retry:
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,6 +1798,9 @@ retry:
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,9 +1930,15 @@ retry:
eof_warned = TRUE;
}
tokadd('\0');
- if (! do_traditional && isnondecimal(tokstart))
+ 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
+ } else
yylval.nodeval = make_number(atof(tokstart));
yylval.nodeval->flags |= PERM;
return lasttok = YNUMBER;
@@ -1816,7 +1973,21 @@ retry:
exit(1);
}
- if (! do_traditional && c == '_') {
+ /*
+ * 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,7 +2124,7 @@ snode(NODE *subn, NODETYPE op, int idx)
/* traverse expression list to see how many args. given */
for (n = subn; n != NULL; n = n->rnode) {
nexp++;
- if (nexp > 3)
+ if (nexp > 5)
break;
}
@@ -2047,9 +2218,22 @@ snode(NODE *subn, NODETYPE op, int idx)
/* 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) {
count_args(r);
@@ -2726,7 +2910,7 @@ mk_rexp(NODE *exp)
return exp;
getnode(n);
- n->type = Node_regex;
+ n->type = Node_dynregex;
n->re_exp = exp;
n->re_text = NULL;
n->re_reg = NULL;
@@ -2828,7 +3012,7 @@ isassignable(register NODE *n)
NODE *
stopme(NODE *tree)
{
- return tmp_number((AWKNUM) 0.0);
+ return 0;
}
/* dumpintlstr --- write out an initial .po file entry for the string */
@@ -2848,10 +3032,36 @@ dumpintlstr(char *str, size_t len)
}
printf("msgid ");
- fflush(stdout);
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 --git a/awklib/ChangeLog b/awklib/ChangeLog
index 531fdb98..9e2cdd34 100644
--- a/awklib/ChangeLog
+++ b/awklib/ChangeLog
@@ -1,3 +1,15 @@
+Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.1: Release tar file made.
+
+Wed Apr 17 15:20:27 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (clean): Add *.exe to list of files to be cleaned.
+
+2002-01-27 Bruno Haible <bruno@clisp.org>
+
+ * eg/lib/libintl.awk (dcngettext): New function.
+
Sun Jun 3 13:04:44 2001 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.0: Release tar file made. And there was
diff --git a/awklib/Makefile.am b/awklib/Makefile.am
index ecd23cfa..d0f25284 100644
--- a/awklib/Makefile.am
+++ b/awklib/Makefile.am
@@ -1,7 +1,7 @@
#
# awklib/Makefile.am --- automake input file for gawk
#
-# Copyright (C) 1995-2001 the Free Software Foundation, Inc.
+# Copyright (C) 1995-2002 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
@@ -49,7 +49,7 @@ uninstall-local:
rm -f $(DESTDIR)$(bindir)/igawk
clean-local:
- rm -f $(AUXAWK) igawk
+ rm -f $(AUXAWK) igawk *.exe
stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi
rm -fr eg stamp-eg
@@ -57,10 +57,10 @@ stamp-eg: $(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: $(srcdir)/eg/lib/pwcat.c
+pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c
$(CC) $(CFLAGS) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@
-grcat: $(srcdir)/eg/lib/grcat.c
+grcat$(EXEEXT): $(srcdir)/eg/lib/grcat.c
$(CC) $(CFLAGS) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@
igawk: $(srcdir)/eg/prog/igawk.sh
diff --git a/awklib/Makefile.in b/awklib/Makefile.in
index 686b65ad..a6dcfb1e 100644
--- a/awklib/Makefile.in
+++ b/awklib/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4a from Makefile.am
+# Makefile.in generated automatically by automake 1.5 from Makefile.am.
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# 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,
@@ -11,6 +11,31 @@
# 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@
@@ -29,11 +54,9 @@ infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-
top_builddir = ..
ACLOCAL = @ACLOCAL@
@@ -45,45 +68,47 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_FLAG =
+INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
-
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-
-@SET_MAKE@
-AMDEP = @AMDEP@
+host_alias = @host_alias@
+host_triplet = @host@
AMTAR = @AMTAR@
AWK = @AWK@
-CATALOGS = @CATALOGS@
+BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CFLAGS = @CFLAGS@
CPP = @CPP@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
+EXEEXT = @EXEEXT@
GENCAT = @GENCAT@
-GMOFILES = @GMOFILES@
+GLIBC21 = @GLIBC21@
GMSGFMT = @GMSGFMT@
-GT_NO = @GT_NO@
-GT_YES = @GT_YES@
-INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
+HAVE_LIB = @HAVE_LIB@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
-INTLDEPS = @INTLDEPS@
+INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
+LIB = @LIB@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
LN_S = @LN_S@
-MAKEINFO = @MAKEINFO@
+LTLIB = @LTLIB@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
+OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
-POFILES = @POFILES@
+PATH_SEPARATOR = @PATH_SEPARATOR@
POSUB = @POSUB@
RANLIB = @RANLIB@
SOCKET_LIBS = @SOCKET_LIBS@
@@ -92,38 +117,15 @@ 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@
-l = @l@
-
-#
-# 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.
-#
-# 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
-#
+libexecdir = @libexecdir@/awk
+datadir = @datadir@/awk
EXTRA_DIST = ChangeLog extract.awk eg stamp-eg
-datadir = @datadir@/awk
-libexecdir = @libexecdir@/awk
-
bin_SCRIPTS = igawk
libexec_PROGRAMS = pwcat grcat
AUXAWK = passwd.awk group.awk
@@ -131,91 +133,73 @@ nodist_grcat_SOURCES = grcat.c
nodist_pwcat_SOURCES = pwcat.c
subdir = awklib
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-PROGRAMS = $(libexec_PROGRAMS)
+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@ -I. -I$(srcdir) -I..
+DEFS = @DEFS@
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
-nodist_grcat_OBJECTS = grcat.o
-grcat_OBJECTS = $(nodist_grcat_OBJECTS)
-grcat_LDADD = $(LDADD)
-grcat_DEPENDENCIES =
-grcat_LDFLAGS =
-nodist_pwcat_OBJECTS = pwcat.o
-pwcat_OBJECTS = $(nodist_pwcat_OBJECTS)
-pwcat_LDADD = $(LDADD)
-pwcat_DEPENDENCIES =
-pwcat_LDFLAGS =
-SCRIPTS = $(bin_SCRIPTS)
-
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+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 =
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-DEP_FILES = @AMDEP@ $(DEPDIR)/grcat.Po $(DEPDIR)/pwcat.Po
-DIST_COMMON = ChangeLog Makefile.am Makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-GZIP_ENV = --best
+DIST_SOURCES =
+DIST_COMMON = ChangeLog Makefile.am Makefile.in
SOURCES = $(nodist_grcat_SOURCES) $(nodist_pwcat_SOURCES)
-OBJECTS = $(nodist_grcat_OBJECTS) $(nodist_pwcat_OBJECTS)
-
-all: all-redirect
-.SUFFIXES:
-.SUFFIXES: .c .o
-$(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_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-mostlyclean-libexecPROGRAMS:
-
-clean-libexecPROGRAMS:
- -test -z "$(libexec_PROGRAMS)" || rm -f $(libexec_PROGRAMS)
-
-distclean-libexecPROGRAMS:
-
-maintainer-clean-libexecPROGRAMS:
+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 \
- if test -f $$p; then \
- f="`echo $$p|sed -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \
- echo " $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libexecdir)/$$f"; \
- $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libexecdir)/$$f; \
+ 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 -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f $(DESTDIR)$(libexecdir)/$$f"; \
rm -f $(DESTDIR)$(libexecdir)/$$f; \
done
-mostlyclean-compile:
- -rm -f *.o core *.core
-
-clean-compile:
-
-distclean-compile:
- -rm -f *.tab.c
-
-maintainer-clean-compile:
-
+clean-libexecPROGRAMS:
+ -test -z "$(libexec_PROGRAMS)" || rm -f $(libexec_PROGRAMS)
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@@ -238,6 +222,32 @@ uninstall-binSCRIPTS:
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)
@@ -262,41 +272,26 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
-mostlyclean-tags:
-
-clean-tags:
+GTAGS:
+ here=`CDPATH=: && cd $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-@AMDEP@include $(DEPDIR)/grcat.Po
-@AMDEP@include $(DEPDIR)/pwcat.Po
-
-mostlyclean-depend:
-
-clean-depend:
-
-distclean-depend:
- -rm -rf $(DEPDIR)
-
-maintainer-clean-depend:
-
-@AMDEP@CCDEPMODE = @CCDEPMODE@
-
-.c.o:
-@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
- d=$(srcdir); \
+ 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; \
@@ -306,84 +301,87 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-exec-am: install-libexecPROGRAMS install-binSCRIPTS
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
-install-exec: install-exec-am
+all-am: Makefile $(PROGRAMS) $(SCRIPTS)
-install-data-am:
-install-data: install-data-am
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(bindir)
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
-uninstall-am: uninstall-libexecPROGRAMS uninstall-binSCRIPTS \
- uninstall-local
+install-exec: install-exec-am
+install-data: install-data-am
uninstall: uninstall-am
-all-am: Makefile $(PROGRAMS) $(SCRIPTS)
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(bindir)
+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)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
maintainer-clean-generic:
- -rm -f Makefile.in
-mostlyclean-am: mostlyclean-libexecPROGRAMS mostlyclean-compile \
- mostlyclean-tags mostlyclean-depend mostlyclean-generic
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
-mostlyclean: mostlyclean-am
+clean-am: clean-generic clean-libexecPROGRAMS clean-local mostlyclean-am
-clean-am: clean-libexecPROGRAMS clean-compile clean-tags clean-depend \
- clean-generic mostlyclean-am clean-local
+distclean: distclean-am
-clean: clean-am
+distclean-am: clean-am distclean-compile distclean-depend \
+ distclean-generic distclean-tags
-distclean-am: distclean-libexecPROGRAMS distclean-compile \
- distclean-tags distclean-depend distclean-generic \
- clean-am
+dvi: dvi-am
-distclean: distclean-am
+dvi-am:
-maintainer-clean-am: maintainer-clean-libexecPROGRAMS \
- maintainer-clean-compile maintainer-clean-tags \
- maintainer-clean-depend maintainer-clean-generic \
- distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+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
-.PHONY: mostlyclean-libexecPROGRAMS distclean-libexecPROGRAMS \
-clean-libexecPROGRAMS maintainer-clean-libexecPROGRAMS \
-uninstall-libexecPROGRAMS install-libexecPROGRAMS mostlyclean-compile \
-distclean-compile clean-compile maintainer-clean-compile \
-uninstall-binSCRIPTS install-binSCRIPTS tags mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags mostlyclean-depend \
-distclean-depend clean-depend maintainer-clean-depend distdir info-am \
-info dvi-am dvi check check-am installcheck-am installcheck \
-install-exec-am install-exec install-data-am install-data install-am \
-install uninstall-local uninstall-am uninstall all-redirect all-am all \
-install-strip installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+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)
@@ -401,7 +399,7 @@ uninstall-local:
rm -f $(DESTDIR)$(bindir)/igawk
clean-local:
- rm -f $(AUXAWK) igawk
+ rm -f $(AUXAWK) igawk *.exe
stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi
rm -fr eg stamp-eg
@@ -409,10 +407,10 @@ stamp-eg: $(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: $(srcdir)/eg/lib/pwcat.c
+pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c
$(CC) $(CFLAGS) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@
-grcat: $(srcdir)/eg/lib/grcat.c
+grcat$(EXEEXT): $(srcdir)/eg/lib/grcat.c
$(CC) $(CFLAGS) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@
igawk: $(srcdir)/eg/prog/igawk.sh
@@ -425,7 +423,6 @@ passwd.awk: $(srcdir)/eg/lib/passwdawk.in
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 --git a/awklib/eg/lib/getopt.awk b/awklib/eg/lib/getopt.awk
index 93753052..4f2686d6 100644
--- a/awklib/eg/lib/getopt.awk
+++ b/awklib/eg/lib/getopt.awk
@@ -6,7 +6,7 @@
# Revised: May, 1993
# External variables:
-# Optind -- index in ARGV of first non-option argument
+# 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
diff --git a/awklib/eg/lib/grcat.c b/awklib/eg/lib/grcat.c
index d34ddd56..802aa639 100644
--- a/awklib/eg/lib/grcat.c
+++ b/awklib/eg/lib/grcat.c
@@ -8,6 +8,14 @@
* Public Domain
*/
+/* For OS/2, do nothing. */
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifndef HAVE_GETPGRENT
+int main() { exit(0); }
+#else
#include <stdio.h>
#include <grp.h>
@@ -32,3 +40,4 @@ char **argv;
endgrent();
exit(0);
}
+#endif /* HAVE_GETPGRENT */
diff --git a/awklib/eg/lib/libintl.awk b/awklib/eg/lib/libintl.awk
index a9402c2a..7efd2b47 100644
--- a/awklib/eg/lib/libintl.awk
+++ b/awklib/eg/lib/libintl.awk
@@ -7,3 +7,8 @@ function dcgettext(string, domain, category)
{
return string
}
+
+function dcngettext(string1, string2, number, domain, category)
+{
+ return (number == 1 ? string1 : string2)
+}
diff --git a/awklib/eg/lib/round.awk b/awklib/eg/lib/round.awk
index bf16c2b6..55ef7dc2 100644
--- a/awklib/eg/lib/round.awk
+++ b/awklib/eg/lib/round.awk
@@ -1,4 +1,4 @@
-# round --- do normal rounding
+# round.awk --- do normal rounding
#
# Arnold Robbins, arnold@gnu.org, Public Domain
# August, 1996
diff --git a/awklib/eg/prog/wordfreq.awk b/awklib/eg/prog/wordfreq.awk
index 62db5cfa..f364c752 100644
--- a/awklib/eg/prog/wordfreq.awk
+++ b/awklib/eg/prog/wordfreq.awk
@@ -13,7 +13,7 @@ END {
printf "%s\t%d\n", word, freq[word]
}
END {
- sort = "sort +1 -nr"
+ sort = "sort -k 2nr"
for (word in freq)
printf "%s\t%d\n", word, freq[word] | sort
close(sort)
diff --git a/builtin.c b/builtin.c
index 10f8b49f..f9cb44c9 100644
--- a/builtin.c
+++ b/builtin.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc.
+ * 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,6 +204,71 @@ do_fflush(NODE *tree)
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 = <mb1(1)>, <mb1(2)>, a, b, <mb2(1)>, <mb2(2)>, <mb2(3)>, 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,6 +278,14 @@ do_index(NODE *tree)
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,11 +304,38 @@ do_index(NODE *tree)
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,6 +343,9 @@ do_index(NODE *tree)
}
l1--;
p1++;
+#ifdef MBS_SUPPORT
+ }
+#endif
}
} else {
while (l1 > 0) {
@@ -253,10 +356,27 @@ do_index(NODE *tree)
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,7 +480,7 @@ format_tree(
/* copy one byte from 's' to 'obufout' checking for space in the process */
#define bchunk_one(s) { \
- if (ofre <= 0) { \
+ if (ofre < 1) { \
long olen = obufout - obuf; \
erealloc(obuf, char *, osiz * 2, "format_tree"); \
ofre += osiz; \
@@ -945,14 +1065,14 @@ check_pos:
if (toofew)
fatal("%s\n\t`%s'\n\t%*s%s",
_("not enough arguments to satisfy format string"),
- fmt_string, s1 - fmt_string - 2, "",
+ 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 (carg != NULL)
+ if (cur_arg < num_args)
lintwarn(
_("too many arguments supplied for format string"));
}
@@ -1140,7 +1260,7 @@ do_strftime(NODE *tree)
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"));
+ lintwarn(_("strftime: received non-string first argument"));
t1 = force_string(tmp);
format = t1->stptr;
formatlen = t1->stlen;
@@ -1155,7 +1275,7 @@ do_strftime(NODE *tree)
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"));
+ lintwarn(_("strftime: received non-numeric second argument"));
fclock = (time_t) force_number(t2);
free_temp(t2);
}
@@ -1263,7 +1383,7 @@ do_system(NODE *tree)
(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"));
+ lintwarn(_("system: received non-string argument"));
cmd = force_string(tmp)->stptr;
if (cmd && *cmd) {
@@ -1380,14 +1500,42 @@ do_tolower(NODE *tree)
{
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: recieved non-string argument"));
+ 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,14 +1549,42 @@ do_toupper(NODE *tree)
{
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: recieved non-string argument"));
+ 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,6 +1845,9 @@ sub_common(NODE *tree, int how_many, int backdigs)
int global = (how_many == -1);
long current;
int lastmatchnonzero;
+#ifdef MBS_SUPPORT
+ char *mb_indices;
+#endif
tmp = tree->lnode;
rp = re_update(tmp);
@@ -1712,8 +1891,28 @@ sub_common(NODE *tree, int how_many, int backdigs)
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,10 +1982,22 @@ sub_common(NODE *tree, int how_many, int backdigs)
* 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,6 +2083,10 @@ sub_common(NODE *tree, int how_many, int backdigs)
(*after_assign)();
t->flags &= ~(NUM|NUMBER);
}
+#ifdef MBS_SUPPORT
+ if (mb_indices != NULL)
+ free(mb_indices);
+#endif
return tmp_number((AWKNUM) matches);
}
@@ -2250,9 +2465,7 @@ do_strtonum(NODE *tree)
tmp = tree_eval(tree->lnode);
- if ((tmp->flags & (NUM|NUMBER)) != 0)
- d = (double) force_number(tmp);
- else if (isnondecimal(tmp->stptr))
+ if (isnondecimal(tmp->stptr))
d = nondec2awknum(tmp->stptr, tmp->stlen);
else
d = (double) force_number(tmp);
@@ -2278,7 +2491,12 @@ nondec2awknum(char *str, size_t len)
char *start = str;
if (*str == '0' && (str[1] == 'x' || str[1] == 'X')) {
- assert(len > 2);
+ /*
+ * 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,25 +2554,13 @@ done:
return retval;
}
-/* do_dcgettext --- handle i18n translations */
+/* do_dcgettext, do_dcngettext --- handle i18n translations */
-/*
- * awk usage is
- *
- * str = dcgettext(string [, domain [, category]])
- *
- * Default domain is TEXTDOMAIN, default category is LC_MESSAGES.
- */
+#if ENABLE_NLS && HAVE_LC_MESSAGES && HAVE_DCGETTEXT
-NODE *
-do_dcgettext(NODE *tree)
+static int
+localecategory_from_argument(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;
@@ -2384,27 +2590,13 @@ do_dcgettext(NODE *tree)
{ 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;
+ NODE *tmp, *t;
+ char *category;
+ int lc_cat = -1;
- tree = tree->rnode;
tmp = tree->lnode;
t = force_string(tree_eval(tmp));
category = t->stptr;
@@ -2429,6 +2621,49 @@ do_dcgettext(NODE *tree)
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,6 +2678,56 @@ do_dcgettext(NODE *tree)
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,7 +2767,7 @@ do_bindtextdomain(NODE *tree)
free_temp(t1);
if (t2 != NULL)
- free_temp(t1);
+ free_temp(t2);
return tmp_string(the_result, strlen(the_result));
}
diff --git a/config.guess b/config.guess
new file mode 100755
index 00000000..ed2e03b7
--- /dev/null
+++ b/config.guess
@@ -0,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 <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. 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 <config-patches@gnu.org>."
+
+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 <<EOF >$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 <stdio.h> /* 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 <sys/systemcfg.h>
+
+ 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 <stdlib.h>
+ #include <unistd.h>
+
+ 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 <unistd.h>
+ 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 <features.h>
+ #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' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/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 <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # 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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+ 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 <sys/param.h>
+# 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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config.rpath b/config.rpath
new file mode 100755
index 00000000..5ead7586
--- /dev/null
+++ b/config.rpath
@@ -0,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 <gord@gnu.ai.mit.edu>, 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 <kc5tja@dolphin.openprojects.net> 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=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec="$escaped_sys_lib_search_path_spec"
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec="$escaped_sys_lib_dlsearch_path_spec"
+
+EOF
diff --git a/config.sub b/config.sub
new file mode 100755
index 00000000..299f3f4c
--- /dev/null
+++ b/config.sub
@@ -0,0 +1,1443 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002 Free Software Foundation, Inc.
+
+timestamp='2002-04-26'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Please send patches to <config-patches@gnu.org>. 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 <config-patches@gnu.org>."
+
+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 --git a/configh.in b/configh.in
index 8c8a517c..24fbe31f 100644
--- a/configh.in
+++ b/configh.in
@@ -142,6 +142,8 @@
#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,24 +157,54 @@
/* 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 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,9 +244,15 @@
/* 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,6 +295,9 @@
/* Define if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
+/* Define if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
@@ -272,17 +313,23 @@
/* Define if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
+/* Define if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
+/* Define if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define if you have the i library (-li). */
-#undef HAVE_LIBI
+/* Define if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
-/* Define if you have the intl library (-lintl). */
-#undef HAVE_LIBINTL
+/* Define if you have the <wctype.h> header file. */
+#undef HAVE_WCTYPE_H
/* Define if you have the m library (-lm). */
#undef HAVE_LIBM
@@ -302,20 +349,27 @@
/* Define if compiler has function prototypes */
#undef PROTOTYPES
-/* Define to 1 if you have the stpcpy function. */
-#undef HAVE_STPCPY
+/* 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 your locale.h file contains LC_MESSAGES. */
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
+
+/* Define if your <locale.h> file defines LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
-/* Define to 1 if NLS is requested. */
+/* Define to 1 if translation of program messages to the user's native language
+ is requested. */
#undef ENABLE_NLS
-/* Define to 1 if you have gettext and don't want to use GNU gettext. */
+/* Define if the GNU gettext() function is already present or preinstalled. */
#undef HAVE_GETTEXT
-/* Define as 1 if you have catgets and don't want to use GNU gettext. */
-#undef HAVE_CATGETS
+/* Define if the GNU dcgettext() function is already present or preinstalled. */
+#undef HAVE_DCGETTEXT
#include <custom.h> /* overrides for stuff autoconf can't deal with */
diff --git a/configure b/configure
index e4ef6d7c..d0122909 100755
--- a/configure
+++ b/configure
@@ -17,13 +17,21 @@ ac_help="$ac_help
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-catgets use catgets functions if available"
+ --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
@@ -533,6 +541,102 @@ 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 </dev/null | egrep '(GNU|with BFD)' 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=
@@ -554,6 +658,10 @@ 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:
@@ -566,7 +674,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# 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:570: checking for a BSD compatible install" >&5
+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
@@ -619,23 +727,24 @@ 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:623: checking whether build environment is sane" >&5
+echo "configure:731: checking whether build environment is sane" >&5
# Just in case
sleep 1
-echo timestamp > conftestfile
+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 conftestfile 2> /dev/null`
+ 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 conftestfile`
+ set X `ls -t $srcdir/configure conftest.file`
fi
- if test "$*" != "X $srcdir/configure conftestfile" \
- && test "$*" != "X conftestfile $srcdir/configure"; then
+ 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
@@ -645,7 +754,7 @@ if (
alias in your environment" 1>&2; exit 1; }
fi
- test "$2" = conftestfile
+ test "$2" = conftest.file
)
then
# Ok.
@@ -654,7 +763,6 @@ else
{ echo "configure: error: newly created file is older than distributed files!
Check your system clock" 1>&2; exit 1; }
fi
-rm -f conftest*
echo "$ac_t""yes" 1>&6
if test "$program_transform_name" = s,x,x,; then
program_transform_name=
@@ -675,11 +783,9 @@ test "$program_suffix" != NONE &&
# 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} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
-if eval "$MISSING --run :"; then
+if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
@@ -692,7 +798,7 @@ 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:696: checking for $ac_word" >&5
+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
@@ -722,7 +828,7 @@ test -n "$AWK" && break
done
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:726: checking whether ${MAKE-make} sets \${MAKE}" >&5
+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
@@ -748,50 +854,49 @@ else
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
- AMDEP="#"
-else
+if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
- if test ! -f "$am_depcomp"; then
- AMDEP="#"
- else
- AMDEP=
- fi
+ AMDEPBACKSLASH='\'
fi
-if test -z "$AMDEP"; then
- AMDEPBACKSLASH='\'
+
+if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
else
- AMDEPBACKSLASH=
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
fi
-
-if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
+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; }
+ { 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.0
+VERSION=3.1.1
cat >> confdefs.h <<EOF
#define PACKAGE "$PACKAGE"
EOF
@@ -801,39 +906,40 @@ cat >> confdefs.h <<EOF
EOF
-# Some tools Automake needs.
+# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
+# the ones we care about.
+# Autoconf 2.50 always computes EXEEXT. However we need to be
+# compatible with 2.13, for now. So we always define EXEEXT, but we
+# don't compute it.
+
+# Similar for OBJEXT -- only we only use OBJEXT if the user actually
+# requests that it be used. This is a bit dumb.
+: ${OBJEXT=o}
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"}
+# Some tools Automake needs.
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"}
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake"}
-
AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
AMTAR=${AMTAR-"${am_missing_run}tar"}
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
-
-if test -z "$install_sh"; then
- install_sh="$ac_aux_dir/install-sh"
- test -f "$install_sh" || install_sh="$ac_aux_dir/install.sh"
- test -f "$install_sh" || install_sh="${am_missing_run}${ac_auxdir}/install-sh"
- install_sh="`echo $install_sh | sed -e 's/\${SHELL}//'`"
-fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
@@ -851,13 +957,26 @@ 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:861: checking for $ac_word" >&5
+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
@@ -888,7 +1007,7 @@ done
test -n "$YACC" || YACC="yacc"
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:892: checking whether ln -s works" >&5
+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
@@ -911,7 +1030,7 @@ 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:915: checking for $ac_word" >&5
+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
@@ -941,7 +1060,7 @@ 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:945: checking for $ac_word" >&5
+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
@@ -992,7 +1111,7 @@ fi
# 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:996: checking for $ac_word" >&5
+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
@@ -1024,7 +1143,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1028: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+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.
@@ -1035,12 +1154,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 1039 "configure"
+#line 1158 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -1066,12 +1185,12 @@ 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:1070: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+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:1075: checking whether we are using GNU C" >&5
+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
@@ -1080,7 +1199,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1084: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1099,7 +1218,7 @@ 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:1103: checking whether ${CC-cc} accepts -g" >&5
+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
@@ -1131,107 +1250,76 @@ else
fi
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1136: 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 <<EOF
-#line 1151 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1157: \"$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 <<EOF
-#line 1168 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1174: \"$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 <<EOF
-#line 1185 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1191: \"$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"
+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""$CPP" 1>&6
-
+echo "$ac_t""$_am_result" 1>&6
+rm -f confinc confmf
+depcc="$CC" am_compiler_list=
-
-depcc="$CC"
-depcpp="$CPP"
echo $ac_n "checking dependency style of $depcc""... $ac_c" 1>&6
-echo "configure:1224: checking dependency style of $depcc" >&5
+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"; then
- echo '#include "conftest.h"' > conftest.c
- echo 'int i;' > conftest.h
+ 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
- for depmode in `sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_depcomp"`; do
- case "$depmode" in
+ 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
@@ -1246,17 +1334,19 @@ if test -z "$AMDEP"; then
# 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" \
+ if depmode=$depmode \
source=conftest.c object=conftest.o \
depfile=conftest.Po tmpdepfile=conftest.TPo \
- $SHELL $am_depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
- grep conftest.h conftest.Po > /dev/null 2>&1; then
- am_cv_CC_dependencies_compiler_type="$depmode"
+ $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
- rm -f conftest.*
+ cd ..
+ rm -rf conftest.dir
else
am_cv_CC_dependencies_compiler_type=none
fi
@@ -1268,7 +1358,7 @@ CCDEPMODE="depmode=$am_cv_CC_dependencies_compiler_type"
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1272: checking how to run the C preprocessor" >&5
+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=
@@ -1283,13 +1373,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1287 "configure"
+#line 1377 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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
:
@@ -1300,13 +1390,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1304 "configure"
+#line 1394 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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
:
@@ -1317,13 +1407,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1321 "configure"
+#line 1411 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1327: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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
:
@@ -1350,7 +1440,7 @@ 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:1354: checking for $ac_word" >&5
+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
@@ -1400,7 +1490,7 @@ fi
# 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:1404: checking for a BSD compatible install" >&5
+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
@@ -1454,7 +1544,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1458: checking whether ${MAKE-make} sets \${MAKE}" >&5
+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
@@ -1484,7 +1574,7 @@ 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:1488: checking for special development options" >&5
+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
@@ -1502,9 +1592,9 @@ fi
echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:1506: checking for AIX" >&5
+echo "configure:1596: checking for AIX" >&5
cat > conftest.$ac_ext <<EOF
-#line 1508 "configure"
+#line 1598 "configure"
#include "confdefs.h"
#ifdef _AIX
yes
@@ -1525,40 +1615,62 @@ fi
rm -f conftest*
-echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:1530: checking for POSIXized ISC" >&5
-if test -d /etc/conf/kconfig.d &&
- grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
-then
- echo "$ac_t""yes" 1>&6
- ISC=yes # If later tests want to check for ISC.
- cat >> confdefs.h <<\EOF
-#define _POSIX_SOURCE 1
+
+ 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 <<EOF
+#line 1629 "configure"
+#include "confdefs.h"
+/* 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 strerror();
+
+int main() {
+strerror()
+; return 0; }
EOF
+if { (eval echo configure:1640: \"$ac_link\") 1>&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"
- if test "$GCC" = yes; then
- CC="$CC -posix"
- else
- CC="$CC -Xp"
- fi
+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
- ISC=
fi
+
+
ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:1552: checking for minix/config.h" >&5
+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
-#line 1557 "configure"
+#line 1669 "configure"
#include "confdefs.h"
#include <minix/config.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1562: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
@@ -1605,7 +1717,7 @@ 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:1609: checking for special C compiler options needed for large files" >&5
+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
@@ -1614,7 +1726,7 @@ else
# 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 <<EOF
-#line 1618 "configure"
+#line 1730 "configure"
#include "confdefs.h"
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
@@ -1630,7 +1742,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
:
else
echo "configure: failed program was:" >&5
@@ -1639,7 +1751,7 @@ else
ac_save_CC="$CC"
CC="$CC -n32"
cat > conftest.$ac_ext <<EOF
-#line 1643 "configure"
+#line 1755 "configure"
#include "confdefs.h"
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
@@ -1655,7 +1767,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1659: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+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
@@ -1675,13 +1787,13 @@ echo "$ac_t""$ac_cv_sys_largefile_CC" 1>&6
fi
echo $ac_n "checking for _FILE_OFFSET_BITS value needed for large files""... $ac_c" 1>&6
-echo "configure:1679: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+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 <<EOF
-#line 1685 "configure"
+#line 1797 "configure"
#include "confdefs.h"
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
@@ -1697,14 +1809,14 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+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 <<EOF
-#line 1708 "configure"
+#line 1820 "configure"
#include "confdefs.h"
#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
@@ -1722,7 +1834,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1726: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+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
@@ -1742,13 +1854,13 @@ EOF
fi
echo $ac_n "checking for _LARGE_FILES value needed for large files""... $ac_c" 1>&6
-echo "configure:1746: checking for _LARGE_FILES value needed for large files" >&5
+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 <<EOF
-#line 1752 "configure"
+#line 1864 "configure"
#include "confdefs.h"
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
@@ -1764,14 +1876,14 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1768: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+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 <<EOF
-#line 1775 "configure"
+#line 1887 "configure"
#include "confdefs.h"
#define _LARGE_FILES 1
#include <sys/types.h>
@@ -1789,7 +1901,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+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
@@ -1812,7 +1924,7 @@ EOF
echo $ac_n "checking for AIX compilation hacks""... $ac_c" 1>&6
-echo "configure:1816: checking for AIX compilation hacks" >&5
+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
@@ -1830,7 +1942,7 @@ echo "$ac_t""${gawk_cv_aix_hack}" 1>&6
echo $ac_n "checking for Linux/Alpha compilation hacks""... $ac_c" 1>&6
-echo "configure:1834: checking for Linux/Alpha compilation hacks" >&5
+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
@@ -1863,7 +1975,7 @@ fi
echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:1867: checking for ${CC-cc} option to accept ANSI C" >&5
+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
@@ -1880,7 +1992,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIO
do
CC="$ac_save_CC $ac_arg"
cat > conftest.$ac_ext <<EOF
-#line 1884 "configure"
+#line 1996 "configure"
#include "confdefs.h"
#include <stdarg.h>
#include <stdio.h>
@@ -1917,7 +2029,7 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
; return 0; }
EOF
-if { (eval echo configure:1921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+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
@@ -1943,7 +2055,7 @@ esac
echo $ac_n "checking for function prototypes""... $ac_c" 1>&6
-echo "configure:1947: checking for function prototypes" >&5
+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
@@ -1954,14 +2066,15 @@ EOF
else
echo "$ac_t""no" 1>&6
U=_ ANSI2KNR=./ansi2knr
- # Ensure some checks needed by ansi2knr itself.
- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1960: checking for ANSI C header files" >&5
+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 <<EOF
-#line 1965 "configure"
+#line 2078 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1969,7 +2082,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1973: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
@@ -1986,7 +2099,7 @@ 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
-#line 1990 "configure"
+#line 2103 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2004,7 +2117,7 @@ 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
-#line 2008 "configure"
+#line 2121 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2025,7 +2138,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2029 "configure"
+#line 2142 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2036,7 +2149,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+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
@@ -2059,21 +2172,21 @@ EOF
fi
- for ac_hdr in string.h
+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:2067: checking for $ac_hdr" >&5
+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
-#line 2072 "configure"
+#line 2185 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
@@ -2099,17 +2212,94 @@ else
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
-ALL_LINGUAS="he"
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2108: checking for working const" >&5
+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 <<EOF
-#line 2113 "configure"
+#line 2303 "configure"
#include "confdefs.h"
int main() {
@@ -2158,7 +2348,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:2162: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -2179,21 +2369,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2183: checking for inline" >&5
+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 <<EOF
-#line 2190 "configure"
+#line 2380 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:2197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2387: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -2219,12 +2409,12 @@ EOF
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2223: checking for off_t" >&5
+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 <<EOF
-#line 2228 "configure"
+#line 2418 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2252,12 +2442,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2256: checking for size_t" >&5
+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 <<EOF
-#line 2261 "configure"
+#line 2451 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2287,19 +2477,19 @@ 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:2291: checking for working alloca.h" >&5
+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 <<EOF
-#line 2296 "configure"
+#line 2486 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:2303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -2320,12 +2510,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2324: checking for alloca" >&5
+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 <<EOF
-#line 2329 "configure"
+#line 2519 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -2353,7 +2543,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:2357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -2385,12 +2575,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2389: checking whether alloca needs Cray hooks" >&5
+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 <<EOF
-#line 2394 "configure"
+#line 2584 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -2415,12 +2605,12 @@ 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:2419: checking for $ac_func" >&5
+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 <<EOF
-#line 2424 "configure"
+#line 2614 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2443,7 +2633,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -2470,7 +2660,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2474: checking stack direction for C alloca" >&5
+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
@@ -2478,7 +2668,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 2482 "configure"
+#line 2672 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -2497,7 +2687,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:2501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+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
@@ -2518,21 +2708,21 @@ EOF
fi
-for ac_hdr in unistd.h
+for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2526: checking for $ac_hdr" >&5
+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
-#line 2531 "configure"
+#line 2721 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
@@ -2561,12 +2751,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2565: checking for $ac_func" >&5
+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 <<EOF
-#line 2570 "configure"
+#line 2760 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2589,7 +2779,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -2614,7 +2804,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2618: checking for working mmap" >&5
+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
@@ -2622,7 +2812,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 2626 "configure"
+#line 2816 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2650,11 +2840,24 @@ else
#include <fcntl.h>
#include <sys/mman.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-# include <unistd.h>
-# endif
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
@@ -2762,7 +2965,7 @@ main()
}
EOF
-if { (eval echo configure:2766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+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
@@ -2784,395 +2987,531 @@ EOF
fi
-
- for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.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:2794: 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
-#line 2799 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2804: \"$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 <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
- for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
-strdup __argz_count __argz_stringify __argz_next
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2834: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ 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 <<EOF
-#line 2839 "configure"
+#line 2998 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* 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();
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
+ Lucky GNU user
+ #endif
#endif
-
-; return 0; }
+
EOF
-if { (eval echo configure:2862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "Lucky GNU user" >/dev/null 2>&1; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ ac_cv_gnu_library_2_1=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ ac_cv_gnu_library_2_1=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 <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
+
+
fi
-done
+echo "$ac_t""$ac_cv_gnu_library_2_1" 1>&6
+
+ GLIBC21="$ac_cv_gnu_library_2_1"
+
- if test "${ac_cv_func_stpcpy+set}" != "set"; then
- for ac_func in stpcpy
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2891: 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 <<EOF
-#line 2896 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* 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:2919: \"$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 <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
+
+
+ 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"
- fi
- if test "${ac_cv_func_stpcpy}" = "yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_STPCPY 1
-EOF
+ # 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"
- fi
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/lib"
+ fi
+ fi
- if test $ac_cv_header_locale_h = yes; then
- echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2953: 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 <<EOF
-#line 2958 "configure"
-#include "confdefs.h"
-#include <locale.h>
-int main() {
-return LC_MESSAGES
-; return 0; }
-EOF
-if { (eval echo configure:2965: \"$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
-
+ 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
- echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2986: 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
-
-
- USE_INCLUDED_LIBINTL=no
-
- if test "$USE_NLS" = "yes"; then
- cat >> confdefs.h <<\EOF
-#define ENABLE_NLS 1
-EOF
+ if test "X$ltrpathdirs" != "X"; then
+ for found_dir in $ltrpathdirs; do
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir"
+ done
+ fi
- echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3006: 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
+ 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
- nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
- if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
- nls_cv_header_intl=
- nls_cv_header_libgt=
- CATOBJEXT=NONE
- ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:3025: checking for libintl.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ 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
- cat > conftest.$ac_ext <<EOF
-#line 3030 "configure"
-#include "confdefs.h"
-#include <libintl.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3035: \"$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 gettext in libc""... $ac_c" 1>&6
-echo "configure:3052: checking for gettext in libc" >&5
-if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 3057 "configure"
+
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ cat > conftest.$ac_ext <<EOF
+#line 3444 "configure"
#include "confdefs.h"
-#include <libintl.h>
+#include <stdlib.h>
+#include <iconv.h>
int main() {
-return (int) gettext ("")
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:3064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- gt_cv_func_gettext_libc=yes
+ am_cv_func_iconv=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
- rm -rf conftest*
- gt_cv_func_gettext_libc=no
fi
rm -f conftest*
-fi
-
-echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
-
- if test "$gt_cv_func_gettext_libc" != "yes"; then
- echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:3080: checking for bindtextdomain in -lintl" >&5
-ac_lib_var=`echo intl'_'bindtextdomain | 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="-lintl $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3088 "configure"
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+ cat > conftest.$ac_ext <<EOF
+#line 3466 "configure"
#include "confdefs.h"
-/* 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 bindtextdomain();
-
+#include <stdlib.h>
+#include <iconv.h>
int main() {
-bindtextdomain()
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:3099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=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
- echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6
-echo "configure:3115: checking for gettext in -lintl" >&5
-ac_lib_var=`echo intl'_'gettext | 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="-lintl $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3123 "configure"
-#include "confdefs.h"
-/* 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 gettext();
-
-int main() {
-gettext()
-; return 0; }
-EOF
-if { (eval echo configure:3134: \"$ac_link\") 1>&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"
+ LIBS="$am_save_LIBS"
+ fi
+
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 intl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
+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
- LIBS="-lintl $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
- fi
+ 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
+
+
- if test "$gt_cv_func_gettext_libc" = "yes" \
- || test "$ac_cv_lib_intl_gettext" = "yes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_GETTEXT 1
-EOF
- # Extract the first word of "msgfmt", so it can be a program name with args.
+
+
+ # 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:3176: checking for $ac_word" >&5
+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
@@ -3185,83 +3524,29 @@ else
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
- if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; 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="no"
+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
;;
esac
fi
MSGFMT="$ac_cv_path_MSGFMT"
-if test -n "$MSGFMT"; then
+if test "$MSGFMT" != ":"; then
echo "$ac_t""$MSGFMT" 1>&6
else
echo "$ac_t""no" 1>&6
fi
- if test "$MSGFMT" != "no"; then
- for ac_func in dcgettext
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3210: 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 <<EOF
-#line 3215 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* 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:3238: \"$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 <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
- # Extract the first word of "gmsgfmt", so it can be a program name with args.
+ # 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:3265: checking for $ac_word" >&5
+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
@@ -3294,10 +3579,11 @@ else
echo "$ac_t""no" 1>&6
fi
- # Extract the first word of "xgettext", so it can be a program name with args.
+
+ # 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:3301: checking for $ac_word" >&5
+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
@@ -3310,7 +3596,8 @@ else
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
- if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; 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
@@ -3322,596 +3609,1009 @@ else
esac
fi
XGETTEXT="$ac_cv_path_XGETTEXT"
-if test -n "$XGETTEXT"; then
+if test "$XGETTEXT" != ":"; then
echo "$ac_t""$XGETTEXT" 1>&6
else
echo "$ac_t""no" 1>&6
fi
- cat > conftest.$ac_ext <<EOF
-#line 3333 "configure"
-#include "confdefs.h"
+ rm -f messages.po
-int main() {
-extern int _nl_msg_cat_cntr;
- return _nl_msg_cat_cntr
-; return 0; }
-EOF
-if { (eval echo configure:3341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- CATOBJEXT=.gmo
- DATADIRNAME=share
+ # 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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CATOBJEXT=.mo
- DATADIRNAME=lib
+ 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
-rm -f conftest*
- INSTOBJEXT=.mo
- fi
- 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 "$CATOBJEXT" = "NONE"; then
- echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6
-echo "configure:3364: checking whether catgets can be used" >&5
- # Check whether --with-catgets or --without-catgets was given.
-if test "${with_catgets+set}" = set; then
- withval="$with_catgets"
- nls_cv_use_catgets=$withval
-else
- nls_cv_use_catgets=no
-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
- echo "$ac_t""$nls_cv_use_catgets" 1>&6
+ 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
- if test "$nls_cv_use_catgets" = "yes"; then
- echo $ac_n "checking for main in -li""... $ac_c" 1>&6
-echo "configure:3377: checking for main in -li" >&5
-ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+
+
+
+ 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
- ac_save_LIBS="$LIBS"
-LIBS="-li $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3385 "configure"
+ cat > conftest.$ac_ext <<EOF
+#line 3692 "configure"
#include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
+#include <$ac_hdr>
EOF
-if { (eval echo configure:3392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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_lib_$ac_lib_var=yes"
+ 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_lib_$ac_lib_var=no"
+ eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
-LIBS="$ac_save_LIBS"
-
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo i | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
+#define $ac_tr_hdr 1
EOF
-
- LIBS="-li $LIBS"
-
+
else
echo "$ac_t""no" 1>&6
fi
+done
- echo $ac_n "checking for catgets""... $ac_c" 1>&6
-echo "configure:3420: checking for catgets" >&5
-if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then
+ 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 <<EOF
-#line 3425 "configure"
+#line 3733 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char catgets(); below. */
+ which can conflict with char $ac_func(); below. */
#include <assert.h>
/* 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 catgets();
+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_catgets) || defined (__stub___catgets)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-catgets();
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:3448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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_catgets=yes"
+ 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_catgets=no"
+ eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'catgets`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_CATGETS 1
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
EOF
-
- INTLOBJS="\$(CATOBJS)"
- # Extract the first word of "gencat", so it can be a program name with args.
-set dummy gencat; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3470: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$GENCAT" in
- /*)
- ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a path.
- ;;
- ?:/*)
- ac_cv_path_GENCAT="$GENCAT" # 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_GENCAT="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_GENCAT" && ac_cv_path_GENCAT="no"
- ;;
-esac
-fi
-GENCAT="$ac_cv_path_GENCAT"
-if test -n "$GENCAT"; then
- echo "$ac_t""$GENCAT" 1>&6
+
else
echo "$ac_t""no" 1>&6
fi
- if test "$GENCAT" != "no"; then
- # 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:3506: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
+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
- 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="no"
- ;;
-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
+
+ cat > conftest.$ac_ext <<EOF
+#line 3791 "configure"
+#include "confdefs.h"
- if test "$GMSGFMT" = "no"; then
- # 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:3543: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+#include <stdlib.h>
+#include <iconv.h>
+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
- case "$GMSGFMT" in
- /*)
- ac_cv_path_GMSGFMT="$GMSGFMT" # 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 test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
- ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
- break
- fi
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no"
- ;;
-esac
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_proto_iconv_arg1="const"
fi
-GMSGFMT="$ac_cv_path_GMSGFMT"
-if test -n "$GMSGFMT"; then
- echo "$ac_t""$GMSGFMT" 1>&6
-else
- echo "$ac_t""no" 1>&6
+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
- 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:3578: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
+ 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 <<EOF
+#define ICONV_CONST $am_cv_proto_iconv_arg1
+EOF
+
+ fi
+
+
+ echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&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
- 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 test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; 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 -n "$XGETTEXT"; then
- echo "$ac_t""$XGETTEXT" 1>&6
+ cat > conftest.$ac_ext <<EOF
+#line 3839 "configure"
+#include "confdefs.h"
+#include <langinfo.h>
+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 "$ac_t""no" 1>&6
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_langinfo_codeset=no
fi
-
- 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
-else
- echo "$ac_t""no" 1>&6
+rm -f conftest*
+
fi
- fi
- 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
- if (test "$gt_cv_func_gettext_libc" = "yes" \
- || test "$gt_cv_func_gettext_libintl" = "yes") \
- && test "$ac_cv_func_dcgettext" = no; then
- nls_cv_use_gnu_gettext=yes
- elif test "$CATOBJEXT" = "NONE"; then
- nls_cv_use_gnu_gettext=yes
- fi
- fi
+ fi
- if test "$nls_cv_use_gnu_gettext" = "yes"; then
- INTLOBJS="\$(GETTOBJS)"
- # Extract the first word of "msgfmt", so it can be a program name with args.
-set dummy msgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3640: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
+ 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
- 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 test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; 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="msgfmt"
- ;;
-esac
-fi
-MSGFMT="$ac_cv_path_MSGFMT"
-if test -n "$MSGFMT"; then
- echo "$ac_t""$MSGFMT" 1>&6
+ cat > conftest.$ac_ext <<EOF
+#line 3874 "configure"
+#include "confdefs.h"
+#include <locale.h>
+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 "$ac_t""no" 1>&6
+ 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
- # Extract the first word of "gmsgfmt", so it can be a program name with args.
-set dummy gmsgfmt; ac_word=$2
+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:3674: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
+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
- 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.
- ;;
- *)
+ 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
+ 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"
+ ac_cv_prog_INTLBISON="$ac_prog"
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
+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
- # 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:3710: 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 test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; 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 -n "$XGETTEXT"; then
- echo "$ac_t""$XGETTEXT" 1>&6
+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
- echo "$ac_t""no" 1>&6
+ USE_NLS=yes
fi
-
- 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
+ echo "$ac_t""$USE_NLS" 1>&6
+
- if test "$XGETTEXT" != ":"; then
- if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
- : ;
- else
- echo "$ac_t""found xgettext program is not GNU xgettext; ignore it" 1>&6
- XGETTEXT=":"
- fi
- fi
+
+ BUILD_INCLUDED_LIBINTL=no
+ USE_INCLUDED_LIBINTL=no
+
+ LIBINTL=
+ LTLIBINTL=
+ POSUB=
- # 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
+ 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 <<EOF
+#line 4016 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+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
- # 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
+echo "$ac_t""$gt_cv_func_gnugettext2_libc" 1>&6
- for lang in $ALL_LINGUAS; do
- GMOFILES="$GMOFILES $lang.gmo"
- POFILES="$POFILES $lang.po"
- done
+ 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"
- if test "x$CATOBJEXT" != "x"; then
- if test "x$ALL_LINGUAS" = "x"; then
- LINGUAS=
- else
- echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:3807: checking for catalogs to be installed" >&5
- NEW_LINGUAS=
- for lang in ${LINGUAS=$ALL_LINGUAS}; do
- case "$ALL_LINGUAS" in
- *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
- esac
- done
- LINGUAS=$NEW_LINGUAS
- echo "$ac_t""$LINGUAS" 1>&6
- fi
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/lib"
+ fi
+ fi
- if test -n "$LINGUAS"; then
- for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
- fi
- fi
+fi
- if test $ac_cv_header_locale_h = yes; then
- INCLUDE_LOCALE_H="#include <locale.h>"
- else
- INCLUDE_LOCALE_H="\
-/* The system does not provide the header <locale.h>. Take care yourself. */"
- 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
- test -d intl || mkdir intl
- if test "$CATOBJEXT" = ".cat"; then
- ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:3835: checking for linux/version.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ 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
- cat > conftest.$ac_ext <<EOF
-#line 3840 "configure"
+ gt_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $INCINTL"
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBINTL"
+ cat > conftest.$ac_ext <<EOF
+#line 4428 "configure"
#include "confdefs.h"
-#include <linux/version.h>
+#include <libintl.h>
+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
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3845: \"$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
+if { (eval echo configure:4442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+ gt_cv_func_gnugettext2_libintl=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"
+ gt_cv_func_gnugettext2_libintl=no
fi
rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- msgformat=linux
+ if test "$gt_cv_func_gnugettext2_libintl" != yes && test -n "$LIBICONV"; then
+ LIBS="$LIBS $LIBICONV"
+ cat > conftest.$ac_ext <<EOF
+#line 4455 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+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 "$ac_t""no" 1>&6
-msgformat=xopen
+ 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
- sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
- fi
- sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
- $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
-
- if test "$PACKAGE" = "gettext"; then
- GT_NO="#NO#"
- GT_YES=
- else
- GT_NO=
- GT_YES="#YES#"
- 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
- MKINSTALLDIRS=
- if test -n "$ac_aux_dir"; then
- MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
- fi
- if test -z "$MKINSTALLDIRS"; then
- MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
- fi
-
+
+ if test "$gt_use_preinstalled_gnugettext" != "yes"; then
+ nls_cv_use_gnu_gettext=yes
+ fi
+ fi
- l=
-
+ 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
+
- 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
+ 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:3910: checking for ANSI C header files" >&5
+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 <<EOF
-#line 3915 "configure"
+#line 4615 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -3919,7 +4619,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
@@ -3936,7 +4636,7 @@ 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
-#line 3940 "configure"
+#line 4640 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -3954,7 +4654,7 @@ 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
-#line 3958 "configure"
+#line 4658 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -3975,7 +4675,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 3979 "configure"
+#line 4679 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -3986,7 +4686,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:3990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+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
@@ -4010,12 +4710,12 @@ EOF
fi
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:4014: checking for sys/wait.h that is POSIX.1 compatible" >&5
+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 <<EOF
-#line 4019 "configure"
+#line 4719 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -4031,7 +4731,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:4035: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+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
@@ -4051,23 +4751,59 @@ 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 <<EOF
+#line 4761 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+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 unistd.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:4061: checking for $ac_hdr" >&5
+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
-#line 4066 "configure"
+#line 4802 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
@@ -4100,17 +4836,17 @@ then
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4104: checking for $ac_hdr" >&5
+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
-#line 4109 "configure"
+#line 4845 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
@@ -4141,17 +4877,17 @@ else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4145: checking for $ac_hdr" >&5
+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
-#line 4150 "configure"
+#line 4886 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4155: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
@@ -4180,12 +4916,12 @@ done
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:4184: checking for pid_t" >&5
+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 <<EOF
-#line 4189 "configure"
+#line 4925 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -4213,12 +4949,12 @@ EOF
fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:4217: checking return type of signal handlers" >&5
+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 <<EOF
-#line 4222 "configure"
+#line 4958 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -4235,7 +4971,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:4239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -4254,12 +4990,12 @@ EOF
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:4258: checking for size_t" >&5
+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 <<EOF
-#line 4263 "configure"
+#line 4999 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -4287,12 +5023,12 @@ EOF
fi
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:4291: checking for uid_t in sys/types.h" >&5
+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
-#line 4296 "configure"
+#line 5032 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -4321,7 +5057,7 @@ EOF
fi
echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:4325: checking type of array argument to getgroups" >&5
+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
@@ -4329,7 +5065,7 @@ else
ac_cv_type_getgroups=cross
else
cat > conftest.$ac_ext <<EOF
-#line 4333 "configure"
+#line 5069 "configure"
#include "confdefs.h"
/* Thanks to Mike Rendell for this test. */
@@ -4354,7 +5090,7 @@ main()
}
EOF
-if { (eval echo configure:4358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+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
@@ -4368,7 +5104,7 @@ fi
if test $ac_cv_type_getgroups = cross; then
cat > conftest.$ac_ext <<EOF
-#line 4372 "configure"
+#line 5108 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -4396,17 +5132,17 @@ EOF
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4400: checking for $ac_hdr" >&5
+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
-#line 4405 "configure"
+#line 5141 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
@@ -4433,12 +5169,12 @@ fi
done
echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:4437: checking for ssize_t" >&5
+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 <<EOF
-#line 4442 "configure"
+#line 5178 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -4468,7 +5204,7 @@ fi
cat > conftest.$ac_ext <<EOF
-#line 4472 "configure"
+#line 5208 "configure"
#include "confdefs.h"
#include <stdio.h>
EOF
@@ -4488,18 +5224,40 @@ EOF
fi
rm -f conftest*
+cat > conftest.$ac_ext <<EOF
+#line 5229 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+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:4498: checking for vprintf" >&5
+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 <<EOF
-#line 4503 "configure"
+#line 5261 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
@@ -4522,7 +5280,7 @@ vprintf();
; return 0; }
EOF
-if { (eval echo configure:4526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -4546,12 +5304,12 @@ fi
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:4550: checking for _doprnt" >&5
+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 <<EOF
-#line 4555 "configure"
+#line 5313 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
@@ -4574,7 +5332,7 @@ _doprnt();
; return 0; }
EOF
-if { (eval echo configure:4578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -4603,17 +5361,17 @@ 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:4607: checking for $ac_hdr" >&5
+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
-#line 4612 "configure"
+#line 5370 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
@@ -4642,12 +5400,12 @@ done
for ac_func in strtod
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4646: checking for $ac_func" >&5
+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 <<EOF
-#line 4651 "configure"
+#line 5409 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4670,7 +5428,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -4695,7 +5453,7 @@ fi
done
echo $ac_n "checking for strtod with C89 semantics""... $ac_c" 1>&6
-echo "configure:4699: checking for strtod with C89 semantics" >&5
+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
@@ -4703,7 +5461,7 @@ else
gawk_ac_cv_func_strtod_c89=no
else
cat > conftest.$ac_ext <<EOF
-#line 4707 "configure"
+#line 5465 "configure"
#include "confdefs.h"
/* Test program from Arnold Robbins (arnold@skeeve.com) */
#if HAVE_STDLIB_H
@@ -4726,9 +5484,10 @@ main ()
exit (0);
else
exit (1);
+#endif
}
EOF
-if { (eval echo configure:4732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+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
@@ -4750,56 +5509,21 @@ EOF
fi
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:4755: 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 <<EOF
-#line 4760 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-int main() {
-struct tm *tp;
-; return 0; }
-EOF
-if { (eval echo configure:4769: \"$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 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:4793: checking for $ac_hdr" >&5
+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
-#line 4798 "configure"
+#line 5522 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
@@ -4828,12 +5552,12 @@ done
for ac_func in alarm
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4832: checking for $ac_func" >&5
+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 <<EOF
-#line 4837 "configure"
+#line 5561 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4856,7 +5580,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -4881,7 +5605,7 @@ fi
done
echo $ac_n "checking for working mktime""... $ac_c" 1>&6
-echo "configure:4885: checking for working mktime" >&5
+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
@@ -4889,7 +5613,7 @@ else
ac_cv_func_working_mktime=no
else
cat > conftest.$ac_ext <<EOF
-#line 4893 "configure"
+#line 5617 "configure"
#include "confdefs.h"
/* Test program from Paul Eggert (eggert@twinsun.com)
and Tony Leneis (tony@plaza.ds.adp.com). */
@@ -5038,7 +5762,7 @@ main ()
exit (0);
}
EOF
-if { (eval echo configure:5042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+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
@@ -5066,7 +5790,7 @@ EOF
esac
echo $ac_n "checking for fmod in -lm""... $ac_c" 1>&6
-echo "configure:5070: checking for fmod in -lm" >&5
+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
@@ -5074,7 +5798,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5078 "configure"
+#line 5802 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5085,7 +5809,7 @@ int main() {
fmod()
; return 0; }
EOF
-if { (eval echo configure:5089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5112,16 +5836,16 @@ else
echo "$ac_t""no" 1>&6
fi
-for ac_func in memset memcpy memcmp fmod setlocale strchr strerror \
- strftime strncasecmp strtod system tzset
+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:5120: checking for $ac_func" >&5
+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 <<EOF
-#line 5125 "configure"
+#line 5849 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5144,7 +5868,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -5171,17 +5895,17 @@ done
ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
-echo "configure:5175: checking for dlfcn.h" >&5
+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
-#line 5180 "configure"
+#line 5904 "configure"
#include "confdefs.h"
#include <dlfcn.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (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*
@@ -5198,7 +5922,7 @@ 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:5202: checking for dlopen in -ldl" >&5
+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
@@ -5206,7 +5930,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5210 "configure"
+#line 5934 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5217,7 +5941,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:5221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5257,14 +5981,14 @@ fi
case `(uname) 2> /dev/null` in
-*VMS*|*BeOS*)
+*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:5268: checking whether getpgrp takes no argument" >&5
+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
@@ -5272,7 +5996,7 @@ else
{ echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 5276 "configure"
+#line 6000 "configure"
#include "confdefs.h"
/*
@@ -5327,7 +6051,7 @@ main()
}
EOF
-if { (eval echo configure:5331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+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
@@ -5379,12 +6103,12 @@ else
# 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:5383: checking for gethostbyname" >&5
+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 <<EOF
-#line 5388 "configure"
+#line 6112 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -5407,7 +6131,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:5411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -5428,7 +6152,7 @@ fi
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:5432: checking for gethostbyname in -lnsl" >&5
+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
@@ -5436,7 +6160,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5440 "configure"
+#line 6164 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5447,7 +6171,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:5451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5477,12 +6201,12 @@ fi
# -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:5481: checking for connect" >&5
+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 <<EOF
-#line 5486 "configure"
+#line 6210 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -5505,7 +6229,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:5509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -5526,7 +6250,7 @@ fi
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:5530: checking for connect in -lsocket" >&5
+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
@@ -5534,7 +6258,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $SOCKET_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5538 "configure"
+#line 6262 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5545,7 +6269,7 @@ int main() {
connect()
; return 0; }
EOF
-if { (eval echo configure:5549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5574,7 +6298,7 @@ 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:5578: checking where to find the socket library calls" >&5
+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" ;;
@@ -5589,12 +6313,12 @@ fi
echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:5593: checking for st_blksize in struct stat" >&5
+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 <<EOF
-#line 5598 "configure"
+#line 6322 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -5602,7 +6326,7 @@ int main() {
struct stat s; s.st_blksize;
; return 0; }
EOF
-if { (eval echo configure:5606: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+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
@@ -5623,12 +6347,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:5627: checking whether time.h and sys/time.h may both be included" >&5
+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 <<EOF
-#line 5632 "configure"
+#line 6356 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -5637,7 +6361,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:5641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -5658,12 +6382,12 @@ EOF
fi
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:5662: checking whether struct tm is in sys/time.h or time.h" >&5
+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 <<EOF
-#line 5667 "configure"
+#line 6391 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -5671,7 +6395,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:5675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+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
@@ -5692,12 +6416,12 @@ EOF
fi
echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:5696: checking for tm_zone in struct tm" >&5
+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 <<EOF
-#line 5701 "configure"
+#line 6425 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
@@ -5705,7 +6429,7 @@ int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
-if { (eval echo configure:5709: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+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
@@ -5725,12 +6449,12 @@ EOF
else
echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:5729: checking for tzname" >&5
+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 <<EOF
-#line 5734 "configure"
+#line 6458 "configure"
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI. */
@@ -5740,7 +6464,7 @@ int main() {
atoi(*tzname);
; return 0; }
EOF
-if { (eval echo configure:5744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+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
@@ -5763,14 +6487,14 @@ fi
echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
-echo "configure:5767: checking whether char is unsigned" >&5
+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 <<EOF
-#line 5774 "configure"
+#line 6498 "configure"
#include "confdefs.h"
#ifdef __CHAR_UNSIGNED__
yes
@@ -5792,7 +6516,7 @@ 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 <<EOF
-#line 5796 "configure"
+#line 6520 "configure"
#include "confdefs.h"
/* volatile prevents gcc2 from optimizing the test away on sparcs. */
#if !defined(__STDC__) || __STDC__ != 1
@@ -5802,7 +6526,7 @@ main() {
volatile char c = 255; exit(c < 0);
}
EOF
-if { (eval echo configure:5806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_char_unsigned=yes
else
@@ -5826,12 +6550,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:5830: checking for working const" >&5
+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 <<EOF
-#line 5835 "configure"
+#line 6559 "configure"
#include "confdefs.h"
int main() {
@@ -5880,7 +6604,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:5884: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -5901,21 +6625,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:5905: checking for inline" >&5
+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 <<EOF
-#line 5912 "configure"
+#line 6636 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:5919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -5943,12 +6667,12 @@ esac
echo $ac_n "checking for preprocessor stringizing operator""... $ac_c" 1>&6
-echo "configure:5947: checking for preprocessor stringizing operator" >&5
+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 <<EOF
-#line 5952 "configure"
+#line 6676 "configure"
#include "confdefs.h"
#define x(y) #y
@@ -5978,6 +6702,12 @@ 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
@@ -6121,6 +6851,8 @@ 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
@@ -6128,42 +6860,53 @@ 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@%$AMDEP%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%@CPP@%$CPP%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%@ALLOCA@%$ALLOCA%g
-s%@USE_NLS@%$USE_NLS%g
+s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
s%@MSGFMT@%$MSGFMT%g
s%@GMSGFMT@%$GMSGFMT%g
s%@XGETTEXT@%$XGETTEXT%g
-s%@GENCAT@%$GENCAT%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%@CATALOGS@%$CATALOGS%g
s%@CATOBJEXT@%$CATOBJEXT%g
+s%@INTLOBJS@%$INTLOBJS%g
s%@DATADIRNAME@%$DATADIRNAME%g
-s%@GMOFILES@%$GMOFILES%g
s%@INSTOBJEXT@%$INSTOBJEXT%g
-s%@INTLDEPS@%$INTLDEPS%g
+s%@GENCAT@%$GENCAT%g
+s%@INTL_LIBTOOL_SUFFIX_PREFIX@%$INTL_LIBTOOL_SUFFIX_PREFIX%g
s%@INTLLIBS@%$INTLLIBS%g
-s%@INTLOBJS@%$INTLOBJS%g
-s%@POFILES@%$POFILES%g
+s%@LIBINTL@%$LIBINTL%g
+s%@LTLIBINTL@%$LTLIBINTL%g
s%@POSUB@%$POSUB%g
-s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g
-s%@GT_NO@%$GT_NO%g
-s%@GT_YES@%$GT_YES%g
-s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
-s%@l@%$l%g
s%@SOCKET_LIBS@%$SOCKET_LIBS%g
+s%@PATH_SEPARATOR@%$PATH_SEPARATOR%g
CEOF
EOF
@@ -6377,70 +7120,41 @@ cat >> $CONFIG_STATUS <<\EOF
fi; done
EOF
-
cat >> $CONFIG_STATUS <<EOF
-ac_sources="$nls_cv_header_libgt"
-ac_dests="$nls_cv_header_intl"
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-srcdir=$ac_given_srcdir
-while test -n "$ac_sources"; do
- set $ac_dests; ac_dest=$1; shift; ac_dests=$*
- set $ac_sources; ac_source=$1; shift; ac_sources=$*
-
- echo "linking $srcdir/$ac_source to $ac_dest"
-
- if test ! -r $srcdir/$ac_source; then
- { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
- fi
- rm -f $ac_dest
-
- # Make relative symlinks.
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
- # The dest file is in a subdirectory.
- test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
- ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dest_dir_suffix.
- ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dest_dir_suffix= ac_dots=
- fi
-
- case "$srcdir" in
- [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
- *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
+am_indx=1
+for am_file in config.h:configh.in; 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
-
- # Make a symlink if possible; otherwise try a hard link.
- if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
- ln $srcdir/$ac_source $ac_dest; then :
- else
- { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
- fi
+ am_indx=\`expr \$am_indx + 1\`
done
-EOF
-cat >> $CONFIG_STATUS <<EOF
-am_indx=1
- for am_file in config.h:configh.in; do
- case " $CONFIG_HEADERS " in
- *" $am_file "*)
- echo timestamp > `echo $am_file | sed 's%:.*%%;s%[^/]*$%%'`stamp-h$am_indx
- ;;
- esac
- am_indx=\`expr \$am_indx + 1\`
- done
-AMDEP="$AMDEP"
+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" != x"" ||
+test x"$AMDEP_TRUE" != x"" ||
for mf in $CONFIG_FILES; do
case "$mf" in
Makefile) dirpart=.;;
@@ -6478,9 +7192,102 @@ for mf in $CONFIG_FILES; do
done
done
-case "$CONFIG_FILES" in *po/Makefile.in*)
- sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
+
+ 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
diff --git a/configure.in b/configure.in
index f3de8221..3f9ffb2a 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,7 @@
dnl
dnl configure.in --- autoconf input file for gawk
dnl
-dnl Copyright (C) 1995-2001 the Free Software Foundation, Inc.
+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,11 +25,17 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(awk.h)
AC_PREREQ(2.13)
-AM_INIT_AUTOMAKE(gawk, 3.1.0)
+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,15 +95,17 @@ dnl check for C compiler for automake
AM_PROG_CC_STDC
AM_C_PROTOTYPES
-ALL_LINGUAS="he"
-AM_GNU_GETTEXT
+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 unistd.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,6 +123,12 @@ GAWK_AC_TYPE_SSIZE_T
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 <sys/types.h>
+AC_TRY_COMPILE([#include <sys/types.h>],[
+ time_t foo;
+ foo = 0;
+],
+ AC_DEFINE(TIME_T_IN_SYS_TYPES_H))
dnl checks for functions
AC_DEFINE(REGEX_MALLOC)
@@ -128,8 +142,8 @@ yes) AC_DEFINE(HAVE_MKTIME)
esac
AC_CHECK_LIB(m, fmod)
-AC_CHECK_FUNCS(memset memcpy memcmp fmod setlocale strchr strerror \
- strftime strncasecmp strtod system tzset)
+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,9 +164,9 @@ AC_CHECK_HEADER(dlfcn.h,
dnl check for how to use getpgrp
dnl have to hardwire it for VMS POSIX. Sigh.
-dnl ditto for BeOS.
+dnl ditto for BeOS, OS/2, and MS-DOS.
case `(uname) 2> /dev/null` in
-*VMS*|*BeOS*)
+*VMS*|*BeOS*|*OS/2*|*MS-DOS*)
AC_DEFINE(GETPGRP_VOID)
;;
*) AC_FUNC_GETPGRP
@@ -174,6 +188,14 @@ AC_C_CONST
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 --git a/custom.h b/custom.h
index 75ceab28..5df5cfe1 100644
--- a/custom.h
+++ b/custom.h
@@ -11,7 +11,7 @@
*/
/*
- * Copyright (C) 1995-2001 the Free Software Foundation, Inc.
+ * Copyright (C) 1995-2002 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -85,3 +85,7 @@
#define HAVE_MKTIME 1
#endif
+/* For whiny users */
+#ifdef USE_INCLUDED_STRFTIME
+#undef HAVE_STRFTIME
+#endif
diff --git a/dfa.c b/dfa.c
index 97164127..77a6fb83 100644
--- a/dfa.c
+++ b/dfa.c
@@ -1,5 +1,5 @@
/* dfa.c - deterministic extended regexp routines for GNU
- Copyright 1988, 1998, 2000 Free Software Foundation, Inc.
+ 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,6 +46,16 @@ extern void free();
#include <strings.h>
#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 <wchar.h>
+# include <wctype.h>
+#endif
+
#ifndef DEBUG /* use the same approach as regex.c */
#undef assert
#define assert(e)
@@ -91,17 +101,22 @@ extern void free();
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 _ */
-#ifndef _
-# ifdef HAVE_LIBINTL_H
-# include <libintl.h>
-# ifndef _
-# define _(Str) gettext (Str)
+#ifdef ENABLE_NLS
+# ifndef _
+# ifdef HAVE_LIBINTL_H
+# include <libintl.h>
+# ifndef _
+# define _(Str) gettext (Str)
+# endif
+# else
+# define _(Str) (Str)
# endif
-# else
-# define _(Str) (Str)
# endif
+#else
+# define _(Str) (Str)
#endif
#include "regex.h"
@@ -234,6 +249,10 @@ prtok (token t)
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,8 +368,117 @@ static int laststart; /* True if we're separated from beginning or (, |
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', <mb(0)>, <mb(1)>, <mb(2)>
+ 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) \
+# 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,6 +490,202 @@ static int minrep, maxrep; /* Repeat counts for {m,n}. */
(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,6 +766,14 @@ lex (void)
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,6 +994,15 @@ lex (void)
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,6 +1028,17 @@ lex (void)
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,6 +1167,26 @@ static int depth; /* Current depth of a hypothetical stack
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,7 +1230,10 @@ addtok (token t)
atom
atom:
+ <multibyte character>
<normal character>
+ ANYCHAR
+ MBCSET
CSET
BACKREF
BEGLINE
@@ -876,10 +1251,31 @@ atom (void)
{
if ((tok >= 0 && tok < NOTCHAR) || tok >= CSET || tok == BACKREF
|| tok == BEGLINE || tok == ENDLINE || tok == BEGWORD
+#ifdef MBS_SUPPORT
+ || tok == ANYCHAR || tok == MBCSET /* MB_CUR_MAX > 1 */
+#endif /* MBS_SUPPORT */
|| tok == ENDWORD || tok == LIMWORD || tok == NOTLIMWORD)
{
addtok(tok);
tok = lex();
+#ifdef MBS_SUPPORT
+ /* We treat a multibyte character as a single atom, so that DFA
+ can treat a multibyte character as a single expression.
+
+ e.g. We construct following tree from "<mb1><mb2>".
+ <mb1(1st-byte)><mb1(2nd-byte)><CAT><mb1(3rd-byte)><CAT>
+ <mb2(1st-byte)><mb2(2nd-byte)><CAT><mb2(3rd-byte)><CAT><CAT>
+ */
+ 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,6 +1394,14 @@ dfaparse (char *s, size_t len, struct dfa *d)
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,6 +1543,10 @@ state_index (struct dfa *d, position_set *s, int newline, int letter)
d->states[i].backref = 0;
d->states[i].constraint = 0;
d->states[i].first_end = 0;
+#ifdef MBS_SUPPORT
+ if (MB_CUR_MAX > 1)
+ d->states[i].mbps.nelem = 0;
+#endif
for (j = 0; j < s->nelem; ++j)
if (d->tokens[s->elems[j].index] < 0)
{
@@ -1181,6 +1589,10 @@ epsclosure (position_set *s, struct dfa *d)
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,6 +1874,10 @@ dfaanalyze (struct dfa *d, int searchflag)
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,6 +1979,9 @@ dfastate (int s, struct dfa *d, int trans[])
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,6 +2003,23 @@ dfastate (int s, struct dfa *d, int trans[])
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,9 +2156,46 @@ dfastate (int s, struct dfa *d, int trans[])
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 <sb a> is a certain singlebyte
+ character, <mb A> is a certain multibyte character, and the
+ codepoint of <sb a> equals the 2nd byte of the codepoint of
+ <mb A>.
+ When state[0] accepts <sb a>, state[i] transit to state[i+1]
+ by accepting accepts 1st byte of <mb A>, and state[i+1]
+ accepts 2nd byte of <mb A>, if state[i+1] encounter the
+ codepoint of <sb a>, it must not be <sb a> but 2nd byte of
+ <mb A>, 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,6 +2344,434 @@ build_state_zero (struct dfa *d)
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; i<work_mbc->nch_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; i<work_mbc->nequivs; 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; i<work_mbc->ncoll_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; i<work_mbc->nranges; 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; i<work_mbc->nchars; 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,8 +2815,80 @@ dfaexec (struct dfa *d, char *begin, char *end,
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,10 +2904,30 @@ dfaexec (struct dfa *d, char *begin, char *end,
{
if (backref)
*backref = (d->states[s].backref != 0);
- return (char *) p;
+#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,7 +2938,16 @@ dfaexec (struct dfa *d, char *begin, char *end,
/* Check if we've run off the end of the buffer. */
if ((char *) p > end)
- return NULL;
+ {
+#ifdef MBS_SUPPORT
+ if (MB_CUR_MAX > 1)
+ {
+ free(mblen_buf);
+ free(inputwcs);
+ }
+#endif /* MBS_SUPPORT */
+ return NULL;
+ }
if (s >= 0)
{
@@ -1976,6 +2978,16 @@ dfainit (struct dfa *d)
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,6 +3048,37 @@ dfafree (struct dfa *d)
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,6 +3134,10 @@ dfafree (struct dfa *d)
---- ---- ----- -- --
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,7 +3583,12 @@ dfamust (struct dfa *dfa)
/* not on *my* shift */
goto done;
}
- else if (t >= CSET)
+ else if (t >= CSET
+#ifdef MBS_SUPPORT
+ || t == ANYCHAR
+ || t == MBCSET
+#endif /* MBS_SUPPORT */
+ )
{
/* easy enough */
resetmust(mp);
diff --git a/dfa.h b/dfa.h
index f2fef4b7..154684bb 100644
--- a/dfa.h
+++ b/dfa.h
@@ -1,5 +1,5 @@
/* dfa.h - declarations for GNU deterministic regexp compiler
- Copyright (C) 1988, 1998 Free Software Foundation, Inc.
+ 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,6 +136,15 @@ typedef enum
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,6 +232,12 @@ typedef struct
char backref; /* True if this state matches a \<digit>. */
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,6 +249,26 @@ struct dfamust
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,6 +287,32 @@ struct dfa
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 --git a/doc/ChangeLog b/doc/ChangeLog
index 79dac766..6223634f 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,55 @@
+Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.1: Release tar file made.
+
+Tue Apr 16 13:26:13 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * texinfo.tex: Updated to version from Texinfo 4.1.
+
+2002-02-10 Paul Eggert <eggert@twinsun.com>
+
+ * 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 <bruno@clisp.org>
+
+ * gawk.texi: Document the dcngettext function.
+ * awkcard.in: Likewise.
+ * gawk.1: Likewise.
+
+Mon Jan 28 18:41:02 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkinet.texi, Makefile.am: Removed User Friendly cartoon.
+ Sigh.
+
+Wed Dec 19 16:00:39 2001 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gawk.texi (Profiling): Describe the signals used for profile
+ dumping in the DJGPP version.
+
+Mon Sep 3 18:30:13 2001 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi (Top): Put in @ifnottex so that makeinfo
+ --html is now happy.
+
Sun Jun 3 13:04:44 2001 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.0: Release tar file made. And there was
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 3a9e4b44..93092a15 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,7 +1,7 @@
#
# doc/Makefile.am --- automake input file for gawk
#
-# Copyright (C) 2000, 2001 the Free Software Foundation, Inc.
+# 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,7 +30,7 @@ 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) \
- uf002331.eps uf002331.jpg lflashlight.eps rflashlight.eps \
+ lflashlight.eps rflashlight.eps \
statist.jpg statist.eps
MAKEINFO = @MAKEINFO@ --no-split
@@ -76,5 +76,6 @@ awkcard.nc: $(CARDFILES)
$(TROFF) $(CARDSRC_N) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps && touch awkcard.nc
clean:
- rm -f *.ps *~ awkcard.nc
+ rm -f *.ps *~ awkcard.nc awkcard.tr
+distclean: clean
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 555450d2..8c38c91c 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4a from Makefile.am
+# Makefile.in generated automatically by automake 1.5 from Makefile.am.
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# 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,
@@ -11,6 +11,31 @@
# 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@
@@ -31,11 +56,9 @@ infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-
top_builddir = ..
ACLOCAL = @ACLOCAL@
@@ -47,44 +70,47 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_FLAG =
+INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
-
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-
-@SET_MAKE@
-AMDEP = @AMDEP@
+host_alias = @host_alias@
+host_triplet = @host@
AMTAR = @AMTAR@
AWK = @AWK@
-CATALOGS = @CATALOGS@
+BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CFLAGS = @CFLAGS@
CPP = @CPP@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
+EXEEXT = @EXEEXT@
GENCAT = @GENCAT@
-GMOFILES = @GMOFILES@
+GLIBC21 = @GLIBC21@
GMSGFMT = @GMSGFMT@
-GT_NO = @GT_NO@
-GT_YES = @GT_YES@
-INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
+HAVE_LIB = @HAVE_LIB@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
-INTLDEPS = @INTLDEPS@
+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@
-MSGFMT = @MSGFMT@
+OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
-POFILES = @POFILES@
+PATH_SEPARATOR = @PATH_SEPARATOR@
POSUB = @POSUB@
RANLIB = @RANLIB@
SOCKET_LIBS = @SOCKET_LIBS@
@@ -93,32 +119,9 @@ 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@
-l = @l@
-
-#
-# 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.
-#
-# 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
-#
-
info_TEXINFOS = gawk.texi gawkinet.texi
@@ -127,7 +130,7 @@ 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) \
- uf002331.eps uf002331.jpg lflashlight.eps rflashlight.eps \
+ lflashlight.eps rflashlight.eps \
statist.jpg statist.eps
@@ -146,113 +149,59 @@ CARDFILES = $(CARDSRC) ad.block awkcard.in setter.outline
AWKCARD = awkcard.ps
subdir = doc
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-DIST_SOURCES =
-TEXI2DVI = texi2dvi
+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
-man1dir = $(mandir)/man1
-MANS = $(man_MANS)
NROFF = nroff
-DIST_COMMON = ChangeLog Makefile.am Makefile.in texinfo.tex
-
-
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+MANS = $(man_MANS)
+DIST_COMMON = ChangeLog Makefile.am Makefile.in texinfo.tex
+all: all-am
-GZIP_ENV = --best
-all: all-redirect
.SUFFIXES:
-.SUFFIXES: .dvi .info .ps .texi .texinfo .txi
-$(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_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
+.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
-
-DVIPS = dvips
-
.texi.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+ && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
+ `echo $< | sed 's,.*/,,'`
.texi.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+ $(TEXI2DVI) $<
.texi:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texinfo.info:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texinfo:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texinfo.dvi:
- TEXINPUTS=$(srcdir):$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.txi.info:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.txi.dvi:
- TEXINPUTS=$(srcdir):$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.txi:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+ && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
+ `echo $< | sed 's,.*/,,'`
+TEXI2DVI = texi2dvi
+DVIPS = dvips
.dvi.ps:
$(DVIPS) $< -o $@
-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 $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i 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
-
-uninstall-info:
+uninstall-info-am:
$(PRE_UNINSTALL)
- @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+ @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"; \
@@ -279,32 +228,28 @@ dist-info: $(INFO_DEPS)
done
mostlyclean-aminfo:
- -rm -f gawk.aux gawk.cp gawk.cps gawk.dvi gawk.fn gawk.fns gawk.pgs \
- gawk.ky gawk.kys gawk.ps gawk.log gawk.pg gawk.toc gawk.tp \
- gawk.tps gawk.vr gawk.vrs gawk.op gawk.tr gawk.cv gawk.cn \
- gawk.cm gawk.ov gawkinet.aux gawkinet.cp gawkinet.cps \
- gawkinet.dvi gawkinet.fn gawkinet.fns gawkinet.pgs \
- gawkinet.ky gawkinet.kys gawkinet.ps gawkinet.log gawkinet.pg \
- gawkinet.toc gawkinet.tp gawkinet.tps gawkinet.vr \
- gawkinet.vrs gawkinet.op gawkinet.tr gawkinet.cv gawkinet.cn \
- gawkinet.cm gawkinet.ov
-
-clean-aminfo:
-
-distclean-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 \
+ 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
-install-man1:
+man1dir = $(mandir)/man1
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(man1dir)
- @list='$(man1_MANS)'; \
- l2='$(man_MANS)'; for i in $$l2; do \
+ @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; \
@@ -319,10 +264,11 @@ install-man1:
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
done
-
uninstall-man1:
- @list='$(man1_MANS)'; \
- l2='$(man_MANS)'; for i in $$l2; do \
+ @$(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; \
@@ -335,21 +281,22 @@ uninstall-man1:
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
rm -f $(DESTDIR)$(man1dir)/$$inst; \
done
-install-man: $(MANS)
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-man1
-uninstall-man:
- @$(NORMAL_UNINSTALL)
- $(MAKE) $(AM_MAKEFLAGS) uninstall-man1
tags: TAGS
TAGS:
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
- d=$(srcdir); \
+ 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; \
@@ -359,71 +306,109 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
- $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
-info-am: $(INFO_DEPS)
-info: info-am
-dvi-am: $(DVIS)
-dvi: dvi-am
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="${top_distdir}" distdir="$(distdir)" \
+ dist-info
check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-exec-am:
-install-exec: install-exec-am
+all-am: Makefile $(INFO_DEPS) $(MANS)
-install-data-am: install-info-am install-man
-install-data: install-data-am
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(man1dir)
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
-uninstall-am: uninstall-info uninstall-man
+install-exec: install-exec-am
+install-data: install-data-am
uninstall: uninstall-am
-all-am: Makefile $(INFO_DEPS) $(MANS)
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(mandir)/man1
+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)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
maintainer-clean-generic:
- -rm -f Makefile.in
-mostlyclean-am: mostlyclean-aminfo mostlyclean-generic
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
-mostlyclean: mostlyclean-am
+clean-am: clean-generic mostlyclean-am
-clean-am: clean-aminfo clean-generic mostlyclean-am
+distclean: distclean-am
-clean: clean-am
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
-distclean-am: distclean-aminfo distclean-generic clean-am
+dvi-am: $(DVIS)
-distclean: distclean-am
+info: info-am
-maintainer-clean-am: maintainer-clean-aminfo maintainer-clean-generic \
- distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+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
-.PHONY: install-info-am uninstall-info mostlyclean-aminfo \
-distclean-aminfo clean-aminfo maintainer-clean-aminfo install-man1 \
-uninstall-man1 install-man uninstall-man tags distdir info-am info \
-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
-install-exec install-data-am install-data install-am install \
-uninstall-am uninstall all-redirect all-am all install-strip \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+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
@@ -456,8 +441,9 @@ awkcard.nc: $(CARDFILES)
$(TROFF) $(CARDSRC_N) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps && touch awkcard.nc
clean:
- rm -f *.ps *~ awkcard.nc
+ 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 --git a/doc/awkcard.in b/doc/awkcard.in
index 43f73fb8..be6a7caa 100644
--- a/doc/awkcard.in
+++ b/doc/awkcard.in
@@ -1,6 +1,6 @@
.\" AWK Reference Card --- Arnold Robbins, arnold@gnu.org
.\"
-.\" Copyright (C) 1996-2001 Free Software Foundation, Inc.
+.\" 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,15 +57,15 @@ Command Line Arguments (\*(MK) 4
Conversions And Comparisons 9
Copying Permissions 18
Definitions 2
-Dynamic Extensions (\*(GK) 18
-Environment Variables (\*(GK) 18
+Dynamic Extensions (\*(GK) 14
+Environment Variables (\*(GK) 16
Escape Sequences 8
Expressions 11
Fields 6
FTP/HTTP Information 18
-Historical Features (\*(GK) 18
+Historical Features (\*(GK) 16
Input Control 12
-Internationalization (\*(GK) 16
+Internationalization (\*(GK) 18
Lines And Statements 5
Localization (\*(GK) 17
Numeric Functions 14
@@ -97,9 +97,8 @@ Brian Kernighan and Michael Brennan who reviewed it.
\*(CD
.SL
.nf
-\*(FR\(co Copyright 1996-2001, Free Software Foundation
-59 Temple Place \(em Suite 330
-Boston, MA 02111-1307 USA
+\*(FRCopyright \(co 1996, 1997, 1998, 1999, 2000, 2001, 2002
+Free Software Foundation, Inc.
.nf
.BT
@@ -111,7 +110,7 @@ Boston, MA 02111-1307 USA
.ES
\*(CDThis card describes POSIX AWK, as well as the three
freely available \*(AK implementations
-(see \fHFTP Information\fP below).
+(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,7 +1421,7 @@ T}
\*(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,6 +1444,24 @@ generator.\*(CX
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,40 +1664,43 @@ teturns the bitwise XOR of the values provided by
.in -.2i
.EB "\s+2\f(HBBIT MANIPULATION FUNCTIONS (\*(GK\f(HB)\*(FR\s0"
-.\" --- Builtin Internationalizatin Functions
+.\" --- Environment Variables
.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.''
+\*(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
-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.
+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
-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"
+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,9 +1776,12 @@ which probably won't work.
.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.
+3. Use the
+\*(FCbindtextdomain()\*(FR,
+\*(FCdcgettext()\*(FR,
+and/or
+\*(FCdcngettext()\*(FR
+functions in your program, as appropriate.
.sp .5
4. Run
.sp .5
@@ -1777,68 +1800,60 @@ The internationalization features are described in full detail in \*(AM.\*(CB
.BT
-.\" --- Extensions
+.\" --- Builtin Internationalization Functions
.ES
.fi
+\*(CD\*(GK
+provides the following functions for runtime message translation.
.in +.2i
+.sp .5
.ti -.2i
-\*(CD\*(FCextension(\*(FIlib\*(FC, \*(FIfunc\*(FC)\*(FR
+\*(FCbindtextdomain(\*(FIdirectory \*(FR[\*(FC, \*(FIdomain\*(FR]\*(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.
+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
-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.
+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
-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"
+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 Information
+.\" --- FTP/HTTP Information
.ES
.nf
-\*(CDHost: \*(FCgnudist.gnu.org\*(FR
-File: \*(FC/gnu/gawk/gawk-3.1.0.tar.gz\fP
+\*(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,10 +1876,11 @@ Michael Brennan's \*(MK. There may be a newer version.\*(CX
.in -.2i
.EB "\s+2\f(HBFTP/HTTP INFORMATION\*(FR\s0"
+
.\" --- Copying Permissions
.ES
.fi
-\*(CDCopyright \(co 1996-2001 Free Software Foundation, Inc.
+\*(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 --git a/doc/gawk.1 b/doc/gawk.1
index 3e3c62b3..5f73a68e 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -14,7 +14,7 @@
. if \w'\(rq' .ds rq "\(rq
. \}
.\}
-.TH GAWK 1 "May 29 2001" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "Apr 16 2002" "Free Software Foundation" "Utility Commands"
.SH NAME
gawk \- pattern scanning and processing language
.SH SYNOPSIS
@@ -923,6 +923,7 @@ specified by
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,16 +1495,14 @@ and
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
+\*(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.
@@ -1677,7 +1676,7 @@ as follows:
\fBdelete \fIarray\^\fB[\^\fIindex\^\fB]\fR
\fBdelete \fIarray\^\fR
\fBexit\fR [ \fIexpression\fR ]
-\fB{ \fIstatements \fB}
+\fB{ \fIstatements \fB}\fR
.fi
.RE
.SS "I/O Statements"
@@ -2322,6 +2321,7 @@ in the string
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,6 +2629,35 @@ in \*(EP.
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,14 +3253,6 @@ 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.
-.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
@@ -3299,7 +3320,8 @@ Brian Kernighan of Bell Laboratories
provided valuable assistance during testing and debugging.
We thank him.
.SH COPYING PERMISSIONS
-Copyright \(co 1989, 1991\-2001 Free Software Foundation, Inc.
+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 --git a/doc/gawk.info b/doc/gawk.info
index 075d4947..316b56c5 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -1,4 +1,4 @@
-This is gawk.info, produced by makeinfo version 4.0 from gawk.texi.
+This is gawk.info, produced by makeinfo version 4.2 from gawk.texi.
INFO-DIR-SECTION GNU Packages
START-INFO-DIR-ENTRY
@@ -9,15 +9,13 @@ START-INFO-DIR-ENTRY
* awk: (gawk)Invoking gawk. Text scanning and processing.
END-INFO-DIR-ENTRY
- This file documents `awk', a program that you can use to select
-particular records in a file and perform operations upon them.
+Copyright (C) 1989, 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000,
+2001, 2002 Free Software Foundation, Inc.
- This is Edition 3 of `GAWK: Effective AWK Programming: A User's
-Guide for GNU Awk', for the 3.1.0 version of the GNU implementation of
-AWK.
- Copyright (C) 1989, 1991, 1992, 1993, 1996-2001 Free Software
-Foundation, Inc.
+ This is Edition 3 of `GAWK: Effective AWK Programming: A User's
+Guide for GNU Awk', for the 3.1.1 (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
@@ -32,7 +30,7 @@ texts being (a) (see below), and with the Back-Cover Texts being (b)
b. "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."
-
+

File: gawk.info, Node: Top, Next: Foreword, Prev: (dir), Up: (dir)
@@ -42,10 +40,28 @@ General Introduction
This file documents `awk', a program that you can use to select
particular records in a file and perform operations upon them.
+Copyright (C) 1989, 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000,
+2001, 2002 Free Software Foundation, Inc.
+
+
This is Edition 3 of `GAWK: Effective AWK Programming: A User's
-Guide for GNU Awk', for the 3.1.0 version of the GNU implementation of
-AWK.
+Guide for GNU Awk', for the 3.1.1 (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
+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".
+
+ a. "A GNU Manual"
+
+ b. "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."
+
* Menu:
* Foreword:: Some nice words about this
@@ -102,7 +118,7 @@ AWK.
* Acknowledgments:: Acknowledgments.
* Running gawk:: How to run `gawk' programs;
includes command-line syntax.
-* One-shot:: Running a short throw-away `awk'
+* One-shot:: Running a short throwaway `awk'
program.
* Read Terminal:: Using no input files (input from terminal
instead).
@@ -126,7 +142,7 @@ AWK.
* When:: When to use `gawk' and when to use
other things.
* Regexp Usage:: How to Use Regular Expressions.
-* Escape Sequences:: How to write non-printing characters.
+* Escape Sequences:: How to write nonprinting characters.
* Regexp Operators:: Regular Expression Operators.
* Character Lists:: What can go between `[...]'.
* GNU Regexp Operators:: Operators specific to GNU software.
@@ -135,7 +151,7 @@ AWK.
* 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.
+* 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.
@@ -183,7 +199,7 @@ AWK.
* 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.
+* 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
@@ -296,7 +312,7 @@ AWK.
* I18N Portability:: `awk'-level portability issues.
* I18N Example:: A simple i18n example.
* Gawk I18N:: `gawk' is also internationalized.
-* Non-decimal Data:: Allowing non-decimal input data.
+* Nondecimal Data:: Allowing nondecimal input data.
* Two-way I/O:: Two-way communications with another
process.
* TCP/IP Networking:: Using `gawk' for network
@@ -388,6 +404,8 @@ AWK.
and OS/2.
* PC Using:: Running `gawk' on MS-DOS, Win32 and
OS/2.
+* Cygwin:: Building and running `gawk' for
+ Cygwin.
* VMS Installation:: Installing `gawk' on VMS.
* VMS Compilation:: How to compile `gawk' under VMS.
* VMS Installation Details:: How to install `gawk' under VMS.
@@ -425,16 +443,12 @@ AWK.
To Miriam, for making me complete.
-
To Chana, for the joy you bring us.
-
To Rivka, for the exponential increase.
-
To Nachum, for the added dimension.
-
To Malka, for the new beginning.

@@ -533,7 +547,7 @@ Preface
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
+tasks in languages such as C, C++, or Pascal is time-consuming and
inconvenient. Such jobs are often easier with `awk'. The `awk'
utility interprets a special-purpose programming language that makes it
easy to handle simple data-reformatting jobs.
@@ -556,7 +570,7 @@ This means that all properly written `awk' programs should work with
* Produce indexes and perform other document preparation tasks
* Experiment with algorithms that you can adapt later to other
- computer languages.
+ computer languages
In addition, `gawk' provides facilities that make it easy to:
@@ -564,21 +578,21 @@ This means that all properly written `awk' programs should work with
* Sort data
- * Perform simple network communications.
+ * Perform simple network communications
This Info file teaches you about the `awk' language and how you can
use it effectively. You should already be familiar with basic system
commands, such as `cat' and `ls',(1) as well as basic shell facilities,
-such as Input/Output (I/O) redirection and pipes.
+such as input/output (I/O) redirection and pipes.
Implementations of the `awk' language are available for many
different computing environments. This Info file, while describing the
`awk' language in general, also describes the particular implementation
of `awk' called `gawk' (which stands for "GNU awk"). `gawk' runs on a
-broad range of Unix systems, ranging from 80386 PC-based computers, up
+broad range of Unix systems, ranging from 80386 PC-based computers up
through large-scale systems, such as Crays. `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.
+to Mac OS X, MS-DOS, Microsoft Windows (all versions) and OS/2 PCs,
+Atari and Amiga microcomputers, BeOS, Tandem D20, and VMS.
* Menu:
@@ -596,7 +610,7 @@ Atari and Amiga micro-computers, BeOS, Tandem D20, and VMS.
---------- Footnotes ----------
(1) These commands are available on POSIX-compliant systems, as well
-as on traditional Unix based systems. If you are using some other
+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.
@@ -607,7 +621,6 @@ History of `awk' and `gawk'
===========================
Recipe For A Programming Language
-
1 part `egrep' 1 part `snobol'
2 parts `ed' 3 parts C
@@ -662,9 +675,9 @@ The language described in this Info file is often referred to as "new
Because of this, many systems have multiple versions of `awk'. Some
systems have an `awk' utility that implements the original version of
the `awk' language and a `nawk' utility for the new version. Others
-have an `oawk' for the "old `awk'" language and plain `awk' for the new
-one. Still others only have one version, which is usually the new
-one.(1)
+have an `oawk' version for the "old `awk'" language and plain `awk' for
+the new one. Still others only have one version, which is usually the
+new one.(1)
All in all, this makes it difficult for you to know which version of
`awk' you should run when writing your programs. The best advice I can
@@ -689,15 +702,11 @@ File: gawk.info, Node: This Manual, Next: Conventions, Prev: Names, Up: Pref
Using This Book
===============
- 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
-
The term `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 `awk' utility" and the language "the
-`awk' language." This Info file explains both the `awk' language and
-how to run the `awk' utility. The term "`awk' program" refers to a
+careful, we call the language "the `awk' language," and the program
+"the `awk' utility." This Info file explains both the `awk' language
+and how to run the `awk' utility. The term "`awk' program" refers to a
program written by you in the `awk' programming language.
Primarily, this Info file explains the features of `awk', as defined
@@ -710,7 +719,8 @@ noted.
There are subsections labelled as *Advanced Notes* scattered
throughout the Info file. 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."
+reading. All appear in the index, under the heading "advanced
+features."
Most of the time, the examples use complete `awk' programs. In some
of the more advanced sections, only the part of the `awk' program that
@@ -750,7 +760,7 @@ structure: associative arrays. Deleting array elements and whole
arrays is also described, as well as sorting arrays in `gawk'.
*Note Functions::, describes the built-in functions `awk' and `gawk'
-provide for you, as well as how to define your own functions.
+provide, as well as how to define your own functions.
*Note Internationalization with `gawk': Internationalization,
describes special features in `gawk' for translating program messages
@@ -767,13 +777,11 @@ program source files.
*Note A Library of `awk' Functions: Library Functions, and *Note
Practical `awk' Programs: Sample Programs, provide many sample `awk'
-programs. Reading them allows you to see `awk' being used for solving
-real problems.
+programs. Reading them allows you to see `awk' solving real problems.
*Note The Evolution of the `awk' Language: Language History,
-describes how the `awk' language has evolved since it was first
-released to present. It also describes how `gawk' has acquired
-features over time.
+describes how the `awk' language has evolved since first release to
+present. It also describes how `gawk' has acquired features over time.
*Note Installing `gawk': Installation, describes how to get `gawk',
how to compile it under Unix, and how to compile and use it on different
@@ -788,20 +796,20 @@ write extension libraries, and some possible future directions for
*Note Basic Programming Concepts: Basic Concepts, 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.
+some of the issues surrounding floating-point numbers.
The *Note 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.
+familiar with, try looking them up here.
*Note GNU General Public License: Copying, and *Note GNU Free
Documentation License::, present the licenses that cover the `gawk'
-source code, and this Info file, respectively.
+source code and this Info file, respectively.
---------- Footnotes ----------
- (1) All such differences appear in the index under the heading
-"differences between `gawk' and `awk'."
+ (1) All such differences appear in the index under the entry
+"differences in `awk' and `gawk'."

File: gawk.info, Node: Conventions, Next: Manual History, Prev: This Manual, Up: Preface
@@ -855,10 +863,7 @@ File: gawk.info, Node: Manual History, Next: How To Contribute, Prev: Convent
The GNU Project and This Book
=============================
- Software is like sex: it's better when it's free.
- Linus Torvalds
-
- The Free Software Foundation (FSF) is a non-profit organization
+ 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
@@ -960,12 +965,12 @@ acknowledgments:
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.
+GNU Project.
The following people (in alphabetical order) provided helpful
comments on various versions of this book, up to and including this
edition. Rick Adams, Nelson H.F. Beebe, Karl Berry, Dr. Michael
-Brennan, Rich Burridge, Claire Coutier, Diane Close, Scott Deifik,
+Brennan, Rich Burridge, Claire Cloutier, Diane Close, Scott Deifik,
Christopher ("Topher") Eliot, Jeffrey Friedl, Dr. Darrel Hankerson,
Michal Jaegermann, Dr. Richard J. LeBlanc, Michael Lijewski, Pat Rankin,
Miriam Robbins, Mary Sheehan, and Chuck Toporek.
@@ -993,12 +998,12 @@ a significant pleasure.
Ulrich Drepper, provided invaluable help and feedback for the design of
the internationalization features.
- Nelson Beebe, Martin Brown, Scott Deifik, Darrel Hankerson, Michal
-Jaegermann, Ju"rgen Kahrs, Pat Rankin, Kai Uwe Rommel, and Eli Zaretskii
-(in alphabetical order) are long-time members of the `gawk' "crack
-portability team." Without their hard work and help, `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 people.
+ Nelson Beebe, Martin Brown, Andreas Buening, Scott Deifik, Darrel
+Hankerson, Isamu Hasegawa, Michal Jaegermann, Ju"rgen Kahrs, Pat Rankin,
+Kai Uwe Rommel, and Eli Zaretskii (in alphabetical order) make up the
+`gawk' "crack portability team." Without their hard work and help,
+`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 people.
David and I would like to thank Brian Kernighan of Bell Laboratories
for invaluable assistance during the testing and debugging of `gawk',
@@ -1011,15 +1016,14 @@ Associates contributed significant editorial help for this Info file
for the 3.1 release of `gawk'.
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,
+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. Finally, I
also must acknowledge my gratitude to G-d, for the many opportunities
He has sent my way, as well as for the gifts He has given me with which
to take advantage of those opportunities.
-
Arnold Robbins
Nof Ayalon
ISRAEL
@@ -1044,7 +1048,7 @@ find it. Most other languages are "procedural"; you have to describe,
in great detail, every step the program is to take. When working with
procedural languages, it is usually much harder to clearly describe the
data your program will process. For this reason, `awk' programs are
-often refreshingly easy to write and read.
+often refreshingly easy to read and write.
When you run `awk', you specify an `awk' "program" that tells `awk'
what to do. The program consists of a series of "rules". (It may also
@@ -1100,7 +1104,7 @@ variations of each.
* Menu:
-* One-shot:: Running a short throw-away `awk'
+* One-shot:: Running a short throwaway `awk'
program.
* Read Terminal:: Using no input files (input from terminal
instead).
@@ -1114,8 +1118,8 @@ variations of each.

File: gawk.info, Node: One-shot, Next: Read Terminal, Prev: Running gawk, Up: Running gawk
-One-Shot Throw-Away `awk' Programs
-----------------------------------
+One-Shot Throwaway `awk' Programs
+---------------------------------
Once you are familiar with `awk', you will often type in simple
programs the moment you want to use them. Then you can write the
@@ -1160,8 +1164,8 @@ MS-DOS, it is `Ctrl-z'.)
As an example, the following program prints a friendly piece of
advice (from Douglas Adams's `The Hitchhiker's Guide to the Galaxy'),
-to keep you from worrying about the complexities of computer
-programming. (`BEGIN' is a feature we haven't discussed yet.):
+to keep you from worrying about the complexities of computer programming
+(`BEGIN' is a feature we haven't discussed yet):
$ awk "BEGIN { print \"Don't Panic!\" }"
-| Don't Panic!
@@ -1172,8 +1176,8 @@ rules--in particular because it mixes both single quotes and double
quotes.(1)
This next simple `awk' program emulates the `cat' utility; it copies
-whatever you type at the keyboard to its standard output. (Why this
-works is explained shortly.)
+whatever you type on the keyboard to its standard output (why this
+works is explained shortly).
$ awk '{ print }'
Now is the time for all good men
@@ -1287,8 +1291,8 @@ interpreter to run and an optional initial command-line argument to
pass to that 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 file name
-of the `awk' program. The rest of the argument list is either options
-to `awk', or data files, or both.
+of the `awk' program. The rest of the argument list contains either
+options to `awk', or data files, or both.

File: gawk.info, Node: Comments, Next: Quoting, Prev: Executable Scripts, Up: Running gawk
@@ -1312,12 +1316,12 @@ put the following into `advice':
# keep novice users from being afraid of the computer.
BEGIN { print "Don't Panic!" }
- You can put comment lines into keyboard-composed throw-away `awk'
+ You can put comment lines into keyboard-composed throwaway `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.
- *Caution:* As mentioned in *Note One-Shot Throw-Away `awk' Programs:
+ *Caution:* As mentioned in *Note One-Shot Throwaway `awk' Programs:
One-shot, you can enclose small to medium programs in single quotes, in
order to keep your shell scripts self-contained. When doing so,
_don't_ put an apostrophe (i.e., a single quote) into a comment (or
@@ -1331,7 +1335,7 @@ example, look at the following:
>
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
+quoted object begins at the end of the command line. It therefore
prompts with the secondary prompt, waiting for more input. With Unix
`awk', closing the quoted string produces this result:
@@ -1347,7 +1351,7 @@ node describes the shell's quoting rules.

File: gawk.info, Node: Quoting, Prev: Comments, Up: Running gawk
-Shell Quoting Issues
+Shell-Quoting Issues
--------------------
For short to medium length `awk' programs, it is most convenient to
@@ -1375,8 +1379,8 @@ Bourne-Again Shell). If you use `csh', you're on your own.
quotes. The shell does no interpretation of the quoted text,
passing it on verbatim to the command. It is _impossible_ to
embed a single quote inside single-quoted text. Refer back to
- *Note Comments in `awk' Programs: Comments, for an example showing
- what happens if you try.
+ *Note Comments in `awk' Programs: Comments, for an example of what
+ happens if you try.
* Double quotes protect most things between the opening and closing
quotes. The shell does at least variable and command substitution
@@ -1385,7 +1389,7 @@ Bourne-Again Shell). If you use `csh', you're on your own.
Since certain characters within double-quoted text are processed
by the shell, they must be "escaped" within the text. Of note are
- the characters `$', ``', `\' and `"', all of which must be
+ the characters `$', ``', `\', and `"', 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 in *Note Running `awk'
@@ -1448,18 +1452,18 @@ Data Files for the Examples
===========================
Many of the examples in this Info file take their input from two
-sample data files. The first, called `BBS-list', represents a list of
+sample data files. The first, `BBS-list', represents a list of
computer bulletin board systems together with information about those
systems. The second data file, called `inventory-shipped', contains
information about monthly shipments. In both files, each line is
considered to be one "record".
- In the 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 `A' in the last column
-means the board operates 24 hours a day. A `B' in the last column
-means the board only operates on evening and weekend hours. A `C'
-means the board operates only on weekends:
+ In the data 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 `A' in the
+last column means the board operates 24 hours a day. A `B' in the last
+column means the board only operates on evening and weekend hours. A
+`C' means the board operates only on weekends:
aardvark 555-5553 1200/300 B
alpo-net 555-3412 2400/1200/300 A
@@ -1473,12 +1477,12 @@ means the board operates only on weekends:
sdace 555-3430 2400/1200/300 A
sabafoo 555-2127 1200/300 C
- The second data file, called `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 orange bags shipped, and the number of blue
-packages shipped, respectively. There are 16 entries, covering the 12
-months of last year and the first four months of the current year.
+ The data 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
+orange bags shipped, and the number of blue packages shipped,
+respectively. There are 16 entries, covering the 12 months of last year
+and the first four months of the current year.
Jan 13 25 15 115
Feb 15 32 24 226
@@ -1519,10 +1523,10 @@ Some Simple Examples
====================
The following command runs a simple `awk' program that searches the
-input file `BBS-list' for the character string `foo'. (A string of
-characters is usually called a "string". The term "string" is based on
-similar usage in English, such as "a string of pearls," or, "a string
-of cars in a train."):
+input file `BBS-list' for the character string `foo' (a grouping of
+characters is usually called a "string"; the term "string" is based on
+similar usage in English, such as "a string of pearls," or "a string of
+cars in a train"):
awk '/foo/ { print $0 }' BBS-list
@@ -1552,10 +1556,10 @@ for _every_ input line. If the action is omitted, the default action
is to print all lines that match the pattern.
Thus, we could leave out the action (the `print' statement and the
-curly braces) in the above example and the result would be the same: all
-lines matching the pattern `foo' are printed. By comparison, omitting
-the `print' statement but retaining the curly braces makes an empty
-action that does nothing (i.e., no lines are printed).
+curly braces) in the previous example and the result would be the same:
+all lines matching the pattern `foo' are printed. By comparison,
+omitting the `print' statement but retaining the curly braces makes an
+empty action that does nothing (i.e., no lines are printed).
Many practical `awk' programs are just a line or two. Following is a
collection of useful, short programs to get you started. Some of these
@@ -1617,7 +1621,7 @@ different ways to do the same things shown here:
awk -F: '{ print $1 }' /etc/passwd | sort
- * Count lines in a file:
+ * Count the lines in a file:
awk 'END { print NR }' data
@@ -1625,8 +1629,8 @@ different ways to do the same things shown here:
awk 'NR % 2 == 0' data
- If you use the expression `NR % 2 == 1' instead, it would print
- the odd-numbered lines.
+ If you use the expression `NR % 2 == 1' instead, the program would
+ print the odd-numbered lines.

File: gawk.info, Node: Two Rules, Next: More Complex, Prev: Very Simple, Up: Getting Started
@@ -1643,9 +1647,9 @@ run.
After processing all the rules that match the line (and perhaps
there are none), `awk' reads the next line. (However, *note The `next'
Statement: Next Statement., and also *note Using `gawk''s `nextfile'
-Statement: Nextfile Statement.). This continues until the end of the
-file is reached. For example, the following `awk' program contains two
-rules:
+Statement: Nextfile Statement.). This continues until the program
+reaches the end of the file. For example, the following `awk' program
+contains two rules:
/12/ { print $0 }
/21/ { print $0 }
@@ -1660,7 +1664,7 @@ the string `21'. If a line contains both strings, it is printed twice,
once by each rule.
This is what happens if we run this program on our two sample data
-files, `BBS-list' and `inventory-shipped', as shown here:
+files, `BBS-list' and `inventory-shipped':
$ awk '/12/ { print $0 }
> /21/ { print $0 }' BBS-list inventory-shipped
@@ -1715,7 +1719,7 @@ 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,
+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.(2)
@@ -1736,14 +1740,14 @@ the value of `sum' is 140963.
(*note Actions: Action Overview.). Before you can move on to more
advanced `awk' programming, you have to know how `awk' interprets your
input and displays your output. By manipulating fields and using
-`print' statements, you can produce some very useful and impressive
-looking reports.
+`print' statements, you can produce some very useful and
+impressive-looking reports.
---------- Footnotes ----------
(1) In the C shell (`csh'), you need to type a semicolon and then a
backslash at the end of the first line; see *Note `awk' Statements
-Versus Lines: Statements/Lines, for an explanation as to why. In a
+Versus Lines: Statements/Lines, for an explanation. In a
POSIX-compliant shell, such as the Bourne shell or `bash', you can type
the example as shown. If the command `echo $path' produces an empty
output line, you are most likely using a POSIX-compliant shell.
@@ -1797,13 +1801,13 @@ constant using backslash continuation. Thus, for maximum portability
of your `awk' programs, it is best not to split your lines in the
middle of a regular expression or a string.
- *Caution:* _Backslash continuation does not work as described above
-with the C shell._ It works for `awk' programs in files and for
-one-shot programs, _provided_ you are using a POSIX-compliant shell,
-such as the Unix Bourne shell or `bash'. But the C shell behaves
-differently! There, you must use two backslashes in a row, followed by
-a newline. Note also that when using the C shell, _every_ newline in
-your awk program must be escaped with a backslash. To illustrate:
+ *Caution:* _Backslash continuation does not work as described with
+the C shell._ It works for `awk' programs in files and for one-shot
+programs, _provided_ you are using a POSIX-compliant shell, such as the
+Unix Bourne shell or `bash'. But the C shell behaves differently!
+There, you must use two backslashes in a row, followed by a newline.
+Note also that when using the C shell, _every_ newline in your awk
+program must be escaped with a backslash. To illustrate:
% awk 'BEGIN { \
? print \\
@@ -1826,7 +1830,7 @@ POSIX-compliant shell:
`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 _must_ use backslash continuation; there is no
-other way.
+other option.
Another thing to keep in mind is that backslash continuation and
comments do not mix. As soon as `awk' sees the `#' that starts a
@@ -1876,7 +1880,7 @@ There are other variables your program can set as well to control how
`awk' processes your data.
In addition, `awk' provides a number of built-in functions for doing
-common computational and string related operations. `gawk' provides
+common computational and string-related operations. `gawk' provides
built-in functions for working with timestamps, performing bit
manipulation, and for runtime string translation.
@@ -1908,7 +1912,7 @@ edit-compile-test-debug cycle of software development.
Complex programs have been written in `awk', including a complete
retargetable assembler for eight-bit microprocessors (*note Glossary::,
-for more information), and a microcode assembler for a special purpose
+for more information), and a microcode assembler for a special-purpose
Prolog computer. However, `awk''s capabilities are strained by tasks of
such complexity.
@@ -1945,7 +1949,7 @@ you specify more complicated classes of strings.
* Menu:
* Regexp Usage:: How to Use Regular Expressions.
-* Escape Sequences:: How to write non-printing characters.
+* Escape Sequences:: How to write nonprinting characters.
* Regexp Operators:: Regular Expression Operators.
* Character Lists:: What can go between `[...]'.
* GNU Regexp Operators:: Operators specific to GNU software.
@@ -1972,13 +1976,13 @@ it:
-| 555-6480
-| 555-2127
- 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 `~' and `!~'
-perform regular expression comparisons. Expressions using these
-operators can be used as patterns, or in `if', `while', `for', and `do'
-statements. (*Note Control Statements in Actions: Statements.) For
-example:
+ `~' (tilde), `~' 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 `~' and `!~' perform regular expression
+comparisons. Expressions using these operators can be used as
+patterns, or in `if', `while', `for', and `do' statements. (*Note
+Control Statements in Actions: Statements.) For example:
EXP ~ /REGEXP/
@@ -2025,9 +2029,9 @@ Escape Sequences
(`"foo"') or regexp constants (`/foo/'). Instead, they should be
represented with "escape sequences", which are character sequences
beginning with a backslash (`\'). One use of an escape sequence is to
-include a double quote character in a string constant. Because a plain
+include a double-quote character in a string constant. Because a plain
double quote ends the string, you must use `\"' to represent an actual
-double quote character as a part of the string. For example:
+double-quote character as a part of the string. For example:
$ awk 'BEGIN { print "He said \"hi!\" to her." }'
-| He said "hi!" to her.
@@ -2037,10 +2041,10 @@ included normally; you must write `\\' to put one backslash in the
string or regexp. Thus, the string whose contents are the two
characters `"' and `\' must be written `"\"\\"'.
- 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.
+ 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.
The following table lists all the escape sequences used in `awk' and
what they represent. Unless noted otherwise, all these escape sequences
@@ -2066,7 +2070,7 @@ apply to both string constants and regexp constants:
Carriage return, `Ctrl-m', ASCII code 13 (CR).
`\t'
- Horizontal tab, `Ctrl-i', ASCII code 9 (HT).
+ Horizontal TAB, `Ctrl-i', ASCII code 9 (HT).
`\v'
Vertical tab, `Ctrl-k', ASCII code 11 (VT).
@@ -2078,11 +2082,11 @@ apply to both string constants and regexp constants:
`\xHH...'
The hexadecimal value HH, where HH stands for a sequence of
- hexadecimal digits (`0' through `9', and either `A' through `F' or
- `a' through `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 `\x' escape sequence is not allowed in POSIX `awk'.)
+ hexadecimal digits (`0'-`9', and either `A'-`F' or `a'-`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 `\x'
+ escape sequence is not allowed in POSIX `awk'.)
`\/'
A literal slash (necessary for regexp constants only). This
@@ -2104,13 +2108,13 @@ with a backslash have special meaning in regexps. *Note
`gawk'-Specific Regexp Operators: GNU Regexp Operators.
In a regexp, a backslash before any character that is not in the
-above table and not listed in *Note `gawk'-Specific Regexp Operators:
+previous list and not listed in *Note `gawk'-Specific Regexp Operators:
GNU Regexp Operators, means that the next character should be taken
literally, even if it would normally be a regexp operator. For
example, `/a\+b/' matches the three characters `a+b'.
For complete portability, do not use a backslash before any
-character not shown in the table above.
+character not shown in the previous list.
To summarize:
@@ -2130,29 +2134,28 @@ Advanced Notes: Backslash Before Regular Characters
---------------------------------------------------
If you place a backslash in a string constant before something that
-is not one of the characters listed above, POSIX `awk' purposely leaves
-what happens as undefined. There are two choices:
+is not one of the characters previously listed, POSIX `awk' purposely
+leaves what happens as undefined. There are two choices:
Strip the backslash out
This is what Unix `awk' and `gawk' both do. For example, `"a\qc"'
- is the same as `"aqc"'. (Because this is such an easy bug to both
+ is the same as `"aqc"'. (Because this is such an easy bug both to
introduce and to miss, `gawk' warns you about it.) Consider `FS =
"[ \t]+\|[ \t]+"' to use vertical bars surrounded by whitespace as
- the field separator. There should be two backslashes in the
- string, `FS = "[ \t]+\\|[ \t]+"'.)
+ the field separator. There should be two backslashes in the string
+ `FS = "[ \t]+\\|[ \t]+"'.)
Leave the backslash alone
Some other `awk' implementations do this. In such
- implementations, `"a\qc"' is the same as if you had typed
- `"a\\qc"'.
+ implementations, typing `"a\qc"' is the same as typing `"a\\qc"'.
Advanced Notes: Escape Sequences for Metacharacters
---------------------------------------------------
Suppose you use an octal or hexadecimal escape to represent a regexp
-metacharacter (*note Regular Expression Operators: Regexp Operators.).
-Does `awk' treat the character as a literal character or as a regexp
-operator?
+metacharacter. (See *Note Regular Expression Operators: Regexp
+Operators.) Does `awk' treat the character as a literal character or
+as a regexp operator?
Historically, such characters were taken literally. (d.c.)
However, the POSIX standard indicates that they should be treated as
@@ -2172,9 +2175,9 @@ Regular Expression Operators
power and versatility of regular expressions.
The escape sequences described in *Note Escape Sequences::, are
-valid inside a regexp. They are introduced by a `\', and are
-recognized and converted into the corresponding real characters as the
-very first step in processing regexps.
+valid inside a regexp. They are introduced by a `\' 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:
@@ -2185,10 +2188,10 @@ sequences and that are not listed in the table stand for themselves:
`^'
This matches the beginning of a string. For example, `^@chapter'
- matches `@chapter' at the beginning of a string, and can be used
- to identify chapter beginnings in Texinfo source files. The `^'
- is known as an "anchor", because it anchors the pattern to match
- only at the beginning of the string.
+ matches `@chapter' at the beginning of a string and can be used to
+ identify chapter beginnings in Texinfo source files. The `^' is
+ known as an "anchor", because it anchors the pattern to match only
+ at the beginning of the string.
It is important to realize that `^' does not match the beginning of
a line embedded in a string. The condition is not true in the
@@ -2197,10 +2200,10 @@ sequences and that are not listed in the table stand for themselves:
if ("line1\nLINE 2" ~ /^L/) ...
`$'
- This is similar to `^' but it matches only at the end of a string.
+ This is similar to `^', but it matches only at the end of a string.
For example, `p$' matches a record that ends with a `p'. The `$'
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:
+ string. The condition in the following example is not true:
if ("line1\nLINE 2" ~ /1$/) ...
@@ -2208,8 +2211,8 @@ sequences and that are not listed in the table stand for themselves:
This matches any single character, _including_ the newline
character. For example, `.P' matches any single character
followed by a `P' in a string. Using concatenation, we can make a
- regular expression such as `U.A', that matches any three-character
- sequence that begins with `U' and ends with `A'.
+ regular expression such as `U.A', which matches any
+ three-character sequence that begins with `U' and ends with `A'.
In strict POSIX mode (*note Command-Line Options: Options.), `.'
does not match the NUL character, which is a character with all
@@ -2219,7 +2222,7 @@ sequences and that are not listed in the table stand for themselves:
`[...]'
This is called a "character list".(1) It matches any _one_ of the
characters that are enclosed in the square brackets. For example,
- `[MVX]' matches any one of the characters `M', `V', or `X', in a
+ `[MVX]' matches any one of the characters `M', `V', or `X' in a
string. A full discussion of what can be inside the square
brackets of a character list is given in *Note Using Character
Lists: Character Lists.
@@ -2228,7 +2231,7 @@ sequences and that are not listed in the table stand for themselves:
This is a "complemented character list". The first character after
the `[' _must_ be a `^'. It matches any characters _except_ those
in the square brackets. For example, `[^awk]' matches any
- character that is not an `a', a `w', or a `k'.
+ character that is not an `a', `w', or `k'.
`|'
This is the "alternation operator" and it is used to specify
@@ -2241,8 +2244,8 @@ sequences and that are not listed in the table stand for themselves:
side.
`(...)'
- Parentheses are used for grouping in regular expressions, similar
- to arithmetic. They can be used to concatenate regular expressions
+ Parentheses are used for grouping in regular expressions, as in
+ arithmetic. They can be used to concatenate regular expressions
containing the alternation operator, `|'. For example,
`@(samp|code)\{[^}]+\}' matches both `@code{foo}' and `@samp{bar}'.
(These are Texinfo formatting control sequences.)
@@ -2263,18 +2266,18 @@ sequences and that are not listed in the table stand for themselves:
preceding them with backslashes.
`+'
- This symbol is similar to `*' except that the preceding expression
- must be matched at least once. This means that `wh+y' would match
- `why' and `whhy', but not `wy', whereas `wh*y' would match all
- three of these strings. The following is a simpler way of writing
- the last `*' example:
+ This symbol is similar to `*', except that the preceding
+ expression must be matched at least once. This means that `wh+y'
+ would match `why' and `whhy', but not `wy', whereas `wh*y' would
+ match all three of these strings. The following is a simpler way
+ of writing the last `*' example:
awk '/\(c[ad]+r x\)/ { print }' sample
`?'
- This symbol is similar to `*' except that the preceding expression
- can be matched either once or not at all. For example, `fe?d'
- matches `fed' and `fd', but nothing else.
+ This symbol is similar to `*', except that the preceding
+ expression can be matched either once or not at all. For example,
+ `fe?d' matches `fed' and `fd', but nothing else.
`{N}'
`{N,}'
@@ -2327,7 +2330,8 @@ available in regular expressions.
---------- Footnotes ----------
(1) In other literature, you may see a character list referred to as
-either a "character set", a "character class" or a "bracket expression".
+either a "character set", a "character class", or a "bracket
+expression".
(2) Use two backslashes if you're using a string constant with a
regexp operator or function.
@@ -2372,11 +2376,11 @@ differs between the United States and France.
A character class is only valid in a regexp _inside_ the brackets of
a character list. Character classes consist of `[:', a keyword
denoting the class, and `:]'. Here are the character classes defined
-by the POSIX standard:
+by the POSIX standard.
`[:alnum:]' Alphanumeric characters.
`[:alpha:]' Alphabetic characters.
-`[:blank:]' Space and tab characters.
+`[:blank:]' Space and TAB characters.
`[:cntrl:]' Control characters.
`[:digit:]' Numeric characters.
`[:graph:]' Characters that are both printable and visible. (A space is
@@ -2386,7 +2390,7 @@ by the POSIX standard:
characters).
`[:punct:]' Punctuation characters (characters that are not letters,
digits, control characters, or space characters).
-`[:space:]' Space characters (such as space, tab, and formfeed, to name a
+`[:space:]' Space characters (such as space, TAB, and formfeed, to name a
few).
`[:upper:]' Uppercase alphabetic characters.
`[:xdigit:]' Characters that are hexadecimal digits.
@@ -2404,26 +2408,24 @@ These apply to non-ASCII character sets, which can have single symbols
(called "collating elements") that are represented with more than one
character. They can also have several characters that are equivalent for
"collating", or sorting, purposes. (For example, in French, a plain "e"
-and a grave-accented "e`" are equivalent.)
+and a grave-accented "e`" are equivalent.) These sequences are:
-Collating Symbols
- A "collating symbol" is a multicharacter collating element
- enclosed between `[.' and `.]'. For example, if `ch' is a
- collating element, then `[[.ch.]]' is a regexp that matches this
- collating element, whereas `[ch]' is a regexp that matches either
- `c' or `h'.
+Collating symbols
+ Multicharacter collating elements enclosed between `[.' and `.]'.
+ For example, if `ch' is a collating element, then `[[.ch.]]' is a
+ regexp that matches this collating element, whereas `[ch]' is a
+ regexp that matches either `c' or `h'.
-Equivalence Classes
- An "equivalence class" is a locale-specific name for a list of
- characters that are equal. The name is enclosed between `[=' and
- `=]'. For example, the name `e' might be used to represent all of
- "e," "e`," and "e'." In this case, `[[=e=]]' is a regexp that
- matches any of `e', `e'', or `e`'.
+Equivalence classes
+ Locale-specific names for a list of characters that are equal. The
+ name is enclosed between `[=' and `=]'. For example, the name `e'
+ might be used to represent all of "e," "e`," and "e'." In this
+ case, `[[=e=]]' is a regexp that matches any of `e', `e'', or `e`'.
- These features are very valuable in non-English speaking locales.
+ These features are very valuable in non-English-speaking locales.
*Caution:* The library functions that `gawk' uses for regular
-expression matching currently only recognize POSIX character classes;
+expression matching currently recognize only POSIX character classes;
they do not recognize collating symbols or equivalence classes.

@@ -2441,12 +2443,12 @@ letters, digits, or underscores (`_'):
`\w'
Matches any word-constituent character--that is, it matches any
- letter, digit, or underscore. Think of it as short-hand for
+ letter, digit, or underscore. Think of it as shorthand for
`[[:alnum:]_]'.
`\W'
Matches any character that is not word-constituent. Think of it
- as short-hand for `[^[:alnum:]_]'.
+ as shorthand for `[^[:alnum:]_]'.
`\<'
Matches the empty string at the beginning of a word. For example,
@@ -2469,7 +2471,7 @@ letters, digits, or underscores (`_'):
There are two other operators that work on buffers. In Emacs, a
"buffer" is, naturally, an Emacs buffer. For other programs, `gawk''s
regexp library routines consider the entire string to match as the
-buffer.
+buffer. The operators are:
`\`'
Matches the empty string at the beginning of a buffer (string).
@@ -2505,7 +2507,7 @@ No options
`--traditional'
Traditional Unix `awk' regexps are matched. The GNU operators are
not special, interval expressions are not available, nor are the
- POSIX character classes (`[[:alnum:]]' and so on). Characters
+ POSIX character classes (`[[:alnum:]]', etc.). Characters
described by octal and hexadecimal escape sequences are treated
literally, even if they represent regexp metacharacters.
@@ -2526,8 +2528,8 @@ lowercase `w' and not an uppercase `W'.
The simplest way to do a case-independent match is to use a character
list--for example, `[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.
+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 program is to convert the data to a single case, using the
@@ -2543,9 +2545,10 @@ works in any POSIX-compliant `awk'.
Another method, specific to `gawk', is to set the variable
`IGNORECASE' to a nonzero value (*note Built-in Variables::). When
`IGNORECASE' is not zero, _all_ regexp and string operations ignore
-case. Changing the value of `IGNORECASE' dynamically controls the case
-sensitivity of the program as it runs. Case is significant by default
-because `IGNORECASE' (like most variables) is initialized to zero:
+case. Changing the value of `IGNORECASE' dynamically controls the
+case-sensitivity of the program as it runs. Case is significant by
+default because `IGNORECASE' (like most variables) is initialized to
+zero:
x = "aB"
if (x ~ /ab/) ... # this test will fail
@@ -2574,7 +2577,7 @@ comparison operations are also affected by `IGNORECASE'.
Beginning with `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
+ASCII characters, which also provides a number of characters suitable
for use with European languages.
The value of `IGNORECASE' has no effect if `gawk' is in
@@ -2645,7 +2648,7 @@ going to use a string constant, you have to understand that the string
is, in essence, scanned _twice_: the first time when `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 `digits_regexp' shown
+true of any string-valued expression (such as `digits_regexp', shown
previously), not just string constants.
What difference does it make if the string is scanned twice? The
@@ -2668,7 +2671,7 @@ constants," for several reasons:
kinds of constants is a common source of errors.
* It is more efficient to use regexp constants. `awk' can note that
- you have supplied a regexp, and store it internally in a form that
+ you have supplied a regexp and store it internally in a form that
makes pattern matching more efficient. When using a string
constant, `awk' must first convert the string into this internal
form and then perform the pattern matching.
@@ -2706,8 +2709,8 @@ Reading Input Files
*******************
In the typical `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
+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
`awk' command line. If you specify input files, `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
@@ -2729,7 +2732,7 @@ have to be named on the `awk' command line (*note Explicit Input with
* Records:: Controlling how data is split into records.
* Fields:: An introduction to fields.
-* Non-Constant Fields:: Non-constant Field Numbers.
+* 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.
@@ -2775,9 +2778,8 @@ a string whose first character is a slash; as a result, records are
separated by slashes. Then the input file is read, and the second rule
in the `awk' program (the action with no pattern) prints each record.
Because each `print' statement adds a newline at the end of its output,
-the effect of this `awk' program is to copy the input with each slash
-changed to a newline. Here are the results of running the program on
-`BBS-list':
+this `awk' program copies the input with each slash changed to a
+newline. Here are the results of running the program on `BBS-list':
$ awk 'BEGIN { RS = "/" }
> { print $0 }' BBS-list
@@ -2860,7 +2862,7 @@ general, each record ends at the next string that matches the regular
expression; the next record starts at the end of the matching string.
This general rule is actually at work in the usual case, where `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
+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 `RS', is not
part of either record.
@@ -2926,13 +2928,13 @@ the end of the previous ones.
(1) At least that we know about.

-File: gawk.info, Node: Fields, Next: Non-Constant Fields, Prev: Records, Up: Reading Files
+File: gawk.info, Node: Fields, Next: Nonconstant Fields, Prev: Records, Up: Reading Files
Examining Fields
================
When `awk' reads an input record, the record is automatically
-separated or "parsed" by the interpreter into chunks called "fields".
+"parsed" or separated by the interpreter into chunks called "fields".
By default, fields are separated by "whitespace", like words in a line.
Whitespace in `awk' means any string of one or more spaces, tabs, or
newlines;(1) other characters, such as formfeed, vertical tab, etc.
@@ -2948,8 +2950,8 @@ simple `awk' programs so powerful.
followed by the number of the field you want. Thus, `$1' refers to the
first field, `$2' to the second, and so on. (Unlike the Unix shells,
the field numbers are not limited to single digits. `$127' is the one
-hundred and twenty-seventh field in the record.) For example, suppose
-the following is a line of input:
+hundred twenty-seventh field in the record.) For example, suppose the
+following is a line of input:
This seems like a pretty nice example.
@@ -2966,9 +2968,9 @@ as `$7', which is `example.'. If you try to reference a field beyond
the last one (such as `$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 `$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:
+ The use of `$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:
$ awk '$1 ~ /foo/ { print $0 }' BBS-list
-| fooey 555-1234 2400/1200/300 B
@@ -2998,10 +3000,10 @@ input record:
separating fields.

-File: gawk.info, Node: Non-Constant Fields, Next: Changing Fields, Prev: Fields, Up: Reading Files
+File: gawk.info, Node: Nonconstant Fields, Next: Changing Fields, Prev: Fields, Up: Reading Files
-Non-Constant Field Numbers
-==========================
+Nonconstant Field Numbers
+=========================
The number of a field does not need to be a constant. Any
expression in the `awk' language can be used after a `$' to refer to a
@@ -3044,7 +3046,7 @@ feature--it is the direct consequence of evaluating `NF' and using its
value as a field number.

-File: gawk.info, Node: Changing Fields, Next: Field Separators, Prev: Non-Constant Fields, Up: Reading Files
+File: gawk.info, Node: Changing Fields, Next: Field Separators, Prev: Nonconstant Fields, Up: Reading Files
Changing the Contents of a Field
================================
@@ -3052,7 +3054,7 @@ Changing the Contents of a Field
The contents of a field, as seen by `awk', can be changed within an
`awk' program; this changes what `awk' perceives as the current input
record. (The actual input is untouched; `awk' _never_ modifies the
-input file.) Consider this example and its output:
+input file.) Consider the following example and its output:
$ awk '{ nboxes = $3 ; $3 = $3 - 10
> print nboxes, $3 }' inventory-shipped
@@ -3259,8 +3261,8 @@ example, the assignment:
FS = ", \t"
makes every area of an input line that consists of a comma followed by a
-space and a tab into a field separator. (`\t' is an "escape sequence"
-that stands for a tab; *note Escape Sequences::, for the complete list
+space and a TAB into a field separator. (`\t' is an "escape sequence"
+that stands for a TAB; *note Escape Sequences::, for the complete list
of similar escape sequences.)
For a less trivial example of a regular expression, try using single
@@ -3341,12 +3343,12 @@ For example:
awk -F, 'PROGRAM' INPUT-FILES
-sets `FS' to the `,' character. Notice that the option uses a capital
-`F' instead of a lowercase `-f', which specifies a file containing an
-`awk' program. Case is significant in command-line options: the `-F'
-and `-f' options have nothing to do with each other. You can use both
-options at the same time to set the `FS' variable _and_ get an `awk'
-program from a file.
+sets `FS' to the `,' character. Notice that the option uses an
+uppercase `F' instead of a lowercase `f'. The latter option (`-f')
+specifies a file containing an `awk' program. Case is significant in
+command-line options: the `-F' and `-f' options have nothing to do with
+each other. You can use both options at the same time to set the `FS'
+variable _and_ get an `awk' program from a file.
The value used for the argument to `-F' is processed in exactly the
same way as assignments to the built-in variable `FS'. Any special
@@ -3364,7 +3366,7 @@ separator.
As a special case, in compatibility mode (*note Command-Line
Options: Options.), if the argument to `-F' is `t', then `FS' is set to
-the tab character. If you type `-F\t' at the shell, without any
+the TAB character. If you type `-F\t' at the shell, without any
quotes, the `\' gets deleted, so `awk' figures that you really want
your fields to be separated with tabs and not `t's. Use `-v FS="t"' or
`-F"[t]"' on the command line if you really do want to separate your
@@ -3421,11 +3423,11 @@ the entries for users who have no password:

File: gawk.info, Node: Field Splitting Summary, Prev: Command Line Field Separator, Up: Field Separators
-Field Splitting Summary
+Field-Splitting Summary
-----------------------
The following table summarizes how fields are split, based on the
-value of `FS'. (`==' means "is equal to.")
+value of `FS' (`==' means "is equal to"):
`FS == " "'
Fields are separated by runs of whitespace. Leading and trailing
@@ -3525,7 +3527,7 @@ use of `FIELDWIDTHS':
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.
+calculated idle time:
*Note:* This program uses a number of `awk' features that haven't
been introduced yet.
@@ -3567,8 +3569,8 @@ An `awk' program for processing such data could use the `FIELDWIDTHS'
feature to simplify reading the data. (Of course, getting `gawk' to
run on a system with card readers is another story!)
- Assigning a value to `FS' causes `gawk' to return to using `FS' for
-field splitting. Use `FS = FS' to make this happen, without having to
+ Assigning a value to `FS' causes `gawk' to use `FS' for field
+splitting again. Use `FS = FS' to make this happen, without having to
know the current value of `FS'. In order to tell which kind of field
splitting is in effect, use `PROCINFO["FS"]' (*note Built-in Variables
That Convey Information: Auto-set.). The value is `"FS"' if regular
@@ -3606,7 +3608,7 @@ well be used, as long as it won't be part of the data in a record.
special dispensation, an empty string as the value of `RS' indicates
that records are separated by one or more blank lines. When `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
+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 whitespace do not count.)
@@ -3616,7 +3618,7 @@ empty; lines that contain only whitespace do not count.)
record and one or more blank lines after the record. In addition, a
regular expression always matches the longest possible sequence when
there is a choice (*note How Much Text Matches?: Leftmost Longest.).
-So the next record doesn't start until the first non-blank line that
+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.
@@ -3646,7 +3648,7 @@ line: to do this, just set the variable `FS' to the string `"\n"'.
(This simple regular expression matches a single newline.) A practical
example of a data file organized this way might be a mailing list,
where each entry is separated by blank lines. Consider a mailing list
-in a file named `addresses', that looks like this:
+in a file named `addresses', which looks like this:
Jane Doe
123 Main Street
@@ -3708,7 +3710,7 @@ equal to.")
`RS == REGEXP'
Records are separated by occurrences of characters that match
REGEXP. Leading and trailing matches of REGEXP delimit empty
- records. (This is a `gawk' extension, it is not specified by the
+ records. (This is a `gawk' extension; it is not specified by the
POSIX standard.)
In all cases, `gawk' sets `RT' to the input text that matched the
@@ -3734,8 +3736,8 @@ have reviewed the rest of this Info file and have a good knowledge of
how `awk' works.
The `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 `getline' returns
+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 `getline' returns
-1. In this case, `gawk' sets the variable `ERRNO' to a string
describing the error that occurred.
@@ -3768,7 +3770,7 @@ Using `getline' with No Arguments
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 _right now_ on the next record. Here's an example:
+processing on the next record _right now_. For example:
{
if ((t = index($0, "/*")) != 0) {
@@ -3821,8 +3823,7 @@ suppose the next line is a comment or a special string, and you want to
read it without triggering any rules. This form of `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 `awk' never sees it. The
-following example swaps every two lines of input. The program is as
-follows:
+following example swaps every two lines of input:
{
if ((getline tmp) > 0) {
@@ -3912,8 +3913,8 @@ file FILENAME:
}
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 `@include' line.
+program; it is taken directly from the data, specifically from the
+second field on the `@include' line.
The `close' function is called to ensure that if two identical
`@include' lines appear in the input, the entire specified file is
@@ -3971,13 +3972,13 @@ the program might produce:
bill ttyp1 Jul 13 14:23 (murphy:0)
bletch
-Notice that this program ran the 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.)
+Notice that this program ran the 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 `getline' splits the record into fields, sets the
-value of `NF' and recomputes the value of `$0'. The values of `NR' and
-`FNR' are not changed.
+value of `NF', and recomputes the value of `$0'. The values of `NR'
+and `FNR' are not changed.
According to POSIX, `EXPRESSION | getline' is ambiguous if
EXPRESSION contains unparenthesized operators other than `$'--for
@@ -4031,7 +4032,7 @@ your `awk' program.
processing and then read the results back. `gawk' allows you start a
"coprocess", with which two-way communications are possible. This is
done with the `|&' operator. Typically, you write data to the
-coprocess first, and then read results back, as shown in the following:
+coprocess first and then read results back, as shown in the following:
print "SOME QUERY" |& "db_server"
"db_server" |& getline
@@ -4040,8 +4041,8 @@ which sends a query to `db_server' and then reads the results.
The values of `NR' and `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 `$0', the other fields, and
-of `NF'.
+normal manner, thus changing the values of `$0', of the other fields,
+and of `NF'.
Coprocesses are an advanced feature. They are discussed here only
because this is the minor node on `getline'. *Note Two-Way
@@ -4070,7 +4071,7 @@ discussed in more detail.

File: gawk.info, Node: Getline Notes, Next: Getline Summary, Prev: Getline/Variable/Coprocess, Up: Getline
-Points About `getline' to Remember
+Points to Remember About `getline'
----------------------------------
Here are some miscellaneous points about `getline' that you should
@@ -4105,15 +4106,15 @@ Summary of `getline' Variants
The following table summarizes the eight variants of `getline',
listing which built-in variables are set by each one.
-`getline' Sets `$0', `NF', `FNR' and `NR'
-`getline' VAR Sets VAR, `FNR' and `NR'
+`getline' Sets `$0', `NF', `FNR', and `NR'
+`getline' VAR Sets VAR, `FNR', and `NR'
`getline <' FILE Sets `$0' and `NF'
`getline VAR < FILE' Sets VAR
COMMAND `| getline' Sets `$0' and `NF'
COMMAND `| getline' VAR Sets VAR
-COMMAND `|& getline' Sets `$0' and `NF' (this is a `gawk'
- extension)
-COMMAND `|& getline' VAR Sets VAR (this is a `gawk' extension)
+COMMAND `|& getline' Sets `$0' and `NF'. This is a `gawk'
+ extension
+COMMAND `|& getline' VAR Sets VAR. This is a `gawk' extension

File: gawk.info, Node: Printing, Next: Expressions, Prev: Reading Files, Up: Top
@@ -4121,16 +4122,16 @@ File: gawk.info, Node: Printing, Next: Expressions, Prev: Reading Files, Up:
Printing Output
***************
- One of the most common programming actions is to "print" or output,
+ One of the most common programming actions is to "print", or output,
some or all of the input. Use the `print' statement for simple output,
and the `printf' statement for fancier formatting. The `print'
statement is not limited when computing _which_ values to print.
However, with two exceptions, you cannot specify _how_ to print
them--how many columns, whether to use exponential notation or not, and
so on. (For the exceptions, *note Output Separators::, and *Note
-Controlling Numeric Output with `print': OFMT.) For that, you need the
-`printf' statement (*note Using `printf' Statements for Fancier
-Printing: Printf.).
+Controlling Numeric Output with `print': OFMT.) For printing with
+specifications, you need the `printf' statement (*note Using `printf'
+Statements for Fancier Printing: Printf.).
Besides basic and formatted printing, this major node also covers
I/O redirections to files and pipes, introduces the special file names
@@ -4177,9 +4178,9 @@ Numeric values are converted to strings and then printed.
$0': it prints the entire current record. To print a blank line, use
`print ""', where `""' is the empty string. To print a fixed piece of
text, use a string constant, such as `"Don't Panic"', as one item. If
-you forget to use the double quote characters, your text is taken as an
-`awk' expression and you will probably get an error. Keep in mind that
-a space is printed between any two items.
+you forget to use the double-quote characters, your text is taken as an
+`awk' expression, and you will probably get an error. Keep in mind
+that a space is printed between any two items.

File: gawk.info, Node: Print Examples, Next: Output Separators, Prev: Print, Up: Printing
@@ -4371,8 +4372,9 @@ Introduction to the `printf' Statement
The entire list of arguments may optionally be enclosed in parentheses.
The parentheses are necessary if any of the item expressions use the
-`>' relational operator; otherwise it can be confused with a redirection
-(*note Redirecting Output of `print' and `printf': Redirection.).
+`>' relational operator; otherwise, it can be confused with a
+redirection (*note Redirecting Output of `print' and `printf':
+Redirection.).
The difference between `printf' and `print' is the FORMAT argument.
This is an expression whose value is taken as a string; it specifies
@@ -4464,7 +4466,7 @@ width. Here is a list of the format-control letters:
`A' through `F' instead of `a' through `f'.
`%%'
- This isn't a format-control letter but it does have meaning--the
+ This isn't a format-control letter, but it does have meaning--the
sequence `%%' outputs one `%'; it does not consume an argument and
it ignores any modifiers.
@@ -4492,7 +4494,7 @@ which they may appear:
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:
+ Positional specifiers begin counting with one. Thus:
printf "%s %s\n", "don't", "panic"
printf "%2$s %1$s\n", "panic", "don't"
@@ -4506,7 +4508,7 @@ which they may appear:
For now, we will not use them.
`-'
- The minus sign, used before the width modifier (see further on in
+ 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 is printed
right-justified in the specified width. Thus:
@@ -4520,7 +4522,7 @@ which they may appear:
negative values with a minus sign.
`+'
- The plus sign, used before the width modifier (see further on in
+ 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 `+' overrides the
space modifier.
@@ -4773,14 +4775,14 @@ work identically for `printf':
close(report)
The message is built using string concatenation and saved in the
- variable `m'. It is then sent down the pipeline to the `mail'
+ variable `m'. It's then sent down the pipeline to the `mail'
program. (The parentheses group the items to concatenate--see
*Note String Concatenation: Concatenation.)
The `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. *Note Closing Input and Output Redirections: Close Files And
- Pipes, for more information on this.
+ Pipes, for more information.
This example also illustrates the use of a variable to represent a
FILE or COMMAND--it is not necessary to always use a string
@@ -4792,15 +4794,15 @@ work identically for `printf':
This type of redirection prints the items to the input of COMMAND.
The difference between this and the single-`|' redirection is that
the output from COMMAND can be read with `getline'. Thus COMMAND
- is a "coprocess", that works together with, but subsidiary to, the
- `awk' program.
+ is a "coprocess", which works together with, but subsidiary to,
+ the `awk' program.
This feature is a `gawk' extension, and is not available in POSIX
`awk'. *Note Two-Way Communications with Another Process: Two-way
I/O, for a more complete discussion.
Redirecting output using `>', `>>', `|', or `|&' asks the system to
-open a file, pipe, or coprocess, only if the particular FILE or COMMAND
+open a file, pipe, or coprocess only if the particular FILE or COMMAND
you specify has not already been written to by your program or if it
has been closed since it was last written to.
@@ -4827,7 +4829,7 @@ Advanced Notes: Piping into `sh'
--------------------------------
A particularly powerful way to use redirection is to build command
-lines, and pipe them into the shell, `sh'. For example, suppose you
+lines and pipe them into the shell, `sh'. For example, suppose you
have a list of files brought over from a system where all the file names
are stored in uppercase, and you wish to rename them to have names in
all lowercase. The following program is both simple and efficient:
@@ -4871,7 +4873,7 @@ the "standard input", "standard output", and "standard error output".
These streams are, by default, connected to your terminal, but they are
often redirected with the shell, via the `<', `<<', `>', `>>', `>&',
and `|' operators. Standard error is typically used for writing error
-messages; the reason there are two separate streams, standard output,
+messages; the reason there are two separate streams, standard output
and standard error, is so that they can be redirected separately.
In other implementations of `awk', the only way to write an error
@@ -4897,8 +4899,8 @@ opening `/dev/tty' fails.
streams, as well as any other inherited open files. If the file name
matches one of these special names when `gawk' redirects input or
output, then it directly uses the stream that the file name stands for.
-(These special file names work for all operating systems that `gawk'
-has been ported to, not just those that are POSIX-compliant.):
+These special file names work for all operating systems that `gawk' has
+been ported to, not just those that are POSIX-compliant:
`/dev/stdin'
The standard input (file descriptor 0).
@@ -4994,7 +4996,7 @@ Special Files for Network Communications
----------------------------------------
Starting with version 3.1 of `gawk', `awk' programs can open a
-two-way TCP/IP connection, acting as either a client or server. This
+two-way TCP/IP connection, acting as either a client or a server. This
is done using a special file name of the form:
`/inet/PROTOCOL/LOCAL-PORT/REMOTE-HOST/REMOTE-PORT'
@@ -5015,7 +5017,7 @@ Special File Name Caveats
-------------------------
Here is a list of things to bear in mind when using the special file
-names that `gawk' provides.
+names that `gawk' provides:
* Recognition of these special file names is disabled if `gawk' is in
compatibility mode (*note Command-Line Options: Options.).
@@ -5036,12 +5038,12 @@ names that `gawk' provides.
---------- Footnotes ----------
- (1) Older versions of `gawk' would only interpret these names
-internally if the system did not actually have a a `/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
-`gawk''s behavior consistent on all systems and to have it always
-interpret the special file names itself.
+ (1) Older versions of `gawk' would interpret these names internally
+only if the system did not actually have a `/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 `gawk''s
+behavior consistent on all systems and to have it always interpret the
+special file names itself.

File: gawk.info, Node: Close Files And Pipes, Prev: Special Files, Up: Printing
@@ -5273,11 +5275,11 @@ forms, but are stored identically internally.
* Menu:
* Scalar Constants:: Numeric and string constants.
-* Non-decimal-numbers:: What are octal and hex numbers.
+* Nondecimal-numbers:: What are octal and hex numbers.
* Regexp Constants:: Regular Expression constants.

-File: gawk.info, Node: Scalar Constants, Next: Non-decimal-numbers, Prev: Constants, Up: Constants
+File: gawk.info, Node: Scalar Constants, Next: Nondecimal-numbers, Prev: Constants, Up: Constants
Numeric and String Constants
----------------------------
@@ -5292,7 +5294,7 @@ the same value:
1050e-1
A string constant consists of a sequence of characters enclosed in
-double quote marks. For example:
+double-quotation marks. For example:
"parrot"
@@ -5309,7 +5311,7 @@ uses double-precision floating-point numbers. On most modern systems,
these are in IEEE 754 standard format.

-File: gawk.info, Node: Non-decimal-numbers, Next: Regexp Constants, Prev: Scalar Constants, Up: Constants
+File: gawk.info, Node: Nondecimal-numbers, Next: Regexp Constants, Prev: Scalar Constants, Up: Constants
Octal and Hexadecimal Numbers
-----------------------------
@@ -5317,14 +5319,14 @@ Octal and Hexadecimal Numbers
In `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 `11' in decimal is 1
-times 10 plus 1, so `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 (`0'--`9'), the
-letters `a' through `f' are used to represent the rest. (Case in the
-letters is usually irrelevant; hexadecimal `a' and `A' have the same
-value.) Thus, `11' in hexadecimal is 1 times 16 plus 1, which equals
-17 in decimal.
+1, 2, 3, 4, 5, 6, 7, 10, 11, 12, etc. Just as `11', in decimal, is 1
+times 10 plus 1, so `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 (`0'-`9'), the letters `a'
+through `f' are used to represent the rest. (Case in the letters is
+usually irrelevant; hexadecimal `a' and `A' have the same value.)
+Thus, `11', in hexadecimal, is 1 times 16 plus 1, which equals 17 in
+decimal.
Just by looking at plain `11', you can't tell what base it's in.
So, in C, C++, and other languages derived from C, there is a special
@@ -5332,7 +5334,7 @@ notation to help signify the base. Octal numbers start with a leading
`0', and hexadecimal numbers start with a leading `0x' or `0X':
`11'
- Decimal 11.
+ Decimal value 11.
`011'
Octal 11, decimal value 9.
@@ -5354,7 +5356,7 @@ of various sorts.
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 `--non-decimal-data' command-line
-option, *note Allowing Non-Decimal Input Data: Non-decimal Data..) If
+option; *note Allowing Nondecimal Input Data: Nondecimal Data..) If
you have octal or hexadecimal data, you can use the `strtonum' function
(*note String Manipulation Functions: String Functions.) to convert
the data into a number. Most of the time, you will want to use octal
@@ -5363,7 +5365,7 @@ manipulation functions; see *Note Using `gawk''s Bit Manipulation
Functions: Bitwise Functions, for more information.
Unlike some early C implementations, `8' and `9' are not valid in
-octal constants; e.g., `gawk' treats `018' as decimal 18.
+octal constants; e.g., `gawk' treats `018' as decimal 18:
$ gawk 'BEGIN { print "021 is", 021 ; print 018 }'
-| 021 is 17
@@ -5385,7 +5387,7 @@ for conversion of numbers to strings:
-| 0x11 is <17>

-File: gawk.info, Node: Regexp Constants, Prev: Non-decimal-numbers, Up: Constants
+File: gawk.info, Node: Regexp Constants, Prev: Nondecimal-numbers, Up: Constants
Regular Expression Constants
----------------------------
@@ -5406,7 +5408,7 @@ Using Regular Expression Constants
regexp constant merely stands for the regexp that is to be matched.
However, regexp constants (such as `/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.; `($0 ~ /foo/)' (d.c.)
+meaning as if it appeared in a pattern, i.e., `($0 ~ /foo/)' (d.c.)
*Note Expressions as Patterns: Expression Patterns. This means that
the following two code segments:
@@ -5447,7 +5449,7 @@ of the `match' function (*note String Manipulation Functions: String
Functions.). Modern implementations of `awk', including `gawk', allow
the third argument of `split' to be a regexp constant, but some older
implementations do not. (d.c.) This can lead to confusion when
-attempting to use regexp constants as arguments to user defined
+attempting to use regexp constants as arguments to user-defined
functions (*note User-Defined Functions: User-defined.). For example:
function mysub(pat, repl, str, global)
@@ -5569,9 +5571,9 @@ second field is printed in lines from `BBS-list':
...
Command-line arguments are made available for explicit examination by
-the `awk' program in an array named `ARGV' (*note Using `ARGC' and
-`ARGV': ARGC and ARGV.). `awk' processes the values of command-line
-assignments for escape sequences (d.c.) (*note Escape Sequences::).
+the `awk' program in the `ARGV' array (*note Using `ARGC' and `ARGV':
+ARGC and ARGV.). `awk' processes the values of command-line
+assignments for escape sequences (*note Escape Sequences::). (d.c.)

File: gawk.info, Node: Conversion, Next: Arithmetic Ops, Prev: Variables, Up: Expressions
@@ -5592,7 +5594,7 @@ are converted to strings. Consider the following:
This prints the (numeric) value 27. The numeric values of the
variables `two' and `three' are converted to strings and concatenated
together. The resulting string is converted back to the number 23, to
-which four is then added.
+which 4 is then added.
If, for some reason, you need to force a number to be converted to a
string, concatenate the empty string, `""', with that number. To force
@@ -5724,7 +5726,7 @@ that `X % Y' is negative if X is negative. Thus:
-17 % 8 = -1
In other `awk' implementations, the signedness of the remainder may
-be machine dependent.
+be machine-dependent.
*Note:* The POSIX standard only specifies the use of `^' for
exponentiation. For maximum portability, do not use the `**' operator.
@@ -5849,7 +5851,7 @@ Arrays.). These are all called "lvalues", 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 "rvalues").
+are called "rvalues".)
It is important to note that variables do _not_ have permanent types.
A variable's type is simply the type of whatever value it happens to
@@ -5872,8 +5874,7 @@ zero. After executing the following code, the value of `foo' is five:
*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 `awk' works, _not_ how you should write your own
-programs!
+illustrate how `awk' works, _not_ how you should write your programs!
An assignment is an expression, so it has a value--the same value
that is assigned. Thus, `z = 1' is an expression with the value one.
@@ -5969,7 +5970,7 @@ A workaround is:
awk '/[=]=/' /dev/null
- `gawk' does not have this problem, nor do the other freely-available
+ `gawk' does not have this problem, nor do the other freely available
versions described in *Note Other Freely Available `awk'
Implementations: Other Versions.
@@ -5981,8 +5982,8 @@ Increment and Decrement Operators
"Increment" and "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 `awk' language; however they
-are convenient abbreviations for very common operations.
+the increment operators add no power to the `awk' language; however,
+they are convenient abbreviations for very common operations.
The operator used for adding one is written `++'. It can be used to
increment a variable either before or after taking its value. To
@@ -6070,7 +6071,7 @@ concepts of "true" and "false." Such languages usually use the special
constants `true' and `false', or perhaps their uppercase equivalents.
However, `awk' is different. It borrows a very simple concept of true
and false from C. In `awk', any nonzero numeric value _or_ any
-non-empty string value is true. Any other value (zero or the null
+nonempty string value is true. Any other value (zero or the null
string `""') is false. The following program prints `A strange truth
value' three times:
@@ -6300,7 +6301,7 @@ also referred to as "logical expressions". The terms are equivalent.
Boolean expressions can be used wherever comparison and matching
expressions can be used. They can be used in `if', `while', `do', and
`for' statements (*note Control Statements in Actions: Statements.).
-They have numeric values (one if true, zero if false), that come into
+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.
@@ -6456,7 +6457,8 @@ concatenation of a variable with an expression inside parentheses.
but 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 `sqrt' function must
-be called with a single argument: the number to take the square root of:
+be called with a single argument, the number of which to take the
+square root:
sqrt(ARGUMENT)
@@ -6516,7 +6518,7 @@ interpret them: innermost first. Thus, `$++i' means `$(++i)' and
operand, then the precedence of the unary operators can matter. `$x^2'
means `($x)^2', but `-x^2' means `-(x^2)', because `-' has lower
precedence than `^', whereas `$' has higher precedence. This table
-presents `awk''s operators, in order of highest precedence to lowest:
+presents `awk''s operators, in order of highest to lowest precedence:
`(...)'
Grouping.
@@ -6556,12 +6558,12 @@ presents `awk''s operators, in order of highest precedence to lowest:
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
+ precedence without parentheses. Such combinations (for example,
`print foo > a ? b : c'), result in syntax errors. The correct
way to write this statement is `print foo > (a ? b : c)'.
`~ !~'
- Matching, non-matching.
+ Matching, nonmatching.
`in'
Array membership.
@@ -6577,7 +6579,7 @@ presents `awk''s operators, in order of highest precedence to lowest:
`= += -= *='
`/= %= ^= **='
- Assignment. These operators group right-to-left.
+ Assignment. These operators group right to left.
*Note:* The `|&', `**', and `**=' operators are not specified by
POSIX. For maximum portability, do not use them.
@@ -6623,7 +6625,7 @@ Pattern Elements
Patterns in `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 `awk':
+summary of the types of `awk' patterns:
`/REGULAR EXPRESSION/'
A regular expression. It matches when the text of the input record
@@ -6675,13 +6677,13 @@ 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 `$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
+otherwise, it depends on only what has happened so far in the execution
of the `awk' program.
Comparison expressions, using the comparison operators described in
*Note Variable Typing and Comparison Expressions: Typing and Comparison,
-are a very common kind of pattern. Regexp matching and non-matching
-are also very common expressions. The left operand of the `~' and `!~'
+are a very common kind of pattern. Regexp matching and nonmatching are
+also very common expressions. The left operand of the `~' and `!~'
operators is a string. The right operand is either a constant regular
expression enclosed in slashes (`/REGEXP/'), or any expression whose
string value is used as a dynamic regular expression (*note Using
@@ -6777,7 +6779,7 @@ distinguish them from the records you are interested in.
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 `%' symbol), each on its own
+between two identical markers (e.g., the `%' 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 `next'
statement (not discussed yet, *note The `next' Statement: Next
@@ -6798,7 +6800,7 @@ a flag:
In a range pattern, the comma (`,') 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:
+program attempts to combine a range pattern with another, simpler test:
echo Yes | awk '/1/,/2/ || /Yes/'
@@ -6873,14 +6875,14 @@ and readability.
functions, because each library file can have its own `BEGIN' and/or
`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 `BEGIN' and `END' rules are executed. Therefore
+order in which their `BEGIN' and `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. *Note
Command-Line Options: Options, for more information on using library
functions. *Note A Library of `awk' Functions: Library Functions, for
a number of useful library functions.
- If an `awk' program only has a `BEGIN' rule and no other rules, then
+ If an `awk' program has only a `BEGIN' rule and no other rules, then
the program exits after the `BEGIN' rule is run.(1) However, if an
`END' rule exists, then the input is read, even if there are no other
rules in the program. This is necessary in case the `END' rule checks
@@ -6889,7 +6891,7 @@ the `FNR' and `NR' variables.
---------- Footnotes ----------
(1) The original version of `awk' used to keep reading and ignoring
-input until end of file was seen.
+input until the end of the file was seen.

File: gawk.info, Node: I/O And BEGIN/END, Prev: Using BEGIN/END, Up: BEGIN/END
@@ -6905,7 +6907,7 @@ fields, when executing `BEGIN' rules. References to `$0' and the fields
yield a null string or zero, depending upon the context. One way to
give `$0' a real value is to execute a `getline' command without a
variable (*note Explicit Input with `getline': Getline.). Another way
-is to simply assign a value to `$0'.
+is simply to assign a value to `$0'.
The second point is similar to the first but from the other
direction. Traditionally, due largely to implementation issues, `$0'
@@ -6940,7 +6942,7 @@ File: gawk.info, Node: Empty, Prev: BEGIN/END, Up: Pattern Overview
The Empty Pattern
-----------------
- An empty (i.e., non-existent) pattern is considered to match _every_
+ An empty (i.e., nonexistent) pattern is considered to match _every_
input record. For example, the program:
awk '{ print $1 }' BBS-list
@@ -7020,10 +7022,10 @@ looks like this:
...
An action consists of one or more `awk' "statements", enclosed in
-curly braces (`{' and `}'). 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 all. However, if you
+curly braces (`{...}'). 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 all. However, if you
omit the action entirely, omit the curly braces as well. An omitted
action is equivalent to `{ print $0 }':
@@ -7032,32 +7034,35 @@ action is equivalent to `{ print $0 }':
The following types of statements are supported in `awk':
- * Expressions, which can call functions or assign values to variables
- (*note Expressions::). Executing this kind of statement simply
- computes the value of the expression. This is useful when the
- expression has side effects (*note Assignment Expressions:
- Assignment Ops.).
-
- * Control statements, which specify the control flow of `awk'
- programs. The `awk' language gives you C-like constructs (`if',
- `for', `while', and `do') as well as a few special ones (*note
- Control Statements in Actions: Statements.).
-
- * 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 `if',
- `while', `do', or `for' statement.
-
- * Input statements using the `getline' command (*note Explicit Input
- with `getline': Getline.), the `next' statement (*note The `next'
- Statement: Next Statement.), and the `nextfile' statement (*note
- Using `gawk''s `nextfile' Statement: Nextfile Statement.).
+Expressions
+ Call functions or assign values to variables (*note
+ Expressions::). Executing this kind of statement simply computes
+ the value of the expression. This is useful when the expression
+ has side effects (*note Assignment Expressions: Assignment Ops.).
+
+Control statements
+ Specify the control flow of `awk' programs. The `awk' language
+ gives you C-like constructs (`if', `for', `while', and `do') as
+ well as a few special ones (*note Control Statements in Actions:
+ Statements.).
+
+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 `if', `while', `do', or `for' statement.
+
+Input statements
+ Use the `getline' command (*note Explicit Input with `getline':
+ Getline.). Also supplied in `awk' are the `next' statement (*note
+ The `next' Statement: Next Statement.), and the `nextfile'
+ statement (*note Using `gawk''s `nextfile' Statement: Nextfile
+ Statement.).
- * Output statements, such as `print' and `printf'. *Note Printing
- Output: Printing.
+Output statements
+ Such as `print' and `printf'. *Note Printing Output: Printing.
- * Deletion statements for deleting array elements. *Note The
- `delete' Statement: Delete.
+Deletion statements
+ For deleting array elements. *Note The `delete' Statement: Delete.

File: gawk.info, Node: Statements, Next: Built-in Variables, Prev: Action Overview, Up: Patterns and Actions
@@ -7108,7 +7113,7 @@ The CONDITION is an expression that controls what the rest of the
statement does. If the CONDITION is true, THEN-BODY is executed;
otherwise, ELSE-BODY is executed. The `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
+the null string; otherwise, the condition is true. Refer to the
following:
if (x % 2 == 0)
@@ -7118,7 +7123,7 @@ following:
In this example, if the expression `x % 2 == 0' is true (that is, if
the value of `x' is evenly divisible by two), then the first `print'
-statement is executed; otherwise the second `print' statement is
+statement is executed; otherwise, the second `print' statement is
executed. If the `else' keyword appears on the same line as THEN-BODY
and THEN-BODY is not a compound statement (i.e., not surrounded by
curly braces), then a semicolon must separate THEN-BODY from the `else'.
@@ -7210,7 +7215,7 @@ false to begin with. The following is an example of a `do' statement:
} while (i <= 10)
}
-This program prints each input record ten times. However, it isn't a
+This program prints each input record 10 times. However, it isn't a
very realistic example, since in this case an ordinary `while' would do
just as well. This situation reflects actual experience; only
occasionally is there a real use for a `do' statement.
@@ -7381,10 +7386,10 @@ illustrates this fact:
print ""
}
-This program prints all the numbers from 0 to 20--except for five, for
+This program prints all the numbers from 0 to 20--except for 5, for
which the `printf' is skipped. Because the increment `x++' is not
-skipped, `x' does not remain stuck at five. Contrast the `for' loop
-from the previous example with the following `while' loop:
+skipped, `x' does not remain stuck at 5. Contrast the `for' loop from
+the previous example with the following `while' loop:
BEGIN {
x = 0
@@ -7397,7 +7402,7 @@ from the previous example with the following `while' loop:
print ""
}
-This program loops forever once `x' reaches five.
+This program loops forever once `x' reaches 5.
The `continue' statement has no meaning when used outside the body of
a loop. Historical versions of `awk' treated a `continue' statement
@@ -7446,8 +7451,8 @@ beginning, in the following manner:
Because of the `next' statement, 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. *Note Special File
-Names in `gawk': Special Files.
+error output stream, as error messages should be. For more detail see
+*Note Special File Names in `gawk': Special Files.
According to the POSIX standard, the behavior is undefined if the
`next' statement is used in a `BEGIN' or `END' rule. `gawk' treats it
@@ -7571,14 +7576,14 @@ File: gawk.info, Node: Built-in Variables, Prev: Statements, Up: Patterns and
Built-in Variables
==================
- Most `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 `awk' have special built-in meanings.
-`awk' examines some of these automatically, so that they enable you to
-tell `awk' how to do certain things. Others are set automatically by
-`awk', so that they carry information from the internal workings of
-`awk' to your program.
+ Most `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 `awk' have special built-in meanings. `awk' examines
+some of these automatically, so that they enable you to tell `awk' how
+to do certain things. Others are set automatically by `awk', so that
+they carry information from the internal workings of `awk' to your
+program.
This minor node documents all the built-in variables of `gawk', most
of which are also documented in the chapters describing their areas of
@@ -7603,8 +7608,8 @@ change to control how `awk' does certain things. The variables that are
specific to `gawk' are marked with a pound sign (`#').
`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
+ 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 `"r"' or `"w"'
specify that input files and output files, respectively, should
@@ -7667,7 +7672,7 @@ specific to `gawk' are marked with a pound sign (`#').
`IGNORECASE #'
If `IGNORECASE' is nonzero or non-null, then all string comparisons
- and all regular expression matching are case-independent. Thus,
+ and all regular expression matching are case independent. Thus,
regexp matching with `~' and `!~', as well as the `gensub',
`gsub', `index', `match', `split', and `sub' functions, record
termination with `RS', and field splitting with `FS', all ignore
@@ -7684,7 +7689,7 @@ specific to `gawk' are marked with a pound sign (`#').
as if the `--lint' command-line option is in effect. (*note
Command-Line Options: Options.). With a value of `"fatal"', lint
warnings become fatal errors. Any other true value prints
- non-fatal warnings. Assigning a false value to `LINT' turns off
+ nonfatal warnings. Assigning a false value to `LINT' turns off
the lint warnings.
This variable is a `gawk' extension. It is not special in other
@@ -7740,7 +7745,7 @@ specific to `gawk' are marked with a pound sign (`#').
This variable is used for internationalization of programs at the
`awk' level. It sets the default text domain for specially marked
string constants in the source text, as well as for the
- `dcgettext' and `bindtextdomain' functions (*note
+ `dcgettext', `dcngettext' and `bindtextdomain' functions (*note
Internationalization with `gawk': Internationalization.). The
default value of `TEXTDOMAIN' is `"messages"'.
@@ -7779,7 +7784,7 @@ with an asterisk (`*').
-| BBS-list
`ARGV[0]' contains `"awk"', `ARGV[1]' contains
- `"inventory-shipped"' and `ARGV[2]' contains `"BBS-list"'. The
+ `"inventory-shipped"', and `ARGV[2]' contains `"BBS-list"'. The
value of `ARGC' is three, one more than the index of the last
element in `ARGV', because the elements are numbered from zero.
@@ -7794,9 +7799,9 @@ with an asterisk (`*').
variables.
`ARGIND #'
- This is the index in `ARGV' of the current file being processed.
- Every time `gawk' opens a new data file for processing, it sets
- `ARGIND' to the index in `ARGV' of the file name. When `gawk' is
+ The index in `ARGV' of the current file being processed. Every
+ time `gawk' opens a new data file for processing, it sets `ARGIND'
+ to the index in `ARGV' of the file name. When `gawk' is
processing the input files, `FILENAME == ARGV[ARGIND]' is always
true.
@@ -7836,29 +7841,29 @@ with an asterisk (`*').
Command-Line Options: Options.), it is not special.
`FILENAME'
- This is the name of the file that `awk' is currently reading.
- When no data files are listed on the command line, `awk' reads
- from the standard input and `FILENAME' is set to `"-"'.
- `FILENAME' is changed each time a new file is read (*note Reading
- Input Files: Reading Files.). Inside a `BEGIN' rule, the value of
- `FILENAME' is `""', since there are no input files being processed
- yet.(1) (d.c.) Note though, that using `getline' (*note Explicit
- Input with `getline': Getline.) inside a `BEGIN' rule can give
+ The name of the file that `awk' is currently reading. When no
+ data files are listed on the command line, `awk' reads from the
+ standard input and `FILENAME' is set to `"-"'. `FILENAME' is
+ changed each time a new file is read (*note Reading Input Files:
+ Reading Files.). Inside a `BEGIN' rule, the value of `FILENAME' is
+ `""', since there are no input files being processed yet.(1)
+ (d.c.) Note, though, that using `getline' (*note Explicit Input
+ with `getline': Getline.) inside a `BEGIN' rule can give
`FILENAME' a value.
`FNR'
- This is the current record number in the current file. `FNR' is
+ The current record number in the current file. `FNR' is
incremented each time a new record is read (*note Explicit Input
with `getline': Getline.). It is reinitialized to zero each time
a new input file is started.
`NF'
- This is the number of fields in the current input record. `NF' is
- set each time a new record is read, when a new field is created or
+ The number of fields in the current input record. `NF' is set
+ each time a new record is read, when a new field is created or
when `$0' changes (*note Examining Fields: Fields.).
`NR'
- This is the number of input records `awk' has processed since the
+ The number of input records `awk' has processed since the
beginning of the program's execution (*note How Input Is Split
into Records: Records.). `NR' is incremented each time a new
record is read.
@@ -7905,17 +7910,17 @@ with an asterisk (`*').
Options.), it is not special.
`RLENGTH'
- This is the length of the substring matched by the `match' function
- (*note String Manipulation Functions: String Functions.).
- `RLENGTH' is set by invoking the `match' function. Its value is
- the length of the matched string, or -1 if no match is found.
+ The length of the substring matched by the `match' function (*note
+ String Manipulation Functions: String Functions.). `RLENGTH' is
+ set by invoking the `match' function. Its value is the length of
+ the matched string, or -1 if no match is found.
`RSTART'
- This is the start-index in characters of the substring that is
- matched by the `match' function (*note String Manipulation
- Functions: String Functions.). `RSTART' is set by invoking the
- `match' function. Its value is the position of the string where
- the matched substring starts, or zero if no match was found.
+ The start-index in characters of the substring that is matched by
+ the `match' function (*note String Manipulation Functions: String
+ Functions.). `RSTART' is set by invoking the `match' function.
+ Its value is the position of the string where the matched
+ substring starts, or zero if no match was found.
`RT #'
This is set each time a record is read. It contains the input text
@@ -8138,12 +8143,12 @@ example, conceptually, if the element values are 8, `"foo"', `""', and
0 1 2 3 Index
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
+the values. Here, 8 is the value at index zero, because 8 appears in the
position with zero elements before it.
Arrays in `awk' are different--they are "associative". This means
-that each array is a collection of pairs: an index, and its
-corresponding array element value:
+that each array is a collection of pairs: an index and its corresponding
+array element value:
Element 3 Value 30
Element 1 Value "foo"
@@ -8169,7 +8174,7 @@ It has elements 0-3 and 10, but doesn't have elements 4, 5, 6, 7, 8, or
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:
+from English to French:
Element "dog" Value "chien"
Element "cat" Value "chat"
@@ -8224,10 +8229,10 @@ index, use the following expression:
INDEX in ARRAY
-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 `ARRAY[INDEX]' exists and
-zero (false) if it does not exist. For example, this statement tests
+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 `ARRAY[INDEX]' exists and zero
+(false) if it does not exist. For example, this statement tests
whether the array `frequencies' contains the index `2':
if (2 in frequencies)
@@ -8293,7 +8298,7 @@ following input:
1 Who is number one?
3 I three you.
-its output is:
+Its output is:
1 Who is number one?
2 Who are you? The new number two!
@@ -8363,9 +8368,9 @@ example of this type.
statement is determined by the internal arrangement of the array
elements within `awk' and cannot be controlled or changed. This can
lead to problems if new elements are added to ARRAY by statements in
-the loop body; it is not predictable whether or not the `for' loop will
-reach them. Similarly, changing VAR inside the loop may produce
-strange results. It is best to avoid such things.
+the loop body; it is not predictable whether the `for' loop will reach
+them. Similarly, changing VAR inside the loop may produce strange
+results. It is best to avoid such things.

File: gawk.info, Node: Delete, Next: Numeric Array Subscripts, Prev: Scanning an Array, Up: Arrays
@@ -8419,7 +8424,7 @@ compatibility mode (*note Command-Line Options: Options.).
more efficient than the equivalent loop that deletes each element one
at a time.
- The following statement provides a portable but non-obvious way to
+ The following statement provides a portable but nonobvious way to
clear out an array:(1)
split("", array)
@@ -8480,8 +8485,8 @@ to be. So the usual case of the following works:
The "integer values always convert to strings as integers" rule has
an additional consequence for array indexing. Octal and hexadecimal
-constants (*note Octal and Hexadecimal Numbers: Non-decimal-numbers.)
-are converted internally into numbers and their original form is
+constants (*note Octal and Hexadecimal Numbers: Nondecimal-numbers.)
+are converted internally into numbers, and their original form is
forgotten. This means, for example, that `array[17]', `array[021]', and
`array[0x11]' all refer to the same element!
@@ -8569,7 +8574,7 @@ it was stored with a single index or a sequence of indices. The two
expressions `foo[5,12]' and `foo[5 SUBSEP 12]' are always equivalent.
The default value of `SUBSEP' is the string `"\034"', which contains
-a non-printing character that is unlikely to appear in an `awk' program
+a nonprinting character that is unlikely to appear in an `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 `SUBSEP' can lead to combined strings that are ambiguous.
@@ -8578,7 +8583,7 @@ Suppose that `SUBSEP' is `"@"'; then `foo["a@b", "c"]' and
stored as `foo["a@b@c"]'.
To test whether a particular index sequence exists in a
-"multidimensional" array, use the same operator (`in') that is used for
+multidimensional array, use the same operator (`in') that is used for
single dimensional arrays. Write the whole sequence of indices in
parentheses, separated by commas, as the left operand:
@@ -8586,7 +8591,7 @@ parentheses, separated by commas, as the left operand:
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.
+result. It assumes that all lines have the same number of elements:
{
if (max_nf < NF)
@@ -8627,7 +8632,7 @@ Scanning Multidimensional Arrays
================================
There is no special `for' statement for scanning a
-"multidimensional" array. There cannot be one, because in truth there
+"multidimensional" array. There cannot be one, because, in truth, there
are no multidimensional arrays or elements--there is only a
multidimensional _way of accessing_ an array.
@@ -8740,7 +8745,7 @@ Functions
This major node describes `awk''s built-in functions, which fall
into three categories: numeric, string, and I/O. `gawk' provides
additional groups of functions to work with values that represent time,
-do bit manipulation, and to internationalize and localize programs.
+do bit manipulation, and internationalize and localize programs.
Besides the built-in functions, `awk' has provisions for writing new
functions that the rest of a program can use. The second half of this
@@ -8782,7 +8787,7 @@ Calling Built-in Functions
To call one of `awk''s built-in functions, write the name of the
function followed by arguments in parentheses. For example, `atan2(y +
-z, 1)' is a call to the function `atan2', and has two arguments.
+z, 1)' is a call to the function `atan2' and has two arguments.
Whitespace is ignored between the built-in function name and the
open parenthesis, and it is good practice to avoid using whitespace
@@ -8814,9 +8819,9 @@ are evaluated from left to right or from right to left. For example:
j = atan2(i++, i *= 2)
If the order of evaluation is left to right, then `i' first becomes
-six, and then 12, and `atan2' is called with the two arguments 6 and
-12. But if the order of evaluation is right to left, `i' first becomes
-10, then 11, and `atan2' is called with the two arguments 11 and 10.
+6, and then 12, and `atan2' is called with the two arguments 6 and 12.
+But if the order of evaluation is right to left, `i' first becomes 10,
+then 11, and `atan2' is called with the two arguments 11 and 10.

File: gawk.info, Node: Numeric Functions, Next: String Functions, Prev: Calling Built-in, Up: Built-in
@@ -8826,18 +8831,18 @@ Numeric Functions
The following list describes all of the built-in functions that work
with numbers. Optional parameters are enclosed in square brackets ([
-and ]):
+]):
`int(X)'
This returns the nearest integer to X, located between X and zero
and truncated toward zero.
- For example, `int(3)' is three, `int(3.9)' is three, `int(-3.9)'
- is -3, and `int(-3)' is -3 as well.
+ For example, `int(3)' is 3, `int(3.9)' is 3, `int(-3.9)' is -3,
+ and `int(-3)' is -3 as well.
`sqrt(X)'
This returns the positive square root of X. `gawk' reports an
- error if X is negative. Thus, `sqrt(4)' is two.
+ error if X is negative. Thus, `sqrt(4)' is 2.
`exp(X)'
This returns the exponential of X (`e ^ X') or reports an error if
@@ -8876,7 +8881,7 @@ and ]):
The following example uses a similar function to produce random
integers between one and N. This program prints a new random
- number for each input record.
+ number for each input record:
# Function to roll a simulated die.
function roll(n) { return 1 + int(rand() * n) }
@@ -8905,7 +8910,7 @@ and ]):
numbers.(2) Thus, if the seed is set to the same value a second
time, the same sequence of random numbers is produced again.
- Different `awk' implementations use different random number
+ Different `awk' implementations use different random-number
generators internally. Don't expect the same `awk' program to
produce the same series of random numbers when executed by
different versions of `awk'.
@@ -8926,21 +8931,21 @@ implementation use the C `rand' to implement the `awk' version of
`rand'. In fact, `gawk' uses the BSD `random' function, which is
considerably better than `rand', to produce random numbers.
- (2) Computer generated random numbers really are not truly random.
-They are technically known as "pseudo-random." This means that while
+ (2) 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.

File: gawk.info, Node: String Functions, Next: I/O Functions, Prev: Numeric Functions, Up: Built-in
-String Manipulation Functions
+String-Manipulation Functions
-----------------------------
The functions in this minor node 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 `gawk' are marked with
-a pound sign (`#'):
+([ ]). Those functions that are specific to `gawk' are marked with a
+pound sign (`#'):
* Menu:
@@ -9006,9 +9011,9 @@ a pound sign (`#'):
programs to be maximally portable, always supply the parentheses.
`match(STRING, REGEXP [, ARRAY])'
- The `match' function searches STRING for the longest leftmost
+ The `match' function searches STRING for the longest, leftmost
substring matched by the regular expression, REGEXP. It returns
- the character position, or "index", where that substring begins
+ the character position, or "index", at which that substring begins
(one, if it starts at the beginning of STRING). If no match is
found, it returns zero.
@@ -9053,14 +9058,14 @@ a pound sign (`#'):
Match of ru+n found at 12 in My program runs
Match of Melvin found at 1 in Melvin was here.
- If ARRAY is present, it is cleared, and then the 0'th element of
+ If ARRAY is present, it is cleared, and then the 0th element of
ARRAY is set to the entire portion of STRING matched by REGEXP.
If REGEXP contains parentheses, the integer-indexed elements of
ARRAY are set to contain the portion of STRING matching the
- corresponding parenthesized sub-expression. For example:
+ corresponding parenthesized subexpression. For example:
$ echo foooobazbarrrrr |
- > gawk '{ match($0, /(fo+).+(ba*r)/, arr)
+ > gawk '{ match($0, /(fo+).+(bar*)/, arr)
> print arr[1], arr[2] }'
-| foooo barrrrr
@@ -9069,15 +9074,14 @@ a pound sign (`#'):
third argument is a fatal error.
`split(STRING, ARRAY [, FIELDSEP])'
- This function divides STRING into pieces separated by FIELDSEP,
- and stores the pieces in ARRAY. The first piece is stored in
+ This function divides STRING into pieces separated by FIELDSEP and
+ stores the pieces in ARRAY. The first piece is stored in
`ARRAY[1]', the second piece in `ARRAY[2]', and so forth. The
string value of the third argument, FIELDSEP, is a regexp
describing where to split STRING (much as `FS' can be a regexp
- describing where to split input records). If the FIELDSEP is
- omitted, the value of `FS' is used. `split' returns the number of
- elements created. If STRING does not match FIELDSEP, ARRAY is
- empty and `split' returns zero.
+ describing where to split input records). If FIELDSEP is omitted,
+ the value of `FS' is used. `split' returns the number of elements
+ created.
The `split' function splits strings into pieces in a manner
similar to the way input lines are split into fields. For example:
@@ -9094,7 +9098,7 @@ a pound sign (`#'):
The value returned by this call to `split' is three.
As with input field-splitting, when the value of FIELDSEP is
- `" "', leading and trailing whitespace is ignored and the elements
+ `" "', leading and trailing whitespace is ignored, and the elements
are separated by runs of whitespace. Also as with input
field-splitting, if FIELDSEP is the null string, each individual
character in the string is split into its own array element.
@@ -9137,7 +9141,7 @@ a pound sign (`#'):
`sub(REGEXP, REPLACEMENT [, TARGET])'
The `sub' function alters the value of TARGET. It searches this
- value, which is treated as a string, for the leftmost longest
+ value, which is treated as a string, for the leftmost, longest
substring matched by the regular expression REGEXP. Then the
entire string is changed by replacing the matched text with
REPLACEMENT. The modified string becomes the new value of TARGET.
@@ -9174,7 +9178,7 @@ a pound sign (`#'):
> }'
-| dCaaCbaaa
- This shows how `&' can represent a non-constant string and also
+ This shows how `&' can represent a nonconstant string and also
illustrates the "leftmost, longest" rule in regexp matching (*note
How Much Text Matches?: Leftmost Longest.).
@@ -9182,7 +9186,7 @@ a pound sign (`#'):
putting a backslash before it in the string. As usual, to insert
one backslash in the string, you must write two backslashes.
Therefore, write `\\&' in a string constant to include a literal
- `&' in the replacement. For example, following is shown how to
+ `&' in the replacement. For example, the following shows how to
replace the first `|' on each line with an `&':
{ sub(/\|/, "\\&"); print }
@@ -9198,7 +9202,7 @@ a pound sign (`#'):
sub(/USA/, "United States", "the USA and Canada")
For historical compatibility, `gawk' accepts erroneous code, such
- as in the previous example. However, using any other non-changeable
+ 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.
@@ -9208,7 +9212,7 @@ a pound sign (`#'):
`gsub(REGEXP, REPLACEMENT [, TARGET])'
This is similar to the `sub' function, except `gsub' replaces
- _all_ of the longest, leftmost, _non-overlapping_ matching
+ _all_ of the longest, leftmost, _nonoverlapping_ matching
substrings it can find. The `g' in `gsub' stands for "global,"
which means replace everywhere. For example:
@@ -9248,10 +9252,8 @@ a pound sign (`#'):
-| def abc
As with `sub', you must type two backslashes in order to get one
- into the string.
-
- In the replacement text, the sequence `\0' represents the entire
- matched text, as does the character `&'.
+ into the string. In the replacement text, the sequence `\0'
+ represents the entire matched text, as does the character `&'.
The following example shows how you can use the third argument to
control which match of the regexp should be changed:
@@ -9285,7 +9287,12 @@ a pound sign (`#'):
STRING that begins at character number START. For example,
`substr("washington", 5)' returns `"ington"'. The whole suffix is
also returned if LENGTH is greater than the number of characters
- remaining in the string, counting from character number START.
+ remaining in the string, counting from character START.
+
+ If START is less than one or greater than the number of characters
+ in the string, `substr' returns the null string. Similarly, if
+ LENGTH is present but less than or equal to zero, the null string
+ is returned.
The string returned by `substr' _cannot_ be assigned. Thus, it is
a mistake to attempt to change a portion of a string, as shown in
@@ -9313,23 +9320,23 @@ a pound sign (`#'):
`tolower(STRING)'
This returns a copy of STRING, with each uppercase character in
the string replaced with its corresponding lowercase character.
- Non-alphabetic characters are left unchanged. For example,
+ Nonalphabetic characters are left unchanged. For example,
`tolower("MiXeD cAsE 123")' returns `"mixed case 123"'.
`toupper(STRING)'
This returns a copy of STRING, with each lowercase character in
the string replaced with its corresponding uppercase character.
- Non-alphabetic characters are left unchanged. For example,
+ Nonalphabetic characters are left unchanged. For example,
`toupper("MiXeD cAsE 123")' returns `"MIXED CASE 123"'.
---------- Footnotes ----------
(1) Unless you use the `--non-decimal-data' option, which isn't
-recommended. *Note Allowing Non-Decimal Input Data: Non-decimal Data,
+recommended. *Note Allowing Nondecimal Input Data: Nondecimal Data,
for more information.
- (2) This is different from C and C++, where the first character is
-number zero.
+ (2) This is different from C and C++, in which the first character
+is number zero.

File: gawk.info, Node: Gory Details, Prev: String Functions, Up: String Functions
@@ -9376,7 +9383,7 @@ illustrate with a table:
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 `sub'. (For the sake of simplicity, the
-rest of the tables below only show the case of even numbers of
+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
@@ -9435,8 +9442,8 @@ specifies; this Info file will be updated as well.(2)
level, whenever `gawk' sees a `\', 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 `\' is, it appears in the generated text
-and the `\' does not:
+what character follows the `\', it appears in the generated text and
+the `\' does not:
You type `gensub' sees `gensub' generates
-------- ------------- ------------------
@@ -9477,8 +9484,8 @@ File: gawk.info, Node: I/O Functions, Next: Time Functions, Prev: String Func
Input/Output Functions
----------------------
- The following functions relate to Input/Output (I/O). Optional
-parameters are enclosed in square brackets ([ and ]):
+ The following functions relate to input/output (I/O). Optional
+parameters are enclosed in square brackets ([ ]):
`close(FILENAME [, HOW])'
Close the file FILENAME for input or output. Alternatively, the
@@ -9488,7 +9495,7 @@ parameters are enclosed in square brackets ([ and ]):
Redirections: Close Files And Pipes, 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
+ one end of the two-way pipe and then to close the other. This is
done by providing a second argument to `close'. This second
argument should be one of the two string values `"to"' or `"from"',
indicating which end of the pipe to close. Case in the string does
@@ -9502,7 +9509,7 @@ parameters are enclosed in square brackets ([ and ]):
redirecting output to a pipe or coprocess.
Many utility programs "buffer" their output; i.e., they save
- information to write to a disk file or terminal in memory, until
+ 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,
@@ -9524,22 +9531,21 @@ parameters are enclosed in square brackets ([ and ]):
output files and pipes are flushed.
`fflush' returns zero if the buffer is successfully flushed;
- otherwise it returns -1. In the case where all buffers are
+ otherwise, it returns -1. In the case where all buffers are
flushed, the return value is zero only if all buffers were flushed
successfully. Otherwise, it is -1, and `gawk' warns about the
- FILENAME that had the problem.
+ problem FILENAME.
`gawk' also issues a warning message if you attempt to flush a
file or pipe that was opened for reading (such as with `getline'),
or if FILENAME is not an open file, pipe, or coprocess. In such a
- case, `fflush' returns -1 as well.
+ case, `fflush' returns -1, as well.
`system(COMMAND)'
- The `system' function allows the user to execute operating system
- commands and then return to the `awk' program. The `system'
- function executes the command given by the string COMMAND. It
- returns the status returned by the command that was executed as
- its value.
+ Executes operating-system commands and then returns to the `awk'
+ program. The `system' function executes the command given by the
+ string COMMAND. It returns the status returned by the command
+ that was executed as its value.
For example, if the following fragment of code is put in your `awk'
program:
@@ -9565,15 +9571,15 @@ parameters are enclosed in square brackets ([ and ]):
an editor. Some operating systems cannot implement the `system'
function. `system' causes a fatal error if it is not supported.
-Advanced Notes: Interactive Versus Non-Interactive Buffering
-------------------------------------------------------------
+Advanced Notes: Interactive Versus Noninteractive Buffering
+-----------------------------------------------------------
As a side point, buffering issues can be even more confusing,
-depending upon whether your program is "interactive"; i.e.,
+depending upon whether your program is "interactive", i.e.,
communicating with a user sitting at a keyboard.(1)
Interactive programs generally "line buffer" their output; i.e., they
-write out every line. Non-interactive programs wait until they have a
+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:
@@ -9638,8 +9644,8 @@ and not:
first print
second print
- If `awk' did not flush its buffers before calling `system', the
-latter (undesirable) output is what you see.
+ If `awk' did not flush its buffers before calling `system', you
+would see the latter (undesirable) output.
---------- Footnotes ----------
@@ -9652,22 +9658,22 @@ File: gawk.info, Node: Time Functions, Next: Bitwise Functions, Prev: I/O Fun
Using `gawk''s Timestamp Functions
----------------------------------
- A common use for `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 `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.(1)
-All known POSIX-compliant systems support timestamps from 0 through
-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.
+ `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
+`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.(1) All known
+POSIX-compliant systems support timestamps from 0 through 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, `gawk' provides the following functions for working
with timestamps. They are `gawk' extensions; they are not specified in
the POSIX standard, nor are they in any other known version of `awk'.(2)
-Optional parameters are enclosed in square brackets ([ and ]):
+Optional parameters are enclosed in square brackets ([ ]):
`systime()'
This function returns the current time as the number of seconds
@@ -9683,13 +9689,13 @@ Optional parameters are enclosed in square brackets ([ and ]):
seven numbers representing, respectively, the full year including
century, the month from 1 to 12, the day of the month from 1 to
31, the hour of the day from 0 to 23, the minute from 0 to 59, the
- second from 0 to 60,(3) and an optional daylight savings flag.
+ second from 0 to 60,(3) and an optional daylight-savings flag.
The values of these numbers need not be within the ranges
specified; for example, an hour of -1 means 1 hour before midnight.
The origin-zero Gregorian calendar is assumed, with year 0
preceding year 1 and year -1 preceding year 0. The time is
- assumed to be in the local timezone. If the daylight savings flag
+ 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), `mktime' attempts to determine whether daylight
@@ -9724,7 +9730,7 @@ file.
The `strftime' function allows you to easily turn a timestamp into
human-readable information. It is similar in nature to the `sprintf'
function (*note String Manipulation Functions: String Functions.), in
-that it copies non-format specification characters verbatim to the
+that it copies nonformat specification characters verbatim to the
returned string, while substituting date and time values for format
specifications in the FORMAT string.
@@ -9766,9 +9772,9 @@ the following date format specifications:
`%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.
+ (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.
+ 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.
@@ -9811,7 +9817,7 @@ the following date format specifications:
The second as a decimal number (00-60).
`%t'
- A tab character.
+ A TAB character.
`%T'
Equivalent to specifying `%H:%M:%S'.
@@ -9828,7 +9834,7 @@ the following date format specifications:
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
+ it is week one; otherwise it is week 53 of the previous year and
the next week is week one.)
`%w'
@@ -9862,9 +9868,9 @@ the following date format specifications:
`%Ec %EC %Ex %EX %Ey %EY %Od %Oe %OH'
`%OI %Om %OM %OS %Ou %OU %OV %Ow %OW %Oy'
- These are "alternate representations" for the specifications that
- use only the second letter (`%c', `%C', and so on).(5) (These
- facilitate compliance with the POSIX `date' utility.)
+ "Alternate representations" for the specifications that use only
+ the second letter (`%c', `%C', and so on).(5) (These facilitate
+ compliance with the POSIX `date' utility.)
`%%'
A literal `%'.
@@ -9888,11 +9894,11 @@ compile `gawk' (*note Installing `gawk': Installation.), then the
following additional format specifications are available:
`%k'
- The hour (24-hour clock) as a decimal number (0-23). Single digit
+ The hour (24-hour clock) as a decimal number (0-23). Single-digit
numbers are padded with a space.
`%l'
- The hour (12-hour clock) as a decimal number (1-12). Single digit
+ The hour (12-hour clock) as a decimal number (1-12). Single-digit
numbers are padded with a space.
`%N'
@@ -9913,7 +9919,7 @@ normal representations are used.
This example is an `awk' implementation of the POSIX `date' utility.
Normally, the `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 `+', `date' copies non-format specifier characters to the
+begins with a `+', `date' copies nonformat specifier characters to the
standard output and interprets the current time according to the format
specifiers in the string. For example:
@@ -9951,10 +9957,10 @@ if the time zone is set to UTC:
---------- Footnotes ----------
- (1) *Note Glossary::, especially the entries for "Epoch" and "UTC."
+ (1) *Note Glossary::, especially the entries "Epoch" and "UTC."
(2) The GNU `date' utility can also do many of the things described
-here. It's use may be preferable for simple time-related operations in
+here. Its use may be preferable for simple time-related operations in
shell scripts.
(3) Occasionally there are minutes in a year with a leap second,
@@ -9971,13 +9977,13 @@ Internationalization with `gawk': Internationalization.
(6) This is because ISO C leaves the behavior of the C version of
`strftime' undefined and `gawk' uses the system's version of `strftime'
if it's there. Typically, the conversion specifier either does not
-appear in the returned string or it appears literally.
+appear in the returned string or appears literally.

File: gawk.info, Node: Bitwise Functions, Next: I18N Functions, Prev: Time Functions, Up: Built-in
-Using `gawk''s Bit Manipulation Functions
------------------------------------------
+Bit-Manipulation Functions of `gawk'
+------------------------------------
I can explain it for you, but I can't understand it for you.
Anonymous
@@ -10010,15 +10016,15 @@ again with `10111001' and shift it left by three bits, you end up with
`11001000'. `gawk' provides built-in functions that implement the
bitwise operations just described. They are:
-`and(V1, V2)' Return the bitwise AND of the values provided by V1
+`and(V1, V2)' Returns the bitwise AND of the values provided by V1
and V2.
-`or(V1, V2)' Return the bitwise OR of the values provided by V1 and
- V2.
-`xor(V1, V2)' Return the bitwise XOR of the values provided by V1
+`or(V1, V2)' Returns the bitwise OR of the values provided by V1
and V2.
-`compl(VAL)' Return the bitwise complement of VAL.
-`lshift(VAL, COUNT)' Return the value of VAL, shifted left by COUNT bits.
-`rshift(VAL, COUNT)' Return the value of VAL, shifted right by COUNT bits.
+`xor(V1, V2)' Returns the bitwise XOR of the values provided by V1
+ and V2.
+`compl(VAL)' Returns the bitwise complement of VAL.
+`lshift(VAL, COUNT)' Returns the value of VAL, shifted left by COUNT bits.
+`rshift(VAL, COUNT)' Returns the value of VAL, shifted right by COUNT bits.
For all of these functions, first the double-precision
floating-point value is converted to a C `unsigned long', then the
@@ -10071,18 +10077,18 @@ This program produces the following output when run:
The `bits2str' function turns a binary number into a string. The
number `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 `"1"' is concatenated onto the front of the string.
+ANDing the mask with the value indicates whether the rightmost bit is 1
+or not. If so, a `"1"' is concatenated onto the front of the string.
Otherwise, a `"0"' is added. The value is then shifted right by one
bit and the loop continues until there are no more 1 bits.
If the initial value is zero it returns a simple `"0"'. Otherwise,
at the end, it pads the value with zeros to represent multiples of
-eight-bit quantities. This is typical in modern computers.
+8-bit quantities. This is typical in modern computers.
The main code in the `BEGIN' rule shows the difference between the
decimal and octal values for the same numbers (*note Octal and
-Hexadecimal Numbers: Non-decimal-numbers.), and then demonstrates the
+Hexadecimal Numbers: Nondecimal-numbers.), and then demonstrates the
results of the `compl', `lshift', and `rshift' functions.
---------- Footnotes ----------
@@ -10094,14 +10100,14 @@ have the left side fill with 1's. Caveat emptor.

File: gawk.info, Node: I18N Functions, Prev: Bitwise Functions, Up: Built-in
-Using `gawk''s String Translation Functions
+Using `gawk''s String-Translation Functions
-------------------------------------------
`gawk' provides facilities for internationalizing `awk' programs.
These include the functions described in the following list. The
-description here is purposely brief. *Note Internationalization with
+descriptions here are purposely brief. *Note Internationalization with
`gawk': Internationalization, for the full story. Optional parameters
-are enclosed in square brackets ([ and ]):
+are enclosed in square brackets ([ ]):
`dcgettext(STRING [, DOMAIN [, CATEGORY]])'
This function returns the translation of STRING in text domain
@@ -10109,11 +10115,19 @@ are enclosed in square brackets ([ and ]):
is the current value of `TEXTDOMAIN'. The default value for
CATEGORY is `"LC_MESSAGES"'.
+`dcngettext(STRING1, STRING2, NUMBER [, DOMAIN [, CATEGORY]])'
+ This function returns the plural form used for NUMBER of the
+ translation of STRING1 and STRING2 in text domain DOMAIN for
+ locale category CATEGORY. STRING1 is the English singular variant
+ of a message, and STRING2 the English plural variant of the same
+ message. The default value for DOMAIN is the current value of
+ `TEXTDOMAIN'. The default value for CATEGORY is `"LC_MESSAGES"'.
+
`bindtextdomain(DIRECTORY [, DOMAIN])'
- This function allows you to specify the directory where `gawk'
+ This function allows you to specify the directory in which `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 DOMAIN is "bound."
+ testing). It returns the directory in which DOMAIN is "bound."
The default DOMAIN is the value of `TEXTDOMAIN'. If DIRECTORY is
the null string (`""'), then `bindtextdomain' returns the current
@@ -10127,7 +10141,7 @@ User-Defined Functions
Complicated `awk' programs can often be simplified by defining your
own functions. User-defined functions can be called just like built-in
-ones (*note Function Calls::), but it is up to you to define them;
+ones (*note Function Calls::), but it is up to you to define them,
i.e., to tell `awk' what they should do.
* Menu:
@@ -10161,7 +10175,7 @@ starting to execute any of it.
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 `awk'
+underscores that doesn't start with a digit. Within a single `awk'
program, any particular name can only be used as a variable, array, or
function.
@@ -10196,7 +10210,7 @@ arguments and the local variables, in order to document how your
function is supposed to be used.
During execution of the function body, the arguments and local
-variable values hide or "shadow" any variables of the same names used
+variable values hide, or "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
@@ -10276,13 +10290,13 @@ The `delete' Statement: Delete.). Instead of having to repeat this
loop everywhere that you need to clear out an array, your program can
just call `delarray'. (This guarantees portability. The use of
`delete ARRAY' to delete the contents of an entire array is a
-non-standard extension.)
+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.
+zero, i.e., when there are no more characters left in the string.
function rev(str, start)
{
@@ -10364,7 +10378,7 @@ does this:
print str
}
-to change its first argument variable `str', it _does not_ change the
+to change its first argument variable `str', it does _not_ change the
value of `foo' in the caller. The role of `foo' in calling `myfunc'
ended when its value (`"bar"') was computed. If `str' also exists
outside of `myfunc', the function body cannot alter this outer value,
@@ -10392,8 +10406,8 @@ dangerous if you do not watch what you are doing. For example:
a[1], a[2], a[3]
}
-This program prints `a[1] = 1, a[2] = two, a[3] = 3', because
-`changeit' stores `"two"' in the second element of `a'.
+prints `a[1] = 1, a[2] = two, a[3] = 3', because `changeit' stores
+`"two"' in the second element of `a'.
Some `awk' implementations allow you to call a function that has not
been defined. They only report a problem at runtime when the program
@@ -10409,7 +10423,7 @@ actually tries to call the function. For example:
# note that `foo' is not defined
Because the `if' statement will never be true, it is not really a
-problem that `foo' has not been defined. Usually though, it is a
+problem that `foo' has not been defined. Usually, though, it is a
problem if a program calls an undefined function.
If `--lint' is specified (*note Command-Line Options: Options.),
@@ -10460,11 +10474,11 @@ a value for the largest number among the elements of an array:
You call `maxelt' with one argument, which is an array name. The local
variables `i' and `ret' are not intended to be arguments; while there
-is nothing to stop you from passing two or three arguments to `maxelt',
+is nothing to stop you from passing more than one argument to `maxelt',
the results would be strange. The extra space before `i' in the
function parameter list indicates that `i' and `ret' are not supposed
-to be arguments. This is a convention that you should follow when you
-define functions.
+to be arguments. You should follow this convention when defining
+functions.
The following program uses the `maxelt' function. It loads an
array, calls `maxelt', and then reports the maximum number in that
@@ -10503,8 +10517,8 @@ the array.

File: gawk.info, Node: Dynamic Typing, Prev: Return Statement, Up: User-defined
-Functions and Their Effect on Variable Typing
----------------------------------------------
+Functions and Their Effects on Variable Typing
+----------------------------------------------
`awk' is a very fluid language. It is possible that `awk' can't
tell if an identifier represents a regular variable or an array until
@@ -10532,7 +10546,7 @@ File: gawk.info, Node: Internationalization, Next: Advanced Features, Prev: F
Internationalization with `gawk'
********************************
- Once upon a time, computer makers wrote software that only worked in
+ 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,
@@ -10565,7 +10579,7 @@ Internationalization and Localization
"Internationalization" means writing (or modifying) a program once,
in such a way that it can use multiple languages without requiring
-further source code changes. "Localization" means providing the data
+further source-code changes. "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 used for printing error messages, the language used to read
@@ -10583,7 +10597,7 @@ by a program, either directly or via formatting with `printf' or
`sprintf'.(1)
When using GNU `gettext', each application has its own "text
-domain". This is a unique name such as `kpilot' or `gawk', that
+domain". This is a unique name, such as `kpilot' or `gawk', that
identifies the application. A complete application may have multiple
components--programs written in C or C++, as well as scripts written in
`sh' or `awk'. All of the components use the same text domain.
@@ -10603,7 +10617,7 @@ in this order:
to the `gettext' library, by calling the `textdomain' function.
3. Messages from the application are extracted from the source code
- and collected into a Portable Object file (`guide.po'), which
+ and collected into a portable object 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.
@@ -10662,11 +10676,11 @@ defined locale categories that `gettext' knows about are:
a different category.)
`LC_COLLATE'
- Text collation information; i.e., how different characters and/or
+ Text-collation information; i.e., how different characters and/or
groups of characters sort in a given language.
`LC_CTYPE'
- Character type information (alphabetic, digit, upper- or
+ 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 `/[[:alnum:]]/'
(*note Regular Expression Operators: Regexp Operators.).
@@ -10684,7 +10698,7 @@ defined locale categories that `gettext' knows about are:
local language, and possibly other information as well.
`LC_TIME'
- Time and date related information, such as 12- or 24-hour clock,
+ 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.
@@ -10700,7 +10714,7 @@ operating systems. Sorry.
(2) Americans use a comma every three decimal places and a period
for the decimal point, while many Europeans do exactly the opposite:
-`1,234.56' vs. `1.234,56'.
+`1,234.56' versus `1.234,56'.

File: gawk.info, Node: Programmer i18n, Next: Translator i18n, Prev: Explaining gettext, Up: Internationalization
@@ -10737,11 +10751,21 @@ internationalization:
C version. The `awk' version's order was chosen to be simple and
to allow for reasonable `awk'-style default arguments.
+`dcngettext(STRING1, STRING2, NUMBER [, DOMAIN [, CATEGORY]])'
+ This built-in function returns the plural form used for NUMBER of
+ the translation of STRING1 and STRING2 in text domain DOMAIN for
+ locale category CATEGORY. STRING1 is the English singular variant
+ of a message, and STRING2 the English plural variant of the same
+ message. The default value for DOMAIN is the current value of
+ `TEXTDOMAIN'. The default value for CATEGORY is `"LC_MESSAGES"'.
+
+ The same remarks as for the `dcgettext' function apply.
+
`bindtextdomain(DIRECTORY [, DOMAIN])'
- This built-in function allows you to specify the directory where
+ This built-in function allows you to specify the directory in which
`gettext' looks for `.mo' files, in case they will not or cannot
be placed in the standard locations (e.g., during testing). It
- returns the directory where DOMAIN is "bound."
+ returns the directory in which DOMAIN is "bound."
The default DOMAIN is the value of `TEXTDOMAIN'. If DIRECTORY is
the null string (`""'), then `bindtextdomain' returns the current
@@ -10769,7 +10793,7 @@ outlined in *Note GNU `gettext': Explaining gettext, like so:
printf(_"Number of users is %d\n", nusers)
3. If you are creating strings dynamically, you can still translate
- them, using the `dcgettext' built-in function.
+ them, using the `dcgettext' built-in function:
message = nusers " users logged in"
message = dcgettext(message, "adminprog")
@@ -10796,8 +10820,8 @@ outlined in *Note GNU `gettext': Explaining gettext, like so:
*Note A Simple Internationalization Example: I18N Example, for an
-example program showing the steps necessary to create and use
-translations from `awk'.
+example program showing the steps to create and use translations from
+`awk'.

File: gawk.info, Node: Translator i18n, Next: I18N Example, Prev: Programmer i18n, Up: Internationalization
@@ -10837,15 +10861,15 @@ to create the initial `.po' file:
Instead, it parses it as usual and prints all marked strings to
standard output in the format of a GNU `gettext' Portable Object file.
Also included in the output are any constant strings that appear as the
-first argument to `dcgettext'.(1) *Note A Simple Internationalization
-Example: I18N Example, for the full list of steps to go through to
-create and test translations for `guide'.
+first argument to `dcgettext' or as the first and second argument to
+`dcngettext'.(1) *Note A Simple Internationalization Example: I18N
+Example, for the full list of steps to go through to create and test
+translations for `guide'.
---------- Footnotes ----------
- (1) Eventually, the `xgettext' utility that comes with GNU `gettext'
-will be taught to automatically run `gawk --gen-po' for `.awk' files,
-freeing the translator from having to do it manually.
+ (1) Starting with `gettext' version 0.11.1, the `xgettext' utility
+that comes with GNU `gettext' can handle `.awk' files.

File: gawk.info, Node: Printf Ordering, Next: I18N Portability, Prev: String Extraction, Up: Translator i18n
@@ -10879,7 +10903,7 @@ For example:
indicates which argument to use, and a `$'. Counts are one-based, and
the format string itself is _not_ included. Thus, in the following
example, `string' is the first argument and `length(string)' is the
-second.
+second:
$ gawk 'BEGIN {
> string = "Dont Panic"
@@ -10903,7 +10927,7 @@ precision capability:
*Note:* When using `*' with a positional specifier, the `*' comes
first, then the integer position, and then the `$'. This is somewhat
-counter-intutive.
+counterintutive.
`gawk' does not allow you to mix regular format specifiers and those
with positional specifiers in the same string:
@@ -10942,7 +10966,7 @@ use them to other versions of `awk'. Consider this program:
}
As written, it won't work on other versions of `awk'. However, it is
-actually almost portable, requiring very little change.
+actually almost portable, requiring very little change:
* Assignments to `TEXTDOMAIN' won't have any effect, since
`TEXTDOMAIN' is not special in other `awk' implementations.
@@ -10952,9 +10976,9 @@ actually almost portable, requiring very little change.
it.(1) Typically, the variable `_' has the null string (`""') as
its value, leaving the original string constant as the result.
- * By defining "dummy" functions to replace `dcgettext' and
- `bindtextdomain', the `awk' program can be made to run, but all
- the messages are output in the original language. For example:
+ * By defining "dummy" functions to replace `dcgettext', `dcngettext'
+ and `bindtextdomain', the `awk' program can be made to run, but
+ all the messages are output in the original language. For example:
function bindtextdomain(dir, domain)
{
@@ -10965,6 +10989,11 @@ actually almost portable, requiring very little change.
{
return string
}
+
+ function dcngettext(string1, string2, number, domain, category)
+ {
+ return (number == 1 ? string1 : string2)
+ }
* The use of positional specifications in `printf' or `sprintf' is
_not_ portable. To support `gettext' at the C level, many
@@ -11060,9 +11089,10 @@ proper directory so that `gawk' can find it:
-| Like, the scoop is 42
-| Pardon me, Zaphod who?
- If the two replacement functions for `dcgettext' and `bindtextdomain'
-(*note `awk' Portability Issues: I18N Portability.) are in a file
-named `libintl.awk', then we can run `guide.awk' unchanged as follows:
+ If the three replacement functions for `dcgettext', `dcngettext' and
+`bindtextdomain' (*note `awk' Portability Issues: I18N Portability.)
+are in a file named `libintl.awk', then we can run `guide.awk'
+unchanged as follows:
$ gawk --posix -f guide.awk -f libintl.awk
-| Don't Panic
@@ -11082,8 +11112,8 @@ File: gawk.info, Node: Gawk I18N, Prev: I18N Example, Up: Internationalizatio
As of version 3.1, `gawk' itself has been internationalized using
the GNU `gettext' package. (GNU `gettext' is described in complete
detail in *Note Top::.) As of this writing, the latest version of GNU
-`gettext' is version 0.10.37
-(ftp://gnudist.gnu.org/gnu/gettext/gettext-0.10.37.tar.gz).
+`gettext' is version 0.11.1
+(ftp://ftp.gnu.org/gnu/gettext/gettext-0.11.1.tar.gz).
If a translation of `gawk''s messages exists, then `gawk' produces
usage messages, warnings, and fatal errors in the local language.
@@ -11105,7 +11135,7 @@ Advanced Features of `gawk'
This major node discusses advanced features in `gawk'. It's a bit
of a "grab bag" of items that are otherwise unrelated to each other.
-First, a command-line option allows `gawk' to recognize non-decimal
+First, a command-line option allows `gawk' to recognize nondecimal
numbers in input data, not just in `awk' programs. Next, two-way I/O,
discussed briefly in earlier parts of this Info file, is described in
full detail, along with the basics of TCP/IP networking and BSD portal
@@ -11119,20 +11149,20 @@ description is relegated to an appendix.
* Menu:
-* Non-decimal Data:: Allowing non-decimal input data.
+* Nondecimal Data:: Allowing nondecimal input data.
* Two-way I/O:: Two-way communications with another process.
* TCP/IP Networking:: Using `gawk' for network programming.
* Portal Files:: Using `gawk' with BSD portals.
* Profiling:: Profiling your `awk' programs.

-File: gawk.info, Node: Non-decimal Data, Next: Two-way I/O, Prev: Advanced Features, Up: Advanced Features
+File: gawk.info, Node: Nondecimal Data, Next: Two-way I/O, Prev: Advanced Features, Up: Advanced Features
-Allowing Non-Decimal Input Data
-===============================
+Allowing Nondecimal Input Data
+==============================
If you run `gawk' with the `--non-decimal-data' option, you can have
-non-decimal constants in your input data:
+nondecimal constants in your input data:
$ echo 0123 123 0x123 |
> gawk --non-decimal-data '{ printf "%d, %d, %d\n",
@@ -11163,12 +11193,12 @@ request it.
*Caution:* _Use of this option is not recommended._ It can break old
programs very badly. Instead, use the `strtonum' function to convert
-your data (*note Octal and Hexadecimal Numbers: Non-decimal-numbers.).
+your data (*note Octal and Hexadecimal Numbers: Nondecimal-numbers.).
This makes your programs easier to write and easier to read, and leads
to less surprising results.

-File: gawk.info, Node: Two-way I/O, Next: TCP/IP Networking, Prev: Non-decimal Data, Up: Advanced Features
+File: gawk.info, Node: Two-way I/O, Next: TCP/IP Networking, Prev: Nondecimal Data, Up: Advanced Features
Two-Way Communications with Another Process
===========================================
@@ -11212,7 +11242,7 @@ This works, but not elegantly.
_two-way_ pipe to another process. The second process is termed a
"coprocess", since it runs in parallel with `gawk'. The two-way
connection is created using the new `|&' operator (borrowed from the
-Korn Shell, `ksh'):(1)
+Korn shell, `ksh'):(1)
do {
print DATA |& "subprogram"
@@ -11235,6 +11265,8 @@ or pipeline of programs, that can be started by the shell.
standard error goes. It is not possible to read the child's
standard error separately.
+ </itemizedlist>
+
* I/O buffering may be a problem. `gawk' automatically flushes all
output down the pipe to the child process. However, if the
coprocess does not flush its output, `gawk' may hang when doing a
@@ -11309,8 +11341,8 @@ networking is by recognizing special file names that begin with
`/inet/'.
The full syntax of the special file name is
-`/inet/PROTOCOL/LOCAL-PORT/REMOTE-HOST/REMOTE-PORT'. The meaning of
-the components are:
+`/inet/PROTOCOL/LOCAL-PORT/REMOTE-HOST/REMOTE-PORT'. The components
+are:
PROTOCOL
The protocol to use over IP. This must be either `tcp', `udp', or
@@ -11325,7 +11357,7 @@ LOCAL-PORT
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 `smtp' or `http', in which case `gawk'
- attempts to determine the pre-defined port number using the C
+ attempts to determine the predefined port number using the C
`getservbyname' function.
REMOTE-HOST
@@ -11382,8 +11414,8 @@ version of `gawk', called `pgawk' ("profiling `gawk'").
`pgawk' is identical in every way to `gawk', except that when it has
finished running, it creates a profile of your program in a file named
-`awkprof.out'. Because it is profiling, it also executes up to 45
-percent slower than `gawk' normally does.
+`awkprof.out'. Because it is profiling, it also executes up to 45%
+slower than `gawk' normally does.
As shown in the following example, the `--profile' option can be
used to change the name of the file where `pgawk' will write the
@@ -11436,8 +11468,8 @@ First, the `awk' program:
junk
Here is the `awkprof.out' that results from running `pgawk' on this
-program and data. (This example also illustrates that `awk'
-programmers sometimes have to work late.):
+program and data (this example also illustrates that `awk' programmers
+sometimes have to work late):
# gawk profile, created Sun Aug 13 00:00:15 2000
@@ -11479,8 +11511,8 @@ programmers sometimes have to work late.):
6 print "I gotta be me!"
}
- The previous example illustrates many of the basic rules for
-profiling output. The rules are as follows:
+ This example illustrates many of the basic rules for profiling
+output. The rules are as follows:
* The program is printed in the order `BEGIN' rule, pattern/action
rules, `END' rule and functions, listed alphabetically. Multiple
@@ -11510,7 +11542,7 @@ profiling output. The rules are as follows:
counts next to the statements in the body show how many times
those statements were executed.
- * The layout uses "K&R" style using tabs. Braces are used
+ * The layout uses "K&R" style with tabs. Braces are used
everywhere, even when the body of an `if', `else', or loop is only
a single statement.
@@ -11536,7 +11568,7 @@ profiling output. The rules are as follows:
you typed when you wrote it. This is because `pgawk' creates the
profiled version by "pretty printing" its internal representation of
the program. The advantage to this is that `pgawk' can produce a
-standard representation. The disadvantage is that all source code
+standard representation. The disadvantage is that all source-code
comments are lost, as are the distinctions among multiple `BEGIN' and
`END' rules. Also, things such as:
@@ -11558,7 +11590,7 @@ executed. To use this feature, run `pgawk' in the background:
$ pgawk -f myprog &
[1] 13992
-The shell prints a job number and process ID number, in this case,
+The shell prints a job number and process ID number; in this case,
13992. Use the `kill' command to send the `USR1' signal to `pgawk':
$ kill -USR1 13992
@@ -11581,7 +11613,15 @@ Each time, the profile and function call trace are appended to the
output profile file.
If you use the `HUP' signal instead of the `USR1' signal, `pgawk'
-produces the profile and the function call trace, and then exits.
+produces the profile and the function call trace and then exits.
+
+ When `pgawk' runs on MS-DOS or MS-Windows, it uses the `INT' and
+`QUIT' signals for producing the profile and, in the case of the `INT'
+signal, `pgawk' exits. This is because these systems don't support the
+`kill' command, so the only signals you can deliver to a program are
+those generated by the keyboard. The `INT' signal is generated by the
+`Ctrl-<C>' or `Ctrl-<BREAK>' key, while the `QUIT' signal is generated
+by the `Ctrl-<\>' key.

File: gawk.info, Node: Invoking Gawk, Next: Library Functions, Prev: Advanced Features, Up: Top
@@ -11631,9 +11671,9 @@ supports GNU long options.
awk '' datafile1 datafile2
-Doing so makes little sense though; `awk' exits silently when given an
-empty program. (d.c.) If `--lint' has been specified on the
-command-line, `gawk' issues a warning that the program is empty.
+Doing so makes little sense, though; `awk' exits silently when given an
+empty program. (d.c.) If `--lint' has been specified on the command
+line, `gawk' issues a warning that the program is empty.

File: gawk.info, Node: Options, Next: Other Arguments, Prev: Command Line, Up: Invoking Gawk
@@ -11682,7 +11722,7 @@ options and their meanings are as follows:
`-mf N'
`-mr N'
- Set various memory limits to the value N. The `f' flag sets the
+ Sets various memory limits to the value N. The `f' flag sets the
maximum number of fields and the `r' flag sets the maximum record
size. These two flags and the `-m' option are from the Bell
Laboratories research version of Unix `awk'. They are provided
@@ -11736,21 +11776,21 @@ The following list describes `gawk'-specific options:
`-W dump-variables[=FILE]'
`--dump-variables[=FILE]'
- Print a sorted list of global variables, their types, and final
+ Prints a sorted list of global variables, their types, and final
values to FILE. If no FILE is provided, `gawk' prints this list
- to a file named `awkvars.out' in the current directory.
+ to the file named `awkvars.out' in the current directory.
- Having a list of all the global variables is a good way to look for
+ 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
- `i', `j', and so on.)
+ `i', `j', etc.)
`-W gen-po'
`--gen-po'
- Analyze the source program and generate a GNU `gettext' Portable
+ Analyzes the source program and generates a GNU `gettext' Portable
Object file on standard output for all string constants that have
been marked for translation. *Note Internationalization with
`gawk': Internationalization, for information about this option.
@@ -11759,28 +11799,28 @@ The following list describes `gawk'-specific options:
`-W usage'
`--help'
`--usage'
- Print a "usage" message summarizing the short and long style
+ Prints a "usage" message summarizing the short and long style
options that `gawk' accepts and then exit.
`-W lint[=fatal]'
`--lint[=fatal]'
- Warn about constructs that are dubious or non-portable to other
+ Warns about constructs that are dubious or nonportable to other
`awk' implementations. Some warnings are issued when `gawk' first
reads your program. Others are issued at runtime, as your program
executes. With an optional argument of `fatal', lint warnings
- become fatal errors. This may be drastic but its use will
+ become fatal errors. This may be drastic, but its use will
certainly encourage the development of cleaner `awk' programs.
`-W lint-old'
`--lint-old'
- Warn about constructs that are not available in the original
+ Warns about constructs that are not available in the original
version of `awk' from Version 7 Unix (*note Major Changes Between
V7 and SVR3.1: V7/SVR3.1.).
`-W non-decimal-data'
`--non-decimal-data'
Enable automatic interpretation of octal and hexadecimal values in
- input data (*note Allowing Non-Decimal Input Data: Non-decimal
+ input data (*note Allowing Nondecimal Input Data: Nondecimal
Data.).
*Caution:* This option can severely break old programs. Use with
@@ -11788,9 +11828,9 @@ The following list describes `gawk'-specific options:
`-W posix'
`--posix'
- Operate in strict POSIX mode. This disables all `gawk' extensions
- (just like `--traditional') and adds the following additional
- restrictions:
+ Operates in strict POSIX mode. This disables all `gawk'
+ extensions (just like `--traditional') and adds the following
+ additional restrictions:
* `\x' escape sequences are not recognized (*note Escape
Sequences::).
@@ -11811,15 +11851,15 @@ The following list describes `gawk'-specific options:
also *note Assignment Expressions: Assignment Ops.).
* Specifying `-Ft' on the command-line does not set the value
- of `FS' to be a single tab character (*note Specifying How
+ of `FS' to be a single TAB character (*note Specifying How
Fields Are Separated: Field Separators.).
* The `fflush' built-in function is not supported (*note
Input/Output Functions: I/O Functions.).
- If you supply both `--traditional' and `--posix' on the
- command-line, `--posix' takes precedence. `gawk' also issues a
- warning if both options are supplied.
+ If you supply both `--traditional' and `--posix' on the command
+ line, `--posix' takes precedence. `gawk' also issues a warning if
+ both options are supplied.
`-W profile[=FILE]'
`--profile[=FILE]'
@@ -11835,23 +11875,22 @@ The following list describes `gawk'-specific options:
`-W re-interval'
`--re-interval'
- Allow interval expressions (*note Regular Expression Operators:
+ Allows interval expressions (*note Regular Expression Operators:
Regexp Operators.) in regexps. Because interval expressions were
traditionally not available in `awk', `gawk' does not provide them
by default. This prevents old `awk' programs from breaking.
`-W source PROGRAM-TEXT'
`--source PROGRAM-TEXT'
- Program source code is taken from the 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 (*note The `AWKPATH' Environment Variable: AWKPATH
- Variable.).
+ 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
+ PROGRAM-TEXT. This is particularly useful when you have library
+ functions that you want to use from your command-line programs
+ (*note The `AWKPATH' Environment Variable: AWKPATH Variable.).
`-W version'
`--version'
- Print version information for this particular copy of `gawk'.
+ Prints version information for this particular copy of `gawk'.
This allows you to determine if your copy of `gawk' is up to date
with respect to whatever the Free Software Foundation is currently
distributing. It is also useful for bug reports (*note Reporting
@@ -11861,11 +11900,11 @@ The following list describes `gawk'-specific options:
flagged as invalid with a warning message but are otherwise ignored.
In compatibility mode, as a special case, if the value of FS supplied
-to the `-F' option is `t', then `FS' is set to the tab character
-(`"\t"'). This is only true for `--traditional' and not for `--posix'
+to the `-F' option is `t', then `FS' is set to the TAB character
+(`"\t"'). This is true only for `--traditional' and not for `--posix'
(*note Specifying How Fields Are Separated: Field Separators.).
- The `-f' option may be used more than once on the command-line. If
+ The `-f' option may be used more than once on the command line. If
it is, `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 `awk' functions. These functions can
@@ -11896,7 +11935,7 @@ source code.
behaves in strict POSIX mode, exactly as if you had supplied the
`--posix' command-line option. Many GNU programs look for this
environment variable to turn on strict POSIX mode. If `--lint' is
-supplied on the command-line and `gawk' turns on POSIX mode because of
+supplied on the command line and `gawk' turns on POSIX mode because of
`POSIXLY_CORRECT', then it issues a warning message indicating that
POSIX mode is in effect. You would typically set this variable in your
shell's startup file. For a Bourne-compatible shell (such as `bash'),
@@ -11905,7 +11944,7 @@ you would add these lines to the `.profile' file in your home directory:
POSIXLY_CORRECT=true
export POSIXLY_CORRECT
- For a `csh' compatible shell,(1) you would add this line to the
+ For a `csh'-compatible shell,(1) you would add this line to the
`.login' file in your home directory:
setenv POSIXLY_CORRECT true
@@ -11924,7 +11963,7 @@ File: gawk.info, Node: Other Arguments, Next: AWKPATH Variable, Prev: Options
Other Command-Line Arguments
============================
- Any additional arguments on the command-line are normally treated as
+ 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 `VAR=VALUE', assigns the value VALUE to the
variable VAR--it does not specify a file at all. (This was discussed
@@ -11951,7 +11990,7 @@ rule (*note The `BEGIN' and `END' Special Patterns: BEGIN/END.),
because such rules are run before `awk' begins scanning the argument
list.
- The variable values given on the command-line are processed for
+ The variable values given on the command line are processed for
escape sequences (*note Escape Sequences::). (d.c.)
In some earlier implementations of `awk', when a variable assignment
@@ -11993,19 +12032,19 @@ by one, looking for a file with the specified name.
The search path is a string consisting of directory names separated
by colons. `gawk' gets its search path from the `AWKPATH' environment
variable. If that variable does not exist, `gawk' uses a default path,
-which is `.:/usr/local/share/awk'.(1) (Programs written for use by
-system administrators should use an `AWKPATH' variable that does not
-include the current directory, `.'.)
+`.:/usr/local/share/awk'.(1) (Programs written for use by system
+administrators should use an `AWKPATH' variable that does not include
+the current directory, `.'.)
The search path feature is particularly useful for building libraries
of useful `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 file name. Otherwise, the full file name
+command line with a short file name. Otherwise, the full file name
would have to be typed for each file.
By using both the `--source' and `-f' options, your command-line
-`awk' programs can use facilities in `awk' library files. *Note A
-Library of `awk' Functions: Library Functions. Path searching is not
+`awk' programs can use facilities in `awk' library files (*note A
+Library of `awk' Functions: Library Functions.). Path searching is not
done if `gawk' is in compatibility mode. This is true for both
`--traditional' and `--posix'. *Note Command-Line Options: Options.
@@ -12034,7 +12073,7 @@ found, and `gawk' no longer needs to use `AWKPATH'.
(1) Your version of `gawk' may use a different directory; it will
depend upon how `gawk' was built and installed. The actual directory is
the value of `$(datadir)' generated when `gawk' was configured. You
-probably don't need to worry about this though.
+probably don't need to worry about this, though.

File: gawk.info, Node: Obsolete, Next: Undocumented, Prev: AWKPATH Variable, Up: Invoking Gawk
@@ -12050,7 +12089,7 @@ they will _not_ be in the next release).
For version 3.1 of `gawk', there are no deprecated command-line
options from the previous version of `gawk'. The use of `next file'
(two words) for `nextfile' was deprecated in `gawk' 3.0 but still
-worked. Starting with version 3.1, the two word usage is no longer
+worked. Starting with version 3.1, the two-word usage is no longer
accepted.
The process-related special files described in *Note Special Files
@@ -12079,13 +12118,13 @@ Known Bugs in `gawk'
* The `-F' option for changing the value of `FS' (*note Command-Line
Options: Options.) is not necessary given the command-line
- variable assignment feature; it remains only for backwards
+ variable assignment feature; it remains only for backward
compatibility.
- * Syntactically invalid single character programs tend to overflow
+ * 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.
+ general case, and the effort to do so really is not worth it.

File: gawk.info, Node: Library Functions, Next: Sample Programs, Prev: Invoking Gawk, Up: Top
@@ -12115,19 +12154,19 @@ these example library functions and programs from the Texinfo source
for this Info file. (This has already been done as part of the `gawk'
distribution.)
- If you have written one or more useful, general purpose `awk'
+ If you have written one or more useful, general-purpose `awk'
functions and would like to contribute them to the author's collection
of `awk' programs, see *Note How to Contribute: How To Contribute, for
more information.
The programs in this major node and in *Note Practical `awk'
Programs: Sample Programs, freely use features that are `gawk'-specific.
-It is straightforward to rewrite these programs for different
-implementations of `awk'.
+Rewriting these programs for different implementations of awk is pretty
+straightforward.
Diagnostic error messages are sent to `/dev/stderr'. Use `| "cat
-1>&2"' instead of `> "/dev/stderr"', if your system does not have a
-`/dev/stderr' or if you cannot use `gawk'.
+1>&2"' instead of `> "/dev/stderr"' if your system does not have a
+`/dev/stderr', or if you cannot use `gawk'.
A number of programs use `nextfile' (*note Using `gawk''s `nextfile'
Statement: Nextfile Statement.) to skip any remaining input in the
@@ -12143,7 +12182,7 @@ following rule to the beginning of the program:
{ $0 = tolower($0) }
Also, verify that all regexp and string constants used in comparisons
-only use lowercase letters.
+use only lowercase letters.
* Menu:
@@ -12238,7 +12277,7 @@ merely recommend that you do so.
(1) While all the library routines could have been rewritten to use
this convention, this was not done, in order to show how my own `awk'
-programming style has evolved, and to provide some basis for this
+programming style has evolved and to provide some basis for this
discussion.
(2) `gawk''s `--dump-variables' command-line option is useful for
@@ -12273,7 +12312,7 @@ File: gawk.info, Node: Nextfile Function, Next: Assert Function, Prev: Genera
Implementing `nextfile' as a Function
-------------------------------------
- The `nextfile' statement presented in *Note Using `gawk''s
+ The `nextfile' statement, presented in *Note Using `gawk''s
`nextfile' Statement: Nextfile Statement, is a `gawk'-specific
extension--it is not available in most other implementations of `awk'.
This minor node shows two versions of a `nextfile' function that you
@@ -12301,7 +12340,7 @@ Variables: Library Names.)
all the records from the current data file. The end of the file is
eventually reached and a new data file is opened, changing the value of
`FILENAME'. Once this happens, the comparison of `_abandon_' to
-`FILENAME' fails and execution continues with the first rule of the
+`FILENAME' fails, and execution continues with the first rule of the
"real" program.
The `nextfile' function itself simply sets the value of `_abandon_'
@@ -12310,9 +12349,9 @@ and then executes a `next' statement to start the loop.
This initial version has a subtle problem. If the same data file is
listed _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
-`nextfile' that remedies this problem is shown here:
+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 `nextfile'
+that remedies this problem is shown here:
# nextfile --- skip remaining records in current file
# correctly handle successive occurrences of the same file
@@ -12411,7 +12450,7 @@ false, it prints a message to standard error, using the `string'
parameter to describe the failed condition. It then sets the variable
`_assert_exit' to one and executes the `exit' statement. The `exit'
statement jumps to the `END' rule. If the `END' rules finds
-`_assert_exit' to be true, it then exits immediately.
+`_assert_exit' to be true, it exits immediately.
The purpose of the test in the `END' rule is to keep any other `END'
rules from running. When an assertion fails, the program should exit
@@ -12459,7 +12498,7 @@ This means that if you are using a format that does rounding (e.g.,
function does traditional rounding; it might be useful if your awk's
`printf' does unbiased rounding:
- # round --- do normal rounding
+ # round.awk --- do normal rounding
function round(x, ival, aval, fraction)
{
ival = int(x) # integer part, int() truncates
@@ -12564,16 +12603,15 @@ no real reason to build them into the `awk' interpreter:
}
Some explanation of the numbers used by `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.(1) In the now
-distant past, at least one minicomputer manufacturer used ASCII, but
-with mark parity, meaning that the leftmost bit in the byte is always
-1. This means that on those systems, characters have numeric values
-from 128 to 255. Finally, large mainframe systems use the EBCDIC
-character set, which uses all 256 values. While there are other
-character sets in use on some older systems, they are not really worth
-worrying about:
+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.(1) In the now distant
+past, at least one minicomputer manufacturer used ASCII, but with mark
+parity, meaning that the leftmost bit in the byte is always 1. This
+means that on those systems, characters have numeric values from 128 to
+255. Finally, large mainframe systems use the EBCDIC character set,
+which uses all 256 values. While there are other character sets in use
+on some older systems, they are not really worth worrying about:
function ord(str, c)
{
@@ -12645,7 +12683,7 @@ Functions.):
}
An optional additional argument is the separator to use when joining
-the strings back together. If the caller supplies a non-empty value,
+the strings back together. If the caller supplies a nonempty value,
`join' uses it; if it is not supplied, it has a null value. In this
case, `join' uses a single blank as a default separator for the
strings. If the value is equal to `SUBSEP', then `join' joins the
@@ -12750,7 +12788,7 @@ Data File Management
====================
This minor node presents functions that are useful for managing
-command-line datafiles.
+command-line data files.
* Menu:
@@ -12765,7 +12803,7 @@ File: gawk.info, Node: Filetrans Function, Next: Rewind Function, Prev: Data
Noting Data File Boundaries
---------------------------
- The `BEGIN' and `END' rules are each executed exactly once, at the
+ The `BEGIN' and `END' rules are each executed exactly once at the
beginning and end of your `awk' program, respectively (*note The
`BEGIN' and `END' Special Patterns: BEGIN/END.). We (the `gawk'
authors) once had a user who mistakenly thought that the `BEGIN' rule
@@ -12985,7 +13023,7 @@ When it returns -1, there are no options left on the command line.
When using `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.
+option letter, or it can be a separate command-line argument.
Given a hypothetical program that takes three command-line options,
`-a', `-b', and `-c', where `-b' requires an argument, all of the
@@ -13006,7 +13044,7 @@ use:
`optind'
The index in the argument value array (`argv') where the first
- non-option command-line argument can be found.
+ nonoption command-line argument can be found.
`optarg'
The string value of the argument to an option.
@@ -13066,7 +13104,7 @@ characters (*note String Manipulation Functions: String Functions.).(1)
# getopt.awk --- do C library getopt(3) function in awk
# External variables:
- # Optind -- index in ARGV of first non-option argument
+ # 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
@@ -13112,7 +13150,7 @@ because it is a global variable.
perhaps a bit of overkill; it checks for a `-' 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.
+option processing:
if (_opti == 0)
_opti = 2
@@ -13171,7 +13209,7 @@ invalid option letter actually is. Continuing on:
a colon in the `options' string. If there are remaining characters in
the current command-line argument (`argv[Optind]'), then the rest of
that string is assigned to `Optarg'. Otherwise, the next command-line
-argument is used (`-xFOO' vs. `-x FOO'). In either case, `_opti' is
+argument is used (`-xFOO' versus `-x FOO'). In either case, `_opti' is
reset to zero, because there are no more characters left to examine in
the current command-line argument. Continuing:
@@ -13249,14 +13287,14 @@ Reading the User Database
=========================
The `PROCINFO' array (*note Built-in Variables::) provides access to
-the current user's real and effective user and group id numbers, and if
+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 minor node presents a
-suite of functions for retrieving information from the user database.
-*Note Reading the Group Database: Group Functions, for a similar suite
-that retrieves information from the group database.
+associated with the user and group ID numbers. This minor node
+presents a suite of functions for retrieving information from the user
+database. *Note Reading the Group Database: Group Functions, for a
+similar suite that retrieves information from the group database.
The POSIX standard does not define the file where user information is
kept. Instead, it provides the `<pwd.h>' header file and several C
@@ -13274,7 +13312,7 @@ pointer to a `struct passwd'. Each time it is called, it returns the
next entry in the database. When there are no more entries, it returns
`NULL', the null pointer. When this happens, the C program should call
`endpwent' to close the database. Following is `pwcat', a C program
-that "cats" the password database.
+that "cats" the password database:
/*
* pwcat.c
@@ -13307,8 +13345,8 @@ of colon-separated fields. The fields are:
Login name The user's login name.
Encrypted password The user's encrypted password. This may not be
available on some systems.
-User-ID The user's numeric user-id number.
-Group-ID The user's numeric group-id number.
+User-ID The user's numeric user ID number.
+Group-ID The user's numeric group ID number.
Full name The user's full name, and perhaps other
information associated with the user.
Home directory The user's login (or "home") directory
@@ -13374,7 +13412,7 @@ you might want it to be in a different directory on your system.
The function `_pw_init' keeps three copies of the user information
in three associative arrays. The arrays are indexed by username
-(`_pw_byname'), by user-id number (`_pw_byuid'), and by order of
+(`_pw_byname'), by user ID number (`_pw_byuid'), and by order of
occurrence (`_pw_bycount'). The variable `_pw_inited' is used for
efficiency; `_pw_init' needs only to be called once.
@@ -13400,7 +13438,7 @@ explained shortly.
The `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:
+Otherwise, it returns the null string:
function getpwnam(name)
{
@@ -13410,9 +13448,9 @@ Otherwise it returns the null string:
return ""
}
- Similarly, the `getpwuid' function takes a user-id number argument.
+ Similarly, the `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:
+line. Otherwise, it returns the null string:
function getpwuid(uid)
{
@@ -13442,15 +13480,16 @@ subsequent calls to `getpwent' start over again:
_pw_count = 0
}
- A conscious design decision in this suite is that each subroutine
-calls `_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 functions. If this library file is loaded along with a
-user's program, but none of the routines are ever called, then there is
-no extra runtime overhead. (The alternative is move the body of
-`_pw_init' into a `BEGIN' rule, which always runs `pwcat'. This
-simplifies the code but runs an extra process that may never be needed.)
+ A conscious design decision in this suite was made that each
+subroutine calls `_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 functions. If this library file is loaded
+along with a user's program, but none of the routines are ever called,
+then there is no extra runtime overhead. (The alternative is move the
+body of `_pw_init' into a `BEGIN' rule, which always runs `pwcat'.
+This simplifies the code but runs an extra process that may never be
+needed.)
In turn, calling `_pw_init' is not too expensive, because the
`_pw_inited' variable keeps the program from reading the data more than
@@ -13522,14 +13561,14 @@ Group name The group's name.
Group password The group's encrypted password. In practice,
this field is never used; it is usually empty
or set to `*'.
-Group-ID The group's numeric group-id number; this
+Group-ID The group's numeric group ID number; this
number should be unique within the file.
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 `"group1"' through
- `"groupN"' in `PROCINFO' for those group-id
+ `"groupN"' in `PROCINFO' for those group ID
numbers. (Note that `PROCINFO' is a `gawk'
extension; *note Built-in Variables::.)
@@ -13612,10 +13651,10 @@ more than once. The `_gr_init' function first saves `FS',
correct values for scanning the group information.
The group information is stored is several associative arrays. The
-arrays are indexed by group name (`_gr_byname'), by group-id number
+arrays are indexed by group name (`_gr_byname'), by group ID number
(`_gr_bygid'), and by position in the database (`_gr_bycount'). There
is an additional array indexed by username (`_gr_groupsbyuser'), which
-is a space-separated list of groups that each user belongs to.
+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
@@ -13625,7 +13664,7 @@ following:
tvpeople:*:101:johnny,jay,arsenio
tvpeople:*:101:david,conan,tom,joan
- For this reason, `_gr_init' looks to see if a group name or group-id
+ For this reason, `_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
@@ -13648,8 +13687,8 @@ null string:
return ""
}
- The `getgrgid' function is similar, it takes a numeric group-id and
-looks up the information associated with that group-id:
+ The `getgrgid' function is similar, it takes a numeric group ID and
+looks up the information associated with that group ID:
function getgrgid(gid)
{
@@ -13783,7 +13822,7 @@ Cutting out Fields and Columns
The `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 "delimiter" (i.e., the field separator character).
+to change the field "delimiter" (i.e., the field-separator character).
`cut''s definition of fields is less general than `awk''s.
A common use of `cut' might be to pull out just the login name of
@@ -13804,7 +13843,7 @@ pipeline generates a sorted, unique list of the logged-on users:
Use LIST as the list of fields to cut out.
`-d DELIM'
- Use DELIM as the field separator character instead of the tab
+ Use DELIM as the field-separator character instead of the tab
character.
`-s'
@@ -13842,13 +13881,13 @@ The variables `e1' and `e2' are used so that the function fits nicely
on the screen.
Next comes a `BEGIN' rule that parses the command-line options. It
-sets `FS' to a single tab character, because that is `cut''s default
+sets `FS' to a single TAB character, because that is `cut''s default
field separator. The output field separator is also set to be the same
as the input field separator. Then `getopt' is used to step through
-the command-line options. One or the other of the variables
-`by_fields' or `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.
+the command-line options. Exactly one of the variables `by_fields' or
+`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:
BEGIN \
{
@@ -13912,7 +13951,7 @@ fields or characters:
set_charlist()
}
- `set_fieldlist' is used to split the field list apart at the commas,
+ `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.
@@ -13942,7 +13981,7 @@ The program lets `awk' handle the job of doing the field splitting:
The `set_charlist' function is more complicated than `set_fieldlist'.
The idea here is to use `gawk''s `FIELDWIDTHS' variable (*note Reading
-Fixed-Width Data: Constant Size.), which describes constant width
+Fixed-Width Data: Constant Size.), which describes constant-width
input. When using a character list, that is exactly what we have.
Setting up `FIELDWIDTHS' is more complicated than simply listing the
@@ -14116,7 +14155,7 @@ that processes the command-line arguments with `getopt'. The `-i'
}
Next comes the code that handles the `egrep'-specific behavior. If no
-pattern is supplied with `-e', the first non-option on the command line
+pattern is supplied with `-e', the first nonoption on the command line
is used. The `awk' command-line arguments up to `ARGV[Optind]' are
cleared, so that `awk' won't try to process them as files. If no files
are specified, the standard input is used, and if multiple files are
@@ -14155,9 +14194,9 @@ since it is not necessary with `gawk':
The `beginfile' function is called by the rule in `ftrans.awk' when
each new file is processed. In this case, it is very simple; all it
does is initialize a variable `fcount' to zero. `fcount' tracks how
-many lines in the current file matched the pattern. (Naming the
+many lines in the current file matched the pattern (naming the
parameter `junk' shows we know that `beginfile' is called with a
-parameter, but that we're not interested in its value.):
+parameter, but that we're not interested in its value):
function beginfile(junk)
{
@@ -14170,8 +14209,8 @@ lines that matched. `no_print' is true only if the exit status is
desired. `count_only' is true if line counts are desired. `egrep'
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, `fcount' is added to `total', so that we know how
-many lines altogether matched the pattern:
+process. Finally, `fcount' is added to `total', so that we know the
+total number of lines that matched the pattern:
function endfile(file)
{
@@ -14227,7 +14266,7 @@ line is printed, with a leading file name and colon if necessary:
}
The `END' rule takes care of producing the correct exit status. If
-there are no matches, the exit status is one, otherwise it is zero:
+there are no matches, the exit status is one; otherwise it is zero:
END \
{
@@ -14268,9 +14307,9 @@ File: gawk.info, Node: Id Program, Next: Split Program, Prev: Egrep Program,
Printing out User Information
-----------------------------
- The `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.
-`id' only prints the effective user-id and group-id if they are
+ The `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.
+`id' only prints the effective user ID and group ID if they are
different from the real ones. If possible, `id' also supplies the
corresponding user and group names. The output might look like this:
@@ -14289,9 +14328,9 @@ the Group Database: Group Functions.):
The program is fairly straightforward. All the work is done in the
`BEGIN' rule. The user and group ID numbers are obtained from
`PROCINFO'. The code is repetitive. The entry in the user database
-for the real user-id number is split into parts at the `:'. The name is
-the first field. Similar code is used for the effective user-id number
-and the group numbers.
+for the real user ID number is split into parts at the `:'. The name is
+the first field. Similar code is used for the effective user ID number
+and the group numbers:
# id.awk --- implement id in awk
#
@@ -14358,9 +14397,8 @@ and the group numbers.
The test in the `for' loop is worth noting. Any supplementary
groups in the `PROCINFO' array have the indices `"group1"' through
-`"groupN"' for some 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.
+`"groupN"' for some 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
`"group"', and then using `in' to see if that value is in the array.
@@ -14378,7 +14416,7 @@ Splitting a Large File into Pieces
----------------------------------
The `split' program splits large text files into smaller pieces.
-The usage is as follows:
+Usage is as follows:
split [-COUNT] file [ PREFIX ]
@@ -14396,8 +14434,8 @@ Numbers: Ordinal Functions.
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
+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 file name is
skipped over and the final argument is used as the prefix for the
output file names:
@@ -14470,10 +14508,10 @@ The `usage' function simply prints an error message and exits:
The variable `e' is used so that the function fits nicely on the screen.
- This program is a bit sloppy; it relies on `awk' to close the last
-file for it automatically, instead of doing it in an `END' rule. It
-also assumes that letters are contiguous in the character set, which
-isn't true for EBCDIC systems.
+ This program is a bit sloppy; it relies on `awk' to automatically
+close the last file instead of doing it in an `END' rule. It also
+assumes that letters are contiguous in the character set, which isn't
+true for EBCDIC systems.

File: gawk.info, Node: Tee Program, Next: Uniq Program, Prev: Split Program, Up: Clones
@@ -14562,8 +14600,8 @@ N input records and M output files, the first method only executes N

File: gawk.info, Node: Uniq Program, Next: Wc Program, Prev: Tee Program, Up: Clones
-Printing Non-Duplicated Lines of Text
--------------------------------------
+Printing Nonduplicated Lines of Text
+------------------------------------
The `uniq' utility reads sorted lines of data on its standard input,
and by default removes duplicate lines. In other words, it only prints
@@ -14572,21 +14610,21 @@ usage is as follows:
uniq [-udc [-N]] [+N] [ INPUT FILE [ OUTPUT FILE ]]
- The option meanings are:
+ The options for `uniq' are:
`-d'
- Only print repeated lines.
+ Pnly print only repeated lines.
`-u'
- Only print non-repeated lines.
+ Print only nonrepeated lines.
`-c'
Count lines. This option overrides `-d' and `-u'. Both repeated
- and non-repeated lines are counted.
+ and nonrepeated lines are counted.
`-N'
Skip N fields before comparing lines. The definition of fields is
- similar to `awk''s default: non-whitespace characters separated by
+ similar to `awk''s default: nonwhitespace characters separated by
runs of spaces and/or tabs.
`+N'
@@ -14616,11 +14654,12 @@ as the option letter `2' with an argument of `5'. If indeed two or more
digits are supplied (`Optarg' looks like a number), `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 `Optarg' is not needed. `Optind' must be decremented so that
-`getopt' processes it next time. This code is admittedly a bit tricky.
+then `Optarg' is not needed. In this case, `Optind' must be decremented
+so that `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
+repeated and nonrepeated lines. The output file, if provided, is
assigned to `outputfile'. Early on, `outputfile' is initialized to the
standard output, `/dev/stdout':
@@ -14726,13 +14765,13 @@ to.
The second rule does the work. The variable `equal' is one or zero,
depending upon the results of `are_equal''s comparison. If `uniq' is
counting repeated lines, and the lines are equal, then it increments
-the `count' variable. Otherwise it prints the line and resets `count',
+the `count' variable. Otherwise, it prints the line and resets `count',
since the two lines are not equal.
If `uniq' is not counting, and if the lines are equal, `count' is
incremented. Nothing is printed, since the point is to remove
duplicates. Otherwise, if `uniq' is counting repeated lines and more
-than one line is seen, or if `uniq' is counting non-repeated lines and
+than one line is seen, or if `uniq' is counting nonrepeated lines and
only one line is seen, then the line is printed, and `count' is reset.
Finally, similar logic is used in the `END' rule to print the final
@@ -14793,16 +14832,16 @@ counts for all the files. The options and their meanings are shown in
the following list:
`-l'
- Only count lines.
+ Count only lines.
`-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 `awk' separates fields in its
+ Count only words. A "word" is a contiguous sequence of
+ nonwhitespace characters, separated by spaces and/or tabs.
+ Luckily, this is the normal way `awk' separates fields in its
input data.
`-c'
- Only count characters.
+ Count only characters.
Implementing `wc' in `awk' is particularly elegant, since `awk' does
a lot of the work for us; it splits lines into words (i.e., fields) and
@@ -14810,7 +14849,7 @@ counts them, it counts lines (i.e., records), and it can easily tell us
how long a line is.
This uses the `getopt' library function (*note Processing
-Command-Line Options: Getopt Function.) and the file transition
+Command-Line Options: Getopt Function.) and the file-transition
functions (*note Noting Data File Boundaries: Filetrans Function.).
This version has one notable difference from traditional versions of
@@ -14865,7 +14904,7 @@ lines, words, and characters to zero, and saves the current file name in
}
The `endfile' function adds the current file's numbers to the running
-totals of lines, words, and characters. It then prints out those
+totals of lines, words, and characters.(1) It then prints out those
numbers for the file that was just read. It relies on `beginfile' to
reset the numbers for the following data file:
@@ -14889,7 +14928,7 @@ is needed because the newline character separating records (the value
of `RS') is not part of the record itself, and thus not included in its
length. Next, `lines' is incremented for each line read, and `words'
is incremented by the value of `NF', which is the number of "words" on
-this line:(1)
+this line:
# do per line
{
@@ -14898,7 +14937,7 @@ this line:(1)
words += NF
}
- Finally, the `END' rule simply prints the totals for all the files.
+ Finally, the `END' rule simply prints the totals for all the files:
END {
if (print_total) {
@@ -14914,9 +14953,9 @@ this line:(1)
---------- Footnotes ----------
- (1) `wc' can't just use the value of `FNR' in `endfile'. If you
+ (1) `wc' can't just use the value of `FNR' in `endfile'. If you
examine the code in *Note Noting Data File Boundaries: Filetrans
-Function, you will see that `FNR' has already been reset by the time
+Function you will see that `FNR' has already been reset by the time
`endfile' is called.

@@ -14951,9 +14990,9 @@ 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 ...." 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.
+"the the program does the following..." 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.
This program, `dupword.awk', scans through a file one line at a time
and looks for adjacent occurrences of the same word. It also saves the
@@ -14962,13 +15001,13 @@ first word on the next line.
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
+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 `@code{NF}' becomes
-`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.
+`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
@@ -15013,10 +15052,10 @@ the Time of Day: Gettimeofday Function.
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, `"\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.):
+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:
# alarm.awk --- set an alarm
#
@@ -15147,18 +15186,17 @@ most of the job.
standard `awk': dealing with individual characters is very painful,
requiring repeated use of the `substr', `index', and `gsub' built-in
functions (*note String Manipulation Functions: String Functions.).(2)
-
- There are two functions. The first, `stranslate', takes three
+There are two functions. The first, `stranslate', takes three
arguments:
`from'
- A list of characters to translate from.
+ A list of characters from which to translate.
`to'
- A list of characters to translate to.
+ A list of characters to which to translate.
`target'
- The string to do the translation on.
+ The string on which to do the translation.
Associative arrays make the translation part fairly easy. `t_ar'
holds the "to" characters, indexed by the "from" characters. Then a
@@ -15251,9 +15289,9 @@ Printing Mailing Labels
Here is a "real world"(1) 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.
+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 is stored in the `line' array. The single rule takes care
@@ -15272,7 +15310,7 @@ print horizontally; `line[1]' next to `line[6]', `line[2]' next to
outer loop, controlled by `i', steps through every 10 lines of data;
this is each row of labels. The inner loop, controlled by `j', goes
through the lines within the row. As `j' goes from 0 to 4, `i+j' is
-the `j''th line in the row, and `i+j+5' is the entry next to it. The
+the `j'-th line in the row, and `i+j+5' is the entry next to it. The
output ends up looking something like this:
line 1 line 6
@@ -15285,7 +15323,7 @@ output ends up looking something like this:
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
+will also note that there are 2 blank lines at the top and 2 blank
lines at the bottom.
The `END' rule arranges to flush the final page of labels; there may
@@ -15351,7 +15389,7 @@ something done."

File: gawk.info, Node: Word Sorting, Next: History Sorting, Prev: Labels Program, Up: Miscellaneous Programs
-Generating Word Usage Counts
+Generating Word-Usage Counts
----------------------------
The following `awk' program prints the number of occurrences of each
@@ -15426,7 +15464,7 @@ Finally, we use the system `sort' utility to process the output of the
Assuming we have saved this program in a file named `wordfreq.awk',
and that the data is in `file1', the following pipeline:
- awk -f wordfreq.awk file1 | sort +1 -nr
+ awk -f wordfreq.awk file1 | sort -k 2nr
produces a table of the words appearing in `file1' in order of
decreasing frequency. The `awk' program suitably massages the data and
@@ -15443,7 +15481,7 @@ descending (reverse) order.
the `END' action to:
END {
- sort = "sort +1 -nr"
+ sort = "sort -k 2nr"
for (word in freq)
printf "%s\t%d\n", word, freq[word] | sort
close(sort)
@@ -15460,8 +15498,8 @@ File: gawk.info, Node: History Sorting, Next: Extract Program, Prev: Word Sor
Removing Duplicates from Unsorted Text
--------------------------------------
- The `uniq' program (*note Printing Non-Duplicated Lines of Text:
-Uniq Program.), removes duplicate lines from _sorted_ data.
+ The `uniq' program (*note Printing Nonduplicated Lines of Text: Uniq
+Program.), removes duplicate lines from _sorted_ data.
Suppose, however, you need to remove duplicate lines from a data
file but that you want to preserve the order the lines are in. A good
@@ -15525,14 +15563,14 @@ input files:
(`\') is in C or `awk'. Literal `@' symbols are represented in
Texinfo source files as `@@'.
- * Comments start with either `@c' or `@comment'. The file
- extraction program works by using special comments that start at
- the beginning of a line.
+ * Comments start with either `@c' or `@comment'. The
+ file-extraction program works by using special comments that start
+ at the beginning of a line.
* Lines containing `@group' and `@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.)
+ right, and we have to give it some help.)
The following program, `extract.awk', reads through a Texinfo source
file and does two things, based on the special comments. Upon seeing
@@ -15700,18 +15738,18 @@ File: gawk.info, Node: Simple Sed, Next: Igawk Program, Prev: Extract Program
A Simple Stream Editor
----------------------
- The `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. While `sed' is a complicated
-program in its own right, its most common use is to perform global
-substitutions in the middle of a pipeline:
+ The `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. While `sed' is a complicated program in its
+own right, its most common use is to perform global substitutions in
+the middle of a pipeline:
command1 < orig.data | sed 's/old/new/g' | command2 > result
Here, `s/old/new/g' tells `sed' to look for the regexp `old' on each
-input line and globally replace it with the text `new', (i.e., all the
-occurrences on a line). This is similar to `awk''s `gsub' function
+input line and globally replace it with the text `new', i.e., all the
+occurrences on a line. This is similar to `awk''s `gsub' function
(*note String Manipulation Functions: String Functions.).
The following program, `awksed.awk', accepts at least two
@@ -15816,7 +15854,7 @@ ability to have multiple source files specified via `-f', and the
ability to mix command-line and library source files.
The program is written using the POSIX Shell (`sh') command language.
-The way the program works is as follows:
+It works as follows:
1. Loop through the arguments, saving anything that doesn't represent
`awk' source code for later, when the expanded program is run.
@@ -15828,9 +15866,9 @@ The way the program works is as follows:
text is just echoed directly. The `echo' program
automatically supplies a trailing newline.
- b. Source file names provided with `-f'. We use a neat trick
+ b. Source file names, provided with `-f'. We use a neat trick
and echo `@include FILENAME' into the temporary file. Since
- the file inclusion program works the way `gawk' does, this
+ the file-inclusion program works the way `gawk' does, this
gets the text of the file included into the program at the
correct point.
@@ -15876,12 +15914,12 @@ are several cases of interest:
the `gawk' version information, and then exits.
If none of the `-f', `--file', `-Wfile', `--source', or `-Wsource'
-arguments are supplied, then the first non-option argument should be
-the `awk' program. If there are no command-line arguments left,
-`igawk' prints an error message and exits. Otherwise, the first
-argument is echoed into `/tmp/ig.s.$$'. In any case, after the
-arguments have been processed, `/tmp/ig.s.$$' contains the complete
-text of the original `awk' program.
+arguments are supplied, then the first nonoption argument should be the
+`awk' program. If there are no command-line arguments left, `igawk'
+prints an error message and exits. Otherwise, the first argument is
+echoed into `/tmp/ig.s.$$'. In any case, after the arguments have been
+processed, `/tmp/ig.s.$$' contains the complete text of the original
+`awk' program.
The `$$' in `sh' represents the current process ID number. It is
often used in shell programs to generate unique temporary file names.
@@ -16073,10 +16111,9 @@ There are three key simplifications that make the program work better:
the initial collected `awk' program much simpler; all the
`@include' processing can be done once.
- * The `pathto' function doesn't try to save the line read with
- `getline' when testing for the file's accessibility. Trying to
- save this line for use with the main program complicates things
- considerably.
+ * Not trying to save the line read with `getline' in the `pathto'
+ function when testing for the file's accessibility for use with
+ the main program simplifies things considerably.
* Using a `getline' loop in the `BEGIN' rule does it all in one
place. It is not necessary to call out to a separate loop for
@@ -16131,7 +16168,7 @@ Unix. (This implementation was the basis for `awk' in Berkeley Unix,
through 4.3-Reno. Subsequent versions of Berkeley Unix, and systems
derived from 4.4BSD-Lite, use various versions of `gawk' for their
`awk'.) This major node briefly describes the evolution of the `awk'
-language, with cross references to other parts of the Info file where
+language, with cross-references to other parts of the Info file where
you can find more information.
* Menu:
@@ -16301,7 +16338,7 @@ standard:
Assignment Expressions: Assignment Ops).
* Specifying `-Ft' on the command line does not set the value of
- `FS' to be a single tab character (*note Specifying How Fields Are
+ `FS' to be a single TAB character (*note Specifying How Fields Are
Separated: Field Separators.).
* The `fflush' built-in function is not supported (*note
@@ -16317,7 +16354,7 @@ Extensions in the Bell Laboratories `awk'
made his version available via his home page (*note Other Freely
Available `awk' Implementations: Other Versions.). This minor node
describes extensions in his version of `awk' that are not in POSIX
-`awk'.
+`awk':
* The `-mf N' and `-mr N' command-line options to set the maximum
number of fields and the maximum record size, respectively (*note
@@ -16407,8 +16444,7 @@ options (*note Command-Line Options: Options.).
through `ARGV' (*note Built-in Variables::).
* The `ERRNO' variable, which contains the system error message when
- `getline' returns -1 or when `close' fails (*note Built-in
- Variables::).
+ `getline' returns -1 or `close' fails (*note Built-in Variables::).
* The `/dev/pid', `/dev/ppid', `/dev/pgrpid', and `/dev/user' file
name interpretation (*note Special File Names in `gawk': Special
@@ -16420,7 +16456,7 @@ options (*note Command-Line Options: Options.).
* The ability to use GNU-style long-named options that start with
`--' (*note Command-Line Options: Options.).
- * The `--source' option for mixing command-line and library file
+ * The `--source' option for mixing command-line and library-file
source code (*note Command-Line Options: Options.).
Version 3.0 of `gawk' introduced the following features:
@@ -16492,7 +16528,7 @@ options (*note Command-Line Options: Options.).
* The ability to use octal and hexadecimal constants in `awk'
program source code (*note Octal and Hexadecimal Numbers:
- Non-decimal-numbers.).
+ Nondecimal-numbers.).
* The `|&' operator for two-way I/O to a coprocess (*note Two-Way
Communications with Another Process: Two-way I/O.).
@@ -16540,7 +16576,7 @@ options (*note Command-Line Options: Options.).
Extracting Marked Strings: String Extraction.).
* The `--non-decimal-data' option to allow non-decimal input data
- (*note Allowing Non-Decimal Input Data: Non-decimal Data.).
+ (*note Allowing Nondecimal Input Data: Nondecimal Data.).
* The `--profile' option and `pgawk', the profiling version of
`gawk', for producing execution profiles of `awk' programs (*note
@@ -16610,7 +16646,8 @@ Info file, in approximate chronological order:
* Hal Peterson provided help in porting `gawk' to Cray systems.
- * Kai Uwe Rommel provided the port to OS/2 and its documentation.
+ * Kai Uwe Rommel provided the initial port to OS/2 and its
+ documentation.
* Michal Jaegermann provided the port to Atari systems and its
documentation. He continues to provide portability checking with
@@ -16647,6 +16684,11 @@ Info file, in approximate chronological order:
as well as the code for the new optional third argument to the
`match' function.
+ * Andreas Buening updated the `gawk' port for OS/2.
+
+ Isamu Hasegawa, of IBM in Japan, contributed support for multibyte
+ characters.
+
* Arnold Robbins has been working on `gawk' since 1988, at first
helping David Trueman, and as the primary maintainer since around
1994.
@@ -16700,8 +16742,8 @@ Getting the `gawk' Distribution
* Copy it from someone else who already has it.
* Order `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:
+ distributions are available for Gnu/Linux, Unix, and MS-Windows,
+ in several CD packages. Their address is:
Free Software Foundation
59 Temple Place, Suite 330
@@ -16709,13 +16751,13 @@ Getting the `gawk' Distribution
Phone: +1-617-542-5942
Fax (including Japan): +1-617-542-2652
Email: <gnu@gnu.org>
- URL: `http://www.gnu.org/'
+ URL: `http://www.gnu.org'
Ordering from the FSF directly contributes to the support of the
foundation and to the production of more free software.
* Retrieve `gawk' by using anonymous `ftp' to the Internet host
- `gnudist.gnu.org', in the directory `/gnu/gawk'.
+ `ftp.gnu.org', in the directory `/gnu/gawk'.
The GNU software archive is mirrored around the world. The
up-to-date list of mirror sites is available from the main FSF web site
@@ -16732,23 +16774,23 @@ Extracting the Distribution
`gawk' is distributed as a `tar' file compressed with the GNU Zip
program, `gzip'.
- Once you have the distribution (for example, `gawk-3.1.0.tar.gz'),
+ Once you have the distribution (for example, `gawk-3.1.1.tar.gz'),
use `gzip' to expand the file and then use `tar' to extract it. You
can use the following pipeline to produce the `gawk' distribution:
# Under System V, add 'o' to the tar options
- gzip -d -c gawk-3.1.0.tar.gz | tar -xvpf -
+ gzip -d -c gawk-3.1.1.tar.gz | tar -xvpf -
-This creates a directory named `gawk-3.1.0' in the current directory.
+This creates a directory named `gawk-3.1.1' in the current directory.
The distribution file name is of the form `gawk-V.R.P.tar.gz'. The
V represents the major version of `gawk', the R represents the current
release of version V, and the P represents a "patch level", meaning
that minor bugs have been fixed in the release. The current patch
-level is 0, but when retrieving distributions, you should get the
+level is 1, 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
+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
`gawk' distribution. You should consult a local expert.
@@ -16765,8 +16807,8 @@ configuration process (*note Compiling and Installing `gawk' on Unix:
Unix Installation.), as well as several subdirectories related to
different non-Unix operating systems:
-Various `.c', `.y', and `.h' files:
- These files are the actual `gawk' source code.
+Various `.c', `.y', and `.h' files
+ The actual `gawk' source code.
`README'
`README_d/README.*'
@@ -16794,11 +16836,11 @@ Various `.c', `.y', and `.h' files:
`LIMITATIONS'
A list of those factors that limit `gawk''s performance. Most of
- these depend on the hardware or operating system software, and are
+ these depend on the hardware or operating system software and are
not limits in `gawk' itself.
`POSIX.STD'
- A description of one area where the POSIX standard for `awk' is
+ A description of one area in which the POSIX standard for `awk' is
incorrect as well as how `gawk' handles the problem.
`doc/awkforai.txt'
@@ -16939,7 +16981,7 @@ Compiling `gawk' for Unix
-------------------------
After you have extracted the `gawk' distribution, `cd' to
-`gawk-3.1.0'. Like most GNU software, `gawk' is configured
+`gawk-3.1.1'. Like most GNU software, `gawk' is configured
automatically for your Unix system by running the `configure' program.
This program is a Bourne shell script that is generated automatically
using GNU `autoconf'. (The `autoconf' software is described fully
@@ -16983,12 +17025,12 @@ Additional Configuration Options
--------------------------------
There are several additional options you may use on the `configure'
-command line when compiling `gawk' from scratch.
+command line when compiling `gawk' from scratch, including:
`--enable-portals'
- This option causes `gawk' to treat pathnames that begin with `/p'
- as BSD portal files when doing two-way I/O with the `|&' operator
- (*note Using `gawk' with BSD Portals: Portal Files.).
+ Treat pathnames that begin with `/p' as BSD portal files when
+ doing two-way I/O with the `|&' operator (*note Using `gawk' with
+ BSD Portals: Portal Files.).
`--with-included-gettext'
Use the version of the `gettext' library that comes with `gawk'.
@@ -16997,7 +17039,7 @@ command line when compiling `gawk' from scratch.
systems use Glibc 2. Use this option on any other system.
`--disable-nls'
- Disable all message translation facilities. This is usually not
+ 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
`--with-included-gettext' doesn't work on your system.
@@ -17154,6 +17196,8 @@ please refer to `README_d/README.pc' in the distribution.
and OS/2.
* PC Using:: Running `gawk' on MS-DOS, Win32 and
OS/2.
+* Cygwin:: Building and running `gawk' for
+ Cygwin.

File: gawk.info, Node: PC Binary Installation, Next: PC Compiling, Prev: PC Installation, Up: PC Installation
@@ -17172,8 +17216,26 @@ and `igawk.bat' (in `gnu/bin') may need to be edited.
The binary distribution contains a separate file describing the
contents. In particular, it may include more than one version of the
-`gawk' executable. OS/2 binary distributions may have a different
-arrangement, but installation is similar.
+`gawk' executable.
+
+ OS/2 (32 bit, EMX) binary distributions are prepared for the `/usr'
+directory of your preferred drive. Set `UNIXROOT' to your installation
+drive (e.g., `e:') if you want to install `gawk' onto another drive
+than the hardcoded default `c:'. Executables appear in `/usr/bin',
+libraries under `/usr/share/awk', manual pages under `/usr/man',
+Texinfo documentation under `/usr/info' and NLS files under
+`/usr/share/locale'. If you already have a file `/usr/info/dir' from
+another package _do not overwrite it!_ Instead enter the following
+commands at your prompt (replace `x:' by your installation drive):
+
+ install-info --info-dir=x:/usr/info x:/usr/info/gawk.info
+ install-info --info-dir=x:/usr/info x:/usr/info/gawkinet.info
+
+ However, the files can be installed anywhere provided `AWKPATH' is
+set properly.
+
+ The binary distribution may contain a separate file containing
+additional or more detailed installation instructions.

File: gawk.info, Node: PC Compiling, Next: PC Using, Prev: PC Binary Installation, Up: PC Installation
@@ -17189,8 +17251,9 @@ used to build a Win32 version, and Microsoft C/C++ can be used to build
the `gawk' distribution contains additional notes, and `pc/Makefile'
contains important information on compilation options.
- To build `gawk', copy the files in the `pc' directory (_except_ for
-`ChangeLog') to the directory with the rest of the `gawk' sources. The
+ To build `gawk' for MS-DOS, Win32, and OS/2 (16 bit; for 32 bit (EMX)
+see below), copy the files in the `pc' directory (_except_ for
+`ChangeLog') to the directory with the rest of the `gawk' sources. The
`Makefile' contains a configuration section with comments and may need
to be edited in order to work with your `make' utility.
@@ -17210,17 +17273,93 @@ the file `pc/Makefile.tst' over the file `test/Makefile' as a
replacement. Details can be found in `README_d/README.pc' and in the
file `pc/Makefile.tst'.
-
-File: gawk.info, Node: PC Using, Prev: PC Compiling, Up: PC Installation
+ To build `gawk' for OS/2 (32 bit, EMX), there are three
+possibilities:
+
+ 1. Using the `configure' script included in the official `gawk'
+ distribution. `configure' need not be recreated but a number of
+ restrictions exist when using this choice:
+
+ * An external `gettext' library cannot be used. I.e. the
+ `configure' option `--without-included-gettext' does not
+ work. Unfortunately, the internal `gettext' library is
+ seriuosly broken for OS/2. Therefore you have to use
+ `--disable-nls'.
+
+ * Executables must be linked statically (`a.out' format only).
+ `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 `gawk'
+ moves on to Autoconf 2.5x. Now enter the following commands
+ at your `sh' prompt:
+
+ $ 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
+
+ 2. Using a special version of Autoconf 2.13 for OS/2 to recreate
+ `configure'. Not tested. In principle this should work but the
+ same restrictions apply as in 1, but the environment variables
+ `CC', `AWK', `LDFLAGS' and `RANLIB' are not necessary.
+
+ 3. Using Autoconf 2.5x to recreate `configure' (2.52f or higher
+ recommended). Some patches must be applied to `Makefile.am' and
+ `test/Makefile.am' and `po/Makefile.in.in'. Currently not
+ supported.
+
+ *Note:* Even if the compiled `gawk.exe' executable contains a DOS
+header (`a.out' format), it does _not_ work under DOS. To compile an
+executable that runs under DOS, `CPPFLAGS' must be set to
+`"-DPIPES_SIMULATED"'. But then some nonstandard extensions of `gawk'
+(e.g., `|&') do not work!
+
+ After compilation the internal tests can be performed. Enter `make
+check CMP="diff -a"' at your command prompt. All tests but the `pid'
+test are expected to work properly. The `pid' test might or might not
+work, no idea why.
+
+ *Note:* Most OS/2 ports of GNU `make' are not able to handle the
+Makefiles of this package. If you encounter any problems with `make'
+try GNU `make' 3.79.1. You should find the latest version on
+`ftp://ftp.unixos2.org'.
+
+
+File: gawk.info, Node: PC Using, Next: Cygwin, Prev: PC Compiling, Up: PC Installation
Using `gawk' on PC Operating Systems
....................................
+ With the exception of the Cygwin environment, the `|&' operator and
+TCP/IP networking (*note Using `gawk' for Network Programming: TCP/IP
+Networking.) are not supported for MS-DOS or MS-Windows. EMX (OS/2
+only) does support at least the `|&' operator.
+
The OS/2 and MS-DOS versions of `gawk' search for program files as
described in *Note The `AWKPATH' Environment Variable: AWKPATH Variable.
However, semicolons (rather than colons) separate elements in the
`AWKPATH' variable. If `AWKPATH' is not set or is empty, then the
-default search path is `".;c:/lib/awk;c:/gnu/lib/awk"'.
+default search path for OS/2 (16 bit) and MS-DOS versions is
+`".;c:/lib/awk;c:/gnu/lib/awk"'.
+
+ The search path for OS/2 (32 bit, EMX) is determined by the prefix
+directory (most likely `/usr' or `c:/usr') that has been specified as
+an option of the `configure' script like it is the case for the Unix
+versions. If `c:/usr' is the prefix directory then the default search
+path contains `.' and `c:/usr/share/awk'. Additionally, to support
+binary distributions of `gawk' for OS/2 systems whose drive `c:' might
+not support long file names or might not exist at all, there is a
+special environment variable. If `UNIXROOT' specifies a drive then this
+specific drive is also searched for program files. E.g., if `UNIXROOT'
+is set to `e:' the complete default search path is
+`".;c:/usr/share/awk;e:/usr/share/awk"'.
An `sh'-like shell (as opposed to `command.com' under MS-DOS or
`cmd.exe' under OS/2) may be useful for `awk' programming. Ian
@@ -17236,7 +17375,7 @@ for `gawk' in the shell configuration may need to be changed and the
Under OS/2 and DOS, `gawk' (and many other text programs) silently
translate end-of-line `"\r\n"' to `"\n"' on input and `"\n"' to
`"\r\n"' on output. A special `BINMODE' variable allows control over
-these translations and is interpreted as follows.
+these translations and is interpreted as follows:
* If `BINMODE' is `"r"', or `(BINMODE & 1)' is nonzero, then binary
mode is set on read (i.e., no translations on reads).
@@ -17269,7 +17408,7 @@ particular, the setting of `RS' giving the fewest "surprises" is open
to debate. `mawk' uses `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
+ To illustrate, the following examples set binary mode on writes for
standard output and other files, and set `ORS' as the "usual" DOS-style
end-of-line:
@@ -17293,6 +17432,36 @@ With proper quoting, in the first example the setting of `RS' can be
moved into the `BEGIN' rule.

+File: gawk.info, Node: Cygwin, Prev: PC Using, Up: PC Installation
+
+Using `gawk' In The Cygwin Environment
+......................................
+
+ `gawk' can be used "out of the box" under Windows if you are using
+the Cygwin environment.(1) This environment provides an excellent
+simulation of Unix, using the GNU tools, such as `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:
+
+ tar -xvpzf gawk-3.1.1.tar.gz
+ cd gawk-3.1.1
+ ./configure
+ make
+
+ When compared to GNU/Linux on the same system, the `configure' step
+on Cygwin takes considerably longer. However, it does finish, and then
+the `make' proceeds as usual.
+
+ *Note:* The `|&' operator and TCP/IP networking (*note Using `gawk'
+for Network Programming: TCP/IP Networking.) are fully supported in
+the Cygwin environment. This is not true for any other environment for
+MS-DOS or MS-Windows.
+
+ ---------- Footnotes ----------
+
+ (1) `http://www.cygwin.com'
+
+
File: gawk.info, Node: VMS Installation, Prev: PC Installation, Up: Non-Unix Installation
How to Compile and Install `gawk' on VMS
@@ -17692,7 +17861,8 @@ BeOS Martin Brown, <mc@whoever.com>.
MS-DOS Scott Deifik, <scottd@amgen.com> and Darrel
Hankerson, <hankedr@mail.auburn.edu>.
MS-Windows Juan Grigera, <juan@biophnet.unlp.edu.ar>.
-OS/2 Kai Uwe Rommel, <rommel@ars.de>.
+OS/2 The Unix for OS/2 team,
+ <gawk-maintainer@unixos2.org>.
Tandem Stephen Davies, <scldad@sdc.com.au>.
VMS Pat Rankin, <rankin@eql.caltech.edu>.
@@ -17830,7 +18000,7 @@ one more option available on the command line:
`-W parsedebug'
`--parsedebug'
- Print out the parse stack information as the program is being
+ Prints out the parse stack information as the program is being
parsed.
This option is intended only for serious `gawk' developers and not
@@ -17886,8 +18056,8 @@ make it possible for me to include your changes:
haven't read it, please do so, preferably _before_ starting to
modify `gawk'. (The `GNU Coding Standards' are available from the
GNU Project's `ftp' site, at
- `ftp://gnudist.gnu.org/gnu/GNUInfo/standards.text'. Texinfo,
- Info, and DVI versions are also available.)
+ `ftp://ftp.gnu.org/gnu/GNUInfo/standards.text'. Texinfo, Info,
+ and DVI versions are also available.)
4. Use the `gawk' coding style. The C code for `gawk' follows the
instructions in the `GNU Coding Standards', with minor exceptions.
@@ -17996,12 +18166,12 @@ Porting `gawk' to a New Operating System
----------------------------------------
If you want to port `gawk' to a new operating system, there are
-several steps to follow:
+several steps:
1. Follow the guidelines in *Note Adding New Features: Adding Code,
concerning coding style, submission of diffs, and so on.
- 2. When doing a port, bear in mind that your code must co-exist
+ 2. When doing a port, bear in mind that your code must coexist
peacefully with the rest of `gawk' and the other ports. Avoid
gratuitous changes to the system-independent parts of the code. If
at all possible, avoid sprinkling `#ifdef's just for your port
@@ -18065,8 +18235,8 @@ several steps to follow:
you have questions, please contact me, or <gnu@gnu.org>.
Following these steps makes it much easier to integrate your changes
-into `gawk' and have them co-exist happily with other operating
-systems' code that is already there.
+into `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 coding
style and brace layout that suits your taste.
@@ -18211,7 +18381,7 @@ when writing extensions. The next minor node shows how they are used:
`NODE *get_argument(NODE *tree, int i)'
This function is called from within a C extension function to get
- the `i''th argument from the function call. The first argument is
+ the `i'-th argument from the function call. The first argument is
argument zero.
`void set_value(NODE *tree)'
@@ -18227,7 +18397,7 @@ when writing extensions. The next minor node shows how they are used:
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
+function parameter. The following boilerplate code shows how to do
this:
NODE *the_arg;
@@ -18650,14 +18820,14 @@ well.
Following is a list of probable future changes visible at the `awk'
language level:
-Loadable Module Interface
+Loadable module interface
It is not clear that the `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.
-`RECLEN' variable for fixed length records
+`RECLEN' variable for fixed-length records
Along with `FIELDWIDTHS', this would speed up the processing of
fixed-length records. `PROCINFO["RS"]' would be `"RS"' or
`"RECLEN"', depending upon which kind of record processing is in
@@ -18672,7 +18842,7 @@ Databases
It may be possible to map a GDBM/NDBM/SDBM file into an `awk'
array.
-Large Character Sets
+Large character sets
It would be nice if `gawk' could handle UTF-8 and other character
sets that are larger than eight bits.
@@ -18682,7 +18852,7 @@ More `lint' warnings
Following is a list of probable improvements that will make `gawk''s
source code easier to work with:
-Loadable Module Mechanics
+Loadable module mechanics
The current extension mechanism works (*note Adding New Built-in
Functions to `gawk': Dynamic Extensions.), but is rather
primitive. It requires a fair amount of manual work to create and
@@ -18691,24 +18861,24 @@ Loadable Module Mechanics
a number of features that would make using loadable modules much
easier. `gawk' should be changed to use `libtool'.
-Loadable Module Internals
+Loadable module internals
The API to its internals that `gawk' "exports" should be revised.
Too many things are needlessly exposed. A new API should be
designed and implemented to make module writing easier.
-Better Array Subscript Management
+Better array subscript management
`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.
-Integrating the DBUG Library
+Integrating the DBUG library
Integrating Fred Fish's DBUG library would be helpful during
development, but it's a lot of work to do.
Following is a list of probable improvements that will make `gawk'
perform better:
-An Improved Version of `dfa'
+An improved version of `dfa'
The `dfa' pattern matcher from GNU `grep' has some problems.
Either a new version or a fixed one will deal with some important
regexp matching issues.
@@ -18823,7 +18993,7 @@ Clean Up
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.
+ mixing bowls and utensils.
An "algorithm" is a detailed set of instructions necessary to
accomplish a task, or process data. It is much the same as a recipe
@@ -18839,7 +19009,7 @@ record.
The act of reading data is termed "input", and that of generating
results, not too surprisingly, is termed "output". They are often
-referred to together as "Input/Output," and even more often, as "I/O"
+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.)
`awk' manages the reading of data for you, as well as the breaking
@@ -18864,7 +19034,7 @@ Data Values in a Computer
In a program, you keep track of information and values in things
called "variables". A variable is just a name for a given value, such
as `first_name', `last_name', `address', and so on. `awk' has several
-pre-defined variables, and it has special names to refer to the current
+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
associated values under one name, as an array.
@@ -18876,7 +19046,7 @@ characters that comprise them. Individual variables, as well as
numeric and string variables, are referred to as "scalar" values.
Groups of values, such as arrays, are not scalars.
- Within computers, there are two kinds of numeric values: "integers",
+ Within computers, there are two kinds of numeric values: "integers"
and "floating-point". In school, integer values were referred to as
"whole" numbers--that is, numbers without any fractional part, such as
1, 42, or -17. The advantage to integer numbers is that they represent
@@ -18920,7 +19090,7 @@ binary, each column represents two times the value in the column to its
right. Each column may contain either a 0 or a 1. 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 *Note Octal
-and Hexadecimal Numbers: Non-decimal-numbers.
+and Hexadecimal Numbers: Nondecimal-numbers.
Programs are written in programming languages. Hundreds, if not
thousands, of programming languages exist. One of the most popular is
@@ -18932,7 +19102,7 @@ to as "K&R" C, after the initials of Brian Kernighan and Dennis Ritchie,
the authors of the first book on C. (Dennis Ritchie created the
language, and Brian Kernighan was one of the creators of `awk'.)
- In the mid-1980's, an effort began to produce an international
+ 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 `awk' is compatible with 1990 ISO C.
@@ -18947,16 +19117,16 @@ Floating-Point Number Caveats
=============================
As mentioned earlier, floating-point numbers represent what are
-called "real" numbers; i.e., those that have a fractional part. `awk'
+called "real" numbers, i.e., those that have a fractional part. `awk'
uses double-precision floating-point numbers to represent all numeric
values. This minor node 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', `ACM Computing Surveys' *23*, 1 (1991-03),
+Goldberg, "What Every Computer Scientist Should Know About
+Floating-point Arithmetic," `ACM Computing Surveys' *23*, 1 (1991-03),
5-48.(1) This is worth reading if you are interested in the details,
-but it does require a background in Computer Science.
+but it does require a background in computer science.
Internally, `awk' keeps both the numeric value (double-precision
floating-point) and the string value for a variable. Separately, `awk'
@@ -19043,7 +19213,7 @@ noted and can affect comparisons.
---------- Footnotes ----------
- (1) `http://www.validgh.com/goldberg/paper.ps'
+ (1) `http://www.validgh.com/goldberg/paper.ps'.
(2) Pathological cases can require up to 752 digits (!), but we
doubt that you need to worry about this.
@@ -19292,7 +19462,7 @@ Epoch
See also "GMT" and "UTC."
Escape Sequences
- A special sequence of characters used for describing non-printing
+ A special sequence of characters used for describing nonprinting
characters, such as `\n' for newline or `\033' for the ASCII ESC
(Escape) character. (*Note Escape Sequences::.)
@@ -19310,7 +19480,7 @@ Field
Flag
A variable whose truth value indicates the existence or
- non-existence of some condition.
+ nonexistence of some condition.
Floating-Point Number
Often referred to in mathematical terms as a "rational" or real
@@ -19339,7 +19509,7 @@ FSF
See "Free Software Foundation."
Free Software Foundation
- A non-profit organization dedicated to the production and
+ 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.
@@ -19652,7 +19822,7 @@ UTC
and "GMT."
Whitespace
- A sequence of space, tab, or newline characters occurring inside
+ A sequence of space, TAB, or newline characters occurring inside
an input record or a string.

@@ -19662,7 +19832,6 @@ GNU General Public License
**************************
Version 2, June 1991
-
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111, USA
@@ -19721,7 +19890,6 @@ patent must be licensed for everyone's free use or not licensed at all.
modification follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
0. This License applies to any program or other work which contains a
notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program",
@@ -20034,7 +20202,6 @@ GNU Free Documentation License
of this license document, but changing it is not allowed.
-
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
@@ -20121,7 +20288,6 @@ GNU Free Documentation License
Page" means the text near the most prominent appearance of the
work's title, preceding the beginning of the body of the text.
-
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
@@ -20138,7 +20304,6 @@ GNU Free Documentation License
You may also lend copies, under the same conditions stated above,
and you may publicly display copies.
-
3. COPYING IN QUANTITY
If you publish printed copies of the Document numbering more than
@@ -20179,7 +20344,6 @@ GNU Free Documentation License
copies, to give them a chance to provide you with an updated
version of the Document.
-
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document
@@ -20285,7 +20449,6 @@ GNU Free Documentation License
License give permission to use their names for publicity for or to
assert or imply endorsement of any Modified Version.
-
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under
@@ -20311,7 +20474,6 @@ GNU Free Documentation License
"Acknowledgements", and any sections entitled "Dedications". You
must delete all sections entitled "Endorsements."
-
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other
@@ -20327,7 +20489,6 @@ GNU Free Documentation License
this License in all other respects regarding verbatim copying of
that document.
-
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other
@@ -20347,7 +20508,6 @@ GNU Free Documentation License
aggregate. Otherwise they must appear on covers around the whole
aggregate.
-
8. TRANSLATION
Translation is considered a kind of modification, so you may
@@ -20361,7 +20521,6 @@ GNU Free Documentation License
disagreement between the translation and the original English
version of this License, the original English version will prevail.
-
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document
@@ -20372,7 +20531,6 @@ GNU Free Documentation License
from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
-
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions of
@@ -20426,46 +20584,76 @@ Index
* Menu:
+* ! (exclamation point), ! operator: Boolean Ops.
+* ! (exclamation point), ! operator <1>: Egrep Program.
+* ! (exclamation point), ! operator: Precedence.
+* ! (exclamation point), != operator <1>: Precedence.
+* ! (exclamation point), != operator: Typing and Comparison.
+* ! (exclamation point), !~ operator <1>: Expression Patterns.
+* ! (exclamation point), !~ operator <2>: Precedence.
+* ! (exclamation point), !~ operator <3>: Typing and Comparison.
+* ! (exclamation point), !~ operator <4>: Regexp Constants.
+* ! (exclamation point), !~ operator <5>: Computed Regexps.
+* ! (exclamation point), !~ operator <6>: Case-sensitivity.
+* ! (exclamation point), !~ operator: Regexp Usage.
* ! operator <1>: Egrep Program.
-* ! operator <2>: Ranges.
-* ! operator <3>: Precedence.
-* ! operator: Boolean Ops.
-* != operator <1>: Precedence.
-* != operator: Typing and Comparison.
-* !~ operator <1>: Precedence.
-* !~ operator <2>: Typing and Comparison.
-* !~ operator <3>: Regexp Constants.
-* !~ operator <4>: Computed Regexps.
-* !~ operator <5>: Case-sensitivity.
-* !~ operator: Regexp Usage.
-* # (comment): Comments.
-* #! (executable scripts): Executable Scripts.
-* $ field operator <1>: Precedence.
+* ! operator: Ranges.
+* " (double quote) <1>: Quoting.
+* " (double quote): Read Terminal.
+* " (double quote), regexp constants: Computed Regexps.
+* # (number sign), #! (executable scripts): Executable Scripts.
+* # (number sign), #! (executable scripts), portability issues with: Executable Scripts.
+* # (number sign), commenting: Comments.
+* $ (dollar sign): Regexp Operators.
+* $ (dollar sign), $ field operator <1>: Precedence.
+* $ (dollar sign), $ field operator: Fields.
+* $ (dollar sign), incrementing fields and arrays: Increment Ops.
* $ field operator: Fields.
-* % operator: Precedence.
-* %= operator <1>: Precedence.
-* %= operator: Assignment Ops.
-* && operator <1>: Precedence.
-* && operator: Boolean Ops.
-* * operator: Precedence.
-* ** operator: Precedence.
-* **= operator <1>: Precedence.
-* **= operator: Assignment Ops.
-* *= operator <1>: Precedence.
-* *= operator: Assignment Ops.
-* + operator: Precedence.
-* ++ operator <1>: Precedence.
-* ++ operator: Increment Ops.
-* += operator <1>: Precedence.
-* += operator: Assignment Ops.
-* - operator: Precedence.
-* -- operator <1>: Precedence.
-* -- operator: Increment Ops.
+* % (percent sign), % operator: Precedence.
+* % (percent sign), %= operator <1>: Precedence.
+* % (percent sign), %= operator: Assignment Ops.
+* & (ampersand), && operator <1>: Precedence.
+* & (ampersand), && operator: Boolean Ops.
+* & (ampersand), gsub/gensub/sub functions and: Gory Details.
+* ' (single quote) <1>: Quoting.
+* ' (single quote) <2>: Long.
+* ' (single quote): One-shot.
+* ' (single quote), vs. apostrophe: Comments.
+* ' (single quote), with double quotes: Quoting.
+* () (parentheses): Regexp Operators.
+* () (parentheses), pgawk program: Profiling.
+* * (asterisk), * operator, as multiplication operator: Precedence.
+* * (asterisk), * operator, as regexp operator: Regexp Operators.
+* * (asterisk), * operator, null strings, matching: Gory Details.
+* * (asterisk), ** operator <1>: Options.
+* * (asterisk), ** operator <2>: Precedence.
+* * (asterisk), ** operator: Arithmetic Ops.
+* * (asterisk), **= operator <1>: Options.
+* * (asterisk), **= operator <2>: Precedence.
+* * (asterisk), **= operator: Assignment Ops.
+* * (asterisk), *= operator <1>: Precedence.
+* * (asterisk), *= operator: Assignment Ops.
+* + (plus sign): Regexp Operators.
+* + (plus sign), + operator: Precedence.
+* + (plus sign), ++ operator <1>: Precedence.
+* + (plus sign), ++ operator: Increment Ops.
+* + (plus sign), += operator <1>: Precedence.
+* + (plus sign), += operator: Assignment Ops.
+* + (plus sign), decrement/increment operators: Increment Ops.
+* , (comma), in range patterns: Ranges.
+* - (hyphen), - operator: Precedence.
+* - (hyphen), -- (decrement/increment) operator: Precedence.
+* - (hyphen), -- operator: Increment Ops.
+* - (hyphen), -= operator <1>: Precedence.
+* - (hyphen), -= operator: Assignment Ops.
+* - (hyphen), filenames beginning with: Options.
+* - (hyphen), in character lists: Character Lists.
* --assign option: Options.
* --compat option: Options.
* --copyleft option: Options.
* --copyright option: Options.
* --disable-nls configuration option: Additional Configuration Options.
+* --dump-variables option <1>: Library Names.
* --dump-variables option: Options.
* --enable-portals configuration option <1>: Additional Configuration Options.
* --enable-portals configuration option: Portal Files.
@@ -20474,234 +20662,369 @@ Index
* --gen-po option <1>: Options.
* --gen-po option: String Extraction.
* --help option: Options.
-* --lint option: Options.
+* --lint option <1>: Options.
+* --lint option: Command Line.
* --lint-old option: Options.
* --non-decimal-data option <1>: Options.
-* --non-decimal-data option: Non-decimal Data.
+* --non-decimal-data option: Nondecimal Data.
+* --non-decimal-data option, strtonum function and: Nondecimal Data.
* --posix option: Options.
-* --profile option: Options.
+* --posix option, --traditional option and: Options.
+* --profile option <1>: Options.
+* --profile option: Profiling.
* --re-interval option: Options.
* --source option: Options.
* --traditional option: Options.
+* --traditional option, --posix option and: Options.
* --usage option: Options.
* --version option: Options.
* --with-included-gettext configuration option <1>: Additional Configuration Options.
* --with-included-gettext configuration option: Gawk I18N.
-* -= operator <1>: Precedence.
-* -= operator: Assignment Ops.
+* --with-included-gettext configuration option, configuring gawk with: Additional Configuration Options.
* -f option: Options.
* -F option <1>: Options.
* -F option: Command Line Field Separator.
* -f option: Long.
-* -mf option: Options.
-* -mr option: Options.
+* -F option, -Ft sets FS to TAB: Options.
+* -f option, on command line: Options.
+* -F option, troubleshooting: Known Bugs.
+* -mf/-mr options: Options.
* -v option: Options.
+* -v option, variables, assigning: Assignment Options.
* -W option: Options.
-* / operator: Precedence.
-* /= operator <1>: Precedence.
-* /= operator: Assignment Ops.
+* . (period): Regexp Operators.
+* .mo files: Explaining gettext.
+* .mo files, converting from .po: I18N Example.
+* .mo files, specifying directory of <1>: Programmer i18n.
+* .mo files, specifying directory of: Explaining gettext.
+* .po files <1>: Translator i18n.
+* .po files: Explaining gettext.
+* .po files, converting to .mo: I18N Example.
+* / (forward slash): Regexp.
+* / (forward slash), / operator: Precedence.
+* / (forward slash), /= operator <1>: Precedence.
+* / (forward slash), /= operator: Assignment Ops.
+* / (forward slash), /= operator, vs. /=.../ regexp constant: Assignment Ops.
+* / (forward slash), patterns and: Expression Patterns.
* /= operator vs. /=.../ regexp constant: Assignment Ops.
-* /dev/fd special files: Special FD.
-* /dev/pgrpid special file: Special Process.
-* /dev/pid special file: Special Process.
-* /dev/ppid special file: Special Process.
-* /dev/stderr special file: Special FD.
-* /dev/stdin special file: Special FD.
-* /dev/stdout special file: Special FD.
-* /dev/user special file: Special Process.
-* /inet special files: TCP/IP Networking.
-* /p special files: Portal Files.
-* < I/O operator: Getline/File.
-* < operator <1>: Precedence.
-* < operator: Typing and Comparison.
-* <= operator <1>: Precedence.
-* <= operator: Typing and Comparison.
-* = operator: Assignment Ops.
-* == operator <1>: Precedence.
-* == operator: Typing and Comparison.
-* > I/O operator: Redirection.
-* > operator <1>: Precedence.
-* > operator: Typing and Comparison.
-* >= operator <1>: Precedence.
-* >= operator: Typing and Comparison.
-* >> I/O operator <1>: Precedence.
-* >> I/O operator: Redirection.
-* ?: operator: Precedence.
-* \" escape sequence: Escape Sequences.
-* \' regexp operator: GNU Regexp Operators.
-* \/ escape sequence: Escape Sequences.
-* \< regexp operator: GNU Regexp Operators.
-* \> regexp operator: GNU Regexp Operators.
-* \` regexp operator: GNU Regexp Operators.
-* \a escape sequence: Escape Sequences.
-* \b escape sequence: Escape Sequences.
-* \B regexp operator: GNU Regexp Operators.
-* \f escape sequence: Escape Sequences.
-* \n escape sequence: Escape Sequences.
-* \NNN escape sequence (octal): Escape Sequences.
-* \r escape sequence: Escape Sequences.
-* \t escape sequence: Escape Sequences.
-* \v escape sequence: Escape Sequences.
-* \W regexp operator: GNU Regexp Operators.
-* \w regexp operator: GNU Regexp Operators.
-* \x escape sequence: Escape Sequences.
-* \y regexp operator: GNU Regexp Operators.
-* ^ operator: Precedence.
-* ^= operator <1>: Precedence.
-* ^= operator: Assignment Ops.
-* _ C macro (gettext): Explaining gettext.
+* /dev/... special files (gawk): Special FD.
+* /inet/ files (gawk): TCP/IP Networking.
+* /p files (gawk): Portal Files.
+* ; (semicolon): Statements/Lines.
+* ; (semicolon), AWKPATH variable and: PC Using.
+* ; (semicolon), separating statements in actions <1>: Statements.
+* ; (semicolon), separating statements in actions: Action Overview.
+* < (left angle bracket), < operator <1>: Precedence.
+* < (left angle bracket), < operator: Typing and Comparison.
+* < (left angle bracket), < operator (I/O): Getline/File.
+* < (left angle bracket), <= operator <1>: Precedence.
+* < (left angle bracket), <= operator: Typing and Comparison.
+* = (equals sign), = operator: Assignment Ops.
+* = (equals sign), == operator <1>: Precedence.
+* = (equals sign), == operator: Typing and Comparison.
+* > (right angle bracket), > operator <1>: Precedence.
+* > (right angle bracket), > operator: Typing and Comparison.
+* > (right angle bracket), > operator (I/O): Redirection.
+* > (right angle bracket), >= operator <1>: Precedence.
+* > (right angle bracket), >= operator: Typing and Comparison.
+* > (right angle bracket), >> operator (I/O) <1>: Precedence.
+* > (right angle bracket), >> operator (I/O): Redirection.
+* ? (question mark) <1>: GNU Regexp Operators.
+* ? (question mark): Regexp Operators.
+* ? (question mark), ?: operator: Precedence.
+* [] (square brackets): Regexp Operators.
+* \ (backslash) <1>: Regexp Operators.
+* \ (backslash) <2>: Quoting.
+* \ (backslash) <3>: Comments.
+* \ (backslash): Read Terminal.
+* \ (backslash), \" escape sequence: Escape Sequences.
+* \ (backslash), \' operator (gawk): GNU Regexp Operators.
+* \ (backslash), \/ escape sequence: Escape Sequences.
+* \ (backslash), \< operator (gawk): GNU Regexp Operators.
+* \ (backslash), \> operator (gawk): GNU Regexp Operators.
+* \ (backslash), \` operator (gawk): GNU Regexp Operators.
+* \ (backslash), \a escape sequence: Escape Sequences.
+* \ (backslash), \b escape sequence: Escape Sequences.
+* \ (backslash), \B operator (gawk): GNU Regexp Operators.
+* \ (backslash), \f escape sequence: Escape Sequences.
+* \ (backslash), \n escape sequence: Escape Sequences.
+* \ (backslash), \NNN escape sequence: Escape Sequences.
+* \ (backslash), \r escape sequence: Escape Sequences.
+* \ (backslash), \t escape sequence: Escape Sequences.
+* \ (backslash), \v escape sequence: Escape Sequences.
+* \ (backslash), \W operator (gawk): GNU Regexp Operators.
+* \ (backslash), \w operator (gawk): GNU Regexp Operators.
+* \ (backslash), \x escape sequence: Escape Sequences.
+* \ (backslash), \y operator (gawk): GNU Regexp Operators.
+* \ (backslash), as field separators: Command Line Field Separator.
+* \ (backslash), continuing lines and <1>: Egrep Program.
+* \ (backslash), continuing lines and: Statements/Lines.
+* \ (backslash), continuing lines and, comments and: Statements/Lines.
+* \ (backslash), continuing lines and, in csh <1>: Statements/Lines.
+* \ (backslash), continuing lines and, in csh: More Complex.
+* \ (backslash), gsub/gensub/sub functions and: Gory Details.
+* \ (backslash), in character lists: Character Lists.
+* \ (backslash), in escape sequences: Escape Sequences.
+* \ (backslash), in escape sequences, POSIX and: Escape Sequences.
+* \ (backslash), regexp constants: Computed Regexps.
+* ^ (caret) <1>: GNU Regexp Operators.
+* ^ (caret): Regexp Operators.
+* ^ (caret), ^ operator <1>: Options.
+* ^ (caret), ^ operator: Precedence.
+* ^ (caret), ^= operator <1>: Options.
+* ^ (caret), ^= operator <2>: Precedence.
+* ^ (caret), ^= operator: Assignment Ops.
+* ^ (caret), in character lists: Character Lists.
+* _ (underscore), _ C macro: Explaining gettext.
+* _ (underscore), in names of private variables: Library Names.
+* _ (underscore), translatable string: Programmer i18n.
* _gr_init user-defined function: Group Functions.
* _pw_init user-defined function: Passwd Functions.
* accessing fields: Fields.
* account information <1>: Group Functions.
* account information: Passwd Functions.
-* acronym: History.
-* action, curly braces: Action Overview.
-* action, default: Very Simple.
-* action, definition of: Action Overview.
-* action, empty: Very Simple.
-* action, separating statements: Action Overview.
-* adding new features: Adding Code.
-* addition: Arithmetic Ops.
-* advanced features: Advanced Features.
-* advanced notes <1>: I/O Functions.
-* advanced notes <2>: Gory Details.
-* advanced notes <3>: Auto-set.
-* advanced notes <4>: Increment Ops.
-* advanced notes <5>: Assignment Ops.
-* advanced notes <6>: Non-decimal-numbers.
-* advanced notes <7>: Close Files And Pipes.
-* advanced notes <8>: Redirection.
-* advanced notes <9>: Records.
-* advanced notes <10>: Computed Regexps.
-* advanced notes <11>: Escape Sequences.
-* advanced notes: Executable Scripts.
+* actions: Action Overview.
+* actions, control statements in: Statements.
+* actions, default: Very Simple.
+* actions, empty: Very Simple.
+* adding, features to gawk: Adding Code.
+* adding, fields: Changing Fields.
+* adding, functions to gawk: Dynamic Extensions.
+* advanced features, buffering: I/O Functions.
+* advanced features, close function: Close Files And Pipes.
+* advanced features, constants, values of: Nondecimal-numbers.
+* advanced features, data files as single record: Records.
+* advanced features, fixed-width data: Constant Size.
+* advanced features, FNR/NR variables: Auto-set.
+* advanced features, gawk: Advanced Features.
+* advanced features, gawk, BSD portals: Portal Files.
+* advanced features, gawk, network programming: TCP/IP Networking.
+* advanced features, gawk, nondecimal input data: Nondecimal Data.
+* advanced features, gawk, processes, communicating with: Two-way I/O.
+* advanced features, network connections, See Also networks, connections: Advanced Features.
+* advanced features, null strings, matching: Gory Details.
+* advanced features, operators, precedence: Increment Ops.
+* advanced features, piping into sh: Redirection.
+* advanced features, regexp constants: Assignment Ops.
* Aho, Alfred <1>: Contributors.
* Aho, Alfred: History.
-* AI programming, using gawk: Distribution contents.
+* alarm clock example program: Alarm Program.
* alarm.awk program: Alarm Program.
-* algorithm, definition of: Basic High Level.
+* algorithms: Basic High Level.
+* Alpha (DEC): Manual History.
* amazing awk assembler (aaa): Glossary.
* amazingly workable formatter (awf): Glossary.
* ambiguity, syntactic: /= operator vs. /=.../ regexp constant: Assignment Ops.
* amiga: Amiga Installation.
-* anchors in regexps: Regexp Operators.
+* ampersand (&), && operator: Boolean Ops.
+* ampersand (&), &&operator: Precedence.
+* ampersand (&), gsub/gensub/sub functions and: Gory Details.
* AND bitwise operation: Bitwise Functions.
-* and built-in function: Bitwise Functions.
-* AND logical operator: Boolean Ops.
-* anonymous ftp: Getting.
+* and Boolean-logic operator: Boolean Ops.
+* and function (gawk): Bitwise Functions.
* ANSI: Glossary.
-* applications of awk <1>: When.
-* applications of awk: Preface.
* archeologists: Bugs.
-* ARGC variable: Auto-set.
-* ARGIND variable <1>: Other Arguments.
+* ARGC/ARGV variables <1>: ARGC and ARGV.
+* ARGC/ARGV variables: Auto-set.
+* ARGC/ARGV variables, command-line arguments: Other Arguments.
+* ARGC/ARGV variables, portability and: Executable Scripts.
* ARGIND variable: Auto-set.
-* argument processing: Getopt Function.
-* arguments in function call: Function Calls.
-* arguments, command-line: Command Line.
-* ARGV variable <1>: Other Arguments.
-* ARGV variable: Auto-set.
+* ARGIND variable, command-line arguments: Other Arguments.
+* arguments, command-line <1>: Other Arguments.
+* arguments, command-line <2>: ARGC and ARGV.
+* arguments, command-line: Auto-set.
+* arguments, command-line, invoking awk: Command Line.
+* arguments, in function calls: Function Calls.
+* arguments, processing: Getopt Function.
+* arguments, retrieving: Internals.
* arithmetic operators: Arithmetic Ops.
-* array assignment: Assigning Elements.
-* array reference: Reference to Elements.
-* arrays: Array Intro.
+* arrays: Arrays.
+* arrays, as parameters to functions: Function Caveats.
* arrays, associative: Array Intro.
-* arrays, definition of: Array Intro.
-* arrays, deleting an element: Delete.
+* arrays, associative, clearing: Internals.
+* arrays, associative, library functions and: Library Names.
* arrays, deleting entire contents: Delete.
-* arrays, multidimensional subscripts: Multi-dimensional.
-* arrays, presence of elements: Reference to Elements.
+* arrays, elements, assigning: Assigning Elements.
+* arrays, elements, deleting: Delete.
+* arrays, elements, installing: Internals.
+* arrays, elements, order of: Scanning an Array.
+* arrays, elements, referencing: Reference to Elements.
+* arrays, elements, retrieving number of: String Functions.
+* arrays, for statement and: Scanning an Array.
+* arrays, IGNORECASE variable and: Array Intro.
+* arrays, indexing: Array Intro.
+* arrays, merging into strings: Join Function.
+* arrays, multidimensional: Multi-dimensional.
+* arrays, multidimensional, scanning: Multi-scanning.
+* arrays, names of: Arrays.
+* arrays, scanning: Scanning an Array.
* arrays, sorting: Array Sorting.
-* arrays, sorting and IGNORECASE: Array Sorting.
+* arrays, sorting, IGNORECASE variable and: Array Sorting.
* arrays, sparse: Array Intro.
-* arrays, special for statement: Scanning an Array.
-* arrays, subscripts, and IGNORECASE: Array Intro.
-* arrays, subscripts, uninitialized variables: Uninitialized Subscripts.
-* arrays, the in operator: Reference to Elements.
-* artificial intelligence, using gawk: Distribution contents.
+* arrays, subscripts: Numeric Array Subscripts.
+* arrays, subscripts, uninitialized variables as: Uninitialized Subscripts.
+* artificial intelligence, gawk and: Distribution contents.
* ASCII: Ordinal Functions.
-* asort built-in function <1>: String Functions.
-* asort built-in function: Array Sorting.
-* assert C library function: Assert Function.
+* asort function (gawk) <1>: String Functions.
+* asort function (gawk): Array Sorting.
+* asort function (gawk), arrays, sorting: Array Sorting.
+* assert function (C library): Assert Function.
* assert user-defined function: Assert Function.
* assertions: Assert Function.
* assignment operators: Assignment Ops.
-* assignment to fields: Changing Fields.
+* assignment operators, evaluation order: Assignment Ops.
+* assignment operators, lvalues/rvalues: Assignment Ops.
+* assignments as filenames: Ignoring Assigns.
* assoc_clear internal function: Internals.
* assoc_lookup internal function: Internals.
* associative arrays: Array Intro.
-* atan2 built-in function: Numeric Functions.
+* asterisk (*), * operator, as multiplication operator: Precedence.
+* asterisk (*), * operator, as regexp operator: Regexp Operators.
+* asterisk (*), * operator, null strings, matching: Gory Details.
+* asterisk (*), ** operator <1>: Options.
+* asterisk (*), ** operator <2>: Precedence.
+* asterisk (*), ** operator: Arithmetic Ops.
+* asterisk (*), **= operator <1>: Options.
+* asterisk (*), **= operator <2>: Precedence.
+* asterisk (*), **= operator: Assignment Ops.
+* asterisk (*), *= operator <1>: Precedence.
+* asterisk (*), *= operator: Assignment Ops.
+* atan2 function: Numeric Functions.
* atari: Atari Installation.
-* automatic initialization: More Complex.
-* automatic warnings <1>: Options.
-* automatic warnings <2>: I/O Functions.
-* automatic warnings <3>: String Functions.
-* automatic warnings <4>: Using Constant Regexps.
-* automatic warnings <5>: Special Caveats.
-* automatic warnings <6>: Special Process.
-* automatic warnings: Escape Sequences.
* awf (amazingly workable formatter) program: Glossary.
-* awk language, POSIX version <1>: Definition Syntax.
-* awk language, POSIX version <2>: Gory Details.
-* awk language, POSIX version <3>: String Functions.
-* awk language, POSIX version <4>: User-modified.
-* awk language, POSIX version <5>: Next Statement.
-* awk language, POSIX version <6>: Continue Statement.
-* awk language, POSIX version <7>: Break Statement.
-* awk language, POSIX version <8>: Precedence.
-* awk language, POSIX version <9>: Assignment Ops.
-* awk language, POSIX version <10>: Arithmetic Ops.
-* awk language, POSIX version <11>: Conversion.
-* awk language, POSIX version <12>: Format Modifiers.
-* awk language, POSIX version <13>: OFMT.
-* awk language, POSIX version <14>: Field Splitting Summary.
-* awk language, POSIX version <15>: Character Lists.
-* awk language, POSIX version <16>: Regexp Operators.
-* awk language, POSIX version: Escape Sequences.
-* awk language, V.4 version <1>: SVR4.
-* awk language, V.4 version: Escape Sequences.
-* awka compiler for awk programs: Other Versions.
-* awka, source code: Other Versions.
+* awk language, POSIX version: Assignment Ops.
+* awk programs <1>: Two Rules.
+* awk programs <2>: Executable Scripts.
+* awk programs: Getting Started.
+* awk programs, complex: When.
+* awk programs, documenting <1>: Library Names.
+* awk programs, documenting: Comments.
+* awk programs, examples of: Sample Programs.
+* awk programs, execution of: Next Statement.
+* awk programs, internationalizing <1>: Programmer i18n.
+* awk programs, internationalizing: I18N Functions.
+* awk programs, lengthy: Long.
+* awk programs, lengthy, assertions: Assert Function.
+* awk programs, location of: Options.
+* awk programs, one-line examples: Very Simple.
+* awk programs, profiling: Profiling.
+* awk programs, profiling, enabling: Options.
+* awk programs, running <1>: Long.
+* awk programs, running: Running gawk.
+* awk programs, running, from shell scripts: One-shot.
+* awk programs, running, without input files: Read Terminal.
+* awk programs, shell variables in: Using Shell Variables.
+* awk, function of: Getting Started.
+* awk, gawk and <1>: This Manual.
+* awk, gawk and: Preface.
+* awk, history of: History.
+* awk, implementation issues, pipes: Redirection.
+* awk, implementations: Other Versions.
+* awk, implementations, limits: Getline Notes.
+* awk, invoking: Command Line.
+* awk, new vs. old: Names.
+* awk, new vs. old, OFMT variable: Conversion.
+* awk, POSIX and: Preface.
+* awk, POSIX and, See Also POSIX awk: Preface.
+* awk, regexp constants and: Typing and Comparison.
+* awk, See Also gawk: Preface.
+* awk, terms describing: This Manual.
+* awk, uses for <1>: When.
+* awk, uses for <2>: Getting Started.
+* awk, uses for: Preface.
+* awk, versions of <1>: V7/SVR3.1.
+* awk, versions of: Names.
+* awk, versions of, changes between SVR3.1 and SVR4: SVR4.
+* awk, versions of, changes between SVR4 and POSIX awk: POSIX.
+* awk, versions of, changes between V7 and SVR3.1: V7/SVR3.1.
+* awk, versions of, See Also Bell Laboratories awk: BTL.
+* awk.h file (internal): Internals.
+* awka compiler for awk: Other Versions.
* AWKNUM internal type: Internals.
+* AWKPATH environment variable <1>: PC Using.
* AWKPATH environment variable: AWKPATH Variable.
-* awkprof.out profiling output file: Profiling.
+* awkprof.out file: Profiling.
* awksed.awk program: Simple Sed.
-* awkvars.out global variable list output file: Options.
-* backslash continuation <1>: Egrep Program.
-* backslash continuation: Statements/Lines.
-* backslash continuation, and comments: Statements/Lines.
-* backslash continuation, in csh <1>: Statements/Lines.
-* backslash continuation, in csh: More Complex.
-* basic function of awk: Getting Started.
-* basic programming concepts: Basic Concepts.
+* awkvars.out file: Options.
+* backslash (\) <1>: Regexp Operators.
+* backslash (\) <2>: Quoting.
+* backslash (\) <3>: Comments.
+* backslash (\): Read Terminal.
+* backslash (\), \" escape sequence: Escape Sequences.
+* backslash (\), \' operator (gawk): GNU Regexp Operators.
+* backslash (\), \/ escape sequence: Escape Sequences.
+* backslash (\), \< operator (gawk): GNU Regexp Operators.
+* backslash (\), \> operator (gawk): GNU Regexp Operators.
+* backslash (\), \` operator (gawk): GNU Regexp Operators.
+* backslash (\), \a escape sequence: Escape Sequences.
+* backslash (\), \b escape sequence: Escape Sequences.
+* backslash (\), \B operator (gawk): GNU Regexp Operators.
+* backslash (\), \f escape sequence: Escape Sequences.
+* backslash (\), \n escape sequence: Escape Sequences.
+* backslash (\), \NNN escape sequence: Escape Sequences.
+* backslash (\), \r escape sequence: Escape Sequences.
+* backslash (\), \t escape sequence: Escape Sequences.
+* backslash (\), \v escape sequence: Escape Sequences.
+* backslash (\), \W operator (gawk): GNU Regexp Operators.
+* backslash (\), \w operator (gawk): GNU Regexp Operators.
+* backslash (\), \x escape sequence: Escape Sequences.
+* backslash (\), \y operator (gawk): GNU Regexp Operators.
+* backslash (\), as field separators: Command Line Field Separator.
+* backslash (\), continuing lines and <1>: Egrep Program.
+* backslash (\), continuing lines and: Statements/Lines.
+* backslash (\), continuing lines and, comments and: Statements/Lines.
+* backslash (\), continuing lines and, in csh <1>: Statements/Lines.
+* backslash (\), continuing lines and, in csh: More Complex.
+* backslash (\), gsub/gensub/sub functions and: Gory Details.
+* backslash (\), in character lists: Character Lists.
+* backslash (\), in escape sequences: Escape Sequences.
+* backslash (\), in escape sequences, POSIX and: Escape Sequences.
+* backslash (\), regexp constants: Computed Regexps.
* BBS-list file: Sample Data Files.
* Beebe, Nelson: Acknowledgments.
-* BEGIN special pattern: BEGIN/END.
+* BEGIN pattern <1>: BEGIN/END.
+* BEGIN pattern <2>: Field Separators.
+* BEGIN pattern: Records.
+* BEGIN pattern, assert user-defined function and: Assert Function.
+* BEGIN pattern, Boolean patterns and: Expression Patterns.
+* BEGIN pattern, exit statement and: Exit Statement.
+* BEGIN pattern, getline and: Getline Notes.
+* BEGIN pattern, headings, adding: Print Examples.
+* BEGIN pattern, next/nextfile statements and <1>: Next Statement.
+* BEGIN pattern, next/nextfile statements and: I/O And BEGIN/END.
+* BEGIN pattern, OFS/ORS variables, assigning values to: Output Separators.
+* BEGIN pattern, operators and: Using BEGIN/END.
+* BEGIN pattern, pgawk program: Profiling.
+* BEGIN pattern, print statement and: I/O And BEGIN/END.
+* BEGIN pattern, pwcat program: Passwd Functions.
+* BEGIN pattern, running awk programs and: Cut Program.
+* BEGIN pattern, TEXTDOMAIN variable and: Programmer i18n.
* beginfile user-defined function: Filetrans Function.
+* Bell Laboratories awk extensions: BTL.
* BeOS: BeOS Installation.
* Berry, Karl: Acknowledgments.
-* binary I/O: User-modified.
-* bindtextdomain built-in function <1>: Programmer i18n.
-* bindtextdomain built-in function: I18N Functions.
-* bindtextdomain C library function: Explaining gettext.
-* bindtextdomain user-defined function: I18N Portability.
+* binary input/output: User-modified.
+* bindtextdomain function (C library): Explaining gettext.
+* bindtextdomain function (gawk) <1>: Programmer i18n.
+* bindtextdomain function (gawk): I18N Functions.
+* bindtextdomain function (gawk), portability and: I18N Portability.
* BINMODE variable <1>: PC Using.
* BINMODE variable: User-modified.
* bits2str user-defined function: Bitwise Functions.
-* bitwise complement: Bitwise Functions.
-* bitwise operations: Bitwise Functions.
-* bitwise shift: Bitwise Functions.
-* blocks, BEGIN and END <1>: Profiling.
-* blocks, BEGIN and END: BEGIN/END.
-* body of a loop: While Statement.
-* book, using this: This Manual.
-* boolean expressions: Boolean Ops.
-* boolean operators: Boolean Ops.
-* bracket expression: Regexp Operators.
-* Brandon, Dick: This Manual.
+* bitwise, complement: Bitwise Functions.
+* bitwise, operations: Bitwise Functions.
+* bitwise, shift: Bitwise Functions.
+* body, in actions: Statements.
+* body, in loops: While Statement.
+* Boolean expressions: Boolean Ops.
+* Boolean expressions, as patterns: Expression Patterns.
+* Boolean operators, See Boolean expressions: Boolean Ops.
+* Bourne shell, quoting rules for: Quoting.
+* braces ({}), actions and: Action Overview.
+* braces ({}), pgawk program: Profiling.
+* braces ({}), statements, grouping: Statements.
+* bracket expressions, See character lists: Regexp Operators.
* break statement: Break Statement.
-* break, outside of loops: Break Statement.
* Brennan, Michael <1>: Other Versions.
* Brennan, Michael <2>: Simple Sed.
* Brennan, Michael <3>: Two-way I/O.
@@ -20710,540 +21033,721 @@ Index
* Brown, Martin <1>: Bugs.
* Brown, Martin <2>: Contributors.
* Brown, Martin: Acknowledgments.
-* BSD portal files: Portal Files.
-* BSD-based operating systems <1>: Glossary.
-* BSD-based operating systems <2>: Portal Files.
-* BSD-based operating systems: Manual History.
-* buffer matching operators: GNU Regexp Operators.
-* buffering output: I/O Functions.
-* buffering, interactive vs. non-interactive: I/O Functions.
-* buffering, non-interactive vs. interactive: I/O Functions.
+* BSD portals: Portal Files.
+* BSD-based operating systems: Glossary.
+* Buening, Andreas <1>: Contributors.
+* Buening, Andreas: Acknowledgments.
+* buffering, input/output <1>: Two-way I/O.
+* buffering, input/output: I/O Functions.
+* buffering, interactive vs. noninteractive: I/O Functions.
* buffers, flushing: I/O Functions.
-* bug reports: Bugs.
+* buffers, operators for: GNU Regexp Operators.
* bug reports, email address, bug-gawk@gnu.org: Bugs.
* bug-gawk@gnu.org bug reporting address: Bugs.
-* bugs, known in gawk: Known Bugs.
-* built-in functions: Built-in.
+* built-in functions: Functions.
+* built-in functions, evaluation order: Calling Built-in.
* built-in variables: Built-in Variables.
-* built-in variables, convey information: Auto-set.
-* built-in variables, user modifiable: User-modified.
+* built-in variables, -v option, setting with: Options.
+* built-in variables, conveying information: Auto-set.
+* built-in variables, user-modifiable: User-modified.
* call by reference: Function Caveats.
* call by value: Function Caveats.
-* calling a function <1>: Function Caveats.
-* calling a function: Function Calls.
-* case conversion: String Functions.
-* case sensitivity: Case-sensitivity.
-* changing contents of a field: Changing Fields.
-* changing the record separator: Records.
-* character class <1>: Character Lists.
-* character class: Regexp Operators.
+* caret (^) <1>: GNU Regexp Operators.
+* caret (^): Regexp Operators.
+* caret (^), ^ operator <1>: Options.
+* caret (^), ^ operator: Precedence.
+* caret (^), ^= operator <1>: Options.
+* caret (^), ^= operator <2>: Precedence.
+* caret (^), ^= operator: Assignment Ops.
+* caret (^), in character lists: Character Lists.
+* case sensitivity, array indices and: Array Intro.
+* case sensitivity, converting case: String Functions.
+* case sensitivity, example programs: Library Functions.
+* case sensitivity, gawk: Case-sensitivity.
+* case sensitivity, regexps and <1>: User-modified.
+* case sensitivity, regexps and: Case-sensitivity.
+* case sensitivity, string comparisons and: User-modified.
* character encodings: Ordinal Functions.
-* character list: Regexp Operators.
-* character list, complemented: Regexp Operators.
-* character set (regexp component): Regexp Operators.
-* character sets (machine character encodings) <1>: Glossary.
-* character sets (machine character encodings): Ordinal Functions.
+* character lists <1>: Character Lists.
+* character lists: Regexp Operators.
+* character lists, character classes: Character Lists.
+* character lists, collating elements: Character Lists.
+* character lists, collating symbols: Character Lists.
+* character lists, complemented: Regexp Operators.
+* character lists, equivalence classes: Character Lists.
+* character lists, non-ASCII: Character Lists.
+* character lists, range expressions: Character Lists.
+* character sets: Ordinal Functions.
+* character sets (machine character encodings): Glossary.
+* character sets, See Also character lists: Regexp Operators.
+* characters, counting: Wc Program.
+* characters, transliterating: Translate Program.
+* characters, values of as numbers: Ordinal Functions.
* Chassell, Robert J.: Acknowledgments.
+* chdir function, implementing in gawk: Sample Library.
* chem utility: Glossary.
* chr user-defined function: Ordinal Functions.
* Cliff random numbers: Cliff Random Function.
* cliff_rand user-defined function: Cliff Random Function.
-* close built-in function <1>: I/O Functions.
-* close built-in function: Close Files And Pipes.
+* close function <1>: I/O Functions.
+* close function <2>: Close Files And Pipes.
+* close function <3>: Getline/Pipe.
+* close function: Getline/Variable/File.
+* close function, return values: Close Files And Pipes.
+* close function, two-way pipes and: Two-way I/O.
* Close, Diane <1>: Contributors.
* Close, Diane: Manual History.
-* close, return value: Close Files And Pipes.
-* closing coprocesses: Close Files And Pipes.
-* closing input files and pipes: Close Files And Pipes.
-* closing output files and pipes: Close Files And Pipes.
-* coding style used in gawk: Adding Code.
* collating elements: Character Lists.
* collating symbols: Character Lists.
-* comma operator, not supported: For Statement.
-* command line: Command Line.
-* command line, setting FS on: Command Line Field Separator.
-* command-line formats: Running gawk.
-* command-line option, --assign: Options.
-* command-line option, --compat: Options.
-* command-line option, --copyleft: Options.
-* command-line option, --copyright: Options.
-* command-line option, --dump-variables: Options.
-* command-line option, --field-separator: Options.
-* command-line option, --file: Options.
-* command-line option, --gen-po <1>: Options.
-* command-line option, --gen-po: String Extraction.
-* command-line option, --help: Options.
-* command-line option, --lint: Options.
-* command-line option, --lint-old: Options.
-* command-line option, --non-decimal-data <1>: Options.
-* command-line option, --non-decimal-data: Non-decimal Data.
-* command-line option, --posix: Options.
-* command-line option, --profile: Options.
-* command-line option, --re-interval: Options.
-* command-line option, --source: Options.
-* command-line option, --traditional: Options.
-* command-line option, --usage: Options.
-* command-line option, --version: Options.
-* command-line option, -f: Options.
-* command-line option, -F <1>: Options.
-* command-line option, -F: Command Line Field Separator.
-* command-line option, -f: Long.
-* command-line option, -mf: Options.
-* command-line option, -mr: Options.
-* command-line option, -v: Options.
-* command-line option, -W: Options.
-* comments: Comments.
-* comments and backslash continuation: Statements/Lines.
-* common mistakes <1>: Options.
-* common mistakes <2>: String Functions.
-* common mistakes <3>: Typing and Comparison.
-* common mistakes <4>: Concatenation.
-* common mistakes <5>: Arithmetic Ops.
-* common mistakes <6>: Special FD.
-* common mistakes <7>: Redirection.
-* common mistakes <8>: Print Examples.
-* common mistakes <9>: Field Separators.
-* common mistakes <10>: Computed Regexps.
-* common mistakes: Escape Sequences.
-* comp.lang.awk Usenet news group: Bugs.
+* columns, aligning: Print Examples.
+* columns, cutting: Cut Program.
+* comma (,), in range patterns: Ranges.
+* command line, arguments <1>: Other Arguments.
+* command line, arguments <2>: ARGC and ARGV.
+* command line, arguments: Auto-set.
+* command line, formats: Running gawk.
+* command line, FS on, setting: Command Line Field Separator.
+* command line, invoking awk from: Command Line.
+* command line, options <1>: Options.
+* command line, options <2>: Command Line Field Separator.
+* command line, options: Long.
+* command line, options, end of: Options.
+* command line, variables, assigning on: Assignment Options.
+* command-line options, processing: Getopt Function.
+* command-line options, string extraction: String Extraction.
+* commenting: Comments.
+* commenting, backslash continuation and: Statements/Lines.
+* comp.lang.awk newsgroup: Bugs.
* comparison expressions: Typing and Comparison.
-* comparisons, string vs. regexp: Typing and Comparison.
-* compatibility mode <1>: POSIX/GNU.
-* compatibility mode: Options.
+* comparison expressions, as patterns: Expression Patterns.
+* comparison expressions, string vs. regexp: Typing and Comparison.
+* compatibility mode (gawk), extensions: POSIX/GNU.
+* compatibility mode (gawk), file names: Special Caveats.
+* compatibility mode (gawk), hexadecimal numbers: Nondecimal-numbers.
+* compatibility mode (gawk), octal numbers: Nondecimal-numbers.
+* compatibility mode (gawk), specifying: Options.
* compiled programs <1>: Glossary.
* compiled programs: Basic High Level.
-* compl built-in function: Bitwise Functions.
+* compl function (gawk): Bitwise Functions.
* complement, bitwise: Bitwise Functions.
-* complemented character list: Regexp Operators.
-* compound statement: Statements.
-* computed regular expressions: Computed Regexps.
-* concatenation: Concatenation.
-* concatenation evaluation order: Concatenation.
-* conditional expression: Conditional Exp.
+* compound statements, control statements and: Statements.
+* concatenating: Concatenation.
+* conditional expressions: Conditional Exp.
* configuration option, --disable-nls: Additional Configuration Options.
-* configuration option, --enable-portals <1>: Additional Configuration Options.
-* configuration option, --enable-portals: Portal Files.
+* configuration option, --enable-portals: Additional Configuration Options.
* configuration option, --with-included-gettext <1>: Additional Configuration Options.
* configuration option, --with-included-gettext: Gawk I18N.
-* configuring gawk: Configuration Philosophy.
+* configuration options, gawk: Additional Configuration Options.
+* constants, nondecimal: Nondecimal Data.
* constants, types of: Constants.
-* continuation of lines: Statements/Lines.
* continue statement: Continue Statement.
-* continue, outside of loops: Continue Statement.
-* contributors to gawk: Contributors.
-* control statement: Statements.
-* conventions, programming <1>: Internal File Ops.
-* conventions, programming <2>: Nextfile Function.
-* conventions, programming <3>: Library Names.
-* conventions, programming <4>: Non-decimal Data.
-* conventions, programming <5>: Return Statement.
-* conventions, programming <6>: Definition Syntax.
-* conventions, programming <7>: Calling Built-in.
-* conventions, programming <8>: Auto-set.
-* conventions, programming: Exit Statement.
-* conversion of case: String Functions.
-* conversion of strings and numbers: Conversion.
-* conversions, during subscripting: Numeric Array Subscripts.
-* converting dates to timestamps: Time Functions.
-* CONVFMT variable <1>: Numeric Array Subscripts.
-* CONVFMT variable <2>: User-modified.
+* control statements: Statements.
+* converting, case: String Functions.
+* converting, dates to timestamps: Time Functions.
+* converting, during subscripting: Numeric Array Subscripts.
+* converting, numbers: Conversion.
+* converting, numbers, to strings: Bitwise Functions.
+* converting, strings to numbers: Conversion.
+* CONVFMT variable <1>: User-modified.
* CONVFMT variable: Conversion.
-* coprocess <1>: Two-way I/O.
-* coprocess <2>: Close Files And Pipes.
-* coprocess <3>: Redirection.
-* coprocess: Getline/Coprocess.
-* cos built-in function: Numeric Functions.
-* csh utility <1>: Options.
-* csh utility <2>: Two-way I/O.
-* csh utility <3>: Statements/Lines.
-* csh utility <4>: More Complex.
-* csh utility: Quoting.
-* csh, backslash continuation <1>: Statements/Lines.
-* csh, backslash continuation: More Complex.
-* curly braces: Action Overview.
-* custom.h configuration file: Configuration Philosophy.
+* CONVFMT variable, array subscripts and: Numeric Array Subscripts.
+* coprocesses <1>: Two-way I/O.
+* coprocesses: Redirection.
+* coprocesses, closing: Close Files And Pipes.
+* coprocesses, getline from: Getline/Coprocess.
+* cos function: Numeric Functions.
+* counting: Wc Program.
+* csh utility: Statements/Lines.
+* csh utility, backslash continuation and: More Complex.
+* csh utility, POSIXLY_CORRECT environment variable: Options.
+* csh utility, |& operator, comparison with: Two-way I/O.
+* ctime user-defined function: Function Example.
+* currency symbols, localization: Explaining gettext.
+* custom.h file: Configuration Philosophy.
* cut utility: Cut Program.
* cut.awk program: Cut Program.
-* d.c., see "dark corner": Conventions.
+* d.c., See dark corner: Conventions.
* dark corner <1>: Glossary.
-* dark corner <2>: Other Arguments.
-* dark corner <3>: Command Line.
-* dark corner <4>: String Functions.
-* dark corner <5>: Uninitialized Subscripts.
-* dark corner <6>: Auto-set.
-* dark corner <7>: Exit Statement.
-* dark corner <8>: Continue Statement.
-* dark corner <9>: Break Statement.
-* dark corner <10>: Truth Values.
-* dark corner <11>: Assignment Ops.
-* dark corner <12>: Conversion.
-* dark corner <13>: Assignment Options.
-* dark corner <14>: Using Constant Regexps.
-* dark corner <15>: Close Files And Pipes.
-* dark corner <16>: Format Modifiers.
-* dark corner <17>: Control Letters.
-* dark corner <18>: OFMT.
-* dark corner <19>: Getline Notes.
-* dark corner <20>: Multiple Line.
-* dark corner <21>: Field Splitting Summary.
-* dark corner <22>: Single Character Fields.
-* dark corner <23>: Changing Fields.
-* dark corner <24>: Records.
-* dark corner <25>: Escape Sequences.
+* dark corner <2>: Truth Values.
+* dark corner <3>: Assignment Ops.
+* dark corner <4>: Format Modifiers.
* dark corner: Conventions.
-* data files, non-readable, skipping: File Checking.
-* data files, readable, checking: File Checking.
-* data-driven languages <1>: Basic High Level.
-* data-driven languages: Getting Started.
+* dark corner, array subscripts: Uninitialized Subscripts.
+* dark corner, break statement: Break Statement.
+* dark corner, close function: Close Files And Pipes.
+* dark corner, command-line arguments: Assignment Options.
+* dark corner, continue statement: Continue Statement.
+* dark corner, CONVFMT variable: Conversion.
+* dark corner, escape sequences: Other Arguments.
+* dark corner, escape sequences, for metacharacters: Escape Sequences.
+* dark corner, exit statement: Exit Statement.
+* dark corner, field separators: Field Splitting Summary.
+* dark corner, FILENAME variable <1>: Auto-set.
+* dark corner, FILENAME variable: Getline Notes.
+* dark corner, FNR/NR variables: Auto-set.
+* dark corner, format-control characters: Control Letters.
+* dark corner, FS as null string: Single Character Fields.
+* dark corner, input files: Records.
+* dark corner, invoking awk: Command Line.
+* dark corner, multiline records: Multiple Line.
+* dark corner, NF variable, decrementing: Changing Fields.
+* dark corner, OFMT variable: OFMT.
+* dark corner, regexp constants: Using Constant Regexps.
+* dark corner, regexp constants, /= operator and: Assignment Ops.
+* dark corner, regexp constants, as arguments to user-defined functions: Using Constant Regexps.
+* dark corner, split function: String Functions.
+* dark corner, strings, storing: Records.
+* data, fixed-width: Constant Size.
+* data-driven languages: Basic High Level.
+* database, group, reading: Group Functions.
+* database, users, reading: Passwd Functions.
+* date utility, GNU: Time Functions.
+* date utility, POSIX: Time Functions.
* dates, converting to timestamps: Time Functions.
+* dates, information related to, localization: Explaining gettext.
* Davies, Stephen <1>: Bugs.
* Davies, Stephen: Contributors.
-* dcgettext built-in function <1>: Programmer i18n.
-* dcgettext built-in function: I18N Functions.
-* dcgettext user-defined function: I18N Portability.
-* deadlock: Two-way I/O.
+* dcgettext function (gawk) <1>: Programmer i18n.
+* dcgettext function (gawk): I18N Functions.
+* dcgettext function (gawk), portability and: I18N Portability.
+* dcngettext function (gawk) <1>: Programmer i18n.
+* dcngettext function (gawk): I18N Functions.
+* dcngettext function (gawk), portability and: I18N Portability.
+* deadlocks: Two-way I/O.
+* debugging gawk: Known Bugs.
+* debugging gawk, bug reports: Bugs.
* decrement operators: Increment Ops.
-* default action: Very Simple.
-* default pattern: Very Simple.
-* defining functions: Definition Syntax.
* Deifik, Scott <1>: Bugs.
* Deifik, Scott <2>: Contributors.
* Deifik, Scott: Acknowledgments.
* delete statement: Delete.
-* deleting elements of arrays: Delete.
+* deleting elements in arrays: Delete.
* deleting entire arrays: Delete.
-* deprecated features: Obsolete.
-* deprecated options: Obsolete.
-* differences between gawk and awk <1>: AWKPATH Variable.
-* differences between gawk and awk <2>: String Functions.
-* differences between gawk and awk <3>: Calling Built-in.
-* differences between gawk and awk <4>: Delete.
-* differences between gawk and awk <5>: ARGC and ARGV.
-* differences between gawk and awk <6>: User-modified.
-* differences between gawk and awk <7>: Nextfile Statement.
-* differences between gawk and awk <8>: I/O And BEGIN/END.
-* differences between gawk and awk <9>: Conditional Exp.
-* differences between gawk and awk <10>: Arithmetic Ops.
-* differences between gawk and awk <11>: Using Constant Regexps.
-* differences between gawk and awk <12>: Scalar Constants.
-* differences between gawk and awk <13>: Close Files And Pipes.
-* differences between gawk and awk <14>: Special FD.
-* differences between gawk and awk <15>: Redirection.
-* differences between gawk and awk <16>: Format Modifiers.
-* differences between gawk and awk <17>: Getline Notes.
-* differences between gawk and awk <18>: Getline/Coprocess.
-* differences between gawk and awk <19>: Getline.
-* differences between gawk and awk <20>: Single Character Fields.
-* differences between gawk and awk <21>: Records.
-* differences between gawk and awk: Case-sensitivity.
-* directory search <1>: VMS Running.
-* directory search <2>: PC Using.
-* directory search <3>: Igawk Program.
-* directory search: AWKPATH Variable.
+* differences in awk and gawk, ARGC/ARGV variables: ARGC and ARGV.
+* differences in awk and gawk, ARGIND variable: Auto-set.
+* differences in awk and gawk, array elements, deleting: Delete.
+* differences in awk and gawk, AWKPATH environment variable: AWKPATH Variable.
+* differences in awk and gawk, BEGIN/END patterns: I/O And BEGIN/END.
+* differences in awk and gawk, BINMODE variable <1>: PC Using.
+* differences in awk and gawk, BINMODE variable: User-modified.
+* differences in awk and gawk, close function: Close Files And Pipes.
+* differences in awk and gawk, ERRNO variable: Auto-set.
+* differences in awk and gawk, error messages: Special FD.
+* differences in awk and gawk, FIELDWIDTHS variable: User-modified.
+* differences in awk and gawk, function arguments (gawk): Calling Built-in.
+* differences in awk and gawk, getline command: Getline.
+* differences in awk and gawk, IGNORECASE variable: User-modified.
+* differences in awk and gawk, implementation limitations <1>: Redirection.
+* differences in awk and gawk, implementation limitations: Getline Notes.
+* differences in awk and gawk, input/output operators <1>: Redirection.
+* differences in awk and gawk, input/output operators: Getline/Coprocess.
+* differences in awk and gawk, line continuations: Conditional Exp.
+* differences in awk and gawk, LINT variable: User-modified.
+* differences in awk and gawk, match function: String Functions.
+* differences in awk and gawk, next/nextfile statements: Nextfile Statement.
+* differences in awk and gawk, print/printf statements: Format Modifiers.
+* differences in awk and gawk, PROCINFO array: Auto-set.
+* differences in awk and gawk, record separators: Records.
+* differences in awk and gawk, regexp constants: Using Constant Regexps.
+* differences in awk and gawk, regular expressions: Case-sensitivity.
+* differences in awk and gawk, RS/RT variables: Records.
+* differences in awk and gawk, RT variable: Auto-set.
+* differences in awk and gawk, single-character fields: Single Character Fields.
+* differences in awk and gawk, split function: String Functions.
+* differences in awk and gawk, strings: Scalar Constants.
+* differences in awk and gawk, strings, storing: Records.
+* differences in awk and gawk, strtonum function (gawk): String Functions.
+* differences in awk and gawk, TEXTDOMAIN variable: User-modified.
+* differences in awk and gawk, trunc-mod operation: Arithmetic Ops.
+* directories, changing: Sample Library.
+* directories, searching <1>: Igawk Program.
+* directories, searching: AWKPATH Variable.
* division: Arithmetic Ops.
-* do-while statement: Do Statement.
+* do-while statement <1>: Do Statement.
+* do-while statement: Regexp Usage.
+* documentation, of awk programs: Library Names.
* documentation, online: Manual History.
-* documenting awk programs <1>: Library Names.
-* documenting awk programs: Comments.
-* double-precision floating-point, definition of: Basic Data Typing.
+* documents, searching: Dupword Program.
+* dollar sign ($): Regexp Operators.
+* dollar sign ($), $ field operator <1>: Precedence.
+* dollar sign ($), $ field operator: Fields.
+* dollar sign ($), incrementing fields and arrays: Increment Ops.
+* double quote (") <1>: Quoting.
+* double quote ("): Read Terminal.
+* double quote ("), regexp constants: Computed Regexps.
+* double-precision floating-point: Basic Data Typing.
* Drepper, Ulrich: Acknowledgments.
* dupnode internal function: Internals.
* dupword.awk program: Dupword Program.
-* dynamic profiling: Profiling.
-* dynamic regular expressions: Computed Regexps.
-* dynamic regular expressions with embedded newlines: Computed Regexps.
* EBCDIC: Ordinal Functions.
* egrep utility <1>: Egrep Program.
* egrep utility: Character Lists.
* egrep.awk program: Egrep Program.
-* element assignment: Assigning Elements.
-* element of array: Reference to Elements.
-* emaill address for bug reports, bug-gawk@gnu.org: Bugs.
-* embedded newlines, in dynamic regexps: Computed Regexps.
+* elements in arrays: Reference to Elements.
+* elements in arrays, assigning: Assigning Elements.
+* elements in arrays, deleting: Delete.
+* elements in arrays, order of: Scanning an Array.
+* elements in arrays, scanning: Scanning an Array.
+* email address for bug reports, bug-gawk@gnu.org: Bugs.
* EMISTERED: TCP/IP Networking.
-* empty action: Very Simple.
* empty pattern: Empty.
-* empty program: Command Line.
-* empty string <1>: Truth Values.
-* empty string <2>: Conversion.
-* empty string <3>: Regexp Field Splitting.
-* empty string: Records.
-* empty string, definition of: Basic Data Typing.
-* END special pattern: BEGIN/END.
+* empty strings, See null strings: Regexp Field Splitting.
+* END pattern: BEGIN/END.
+* END pattern, assert user-defined function and: Assert Function.
+* END pattern, backslash continuation and: Egrep Program.
+* END pattern, Boolean patterns and: Expression Patterns.
+* END pattern, exit statement and: Exit Statement.
+* END pattern, next/nextfile statements and <1>: Next Statement.
+* END pattern, next/nextfile statements and: I/O And BEGIN/END.
+* END pattern, operators and: Using BEGIN/END.
+* END pattern, pgawk program: Profiling.
+* END pattern, print statement and: I/O And BEGIN/END.
* endfile user-defined function: Filetrans Function.
+* endgrent function (C library): Group Functions.
* endgrent user-defined function: Group Functions.
+* endpwent function (C library): Passwd Functions.
* endpwent user-defined function: Passwd Functions.
* ENVIRON variable: Auto-set.
-* environment variable, AWKPATH: AWKPATH Variable.
-* environment variable, POSIXLY_CORRECT: Options.
+* environment variables: Auto-set.
* epoch, definition of: Glossary.
-* equivalence classes: Character Lists.
-* ERRNO variable <1>: Auto-set.
+* equals sign (=), = operator: Assignment Ops.
+* equals sign (=), == operator <1>: Precedence.
+* equals sign (=), == operator: Typing and Comparison.
+* EREs (Extended Regular Expressions): Character Lists.
+* ERRNO variable <1>: Internals.
+* ERRNO variable <2>: Auto-set.
* ERRNO variable: Getline.
-* errors, common <1>: Options.
-* errors, common <2>: String Functions.
-* errors, common <3>: Typing and Comparison.
-* errors, common <4>: Concatenation.
-* errors, common <5>: Arithmetic Ops.
-* errors, common <6>: Special FD.
-* errors, common <7>: Redirection.
-* errors, common <8>: Print Examples.
-* errors, common <9>: Field Separators.
-* errors, common <10>: Computed Regexps.
-* errors, common: Escape Sequences.
-* escape processing, sub et. al.: Gory Details.
-* escape sequence notation: Escape Sequences.
-* evaluation, order of <1>: Calling Built-in.
-* evaluation, order of <2>: Increment Ops.
-* evaluation, order of: Concatenation.
+* error handling: Special FD.
+* error handling, ERRNO variable and: Auto-set.
+* error output: Special FD.
+* escape processing, gsub/gensub/sub functions: Gory Details.
+* escape sequences: Escape Sequences.
+* escape sequences, unrecognized: Options.
+* evaluation order: Increment Ops.
+* evaluation order, concatenation: Concatenation.
+* evaluation order, functions: Calling Built-in.
* examining fields: Fields.
-* executable scripts: Executable Scripts.
+* exclamation point (!), ! operator <1>: Egrep Program.
+* exclamation point (!), ! operator <2>: Precedence.
+* exclamation point (!), ! operator: Boolean Ops.
+* exclamation point (!), != operator <1>: Precedence.
+* exclamation point (!), != operator: Typing and Comparison.
+* exclamation point (!), !~ operator <1>: Expression Patterns.
+* exclamation point (!), !~ operator <2>: Precedence.
+* exclamation point (!), !~ operator <3>: Typing and Comparison.
+* exclamation point (!), !~ operator <4>: Regexp Constants.
+* exclamation point (!), !~ operator <5>: Computed Regexps.
+* exclamation point (!), !~ operator <6>: Case-sensitivity.
+* exclamation point (!), !~ operator: Regexp Usage.
* exit statement: Exit Statement.
-* exp built-in function: Numeric Functions.
+* exp function: Numeric Functions.
* expand utility: Very Simple.
-* explicit input: Getline.
-* exponentiation: Arithmetic Ops.
-* expression: Expressions.
-* expression, assignment: Assignment Ops.
-* expression, boolean: Boolean Ops.
-* expression, comparison: Typing and Comparison.
-* expression, conditional: Conditional Exp.
-* expression, matching: Typing and Comparison.
-* extension built-in function: Using Internal File Ops.
+* expressions: Expressions.
+* expressions, as patterns: Expression Patterns.
+* expressions, assignment: Assignment Ops.
+* expressions, Boolean: Boolean Ops.
+* expressions, comparison: Typing and Comparison.
+* expressions, conditional: Conditional Exp.
+* expressions, matching, See comparison expressions: Typing and Comparison.
+* expressions, selecting: Conditional Exp.
+* Extended Regular Expressions (EREs): Character Lists.
+* extension function (gawk): Using Internal File Ops.
* extensions, Bell Laboratories awk: BTL.
+* extensions, in gawk, not in POSIX awk: POSIX/GNU.
* extensions, mawk: Other Versions.
* extract.awk program: Extract Program.
* extraction, of marked strings (internationalization): String Extraction.
-* fatal errors <1>: File Checking.
-* fatal errors <2>: Options.
-* fatal errors <3>: I/O Functions.
-* fatal errors <4>: String Functions.
-* fatal errors <5>: Calling Built-in.
-* fatal errors <6>: Format Modifiers.
-* fatal errors: Constant Size.
-* FDL: GNU Free Documentation License.
+* false, logical: Truth Values.
+* FDL (Free Documentation License): GNU Free Documentation License.
* features, adding to gawk: Adding Code.
-* features, advanced: Advanced Features.
+* features, advanced, See advanced features: Obsolete.
+* features, deprecated: Obsolete.
* features, undocumented: Undocumented.
* Fenlason, Jay <1>: Contributors.
* Fenlason, Jay: History.
-* fflush built-in function: I/O Functions.
+* fflush function: I/O Functions.
+* fflush function, unsupported: Options.
+* field numbers: Nonconstant Fields.
* field operator $: Fields.
-* field separator, choice of: Field Separators.
-* field separator, FS: Field Separators.
-* field separator, on command line: Command Line Field Separator.
-* fields: Fields.
+* field operators, dollar sign as: Fields.
+* field separators <1>: User-modified.
+* field separators: Field Separators.
+* field separators, choice of: Field Separators.
+* field separators, FIELDWIDTHS variable and: User-modified.
+* field separators, in multiline records: Multiple Line.
+* field separators, on command line: Command Line Field Separator.
+* field separators, POSIX and <1>: Field Splitting Summary.
+* field separators, POSIX and: Fields.
+* field separators, regular expressions as <1>: Regexp Field Splitting.
+* field separators, regular expressions as: Field Separators.
+* field separators, See Also OFS: Changing Fields.
+* field separators, spaces as: Cut Program.
+* fields <1>: Basic High Level.
+* fields <2>: Fields.
+* fields: Reading Files.
+* fields, adding: Changing Fields.
* fields, changing contents of: Changing Fields.
-* fields, definition of: Basic High Level.
+* fields, cutting: Cut Program.
+* fields, examining: Fields.
+* fields, number of: Fields.
+* fields, numbers: Nonconstant Fields.
+* fields, printing: Print Examples.
* fields, separating: Field Separators.
-* FIELDWIDTHS variable: User-modified.
+* fields, single-character: Single Character Fields.
+* FIELDWIDTHS variable <1>: User-modified.
+* FIELDWIDTHS variable: Constant Size.
* file descriptors: Special FD.
-* file, awk program: Long.
+* file names, distinguishing: Auto-set.
+* file names, in compatibility mode: Special Caveats.
+* file names, standard streams in gawk: Special FD.
* FILENAME variable <1>: Auto-set.
-* FILENAME variable <2>: Getline Notes.
* FILENAME variable: Reading Files.
-* FILENAME, being set by getline: Getline Notes.
+* FILENAME variable, getline, setting with: Getline Notes.
+* filenames, assignments as: Ignoring Assigns.
+* files, .mo: Explaining gettext.
+* files, .mo, converting from .po: I18N Example.
+* files, .mo, specifying directory of <1>: Programmer i18n.
+* files, .mo, specifying directory of: Explaining gettext.
+* files, .po <1>: Translator i18n.
+* files, .po: Explaining gettext.
+* files, .po, converting to .mo: I18N Example.
+* files, /dev/... special files: Special FD.
+* files, /inet/ (gawk): TCP/IP Networking.
+* files, /p (gawk): Portal Files.
+* files, as single records: Records.
+* files, awk programs in: Long.
+* files, awkprof.out: Profiling.
+* files, awkvars.out: Options.
+* files, closing: I/O Functions.
+* files, descriptors, See file descriptors: Special FD.
+* files, for process information: Special Process.
+* files, group: Group Functions.
+* files, information about, retrieving: Sample Library.
+* files, initialization and cleanup: Filetrans Function.
+* files, input, See input files: Read Terminal.
+* files, log, timestamps in: Time Functions.
+* files, managing: Data File Management.
+* files, managing, data file boundaries: Filetrans Function.
+* files, message object: Explaining gettext.
+* files, message object, converting from portable object files: I18N Example.
+* files, message object, specifying directory of <1>: Programmer i18n.
+* files, message object, specifying directory of: Explaining gettext.
+* files, multiple passes over: Other Arguments.
+* files, multiple, duplicating output into: Tee Program.
+* files, output, See output files: Close Files And Pipes.
+* files, password: Passwd Functions.
+* files, portable object <1>: Translator i18n.
+* files, portable object: Explaining gettext.
+* files, portable object, converting to message object files: I18N Example.
+* files, portable object, generating: Options.
+* files, portal: Portal Files.
+* files, processing, ARGIND variable and: Auto-set.
+* files, reading: Rewind Function.
+* files, reading, multiline records: Multiple Line.
+* files, searching for regular expressions: Egrep Program.
+* files, skipping: File Checking.
+* files, source, search path for: Igawk Program.
+* files, splitting: Split Program.
+* files, Texinfo, extracting programs from: Extract Program.
* Fish, Fred <1>: Bugs.
* Fish, Fred: Contributors.
+* fixed-width data: Constant Size.
* flag variables <1>: Tee Program.
-* flag variables <2>: Ranges.
* flag variables: Boolean Ops.
-* floating-point, definition of: Basic Data Typing.
-* floating-point, positive and negative values for zero: Floating Point Issues.
-* floating-point, precision issues: Floating Point Issues.
-* flushing buffers: I/O Functions.
+* floating-point: Floating Point Issues.
+* floating-point, numbers: Basic Data Typing.
+* floating-point, numbers, AWKNUM internal type: Internals.
* FNR variable <1>: Auto-set.
* FNR variable: Records.
-* for (x in ...) statement: Scanning an Array.
+* FNR variable, changing: Auto-set.
* for statement: For Statement.
+* for statement, in arrays: Scanning an Array.
* force_number internal function: Internals.
* force_string internal function: Internals.
-* format specifier, printf: Control Letters.
-* format specifier, strftime: Time Functions.
-* format specifiers, mixing regular with positional specifiers (printf): Printf Ordering.
-* format string: Basic Printf.
-* format, numeric output: OFMT.
-* formatted output: Printf.
-* formatted timestamps: Gettimeofday Function.
-* Free Documentation License: GNU Free Documentation License.
-* Free Software Foundation <1>: Glossary.
-* Free Software Foundation <2>: Getting.
-* Free Software Foundation: Manual History.
+* format specifiers, mixing regular with positional specifiers: Printf Ordering.
+* format specifiers, printf statement: Control Letters.
+* format specifiers, strftime function (gawk): Time Functions.
+* format strings: Basic Printf.
+* formats, numeric output: OFMT.
+* formatting output: Printf.
+* forward slash (/): Regexp.
+* forward slash (/), / operator: Precedence.
+* forward slash (/), /= operator <1>: Precedence.
+* forward slash (/), /= operator: Assignment Ops.
+* forward slash (/), /= operator, vs. /=.../ regexp constant: Assignment Ops.
+* forward slash (/), patterns and: Expression Patterns.
+* Free Documentation License (FDL): GNU Free Documentation License.
+* Free Software Foundation (FSF) <1>: Glossary.
+* Free Software Foundation (FSF) <2>: Getting.
+* Free Software Foundation (FSF): Manual History.
* free_temp internal macro: Internals.
-* FreeBSD <1>: Glossary.
-* FreeBSD: Manual History.
+* FreeBSD: Glossary.
* FS variable <1>: User-modified.
* FS variable: Field Separators.
-* FSF <1>: Glossary.
-* FSF <2>: Getting.
-* FSF: Manual History.
-* ftp, anonymous: Getting.
-* function call <1>: Function Caveats.
-* function call: Function Calls.
-* function definition: Definition Syntax.
-* function, recursive: Definition Syntax.
-* function, user-defined: User-defined.
+* FS variable, --field-separator option and: Options.
+* FS variable, as null string: Single Character Fields.
+* FS variable, as TAB character: Options.
+* FS variable, changing value of <1>: Known Bugs.
+* FS variable, changing value of: Field Separators.
+* FS variable, running awk programs and: Cut Program.
+* FS variable, setting from command line: Command Line Field Separator.
+* FSF (Free Software Foundation) <1>: Glossary.
+* FSF (Free Software Foundation) <2>: Getting.
+* FSF (Free Software Foundation): Manual History.
+* function calls: Function Calls.
+* functions, arrays as parameters to: Function Caveats.
+* functions, built-in <1>: Functions.
+* functions, built-in: Function Calls.
+* functions, built-in, adding to gawk: Dynamic Extensions.
+* functions, built-in, evaluation order: Calling Built-in.
+* functions, defining: Definition Syntax.
+* functions, library: Library Functions.
+* functions, library, assertions: Assert Function.
+* functions, library, associative arrays and: Library Names.
+* functions, library, C library: Getopt Function.
+* functions, library, character values as numbers: Ordinal Functions.
+* functions, library, Cliff random numbers: Cliff Random Function.
+* functions, library, command-line options: Getopt Function.
+* functions, library, example program for using: Igawk Program.
+* functions, library, group database, reading: Group Functions.
+* functions, library, managing data files: Data File Management.
+* functions, library, managing time: Gettimeofday Function.
+* functions, library, merging arrays into strings: Join Function.
+* functions, library, nextfile statement: Nextfile Function.
+* functions, library, rounding numbers: Round Function.
+* functions, library, user database, reading: Passwd Functions.
+* functions, names of <1>: Definition Syntax.
+* functions, names of: Arrays.
+* functions, recursive: Definition Syntax.
+* functions, return values, setting: Internals.
+* functions, string-translation: I18N Functions.
* functions, undefined: Function Caveats.
+* functions, user-defined: User-defined.
+* functions, user-defined, calling: Function Caveats.
+* functions, user-defined, counts: Profiling.
+* functions, user-defined, library of: Library Functions.
+* functions, user-defined, next/nextfile statements and <1>: Nextfile Statement.
+* functions, user-defined, next/nextfile statements and: Next Statement.
* G-d: Acknowledgments.
* Garfinkle, Scott: Contributors.
-* gawk, coding style: Adding Code.
-* gawk, source code: Getting.
-* General Public License <1>: Glossary.
-* General Public License <2>: New Ports.
-* General Public License <3>: Other Versions.
-* General Public License: Manual History.
-* gensub built-in function: String Functions.
-* gensub, escape processing: Gory Details.
+* gawk, awk and <1>: This Manual.
+* gawk, awk and: Preface.
+* gawk, bitwise operations in: Bitwise Functions.
+* gawk, break statement in: Break Statement.
+* gawk, built-in variables and: Built-in Variables.
+* gawk, character classes and: Character Lists.
+* gawk, coding style in: Adding Code.
+* gawk, command-line options: GNU Regexp Operators.
+* gawk, comparison operators and: Typing and Comparison.
+* gawk, configuring: Configuration Philosophy.
+* gawk, configuring, options: Additional Configuration Options.
+* gawk, continue statement in: Continue Statement.
+* gawk, debugging: Known Bugs.
+* gawk, distribution: Distribution contents.
+* gawk, escape sequences: Escape Sequences.
+* gawk, extensions, disabling: Options.
+* gawk, features, adding: Adding Code.
+* gawk, features, advanced: Advanced Features.
+* gawk, fflush function in: I/O Functions.
+* gawk, field separators and: User-modified.
+* gawk, FIELDWIDTHS variable in: User-modified.
+* gawk, file names in: Special Files.
+* gawk, format-control characters: Control Letters.
+* gawk, function arguments and: Calling Built-in.
+* gawk, functions, adding: Dynamic Extensions.
+* gawk, hexadecimal numbers and: Nondecimal-numbers.
+* gawk, IGNORECASE variable in: User-modified.
+* gawk, implementation issues: Notes.
+* gawk, implementation issues, debugging: Compatibility Mode.
+* gawk, implementation issues, downward compatibility: Compatibility Mode.
+* gawk, implementation issues, limits: Getline Notes.
+* gawk, implementation issues, pipes: Redirection.
+* gawk, installing: Installation.
+* gawk, internals: Internals.
+* gawk, internationalization and, See internationalization: Internationalization.
+* gawk, interpreter, adding code to <1>: Future Extensions.
+* gawk, interpreter, adding code to: Using Internal File Ops.
+* gawk, interval expressions and: Regexp Operators.
+* gawk, line continuation in: Conditional Exp.
+* gawk, LINT variable in: User-modified.
+* gawk, list of contributors to: Contributors.
+* gawk, MS-DOS version of: PC Using.
+* gawk, newlines in: Statements/Lines.
+* gawk, next file statement in: Nextfile Statement.
+* gawk, nextfile statement in <1>: Nextfile Function.
+* gawk, nextfile statement in: Nextfile Statement.
+* gawk, octal numbers and: Nondecimal-numbers.
+* gawk, OS/2 version of: PC Using.
+* gawk, regexp constants and: Using Constant Regexps.
+* gawk, regular expressions, case sensitivity: Case-sensitivity.
+* gawk, regular expressions, operators: GNU Regexp Operators.
+* gawk, regular expressions, precedence: Regexp Operators.
+* gawk, See Also awk: Preface.
+* gawk, source code, obtaining: Getting.
+* gawk, splitting fields and: Constant Size.
+* gawk, string-translation functions: I18N Functions.
+* gawk, timestamps: Time Functions.
+* gawk, uses for: Preface.
+* gawk, versions of, information about, printing: Options.
+* gawk, word-boundary operator: GNU Regexp Operators.
+* General Public License (GPL): Glossary.
+* General Public License, See GPL: Manual History.
+* gensub function (gawk) <1>: String Functions.
+* gensub function (gawk): Using Constant Regexps.
+* gensub function (gawk), escape processing: Gory Details.
* get_argument internal function: Internals.
-* getgrent C library function: Group Functions.
+* getgrent function (C library): Group Functions.
* getgrent user-defined function: Group Functions.
+* getgrgid function (C library): Group Functions.
* getgrgid user-defined function: Group Functions.
+* getgrnam function (C library): Group Functions.
* getgrnam user-defined function: Group Functions.
-* getgruser user-defined function: Group Functions.
-* getline built-in function: Getline.
-* getline, return values: Getline.
-* getline, setting FILENAME: Getline Notes.
-* getopt C library function: Getopt Function.
+* getgruser function (C library): Group Functions.
+* getgruser function, user-defined: Group Functions.
+* getline command: Reading Files.
+* getline command, _gr_init user-defined function: Group Functions.
+* getline command, _pw_init function: Passwd Functions.
+* getline command, coprocesses, using from <1>: Close Files And Pipes.
+* getline command, coprocesses, using from: Getline/Coprocess.
+* getline command, deadlock and: Two-way I/O.
+* getline command, explicit input with: Getline.
+* getline command, FILENAME variable and: Getline Notes.
+* getline command, return values: Getline.
+* getline command, variants: Getline Summary.
+* getopt function (C library): Getopt Function.
* getopt user-defined function: Getopt Function.
-* getpwent C library function: Passwd Functions.
+* getpwent function (C library): Passwd Functions.
* getpwent user-defined function: Passwd Functions.
+* getpwnam function (C library): Passwd Functions.
* getpwnam user-defined function: Passwd Functions.
+* getpwuid function (C library): Passwd Functions.
* getpwuid user-defined function: Passwd Functions.
-* getservbyname C library function: TCP/IP Networking.
-* gettext C library function: Explaining gettext.
-* gettext, how it works: Explaining gettext.
+* getservbyname function (C library): TCP/IP Networking.
+* gettext function (C library): Explaining gettext.
+* gettext library: Explaining gettext.
+* gettext library, locale categories: Explaining gettext.
* gettimeofday user-defined function: Gettimeofday Function.
-* getting gawk: Getting.
* GNITS mailing list: Acknowledgments.
+* GNU awk, See gawk: Preface.
* GNU Free Documentation License: GNU Free Documentation License.
-* GNU General Public License <1>: Glossary.
-* GNU General Public License <2>: New Ports.
-* GNU General Public License <3>: Other Versions.
-* GNU General Public License: Manual History.
-* GNU Lesser General Public License <1>: Glossary.
-* GNU Lesser General Public License: Other Versions.
+* GNU General Public License: Glossary.
+* GNU Lesser General Public License: Glossary.
+* GNU long options <1>: Options.
+* GNU long options: Command Line.
+* GNU long options, printing list of: Options.
* GNU Project <1>: Glossary.
* GNU Project: Manual History.
* GNU/Linux <1>: Glossary.
-* GNU/Linux <2>: Using Internal File Ops.
-* GNU/Linux <3>: Internal File Ops.
-* GNU/Linux <4>: Dynamic Extensions.
-* GNU/Linux <5>: Atari Compiling.
-* GNU/Linux <6>: Additional Configuration Options.
-* GNU/Linux <7>: Installation.
-* GNU/Linux <8>: I18N Example.
+* GNU/Linux <2>: Atari Compiling.
+* GNU/Linux <3>: Additional Configuration Options.
+* GNU/Linux <4>: I18N Example.
* GNU/Linux: Manual History.
-* GPL <1>: Glossary.
-* GPL <2>: New Ports.
-* GPL <3>: Other Versions.
-* GPL: Manual History.
+* GPL (General Public License) <1>: Glossary.
+* GPL (General Public License): Manual History.
+* GPL (General Public License), printing: Options.
* grcat program: Group Functions.
* Grigera, Juan <1>: Bugs.
* Grigera, Juan: Contributors.
+* group database, reading: Group Functions.
* group file: Group Functions.
-* group information: Group Functions.
-* gsub built-in function: String Functions.
-* gsub, escape processing: Gory Details.
-* gsub, third argument of: String Functions.
+* groups, information about: Group Functions.
+* gsub function <1>: String Functions.
+* gsub function: Using Constant Regexps.
+* gsub function, arguments of: String Functions.
+* gsub function, escape processing: Gory Details.
* Hankerson, Darrel <1>: Bugs.
* Hankerson, Darrel <2>: Contributors.
* Hankerson, Darrel: Acknowledgments.
* Hartholz, Elaine: Acknowledgments.
* Hartholz, Marshall: Acknowledgments.
-* hexadecimal numbers: Non-decimal-numbers.
-* historical features <1>: String Functions.
-* historical features <2>: Continue Statement.
-* historical features <3>: Break Statement.
-* historical features: Command Line Field Separator.
-* history of awk: History.
+* Hasegawa, Isamu <1>: Contributors.
+* Hasegawa, Isamu: Acknowledgments.
+* hexadecimal numbers: Nondecimal-numbers.
+* hexadecimal, values, enabling interpretation of: Options.
* histsort.awk program: History Sorting.
-* how awk works: Two Rules.
* Hughes, Phil: Acknowledgments.
* HUP signal: Profiling.
-* I/O, binary: User-modified.
-* I/O, from BEGIN and END: I/O And BEGIN/END.
-* I/O, two-way: Two-way I/O.
+* hyphen (-), - operator: Precedence.
+* hyphen (-), -- (decrement/increment) operators: Precedence.
+* hyphen (-), -- operator: Increment Ops.
+* hyphen (-), -= operator <1>: Precedence.
+* hyphen (-), -= operator: Assignment Ops.
+* hyphen (-), filenames beginning with: Options.
+* hyphen (-), in character lists: Character Lists.
* id utility: Id Program.
* id.awk program: Id Program.
-* if-else statement: If Statement.
+* if statement <1>: If Statement.
+* if statement: Regexp Usage.
+* if statement, actions, changing: Ranges.
* igawk.sh program: Igawk Program.
-* IGNORECASE variable <1>: Array Sorting.
-* IGNORECASE variable <2>: Array Intro.
-* IGNORECASE variable <3>: User-modified.
+* IGNORECASE variable <1>: User-modified.
* IGNORECASE variable: Case-sensitivity.
-* IGNORECASE, and array sorting: Array Sorting.
-* IGNORECASE, and array subscripts: Array Intro.
-* ignoring case: Case-sensitivity.
-* implementation limits <1>: Redirection.
-* implementation limits: Getline Notes.
+* IGNORECASE variable, array sorting and: Array Sorting.
+* IGNORECASE variable, array subscripts and: Array Intro.
+* IGNORECASE variable, in example programs: Library Functions.
+* implementation issues, gawk: Notes.
+* implementation issues, gawk, debugging: Compatibility Mode.
+* implementation issues, gawk, limits <1>: Redirection.
+* implementation issues, gawk, limits: Getline Notes.
* in operator <1>: Id Program.
-* in operator <2>: Scanning an Array.
-* in operator <3>: For Statement.
-* in operator <4>: Precedence.
+* in operator <2>: For Statement.
+* in operator <3>: Precedence.
* in operator: Typing and Comparison.
+* in operator, arrays and <1>: Scanning an Array.
+* in operator, arrays and: Reference to Elements.
* increment operators: Increment Ops.
-* index built-in function: String Functions.
+* index function: String Functions.
+* indexing arrays: Array Intro.
* initialization, automatic: More Complex.
-* input: Reading Files.
-* input file, sample: Sample Data Files.
+* input files: Reading Files.
+* input files, closing: Close Files And Pipes.
+* input files, counting elements in: Wc Program.
+* input files, examples: Sample Data Files.
+* input files, reading: Reading Files.
+* input files, running awk without: Read Terminal.
* input files, skipping: Nextfile Function.
+* input files, variable assignments and: Other Arguments.
* input pipeline: Getline/Pipe.
* input redirection: Getline/File.
+* input, data, nondecimal: Nondecimal Data.
* input, explicit: Getline.
-* input, getline command: Getline.
-* input, multiple line records: Multiple Line.
+* input, files, See input files: Multiple Line.
+* input, multiline records: Multiple Line.
+* input, splitting into records: Records.
+* input, standard <1>: Special FD.
* input, standard: Read Terminal.
+* input/output, binary: User-modified.
+* input/output, from BEGIN and END: I/O And BEGIN/END.
+* input/output, two-way: Two-way I/O.
* insomnia, cure for: Alarm Program.
* installation, amiga: Amiga Installation.
* installation, atari: Atari Installation.
* installation, beos: BeOS Installation.
-* installation, pc operating systems: PC Installation.
* installation, tandem: Tandem Installation.
-* installation, unix: Quick Installation.
* installation, vms: VMS Installation.
-* int built-in function: Numeric Functions.
-* integer, definition of: Basic Data Typing.
-* integer, unsigned: Basic Data Typing.
-* interaction, awk and other programs: I/O Functions.
-* interactive buffering vs. non-interactive: I/O Functions.
-* internal function, assoc_clear: Internals.
-* internal function, assoc_lookup: Internals.
-* internal function, dupnode: Internals.
-* internal function, force_number: Internals.
-* internal function, force_string: Internals.
-* internal function, get_argument: Internals.
-* internal function, make_builtin: Internals.
-* internal function, make_number: Internals.
-* internal function, make_string: Internals.
-* internal function, set_value: Internals.
-* internal function, tmp_number: Internals.
-* internal function, tmp_string: Internals.
-* internal function, update_ERRNO: Internals.
-* internal macro, free_temp: Internals.
-* internal type, AWKNUM: Internals.
-* internal type, NODE: Internals.
-* internal variable, param_cnt: Internals.
-* internal variable, stlen: Internals.
-* internal variable, stptr: Internals.
-* internal variable, type: Internals.
-* internal variable, vname: Internals.
+* installing gawk: Installation.
+* int function: Numeric Functions.
+* INT signal (MS-DOS): Profiling.
+* integers: Basic Data Typing.
+* integers, unsigned: Basic Data Typing.
+* interacting with other programs: I/O Functions.
* internationalization <1>: I18N and L10N.
-* internationalization: User-modified.
-* internationalization features in gawk: Internationalization.
-* internationalization of awk programs, portability issues: I18N Portability.
-* internationalization, marked strings: Programmer i18n.
+* internationalization: I18N Functions.
+* internationalization, localization <1>: Internationalization.
+* internationalization, localization: User-modified.
+* internationalization, localization, character classes: Character Lists.
+* internationalization, localization, gawk and: Internationalization.
+* internationalization, localization, locale categories: Explaining gettext.
+* internationalization, localization, marked strings: Programmer i18n.
+* internationalization, localization, portability and: I18N Portability.
* internationalizing a program: Explaining gettext.
* interpreted programs <1>: Glossary.
* interpreted programs: Basic High Level.
* interval expressions: Regexp Operators.
* inventory-shipped file: Sample Data Files.
-* invocation of gawk: Command Line.
* ISO: Glossary.
-* ISO 8601: Time Functions.
-* ISO 8859-1 <1>: Glossary.
-* ISO 8859-1: Case-sensitivity.
-* ISO Latin-1 <1>: Glossary.
-* ISO Latin-1: Case-sensitivity.
+* ISO 8859-1: Glossary.
+* ISO Latin-1: Glossary.
* Jacobs, Andrew: Passwd Functions.
* Jaegermann, Michal <1>: Contributors.
* Jaegermann, Michal: Acknowledgments.
@@ -21260,371 +21764,505 @@ Index
* Kernighan, Brian <6>: Acknowledgments.
* Kernighan, Brian <7>: Conventions.
* Kernighan, Brian: History.
-* kill command: Profiling.
+* kill command, dynamic profiling: Profiling.
* Knights, jedi: Undocumented.
-* known bugs: Known Bugs.
* Kwok, Conrad: Contributors.
* labels.awk program: Labels Program.
-* language, awk: This Manual.
-* language, data-driven <1>: Basic High Level.
-* language, data-driven: Getting Started.
-* language, procedural: Getting Started.
+* languages, data-driven: Basic High Level.
* LC_ALL locale category: Explaining gettext.
* LC_COLLATE locale category: Explaining gettext.
* LC_CTYPE locale category: Explaining gettext.
* LC_MESSAGES locale category: Explaining gettext.
+* LC_MESSAGES locale category, bindtextdomain function (gawk): Programmer i18n.
* LC_MONETARY locale category: Explaining gettext.
* LC_NUMERIC locale category: Explaining gettext.
* LC_RESPONSE locale category: Explaining gettext.
* LC_TIME locale category: Explaining gettext.
+* left angle bracket (<), < operator <1>: Precedence.
+* left angle bracket (<), < operator: Typing and Comparison.
+* left angle bracket (<), < operator (I/O): Getline/File.
+* left angle bracket (<), <= operator <1>: Precedence.
+* left angle bracket (<), <= operator: Typing and Comparison.
* left shift, bitwise: Bitwise Functions.
-* leftmost longest match <1>: Multiple Line.
-* leftmost longest match: Leftmost Longest.
-* length built-in function: String Functions.
-* Lesser General Public License <1>: Glossary.
-* Lesser General Public License: Other Versions.
-* LGPL <1>: Glossary.
-* LGPL: Other Versions.
-* limitations <1>: Redirection.
-* limitations: Getline Notes.
-* line break: Statements/Lines.
-* line continuation <1>: Conditional Exp.
-* line continuation <2>: Boolean Ops.
-* line continuation <3>: Print Examples.
-* line continuation: Statements/Lines.
-* lint checks <1>: Options.
-* lint checks <2>: Command Line.
-* lint checks <3>: Function Caveats.
-* lint checks <4>: Uninitialized Subscripts.
-* lint checks <5>: Delete.
-* lint checks <6>: User-modified.
-* lint checks: Format Modifiers.
+* leftmost longest match: Multiple Line.
+* length function: String Functions.
+* Lesser General Public License (LGPL): Glossary.
+* LGPL (Lesser General Public License): Glossary.
+* libraries of awk functions: Library Functions.
+* libraries of awk functions, assertions: Assert Function.
+* libraries of awk functions, associative arrays and: Library Names.
+* libraries of awk functions, character values as numbers: Ordinal Functions.
+* libraries of awk functions, command-line options: Getopt Function.
+* libraries of awk functions, example program for using: Igawk Program.
+* libraries of awk functions, group database, reading: Group Functions.
+* libraries of awk functions, managing, data files: Data File Management.
+* libraries of awk functions, managing, time: Gettimeofday Function.
+* libraries of awk functions, merging arrays into strings: Join Function.
+* libraries of awk functions, nextfile statement: Nextfile Function.
+* libraries of awk functions, rounding numbers: Round Function.
+* libraries of awk functions, user database, reading: Passwd Functions.
+* line breaks: Statements/Lines.
+* line continuations: Boolean Ops.
+* line continuations, gawk: Conditional Exp.
+* line continuations, in print statement: Print Examples.
+* line continuations, with C shell: More Complex.
+* lines, blank, printing: Print.
+* lines, counting: Wc Program.
+* lines, duplicate, removing: History Sorting.
+* lines, matching ranges of: Ranges.
+* lines, skipping between markers: Ranges.
+* lint checking: User-modified.
+* lint checking, array elements: Delete.
+* lint checking, array subscripts: Uninitialized Subscripts.
+* lint checking, empty programs: Command Line.
+* lint checking, issuing warnings: Options.
+* lint checking, POSIXLY_CORRECT environment variable: Options.
+* lint checking, undefined functions: Function Caveats.
* LINT variable: User-modified.
* Linux <1>: Glossary.
-* Linux <2>: Using Internal File Ops.
-* Linux <3>: Internal File Ops.
-* Linux <4>: Dynamic Extensions.
-* Linux <5>: Atari Compiling.
-* Linux <6>: Additional Configuration Options.
-* Linux <7>: Installation.
-* Linux <8>: I18N Example.
+* Linux <2>: Atari Compiling.
+* Linux <3>: Additional Configuration Options.
+* Linux <4>: I18N Example.
* Linux: Manual History.
* locale categories: Explaining gettext.
-* locale, definition of: Time Functions.
* localization: I18N and L10N.
-* log built-in function: Numeric Functions.
-* logical false: Truth Values.
-* logical operators: Boolean Ops.
-* logical true: Truth Values.
+* localization, See internationalization, localization: I18N and L10N.
+* log files, timestamps in: Time Functions.
+* log function: Numeric Functions.
+* logical false/true: Truth Values.
+* logical operators, See Boolean expressions: Boolean Ops.
* login information: Passwd Functions.
* long options: Command Line.
-* loop: While Statement.
+* loops: While Statement.
+* loops, continue statements and: For Statement.
+* loops, count for header: Profiling.
* loops, exiting: Break Statement.
+* loops, See Also while statement: While Statement.
* Lost In Space: Dynamic Extensions.
* ls utility: More Complex.
-* lshift built-in function: Bitwise Functions.
-* lvalue: Assignment Ops.
+* lshift function (gawk): Bitwise Functions.
+* lvalues/rvalues: Assignment Ops.
+* mailing labels, printing: Labels Program.
+* mailing list, GNITS: Acknowledgments.
* make_builtin internal function: Internals.
* make_number internal function: Internals.
* make_string internal function: Internals.
* mark parity: Ordinal Functions.
* marked string extraction (internationalization): String Extraction.
-* marked strings for internationalization: Programmer i18n.
+* marked strings, extracting: String Extraction.
* Marx, Groucho: Increment Ops.
-* match built-in function: String Functions.
-* matching ranges of lines: Ranges.
-* matching, leftmost longest <1>: Multiple Line.
-* matching, leftmost longest: Leftmost Longest.
-* matching, the null string: Gory Details.
-* mawk, source code: Other Versions.
-* merging strings: Join Function.
-* message object files (gettext): Explaining gettext.
-* metacharacters: Regexp Operators.
-* mistakes, common <1>: Options.
-* mistakes, common <2>: String Functions.
-* mistakes, common <3>: Typing and Comparison.
-* mistakes, common <4>: Concatenation.
-* mistakes, common <5>: Arithmetic Ops.
-* mistakes, common <6>: Special FD.
-* mistakes, common <7>: Redirection.
-* mistakes, common <8>: Print Examples.
-* mistakes, common <9>: Field Separators.
-* mistakes, common <10>: Computed Regexps.
-* mistakes, common: Escape Sequences.
-* mktime built-in function: Time Functions.
-* modifiers (in format specifiers): Format Modifiers.
+* match function: String Functions.
+* match function, RSTART/RLENGTH variables: String Functions.
+* matching, expressions, See comparison expressions: Typing and Comparison.
+* matching, leftmost longest: Multiple Line.
+* matching, null strings: Gory Details.
+* mawk program: Other Versions.
+* memory, releasing: Internals.
+* memory, setting limits: Options.
+* message object files: Explaining gettext.
+* message object files, converting from portable object files: I18N Example.
+* message object files, specifying directory of <1>: Programmer i18n.
+* message object files, specifying directory of: Explaining gettext.
+* metacharacters, escape sequences for: Escape Sequences.
+* mktime function (gawk): Time Functions.
+* modifiers, in format specifiers: Format Modifiers.
+* monetary information, localization: Explaining gettext.
* msgfmt utility: I18N Example.
-* multidimensional subscripts: Multi-dimensional.
-* multiple line records: Multiple Line.
-* multiple passes over data: Other Arguments.
-* multiple statements on one line: Statements/Lines.
-* multiplication: Arithmetic Ops.
-* mv utility: Redirection.
-* names, use of <1>: Library Names.
-* names, use of <2>: Definition Syntax.
-* names, use of: Arrays.
-* namespace issues in awk <1>: Library Names.
-* namespace issues in awk <2>: Definition Syntax.
-* namespace issues in awk: Arrays.
+* names, arrays/variables <1>: Library Names.
+* names, arrays/variables: Arrays.
+* names, functions <1>: Library Names.
+* names, functions: Definition Syntax.
+* namespace issues <1>: Library Names.
+* namespace issues: Arrays.
+* namespace issues, functions: Definition Syntax.
+* nawk utility: Names.
* negative zero: Floating Point Issues.
-* NetBSD <1>: Glossary.
-* NetBSD: Manual History.
-* networking, TCP/IP: TCP/IP Networking.
-* new awk: History.
-* new awk vs. old awk: Names.
-* newline: Statements/Lines.
-* newlines, embedded in dynamic regexps: Computed Regexps.
-* next file statement <1>: POSIX/GNU.
-* next file statement: Nextfile Statement.
-* next statement: Next Statement.
-* next, inside a user-defined function: Next Statement.
+* NetBSD: Glossary.
+* networks, programming: TCP/IP Networking.
+* networks, support for: Special Network.
+* newlines <1>: Options.
+* newlines <2>: Boolean Ops.
+* newlines: Statements/Lines.
+* newlines, as field separators: Field Separators.
+* newlines, as record separators: Records.
+* newlines, in dynamic regexps: Computed Regexps.
+* newlines, in regexp constants: Computed Regexps.
+* newlines, printing: Print Examples.
+* newlines, separating statements in actions <1>: Statements.
+* newlines, separating statements in actions: Action Overview.
+* next file statement: POSIX/GNU.
+* next file statement, deprecated: Obsolete.
+* next file statement, in gawk: Nextfile Statement.
+* next statement <1>: Next Statement.
+* next statement: Boolean Ops.
+* next statement, BEGIN/END patterns and: I/O And BEGIN/END.
+* next statement, user-defined functions and: Next Statement.
* nextfile statement: Nextfile Statement.
+* nextfile statement, BEGIN/END patterns and: I/O And BEGIN/END.
+* nextfile statement, implementing: Nextfile Function.
+* nextfile statement, in gawk: Nextfile Statement.
+* nextfile statement, next file statement and: Obsolete.
+* nextfile statement, user-defined functions and: Nextfile Statement.
* nextfile user-defined function: Nextfile Function.
-* nextfile, inside a user-defined function: Nextfile Statement.
* NF variable <1>: Auto-set.
* NF variable: Fields.
+* NF variable, decrementing: Changing Fields.
* noassign.awk program: Ignoring Assigns.
* NODE internal type: Internals.
-* non-interactive buffering vs. interactive: I/O Functions.
-* non-readable data files, skipping: File Checking.
-* NOT logical operator: Boolean Ops.
+* nodes, duplicating: Internals.
+* not Boolean-logic operator: Boolean Ops.
* NR variable <1>: Auto-set.
* NR variable: Records.
-* null string <1>: Truth Values.
-* null string <2>: Conversion.
-* null string: Regexp Field Splitting.
-* null string, as array subscript: Uninitialized Subscripts.
-* null string, definition of: Basic Data Typing.
-* number of fields, NF: Fields.
-* number of records, NR, FNR: Records.
-* numbers, hexadecimal: Non-decimal-numbers.
-* numbers, octal: Non-decimal-numbers.
-* numbers, used as subscripts: Numeric Array Subscripts.
-* numeric character values: Ordinal Functions.
-* numeric constant: Scalar Constants.
-* numeric output format: OFMT.
-* numeric string: Typing and Comparison.
-* numeric value: Scalar Constants.
+* NR variable, changing: Auto-set.
+* null strings <1>: Basic Data Typing.
+* null strings <2>: Truth Values.
+* null strings <3>: Regexp Field Splitting.
+* null strings: Records.
+* null strings, array elements and: Delete.
+* null strings, as array subscripts: Uninitialized Subscripts.
+* null strings, converting numbers to strings: Conversion.
+* null strings, matching: Gory Details.
+* null strings, quoting and: Quoting.
+* number sign (#), #! (executable scripts): Executable Scripts.
+* number sign (#), #! (executable scripts), portability issues with: Executable Scripts.
+* number sign (#), commenting: Comments.
+* numbers: Internals.
+* numbers, as array subscripts: Numeric Array Subscripts.
+* numbers, as values of characters: Ordinal Functions.
+* numbers, Cliff random: Cliff Random Function.
+* numbers, converting: Conversion.
+* numbers, converting, to strings <1>: Bitwise Functions.
+* numbers, converting, to strings: User-modified.
+* numbers, floating-point: Basic Data Typing.
+* numbers, floating-point, AWKNUM internal type: Internals.
+* numbers, hexadecimal: Nondecimal-numbers.
+* numbers, NODE internal type: Internals.
+* numbers, octal: Nondecimal-numbers.
+* numbers, random: Numeric Functions.
+* numbers, rounding: Round Function.
+* numeric, constants: Scalar Constants.
+* numeric, output format: OFMT.
+* numeric, strings: Typing and Comparison.
+* numeric, values: Internals.
+* oawk utility: Names.
* obsolete features: Obsolete.
-* obsolete options: Obsolete.
-* octal numbers: Non-decimal-numbers.
+* octal numbers: Nondecimal-numbers.
+* octal values, enabling interpretation of: Options.
* OFMT variable <1>: User-modified.
* OFMT variable <2>: Conversion.
* OFMT variable: OFMT.
+* OFMT variable, POSIX awk and: OFMT.
* OFS variable <1>: User-modified.
-* OFS variable: Output Separators.
-* old awk: History.
-* old awk vs. new awk: Names.
-* one-liners: Very Simple.
-* online documentation: Manual History.
-* OpenBSD <1>: Glossary.
-* OpenBSD: Manual History.
-* operator precedence <1>: Precedence.
-* operator precedence: Increment Ops.
+* OFS variable <2>: Output Separators.
+* OFS variable: Changing Fields.
+* OpenBSD: Glossary.
+* operating systems, BSD-based <1>: Portal Files.
+* operating systems, BSD-based: Manual History.
+* operating systems, PC, gawk on: PC Using.
+* operating systems, PC, gawk on, installing: PC Installation.
+* operating systems, porting gawk to: New Ports.
+* operating systems, See Also GNU/Linux, PC operating systems, Unix: Installation.
+* operations, bitwise: Bitwise Functions.
* operators, arithmetic: Arithmetic Ops.
* operators, assignment: Assignment Ops.
-* operators, boolean: Boolean Ops.
-* operators, decrement: Increment Ops.
-* operators, increment: Increment Ops.
-* operators, logical: Boolean Ops.
-* operators, regexp matching: Regexp Usage.
-* operators, relational: Typing and Comparison.
+* operators, assignment, evaluation order: Assignment Ops.
+* operators, Boolean, See Boolean expressions: Boolean Ops.
+* operators, decrement/increment: Increment Ops.
+* operators, GNU-specific: GNU Regexp Operators.
+* operators, input/output <1>: Precedence.
+* operators, input/output <2>: Redirection.
+* operators, input/output <3>: Getline/Coprocess.
+* operators, input/output <4>: Getline/Pipe.
+* operators, input/output: Getline/File.
+* operators, logical, See Boolean expressions: Boolean Ops.
+* operators, precedence <1>: Precedence.
+* operators, precedence: Increment Ops.
+* operators, relational, See operators, comparison: Typing and Comparison.
* operators, short-circuit: Boolean Ops.
* operators, string: Concatenation.
* operators, string-matching: Regexp Usage.
-* options, command-line: Command Line.
+* operators, string-matching, for buffers: GNU Regexp Operators.
+* operators, word-boundary (gawk): GNU Regexp Operators.
+* options, command-line <1>: Options.
+* options, command-line <2>: Command Line Field Separator.
+* options, command-line: Long.
+* options, command-line, end of: Options.
+* options, command-line, invoking awk: Command Line.
+* options, command-line, processing: Getopt Function.
+* options, deprecated: Obsolete.
+* options, long <1>: Options.
* options, long: Command Line.
+* options, printing list of: Options.
* OR bitwise operation: Bitwise Functions.
-* or built-in function: Bitwise Functions.
-* OR logical operator: Boolean Ops.
+* or Boolean-logic operator: Boolean Ops.
+* or function (gawk): Bitwise Functions.
* ord user-defined function: Ordinal Functions.
-* order of evaluation: Calling Built-in.
* order of evaluation, concatenation: Concatenation.
* ORS variable <1>: User-modified.
* ORS variable: Output Separators.
-* other awk implementations: Other Versions.
-* output: Printing.
-* output field separator, OFS: Output Separators.
-* output format specifier, OFMT: OFMT.
-* output record separator, ORS: Output Separators.
+* output field separator, See OFS variable: Changing Fields.
+* output record separator, See ORS variable: Output Separators.
* output redirection: Redirection.
* output, buffering: I/O Functions.
+* output, duplicating into files: Tee Program.
+* output, files, closing: Close Files And Pipes.
+* output, format specifier, OFMT: OFMT.
* output, formatted: Printf.
-* output, piping: Redirection.
+* output, pipes: Redirection.
+* output, printing, See printing: Printing.
+* output, records: Output Separators.
+* output, standard: Special FD.
* P1003.2 POSIX standard: Glossary.
* param_cnt internal variable: Internals.
-* passes, multiple: Other Arguments.
+* parameters, number of: Internals.
+* parentheses (): Regexp Operators.
+* parentheses (), pgawk program: Profiling.
* password file: Passwd Functions.
-* path, search <1>: VMS Running.
-* path, search <2>: PC Using.
-* path, search <3>: Igawk Program.
-* path, search: AWKPATH Variable.
-* pattern, BEGIN: BEGIN/END.
-* pattern, default: Very Simple.
-* pattern, definition of: Patterns and Actions.
-* pattern, empty: Empty.
-* pattern, END: BEGIN/END.
-* pattern, range: Ranges.
-* pattern, regular expressions: Regexp.
+* patterns: Patterns and Actions.
+* patterns, comparison expressions as: Expression Patterns.
+* patterns, counts: Profiling.
+* patterns, default: Very Simple.
+* patterns, empty: Empty.
+* patterns, expressions as: Regexp Patterns.
+* patterns, ranges in: Ranges.
+* patterns, regexp constants as: Expression Patterns.
* patterns, types of: Pattern Overview.
-* per file initialization and cleanup: Filetrans Function.
+* PC operating systems, gawk on: PC Using.
+* PC operating systems, gawk on, installing: PC Installation.
+* percent sign (%), % operator: Precedence.
+* percent sign (%), %= operator <1>: Precedence.
+* percent sign (%), %= operator: Assignment Ops.
+* period (.): Regexp Operators.
* PERL: Future Extensions.
* Peters, Arno: Contributors.
* Peterson, Hal: Contributors.
* pgawk program: Profiling.
-* pipeline, input: Getline/Pipe.
-* pipes for output: Redirection.
-* piping commands into the shell: Redirection.
-* portability issues <1>: Library Functions.
-* portability issues <2>: I18N Portability.
-* portability issues <3>: Function Caveats.
-* portability issues <4>: Definition Syntax.
-* portability issues <5>: I/O Functions.
-* portability issues <6>: String Functions.
-* portability issues <7>: Delete.
-* portability issues <8>: Precedence.
-* portability issues <9>: Increment Ops.
-* portability issues <10>: Assignment Ops.
-* portability issues <11>: Arithmetic Ops.
-* portability issues <12>: Close Files And Pipes.
-* portability issues <13>: Changing Fields.
-* portability issues <14>: Records.
-* portability issues <15>: Escape Sequences.
-* portability issues <16>: Statements/Lines.
-* portability issues: Executable Scripts.
-* portability issues, internationalization of awk programs: I18N Portability.
-* portable object files (gettext): Explaining gettext.
+* pgawk program, awkprof.out file: Profiling.
+* pgawk program, dynamic profiling: Profiling.
+* pipes, closing: Close Files And Pipes.
+* pipes, input: Getline/Pipe.
+* pipes, output: Redirection.
+* plus sign (+): Regexp Operators.
+* plus sign (+), + operator: Precedence.
+* plus sign (+), ++ operator <1>: Precedence.
+* plus sign (+), ++ operator: Increment Ops.
+* plus sign (+), += operator <1>: Precedence.
+* plus sign (+), += operator: Assignment Ops.
+* plus sign (+), decrement/increment operators: Increment Ops.
+* portability: Escape Sequences.
+* portability, #! (executable scripts): Executable Scripts.
+* portability, ** operator and: Arithmetic Ops.
+* portability, **= operator and: Assignment Ops.
+* portability, ARGV variable: Executable Scripts.
+* portability, backslash continuation and: Statements/Lines.
+* portability, backslash in escape sequences: Escape Sequences.
+* portability, close function and: Close Files And Pipes.
+* portability, data files as single record: Records.
+* portability, deleting array elements: Delete.
+* portability, example programs: Library Functions.
+* portability, fflush function and: I/O Functions.
+* portability, functions, defining: Definition Syntax.
+* portability, gawk: New Ports.
+* portability, gettext library and: Explaining gettext.
+* portability, internationalization and: I18N Portability.
+* portability, length function: String Functions.
+* portability, new awk vs. old awk: Conversion.
+* portability, next statement in user-defined functions: Function Caveats.
+* portability, NF variable, decrementing: Changing Fields.
+* portability, operators: Increment Ops.
+* portability, operators, not in POSIX awk: Precedence.
+* portability, POSIXLY_CORRECT environment variable: Options.
+* portability, substr function: String Functions.
+* portable object files <1>: Translator i18n.
+* portable object files: Explaining gettext.
+* portable object files, converting to message object files: I18N Example.
+* portable object files, generating: Options.
* portal files: Portal Files.
* porting gawk: New Ports.
-* positional specifier, printf <1>: Printf Ordering.
-* positional specifier, printf: Format Modifiers.
-* positional specifiers, mixing with regular formats (printf): Printf Ordering.
+* positional specifiers, printf statement <1>: Printf Ordering.
+* positional specifiers, printf statement: Format Modifiers.
+* positional specifiers, printf statement, mixing with regular formats: Printf Ordering.
* positive zero: Floating Point Issues.
-* POSIX awk <1>: Definition Syntax.
-* POSIX awk <2>: Gory Details.
-* POSIX awk <3>: String Functions.
-* POSIX awk <4>: User-modified.
-* POSIX awk <5>: Next Statement.
-* POSIX awk <6>: Continue Statement.
-* POSIX awk <7>: Break Statement.
-* POSIX awk <8>: Precedence.
-* POSIX awk <9>: Assignment Ops.
-* POSIX awk <10>: Arithmetic Ops.
-* POSIX awk <11>: Conversion.
-* POSIX awk <12>: Format Modifiers.
-* POSIX awk <13>: OFMT.
-* POSIX awk <14>: Field Splitting Summary.
-* POSIX awk <15>: Character Lists.
-* POSIX awk <16>: Regexp Operators.
-* POSIX awk: Escape Sequences.
+* POSIX awk <1>: Assignment Ops.
+* POSIX awk: This Manual.
+* POSIX awk, **= operator and: Assignment Ops.
+* POSIX awk, < operator and: Getline/File.
+* POSIX awk, arithmetic operators and: Arithmetic Ops.
+* POSIX awk, backslashes in string constants: Escape Sequences.
+* POSIX awk, BEGIN/END patterns: I/O And BEGIN/END.
+* POSIX awk, break statement and: Break Statement.
+* POSIX awk, changes in awk versions: POSIX.
+* POSIX awk, character lists and: Character Lists.
+* POSIX awk, character lists and, character classes: Character Lists.
+* POSIX awk, continue statement and: Continue Statement.
+* POSIX awk, CONVFMT variable and: User-modified.
+* POSIX awk, date utility and: Time Functions.
+* POSIX awk, field separators and <1>: Field Splitting Summary.
+* POSIX awk, field separators and: Fields.
+* POSIX awk, FS variable and: User-modified.
+* POSIX awk, function keyword in: Definition Syntax.
+* POSIX awk, functions and, gsub/sub: Gory Details.
+* POSIX awk, functions and, length: String Functions.
+* POSIX awk, GNU long options and: Options.
+* POSIX awk, interval expressions in: Regexp Operators.
+* POSIX awk, next/nextfile statements and: Next Statement.
+* POSIX awk, numeric strings and: Typing and Comparison.
+* POSIX awk, OFMT variable and <1>: Conversion.
+* POSIX awk, OFMT variable and: OFMT.
+* POSIX awk, period (.), using: Regexp Operators.
+* POSIX awk, pipes, closing: Close Files And Pipes.
+* POSIX awk, printf format strings and: Format Modifiers.
+* POSIX awk, regular expressions and: Regexp Operators.
+* POSIX awk, timestamps and: Time Functions.
+* POSIX awk, | I/O operator and: Getline/Pipe.
* POSIX mode: Options.
+* POSIX, awk and: Preface.
+* POSIX, gawk extensions not included in: POSIX/GNU.
+* POSIX, programs, implementing in awk: Clones.
* POSIXLY_CORRECT environment variable: Options.
* precedence <1>: Precedence.
* precedence: Increment Ops.
* precedence, regexp operators: Regexp Operators.
-* print statement: Print.
-* printf statement: Printf.
+* print statement: Printing.
+* print statement, BEGIN/END patterns and: I/O And BEGIN/END.
+* print statement, commas, omitting: Print Examples.
+* print statement, I/O operators in: Precedence.
+* print statement, line continuations and: Print Examples.
+* print statement, OFMT variable and: User-modified.
+* print statement, See Also redirection, of output: Redirection.
+* print statement, sprintf function and: Round Function.
+* printf statement <1>: Printf.
+* printf statement: Printing.
+* printf statement, columns, aligning: Print Examples.
+* printf statement, format-control characters: Control Letters.
+* printf statement, I/O operators in: Precedence.
+* printf statement, modifiers: Format Modifiers.
+* printf statement, positional specifiers <1>: Printf Ordering.
+* printf statement, positional specifiers: Format Modifiers.
+* printf statement, positional specifiers, mixing with regular formats: Printf Ordering.
+* printf statement, See Also redirection, of output: Redirection.
+* printf statement, sprintf function and: Round Function.
* printf statement, syntax of: Basic Printf.
-* printf, format-control characters: Control Letters.
-* printf, mixing positional specifiers with regular formats: Printf Ordering.
-* printf, modifiers: Format Modifiers.
-* printf, positional specifier <1>: Printf Ordering.
-* printf, positional specifier: Format Modifiers.
* printing: Printing.
-* problem reports: Bugs.
-* procedural languages: Getting Started.
-* process information: Special Process.
-* processing arguments: Getopt Function.
+* printing, list of options: Options.
+* printing, mailing labels: Labels Program.
+* printing, unduplicated lines of text: Uniq Program.
+* printing, user information: Id Program.
+* private variables: Library Names.
+* process information, files for: Special Process.
+* processes, two-way communications with: Two-way I/O.
* processing data: Basic High Level.
-* PROCINFO variable: Auto-set.
+* PROCINFO array <1>: Group Functions.
+* PROCINFO array <2>: Passwd Functions.
+* PROCINFO array <3>: Auto-set.
+* PROCINFO array: Special Caveats.
* profiling awk programs: Profiling.
-* profiling output file (awkprof.out): Profiling.
-* profiling, dynamic: Profiling.
-* program file: Long.
-* program, awk: This Manual.
+* profiling awk programs, dynamically: Profiling.
+* profiling gawk, See pgawk program: Profiling.
* program, definition of: Getting Started.
-* program, self-contained: Executable Scripts.
-* programming concepts, basic: Basic Concepts.
-* programming conventions <1>: Internal File Ops.
-* programming conventions <2>: Nextfile Function.
-* programming conventions <3>: Library Names.
-* programming conventions <4>: Non-decimal Data.
-* programming conventions <5>: Return Statement.
-* programming conventions <6>: Definition Syntax.
-* programming conventions <7>: Calling Built-in.
-* programming conventions <8>: Auto-set.
-* programming conventions: Exit Statement.
+* programmers, attractiveness of: Two-way I/O.
+* programming conventions, --non-decimal-data option: Nondecimal Data.
+* programming conventions, ARGC/ARGV variables: Auto-set.
+* programming conventions, exit statement: Exit Statement.
+* programming conventions, function parameters: Return Statement.
+* programming conventions, functions, calling: Calling Built-in.
+* programming conventions, functions, writing: Definition Syntax.
+* programming conventions, gawk internals: Internal File Ops.
+* programming conventions, nextfile statement: Nextfile Function.
+* programming conventions, private variable names: Library Names.
* programming language, recipe for: History.
+* programming languages, data-driven vs. procedural: Getting Started.
* programming, basic steps: Basic High Level.
-* programs, compiled: Basic High Level.
-* programs, documenting <1>: Library Names.
-* programs, documenting: Comments.
-* programs, interpreted: Basic High Level.
+* programming, concepts: Basic Concepts.
* pwcat program: Passwd Functions.
-* quotient: Arithmetic Ops.
-* quoting rules, shell: Quoting.
-* quoting, shell <1>: Comments.
-* quoting, shell <2>: Long.
-* quoting, shell: Read Terminal.
+* question mark (?) <1>: GNU Regexp Operators.
+* question mark (?): Regexp Operators.
+* question mark (?), ?: operator: Precedence.
+* QUIT signal (MS-DOS): Profiling.
+* quoting <1>: Comments.
+* quoting <2>: Long.
+* quoting: Read Terminal.
+* quoting, rules for: Quoting.
+* quoting, tricks for: Quoting.
* Rakitzis, Byron: History Sorting.
-* rand built-in function: Numeric Functions.
+* rand function: Numeric Functions.
* random numbers, Cliff: Cliff Random Function.
+* random numbers, rand/srand functions: Numeric Functions.
* random numbers, seed of: Numeric Functions.
-* range pattern: Ranges.
+* range expressions: Character Lists.
+* range patterns: Ranges.
* Rankin, Pat <1>: Bugs.
* Rankin, Pat <2>: Contributors.
* Rankin, Pat <3>: Assignment Ops.
* Rankin, Pat: Acknowledgments.
+* raw sockets: TCP/IP Networking.
* readable data files, checking: File Checking.
* readable.awk program: File Checking.
-* reading files: Reading Files.
-* reading files, getline command: Getline.
-* reading files, multiple line records: Multiple Line.
* recipe for a programming language: History.
-* record separator, RS: Records.
-* record terminator, RT: Records.
-* record, definition of <1>: Basic High Level.
-* record, definition of: Records.
-* records, multiple line: Multiple Line.
-* recursive function: Definition Syntax.
+* record separators <1>: User-modified.
+* record separators: Records.
+* record separators, changing: Records.
+* record separators, regular expressions as: Records.
+* record separators, with multiline records: Multiple Line.
+* records <1>: Basic High Level.
+* records: Reading Files.
+* records, multiline: Multiple Line.
+* records, printing: Print.
+* records, splitting input into: Records.
+* records, terminating: Records.
+* records, treating files as: Records.
+* recursive functions: Definition Syntax.
* redirection of input: Getline/File.
* redirection of output: Redirection.
-* reference counting: Array Sorting.
-* reference to array: Reference to Elements.
-* regexp: Regexp.
-* regexp as expression: Typing and Comparison.
-* regexp comparison vs. string comparison: Typing and Comparison.
-* regexp constant: Regexp Usage.
-* regexp constants, difference between slashes and quotes: Computed Regexps.
-* regexp operators <1>: Typing and Comparison.
-* regexp operators <2>: Regexp Operators.
-* regexp operators: Regexp Usage.
-* regexp operators, GNU specific: GNU Regexp Operators.
-* regexp operators, precedence of: Regexp Operators.
-* regexp, anchors: Regexp Operators.
-* regexp, dynamic: Computed Regexps.
-* regexp, dynamic, with embedded newlines: Computed Regexps.
-* regexp, effect of command-line options: GNU Regexp Operators.
-* regular expression: Regexp.
-* regular expression metacharacters: Regexp Operators.
+* reference counting, sorting arrays: Array Sorting.
+* regexp constants <1>: Typing and Comparison.
+* regexp constants <2>: Regexp Constants.
+* regexp constants: Regexp Usage.
+* regexp constants, /=.../, /= operator and: Assignment Ops.
+* regexp constants, as patterns: Expression Patterns.
+* regexp constants, in gawk: Using Constant Regexps.
+* regexp constants, slashes vs. quotes: Computed Regexps.
+* regexp constants, vs. string constants: Computed Regexps.
+* regexp, See regular expressions: Regexp.
+* regular expressions: Regexp.
* regular expressions as field separators: Field Separators.
-* regular expressions as patterns: Regexp.
-* regular expressions as record separators: Records.
+* regular expressions, anchors in: Regexp Operators.
+* regular expressions, as field separators: Regexp Field Splitting.
+* regular expressions, as patterns <1>: Regexp Patterns.
+* regular expressions, as patterns: Regexp Usage.
+* regular expressions, as record separators: Records.
+* regular expressions, case sensitivity <1>: User-modified.
+* regular expressions, case sensitivity: Case-sensitivity.
* regular expressions, computed: Computed Regexps.
-* relational operators: Typing and Comparison.
-* remainder: Arithmetic Ops.
-* removing elements of arrays: Delete.
-* reporting bugs: Bugs.
-* reporting problems: Bugs.
-* return statement: Return Statement.
-* return value from close: Close Files And Pipes.
+* regular expressions, constants, See regexp constants: Regexp Usage.
+* regular expressions, dynamic: Computed Regexps.
+* regular expressions, dynamic, with embedded newlines: Computed Regexps.
+* regular expressions, gawk, command-line options: GNU Regexp Operators.
+* regular expressions, interval expressions and: Options.
+* regular expressions, leftmost longest match: Leftmost Longest.
+* regular expressions, operators <1>: Regexp Operators.
+* regular expressions, operators: Regexp Usage.
+* regular expressions, operators, for buffers: GNU Regexp Operators.
+* regular expressions, operators, for words: GNU Regexp Operators.
+* regular expressions, operators, gawk: GNU Regexp Operators.
+* regular expressions, operators, precedence of: Regexp Operators.
+* regular expressions, searching for: Egrep Program.
+* relational operators, See comparison operators: Typing and Comparison.
+* return statement, user-defined functions: Return Statement.
+* return values, close function: Close Files And Pipes.
+* rev user-defined function: Function Example.
* rewind user-defined function: Rewind Function.
-* RFC 1036: Time Functions.
-* RFC 822: Time Functions.
+* right angle bracket (>), > operator <1>: Precedence.
+* right angle bracket (>), > operator: Typing and Comparison.
+* right angle bracket (>), > operator (I/O): Redirection.
+* right angle bracket (>), >= operator <1>: Precedence.
+* right angle bracket (>), >= operator: Typing and Comparison.
+* right angle bracket (>), >> operator (I/O) <1>: Precedence.
+* right angle bracket (>), >> operator (I/O): Redirection.
* right shift, bitwise: Bitwise Functions.
* Ritchie, Dennis: Basic Data Typing.
-* RLENGTH variable <1>: String Functions.
* RLENGTH variable: Auto-set.
+* RLENGTH variable, match function and: String Functions.
* Robbins, Arnold <1>: Future Extensions.
* Robbins, Arnold <2>: Bugs.
* Robbins, Arnold <3>: Contributors.
@@ -21640,573 +22278,683 @@ Index
* Robbins, Miriam: Acknowledgments.
* Robinson, Will: Dynamic Extensions.
* robot, the: Dynamic Extensions.
-* Rommel, Kai Uwe <1>: Bugs.
-* Rommel, Kai Uwe <2>: Contributors.
+* Rommel, Kai Uwe <1>: Contributors.
* Rommel, Kai Uwe: Acknowledgments.
* round user-defined function: Round Function.
* rounding: Round Function.
+* rounding numbers: Round Function.
* RS variable <1>: User-modified.
* RS variable: Records.
-* rshift built-in function: Bitwise Functions.
-* RSTART variable <1>: String Functions.
+* RS variable, multiline records and: Multiple Line.
+* rshift function (gawk): Bitwise Functions.
* RSTART variable: Auto-set.
+* RSTART variable, match function and: String Functions.
* RT variable <1>: Auto-set.
* RT variable <2>: Multiple Line.
* RT variable: Records.
* Rubin, Paul <1>: Contributors.
* Rubin, Paul: History.
* rule, definition of: Getting Started.
-* running awk programs: Running gawk.
-* running long programs: Long.
-* rvalue: Assignment Ops.
-* sample input files: Sample Data Files.
-* scalar, definition of: Basic Data Typing.
-* scanning an array: Scanning an Array.
+* rvalues/lvalues: Assignment Ops.
+* scalar values: Basic Data Typing.
* Schreiber, Bert: Acknowledgments.
* Schreiber, Rita: Acknowledgments.
-* script, definition of: Getting Started.
-* scripts, executable: Executable Scripts.
-* search path <1>: VMS Running.
-* search path <2>: PC Using.
-* search path <3>: Igawk Program.
-* search path: AWKPATH Variable.
-* search path, for source files <1>: VMS Running.
-* search path, for source files <2>: PC Using.
-* search path, for source files <3>: Igawk Program.
-* search path, for source files: AWKPATH Variable.
+* search paths <1>: VMS Running.
+* search paths: PC Using.
+* search paths, for source files <1>: VMS Running.
+* search paths, for source files <2>: Igawk Program.
+* search paths, for source files: AWKPATH Variable.
+* searching: String Functions.
+* searching, files for regular expressions: Egrep Program.
+* searching, for words: Dupword Program.
* sed utility <1>: Glossary.
* sed utility <2>: Igawk Program.
* sed utility <3>: Simple Sed.
* sed utility: Field Splitting Summary.
-* seed for random numbers: Numeric Functions.
-* self-contained programs: Executable Scripts.
+* semicolon (;): Statements/Lines.
+* semicolon (;), AWKPATH variable and: PC Using.
+* semicolon (;), separating statements in actions <1>: Statements.
+* semicolon (;), separating statements in actions: Action Overview.
+* separators, field: User-modified.
+* separators, field, FIELDWIDTHS variable and: User-modified.
+* separators, field, POSIX and: Fields.
+* separators, for records: Records.
+* separators, for records, regular expressions as: Records.
+* separators, for statements in actions: Action Overview.
+* separators, record: User-modified.
+* separators, subscript: User-modified.
* set_value internal function: Internals.
-* sex, comparisons with <1>: Manual History.
-* sex, comparisons with: This Manual.
-* sex, programmer attractiveness: Two-way I/O.
-* shell and awk interaction: Using Shell Variables.
-* shell quoting <1>: Comments.
-* shell quoting <2>: Long.
-* shell quoting: Read Terminal.
-* shell quoting rules: Quoting.
-* shell quoting, tricks: Quoting.
-* shell varibles, using in awk programs: Using Shell Variables.
-* shell, piping commands into: Redirection.
+* shells, piping commands into: Redirection.
+* shells, quoting: Using Shell Variables.
+* shells, quoting, rules for: Quoting.
+* shells, scripts: One-shot.
+* shells, variables: Using Shell Variables.
* shift, bitwise: Bitwise Functions.
* short-circuit operators: Boolean Ops.
-* side effects <1>: Array Sorting.
-* side effects <2>: Reference to Elements.
-* side effects <3>: Action Overview.
-* side effects <4>: Function Calls.
-* side effects <5>: Conditional Exp.
-* side effects <6>: Boolean Ops.
-* side effects <7>: Increment Ops.
-* side effects <8>: Assignment Ops.
-* side effects <9>: Concatenation.
-* side effects: Getline Notes.
-* SIGHUP signal: Profiling.
-* signals, SIGHUP: Profiling.
-* signals, SIGUSR1: Profiling.
-* SIGUSR1 signal: Profiling.
-* simple stream editor: Simple Sed.
-* sin built-in function: Numeric Functions.
-* single quotes, why needed: One-shot.
+* side effects <1>: Increment Ops.
+* side effects: Concatenation.
+* side effects, array indexing: Reference to Elements.
+* side effects, asort function: Array Sorting.
+* side effects, assignment expressions: Assignment Ops.
+* side effects, Boolean operators: Boolean Ops.
+* side effects, conditional expressions: Conditional Exp.
+* side effects, decrement/increment operators: Increment Ops.
+* side effects, FILENAME variable: Getline Notes.
+* side effects, function calls: Function Calls.
+* side effects, statements: Action Overview.
+* signals, HUP/SIGHUP: Profiling.
+* signals, INT/SIGINT (MS-DOS): Profiling.
+* signals, QUIT/SIGQUIT (MS-DOS): Profiling.
+* signals, USR1/SIGUSR1: Profiling.
+* sin function: Numeric Functions.
+* single quote (') <1>: Quoting.
+* single quote (') <2>: Long.
+* single quote ('): One-shot.
+* single quote ('), vs. apostrophe: Comments.
+* single quote ('), with double quotes: Quoting.
* single-character fields: Single Character Fields.
-* single-precision floating-point, definition of: Basic Data Typing.
-* skipping input files: Nextfile Function.
-* skipping lines between markers: Ranges.
+* single-precision floating-point: Basic Data Typing.
* Skywalker, Luke: Undocumented.
* sleep utility: Alarm Program.
+* sockets: TCP/IP Networking.
+* sort function, arrays, sorting: Array Sorting.
* sort utility: Word Sorting.
+* sort utility, coprocesses and: Two-way I/O.
+* sorting characters in different languages: Explaining gettext.
* source code, awka: Other Versions.
-* source code, gawk: Getting.
+* source code, Bell Laboratories awk: Other Versions.
+* source code, gawk: Gawk Distribution.
* source code, mawk: Other Versions.
-* source code, Unix awk: Other Versions.
+* source code, mixing: Options.
+* source files, search path for: Igawk Program.
* sparse arrays: Array Intro.
* Spencer, Henry: Glossary.
-* split built-in function: String Functions.
+* split function: String Functions.
+* split function, array elements, deleting: Delete.
* split utility: Split Program.
* split.awk program: Split Program.
-* sprintf built-in function: String Functions.
-* sqrt built-in function: Numeric Functions.
-* srand built-in function: Numeric Functions.
+* sprintf function <1>: String Functions.
+* sprintf function: OFMT.
+* sprintf function, OFMT variable and: User-modified.
+* sprintf function, print/printf statements and: Round Function.
+* sqrt function: Numeric Functions.
+* square brackets ([]): Regexp Operators.
+* srand function: Numeric Functions.
* Stallman, Richard <1>: Glossary.
* Stallman, Richard <2>: Contributors.
* Stallman, Richard <3>: Acknowledgments.
* Stallman, Richard: Manual History.
-* standard error output: Special FD.
* standard input <1>: Special FD.
-* standard input <2>: Reading Files.
* standard input: Read Terminal.
* standard output: Special FD.
-* statement, compound: Statements.
+* stat function, implementing in gawk: Sample Library.
+* statements, compound, control statements and: Statements.
+* statements, control, in actions: Statements.
+* statements, multiple: Statements/Lines.
* stlen internal variable: Internals.
* stptr internal variable: Internals.
-* stream editor <1>: Igawk Program.
-* stream editor <2>: Simple Sed.
-* stream editor: Field Splitting Summary.
-* stream editor, simple: Simple Sed.
-* strftime built-in function: Time Functions.
-* string comparison vs. regexp comparison: Typing and Comparison.
+* stream editors <1>: Igawk Program.
+* stream editors <2>: Simple Sed.
+* stream editors: Field Splitting Summary.
+* strftime function (gawk): Time Functions.
* string constants: Scalar Constants.
+* string constants, vs. regexp constants: Computed Regexps.
* string extraction (internationalization): String Extraction.
* string operators: Concatenation.
* string-matching operators: Regexp Usage.
-* strtonum built-in function: String Functions.
-* sub built-in function: String Functions.
-* sub, escape processing: Gory Details.
-* sub, third argument of: String Functions.
-* subscripts in arrays: Multi-dimensional.
-* SUBSEP variable <1>: Multi-dimensional.
+* strings: Internals.
+* strings, converting: Conversion.
+* strings, converting, numbers to <1>: Bitwise Functions.
+* strings, converting, numbers to: User-modified.
+* strings, empty, See null strings: Records.
+* strings, extracting: String Extraction.
+* strings, for localization: Programmer i18n.
+* strings, length of: Scalar Constants.
+* strings, merging arrays into: Join Function.
+* strings, NODE internal type: Internals.
+* strings, null: Regexp Field Splitting.
+* strings, numeric: Typing and Comparison.
+* strings, splitting: String Functions.
+* strtonum function (gawk): String Functions.
+* strtonum function (gawk), --non-decimal-data option and: Nondecimal Data.
+* sub function <1>: String Functions.
+* sub function: Using Constant Regexps.
+* sub function, arguments of: String Functions.
+* sub function, escape processing: Gory Details.
+* subscript separators: User-modified.
+* subscripts in arrays, multidimensional: Multi-dimensional.
+* subscripts in arrays, multidimensional, scanning: Multi-scanning.
+* subscripts in arrays, numbers as: Numeric Array Subscripts.
+* subscripts in arrays, uninitialized variables as: Uninitialized Subscripts.
* SUBSEP variable: User-modified.
-* substr built-in function: String Functions.
-* subtraction: Arithmetic Ops.
+* SUBSEP variable, multidimensional arrays: Multi-dimensional.
+* substr function: String Functions.
* Sumner, Andrew: Other Versions.
* syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops.
-* system built-in function: I/O Functions.
-* systime built-in function: Time Functions.
+* system function: I/O Functions.
+* systime function (gawk): Time Functions.
* tandem: Tandem Installation.
* Tcl: Library Names.
-* TCP/IP networking <1>: Portal Files.
-* TCP/IP networking: TCP/IP Networking.
+* TCP/IP: TCP/IP Networking.
+* TCP/IP, support for: Special Network.
* tee utility: Tee Program.
* tee.awk program: Tee Program.
-* terminator, record: Records.
+* terminating records: Records.
* testbits.awk program: Bitwise Functions.
* Texinfo <1>: Adding Code.
* Texinfo <2>: Distribution contents.
* Texinfo <3>: Extract Program.
* Texinfo <4>: Dupword Program.
* Texinfo <5>: Library Functions.
-* Texinfo <6>: Regexp Operators.
-* Texinfo <7>: Sample Data Files.
-* Texinfo <8>: Acknowledgments.
+* Texinfo <6>: Sample Data Files.
* Texinfo: Conventions.
-* textdomain C library function: Explaining gettext.
+* Texinfo, chapter beginnings in files: Regexp Operators.
+* Texinfo, extracting programs from source files: Extract Program.
+* text, printing: Print.
+* text, printing, unduplicated lines of: Uniq Program.
+* textdomain function (C library): Explaining gettext.
* TEXTDOMAIN variable <1>: Programmer i18n.
* TEXTDOMAIN variable: User-modified.
-* time of day: Time Functions.
+* TEXTDOMAIN variable, BEGIN pattern and: Programmer i18n.
+* TEXTDOMAIN variable, portability and: I18N Portability.
+* tilde (~), ~ operator <1>: Expression Patterns.
+* tilde (~), ~ operator <2>: Precedence.
+* tilde (~), ~ operator <3>: Typing and Comparison.
+* tilde (~), ~ operator <4>: Regexp Constants.
+* tilde (~), ~ operator <5>: Computed Regexps.
+* tilde (~), ~ operator <6>: Case-sensitivity.
+* tilde (~), ~ operator: Regexp Usage.
+* time, alarm clock example program: Alarm Program.
+* time, localization and: Explaining gettext.
+* time, managing: Gettimeofday Function.
+* time, retrieving: Time Functions.
* timestamps: Time Functions.
-* timestamps, converting from dates: Time Functions.
+* timestamps, converting dates to: Time Functions.
* timestamps, formatted: Gettimeofday Function.
* tmp_number internal function: Internals.
* tmp_string internal function: Internals.
-* tolower built-in function: String Functions.
-* Torvalds, Linus: Manual History.
-* toupper built-in function: String Functions.
+* tolower function: String Functions.
+* toupper function: String Functions.
* tr utility: Translate Program.
* translate.awk program: Translate Program.
+* troubleshooting, --non-decimal-data option: Options.
+* troubleshooting, -F option: Known Bugs.
+* troubleshooting, == operator: Typing and Comparison.
+* troubleshooting, awk uses FS not IFS: Field Separators.
+* troubleshooting, backslash before nonspecial character: Escape Sequences.
+* troubleshooting, division: Arithmetic Ops.
+* troubleshooting, fatal errors, field widths, specifying: Constant Size.
+* troubleshooting, fatal errors, printf format strings: Format Modifiers.
+* troubleshooting, fflush function: I/O Functions.
+* troubleshooting, function call syntax: Function Calls.
+* troubleshooting, gawk <1>: Compatibility Mode.
+* troubleshooting, gawk: Known Bugs.
+* troubleshooting, gawk, bug reports: Bugs.
+* troubleshooting, gawk, fatal errors, function arguments: Calling Built-in.
+* troubleshooting, getline function: File Checking.
+* troubleshooting, gsub/sub functions: String Functions.
+* troubleshooting, match function: String Functions.
+* troubleshooting, print statement, omitting commas: Print Examples.
+* troubleshooting, printing: Redirection.
+* troubleshooting, quotes with file names: Special FD.
+* troubleshooting, readable data files: File Checking.
+* troubleshooting, regexp constants vs. string constants: Computed Regexps.
+* troubleshooting, string concatenation: Concatenation.
+* troubleshooting, substr function: String Functions.
+* troubleshooting, system function: I/O Functions.
+* troubleshooting, typographical errors, global variables: Options.
+* true, logical: Truth Values.
* Trueman, David <1>: Contributors.
* Trueman, David <2>: Acknowledgments.
* Trueman, David: History.
+* trunc-mod operation: Arithmetic Ops.
* truth values: Truth Values.
-* two-way I/O: Two-way I/O.
* type conversion: Conversion.
* type internal variable: Internals.
-* types of variables <1>: Typing and Comparison.
-* types of variables: Assignment Ops.
* undefined functions: Function Caveats.
+* underscore (_), _ C macro: Explaining gettext.
+* underscore (_), in names of private variables: Library Names.
+* underscore (_), translatable string: Programmer i18n.
* undocumented features: Undocumented.
* uninitialized variables, as array subscripts: Uninitialized Subscripts.
* uniq utility: Uniq Program.
* uniq.awk program: Uniq Program.
* Unix: Glossary.
-* Unix awk, source code: Other Versions.
+* Unix awk, backslashes in escape sequences: Escape Sequences.
+* Unix awk, close function and: Close Files And Pipes.
+* Unix awk, password files, field separators and: Command Line Field Separator.
+* Unix, awk scripts and: Executable Scripts.
* unsigned integers: Basic Data Typing.
* update_ERRNO internal function: Internals.
-* use of comments: Comments.
-* user information: Passwd Functions.
-* user-defined functions: User-defined.
-* user-defined variables: Using Variables.
-* uses of awk <1>: When.
-* uses of awk: Preface.
-* uses of gawk: Preface.
-* using shell variables in awk programs: Using Shell Variables.
-* using this book: This Manual.
+* user database, reading: Passwd Functions.
+* user-defined, functions: User-defined.
+* user-defined, functions, counts: Profiling.
+* user-defined, variables: Variables.
+* user-modifiable variables: User-modified.
+* users, information about, printing: Id Program.
+* users, information about, retrieving: Passwd Functions.
* USR1 signal: Profiling.
-* values of characters as numbers: Ordinal Functions.
* values, numeric: Basic Data Typing.
* values, string: Basic Data Typing.
-* variable shadowing: Definition Syntax.
* variable typing: Typing and Comparison.
-* variable, definition of: Basic Data Typing.
-* variables, user-defined: Using Variables.
+* variables <1>: Basic Data Typing.
+* variables: Other Features.
+* variables, assigning on command line: Assignment Options.
+* variables, built-in <1>: Built-in Variables.
+* variables, built-in: Using Variables.
+* variables, built-in, -v option, setting with: Options.
+* variables, built-in, conveying information: Auto-set.
+* variables, flag: Boolean Ops.
+* variables, getline command into, using <1>: Getline/Variable/Coprocess.
+* variables, getline command into, using <2>: Getline/Variable/Pipe.
+* variables, getline command into, using <3>: Getline/Variable/File.
+* variables, getline command into, using: Getline/Variable.
+* variables, global, for library functions: Library Names.
+* variables, global, printing list of: Options.
+* variables, initializing: Using Variables.
+* variables, names of: Arrays.
+* variables, private: Library Names.
+* variables, setting: Options.
+* variables, shadowing: Definition Syntax.
+* variables, types of: Assignment Ops.
+* variables, types of, comparison expressions and: Typing and Comparison.
+* variables, uninitialized, as array subscripts: Uninitialized Subscripts.
+* variables, user-defined: Variables.
+* vertical bar (|): Regexp Operators.
+* vertical bar (|), | operator (I/O) <1>: Precedence.
+* vertical bar (|), | operator (I/O): Getline/Pipe.
+* vertical bar (|), |& I/O operator (I/O): Two-way I/O.
+* vertical bar (|), |& operator (I/O) <1>: Precedence.
+* vertical bar (|), |& operator (I/O): Getline/Coprocess.
+* vertical bar (|), |& operator (I/O), two-way communications: Portal Files.
+* vertical bar (|), || operator <1>: Precedence.
+* vertical bar (|), || operator: Boolean Ops.
* vname internal variable: Internals.
* w utility: Constant Size.
* Wall, Larry: Future Extensions.
-* warnings, automatic <1>: Options.
-* warnings, automatic <2>: I/O Functions.
-* warnings, automatic <3>: String Functions.
-* warnings, automatic <4>: Using Constant Regexps.
-* warnings, automatic <5>: Special Caveats.
-* warnings, automatic <6>: Special Process.
-* warnings, automatic: Escape Sequences.
+* warnings, issuing: Options.
* wc utility: Wc Program.
* wc.awk program: Wc Program.
* Weinberger, Peter <1>: Contributors.
* Weinberger, Peter: History.
-* while statement: While Statement.
+* while statement <1>: While Statement.
+* while statement: Regexp Usage.
+* whitespace, as field separators: Field Separators.
+* whitespace, functions, calling: Calling Built-in.
+* whitespace, newlines as: Options.
* Williams, Kent: Contributors.
* Woods, John: Contributors.
* word boundaries, matching: GNU Regexp Operators.
* word, regexp definition of: GNU Regexp Operators.
+* word-boundary operator (gawk): GNU Regexp Operators.
* wordfreq.awk program: Word Sorting.
+* words, counting: Wc Program.
+* words, duplicate, searching for: Dupword Program.
+* words, usage counts, generating: Word Sorting.
* xgettext utility: String Extraction.
* XOR bitwise operation: Bitwise Functions.
-* xor built-in function: Bitwise Functions.
+* xor function (gawk): Bitwise Functions.
* Zaretskii, Eli: Acknowledgments.
* zero, negative vs. positive: Floating Point Issues.
* Zoulas, Christos: Contributors.
-* | I/O operator <1>: Precedence.
-* | I/O operator <2>: Redirection.
-* | I/O operator: Getline/Pipe.
-* |& I/O operator <1>: Two-way I/O.
-* |& I/O operator <2>: Precedence.
-* |& I/O operator <3>: Redirection.
-* |& I/O operator: Getline/Coprocess.
-* || operator <1>: Precedence.
-* || operator: Boolean Ops.
-* ~ operator <1>: Precedence.
-* ~ operator <2>: Typing and Comparison.
-* ~ operator <3>: Regexp Constants.
-* ~ operator <4>: Computed Regexps.
-* ~ operator <5>: Case-sensitivity.
-* ~ operator: Regexp Usage.
+* {} (braces), actions and: Action Overview.
+* {} (braces), pgawk program: Profiling.
+* {} (braces), statements, grouping: Statements.
+* | (vertical bar): Regexp Operators.
+* | (vertical bar), | operator (I/O) <1>: Precedence.
+* | (vertical bar), | operator (I/O) <2>: Redirection.
+* | (vertical bar), | operator (I/O): Getline/Pipe.
+* | (vertical bar), |& operator (I/O) <1>: Two-way I/O.
+* | (vertical bar), |& operator (I/O) <2>: Precedence.
+* | (vertical bar), |& operator (I/O) <3>: Redirection.
+* | (vertical bar), |& operator (I/O): Getline/Coprocess.
+* | (vertical bar), |& operator (I/O), pipes, closing: Close Files And Pipes.
+* | (vertical bar), |& operator (I/O), two-way communications: Portal Files.
+* | (vertical bar), || operator <1>: Precedence.
+* | (vertical bar), || operator: Boolean Ops.
+* ~ (tilde), ~ operator <1>: Expression Patterns.
+* ~ (tilde), ~ operator <2>: Precedence.
+* ~ (tilde), ~ operator <3>: Typing and Comparison.
+* ~ (tilde), ~ operator <4>: Regexp Constants.
+* ~ (tilde), ~ operator <5>: Computed Regexps.
+* ~ (tilde), ~ operator: Case-sensitivity.

Tag Table:
-Node: Top1365
-Node: Foreword25650
-Node: Preface29974
-Ref: Preface-Footnote-132860
-Node: History33092
-Node: Names35352
-Ref: Names-Footnote-136853
-Node: This Manual36925
-Ref: This Manual-Footnote-142290
-Node: Conventions42397
-Node: Manual History44274
-Ref: Manual History-Footnote-148037
-Ref: Manual History-Footnote-248078
-Node: How To Contribute48152
-Node: Acknowledgments48750
-Node: Getting Started52540
-Node: Running gawk54933
-Node: One-shot56139
-Node: Read Terminal57398
-Ref: Read Terminal-Footnote-159051
-Node: Long59222
-Node: Executable Scripts60623
-Ref: Executable Scripts-Footnote-162359
-Ref: Executable Scripts-Footnote-262510
-Node: Comments62955
-Node: Quoting65349
-Node: Sample Data Files69331
-Node: Very Simple72427
-Node: Two Rules77034
-Node: More Complex79239
-Ref: More Complex-Footnote-182161
-Ref: More Complex-Footnote-282647
-Node: Statements/Lines82730
-Ref: Statements/Lines-Footnote-187094
-Node: Other Features87403
-Node: When88268
-Node: Regexp90257
-Node: Regexp Usage91648
-Node: Escape Sequences93713
-Node: Regexp Operators99658
-Ref: Regexp Operators-Footnote-1106811
-Ref: Regexp Operators-Footnote-2106957
-Node: Character Lists107055
-Node: GNU Regexp Operators111565
-Node: Case-sensitivity115046
-Ref: Case-sensitivity-Footnote-1118168
-Node: Leftmost Longest118403
-Node: Computed Regexps119717
-Node: Reading Files123108
-Node: Records124895
-Ref: Records-Footnote-1132790
-Node: Fields132827
-Ref: Fields-Footnote-1135886
-Node: Non-Constant Fields135972
-Node: Changing Fields138227
-Node: Field Separators142929
-Node: Regexp Field Splitting146473
-Node: Single Character Fields148974
-Node: Command Line Field Separator150037
-Node: Field Splitting Summary153467
-Ref: Field Splitting Summary-Footnote-1155571
-Node: Constant Size155672
-Node: Multiple Line160252
-Node: Getline165684
-Node: Plain Getline167748
-Node: Getline/Variable169804
-Node: Getline/File170964
-Node: Getline/Variable/File172389
-Node: Getline/Pipe173999
-Node: Getline/Variable/Pipe176195
-Node: Getline/Coprocess177411
-Node: Getline/Variable/Coprocess178683
-Node: Getline Notes179431
-Node: Getline Summary180780
-Node: Printing181485
-Node: Print183174
-Node: Print Examples184554
-Node: Output Separators187451
-Node: OFMT189267
-Node: Printf190669
-Node: Basic Printf191583
-Node: Control Letters193166
-Node: Format Modifiers195752
-Node: Printf Examples200802
-Node: Redirection203572
-Node: Special Files210306
-Node: Special FD210935
-Node: Special Process213978
-Node: Special Network216264
-Node: Special Caveats217177
-Ref: Special Caveats-Footnote-1218387
-Node: Close Files And Pipes218770
-Ref: Close Files And Pipes-Footnote-1225952
-Node: Expressions226100
-Node: Constants228288
-Node: Scalar Constants228984
-Ref: Scalar Constants-Footnote-1229845
-Node: Non-decimal-numbers230027
-Node: Regexp Constants233200
-Node: Using Constant Regexps233665
-Node: Variables236825
-Node: Using Variables237476
-Node: Assignment Options239017
-Node: Conversion240962
-Ref: Conversion-Footnote-1244196
-Node: Arithmetic Ops244305
-Node: Concatenation246802
-Node: Assignment Ops249497
-Node: Increment Ops255817
-Node: Truth Values259304
-Node: Typing and Comparison260350
-Ref: Typing and Comparison-Footnote-1266904
-Node: Boolean Ops267049
-Node: Conditional Exp271158
-Node: Function Calls272954
-Node: Precedence275921
-Node: Patterns and Actions279365
-Node: Pattern Overview280418
-Node: Regexp Patterns282034
-Node: Expression Patterns282593
-Node: Ranges286199
-Node: BEGIN/END289297
-Node: Using BEGIN/END290037
-Ref: Using BEGIN/END-Footnote-1292821
-Node: I/O And BEGIN/END292927
-Node: Empty295266
-Node: Using Shell Variables295566
-Node: Action Overview297926
-Node: Statements300510
-Node: If Statement302216
-Node: While Statement303723
-Node: Do Statement305746
-Node: For Statement306887
-Node: Break Statement310075
-Node: Continue Statement312179
-Node: Next Statement314127
-Node: Nextfile Statement316496
-Node: Exit Statement319250
-Node: Built-in Variables321359
-Node: User-modified322455
-Ref: User-modified-Footnote-1330031
-Node: Auto-set330093
-Ref: Auto-set-Footnote-1338167
-Node: ARGC and ARGV338372
-Node: Arrays342234
-Node: Array Intro344164
-Node: Reference to Elements348432
-Node: Assigning Elements350323
-Node: Array Example350785
-Node: Scanning an Array352508
-Node: Delete354839
-Ref: Delete-Footnote-1357290
-Node: Numeric Array Subscripts357347
-Node: Uninitialized Subscripts359626
-Node: Multi-dimensional361248
-Node: Multi-scanning364298
-Node: Array Sorting365968
-Node: Functions368782
-Node: Built-in369519
-Node: Calling Built-in370502
-Node: Numeric Functions372481
-Ref: Numeric Functions-Footnote-1376235
-Ref: Numeric Functions-Footnote-2376561
-Node: String Functions376831
-Ref: String Functions-Footnote-1393299
-Ref: String Functions-Footnote-2393460
-Node: Gory Details393544
-Ref: Gory Details-Footnote-1400132
-Ref: Gory Details-Footnote-2400183
-Node: I/O Functions400390
-Ref: I/O Functions-Footnote-1407133
-Node: Time Functions407224
-Ref: Time Functions-Footnote-1418026
-Ref: Time Functions-Footnote-2418098
-Ref: Time Functions-Footnote-3418257
-Ref: Time Functions-Footnote-4418368
-Ref: Time Functions-Footnote-5418493
-Ref: Time Functions-Footnote-6418752
-Node: Bitwise Functions419017
-Ref: Bitwise Functions-Footnote-1423725
-Node: I18N Functions423909
-Node: User-defined425173
-Node: Definition Syntax425949
-Node: Function Example430340
-Node: Function Caveats432982
-Node: Return Statement436894
-Node: Dynamic Typing439564
-Node: Internationalization440300
-Node: I18N and L10N441718
-Node: Explaining gettext442427
-Ref: Explaining gettext-Footnote-1447361
-Ref: Explaining gettext-Footnote-2447600
-Node: Programmer i18n447766
-Node: Translator i18n451569
-Node: String Extraction452354
-Ref: String Extraction-Footnote-1453304
-Node: Printf Ordering453501
-Ref: Printf Ordering-Footnote-1456293
-Node: I18N Portability456357
-Ref: I18N Portability-Footnote-1458617
-Node: I18N Example458680
-Ref: I18N Example-Footnote-1461302
-Node: Gawk I18N461374
-Node: Advanced Features462202
-Node: Non-decimal Data463636
-Node: Two-way I/O465248
-Ref: Two-way I/O-Footnote-1469889
-Node: TCP/IP Networking469966
-Node: Portal Files472445
-Node: Profiling473108
-Node: Invoking Gawk480308
-Node: Command Line481485
-Node: Options482284
-Ref: Options-Footnote-1494190
-Node: Other Arguments494215
-Node: AWKPATH Variable496967
-Ref: AWKPATH Variable-Footnote-1499758
-Node: Obsolete500017
-Node: Undocumented501098
-Node: Known Bugs501350
-Node: Library Functions501969
-Ref: Library Functions-Footnote-1505152
-Node: Library Names505323
-Ref: Library Names-Footnote-1508932
-Ref: Library Names-Footnote-2509152
-Node: General Functions509238
-Node: Nextfile Function510174
-Node: Assert Function514638
-Node: Round Function517974
-Node: Cliff Random Function519529
-Ref: Cliff Random Function-Footnote-1520512
-Node: Ordinal Functions520583
-Ref: Ordinal Functions-Footnote-1523661
-Node: Join Function523877
-Ref: Join Function-Footnote-1525682
-Node: Gettimeofday Function525882
-Node: Data File Management529660
-Node: Filetrans Function530220
-Node: Rewind Function533772
-Node: File Checking535396
-Node: Ignoring Assigns536442
-Node: Getopt Function538026
-Ref: Getopt Function-Footnote-1549173
-Node: Passwd Functions549374
-Ref: Passwd Functions-Footnote-1558085
-Node: Group Functions558173
-Node: Sample Programs566271
-Node: Running Examples567001
-Node: Clones567772
-Node: Cut Program568897
-Node: Egrep Program578768
-Ref: Egrep Program-Footnote-1586632
-Node: Id Program586742
-Node: Split Program590434
-Node: Tee Program593950
-Node: Uniq Program596621
-Node: Wc Program604115
-Ref: Wc Program-Footnote-1608430
-Node: Miscellaneous Programs608654
-Node: Dupword Program609643
-Node: Alarm Program611699
-Node: Translate Program616315
-Ref: Translate Program-Footnote-1620617
-Ref: Translate Program-Footnote-2620854
-Node: Labels Program620988
-Ref: Labels Program-Footnote-1624355
-Node: Word Sorting624439
-Node: History Sorting628742
-Node: Extract Program630612
-Node: Simple Sed638193
-Node: Igawk Program641394
-Ref: Igawk Program-Footnote-1654472
-Node: Language History654610
-Node: V7/SVR3.1655977
-Node: SVR4658572
-Node: POSIX660219
-Node: BTL662007
-Node: POSIX/GNU663824
-Node: Contributors672461
-Node: Installation675554
-Node: Gawk Distribution676533
-Node: Getting677033
-Node: Extracting678270
-Node: Distribution contents679650
-Node: Unix Installation685262
-Node: Quick Installation685848
-Node: Additional Configuration Options687595
-Node: Configuration Philosophy688708
-Node: Non-Unix Installation691091
-Node: Amiga Installation691673
-Node: BeOS Installation692818
-Node: PC Installation693990
-Node: PC Binary Installation695019
-Node: PC Compiling696017
-Node: PC Using697840
-Node: VMS Installation701526
-Node: VMS Compilation702045
-Node: VMS Installation Details703634
-Node: VMS Running705251
-Node: VMS POSIX706835
-Node: Unsupported708099
-Node: Atari Installation708497
-Node: Atari Compiling709818
-Node: Atari Using711747
-Node: Tandem Installation714611
-Node: Bugs716417
-Node: Other Versions719667
-Ref: Other Versions-Footnote-1723253
-Node: Notes723295
-Node: Compatibility Mode723968
-Node: Additions724809
-Node: Adding Code725581
-Node: New Ports731627
-Node: Dynamic Extensions735742
-Node: Internals736758
-Node: Sample Library743097
-Node: Internal File Description743747
-Node: Internal File Ops747499
-Ref: Internal File Ops-Footnote-1752915
-Node: Using Internal File Ops753063
-Node: Future Extensions755084
-Node: Basic Concepts759427
-Node: Basic High Level760165
-Ref: Basic High Level-Footnote-1764332
-Node: Basic Data Typing764526
-Node: Floating Point Issues769020
-Ref: Floating Point Issues-Footnote-1772943
-Ref: Floating Point Issues-Footnote-2772994
-Node: Glossary773103
-Node: Copying797415
-Node: GNU Free Documentation License816614
-Node: Index836506
+Node: Top353
+Node: Foreword26454
+Node: Preface30778
+Ref: Preface-Footnote-133660
+Node: History33892
+Node: Names36151
+Ref: Names-Footnote-137660
+Node: This Manual37732
+Ref: This Manual-Footnote-142925
+Node: Conventions43025
+Node: Manual History44902
+Ref: Manual History-Footnote-148588
+Ref: Manual History-Footnote-248629
+Node: How To Contribute48703
+Node: Acknowledgments49301
+Node: Getting Started53106
+Node: Running gawk55499
+Node: One-shot56704
+Node: Read Terminal57961
+Ref: Read Terminal-Footnote-159610
+Node: Long59781
+Node: Executable Scripts61182
+Ref: Executable Scripts-Footnote-162918
+Ref: Executable Scripts-Footnote-263069
+Node: Comments63520
+Node: Quoting65912
+Node: Sample Data Files69890
+Node: Very Simple72968
+Node: Two Rules77588
+Node: More Complex79787
+Ref: More Complex-Footnote-182710
+Ref: More Complex-Footnote-283186
+Node: Statements/Lines83269
+Ref: Statements/Lines-Footnote-187628
+Node: Other Features87937
+Node: When88802
+Node: Regexp90791
+Node: Regexp Usage92181
+Node: Escape Sequences94272
+Node: Regexp Operators100184
+Ref: Regexp Operators-Footnote-1107325
+Ref: Regexp Operators-Footnote-2107472
+Node: Character Lists107570
+Node: GNU Regexp Operators112039
+Node: Case-sensitivity115534
+Ref: Case-sensitivity-Footnote-1118659
+Node: Leftmost Longest118894
+Node: Computed Regexps120208
+Node: Reading Files123599
+Node: Records125385
+Ref: Records-Footnote-1133263
+Node: Fields133300
+Ref: Fields-Footnote-1136355
+Node: Nonconstant Fields136441
+Node: Changing Fields138693
+Node: Field Separators143403
+Node: Regexp Field Splitting146947
+Node: Single Character Fields149448
+Node: Command Line Field Separator150511
+Node: Field Splitting Summary153962
+Ref: Field Splitting Summary-Footnote-1156065
+Node: Constant Size156166
+Node: Multiple Line160740
+Node: Getline166171
+Node: Plain Getline168234
+Node: Getline/Variable170284
+Node: Getline/File171416
+Node: Getline/Variable/File172841
+Node: Getline/Pipe174464
+Node: Getline/Variable/Pipe176671
+Node: Getline/Coprocess177887
+Node: Getline/Variable/Coprocess179161
+Node: Getline Notes179909
+Node: Getline Summary181258
+Node: Printing181965
+Node: Print183679
+Node: Print Examples185060
+Node: Output Separators187957
+Node: OFMT189773
+Node: Printf191175
+Node: Basic Printf192089
+Node: Control Letters193673
+Node: Format Modifiers196260
+Node: Printf Examples201312
+Node: Redirection204082
+Node: Special Files210806
+Node: Special FD211435
+Node: Special Process214474
+Node: Special Network216760
+Node: Special Caveats217675
+Ref: Special Caveats-Footnote-1218885
+Node: Close Files And Pipes219268
+Ref: Close Files And Pipes-Footnote-1226450
+Node: Expressions226598
+Node: Constants228786
+Node: Scalar Constants229482
+Ref: Scalar Constants-Footnote-1230346
+Node: Nondecimal-numbers230528
+Node: Regexp Constants233704
+Node: Using Constant Regexps234168
+Node: Variables237328
+Node: Using Variables237979
+Node: Assignment Options239520
+Node: Conversion241460
+Ref: Conversion-Footnote-1244691
+Node: Arithmetic Ops244800
+Node: Concatenation247297
+Node: Assignment Ops249992
+Node: Increment Ops256308
+Node: Truth Values259796
+Node: Typing and Comparison260841
+Ref: Typing and Comparison-Footnote-1267395
+Node: Boolean Ops267540
+Node: Conditional Exp271648
+Node: Function Calls273444
+Node: Precedence276417
+Node: Patterns and Actions279861
+Node: Pattern Overview280914
+Node: Regexp Patterns282527
+Node: Expression Patterns283086
+Node: Ranges286692
+Node: BEGIN/END289793
+Node: Using BEGIN/END290533
+Ref: Using BEGIN/END-Footnote-1293318
+Node: I/O And BEGIN/END293432
+Node: Empty295771
+Node: Using Shell Variables296070
+Node: Action Overview298430
+Node: Statements300996
+Node: If Statement302702
+Node: While Statement304211
+Node: Do Statement306234
+Node: For Statement307374
+Node: Break Statement310562
+Node: Continue Statement312666
+Node: Next Statement314605
+Node: Nextfile Statement316994
+Node: Exit Statement319748
+Node: Built-in Variables321857
+Node: User-modified322947
+Ref: User-modified-Footnote-1330533
+Node: Auto-set330595
+Ref: Auto-set-Footnote-1338618
+Node: ARGC and ARGV338823
+Node: Arrays342685
+Node: Array Intro344615
+Node: Reference to Elements348885
+Node: Assigning Elements350770
+Node: Array Example351232
+Node: Scanning an Array352955
+Node: Delete355279
+Ref: Delete-Footnote-1357729
+Node: Numeric Array Subscripts357786
+Node: Uninitialized Subscripts360065
+Node: Multi-dimensional361687
+Node: Multi-scanning364734
+Node: Array Sorting366406
+Node: Functions369220
+Node: Built-in369954
+Node: Calling Built-in370937
+Node: Numeric Functions372912
+Ref: Numeric Functions-Footnote-1376652
+Ref: Numeric Functions-Footnote-2376978
+Node: String Functions377247
+Ref: String Functions-Footnote-1393843
+Ref: String Functions-Footnote-2394002
+Node: Gory Details394089
+Ref: Gory Details-Footnote-1400676
+Ref: Gory Details-Footnote-2400727
+Node: I/O Functions400934
+Ref: I/O Functions-Footnote-1407611
+Node: Time Functions407702
+Ref: Time Functions-Footnote-1418476
+Ref: Time Functions-Footnote-2418544
+Ref: Time Functions-Footnote-3418702
+Ref: Time Functions-Footnote-4418813
+Ref: Time Functions-Footnote-5418938
+Ref: Time Functions-Footnote-6419197
+Node: Bitwise Functions419459
+Ref: Bitwise Functions-Footnote-1424157
+Node: I18N Functions424341
+Node: User-defined426085
+Node: Definition Syntax426861
+Node: Function Example431253
+Node: Function Caveats433894
+Node: Return Statement437794
+Node: Dynamic Typing440452
+Node: Internationalization441190
+Node: I18N and L10N442608
+Node: Explaining gettext443317
+Ref: Explaining gettext-Footnote-1448253
+Ref: Explaining gettext-Footnote-2448492
+Node: Programmer i18n448661
+Node: Translator i18n453007
+Node: String Extraction453792
+Ref: String Extraction-Footnote-1454794
+Node: Printf Ordering454920
+Ref: Printf Ordering-Footnote-1457711
+Node: I18N Portability457775
+Ref: I18N Portability-Footnote-1460213
+Node: I18N Example460276
+Ref: I18N Example-Footnote-1462913
+Node: Gawk I18N462985
+Node: Advanced Features463807
+Node: Nondecimal Data465239
+Node: Two-way I/O466846
+Ref: Two-way I/O-Footnote-1471508
+Node: TCP/IP Networking471585
+Node: Portal Files474048
+Node: Profiling474711
+Node: Invoking Gawk482337
+Node: Command Line483514
+Node: Options484314
+Ref: Options-Footnote-1496204
+Node: Other Arguments496229
+Node: AWKPATH Variable498981
+Ref: AWKPATH Variable-Footnote-1501764
+Node: Obsolete502024
+Node: Undocumented503105
+Node: Known Bugs503357
+Node: Library Functions503976
+Ref: Library Functions-Footnote-1507160
+Node: Library Names507331
+Ref: Library Names-Footnote-1510940
+Ref: Library Names-Footnote-2511159
+Node: General Functions511245
+Node: Nextfile Function512181
+Node: Assert Function516646
+Node: Round Function519977
+Node: Cliff Random Function521536
+Ref: Cliff Random Function-Footnote-1522519
+Node: Ordinal Functions522590
+Ref: Ordinal Functions-Footnote-1525664
+Node: Join Function525880
+Ref: Join Function-Footnote-1527684
+Node: Gettimeofday Function527884
+Node: Data File Management531662
+Node: Filetrans Function532223
+Node: Rewind Function535774
+Node: File Checking537398
+Node: Ignoring Assigns538444
+Node: Getopt Function540028
+Ref: Getopt Function-Footnote-1551177
+Node: Passwd Functions551378
+Ref: Passwd Functions-Footnote-1560100
+Node: Group Functions560188
+Node: Sample Programs568287
+Node: Running Examples569017
+Node: Clones569788
+Node: Cut Program570913
+Node: Egrep Program580778
+Ref: Egrep Program-Footnote-1588643
+Node: Id Program588753
+Node: Split Program592438
+Node: Tee Program595947
+Node: Uniq Program598618
+Node: Wc Program606128
+Ref: Wc Program-Footnote-1610442
+Node: Miscellaneous Programs610664
+Node: Dupword Program611653
+Node: Alarm Program613704
+Node: Translate Program618328
+Ref: Translate Program-Footnote-1622644
+Ref: Translate Program-Footnote-2622881
+Node: Labels Program623015
+Ref: Labels Program-Footnote-1626372
+Node: Word Sorting626456
+Node: History Sorting630759
+Node: Extract Program632628
+Node: Simple Sed640210
+Node: Igawk Program643407
+Ref: Igawk Program-Footnote-1656434
+Node: Language History656572
+Node: V7/SVR3.1657939
+Node: SVR4660534
+Node: POSIX662181
+Node: BTL663969
+Node: POSIX/GNU665786
+Node: Contributors674410
+Node: Installation677662
+Node: Gawk Distribution678641
+Node: Getting679141
+Node: Extracting680387
+Node: Distribution contents681766
+Node: Unix Installation687363
+Node: Quick Installation687949
+Node: Additional Configuration Options689696
+Node: Configuration Philosophy690791
+Node: Non-Unix Installation693174
+Node: Amiga Installation693756
+Node: BeOS Installation694901
+Node: PC Installation696073
+Node: PC Binary Installation697206
+Node: PC Compiling699060
+Node: PC Using703514
+Node: Cygwin708232
+Ref: Cygwin-Footnote-1709245
+Node: VMS Installation709277
+Node: VMS Compilation709796
+Node: VMS Installation Details711385
+Node: VMS Running713002
+Node: VMS POSIX714586
+Node: Unsupported715850
+Node: Atari Installation716248
+Node: Atari Compiling717569
+Node: Atari Using719498
+Node: Tandem Installation722362
+Node: Bugs724168
+Node: Other Versions727453
+Ref: Other Versions-Footnote-1731039
+Node: Notes731081
+Node: Compatibility Mode731754
+Node: Additions732596
+Node: Adding Code733368
+Node: New Ports739410
+Node: Dynamic Extensions743513
+Node: Internals744529
+Node: Sample Library750865
+Node: Internal File Description751515
+Node: Internal File Ops755267
+Ref: Internal File Ops-Footnote-1760683
+Node: Using Internal File Ops760831
+Node: Future Extensions762852
+Node: Basic Concepts767195
+Node: Basic High Level767933
+Ref: Basic High Level-Footnote-1772094
+Node: Basic Data Typing772288
+Node: Floating Point Issues776778
+Ref: Floating Point Issues-Footnote-1780701
+Ref: Floating Point Issues-Footnote-2780753
+Node: Glossary780862
+Node: Copying805171
+Node: GNU Free Documentation License824368
+Node: Index844250

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 808ef6e8..e5f50413 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -20,9 +20,9 @@
@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 UPDATE-MONTH April, 2002
@set VERSION 3.1
-@set PATCHLEVEL 0
+@set PATCHLEVEL 1
@set FSF
@@ -68,6 +68,7 @@
@set DF data file
@set DDF Data File
@set PVERSION version
+@set CTL Ctrl
@ignore
Some comments on the layout for TeX.
@@ -96,19 +97,13 @@ Some comments on the layout for TeX.
@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.
+@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} version of the GNU implementation of AWK.
-
-Copyright (C) 1989, 1991, 1992, 1993, 1996-2001 Free Software Foundation, Inc.
+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,11 +122,21 @@ texts being (a) (see below), and with the Back-Cover Texts being (b)
software. Copies published by the Free Software Foundation raise
funds for GNU development.''
@end enumerate
-@end ifinfo
+@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.
-@setchapternewpage odd
+@c @setchapternewpage odd
@titlepage
@title @value{TITLE}
@@ -166,14 +171,6 @@ Corporation. @*
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
@@ -187,24 +184,8 @@ URL: @uref{http://www.gnu.org/} @*
@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
+@insertcopying
@sp 2
Cover art by Etienne Suvasa.
@end titlepage
@@ -237,7 +218,7 @@ Cover art by Etienne Suvasa.
@oddheading @| @| @strong{@thischapter}@ @ @ @thispage
@end iftex
-@ifinfo
+@ifnottex
@node Top, Foreword, (dir), (dir)
@top General Introduction
@c Preface node should come right after the Top
@@ -247,11 +228,9 @@ Cover art by Etienne Suvasa.
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.
+@insertcopying
-@end ifinfo
+@end ifnottex
@menu
* Foreword:: Some nice words about this
@@ -309,7 +288,7 @@ of AWK.
* Acknowledgments:: Acknowledgments.
* Running gawk:: How to run @command{gawk} programs;
includes command-line syntax.
-* One-shot:: Running a short throw-away @command{awk}
+* One-shot:: Running a short throwaway @command{awk}
program.
* Read Terminal:: Using no input files (input from terminal
instead).
@@ -333,7 +312,7 @@ of AWK.
* 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.
+* 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,7 +321,7 @@ of AWK.
* 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.
+* 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,7 +369,7 @@ of AWK.
* 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.
+* 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,7 +482,7 @@ of AWK.
* 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.
+* 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,6 +574,8 @@ of AWK.
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,7 +755,7 @@ when working with text files.
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
+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,8 +769,12 @@ properly written @command{awk} programs should work with @command{gawk}.
Thus, we usually don't distinguish between @command{gawk} and other
@command{awk} implementations.
-@cindex uses of @command{awk}
-@cindex applications of @command{awk}
+@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,10 +792,12 @@ Produce indexes and perform other document preparation tasks
@item
Experiment with algorithms that you can adapt later to other computer
-languages.
+languages
@end itemize
-@cindex uses of @command{gawk}
+@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,26 +810,27 @@ Extract bits and pieces of data for processing
Sort data
@item
-Perform simple network communications.
+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
+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.
+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,
+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.
+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,13 +864,10 @@ After eight years, add another part @code{egrep} and two
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}
+@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,24 +910,26 @@ for a complete list of those who made important contributions to @command{gawk}.
@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}
+@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} for the ``old @command{awk}''
+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,44 +946,34 @@ specific to the GNU implementation, we use the term @command{gawk}.
@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
+@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 program ``the @command{awk} utility'' and the language ``the @command{awk}
-language.''
+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 heading ``differences between @command{gawk} and
-@command{awk}.''} Finally, any @command{gawk} features that are not in
+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
+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,7 +983,7 @@ as @strong{Advanced Notes}
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.''
+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,7 +1031,7 @@ sorting arrays in @command{gawk}.
@ref{Functions},
describes the built-in functions @command{awk} and
-@command{gawk} provide for you, as well as how to define
+@command{gawk} provide, as well as how to define
your own functions.
@ref{Internationalization, ,Internationalization with @command{gawk}},
@@ -1076,12 +1053,12 @@ program source files.
@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.
+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 it was
-first released to present. It also describes how @command{gawk}
+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,17 +1078,17 @@ future directions for @command{gawk} development.
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.
+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.
+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,
+present the licenses that cover the @command{gawk} source code
and this @value{DOCUMENT}, respectively.
@node Conventions, Manual History, This Manual, Preface
@@ -1157,7 +1134,7 @@ font as the previous occurrence of ``definition'' in this sentence.
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
+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,7 +1147,7 @@ you illuminate, there's always a smaller but darker one.}@*
Brian Kernighan
@end quotation
-@cindex d.c., see ``dark corner''
+@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,26 +1168,18 @@ is, by definition, something that is incomplete.
@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 FSF (Free Software Foundation)
+@cindex Free Software Foundation (FSF)
@cindex Stallman, Richard
-The Free Software Foundation (FSF) is a non-profit organization dedicated
+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
-@cindex General Public License
-@cindex GNU General Public License
-@cindex online documentation
+@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,10 +1209,8 @@ stage of development.
@cindex Linux
@cindex GNU/Linux
-@cindex BSD-based operating systems
-@cindex NetBSD
-@cindex FreeBSD
-@cindex OpenBSD
+@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,12 +1227,12 @@ bundled on CD-ROMs with books about Linux.
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
+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 of it as they like. (Take a moment to check the Free Documentation
-License; see @ref{GNU Free Documentation License}.)
+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,7 +1351,7 @@ would otherwise have escaped us.
@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.
+GNU Project.
The following people (in alphabetical order)
provided helpful comments on various
@@ -1394,7 +1361,7 @@ Nelson H.F. Beebe,
Karl Berry,
Dr.@: Michael Brennan,
Rich Burridge,
-Claire Coutier,
+Claire Cloutier,
Diane Close,
Scott Deifik,
Christopher (``Topher'') Eliot,
@@ -1411,7 +1378,7 @@ Chuck Toporek.
@cindex Berry, Karl
@cindex Chassell, Robert J.@:
-@cindex Texinfo
+@c @cindex Texinfo
Robert J.@: Chassell provided much valuable advice on
the use of Texinfo.
He also deserves special thanks for
@@ -1442,14 +1409,17 @@ working with him on this project was a significant pleasure.
@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,15 +1427,17 @@ internationalization features.
@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)
-are long-time members of the
+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,7 +1459,7 @@ significant editorial help for this @value{DOCUMENT} for the
@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,
+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,10 +1526,11 @@ and @command{gawk}. It contains the following chapters:
@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}
+@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,10 +1538,10 @@ of the patterns, @command{awk} performs specified actions on that line.
@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
+@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,7 +1550,7 @@ detail, every step the program is to take. When working with procedural
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.
+read and write.
@cindex program, definition of
@cindex rule, definition of
@@ -1619,8 +1592,7 @@ program looks like this:
@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
+@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,6 +1601,7 @@ like this:
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,7 +1613,7 @@ This @value{SECTION} discusses both mechanisms, along with several
variations of each.
@menu
-* One-shot:: Running a short throw-away @command{awk}
+* One-shot:: Running a short throwaway @command{awk}
program.
* Read Terminal:: Using no input files (input from terminal
instead).
@@ -1653,7 +1626,7 @@ variations of each.
@end menu
@node One-shot, Read Terminal, Running gawk, Running gawk
-@subsection One-Shot Throw-Away @command{awk} Programs
+@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,7 +1640,8 @@ awk '@var{program}' @var{input-file1} @var{input-file2} @dots{}
where @var{program} consists of a series of @var{patterns} and
@var{actions}, as described earlier.
-@cindex single quotes, why needed
+@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,6 +1650,8 @@ characters. The quotes also cause the shell to treat all of @var{program} as
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,6 +1686,7 @@ egrep foo @var{files} @dots{}
@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,22 +1697,28 @@ awk '@var{program}'
@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}.
+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{Ctrl-z}.)
+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.):
+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
+@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,8 +1727,8 @@ quotes around the program text, double quotes are needed here in order to
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.)
+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,17 +1740,15 @@ Four score and seven years ago, ...
@print{} Four score and seven years ago, ...
What, me worry?
@print{} What, me worry?
-@kbd{Ctrl-d}
+@kbd{@value{CTL}-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
+@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,6 +1757,9 @@ more convenient to put the program into a separate file. In order to tell
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,8 +1782,7 @@ does the same thing as this one:
awk "BEGIN @{ print \"Don't Panic!\" @}"
@end example
-@cindex quoting, shell
-@cindex shell quoting
+@cindex quoting
@noindent
This was explained earlier
(@pxref{Read Terminal, ,Running @command{awk} Without Input Files}).
@@ -1809,6 +1792,10 @@ special characters. Notice that in @file{advice}, the @command{awk}
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,11 +1803,12 @@ affect the execution of the @command{awk} program but it does make
@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)
+@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,7 +1833,7 @@ to run and an optional initial command-line argument to pass to that
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,
+argument list contains either options to @command{awk}, or @value{DF}s,
or both.} as if you had
typed @samp{awk -f advice}:
@@ -1862,7 +1850,7 @@ written in @command{awk}.
@c fakenode --- for prepinfo
@subheading Advanced Notes: Portability Issues with @samp{#!}
-@cindex advanced notes
+@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,7 +1861,8 @@ treats the rest of the line as a single argument and passes it to @command{awk}.
Doing this leads to confusing behavior---most likely a usage diagnostic
of some sort from @command{awk}.
-@cindex portability issues
+@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,11 +1874,10 @@ to provide your script name.
@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
+@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,15 +1897,16 @@ For example, we could have put the following into @file{advice}:
BEGIN @{ print "Don't Panic!" @}
@end example
-You can put comment lines into keyboard-composed throw-away @command{awk}
+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, shell
-@cindex shell quoting
+@cindex quoting
+@cindex single quote (@code{'}), vs. apostrophe
+@cindex @code{'} (single quote), vs. apostrophe
@strong{Caution:} As mentioned in
-@ref{One-shot, ,One-Shot Throw-Away @command{awk} Programs},
+@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,7 +1922,7 @@ $ awk '@{ print "hello" @} # let's be cute'
@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.
+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,16 +1933,15 @@ $ awk '@{ print "hello" @} # let's be cute'
@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
-@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
+@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,7 +1953,8 @@ the shell prompt, or writing it as part of a larger shell script:
awk '@var{program text}' @var{input-file1} @var{input-file2} @dots{}
@end example
-@cindex @command{csh} utility
+@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,22 +1972,28 @@ that character. The shell removes the backslash and passes the quoted
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 showing what happens if you try.
+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
+@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,6 +2008,8 @@ $ awk "BEGIN @{ print \"Don't Panic!\" @}"
@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,6 +2023,7 @@ awk -F "" '@var{program}' @var{files} # correct
@end example
@noindent
+@cindex null strings, quoting and
Don't use this:
@example
@@ -2038,7 +2036,7 @@ as the value of @code{FS}, and the first @value{FN} as the text of the program!
This results in syntax errors at best, and confusing behavior at worst.
@end itemize
-@cindex shell quoting, tricks
+@cindex quoting, tricks for
Mixing single and double quotes is difficult. You have to resort
to shell quoting tricks, like this:
@@ -2070,6 +2068,8 @@ $ awk "BEGIN @{ print \"Here is a single quote <'>\" @}"
@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,17 +2081,16 @@ the shell won't be part of the picture, and you can say what you mean.
@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
+@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, called @file{BBS-list}, represents a list of
+@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 file @file{BBS-list}, each record contains the name of a computer
+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,8 +2119,8 @@ sabafoo 555-2127 1200/300 C
@c endfile
@end example
-@cindex @file{inventory-shipped} file
-The second @value{DF}, called @file{inventory-shipped}, represents
+@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,10 +2172,10 @@ for an @command{awk} program that extracts these @value{DF}s from
@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.''):
+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,24 +2207,21 @@ $ awk '/foo/ @{ print $0 @}' BBS-list
@print{} sabafoo 555-2127 1200/300 C
@end example
-@cindex action, default
-@cindex pattern, default
-@cindex default action
-@cindex default pattern
+@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 empty action
-@cindex action, empty
+@cindex actions, 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
+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 one-liners
+@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,7 +2310,7 @@ awk -F: '@{ print $1 @}' /etc/passwd | sort
@end example
@item
-Count lines in a file:
+Count the lines in a file:
@example
awk 'END @{ print NR @}' data
@@ -2328,12 +2324,12 @@ awk 'NR % 2 == 0' data
@end example
If you use the expression @samp{NR % 2 == 1} instead,
-it would print the odd-numbered lines.
+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 how @command{awk} works
+@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,7 +2341,7 @@ After processing all the rules that match the line (and perhaps there are none),
@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.
+This continues until the program reaches the end of the file.
For example, the following @command{awk} program contains two rules:
@example
@@ -2364,7 +2360,7 @@ This program prints every line that contains the string
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:
+@file{BBS-list} and @file{inventory-shipped}:
@example
$ awk '/12/ @{ print $0 @}
@@ -2403,16 +2399,16 @@ ls -l | awk '$6 == "Nov" @{ sum += $5 @}
END @{ print sum @}'
@end example
-@cindex @command{csh} utility
-@cindex @command{csh}, backslash continuation
-@cindex backslash continuation, in @command{csh}
+@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 as to why. In a POSIX-compliant shell, such as the Bourne
+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,16 +2429,17 @@ the file was last modified. Its output looks like this:
@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,
+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
+@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,13 +2459,13 @@ These more advanced @command{awk} techniques are covered in later sections
(@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.
+@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
+@cindex line breaks
+@cindex newlines
Most often, each line in an @command{awk} program is a separate statement or
separate rule, like this:
@@ -2478,6 +2475,7 @@ awk '/12/ @{ print $0 @}
/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,9 +2492,8 @@ Splitting lines after @samp{?} and @samp{:} is a minor @command{gawk}
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
+@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,7 +2507,7 @@ awk '/This regular expression is too long, so continue it\
@end example
@noindent
-@cindex portability issues
+@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,10 +2525,10 @@ lines in the middle of a regular expression or a string.
@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}
+@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
-above with the C shell.} It works for @command{awk} programs in files and
+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,10 +2560,11 @@ $ awk 'BEGIN @{
@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.
+is no other option.
-@cindex backslash continuation, and comments
-@cindex comments and backslash continuation
+@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,7 +2584,9 @@ next line. However, the backslash-newline combination is never even
noticed because it is ``hidden'' inside the comment. Thus, the
@code{BEGIN} is noted as a syntax error.
-@cindex multiple statements on one line
+@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,13 +2607,14 @@ within an action.
@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.
+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,8 +2626,7 @@ systematically in @ref{Built-in Variables}, and
@node When, , Other Features, Getting Started
@section When to Use @command{awk}
-@cindex uses of @command{awk}
-@cindex applications of @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,10 +2645,11 @@ edit-compile-test-debug cycle of software development.
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
+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,16 +2663,17 @@ easier to maintain and usually run more efficiently.
@node Regexp, Reading Files, Getting Started, Top
@chapter Regular Expressions
-@cindex pattern, regular expressions
-@cindex regexp
-@cindex regular expression
-@cindex regular expressions as patterns
+@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,7 +2692,7 @@ regular expressions work, we will present more complicated instances.
@menu
* Regexp Usage:: How to Use Regular Expressions.
-* Escape Sequences:: How to write non-printing characters.
+* 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,6 +2704,7 @@ regular expressions work, we will present more complicated instances.
@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,12 +2720,21 @@ $ awk '/foo/ @{ print $2 @}' BBS-list
@print{} 555-2127
@end example
-@cindex regexp operators
-@cindex string-matching operators
+@cindex regular expressions, operators
@cindex operators, string-matching
-@cindex operators, regexp matching
-@cindex @code{~} operator
-@cindex @code{!~} operator
+@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,7 +2789,8 @@ $ awk '$1 !~ /J/' inventory-shipped
@dots{}
@end example
-@cindex regexp constant
+@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,14 +2798,16 @@ a @dfn{regexp constant}, much like @code{5.27} is a numeric constant and
@node Escape Sequences, Regexp Operators, Regexp Usage, Regexp
@section Escape Sequences
-@cindex escape sequence notation
+@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
+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
+must use @samp{\"} to represent an actual double-quote character as a
part of the string. For example:
@example
@@ -2805,8 +2820,8 @@ included normally; you must write @samp{\\} to put one backslash in the
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
+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,57 +2834,66 @@ sequences apply to both string constants and regexp constants:
@item \\
A literal backslash, @samp{\}.
-@cindex @command{awk} language, V.4 version
-@cindex @code{\a} escape sequence
+@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{Ctrl-g}, ASCII code 7 (BEL).
+The ``alert'' character, @kbd{@value{CTL}-g}, ASCII code 7 (BEL).
(This usually makes some sort of audible noise.)
-@cindex @code{\b} escape sequence
+@cindex @code{\} (backslash), @code{\b} escape sequence
+@cindex backslash (@code{\}), @code{\b} escape sequence
@item \b
-Backspace, @kbd{Ctrl-h}, ASCII code 8 (BS).
+Backspace, @kbd{@value{CTL}-h}, ASCII code 8 (BS).
-@cindex @code{\f} escape sequence
+@cindex @code{\} (backslash), @code{\f} escape sequence
+@cindex backslash (@code{\}), @code{\f} escape sequence
@item \f
-Formfeed, @kbd{Ctrl-l}, ASCII code 12 (FF).
+Formfeed, @kbd{@value{CTL}-l}, ASCII code 12 (FF).
-@cindex @code{\n} escape sequence
+@cindex @code{\} (backslash), @code{\n} escape sequence
+@cindex backslash (@code{\}), @code{\n} escape sequence
@item \n
-Newline, @kbd{Ctrl-j}, ASCII code 10 (LF).
+Newline, @kbd{@value{CTL}-j}, ASCII code 10 (LF).
-@cindex @code{\r} escape sequence
+@cindex @code{\} (backslash), @code{\r} escape sequence
+@cindex backslash (@code{\}), @code{\r} escape sequence
@item \r
-Carriage return, @kbd{Ctrl-m}, ASCII code 13 (CR).
+Carriage return, @kbd{@value{CTL}-m}, ASCII code 13 (CR).
-@cindex @code{\t} escape sequence
+@cindex @code{\} (backslash), @code{\t} escape sequence
+@cindex backslash (@code{\}), @code{\t} escape sequence
@item \t
-Horizontal tab, @kbd{Ctrl-i}, ASCII code 9 (HT).
+Horizontal TAB, @kbd{@value{CTL}-i}, ASCII code 9 (HT).
-@cindex @command{awk} language, V.4 version
-@cindex @code{\v} escape sequence
+@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{Ctrl-k}, ASCII code 11 (VT).
+Vertical tab, @kbd{@value{CTL}-k}, ASCII code 11 (VT).
-@cindex @code{\}@var{nnn} escape sequence (octal)
+@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}.
-@cindex @code{\x} escape sequence
-@cindex @command{awk} language, V.4 version
-@cindex @command{awk} language, POSIX version
-@cindex POSIX @command{awk}
+@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} 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
+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{\/} escape sequence
+@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,7 +2901,8 @@ constant that contains a slash. Because the regexp is delimited by
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
+@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,16 +2915,18 @@ In @command{gawk}, a number of additional two-character sequences that begin
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
+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 portability issues
+@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 table above.
+shown in the previous list.
To summarize:
@@ -2922,45 +2949,48 @@ literally.
@c fakenode --- for prepinfo
@subheading Advanced Notes: Backslash Before Regular Characters
-@cindex advanced notes
+@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 common mistakes
-@cindex mistakes, common
-@cindex errors, common
+@cindex troubleshooting, backslash before nonspecial character
If you place a backslash in a string constant before something that is
-not one of the characters listed above, POSIX @command{awk} purposely
+not one of the characters previously listed, POSIX @command{awk} purposely
leaves what happens as undefined. There are two choices:
-@cindex automatic warnings
-@cindex warnings, automatic
+@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 to both introduce and to miss,
+(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]+"}}.)
+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, @code{"a\qc"} is the same as if you had typed
+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 advanced notes
+@cindex metacharacters, escape sequences for
Suppose you use an octal or hexadecimal
-escape to represent a regexp metacharacter
-(@pxref{Regexp Operators, , Regular Expression Operators}).
+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
+@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,9 +3002,8 @@ escape sequences literally when used in regexp constants. Thus,
@node Regexp Operators, Character Lists, Escape Sequences, Regexp
@section Regular Expression Operators
-@cindex metacharacters
-@cindex regular expression metacharacters
-@cindex regexp 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,25 +3014,28 @@ The escape sequences described
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
+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 anchors in regexps
-@cindex regexp, anchors
-@cindex Texinfo
+@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
+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,57 +3048,63 @@ The condition is not true in the following example:
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.
+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:
+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}, that
+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}.
-@cindex @command{awk} language, POSIX version
-@cindex POSIX @command{awk}
+@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 character list
-@cindex character set (regexp component)
-@cindex character class
-@cindex bracket expression
+@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}.}
+@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
+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
+@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}, a @samp{w},
-or a @samp{k}.
+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,15 +3116,18 @@ means it matches any string that starts with @samp{P} or contains a digit.
The alternation applies to the largest possible regexps on either side.
-@cindex Texinfo
+@cindex @code{()} (parentheses)
+@cindex parentheses @code{()}
@item (@dots{})
-Parentheses are used for grouping in regular expressions, similar to
+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,8 +3144,10 @@ prints every record in @file{sample} containing a string of the form
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
+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,13 +3158,13 @@ way of writing the last @samp{*} example:
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
+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},@}
@@ -3145,10 +3188,12 @@ Matches @samp{whhhy}, @samp{whhhhy}, or @samp{whhhhhy}, only.
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,13 +3208,15 @@ using a string constant with a regexp operator or function.}
@end table
@cindex precedence, regexp operators
-@cindex regexp operators, precedence of
+@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,9 +3226,14 @@ If @command{gawk} is in compatibility mode
(@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,6 +3247,12 @@ the traditional interpretation of bracket expressions, you can use the C
locale by setting the @env{LC_ALL} environment variable to the value
@samp{C}.
+@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,6 +3263,9 @@ character list, put a @samp{\} in front of it. For example:
@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,9 +3275,8 @@ of the POSIX specification for Extended Regular Expressions (EREs).
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}
+@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,7 +3287,7 @@ is an alphabetic character differs between the United States and France.
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:
+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,7 +3302,7 @@ Alphanumeric characters.
Alphabetic characters.
@item [:blank:]
-Space and tab characters.
+Space and TAB characters.
@item [:cntrl:]
Control characters.
@@ -3265,7 +3325,7 @@ Punctuation characters (characters that are not letters, digits,
control characters, or space characters).
@item [:space:]
-Space characters (such as space, tab, and formfeed, to name a few).
+Space characters (such as space, TAB, and formfeed, to name a few).
@item [:upper:]
Uppercase alphabetic characters.
@@ -3278,7 +3338,7 @@ Characters that are hexadecimal digits.
@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{[: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,7 +3347,7 @@ Characters that are hexadecimal digits.
@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{[: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,6 +3361,8 @@ With the POSIX character classes, you can write
@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,18 +3370,20 @@ These apply to non-ASCII character sets, which can have single symbols
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
-A @dfn{collating symbol} is a multicharacter collating element enclosed between
+@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 equivalence classes
-@item Equivalence Classes
-An @dfn{equivalence class} is a locale-specific name for a list of
+@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,19 +3391,28 @@ For example, the name @samp{e} might be used to represent all of
that matches any of @samp{e}, @samp{@'e}, or @samp{@`e}.
@end table
-These features are very valuable in non-English speaking locales.
+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 only recognize POSIX character classes;
+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
-@cindex regexp operators, GNU specific
+@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,37 +3423,50 @@ For our purposes, a @dfn{word} is a sequence of one or more letters, digits,
or underscores (@samp{_}):
@table @code
-@cindex @code{\w} regexp operator
+@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 short-hand for
+letter, digit, or underscore. Think of it as shorthand for
@w{@code{[[:alnum:]_]}}.
-@cindex @code{\W} regexp operator
+@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 short-hand for
+Think of it as shorthand for
@w{@code{[^[:alnum:]_]}}.
-@cindex @code{\<} regexp operator
+@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{/\<away/} matches @samp{away} but not
@samp{stowaway}.
-@cindex @code{\>} regexp operator
+@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 word.
For example, @code{/stow\>/} matches @samp{stow} but not @samp{stowaway}.
-@cindex @code{\y} regexp operator
+@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.
-@cindex @code{\B} regexp operator
+@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,29 +3474,43 @@ word-constituent characters. For example,
@samp{\B} is essentially the opposite of @samp{\y}.
@end table
-@cindex buffer matching operators
+@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 \`
-@cindex @code{\`} regexp operator
+@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).
-@cindex @code{\'} regexp operator
+@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,7 +3522,8 @@ lesser of two evils.
@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
+@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,7 +3550,7 @@ are allowed.
@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).
+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,12 +3558,16 @@ treated literally, even if they represent regexp metacharacters.
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
-@cindex case sensitivity
-@cindex ignoring case
+@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,7 +3575,7 @@ sets. Thus, a @samp{w} in a regular expression matches only a lowercase
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
+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,15 +3593,20 @@ tolower($1) ~ /foo/ @{ @dots{} @}
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 @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
+@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,24 +3644,26 @@ with @samp{==}, @samp{!=}, and so on.
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
+@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, that also provides a number of characters suitable
+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 leftmost longest match
-@cindex matching, leftmost longest
+@cindex regular expressions, leftmost longest match
+@c @cindex matching, leftmost longest
Consider the following:
@example
@@ -3589,12 +3701,16 @@ and also @pxref{Field Separators, ,Specifying How Fields Are Separated}).
@node Computed Regexps, , Leftmost Longest, Regexp
@section Using Dynamic Regexps
-@cindex computed regular expressions
+@c STARTOFRANGE dregexp
@cindex regular expressions, computed
-@cindex dynamic regular expressions
-@cindex regexp, dynamic
-@cindex @code{~} operator
-@cindex @code{!~} operator
+@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,10 +3736,14 @@ If you are going to use a string constant, you have to understand that
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
+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,9 +3755,9 @@ you have to type @code{"\\*"}. The first backslash escapes the
second one so that the string actually contains the
two characters @samp{\} and @samp{*}.
-@cindex common mistakes
-@cindex mistakes, common
-@cindex errors, common
+@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,7 +3771,7 @@ kinds of constants is a common source of errors.
@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
+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,11 +3783,8 @@ intend a regexp match.
@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
+@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,40 +3798,47 @@ $ awk '$0 ~ "[ \t\n]"'
@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{Ctrl-d}
+@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
-@cindex reading files
-@cindex input
-@cindex standard input
+@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}
+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,7 +3848,7 @@ used with it do not have to be named on the @command{awk} command line
@menu
* Records:: Controlling how data is split into records.
* Fields:: An introduction to fields.
-* Non-Constant Fields:: Non-constant Field Numbers.
+* 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,7 +3860,10 @@ used with it do not have to be named on the @command{awk} command line
@node Records, Fields, Reading Files, Reading Files
@section How Input Is Split into Records
-@cindex number of records, @code{NR}, @code{FNR}
+@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,16 +3877,16 @@ file is started. Another built-in variable, @code{NR}, is the total
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
+@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,6 +3899,7 @@ To do this, use the special @code{BEGIN} pattern
(@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,7 +3911,7 @@ This is a string whose first character is a slash; as a result, records
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
+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,6 +3964,8 @@ for the @samp{core} BBS; the newline separating them in the output
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,12 +3989,13 @@ $ echo | awk 'BEGIN @{ RS = "a" @} ; @{ print NF @}'
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
+@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 empty string
+@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,10 +4008,12 @@ currently being processed, as well as records already processed, are not
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
+@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,7 +4026,7 @@ ends at the next string that matches the regular expression; the next
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
+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,7 +4057,7 @@ supplies its own terminating newline.
@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}
+@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,9 +4067,9 @@ In compatibility mode, only the first character of the value of
@c fakenode --- for prepinfo
@subheading Advanced Notes: @code{RS = "\0"} Is Not Portable
-@cindex advanced notes
-@cindex portability issues
+@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,31 +4085,40 @@ value to use for @code{RS} in this case:
BEGIN @{ RS = "\0" @} # whole file becomes one record?
@end example
-@cindex differences between @command{gawk} and @command{awk}
+@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
+@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, Non-Constant Fields, Records, Reading Files
+@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 separated or @dfn{parsed} by the interpreter into chunks
+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,12 +4135,16 @@ simple @command{awk} programs so powerful.
@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 and twenty-seventh field in the record.)
+@code{$127} is the one hundred twenty-seventh field in the record.)
For example, suppose the following is a line of input:
@example
@@ -4013,7 +4159,7 @@ Here the first field, or @code{$1}, is @samp{This}, the second field, or
field.
@cindex @code{NF} variable
-@cindex number of fields, @code{NF}
+@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,7 +4169,7 @@ If you try to reference a field beyond the last
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
+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,9 +4201,12 @@ $ awk '/foo/ @{ print $1, $NF @}' BBS-list
@print{} macfoo A
@print{} sabafoo C
@end example
+@c ENDOFRANGE fiex
-@node Non-Constant Fields, Changing Fields, Fields, Reading Files
-@section Non-Constant Field Numbers
+@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,17 +4255,15 @@ variable @code{NF} (also @pxref{Built-in Variables}). The expression
@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
+@node Changing Fields, Field Separators, Nonconstant 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:
+Consider the following example and its output:
@example
$ awk '@{ nboxes = $3 ; $3 = $3 - 10
@@ -4171,6 +4318,8 @@ $ awk '@{ $6 = ($5 + $4 + $3 + $2)
@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,6 +4332,9 @@ after adding a field, the record printed includes the new field, with
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,7 +4392,8 @@ The intervening field, @code{$5}, is created with an empty value
and @code{NF} is updated with the value six.
@c FIXME: Verify that this is in POSIX
-@cindex dark corner
+@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,9 +4406,11 @@ $ echo a b c d e f | awk '@{ print "NF =", NF;
@print{} a b c
@end example
-@cindex portability issues
+@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,7 +4424,10 @@ rebuild @code{$0} when @code{NF} is decremented. Caveat emptor.
@cindex @code{FS} variable
@cindex fields, separating
-@cindex field separator, @code{FS}
+@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,14 +4446,13 @@ is split into three fields: @samp{m}, @samp{@bullet{}g}, and
@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
+@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,6 +4467,7 @@ For example, here we set the value of @code{FS} to the string
awk 'BEGIN @{ FS = "," @} ; @{ print $2 @}'
@end example
+@cindex @code{BEGIN} pattern
@noindent
Given the input line:
@@ -4321,8 +4479,9 @@ John Q. Smith, 29 Oak St., Walamazoo, MI 42139
this @command{awk} program extracts and prints the string
@samp{@bullet{}29@bullet{}Oak@bullet{}St.}.
-@cindex field separator, choice of
+@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,6 +4500,8 @@ separator characters carefully to prevent such problems.
(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,6 +4522,10 @@ rules.
@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,10 +4539,10 @@ FS = ", \t"
@noindent
makes every area of an input line that consists of a comma followed by a
-space and a tab into a field separator.
+space and a TAB into a field separator.
@ifinfo
(@samp{\t}
-is an @dfn{escape sequence} that stands for a tab;
+is an @dfn{escape sequence} that stands for a TAB;
@pxref{Escape Sequences},
for the complete list of similar escape sequences.)
@end ifinfo
@@ -4414,8 +4579,9 @@ $ echo ' a b c d ' | awk 'BEGIN @{ FS = "[ \t\n]+" @}
@end example
@noindent
-@cindex null string
-@cindex empty string
+@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,12 +4600,15 @@ with leading whitespace intact. The assignment to @code{$2} rebuilds
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 between @command{gawk} and @command{awk}
+@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,7 +4626,8 @@ $ echo a b | gawk 'BEGIN @{ FS = "" @}
@print{} Field 3 is b
@end example
-@cindex dark corner
+@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,9 +4640,12 @@ behaves this way.
@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
+@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,7 +4656,8 @@ awk -F, '@var{program}' @var{input-files}
@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
+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,16 +4676,18 @@ awk -F\\\\ '@dots{}' files @dots{}
@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.
-@cindex historical features
+@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
+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,6 +4734,8 @@ separator, instead of the @samp{-} in the phone number that was
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,12 +4757,12 @@ awk -F: '$2 == ""' /etc/passwd
@end example
@node Field Splitting Summary, , Command Line Field Separator, Field Separators
-@subsection Field Splitting Summary
+@subsection Field-Splitting Summary
The following
table
summarizes how fields are split, based on the
-value of @code{FS}. (@samp{==} means ``is equal to.'')
+value of @code{FS} (@samp{==} means ``is equal to''):
@table @code
@item FS == " "
@@ -4611,17 +4789,17 @@ POSIX standard.)
@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}
+@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
+@cindex dark corner, field separators
@cindex @command{sed} utility
-@cindex stream editor
+@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,6 +4830,8 @@ prints something like:
@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,6 +4848,9 @@ If you are a novice @command{awk} user, you might want to skip it on
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,8 +4865,10 @@ can use a series of @code{substr} calls on @code{$0}
(@pxref{String Functions, ,String Manipulation Functions}),
this is awkward and inefficient for a large number of fields.
-@cindex fatal errors
+@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,7 +4896,7 @@ dave ttyq4 26Jun9115days 46 46 wnewmail
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.
+idle time:
@strong{Note:}
This program uses a number of @command{awk} features that
@@ -4762,8 +4947,9 @@ a system with card readers is another story!)
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,
+@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,14 +4973,18 @@ for an example of such a function).
@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
+@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,11 +4993,12 @@ a page of the file. To do this, just set the variable @code{RS} to
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 non-blank
+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,10 +5013,10 @@ In addition, a regular expression always matches the longest possible
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
+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
+@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,6 +5024,7 @@ after the last record, the final newline is removed from the record.
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,7 +5046,7 @@ variable @code{FS} to the string @code{"\n"}. (This simple regular
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:
+list in a file named @file{addresses}, which looks like this:
@example
Jane Doe
@@ -4932,22 +5124,23 @@ always serves as a field separator, in addition to whatever value
@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
+(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}
-@cindex @code{getline} built-in function
+@c STARTOFRANGE getl
+@cindex @code{getline} command, explicit input with
@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
@@ -4963,10 +5156,10 @@ and study the @code{getline} command @emph{after} you have reviewed the
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
+@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
-the end of the file is encountered. If there is some error in getting
+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,8 +5190,7 @@ The @code{getline} command can be used without arguments to read input
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:
+processing on the next record @emph{right now}. For example:
@example
@{
@@ -5049,6 +5241,8 @@ rule in the program. @xref{Next Statement, ,The @code{next} Statement}.
@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,8 +5252,7 @@ and you want to read it without triggering
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:
+The following example swaps every two lines of input:
@example
@{
@@ -5101,7 +5294,9 @@ the value of @code{NF} do not change.
@cindex input redirection
@cindex redirection of input
-@cindex @code{<} I/O operator
+@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,6 +5321,7 @@ Because the main input stream is not used, the values of @code{NR} and
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,6 +5334,8 @@ rely on this. Parentheses make it easier to read.)
@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,9 +5362,10 @@ Such a record is replaced by the contents of the file
@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 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,9 +5381,11 @@ that does handle nested @samp{@@include} statements.
@node Getline/Pipe, Getline/Variable/Pipe, Getline/Variable/File, Getline
@subsection Using @code{getline} from a Pipe
-@cindex @code{|} I/O operator
+@cindex @code{|} (vertical bar), @code{|} operator (I/O)
+@cindex vertical bar (@code{|}), @code{|} operator (I/O)
@cindex input pipeline
-@cindex pipeline, input
+@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,6 +5408,7 @@ produced by running the rest of the line as a shell command:
@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,14 +5444,15 @@ bletch
@end example
@noindent
-Notice that this program ran the command @command{who} and printed the result.
+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
+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,6 +5467,8 @@ rely on this. Parentheses make it easier to read, anyway.)
@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,9 +5502,13 @@ rely on this. Parentheses make it easier to read, anyway.)
@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}
+@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,7 +5519,7 @@ for processing and then read the results back.
@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
+Typically, you write data to the coprocess first and then
read results back, as shown in the following:
@example
@@ -5325,7 +5534,7 @@ The values of @code{NR} and
@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,
+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,6 +5544,8 @@ where coprocesses are discussed in more detail.
@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,7 +5563,7 @@ where coprocesses are discussed in more detail.
@end ifinfo
@node Getline Notes, Getline Summary, Getline/Variable/Coprocess, Getline
-@subsection Points About @code{getline} to Remember
+@subsection Points to Remember About @code{getline}
Here are some miscellaneous points about @code{getline} that
you should bear in mind:
@@ -5363,20 +5574,22 @@ When @code{getline} changes the value of @code{$0} and @code{NF},
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
+@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
-@cindex @code{FILENAME} variable
-@cindex dark corner
-@cindex @code{getline}, setting @code{FILENAME}
-@cindex @code{FILENAME}, being set by @code{getline}
+@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,14 +5604,15 @@ also @pxref{Auto-set, ,Built-in Variables That Convey Information}.)
@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} @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{var} @tab Sets @var{var}, @code{FNR}, and @code{NR}
@item @code{getline <} @var{file} @tab Sets @code{$0} and @code{NF}
@@ -5408,19 +5622,23 @@ listing which built-in variables are set by each one.
@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} @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)
+@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
-One of the most common programming actions is to @dfn{print} or output,
+@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,9 +5648,12 @@ you cannot specify @emph{how} to print them---how many
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
+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,7 +5675,6 @@ and discusses the @code{close} built-in function.
@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
@@ -5475,13 +5695,16 @@ The items to print can be constant strings or numbers, fields of the
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
+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,6 +5715,7 @@ isn't limited to only one line. If an item value is a string that contains a
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,6 +5727,7 @@ $ awk 'BEGIN @{ print "line one\nline two\nline three" @}'
@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,9 +5740,9 @@ $ awk '@{ print $1, $2 @}' inventory-shipped
@dots{}
@end example
-@cindex common mistakes
-@cindex mistakes, common
-@cindex errors, common
+@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,6 +5757,8 @@ $ awk '@{ print $1 $2 @}' inventory-shipped
@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,6 +5798,9 @@ awk 'BEGIN @{ print "Month Crates"
@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,18 +5808,17 @@ a lot of time. This is why the @code{printf} statement was
created (@pxref{Printf, ,Using @code{printf} Statements for Fancier Printing});
one of its specialties is lining up columns of data.
-@cindex line continuation
+@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 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;
@@ -5605,6 +5834,10 @@ record, and then outputs a string called the @dfn{output record separator}
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,10 +5877,9 @@ is run together on a single line.
@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}
+@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,6 +5892,10 @@ numbers can be formatted. The different format specifications are discussed
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,19 +5912,20 @@ $ awk 'BEGIN @{
@end example
@noindent
-@cindex dark corner
-@cindex @command{awk} language, POSIX version
-@cindex POSIX @command{awk}
+@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
-@cindex formatted output
-@cindex output, formatted
-@cindex @code{printf} statement
+@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,10 +5956,10 @@ printf @var{format}, @var{item1}, @var{item2}, @dots{}
@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
+relational operator; otherwise, it can be confused with a redirection
(@pxref{Redirection, ,Redirecting Output of @code{print} and @code{printf}}).
-@cindex format string
+@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,8 +5992,8 @@ the message is printed.
@node Control Letters, Format Modifiers, Basic Printf, Printf
@subsection Format-Control Letters
-@cindex @code{printf}, format-control characters
-@cindex format specifier, @code{printf}
+@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,12 +6063,13 @@ These print an unsigned hexadecimal integer;
instead of @samp{a} through @samp{f}.
@item %%
-This isn't a format-control letter but it does have meaning---the
+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
+@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,8 +6080,10 @@ invalid values or do something else entirely.
@node Format Modifiers, Printf Examples, Control Letters, Printf
@subsection Modifiers for @code{printf} Formats
-@cindex @code{printf}, modifiers
-@cindex modifiers (in format specifiers)
+@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,16 +6093,17 @@ spaces in the output. Here are the possible modifiers, in the order in
which they may appear:
@table @code
-@cindex differences between @command{gawk} and @command{awk}
-@cindex @code{printf}, positional specifier
-@cindex positional specifier, @code{printf}
+@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:
+counting with one. Thus:
@example
printf "%s %s\n", "don't", "panic"
@@ -5880,7 +6121,7 @@ which describes how and why to use positional specifiers.
For now, we will not use them.
@item -
-The minus sign, used before the width modifier (see further on in
+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,7 +6139,7 @@ For numeric conversions, prefix positive values with a space and
negative values with a minus sign.
@item +
-The plus sign, used before the width modifier (see further on in
+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,10 +6254,9 @@ printf "%" w "." p "s\n", s
@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 @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,6 +6265,7 @@ If @option{--lint} is provided on the command line
(@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,6 +6352,7 @@ At this point, it would be a worthwhile exercise to use the
@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,13 +6369,18 @@ A redirection appears after the @code{print} or @code{printf} statement.
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{>} I/O operator
+@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,7 +6412,8 @@ $ cat name-list
@noindent
Each output file contains one name or number per line.
-@cindex @code{>>} I/O operator
+@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,9 +6422,9 @@ single-@samp{>} redirection is that the old contents (if any) of
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
+@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,14 +6466,14 @@ close(report)
@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.
+@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 on this.
+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,15 +6481,16 @@ use a string constant. Using a variable is generally a good idea,
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}
+@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}, that works together with,
+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,13 +6500,11 @@ for a more complete discussion.
@end table
Redirecting output using @samp{>}, @samp{>>}, @samp{|}, or @samp{|&}
-asks the system to open a file, pipe, or coprocess, only if the particular
+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
+@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,9 +6522,11 @@ This is indeed how redirections must be used from the shell. But in
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
+@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,17 +6542,16 @@ open as many pipelines as the underlying operating system permits.
@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
+@cindex advanced features, piping into @command{sh}
+@cindex shells, piping commands into
-A particularly powerful way to use redirection is to build command lines,
+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
+@c @cindex @command{mv} utility
@example
@{ printf("mv %s %s\n", $0, tolower($0)) | "sh" @}
@@ -6316,9 +6564,13 @@ uppercase characters converted to lowercase
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,9 +6586,12 @@ process-related information, and TCP/IP networking.
@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 standard error 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,10 +6600,11 @@ output}. These streams are, by default, connected to your terminal, but
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
+streams, standard output and standard error, is so that they can be
redirected separately.
-@cindex differences between @command{gawk} and @command{awk}
+@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,13 +6635,16 @@ Then opening @file{/dev/tty} fails.
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
+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,9 +6672,7 @@ is to use @file{/dev/stderr}, like this:
print "Serious error detected!" > "/dev/stderr"
@end example
-@cindex common mistakes
-@cindex mistakes, common
-@cindex errors, common
+@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,6 +6682,8 @@ to confusing results.
@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,11 +6691,10 @@ first be closed with the @code{close} function
(@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
+@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,8 +6740,8 @@ These special @value{FN}s may be used on the command line as @value{DF}s,
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
+@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,10 +6753,12 @@ To obtain process-related information, use the @code{PROCINFO} array.
@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 server.
+TCP/IP connection, acting as either a client or a server.
This is done using a special @value{FN} of the form:
@example
@@ -6519,15 +6779,18 @@ Full discussion is delayed until
@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.
+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}).
-@cindex automatic warnings
-@cindex warnings, automatic
+@c @cindex automatic warnings
+@c @cindex warnings, automatic
+@cindex @code{PROCINFO} array
@item
@ifnottex
The
@@ -6548,9 +6811,9 @@ To obtain process-related information, use the @code{PROCINFO} array.
@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,
+@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,14 +6824,22 @@ the time this does not matter; however, it is important to @emph{not}
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 closing input files and pipes
-@cindex closing output files and pipes
-@cindex closing coprocesses
-@cindex coprocess
-@cindex @code{close} built-in function
+@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,6 +6854,7 @@ command associated with it is remembered by @command{awk}, and subsequent
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,8 +6937,8 @@ program closes the pipe after each line of output, then each line makes
a separate message.
@end itemize
-@cindex differences between @command{gawk} and @command{awk}
-@cindex portability issues
+@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,6 +6978,8 @@ is not closed and released until @code{close} is called or
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,11 +6996,13 @@ which discusses it in more detail and gives an example.
@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}
+@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,6 +7035,9 @@ The return value for closing a pipeline is particularly useful.
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,10 +7055,16 @@ piping into @code{getline}. For commands piped into
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
-@cindex expression
+@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,15 +7117,14 @@ have different forms, but are stored identically internally.
@menu
* Scalar Constants:: Numeric and string constants.
-* Non-decimal-numbers:: What are octal and hex numbers.
+* Nondecimal-numbers:: What are octal and hex numbers.
* Regexp Constants:: Regular Expression constants.
@end menu
-@node Scalar Constants, Non-decimal-numbers, Constants, Constants
+@node Scalar Constants, Nondecimal-numbers, Constants, Constants
@subsection Numeric and String Constants
-@cindex numeric constant
-@cindex numeric value
+@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,21 +7142,22 @@ have the same value:
@cindex string constants
A string constant consists of a sequence of characters enclosed in
-double quote marks. For example:
+double-quotation marks. For example:
@example
"parrot"
@end example
@noindent
-@cindex differences between @command{gawk} and @command{awk}
+@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 Non-decimal-numbers, Regexp Constants, Scalar Constants, Constants
+@node Nondecimal-numbers, Regexp Constants, Scalar Constants, Constants
@subsection Octal and Hexadecimal Numbers
@cindex octal numbers
@cindex hexadecimal numbers
@@ -6882,16 +7167,16 @@ implementations may have difficulty with some character codes.
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 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
+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.
+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,7 +7187,7 @@ and hexadecimal numbers start with a leading @samp{0x} or @samp{0X}:
@table @code
@item 11
-Decimal 11.
+Decimal value 11.
@item 011
Octal 11, decimal value 9.
@@ -6922,13 +7207,15 @@ Being able to use octal and hexadecimal constants in your programs is most
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{Non-decimal Data, ,Allowing Non-Decimal Input 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,7 +7226,7 @@ see @ref{Bitwise Functions, ,Using @command{gawk}'s Bit Manipulation Functions},
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.
+in octal constants; e.g., @command{gawk} treats @samp{018} as decimal 18:
@example
$ gawk 'BEGIN @{ print "021 is", 021 ; print 018 @}'
@@ -6947,6 +7234,8 @@ $ gawk 'BEGIN @{ print "021 is", 021 ; print 018 @}'
@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,7 +7243,8 @@ they are not available.
@c fakenode --- for prepinfo
@subheading Advanced Notes: A Constant's Base Does Not Affect Its Value
-@cindex advanced notes
+@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,28 +7258,33 @@ $ gawk 'BEGIN @{ printf "0x11 is <%s>\n", 0x11 @}'
@print{} 0x11 is <17>
@end example
-@node Regexp Constants, , Non-decimal-numbers, Constants
+@node Regexp Constants, , Nondecimal-numbers, Constants
@subsection Regular Expression Constants
-@cindex @code{~} operator
-@cindex @code{!~} operator
+@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
+@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/)}
+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,8 +7313,10 @@ intended:
if (/foo/ ~ $1) print "found foo"
@end example
-@cindex automatic warnings
-@cindex warnings, automatic
+@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,8 +7339,11 @@ upon the contents of the current input record.
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
+@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,7 +7353,7 @@ the third argument of @code{split} to be a regexp constant, but some
older implementations do not.
@value{DARKCORNER}
This can lead to confusion when attempting to use regexp constants
-as arguments to user defined functions
+as arguments to user-defined functions
(@pxref{User-defined, ,User-Defined Functions}).
For example:
@@ -7075,8 +7375,8 @@ function mysub(pat, repl, str, global)
@}
@end example
-@cindex automatic warnings
-@cindex warnings, automatic
+@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,10 +7385,13 @@ or not @code{$0} matches @code{/hi/}.
@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,8 +7407,6 @@ on the @command{awk} command line.
@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
@@ -7119,6 +7420,8 @@ variable's current value. Variables are given new values with
@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,6 +7438,9 @@ which is what you would do in C and in most other traditional languages.
@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,6 +7451,8 @@ Such an assignment has the following form:
@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,19 +7495,22 @@ $ awk '@{ print $n @}' n=4 inventory-shipped n=2 BBS-list
@dots{}
@end example
-@cindex dark corner
+@cindex dark corner, command-line arguments
Command-line arguments are made available for explicit examination by
-the @command{awk} program in an array named @code{ARGV}
+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
-@value{DARKCORNER}
(@pxref{Escape Sequences}).
+@value{DARKCORNER}
@node Conversion, Arithmetic Ops, Variables, Expressions
@section Conversion of Strings and Numbers
-@cindex 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,10 +7527,9 @@ print (two three) + 4
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.
+number 23, to which 4 is then added.
-@cindex null string
-@cindex empty string
+@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,7 +7557,7 @@ value exactly,
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
+@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,9 +7576,10 @@ b = a ""
@code{b} has the value @code{"12"}, not @code{"12.00"}.
@value{DARKCORNER}
-@cindex @command{awk} language, POSIX version
-@cindex POSIX @command{awk}
+@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,13 +7598,13 @@ for more information on the @code{print} statement.
@section Arithmetic Operators
@cindex arithmetic operators
@cindex operators, arithmetic
-@cindex addition
-@cindex subtraction
-@cindex multiplication
-@cindex division
-@cindex remainder
-@cindex quotient
-@cindex exponentiation
+@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,8 +7642,7 @@ Negation.
@item + @var{x}
Unary plus; the expression is converted to a number.
-@cindex @command{awk} language, POSIX version
-@cindex POSIX @command{awk}
+@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,9 +7652,8 @@ the value eight; the character sequence @samp{**} is equivalent to
@item @var{x} * @var{y}
Multiplication.
-@cindex common mistakes
-@cindex mistakes, common
-@cindex errors, common
+@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,7 +7677,8 @@ Unary plus and minus have the same precedence,
the multiplication operators all have the same precedence, and
addition and subtraction have the same precedence.
-@cindex differences between @command{gawk} and @command{awk}
+@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,10 +7697,12 @@ One possibly undesirable effect of this definition of remainder is that
@end example
In other @command{awk} implementations, the signedness of the remainder
-may be machine dependent.
+may be machine-dependent.
@c !!! what does posix say?
-@cindex portability issues
+@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,7 +7718,7 @@ Brian Kernighan
@cindex string operators
@cindex operators, string
-@cindex concatenation
+@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,9 +7740,7 @@ $ awk '@{ print "Field number one:" $1 @}' BBS-list
@dots{}
@end example
-@cindex common mistakes
-@cindex mistakes, common
-@cindex errors, common
+@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,8 +7761,7 @@ print "something meaningful" > (file name)
@end example
@cindex order of evaluation, concatenation
-@cindex concatenation evaluation order
-@cindex evaluation, order of
+@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,11 +7840,14 @@ you're never quite sure what you'll get.
@node Assignment Ops, Increment Ops, Concatenation, Expressions
@section Assignment Expressions
+@c STARTOFRANGE asop
@cindex assignment operators
+@c STARTOFRANGE opas
@cindex operators, assignment
-@cindex expression, assignment
-
-@cindex @code{=} operator
+@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,7 +7870,7 @@ message = "this " thing " is " predicate
@end example
@noindent
-@cindex side effects
+@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,8 +7882,10 @@ produce a value, but even if you ignore it, the assignment still
makes itself felt through the alteration of the variable. We call this
a @dfn{side effect}.
-@cindex lvalue
-@cindex rvalue
+@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,9 +7894,9 @@ These are all called @dfn{lvalues},
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}).
+element. (Such values are called @dfn{rvalues}.)
-@cindex types of variables
+@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,7 +7925,7 @@ foo = foo + 5
@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!
+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,6 +7949,8 @@ and then test whether @code{x} equals one. But this style tends to make
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,6 +7989,8 @@ BEGIN @{
@}
@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,13 +8041,18 @@ Raises @var{lvalue} to the power @var{power}.
@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
+@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,14 +8070,19 @@ Raises @var{lvalue} to the power @var{power}.
@item @var{lvalue} @code{**=} @var{power} @tab Raises @var{lvalue} to the power @var{power}.
@end multitable
-@cindex portability issues
+@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 notes
+@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" <beebe@math.utah.edu>
@c Date: Mon, 1 Sep 1997 13:38:35 -0600 (MDT)
@@ -7786,20 +8114,28 @@ awk '/[=]=/' /dev/null
@command{gawk} does not have this problem,
nor do the other
-freely-available versions described in
+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
-@cindex operators, increment
+@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
+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,20 +8156,22 @@ The post-increment @samp{foo++} is nearly the same as writing @samp{(foo
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
-@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
+@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,7 +8180,8 @@ value of the expression.
This expression increments @var{lvalue}, but
the value of the expression is the @emph{old} value of @var{lvalue}.
-@cindex @code{--} operator
+@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,11 +8196,12 @@ value of @var{lvalue}.
@c fakenode --- for prepinfo
@subheading Advanced Notes: Operator Evaluation Order
-@cindex advanced notes
+@c comma before precedence does NOT start tertiary
+@cindex advanced features, operators, precedence
@cindex precedence
-@cindex operator precedence
-@cindex portability issues
-@cindex evaluation, order of
+@cindex operators, precedence
+@cindex portability, operators
+@cindex evaluation order
@cindex Marx, Groucho
@quotation
@i{Doctor, doctor! It hurts when I do this!@*
@@ -7899,15 +8239,18 @@ not anything that you can rely upon for portability.
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 true
-@cindex logical false
+@cindex logical false/true
+@cindex false, logical
+@cindex true, logical
-@cindex null string
-@cindex empty string
+@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,7 +8258,7 @@ equivalents.
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
+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,24 +8280,31 @@ the string constant @code{"0"} is actually true, because it is non-null.
@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
+@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 string
+@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,16 +8432,22 @@ relationships such as equality. They are written using @dfn{relational
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{<} (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,9 +8489,7 @@ and so on. Thus, @code{"10"} is less than @code{"9"}. If there are two
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
+@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,6 +8507,7 @@ part of the test always succeeds. Because the operators are
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,9 +8540,9 @@ $ echo 1e2 3 | awk '@{ print ($1 < $2) ? "true" : "false" @}'
@print{} false
@end example
-@cindex comparisons, string vs. regexp
-@cindex string comparison vs. regexp comparison
-@cindex regexp comparison vs. string comparison
+@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,13 +8569,18 @@ x ~ /foo/
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 regexp as expression
+@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,23 +8594,24 @@ One special place where @code{/foo/} is @emph{not} an abbreviation for
@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 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
+@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,7 +8625,7 @@ Boolean expressions can be used wherever comparison and matching
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
+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,7 +8643,7 @@ both @samp{2400} and @samp{foo}:
if ($0 ~ /2400/ && $0 ~ /foo/) print
@end example
-@cindex side effects
+@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,17 +8679,27 @@ BEGIN @{ if (! ("HOME" in ENVIRON))
@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 continuation
+@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,17 +8728,21 @@ bogus input data, but the point is to illustrate the use of `!',
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 expression
-@cindex expression, conditional
+@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,7 +8766,7 @@ For example, the following expression produces the absolute value of @code{x}:
x >= 0 ? x : -x
@end example
-@cindex side effects
+@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,8 +8784,9 @@ and the other is not.
@xref{Arrays, ,Arrays in @command{awk}},
for more information about arrays.
-@cindex differences between @command{gawk} and @command{awk}
-@cindex line continuation
+@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,14 +8798,14 @@ If @option{--posix} is specified
@node Function Calls, Precedence, Conditional Exp, Expressions
@section Function Calls
-@cindex function call
-@cindex calling a function
+@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,7 +8814,7 @@ functions for use in your program.
@xref{User-defined, ,User-Defined Functions},
for instructions on how to do this.
-@cindex arguments in function call
+@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,6 +8829,7 @@ atan2(y, x) @i{two arguments}
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,7 +8840,7 @@ With built-in functions, space before the parenthesis is harmless, but
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:
+a single argument, the number of which to take the square root:
@example
sqrt(@var{argument})
@@ -8478,7 +8855,7 @@ are omitted in calls to user-defined functions, then those arguments are
treated as local variables and initialized to the empty string
(@pxref{User-defined, ,User-Defined Functions}).
-@cindex side effects
+@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,13 +8872,15 @@ $ awk '@{ print "The square root of", $1, "is", sqrt($1) @}'
@print{} The square root of 3 is 1.73205
5
@print{} The square root of 5 is 2.23607
-@kbd{Ctrl-d}
+@kbd{@value{CTL}-d}
@end example
@node Precedence, , Function Calls, Expressions
@section Operator Precedence (How Operators Nest)
+@c STARTOFRANGE prec
@cindex precedence
-@cindex operator 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,63 +8914,56 @@ the operand, then the precedence of the unary operators can matter.
@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:
+to lowest precedence:
@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.
+@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,6 +8972,27 @@ No special symbol is used to indicate concatenation.
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,45 +9000,74 @@ The relational operators and the redirections have the same precedence
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}),
+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, non-matching.
+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.
+Assignment. These operators group right to left.
@end table
-@cindex portability issues
-@cindex @command{awk} language, POSIX version
-@cindex POSIX @command{awk}
+@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
-@cindex pattern, definition of
+@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,7 +9104,7 @@ building something useful.
@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}:
+The following is a summary of the types of @command{awk} patterns:
@table @code
@item /@var{regular expression}/
@@ -8714,6 +9136,8 @@ The empty pattern matches every input record.
@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,20 +9153,23 @@ END @{ print buzzwords, "buzzwords seen" @}
@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
+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 non-matching are also very common 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,6 +9178,12 @@ is used as a dynamic regular expression
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,11 +9201,14 @@ $ awk '$1 ~ /foo/ @{ print $2 @}' BBS-list
@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,6 +9249,8 @@ $ awk '! /foo/' BBS-list
@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,9 +9261,11 @@ appear inside Boolean patterns.
@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
+@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,6 +9288,8 @@ input record; when this succeeds, the range pattern is turned off again
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,7 +9298,7 @@ to distinguish them from the records you are interested in.
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
+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,8 +9314,8 @@ looks like this:
@end example
@noindent
-@cindex skipping lines between markers
-@cindex flag variables
+@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,7 +9328,7 @@ skip == 1 @{ next @} # skip lines with `skip' set
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:
+program attempts to combine a range pattern with another, simpler test:
@example
echo Yes | awk '/1/,/2/ || /Yes/'
@@ -8908,11 +9350,10 @@ $ echo yes | gawk '(/1/,/2/) || /Yes/'
@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}
+@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,6 +9384,8 @@ $ awk '
@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,17 +9415,17 @@ library functions, because each library file can have its own @code{BEGIN} and/o
@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
+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
+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 end of file was seen.} However, if an
+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,7 +9433,7 @@ rule checks the @code{FNR} and @code{NR} variables.
@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}
+@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,9 +9443,13 @@ executing @code{BEGIN} rules. References to @code{$0} and the fields
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}.
+Another way is simply to assign a value to @code{$0}.
-@cindex differences between @command{gawk} and @command{awk}
+@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,19 +9471,25 @@ this in @code{BEGIN} rules, it is a very bad idea in @code{END} rules,
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 pattern, empty
-An empty (i.e., non-existent) pattern is considered to match @emph{every}
+@cindex patterns, empty
+An empty (i.e., nonexistent) pattern is considered to match @emph{every}
input record. For example, the program:
@example
@@ -9045,12 +9498,13 @@ awk '@{ print $1 @}' BBS-list
@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 shell varibles, using in @command{awk} programs
-@cindex using shell variables in @command{awk} programs
-@cindex shell and @command{awk} interaction
+@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,6 +9513,7 @@ hold a pattern that the @command{awk} program searches for.
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,10 +9565,11 @@ use---without requiring the quoting tricks at every point in the program.
@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
+@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,8 +9587,14 @@ function @var{name}(@var{args}) @{ @dots{} @}
@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{@{} and @samp{@}}). Each statement specifies one
+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,53 +9608,67 @@ well. An omitted action is equivalent to @samp{@{ print $0 @}}:
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
+@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, which specify the control flow of @command{awk}
+@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, which consist of one or more statements enclosed in
+@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 using the @code{getline} command
-(@pxref{Getline, ,Explicit Input with @code{getline}}), the @code{next}
+@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}.
+@item Output statements
+Such as @code{print} and @code{printf}.
@xref{Printing, ,Printing Output}.
-@item
-Deletion statements for deleting array elements.
+@item Deletion statements
+For deleting array elements.
@xref{Delete, ,The @code{delete} Statement}.
-@end itemize
+@end table
@node Statements, Built-in Variables, Action Overview, Patterns and Actions
@section Control Statements in Actions
-@cindex control statement
+@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.
-@cindex compound statement
-@cindex statement, compound
+@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,7 +9697,7 @@ newlines or semicolons.
@node If Statement, While Statement, Statements, Statements
@subsection The @code{if}-@code{else} Statement
-@cindex @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,7 +9711,7 @@ statement does. If the @var{condition} is true, @var{then-body} is
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.
+the null string; otherwise, the condition is true.
Refer to the following:
@example
@@ -9247,7 +9723,7 @@ else
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}
+@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,8 +9745,8 @@ the first thing on its line.
@node While Statement, Do Statement, If Statement, Statements
@subsection The @code{while} Statement
@cindex @code{while} statement
-@cindex loop
-@cindex body of a loop
+@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,6 +9759,7 @@ while (@var{condition})
@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,7 +9841,7 @@ The following is an example of a @code{do} statement:
@end example
@noindent
-This program prints each input record ten times. However, it isn't a very
+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,7 +9888,7 @@ such as @samp{x = y = 0}. This makes sense only if all the initial values
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
+@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,6 +9921,7 @@ while (@var{condition}) @{
@}
@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,11 +10002,12 @@ an @code{if}:
@}
@end example
-@cindex @code{break}, outside of loops
-@cindex historical features
-@cindex @command{awk} language, POSIX version
-@cindex POSIX @command{awk}
-@cindex dark corner
+@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,9 +10050,9 @@ BEGIN @{
@end example
@noindent
-This program prints all the numbers from 0 to 20---except for five, for
+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 five. Contrast the
+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,13 +10069,14 @@ BEGIN @{
@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
+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,6 +10105,7 @@ Contrast this with the effect of the @code{getline} function
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,11 +10131,16 @@ Because of the @code{next} statement,
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
+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,7 +10158,7 @@ then the code in any @code{END} rules is executed.
@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}
+@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,7 +10199,8 @@ If it's necessary to use an @command{awk} version that doesn't support
for a user-defined function that simulates the @code{nextfile}
statement.
-@cindex @code{nextfile}, inside a user-defined function
+@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,7 +10210,10 @@ statement inside function bodies
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
+@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,6 +10234,8 @@ is ignored. The @code{exit} statement is written as follows:
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,7 +10257,7 @@ the @code{END} rule.
@xref{Assert Function, ,Assertions},
for an example that does this.
-@cindex dark corner
+@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,8 +10266,7 @@ called a second time from an @code{END} rule with no argument,
@command{awk} uses the previously supplied exit value.
@value{DARKCORNER}
-@cindex conventions, programming
-@cindex programming conventions
+@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,12 +10283,18 @@ BEGIN @{
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 for you to use for your own
+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,6 +10303,7 @@ to tell @command{awk} how to do certain things. Others are set
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,7 +10318,10 @@ describing their areas of activity.
@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
+@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,12 +10329,11 @@ specific to @command{gawk} are marked with a pound sign (@samp{#}).
@table @code
@cindex @code{BINMODE} variable
-@cindex binary I/O
-@cindex I/O, binary
-@cindex differences between @command{gawk} and @command{awk}
+@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
+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,6 +10345,7 @@ generates a warning message.
@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,8 +10355,9 @@ or if @command{gawk} is in compatibility mode
it is not special.
@cindex @code{CONVFMT} variable
-@cindex @command{awk} language, POSIX version
-@cindex POSIX @command{awk}
+@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,6 +10368,9 @@ Its default value is @code{"%.6g"}.
@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,12 +10378,15 @@ Assigning a value to @code{FIELDWIDTHS}
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,6 +10398,7 @@ character in the record becomes a separate field.
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,15 +10412,20 @@ You can set the value of @code{FS} on the command line using the
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
+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,22 +10433,24 @@ functions, record termination with @code{RS}, and field splitting with
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 between @command{gawk} and @command{awk}
-@cindex lint checks
+@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 non-fatal warnings.
+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,6 +10461,8 @@ of lint warnings during program execution is independent of the flavor
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,7 +10473,11 @@ Its default value is @code{"%.6g"}. Earlier versions of @command{awk}
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,6 +10490,8 @@ This is the output record separator. It is output at the end of every
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,6 +10510,8 @@ or if @command{gawk} is in compatibility mode
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,12 +10520,13 @@ really accesses @code{foo["A\034B"]}
(@pxref{Multi-dimensional, ,Multidimensional Arrays}).
@cindex @code{TEXTDOMAIN} variable
-@cindex internationalization
+@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} and @code{bindtextdomain} functions
+@code{dcgettext}, @code{dcngettext} and @code{bindtextdomain} functions
(@pxref{Internationalization, ,Internationalization with @command{gawk}}).
The default value of @code{TEXTDOMAIN} is @code{"messages"}.
@@ -10009,19 +10536,27 @@ or if @command{gawk} is in compatibility mode
(@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
-@cindex built-in variables, 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} variable
-@cindex @code{ARGV} variable
+@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,13 +10577,12 @@ $ awk 'BEGIN @{
@noindent
@code{ARGV[0]} contains @code{"awk"}, @code{ARGV[1]}
-contains @code{"inventory-shipped"} and @code{ARGV[2]} contains
+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
+@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,17 +10594,21 @@ Also, you should note that the program text is @emph{not} included in
about how @command{awk} uses these variables.
@cindex @code{ARGIND} variable
+@cindex differences in @command{awk} and @command{gawk}, @code{ARGIND} variable
@item ARGIND #
-This is the index in @code{ARGV} of the current file being processed.
+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,6 +10620,7 @@ or if @command{gawk} is in compatibility mode
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,6 +10636,8 @@ On such systems, the @code{ENVIRON} array is empty (except for
@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,10 +10649,10 @@ or if @command{gawk} is in compatibility mode
(@pxref{Options, ,Command-Line Options}),
it is not special.
-@cindex dark corner
@cindex @code{FILENAME} variable
+@cindex dark corner, @code{FILENAME} variable
@item FILENAME
-This is the name of the file that @command{awk} is currently reading.
+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,32 +10664,33 @@ yet.@footnote{Some early implementations of Unix @command{awk} initialized
processed. This behavior was incorrect and should not be relied
upon in your programs.}
@value{DARKCORNER}
-Note though, that using @code{getline}
+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
+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.
+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 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
+@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,7 +10739,7 @@ it is not special.
@cindex @code{RLENGTH} variable
@item RLENGTH
-This is the length of the substring matched by the
+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,7 +10747,7 @@ is the length of the matched string, or @minus{}1 if no match is found.
@cindex @code{RSTART} variable
@item RSTART
-This is the start-index in characters of the substring that is matched by the
+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,6 +10755,7 @@ is the position of the string where the matched substring starts, or zero
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,11 +10766,15 @@ or if @command{gawk} is in compatibility mode
(@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 advanced notes
-@cindex dark corner
+@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,6 +10804,9 @@ changed.
@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,7 +10905,7 @@ the @command{awk} program's options, in the following manner:
awk -f myprog -- -v -d file1 file2 @dots{}
@end example
-@cindex differences between @command{gawk} and @command{awk}
+@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,6 +10924,8 @@ are passed on to the @command{awk} program.
@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,8 +10939,11 @@ arrays, as well as some of the less obvious points about array usage.
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}
+@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,7 +10972,6 @@ same @command{awk} program.
@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
@@ -10480,14 +11034,17 @@ conceptually, if the element values are 8, @code{"foo"},
@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
+the values. Here, 8 is the value at index zero, because 8 appears in the
position with zero elements before it.
-@cindex arrays, definition of
+@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
+that each array is a collection of pairs: an index and its corresponding
array element value:
@example
@@ -10521,7 +11078,7 @@ It has elements 0--3 and 10, but doesn't have elements 4, 5, 6, 7, 8, or 9.
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:
+English to French:
@example
@r{Element} "dog" @r{Value} "chien"
@@ -10540,9 +11097,9 @@ in more detail in
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
+@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,12 +11110,13 @@ that array's indices are consecutive integers starting at one.
@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 array reference
-@cindex element of array
-@cindex reference to array
+@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,8 +11141,8 @@ automatically creates that array element, with the null string as its value.
(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
+@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,9 +11150,9 @@ the following expression:
@var{index} in @var{array}
@end example
-@cindex side effects
+@cindex side effects, array indexing
@noindent
-This expression tests whether or not the particular index exists,
+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,8 +11177,8 @@ if (frequencies[2] != "")
@node Assigning Elements, Array Example, Reference to Elements, Arrays
@section Assigning Array Elements
-@cindex array assignment
-@cindex element assignment
+@cindex arrays, elements, assigning
+@cindex elements in arrays, assigning
Array elements can be assigned values just like
@command{awk} variables:
@@ -10680,7 +11238,7 @@ When this program is run with the following input:
@end example
@noindent
-its output is:
+Its output is:
@example
1 Who is number one?
@@ -10705,10 +11263,8 @@ END @{
@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
+@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,9 +11281,12 @@ for (@var{var} in @var{array})
@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,20 +11319,22 @@ END @{
@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 or not the @code{for} loop will
+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 of arrays
-@cindex removing elements of arrays
-@cindex arrays, deleting an element
+@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,6 +11365,7 @@ if (4 in foo)
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,7 +11376,7 @@ if (4 in foo)
print "This is printed, even though foo[4] is empty"
@end example
-@cindex lint checks
+@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,7 +11385,7 @@ is not in the array is deleted.
@cindex arrays, deleting entire contents
@cindex deleting entire arrays
-@cindex differences between @command{gawk} and @command{awk}
+@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,15 +11401,17 @@ Using this version of the @code{delete} statement is about three times
more efficient than the equivalent loop that deletes each element one
at a time.
-@cindex portability issues
+@cindex portability, deleting array elements
@cindex Brennan, Michael
-The following statement provides a portable but non-obvious way to clear
+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,9 +11429,10 @@ a[1] = 3; delete a; a = 3
@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
+@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,6 +11462,7 @@ string value from @code{xyz}---this time @code{"12.15"}---because the value of
@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,8 +11477,8 @@ for (i = 1; i <= maxsub; i++)
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
+(@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,8 +11495,11 @@ effect on your programs.
@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 arrays, subscripts, uninitialized variables
+@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,9 +11542,9 @@ Here, the @samp{++} forces @code{lines} to be numeric, thus making
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
+@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,9 +11555,8 @@ on the command line (@pxref{Options, ,Command-Line Options}).
@node Multi-dimensional, Multi-scanning, Uninitialized Subscripts, Arrays
@section Multidimensional Arrays
-@cindex subscripts in arrays
-@cindex arrays, multidimensional subscripts
-@cindex multidimensional subscripts
+@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,7 +11564,7 @@ languages, including @command{awk}) to refer to an element of a
two-dimensional array named @code{grid} is with
@code{grid[@var{x},@var{y}]}.
-@cindex @code{SUBSEP} variable
+@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,7 +11587,7 @@ expressions @samp{foo[5,12]} and @w{@samp{foo[5 SUBSEP 12]}} are always
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
+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,7 +11597,7 @@ combined strings that are ambiguous. Suppose that @code{SUBSEP} is
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
+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,7 +11608,7 @@ in parentheses, separated by commas, as the left operand:
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.
+elements:
@example
@{
@@ -11086,10 +11654,12 @@ the program produces the following output:
@section Scanning Multidimensional Arrays
There is no special @code{for} statement for scanning a
-``multidimensional'' array. There cannot be one, because in truth there
+``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,7 +11702,10 @@ separate indices is recovered.
@section Sorting Array Values and Indices with @command{gawk}
@cindex arrays, sorting
-@cindex @code{asort} built-in function
+@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,7 +11731,7 @@ The comparison of array elements is done
using @command{gawk}'s usual comparison rules
(@pxref{Typing and Comparison, ,Variable Typing and Comparison Expressions}).
-@cindex side effects
+@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,7 +11770,7 @@ Sorting the array by replacing the indices provides maximal flexibility.
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
+@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,20 +11779,24 @@ both arrays use the values. Similarly, when copying the indices from
@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
+@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 to internationalize and localize programs.
+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,7 +11812,6 @@ The second half of this @value{CHAPTER} describes these
@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
@@ -11260,18 +11836,21 @@ but are summarized here for your convenience.
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.
+is a call to the function @code{atan2} and has two arguments.
-@cindex conventions, programming
-@cindex programming conventions
+@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.
-@cindex fatal errors
-@cindex differences between @command{gawk} and @command{awk}
+@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,8 +11867,9 @@ i = 4
j = sqrt(i++)
@end example
-@cindex evaluation, order of
-@cindex order of evaluation
+@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,7 +11884,7 @@ j = atan2(i++, i *= 2)
@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
+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,48 +11894,49 @@ two arguments 11 and 10.
The following list describes all of
the built-in functions that work with numbers.
-Optional parameters are enclosed in square brackets ([ and ]):
+Optional parameters are enclosed in square brackets ([ ]):
@table @code
@item int(@var{x})
-@cindex @code{int} built-in function
+@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 three, @code{int(3.9)} is three, @code{int(-3.9)}
+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} built-in function
+@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 two.
+if @var{x} is negative. Thus, @code{sqrt(4)} is 2.
@item exp(@var{x})
-@cindex @code{exp} built-in function
+@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} built-in function
+@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} built-in function
+@cindex @code{sin} function
This returns the sine of @var{x}, with @var{x} in radians.
@item cos(@var{x})
-@cindex @code{cos} built-in function
+@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} built-in function
+@cindex @code{atan2} function
This returns the arctangent of @code{@var{y} / @var{x}} in radians.
@item rand()
-@cindex @code{rand} built-in function
+@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,7 +11962,7 @@ an integer between zero and @code{n} @minus{} 1, inclusive.
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.
+each input record:
@example
# Function to roll a simulated die.
@@ -11395,7 +11976,7 @@ function roll(n) @{ return 1 + int(rand() * n) @}
@}
@end example
-@cindex seed for random numbers
+@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,19 +11990,19 @@ the seed to a value that is different in each run. To do this,
use @code{srand}.
@item srand(@r{[}@var{x}@r{]})
-@cindex @code{srand} built-in function
+@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 ``pseudo-random.'' This means
+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
+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,11 +12017,11 @@ sequences of random numbers.
@end table
@node String Functions, I/O Functions, Numeric Functions, Built-in
-@subsection String Manipulation Functions
+@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 ]).
+Optional parameters are enclosed in square brackets ([ ]).
Those functions that are
specific to @command{gawk} are marked with a pound sign (@samp{#}):
@@ -11452,7 +12033,8 @@ specific to @command{gawk} are marked with a pound sign (@samp{#}):
@table @code
@item asort(@var{source} @r{[}, @var{dest}@r{]}) #
-@cindex @code{asort} built-in function
+@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,14 +12066,14 @@ a[2] = "de"
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
+@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,7 +12088,7 @@ If @var{find} is not found, @code{index} returns zero.
(Remember that string indices in @command{awk} start at one.)
@item length(@r{[}@var{string}@r{]})
-@cindex @code{length} built-in function
+@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,10 +12098,9 @@ three characters.
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}
+@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,11 +12111,11 @@ version of the standard. Therefore, for programs to be maximally portable,
always supply the parentheses.
@item match(@var{string}, @var{regexp} @r{[}, @var{array}@r{]})
-@cindex @code{match} built-in function
+@cindex @code{match} function
The @code{match} function searches @var{string} for the
-longest leftmost substring matched by the regular expression,
+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
+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,8 +12124,9 @@ functions that work with regular expressions, such as
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
+@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,40 +12175,38 @@ Match of ru+n found at 12 in My program runs
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
+@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
-sub-expression.
+subexpression.
For example:
@example
$ echo foooobazbarrrrr |
-> gawk '@{ match($0, /(fo+).+(ba*r)/, arr)
+> gawk '@{ match($0, /(fo+).+(bar*)/, arr)
> print arr[1], arr[2] @}'
@print{} foooo barrrrr
@end example
-@cindex fatal errors
+@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} built-in function
-This function divides @var{string} into pieces separated by @var{fieldsep},
+@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
-the @var{fieldsep} is omitted, the value of @code{FS} is used.
+@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:
@@ -11636,6 +12216,7 @@ split("cul-de-sac", a, "-")
@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,15 +12229,15 @@ a[3] = "sac"
@noindent
The value returned by this call to @code{split} is three.
-@cindex differences between @command{gawk} and @command{awk}
+@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
+@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
+@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,7 +12250,7 @@ If @var{string} does not match @var{fieldsep} at all, @var{array} has
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
+@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,7 +12263,8 @@ pival = sprintf("pi = %.2f (approx.)", 22/7)
@noindent
assigns the string @w{@code{"pi = 3.14 (approx.)"}} to the variable @code{pival}.
-@cindex @code{strtonum} built-in function
+@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,17 +12282,17 @@ Using the @code{strtonum} function is @emph{not} the same as adding zero
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.}
+@xref{Nondecimal Data, ,Allowing Nondecimal Input Data}, for more information.}
-@cindex differences between @command{gawk} and @command{awk}
+@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} built-in function
+@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}.
+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,7 +12340,7 @@ $ awk 'BEGIN @{
@end example
@noindent
-This shows how @samp{&} can represent a non-constant string and also
+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,15 +12348,15 @@ The effect of this special character (@samp{&}) can be turned off by putting a
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
+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}, third argument of
-@cindex @code{gsub}, third argument of
+@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,9 +12371,9 @@ sub(/USA/, "United States", "the USA and Canada")
@end example
@noindent
-@cindex fatal errors
+@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 non-changeable
+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,9 +12381,9 @@ Finally, if the @var{regexp} is not a regexp constant, it is converted into a
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
+@cindex @code{gsub} function
This is similar to the @code{sub} function, except @code{gsub} replaces
-@emph{all} of the longest, leftmost, @emph{non-overlapping} matching
+@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,7 +12402,7 @@ As in @code{sub}, the characters @samp{&} and @samp{\} are special,
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
+@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,7 +12433,6 @@ $ gawk '
@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{&}.
@@ -11868,8 +12449,8 @@ In this case, @code{$0} is used as the default target string.
@code{gensub} returns the new string as its result, which is
passed directly to @code{print} for printing.
-@cindex automatic warnings
-@cindex warnings, automatic
+@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,16 +12459,15 @@ a warning message.
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
+@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++, where the first character is number zero.}
+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,11 +12475,14 @@ If @var{length} is not present, this function returns the whole suffix of
@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}.
+in the string, counting from character @var{start}.
-@cindex common mistakes
-@cindex mistakes, common
-@cindex errors, common
+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,7 +12501,7 @@ of @code{sub} or @code{gsub}:
gsub(/xyz/, "pdq", substr($0, 5, 20)) # WRONG
@end example
-@cindex portability issues
+@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,30 +12514,34 @@ string = "abcdef"
string = substr(string, 1, 2) "CDE" substr(string, 6)
@end example
-@cindex case conversion
-@cindex conversion of case
+@cindex case sensitivity, converting case
+@cindex converting, case
@item tolower(@var{string})
-@cindex @code{tolower} built-in function
+@cindex @code{tolower} 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,
+Nonalphabetic 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
+@cindex @code{toupper} 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,
+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{sub} et. al.
-@cindex @code{sub}, escape processing
-@cindex @code{gsub}, escape processing
-@cindex @code{gensub}, escape processing
+@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,14 +12608,14 @@ through unchanged. To illustrate with a table:
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
+(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.
-@cindex @command{awk} language, POSIX version
-@cindex POSIX @command{awk}
+@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,7 +12723,7 @@ The rules for @code{gensub} are considerably simpler. At the runtime
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
+no matter what character follows the @samp{\}, it
appears in the generated text and the @samp{\} does not:
@tex
@@ -12177,8 +12764,13 @@ to do substitutions.
@c fakenode --- for prepinfo
@subheading Advanced Notes: Matching the Null String
-@cindex advanced notes
-@cindex 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,12 +12787,13 @@ Although this makes a certain amount of sense, it can be surprising.
@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 ]):
+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} built-in function
+@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,7 +12801,7 @@ for redirecting to or from a pipe; then the coprocess or pipe is closed.
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
+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,18 +12810,16 @@ not matter.
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
+@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
+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,30 +12834,32 @@ version of @command{awk} in 1994; it is not part of the POSIX standard and is
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.
-@cindex automatic warnings
-@cindex warnings, automatic
+@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.
+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.
+@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.
+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}
+@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,7 +12888,7 @@ close("/bin/sh")
@end example
@noindent
-@cindex fatal errors
+@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,15 +12897,12 @@ Some operating systems cannot implement the @code{system} function.
@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
+@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
+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,7 +12910,7 @@ to a terminal device.}
@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
+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,7 +12920,7 @@ $ awk '@{ print $1 + $2 @}'
@print{} 2
2 3
@print{} 5
-@kbd{Ctrl-d}
+@kbd{@value{CTL}-d}
@end example
@noindent
@@ -12341,21 +12931,20 @@ with this example:
$ awk '@{ print $1 + $2 @}' | cat
1 1
2 3
-@kbd{Ctrl-d}
+@kbd{@value{CTL}-d}
@print{} 2
@print{} 5
@end example
@noindent
-Here, no output is printed until after the @kbd{Ctrl-d} is typed, because
+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 notes
-@cindex flushing buffers
+@cindex advanced features, buffering
@cindex buffers, flushing
-@cindex buffering output
+@cindex buffering, input/output
@cindex output, buffering
The @code{fflush} function provides explicit control over output buffering for
@@ -12406,40 +12995,51 @@ first print
second print
@end example
-If @command{awk} did not flush its buffers before calling @code{system}, the
-latter (undesirable) output is what you see.
+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
-@cindex time of day
-A common use for @command{awk} programs is the processing of log files
+@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 for ``Epoch'' and ``UTC.''}
+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. It's use may be preferable
+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 ([ and ]):
+Optional parameters are enclosed in square brackets ([ ]):
@table @code
@item systime()
-@cindex @code{systime} built-in function
+@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,7 +13047,7 @@ It may be a different number on
other systems.
@item mktime(@var{datespec})
-@cindex @code{mktime} built-in function
+@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,14 +13058,14 @@ from 1 to 31, the hour of the day from 0 to 23, the minute from 0 to
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.
+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
+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,7 +13074,8 @@ If @var{datespec} does not contain enough elements or if the resulting time
is out of range, @code{mktime} returns @minus{}1.
@item strftime(@r{[}@var{format} @r{[}, @var{timestamp}@r{]]})
-@cindex @code{strftime} built-in function
+@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,9 +13093,9 @@ log file with the current time of day. In particular, it is easy to
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 converting, dates to timestamps
@cindex dates, converting to timestamps
-@cindex timestamps, converting from dates
+@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,16 +13105,16 @@ The @code{strftime} function allows you to easily turn a timestamp
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
+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:
-@cindex format specifier, @code{strftime}
@table @code
@item %a
The locale's abbreviated weekday name.
@@ -12550,9 +13151,9 @@ This is the ISO 8601 date format.
@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
+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
+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,7 +13195,7 @@ Equivalent to specifying @samp{%H:%M}.
The second as a decimal number (00--60).
@item %t
-A tab character.
+A TAB character.
@item %T
Equivalent to specifying @samp{%H:%M:%S}.
@@ -12606,13 +13207,13 @@ The weekday as a decimal number (1--7). Monday is day one.
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
+@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
+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,8 +13237,8 @@ The year modulo 100 as a decimal number (00--99).
@item %Y
The full year as a decimal number (e.g., 1995).
-@cindex RFC 822
-@cindex RFC 1036
+@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,7 +13249,7 @@ no time zone is determinable.
@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
+``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,9 +13267,9 @@ undefined.@footnote{This is because ISO C leaves the
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.}
+returned string or appears literally.}
-@cindex locale, definition of
+@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,11 +13290,11 @@ then the following additional format specifications are available:
@table @code
@item %k
The hour (24-hour clock) as a decimal number (0--23).
-Single digit numbers are padded with a space.
+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.
+Single-digit numbers are padded with a space.
@item %N
The ``Emperor/Era'' name.
@@ -12709,15 +13310,18 @@ The time as a decimal timestamp in seconds since the epoch.
@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 non-format specifier characters to the standard output and
+copies nonformat specifier characters to the standard output and
interprets the current time according to the format specifiers in
the string. For example:
@@ -12758,18 +13362,28 @@ gawk 'BEGIN @{
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 Using @command{gawk}'s Bit Manipulation Functions
-@cindex bitwise operations
+@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
-@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.
@@ -12816,7 +13430,7 @@ Operands | 0 | 1 | 0 | 1 | 0 | 1
}}}
@end tex
-@cindex bitwise complement
+@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,7 +13441,7 @@ The next operation is the @dfn{complement}; the complement of 1 is 0 and
the complement of 0 is 1. Thus, this operation ``flips'' all the bits
of a given value.
-@cindex bitwise shift
+@cindex bitwise, shift
@cindex left shift, bitwise
@cindex right shift, bitwise
@cindex shift, bitwise
@@ -12846,56 +13460,57 @@ bitwise operations just described. They are:
@ignore
@table @code
-@cindex @code{and} built-in function
+@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} built-in function
+@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} built-in function
+@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} built-in function
+@cindex @code{compl} function (@command{gawk})
@item compl(@var{val})
Return the bitwise complement of @var{val}.
-@cindex @code{lshift} built-in function
+@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} built-in function
+@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} built-in function
+@cindex @code{and} function (@command{gawk})
@item @code{and(@var{v1}, @var{v2})}
-@tab Return the bitwise AND of the values provided by @var{v1} and @var{v2}.
+@tab Returns the bitwise AND of the values provided by @var{v1} and @var{v2}.
-@cindex @code{or} built-in function
+@cindex @code{or} function (@command{gawk})
@item @code{or(@var{v1}, @var{v2})}
-@tab Return the bitwise OR of the values provided by @var{v1} and @var{v2}.
+@tab Returns the bitwise OR of the values provided by @var{v1} and @var{v2}.
-@cindex @code{xor} built-in function
+@cindex @code{xor} function (@command{gawk})
@item @code{xor(@var{v1}, @var{v2})}
-@tab Return the bitwise XOR of the values provided by @var{v1} and @var{v2}.
+@tab Returns the bitwise XOR of the values provided by @var{v1} and @var{v2}.
-@cindex @code{compl} built-in function
+@cindex @code{compl} function (@command{gawk})
@item @code{compl(@var{val})}
-@tab Return the bitwise complement of @var{val}.
+@tab Returns the bitwise complement of @var{val}.
-@cindex @code{lshift} built-in function
+@cindex @code{lshift} function (@command{gawk})
@item @code{lshift(@var{val}, @var{count})}
-@tab Return the value of @var{val}, shifted left by @var{count} bits.
+@tab Returns the value of @var{val}, shifted left by @var{count} bits.
-@cindex @code{rshift} built-in function
+@cindex @code{rshift} function (@command{gawk})
@item @code{rshift(@var{val}, @var{count})}
-@tab Return the value of @var{val}, shifted right by @var{count} bits.
+@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,11 +13595,14 @@ $ gawk -f testbits.awk
@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.
-AND-ing the mask with the value indicates whether the
+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,55 +13611,78 @@ until there are no more 1 bits.
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.
+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{Non-decimal-numbers, ,Octal and Hexadecimal 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
+@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 description here is purposely brief.
+The descriptions here are purposely brief.
@xref{Internationalization, ,Internationalization with @command{gawk}},
for the full story.
-Optional parameters are enclosed in square brackets ([ and ]):
+Optional parameters are enclosed in square brackets ([ ]):
@table @code
-@cindex @code{dcgettext} built-in function
+@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{bindtextdomain} built-in function
+@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 where
+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 where @var{domain} is ``bound.''
+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
-@cindex user-defined functions
-@cindex function, user-defined
+@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.
+them, i.e., to tell @command{awk} what they should do.
@menu
* Definition Syntax:: How to write definitions and what they mean.
@@ -13054,9 +13695,9 @@ them; i.e., to tell @command{awk} what they should do.
@node Definition Syntax, Function Example, User-defined, User-defined
@subsection Function Definition Syntax
-@cindex defining functions
-@cindex function definition
+@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,12 +13716,13 @@ function @var{name}(@var{parameter-list})
@}
@end example
-@cindex names, use of
-@cindex namespace issues in @command{awk}
+@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.
+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,16 +13752,15 @@ arguments on some occasions and local variables on others. Another
way to think of this is that omitted arguments default to the
null string.
-@cindex conventions, programming
-@cindex programming conventions
+@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 variable shadowing
+@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
+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,15 +13771,16 @@ The arguments and local variables last only as long as the function body
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
+@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}.
-@cindex @command{awk} language, POSIX version
-@cindex POSIX @command{awk}
+@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,7 +13802,8 @@ syntactically valid, because functions may be used before they are defined
in @command{awk} programs.)
@c NEXT ED: This won't actually run, since foo() is undefined ...
-@cindex portability issues
+@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,14 +13864,15 @@ Instead of having
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 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.
+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,6 +13898,7 @@ The following example uses the built-in @code{strftime} function
(@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,12 +13915,13 @@ function ctime(ts, format)
@}
@c endfile
@end example
+@c ENDOFRANGE fdef
@node Function Caveats, Return Statement, Function Example, User-defined
@subsection Calling User-Defined Functions
-@cindex calling a function
-@cindex function call
+@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,7 +13974,7 @@ function myfunc(str)
@end example
@noindent
-to change its first argument variable @code{str}, it @emph{does not}
+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,6 +13982,8 @@ cannot alter this outer value, because it is shadowed during the
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,7 +14009,7 @@ BEGIN @{
@end example
@noindent
-This program prints @samp{a[1] = 1, a[2] = two, a[3] = 3}, because
+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,24 +14031,26 @@ function bar() @{ @dots{} @}
@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 that @code{foo} has not been defined. Usually, though, it is a
problem if a program calls an undefined function.
-@cindex lint checks
+@cindex lint checking, undefined functions
If @option{--lint} is specified
(@pxref{Options, ,Command-Line Options}),
@command{gawk} reports calls to undefined functions.
-@cindex portability issues
+@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
-@cindex @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,16 +14089,15 @@ function maxelt(vec, i, ret)
@}
@end example
-@cindex conventions, programming
-@cindex programming conventions
+@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 two or three 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. This is a convention that
-you should follow when you define functions.
+@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,7 +14139,7 @@ the program reports (predictably) that @code{99385} is the largest number
in the array.
@node Dynamic Typing, , Return Statement, User-defined
-@subsection Functions and Their Effect on Variable Typing
+@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,19 +14163,24 @@ BEGIN @{
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 only worked in English.
+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.
-@cindex internationalization features in @command{gawk}
+@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,10 +14205,12 @@ a requirement.
@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.
+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,8 +14221,9 @@ monetary values are printed and read.
@node Explaining gettext, Programmer i18n, I18N and L10N, Internationalization
@section GNU @code{gettext}
-@cindex @code{gettext}, how it works
@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,8 +14231,9 @@ port doesn't support GNU @code{gettext}. This applies most notably to
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},
+@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,7 +14253,7 @@ A table with strings of option names is not (e.g., @command{gawk}'s
@option{--profile} option should remain the same, no matter what the local
language).
-@cindex @code{textdomain} C library function
+@cindex @code{textdomain} function (C library)
@item
The programmer indicates the application's text domain
(@code{"guide"}) to the @code{gettext} library,
@@ -13603,18 +14261,24 @@ by calling the @code{textdomain} function.
@item
Messages from the application are extracted from the source code and
-collected into a Portable Object file (@file{guide.po}),
+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})
+@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 message object files (@code{gettext})
+@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,12 +14290,16 @@ at runtime.
When @command{guide} is built and installed, the binary translation files
are installed in a standard place.
-@cindex @code{bindtextdomain} C library function
+@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,7 +14312,7 @@ having to switch the application's default text domain back
and forth.
@end enumerate
-@cindex @code{gettext} C library function
+@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,7 +14323,8 @@ printf(gettext("Don't Panic!\n"));
The tools that extract messages from source code pull out all
strings enclosed in calls to @code{gettext}.
-@cindex @code{_} C macro (@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,6 +14337,8 @@ at, use the macro @samp{_} (an underscore) to make things easier:
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,20 +14354,23 @@ Text messages. This is the default category for @code{gettext}
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
+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
+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,25 +14382,31 @@ Numeric information, such as which characters to use for the decimal
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}.}
+@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
+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,14 +14418,14 @@ This variable indicates the application's text domain.
For compatibility with GNU @code{gettext}, the default
value is @code{"messages"}.
-@cindex internationalization, marked strings
-@cindex marked strings for internationalization
+@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} built-in function
+@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,13 +14449,29 @@ the C version. The @command{awk} version's order was
chosen to be simple and to allow for reasonable @command{awk}-style
default arguments.
-@cindex @code{bindtextdomain} built-in function
+@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 where
+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 where @var{domain} is ``bound.''
+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,6 +14490,8 @@ the previous @value{SECTION},
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,6 +14506,8 @@ BEGIN @{
@}
@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,7 +14522,7 @@ printf(_"Number of users is %d\n", nusers)
@item
If you are creating strings dynamically, you can
still translate them, using the @code{dcgettext}
-built-in function.
+built-in function:
@example
message = nusers " users logged in"
@@ -13834,6 +14534,7 @@ Here, the call to @code{dcgettext} supplies a different
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,12 +14556,16 @@ BEGIN @{
@end enumerate
@xref{I18N Example, ,A Simple Internationalization Example},
-for an example program showing the steps necessary to create
+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,12 +14585,16 @@ is covered.
@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
-@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.
@@ -13901,10 +14610,10 @@ When run with @option{--gen-po}, @command{gawk} does not execute your
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.}
+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,8 +14621,9 @@ translations for @command{guide}.
@node Printf Ordering, I18N Portability, String Extraction, Translator i18n
@subsection Rearranging @code{printf} Arguments
-@cindex @code{printf}, positional specifier
-@cindex positional specifier, @code{printf}
+@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,7 +14659,7 @@ For example:
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, @samp{string} is the first argument and @samp{length(string)} is the second:
@example
$ gawk 'BEGIN @{
@@ -13978,11 +14688,12 @@ $ gawk 'BEGIN @{
@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.
+This is somewhat counterintutive.
-@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})
+@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,9 +14715,8 @@ is first written.
@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
+@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,9 +14734,10 @@ BEGIN @{
@noindent
As written, it won't work on other versions of @command{awk}.
However, it is actually almost portable, requiring very little
-change.
+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,13 +14751,14 @@ the null string (@code{""}) as its value, leaving the original string constant a
the result.
@item
-By defining ``dummy'' functions to replace @code{dcgettext}
+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} user-defined function
-@cindex @code{dcgettext} user-defined function
+@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,6 +14770,11 @@ function dcgettext(string, domain, category)
@{
return string
@}
+
+function dcngettext(string1, string2, number, domain, category)
+@{
+ return (number == 1 ? string1 : string2)
+@}
@c endfile
@end example
@@ -14075,6 +14792,7 @@ However, since the positional specifications are primarily for use in
@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,6 +14883,14 @@ layout:
$ 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,7 +14912,7 @@ $ gawk -f guide.awk
@print{} Pardon me, Zaphod who?
@end example
-If the two replacement functions for @code{dcgettext}
+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,7 +14941,7 @@ complete detail in
@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}.
+@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,11 +14954,15 @@ configure @command{gawk} with the @option{--with-included-gettext} option
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
-@cindex features, advanced
+@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 <pud!psl@bellcore.bellcore.com>
@@ -14251,7 +14981,7 @@ This @value{CHAPTER} discusses advanced features in @command{gawk}.
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}
+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,20 +14994,23 @@ discusses the ability to dynamically add new built-in functions to
its description is relegated to an appendix.
@menu
-* Non-decimal Data:: Allowing non-decimal input data.
+* 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 Non-decimal Data, Two-way I/O, Advanced Features, Advanced Features
-@section Allowing Non-Decimal Input Data
+@node Nondecimal Data, Two-way I/O, Advanced Features, Advanced Features
+@section Allowing Nondecimal Input Data
@cindex @code{--non-decimal-data} option
-@cindex command-line option, @code{--non-decimal-data}
+@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 non-decimal constants in your input data:
+you can have nondecimal constants in your input data:
@c line break here for small book format
@example
@@ -14314,20 +15047,21 @@ Because it is common to have decimal data with leading zeros, and because
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
+@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{Non-decimal-numbers, ,Octal and Hexadecimal Numbers}).
+(@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, Non-decimal Data, Advanced Features
+@node Two-way I/O, TCP/IP Networking, Nondecimal Data, Advanced Features
@section Two-Way Communications with Another Process
@cindex Brennan, Michael
-@cindex sex, programmer attractiveness
+@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,6 +15090,9 @@ Mike Brennan
@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,16 +15115,16 @@ system("rm " tempfile)
@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
+@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
+(borrowed from the Korn shell, @command{ksh}):@footnote{This is very
different from the same operator in the C shell, @command{csh}.}
@example
@@ -14417,7 +15154,10 @@ standard error goes to the same place that the parent @command{gawk}'s
standard error goes. It is not possible to read the child's
standard error separately.
-@cindex deadlock
+@cindex deadlocks
+@cindex buffering, input/output
+@cindex @code{getline} command, deadlock and
+</itemizedlist>
@item
I/O buffering may be a problem. @command{gawk} automatically
flushes all output down the pipe to the child process.
@@ -14428,6 +15168,7 @@ known as @dfn{deadlock}, where each process is waiting for the
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,6 +15177,7 @@ These strings tell @command{gawk} to close the end of the pipe
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,9 +15217,12 @@ command ensures traditional Unix (ASCII) sorting from @command{sort}.
@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 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,7 +15244,7 @@ by recognizing special @value{FN}s that begin with @samp{/inet/}.
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:
+The components are:
@table @var
@item protocol
@@ -14507,17 +15252,19 @@ The protocol to use over IP. This must be either @samp{tcp},
@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} C library function
+@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 pre-defined port number using the C @code{getservbyname} function.
+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,13 +15305,14 @@ extensive examples.
@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 BSD portal files
-@cindex TCP/IP networking
-@cindex @file{/p} special 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 configuration option, @code{--enable-portals}
-@cindex BSD-based operating systems
+@cindex operating systems, BSD-based
Similar to the @file{/inet} special files, if @command{gawk}
is configured with the @option{--enable-portals} option
@@ -14572,29 +15320,39 @@ is configured with the @option{--enable-portals} option
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 @file{awkprof.out} profiling output file
-@cindex profiling output file (@file{awkprof.out})
+@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 percent slower than
+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,10 +15411,11 @@ junk
@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.):
+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}
+@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,7 +15458,7 @@ programmers sometimes have to work late.):
@}
@end example
-The previous example illustrates many of the basic rules for profiling output.
+This example illustrates many of the basic rules for profiling output.
The rules are as follows:
@itemize @bullet
@@ -14709,6 +15468,7 @@ pattern/action rules, @code{END} rule and functions, listed
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,6 +15488,7 @@ is a count showing how many times the condition was true.
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,17 +15496,23 @@ or @code{while}) shows how many times the loop test was executed.
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 using tabs.
+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,7 +15543,7 @@ The profiled version of your program may not look exactly like what you
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
+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,8 +15563,8 @@ come out as:
@noindent
which is correct, but possibly surprising.
-@cindex dynamic profiling
-@cindex profiling, dynamic
+@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,12 +15576,12 @@ $ pgawk -f myprog &
[1] 13992
@end example
-@cindex @command{kill} command
-@cindex @code{SIGUSR1} signal
+@c comma does NOT start secondary
+@cindex @command{kill} command, dynamic profiling
@cindex @code{USR1} signal
-@cindex signals, @code{SIGUSR1}
+@cindex signals, @code{USR1}/@code{SIGUSR1}
@noindent
-The shell prints a job number and process ID number, in this case, 13992.
+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,11 +15610,28 @@ You may send @command{pgawk} the @code{USR1} signal as many times as you like.
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}
+@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.
+@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,12 +15662,10 @@ full details.
@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
+@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,28 +15676,39 @@ awk @r{[@var{options}]} -f progfile @r{[@code{--}]} @var{file} @dots{}
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 empty program
-@cindex dark corner
-@cindex lint checks
+@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
+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
+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,6 +15720,7 @@ by whitespace.
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,27 +15731,24 @@ The options and their meanings are as follows:
@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}
+@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 command-line option, @code{-f}
@cindex @code{--file} option
-@cindex command-line option, @code{--file}
+@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 command-line option, @code{-v}
@cindex @code{--assign} option
-@cindex command-line option, @code{--assign}
+@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,6 +15758,10 @@ The @option{-v} option can only set one variable, but it can be used
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,11 +15769,9 @@ predefined value you may have given.
@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
+@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,7 +15782,6 @@ it continues to accept them to avoid breaking old programs.)
@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.
@@ -14998,15 +15790,21 @@ the abbreviations remain unique.
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,10 +15816,8 @@ The following list describes @command{gawk}-specific options:
@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
+@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,42 +15829,42 @@ which summarizes the extensions. Also see
@item -W copyright
@itemx --copyright
@cindex @code{--copyright} option
-@cindex command-line option, @code{--copyright}
+@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
-@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
+@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{]}
-Print a sorted list of global variables, their types, and final values
+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 a file named @file{awkvars.out} in the current directory.
+list to the 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
+@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}, and so on.)
+names like @code{i}, @code{j}, etc.)
@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
+@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,63 +15874,68 @@ for information about this option.
@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
+@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 command-line option, @code{--lint}
-@cindex lint checks
-@cindex fatal errors
-Warn about constructs that are dubious or non-portable to
+@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
+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
+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 command-line option, @code{--non-decimal-data}
+@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{Non-decimal Data, ,Allowing Non-Decimal 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 command-line option, @code{--posix}
@cindex POSIX mode
-Operate in strict POSIX mode. This disables all @command{gawk}
+@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,31 +15949,44 @@ Newlines are not allowed after @samp{?} or @samp{:}
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
+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
-@cindex automatic warnings
-@cindex warnings, automatic
+@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}
+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}
+@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,8 +16001,8 @@ call counts for each function.
@item -W re-interval
@itemx --re-interval
@cindex @code{--re-interval} option
-@cindex command-line option, @code{--re-interval}
-Allow interval expressions
+@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,18 +16012,20 @@ programs from breaking.
@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
+@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
-@cindex command-line option, @code{--version}
-Print version information for this particular copy of @command{gawk}.
+@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,13 +16037,15 @@ As long as program text has been supplied,
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 only true for @option{--traditional} and not
+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}).
-The @option{-f} option may be used more than once on the command-line.
+@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,7 +16057,7 @@ function names must be unique.)
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.
+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,18 +16069,19 @@ input for your source code; it allows you to easily mix command-line
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 environment variable, @code{POSIXLY_CORRECT}
-@cindex lint checks
+@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
+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,8 +16094,8 @@ POSIXLY_CORRECT=true
export POSIXLY_CORRECT
@end example
-@cindex @command{csh} utility
-For a @command{csh} compatible
+@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,14 +16103,19 @@ you would add this line to the @file{.login} file in your home directory:
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
+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,8 +16123,8 @@ file at all.
(This was discussed earlier in
@ref{Assignment Options, ,Assigning Variables on the Command Line}.)
-@cindex @code{ARGIND} variable
-@cindex @code{ARGV} variable
+@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,6 +16133,7 @@ included. As each element of @code{ARGV} is processed, @command{gawk}
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,8 +16147,8 @@ variables assigned in this fashion are @emph{not} available inside a
(@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
+@cindex dark corner, escape sequences
+The variable values given on the command line are processed for escape
sequences (@pxref{Escape Sequences}).
@value{DARKCORNER}
@@ -15343,8 +16168,7 @@ output formats before scanning the @value{DF}s. It is also useful for
controlling state if multiple passes are needed over a @value{DF}. For
example:
-@cindex multiple passes over data
-@cindex passes, multiple
+@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,12 +16181,9 @@ strictly necessary. It remains for historical compatibility.
@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}
+@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,12 +16199,12 @@ file with the specified name.
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
+@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
+@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,12 +16212,12 @@ does not include the current directory, @file{.}.)
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}
+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}.
+@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,9 +16247,9 @@ found, and @command{gawk} no longer needs to use @env{AWKPATH}.
@node Obsolete, Undocumented, AWKPATH Variable, Invoking Gawk
@section Obsolete Options and/or Features
-@cindex deprecated options
-@cindex obsolete options
-@cindex deprecated 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,13 +16258,15 @@ they will @emph{not} be in the next release).
@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.
+two-word usage is no longer accepted.
The process-related special files described in
@ref{Special Process, ,Special Files for Process-Related Information},
@@ -15523,6 +16346,10 @@ explanation.
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,24 +16358,32 @@ The comparison used for sorting is simple string comparison;
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 bugs, known in @command{gawk}
-@cindex known bugs
+@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 backwards compatibility.
+assignment feature; it remains only for backward compatibility.
@item
-Syntactically invalid single character programs tend to overflow
+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
+are surprisingly difficult to diagnose in the completely general case,
and the effort to do so really is not worth it.
@end itemize
@@ -15579,6 +16414,12 @@ It contains the following chapters:
@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,21 +16446,20 @@ these example library functions and programs from the Texinfo source
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
+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
+@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.
-It is straightforward to rewrite these programs for
-different implementations of @command{awk}.
+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}.
+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,6 +16468,8 @@ to skip any remaining input in the input file.
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,7 +16485,7 @@ beginning of the program:
@noindent
Also, verify that all regexp and string constants used in
-comparisons only use lowercase letters.
+comparisons use only lowercase letters.
@menu
* Library Names:: How to best name private global variables in
@@ -15660,15 +16502,19 @@ comparisons only use lowercase letters.
@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
+@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,14 +16528,15 @@ either another library function or a user's main program. For example, a
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
+@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,7 +16546,7 @@ chance of inadvertent conflict among variable names. Note that this
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
+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,6 +16558,7 @@ The leading capital letter indicates that it is global, while the fact that
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,6 +16575,9 @@ function lib_func(x, y, l1, l2)
@}
@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,9 +16616,15 @@ programming use.
@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
+@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,8 +16641,7 @@ function nextfile() @{ _abandon_ = FILENAME; next @}
_abandon_ == FILENAME @{ next @}
@end example
-@cindex conventions, programming
-@cindex programming conventions
+@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,7 +16656,7 @@ all the records from the current @value{DF}.
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.
+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,7 +16675,7 @@ This initial version has a subtle problem.
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
+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,12 +16741,22 @@ next one, which saves a lot of time. This is particularly important in
@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
-@cindex @code{assert} C library function
+@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,7 +16829,7 @@ is false, it prints a message to standard error, using the @code{string}
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.
+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,6 +16856,7 @@ If the assertion fails, you see a message similar to the following:
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,14 +16866,26 @@ attempts to read the input @value{DF}s or standard input
(@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,7 +16901,7 @@ does unbiased rounding:
@cindex @code{round} user-defined function
@example
@c file eg/lib/round.awk
-# round --- do normal rounding
+# round.awk --- do normal rounding
@c endfile
@ignore
@c file eg/lib/round.awk
@@ -16067,6 +16946,8 @@ function round(x, ival, aval, fraction)
@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,8 +16990,10 @@ isn't random enough, you might try using this function instead.
@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
+@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,14 +17049,14 @@ function _ord_init( low, high, i, t)
@c endfile
@end example
-@cindex character sets (machine character encodings)
+@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
-eight-bit byte can hold 256 distinct values (from 0 to 255), ASCII only
+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,7 +17110,10 @@ function. It is commented out for production use.
@node Join Function, Gettimeofday Function, Ordinal Functions, General Functions
@subsection Merging an Array into a String
-@cindex merging strings
+@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,7 +17156,7 @@ function join(array, start, end, sep, result, i)
@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,
+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,8 +17170,10 @@ more difficult than they really need to be.}
@node Gettimeofday Function, , Join Function, General Functions
@subsection Managing the Time of Day
-@cindex formatted timestamps
+@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,8 +17270,14 @@ of the current time.
@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 datafiles.
+command-line @value{DF}s.
@menu
* Filetrans Function:: A function for handling data file transitions.
@@ -16395,8 +17289,9 @@ command-line datafiles.
@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
+@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,6 +17395,7 @@ how it simplifies writing the main program.
@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,11 +17461,10 @@ for a function version of @code{nextfile}.
@node File Checking, Ignoring Assigns, Rewind Function, Data File Management
@subsection Checking for Readable @value{DDF}s
-@cindex fatal errors
+@cindex troubleshooting, readable @value{DF}s
+@c comma is part of primary
@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
+@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,7 +17499,7 @@ BEGIN @{
@c endfile
@end example
-@cindex fatal errors
+@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,6 +17510,8 @@ skips the file (since it's no longer in the list).
@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,13 +17566,24 @@ The use of @code{No_command_assign} allows you to disable command-line
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
-@cindex @code{getopt} C library function
-@cindex processing arguments
-@cindex argument processing
+@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,6 +17594,7 @@ correctly obey the command-line option. For example, @command{awk}'s
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,7 +17607,7 @@ When it returns @minus{}1, there are no options left on the command line.
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
+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,7 +17632,7 @@ and that @samp{foo} is the argument to the @option{-b} option.
@table @code
@item optind
The index in the argument value array (@code{argv}) where the first
-non-option command-line argument can be found.
+nonoption command-line argument can be found.
@item optarg
The string value of the argument to an option.
@@ -16789,6 +17698,7 @@ We have left it alone, since using @code{substr} is more portable.}
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,7 +17715,7 @@ The discussion that follows walks through the code a bit at a time:
@end ignore
@c file eg/lib/getopt.awk
# External variables:
-# Optind -- index in ARGV of first non-option argument
+# 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,7 +17771,7 @@ The regular expression that is used, @code{@w{/^-[^: \t\n\f\r\v\b]/}}, is
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.
+it is not an option, and it ends option processing:
@example
@c file eg/lib/getopt.awk
@@ -16929,7 +17839,7 @@ If the option requires an argument, the option letter is followed by a colon
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,
+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,26 +17915,43 @@ not try to interpret the @option{-a}, etc., as its own options.
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
+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
+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} C library function
-@cindex user information
+@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{<pwd.h>} header file
and several C language subroutines for obtaining user information.
@@ -17044,7 +17971,7 @@ is defined as returning a pointer to a @code{struct passwd}. Each time it
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.
+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,10 +18027,10 @@ The user's login name.
The user's encrypted password. This may not be available on some systems.
@item User-ID
-The user's numeric user-id number.
+The user's numeric user ID number.
@item Group-ID
-The user's numeric group-id number.
+The user's numeric group ID number.
@item Full name
The user's full name, and perhaps other information associated with the
@@ -17124,9 +18051,9 @@ shell, such as @command{bash}.
@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 User-ID @tab The user's numeric user ID number.
-@item Group-ID @tab The user's numeric group-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,6 +18140,7 @@ function _pw_init( oldfs, oldrs, olddol0, pwcat, using_fw)
@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,11 +18148,12 @@ however, you might want it to be in a different directory on your system.
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
+(@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,8 +18179,9 @@ The use of @code{@w{_pw_count}} is explained shortly.
@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
+user is in the database, it returns the appropriate line. Otherwise, it
returns the null string:
@cindex @code{getpwnam} user-defined function
@@ -17269,9 +18199,10 @@ function getpwnam(name)
@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
+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,6 +18218,7 @@ function getpwuid(uid)
@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,6 +18236,7 @@ function getpwent()
@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,7 +18250,7 @@ function endpwent()
@c endfile
@end example
-A conscious design decision in this suite is that each subroutine calls
+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,14 +18270,30 @@ clutters up the code.
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
-@cindex @code{getgrent} C library function
-@cindex group information
+@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,6 +18324,14 @@ is as follows:
* Public Domain
*/
+/* For OS/2, do nothing. */
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifndef HAVE_GETPGRENT
+int main() { exit(0); }
+#else
@c endfile
@end ignore
@c file eg/lib/grcat.c
@@ -17406,6 +18363,11 @@ char **argv;
@}
@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,14 +18382,14 @@ The encrypted group password. In practice, this field is never used. It is
usually empty or set to @samp{*}.
@item Group ID Number
-The numeric group-id number. This number should be unique within the file.
+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.
+for those group ID numbers.
(Note that @code{PROCINFO} is a @command{gawk} extension;
@pxref{Built-in Variables}.)
@end table
@@ -17440,14 +18402,14 @@ for those group-id numbers.
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.
+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.
+for those group ID numbers.
(Note that @code{PROCINFO} is a @command{gawk} extension;
@pxref{Built-in Variables}.)
@end multitable
@@ -17468,6 +18430,7 @@ $ grcat
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,10 +18513,10 @@ The @code{@w{_gr_init}} function first saves @code{FS}, @code{FIELDWIDTHS}, @cod
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
+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.
+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,7 +18528,7 @@ tvpeople:*:101:david,conan,tom,joan
@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
+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,6 +18539,7 @@ Finally, @code{_gr_init} closes the pipeline to @command{grcat}, restores
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,8 +18557,9 @@ function getgrnam(group)
@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} 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,10 +18574,11 @@ function getgrgid(gid)
@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} user-defined function
+@cindex @code{getgruser} function, user-defined
@example
@c file eg/lib/groupawk.in
function getgruser(user)
@@ -17625,6 +18591,7 @@ function getgruser(user)
@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,7 +18607,9 @@ function getgrent()
@}
@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,9 +18634,18 @@ simple, relying on @command{awk}'s associative arrays to do work.
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,6 +18710,9 @@ cut.awk -- -c1-8 myfiles > results
@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,11 +18740,17 @@ The programs are presented in alphabetical order.
@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
+@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,7 +18774,7 @@ dashes. The list @samp{1-8,15,22-35} specifies characters 1 through
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
+Use @var{delim} as the field-separator character instead of the tab
character.
@item -s
@@ -17850,15 +18837,17 @@ page.
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
+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
+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.
+string:
@example
@c file eg/prog/cut.awk
@@ -17895,6 +18884,7 @@ BEGIN \
@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,7 +18921,7 @@ list of fields or characters:
@c endfile
@end example
-@code{set_fieldlist} is used to split the field list apart at the commas,
+@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,7 +18959,7 @@ function set_fieldlist( n, m, i, j, k, f, g)
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
+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,12 +19059,21 @@ other @command{awk} implementations to use @code{substr}
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,7 +19174,7 @@ BEGIN @{
@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
+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,9 +19226,9 @@ commented out since it is not necessary with @command{gawk}:
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.):
+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,7 +19246,7 @@ matched. @code{no_print} is true only if the exit status is desired.
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:
+know the total number of lines that matched the pattern:
@example
@c file eg/prog/egrep.awk
@@ -18272,6 +19271,8 @@ using the @samp{!} operator. @code{fcount} is incremented with the value of
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,7 +19314,7 @@ if necessary:
@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:
+there are no matches, the exit status is one; otherwise it is zero:
@example
@c file eg/prog/egrep.awk
@@ -18344,7 +19345,9 @@ function usage( e)
The variable @code{e} is used so that the function fits nicely
on the printed page.
-@cindex backslash continuation
+@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,14 +19356,19 @@ in this @value{CHAPTER}
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
+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,10 +19391,10 @@ and the group database library functions
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
+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.
+Similar code is used for the effective user ID number and the group
+numbers:
@cindex @code{id.awk} program
@example
@@ -18473,8 +19481,8 @@ BEGIN \
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
+@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,9 +19504,11 @@ arguments and perform in the same way.
@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.
-The usage is as follows:
+Usage is as follows:
@example
split @r{[}-@var{count}@r{]} file @r{[} @var{prefix} @r{]}
@@ -18519,7 +19529,7 @@ Here is a version of @code{split} in @command{awk}. It uses the @code{ord} and
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
+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,15 +19639,19 @@ screen.
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.
+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,8 +19766,13 @@ END \
@end example
@node Uniq Program, Wc Program, Tee Program, Clones
-@subsection Printing Non-Duplicated Lines of Text
+@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,22 +19783,22 @@ options. The usage is as follows:
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:
+The options for @command{uniq} are:
@table @code
@item -d
-Only print repeated lines.
+Pnly print only repeated lines.
@item -u
-Only print non-repeated lines.
+Print only nonrepeated lines.
@item -c
Count lines. This option overrides @option{-d} and @option{-u}. Both repeated
-and non-repeated lines are counted.
+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: non-whitespace characters separated
+is similar to @command{awk}'s default: nonwhitespace characters separated
by runs of spaces and/or tabs.
@item +@var{n}
@@ -18813,12 +19832,12 @@ treating such an option as the option letter @samp{2} with an argument of
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{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 non-repeated lines. The output file, if provided, is assigned
+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,13 +19967,13 @@ executed only for the very first line of data. It sets @code{last} equal to
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},
+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
+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,10 +20021,22 @@ END @{
@}
@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,16 +20051,16 @@ the files. The options and their meanings are shown in the following list:
@table @code
@item -l
-Only count lines.
+Count only 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
+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
-Only count characters.
+Count only characters.
@end table
Implementing @command{wc} in @command{awk} is particularly elegant,
@@ -19039,7 +20070,7 @@ and it can easily tell us how long a line is.
This uses the @code{getopt} library function
(@pxref{Getopt Function, ,Processing Command-Line Options})
-and the file transition functions
+and the file-transition functions
(@pxref{Filetrans Function, ,Noting @value{DDF} Boundaries}).
This version has one notable difference from traditional versions of
@@ -19114,9 +20145,16 @@ function beginfile(file)
@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
+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,12 +20183,7 @@ is needed because the newline character separating records (the value
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.
+number of ``words'' on this line:
@example
@c file eg/prog/wc.awk
@@ -19163,7 +20196,7 @@ you will see that @code{FNR} has already been reset by the time
@c endfile
@end example
-Finally, the @code{END} rule simply prints the totals for all the files.
+Finally, the @code{END} rule simply prints the totals for all the files:
@example
@c file eg/prog/wc.awk
@@ -19180,6 +20213,12 @@ END @{
@}
@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,9 +20244,14 @@ We hope you find them both interesting and enjoyable.
@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 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,13 +20264,13 @@ word on the next line.
@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
+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 re-split into fields, yielding just the actual words on the line,
-and insuring that there are no empty fields.
+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,6 +20318,10 @@ word, comparing it to the previous one:
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,9 +20335,10 @@ All the work is done in the @code{BEGIN} rule. The first part is argument
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.):
+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,10 +20464,14 @@ seconds are necessary:
@}
@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,6 +20482,9 @@ often used to map uppercase letters into lowercase for further processing:
@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,19 +20514,18 @@ and @code{gsub} built-in functions
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.
+A list of characters from which to translate.
@item to
-A list of characters to translate to.
+A list of characters to which to translate.
@item target
-The string to do the translation on.
+The string on which to do the translation.
@end table
Associative arrays make the translation part fairly easy. @code{t_ar} holds
@@ -19562,17 +20617,23 @@ An obvious improvement to this program would be to set up the
@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, 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
+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,7 +20653,7 @@ have to print horizontally; @code{line[1]} next to @code{line[6]},
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
+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,7 +20669,7 @@ line 5 line 10
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.
+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,10 +20739,15 @@ END \
@}
@c endfile
@end example
+@c ENDOFRANGE prml
+@c ENDOFRANGE mlprint
@node Word Sorting, History Sorting, Labels Program, Miscellaneous Programs
-@subsection Generating Word Usage Counts
+@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,7 +20839,7 @@ Assuming we have saved this program in a file named @file{wordfreq.awk},
and that the data is in @file{file1}, the following pipeline:
@example
-awk -f wordfreq.awk file1 | sort +1 -nr
+awk -f wordfreq.awk file1 | sort -k 2nr
@end example
@noindent
@@ -19794,7 +20860,7 @@ the @code{END} action to:
@example
@c file eg/prog/wordfreq.awk
END @{
- sort = "sort +1 -nr"
+ sort = "sort -k 2nr"
for (word in freq)
printf "%s\t%d\n", word, freq[word] | sort
close(sort)
@@ -19806,12 +20872,16 @@ This way of sorting must be used on systems that do not
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 Non-Duplicated Lines of Text}),
+(@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,10 +20942,16 @@ print data[lines[i]], lines[i]
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,13 +20995,13 @@ files as @samp{@@@@}.
@item
Comments start with either @samp{@@c} or @samp{@@comment}.
-The file extraction program works by using special comments that start
+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
+(Unfortunately, @TeX{} isn't always smart enough to do things exactly right,
and we have to give it some help.)
@end itemize
@@ -20131,13 +21207,15 @@ END @{
@}
@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 editor
-The @command{sed} utility is a ``stream editor,'' a program that reads a
+@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,7 +21228,7 @@ command1 < orig.data | sed 's/old/new/g' | command2 > result
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
+@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,8 +21239,8 @@ are provided, the standard input is used:
@cindex Brennan, Michael
@cindex @command{awksed.awk} program
-@cindex simple stream editor
-@cindex stream editor, simple
+@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,7 +21327,7 @@ BEGIN {
{ gsub(pat, repl); print }
-Exercise: what are the advantages and disadvantages of this version vs. sed?
+Exercise: what are the advantages and disadvantages of this version versus sed?
Advantage: egrep regexps
speed (?)
Disadvantage: no & in replacement text
@@ -20260,6 +21338,10 @@ Others?
@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,7 +21379,7 @@ including the ability to have multiple source files specified via
@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:
+It works as follows:
@enumerate
@item
@@ -20315,9 +21397,9 @@ text is just echoed directly. The @command{echo} program automatically
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
+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,7 +21454,7 @@ to get the @command{gawk} version information, and then exits.
@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
+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,7 +21463,7 @@ In any case, after the arguments have been processed,
program.
@cindex @command{sed} utility
-@cindex stream editor
+@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,9 +21723,10 @@ the initial collected @command{awk} program much simpler; all the
@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.
+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,10 +21747,12 @@ features to a program; they can often be layered on top. With @command{igawk},
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
+@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,6 +21776,9 @@ upon startup. Instead, it would be very simple to modify @command{igawk}
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,11 +21829,11 @@ the POSIX specification.
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}
+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
+evolution of the @command{awk} language, with cross-references to other parts
of the @value{DOCUMENT} where you can find more information.
@menu
@@ -20763,6 +21851,10 @@ of the @value{DOCUMENT} where you can find more information.
@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,11 +21935,12 @@ Multiple @code{BEGIN} and @code{END} rules
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} language, V.4 version
+@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,6 +21998,8 @@ Processing of escape sequences inside command-line variable assignments
@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,24 +22052,27 @@ and @ref{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
+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}.
+not in POSIX @command{awk}:
@itemize @bullet
@item
@@ -21051,7 +22149,12 @@ I've tried to follow this general order, esp. for the 3.0 and 3.1 sections:
Within each category, be alphabetical.
@end ignore
-@cindex compatibility mode
+@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,7 +22222,7 @@ through @code{ARGV} (@pxref{Built-in Variables}).
@item
The @code{ERRNO} variable, which contains the system error message when
-@code{getline} returns @minus{}1 or when @code{close} fails
+@code{getline} returns @minus{}1 or @code{close} fails
(@pxref{Built-in Variables}).
@item
@@ -21136,8 +22239,8 @@ The ability to use GNU-style long-named options that start with @option{--}
(@pxref{Options, ,Command-Line Options}).
@item
-The @option{--source} option for mixing command-line and library
-file source code
+The @option{--source} option for mixing command-line and library-file
+source code
(@pxref{Options, ,Command-Line Options}).
@end itemize
@@ -21236,7 +22339,7 @@ and
@item
The ability to use octal and hexadecimal constants in @command{awk}
program source code
-(@pxref{Non-decimal-numbers, ,Octal and Hexadecimal Numbers}).
+(@pxref{Nondecimal-numbers, ,Octal and Hexadecimal Numbers}).
@item
The @samp{|&} operator for two-way I/O to a coprocess
@@ -21309,7 +22412,7 @@ underscore to mark strings that should be translated
@item
The @option{--non-decimal-data} option to allow non-decimal
input data
-(@pxref{Non-decimal Data, ,Allowing Non-Decimal Input Data}).
+(@pxref{Nondecimal Data, ,Allowing Nondecimal Input Data}).
@item
The @option{--profile} option and @command{pgawk}, the
@@ -21350,9 +22453,13 @@ The source code now uses new-style function definitions, with
@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 contributors to @command{gawk}
+@cindex @command{gawk}, list of contributors to
@quotation
@i{Always give credit where credit is due.}@*
Anonymous
@@ -21433,7 +22540,7 @@ provided help in porting @command{gawk} to Cray systems.
@item
@cindex Rommel, Kai Uwe
Kai Uwe Rommel
-provided the port to OS/2 and its documentation.
+provided the initial port to OS/2 and its documentation.
@item
@cindex Jaegermann, Michal
@@ -21501,6 +22608,15 @@ provided the initial version of the @code{asort} function
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,8 +22626,12 @@ helping David Trueman, and as the primary maintainer since around 1994.
@node Installation, Notes, Language History, Top
@appendix Installing @command{gawk}
-@cindex Linux
-@cindex GNU/Linux
+@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,6 +22653,7 @@ the respective ports.
@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,23 +22667,21 @@ subdirectories.
@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
+@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
-@cindex Free Software Foundation
+@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 Unix, MS-DOS, and VMS, on
-tape and CD-ROM. Their address is:
+Software distributions are available for
+Gnu/Linux, Unix, and MS-Windows, in several CD packages.
+Their address is:
@display
Free Software Foundation
@@ -21571,7 +22690,7 @@ Boston, MA 02111-1307 USA
Phone: +1-617-542-5942
Fax (including Japan): +1-617-542-2652
Email: @email{gnu@@gnu.org}
-URL: @uref{http://www.gnu.org/}
+URL: @uref{http://www.gnu.org}
@end display
@noindent
@@ -21580,7 +22699,7 @@ and to the production of more free software.
@item
Retrieve @command{gawk} by using anonymous @command{ftp} to the Internet host
-@code{gnudist.gnu.org}, in the directory @file{/gnu/gawk}.
+@code{ftp.gnu.org}, in the directory @file{/gnu/gawk}.
@end itemize
The GNU software archive is mirrored around the world.
@@ -21617,7 +22736,7 @@ the @var{P} represents a @dfn{patch level}, meaning that minor bugs have
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
+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,6 +22744,8 @@ a local expert.
@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,8 +22755,8 @@ as well as several subdirectories related to different non-Unix
operating systems:
@table @asis
-@item Various @samp{.c}, @samp{.y}, and @samp{.h} files:
-These files are the actual @command{gawk} source code.
+@item Various @samp{.c}, @samp{.y}, and @samp{.h} files
+The actual @command{gawk} source code.
@end table
@table @file
@@ -21663,15 +22784,15 @@ on its difficulty.
@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
+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
+A description of one area in which 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}
+@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,6 +22918,7 @@ directory to run your version of @command{gawk} against the test suite.
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,7 +22936,7 @@ to configure @command{gawk} for your system yourself.
@node Quick Installation, Additional Configuration Options, Unix Installation, Unix Installation
@appendixsubsec Compiling @command{gawk} for Unix
-@cindex installation, 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,15 +22999,18 @@ please send in a bug report
@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.
+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
-This option causes @command{gawk} to treat pathnames that begin
+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,6 +23018,7 @@ the @samp{|&} operator
@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,7 +23029,7 @@ All known modern GNU/Linux systems use Glibc 2. Use this option on any other sy
@cindex @code{--disable-nls} configuration option
@cindex configuration option, @code{--disable-nls}
@item --disable-nls
-Disable all message translation facilities.
+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,7 +23039,7 @@ doesn't work on your system.
@node Configuration Philosophy, , Additional Configuration Options, Unix Installation
@appendixsubsec The Configuration Process
-@cindex configuring @command{gawk}
+@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,7 +23064,7 @@ facts about your variant of Unix. For example, there may not be an
@code{st_blksize} element in the @code{stat} structure. In this case,
@samp{HAVE_ST_BLKSIZE} is undefined.
-@cindex @code{custom.h} configuration file
+@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,7 +23178,10 @@ If these steps do not work, please send in a bug report
@node PC Installation, VMS Installation, BeOS Installation, Non-Unix Installation
@appendixsubsec Installation on PC Operating Systems
-@cindex installation, 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,6 +23200,8 @@ distribution.
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,8 +23219,28 @@ edited.
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.
+@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,11 +23254,11 @@ used to build 16-bit versions for MS-DOS and OS/2. The file
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.
+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,18 +23276,108 @@ companion utilities or appropriate GNU utilities. However, some editing of
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
+To build @command{gawk} for OS/2 (32 bit, EMX), there are three possibilities:
-@cindex search path
-@cindex directory search
-@cindex path, search
-@cindex search path, for source files
+@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 is @code{@w{".;c:/lib/awk;c:/gnu/lib/awk"}}.
+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,11 +23390,12 @@ examine its documentation for handling command lines; in particular,
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.
+control over these translations and is interpreted as follows:
@itemize @bullet
@item
@@ -22200,7 +23442,7 @@ the setting of @code{RS} giving the fewest ``surprises'' is open to debate.
@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
+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,6 +23478,32 @@ gawk -f binmode1.awk @dots{}
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,10 +23643,10 @@ flag is required to force Unix style rather than @code{DCL} parsing. If any
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
+@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,6 +23857,8 @@ The @samp{-mr @var{val}} option
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,10 +23869,10 @@ The Hitchhiker's Guide to the Galaxy
@end quotation
@c the radio show, not the book. :-)
-@cindex bug reports
-@cindex problem reports
-@cindex reporting bugs
-@cindex reporting problems
+@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,7 +23891,7 @@ the compiler you used to compile @command{gawk}, and the exact results
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 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,7 +23904,7 @@ mail to me. If necessary, I can be reached directly at
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
+@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,9 +23946,8 @@ Darrel Hankerson, @email{hankedr@@mail.auburn.edu}.
@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}.
+The Unix for OS/2 team, @email{gawk-maintainer@@unixos2.org}.
@cindex Davies, Stephen
@item Tandem
@@ -22705,8 +23974,7 @@ Darrel Hankerson, @email{hankedr@@mail.auburn.edu}.
@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}.
+@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,10 +23985,13 @@ Darrel Hankerson, @email{hankedr@@mail.auburn.edu}.
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
-@cindex other @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,8 +24011,7 @@ This @value{SECTION} briefly describes where to get them:
@table @asis
@cindex Kernighan, Brian
-@cindex Unix @command{awk}, source code
-@cindex source code, Unix @command{awk}
+@cindex source code, Bell Laboratories @command{awk}
@item Unix @command{awk}
Brian Kernighan has made his implementation of
@command{awk} freely available.
@@ -22768,11 +24038,8 @@ works quite nicely.
@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 @command{mawk} program
@cindex source code, @command{mawk}
@item @command{mawk}
Michael Brennan has written an independent implementation of @command{awk},
@@ -22838,8 +24105,7 @@ The @code{BINMODE} special variable for non-Unix operating systems
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 @command{awka} compiler for @command{awk}
@cindex source code, @command{awka}
@item @command{awka}
Written by Andrew Sumner,
@@ -22848,12 +24114,6 @@ and links them with a library of functions that provides the core
@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.
@@ -22864,9 +24124,16 @@ Go to @uref{http://awka.sourceforge.net}.
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,6 +24150,11 @@ maintainers of @command{gawk}. Everything in it applies specifically to
@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,7 +24167,7 @@ is one more option available on the command line:
@table @code
@item -W parsedebug
@itemx --parsedebug
-Print out the parse stack information as the program is being parsed.
+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,8 +24195,12 @@ as well as any considerations you should bear in mind.
@node Adding Code, New Ports, Additions, Additions
@appendixsubsec Adding New Features
-@cindex 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,11 +24234,10 @@ read it, please do so, preferably @emph{before} starting to modify @command{gawk
the GNU Project's
@command{ftp}
site, at
-@uref{ftp://gnudist.gnu.org/gnu/GNUInfo/standards.text}.
+@uref{ftp://ftp.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}
+@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,13 +24360,18 @@ Although this sounds like a lot of work, please remember that while you
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 to follow:
+several steps:
@enumerate 1
@item
@@ -23105,15 +24385,12 @@ the previous @value{SECTION}
concerning coding style, submission of diffs, and so on.
@item
-When doing a port, bear in mind that your code must co-exist peacefully
+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.
-@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
@@ -23182,7 +24459,7 @@ already. If you have questions, please contact me, or
@end enumerate
Following these steps makes it much easier to integrate your changes
-into @command{gawk} and have them co-exist happily with other
+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,8 +24476,12 @@ Warning! Warning!}@*
The Robot
@end quotation
-@cindex Linux
-@cindex GNU/Linux
+@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,6 +24503,8 @@ upon the next release.
@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,47 +24516,48 @@ are the files @file{awk.h}, @file{builtin.c}, and @file{eval.c}.
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
-@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}
+@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 internal function, @code{force_number}
+@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
-@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.
+@c comma is part of primary
+@cindex parameters, number of
@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.
@@ -23283,26 +24567,24 @@ the value in @code{n->stptr[n->stlen]}, assign @code{'\0'} to it,
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 arrays, associative, clearing
@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 arrays, elements, installing
@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.
@@ -23311,15 +24593,15 @@ This is usually a value created with @code{tmp_string} (see below).
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
-@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 numbers
@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
@@ -23327,34 +24609,32 @@ of @command{gawk} memory management is helpful.
@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.
+@c comma is part of primary
+@cindex nodes, duplicating
@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 memory, releasing
@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}
@@ -23371,24 +24651,25 @@ do_xxx(NODE *tree)
@}
@end example
+@cindex arguments, retrieving
@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 @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)
-@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{ERRNO} variable
@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.
@@ -23398,7 +24679,7 @@ It is provided as a convenience.
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:
+The following boilerplate code shows how to do this:
@smallexample
NODE *the_arg;
@@ -23424,9 +24705,21 @@ assoc_clear(the_arg);
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,8 +24879,6 @@ of that number, respectively.
@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
@@ -23617,8 +24908,7 @@ The file includes the @code{"awk.h"} header file for definitions
for the @command{gawk} internals. It includes @code{<sys/sysmacros.h>}
for access to the @code{major} and @code{minor} macros.
-@cindex conventions, programming
-@cindex programming conventions
+@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,8 +25053,7 @@ set the return value, and return:
@}
@end example
-@cindex conventions, programming
-@cindex programming conventions
+@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,8 +25078,8 @@ implement system calls such as @code{chown}, @code{chmod}, and @code{umask}.
@node Using Internal File Ops, , Internal File Ops, Sample Library
@appendixsubsubsec Integrating the Extensions
-@cindex Linux
-@cindex GNU/Linux
+@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,7 +25093,7 @@ $ gcc -shared -DHAVE_CONFIG_H -c -O -g -I@var{idir} filefuncs.c
$ ld -o filefuncs.so -shared filefuncs.o
@end example
-@cindex @code{extension} built-in function
+@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,6 +25143,13 @@ $ gawk -f testff.awk
@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,14 +25208,14 @@ Following is a list of probable future changes visible at the
@c these are ordered by likelihood
@table @asis
-@item Loadable Module Interface
+@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
+@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,7 +25234,7 @@ Add @samp{%'d} for putting in commas in formatting numeric values.
@item Databases
It may be possible to map a GDBM/NDBM/SDBM file into an @command{awk} array.
-@item Large Character Sets
+@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,7 +25246,7 @@ Following is a list of probable improvements that will make @command{gawk}'s
source code easier to work with:
@table @asis
-@item Loadable Module Mechanics
+@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,17 +25256,17 @@ The GNU @command{libtool} package provides a number of features that
would make using loadable modules much easier.
@command{gawk} should be changed to use @command{libtool}.
-@item Loadable Module Internals
+@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
+@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
+@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,7 +25275,7 @@ Following is a list of probable improvements that will make @command{gawk}
perform better:
@table @asis
-@item An Improved Version of @code{dfa}
+@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,6 +25293,8 @@ into a C program which the user would then compile, using the normal
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,11 +25308,14 @@ the programs in the test suite could use documenting in this @value{DOCUMENT}.
@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 basic programming concepts
-@cindex programming concepts, basic
+@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,9 +25405,7 @@ some input data and produce results.
@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,
@@ -24257,17 +25556,17 @@ This step corresponds to @command{awk}'s @code{END} rule
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.
+the mixing bowls and utensils.
@end table
-@cindex algorithm, definition of
+@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 record, definition of
-@cindex fields, definition of
+@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,12 +25576,13 @@ to as the @dfn{fields} of the record.
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,''
+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
+@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,12 +25594,12 @@ and easier to read.
@node Basic Data Typing, Floating Point Issues, Basic High Level, Basic Concepts
@appendixsec Data Values in a Computer
-@cindex variable, definition of
+@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 pre-defined variables, and it has
+@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,7 +25607,7 @@ associated values under one name, as an array.
@cindex values, numeric
@cindex values, string
-@cindex scalar, definition of
+@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,9 +25617,10 @@ Individual variables, as well as numeric and string variables, are
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},
+@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,15 +25629,15 @@ The disadvantage is that their range is limited. On most modern systems,
this range is @minus{}2,147,483,648 to 2,147,483,647.
@cindex unsigned integers
-@cindex integer, unsigned
+@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, definition of
-@cindex single-precision floating-point, definition of
+@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,8 +25655,7 @@ or @dfn{bits}. Modern computers group bits into groups of eight, called @dfn{by
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
+@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,7 +25675,7 @@ its right. Each column may contain either a 0 or a 1.
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}.
+@ref{Nondecimal-numbers, ,Octal and Hexadecimal Numbers}.
Programs are written in programming languages.
Hundreds, if not thousands, of programming languages exist.
@@ -24390,7 +25690,7 @@ as ``K&R'' C, after the initials of Brian Kernighan and Dennis Ritchie,
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
+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,18 +25703,18 @@ with this standard.
@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}
+``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},
+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}}
+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.
+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,7 +25769,7 @@ On most modern machines, most of the time,
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
+@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,7 +25788,7 @@ $ awk '@{ printf("%010d\n", $1 * 100) @}'
@print{} 0000051580
515.82
@print{} 0000051582
-@kbd{Ctrl-d}
+@kbd{@value{CTL}-d}
@end example
@noindent
@@ -24499,8 +25799,8 @@ represent numbers.
@cindex negative zero
@cindex positive zero
+@c comma is part of primary
@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
@@ -24522,6 +25822,7 @@ $ gawk 'BEGIN @{ mz = -0 ; pz = 0
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,7 +26116,7 @@ The epoch on Unix and POSIX systems is 1970-01-01 00:00:00 UTC.
See also ``GMT'' and ``UTC.''
@item Escape Sequences
-A special sequence of characters used for describing non-printing
+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,7 +26134,7 @@ and
@ref{Constant Size, ,Reading Fixed-Width Data}.)
@item Flag
-A variable whose truth value indicates the existence or non-existence
+A variable whose truth value indicates the existence or nonexistence
of some condition.
@item Floating-Point Number
@@ -24861,11 +26162,11 @@ functions, and also allows you to define your own.
@item FSF
See ``Free Software Foundation.''
-@cindex FSF
-@cindex Free Software Foundation
+@cindex FSF (Free Software Foundation)
+@cindex Free Software Foundation (FSF)
@cindex Stallman, Richard
@item Free Software Foundation
-A non-profit organization dedicated
+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,8 +26174,8 @@ Emacs editor. GNU Emacs is the most widely used version of Emacs today.
@item @command{gawk}
The GNU implementation of @command{awk}.
-@cindex GPL
-@cindex General Public License
+@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,8 +26187,8 @@ This is the old term for UTC.
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 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,8 +26276,8 @@ meaning. Keywords are reserved and may not be used as variable names.
and
@code{exit}.
-@cindex LGPL
-@cindex Lesser General Public License
+@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,7 +26510,7 @@ reference time for day and date calculations.
See also ``Epoch'' and ``GMT.''
@item Whitespace
-A sequence of space, tab, or newline characters occurring inside an input
+A sequence of space, TAB, or newline characters occurring inside an input
record or a string.
@end table
@@ -25617,8 +26918,8 @@ Public License instead of this License.
@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 FDL (Free Documentation License)
+@cindex Free Documentation License (FDL)
@cindex GNU Free Documentation License
@display
@@ -26037,7 +27338,7 @@ Consistency issues:
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 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,7 +27346,7 @@ Consistency issues:
closing `.' of a sentence and after (pxref{...}). This is
a change from earlier versions.
" " should have an @w{} around it
- Use "non-" everywhere
+ 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,6 +27368,7 @@ Consistency issues:
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 --git a/doc/gawkinet.info b/doc/gawkinet.info
index 3d5e5d3f..3c1f9722 100644
--- a/doc/gawkinet.info
+++ b/doc/gawkinet.info
@@ -1,4 +1,4 @@
-This is gawkinet.info, produced by makeinfo version 4.0 from
+This is gawkinet.info, produced by makeinfo version 4.2 from
gawkinet.texi.
INFO-DIR-SECTION GNU Packages
@@ -6,12 +6,12 @@ START-INFO-DIR-ENTRY
* Gawkinet: (gawkinet). TCP/IP Internetworking With `gawk'.
END-INFO-DIR-ENTRY
- This file documents the networking features in GNU `awk'.
+This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the
+3.1.1 (or later) version of the GNU implementation of AWK.
+
- This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the
-3.1.0 (or later) version of the GNU implementation of AWK.
+ Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
- 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
@@ -26,7 +26,30 @@ texts being (a) (see below), and with the Back-Cover Texts being (b)
b. "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."
+
+ This file documents the networking features in GNU `awk'.
+
+This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the
+3.1.1 (or later) version of the GNU implementation of AWK.
+
+
+ Copyright (C) 2000, 2001, 2002 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
+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".
+
+ a. "A GNU Manual"
+ b. "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."
+

File: gawkinet.info, Node: Top, Next: Preface, Prev: (dir), Up: (dir)
@@ -36,6 +59,27 @@ General Introduction
This file documents the networking features in GNU Awk (`gawk')
version 3.1 and later.
+This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the
+3.1.1 (or later) version of the GNU implementation of AWK.
+
+
+ Copyright (C) 2000, 2001, 2002 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
+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".
+
+ a. "A GNU Manual"
+
+ b. "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."
+
* Menu:
* Preface:: About this document.
@@ -57,7 +101,7 @@ version 3.1 and later.
* 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/udp:: The UDP special file.
* File /inet/raw:: The RAW special file.
* TCP Connecting:: Making a TCP connection.
* Troubleshooting:: Troubleshooting TCP/IP connections.
@@ -378,12 +422,13 @@ This can be done with file-like handling of network connections.
family of protocols for the convenience of simple connection handling.
The advanced features are available when programming in C or Perl. In
fact, the network programming in this major node is very similar to
-what is described in books like `Internet Programming with Python',
+what is described in books such as `Internet Programming with Python',
`Advanced Perl Programming', or `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.
+
+ 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.
This major node demonstrates how to use the TCP protocol. The other
protocols are much less important for most users (UDP) or even
@@ -407,23 +452,23 @@ untractable (RAW).

File: gawkinet.info, Node: Gawk Special Files, Next: TCP Connecting, Prev: Using Networking, Up: Using Networking
-`gawk' Networking Mechanisms
-============================
+`gawk''s Networking Mechanisms
+==============================
The `|&' operator introduced in `gawk' 3.1 for use in communicating
-with a "co-process" is described in *Note Two-way Communications With
+with a "coprocess" is described in *Note Two-way Communications With
Another Process: (gawk)Two-way I/O. It shows how to do two-way I/O to a
separate process, sending it data with `print' or `printf' and reading
data with `getline'. If you haven't read it already, you should detour
there to do so.
`gawk' transparently extends the two-way I/O mechanism to simple
-networking through the use of special file names. When a "co-process"
-is started that matches the special files we are about to describe,
+networking through the use of special file names. When a "coprocess"
+that matches the special files we are about to describe is started,
`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
+ At the C, C++, and Perl level, networking is accomplished via
"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. Socket level programming,
@@ -434,7 +479,7 @@ from a high-level language like `awk'. The special files provided in
and easier to use.
The special file name for network access is made up of several
-fields, all of them mandatory, none of them optional:
+fields, all of which are mandatory:
/inet/PROTOCOL/LOCALPORT/HOSTNAME/REMOTEPORT
@@ -457,7 +502,7 @@ The Fields of the Special File Name
This node 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 `0'.
+protocol, specify it as `0':
PROTOCOL
Determines which member of the TCP/IP family of protocols is
@@ -468,34 +513,34 @@ PROTOCOL
LOCALPORT
Determines which port on the local machine is used to communicate
across the network. It has no meaning with `/inet/raw' and must
- therefore be `0'. Application level clients usually use `0' to
+ therefore be `0'. Application-level clients usually use `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 `0' here because
- their service has to be available at a specific publicly-known
- port number. It is possible to use a name from `/etc/services'
- here.
+ specify a remote port to connect to. It is vital for
+ application-level servers to use a number different from `0' here
+ because their service has to be available at a specific publicly
+ known port number. It is possible to use a name from
+ `/etc/services' here.
HOSTNAME
Determines which remote host is to be at the other end of the
- connection. Application level servers must fill this field with a
+ connection. Application-level servers must fill this field with a
`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
+ 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 `0'.
+ Application-level clients must enter a name different from `0'.
The name can be either symbolic (e.g., `jpl-devvax.jpl.nasa.gov')
or numeric (e.g., `128.149.1.143').
REMOTEPORT
Determines which port on the remote machine is used to communicate
across the network. It has no meaning with `/inet/raw' and must
- therefore be 0. For `/inet/tcp' and `/inet/udp', application
- level clients _must_ use a number other than `0' to indicate which
- port on the remote machine they want to connect to. Application
- level servers must not fill this field with a `0'. Instead they
- specify a local port for clients to connect to. It is possible to
- use a name from `/etc/services' here.
+ therefore be 0. For `/inet/tcp' and `/inet/udp',
+ application-level clients _must_ use a number other than `0' to
+ indicate to which port on the remote machine they want to connect.
+ Application-level servers must not fill this field with a `0'.
+ Instead they specify a local port to which clients connect. It is
+ possible to use a name from `/etc/services' here.
Experts in network programming will notice that the usual
client/server asymmetry found at the level of the socket API is not
@@ -503,7 +548,7 @@ visible here. This is for the sake of simplicity of the high-level
concept. If this asymmetry is necessary for your application, use
another language. For `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:
+accessing a network connection is seen in the following pseudocode:
if ((name of remote host given) && (other side accepts connection)) {
rendez-vous successful; transmit with getline or print
@@ -524,7 +569,7 @@ is too complicated, focus on the three lines printed in *bold*. All the
examples in *Note Networking With `gawk': Using Networking, use only the
patterns printed in bold letters.
-PROTOCOL LOCAL HOST REMOTE RESULTING CONNECTION LEVEL
+PROTOCOL LOCAL HOST REMOTE RESULTING CONNECTION-LEVEL
PORT NAME PORT BEHAVIOR
*tcp* *0* *x* *x* *Dedicated client, fails
if immediately connecting
@@ -566,7 +611,7 @@ available and demonstrate the differences between them.
* Menu:
* File /inet/tcp:: The TCP special file.
-* File /inet/udp:: The UDB special file.
+* File /inet/udp:: The UDP special file.
* File /inet/raw:: The RAW special file.

@@ -575,7 +620,7 @@ File: gawkinet.info, Node: File /inet/tcp, Next: File /inet/udp, Prev: Compar
`/inet/tcp'
...........
- Once again, always use TCP. (Use UDP when low-overhead is a
+ 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:
@@ -642,7 +687,7 @@ File: gawkinet.info, Node: File /inet/raw, Prev: File /inet/udp, Up: Comparin
This is an IP-level protocol. Only `root' is allowed to access this
special file. It is meant to be the basis for implementing and
-experimenting with transport level protocols.(1) In the most general
+experimenting with transport-level protocols.(1) 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.
@@ -711,7 +756,7 @@ 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
-(`/inet/tcp') to the machine it is running on (`localhost'), and asks
+(`/inet/tcp') to the machine it is running on (`localhost') and asks
the service `daytime' on the machine what time it is:
BEGIN {
@@ -753,7 +798,7 @@ line from the special file `/inet/tcp/0/localhost/daytime'. We could
also have printed a line into the special file. But instead we just
read a line with the time, printed it, and closed the connection.
(While we could just let `gawk' close the connection by finishing the
-program, in this Info file we are pedantic, and always explicitly close
+program, in this Info file we are pedantic and always explicitly close
the connections.)

@@ -762,24 +807,24 @@ File: gawkinet.info, Node: Troubleshooting, Next: Interacting, Prev: TCP Conn
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 `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 major node,
-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 `localhost' with the name of your machine or its IP address.
-If it does, you could replace `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 `daytime' service.
-Try changing the service to `chargen' or `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'. It
-could look like this:
+ 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 `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 major node, 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 `localhost' with the name of
+your machine or its IP address. If it does, you could replace
+`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 `daytime' service. Try changing the service to
+`chargen' or `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 `/etc/services' file. It could look like this:
# /etc/services:
#
@@ -813,13 +858,13 @@ could look like this:
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 _not_ support such
+running some flavor of Microsoft Windows usually do _not_ support these
services. Nevertheless, it _is_ possible to do networking with `gawk'
on Microsoft Windows.(1) 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 (`echo') support TCP as well as
-UDP.
+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 (`echo')
+support TCP as well as UDP.
---------- Footnotes ----------
@@ -857,7 +902,7 @@ program repeatedly reads lines that come as a reply. When no more lines
are coming (because the service has closed the connection), the program
also closes the connection. Try replacing `"NAME"' with your login name
(or the name of someone else logged in). For a list of all users
-currently logged in, replace NAME with an empty string `""'.
+currently logged in, replace NAME with an empty string (`""').
The final `close' command could be safely deleted from the above
script, because the operating system closes any open connection by
@@ -897,7 +942,7 @@ Setting Up a Service
somewhere on the Internet and request a particular service. Now we set
up such a service to mimic the behavior of the `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
+the network. Therefore, we cannot insert a name for the host to connect
to in our special file name.
Start the following program in one window. Notice that the service
@@ -930,13 +975,13 @@ Start the server program in both windows. The first one works, but the
second one 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 `8888' to `echo'.
-After restarting it, the server program does not run any more and you
-know why: there already is an `echo' service running on your machine.
+After restarting it, the server program does not run any more, and you
+know why: there is already an `echo' service running on your machine.
But even if this isn't true, you would not get your own `echo' server
running on a Unix machine, because the ports with numbers smaller than
1024 (`echo' is at port 7) are reserved for `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
+reserves ports 1 to 1024 for a privileged user; hence, you can start an
`echo' server there.
Turning this short server program into something really useful is
@@ -1076,7 +1121,7 @@ following:
(1) 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.
+obsolete by RFC 2616, an update without any substantial changes.

File: gawkinet.info, Node: Primitive Service, Next: Interacting Service, Prev: Web page, Up: Using Networking
@@ -1097,7 +1142,7 @@ not know in advance which host will connect to our service.
and close the connection. Here, we adhere to the modern syntax of HTTP.
The steps are as follows:
- 1. Send a status line telling the web browser that everything is OK.
+ 1. Send a status line telling the web browser that everything is okay.
2. Send a line to tell the browser how many bytes follow in the body
of the message. This was not necessary earlier because both
@@ -1156,7 +1201,7 @@ node, we develop a main program (a `BEGIN' pattern and its action)
that will become the core of event-driven execution controlled by a
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
+procedure. Parameters and menu choices are extracted from this request,
and an appropriate measure is taken according to the user's choice.
For example:
@@ -1352,19 +1397,19 @@ the function `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 `&' is encoded as a percent sign
-followed by the hexadecimal value--`%26'. These encoded values should
+followed by the hexadecimal value: `%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 used throughout the rest
of this Info file. If you want to use it for your own web server,
store the source code into a file named `inetlib.awk'. Then you can
include these functions into your code by placing the following
-statement into your program:
+statement into your program (on the first line of your script):
@include inetlib.awk
-on the first line of your script. But beware, this mechanism is only
-possible if you invoke your web server script with `igawk' instead of
-the usual `awk' or `gawk'. Here is the code:
+But beware, this mechanism is only possible if you invoke your web
+server script with `igawk' instead of the usual `awk' or `gawk'. Here
+is the code:
# CGI Library and core of a web server
# Global arrays
@@ -1483,13 +1528,13 @@ although there is nothing to enforce this:
}
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 `0' is not in the string on purpose; `index'
-returns zero when it's not found, automatically giving the correct
-value! Once the hexadecimal value is converted from characters in a
-string into a numerical value, `sprintf' converts the value back into a
-real character. The following is a simple test harness for the above
-functions:
+The two digits are converted to lowercase characters and looked up in a
+string of hex digits. Note that `0' is not in the string on purpose;
+`index' returns zero when it's not found, automatically giving the
+correct value! Once the hexadecimal value is converted from characters
+in a string into a numerical value, `sprintf' converts the value back
+into a real character. The following is a simple test harness for the
+above functions:
BEGIN {
CGI_setup("GET",
@@ -1530,7 +1575,7 @@ File: gawkinet.info, Node: Simple Server, Next: Caveats, Prev: Interacting Se
A Simple Web Server
===================
- In the preceding node, we built the core logic for event driven GUIs.
+ In the preceding node, we built the core logic for event-driven GUIs.
In this node, we finally extend the core to a real application. No one
would actually write a commercial web server in `gawk', but it is
instructive to see that it is feasible in principle.
@@ -1614,9 +1659,9 @@ holds the HTML page contents:
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
+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
the keyword for later use, and finally selects an answer from the set of
possible answers:
@@ -1723,14 +1768,14 @@ 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
+noncausal because it is not reproducible in a strong sense. Whether a
network application works or not sometimes depends on the following:
- * How crowded the underlying network is.
+ * How crowded the underlying network is
- * If the party at the other end is running or not.
+ * If the party at the other end is running or not
- * The state of the party at the other end.
+ * The state of the party at the other end
The most difficult problems for a beginner arise from the hidden
states of the underlying network. After closing a TCP connection, it's
@@ -1900,17 +1945,17 @@ technology that may shape the future of networking.
We often refer to the site-independent core of the server that we
built in *Note A Simple Web Server: Simple Server. When building new
-and non-trivial servers, we always copy this building block and append
+and nontrivial servers, we always copy this building block and append
new instances of the two functions `SetUpServer' and `HandleGET'.
This makes a lot of sense, since this scheme of event-driven
execution provides `gawk' with an interface to the most widely accepted
-standard for GUIs: the web browser. Now, `gawk' can even rival Tcl/Tk.
+standard for GUIs: the web browser. Now, `gawk' can rival even Tcl/Tk.
Tcl and `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 `gawk' had nothing comparable up to
-now. While Tcl needs a large and ever changing library (Tk, which was
+But Tcl has Tk on top of it, and `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), `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
@@ -1935,7 +1980,7 @@ VRML, or whatever else comes along to do our work.

File: gawkinet.info, Node: PANIC, Next: GETURL, Prev: Some Applications and Techniques, Up: Some Applications and Techniques
-PANIC: an Emergency Web Server
+PANIC: An Emergency Web Server
==============================
At first glance, the `"Hello, world"' example in *Note A Primitive
@@ -3674,7 +3719,6 @@ GNU Free Documentation License
******************************
Version 1.1, March 2000
-
Copyright (C) 2000 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -3682,7 +3726,6 @@ GNU Free Documentation License
of this license document, but changing it is not allowed.
-
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
@@ -3769,7 +3812,6 @@ GNU Free Documentation License
Page" means the text near the most prominent appearance of the
work's title, preceding the beginning of the body of the text.
-
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
@@ -3786,7 +3828,6 @@ GNU Free Documentation License
You may also lend copies, under the same conditions stated above,
and you may publicly display copies.
-
3. COPYING IN QUANTITY
If you publish printed copies of the Document numbering more than
@@ -3827,7 +3868,6 @@ GNU Free Documentation License
copies, to give them a chance to provide you with an updated
version of the Document.
-
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document
@@ -3933,7 +3973,6 @@ GNU Free Documentation License
License give permission to use their names for publicity for or to
assert or imply endorsement of any Modified Version.
-
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under
@@ -3959,7 +3998,6 @@ GNU Free Documentation License
"Acknowledgements", and any sections entitled "Dedications". You
must delete all sections entitled "Endorsements."
-
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other
@@ -3975,7 +4013,6 @@ GNU Free Documentation License
this License in all other respects regarding verbatim copying of
that document.
-
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other
@@ -3995,7 +4032,6 @@ GNU Free Documentation License
aggregate. Otherwise they must appear on covers around the whole
aggregate.
-
8. TRANSLATION
Translation is considered a kind of modification, so you may
@@ -4009,7 +4045,6 @@ GNU Free Documentation License
disagreement between the translation and the original English
version of this License, the original English version will prevail.
-
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document
@@ -4020,7 +4055,6 @@ GNU Free Documentation License
from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
-
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions of
@@ -4074,9 +4108,11 @@ Index
* Menu:
-* /inet/raw special files: File /inet/raw.
-* /inet/tcp special files: File /inet/tcp.
-* /inet/udp special files: File /inet/udp.
+* /inet/ files (gawk): Gawk Special Files.
+* /inet/raw special files (gawk): File /inet/raw.
+* /inet/tcp special files (gawk): File /inet/tcp.
+* /inet/udp special files (gawk): File /inet/udp.
+* advanced features, network connections: Troubleshooting.
* agent <1>: MOBAGWHO.
* agent: Challenges.
* AI: Challenges.
@@ -4086,161 +4122,213 @@ Index
* BLAST, Basic Local Alignment Search Tool: PROTBASE.
* blocking: Making Connections.
* Boutell, Thomas: STATIST.
-* CGI <1>: MOBAGWHO.
-* CGI <2>: Interacting Service.
-* CGI: Web page.
-* client: Making Connections.
+* CGI (Common Gateway Interface): MOBAGWHO.
+* CGI (Common Gateway Interface), dynamic web pages and: Web page.
+* CGI (Common Gateway Interface), library: CGI Lib.
+* clients: Making Connections.
* Clinton, Bill: Challenges.
+* Common Gateway Interface, See CGI: Web page.
* Computational Biology: PROTBASE.
-* Contest: Challenges.
-* cron: STOXPRED.
+* contest: Challenges.
+* cron utility: STOXPRED.
* CSV format: STOXPRED.
-* dark corner: File /inet/raw.
+* dark corner, RAW protocol: File /inet/raw.
* Dow Jones Industrial Index: STOXPRED.
* ELIZA program: Simple Server.
+* email: Email.
* FASTA/Pearson format: PROTBASE.
+* filenames, for network access: Gawk Special Files.
+* files, /inet/ (gawk): Gawk Special Files.
+* files, /inet/raw (gawk): File /inet/raw.
+* files, /inet/tcp (gawk): File /inet/tcp.
+* files, /inet/udp (gawk): File /inet/udp.
* finger utility: Setting Up.
-* FTP: Basic Protocols.
-* getline built-in function: TCP Connecting.
+* FTP (File Transfer Protocol): Basic Protocols.
+* gawk, networking: Using Networking.
+* gawk, networking, connections <1>: TCP Connecting.
+* gawk, networking, connections: Special File Fields.
+* gawk, networking, filenames: Gawk Special Files.
+* gawk, networking, See Also email: Email.
+* gawk, networking, service, establishing: Setting Up.
+* gawk, networking, troubleshooting: Caveats.
+* gawk, web and, See web service: Interacting Service.
+* getline command: TCP Connecting.
* GETURL program: GETURL.
-* gif image format <1>: STATIST.
-* gif image format: Web page.
+* GIF image format <1>: STATIST.
+* GIF image format: Web page.
* GNU/Linux <1>: REMCONF.
* GNU/Linux <2>: Interacting.
* GNU/Linux: Troubleshooting.
* GNUPlot utility <1>: STATIST.
* GNUPlot utility: Interacting Service.
-* GUI <1>: Simple Server.
-* GUI: Interacting Service.
* Hoare, C.A.R. <1>: PROTBASE.
* Hoare, C.A.R.: MOBAGWHO.
-* HTML: Web page.
-* HTTP <1>: Web page.
-* HTTP: Basic Protocols.
+* hostname field: Special File Fields.
+* HTML (Hypertext Markup Language): Web page.
+* HTTP (Hypertext Transfer Protocol) <1>: Web page.
+* HTTP (Hypertext Transfer Protocol): Basic Protocols.
+* HTTP (Hypertext Transfer Protocol), record separators and: Web page.
* HTTP server, core logic: Interacting Service.
* Humphrys, Mark: Simple Server.
-* image format <1>: STATIST.
-* image format: Interacting Service.
-* JavaScript <1>: STATIST.
-* JavaScript: Some Applications and Techniques.
+* Hypertext Markup Language (HTML): Web page.
+* Hypertext Transfer Protocol, See HTTP: Web page.
+* image format: STATIST.
+* images, in web pages: Interacting Service.
+* images, retrieving over networks: Web page.
+* input/output, two-way, See Also gawk, networking: Gawk Special Files.
+* Internet, See networks: Interacting.
+* JavaScript: STATIST.
* Linux <1>: REMCONF.
* Linux <2>: Interacting.
* Linux: Troubleshooting.
* Lisp: MOBAGWHO.
+* localport field: Gawk Special Files.
* Loebner, Hugh: Challenges.
-* Loui, Ronald P.: Challenges.
+* Loui, Ronald: Challenges.
* MAZE: MAZE.
-* Microsoft Windows <1>: WEBGRAB.
-* Microsoft Windows <2>: Setting Up.
-* Microsoft Windows: Troubleshooting.
+* Microsoft Windows: WEBGRAB.
+* Microsoft Windows, networking: Troubleshooting.
+* Microsoft Windows, networking, ports: Setting Up.
* MiniSQL: REMCONF.
* MOBAGWHO program: MOBAGWHO.
* NCBI, National Center for Biotechnology Information: PROTBASE.
-* network <1>: Caveats.
-* network <2>: Gawk Special Files.
-* network: Using Networking.
+* networks, gawk and: Using Networking.
+* networks, gawk and, connections <1>: TCP Connecting.
+* networks, gawk and, connections: Special File Fields.
+* networks, gawk and, filenames: Gawk Special Files.
+* networks, gawk and, See Also email: Email.
+* networks, gawk and, service, establishing: Setting Up.
+* networks, gawk and, troubleshooting: Caveats.
+* networks, ports, reserved: Setting Up.
+* networks, ports, specifying: Special File Fields.
+* networks, See Also web pages: PANIC.
* Numerical Recipes: STATIST.
+* ORS variable, HTTP and: Web page.
+* ORS variable, POP and: Email.
* PANIC program: PANIC.
* Perl: Using Networking.
+* Perl, gawk networking and: Using Networking.
* Perlis, Alan: MAZE.
-* png image format <1>: STATIST.
-* png image format: Web page.
-* POP: Email.
+* pipes, networking and: TCP Connecting.
+* PNG image format <1>: STATIST.
+* PNG image format: Web page.
+* POP (Post Office Protocol): Email.
+* Post Office Protocol (POP): Email.
* PostScript: STATIST.
* PROLOG: Challenges.
* PROTBASE: PROTBASE.
-* ps image format: STATIST.
+* protocol field: Special File Fields.
+* PS image format: STATIST.
* Python: Using Networking.
-* RAW: File /inet/raw.
+* Python, gawk networking and: Using Networking.
+* RAW protocol: File /inet/raw.
+* record separators, HTTP and: Web page.
+* record separators, POP and: Email.
* REMCONF program: REMCONF.
-* reserved ports: Setting Up.
-* RFC 1939: Email.
-* RFC 1945: Web page.
-* RFC 2068 <1>: Interacting Service.
-* RFC 2068: Web page.
-* RFC 2616: Web page.
-* RFC 821: Email.
+* remoteport field: Gawk Special Files.
* robot <1>: WEBGRAB.
-* robot <2>: GETURL.
* robot: Challenges.
-* server <1>: Setting Up.
-* server: Making Connections.
-* SMTP <1>: Email.
-* SMTP: Basic Protocols.
+* RS variable, HTTP and: Web page.
+* RS variable, POP and: Email.
+* servers <1>: Setting Up.
+* servers: Making Connections.
+* servers, as hosts: Special File Fields.
+* servers, HTTP: Interacting Service.
+* servers, web: Simple Server.
+* Simple Mail Transfer Protocol (SMTP): Email.
+* SMTP (Simple Mail Transfer Protocol) <1>: Email.
+* SMTP (Simple Mail Transfer Protocol): Basic Protocols.
* SPAK utility: File /inet/raw.
* STATIST program: STATIST.
* STOXPRED program: STOXPRED.
* synchronous communications: Making Connections.
-* Tcl/Tk <1>: Some Applications and Techniques.
* Tcl/Tk: Using Networking.
-* TCP <1>: Interacting.
-* TCP: File /inet/tcp.
-* UDP <1>: Interacting.
-* UDP: File /inet/udp.
+* Tcl/Tk, gawk and <1>: Some Applications and Techniques.
+* Tcl/Tk, gawk and: Using Networking.
+* TCP (Transmission Control Protocol) <1>: File /inet/tcp.
+* TCP (Transmission Control Protocol): Using Networking.
+* TCP (Transmission Control Protocol), connection, establishing: TCP Connecting.
+* TCP (Transmission Control Protocol), UDP and: Interacting.
+* TCP/IP, protocols, selecting: Special File Fields.
+* TCP/IP, sockets and: Gawk Special Files.
+* Transmission Control Protocol, See TCP: Using Networking.
+* troubleshooting, gawk, networks: Caveats.
+* troubleshooting, networks, connections: Troubleshooting.
+* troubleshooting, networks, timeouts: Caveats.
+* UDP (User Datagram Protocol): File /inet/udp.
+* UDP (User Datagram Protocol), TCP and: Interacting.
+* Unix, network ports and: Setting Up.
* URLCHK program: URLCHK.
+* User Datagram Protocol, See UDP: File /inet/udp.
+* vertical bar (|), |& operator (I/O): TCP Connecting.
* VRML: MAZE.
+* web browsers, See web service: Interacting Service.
+* web pages: Web page.
+* web pages, images in: Interacting Service.
+* web pages, retrieving: GETURL.
+* web servers: Simple Server.
+* web service <1>: PANIC.
+* web service: Primitive Service.
* WEBGRAB program: WEBGRAB.
* Weizenbaum, Joseph: Simple Server.
-* xbm image format: Interacting Service.
-* Yahoo: STOXPRED.
-* Yahoo! <1>: REMCONF.
-* Yahoo! <2>: Simple Server.
-* Yahoo!: Web page.
-* |& I/O operator: TCP Connecting.
+* XBM image format: Interacting Service.
+* Yahoo! <1>: STOXPRED.
+* Yahoo!: REMCONF.
+* | (vertical bar), |& operator (I/O): TCP Connecting.

Tag Table:
-Node: Top1119
-Node: Preface3953
-Node: Introduction5331
-Node: Stream Communications6355
-Node: Datagram Communications7523
-Node: The TCP/IP Protocols9148
-Ref: The TCP/IP Protocols-Footnote-19824
-Node: Basic Protocols9981
-Node: Ports11288
-Node: Making Connections12685
-Ref: Making Connections-Footnote-115256
-Node: Using Networking15303
-Node: Gawk Special Files17627
-Node: Special File Fields19649
-Node: Comparing Protocols24957
-Node: File /inet/tcp25537
-Node: File /inet/udp26550
-Node: File /inet/raw27658
-Ref: File /inet/raw-Footnote-130678
-Node: TCP Connecting30758
-Node: Troubleshooting33093
-Ref: Troubleshooting-Footnote-136090
-Node: Interacting36609
-Node: Setting Up39332
-Node: Email42818
-Node: Web page45139
-Ref: Web page-Footnote-147939
-Node: Primitive Service48142
-Node: Interacting Service50869
-Ref: Interacting Service-Footnote-159992
-Node: CGI Lib60024
-Node: Simple Server66994
-Ref: Simple Server-Footnote-174716
-Node: Caveats74817
-Node: Challenges75958
-Node: Some Applications and Techniques84617
-Node: PANIC87073
-Node: GETURL88786
-Node: REMCONF91404
-Node: URLCHK96875
-Node: WEBGRAB100705
-Node: STATIST105150
-Ref: STATIST-Footnote-1116851
-Node: MAZE117296
-Node: MOBAGWHO123476
-Ref: MOBAGWHO-Footnote-1137412
-Node: STOXPRED137467
-Node: PROTBASE151742
-Node: Links164833
-Node: GNU Free Documentation License168265
-Node: Index188159
+Node: Top1132
+Node: Preface5684
+Node: Introduction7062
+Node: Stream Communications8086
+Node: Datagram Communications9254
+Node: The TCP/IP Protocols10879
+Ref: The TCP/IP Protocols-Footnote-111555
+Node: Basic Protocols11712
+Node: Ports13019
+Node: Making Connections14416
+Ref: Making Connections-Footnote-116987
+Node: Using Networking17034
+Node: Gawk Special Files19387
+Node: Special File Fields21386
+Node: Comparing Protocols26692
+Node: File /inet/tcp27272
+Node: File /inet/udp28285
+Node: File /inet/raw29393
+Ref: File /inet/raw-Footnote-132413
+Node: TCP Connecting32493
+Node: Troubleshooting34826
+Ref: Troubleshooting-Footnote-137877
+Node: Interacting38396
+Node: Setting Up41121
+Node: Email44610
+Node: Web page46931
+Ref: Web page-Footnote-149731
+Node: Primitive Service49928
+Node: Interacting Service52657
+Ref: Interacting Service-Footnote-161781
+Node: CGI Lib61813
+Node: Simple Server68795
+Ref: Simple Server-Footnote-176528
+Node: Caveats76629
+Node: Challenges77766
+Node: Some Applications and Techniques86425
+Node: PANIC88881
+Node: GETURL90594
+Node: REMCONF93212
+Node: URLCHK98683
+Node: WEBGRAB102513
+Node: STATIST106958
+Ref: STATIST-Footnote-1118659
+Node: MAZE119104
+Node: MOBAGWHO125284
+Ref: MOBAGWHO-Footnote-1139220
+Node: STOXPRED139275
+Node: PROTBASE153550
+Node: Links166641
+Node: GNU Free Documentation License170073
+Node: Index189956

End Tag Table
diff --git a/doc/gawkinet.texi b/doc/gawkinet.texi
index 2ffb5814..d51ce794 100644
--- a/doc/gawkinet.texi
+++ b/doc/gawkinet.texi
@@ -3,6 +3,7 @@
@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,20 +65,18 @@
@set TITLE TCP/IP Internetworking With @command{gawk}
@set EDITION 1.1
-@set UPDATE-MONTH March, 2001
+@set UPDATE-MONTH April, 2002
@c gawk versions:
@set VERSION 3.1
-@set PATCHLEVEL 0
-
-@ifinfo
-This file documents the networking features in GNU @command{awk}.
+@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.
-
-Copyright (C) 2000, 2001 Free Software Foundation, Inc.
-
+@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,6 +94,12 @@ texts being (a) (see below), and with the Back-Cover Texts being (b)
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,16 +116,6 @@ funds for GNU development.''
@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
@@ -135,23 +130,8 @@ URL: @uref{http://www.gnu.org/} @*
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''
+@insertcopying
-@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
@@ -169,6 +149,8 @@ funds for GNU development.''
This file documents the networking features in GNU Awk (@command{gawk})
version 3.1 and later.
+
+@insertcopying
@end ifinfo
@menu
@@ -192,7 +174,7 @@ version 3.1 and later.
* 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/udp:: The UDP special file.
* File /inet/raw:: The RAW special file.
* TCP Connecting:: Making a TCP connection.
* Troubleshooting:: Troubleshooting TCP/IP connections.
@@ -414,9 +396,9 @@ when using @command{gawk} for network programming.
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
+@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,7 +438,7 @@ such as HTTP or FTP, determine who is the client and who is the
server. Often, it turns out that the client and server are the
same in both roles.)
-@cindex server
+@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,7 +448,7 @@ the phone@footnote{In the days before voice mail systems!}, the
server process (usually) has to be started first and waiting
for a connection.
-@cindex client
+@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,7 +504,10 @@ RAW&&X&\cr
@comment node-name, next, previous, up
@chapter Networking With @command{gawk}
-@cindex network
+@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,15 +532,21 @@ The advanced
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
+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}.
-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.
+@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,11 +568,10 @@ untractable (RAW).
@node Gawk Special Files, TCP Connecting, Using Networking, Using Networking
@comment node-name, next, previous, up
-@section @command{gawk} Networking Mechanisms
-@cindex network
+@section @command{gawk}'s Networking Mechanisms
The @samp{|&} operator introduced in @command{gawk} 3.1 for use in
-communicating with a @dfn{co-process} is described 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,11 +579,15 @@ reading data with @code{getline}. If you haven't read it already, you should
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
+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.
-At the C, C++ (and basic Perl) level, networking is accomplished
+@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,13 +598,23 @@ The special files provided in @command{gawk} hide the details from
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 them mandatory, none of them optional:
+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,9 +631,12 @@ to be @samp{0}.
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}.
+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,23 +645,26 @@ network. There are three possible values (always written in lowercase):
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
+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
+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
+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
+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}.
+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,13 +673,15 @@ Determines which port on the remote
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.
+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,7 +690,7 @@ use another language.
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:
+in the following pseudocode:
@smallexample
if ((name of remote host given) && (other side accepts connection)) @{
@@ -705,7 +717,7 @@ patterns printed in bold letters.
@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}
+@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,16 +752,17 @@ available and demonstrate the differences between them.
@menu
* File /inet/tcp:: The TCP special file.
-* File /inet/udp:: The UDB 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 @file{/inet/tcp} special files
-@cindex 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
+(Use UDP when low overhead is a necessity, and use RAW for
network experimentation.)
The first example is the sender
program:
@@ -783,8 +796,10 @@ first, and it waits for the receiver to read a line.
@node File /inet/udp, File /inet/raw, File /inet/tcp, Comparing Protocols
@subsubsection @file{/inet/udp}
-@cindex @file{/inet/udp} special files
-@cindex 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,18 +833,19 @@ such as data acquisition, logging, and even stateless services like NFS.
@node File /inet/raw, , File /inet/udp, Comparing Protocols
@subsubsection @file{/inet/raw}
-@cindex @file{/inet/raw} special files
-@cindex 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
+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
+@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,13 +910,18 @@ implies that line separation with @code{RS} does not work as usual.
@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
+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
+@cindex @code{getline} command
@example
BEGIN @{
"/inet/tcp/0/localhost/daytime" |& getline
@@ -920,12 +941,15 @@ being read like any other file (@samp{getline <
"/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,29 +975,32 @@ We could also have printed a line into the special file. But instead we just
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.)
+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
+@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
-like DECnet or Novell's IPX. For the rest of this @value{CHAPTER},
+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 above program does
-not run on such a machine, it may help to replace the name
+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.
+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
+curious, you should have a look at your @file{/etc/services} file. It could
look like this:
@ignore
@@ -1035,11 +1062,11 @@ irc 194/udp
@cindex Linux
@cindex GNU/Linux
-@cindex Microsoft Windows
+@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 such services.
+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,8 +1077,8 @@ their TCP/IP implementation to Microsoft Windows for Workgroups 3.11, but it was
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
+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,7 +1113,7 @@ lines are coming (because the service has closed the connection), the
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{""}.
+(@code{""}).
@cindex Linux
@cindex GNU/Linux
@@ -1166,8 +1193,9 @@ remember the advice Douglas E.@: Comer and David Stevens give in
Volume III of their series @cite{Internetworking With TCP}
(page 14):
-@cindex TCP
-@cindex UDP
+@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,11 +1206,15 @@ or the application cannot tolerate virtual circuit overhead.
@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
+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,7 +1227,7 @@ Also notice that the service name has to be entered into a different field
of the special @value{FN} because we are setting up a server, not a client:
@cindex @command{finger} utility
-@cindex server
+@cindex servers
@example
BEGIN @{
print strftime() |& "/inet/tcp/8888/0/0"
@@ -1217,8 +1249,10 @@ Sat Sep 27 19:08:16 CEST 1997
@noindent
Both programs explicitly close the connection.
-@cindex Microsoft Windows
-@cindex reserved ports
+@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,14 +1260,14 @@ program in both windows. The first one works, but the second one
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
+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
+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,10 +1299,14 @@ execute arbitrary commands, anyone would be free to do @samp{rm -rf *}.
@node Email, Web page, Setting Up, Using Networking
@section Reading Email
-@cindex POP
-@cindex SMTP
-@cindex RFC 1939
-@cindex RFC 821
+@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,6 +1317,7 @@ RFC 821 defines SMTP. See
@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,7 +1345,11 @@ BEGIN @{
@}
@end example
-@cindex RFC 1939
+@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,9 +1366,11 @@ message it reads, but instead leaves it on the server.
@node Web page, Primitive Service, Email, Using Networking
@section Reading a Web Page
-@cindex HTTP
-@cindex RFC 2068
-@cindex RFC 2616
+@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,9 +1432,13 @@ BEGIN @{
@}
@end example
-@cindex RFC 1945
-@cindex HTML
-@cindex Yahoo!
+@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,7 +1447,7 @@ service to transmit a web page (here the home page of the Yahoo! search
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
+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,9 +1459,11 @@ then you get the body of the page in HTML. The lines of the headers also
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
+@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,6 +1494,8 @@ Another good source is @cite{The CGI Resource Index}}.@footnote{@uref{http://www
@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,7 +1513,7 @@ The steps are as follows:
@enumerate 1
@item
Send a status line telling the web browser that everything
-is OK.
+is okay.
@item
Send a line to tell the browser how many bytes follow in the
@@ -1509,7 +1562,11 @@ use a proxy to connect to your machine.
@node Interacting Service, Simple Server, Primitive Service, Using Networking
@section A Web Service with Interaction
-@cindex GUI
+@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,7 +1584,7 @@ that will become the core of event-driven execution controlled by a
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
+extracted from this request, and an appropriate measure is taken according to
the user's choice.
For example:
@@ -1615,8 +1672,7 @@ is the first run, @code{GETARG["Method"]} is not initialized yet, hence the
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
+@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,7 +1759,6 @@ function HandleGET() @{
@}
@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
@@ -1713,8 +1768,9 @@ consists of just one @command{gawk} program. No need for installing an
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 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,13 +1790,15 @@ Phil Smith III,@*
@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
+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,14 +1806,15 @@ used throughout the rest of this @value{DOCUMENT}.
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:
+into your program
+(on the first line of your script):
@example
@@include inetlib.awk
@end example
@noindent
-on the first line of your script. But beware, this mechanism is
+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,7 +1955,7 @@ function _CGI_decode(str, hexdigs, i, pre, code1, code2,
@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
+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,16 +2005,15 @@ p2=stuff%26junk&percent=a %25 sign
@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.
+@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.
-@iftex
-@image{uf002331,4in}
-@end iftex
-
@cindex ELIZA program
@cindex Weizenbaum, Joseph
The application is ELIZA, the famous program by Joseph Weizenbaum that
@@ -2005,7 +2063,6 @@ initialize the HTML pages and some variables. These initializations
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
@@ -2049,7 +2106,7 @@ function HandleGET() @{
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
+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,7 +2372,6 @@ function SetUpEliza() @{
@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
@@ -2325,25 +2381,28 @@ explain how to modify the Java source code.
@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 non-causal because
+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.
+How crowded the underlying network is
@item
-If the party at the other end is running or not.
+If the party at the other end is running or not
@item
-The state of the party at the other end.
+The state of the party at the other end
@end itemize
-@cindex network
+@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,7 +2416,7 @@ provides a list of still ``active'' connections.
@section Where To Go From Here
@cindex Loebner, Hugh
-@cindex Contest
+@cindex contest
Now, you have learned enough to build your own application. You could,
for example, take part in the
Loebner Contest
@@ -2434,7 +2493,7 @@ some passages from the text:
@cindex AI
@cindex PROLOG
-@cindex Loui, Ronald P.
+@cindex Loui, Ronald
@cindex agent
@quotation
The GAWK manual can
@@ -2517,22 +2576,21 @@ explore leading edge technology that may shape the future of networking.
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
+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 even rival
+accepted standard for GUIs: the web browser. Now, @command{gawk} can rival even
Tcl/Tk.
-@cindex Tcl/Tk
-@cindex JavaScript
+@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
+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,8 +2612,10 @@ We can use HTML, JavaScript, VRML, or whatever else comes along to do our work.
@end menu
@node PANIC, GETURL, Some Applications and Techniques, Some Applications and Techniques
-@section PANIC: an Emergency Web Server
+@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,7 +2659,7 @@ BEGIN @{
@node GETURL, REMCONF, PANIC, Some Applications and Techniques
@section GETURL: Retrieving Web Pages
@cindex GETURL program
-@cindex robot
+@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,9 +3055,9 @@ sure that none of the above reveals too much information about your system.
@cindex GNUPlot utility
@cindex image format
-@cindex @file{gif} image format
-@cindex @file{png} image format
-@cindex @file{ps} image format
+@cindex GIF image format
+@cindex PNG image format
+@cindex PS image format
@cindex Boutell, Thomas
@iftex
@image{statist,3in}
@@ -3529,7 +3589,7 @@ of the server's CGI script. So, to implement a mobile agent,
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 CGI (Common Gateway Interface)
@cindex apache
@item
The @code{PUT} method can also be used for migration. HTTP does not
@@ -3822,7 +3882,7 @@ the originating host, whose name is stored in @code{MOBVAR["MyOrigin"]}.
@node STOXPRED, PROTBASE, MOBAGWHO, Some Applications and Techniques
@section STOXPRED: Stock Market Prediction As A Service
@cindex STOXPRED program
-@cindex Yahoo
+@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,7 +3901,7 @@ were unhappy.} @*
Douglas Adams, @cite{The Hitch Hiker's Guide to the Galaxy}
@end quotation
-@cindex @command{cron}
+@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 --git a/doc/texinfo.tex b/doc/texinfo.tex
index 0b5b9033..df62a127 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -3,10 +3,10 @@
% 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}
+\def\texinfoversion{2002-03-26.08}
%
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
-% 2000, 01 Free Software Foundation, Inc.
+% 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,14 +30,17 @@
% 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.
+% (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/.
+%
+% 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,13 +53,13 @@
% 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.
+% 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 ftp://ftp.gnu.org/gnu/texinfo/.
+% the existing language-specific files from the full Texinfo distribution.
\message{Loading texinfo [version \texinfoversion]:}
@@ -170,6 +173,16 @@
}%
\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,7 +444,7 @@
% environments. --karl, 6may93
%{\advance \baselineskip by -\singlespaceskip
%\kern \baselineskip}%
- \setleading \singlespaceskip
+ \setleading\singlespaceskip
}
%% Simple single-character @ commands
@@ -823,18 +836,43 @@ where each line of input produces a line of output.}
%
\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.
+% @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}%
+}}
%
-% This isn't quite enough for @math to work properly in indices, but it
-% seems unlikely it will ever be needed there.
+% 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}
%
-\let\implicitmath = $
-\def\math#1{\implicitmath #1\implicitmath}
+\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,10 +955,12 @@ where each line of input produces a line of output.}
\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
- \pdfimage
+ \immediate\pdfimage
\else
- \pdfximage
+ \immediate\pdfximage
\fi
\ifx\empty\imagewidth\else width \imagewidth \fi
\ifx\empty\imageheight\else height \imageheight \fi
@@ -932,8 +972,8 @@ where each line of input produces a line of output.}
\ifnum\pdftexversion < 14 \else
\pdfrefximage \pdflastximage
\fi}
- \def\pdfmkdest#1{\pdfdest name{#1} xyz}
- \def\pdfmkpgn#1{#1@}
+ \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,7 +985,7 @@ where each line of input produces a line of output.}
\expandafter\xdef\csname#1\endcsname{\the\tempnum}}
\def\pdfmakeoutlines{{%
\openin 1 \jobname.toc
- \ifeof 1\else\bgroup
+ \ifeof 1\else\begingroup
\closein 1
\indexnofonts
\def\tt{}
@@ -955,32 +995,34 @@ where each line of input produces a line of output.}
\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{}
+ \def\unnumbsecentry ##1##2##3{\advancenumber{chap##2}}
\def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
- \def\unnumbsubsecentry ##1##2{}
+ \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{}
+ \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{%
- \pdfoutline goto name{\pdfmkpgn{##2}}{##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{%
- \pdfoutline goto name{\pdfmkpgn{##2}}{##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{%
- \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\unnumbsubsubsecentry ##1##2##3##4##5{%
+ \pdfoutline goto name{\pdfmkpgn{##5}}{##1}}
\input \jobname.toc
- \egroup\fi
+ \endgroup\fi
}}
\def\makelinks #1,{%
\def\params{#1}\def\E{END}%
@@ -1030,6 +1072,7 @@ where each line of input produces a line of output.}
\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,9 +1100,8 @@ where each line of input produces a line of output.}
\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}}
+ \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
\linkcolor #1\endlink}
- \def\mkpgn#1{#1@}
\def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
\fi % \ifx\pdfoutput
@@ -1076,9 +1118,26 @@ where each line of input produces a line of output.}
% We don't need math for this one.
\def\ttsl{\tenttsl}
-% Use Computer Modern fonts at \magstephalf (11pt).
-\newcount\mainmagstep
-\mainmagstep=\magstephalf
+% 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,13 +1167,16 @@ where each line of input produces a line of output.}
\def\scshape{csc}
\def\scbshape{csc}
+\newcount\mainmagstep
\ifx\bigger\relax
-\let\mainmagstep=\magstep1
-\setfont\textrm\rmshape{12}{1000}
-\setfont\texttt\ttshape{12}{1000}
+ % not really supported.
+ \let\mainmagstep=\magstep1
+ \setfont\textrm\rmshape{12}{1000}
+ \setfont\texttt\ttshape{12}{1000}
\else
-\setfont\textrm\rmshape{10}{\mainmagstep}
-\setfont\texttt\ttshape{10}{\mainmagstep}
+ \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,6 +1207,18 @@ where each line of input produces a line of output.}
\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,20 +1256,6 @@ where each line of input produces a line of output.}
\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}
@@ -1212,17 +1272,16 @@ where each line of input produces a line of output.}
% 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).
+% 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
+ \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,7 +1292,7 @@ where each line of input produces a line of output.}
\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}
+ \resetmathfonts \setleading{\textleading}}
\def\titlefonts{%
\let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
\let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
@@ -1262,7 +1321,14 @@ where each line of input produces a line of output.}
\let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
\let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
\let\tenttsl=\smallttsl
- \resetmathfonts \setleading{11pt}}
+ \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,11 +1442,19 @@ where each line of input produces a line of output.}
\def\realdash{-}
\def\codedash{-\discretionary{}{}{}}
-\def\codeunder{\ifusingtt{\normalunderscore\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}
-%\let\exp=\tclose %Was temporary
-
% @kbd is like @code, except that if the argument is just one @key command,
% then @kbd has no effect.
@@ -1565,6 +1639,10 @@ where each line of input produces a line of output.}
\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,10 +1656,6 @@ where each line of input produces a line of output.}
\global\let\contents = \relax
\global\let\shortcontents = \relax
\fi
- %
- \ifpdf \pdfmakepagedesttrue \fi
- %
- \HEADINGSon
}
\def\finishtitlepage{%
@@ -2339,18 +2413,19 @@ width0pt\relax} \fi
\let\item = \relax
}
-% Ignore @ignore ... @end ignore.
+% Ignore @ignore, @ifhtml, @ifinfo, @ifplaintext, @ifnottex, @html, @menu,
+% @direntry, and @documentdescription.
%
\def\ignore{\doignore{ignore}}
-
-% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
-%
-\def\ifinfo{\doignore{ifinfo}}
\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,14 +2452,21 @@ width0pt\relax} \fi
% 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
+ \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 that command.
+ % And now expand the command defined above.
\doignoretext
}
@@ -2456,10 +2538,14 @@ width0pt\relax} \fi
\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).
+ % 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,19 +2657,21 @@ width0pt\relax} \fi
\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.
+% @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 (for example) and end it
-% at @end iftex, since then @set commands inside the conditional have no
+% 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,9 +2784,23 @@ width0pt\relax} \fi
\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,69 +2813,66 @@ width0pt\relax} \fi
\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\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\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\L{\realbackslash L}%
+\def\oe{\realbackslash oe}%
+\def\o{\realbackslash o}%
\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 }%
+%
+% 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\sl{\realbackslash sl }%
\def\sf{\realbackslash sf}%
+\def\sl{\realbackslash sl }%
+\def\tclose##1{\realbackslash tclose {##1}}%
\def\tt{\realbackslash tt}%
-\def\gtr{\realbackslash gtr}%
-\def\less{\realbackslash less}%
-\def\hat{\realbackslash hat}%
+%
+\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\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\acronym##1{\realbackslash acronym {##1}}%
+\def\cite##1{\realbackslash cite {##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\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\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\strong##1{\realbackslash strong {##1}}%
+\def\uref##1{\realbackslash uref {##1}}%
+\def\url##1{\realbackslash url {##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}}%
+\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,7 +2886,7 @@ width0pt\relax} \fi
% 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 \ ).
+% expansion of \tie (\leavevmode \penalty \@M \ ).
{\obeyspaces
\gdef\unsepspaces{\obeyspaces\let =\space}}
@@ -2798,7 +2897,10 @@ width0pt\relax} \fi
\def\indexdummydots{...}
\def\indexnofonts{%
-% Just ignore accents.
+\def\@{@}%
+% how to handle braces?
+\def\_{\normalunderscore}%
+%
\let\,=\indexdummyfont
\let\"=\indexdummyfont
\let\`=\indexdummyfont
@@ -2814,45 +2916,49 @@ width0pt\relax} \fi
\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\AE{AE}%
+\def\L{L}%
+\def\OE{OE}%
\def\O{O}%
+\def\aa{aa}%
+\def\ae{ae}%
\def\l{l}%
-\def\L{L}%
+\def\oe{oe}%
+\def\o{o}%
\def\ss{ss}%
-\let\w=\indexdummyfont
-\let\t=\indexdummyfont
-\let\r=\indexdummyfont
-\let\i=\indexdummyfont
+%
+% Don't no-op \tt, since it isn't a user-level command
+% and is used in the definitions of the active chars like <, >, |, etc.
+% Likewise with the other plain tex font commands.
+%\let\tt=\indexdummyfont
+%
\let\b=\indexdummyfont
-\let\emph=\indexdummyfont
-\let\strong=\indexdummyfont
-\let\cite=\indexdummyfont
+\let\i=\indexdummyfont
+\let\r=\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\t=\indexdummyfont
+%
+\let\TeX=\indexdummytex
\let\acronym=\indexdummyfont
+\let\cite=\indexdummyfont
+\let\code=\indexdummyfont
\let\command=\indexdummyfont
-\let\option=\indexdummyfont
+\let\dfn=\indexdummyfont
+\let\dots=\indexdummydots
+\let\emph=\indexdummyfont
+\let\env=\indexdummyfont
\let\file=\indexdummyfont
-\let\samp=\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\TeX=\indexdummytex
-\let\dots=\indexdummydots
-\def\@{@}%
+\let\w=\indexdummyfont
}
% To define \realbackslash, we must make \ not be an escape.
@@ -3454,8 +3560,8 @@ width0pt\relax} \fi
\gdef\thischaptername{#1}%
\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
- {\putwordAppendix{} \appendixletter}}}%
+\edef\temp{\noexpand\writetocentry{\realbackslash appendixentry{\the\toks0}%
+ {\appendixletter}}}%
\temp
\appendixnoderef
\global\let\section = \appendixsec
@@ -3532,7 +3638,8 @@ width0pt\relax} \fi
\def\unnumberedseczzz #1{%
\plainsecheading {#1}\gdef\thissection{#1}%
\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry%
+ {\the\toks0}{\the\chapno}}}%
\temp
\unnumbnoderef
\nobreak
@@ -3571,7 +3678,7 @@ width0pt\relax} \fi
\plainsubsecheading {#1}\gdef\thissection{#1}%
\toks0 = {#1}%
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
- {\the\toks0}}}%
+ {\the\toks0}{\the\chapno}{\the\secno}}}%
\temp
\unnumbnoderef
\nobreak
@@ -3612,7 +3719,7 @@ width0pt\relax} \fi
\plainsubsubsecheading {#1}\gdef\thissection{#1}%
\toks0 = {#1}%
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
- {\the\toks0}}}%
+ {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}}}%
\temp
\unnumbnoderef
\nobreak
@@ -3824,7 +3931,7 @@ width0pt\relax} \fi
% 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.
+% fixed time so that @contents can be put in the document anywhere.
%
\newif\iftocfileopened
\def\writetocentry#1{%
@@ -3833,6 +3940,14 @@ width0pt\relax} \fi
\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,6 +4003,7 @@ width0pt\relax} \fi
\startcontents{\putwordShortTOC}%
%
\let\chapentry = \shortchapentry
+ \let\appendixentry = \shortappendixentry
\let\unnumbchapentry = \shortunnumberedentry
% We want a true roman here for the page numbers.
\secfonts
@@ -3896,11 +4012,11 @@ width0pt\relax} \fi
\hyphenpenalty = 10000
\advance\baselineskip by 1pt % Open it up a little.
\def\secentry ##1##2##3##4{}
- \def\unnumbsecentry ##1##2{}
+ \def\unnumbsecentry ##1##2##3{}
\def\subsecentry ##1##2##3##4##5{}
- \def\unnumbsubsecentry ##1##2{}
+ \def\unnumbsubsecentry ##1##2##3##4{}
\def\subsubsecentry ##1##2##3##4##5##6{}
- \def\unnumbsubsubsecentry ##1##2{}
+ \def\unnumbsubsubsecentry ##1##2##3##4##5{}
\openin 1 \jobname.toc
\ifeof 1 \else
\closein 1
@@ -3923,16 +4039,23 @@ width0pt\relax} \fi
% 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.
+% Chapters, in the main contents.
\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
-
-% See comments in \dochapentry re vbox and related settings
+%
+% 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.
+% 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,38 +4063,31 @@ width0pt\relax} \fi
\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
+ % 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.)
- \advance\dimen0 by 1.1em
- \hbox to \dimen0{#1\hfil}%
+ \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{\dosecentry{#1}{#2}}
+\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{\dosubsecentry{#1}{#2}}
+\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{\dosubsubsecentry{#1}{#2}}
+\def\unnumbsubsubsecentry#1#2#3#4#5{\dosubsubsecentry{#1}{#5}}
% This parameter controls the indentation of the various levels.
\newdimen\tocindent \tocindent = 3pc
@@ -4012,7 +4128,7 @@ width0pt\relax} \fi
\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
+ % typeset in cmr, characters such as _ would come out wrong; we
% have to do the usual translation tricks.
\entry{#1}{#2}%
\endgroup}
@@ -4032,36 +4148,27 @@ width0pt\relax} \fi
\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.
-% 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}}
+% 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,8 +4179,7 @@ width0pt\relax} \fi
\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.
@@ -4113,9 +4219,9 @@ width0pt\relax} \fi
\def\@{@}%
\let\Etex=\endgroup}
-% Define @lisp ... @endlisp.
+% Define @lisp ... @end lisp.
% @lisp does a \begingroup so it can rebind things,
-% including the definition of @endlisp (which normally is erroneous).
+% including the definition of @end lisp (which normally is erroneous).
% Amount to narrow the margins by for @lisp.
\newskip\lispnarrowing \lispnarrowing=0.4in
@@ -4146,9 +4252,17 @@ width0pt\relax} \fi
% 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}}
+\def\aboveenvbreak{{%
+ \ifnum\lastpenalty < 10000
+ \advance\envskipamount by \parskip
+ \endgraf
+ \ifdim\lastskip<\envskipamount
+ \removelastskip
+ \penalty-50
+ \vskip\envskipamount
+ \fi
+ \fi
+}}
\let\afterenvbreak = \aboveenvbreak
@@ -4280,7 +4394,7 @@ width0pt\relax} \fi
\def\smalllispx{\begingroup
\def\Esmalllisp{\nonfillfinish\endgroup}%
\def\Esmallexample{\nonfillfinish\endgroup}%
- \smallfonts
+ \smallexamplefonts
\lisp
}
@@ -4291,12 +4405,12 @@ width0pt\relax} \fi
\let\Edisplay = \nonfillfinish
\gobble
}
-
+%
% @smalldisplay (when @smallbook): @display plus smaller fonts.
%
\def\smalldisplayx{\begingroup
\def\Esmalldisplay{\nonfillfinish\endgroup}%
- \smallfonts \rm
+ \smallexamplefonts \rm
\display
}
@@ -4308,12 +4422,12 @@ width0pt\relax} \fi
\let\Eformat = \nonfillfinish
\gobble
}
-
+%
% @smallformat (when @smallbook): @format plus smaller fonts.
%
\def\smallformatx{\begingroup
\def\Esmallformat{\nonfillfinish\endgroup}%
- \smallfonts \rm
+ \smallexamplefonts \rm
\format
}
@@ -4505,6 +4619,21 @@ width0pt\relax} \fi
\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,7 +4962,7 @@ width0pt\relax} \fi
% #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}%
+\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}%
\deftypefunargs {#3}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}
@@ -4842,9 +4971,9 @@ width0pt\relax} \fi
\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
-% \defheaderxcond#1\relax$$$
+% \defheaderxcond#1\relax$.$
% puts #1 in @code, followed by a space, but does nothing if #1 is null.
-\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
+\def\defheaderxcond#1#2$.${\ifx#1\relax\else\code{#1#2} \fi}
% #1 is the classification. #2 is the data type. #3 is the name and args.
\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
@@ -4854,7 +4983,7 @@ width0pt\relax} \fi
\begingroup
\normalparens % notably, turn off `&' magic, which prevents
% at least some C++ text from working
-\defname {\defheaderxcond#2\relax$$$#3}{#1}%
+\defname {\defheaderxcond#2\relax$.$#3}{#1}%
\deftypefunargs {#4}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody
}
@@ -4900,7 +5029,7 @@ width0pt\relax} \fi
\def\deftypeopheader#1#2#3#4{%
\dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
\begingroup
- \defname{\defheaderxcond#2\relax$$$#3}
+ \defname{\defheaderxcond#2\relax$.$#3}
{\deftypeopcategory\ \putwordon\ \code{#1}}%
\deftypefunargs{#4}%
\endgroup
@@ -4915,7 +5044,7 @@ width0pt\relax} \fi
\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}}%
+ \defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}%
\deftypefunargs{#4}%
\endgroup
}
@@ -4929,7 +5058,7 @@ width0pt\relax} \fi
\def\deftypeivarheader#1#2#3{%
\dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
\begingroup
- \defname{\defheaderxcond#2\relax$$$#3}
+ \defname{\defheaderxcond#2\relax$.$#3}
{\putwordInstanceVariableof\ \code{#1}}%
\defvarargs{#3}%
\endgroup
@@ -5012,7 +5141,7 @@ width0pt\relax} \fi
% 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}%
+\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
\interlinepenalty=10000
\endgraf\nobreak\vskip -\parskip\nobreak
\endgroup}
@@ -5023,7 +5152,7 @@ width0pt\relax} \fi
\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
-\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
+\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
\interlinepenalty=10000
\endgraf\nobreak\vskip -\parskip\nobreak
\endgroup}
@@ -5183,7 +5312,7 @@ width0pt\relax} \fi
\message{Warning: redefining \the\macname}%
\else
\expandafter\ifx\csname \the\macname\endcsname \relax
- \else \errmessage{The name \the\macname\space is reserved}\fi
+ \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,13 +5593,15 @@ width0pt\relax} \fi
\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
+ {\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,8 +5863,15 @@ width0pt\relax} \fi
%
\smallfonts \rm
%
- % Hang the footnote text off the number.
- \hang
+ % 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,24 +5888,6 @@ width0pt\relax} \fi
}%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
@@ -5832,41 +5952,44 @@ width0pt\relax} \fi
\global\warnednoepsftrue
\fi
\else
- \imagexxx #1,,,\finish
+ \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{%
+% #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
- \centerline{\dopdfimage{#1}{#2}{#3}}%
+ \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
+ \epsfbox{#1.eps}%
\fi
-}
+ %
+ \ifimagevmode \hss \egroup \bigbreak \fi % space after the image
+\endgroup}
\message{localization,}
@@ -5935,8 +6058,9 @@ should work if nowhere else does.}
}
% 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.
+% 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,6 +6081,8 @@ should work if nowhere else does.}
\normaloffset = #4\relax
\bindingoffset = #5\relax
%
+ \setleading{\textleading}
+ %
\parindent = \defaultparindent
\setemergencystretch
}
@@ -5973,7 +6099,7 @@ should work if nowhere else does.}
% @letterpaper (the default).
\def\letterpaper{{\globaldefs = 1
\parskip = 3pt plus 2pt minus 1pt
- \setleading{13.2pt}%
+ \textleading = 13.2pt
%
% If page is nothing but text, make it come out even.
\internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}%
@@ -5982,7 +6108,7 @@ should work if nowhere else does.}
% Use @smallbook to reset parameters for 7x9.5 (or so) format.
\def\smallbook{{\globaldefs = 1
\parskip = 2pt plus 1pt
- \setleading{12pt}%
+ \textleading = 12pt
%
\internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
%
@@ -5997,8 +6123,8 @@ should work if nowhere else does.}
% Use @afourpaper to print on European A4 paper.
\def\afourpaper{{\globaldefs = 1
- \setleading{12pt}%
\parskip = 3pt plus 2pt minus 1pt
+ \textleading = 12pt
%
\internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}%
%
@@ -6010,8 +6136,8 @@ should work if nowhere else does.}
% 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
+ \textleading = 12.5pt
%
\internalpagesizes{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}%
%
@@ -6029,11 +6155,13 @@ should work if nowhere else does.}
% 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}%
+ \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,8 +6169,6 @@ should work if nowhere else does.}
\def\afourwide{%
\afourpaper
\internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
- %
- \globaldefs = 0
}
% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
@@ -6056,7 +6182,7 @@ should work if nowhere else does.}
\globaldefs = 1
%
\parskip = 3pt plus 2pt minus 1pt
- \setleading{13.2pt}%
+ \setleading{\textleading}%
%
\internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
}}
@@ -6086,7 +6212,7 @@ should work if nowhere else does.}
\def\normalless{<}
\def\normalgreater{>}
\def\normalplus{+}
-\def\normaldollar{$}
+\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,7 +6261,7 @@ should work if nowhere else does.}
\catcode`\+=\active
\def+{{\tt \char 43}}
\catcode`\$=\active
-\def${\ifusingit{{\sl\$}}\normaldollar}
+\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
%\catcode 27=\active
%\def^^[{$\diamondsuit$}
@@ -6180,7 +6306,7 @@ should work if nowhere else does.}
@let<=@normalless
@let>=@normalgreater
@let+=@normalplus
-@let$=@normaldollar}
+@let$=@normaldollar}%$ font-lock fix
@def@normalturnoffactive{@let"=@normaldoublequote
@let\=@normalbackslash
@@ -6191,7 +6317,7 @@ should work if nowhere else does.}
@let<=@normalless
@let>=@normalgreater
@let+=@normalplus
-@let$=@normaldollar}
+@let$=@normaldollar}%$ font-lock fix
% Make _ and + \other characters, temporarily.
% This is canceled by @fixbackslash.
diff --git a/doc/uf002331.eps b/doc/uf002331.eps
deleted file mode 100644
index 89791cfd..00000000
--- a/doc/uf002331.eps
+++ /dev/null
@@ -1,1155 +0,0 @@
-%!PS-Adobe-2.0 EPSF-1.2
-%%Title: /home/jkahrs/uf002331.ps
-%%Creator: XV Version 3.10a Rev: 12/29/94 (PNG patch 1.2) - by John Bradley
-%%CreationDate: Oct 14 22:02
-%%For:jkahrs jkahrs
-%%Pages: 1
-%%DocumentFonts:
-%%BoundingBox: -1 259 595 529
-%%BeginPreview: 597 269 1 269
-% 000000000000000080000000202018000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-% f0f0f8d8f0c0c80080000078302000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-% 982080c89040580090000010202000181400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-% 982080c898c07000f8c400303030382c3c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-% b020f8a888403000c44c0010202008046400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-% e02080a888c02000842800303020083c4600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-% b02080b898403000c4300010202008444400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-% 9060c898f0c83000c83000303030084c6c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-% 98f0f898e07c2000f8200078181c083c3c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-% ab6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa000d55555555555555555555555555555555555555555555555555555555500155555555555555555555555555555555555555540
-% fffffffffffffffffffffffffffffffffffffffffffff000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff803fffffffffffffffffffffffffffffffffffffffe0
-% fffffffffffffffffffffffffffffffffffffffffffff001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff003fffffffffffffffffffffffffffffffffffffffe0
-% 555555555555555555555555555555555555555555557000eaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab803aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0
-% 000000000000000000000000000000000000000000007001c00000000000000000000000000000000000000000000000000000000300300000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000007780e00000000000000000000000000000000000000000000000000000000380380000000000000000000000000000000000000000
-% 0000000000000000000000000000000000000000000070fdc00000000000000000000000000000000000000000000000000000000300300000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000007000e00000000000000000000000000000000000000000000000000000000380380000000000000000000000000000000000000000
-% 0000000000000000000000000000000000000000000070fcc00000000000000000000000000000000000000000000000000000000300300000000000000000000000000000000000000000
-% 0000000000000000000000000000000000000000000070dbe00000000000000000000000000000000000000000000000000000000380380000000000000000000000000000000000000000
-% 00000000000000000000000000000000000000000000708dc00000000000000000000000000000000000000000000000000000000300300000000000000000000000000000000000000000
-% 00000000000000000000000000000000000000000000718be00000000000000000000000000000000000000000000000000000000380380000000000000000000000000000000000000000
-% 00000000000000000000000000000000000000000000707bc00000000000000000000000000000000000000000000000000000000300300000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000007000e00000000000000000000000000000000000000000000000000000000380380000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000007181c00000000000000000000000000000000000000000000000000000000300300000000000000000000000000000000000000000
-% 0000000000000000000000000000000000000000000070fce00000000000000000000000000000000000000000000000000000000380380f00bc3c1c09f020f3cffffc3030e0e700f1cf00
-% 000000000000000000000000000000000000000000007001c00000000000000000000000000000000000000000000000000000000300301f51b83e1ec9c020db6cfffe2078f1e780fbe980
-% 000000000000000000000000000000000000000000007070e000000000000000000000000000000000000000000000000000000003803804516013324d00608a38002260419b34c0223980
-% 0000000000000000000000000000000000000000000070d9c000000000000000000000000000000000000000000000000000000003003006196c31a34960608a6b082240810a1460343f00
-% 00000000000000000000000000000000000000000000718ce000000000000000000000000000000000000000000000000000000003803804097c31634de070d3df102180b90a1460143f00
-% 0000000000000000000000000000000000000000000070cdc0000000000000000000000000000000000000000000000000000000030030040b4011426d0060e3900821818e1e3440142880
-% 000000000000000000000000000000000000000000007078e0000000000000000000000000000000000000000000000000000000038038040e403246e800f082501821818e1424c0146880
-% 000000000000000000000000000000000000000000007001c0000000000000000000000000000000000000000000000000000000030030040646164699309082519061011a366583344980
-% 00000000000000000000000000000000000000000000700ce00000000000000000000000000000000000000000000000000000000380380f067c1c6cd9f090c25f182101f1e3c701f7cf00
-% 00000000000000000000000000000000000000000000700dc00000000000000000000000000000000000000000000000000000000300301c0638183889c010826e102100c1c38600e38c00
-% 000000000000000000000000000000000000000000007180e00000000000000000000000000000000000000000000000000000000380380000000000000000000000000000000000000000
-% 0000000000000000000000000000000000000000000070f1c00000000000000000000000000000000000000000000000000000000300300000000000000000000000000000000000000000
-% 00000000000000000000000000000000000000000000701ee0000000000000000000000000000000000000000000000000000000038038073e1f3e821808618f7bf7dc037c7130b8093de0
-% 00000000000000000000000000000000000000000000707bc000000000000000000000000000000000000000000000000000000003003007be1938a2380871dc6fff1e0366f928be0971a0
-% 0000000000000000000000000000000000000000000071c1e00000000000000000000000000000000000000000000000000000000380380ce00920b26008c3104444130322892ca3094080
-% 000000000000000000000000000000000000000000007000c000000000000000000000000000000000000000000000000000000003003008660f3cb25c1c821f4c4f91876d8f2ca1097da0
-% 0000000000000000000000000000000000000000000077fde0000000000000000000000000000000000000000000000000000000038038187e0b78b2fc1d863c58cf3185390a2ca10ef0e0
-% 000000000000000000000000000000000000000000007000c000000000000000000000000000000000000000000000000000000003003018f009a0aa861d041070481107290a2ab30f41e0
-% 000000000000000000000000000000000000000000007779e000000000000000000000000000000000000000000000000000000003803810a00881aa841d1c7040cc1207ed0a2aa6094120
-% 0000000000000000000000000000000000000000000077f8c000000000000000000000000000000000000000000000000000000003003011a00ba7ae9c3534d3c0c8d60ca5126bbc0b47a0
-% 000000000000000000000000000000000000000000007089e00000000000000000000000000000000000000000000000000000000380381f200e3ca6f825e79f40c79c08e7f3e9981b7d80
-% 00000000000000000000000000000000000000000000718cc000000000000000000000000000000000000000000000000000000003003004200810804004c2084006000080c18000003000
-% 0000000000000000000000000000000000000000000070f9e00000000000000000000000000000000000000000000000000000000380380000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000007000c00000000000000000000000000000000000000000000000000000000300300000000000000000000000000000001000000000
-% 000000000000000000000000000000000000000000007059e00000000000000000000000000000000000000000000000000000000380380f8633defe1e73c1fa4df0466f917ffe08700160
-% 0000000000000000000000000000000000000000000070fcc00000000000000000000000000000000000000000000000000000000300300c647719fe3edb61fe4ff0666fdb75fac8f04160
-% 000000000000000000000000000000000000000000007081e00000000000000000000000000000000000000000000000000000000380380828c41910208920224c40ee64d64862cd804940
-% 0000000000000000000000000000000000000000000070fcc00000000000000000000000000000000000000000000000000000000300301f3887d310378f60269c40ecf59e7c62edb04960
-% 0000000000000000000000000000000000000000000070f9e00000000000000000000000000000000000000000000000000000000380381c11871e103d0dc0239440feb7bef862e9f85960
-% 000000000000000000000000000000000000000000007000c00000000000000000000000000000000000000000000000000000000300301839041c10310b40269c40b6e7924062ed585b40
-% 0000000000000000000000000000000000000000000070e9e0000000000000000000000000000000000000000000000000000000038038182d0c1810210a40261ec0b6f4924662bb187b40
-% 0000000000000000000000000000000000000000000071acc00000000000000000000000000000000000000000000000000000000300300be734f01021132064a2408394936e629b706640
-% 0000000000000000000000000000000000000000000070ede00000000000000000000000000000000000000000000000000000000380380f43e7d81031f32026a2408394d17c62cbe02660
-% 000000000000000000000000000000000000000000007078c00000000000000000000000000000000000000000000000000000000300300400c3001000c020000240021410304289800020
-% 000000000000000000000000000000000000000000007001e00000000000000000000000000000000000000000000000000000000380380000000000000000000000000000000000000000
-% 0000000000000000000000000000000000000000000076f8c00000000000000000000000000000000000000000000000000000000300300000000000000000000000000000000000000000
-% 0000000000000000000000000000000000000000000074a9e000000000000000000000000000000000000000000000000000000003803807fff7c1c7820a4bfc7004fa107c4de3ff000000
-% 000000000000000000000000000000000000000000007080c00000000000000000000000000000000000000000000000000000000300300c7106034cc24e4fc4e864820826497611000000
-% 000000000000000000000000000000000000000000007081e00000000000000000000000000000000000000000000000000000000380381811040608424e5c45806482d8224d1001000000
-% 0000000000000000000000000000000000000000000070fcc0000c346f87cf9fbfffc08071f27efc3f66f80783080406000000000300301f11f5c7c8424cd4c3f026f2d061c91fc7000000
-% 000000000000000000000000000000000000000000007001e00004646887fedc7fffe180f91afdfc3865ec1fb3180c46000000000380380f13c787e842c794c0f875e2d023891f0e000000
-% 000000000000000000000000000000000000000000007480c000066c68c4285006023303811ac1006064040217380e62000000000300300191040030c2d6dcc0087483d062893408000000
-% 467efe7f0000000007f1bf00037e3181fcc63dff000077fde000038c4984699f84061603f932ddb87e441c0217781a620000000003803801111c04708334b4c1884c8b7026896420000000
-% 46f0e678000000000239b3c186e6610018c4f6d800007080c00001884b05cfbe06061c03f9e6f9f8f87c780204d81272000000000300301b113d06d98134a6c1b84cbb782cd944e0000000
-% 46c0424000000000060db0c0ccc361000987c01800007181e00001885e078db004040c000fc6c1806074600604d81ed2000000000380380e11e503cf0334a6c0f04cf22838f983c8000000
-% c4dc464e00000000060db040498161000985fc1800007080c000018858060890440608020b0681004044400604c81e5a000000000300300410c40106000080006004402000600308000000
-% 7dfe7cfe00000000020d3040798343000905fe18000070fde0000188ca040891c40408031906812063c40006040832ce000000000380380000000000000000000000000000000000000000
-% f4806cc0000000000619b1c03302c1000904031800007000c000010fcb0408df04061801f106c1a03e44601f840823c6000000000300300000000000000000000000000000000000000000
-% c480c4c100000000023133803306c3020b0d8618000070e9e00001060804084c04001000610000001800201800080004000000000380380000000000000000000000000000000000000000
-% c487c6c30000000003611700219c6f0399bdce10000071acc00000000000000000000000000000000000000000000000000000000300300000000000000000000000000000000000000000
-% c4fe467e0000000003c19c0061f87f01f9fcfc18000071ade00000000000000000000000000000000000000000000000000000000380380000000000000000000000000000000000000000
-% 4478c27800000000010008002040100020401000000070f8c000019f3fd3e8708801837f3e60c0871f81873f0080df00000000000300300000000000000000000000000000000000000000
-% 000000000000000000000000000000000000000000007001e0000198f6370cd1c801a16d6060c08d18188d30018859c0000000000380380000000000000000000000000000000000000000
-% 00000000000000000030701c2100057180102061c0007010c000038886340881d801b1084040c1981018982001cc58c0000000000300300000000000000000000000000000000000000000
-% d608fcfc0000000000f9f9fc330c1ff3e01867ffe00070f9e000029b8636e9835801b10c7e40c19b9f98907e01cc5060000000000380380000000000000000000000000000000000000000
-% b718f1ce0000000001c9858073181d863038ce08300071acc000028f0637c9025801b188f84081b7de18907c034c5040000000000300300000000000000000000000000000000000000000
-% 371980c60000000007018d007330018c1039cc00300070ede000039b06361b03d801390c40c081b05014b06003ce58c0000000000380380000000000000000000000000000000000000000
-% 3739bccc0000000007f98bf8d3e00198102dcfe0e00070c8c00007d906340b0b5041ad0840c18120d056a0e0834b5980000000000300300000000000000000000000000000000000000000
-% 35ebe0f800000000000df380d320019810266c07800070a9e000045986341b3679c1270847cf9da391f3a3278669db00000000000380380000000001800000000000000000000000000000
-% 34c900d8000000000005c300fb30019830266c02000071f8c0000458863419e47f81a3087e7cf9be1f319e3e0268ce00000000000300300000000001800000000000000000000000000000
-% 34c9028c00000000060d83079b10011060226c3800007009e0000050802008c00c010108306060180c009c1800204000000000000380380000000001000000000000000000000000000000
-% 340d0ecc8000000003b9013d0b180119e0206cf00000700cc00000000000000000000000000000000000000000000000000000000300300000000001000000000000000000000000000000
-% 340cfcc68000000001f181f90a08010f802027c3000070f9e00000000000000000000000000000000000000000000000000000000380380000000001000000000000000000000000000000
-% 200440000000000000000000000000000000000000007000c00000f98b7ffe07ffc44242c4307fe2fc03c6319fbfdf8f7f8000000300300000000001000000000000000000000000000000
-% 00000000000000000000000000000000000000000000700de00003898b6c600c0c466246c4306c66c0074e7198be301d6c00000003803800000000010000000080701c40818811e0387000
-% 00000000000000000000000000000000000000000000700cc000030d0b0c40040c4e634c86600c64800c0e63988620300c00000003003000000000030000000081fcfe619fcc37f1fff800
-% 000000000000000000000000000000000000000000007081e00006070b087e0dc98e637882c00c44fc1fce7299863f7f0c000000038038000000000100000000818580e3380c7211818c00
-% 0000000000000000000000000000000000000000000071e0c000044f0b0cf807cf8a737881800c7df00febb2df063c3f8c000000030030000000000300000001808d80e7110e6273018c00
-% 00000000000000000000000800000000000000000000703de000047b0b08400c0d9e5b4d81800c64800029b7db042000cc00000003803800000000020000000181f9fcbd3f96f3f3f9b800
-% 00000000000000000000000c0000000000000000000070e0c00004321b08430c089b4a4587000c4486086936510420a18c00000003003000000000020000000181f3809db013b21301f000
-% 0000000000000000000000040000000000000000000070e1e00007f33b0c470408934e469d000c448e0ce814518633b38c00000003803800000000020000000181998099b013b20b019000
-% 00000000000000000000000400000000000000000000703cc00003d3fb087c0408d146c2f9000c44f807c81858841f1f0c00000003003000000000020000000181890689b0f1321b0f1800
-% 0000000000000000000000040000000000000000000070f9e00000108208300408410200610000046003001050840c0c00000000038038000000000200000001818d9e81b3d012f33d8800
-% 000000000000000000000006000000000000000000007180c00000000000000000000000000000000000000000000000000000000300300000000006000000018184f0809e101381e10c00
-% 0000000000000000000000020000000000000000000070e1e000004000300850100009c000030c060000000000000000000000000380380000000004000000000000000000000000000000
-% 00000000000000000000000200000000000000000000703cc00001f213f80cfc7c4689f018bf7f7e0000000000000000000000000300300000000004000000000000000000000000000000
-% 000000000000000000000002000000000000000000007079e000019b13001cc4e6448d3c18b02160000000000000000000000000038038000000000400000000000000000000078c040f00
-% 0000000000000000000000010000000000000000000071c0c000030b1b001c44c2c68d8c18a023400000000000000000000000000300300000000004000000000278634fc7f03fcc06ff80
-% 000000000000000000000000000000000000000000007039e000060d93f014dd8285cd04193f26fc00000000000000000000000003803800000000040000000186fc636e6700780c06ff00
-% 0000000000000000000000010000000000000000000070f8c000060b9b0016790285e50c1f703ce0000000000000000000000000030030000000000c00000001998642246c00230c060e00
-% 000000000000000000000001000000000000000000007181e000041aca001ed90685ad98192026c0000000000000000000000000038038000000000c000000009902c224efe07f8c0c1800
-% 000000000000000000000001000000000000000000007180c00004327208368d0c853d381121a2c30000000000000000000000000300300000000008000000007306820f9f007e080c3820
-% 0000000000000000000000018000000000000000000070f9e00006723338228d9c9d9df01123a2474000000000000000000000000380380000000008000000006206820e8c0060180e3020
-% 00000000000000000000000080000000000000000000703cc00007c231f02285f0fd08c0113e237c400000000000000000000000030030000000000800000000620c820c481060c8346060
-% 0000000000000000000000008000000000000000000071c1e00000000000000000000000000000000000000000000000000000000380380000000008000000004318de0c6cf077cdecffe0
-% 000000000000000000000000800000000000000000007038c000000000000000000000000000000000000000000000000000000003003000000000080000000041f0fe0c67c03f9fccff60
-% 000000000000000000000000c0000000000000000000703de000000000000000000000000000000000000000000000000000000003803800000000080000000000c0200022001c0f04e000
-% 0000000000000000000000004000000000000000000071e0c00000000000000000000000000000000000000000000000000000000300300000000008000000000000000000000000000000
-% 000000000000000000000000400000000000000000007781e00000000000000000000000000000000000000000000000000000000380380000000000000000000000000000000000000000
-% 00000000000000000000000040000000000000000000707cc00000000000000000000000000000000000000000000000000000000300300000000008000000000000000000000000000000
-% 000000000000000000000000600000000000000000007009e0000000000000000000000000000000000000000000000000000000038038000000001000000000000000000c000000000000
-% 000000000000000000000000200000000000000000007780c00000000000000000000000000000000000000000000000000000000300300000000010000000000000000004000000000000
-% 0000000000000000000000002000000000000000000070fde00000000000000000000000000000000000000000000000000000000380380000000010000000000000000006000000000000
-% 000000000000000000000000000000000000000000007000c00000000000000000000000000000000000000000000000000000000300300000000010000000000000000002000000000000
-% 000000000000000000000000000000000000000000007189e00000000000000000000000000000000000000000000000000000000380380000000010000000000000000001000000000000
-% 00000000000000000000000000000000000000000000708cc00000000000000000000000000000000000000000000000000000000300300000000010000000000000000001000000000000
-% 000000000000000000000000007c00000000000000007021e000000000000000000000000000000000000003e0000000000000000380380000000030000000000000000001800003e00000
-% 00000000000000000000000001ffc00000000000000070f8c00000000300000000000000000000000000000ffe00000000000000030030000000003000000000000000000080000ffe0000
-% 00000000000000000000000003007000000000000000718de00000000300000000000000000000000000001803800000000000000380380000000020000000000000000000c00018038000
-% 0000000000000000000000000e001800000000000000708cc00000000200000000000000000000000000007000c0000000000000030030000000002000000000000000000040007000c000
-% 0000000000000000000000001800060000000000000070ffe0000000020000000000000000000000000000c000300000000000000380380000000020000000000000000000200080003000
-% 000000000000000000000000300003000000000000007001c00000000200000000000000000000000000018000180000000000000300300000000020000000000000000000300180001800
-% 000000000000000000000000300001800000000000007084e000000002000000000000000000000000000100000c0000000000000380380000000020000000000000000000100100000800
-% 000000000000000000000000300000c000000000000073fdc00000000200000000000000000000000000010000040000000000000300300000000060000000000000000000100300000c00
-% 0000000000000000000000002020004000000000000073f8e00000000600000000000000000000000000030100060000000000000380380000000060000000000000000000080301000600
-% 00000000000000000000000063f800400000000000007085c00000000400000000000000000000000000031dc002000000000000030030000000004000000000000000000008021d800200
-% 00000000000000000000000066c8002000000000000073fce00000000400000000000000000000000000037640030000000000000380380000000040000000000000000000040276400300
-% 0000000000000000000000006866002000000000000073f9c0000000040000000000000000000000000002c3200100000000000003003000000000400000000000000000000402c3600100
-% 000000000000000000000000382200300000000000007000e00000000400000000000000000000000000018130018000000000000380380000000040000000000000000000020381200180
-% 000000000000000000000000303200180000000000007079c0000000040000000000000000000000000001819000c000000000000300300000000040000000000000000000020301b00080
-% 0000000000000000000000002031000c00000000000071a8e00000000c000000000000000000000000000100900060000000000003803800000000c0000000000000000000010300900040
-% 000000000000000000000000201100040000000000007081c000000008000000000000000000000000000100980020000000000003003000000000c0000000000000000000018200980060
-% 0000000000000000000000000012600400000000000077f8e00000000800000000000000000000000000000093002000000000000380380000000080000000000000000000008000930040
-% 0000000000000000000000000012f80400000000000077fdc00000000800000000000000000000000000000097c0200000000000030030000000008000000000000000000000c00097c060
-% 0000000000000000000000000011dc040000000000007000e0000000080000000000000000000000000000009e6020000000000003803800000000800000000000000000000000009d6060
-% 000000000000000000000000001b86040000000000007001c000000008000000000000000000000000000000dc3060000000000003003000000000800000000000000000000000003c3040
-% 000000000000000000000000080d8b040000000000007000e0000000080000000000000000000000000000406c5020000000000003803800000000800000000000000000000000c0cc5060
-% 0000000000000000000000000c38090c0000000000007001c000000008000000000000000000000000000061c0686000000000000300300000000180000000000000000000000061804040
-% 0000000000000000000000000c681b0c0000000000007000e0000000100000000000000000000000000000634098600000000000038038000000018000000000000000000000006300d840
-% 0000000000000000000000000cd003880000000000007001c0000000100000000000000000000000000000e680184000000000000300300000000100000000000000000000000066801840
-% 0000000000000000000000003fb01c8c0000000000007000e0000000100000000000000000000000000001fd80e440000000000003803800000001000000000000000000000003fd80ec40
-% 0000000000000000000000003fc000c80000000000007001c0000000100000000000000000000000000001be000440000000000003003000000001000000000000000000000003b6000440
-% 000000000000000000000000280000c40000000000007000e0000000100000000000000000000000000001c0000420000000000003803800000001000000000000000000000001c0000440
-% 000000000000000000000000680000440000000000007001c00000001000000000000000000000000000034000062000000000000300300000000100000000000000000000000240000660
-% 000000000000000000000000abc000460000000000007000e000000010000000000000000000000000000cde00023000000000000380380000000100000000000000000000000dde000220
-% 000000000000000000000001be7000620000000000007001c000000010000000000000000000000000001db380031000000000000300300000000100000000000000000000001df3800300
-% 000000000000000000000002041800210000000000007000e000000030000000000000000000000000001020c0030800000000000380380000000000000000000000000000003021c00300
-% 0000000000000000000000020c0e00308000000000007001c00000002000000000000000000000000000106060018400000000000300300000000100000000000000000000001063600180
-% 000000000000000000000001fa860030c000000000007000e000000020000000000000000000000000001f9020018600000000000380380000000200000000000000000000001f9f200180
-% 00000000000000000000000003c20038c000000000007001c0000000200000000000000000000000000000182001c60000000000030030000000020000000000000000000000001fa00180
-% 00000000000000000000000001c20008c000000000007000e0000000200000000000000000000000000000081000660000000000038038000000020000000000000000000000000f300040
-% 00000000000000000000000001c3000c6000000000007001c00000002000000000000000000000000000000c1800630000000000030030000000020000000000000000000000000e180060
-% 0000000000000000000000000103801e2000000000007000e0000000600000000000000000000000000000081c00f3000000000003803800000002000000000000000000000000103c00e0
-% 000000000000000000000000030280162000000000007001c000000060000000000000000000000000000018240091000000000003003000000002000000000000000000000000182400a0
-% 000000000000000000000000030080321000000000007000e000000040000000000000000000000000000018040191800000000003803800000006000000000000000000000000180401a0
-% 000000000000000000000000030080221000000000007001c00000004000000000000000000000000000001804031080000000000300300000000600000000000000000000000018040300
-% 0000000000000000000000000300c02318000000000077f8e000000040000000000000000000000000000018060318c0000000000380380000000400000000000000000000000010040320
-% 000000000000000000000000010040478800000000007089c00000004000000000000000000000000000000802022c40000000000300300000000400000000000000000000000018020220
-% 000000000000000000000000018041cce40000000000718ce000000040000000000000000000000000000008020c6760000000000380380000000400000000000000000000000008020c60
-% 0000000000000000000000000180cf8db6000000000070f9c0000000c000000000000000000000000000000c067c6db000000000030030000000040000000000000000000000000804fc60
-% 00000000000000000000000000c0fa1bd300000000007060e0000000c000000000000000000000000000000407d0dc9800000000038038000000040000000000000000000000000c07b0c0
-% 00000000000000000000000000c0803b118000000000700dc0000000800000000000000000000000000000040401db88000000000300300000000c0000000000000000000000000c040180
-% 0000000000000000000000000041806270800000000071f8e0000000800000000000000000000000000000020c033584000000000380380000000c000000000000000000000000020c0320
-% 00000000000000000000000000e301d750c00000000071adc000000080000000000000000000000000000007180e3284000000000300300000000800000000000000000000000007180e60
-% 000000000000000000000000008307bd50400000000070bce0000000800000000000000000000000000000041839ea8600000000038038000000080000000000000000000000000c1039e0
-% 00000000000000000000000000821c765840000000007011c00000018000000000000000000000000000000410ebb2c600000000030030000000080000000000000000000000000c10eba0
-% 0000000000000000000000000182fadfa840000000007000e00000018000000000000000000000000000000c17d6fac6000000000380380000000800000000000000000f0000000837d6e0
-% 0000000000000000000000000107c5b1aec00000000076f9c0000001000000000000000000000000000000083e2f4d640000000003003000000008000000000000000008000000087d2d80
-% 000000000000000000000000010f29ed9780000000007000e0000001000000000000000000000000000000087aceacbc000000000380380000001800000000000000001000000018795b60
-% 000000000000000000000000037fabcad4c00000000077f9c00000010000000000000000000000000000001b7c9eaeb4000000000300300000001800000000000000002180000003fe9e40
-% 000000000000000000000000023fd6ead6800000000077fce000000100000000000000000000000000000013fd7556b0000000000380380000001000000000000000000380000011fd7540
-% 000000000000000000000000020faccad600000000007001c0000001000000000000000000000000000000117d6d56a00000000003003000000010000000000000000004000000127e6d40
-% 000000000000000000000000024fadb564000000000077f8e0000003000000000000000000000000000000127eeaab300000000003803800000010000000000000000000018000127cdaa0
-% 000000000000000000000000035fdb957600000000007001c00000020000000000000000000000000000001efcdaabb00000000003003000000010000000000000000001ffc0001e7edaa0
-% 000000000000000000000000018f992aaa000000000077f8e00000020000000000000000000000000000000c7ecd55500000000003803800000000000000000000000003d870000cfcdaa0
-% 000000000000000000000000000fdb6ab3000000000077fdc0000002000000000000000000000000000000007d9aab58000000000300300000000000000000000000000e08d80001fd9aa0
-% 000000000000000000000000000fb74abb00000000007000e0000002000000000000000000000000000000007db9555800000000038038000000000000000000000000120ccc0007fdb540
-% 000000000000000000000000001fb35ab200000000007001c000000200000000000000000000000000000000fddd55d000000000030030000000000000000000000000e64cb60006fddd40
-% 000000000000000000000000000fbbaab700000000007000e0000002000000000000000000000000000000007d995598000000000380380000000000000000000000018c44a58018fd1940
-% 000000000000000000000000000fb3555b000000000070e1c0000002000000000000000000000000000000007d3b55d80000000003003000000000000000000000000236cd9ac036ff5b40
-% 000000000000000000000000001fb7555b000000000077f8e000000000000000000000000000000000000000ff5a5598000000000380380000000000000000000000066385a57064ff5a40
-% 000000000000000000000000001fab55590000000000760dc000000200000000000000000000000000000000fd59aaa800000000030030000000000000000000000003c709d530d5ff55a0
-% 000000000000000000000000001feb555b000000000077b8e000000400000000000000000000000000000000ff5a55a8000000000380380000000000000000000000014c9bd559aaff5940
-% 000000000000000000000000001feb555d000000000070e1c000000400000000000000000000000000000000ff5daad80000000003003000000000000000000000000038912aa72aff5aa0
-% 000000000000000000000000001feb555900000000007040e000000000000000000000000000000000000000ff5aaaa80000000003803800000000000000000000000008e355576afe5aa0
-% 000000000000000000000000001fcb555b000000000073f9c000000000000000000000000000000000000000fe5aaad80000000003003000000000000000000000000009c35556aaff5540
-% 000000000000000000000000001feb555d0000000000760ce000000000000000000000000000000000000000ffd95588000000000380380000000000000000000000000f0195572afe5540
-% 000000000000000000000000001fab5553000000000077bdc000000000000000000000000000000000000000fc5d55b8000000000300300000000000000000000000000000e55754fcdaa0
-% 000000000000000000000000001fab2ab5000000000070f0e000000000000000000000000000000000000000fd5955c80000000003803800000000000000000000000000007aaeabfd5d40
-% 000000000000000000000000001fab555500000000007001c000000000000000000000000000000000000000fd5d55980000000003003000000000000000000000000000001d5f56fd5940
-% 000000000000000000000000001fd7555b000000000073f0e000000000000000000000000000000000000000fd5955a80000000003803800000000000000000000000000000658acfd5d40
-% 000000000000000000000000001fabaab30000000000761dc000000000000000000000000000000000000000fd5d55d8000000000300300000000000000000000000000000038b4cfd5940
-% 000000000000000000000000001f95555b0000000000760ce0003fff40000000000000000000000000000000fead559800000000038038000fffd000000000000000000c0001f158fd5b40
-% 000000000000000000000000001fabaab2000000000073f1c001f4005c000000000000000000000000000000fd5955b000000000030030007d0017000000000000000007c0003e70fd5d40
-% 000000000000000000000000001fd3555b00000000007000e003008006000000000000000000000000000000fe5b5598000000000380380042200180000000000000000000000fe0fd5140
-% 000000000000000000000000001fab2abb000000000073cdc0037a0001800000000000000000000000000000fd5a55d80000000003003000d4800060000000000000000800000180fd5d40
-% 000000000000000000000000001fab553300000000007668e006048000800000000000000000000000000000fd5955500000000003803801911000300000000000000007e0000000fd5aa0
-% 000000000000000003800000001fcbaaba0000000000743dc007f00000c00000000000000000000000000000fe5aab580000000003003001fc4000100000000000000001c0000000fe5540
-% 000000000000000002000000001fdb2ab30000000000731ce00d7c8000400000000000000000000000000000fedd55d800000000038038035f000010000000000000000000000000fed540
-% 000000000000000004c00000001feb555b00000000007001c00a840000600000000000000000000000000000ff5955180000000003003003a1000030000000000000000000000000fd5d40
-% 000000000000000004800000001fcb555a00000000007000e00aa60000a00000000000000000000000000000fe5b55d0000000000380380229900038000000000000000000000000fe52a0
-% 000000000000000000800000003fdb555b00000000007001c00d260000a00000000000000000000000000000feba55580000000003003002c9800028000000000000000000000000fedaa0
-% 000000000000000001000000003fcb2ab300000000007000e019420000a00000000000000000000000000000fea955d8000000000380380650800028000000000000000000000000fd5940
-% 000000000000000000008000017fd5f55b000000000071fcc00d520001a00000000000000000000000000000ff5faa980000000003003002aa80006c000000000000000000000000feafa0
-% 0000000000000000007fedf07fdfebc55b00000000007707e009230eff300000000000000000000000000000fe5e55d80000000003803806a0c3bf88000000000000000000000000fe5e40
-% 000000000000000000c13b7fe99fcbf55500000000007001c01d49fb80200000000000000000000000000000ff5faaa80000000003003003547ed008000000000000000000000000ff5fa0
-% 0000000000000000008219894adfd5955980000000007098e009200000200000000000000000000000000000fe4d55a8000000000380380248000004000000000000000000000000fead40
-% 000000000000000000ff4b6ab55fd5d5558000000000718dc01a4400003000000000000000000000000000007f5caaa80000000003003006910000080000000000000000000000007e5ca0
-% 000000000000000000225b55555febd55d0000000000708ce00a9000002000000000000000000000000000007eaf55980000000003803802a400000c0000000000000000000000007eaf40
-% 00000000000000000026d155555fcb6ab5800000000070f9c00d400300200000000000000000000000000000ff5a556c00000000030030035000c008000000000000000000000000ff5240
-% 0000000000000000003f932aaa9feb155580000000007000e0090805002000000000000000000000000000007f59554800000000038038064200c0080000000000000000000000007ebac0
-% 0000000000000000002013aaaaafeb6ab280000000007603c01aa003002000000000000000000000000000007f36ab5c0000000003003006a801c0080000000000000000000000007e5280
-% 00000000000000000036132aaaafeaaab5800000000073fce01d0802002000000000000000000000000000007f5955a80000000003803805420080080000000000000000000000007f5aa0
-% 0000000000000000001c11550aaff6aaba80000000007001c018a000002000000000000000000000000000007fb355ac0000000003003006a80000080000000000000000000000007eb540
-% 00000000000000000007dfa9f94fc6aab280000000007000e0150000002000000000000000000000000000007e3655280000000003803806400000080000000000000000000000007eb540
-% 00000000000000000000012fdffff6553580000000007001c01a5200006000000000000000000000000000007eb4d5ac0000000003003006948000000000000000000000000000007ebaa0
-% 0000000000000000000001fc000fcf556a80000000007000e01a8c00002000000000000000000000000000007f732b280000000003803806a1000008000000000000000000000000fe72a0
-% 0000000000000000000000c0001fed55658000000000708dc01a080000200000000000000000000000000000fe7aab6c0000000003003006430000000000000000000000000000007f76a0
-% 000000000000000000000000000fce556a800000000073fce0194800002000000000000000000000000000007ef555a80000000003803806920000080000000000000000000000007e72a0
-% 0000000000000000000c0000000fddaaaa80000000007081c01a0800002000000000000000000000000000007e6aab2c000000000300300522000000000000000000000000000000fd6aa0
-% 00000000000000000003c000001fcd5575800000000070fce014a80000200000000000000000000000000000ff6555a8000000000380380642000008000000000000000000000000ff6aa0
-% 000000000000000000000000001fdcaaaa80000000007181c019080000200000000000000000000000000000fe6aab2c000000000300300692000000000000000000000000000000fe6aa0
-% 0000000000000000000c6000001fed556580000000007080e01a480000600000000000000000000000000000feeaab68000000000380380542000008000000000000000000000000feeaa0
-% 00000000000000000007c000001fcd556a800000000077f9c014080000200000000000000000000000000000fe6aaaac000000000300300613000000000000000000000000000000fe6aa0
-% 000000000000000000000000001fed556a800000000077fce019480000400000000000000000000000000000fecaaaa8000000000380380542000008000000000000000000000000fed540
-% 000000000000000000000000001f99555580000000007001c00a080000200000000000000000000000000000feeaabac000000000300300281000008000000000000000000000000fccaa0
-% 000000000000000000000000003fdb556a800000000070fee014880000200000000000000000000000000001fdcaab28000000000380380652000008000000000000000000000000fdeaa0
-% 000000000000000000000000001f1a556a8000000000708bc01a080000200000000000000000000000000000f8daab6c000000000300300682000008000000000000000000000001fad540
-% 000000000000000000000000001f79aad580000000007189e018480000200000000000000000000000000000fdcaaaa8000000000380380601000008000000000000000000000000facaa0
-% 000000000000000000000000000f9d554ac00000000070dfc0150c00002000000000000000000000000000007ad5572c00000000030030055100000800000000000000000000000079daa0
-% 000000000000000000000000000f5aaad4c0000000007061e0180c00003000000000000000000000000000007aeaaa5400000000038038060000000c0000000000000000000000007ad2a0
-% 00000000000000000000000000035d556a800000000074b8c01a840000200000000000000000000000000000159556d400000000030030054100000800000000000000000000000052ad40
-% 00000000000000000000000000015aaaaac00000000076f9e0180c000020000000000000000000000000000012d556ac0000000003803806110000080000000000000000000000001ad540
-% 000000000000000000000000000312aad4c0000000007000c019080000300000000000000000000000000000199554a4000000000300300680000008000000000000000000000000199540
-% 0000000000000000000000000001dd55eb80000000007181e0120c00002000000000000000000000000000000eaaaf1c0000000003803804410000080000000000000000000000000daaa0
-% 0000000000000000000000000000f2aabf000000000070fcc01884000010000000000000000000000000000007d557f800000000030030070100000c000000000000000000000000079540
-% 0000000000000000000000000000d9559400000000007001e01404000020000000000000000000000000000006caaca000000000038038042100000800000000000000000000000006caa0
-% 0000000000000000000000000000ef11a600000000007000c011040001f0000000000000000000000000000006788ab000000000030030048100007c000000000000000000000000067880
-% 0000000000000000000000000000edff2c000000000071e1e01c02001f100000000000000000000000000000076ffd600000000003803807008007c400000000000000000000000006dfe0
-% 0000000000000000000000000001eac6ec0000000000703cc037d37ff08800000000000000000000000000000f563560000000000300300df4dffc220000000000000000000000000f4e60
-% 0000000000000000000000000000ed67280000000000703fe0607fe0038800000000000000000000000000000f57954000000000038038081fe801e20000000000000000000000000ed720
-% 0000000000000000000000000001eabc58000000000071c1c0400680184400000000000000000000000000000769eac0000000000300301001b006110000000000000000000000000769e0
-% 0000000000000000000000000000eaa5d000000000007020e0400cd007b400000000000000000000000000000f4a2ac00000000003803810013400ed0000000000000000000000000f5500
-% 0000000000000000000000000001bd5518000000000070f9c0800cd00c6400000000000000000000000000000d6aaa800000000003003030013403198000000000000000000000000f6560
-% 0000000000000000000000000001a555700000000000718ce08007b0018400000000000000000000000000000db55580000000000380382001e400f100000000000000000000000007b540
-% 0000124924800000000000000001b6aa900000000000708ce880000002020000012492480000000000000000073555800000000003003920000400008000002492490000000000000f3540
-% ffffffffffc00000000000000001b3aab0000000000070fffffffffffffffffffffffffe00000000000000000dda95800000000003803fffffffffffffffffffffff8000000000000f5d40
-% efdfeeeeeec00000000000000001bdd6b000000000007001f7df6efff6fef7dfbedddddc00000000000000000d6d75000000000003003ddfbb75ffdf7fdfbfdddddd800000000000096e60
-% bd7abbbbbbc00000000000000001bcfca000000000007000ed75fbd55fabdd7aebf7777600000000000000000967cb000000000003803b7aefdf5575d57af57777778000000000000b67e0
-% ebd7eeeeeec00000000000000001b61360000000000070f9ffdfaebffaff77d7bf5ddddc00000000000000000db8b3000000000003003fd7bd75ffdf7fd7afdddddd8000000000000db080
-% bebebbbbbdc00000000000000001b355400000000000708cf5757dd557aaaebeeaf7776e00000000000000000d9d56000000000003803d7eebdf556ad57d7d77777b800000000000099aa0
-% ffffffffffc000000000000000019dd5600000000000718dfffffffffffffffffffffffc000000000000000009aeab000000000003003fffffffffffffffffffffff8000000000000dbea0
-% 0000000000000000000000000001b55560000000000070f8c000400094aac0000000000000000000000000000dd2ab00000000000380300010000aaaa000000000000000000000000dcaa0
-% 000000000000000000000000000155557000000000007061e0002025295580000000000000000000000000000d95538000000000030038000801555560000000000000000000000009aaa0
-% 00000000000000000000000000019aaae000000000007000c0001008aaab000000000000000000000000000009d557000000000003803000040429554000000000000000000000000d9540
-% 0000000000000000000000000001b555f000000000007339e0001002555200000000000000000000000000000daaaf00000000000300380006214aaa8000000000000000000000000daaa0
-% 0000000000000000000000000001baa9200000000000760cc0000848aaac000000000000000000000000000009d5490000000000038030000204155580000000000000000000000009d540
-% 00000000000000000000000000013957600000000000740de00006010aa800000000000000000000000000001daabb0000000000030038000100aaaa0000000000000000000000001beaa0
-% 0000000000000000000000000001b54ea000000000007608c000020a5550000000000000000000000000000019aa6500000000000380300000910154000000000000000000000000198a60
-% 0000000000000000000000000001353920000000000073f9e0000100922000000000000000000000000000000989cb00000000000300300000402a880000000000000000000000000d29c0
-% fffffffffffffffffffffffffffffffffffffffffffff040ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff803fffffffffffffffffffffffffffffffffffffffe0
-% fffffffffffffffffffffffffffffffffffffffffffff001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff003fffffffffffffffffffffffffffffffffffffffe0
-%%EndImage
-%%EndPreview
-save
-countdictstack
-mark
-newpath
-/showpage {} def
-%%EndProlog
-%%Page 1 1
-%%DocumentFonts:
-
-
-% remember original state
-/origstate save def
-
-% build a temporary dictionary
-20 dict begin
-
-% define string to hold a scanline's worth of data
-/pix 90 string def
-
-% define space for color conversions
-/grays 720 string def % space for gray scale line
-/npixls 0 def
-/rgbindx 0 def
-
-% lower left corner
--53 259 translate
-
-% size of image (on paper, in 1/72inch coords)
-720.00000 274.03200 scale
-
-% dimensions of data
-720 274 1
-
-% mapping matrix
-[720 0 0 -274 0 274]
-
-{currentfile pix readhexstring pop}
-image
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-fffdfffffffffffffffffffffffffbfffffffefeff3fffdfffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-f670f070fff8787878393879f9bffbfffffc3e7effffffcfffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-f77773f37ff9f33efbf9bb7dfd3ffb7fffff7efeffff3f5fffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-f773f7f37ff9fb3efbf9bb39fc7ff839dffe7e7e7e3e9e1fffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-f779f0727ff87a7ef83abbbdfe7ff9dd9fff7efeffbfdcdfffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-f77cfbf0fff9f8fefbfabbb9fefffbdebffe7e7effbe1dcfffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-f67777f2fffbf27efbfa3b3dfe7ff9de7fff7efeffbddddfffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-f27273727ff9fb7cf9bb3879be7ff9be7ffe7e7e7fbd9c9fffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-f8f8f8777ff9fb38783b38fc1efff83efffc3f3f1fbe1e1fffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-fffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff
-aaaaaaaaaaaaaaa4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafff95555555555
-555555555555555555555555555555555555555555555557ff5555555555555555555555
-555555555555555555555555555555555555
-00000000000000000000000000000000000000000000000000000000007ff80000000000
-000000000000000000000000000000000000000000000003fe0000000000000000000000
-000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000007ff00000000000
-000000000000000000000000000000000000000000000007fe0000000000000000000000
-000000000000000000000000000000000000
-15555555555555555555555555555555555555555555555555555555547ff8aaaaaaaaaa
-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3fe2aaaaaaaaaaaaaaaaaaaaa
-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7ff1ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc43f8ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7811ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7ff8ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7819ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7920ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7b91ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc73a0ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7c21ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7ff8ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc73f1ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7818ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3f87fa1e1f1fb07ef86180
-001e7e78f8c7f87187fffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7ff1ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7f05723e0f09b1fef92498
-000efc3870c3f820b3fffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7c78ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fdd74ff666d97fcfbae3f
-feecfdf32659feee33fffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7931ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fcf349e72e5b4fcfbaca7
-beedfbf7af5cfe5e07fffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7398ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fdfb41e74e590fc796107
-7ef3fa37af5cff5e07fffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7991ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fdfa5ff75ec97fcf8e37f
-bef3f38f0e5dff5ebbfffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7c38ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fdf8dfe6dc8bff87bed7f
-3ef3f38f5ed9ff5cbbfffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7ff1ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fdfcdcf4dcb367b7bed73
-7cf7f72e4cd3e65db3fffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7f98ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3f87cc1f1c99307b79ed07
-3ef7f070e1c7f04187fffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7f91ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7f1fce3f3e3bb1ff7bec8f
-7ef7f9f1e3cff8e39ffffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc73f8ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7871ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7f08ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fc60f060bef3fbcf38420
-411fe41c767a3fb61061fffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7c21ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fc20f363aee3fbc711c80
-070fe4c836ba0fb47247fffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc71f0ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3f98ffb6fa6cffb9e77ddd
-df67e6ebb69ae7b5fb5ffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7ff9ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fbccf861a6d1f1bef059d
-8373c493869af7b41243fffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc4010ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3f3c0fa43a681f13ce1d39
-8673d637ae9af7887887fffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7ff9ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7f387fb2faabcf17df7c7d
-bf77c6b7aeaa6785f0dffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc4430ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3f7affbbf2abdf171c7df9
-9f6fc097aeaacfb5f6dffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc4039ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7f72ffa2c28b1e565961f9
-b94f9ad76ca21fa5c258fffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7bb0ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3f06ff8e1ac83ed0c305f9
-c31fb8c060b33f2413417ffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7399ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fdeffbf7bfdffd9efbdff
-cffffbf9f3fffffe7f6ffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7830ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7ff9ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffffffffffffffff
-ffffffffff7ffffffffffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7d30ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3f83ce61080f0c61f02d90
-7dcc8374000fbc7ff4107d20fffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7819ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7f9cdc47300e0924f00d80
-7ccc81245029b87df471dd27fffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7bf0ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fbeb9df377efbb6feed9d
-f88cd94dbce993fdb5f7cd3ffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7819ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7f063bc1677e4384fecb1d
-f898530c1ce8927db4104d21fffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7830ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3f1f73c70f7e1791fee35d
-f80a42083ce8b03d34e1cd43fffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7ff9ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7f3e37df1f7e77a5fecb1d
-fa48c36dfce8953d25f7d56ffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc78b0ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3f3e979f3f7ef7adfecf09
-fa485b6dccea273c25e7d15ffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7299ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fa0c6587f7ef766fcdaed
-fbe35b648ceb247ccd861968bffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7890ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3f85e0c13f7e7066fecaed
-fbe359741ce9a0fecc30d9613ffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7c39ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fdff9e7ff7ff9feffffed
-ffef5f7e7debb3fffef9ff77fffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7ff0ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc4839ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc5ab0ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fc00041f1c3efada01c7f
-d82f7c1d90e007fffffffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7bf9ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7f9c77cfe599ed8d81d8bc
-dbefbecdb44f77fffffffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7bf0ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3f3f77dfcfbded8d1dd3fc
-dbe93eed977ff7fffffffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7819ffff9e5c83
-c183020001fbfc706c081e04c83fc3e7bfdfcfffffffffe7fe7f077051c1bded9959e07e
-c8697cf1b701c7fffffffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7ff0ffffdcdcbb
-c0091c0000f3f83728101e3cd09f02673f9dcfffffffffe3fe3f8761c3c0bde9c359f83c
-50e97ee3b7078ffffffffffffffffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc5bf9ffffcc9cb9
-debd7fcfee67e3f729f7fcfcdfdfef463f8cefffffffffe7fe7ff377dffe79e94919ffbc
-5be17cebb65fbffffffffffffffffffffff8
-1fff3b01f9f005cc080c07ffffffffc07207ffe40e73f019ce1007fffc4010ffffe39db3
-dcb303dfcf4fe03669123c0ddf1fef443f2cefffffffffe3fe3ff7771fdc7be65a59f3bd
-9ba47ecbb4defffffffffffffffffffffff8
-3fff3b0efbf005c878cc3fffffffffee3261f3c8ccf7ff39d8493ffffc7bf9fffff3bda7
-d1820fcfcf1fe030c830383c1c3fefd93f6c6fffffffffe7fe7f277617c933f65ac9f23d
-9a243e9935d8fffffffffffffffffffffff8
-1fff3b7e73ff3dc9fdedffffffffffcf9279f999e4f7ffb3c1ff3ffffc73f0fffff3bd0f
-c3927fdfdf9fff81c9f3fcfc5cffcfd93f096fffffffffe3fe3f8f70d7e187e65ac9f87d
-986ebe3833e1bffffffffffffffffffffff8
-3fff3a6367ff39d91dcd8fffffffffcf927dfdb3f4f7ffb3d01f3ffffc7bf9fffff3bd3f
-cfbb7ddfcfbfefa7cbf7fdfdddffcfd9bf0d2fffffffffe7fe7fdf79dff7cffffbfffcff
-ddfefffcffe7bffffffffffffffffffffff8
-1fff02030fff3c100c180fffffffffef967dfc33e5e7ffb7d00f3ffffc7810fffff3b9af
-dfbb71dfdfbfe737cbf6fce1dfffcfdfbe698fffffffffe3fe3fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-3fff127f9fff385bfc99ffffffffffcf3271fe67e9f7ffb7dfe73ffffc7ff9fffff781a7
-dfb907dfcf3ff077c9f2fe0ddcff03dfbee1cfffffffffe7fe7fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-1fff7a7d9fff79dbf9d9f7ffffffffee7663fe67c9e7efa793cf3ffffc78b0fffff7cfbf
-dfbd9fdfff7ffcf7ffffff3ffeff3fffbfffdfffffffffe3fe3fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-3fff72789fff79dbc1c9e7ffffffffe4f747fef31c87e332118f7ffffc7299ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-1fff7701bfff79d80dcc0fffffffffe1f31ffcf03c07f030181f3ffffc7290ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-3fff738f3fff7ddc39ec3ffffffffff7ffbffefdff7ffefdff7ffffffc7839fffff30601
-60bc7bbff3e4060cf9fbc703f3c607fbf907ffffffffffe7fe7fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7ff0fffff3384e
-479971bff2f494fcf9fb973f3b967ff3bd31ffffffffffe3fe3fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-3ffffffffffffffffffffffffffffffe7c7f1ef7ffd473ff7efcf1fffc7f79ffffe3bbce
-5fbbf13ff277bdfdf9f33f7f3b3efff19d39ffffffffffe7fe7fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-1fffe1efc1fc014fb8181ffffffffff830301e679f0060ff3cc000fffc7830ffffeb23ce
-48b3e53ff2779c0df9f323033b7c0ff19d7cffffffffffe3fe3fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-3fffc04fc078024738718ffffffffff1b3d3fc673f13ce7e398fbe7ffc7299ffffeb87ce
-41b7ed3ff273b83dfbf2410f3b7c1fe59d7dffffffffffe7fe7fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-1fff8e4fce3fde4733f9cfffffffffc7f397fc667ff39f7e319ffe7ffc7890ffffe327ce
-4f27e13ff6379df9fbf27d7f5a7cffe18d39ffffffffffe3fe3fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-3fff9f4fdfbf9e4632199fffffffffc033a03960fff33f7e9180f8fffc79b9ffffc137ce
-5fa7a57df297bdf9f3f6f97d4af8fbe5a533ffffffffffe7fe7fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-1fff3f4fcfa0de50a0f83fffffffffff9063f966fff33f7ecc9fc3fffc7ab0ffffdd33ce
-5f264c31f6c7bdc18312e37062e6c3ccb127ffffffffffe3fe3ffffffffff3ffffffffff
-fffffffffffffffffffffffffffffffffff8
-3fff3e5fcf329e59b7f93fffffffffffd1e7f8267ff33e7ecc9feffffc7039ffffdd3bce
-5f30dc03f2e7bc0c18320f06730e0fecb98fffffffffffe7fe7ffffffffff3ffffffffff
-fffffffffffffffffffffffffffffffffff8
-1fff7c5fce7f9e59b7eb9fffffffffcf93e7c3277ff77cfeec9e3ffffc7fb0fffffd7bfe
-ffb9ff9ff7f7be7cfcff3f9ffb1f3ffefdffffffffffffe3fe3ffffffffff7ffffffffff
-fffffffffffffffffffffffffffffffffff8
-3fff38de08ff9e5f97899bffffffffe237f617a73ff730fefc987ffffc7f99ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7ffffffffff7ffffffffff
-fffffffffffffffffffffffffffffffffff8
-1fff01c0e1ff9e5f9819cbfffffffff073f037afbff783fefec1e7fffc7830ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3ffffffffff7ffffffffff
-fffffffffffffffffffffffffffffffffff8
-3fffefe7f7fffeffddfffffffffffffffffffffffffffffffffffffffc7ff9fffff833a4
-000fc001ddede9de7c00e81fe1ce730201038403ffffffe7fe7ffffffffff7ffffffffff
-fffffffffffffffffffffffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7f90ffffe3b3a4
-9cff9f9dccedc9de7c9cc9ffc58c733a0e7f149fffffffe3fe3ffffffffff7fffffffbfc
-7f1dfbf3bf70fe3c7ffee7fff7fffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7f99ffffe797a7
-9dffdf9d8ce59bccff9cdbff9f8ce33bcefe7f9fffffffe7fe7fffffffffe7fffffffbf0
-180cf3019e4070003f7c81ce73fffffffff8
-1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc7bf0ffffcfc7a7
-bc0f91b38ce43be9ff9dd81f018c6b33ce04079fffffffe3fe3ffffffffff7fffffffbf3
-d3f8e63f9c6f73f39f3d9cce77fffffffff8
-3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffc70f9ffffdd87a7
-983fc183ac643bf3ff9c107f80a26907ce1e039fffffffe7fe7fffffffffe7fffffff3fb
-93f8c7778cec67f39f993ede67fffffffff8
-1fffffffffffffffffffffffffffffffffffbffffffffffffffffffffc7e10ffffdc27a7
-bdff9f930d2593f3ff9cdbfffeb24127defff99fffffffe3fe3fffffffffeffffffff3f0
-301a1603486060323fc67e9eeffffffffff8
-3fffffffffffffffffffffffffffffffffff9ffffffffffffffffffffc78f9ffffde6f27
-bde79fbb25add3c7ff9ddbcfbcb64d77defaf39fffffffe7fe7fffffffffeffffffff3f0
-63fb127f626f67f07fe67c9ecffffffffff8
-1fffffffffffffffffffffffffffffffffffdffffffffffffffffffffc78f0ffffc06627
-9dc7dfbb658dcb17ff9ddb8f98bf5d73ce62639fffffffe3fe3fffffffffeffffffff3f3
-33fb327f626fa7f37feefc9ecffffffffff8
-3fffffffffffffffffffffffffffffffffffdffffffffffffffffffffc7e19ffffe16027
-bc1fdfb975c9e837ff9dd83fc1bf3d3bdf07079fffffffe7fe7fffffffffeffffffff3f3
-b7cbb278766f27873fcef99cfffffffffff8
-1fffffffffffffffffffffffffffffffffffdffffffffffffffffffffc7830ffffff7bef
-be7fdfbdf7effcf7ffffdcffe7ff7d7bdf9f9fffffffffe3fe3fffffffffeffffffff3f3
-930bf2617f686613bfce6398dffffffffff8
-3fffffffffffffffffffffffffffffffffffcffffffffffffffffffffc73f9ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffffcffffffff3f3
-d87bfb0f7f63f0f79fdf0fc29ffffffffff8
-1ffffffff3ffffffffffffffffffffffffffeffffffffffffffffffffc78f0fffffdfffe
-7fbd7f7fffb1ffffe79fcfffffffffffffffffffffffffe3fe3fffffffffdfffffffffff
-fffffffffffffffffffffffffffffffffff8
-3ffffffff7ffffffffffffffffffffffffffeffffffffffffffffffffc7e19fffff06f60
-3f981c1dcbb07f3a04040fffffffffffffffffffffffffe7fe7fffffffffdfffffffffff
-fffffffffffffffffffffffffffffffffff8
-1ffffffff7ffffffffffffffffffffffffffeffffffffffffffffffffc7c30fffff32767
-ff19d8cddb961f3a7ef4ffffffffffffffffffffffffffe3fe3fffffffffdfffffffffff
-ffffffffffc39fdf87dffffffffffffffff8
-3ffffffff7fffffffffffffffffffffffffff7fffffffffffffffffffc71f9ffffe7a727
-ff1dd9e9cb939f3afee5ffffffffffffffffffffffffffe7fe7fffffffffdfffffffffec
-3ce581c07e019fc8039f3ffffffffffffff8
-1ffffffff7fffffffffffffffffffffffffffffffffffffffffffffffc7e30ffffcf9360
-7f5913ebd197df3606c81fffffffffffffffffffffffffe3fe3fffffffffdffffffff3c8
-1ce48cc7fc3f9fc8071f7ffffffffffffff8
-3ffffffff7fffffffffffffffffffffffffff7fffffffffffffffffffc7839ffffcfa327
-ff4c37ebd0d79f047e18ffffffffffffffffffffffffffe7fe7fffffffff9ffffffff333
-cdeedc9ffee79fcf8f0f7ffffffffffffff8
-1ffffffff7fffffffffffffffffffffffffff7fffffffffffffffffffc73f0ffffdf29af
-ff0937cbd2933f36fec9ffffffffffffffffffffffffffe3fe3fffffffff9ffffffffb37
-e9eed880fc039f9f3f4e7ffffffffffffff8
-3ffffffff7fffffffffffffffffffffffffff7fffffffffffffffffffc73f9ffffde6c6f
-be4b979bd6163f76f2e9e7ffffffffffffffffffffffffe7fe7fffffffffbffffffffc67
-cbef8307fc0fbf9e3e6efffffffffffffff8
-1ffffffff7fffffffffffffffffffffffffff3fffffffffffffffffffc7830ffffcc6e66
-3eeb931b13107f76e2edc5ffffffffffffffffffffffffe3fe3fffffffffbffffffffcef
-cbef8b9ffcff3f8e7e0efffffffffffffff8
-3fffffffe7fffffffffffffffffffffffffffbfffffffffffffffffffc7e19ffffc1ee70
-7eebd07817b9ff760ee41dffffffffffffffffffffffffe7fe7fffffffffbffffffffcef
-9bef9dbf7cf9be5cfc0efffffffffffffff8
-1fffffffe7fffffffffffffffffffffffffffbfffffffffffffffffffc71f0ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fffffffffbffffffffde7
-390f9c987c41909800e7fffffffffffffff8
-3fffffffeffffffffffffffffffffffffffffbfffffffffffffffffffc7e39ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffffbffffffffdf0
-780f9cc1fe03019804e4fffffffffffffff8
-1fffffffeffffffffffffffffffffffffffff9fffffffffffffffffffc7e10ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fffffffffbffffffffff9
-fefffeefff1f87d8ffe5fffffffffffffff8
-3fffffffeffffffffffffffffffffffffffffdfffffffffffffffffffc70f9ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffffbfffffffffff
-fffffffffffffffffffffffffffffffffff8
-1fffffffeffffffffffffffffffffffffffffdfffffffffffffffffffc43f0ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fffffffffffffffffffff
-fffffffffffffffffffffffffffffffffff8
-3fffffffeffffffffffffffffffffffffffffdfffffffffffffffffffc7c19ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffffbfffffffffff
-fffffffffffffffffffffffffffffffffff8
-1fffffffeffffffffffffffffffffffffffffcfffffffffffffffffffc7fb0ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fffffffff7fffffffffff
-ffffff9ffffffffffffffffffffffffffff8
-3fffffffcffffffffffffffffffffffffffffefffffffffffffffffffc43f9ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffff7fffffffffff
-ffffffdffffffffffffffffffffffffffff8
-1fffffffcffffffffffffffffffffffffffffefffffffffffffffffffc7810ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fffffffff7fffffffffff
-ffffffcffffffffffffffffffffffffffff8
-3fffffffdffffffffffffffffffffffffffffffffffffffffffffffffc7ff9ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffff7fffffffffff
-ffffffeffffffffffffffffffffffffffff8
-1fffffffdffffffffffffffffffffffffffffffffffffffffffffffffc73b0ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe3fe3fffffffff7fffffffffff
-fffffff7fffffffffffffffffffffffffff8
-3fffffffdffffffffffffffffffffffffffffffffffffffffffffffffc7b99ffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffe7fe7fffffffff7fffffffffff
-fffffff7fffffffffffffffffffffffffff8
-1fffffffdffffffffffffffffffffffffffffffc1ffffffffffffffffc7ef0ffffffffff
-ffffffffffffffffffffffffffffe0ffffffffffffffffe3fe3ffffffffe7fffffffffff
-fffffff3ffffe0fffffffffffffffffffff8
-3fffffffdffffffffffffffffffffffffffffff001fffffffffffffffc7839ffffffffe7
-ffffffffffffffffffffffffffff800fffffffffffffffe7fe7ffffffffe7fffffffffff
-fffffffbffff800ffffffffffffffffffff8
-1fffffffdfffffffffffffffffffffffffffffe7fc7ffffffffffffffc7390ffffffffe7
-ffffffffffffffffffffffffffff3fe3ffffffffffffffe3fe3ffffffffeffffffffffff
-fffffff9ffff3fe3fffffffffffffffffff8
-3fffffff9fffffffffffffffffffffffffffff8fff3ffffffffffffffc7b99ffffffffef
-fffffffffffffffffffffffffffc7ff9ffffffffffffffe7fe7ffffffffeffffffffffff
-fffffffdfffc7ff9fffffffffffffffffff8
-1fffffff9fffffffffffffffffffffffffffff3fffcffffffffffffffc7800ffffffffef
-fffffffffffffffffffffffffff9fffe7fffffffffffffe3fe3ffffffffeffffffffffff
-fffffffefffbfffe7ffffffffffffffffff8
-3fffffffbffffffffffffffffffffffffffffe7fffe7fffffffffffffc7ff1ffffffffef
-fffffffffffffffffffffffffff3ffff3fffffffffffffe7fe7ffffffffeffffffffffff
-fffffffe7ff3ffff3ffffffffffffffffff8
-1fffffffbffffffffffffffffffffffffffffe7ffff3fffffffffffffc7bd8ffffffffef
-fffffffffffffffffffffffffff7ffff9fffffffffffffe3fe3ffffffffeffffffffffff
-ffffffff7ff7ffffbffffffffffffffffff8
-3fffffffbffffffffffffffffffffffffffffe7ffff9fffffffffffffc6011ffffffffef
-fffffffffffffffffffffffffff7ffffdfffffffffffffe7fe7ffffffffcffffffffffff
-ffffffff7fe7ffff9ffffffffffffffffff8
-1fffffffbffffffffffffffffffffffffffffefefffdfffffffffffffc6038ffffffffcf
-ffffffffffffffffffffffffffe7f7ffcfffffffffffffe3fe3ffffffffcffffffffffff
-ffffffffbfe7f7ffcffffffffffffffffff8
-3fffffffbffffffffffffffffffffffffffffce03ffdfffffffffffffc7bd1ffffffffdf
-ffffffffffffffffffffffffffe711ffefffffffffffffe7fe7ffffffffdffffffffffff
-ffffffffbfef13ffeffffffffffffffffff8
-1fffffffbffffffffffffffffffffffffffffcc9bffefffffffffffffc6018ffffffffdf
-ffffffffffffffffffffffffffe44dffe7ffffffffffffe3fe3ffffffffdffffffffffff
-ffffffffdfec4dffe7fffffffffffffffff8
-3fffffffbffffffffffffffffffffffffffffcbccffefffffffffffffc6031ffffffffdf
-ffffffffffffffffffffffffffe9e6fff7ffffffffffffe7fe7ffffffffdffffffffffff
-ffffffffdfe9e4fff7fffffffffffffffff8
-1fffffff3ffffffffffffffffffffffffffffe3eeffe7ffffffffffffc7ff8ffffffffdf
-fffffffffffffffffffffffffff3f67ff3ffffffffffffe3fe3ffffffffdffffffffffff
-ffffffffefe3f6fff3fffffffffffffffff8
-3fffffff3ffffffffffffffffffffffffffffe7e6fff3ffffffffffffc7c31ffffffffdf
-fffffffffffffffffffffffffff3f37ff9ffffffffffffe7fe7ffffffffdffffffffffff
-ffffffffefe7f27ffbfffffffffffffffff8
-1fffffff7ffffffffffffffffffffffffffffefe77ff9ffffffffffffc72b8ffffffff9f
-fffffffffffffffffffffffffff7fb7ffcffffffffffffe3fe3ffffffff9ffffffffffff
-fffffffff7e7fb7ffdfffffffffffffffff8
-3fffffff7ffffffffffffffffffffffffffffeff77ffdffffffffffffc7bf1ffffffffbf
-fffffffffffffffffffffffffff7fb3ffeffffffffffffe7fe7ffffffff9ffffffffffff
-fffffffff3effb3ffcfffffffffffffffff8
-1fffffff7fffffffffffffffffffffffffffffff6cffdffffffffffffc4038ffffffffbf
-fffffffffffffffffffffffffffffb67feffffffffffffe3fe3ffffffffbffffffffffff
-fffffffffbfffb67fdfffffffffffffffff8
-3fffffff7fffffffffffffffffffffffffffffff683fdffffffffffffc4011ffffffffbf
-fffffffffffffffffffffffffffffb41feffffffffffffe7fe7ffffffffbffffffffffff
-fffffffff9fffb41fcfffffffffffffffff8
-1fffffff7fffffffffffffffffffffffffffffff711fdffffffffffffc7ff8ffffffffbf
-fffffffffffffffffffffffffffffb0cfeffffffffffffe3fe3ffffffffbffffffffffff
-fffffffffffffb14fcfffffffffffffffff8
-3fffffff7fffffffffffffffffffffffffffffff23cfdffffffffffffc7ff1ffffffffbf
-fffffffffffffffffffffffffffff91e7cffffffffffffe7fe7ffffffffbffffffffffff
-fffffffffffffe1e7dfffffffffffffffff8
-1fffffff7fffffffffffffffffffffffffffffbf93a7dffffffffffffc7ff8ffffffffbf
-fffffffffffffffffffffffffffdfc9d7effffffffffffe3fe3ffffffffbffffffffffff
-fffffffffff9f99d7cfffffffffffffffff8
-3fffffff7fffffffffffffffffffffffffffff9e3fb79ffffffffffffc7ff1ffffffffbf
-fffffffffffffffffffffffffffcf1fcbcffffffffffffe7fe7ffffffff3ffffffffffff
-fffffffffffcf3fdfdfffffffffffffffff8
-1ffffffeffffffffffffffffffffffffffffff9cbf279ffffffffffffc7ff8ffffffff7f
-fffffffffffffffffffffffffffce5fb3cffffffffffffe3fe3ffffffff3ffffffffffff
-fffffffffffce7f93dfffffffffffffffff8
-3ffffffeffffffffffffffffffffffffffffff997fe3bffffffffffffc7ff1ffffffff7f
-fffffffffffffffffffffffffff8cbff3dffffffffffffe7fe7ffffffff7ffffffffffff
-fffffffffffccbff3dfffffffffffffffff8
-1ffffffefffffffffffffffffffffffffffffe027f1b9ffffffffffffc7ff8ffffffff7f
-fffffffffffffffffffffffffff013f8ddffffffffffffe3fe3ffffffff7ffffffffffff
-ffffffffffe013f89dfffffffffffffffff8
-3ffffffefffffffffffffffffffffffffffffe01fff9bffffffffffffc7ff1ffffffff7f
-fffffffffffffffffffffffffff20fffddffffffffffffe7fe7ffffffff7ffffffffffff
-ffffffffffe24fffddfffffffffffffffff8
-1ffffffefffffffffffffffffffffffffffffebffff9dffffffffffffc7ff8ffffffff7f
-fffffffffffffffffffffffffff1ffffdeffffffffffffe3fe3ffffffff7ffffffffffff
-fffffffffff1ffffddfffffffffffffffff8
-3ffffffefffffffffffffffffffffffffffffcbffffddffffffffffffc7ff1ffffffff7f
-ffffffffffffffffffffffffffe5ffffceffffffffffffe7fe7ffffffff7ffffffffffff
-ffffffffffedffffccfffffffffffffffff8
-1ffffffefffffffffffffffffffffffffffffaa1fffdcffffffffffffc7ff8ffffffff7f
-ffffffffffffffffffffffffff990fffee7fffffffffffe3fe3ffffffff7ffffffffffff
-ffffffffff910fffee7ffffffffffffffff8
-3ffffffefffffffffffffffffffffffffffff20c7ffceffffffffffffc7ff1ffffffff7f
-ffffffffffffffffffffffffff1263ffe77fffffffffffe7fe7ffffffff7ffffffffffff
-ffffffffff1063ffe77ffffffffffffffff8
-1ffffffeffffffffffffffffffffffffffffefdf3ffef7fffffffffffc7ff8fffffffe7f
-ffffffffffffffffffffffffff7ef9ffe7bfffffffffffe3fe3fffffffffffffffffffff
-fffffffffe7ef1ffe7bffffffffffffffff8
-3ffffffeffffffffffffffffffffffffffffef9f8ffe7bfffffffffffc7ff1fffffffeff
-ffffffffffffffffffffffffff7cfcfff3dfffffffffffe7fe7ffffffff7ffffffffffff
-ffffffffff7ce4fff3dffffffffffffffff8
-1ffffffcfffffffffffffffffffffffffffff02bcffe79fffffffffffc7ff8fffffffeff
-ffffffffffffffffffffffffff037efff3cfffffffffffe3fe3fffffffefffffffffffff
-ffffffffff0306fff3dffffffffffffffff8
-3ffffffeffffffffffffffffffffffffffffffe1effe39fffffffffffc7ff1fffffffeff
-ffffffffffffffffffffffffffff3efff1cfffffffffffe7fe7fffffffefffffffffffff
-ffffffffffff02fff3cffffffffffffffff8
-1ffffffcfffffffffffffffffffffffffffffff1efffb9fffffffffffc7ff8fffffffeff
-ffffffffffffffffffffffffffffbf7ffccfffffffffffe3fe3fffffffefffffffffffff
-ffffffffffff867ffdcffffffffffffffff8
-3ffffffdfffffffffffffffffffffffffffffff1e7ff9cfffffffffffc7ff1fffffffeff
-ffffffffffffffffffffffffffff9f3ffce7ffffffffffe7fe7fffffffefffffffffffff
-ffffffffffff8f3ffceffffffffffffffff8
-1ffffffdfffffffffffffffffffffffffffffff7e3ff0efffffffffffc7ff8fffffffcff
-ffffffffffffffffffffffffffffbf1ff867ffffffffffe3fe3fffffffefffffffffffff
-ffffffffffff7e1ff86ffffffffffffffff8
-3ffffffdffffffffffffffffffffffffffffffe7ebff4efffffffffffc7ff1fffffffcff
-ffffffffffffffffffffffffffff3edffb77ffffffffffe7fe7fffffffefffffffffffff
-ffffffffffff3edffa67fffffffffffffff8
-1ffffffdffffffffffffffffffffffffffffffe7fbfe6f7ffffffffffc7ff8fffffffdff
-ffffffffffffffffffffffffffff3fdff373ffffffffffe3fe3fffffffcfffffffffffff
-ffffffffffff3fdff273fffffffffffffff8
-3ffffffdffffffffffffffffffffffffffffffe7fbfeef7ffffffffffc7ff1fffffffdff
-ffffffffffffffffffffffffffff3fdfe77bffffffffffe7fe7fffffffcfffffffffffff
-ffffffffffff3fdfe773fffffffffffffff8
-1ffffffdffffffffffffffffffffffffffffffe7f9fee73ffffffffffc4038fffffffdff
-ffffffffffffffffffffffffffff3fcfe739ffffffffffe3fe3fffffffdfffffffffffff
-ffffffffffff7fdfe639fffffffffffffff8
-3ffffff9fffffffffffffffffffffffffffffff7fdfdc3bffffffffffc7bb1fffffffdff
-ffffffffffffffffffffffffffffbfefee9dffffffffffe7fe7fffffffdfffffffffffff
-ffffffffffff3fefee9dfffffffffffffff8
-1ffffff9fffffffffffffffffffffffffffffff3fdf198dffffffffffc7398fffffffdff
-ffffffffffffffffffffffffffffbfef9cc4ffffffffffe3fe3fffffffdfffffffffffff
-ffffffffffffbfef9cccfffffffffffffff8
-3ffffffbfffffffffffffffffffffffffffffff3f983924ffffffffffc7831fffffff9ff
-ffffffffffffffffffffffffffff9fcc1c927fffffffffe7fe7fffffffdfffffffffffff
-ffffffffffffbfd81c827ffffffffffffff8
-1ffffffbfffffffffffffffffffffffffffffff9f82f2167fffffffffc7cf8fffffff9ff
-ffffffffffffffffffffffffffffdfc1791b3fffffffffe3fe3fffffffdfffffffffffff
-ffffffffffff9fc279133ffffffffffffff8
-3ffffffbfffffffffffffffffffffffffffffff9fbfe2773fffffffffc7f91fffffffbff
-ffffffffffffffffffffffffffffdfdff123bfffffffffe7fe7fffffff9fffffffffffff
-ffffffffffff9fdff333bffffffffffffff8
-1ffffffbfffffffffffffffffffffffffffffffdf3fcec7bfffffffffc7038fffffffbff
-ffffffffffffffffffffffffffffef9fe653dfffffffffe3fe3fffffff9fffffffffffff
-ffffffffffffef9fe6539ffffffffffffff8
-3ffffffbfffffffffffffffffffffffffffffff8e7f14579fffffffffc7291fffffffbff
-ffffffffffffffffffffffffffffc73f8e6bdfffffffffe7fe7fffffffbfffffffffffff
-ffffffffffffc73f8c73dffffffffffffff8
-1ffffffbfffffffffffffffffffffffffffffffbe7c2157dfffffffffc7a18fffffffbff
-ffffffffffffffffffffffffffffdf3e30abcfffffffffe3fe3fffffffbfffffffffffff
-ffffffffffff9f7e308bcffffffffffffff8
-3ffffff3fffffffffffffffffffffffffffffffbef1c4d3dfffffffffc7f71fffffff3ff
-ffffffffffffffffffffffffffffdf78a269cfffffffffe7fe7fffffffbfffffffffffff
-ffffffffffff9f78a279cffffffffffffff8
-1ffffff3fffffffffffffffffffffffffffffff3e82902bdfffffffffc7ff8fffffff3ff
-ffffffffffffffffffffffffffff9f414829cfffffffffe3fe3fffffffbfffffffffffff
-ffff87ffffffbe414829cffffffffffffff8
-3ffffff7fffffffffffffffffffffffffffffff7c1d27289fffffffffc4831fffffff7ff
-ffffffffffffffffffffffffffffbe0e8594dfffffffffe7fe7fffffffbfffffffffffff
-ffffbfffffffbc169394dffffffffffffff8
-1ffffff7fffffffffffffffffffffffffffffff786b09343fffffffffc7ff8fffffff7ff
-ffffffffffffffffffffffffffffbc298a9a1fffffffffe3fe3fffffff3fffffffffffff
-ffff7fffffff3c3524961ffffffffffffff8
-3ffffff7ffffffffffffffffffffffffffffffe402a1a959fffffffffc4031fffffff7ff
-ffffffffffffffffffffffffffff241b0a8a5fffffffffe7fe7fffffff3fffffffffffff
-fffef3ffffffe00b0d4adffffffffffffff8
-1ffffff7ffffffffffffffffffffffffffffffee0148a94bfffffffffc4018fffffff7ff
-ffffffffffffffffffffffffffff6014554a7fffffffffe3fe3fffffff7fffffffffffff
-ffffe3ffffff7014554adffffffffffffff8
-3ffffff7ffffffffffffffffffffffffffffffef8299a94ffffffffffc7ff1fffffff7ff
-ffffffffffffffffffffffffffff7414954affffffffffe7fe7fffffff7fffffffffffff
-ffffdfffffff6c0c954afffffffffffffff8
-1fffffffffffffffffffffffffffffffffffffed829254dffffffffffc4038ffffffe7ff
-ffffffffffffffffffffffffffff6c08aaa67fffffffffe3fe3fffffff7fffffffffffff
-fffffff3ffff6c192aa4fffffffffffffff8
-3fffffffffffffffffffffffffffffffffffffe50123544ffffffffffc7ff1ffffffefff
-ffffffffffffffffffffffffffff08192aa27fffffffffe7fe7fffffff7fffffffffffff
-fffff001ffff0c092aa67ffffffffffffff8
-1ffffffffffffffffffffffffffffffffffffff38336aaaffffffffffc4038ffffffefff
-ffffffffffffffffffffffffffff9c0995557fffffffffe3fe3fffffffffffffffffffff
-ffffe13c7fff98192aa4fffffffffffffff8
-3fffffffffffffffffffffffffffffffffffffff8124aa67fffffffffc4011ffffffefff
-fffffffffffffffffffffffffffffc132aa53fffffffffe7fe7fffffffffffffffffffff
-ffff8fb93ffff0132aa37ffffffffffffff8
-1fffffffffffffffffffffffffffffffffffffff8245aa27fffffffffc7ff8ffffffefff
-fffffffffffffffffffffffffffffc1235553fffffffffe3fe3fffffffffffffffffffff
-ffff6f999fffc01255567ffffffffffffff8
-3fffffffffffffffffffffffffffffffffffffff02652a6ffffffffffc7ff1ffffffefff
-fffffffffffffffffffffffffffff81115517fffffffffe7fe7fffffffffffffffffffff
-fff8cd9a4fffc81115517ffffffffffffff8
-1fffffffffffffffffffffffffffffffffffffff8222aa47fffffffffc7ff8ffffffefff
-fffffffffffffffffffffffffffffc1335533fffffffffe3fe3fffffffffffffffffffff
-fff39ddad3ff381735527ffffffffffffff8
-3fffffffffffffffffffffffffffffffffffffff82655527fffffffffc78f1ffffffefff
-fffffffffffffffffffffffffffffc1625513fffffffffe7fe7fffffffffffffffffffff
-ffee499329fe480525537ffffffffffffff8
-1fffffffffffffffffffffffffffffffffffffff02455527fffffffffc4038ffffffffff
-fffffffffffffffffffffffffffff8052d533fffffffffe3fe3fffffffffffffffffffff
-ffcce3d2d47cd8052d513ffffffffffffff8
-3fffffffffffffffffffffffffffffffffffffff02a55537fffffffffc4f91ffffffefff
-fffffffffffffffffffffffffffff81532aabfffffffffe7fe7fffffffffffffffffffff
-ffe1c7b15679500552ab3ffffffffffffff8
-1fffffffffffffffffffffffffffffffffffffff00a55527fffffffffc4238ffffffdfff
-fffffffffffffffffffffffffffff8052d52bfffffffffe3fe3fffffffffffffffffffff
-fff59b215532a80535517ffffffffffffff8
-3fffffffffffffffffffffffffffffffffffffff00a55517fffffffffc78f1ffffffdfff
-fffffffffffffffffffffffffffff80512a93fffffffffe7fe7fffffffffffffffffffff
-fffe3b76aac6a8052aa93ffffffffffffff8
-1fffffffffffffffffffffffffffffffffffffff00a55537fffffffffc7df8ffffffffff
-fffffffffffffffffffffffffffff8052aaabfffffffffe3fe3fffffffffffffffffffff
-ffffb8e55544a80d2aab3ffffffffffffff8
-3fffffffffffffffffffffffffffffffffffffff01a55527fffffffffc6031ffffffffff
-fffffffffffffffffffffffffffff80d2aa93fffffffffe7fe7fffffffffffffffffffff
-ffffb1e5554aa80555527ffffffffffffff8
-1fffffffffffffffffffffffffffffffffffffff00a55517fffffffffc4f98ffffffffff
-fffffffffffffffffffffffffffff8013553bfffffffffe3fe3fffffffffffffffffffff
-ffff87f35546a80d55513ffffffffffffff8
-3fffffffffffffffffffffffffffffffffffffff02a55567fffffffffc4211ffffffffff
-fffffffffffffffffffffffffffff81d15523fffffffffe7fe7fffffffffffffffffffff
-fffffff8d54558192ab33ffffffffffffff8
-1fffffffffffffffffffffffffffffffffffffff02a6aa57fffffffffc7878ffffffffff
-fffffffffffffffffffffffffffff8153551bfffffffffe3fe3fffffffffffffffffffff
-fffffffc2a8aa01515517ffffffffffffff8
-3fffffffffffffffffffffffffffffffffffffff02a55557fffffffffc7ff1ffffffffff
-fffffffffffffffffffffffffffff81515533fffffffffe7fe7fffffffffffffffffffff
-ffffffff1505481535533ffffffffffffff8
-1fffffffffffffffffffffffffffffffffffffff01455527fffffffffc6078ffffffffff
-fffffffffffffffffffffffffffff8153552bfffffffffe3fe3fffffffffffffffffffff
-ffffffffcd3a981515523ffffffffffffff8
-3fffffffffffffffffffffffffffffffffffffff02a2aa67fffffffffc4f11ffffffffff
-fffffffffffffffffffffffffffff81515513fffffffffe7fe7fffffffffffffffffffff
-ffffffffe3a5981535537ffffffffffffff8
-1fffc000bfffffffffffffffffffffffffffffff03555527fffffffffc4f98fffe0005ff
-fffffffffffffffffffffffffffff80a95533fffffffffe3fe3fff80017fffffffffffff
-ffff9ffff075381525527ffffffffffffff8
-3ffe0bffa3ffffffffffffffffffffffffffffff02a2aa6ffffffffffc6071fff05ffd1f
-fffffffffffffffffffffffffffff81535527fffffffffe7fe7ffc17ff47ffffffffffff
-ffffc1fffe0c781515517ffffffffffffff8
-1ffef77ff9ffffffffffffffffffffffffffffff01655527fffffffffc7ff8ffe7fbffcf
-fffffffffffffffffffffffffffff80d25533fffffffffe3fe3ffdeefff3ffffffffffff
-ffffffffff80f81575537ffffffffffffff8
-3ffcadfffe7fffffffffffffffffffffffffffff02a6aa27fffffffffc6191ffe42ffff3
-fffffffffffffffffffffffffffff8152d513fffffffffe7fe7ff95bfffcffffffffffff
-ffffbffffff3f81515527ffffffffffffff8
-1ff9bbbfff3fffffffffffffffffffffffffffff02a55667fffffffffc4cb8ffcfdbfffb
-fffffffffffffffffffffffffffff81535557fffffffffe3fe3ff3777ffe7fffffffffff
-ffffc0fffffff8152aa57ffffffffffffff8
-3ff80effffbfffffffffffffffffffe3ffffffff01a2aa2ffffffffffc5e11ffc07ffff9
-fffffffffffffffffffffffffffff80d2aa53fffffffffe7fe7ff01dffff7fffffffffff
-fffff1fffffff80d55527ffffffffffffff8
-1ff283ffffbfffffffffffffffffffefffffffff0126aa67fffffffffc6718ff941bfffd
-fffffffffffffffffffffffffffff80915513fffffffffe3fe3fe507ffff7fffffffffff
-fffffffffffff80955557ffffffffffffff8
-3ff17bffff3fffffffffffffffffffd9ffffffff00a55527fffffffffc7ff1ffabdffffc
-fffffffffffffffffffffffffffff80535573fffffffffe7fe7fe2f7fffe7fffffffffff
-fffffffffffff81515557ffffffffffffff8
-1ff7597fff1fffffffffffffffffffdbffffffff01a5552ffffffffffc7ff8ffaacffffa
-fffffffffffffffffffffffffffff80d25517fffffffffe3fe3feeb37ffe3fffffffffff
-fffffffffffff80d6aa27ffffffffffffff8
-3ff4d9ffff5ffffffffffffffffffffbfffffffe01255527fffffffffc7ff1ff96cffffa
-fffffffffffffffffffffffffffff80a2d553fffffffffe7fe7fe9b3fffebfffffffffff
-fffffffffffff8092aa97ffffffffffffff8
-1fe6bdffff5ffffffffffffffffffff7fffffffe01a6aa67fffffffffc7ff8ff35effffa
-fffffffffffffffffffffffffffff80ab5513fffffffffe3fe3fcd7bfffebfffffffffff
-fffffffffffff81535537ffffffffffffff8
-3ff2adfffe4ffffffffffffffffffffffbfffff401505527fffffffffc7019ff956ffff2
-fffffffffffffffffffffffffffff80502ab3fffffffffe7fe7feaabfffc9fffffffffff
-fffffffffffff80a82aa7ffffffffffffff8
-1fe6dcf101dffffffffffffffffffffc00907c0100a1d527fffffffffc47c0ffb6e78806
-7ffffffffffffffffffffffffffff80d0d513fffffffffe3fe3fcaf9e203bfffffffffff
-fffffffffffff80d0d513ffffffffffffff8
-3ff4b604bfdffffffffffffffffffff9f62400b301a05557fffffffffc7ff1ff15b023fe
-fffffffffffffffffffffffffffff80502aabfffffffffe7fe7fe55c097fbfffffffffff
-fffffffffffff80502ab7ffffffffffffff8
-1ff37fffffeffffffffffffffffffffbef33b5a901535533fffffffffc7b38ffb6fffffe
-fffffffffffffffffffffffffffff80d9552bfffffffffe3fe3fedbfffffdfffffffffff
-fffffffffffff80a95513ffffffffffffff8
-3fe6d7ffffdffffffffffffffffffff805a4aa5501515553fffffffffc7391ff2ddffffe
-7ffffffffffffffffffffffffffffc051aaabfffffffffe7fe7fcb77ffffbfffffffffff
-fffffffffffffc0d1aaabffffffffffffff8
-1ff4bfffffcffffffffffffffffffffeed25555500a15517fffffffffc7b98ffab7ffffe
-fffffffffffffffffffffffffffffc0a85533fffffffffe3fe3feadfffff9fffffffffff
-fffffffffffffc0a85533ffffffffffffff8
-3ff5dbfcffdffffffffffffffffffffec975555501a4aa53fffffffffc7831ff95ffe7fe
-fffffffffffffffffffffffffffff8052d549fffffffffe7fe7fe57ff9ffbfffffffffff
-fffffffffffff8056d54bffffffffffffff8
-1ff2bffcffdffffffffffffffffffffe0366aaab00a75553fffffffffc7ff8ffb7bfd7fe
-fffffffffffffffffffffffffffffc053555bfffffffffe3fe3fcdeff9ffbfffffffffff
-fffffffffffffc0a29529ffffffffffffff8
-3fe577f8ffdffffffffffffffffffffeff62aaaa80a4aa6bfffffffffc4fe1ff2affe7fe
-fffffffffffffffffffffffffffffc064aa51fffffffffe7fe7fcabff1ffbfffffffffff
-fffffffffffffc0d6b529ffffffffffffff8
-1fe5dffdffdffffffffffffffffffffe4f66aaaa80aaaa53fffffffffc6018ff17bfeffe
-fffffffffffffffffffffffffffffc053552bfffffffffe3fe3fd5effbffbfffffffffff
-fffffffffffffc052a52bffffffffffffff8
-3feabfffffdfffffffffffffffffffff1f7557aa804aaa2bfffffffffc7ff1ff3afffffe
-fffffffffffffffffffffffffffffc0265529fffffffffe7fe7fcabfffffbfffffffffff
-fffffffffffffc0a55a69ffffffffffffff8
-1fe377ffffdfffffffffffffffffffffc102b03581caaa6bfffffffffc7ff8ff57fffffe
-fffffffffffffffffffffffffffffc0e4d56bfffffffffe3fe3fcdffffffbfffffffffff
-fffffffffffffc0a55529ffffffffffffff8
-3fe6ddfffffffffffffffffffffffffffff68100004d5653fffffffffc7ff1ff2d6ffffc
-fffffffffffffffffffffffffffffc0a59529fffffffffe7fe7fcb5bffffffffffffffff
-fffffffffffffc0a2aa69ffffffffffffff8
-1feafbffffdffffffffffffffffffffffff01fff818554abfffffffffc7ff8ff2b9ffffe
-fffffffffffffffffffffffffffffc0466a6bfffffffffe3fe3fcaf7ffffbfffffffffff
-fffffffffffff80c6aa4bffffffffffffff8
-3fe5b3fffffffffffffffffffffffffffff9ffff009554d3fffffffffc7b91ff2fbffffe
-fffffffffffffffffffffffffffff80c2aa49fffffffffe7fe7fcde7ffffffffffffffff
-fffffffffffffc044aa59ffffffffffffff8
-1feb77ffffdfffffffffffffffffffffffffffff818d54abfffffffffc6018ff35bffffe
-fffffffffffffffffffffffffffffc085552bfffffffffe3fe3fcb6fffffbfffffffffff
-fffffffffffffc0c6aaa9ffffffffffffff8
-3fe2f7ffffffffffffffffffffffffff9fffffff8112aaabfffffffffc7bf1ff2fbffffe
-fffffffffffffffffffffffffffffc0caaa69fffffffffe7fe7fd6efffffffffffffffff
-fffffffffffff814aaaabffffffffffffff8
-1fedb7ffffdfffffffffffffffffffffe1ffffff01955453fffffffffc7818ff5abffffe
-fffffffffffffffffffffffffffff804d552bfffffffffe3fe3fcdefffffbfffffffffff
-fffffffffffff804aaa29ffffffffffffff8
-3fe6f7ffffffffffffffffffffffffffffffffff011aaaabfffffffffc73f1ff37bffffe
-fffffffffffffffffffffffffffff80caaa69fffffffffe7fe7fcb6fffffffffffffffff
-fffffffffffff80caaa69ffffffffffffff8
-1fe5b7ffffdfffffffffffffffffffff9cffffff009554d3fffffffffc7bf8ff2dbffffc
-fffffffffffffffffffffffffffff808aaa4bfffffffffe3fe3fd5efffffbfffffffffff
-fffffffffffff808aaa49ffffffffffffff8
-3fe6f3ffffffffffffffffffffffffffc1ffffff019554abfffffffffc4031ff5fbffffe
-fffffffffffffffffffffffffffff80caaaa9fffffffffe7fe7fcf67ffffffffffffffff
-fffffffffffff80caaadbffffffffffffff8
-1fe5f7ffffdfffffffffffffffffffffffffffff009554abfffffffffc4018ff35bffffd
-fffffffffffffffffffffffffffff809aaaabfffffffffe3fe3fd5efffffbfffffffffff
-fffffffffffff80955491ffffffffffffff8
-3ff5b7ffffdfffffffffffffffffffffffffffff03355553fffffffffc7ff1ffafbffffe
-fffffffffffffffffffffffffffff808aaa29fffffffffe7fe7febf7ffffbfffffffffff
-fffffffffffff819aaa69ffffffffffffff8
-1ff6fbffffdffffffffffffffffffffffffffffe012554abfffffffffc7808ff5bbffffe
-fffffffffffffffffffffffffffff011aaa6bfffffffffe3fe3fcd6fffffbfffffffffff
-fffffffffffff810aaaabffffffffffffff8
-3fe5f7ffffdfffffffffffffffffffffffffffff072d54abfffffffffc7ba1ff2fbffffe
-fffffffffffffffffffffffffffff8392aa49fffffffffe7fe7fcbefffffbfffffffffff
-fffffffffffff029554a9ffffffffffffff8
-1fe7bbffffdfffffffffffffffffffffffffffff0432a953fffffffffc73b0ff3dbffffe
-fffffffffffffffffffffffffffff811aaaabfffffffffe3fe3fcff7ffffbfffffffffff
-fffffffffffff829aaaa9ffffffffffffff8
-3feafbffffdfffffffffffffffffffffffffffff831555a9fffffffffc7901ff579ffffe
-fffffffffffffffffffffffffffffc2955469fffffffffe7fe7fd577ffffbfffffffffff
-fffffffffffffc312aaa9ffffffffffffff8
-1fe5ffffffcfffffffffffffffffffffffffffff852aa959fffffffffc7cf0ff3f9ffffe
-7ffffffffffffffffffffffffffffc28aaad5fffffffffe3fe3fcfffffff9fffffffffff
-fffffffffffffc296aa55ffffffffffffff8
-3fe7bbffffdfffffffffffffffffffffffffffffe51554abfffffffffc5a39ff2bdffffe
-ffffffffffffffffffffffffffffff5355495fffffffffe7fe7fd5f7ffffbfffffffffff
-fffffffffffffd6a954d5ffffffffffffff8
-1fe6fbffffdffffffffffffffffffffffffffffff52aaaa9fffffffffc4830ff3f9ffffe
-ffffffffffffffffffffffffffffff69554a9fffffffffe3fe3fcf77ffffbfffffffffff
-ffffffffffffff2955555ffffffffffffff8
-3fedffffffdfffffffffffffffffffffffffffffe76aa959fffffffffc7ff9ff37bffffe
-7fffffffffffffffffffffffffffff33555adfffffffffe7fe7fcbffffffbfffffffffff
-ffffffffffffff3355559ffffffffffffff8
-1febbbffffdffffffffffffffffffffffffffffff11550a3fffffffffc73f0ff6f9ffffe
-ffffffffffffffffffffffffffffff8aaa871fffffffffe3fe3fddf7ffffbfffffffffff
-ffffffffffffff92aa8b1ffffffffffffff8
-3fe5fbffffcffffffffffffffffffffffffffffff86aaa07fffffffffc7819ff3bdfffff
-7fffffffffffffffffffffffffffffc155403fffffffffe7fe7fc7f7ffff9fffffffffff
-ffffffffffffffc355407ffffffffffffff8
-1feffbffffdffffffffffffffffffffffffffffff935535ffffffffffc7ff0ff5fdffffe
-ffffffffffffffffffffffffffffffc9aa9affffffffffe3fe3fdef7ffffbfffffffffff
-ffffffffffffffc9aa9afffffffffffffff8
-3fe77bfffe0ffffffffffffffffffffffffffffff88772cffffffffffc7ff9ff77dffff0
-7fffffffffffffffffffffffffffffcc3baa7fffffffffe7fe7fdbf7fffc1fffffffffff
-ffffffffffffffcc3baafffffffffffffff8
-1fe1fdffe0effffffffffffffffffffffffffffff890069ffffffffffc70f0ff1fefff07
-7fffffffffffffffffffffffffffffc48014ffffffffffe3fe3fc7fbffc1dfffffffffff
-ffffffffffffffc90014fffffffffffffff8
-3fc82c800f77fffffffffffffffffffffffffffff0a9c89ffffffffffc7e19fe4164007b
-bfffffffffffffffffffffffffffff854e54ffffffffffe7fe7f9059001eefffffffffff
-ffffffffffffff858cd4fffffffffffffff8
-1fdf805ff877fffffffffffffffffffffffffffff894c6bffffffffffc7e00fcfc00ffe3
-bfffffffffffffffffffffffffffff854355ffffffffffe3fe3fbf00bff0efffffffffff
-ffffffffffffff894655fffffffffffffff8
-3fbff93fe7bbfffffffffffffffffffffffffffff0aa1d3ffffffffffc71f1fdffcbff3d
-dfffffffffffffffffffffffffffffc4b0a9ffffffffffe7fe7f7ff27fcf77ffffffffff
-ffffffffffffffc4b0a9fffffffffffffff8
-1fbffb2ffc4bfffffffffffffffffffffffffffff8aad17ffffffffffc7ef8fdff997fc2
-5fffffffffffffffffffffffffffff85aea9ffffffffffe3fe3f7ff65ff897ffffffffff
-ffffffffffffff8557a9fffffffffffffff8
-3fbffb2ff399fffffffffffffffffffffffffffff215573ffffffffffc7831fbff997f9c
-dfffffffffffffffffffffffffffff94aaabffffffffffe7fe7e7ff65fe733ffffffffff
-ffffffffffffff84d429fffffffffffffff8
-1f7ff84ffc3bfffffffffffffffffffffffffffff2d5547ffffffffffc7398fbffc27ff3
-dfffffffffffffffffffffffffffff925553ffffffffffe3fe3efff0dff877ffffffffff
-ffffffffffffffc255d3fffffffffffffff8
-167ffffffffdffffff6db6dbfffffffffffffffff24aab7ffffffffffc7b98bbffffffef
-effffff6db6dbfffffffffffffffffc65553ffffffffffe7fe36ffffdffffbfffffedb6d
-b7ffffffffffff865557fffffffffffffff8
-000000000000000000000001fffffffffffffffff262aa7ffffffffffc78000000000000
-0000000000000fffffffffffffffff912b53ffffffffffe3fe0000000000000000000000
-03ffffffffffff851553fffffffffffffff8
-088449200082008100888889fffffffffffffffff2114a7ffffffffffc7ff04104880048
-0841020911111fffffffffffffffff949457ffffffffffe7fe1102245001040102011111
-13ffffffffffffb48ca7fffffffffffffff8
-1111040aaa28aa142a222221fffffffffffffffff2181afffffffffffc7ff89450215502
-a11428a044444fffffffffffffffffb4c1a7ffffffffffe3fe2428810554515428544444
-43ffffffffffffa4c0a7fffffffffffffff8
-022450a0008200a140888889fffffffffffffffff24f64fffffffffffc783001028a0028
-0441420511111fffffffffffffffff923a67ffffffffffe7fe0142145001040142811111
-13ffffffffffff927baffffffffffffffff8
-1488850aaa54aa0a0a222211fffffffffffffffff26555fffffffffffc7b985454115542
-aa8a08a844448fffffffffffffffff93154fffffffffffe3fe1408a10554a95414144444
-23ffffffffffffb32a4ffffffffffffffff8
-000000000000000000000001fffffffffffffffff31154fffffffffffc73900000000000
-0000000000001fffffffffffffffffb28aa7ffffffffffe7fe0000000000000000000000
-03ffffffffffff920aaffffffffffffffff8
-1fffbfffd5557ffffffffffffffffffffffffffff25554fffffffffffc7839fffdfffb5a
-a9ffffffffffffffffffffffffffff916aa7ffffffffffe3fe7fff7fffaaaaffffffffff
-ffffffffffffff91aaa7fffffffffffffff8
-3fffdffaaaaa7ffffffffffffffffffffffffffff555547ffffffffffc7cf0fffefed6b5
-53ffffffffffffffffffffffffffff935563ffffffffffe7fe3fffbff55554ffffffffff
-ffffffffffffffb2aaa3fffffffffffffff8
-1fffefb75aaafffffffffffffffffffffffffffff32aa8fffffffffffc7ff9ffff7fbaaa
-a7ffffffffffffffffffffffffffffb15547ffffffffffe3fe7fffdfdeb555ffffffffff
-ffffffffffffff935547fffffffffffffff8
-3fffe7eed555fffffffffffffffffffffffffffff255507ffffffffffc6630ffff7fed55
-6fffffffffffffffffffffffffffff92aa87ffffffffffe7fe3fffcef5aaabffffffffff
-ffffffffffffff92aa87fffffffffffffff8
-1ffff3fdaaa9fffffffffffffffffffffffffffff22ab6fffffffffffc4f99ffffbdbaaa
-9fffffffffffffffffffffffffffffb155b7ffffffffffe3fe7fffefdf5553ffffffffff
-ffffffffffffffb155b7fffffffffffffff8
-3ffffbdb5557fffffffffffffffffffffffffffff63544fffffffffffc5f90ffffcff7aa
-bfffffffffffffffffffffffffffff12aa27ffffffffffe7fe3ffff7faaaafffffffffff
-ffffffffffffff20aa27fffffffffffffff8
-1ffffdfefaaffffffffffffffffffffffffffffff2558afffffffffffc4fb9ffffefad55
-7fffffffffffffffffffffffffffff32acd7ffffffffffe3fe7ffffb77f55fffffffffff
-ffffffffffffff33ac6ffffffffffffffff8
-3ffffeffd5dffffffffffffffffffffffffffffff65636fffffffffffc6030fffff7fb6e
-ffffffffffffffffffffffffffffffb3b1a7ffffffffffe7fe7ffffdfeabbfffffffffff
-ffffffffffffff96b1a7fffffffffffffff8
-00000000000000000000000000000000000000000000000000000000007df80000000000
-000000000000000000000000000000000000000000000003fe0000000000000000000000
-000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000007ff00000000000
-000000000000000000000000000000000000000000000007fe0000000000000000000000
-000000000000000000000000000000000000
-
-
-showpage
-
-% stop using temporary dictionary
-end
-
-% restore original state
-origstate restore
-
-%%Trailer
-cleartomark
-countdictstack exch sub { end } repeat
-restore
-%%EOF
diff --git a/doc/uf002331.jpg b/doc/uf002331.jpg
deleted file mode 100644
index 3fd1b784..00000000
--- a/doc/uf002331.jpg
+++ /dev/null
Binary files differ
diff --git a/eval.c b/eval.c
index e584afe7..479cb920 100644
--- a/eval.c
+++ b/eval.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc.
+ * 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,6 +224,7 @@ static char *nodetypes[] = {
"Node_func_call",
"Node_cond_exp",
"Node_regex",
+ "Node_dynregex",
"Node_hashnode",
"Node_ahash",
"Node_array_ref",
@@ -468,8 +469,7 @@ interpret(register NODE *volatile tree)
volatile size_t i;
size_t j, num_elems;
volatile int retval = 0;
- static int first = TRUE;
- static int sort_indices = FALSE;
+ int sort_indices = whiny_users;
#define hakvar forloop->init
#define arrvar forloop->incr
@@ -504,10 +504,6 @@ interpret(register NODE *volatile tree)
}
}
- if (first) {
- first = FALSE;
- sort_indices = (getenv("WHINY_USERS") != 0);
- }
if (sort_indices)
qsort(list, num_elems, sizeof(NODE *), comp_func); /* shazzam! */
@@ -810,6 +806,7 @@ r_tree_eval(register NODE *tree, int iscond)
case Node_match:
case Node_nomatch:
case Node_regex:
+ case Node_dynregex:
return match_op(tree);
case Node_func:
@@ -949,9 +946,13 @@ r_tree_eval(register NODE *tree, int iscond)
break; /* handled below */
}
- /* evaluate subtrees in order to do binary operation, then keep going */
- t1 = tree_eval(tree->lnode);
- t2 = tree_eval(tree->rnode);
+ /*
+ * 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,8 +962,8 @@ r_tree_eval(register NODE *tree, int iscond)
case Node_notequal:
case Node_equal:
di = cmp_nodes(t1, t2);
- free_temp(t1);
- free_temp(t2);
+ unref(t1);
+ unref(t2);
switch (tree->type) {
case Node_equal:
return tmp_number((AWKNUM) (di == 0));
@@ -985,9 +986,9 @@ r_tree_eval(register NODE *tree, int iscond)
}
x1 = force_number(t1);
- free_temp(t1);
x2 = force_number(t2);
- free_temp(t2);
+ unref(t1);
+ unref(t2);
switch (tree->type) {
case Node_exp:
if ((lx = x2) == x2 && lx >= 0) { /* integer exponent */
@@ -1137,6 +1138,13 @@ cmp_nodes(register NODE *t1, register NODE *t2)
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,17 +1329,14 @@ pop_fcall()
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.
+ * 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 || old_type == Node_array_ref)
+ 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,7 +2018,7 @@ fmt_index(NODE *n)
if (fmt_hiwater >= fmt_num) {
fmt_num *= 2;
- emalloc(fmt_list, NODE **, fmt_num, "fmt_index");
+ erealloc(fmt_list, NODE **, fmt_num * sizeof(*fmt_list), "fmt_index");
}
fmt_list[fmt_hiwater] = dupnode(n);
return fmt_hiwater++;
@@ -2105,6 +2110,10 @@ assign_val(NODE **lhs_p, NODE *rhs)
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 --git a/extension/arrayparm.c b/extension/arrayparm.c
new file mode 100644
index 00000000..9a158676
--- /dev/null
+++ b/extension/arrayparm.c
@@ -0,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 --git a/extension/ordchr.c b/extension/ordchr.c
new file mode 100644
index 00000000..037bfa37
--- /dev/null
+++ b/extension/ordchr.c
@@ -0,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 --git a/extension/readfile.c b/extension/readfile.c
new file mode 100644
index 00000000..8713bc8d
--- /dev/null
+++ b/extension/readfile.c
@@ -0,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 <fcntl.h>
+
+/* 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 --git a/extension/steps b/extension/steps
index 61a9e6eb..8bac5d85 100755
--- a/extension/steps
+++ b/extension/steps
@@ -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 --git a/extension/testarrayparm.awk b/extension/testarrayparm.awk
new file mode 100644
index 00000000..08178f3e
--- /dev/null
+++ b/extension/testarrayparm.awk
@@ -0,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 --git a/extension/testordchr.awk b/extension/testordchr.awk
new file mode 100644
index 00000000..64e53d16
--- /dev/null
+++ b/extension/testordchr.awk
@@ -0,0 +1,6 @@
+BEGIN {
+ extension("./ordchr.so", "dlload")
+
+ print "ord(\"a\") is", ord("a")
+ print "chr(65) is", chr(65)
+}
diff --git a/field.c b/field.c
index 7ce6fd0a..a95ec53b 100644
--- a/field.c
+++ b/field.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc.
+ * 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,17 +315,18 @@ set_NF()
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++) {
+ 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 <= parse_high_water; i++) {
+ for (i = NF + 1; i >= 0 && i <= parse_high_water; i++) {
unref(fields_arr[i]);
getnode(n);
*n = *Null_field;
@@ -356,6 +357,12 @@ re_parse_field(long up_to, /* parse only up to this field number */
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,6 +377,17 @@ re_parse_field(long up_to, /* parse only up to this field number */
&& 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,6 +568,22 @@ null_parse_field(long up_to, /* parse only up to this field number */
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,6 +614,12 @@ sc_parse_field(long up_to, /* parse only up to this field number */
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,9 +644,31 @@ sc_parse_field(long up_to, /* parse only up to this field number */
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 --git a/fixvers b/fixvers
index f7e419b2..0faab9bb 100755
--- a/fixvers
+++ b/fixvers
@@ -3,7 +3,7 @@
# fixvers --- make sure version.c and patchlev.h reflect
# the reality in configure.in
#
-# Copyright (C) 2001 the Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
@@ -26,11 +26,11 @@ line=`grep AM_INIT_AUTOMAKE configure.in`
case $1 in
-v)
- VERS=`echo $line | sed 's/.*, *\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\))/\1.\2/'`
+ 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 cmp version.c version.new
+ if [ -f version.c ] && cmp version.c version.new
then
- :
+ rm version.new
else
mv version.new version.c
fi
@@ -38,11 +38,11 @@ case $1 in
;;
-p)
- LEV=`echo $line | sed 's/.*, *\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\))/\3/'`
+ 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 cmp patchlev.h patchlev.new
+ if [ -f patchlev.h ] && cmp patchlev.h patchlev.new
then
- :
+ rm patchlev.new
else
mv patchlev.new patchlev.h
fi
diff --git a/gawkmisc.c b/gawkmisc.c
index 35e5bf9a..18a6807c 100644
--- a/gawkmisc.c
+++ b/gawkmisc.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc.
+ * 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,6 +31,9 @@
/* 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,6 +51,7 @@
#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 --git a/getopt.c b/getopt.c
index 0ecad382..289d137e 100644
--- a/getopt.c
+++ b/getopt.c
@@ -2,24 +2,24 @@
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
+ 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 Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ 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
- Library General Public License for more details.
+ Lesser 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. */
+ 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 <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
@@ -78,7 +78,7 @@
#ifndef _
/* This is for other GNU distributions with internationalized messages. */
-# if defined HAVE_LIBINTL_H || defined _LIBC
+# if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
# include <libintl.h>
# ifndef _
# define _(msgid) gettext (msgid)
@@ -86,6 +86,13 @@
# else
# define _(msgid) (msgid)
# endif
+# if defined _LIBC && defined USE_IN_LIBIO
+# include <wchar.h>
+# endif
+#endif
+
+#ifndef attribute_hidden
+# define attribute_hidden
#endif
/* This version of `getopt' appears to the caller like standard Unix `getopt'
@@ -131,7 +138,7 @@ int optind = 1;
causes problems with re-calling getopt as programs generally don't
know that. */
-int __getopt_initialized;
+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,41 +257,34 @@ static int first_nonopt;
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
-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) \
+# 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,7 +316,7 @@ exchange (argv)
It leaves the longer segment in the right place overall,
but it consists of two parts that need to be swapped next. */
-#ifdef _LIBC
+#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,9 +420,9 @@ _getopt_initialize (argc, argv, optstring)
else
ordering = PERMUTE;
-#ifdef _LIBC
+#if defined _LIBC && defined USE_NONOPTION_FLAGS
if (posixly_correct == NULL
- && argc == original_argc && argv == original_argv)
+ && argc == __libc_argc && argv == __libc_argv)
{
if (nonoption_flags_max_len == 0)
{
@@ -539,7 +539,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
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
+#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,8 +685,26 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (ambig && !exact)
{
if (print_errors)
- fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
- argv[0], argv[optind]);
+ {
+#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,16 +725,50 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
if (print_errors)
{
+#if defined _LIBC && defined USE_IN_LIBIO
+ char *buf;
+ int n;
+#endif
+
if (argv[optind - 1][1] == '-')
- /* --option */
- fprintf (stderr,
- _("%s: option `--%s' doesn't allow an argument\n"),
- argv[0], pfound->name);
+ {
+ /* --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 */
- fprintf (stderr,
- _("%s: option `%c%s' doesn't allow an argument\n"),
- argv[0], argv[optind - 1][0], pfound->name);
+ {
+ /* +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,9 +784,27 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
else
{
if (print_errors)
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
+ {
+#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,14 +830,45 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
if (print_errors)
{
+#if defined _LIBC && defined USE_IN_LIBIO
+ char *buf;
+ int n;
+#endif
+
if (argv[optind][1] == '-')
- /* --option */
- fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
- argv[0], nextchar);
+ {
+ /* --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 */
- fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
- argv[0], argv[optind][0], nextchar);
+ {
+ /* +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,13 +891,42 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
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. */
- fprintf (stderr, _("%s: illegal option -- %c\n"),
- argv[0], c);
+ {
+ /* 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
- fprintf (stderr, _("%s: invalid option -- %c\n"),
- argv[0], c);
+ {
+#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,8 +955,24 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
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,8 +1018,25 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (ambig && !exact)
{
if (print_errors)
- fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
- argv[0], argv[optind]);
+ {
+#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,9 +1053,27 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
else
{
if (print_errors)
- fprintf (stderr, _("\
+ {
+#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);
+ argv[0], pfound->name);
+#endif
+ }
nextchar += strlen (nextchar);
return '?';
@@ -905,9 +1086,27 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
else
{
if (print_errors)
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
+ {
+#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,9 +1153,25 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
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 --git a/getopt.h b/getopt.h
index 64390209..4283c35b 100644
--- a/getopt.h
+++ b/getopt.h
@@ -1,21 +1,21 @@
/* Declarations for getopt.
- Copyright (C) 1989,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc.
+ 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 Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ 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
- Library General Public License for more details.
+ Lesser 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. */
+ 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,7 +93,7 @@ extern int optopt;
struct option
{
-# if defined __STDC__ && __STDC__
+# if (defined __STDC__ && __STDC__) || defined __cplusplus
const char *name;
# else
char *name;
@@ -137,25 +137,26 @@ struct option
arguments to the option '\0'. This behavior is specific to the GNU
`getopt'. */
-#if defined __STDC__ && __STDC__
+#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);
+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 *);
+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,
+extern int _getopt_internal (int ___argc, char *const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind,
int __long_only);
diff --git a/getopt1.c b/getopt1.c
index 3d264f2d..22a7efbd 100644
--- a/getopt1.c
+++ b/getopt1.c
@@ -4,19 +4,19 @@
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.
+ 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
- Library General Public License for more details.
+ Lesser 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. */
+ 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 <config.h>
diff --git a/gettext.h b/gettext.h
new file mode 100644
index 00000000..1ad714f4
--- /dev/null
+++ b/gettext.h
@@ -0,0 +1,60 @@
+/* Convenience header for conditional use of GNU <libintl.h>.
+ 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 <libintl.h>
+
+#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 --git a/intl/ChangeLog b/intl/ChangeLog
index 19895015..78b57574 100644
--- a/intl/ChangeLog
+++ b/intl/ChangeLog
@@ -1,1086 +1,8 @@
-1998-04-29 Ulrich Drepper <drepper@cygnus.com>
+Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
- * intl/localealias.c (read_alias_file): Use unsigned char for
- local variables. Remove unused variable tp.
- * intl/l10nflist.c (_nl_normalize_codeset): Use unsigned char *
- for type of codeset. For loosing Solaris systems.
- * intl/loadinfo.h: Adapt prototype of _nl_normalize_codeset.
- * intl/bindtextdom.c (BINDTEXTDOMAIN): Don't define local variable
- len if not needed.
- Patches by Jim Meyering.
+ * Release 3.1.1: Release tar file made.
-1998-04-28 Ulrich Drepper <drepper@cygnus.com>
+2002-04-24 GNU <bug-gnu-gettext@gnu.org>
- * loadmsgcat.c (_nl_load_domain): Don't assign the element use_mmap if
- mmap is not supported.
+ * Version 0.11.2 released.
- * hash-string.h: Don't include <values.h>.
-
-1998-04-27 Ulrich Drepper <drepper@cygnus.com>
-
- * textdomain.c: Use strdup is available.
-
- * localealias.c: Define HAVE_MEMPCPY so that we can use this
- function. Define and use semapahores to protect modfication of
- global objects when compiling for glibc. Add code to allow
- freeing alias table.
-
- * l10nflist.c: Don't assume stpcpy not being a macro.
-
- * gettextP.h: Define internal_function macri if not already done.
- Use glibc byte-swap macros instead of defining SWAP when compiled
- for glibc.
- (struct loaded_domain): Add elements to allow unloading.
-
- * Makefile.in (distclean): Don't remove libintl.h here.
-
- * bindtextdomain.c: Carry over changes from glibc. Use strdup if
- available.
-
- * dcgettext.c: Don't assume stpcpy not being a macro. Mark internal
- functions. Add memory freeing code for glibc.
-
- * dgettext.c: Update copyright.
-
- * explodename.c: Include stdlib.h and string.h only if they exist.
- Use strings.h eventually.
-
- * finddomain.c: Mark internal functions. Use strdup if available.
- Add memory freeing code for glibc.
-
-1997-10-10 20:00 Ulrich Drepper <drepper@cygnus.com>
-
- * libgettext.h: Fix dummy textdomain and bindtextdomain macros.
- They should return reasonable values.
- Reported by Tom Tromey <tromey@cygnus.com>.
-
-1997-09-16 03:33 Ulrich Drepper <drepper@cygnus.com>
-
- * libgettext.h: Define PARAMS also to `args' if __cplusplus is defined.
- * intlh.inst.in: Likewise.
- Reported by Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>.
-
- * libintl.glibc: Update from current glibc version.
-
-1997-09-06 02:10 Ulrich Drepper <drepper@cygnus.com>
-
- * intlh.inst.in: Reformat copyright.
-
-1997-08-19 15:22 Ulrich Drepper <drepper@cygnus.com>
-
- * dcgettext.c (DCGETTEXT): Remove wrong comment.
-
-1997-08-16 00:13 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (install-data): Don't change directory to install.
-
-1997-08-01 14:30 Ulrich Drepper <drepper@cygnus.com>
-
- * cat-compat.c: Fix copyright.
-
- * localealias.c: Don't define strchr unless !HAVE_STRCHR.
-
- * loadmsgcat.c: Update copyright. Fix typos.
-
- * l10nflist.c: Don't define strchr unless !HAVE_STRCHR.
- (_nl_make_l10nflist): Handle sponsor and revision correctly.
-
- * gettext.c: Update copyright.
- * gettext.h: Likewise.
- * hash-string.h: Likewise.
-
- * finddomain.c: Remoave dead code. Define strchr only if
- !HAVE_STRCHR.
-
- * explodename.c: Include <sys/types.h>.
-
- * explodename.c: Reformat copyright text.
- (_nl_explode_name): Fix typo.
-
- * dcgettext.c: Define and use __set_errno.
- (guess_category_value): Don't use setlocale if HAVE_LC_MESSAGES is
- not defined.
-
- * bindtextdom.c: Pretty printing.
-
-1997-05-01 02:25 Ulrich Drepper <drepper@cygnus.com>
-
- * dcgettext.c (guess_category_value): Don't depend on
- HAVE_LC_MESSAGES. We don't need the macro here.
- Patch by Bruno Haible <haible@ilog.fr>.
-
- * cat-compat.c (textdomain): DoN't refer to HAVE_SETLOCALE_NULL
- macro. Instead use HAVE_LOCALE_NULL and define it when using
- glibc, as in dcgettext.c.
- Patch by Bruno Haible <haible@ilog.fr>.
-
- * Makefile.in (CPPFLAGS): New variable. Reported by Franc,ois
- Pinard.
-
-Mon Mar 10 06:51:17 1997 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in: Implement handling of libtool.
-
- * gettextP.h: Change data structures for use of generic lowlevel
- i18n file handling.
-
-Wed Dec 4 20:21:18 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * textdomain.c: Put parentheses around arguments of memcpy macro
- definition.
- * localealias.c: Likewise.
- * l10nflist.c: Likewise.
- * finddomain.c: Likewise.
- * bindtextdom.c: Likewise.
- Reported by Thomas Esken.
-
-Mon Nov 25 22:57:51 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * textdomain.c: Move definition of `memcpy` macro to right
- position.
-
-Fri Nov 22 04:01:58 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * finddomain.c [!HAVE_STRING_H && !_LIBC]: Define memcpy using
- bcopy if not already defined. Reported by Thomas Esken.
- * bindtextdom.c: Likewise.
- * l10nflist.c: Likewise.
- * localealias.c: Likewise.
- * textdomain.c: Likewise.
-
-Tue Oct 29 11:10:27 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (libdir): Change to use exec_prefix instead of
- prefix. Reported by Knut-HåvardAksnes <etokna@eto.ericsson.se>.
-
-Sat Aug 31 03:07:09 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * l10nflist.c (_nl_normalize_codeset): We convert to lower case,
- so don't prepend uppercase `ISO' for only numeric arg.
-
-Fri Jul 19 00:15:46 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * l10nflist.c: Move inclusion of argz.h, ctype.h, stdlib.h after
- definition of _GNU_SOURCE. Patch by Roland McGrath.
-
- * Makefile.in (uninstall): Fix another bug with `for' loop and
- empty arguments. Patch by Jim Meyering. Correct name os
- uninstalled files: no intl- prefix anymore.
-
- * Makefile.in (install-data): Again work around shells which
- cannot handle mpty for list. Reported by Jim Meyering.
-
-Sat Jul 13 18:11:35 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (install): Split goal. Now depend on install-exec
- and install-data.
- (install-exec, install-data): New goals. Created from former
- install goal.
- Reported by Karl Berry.
-
-Sat Jun 22 04:58:14 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (MKINSTALLDIRS): New variable. Path to
- mkinstalldirs script.
- (install): use MKINSTALLDIRS variable or if the script is not present
- try to find it in the $top_scrdir).
-
-Wed Jun 19 02:56:56 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * l10nflist.c: Linux libc *partly* includes the argz_* functions.
- Grr. Work around by renaming the static version and use macros
- for renaming.
-
-Tue Jun 18 20:11:17 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * l10nflist.c: Correct presence test macros of __argz_* functions.
-
- * l10nflist.c: Include <argz.h> based on test of it instead when
- __argz_* functions are available.
- Reported by Andreas Schwab.
-
-Thu Jun 13 15:17:44 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * explodename.c, l10nflist.c: Define NULL for dumb systems.
-
-Tue Jun 11 17:05:13 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * intlh.inst.in, libgettext.h (dcgettext): Rename local variable
- result to __result to prevent name clash.
-
- * l10nflist.c, localealias.c, dcgettext.c: Define _GNU_SOURCE to
- get prototype for stpcpy and strcasecmp.
-
- * intlh.inst.in, libgettext.h: Move declaration of
- `_nl_msg_cat_cntr' outside __extension__ block to prevent warning
- from gcc's -Wnested-extern option.
-
-Fri Jun 7 01:58:00 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (install): Remove comment.
-
-Thu Jun 6 17:28:17 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (install): Work around for another Buglix stupidity.
- Always use an `else' close for `if's. Reported by Nelson Beebe.
-
- * Makefile.in (intlh.inst): Correct typo in phony rule.
- Reported by Nelson Beebe.
-
-Thu Jun 6 01:49:52 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * dcgettext.c (read_alias_file): Rename variable alloca_list to
- block_list as the macro calls assume.
- Patch by Eric Backus.
-
- * localealias.c [!HAVE_ALLOCA]: Define alloca as macro using
- malloc.
- (read_alias_file): Rename varriabe alloca_list to block_list as the
- macro calls assume.
- Patch by Eric Backus.
-
- * l10nflist.c: Correct conditional for <argz.h> inclusion.
- Reported by Roland McGrath.
-
- * Makefile.in (all): Depend on all-@USE_INCLUDED_LIBINTL@, not
- all-@USE_NLS@.
-
- * Makefile.in (install): intlh.inst comes from local dir, not
- $(srcdir).
-
- * Makefile.in (intlh.inst): Special handling of this goal. If
- used in gettext, this is really a rul to construct this file. If
- used in any other package it is defined as a .PHONY rule with
- empty body.
-
- * finddomain.c: Extract locale file information handling into
- l10nfile.c. Rename local stpcpy__ function to stpcpy.
-
- * dcgettext.c (stpcpy): Add local definition.
-
- * l10nflist.c: Solve some portability problems. Patches partly by
- Thomas Esken. Add local definition of stpcpy.
-
-Tue Jun 4 02:47:49 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * intlh.inst.in: Don't depend including <locale.h> on
- HAVE_LOCALE_H. Instead configure must rewrite this fiile
- depending on the result of the configure run.
-
- * Makefile.in (install): libintl.inst is now called intlh.inst.
- Add rules for updating intlh.inst from intlh.inst.in.
-
- * libintl.inst: Renamed to intlh.inst.in.
-
- * localealias.c, dcgettext.c [__GNUC__]: Define HAVE_ALLOCA to 1
- because gcc has __buitlin_alloca.
- Reported by Roland McGrath.
-
-Mon Jun 3 00:32:16 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * Makefile.in (installcheck): New goal to fulfill needs of
- automake's distcheck.
-
- * Makefile.in (install): Reorder commands so that VERSION is
- found.
-
- * Makefile.in (gettextsrcdir): Now use subdirectory intl/ in
- @datadir@/gettext.
- (COMSRCS): Add l10nfile.c.
- (OBJECTS): Add l10nfile.o.
- (DISTFILES): Rename to DISTFILE.normal. Remove $(DISTFILES.common).
- (DISTFILE.gettext): Remove $(DISTFILES.common).
- (all-gettext): Remove goal.
- (install): If $(PACKAGE) = gettext install, otherwose do nothing. No
- package but gettext itself should install libintl.h + headers.
- (dist): Extend goal to work for gettext, too.
- (dist-gettext): Remove goal.
-
- * dcgettext.c [!HAVE_ALLOCA]: Define macro alloca by using malloc.
-
-Sun Jun 2 17:33:06 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * loadmsgcat.c (_nl_load_domain): Parameter is now comes from
- find_l10nfile.
-
-Sat Jun 1 02:23:03 1996 Ulrich Drepper <drepper@cygnus.com>
-
- * l10nflist.c (__argz_next): Add definition.
-
- * dcgettext.c [!HAVE_ALLOCA]: Add code for handling missing alloca
- code. Use new l10nfile handling.
-
- * localealias.c [!HAVE_ALLOCA]: Add code for handling missing
- alloca code.
-
- * l10nflist.c: Initial revision.
-
-Tue Apr 2 18:51:18 1996 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (all-gettext): New goal. Same as all-yes.
-
-Thu Mar 28 23:01:22 1996 Karl Eichwalder <ke@ke.central.de>
-
- * Makefile.in (gettextsrcdir): Define using @datadir@.
-
-Tue Mar 26 12:39:14 1996 Ulrich Drepper <drepper@myware>
-
- * finddomain.c: Include <ctype.h>. Reported by Roland McGrath.
-
-Sat Mar 23 02:00:35 1996 Ulrich Drepper <drepper@myware>
-
- * finddomain.c (stpcpy): Rename to stpcpy__ to prevent clashing
- with external declaration.
-
-Sat Mar 2 00:47:09 1996 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (all-no): Rename from all_no.
-
-Sat Feb 17 00:25:59 1996 Ulrich Drepper <drepper@myware>
-
- * gettextP.h [loaded_domain]: Array `successor' must now contain up
- to 63 elements (because of codeset name normalization).
-
- * finddomain.c: Implement codeset name normalization.
-
-Thu Feb 15 04:39:09 1996 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (all): Define to `all-@USE_NLS@'.
- (all-yes, all_no): New goals. `all-no' is noop, `all-yes'
- is former all.
-
-Mon Jan 15 21:46:01 1996 Howard Gayle <howard@hal.com>
-
- * localealias.c (alias_compare): Increment string pointers in loop
- of strcasecmp replacement.
-
-Fri Dec 29 21:16:34 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (install-src): Who commented this goal out ? :-)
-
-Fri Dec 29 15:08:16 1995 Ulrich Drepper <drepper@myware>
-
- * dcgettext.c (DCGETTEXT): Save `errno'. Failing system calls
- should not effect it because a missing catalog is no error.
- Reported by Harald K<o:>nig <koenig@tat.physik.uni-tuebingen.de>.
-
-Tue Dec 19 22:09:13 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (Makefile): Explicitly use $(SHELL) for running
- shell scripts.
-
-Fri Dec 15 17:34:59 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * Makefile.in (install-src): Only install library and header when
- we use the own implementation. Don't do it when using the
- system's gettext or catgets functions.
-
- * dcgettext.c (find_msg): Must not swap domain->hash_size here.
-
-Sat Dec 9 16:24:37 1995 Ulrich Drepper <drepper@myware>
-
- * localealias.c, libintl.inst, libgettext.h, hash-string.h,
- gettextP.h, finddomain.c, dcgettext.c, cat-compat.c:
- Use PARAMS instead of __P. Suggested by Roland McGrath.
-
-Tue Dec 5 11:39:14 1995 Larry Schwimmer <rosebud@cyclone.stanford.edu>
-
- * libgettext.h: Use `#if !defined (_LIBINTL_H)' instead of `#if
- !_LIBINTL_H' because Solaris defines _LIBINTL_H as empty.
-
-Mon Dec 4 15:42:07 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (install-src):
- Install libintl.inst instead of libintl.h.install.
-
-Sat Dec 2 22:51:38 1995 Marcus Daniels <marcus@sysc.pdx.edu>
-
- * cat-compat.c (textdomain):
- Reverse order in which files are tried you load. First
- try local file, when this failed absolute path.
-
-Wed Nov 29 02:03:53 1995 Nelson H. F. Beebe <beebe@math.utah.edu>
-
- * cat-compat.c (bindtextdomain): Add missing { }.
-
-Sun Nov 26 18:21:41 1995 Ulrich Drepper <drepper@myware>
-
- * libintl.inst: Add missing __P definition. Reported by Nelson Beebe.
-
- * Makefile.in:
- Add dummy `all' and `dvi' goals. Reported by Tom Tromey.
-
-Sat Nov 25 16:12:01 1995 Franc,ois Pinard <pinard@iro.umontreal.ca>
-
- * hash-string.h: Capitalize arguments of macros.
-
-Sat Nov 25 12:01:36 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (DISTFILES): Prevent files names longer than 13
- characters. libintl.h.glibc->libintl.glibc,
- libintl.h.install->libintl.inst. Reported by Joshua R. Poulson.
-
-Sat Nov 25 11:31:12 1995 Eric Backus <ericb@lsid.hp.com>
-
- * dcgettext.c: Fix bug in preprocessor conditionals.
-
-Sat Nov 25 02:35:27 1995 Nelson H. F. Beebe <beebe@math.utah.edu>
-
- * libgettext.h: Solaris cc does not understand
- #if !SYMBOL1 && !SYMBOL2. Sad but true.
-
-Thu Nov 23 16:22:14 1995 Ulrich Drepper <drepper@myware>
-
- * hash-string.h (hash_string):
- Fix for machine with >32 bit `unsigned long's.
-
- * dcgettext.c (DCGETTEXT):
- Fix horrible bug in loop for alternative translation.
-
-Thu Nov 23 01:45:29 1995 Ulrich Drepper <drepper@myware>
-
- * po2tbl.sed.in, linux-msg.sed, xopen-msg.sed:
- Some further simplifications in message number generation.
-
-Mon Nov 20 21:08:43 1995 Ulrich Drepper <drepper@myware>
-
- * libintl.h.glibc: Use __const instead of const in prototypes.
-
- * Makefile.in (install-src):
- Install libintl.h.install instead of libintl.h. This
- is a stripped-down version. Suggested by Peter Miller.
-
- * libintl.h.install, libintl.h.glibc: Initial revision.
-
- * localealias.c (_nl_expand_alias, read_alias_file):
- Protect prototypes in type casts by __P.
-
-Tue Nov 14 16:43:58 1995 Ulrich Drepper <drepper@myware>
-
- * hash-string.h: Correct prototype for hash_string.
-
-Sun Nov 12 12:42:30 1995 Ulrich Drepper <drepper@myware>
-
- * hash-string.h (hash_string): Add prototype.
-
- * gettextP.h: Fix copyright.
- (SWAP): Add prototype.
-
-Wed Nov 8 22:56:33 1995 Ulrich Drepper <drepper@myware>
-
- * localealias.c (read_alias_file): Forgot sizeof.
- Avoid calling *printf function. This introduces a big overhead.
- Patch by Roland McGrath.
-
-Tue Nov 7 14:21:08 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c, cat-compat.c: Wrong indentation in #if for stpcpy.
-
- * finddomain.c (stpcpy):
- Define substitution function local. The macro was to flaky.
-
- * cat-compat.c: Fix typo.
-
- * xopen-msg.sed, linux-msg.sed:
- While bringing message number to right place only accept digits.
-
- * linux-msg.sed, xopen-msg.sed: Now that the counter does not have
- leading 0s we don't need to remove them. Reported by Marcus
- Daniels.
-
- * Makefile.in (../po/cat-id-tbl.o): Use $(top_srdir) in
- dependency. Reported by Marcus Daniels.
-
- * cat-compat.c: (stpcpy) [!_LIBC && !HAVE_STPCPY]: Define replacement.
- Generally cleanup using #if instead of #ifndef.
-
- * Makefile.in: Correct typos in comment. By Franc,ois Pinard.
-
-Mon Nov 6 00:27:02 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (install-src): Don't install libintl.h and libintl.a
- if we use an available gettext implementation.
-
-Sun Nov 5 22:02:08 1995 Ulrich Drepper <drepper@myware>
-
- * libgettext.h: Fix typo: HAVE_CATGETTS -> HAVE_CATGETS. Reported
- by Franc,ois Pinard.
-
- * libgettext.h: Use #if instead of #ifdef/#ifndef.
-
- * finddomain.c:
- Comments describing what has to be done should start with FIXME.
-
-Sun Nov 5 19:38:01 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (DISTFILES): Split. Use DISTFILES with normal meaning.
- DISTFILES.common names the files common to both dist goals.
- DISTFILES.gettext are the files only distributed in GNU gettext.
-
-Sun Nov 5 17:32:54 1995 Ulrich Drepper <drepper@myware>
-
- * dcgettext.c (DCGETTEXT): Correct searching in derived locales.
- This was necessary since a change in _nl_find_msg several weeks
- ago. I really don't know this is still not fixed.
-
-Sun Nov 5 12:43:12 1995 Ulrich Drepper <drepper@myware>
-
- * loadmsgcat.c (_nl_load_domain): Test for FILENAME == NULL. This
- might mark a special condition.
-
- * finddomain.c (make_entry_rec): Don't make illegal entry as decided.
-
- * Makefile.in (dist): Suppress error message when ln failed.
- Get files from $(srcdir) explicitly.
-
- * libgettext.h (gettext_const): Rename to gettext_noop.
-
-Fri Nov 3 07:36:50 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c (make_entry_rec):
- Protect against wrong locale names by testing mask.
-
- * libgettext.h (gettext_const): Add macro definition.
- Capitalize macro arguments.
-
-Thu Nov 2 23:15:51 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c (_nl_find_domain):
- Test for pointer != NULL before accessing value.
- Reported by Tom Tromey.
-
- * gettext.c (NULL):
- Define as (void*)0 instad of 0. Reported by Franc,ois Pinard.
-
-Mon Oct 30 21:28:52 1995 Ulrich Drepper <drepper@myware>
-
- * po2tbl.sed.in: Serious typo bug fixed by Jim Meyering.
-
-Sat Oct 28 23:20:47 1995 Ulrich Drepper <drepper@myware>
-
- * libgettext.h: Disable dcgettext optimization for Solaris 2.3.
-
- * localealias.c (alias_compare):
- Peter Miller reported that tolower in some systems is
- even dumber than I thought. Protect call by `isupper'.
-
-Fri Oct 27 22:22:51 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (libdir, includedir): New variables.
- (install-src): Install libintl.a and libintl.h in correct dirs.
-
-Fri Oct 27 22:07:29 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (SOURCES): Fix typo: intrl.compat.c -> intl-compat.c.
-
- * po2tbl.sed.in: Patch for buggy SEDs by Christian von Roques.
-
- * localealias.c:
- Fix typo and superflous test. Reported by Christian von Roques.
-
-Fri Oct 6 11:52:05 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c (_nl_find_domain):
- Correct some remainder from the pre-CEN syntax. Now
- we don't have a constant number of successors anymore.
-
-Wed Sep 27 21:41:13 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (DISTFILES): Add libintl.h.glibc.
-
- * Makefile.in (dist-libc): Add goal for packing sources for glibc.
- (COMSRCS, COMHDRS): Splitted to separate sources shared with glibc.
-
- * loadmsgcat.c: Forget to continue #if line.
-
- * localealias.c:
- [_LIBC]: Rename strcasecmp to __strcasecmp to keep ANSI C name
- space clean.
-
- * dcgettext.c, finddomain.c: Better comment to last change.
-
- * loadmsgcat.c:
- [_LIBC]: Rename fstat, open, close, read, mmap, and munmap to
- __fstat, __open, __close, __read, __mmap, and __munmap resp
- to keep ANSI C name space clean.
-
- * finddomain.c:
- [_LIBC]: Rename stpcpy to __stpcpy to keep ANSI C name space clean.
-
- * dcgettext.c:
- [_LIBC]: Rename getced and stpcpy to __getcwd and __stpcpy resp to
- keep ANSI C name space clean.
-
- * libgettext.h:
- Include sys/types.h for those old SysV systems out there.
- Reported by Francesco Potorti`.
-
- * loadmsgcat.c (use_mmap): Define if compiled for glibc.
-
- * bindtextdom.c: Include all those standard headers
- unconditionally if _LIBC is defined.
-
- * finddomain.c: Fix 2 times defiend -> defined.
-
- * textdomain.c: Include libintl.h instead of libgettext.h when
- compiling for glibc. Include all those standard headers
- unconditionally if _LIBC is defined.
-
- * localealias.c, loadmsgcat.c: Prepare to be compiled in glibc.
-
- * gettext.c:
- Include libintl.h instead of libgettext.h when compiling for glibc.
- Get NULL from stddef.h if we compile for glibc.
-
- * finddomain.c: Include libintl.h instead of libgettext.h when
- compiling for glibc. Include all those standard headers
- unconditionally if _LIBC is defined.
-
- * dcgettext.c: Include all those standard headers unconditionally
- if _LIBC is defined.
-
- * dgettext.c: If compiled in glibc include libintl.h instead of
- libgettext.h.
- (locale.h): Don't rely on HAVE_LOCALE_H when compiling for glibc.
-
- * dcgettext.c: If compiled in glibc include libintl.h instead of
- libgettext.h.
- (getcwd): Don't rely on HAVE_GETCWD when compiling for glibc.
-
- * bindtextdom.c:
- If compiled in glibc include libintl.h instead of libgettext.h.
-
-Mon Sep 25 22:23:06 1995 Ulrich Drepper <drepper@myware>
-
- * localealias.c (_nl_expand_alias): Don't call bsearch if NMAP <= 0.
- Reported by Marcus Daniels.
-
- * cat-compat.c (bindtextdomain):
- String used in putenv must not be recycled.
- Reported by Marcus Daniels.
-
- * libgettext.h (__USE_GNU_GETTEXT):
- Additional symbol to signal that we use GNU gettext
- library.
-
- * cat-compat.c (bindtextdomain):
- Fix bug with the strange stpcpy replacement.
- Reported by Nelson Beebe.
-
-Sat Sep 23 08:23:51 1995 Ulrich Drepper <drepper@myware>
-
- * cat-compat.c: Include <string.h> for stpcpy prototype.
-
- * localealias.c (read_alias_file):
- While expand strdup code temporary variable `cp' hided
- higher level variable with same name. Rename to `tp'.
-
- * textdomain.c (textdomain):
- Avoid warning by using temporary variable in strdup code.
-
- * finddomain.c (_nl_find_domain): Remove unused variable `application'.
-
-Thu Sep 21 15:51:44 1995 Ulrich Drepper <drepper@myware>
-
- * localealias.c (alias_compare):
- Use strcasecmp() only if available. Else use
- implementation in place.
-
- * intl-compat.c:
- Wrapper functions now call *__ functions instead of __*.
-
- * libgettext.h: Declare prototypes for *__ functions instead for __*.
-
- * cat-compat.c, loadmsgcat.c:
- Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
- of the standard libc and so prevent libintl.a from being used
- standalone.
-
- * bindtextdom.c:
- Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
- of the standard libc and so prevent libintl.a from being used
- standalone.
- Rename to bindtextdomain__ if not used in GNU C Library.
-
- * dgettext.c:
- Rename function to dgettext__ if not used in GNU C Library.
-
- * gettext.c:
- Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
- of the standard libc and so prevent libintl.a from being used
- standalone.
- Functions now called gettext__ if not used in GNU C Library.
-
- * dcgettext.c, localealias.c, textdomain.c, finddomain.c:
- Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
- of the standard libc and so prevent libintl.a from being used
- standalone.
-
-Sun Sep 17 23:14:49 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c: Correct some bugs in handling of CEN standard
- locale definitions.
-
-Thu Sep 7 01:49:28 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c: Implement CEN syntax.
-
- * gettextP.h (loaded_domain): Extend number of successors to 31.
-
-Sat Aug 19 19:25:29 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (aliaspath): Remove path to X11 locale dir.
-
- * Makefile.in: Make install-src depend on install. This helps
- gettext to install the sources and other packages can use the
- install goal.
-
-Sat Aug 19 15:19:33 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (uninstall): Remove stuff installed by install-src.
-
-Tue Aug 15 13:13:53 1995 Ulrich Drepper <drepper@myware>
-
- * VERSION.in: Initial revision.
-
- * Makefile.in (DISTFILES):
- Add VERSION file. This is not necessary for gettext, but
- for other packages using this library.
-
-Tue Aug 15 06:16:44 1995 Ulrich Drepper <drepper@myware>
-
- * gettextP.h (_nl_find_domain):
- New prototype after changing search strategy.
-
- * finddomain.c (_nl_find_domain):
- We now try only to find a specified catalog. Fall back to other
- catalogs listed in the locale list is now done in __dcgettext.
-
- * dcgettext.c (__dcgettext):
- Now we provide message fall back even to different languages.
- I.e. if a message is not available in one language all the other
- in the locale list a tried. Formerly fall back was only possible
- within one language. Implemented by moving one loop from
- _nl_find_domain to here.
-
-Mon Aug 14 23:45:50 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (gettextsrcdir):
- Directory where source of GNU gettext library are made
- available.
- (INSTALL, INSTALL_DATA): Programs used for installing sources.
- (gettext-src): New. Rule to install GNU gettext sources for use in
- gettextize shell script.
-
-Sun Aug 13 14:40:48 1995 Ulrich Drepper <drepper@myware>
-
- * loadmsgcat.c (_nl_load_domain):
- Use mmap for loading only when munmap function is
- also available.
-
- * Makefile.in (install): Depend on `all' goal.
-
-Wed Aug 9 11:04:33 1995 Ulrich Drepper <drepper@myware>
-
- * localealias.c (read_alias_file):
- Do not overwrite '\n' when terminating alias value string.
-
- * localealias.c (read_alias_file):
- Handle long lines. Ignore the rest not fitting in
- the buffer after the initial `fgets' call.
-
-Wed Aug 9 00:54:29 1995 Ulrich Drepper <drepper@myware>
-
- * gettextP.h (_nl_load_domain):
- Add prototype, replacing prototype for _nl_load_msg_cat.
-
- * finddomain.c (_nl_find_domain):
- Remove unneeded variable filename and filename_len.
- (expand_alias): Remove prototype because functions does not
- exist anymore.
-
- * localealias.c (read_alias_file):
- Change type of fname_len parameter to int.
- (xmalloc): Add prototype.
-
- * loadmsgcat.c: Better prototypes for xmalloc.
-
-Tue Aug 8 22:30:39 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c (_nl_find_domain):
- Allow alias name to be constructed from the four components.
-
- * Makefile.in (aliaspath): New variable. Set to preliminary value.
- (SOURCES): Add localealias.c.
- (OBJECTS): Add localealias.o.
-
- * gettextP.h: Add prototype for _nl_expand_alias.
-
- * finddomain.c: Aliasing handled in intl/localealias.c.
-
- * localealias.c: Aliasing for locale names.
-
- * bindtextdom.c: Better prototypes for xmalloc and xstrdup.
-
-Mon Aug 7 23:47:42 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (DISTFILES): gettext.perl is now found in misc/.
-
- * cat-compat.c (bindtextdomain):
- Correct implementation. dirname parameter was not used.
- Reported by Marcus Daniels.
-
- * gettextP.h (loaded_domain):
- New fields `successor' and `decided' for oo, lazy
- message handling implementation.
-
- * dcgettext.c:
- Adopt for oo, lazy message handliing.
- Now we can inherit translations from less specific locales.
- (find_msg): New function.
-
- * loadmsgcat.c, finddomain.c:
- Complete rewrite. Implement oo, lazy message handling :-).
- We now have an additional environment variable `LANGUAGE' with
- a higher priority than LC_ALL for the LC_MESSAGE locale.
- Here we can set a colon separated list of specifications each
- of the form `language[_territory[.codeset]][@modifier]'.
-
-Sat Aug 5 09:55:42 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c (unistd.h):
- Include to get _PC_PATH_MAX defined on system having it.
-
-Fri Aug 4 22:42:00 1995 Ulrich Drepper <drepper@myware>
-
- * finddomain.c (stpcpy): Include prototype.
-
- * Makefile.in (dist): Remove `copying instead' message.
-
-Wed Aug 2 18:52:03 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (ID, TAGS): Do not use $^.
-
-Tue Aug 1 20:07:11 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (TAGS, ID): Use $^ as command argument.
- (TAGS): Give etags -o option t write to current directory,
- not $(srcdir).
- (ID): Use $(srcdir) instead os $(top_srcdir)/src.
- (distclean): Remove ID.
-
-Sun Jul 30 11:51:46 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (gnulocaledir):
- New variable, always using share/ for data directory.
- (DEFS): Add GNULOCALEDIR, used in finddomain.c.
-
- * finddomain.c (_nl_default_dirname):
- Set to GNULOCALEDIR, because it always has to point
- to the directory where GNU gettext Library writes it to.
-
- * intl-compat.c (textdomain, bindtextdomain):
- Undefine macros before function definition.
-
-Sat Jul 22 01:10:02 1995 Ulrich Drepper <drepper@myware>
-
- * libgettext.h (_LIBINTL_H):
- Protect definition in case where this file is included as
- libgettext.h on Solaris machines. Add comment about this.
-
-Wed Jul 19 02:36:42 1995 Ulrich Drepper <drepper@myware>
-
- * intl-compat.c (textdomain): Correct typo.
-
-Wed Jul 19 01:51:35 1995 Ulrich Drepper <drepper@myware>
-
- * dcgettext.c (dcgettext): Function now called __dcgettext.
-
- * dgettext.c (dgettext): Now called __dgettext and calls
- __dcgettext.
-
- * gettext.c (gettext):
- Function now called __gettext and calls __dgettext.
-
- * textdomain.c (textdomain): Function now called __textdomain.
-
- * bindtextdom.c (bindtextdomain): Function now called
- __bindtextdomain.
-
- * intl-compat.c: Initial revision.
-
- * Makefile.in (SOURCES): Add intl-compat.c.
- (OBJECTS): We always compile the GNU gettext library functions.
- OBJECTS contains all objects but cat-compat.o, ../po/cat-if-tbl.o,
- and intl-compat.o.
- (GETTOBJS): Contains now only intl-compat.o.
-
- * libgettext.h:
- Re-include protection matches dualistic character of libgettext.h.
- For all functions in GNU gettext library define __ counter part.
-
- * finddomain.c (strchr): Define as index if not found in C library.
- (_nl_find_domain): For relative paths paste / in between.
-
-Tue Jul 18 16:37:45 1995 Ulrich Drepper <drepper@myware>
-
- * loadmsgcat.c, finddomain.c: Add inclusion of sys/types.h.
-
- * xopen-msg.sed: Fix bug with `msgstr ""' lines.
- A little bit better comments.
-
-Tue Jul 18 01:18:27 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in:
- po-mode.el, makelinks, combine-sh are now found in ../misc.
-
- * po-mode.el, makelinks, combine-sh, elisp-comp:
- Moved to ../misc/.
-
- * libgettext.h, gettextP.h, gettext.h: Uniform test for __STDC__.
-
-Sun Jul 16 22:33:02 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (INSTALL, INSTALL_DATA): New variables.
- (install-data, uninstall): Install/uninstall .elc file.
-
- * po-mode.el (Installation comment):
- Add .pox as possible extension of .po files.
-
-Sun Jul 16 13:23:27 1995 Ulrich Drepper <drepper@myware>
-
- * elisp-comp: Complete new version by Franc,ois: This does not
- fail when not compiling in the source directory.
-
-Sun Jul 16 00:12:17 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (../po/cat-id-tbl.o):
- Use $(MAKE) instead of make for recursive make.
-
- * Makefile.in (.el.elc): Use $(SHELL) instead of /bin/sh.
- (install-exec): Add missing dummy goal.
- (install-data, uninstall): @ in multi-line shell command at
- beginning, not in front of echo. Reported by Eric Backus.
-
-Sat Jul 15 00:21:28 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (DISTFILES):
- Rename libgettext.perl to gettext.perl to fit in 14 chars
- file systems.
-
- * gettext.perl:
- Rename to gettext.perl to fit in 14 chars file systems.
-
-Thu Jul 13 23:17:20 1995 Ulrich Drepper <drepper@myware>
-
- * cat-compat.c: If !STDC_HEADERS try to include malloc.h.
-
-Thu Jul 13 20:55:02 1995 Ulrich Drepper <drepper@myware>
-
- * po2tbl.sed.in: Pretty printing.
-
- * linux-msg.sed, xopen-msg.sed:
- Correct bugs with handling substitute flags in branches.
-
- * hash-string.h (hash_string):
- Old K&R compilers don't under stand `unsigned char'.
-
- * gettext.h (nls_uint32):
- Some old K&R compilers (eg HP) don't understand `unsigned int'.
-
- * cat-compat.c (msg_to_cat_id): De-ANSI-fy prototypes.
-
-Thu Jul 13 01:34:33 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (ELCFILES): New variable.
- (DISTFILES): Add elisp-comp.
- Add implicit rule for .el -> .elc compilation.
- (install-data): install $ELCFILES
- (clean): renamed po-to-tbl and po-to-msg to po2tbl and po2msg resp.
-
- * elisp-comp: Initial revision
-
-Wed Jul 12 16:14:52 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in:
- cat-id-tbl.c is now found in po/. This enables us to use an identical
- intl/ directory in all packages.
-
- * dcgettext.c (dcgettext): hashing does not work for table size <= 2.
-
- * textdomain.c: fix typo (#if def -> #if defined)
-
-Tue Jul 11 18:44:43 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in (stamp-cat-id): use top_srcdir to address source files
- (DISTFILES,distclean): move tupdate.perl to src/
-
- * po-to-tbl.sed.in:
- add additional jump to clear change flag to recognize multiline strings
-
-Tue Jul 11 01:32:50 1995 Ulrich Drepper <drepper@myware>
-
- * textdomain.c: Protect inclusion of stdlib.h and string.h.
-
- * loadmsgcat.c: Protect inclusion of stdlib.h.
-
- * libgettext.h: Protect inclusion of locale.h.
- Allow use in C++ programs.
- Define NULL is not happened already.
-
- * Makefile.in (DISTFILES): ship po-to-tbl.sed.in instead of
- po-to-tbl.sed.
- (distclean): remove po-to-tbl.sed and tupdate.perl.
-
- * tupdate.perl.in: Substitute Perl path even in exec line.
- Don't include entries without translation from old .po file.
-
-Tue Jul 4 00:41:51 1995 Ulrich Drepper <drepper@myware>
-
- * tupdate.perl.in: use "Updated: " in msgid "".
-
- * cat-compat.c: Fix typo (LOCALDIR -> LOCALEDIR).
- Define getenv if !__STDC__.
-
- * bindtextdom.c: Protect stdlib.h and string.h inclusion.
- Define free if !__STDC__.
-
- * finddomain.c: Change DEF_MSG_DOM_DIR to LOCALEDIR.
- Define free if !__STDC__.
-
- * cat-compat.c: Change DEF_MSG_DOM_DIR to LOCALEDIR.
-
-Mon Jul 3 23:56:30 1995 Ulrich Drepper <drepper@myware>
-
- * Makefile.in: Use LOCALEDIR instead of DEF_MSG_DOM_DIR.
- Remove unneeded $(srcdir) from Makefile.in dependency.
-
- * makelinks: Add copyright and short description.
-
- * po-mode.el: Last version for 0.7.
-
- * tupdate.perl.in: Fix die message.
-
- * dcgettext.c: Protect include of string.h.
-
- * gettext.c: Protect include of stdlib.h and further tries to get NULL.
-
- * finddomain.c: Some corrections in includes.
-
- * Makefile.in (INCLUDES): Prune list correct path to Makefile.in.
-
- * po-to-tbl.sed: Adopt for new .po file format.
-
- * linux-msg.sed, xopen-msg.sed: Adopt for new .po file format.
-
-Sun Jul 2 23:55:03 1995 Ulrich Drepper <drepper@myware>
-
- * tupdate.perl.in: Complete rewrite for new .po file format.
-
-Sun Jul 2 02:06:50 1995 Ulrich Drepper <drepper@myware>
-
- * First official release. This directory contains all the code
- needed to internationalize own packages. It provides functions
- which allow to use the X/Open catgets function with an interface
- like the Uniforum gettext function. For system which does not
- have neither of those a complete implementation is provided.
diff --git a/intl/Makefile.in b/intl/Makefile.in
index 423a5a21..5b1cf2f2 100644
--- a/intl/Makefile.in
+++ b/intl/Makefile.in
@@ -1,19 +1,20 @@
# Makefile for directory with message catalog handling in GNU NLS Utilities.
-# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+# 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 General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
+# 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 General Public License for more details.
+# 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.
+# 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@
@@ -28,75 +29,107 @@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
transform = @program_transform_name@
-libdir = $(exec_prefix)/lib
-includedir = $(prefix)/include
-datadir = $(prefix)/@DATADIRNAME@
+libdir = @libdir@
+includedir = @includedir@
+datadir = @datadir@
localedir = $(datadir)/locale
-gnulocaledir = $(prefix)/share/locale
-gettextsrcdir = @datadir@/gettext/intl
-aliaspath = $(localedir):.
+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 = @l@
+l = @INTL_LIBTOOL_SUFFIX_PREFIX@
AR = ar
CC = @CC@
LIBTOOL = @LIBTOOL@
RANLIB = @RANLIB@
+YACC = @INTLBISON@ -y -d
+YFLAGS = --name-prefix=__gettext
-DEFS = -DLOCALEDIR=\"$(localedir)\" -DGNULOCALEDIR=\"$(gnulocaledir)\" \
--DLOCALE_ALIAS_PATH=\"$(aliaspath)\" @DEFS@
+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) libgettext.h loadinfo.h
-COMHDRS = gettext.h gettextP.h hash-string.h
-SOURCES = $(COMSRCS) intl-compat.c cat-compat.c
+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
+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
-CATOBJS = cat-compat.$lo ../po/cat-id-tbl.$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 = ChangeLog Makefile.in linux-msg.sed po2tbl.sed.in \
-xopen-msg.sed $(HEADERS) $(SOURCES)
+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 = libintl.glibc intlh.inst.in
+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 .o .lo
+.SUFFIXES: .c .y .o .lo .sin .sed
.c.o:
$(COMPILE) $<
.c.lo:
$(LIBTOOL) --mode=compile $(COMPILE) $<
-INCLUDES = -I$(top_srcdir) -I.. -I. -I$(top_srcdir)/intl -I$(top_srcdir)/lib
+.y.c:
+ $(YACC) $(YFLAGS) --output $@ $<
+ rm -f $*.h
-all: all-@USE_INCLUDED_LIBINTL@
+.sin.sed:
+ sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@
+ mv t-$@ $@
+
+INCLUDES = -I.. -I. -I$(top_srcdir)/intl
-all-yes: libintl.$la intlh.inst
-all-no:
+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: $(OBJECTS)
+libintl.a libgnuintl.a: $(OBJECTS)
rm -f $@
$(AR) cru $@ $(OBJECTS)
$(RANLIB) $@
-libintl.la: $(OBJECTS)
- $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(OBJECTS) \
- -version-info 1:0 -rpath $(libdir)
+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
-../po/cat-id-tbl.$lo: ../po/cat-id-tbl.c $(top_srcdir)/po/$(PACKAGE).pot
- cd ../po && $(MAKE) cat-id-tbl.$lo
+libintl.h: libgnuintl.h
+ cp $(srcdir)/libgnuintl.h libintl.h
+
+charset.alias: config.charset
+ $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
+ mv t-$@ $@
check: all
@@ -104,37 +137,92 @@ check: all
# 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 gettext() function in its C library or in a
-# separate library or use the catgets interface. A special case is
-# where configure found a previously installed GNU gettext library.
+# 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 \
- if test -r $(MKINSTALLDIRS); then \
- $(MKINSTALLDIRS) $(libdir) $(includedir); \
+ $(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 \
- $(top_srcdir)/mkinstalldirs $(libdir) $(includedir); \
+ if test @GLIBC21@ = no; then \
+ orig=charset.alias; \
+ sed -f ref-add.sed $$orig > $$temp; \
+ $(INSTALL_DATA) $$temp $$dest; \
+ rm -f $$temp; \
+ fi; \
fi; \
- $(INSTALL_DATA) intlh.inst $(includedir)/libintl.h; \
- $(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \
+ $(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 \
- if test -r $(MKINSTALLDIRS); then \
- $(MKINSTALLDIRS) $(gettextsrcdir); \
- else \
- $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
- fi; \
- $(INSTALL_DATA) VERSION $(gettextsrcdir)/VERSION; \
- dists="$(DISTFILES.common)"; \
+ $(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 \
- $(INSTALL_DATA) $(srcdir)/$$file $(gettextsrcdir)/$$file; \
+ 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
@@ -143,10 +231,43 @@ install-data: all
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 \
- dists="$(DISTFILES.common)"; \
- for file in $$dists; do \
- rm -f $(gettextsrcdir)/$$file; \
+ 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 \
: ; \
@@ -154,9 +275,12 @@ uninstall:
info dvi:
-$(OBJECTS): ../config.h libgettext.h
-bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
-dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
+$(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
@@ -170,12 +294,19 @@ ID: $(HEADERS) $(SOURCES)
mostlyclean:
- rm -f *.a *.o *.lo core core.*
+ 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 po2msg.sed po2tbl.sed
+ 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;"
@@ -185,34 +316,22 @@ maintainer-clean: distclean
# 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 $(DISTFILES)
+dist distdir: Makefile
if test "$(PACKAGE)" = gettext; then \
additional="$(DISTFILES.gettext)"; \
else \
additional="$(DISTFILES.normal)"; \
fi; \
- for file in $(DISTFILES.common) $$additional; do \
- ln $(srcdir)/$$file $(distdir) 2> /dev/null \
- || cp -p $(srcdir)/$$file $(distdir); \
+ $(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
-dist-libc:
- tar zcvf intl-glibc.tar.gz $(COMSRCS) $(COMHDRS) libintl.h.glibc
-
Makefile: Makefile.in ../config.status
cd .. \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-# The dependency for intlh.inst is different in gettext and all other
-# packages. Because we cannot you GNU make features we have to solve
-# the problem while rewriting Makefile.in.
-@GT_YES@intlh.inst: intlh.inst.in ../config.status
-@GT_YES@ cd .. \
-@GT_YES@ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
-@GT_YES@ $(SHELL) ./config.status
-@GT_NO@.PHONY: intlh.inst
-@GT_NO@intlh.inst:
-
# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/intl/VERSION b/intl/VERSION
index ee66b061..657e73b6 100644
--- a/intl/VERSION
+++ b/intl/VERSION
@@ -1 +1 @@
-GNU gettext library from gettext-0.10.35
+GNU gettext library from gettext-0.11.2
diff --git a/intl/bindtextdom.c b/intl/bindtextdom.c
index d9c3f349..a3c233d7 100644
--- a/intl/bindtextdom.c
+++ b/intl/bindtextdom.c
@@ -1,50 +1,58 @@
/* Implementation of the bindtextdomain(3) function
- Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ 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 General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ 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 General Public License for more details.
+ 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. */
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#else
-# ifdef HAVE_MALLOC_H
-# include <malloc.h>
-# else
-void free ();
-# endif
-#endif
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
-#if defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
+#ifdef _LIBC
+# include <libintl.h>
#else
-# include <strings.h>
-# ifndef memcpy
-# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
-# endif
+# include "libgnuintl.h"
#endif
+#include "gettextP.h"
#ifdef _LIBC
-# include <libintl.h>
+/* We have to handle multi-threaded applications. */
+# include <bits/libc-lock.h>
#else
-# include "libgettext.h"
+/* Provide dummy implementation if this is outside glibc. */
+# define __libc_rwlock_define(CLASS, NAME)
+# define __libc_rwlock_wrlock(NAME)
+# define __libc_rwlock_unlock(NAME)
+#endif
+
+/* The internal variables in the standalone libintl.a must have different
+ names than the internal variables in GNU libc, otherwise programs
+ using libintl.a cannot be linked statically. */
+#if !defined _LIBC
+# define _nl_default_dirname _nl_default_dirname__
+# define _nl_domain_bindings _nl_domain_bindings__
+#endif
+
+/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */
+#ifndef offsetof
+# define offsetof(type,ident) ((size_t)&(((type*)0)->ident))
#endif
-#include "gettext.h"
-#include "gettextP.h"
/* @@ end of prolog @@ */
@@ -54,6 +62,9 @@ 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
@@ -61,25 +72,48 @@ extern struct binding *_nl_domain_bindings;
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
-/* Specify that the DOMAINNAME message catalog will be found
- in DIRNAME rather than in the system locale data base. */
-char *
-BINDTEXTDOMAIN (domainname, dirname)
+/* 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 *dirname;
+ const char **dirnamep;
+ const char **codesetp;
{
struct binding *binding;
+ int modified;
/* Some sanity checks. */
if (domainname == NULL || domainname[0] == '\0')
- return NULL;
+ {
+ 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)
{
@@ -95,83 +129,173 @@ BINDTEXTDOMAIN (domainname, dirname)
}
}
- if (dirname == NULL)
- /* The current binding has be to returned. */
- return binding == NULL ? (char *) _nl_default_dirname : binding->dirname;
-
if (binding != NULL)
{
- /* The domain is already bound. If the new value and the old
- one are equal we simply do nothing. Otherwise replace the
- old binding. */
- if (strcmp (dirname, binding->dirname) != 0)
+ if (dirnamep)
{
- char *new_dirname;
+ const char *dirname = *dirnamep;
- if (strcmp (dirname, _nl_default_dirname) == 0)
- new_dirname = (char *) _nl_default_dirname;
+ 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
- new_dirname = strdup (dirname);
- if (new_dirname == NULL)
- return NULL;
+ result = strdup (dirname);
#else
- size_t len = strlen (dirname) + 1;
- new_dirname = (char *) malloc (len);
- if (new_dirname == NULL)
- return NULL;
-
- memcpy (new_dirname, dirname, len);
+ 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 (binding->dirname != _nl_default_dirname)
- free (binding->dirname);
+ if (codesetp)
+ {
+ const char *codeset = *codesetp;
- binding->dirname = new_dirname;
+ 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. */
-#if !defined _LIBC && !defined HAVE_STRDUP
- size_t len;
-#endif
+ size_t len = strlen (domainname) + 1;
struct binding *new_binding =
- (struct binding *) malloc (sizeof (*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 (new_binding == NULL)
- return NULL;
+ 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
- new_binding->domainname = strdup (domainname);
- if (new_binding->domainname == NULL)
- return NULL;
+ result = strdup (dirname);
+ if (__builtin_expect (result == NULL, 0))
+ goto failed_dirname;
#else
- len = strlen (domainname) + 1;
- new_binding->domainname = (char *) malloc (len);
- if (new_binding->domainname == NULL)
- return NULL;
- memcpy (new_binding->domainname, domainname, len);
+ size_t len = strlen (dirname) + 1;
+ result = (char *) malloc (len);
+ if (__builtin_expect (result == NULL, 0))
+ goto failed_dirname;
+ memcpy (result, dirname, len);
#endif
-
- if (strcmp (dirname, _nl_default_dirname) == 0)
- new_binding->dirname = (char *) _nl_default_dirname;
+ 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
- new_binding->dirname = strdup (dirname);
- if (new_binding->dirname == NULL)
- return NULL;
+ result = strdup (codeset);
+ if (__builtin_expect (result == NULL, 0))
+ goto failed_codeset;
#else
- len = strlen (dirname) + 1;
- new_binding->dirname = (char *) malloc (len);
- if (new_binding->dirname == NULL)
- return NULL;
- memcpy (new_binding->dirname, dirname, len);
+ 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
@@ -191,13 +315,55 @@ BINDTEXTDOMAIN (domainname, dirname)
binding->next = new_binding;
}
- binding = 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;
+ }
}
- return binding->dirname;
+ /* 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
-/* Alias for function name in GNU C Library. */
+/* Aliases for function names in GNU C Library. */
weak_alias (__bindtextdomain, bindtextdomain);
+weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset);
#endif
diff --git a/intl/cat-compat.c b/intl/cat-compat.c
deleted file mode 100644
index 867d901b..00000000
--- a/intl/cat-compat.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/* Compatibility code for gettext-using-catgets interface.
- Copyright (C) 1995, 1997 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. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <string.h>
-#else
-char *getenv ();
-# ifdef HAVE_MALLOC_H
-# include <malloc.h>
-# endif
-#endif
-
-#ifdef HAVE_NL_TYPES_H
-# include <nl_types.h>
-#endif
-
-#include "libgettext.h"
-
-/* @@ end of prolog @@ */
-
-/* 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. And even worse: POSIX
- defines this not at all. So we can use this feature only on selected
- system (e.g. those using GNU C Library). */
-#ifdef _LIBC
-# define HAVE_LOCALE_NULL
-#endif
-
-/* The catalog descriptor. */
-static nl_catd catalog = (nl_catd) -1;
-
-/* Name of the default catalog. */
-static const char default_catalog_name[] = "messages";
-
-/* Name of currently used catalog. */
-static const char *catalog_name = default_catalog_name;
-
-/* Get ID for given string. If not found return -1. */
-static int msg_to_cat_id PARAMS ((const char *msg));
-
-/* Substitution for systems lacking this function in their C library. */
-#if !_LIBC && !HAVE_STPCPY
-static char *stpcpy PARAMS ((char *dest, const char *src));
-#endif
-
-
-/* Set currently used domain/catalog. */
-char *
-textdomain (domainname)
- const char *domainname;
-{
- nl_catd new_catalog;
- char *new_name;
- size_t new_name_len;
- char *lang;
-
-#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES \
- && defined HAVE_LOCALE_NULL
- lang = setlocale (LC_MESSAGES, NULL);
-#else
- lang = getenv ("LC_ALL");
- if (lang == NULL || lang[0] == '\0')
- {
- lang = getenv ("LC_MESSAGES");
- if (lang == NULL || lang[0] == '\0')
- lang = getenv ("LANG");
- }
-#endif
- if (lang == NULL || lang[0] == '\0')
- lang = "C";
-
- /* See whether name of currently used domain is asked. */
- if (domainname == NULL)
- return (char *) catalog_name;
-
- if (domainname[0] == '\0')
- domainname = default_catalog_name;
-
- /* Compute length of added path element. */
- new_name_len = sizeof (LOCALEDIR) - 1 + 1 + strlen (lang)
- + sizeof ("/LC_MESSAGES/") - 1 + sizeof (PACKAGE) - 1
- + sizeof (".cat");
-
- new_name = (char *) malloc (new_name_len);
- if (new_name == NULL)
- return NULL;
-
- strcpy (new_name, PACKAGE);
- new_catalog = catopen (new_name, 0);
-
- if (new_catalog == (nl_catd) -1)
- {
- /* NLSPATH search didn't work, try absolute path */
- sprintf (new_name, "%s/%s/LC_MESSAGES/%s.cat", LOCALEDIR, lang,
- PACKAGE);
- new_catalog = catopen (new_name, 0);
-
- if (new_catalog == (nl_catd) -1)
- {
- free (new_name);
- return (char *) catalog_name;
- }
- }
-
- /* Close old catalog. */
- if (catalog != (nl_catd) -1)
- catclose (catalog);
- if (catalog_name != default_catalog_name)
- free ((char *) catalog_name);
-
- catalog = new_catalog;
- catalog_name = new_name;
-
- return (char *) catalog_name;
-}
-
-char *
-bindtextdomain (domainname, dirname)
- const char *domainname;
- const char *dirname;
-{
-#if HAVE_SETENV || HAVE_PUTENV
- char *old_val, *new_val, *cp;
- size_t new_val_len;
-
- /* This does not make much sense here but to be compatible do it. */
- if (domainname == NULL)
- return NULL;
-
- /* Compute length of added path element. If we use setenv we don't need
- the first byts for NLSPATH=, but why complicate the code for this
- peanuts. */
- new_val_len = sizeof ("NLSPATH=") - 1 + strlen (dirname)
- + sizeof ("/%L/LC_MESSAGES/%N.cat");
-
- old_val = getenv ("NLSPATH");
- if (old_val == NULL || old_val[0] == '\0')
- {
- old_val = NULL;
- new_val_len += 1 + sizeof (LOCALEDIR) - 1
- + sizeof ("/%L/LC_MESSAGES/%N.cat");
- }
- else
- new_val_len += strlen (old_val);
-
- new_val = (char *) malloc (new_val_len);
- if (new_val == NULL)
- return NULL;
-
-# if HAVE_SETENV
- cp = new_val;
-# else
- cp = stpcpy (new_val, "NLSPATH=");
-# endif
-
- cp = stpcpy (cp, dirname);
- cp = stpcpy (cp, "/%L/LC_MESSAGES/%N.cat:");
-
- if (old_val == NULL)
- {
-# if __STDC__
- stpcpy (cp, LOCALEDIR "/%L/LC_MESSAGES/%N.cat");
-# else
-
- cp = stpcpy (cp, LOCALEDIR);
- stpcpy (cp, "/%L/LC_MESSAGES/%N.cat");
-# endif
- }
- else
- stpcpy (cp, old_val);
-
-# if HAVE_SETENV
- setenv ("NLSPATH", new_val, 1);
- free (new_val);
-# else
- putenv (new_val);
- /* Do *not* free the environment entry we just entered. It is used
- from now on. */
-# endif
-
-#endif
-
- return (char *) domainname;
-}
-
-#undef gettext
-char *
-gettext (msg)
- const char *msg;
-{
- int msgid;
-
- if (msg == NULL || catalog == (nl_catd) -1)
- return (char *) msg;
-
- /* Get the message from the catalog. We always use set number 1.
- The message ID is computed by the function `msg_to_cat_id'
- which works on the table generated by `po-to-tbl'. */
- msgid = msg_to_cat_id (msg);
- if (msgid == -1)
- return (char *) msg;
-
- return catgets (catalog, 1, msgid, (char *) msg);
-}
-
-/* Look through the table `_msg_tbl' which has `_msg_tbl_length' entries
- for the one equal to msg. If it is found return the ID. In case when
- the string is not found return -1. */
-static int
-msg_to_cat_id (msg)
- const char *msg;
-{
- int cnt;
-
- for (cnt = 0; cnt < _msg_tbl_length; ++cnt)
- if (strcmp (msg, _msg_tbl[cnt]._msg) == 0)
- return _msg_tbl[cnt]._msg_number;
-
- return -1;
-}
-
-
-/* @@ begin of epilog @@ */
-
-/* We don't want libintl.a to depend on any other library. So we
- avoid the non-standard function stpcpy. In GNU C Library this
- function is available, though. Also allow the symbol HAVE_STPCPY
- to be defined. */
-#if !_LIBC && !HAVE_STPCPY
-static char *
-stpcpy (dest, src)
- char *dest;
- const char *src;
-{
- while ((*dest++ = *src++) != '\0')
- /* Do nothing. */ ;
- return dest - 1;
-}
-#endif
diff --git a/intl/config.charset b/intl/config.charset
new file mode 100755
index 00000000..0a1a68db
--- /dev/null
+++ b/intl/config.charset
@@ -0,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 <st001906@hrz1.hrz.tu-darmstadt.de>"
+ echo "# and Bruno Haible <haible@clisp.cons.org>."
+ 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 --git a/intl/dcgettext.c b/intl/dcgettext.c
index 0f7bb486..70ee3baf 100644
--- a/intl/dcgettext.c
+++ b/intl/dcgettext.c
@@ -1,238 +1,44 @@
/* Implementation of the dcgettext(3) function.
- Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ 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 General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ 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 General Public License for more details.
+ 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. */
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include <sys/types.h>
-
-#if defined __GNUC__ && !defined C_ALLOCA
-# define alloca __builtin_alloca
-# define HAVE_ALLOCA 1
-#else
-# if (defined HAVE_ALLOCA_H || defined _LIBC) && !defined C_ALLOCA
-# include <alloca.h>
-# else
-# ifdef _AIX
- #pragma alloca
-# else
-# ifndef alloca
-char *alloca ();
-# endif
-# endif
-# endif
-#endif
-
-#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-#ifndef __set_errno
-# define __set_errno(val) errno = (val)
-#endif
-
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#else
-char *getenv ();
-# ifdef HAVE_MALLOC_H
-# include <malloc.h>
-# else
-void free ();
-# endif
-#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-# endif
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-#if !HAVE_STRCHR && !defined _LIBC
-# ifndef strchr
-# define strchr index
-# endif
-#endif
-
-#if defined HAVE_UNISTD_H || defined _LIBC
-# include <unistd.h>
-#endif
-
-#include "gettext.h"
#include "gettextP.h"
#ifdef _LIBC
# include <libintl.h>
#else
-# include "libgettext.h"
+# include "libgnuintl.h"
#endif
-#include "hash-string.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 getcwd __getcwd
-# ifndef stpcpy
-# define stpcpy __stpcpy
-# endif
-#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
-#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 <limits.h>
-#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 <sys/param.h>
-#endif
-
-#if !defined(PATH_MAX) && defined(MAXPATHLEN)
-# define PATH_MAX MAXPATHLEN
-#endif
-
-#ifndef PATH_MAX
-# define PATH_MAX _POSIX_PATH_MAX
-#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. And even worse: POSIX
- defines this not at all. So we can use this feature only on selected
- system (e.g. those using GNU C Library). */
-#ifdef _LIBC
-# define HAVE_LOCALE_NULL
-#endif
-
-/* Name of the default domain used for gettext(3) prior any call to
- textdomain(3). The default value for this is "messages". */
-const char _nl_default_default_domain[] = "messages";
-
-/* Value used as the default domain for gettext(3). */
-const char *_nl_current_default_domain = _nl_default_default_domain;
-
-/* Contains the default location of the message catalogs. */
-const char _nl_default_dirname[] = GNULOCALEDIR;
-
-/* List with bindings of specific domains created by bindtextdomain()
- calls. */
-struct binding *_nl_domain_bindings;
-
-/* Prototypes for local functions. */
-static char *find_msg PARAMS ((struct loaded_l10nfile *domain_file,
- const char *msgid)) 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 */
-
-
/* 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__
-#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
-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; \
- }
+# define DCIGETTEXT dcigettext__
#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
@@ -243,413 +49,11 @@ DCGETTEXT (domainname, msgid, category)
const char *msgid;
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;
- int saved_errno = errno;
-
- /* If no real MSGID is given return NULL. */
- if (msgid == NULL)
- return NULL;
-
- /* See whether this is a SUID binary or not. */
- DETERMINE_SECURE;
-
- /* 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;
-
- /* 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 (binding->dirname[0] == '/')
- 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. */
-
- dirname = (char *) alloca (path_max + dirname_len);
- ADD_BLOCK (block_list, dirname);
-
- __set_errno (0);
- while ((ret = getcwd (dirname, path_max)) == NULL && errno == ERANGE)
- {
- path_max += PATH_INCR;
- dirname = (char *) alloca (path_max + dirname_len);
- ADD_BLOCK (block_list, dirname);
- __set_errno (0);
- }
-
- 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);
- __set_errno (saved_errno);
- return (char *) msgid;
- }
-
- 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);
-
- xdomainname = (char *) alloca (strlen (categoryname)
- + strlen (domainname) + 5);
- ADD_BLOCK (block_list, xdomainname);
-
- stpcpy (stpcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
- domainname),
- ".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
- && (memchr (single_locale, '/',
- _nl_find_language (single_locale) - single_locale)
- != NULL))
- /* 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);
- __set_errno (saved_errno);
- return (char *) msgid;
- }
-
-
- /* Find structure describing the message catalog matching the
- DOMAINNAME and CATEGORY. */
- domain = _nl_find_domain (dirname, single_locale, xdomainname);
-
- if (domain != NULL)
- {
- retval = find_msg (domain, msgid);
-
- if (retval == NULL)
- {
- int cnt;
-
- for (cnt = 0; domain->successor[cnt] != NULL; ++cnt)
- {
- retval = find_msg (domain->successor[cnt], msgid);
-
- if (retval != NULL)
- break;
- }
- }
-
- if (retval != NULL)
- {
- FREE_BLOCKS (block_list);
- __set_errno (saved_errno);
- return retval;
- }
- }
- }
- /* NOTREACHED */
+ 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
-
-
-static char *
-internal_function
-find_msg (domain_file, msgid)
- struct loaded_l10nfile *domain_file;
- const char *msgid;
-{
- size_t act = 0;
- size_t top, bottom;
- struct loaded_domain *domain;
-
- if (domain_file->decided == 0)
- _nl_load_domain (domain_file);
-
- 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));
- nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]);
-
- if (nstr == 0)
- /* Hash table entry is empty. */
- return NULL;
-
- 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)
- return (char *) domain->data + W (domain->must_swap,
- domain->trans_tab[nstr - 1].offset);
-
- while (1)
- {
- if (idx >= domain->hash_size - incr)
- idx -= domain->hash_size - incr;
- else
- idx += incr;
-
- nstr = W (domain->must_swap, domain->hash_tab[idx]);
- if (nstr == 0)
- /* Hash table entry is empty. */
- return NULL;
-
- 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)
- return (char *) domain->data
- + W (domain->must_swap, domain->trans_tab[nstr - 1].offset);
- }
- /* NOTREACHED */
- }
-
- /* Now we try the default method: binary search in the sorted
- array of messages. */
- 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
- break;
- }
-
- /* If an translation is found return this. */
- return bottom >= top ? NULL : (char *) domain->data
- + W (domain->must_swap,
- domain->trans_tab[act].offset);
-}
-
-
-/* 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 *retval;
-
- /* The highest priority value is the `LANGUAGE' environment
- variable. This is a GNU extension. */
- retval = getenv ("LANGUAGE");
- if (retval != NULL && retval[0] != '\0')
- return retval;
-
- /* `LANGUAGE' is not set. So 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. */
-#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
- return setlocale (category, NULL);
-#else
- /* Setting of LC_ALL overwrites all other. */
- retval = getenv ("LC_ALL");
- if (retval != NULL && retval[0] != '\0')
- return retval;
-
- /* Next comes the name of the desired category. */
- retval = getenv (categoryname);
- if (retval != NULL && retval[0] != '\0')
- return retval;
-
- /* Last possibility is the LANG environment variable. */
- retval = getenv ("LANG");
- if (retval != NULL && retval[0] != '\0')
- return retval;
-
- /* We use C as the default domain. POSIX says this is implementation
- defined. */
- return "C";
-#endif
-}
-
-/* @@ 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
-
-
-#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)
-{
- struct binding *runp;
-
- for (runp = _nl_domain_bindings; runp != NULL; runp = runp->next)
- {
- free (runp->domainname);
- if (runp->dirname != _nl_default_dirname)
- /* Yes, this is a pointer comparison. */
- free (runp->dirname);
- }
-
- if (_nl_current_default_domain != _nl_default_default_domain)
- /* Yes, again a pointer comparison. */
- free ((char *) _nl_current_default_domain);
-}
-
-text_set_element (__libc_subfreeres, free_mem);
-#endif
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
new file mode 100644
index 00000000..afbb181f
--- /dev/null
+++ b/intl/dcigettext.c
@@ -0,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 <string.h> to provide a prototype for mempcpy().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <sys/types.h>
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# if defined HAVE_ALLOCA_H || defined _LIBC
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca
+char *alloca ();
+# endif
+# endif
+# endif
+#endif
+
+#include <errno.h>
+#ifndef errno
+extern int errno;
+#endif
+#ifndef __set_errno
+# define __set_errno(val) errno = (val)
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#include <locale.h>
+
+#if defined HAVE_SYS_PARAM_H || defined _LIBC
+# include <sys/param.h>
+#endif
+
+#include "gettextP.h"
+#include "plural-exp.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+#include "hash-string.h"
+
+/* Thread safetyness. */
+#ifdef _LIBC
+# include <bits/libc-lock.h>
+#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 <stddef.h>. */
+#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 <limits.h>
+#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 <sys/param.h>
+#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 <search.h>
+
+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 --git a/intl/dcngettext.c b/intl/dcngettext.c
new file mode 100644
index 00000000..d31ff9bf
--- /dev/null
+++ b/intl/dcngettext.c
@@ -0,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 <config.h>
+#endif
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DCNGETTEXT __dcngettext
+# define DCIGETTEXT __dcigettext
+#else
+# define DCNGETTEXT dcngettext__
+# define DCIGETTEXT dcigettext__
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+ locale. */
+char *
+DCNGETTEXT (domainname, msgid1, msgid2, n, category)
+ const char *domainname;
+ const char *msgid1;
+ const char *msgid2;
+ unsigned long int n;
+ int category;
+{
+ return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+INTDEF(__dcngettext)
+weak_alias (__dcngettext, dcngettext);
+#endif
diff --git a/intl/dgettext.c b/intl/dgettext.c
index 0510c2b0..17b0442c 100644
--- a/intl/dgettext.c
+++ b/intl/dgettext.c
@@ -1,32 +1,32 @@
-/* Implementation of the dgettext(3) function
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* 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 General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ 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 General Public License for more details.
+ 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. */
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#if defined HAVE_LOCALE_H || defined _LIBC
-# include <locale.h>
-#endif
+#include <locale.h>
+#include "gettextP.h"
#ifdef _LIBC
# include <libintl.h>
#else
-# include "libgettext.h"
+# include "libgnuintl.h"
#endif
/* @@ end of prolog @@ */
@@ -37,7 +37,7 @@
prefix. So we have to make a difference here. */
#ifdef _LIBC
# define DGETTEXT __dgettext
-# define DCGETTEXT __dcgettext
+# define DCGETTEXT INTUSE(__dcgettext)
#else
# define DGETTEXT dgettext__
# define DCGETTEXT dcgettext__
diff --git a/intl/dngettext.c b/intl/dngettext.c
new file mode 100644
index 00000000..2b9ff886
--- /dev/null
+++ b/intl/dngettext.c
@@ -0,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 <config.h>
+#endif
+
+#include <locale.h>
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DNGETTEXT __dngettext
+# define DCNGETTEXT 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 --git a/intl/eval-plural.h b/intl/eval-plural.h
new file mode 100644
index 00000000..44f49342
--- /dev/null
+++ b/intl/eval-plural.h
@@ -0,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 --git a/intl/explodename.c b/intl/explodename.c
index 7f480973..2985064c 100644
--- a/intl/explodename.c
+++ b/intl/explodename.c
@@ -1,33 +1,27 @@
-/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ 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 General Public License for more details.
+ 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. */
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include "loadinfo.h"
diff --git a/intl/finddomain.c b/intl/finddomain.c
index 81ea29bf..2f103d55 100644
--- a/intl/finddomain.c
+++ b/intl/finddomain.c
@@ -1,64 +1,40 @@
/* Handle list of needed message catalogs
- Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
- Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+ Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@gnu.org>, 1995.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ 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 General Public License for more details.
+ 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. */
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include <ctype.h>
-#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
-
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#else
-# ifdef HAVE_MALLOC_H
-# include <malloc.h>
-# else
-void free ();
-# endif
-#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
-#else
-# include <strings.h>
-# ifndef memcpy
-# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
-# endif
-#endif
-#if !HAVE_STRCHR && !defined _LIBC
-# ifndef strchr
-# define strchr index
-# endif
-#endif
+#include <stdlib.h>
+#include <string.h>
#if defined HAVE_UNISTD_H || defined _LIBC
# include <unistd.h>
#endif
-#include "gettext.h"
#include "gettextP.h"
#ifdef _LIBC
# include <libintl.h>
#else
-# include "libgettext.h"
+# include "libgnuintl.h"
#endif
/* @@ end of prolog @@ */
@@ -71,10 +47,11 @@ static struct loaded_l10nfile *_nl_loaded_domains;
established bindings. */
struct loaded_l10nfile *
internal_function
-_nl_find_domain (dirname, locale, domainname)
+_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;
@@ -120,7 +97,7 @@ _nl_find_domain (dirname, locale, domainname)
int cnt;
if (retval->decided == 0)
- _nl_load_domain (retval);
+ _nl_load_domain (retval, domainbinding);
if (retval->data != NULL)
return retval;
@@ -128,7 +105,7 @@ _nl_find_domain (dirname, locale, domainname)
for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
{
if (retval->successor[cnt]->decided == 0)
- _nl_load_domain (retval->successor[cnt]);
+ _nl_load_domain (retval->successor[cnt], domainbinding);
if (retval->successor[cnt]->data != NULL)
break;
@@ -175,14 +152,14 @@ _nl_find_domain (dirname, locale, domainname)
return NULL;
if (retval->decided == 0)
- _nl_load_domain (retval);
+ _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]);
+ _nl_load_domain (retval->successor[cnt], domainbinding);
if (retval->successor[cnt]->data != NULL)
break;
}
@@ -192,6 +169,10 @@ _nl_find_domain (dirname, locale, domainname)
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;
}
@@ -208,6 +189,7 @@ free_mem (void)
if (runp->data != NULL)
_nl_unload_domain ((struct loaded_domain *) runp->data);
runp = runp->next;
+ free ((char *) here->filename);
free (here);
}
}
diff --git a/intl/gettext.c b/intl/gettext.c
index d929f98d..e52d8aef 100644
--- a/intl/gettext.c
+++ b/intl/gettext.c
@@ -1,19 +1,20 @@
/* Implementation of gettext(3) function.
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ 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 General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ 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 General Public License for more details.
+ 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. */
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -23,21 +24,14 @@
# define __need_NULL
# include <stddef.h>
#else
-# ifdef STDC_HEADERS
-# include <stdlib.h> /* Just for NULL. */
-# else
-# ifdef HAVE_STRING_H
-# include <string.h>
-# else
-# define NULL ((void *) 0)
-# endif
-# endif
+# include <stdlib.h> /* Just for NULL. */
#endif
+#include "gettextP.h"
#ifdef _LIBC
# include <libintl.h>
#else
-# include "libgettext.h"
+# include "libgnuintl.h"
#endif
/* @@ end of prolog @@ */
@@ -48,10 +42,10 @@
prefix. So we have to make a difference here. */
#ifdef _LIBC
# define GETTEXT __gettext
-# define DGETTEXT __dgettext
+# define DCGETTEXT INTUSE(__dcgettext)
#else
# define GETTEXT gettext__
-# define DGETTEXT dgettext__
+# define DCGETTEXT dcgettext__
#endif
/* Look up MSGID in the current default message catalog for the current
@@ -61,7 +55,7 @@ char *
GETTEXT (msgid)
const char *msgid;
{
- return DGETTEXT (NULL, msgid);
+ return DCGETTEXT (NULL, msgid, LC_MESSAGES);
}
#ifdef _LIBC
diff --git a/intl/gettextP.h b/intl/gettextP.h
index 00c52031..4e3a5b25 100644
--- a/intl/gettextP.h
+++ b/intl/gettextP.h
@@ -1,30 +1,43 @@
-/* Header describing internals of gettext library
- Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
- Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+/* Header describing internals of libintl library.
+ Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ 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 General Public License for more details.
+ 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. */
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
#ifndef _GETTEXTP_H
#define _GETTEXTP_H
+#include <stddef.h> /* Get size_t. */
+
+#ifdef _LIBC
+# include "../iconv/gconv_int.h"
+#else
+# if HAVE_ICONV
+# include <iconv.h>
+# endif
+#endif
+
#include "loadinfo.h"
+#include "gmo.h" /* Get nls_uint32. */
+
/* @@ end of prolog @@ */
#ifndef PARAMS
-# if __STDC__
+# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
# define PARAMS(args) args
# else
# define PARAMS(args) ()
@@ -35,6 +48,16 @@
# 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
@@ -44,8 +67,6 @@
# include <byteswap.h>
# define SWAP(i) bswap_32 (i)
#else
-static nls_uint32 SWAP PARAMS ((nls_uint32 i));
-
static inline nls_uint32
SWAP (i)
nls_uint32 i;
@@ -55,6 +76,7 @@ SWAP (i)
#endif
+/* The representation of an opened message catalog. */
struct loaded_domain
{
const char *data;
@@ -66,23 +88,117 @@ struct loaded_domain
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 *domainname;
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))
+ const char *__domainname,
+ struct binding *__domainbinding))
internal_function;
-void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain))
+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 @@ */
diff --git a/intl/gettext.h b/intl/gmo.h
index 3cd23d7d..f05ae470 100644
--- a/intl/gettext.h
+++ b/intl/gmo.h
@@ -1,29 +1,25 @@
-/* Internal header for GNU gettext internationalization functions.
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+/* 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 General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ 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 General Public License for more details.
+ 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. */
+ 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 <stdio.h>
-
-#if HAVE_LIMITS_H || _LIBC
-# include <limits.h>
-#endif
+#include <limits.h>
/* @@ end of prolog @@ */
@@ -37,9 +33,8 @@
/* 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
- doing that would require that the configure script compile and *run*
- the resulting executable. Locally running cross-compiled executables
- is usually not possible. */
+ 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
diff --git a/intl/hash-string.h b/intl/hash-string.h
index 939e9582..b267a877 100644
--- a/intl/hash-string.h
+++ b/intl/hash-string.h
@@ -1,25 +1,25 @@
-/* Implements a string hashing function.
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+/* 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 General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ 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 General Public License for more details.
+ 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. */
+ 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__
+# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
diff --git a/intl/intl-compat.c b/intl/intl-compat.c
index 503efa0f..0a06ce94 100644
--- a/intl/intl-compat.c
+++ b/intl/intl-compat.c
@@ -1,43 +1,99 @@
/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
Library.
- Copyright (C) 1995 Software Foundation, Inc.
+ 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 General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+ 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 General Public License for more details.
+ 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. */
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include "libgettext.h"
+#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 *
-bindtextdomain (domainname, dirname)
+gettext (msgid)
+ const char *msgid;
+{
+ return gettext__ (msgid);
+}
+
+
+char *
+dgettext (domainname, msgid)
const char *domainname;
- const char *dirname;
+ const char *msgid;
{
- return bindtextdomain__ (domainname, dirname);
+ return dgettext__ (domainname, msgid);
}
@@ -52,19 +108,35 @@ dcgettext (domainname, msgid, category)
char *
-dgettext (domainname, msgid)
+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 *msgid;
+ const char *msgid1;
+ const char *msgid2;
+ unsigned long int n;
{
- return dgettext__ (domainname, msgid);
+ return dngettext__ (domainname, msgid1, msgid2, n);
}
char *
-gettext (msgid)
- const char *msgid;
+dcngettext (domainname, msgid1, msgid2, n, category)
+ const char *domainname;
+ const char *msgid1;
+ const char *msgid2;
+ unsigned long int n;
+ int category;
{
- return gettext__ (msgid);
+ return dcngettext__ (domainname, msgid1, msgid2, n, category);
}
@@ -74,3 +146,21 @@ textdomain (domainname)
{
return textdomain__ (domainname);
}
+
+
+char *
+bindtextdomain (domainname, dirname)
+ const char *domainname;
+ const char *dirname;
+{
+ return bindtextdomain__ (domainname, dirname);
+}
+
+
+char *
+bind_textdomain_codeset (domainname, codeset)
+ const char *domainname;
+ const char *codeset;
+{
+ return bind_textdomain_codeset__ (domainname, codeset);
+}
diff --git a/intl/l10nflist.c b/intl/l10nflist.c
index 30f5f645..d861912d 100644
--- a/intl/l10nflist.c
+++ b/intl/l10nflist.c
@@ -1,52 +1,40 @@
-/* Handle list of needed message catalogs
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ 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 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. */
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+/* Tell glibc's <string.h> to provide a prototype for stpcpy().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-# endif
-# include <string.h>
-#else
-# include <strings.h>
-# ifndef memcpy
-# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
-# endif
-#endif
-#if !HAVE_STRCHR && !defined _LIBC
-# ifndef strchr
-# define strchr index
-# endif
-#endif
+#include <string.h>
#if defined _LIBC || defined HAVE_ARGZ_H
# include <argz.h>
#endif
#include <ctype.h>
#include <sys/types.h>
-
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#endif
+#include <stdlib.h>
#include "loadinfo.h"
@@ -97,6 +85,10 @@ argz_count__ (argz, len)
}
# 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
@@ -121,6 +113,11 @@ argz_stringify__ (argz, len, 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
@@ -224,7 +221,7 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
/* Construct file name. */
memcpy (abs_filename, dirlist, dirlist_len);
- __argz_stringify (abs_filename, dirlist_len, ':');
+ __argz_stringify (abs_filename, dirlist_len, PATH_SEPARATOR);
cp = abs_filename + (dirlist_len - 1);
*cp++ = '/';
cp = stpcpy (cp, language);
@@ -349,7 +346,8 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
/* Normalize codeset name. There is no standard for the codeset
names. Normalization allows the user to use any of the common
- names. */
+ 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;
@@ -362,11 +360,11 @@ _nl_normalize_codeset (codeset, name_len)
size_t cnt;
for (cnt = 0; cnt < name_len; ++cnt)
- if (isalnum (codeset[cnt]))
+ if (isalnum ((unsigned char) codeset[cnt]))
{
++len;
- if (isalpha (codeset[cnt]))
+ if (isalpha ((unsigned char) codeset[cnt]))
only_digit = 0;
}
@@ -380,9 +378,9 @@ _nl_normalize_codeset (codeset, name_len)
wp = retval;
for (cnt = 0; cnt < name_len; ++cnt)
- if (isalpha (codeset[cnt]))
- *wp++ = tolower (codeset[cnt]);
- else if (isdigit (codeset[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';
diff --git a/intl/libgettext.h b/intl/libgettext.h
deleted file mode 100644
index 5bed8bbb..00000000
--- a/intl/libgettext.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/* Message catalogs for internationalization.
- Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* Because on some systems (e.g. Solaris) we sometimes have to include
- the systems libintl.h as well as this file we have more complex
- include protection above. But the systems header might perhaps also
- define _LIBINTL_H and therefore we have to protect the definition here. */
-
-#if !defined _LIBINTL_H || !defined _LIBGETTEXT_H
-#ifndef _LIBINTL_H
-# define _LIBINTL_H 1
-#endif
-#define _LIBGETTEXT_H 1
-
-/* We define an additional symbol to signal that we use the GNU
- implementation of gettext. */
-#define __USE_GNU_GETTEXT 1
-
-#include <sys/types.h>
-
-#if HAVE_LOCALE_H
-# include <locale.h>
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* @@ end of prolog @@ */
-
-#ifndef PARAMS
-# if __STDC__ || defined __cplusplus
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif
-#endif
-
-#ifndef NULL
-# if !defined __cplusplus || defined __GNUC__
-# define NULL ((void *) 0)
-# else
-# define NULL (0)
-# endif
-#endif
-
-#if !HAVE_LC_MESSAGES
-/* This value determines the behaviour of the gettext() and dgettext()
- function. But some system does not have this defined. Define it
- to a default value. */
-# define LC_MESSAGES (-1)
-#endif
-
-
-/* Declarations for gettext-using-catgets interface. Derived from
- Jim Meyering's libintl.h. */
-struct _msg_ent
-{
- const char *_msg;
- int _msg_number;
-};
-
-
-#if HAVE_CATGETS
-/* These two variables are defined in the automatically by po-to-tbl.sed
- generated file `cat-id-tbl.c'. */
-extern const struct _msg_ent _msg_tbl[];
-extern int _msg_tbl_length;
-#endif
-
-
-/* For automatical extraction of messages sometimes no real
- translation is needed. Instead the string itself is the result. */
-#define gettext_noop(Str) Str
-
-/* Look up MSGID in the current default message catalog for the current
- LC_MESSAGES locale. If not found, returns MSGID itself (the default
- text). */
-extern char *gettext PARAMS ((const char *__msgid));
-extern char *gettext__ PARAMS ((const char *__msgid));
-
-/* Look up MSGID in the DOMAINNAME message catalog for the current
- LC_MESSAGES locale. */
-extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
-extern char *dgettext__ PARAMS ((const char *__domainname,
- const char *__msgid));
-
-/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
- locale. */
-extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
- int __category));
-extern char *dcgettext__ PARAMS ((const char *__domainname,
- const char *__msgid, int __category));
-
-
-/* Set the current default message catalog to DOMAINNAME.
- If DOMAINNAME is null, return the current default.
- If DOMAINNAME is "", reset to the default of "messages". */
-extern char *textdomain PARAMS ((const char *__domainname));
-extern char *textdomain__ PARAMS ((const char *__domainname));
-
-/* Specify that the DOMAINNAME message catalog will be found
- in DIRNAME rather than in the system locale data base. */
-extern char *bindtextdomain PARAMS ((const char *__domainname,
- const char *__dirname));
-extern char *bindtextdomain__ PARAMS ((const char *__domainname,
- const char *__dirname));
-
-#if ENABLE_NLS
-
-/* Solaris 2.3 has the gettext function but dcgettext is missing.
- So we omit this optimization for Solaris 2.3. BTW, Solaris 2.4
- has dcgettext. */
-# if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT)
-
-# define gettext(Msgid) \
- dgettext (NULL, Msgid)
-
-# define dgettext(Domainname, Msgid) \
- dcgettext (Domainname, Msgid, LC_MESSAGES)
-
-# if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7
-/* This global variable is defined in loadmsgcat.c. We need a sign,
- whether a new catalog was loaded, which can be associated with all
- translations. */
-extern int _nl_msg_cat_cntr;
-
-# define dcgettext(Domainname, Msgid, Category) \
- (__extension__ \
- ({ \
- char *__result; \
- if (__builtin_constant_p (Msgid)) \
- { \
- static char *__translation__; \
- static int __catalog_counter__; \
- if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr) \
- { \
- __translation__ = \
- dcgettext__ (Domainname, Msgid, Category); \
- __catalog_counter__ = _nl_msg_cat_cntr; \
- } \
- __result = __translation__; \
- } \
- else \
- __result = dcgettext__ (Domainname, Msgid, Category); \
- __result; \
- }))
-# endif
-# endif
-
-#else
-
-# define gettext(Msgid) (Msgid)
-# define dgettext(Domainname, Msgid) (Msgid)
-# define dcgettext(Domainname, Msgid, Category) (Msgid)
-# define textdomain(Domainname) ((char *) Domainname)
-# define bindtextdomain(Domainname, Dirname) ((char *) Dirname)
-
-#endif
-
-/* @@ begin of epilog @@ */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/intl/libgnuintl.h b/intl/libgnuintl.h
new file mode 100644
index 00000000..1387e70c
--- /dev/null
+++ b/intl/libgnuintl.h
@@ -0,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 <locale.h>
+
+/* The LC_MESSAGES locale category is the category used by the functions
+ gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
+ On systems that don't define it, use an arbitrary value instead.
+ On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
+ then includes <libintl.h> (i.e. this file!) and then only defines
+ LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES
+ in this case. */
+#if !defined LC_MESSAGES && !(defined __LOCALE_H || (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 --git a/intl/linux-msg.sed b/intl/linux-msg.sed
deleted file mode 100644
index 5918e720..00000000
--- a/intl/linux-msg.sed
+++ /dev/null
@@ -1,100 +0,0 @@
-# po2msg.sed - Convert Uniforum style .po file to Linux style .msg file
-# Copyright (C) 1995 Free Software Foundation, Inc.
-# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-#
-# The first directive in the .msg should be the definition of the
-# message set number. We use always set number 1.
-#
-1 {
- i\
-$set 1 # Automatically created by po2msg.sed
- h
- s/.*/0/
- x
-}
-#
-# Mitch's old catalog format does not allow comments.
-#
-# We copy the original message as a comment into the .msg file.
-#
-/^msgid/ {
- s/msgid[ ]*"//
-#
-# This does not work now with the new format.
-# /"$/! {
-# s/\\$//
-# s/$/ ... (more lines following)"/
-# }
- x
-# The following nice solution is by
-# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
- td
-# Increment a decimal number in pattern space.
-# First hide trailing `9' digits.
- :d
- s/9\(_*\)$/_\1/
- td
-# Assure at least one digit is available.
- s/^\(_*\)$/0\1/
-# Increment the last digit.
- s/8\(_*\)$/9\1/
- s/7\(_*\)$/8\1/
- s/6\(_*\)$/7\1/
- s/5\(_*\)$/6\1/
- s/4\(_*\)$/5\1/
- s/3\(_*\)$/4\1/
- s/2\(_*\)$/3\1/
- s/1\(_*\)$/2\1/
- s/0\(_*\)$/1\1/
-# Convert the hidden `9' digits to `0's.
- s/_/0/g
- x
- G
- s/\(.*\)"\n\([0-9]*\)/$ #\2 Original Message:(\1)/p
-}
-#
-# The .msg file contains, other then the .po file, only the translations
-# but each given a unique ID. Starting from 1 and incrementing by 1 for
-# each message we assign them to the messages.
-# It is important that the .po file used to generate the cat-id-tbl.c file
-# (with po-to-tbl) is the same as the one used here. (At least the order
-# of declarations must not be changed.)
-#
-/^msgstr/ {
- s/msgstr[ ]*"\(.*\)"/# \1/
-# Clear substitution flag.
- tb
-# Append the next line.
- :b
- N
-# Look whether second part is continuation line.
- s/\(.*\n\)"\(.*\)"/\1\2/
-# Yes, then branch.
- ta
- P
- D
-# Note that D includes a jump to the start!!
-# We found a continuation line. But before printing insert '\'.
- :a
- s/\(.*\)\(\n.*\)/\1\\\2/
- P
-# We cannot use D here.
- s/.*\n\(.*\)/\1/
- tb
-}
-d
diff --git a/intl/loadinfo.h b/intl/loadinfo.h
index 1c4524ab..d180962f 100644
--- a/intl/loadinfo.h
+++ b/intl/loadinfo.h
@@ -1,29 +1,64 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ 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 General Public License for more details.
+ 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. */
+ 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__
+# 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
@@ -50,6 +85,10 @@ struct loaded_l10nfile
};
+/* 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));
@@ -66,6 +105,8 @@ _nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
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,
@@ -76,3 +117,5 @@ extern int _nl_explode_name PARAMS ((char *name, const char **language,
const char **revision));
extern char *_nl_find_language PARAMS ((const char *name));
+
+#endif /* loadinfo.h */
diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c
index ed3be019..76130ed2 100644
--- a/intl/loadmsgcat.c
+++ b/intl/loadmsgcat.c
@@ -1,37 +1,67 @@
/* Load needed message catalogs.
- Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ 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 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. */
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+/* Tell glibc's <string.h> to provide a prototype for mempcpy().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
+#include <ctype.h>
+#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# if defined HAVE_ALLOCA_H || defined _LIBC
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca
+char *alloca ();
+# endif
+# endif
+# endif
#endif
+#include <stdlib.h>
+#include <string.h>
+
#if defined HAVE_UNISTD_H || defined _LIBC
# include <unistd.h>
#endif
-#define DISALLOW_MMAP 1 /* ADR */
+#ifdef _LIBC
+# include <langinfo.h>
+# include <locale.h>
+#endif
+
#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
|| (defined _LIBC && defined _POSIX_MAPPED_FILES)
# include <sys/mman.h>
@@ -41,8 +71,13 @@
# undef HAVE_MMAP
#endif
-#include "gettext.h"
+#include "gmo.h"
#include "gettextP.h"
+#include "plural-exp.h"
+
+#ifdef _LIBC
+# include "../locale/localeinfo.h"
+#endif
/* @@ end of prolog @@ */
@@ -57,29 +92,201 @@
# 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 <fcntl.h>. */
+#if !defined O_BINARY && defined _O_BINARY
+ /* For MSC-compatible compilers. */
+# define O_BINARY _O_BINARY
+# define O_TEXT _O_TEXT
+#endif
+#ifdef __BEOS__
+ /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
+# undef O_BINARY
+# undef O_TEXT
+#endif
+/* On reasonable systems, binary I/O is the default. */
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
+
/* We need a sign, whether a new catalog was loaded, which can be associated
with all translations. This is important if the translations are
cached by one of GCC's features. */
-int _nl_msg_cat_cntr = 0;
+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)
+_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
@@ -88,14 +295,19 @@ _nl_load_domain (domain_file)
return;
/* Try to open the addressed file. */
- fd = open (domain_file->filename, O_RDONLY);
+ fd = open (domain_file->filename, O_RDONLY | O_BINARY);
if (fd == -1)
return;
/* We must know about the size of the file. */
- if (fstat (fd, &st) != 0
- || (size = (size_t) st.st_size) != st.st_size
- || size < sizeof (struct mo_file_header))
+ 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);
@@ -108,7 +320,7 @@ _nl_load_domain (domain_file)
data = (struct mo_file_header *) mmap (NULL, size, PROT_READ,
MAP_PRIVATE, fd, 0);
- if (data != (struct mo_file_header *) -1)
+ if (__builtin_expect (data != (struct mo_file_header *) -1, 1))
{
/* mmap() call was successful. */
close (fd);
@@ -132,12 +344,15 @@ _nl_load_domain (domain_file)
do
{
long int nb = (long int) read (fd, read_ptr, to_read);
- if (nb == -1)
+ if (nb <= 0)
{
+#ifdef EINTR
+ if (nb == -1 && errno == EINTR)
+ continue;
+#endif
close (fd);
return;
}
-
read_ptr += nb;
to_read -= nb;
}
@@ -148,7 +363,8 @@ _nl_load_domain (domain_file)
/* Using the magic number we can test whether it really is a message
catalog file. */
- if (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED)
+ if (__builtin_expect (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED,
+ 0))
{
/* The magic number is wrong: not a message catalog file. */
#ifdef HAVE_MMAP
@@ -160,12 +376,11 @@ _nl_load_domain (domain_file)
return;
}
- domain_file->data
- = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
- if (domain_file->data == NULL)
+ domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
+ if (domain == NULL)
return;
+ domain_file->data = domain;
- domain = (struct loaded_domain *) domain_file->data;
domain->data = (char *) data;
domain->use_mmap = use_mmap;
domain->mmap_size = size;
@@ -197,9 +412,13 @@ _nl_load_domain (domain_file)
return;
}
- /* Show that one domain is changed. This might make some cached
- translations invalid. */
- ++_nl_msg_cat_cntr;
+ /* 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);
}
@@ -209,11 +428,16 @@ internal_function
_nl_unload_domain (domain)
struct loaded_domain *domain;
{
-#ifdef _POSIX_MAPPED_FILES
+ 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 */
+# endif /* _POSIX_MAPPED_FILES */
free ((void *) domain->data);
free (domain);
diff --git a/intl/localcharset.c b/intl/localcharset.c
new file mode 100644
index 00000000..bc5587bf
--- /dev/null
+++ b/intl/localcharset.c
@@ -0,0 +1,345 @@
+/* Determine a canonical name for the current locale's character encoding.
+
+ Copyright (C) 2000-2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+/* Written by Bruno Haible <haible@clisp.cons.org>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if HAVE_STDDEF_H
+# include <stddef.h>
+#endif
+
+#include <stdio.h>
+#if HAVE_STRING_H
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#if defined _WIN32 || defined __WIN32__
+# undef WIN32 /* avoid warning on mingw32 */
+# define WIN32
+#endif
+
+#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 <langinfo.h>
+# else
+# if HAVE_SETLOCALE
+# include <locale.h>
+# endif
+# endif
+#elif defined WIN32
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+#if defined OS2
+# define INCL_DOS
+# include <os2.h>
+#endif
+
+#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
+ /* Win32, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+#endif
+
+#ifndef DIRECTORY_SEPARATOR
+# define DIRECTORY_SEPARATOR '/'
+#endif
+
+#ifndef ISSLASH
+# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
+#endif
+
+#ifdef HAVE_GETC_UNLOCKED
+# undef getc
+# define getc getc_unlocked
+#endif
+
+/* The following static variable is declared 'volatile' to avoid a
+ possible multithread problem in the function get_charset_aliases. If we
+ are running in a threaded environment, and if two threads initialize
+ 'charset_aliases' simultaneously, both will produce the same value,
+ and everything will be ok if the two assignments to 'charset_aliases'
+ are atomic. But I don't know what will happen if the two assignments mix. */
+#if __STDC__ != 1
+# define volatile /* empty */
+#endif
+/* Pointer to the contents of the charset.alias file, if it has already been
+ read, else NULL. Its format is:
+ ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */
+static const char * volatile charset_aliases;
+
+/* Return a pointer to the contents of the charset.alias file. */
+static const char *
+get_charset_aliases ()
+{
+ const char *cp;
+
+ cp = charset_aliases;
+ if (cp == NULL)
+ {
+#if !defined WIN32
+ FILE *fp;
+ const char *dir = LIBDIR;
+ const char *base = "charset.alias";
+ char *file_name;
+
+ /* Concatenate dir and base into freshly allocated file_name. */
+ {
+ size_t dir_len = strlen (dir);
+ size_t base_len = strlen (base);
+ int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
+ file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
+ if (file_name != NULL)
+ {
+ memcpy (file_name, dir, dir_len);
+ if (add_slash)
+ file_name[dir_len] = DIRECTORY_SEPARATOR;
+ memcpy (file_name + dir_len + add_slash, base, base_len + 1);
+ }
+ }
+
+ if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL)
+ /* Out of memory or file not found, treat it as empty. */
+ cp = "";
+ else
+ {
+ /* Parse the file's contents. */
+ int c;
+ char buf1[50+1];
+ char buf2[50+1];
+ char *res_ptr = NULL;
+ size_t res_size = 0;
+ size_t l1, l2;
+
+ for (;;)
+ {
+ c = getc (fp);
+ if (c == EOF)
+ break;
+ if (c == '\n' || c == ' ' || c == '\t')
+ continue;
+ if (c == '#')
+ {
+ /* Skip comment, to end of line. */
+ do
+ c = getc (fp);
+ while (!(c == EOF || c == '\n'));
+ if (c == EOF)
+ break;
+ continue;
+ }
+ ungetc (c, fp);
+ if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
+ break;
+ l1 = strlen (buf1);
+ l2 = strlen (buf2);
+ if (res_size == 0)
+ {
+ res_size = l1 + 1 + l2 + 1;
+ res_ptr = (char *) malloc (res_size + 1);
+ }
+ else
+ {
+ res_size += l1 + 1 + l2 + 1;
+ res_ptr = (char *) realloc (res_ptr, res_size + 1);
+ }
+ if (res_ptr == NULL)
+ {
+ /* Out of memory. */
+ res_size = 0;
+ break;
+ }
+ strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
+ strcpy (res_ptr + res_size - (l2 + 1), buf2);
+ }
+ fclose (fp);
+ if (res_size == 0)
+ cp = "";
+ else
+ {
+ *(res_ptr + res_size) = '\0';
+ cp = res_ptr;
+ }
+ }
+
+ if (file_name != NULL)
+ free (file_name);
+
+#else
+
+ /* To avoid the troubles of installing a separate file in the same
+ directory as the DLL and of retrieving the DLL's directory at
+ runtime, simply inline the aliases here. */
+
+# if defined WIN32
+ cp = "CP936" "\0" "GBK" "\0"
+ "CP1361" "\0" "JOHAB" "\0";
+# endif
+#endif
+
+ charset_aliases = cp;
+ }
+
+ return cp;
+}
+
+/* Determine the current locale's character encoding, and canonicalize it
+ into one of the canonical names listed in config.charset.
+ The result must not be freed; it is statically allocated.
+ If the canonical name cannot be determined, the result is a non-canonical
+ name. */
+
+#ifdef STATIC
+STATIC
+#endif
+const char *
+locale_charset ()
+{
+ const char *codeset;
+ const char *aliases;
+
+#if !(defined WIN32 || defined OS2)
+
+# if HAVE_LANGINFO_CODESET
+
+ /* Most systems support nl_langinfo (CODESET) nowadays. */
+ codeset = nl_langinfo (CODESET);
+
+# else
+
+ /* On old systems which lack it, use setlocale or getenv. */
+ const char *locale = NULL;
+
+ /* But most old systems don't have a complete set of locales. Some
+ (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't
+ use setlocale here; it would return "C" when it doesn't support the
+ locale name the user has set. */
+# if HAVE_SETLOCALE && 0
+ locale = setlocale (LC_CTYPE, NULL);
+# endif
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_ALL");
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_CTYPE");
+ if (locale == NULL || locale[0] == '\0')
+ locale = getenv ("LANG");
+ }
+ }
+
+ /* On some old systems, one used to set locale = "iso8859_1". On others,
+ you set it to "language_COUNTRY.charset". In any case, we resolve it
+ through the charset.alias file. */
+ codeset = locale;
+
+# endif
+
+#elif defined WIN32
+
+ static char buf[2 + 10 + 1];
+
+ /* Win32 has a function returning the locale's codepage as a number. */
+ sprintf (buf, "CP%u", GetACP ());
+ codeset = buf;
+
+#elif defined OS2
+
+ const char *locale;
+ static char buf[2 + 10 + 1];
+ ULONG cp[3];
+ ULONG cplen;
+
+ /* Allow user to override the codeset, as set in the operating system,
+ with standard language environment variables. */
+ locale = getenv ("LC_ALL");
+ if (locale == NULL || locale[0] == '\0')
+ {
+ locale = getenv ("LC_CTYPE");
+ if (locale == NULL || locale[0] == '\0')
+ locale = getenv ("LANG");
+ }
+ if (locale != NULL && locale[0] != '\0')
+ {
+ /* If the locale name contains an encoding after the dot, return it. */
+ const char *dot = strchr (locale, '.');
+
+ if (dot != NULL)
+ {
+ const char *modifier;
+
+ dot++;
+ /* Look for the possible @... trailer and remove it, if any. */
+ modifier = strchr (dot, '@');
+ if (modifier == NULL)
+ return dot;
+ if (modifier - dot < sizeof (buf))
+ {
+ memcpy (buf, dot, modifier - dot);
+ buf [modifier - dot] = '\0';
+ return buf;
+ }
+ }
+
+ /* Resolve through the charset.alias file. */
+ codeset = locale;
+ }
+ else
+ {
+ /* OS/2 has a function returning the locale's codepage as a number. */
+ if (DosQueryCp (sizeof (cp), cp, &cplen))
+ codeset = "";
+ else
+ {
+ sprintf (buf, "CP%u", cp[0]);
+ codeset = buf;
+ }
+ }
+
+#endif
+
+ if (codeset == NULL)
+ /* The canonical name cannot be determined. */
+ codeset = "";
+
+ /* Resolve alias. */
+ for (aliases = get_charset_aliases ();
+ *aliases != '\0';
+ aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
+ if (strcmp (codeset, aliases) == 0
+ || (aliases[0] == '*' && aliases[1] == '\0'))
+ {
+ codeset = aliases + strlen (aliases) + 1;
+ break;
+ }
+
+ return codeset;
+}
diff --git a/intl/locale.alias b/intl/locale.alias
new file mode 100644
index 00000000..bd7b9b31
--- /dev/null
+++ b/intl/locale.alias
@@ -0,0 +1,78 @@
+# Locale name alias data base.
+# Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Library General Public License as published
+# by the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+# USA.
+
+# The format of this file is the same as for the corresponding file of
+# the X Window System, which normally can be found in
+# /usr/lib/X11/locale/locale.alias
+# A single line contains two fields: an alias and a substitution value.
+# All entries are case independent.
+
+# Note: This file is far from being complete. If you have a value for
+# your own site which you think might be useful for others too, share
+# it with the rest of us. Send it using the `glibcbug' script to
+# bugs@gnu.org.
+
+# Packages using this file:
+
+bokmal no_NO.ISO-8859-1
+bokmål no_NO.ISO-8859-1
+catalan ca_ES.ISO-8859-1
+croatian hr_HR.ISO-8859-2
+czech cs_CZ.ISO-8859-2
+danish da_DK.ISO-8859-1
+dansk da_DK.ISO-8859-1
+deutsch de_DE.ISO-8859-1
+dutch nl_NL.ISO-8859-1
+eesti et_EE.ISO-8859-1
+estonian et_EE.ISO-8859-1
+finnish fi_FI.ISO-8859-1
+français fr_FR.ISO-8859-1
+french fr_FR.ISO-8859-1
+galego gl_ES.ISO-8859-1
+galician gl_ES.ISO-8859-1
+german de_DE.ISO-8859-1
+greek el_GR.ISO-8859-7
+hebrew he_IL.ISO-8859-8
+hrvatski hr_HR.ISO-8859-2
+hungarian hu_HU.ISO-8859-2
+icelandic is_IS.ISO-8859-1
+italian it_IT.ISO-8859-1
+japanese ja_JP.eucJP
+japanese.euc ja_JP.eucJP
+ja_JP ja_JP.eucJP
+ja_JP.ujis ja_JP.eucJP
+japanese.sjis ja_JP.SJIS
+korean ko_KR.eucKR
+korean.euc ko_KR.eucKR
+ko_KR ko_KR.eucKR
+lithuanian lt_LT.ISO-8859-13
+nb_NO no_NO.ISO-8859-1
+nb_NO.ISO-8859-1 no_NO.ISO-8859-1
+norwegian no_NO.ISO-8859-1
+nynorsk nn_NO.ISO-8859-1
+polish pl_PL.ISO-8859-2
+portuguese pt_PT.ISO-8859-1
+romanian ro_RO.ISO-8859-2
+russian ru_RU.ISO-8859-5
+slovak sk_SK.ISO-8859-2
+slovene sl_SI.ISO-8859-2
+slovenian sl_SI.ISO-8859-2
+spanish es_ES.ISO-8859-1
+swedish sv_SE.ISO-8859-1
+thai th_TH.TIS-620
+turkish tr_TR.ISO-8859-9
diff --git a/intl/localealias.c b/intl/localealias.c
index a6f054a9..456e41e3 100644
--- a/intl/localealias.c
+++ b/intl/localealias.c
@@ -1,20 +1,27 @@
/* Handle aliases for locale names.
- Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
- Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+ Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ 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 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. */
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+/* Tell glibc's <string.h> to provide a prototype for mempcpy().
+ This must come before <config.h> because <config.h> may include
+ <features.h>, and once <features.h> has been included, it's too late. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -22,6 +29,9 @@
#include <ctype.h>
#include <stdio.h>
+#if defined _LIBC || defined HAVE___FSETLOCKING
+# include <stdio_ext.h>
+#endif
#include <sys/types.h>
#ifdef __GNUC__
@@ -41,35 +51,9 @@ char *alloca ();
# endif
#endif
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#else
-char *getenv ();
-# ifdef HAVE_MALLOC_H
-# include <malloc.h>
-# else
-void free ();
-# endif
-#endif
-
-#if defined HAVE_STRING_H || defined _LIBC
-# ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-# endif
-# include <string.h>
-#else
-# include <strings.h>
-# ifndef memcpy
-# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
-# endif
-#endif
-#if !HAVE_STRCHR && !defined _LIBC
-# ifndef strchr
-# define strchr index
-# endif
-#endif
+#include <stdlib.h>
+#include <string.h>
-#include "gettext.h"
#include "gettextP.h"
/* @@ end of prolog @@ */
@@ -84,6 +68,7 @@ void free ();
# 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 <bits/libc-lock.h>
@@ -95,40 +80,23 @@ __libc_lock_define_initialized (static, lock);
# define internal_function
#endif
-/* For those loosing systems which don't have `alloca' we have to add
+/* 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
-/* Nothing has to be done. */
-# define ADD_BLOCK(list, address) /* nothing */
-# define FREE_BLOCKS(list) /* nothing */
+# define freea(p) /* 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 */
+# define alloca(n) malloc (n)
+# define freea(p) free (p)
+#endif
#if defined _LIBC_REENTRANT || defined HAVE_FGETS_UNLOCKED
# undef fgets
@@ -147,18 +115,18 @@ struct alias_map
};
-static char *string_space = NULL;
-static size_t string_space_act = 0;
-static size_t string_space_max = 0;
+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 = 0;
-static size_t maxmap = 0;
+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 void extend_alias_table PARAMS ((void));
+static int extend_alias_table PARAMS ((void));
static int alias_compare PARAMS ((const struct alias_map *map1,
const struct alias_map *map2));
@@ -167,7 +135,7 @@ const char *
_nl_expand_alias (name)
const char *name;
{
- static const char *locale_alias_path = LOCALE_ALIAS_PATH;
+ static const char *locale_alias_path;
struct alias_map *retval;
const char *result = NULL;
size_t added;
@@ -176,6 +144,9 @@ _nl_expand_alias (name)
__libc_lock_lock (lock);
#endif
+ if (locale_alias_path == NULL)
+ locale_alias_path = LOCALE_ALIAS_PATH;
+
do
{
struct alias_map item;
@@ -204,11 +175,12 @@ _nl_expand_alias (name)
{
const char *start;
- while (locale_alias_path[0] == ':')
+ while (locale_alias_path[0] == PATH_SEPARATOR)
++locale_alias_path;
start = locale_alias_path;
- while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':')
+ while (locale_alias_path[0] != '\0'
+ && locale_alias_path[0] != PATH_SEPARATOR)
++locale_alias_path;
if (start < locale_alias_path)
@@ -231,16 +203,12 @@ read_alias_file (fname, fname_len)
const char *fname;
int fname_len;
{
-#ifndef HAVE_ALLOCA
- struct block_list *block_list = NULL;
-#endif
FILE *fp;
char *full_fname;
size_t added;
static const char aliasfile[] = "/locale.alias";
full_fname = (char *) alloca (fname_len + sizeof aliasfile);
- ADD_BLOCK (block_list, full_fname);
#ifdef HAVE_MEMPCPY
mempcpy (mempcpy (full_fname, fname, fname_len),
aliasfile, sizeof aliasfile);
@@ -250,14 +218,17 @@ read_alias_file (fname, fname_len)
#endif
fp = fopen (full_fname, "r");
+ freea (full_fname);
if (fp == NULL)
- {
- FREE_BLOCKS (block_list);
- return 0;
- }
+ return 0;
+
+#ifdef HAVE___FSETLOCKING
+ /* No threads present. */
+ __fsetlocking (fp, FSETLOCKING_BYCALLER);
+#endif
added = 0;
- while (!feof (fp))
+ 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
@@ -269,7 +240,7 @@ read_alias_file (fname, fname_len)
char *value;
char *cp;
- if (fgets (buf, sizeof buf, fp) == NULL)
+ if (FGETS (buf, sizeof buf, fp) == NULL)
/* EOF reached. */
break;
@@ -279,7 +250,7 @@ read_alias_file (fname, fname_len)
{
char altbuf[BUFSIZ];
do
- if (fgets (altbuf, sizeof altbuf, fp) == NULL)
+ 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;
@@ -288,21 +259,21 @@ read_alias_file (fname, fname_len)
cp = buf;
/* Ignore leading white space. */
- while (isspace (cp[0]))
+ 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 (cp[0]))
+ 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 (cp[0]))
+ while (isspace ((unsigned char) cp[0]))
++cp;
if (cp[0] != '\0')
@@ -311,7 +282,7 @@ read_alias_file (fname, fname_len)
size_t value_len;
value = cp++;
- while (cp[0] != '\0' && !isspace (cp[0]))
+ while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
++cp;
/* Terminate value. */
if (cp[0] == '\n')
@@ -326,7 +297,8 @@ read_alias_file (fname, fname_len)
*cp++ = '\0';
if (nmap >= maxmap)
- extend_alias_table ();
+ if (__builtin_expect (extend_alias_table (), 0))
+ return added;
alias_len = strlen (alias) + 1;
value_len = strlen (value) + 1;
@@ -339,19 +311,28 @@ read_alias_file (fname, fname_len)
? 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))
{
- FREE_BLOCKS (block_list);
- return added;
+ 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 = (char *) memcpy (&string_space[string_space_act],
+ map[nmap].alias = memcpy (&string_space[string_space_act],
alias, alias_len);
string_space_act += alias_len;
- map[nmap].value = (char *) memcpy (&string_space[string_space_act],
+ map[nmap].value = memcpy (&string_space[string_space_act],
value, value_len);
string_space_act += value_len;
@@ -369,12 +350,11 @@ read_alias_file (fname, fname_len)
qsort (map, nmap, sizeof (struct alias_map),
(int (*) PARAMS ((const void *, const void *))) alias_compare);
- FREE_BLOCKS (block_list);
return added;
}
-static void
+static int
extend_alias_table ()
{
size_t new_size;
@@ -385,10 +365,11 @@ extend_alias_table ()
* sizeof (struct alias_map)));
if (new_map == NULL)
/* Simply don't extend: we don't have any more core. */
- return;
+ return -1;
map = new_map;
maxmap = new_size;
+ return 0;
}
diff --git a/intl/localename.c b/intl/localename.c
new file mode 100644
index 00000000..a7241981
--- /dev/null
+++ b/intl/localename.c
@@ -0,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 <drepper@gnu.org>, 1995. */
+/* Win32 code written by Tor Lillqvist <tml@iki.fi>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <locale.h>
+
+#if defined _WIN32 || defined __WIN32__
+# undef WIN32 /* avoid warning on mingw32 */
+# define WIN32
+#endif
+
+#ifdef WIN32
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+/* Mingw headers don't have latest language and sublanguage codes. */
+# ifndef LANG_AFRIKAANS
+# define LANG_AFRIKAANS 0x36
+# endif
+# ifndef LANG_ALBANIAN
+# define LANG_ALBANIAN 0x1c
+# endif
+# ifndef LANG_ARABIC
+# define LANG_ARABIC 0x01
+# endif
+# ifndef LANG_ARMENIAN
+# define LANG_ARMENIAN 0x2b
+# endif
+# ifndef LANG_ASSAMESE
+# define LANG_ASSAMESE 0x4d
+# endif
+# ifndef LANG_AZERI
+# define LANG_AZERI 0x2c
+# endif
+# ifndef LANG_BASQUE
+# define LANG_BASQUE 0x2d
+# endif
+# ifndef LANG_BELARUSIAN
+# define LANG_BELARUSIAN 0x23
+# endif
+# ifndef LANG_BENGALI
+# define LANG_BENGALI 0x45
+# endif
+# ifndef LANG_CATALAN
+# define LANG_CATALAN 0x03
+# endif
+# ifndef LANG_ESTONIAN
+# define LANG_ESTONIAN 0x25
+# endif
+# ifndef LANG_FAEROESE
+# define LANG_FAEROESE 0x38
+# endif
+# ifndef LANG_FARSI
+# define LANG_FARSI 0x29
+# endif
+# ifndef LANG_GEORGIAN
+# define LANG_GEORGIAN 0x37
+# endif
+# ifndef LANG_GUJARATI
+# define LANG_GUJARATI 0x47
+# endif
+# ifndef LANG_HEBREW
+# define LANG_HEBREW 0x0d
+# endif
+# ifndef LANG_HINDI
+# define LANG_HINDI 0x39
+# endif
+# ifndef LANG_INDONESIAN
+# define LANG_INDONESIAN 0x21
+# endif
+# ifndef LANG_KANNADA
+# define LANG_KANNADA 0x4b
+# endif
+# ifndef LANG_KASHMIRI
+# define LANG_KASHMIRI 0x60
+# endif
+# ifndef LANG_KAZAK
+# define LANG_KAZAK 0x3f
+# endif
+# ifndef LANG_KONKANI
+# define LANG_KONKANI 0x57
+# endif
+# ifndef LANG_LATVIAN
+# define LANG_LATVIAN 0x26
+# endif
+# ifndef LANG_LITHUANIAN
+# define LANG_LITHUANIAN 0x27
+# endif
+# ifndef LANG_MACEDONIAN
+# define LANG_MACEDONIAN 0x2f
+# endif
+# ifndef LANG_MALAY
+# define LANG_MALAY 0x3e
+# endif
+# ifndef LANG_MALAYALAM
+# define LANG_MALAYALAM 0x4c
+# endif
+# ifndef LANG_MANIPURI
+# define LANG_MANIPURI 0x58
+# endif
+# ifndef LANG_MARATHI
+# define LANG_MARATHI 0x4e
+# endif
+# ifndef LANG_NEPALI
+# define LANG_NEPALI 0x61
+# endif
+# ifndef LANG_ORIYA
+# define LANG_ORIYA 0x48
+# endif
+# ifndef LANG_PUNJABI
+# define LANG_PUNJABI 0x46
+# endif
+# ifndef LANG_SANSKRIT
+# define LANG_SANSKRIT 0x4f
+# endif
+# ifndef LANG_SERBIAN
+# define LANG_SERBIAN 0x1a
+# endif
+# ifndef LANG_SINDHI
+# define LANG_SINDHI 0x59
+# endif
+# ifndef LANG_SLOVAK
+# define LANG_SLOVAK 0x1b
+# endif
+# ifndef LANG_SWAHILI
+# define LANG_SWAHILI 0x41
+# endif
+# ifndef LANG_TAMIL
+# define LANG_TAMIL 0x49
+# endif
+# ifndef LANG_TATAR
+# define LANG_TATAR 0x44
+# endif
+# ifndef LANG_TELUGU
+# define LANG_TELUGU 0x4a
+# endif
+# ifndef LANG_THAI
+# define LANG_THAI 0x1e
+# endif
+# ifndef LANG_UKRAINIAN
+# define LANG_UKRAINIAN 0x22
+# endif
+# ifndef LANG_URDU
+# define LANG_URDU 0x20
+# endif
+# ifndef LANG_UZBEK
+# define LANG_UZBEK 0x43
+# endif
+# ifndef LANG_VIETNAMESE
+# define LANG_VIETNAMESE 0x2a
+# endif
+# ifndef SUBLANG_ARABIC_SAUDI_ARABIA
+# define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
+# endif
+# ifndef SUBLANG_ARABIC_IRAQ
+# define SUBLANG_ARABIC_IRAQ 0x02
+# endif
+# ifndef SUBLANG_ARABIC_EGYPT
+# define SUBLANG_ARABIC_EGYPT 0x03
+# endif
+# ifndef SUBLANG_ARABIC_LIBYA
+# define SUBLANG_ARABIC_LIBYA 0x04
+# endif
+# ifndef SUBLANG_ARABIC_ALGERIA
+# define SUBLANG_ARABIC_ALGERIA 0x05
+# endif
+# ifndef SUBLANG_ARABIC_MOROCCO
+# define SUBLANG_ARABIC_MOROCCO 0x06
+# endif
+# ifndef SUBLANG_ARABIC_TUNISIA
+# define SUBLANG_ARABIC_TUNISIA 0x07
+# endif
+# ifndef SUBLANG_ARABIC_OMAN
+# define SUBLANG_ARABIC_OMAN 0x08
+# endif
+# ifndef SUBLANG_ARABIC_YEMEN
+# define SUBLANG_ARABIC_YEMEN 0x09
+# endif
+# ifndef SUBLANG_ARABIC_SYRIA
+# define SUBLANG_ARABIC_SYRIA 0x0a
+# endif
+# ifndef SUBLANG_ARABIC_JORDAN
+# define SUBLANG_ARABIC_JORDAN 0x0b
+# endif
+# ifndef SUBLANG_ARABIC_LEBANON
+# define SUBLANG_ARABIC_LEBANON 0x0c
+# endif
+# ifndef SUBLANG_ARABIC_KUWAIT
+# define SUBLANG_ARABIC_KUWAIT 0x0d
+# endif
+# ifndef SUBLANG_ARABIC_UAE
+# define SUBLANG_ARABIC_UAE 0x0e
+# endif
+# ifndef SUBLANG_ARABIC_BAHRAIN
+# define SUBLANG_ARABIC_BAHRAIN 0x0f
+# endif
+# ifndef SUBLANG_ARABIC_QATAR
+# define SUBLANG_ARABIC_QATAR 0x10
+# endif
+# ifndef SUBLANG_AZERI_LATIN
+# define SUBLANG_AZERI_LATIN 0x01
+# endif
+# ifndef SUBLANG_AZERI_CYRILLIC
+# define SUBLANG_AZERI_CYRILLIC 0x02
+# endif
+# ifndef SUBLANG_CHINESE_MACAU
+# define SUBLANG_CHINESE_MACAU 0x05
+# endif
+# ifndef SUBLANG_ENGLISH_SOUTH_AFRICA
+# define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
+# endif
+# ifndef SUBLANG_ENGLISH_JAMAICA
+# define SUBLANG_ENGLISH_JAMAICA 0x08
+# endif
+# ifndef SUBLANG_ENGLISH_CARIBBEAN
+# define SUBLANG_ENGLISH_CARIBBEAN 0x09
+# endif
+# ifndef SUBLANG_ENGLISH_BELIZE
+# define SUBLANG_ENGLISH_BELIZE 0x0a
+# endif
+# ifndef SUBLANG_ENGLISH_TRINIDAD
+# define SUBLANG_ENGLISH_TRINIDAD 0x0b
+# endif
+# ifndef SUBLANG_ENGLISH_ZIMBABWE
+# define SUBLANG_ENGLISH_ZIMBABWE 0x0c
+# endif
+# ifndef SUBLANG_ENGLISH_PHILIPPINES
+# define SUBLANG_ENGLISH_PHILIPPINES 0x0d
+# endif
+# ifndef SUBLANG_FRENCH_LUXEMBOURG
+# define SUBLANG_FRENCH_LUXEMBOURG 0x05
+# endif
+# ifndef SUBLANG_FRENCH_MONACO
+# define SUBLANG_FRENCH_MONACO 0x06
+# endif
+# ifndef SUBLANG_GERMAN_LUXEMBOURG
+# define SUBLANG_GERMAN_LUXEMBOURG 0x04
+# endif
+# ifndef SUBLANG_GERMAN_LIECHTENSTEIN
+# define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
+# endif
+# ifndef SUBLANG_KASHMIRI_INDIA
+# define SUBLANG_KASHMIRI_INDIA 0x02
+# endif
+# ifndef SUBLANG_MALAY_MALAYSIA
+# define SUBLANG_MALAY_MALAYSIA 0x01
+# endif
+# ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM
+# define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
+# endif
+# ifndef SUBLANG_NEPALI_INDIA
+# define SUBLANG_NEPALI_INDIA 0x02
+# endif
+# ifndef SUBLANG_SERBIAN_LATIN
+# define SUBLANG_SERBIAN_LATIN 0x02
+# endif
+# ifndef SUBLANG_SERBIAN_CYRILLIC
+# define SUBLANG_SERBIAN_CYRILLIC 0x03
+# endif
+# ifndef SUBLANG_SPANISH_GUATEMALA
+# define SUBLANG_SPANISH_GUATEMALA 0x04
+# endif
+# ifndef SUBLANG_SPANISH_COSTA_RICA
+# define SUBLANG_SPANISH_COSTA_RICA 0x05
+# endif
+# ifndef SUBLANG_SPANISH_PANAMA
+# define SUBLANG_SPANISH_PANAMA 0x06
+# endif
+# ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
+# define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
+# endif
+# ifndef SUBLANG_SPANISH_VENEZUELA
+# define SUBLANG_SPANISH_VENEZUELA 0x08
+# endif
+# ifndef SUBLANG_SPANISH_COLOMBIA
+# define SUBLANG_SPANISH_COLOMBIA 0x09
+# endif
+# ifndef SUBLANG_SPANISH_PERU
+# define SUBLANG_SPANISH_PERU 0x0a
+# endif
+# ifndef SUBLANG_SPANISH_ARGENTINA
+# define SUBLANG_SPANISH_ARGENTINA 0x0b
+# endif
+# ifndef SUBLANG_SPANISH_ECUADOR
+# define SUBLANG_SPANISH_ECUADOR 0x0c
+# endif
+# ifndef SUBLANG_SPANISH_CHILE
+# define SUBLANG_SPANISH_CHILE 0x0d
+# endif
+# ifndef SUBLANG_SPANISH_URUGUAY
+# define SUBLANG_SPANISH_URUGUAY 0x0e
+# endif
+# ifndef SUBLANG_SPANISH_PARAGUAY
+# define SUBLANG_SPANISH_PARAGUAY 0x0f
+# endif
+# ifndef SUBLANG_SPANISH_BOLIVIA
+# define SUBLANG_SPANISH_BOLIVIA 0x10
+# endif
+# ifndef SUBLANG_SPANISH_EL_SALVADOR
+# define SUBLANG_SPANISH_EL_SALVADOR 0x11
+# endif
+# ifndef SUBLANG_SPANISH_HONDURAS
+# define SUBLANG_SPANISH_HONDURAS 0x12
+# endif
+# ifndef SUBLANG_SPANISH_NICARAGUA
+# define SUBLANG_SPANISH_NICARAGUA 0x13
+# endif
+# ifndef SUBLANG_SPANISH_PUERTO_RICO
+# define SUBLANG_SPANISH_PUERTO_RICO 0x14
+# endif
+# ifndef SUBLANG_SWEDISH_FINLAND
+# define SUBLANG_SWEDISH_FINLAND 0x02
+# endif
+# ifndef SUBLANG_URDU_PAKISTAN
+# define SUBLANG_URDU_PAKISTAN 0x01
+# endif
+# ifndef SUBLANG_URDU_INDIA
+# define SUBLANG_URDU_INDIA 0x02
+# endif
+# ifndef SUBLANG_UZBEK_LATIN
+# define SUBLANG_UZBEK_LATIN 0x01
+# endif
+# ifndef SUBLANG_UZBEK_CYRILLIC
+# define SUBLANG_UZBEK_CYRILLIC 0x02
+# endif
+#endif
+
+/* XPG3 defines the result of 'setlocale (category, NULL)' as:
+ "Directs 'setlocale()' to query 'category' and return the current
+ setting of 'local'."
+ However it does not specify the exact format. Neither do SUSV2 and
+ ISO C 99. So we can use this feature only on selected systems (e.g.
+ those using GNU C Library). */
+#if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2)
+# define HAVE_LOCALE_NULL
+#endif
+
+/* Determine the current locale's name, and canonicalize it into XPG syntax
+ language[_territory[.codeset]][@modifier]
+ The codeset part in the result is not reliable; the locale_charset()
+ should be used for codeset information instead.
+ The result must not be freed; it is statically allocated. */
+
+const char *
+_nl_locale_name (category, categoryname)
+ int category;
+ const char *categoryname;
+{
+ const char *retval;
+
+#ifndef WIN32
+
+ /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'.
+ On some systems this can be done by the 'setlocale' function itself. */
+# if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
+ retval = setlocale (category, NULL);
+# else
+ /* Setting of LC_ALL overwrites all other. */
+ retval = getenv ("LC_ALL");
+ if (retval == NULL || retval[0] == '\0')
+ {
+ /* Next comes the name of the desired category. */
+ retval = getenv (categoryname);
+ if (retval == NULL || retval[0] == '\0')
+ {
+ /* Last possibility is the LANG environment variable. */
+ retval = getenv ("LANG");
+ if (retval == NULL || retval[0] == '\0')
+ /* We use C as the default domain. POSIX says this is
+ implementation defined. */
+ retval = "C";
+ }
+ }
+# endif
+
+ return retval;
+
+#else /* WIN32 */
+
+ /* Return an XPG style locale name language[_territory][@modifier].
+ Don't even bother determining the codeset; it's not useful in this
+ context, because message catalogs are not specific to a single
+ codeset. */
+
+ LCID lcid;
+ LANGID langid;
+ int primary, sub;
+
+ /* Let the user override the system settings through environment
+ variables, as on POSIX systems. */
+ retval = getenv ("LC_ALL");
+ if (retval != NULL && retval[0] != '\0')
+ return retval;
+ retval = getenv (categoryname);
+ if (retval != NULL && retval[0] != '\0')
+ return retval;
+ retval = getenv ("LANG");
+ if (retval != NULL && retval[0] != '\0')
+ return retval;
+
+ /* Use native Win32 API locale ID. */
+ lcid = GetThreadLocale ();
+
+ /* Strip off the sorting rules, keep only the language part. */
+ langid = LANGIDFROMLCID (lcid);
+
+ /* Split into language and territory part. */
+ primary = PRIMARYLANGID (langid);
+ sub = SUBLANGID (langid);
+ switch (primary)
+ {
+ case LANG_AFRIKAANS: return "af_ZA";
+ case LANG_ALBANIAN: return "sq_AL";
+ case LANG_ARABIC:
+ switch (sub)
+ {
+ case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA";
+ case SUBLANG_ARABIC_IRAQ: return "ar_IQ";
+ case SUBLANG_ARABIC_EGYPT: return "ar_EG";
+ case SUBLANG_ARABIC_LIBYA: return "ar_LY";
+ case SUBLANG_ARABIC_ALGERIA: return "ar_DZ";
+ case SUBLANG_ARABIC_MOROCCO: return "ar_MA";
+ case SUBLANG_ARABIC_TUNISIA: return "ar_TN";
+ case SUBLANG_ARABIC_OMAN: return "ar_OM";
+ case SUBLANG_ARABIC_YEMEN: return "ar_YE";
+ case SUBLANG_ARABIC_SYRIA: return "ar_SY";
+ case SUBLANG_ARABIC_JORDAN: return "ar_JO";
+ case SUBLANG_ARABIC_LEBANON: return "ar_LB";
+ case SUBLANG_ARABIC_KUWAIT: return "ar_KW";
+ case SUBLANG_ARABIC_UAE: return "ar_AE";
+ case SUBLANG_ARABIC_BAHRAIN: return "ar_BH";
+ case SUBLANG_ARABIC_QATAR: return "ar_QA";
+ }
+ return "ar";
+ case LANG_ARMENIAN: return "hy_AM";
+ case LANG_ASSAMESE: return "as_IN";
+ case LANG_AZERI:
+ switch (sub)
+ {
+ /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */
+ case SUBLANG_AZERI_LATIN: return "az_AZ@latin";
+ case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic";
+ }
+ return "az";
+ case LANG_BASQUE:
+ return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */
+ case LANG_BELARUSIAN: return "be_BY";
+ case LANG_BENGALI: return "bn_IN";
+ case LANG_BULGARIAN: return "bg_BG";
+ case LANG_CATALAN: return "ca_ES";
+ case LANG_CHINESE:
+ switch (sub)
+ {
+ case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW";
+ case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN";
+ case SUBLANG_CHINESE_HONGKONG: return "zh_HK";
+ case SUBLANG_CHINESE_SINGAPORE: return "zh_SG";
+ case SUBLANG_CHINESE_MACAU: return "zh_MO";
+ }
+ return "zh";
+ case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN
+ * What used to be called Serbo-Croatian
+ * should really now be two separate
+ * languages because of political reasons.
+ * (Says tml, who knows nothing about Serbian
+ * or Croatian.)
+ * (I can feel those flames coming already.)
+ */
+ switch (sub)
+ {
+ /* FIXME: How to distinguish Croatian and Latin Serbian locales? */
+ case SUBLANG_SERBIAN_LATIN: return "sr_YU";
+ case SUBLANG_SERBIAN_CYRILLIC: return "sr_YU@cyrillic";
+ default: return "hr_HR";
+ }
+ case LANG_CZECH: return "cs_CZ";
+ case LANG_DANISH: return "da_DK";
+ case LANG_DUTCH:
+ switch (sub)
+ {
+ case SUBLANG_DUTCH: return "nl_NL";
+ case SUBLANG_DUTCH_BELGIAN: return "nl_BE";
+ }
+ return "nl";
+ case LANG_ENGLISH:
+ switch (sub)
+ {
+ /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought
+ * English was the language spoken in England.
+ * Oh well.
+ */
+ case SUBLANG_ENGLISH_US: return "en_US";
+ case SUBLANG_ENGLISH_UK: return "en_GB";
+ case SUBLANG_ENGLISH_AUS: return "en_AU";
+ case SUBLANG_ENGLISH_CAN: return "en_CA";
+ case SUBLANG_ENGLISH_NZ: return "en_NZ";
+ case SUBLANG_ENGLISH_EIRE: return "en_IE";
+ case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA";
+ case SUBLANG_ENGLISH_JAMAICA: return "en_JM";
+ case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */
+ case SUBLANG_ENGLISH_BELIZE: return "en_BZ";
+ case SUBLANG_ENGLISH_TRINIDAD: return "en_TT";
+ case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW";
+ case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH";
+ }
+ return "en";
+ case LANG_ESTONIAN: return "et_EE";
+ case LANG_FAEROESE: return "fo_FO";
+ case LANG_FARSI: return "fa_IR";
+ case LANG_FINNISH: return "fi_FI";
+ case LANG_FRENCH:
+ switch (sub)
+ {
+ case SUBLANG_FRENCH: return "fr_FR";
+ case SUBLANG_FRENCH_BELGIAN: return "fr_BE";
+ case SUBLANG_FRENCH_CANADIAN: return "fr_CA";
+ case SUBLANG_FRENCH_SWISS: return "fr_CH";
+ case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU";
+ case SUBLANG_FRENCH_MONACO: return "fr_MC";
+ }
+ return "fr";
+ case LANG_GEORGIAN: return "ka_GE";
+ case LANG_GERMAN:
+ switch (sub)
+ {
+ case SUBLANG_GERMAN: return "de_DE";
+ case SUBLANG_GERMAN_SWISS: return "de_CH";
+ case SUBLANG_GERMAN_AUSTRIAN: return "de_AT";
+ case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU";
+ case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI";
+ }
+ return "de";
+ case LANG_GREEK: return "el_GR";
+ case LANG_GUJARATI: return "gu_IN";
+ case LANG_HEBREW: return "he_IL";
+ case LANG_HINDI: return "hi_IN";
+ case LANG_HUNGARIAN: return "hu_HU";
+ case LANG_ICELANDIC: return "is_IS";
+ case LANG_INDONESIAN: return "id_ID";
+ case LANG_ITALIAN:
+ switch (sub)
+ {
+ case SUBLANG_ITALIAN: return "it_IT";
+ case SUBLANG_ITALIAN_SWISS: return "it_CH";
+ }
+ return "it";
+ case LANG_JAPANESE: return "ja_JP";
+ case LANG_KANNADA: return "kn_IN";
+ case LANG_KASHMIRI:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "ks_PK";
+ case SUBLANG_KASHMIRI_INDIA: return "ks_IN";
+ }
+ return "ks";
+ case LANG_KAZAK: return "kk_KZ";
+ case LANG_KONKANI:
+ /* FIXME: Adjust this when such locales appear on Unix. */
+ return "kok_IN";
+ case LANG_KOREAN: return "ko_KR";
+ case LANG_LATVIAN: return "lv_LV";
+ case LANG_LITHUANIAN: return "lt_LT";
+ case LANG_MACEDONIAN: return "mk_MK";
+ case LANG_MALAY:
+ switch (sub)
+ {
+ case SUBLANG_MALAY_MALAYSIA: return "ms_MY";
+ case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN";
+ }
+ return "ms";
+ case LANG_MALAYALAM: return "ml_IN";
+ case LANG_MANIPURI:
+ /* FIXME: Adjust this when such locales appear on Unix. */
+ return "mni_IN";
+ case LANG_MARATHI: return "mr_IN";
+ case LANG_NEPALI:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "ne_NP";
+ case SUBLANG_NEPALI_INDIA: return "ne_IN";
+ }
+ return "ne";
+ case LANG_NORWEGIAN:
+ switch (sub)
+ {
+ case SUBLANG_NORWEGIAN_BOKMAL: return "no_NO";
+ case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO";
+ }
+ return "no";
+ case LANG_ORIYA: return "or_IN";
+ case LANG_POLISH: return "pl_PL";
+ case LANG_PORTUGUESE:
+ switch (sub)
+ {
+ case SUBLANG_PORTUGUESE: return "pt_PT";
+ /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT.
+ Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */
+ case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR";
+ }
+ return "pt";
+ case LANG_PUNJABI: return "pa_IN";
+ case LANG_ROMANIAN: return "ro_RO";
+ case LANG_RUSSIAN:
+ return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA". */
+ case LANG_SANSKRIT: return "sa_IN";
+ case LANG_SINDHI: return "sd";
+ case LANG_SLOVAK: return "sk_SK";
+ case LANG_SLOVENIAN: return "sl_SI";
+ case LANG_SORBIAN:
+ /* FIXME: Adjust this when such locales appear on Unix. */
+ return "wen_DE";
+ case LANG_SPANISH:
+ switch (sub)
+ {
+ case SUBLANG_SPANISH: return "es_ES";
+ case SUBLANG_SPANISH_MEXICAN: return "es_MX";
+ case SUBLANG_SPANISH_MODERN:
+ return "es_ES@modern"; /* not seen on Unix */
+ case SUBLANG_SPANISH_GUATEMALA: return "es_GT";
+ case SUBLANG_SPANISH_COSTA_RICA: return "es_CR";
+ case SUBLANG_SPANISH_PANAMA: return "es_PA";
+ case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO";
+ case SUBLANG_SPANISH_VENEZUELA: return "es_VE";
+ case SUBLANG_SPANISH_COLOMBIA: return "es_CO";
+ case SUBLANG_SPANISH_PERU: return "es_PE";
+ case SUBLANG_SPANISH_ARGENTINA: return "es_AR";
+ case SUBLANG_SPANISH_ECUADOR: return "es_EC";
+ case SUBLANG_SPANISH_CHILE: return "es_CL";
+ case SUBLANG_SPANISH_URUGUAY: return "es_UY";
+ case SUBLANG_SPANISH_PARAGUAY: return "es_PY";
+ case SUBLANG_SPANISH_BOLIVIA: return "es_BO";
+ case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV";
+ case SUBLANG_SPANISH_HONDURAS: return "es_HN";
+ case SUBLANG_SPANISH_NICARAGUA: return "es_NI";
+ case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR";
+ }
+ return "es";
+ case LANG_SWAHILI: return "sw";
+ case LANG_SWEDISH:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "sv_SE";
+ case SUBLANG_SWEDISH_FINLAND: return "sv_FI";
+ }
+ return "sv";
+ case LANG_TAMIL:
+ return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */
+ case LANG_TATAR: return "tt";
+ case LANG_TELUGU: return "te_IN";
+ case LANG_THAI: return "th_TH";
+ case LANG_TURKISH: return "tr_TR";
+ case LANG_UKRAINIAN: return "uk_UA";
+ case LANG_URDU:
+ switch (sub)
+ {
+ case SUBLANG_URDU_PAKISTAN: return "ur_PK";
+ case SUBLANG_URDU_INDIA: return "ur_IN";
+ }
+ return "ur";
+ case LANG_UZBEK:
+ switch (sub)
+ {
+ /* FIXME: Adjust this when Uzbek locales appear on Unix. */
+ case SUBLANG_UZBEK_LATIN: return "uz_UZ@latin";
+ case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic";
+ }
+ return "uz";
+ case LANG_VIETNAMESE: return "vi_VN";
+ default: return "C";
+ }
+
+#endif
+}
diff --git a/intl/ngettext.c b/intl/ngettext.c
new file mode 100644
index 00000000..b42ff6a1
--- /dev/null
+++ b/intl/ngettext.c
@@ -0,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 <config.h>
+#endif
+
+#ifdef _LIBC
+# define __need_NULL
+# include <stddef.h>
+#else
+# include <stdlib.h> /* Just for NULL. */
+#endif
+
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgnuintl.h"
+#endif
+
+#include <locale.h>
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define NGETTEXT __ngettext
+# define DCNGETTEXT 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 --git a/intl/os2compat.c b/intl/os2compat.c
new file mode 100644
index 00000000..3ca82666
--- /dev/null
+++ b/intl/os2compat.c
@@ -0,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 <config.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/param.h>
+
+/* 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 --git a/intl/os2compat.h b/intl/os2compat.h
new file mode 100644
index 00000000..4f74e8c0
--- /dev/null
+++ b/intl/os2compat.h
@@ -0,0 +1,46 @@
+/* OS/2 compatibility defines.
+ This file is intended to be included from config.h
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+/* When included from os2compat.h we need all the original definitions */
+#ifndef OS2_AWARE
+
+#undef LIBDIR
+#define LIBDIR _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 --git a/intl/osdep.c b/intl/osdep.c
new file mode 100644
index 00000000..b3725983
--- /dev/null
+++ b/intl/osdep.c
@@ -0,0 +1,24 @@
+/* OS dependent parts of libintl.
+ Copyright (C) 2001-2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#if defined __EMX__
+# include "os2compat.c"
+#else
+/* Avoid AIX compiler warning. */
+typedef int dummy;
+#endif
diff --git a/intl/plural-exp.c b/intl/plural-exp.c
new file mode 100644
index 00000000..c937c011
--- /dev/null
+++ b/intl/plural-exp.c
@@ -0,0 +1,156 @@
+/* Expression parsing for plural form selection.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@cygnus.com>, 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 <config.h>
+#endif
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "plural-exp.h"
+
+#if (defined __GNUC__ && !defined __APPLE_CC__) \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
+
+/* These structs are the constant expression for the germanic plural
+ form determination. It represents the expression "n != 1". */
+static const struct expression plvar =
+{
+ .nargs = 0,
+ .operation = var,
+};
+static const struct expression plone =
+{
+ .nargs = 0,
+ .operation = num,
+ .val =
+ {
+ .num = 1
+ }
+};
+struct expression GERMANIC_PLURAL =
+{
+ .nargs = 2,
+ .operation = not_equal,
+ .val =
+ {
+ .args =
+ {
+ [0] = (struct expression *) &plvar,
+ [1] = (struct expression *) &plone
+ }
+ }
+};
+
+# define INIT_GERMANIC_PLURAL()
+
+#else
+
+/* For compilers without support for ISO C 99 struct/union initializers:
+ Initialization at run-time. */
+
+static struct expression plvar;
+static struct expression plone;
+struct expression GERMANIC_PLURAL;
+
+static void
+init_germanic_plural ()
+{
+ if (plone.val.num == 0)
+ {
+ plvar.nargs = 0;
+ plvar.operation = var;
+
+ plone.nargs = 0;
+ plone.operation = num;
+ plone.val.num = 1;
+
+ GERMANIC_PLURAL.nargs = 2;
+ GERMANIC_PLURAL.operation = not_equal;
+ GERMANIC_PLURAL.val.args[0] = &plvar;
+ GERMANIC_PLURAL.val.args[1] = &plone;
+ }
+}
+
+# define INIT_GERMANIC_PLURAL() init_germanic_plural ()
+
+#endif
+
+void
+internal_function
+EXTRACT_PLURAL_EXPRESSION (nullentry, pluralp, npluralsp)
+ const char *nullentry;
+ struct expression **pluralp;
+ unsigned long int *npluralsp;
+{
+ if (nullentry != NULL)
+ {
+ const char *plural;
+ const char *nplurals;
+
+ plural = strstr (nullentry, "plural=");
+ nplurals = strstr (nullentry, "nplurals=");
+ if (plural == NULL || nplurals == NULL)
+ goto no_plural;
+ else
+ {
+ char *endp;
+ unsigned long int n;
+ struct parse_args args;
+
+ /* First get the number. */
+ nplurals += 9;
+ while (*nplurals != '\0' && isspace ((unsigned char) *nplurals))
+ ++nplurals;
+ if (!(*nplurals >= '0' && *nplurals <= '9'))
+ goto no_plural;
+#if defined HAVE_STRTOUL || defined _LIBC
+ n = strtoul (nplurals, &endp, 10);
+#else
+ for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++)
+ n = n * 10 + (*endp - '0');
+#endif
+ if (nplurals == endp)
+ goto no_plural;
+ *npluralsp = n;
+
+ /* Due to the restrictions bison imposes onto the interface of the
+ scanner function we have to put the input string and the result
+ passed up from the parser into the same structure which address
+ is passed down to the parser. */
+ plural += 7;
+ args.cp = plural;
+ if (PLURAL_PARSE (&args) != 0)
+ goto no_plural;
+ *pluralp = args.res;
+ }
+ }
+ else
+ {
+ /* By default we are using the Germanic form: singular form only
+ for `one', the plural form otherwise. Yes, this is also what
+ English is using since English is a Germanic language. */
+ no_plural:
+ INIT_GERMANIC_PLURAL ();
+ *pluralp = &GERMANIC_PLURAL;
+ *npluralsp = 2;
+ }
+}
diff --git a/intl/plural-exp.h b/intl/plural-exp.h
new file mode 100644
index 00000000..93cdaef5
--- /dev/null
+++ b/intl/plural-exp.h
@@ -0,0 +1,126 @@
+/* Expression parsing and evaluation for plural form selection.
+ Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@cygnus.com>, 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 --git a/intl/plural.c b/intl/plural.c
new file mode 100644
index 00000000..c9ff63fb
--- /dev/null
+++ b/intl/plural.c
@@ -0,0 +1,1322 @@
+
+/* A Bison parser, made from plural.y
+ by GNU Bison version 1.28 */
+
+#define YYBISON 1 /* Identify Bison output. */
+
+#define yyparse __gettextparse
+#define yylex __gettextlex
+#define yyerror __gettexterror
+#define yylval __gettextlval
+#define yychar __gettextchar
+#define yydebug __gettextdebug
+#define yynerrs __gettextnerrs
+#define EQUOP2 257
+#define CMPOP2 258
+#define ADDOP2 259
+#define MULOP2 260
+#define NUMBER 261
+
+#line 1 "plural.y"
+
+/* Expression parsing for plural form selection.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+/* The bison generated parser uses alloca. AIX 3 forces us to put this
+ declaration at the beginning of the file. The declaration in bison's
+ skeleton file comes too late. This must come before <config.h>
+ because <config.h> may include arbitrary system headers. */
+#if defined _AIX && !defined __GNUC__
+ #pragma alloca
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#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 <stdio.h>
+
+#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 <alloca.h>
+#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 <malloc.h>
+#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 <malloc.h> */
+ #pragma alloca
+#define YYSTACK_USE_ALLOCA
+#else /* not MSDOS, or __TURBOC__, or _AIX */
+#if 0
+#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
+ and on HPUX 10. Eventually we can turn this on. */
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
+#endif /* __hpux */
+#endif
+#endif /* not _AIX */
+#endif /* not MSDOS, or __TURBOC__ */
+#endif /* not sparc */
+#endif /* not GNU C */
+#endif /* alloca not defined */
+#endif /* YYSTACK_USE_ALLOCA not defined */
+
+#ifdef YYSTACK_USE_ALLOCA
+#define YYSTACK_ALLOC alloca
+#else
+#define YYSTACK_ALLOC malloc
+#endif
+
+/* Note: there must be only one dollar sign in this file.
+ It is replaced by the list of actions, each action
+ as one case of the switch. */
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY -2
+#define YYEOF 0
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrlab1
+/* Like YYERROR except do call yyerror.
+ This remains here temporarily to ease the
+ transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
+#define YYFAIL goto yyerrlab
+#define YYRECOVERING() (!!yyerrstatus)
+#define YYBACKUP(token, value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { yychar = (token), yylval = (value); \
+ yychar1 = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+ { yyerror ("syntax error: cannot back up"); YYERROR; } \
+while (0)
+
+#define YYTERROR 1
+#define YYERRCODE 256
+
+#ifndef YYPURE
+#define YYLEX yylex()
+#endif
+
+#ifdef YYPURE
+#ifdef YYLSP_NEEDED
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
+#else
+#define YYLEX yylex(&yylval, &yylloc)
+#endif
+#else /* not YYLSP_NEEDED */
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, YYLEX_PARAM)
+#else
+#define YYLEX yylex(&yylval)
+#endif
+#endif /* not YYLSP_NEEDED */
+#endif
+
+/* If nonreentrant, generate the variables here */
+
+#ifndef YYPURE
+
+int yychar; /* the lookahead symbol */
+YYSTYPE yylval; /* the semantic value of the */
+ /* lookahead symbol */
+
+#ifdef YYLSP_NEEDED
+YYLTYPE yylloc; /* location data for the lookahead */
+ /* symbol */
+#endif
+
+int yynerrs; /* number of parse errors so far */
+#endif /* not YYPURE */
+
+#if YYDEBUG != 0
+int yydebug; /* nonzero means print parse trace */
+/* Since this is uninitialized, it does not stop multiple parsers
+ from coexisting. */
+#endif
+
+/* YYINITDEPTH indicates the initial size of the parser's stacks */
+
+#ifndef YYINITDEPTH
+#define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH is the maximum size the stacks can grow to
+ (effective only if the built-in stack extension method is used). */
+
+#if YYMAXDEPTH == 0
+#undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+#define YYMAXDEPTH 10000
+#endif
+
+/* Define __yy_memcpy. Note that the size argument
+ should be passed with type unsigned int, because that is what the non-GCC
+ definitions require. With GCC, __builtin_memcpy takes an arg
+ of type size_t, but it can handle unsigned int. */
+
+#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
+#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
+#else /* not GNU C or C++ */
+#ifndef __cplusplus
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (to, from, count)
+ char *to;
+ char *from;
+ unsigned int count;
+{
+ register char *f = from;
+ register char *t = to;
+ register int i = count;
+
+ while (i-- > 0)
+ *t++ = *f++;
+}
+
+#else /* __cplusplus */
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (char *to, char *from, unsigned int count)
+{
+ register char *t = to;
+ register char *f = from;
+ register int i = count;
+
+ while (i-- > 0)
+ *t++ = *f++;
+}
+
+#endif
+#endif
+
+#line 217 "/usr/local/share/bison.simple"
+
+/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+ into yyparse. The argument should have type void *.
+ It should actually point to an object.
+ Grammar actions can access the variable by casting it
+ to the proper pointer type. */
+
+#ifdef YYPARSE_PARAM
+#ifdef __cplusplus
+#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL
+#else /* not __cplusplus */
+#define YYPARSE_PARAM_ARG YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+#endif /* not __cplusplus */
+#else /* not YYPARSE_PARAM */
+#define YYPARSE_PARAM_ARG
+#define YYPARSE_PARAM_DECL
+#endif /* not YYPARSE_PARAM */
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+#ifdef YYPARSE_PARAM
+int yyparse (void *);
+#else
+int yyparse (void);
+#endif
+#endif
+
+int
+yyparse(YYPARSE_PARAM_ARG)
+ YYPARSE_PARAM_DECL
+{
+ register int yystate;
+ register int yyn;
+ register short *yyssp;
+ register YYSTYPE *yyvsp;
+ int yyerrstatus; /* number of tokens to shift before error messages enabled */
+ int yychar1 = 0; /* lookahead token as an internal (translated) token number */
+
+ short yyssa[YYINITDEPTH]; /* the state stack */
+ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
+
+ short *yyss = yyssa; /* refer to the stacks thru separate pointers */
+ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
+
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
+ YYLTYPE *yyls = yylsa;
+ YYLTYPE *yylsp;
+
+#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+#else
+#define YYPOPSTACK (yyvsp--, yyssp--)
+#endif
+
+ int yystacksize = YYINITDEPTH;
+ int yyfree_stacks = 0;
+
+#ifdef YYPURE
+ int yychar;
+ YYSTYPE yylval;
+ int yynerrs;
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylloc;
+#endif
+#endif
+
+ YYSTYPE yyval; /* the variable used to return */
+ /* semantic values from the action */
+ /* routines */
+
+ int yylen;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Starting parse\n");
+#endif
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = YYEMPTY; /* Cause a token to be read. */
+
+ /* Initialize stack pointers.
+ Waste one element of value and location stack
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+
+ yyssp = yyss - 1;
+ yyvsp = yyvs;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls;
+#endif
+
+/* Push a new state, which is found in yystate . */
+/* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks. */
+yynewstate:
+
+ *++yyssp = yystate;
+
+ if (yyssp >= yyss + yystacksize - 1)
+ {
+ /* Give user a chance to reallocate the stack */
+ /* Use copies of these so that the &'s don't force the real ones into memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+#ifdef YYLSP_NEEDED
+ YYLTYPE *yyls1 = yyls;
+#endif
+
+ /* Get the current used size of the three stacks, in elements. */
+ int size = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ /* Each stack pointer address is followed by the size of
+ the data in use in that stack, in bytes. */
+#ifdef YYLSP_NEEDED
+ /* This used to be a conditional around just the two extra args,
+ but that might be undefined if yyoverflow is a macro. */
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yyls1, size * sizeof (*yylsp),
+ &yystacksize);
+#else
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yystacksize);
+#endif
+
+ yyss = yyss1; yyvs = yyvs1;
+#ifdef YYLSP_NEEDED
+ yyls = yyls1;
+#endif
+#else /* no yyoverflow */
+ /* Extend the stack our own way. */
+ if (yystacksize >= YYMAXDEPTH)
+ {
+ yyerror("parser stack overflow");
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 2;
+ }
+ yystacksize *= 2;
+ if (yystacksize > YYMAXDEPTH)
+ yystacksize = YYMAXDEPTH;
+#ifndef YYSTACK_USE_ALLOCA
+ yyfree_stacks = 1;
+#endif
+ yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
+ __yy_memcpy ((char *)yyss, (char *)yyss1,
+ size * (unsigned int) sizeof (*yyssp));
+ yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
+ __yy_memcpy ((char *)yyvs, (char *)yyvs1,
+ size * (unsigned int) sizeof (*yyvsp));
+#ifdef YYLSP_NEEDED
+ yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
+ __yy_memcpy ((char *)yyls, (char *)yyls1,
+ size * (unsigned int) sizeof (*yylsp));
+#endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + size - 1;
+ yyvsp = yyvs + size - 1;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls + size - 1;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Stack size increased to %d\n", yystacksize);
+#endif
+
+ if (yyssp >= yyss + yystacksize - 1)
+ YYABORT;
+ }
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Entering state %d\n", yystate);
+#endif
+
+ goto yybackup;
+ yybackup:
+
+/* Do appropriate processing given the current state. */
+/* Read a lookahead token if we need one and don't already have one. */
+/* yyresume: */
+
+ /* First try to decide what to do without reference to lookahead token. */
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* yychar is either YYEMPTY or YYEOF
+ or a valid token in external form. */
+
+ if (yychar == YYEMPTY)
+ {
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Reading a token: ");
+#endif
+ yychar = YYLEX;
+ }
+
+ /* Convert token to internal form (in yychar1) for indexing tables with */
+
+ if (yychar <= 0) /* This means end of input. */
+ {
+ yychar1 = 0;
+ yychar = YYEOF; /* Don't call YYLEX any more */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Now at end of input.\n");
+#endif
+ }
+ else
+ {
+ yychar1 = YYTRANSLATE(yychar);
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+ /* Give the individual parser a way to print the precise meaning
+ of a token, for further debugging info. */
+#ifdef YYPRINT
+ YYPRINT (stderr, yychar, yylval);
+#endif
+ fprintf (stderr, ")\n");
+ }
+#endif
+ }
+
+ yyn += yychar1;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
+ goto yydefault;
+
+ yyn = yytable[yyn];
+
+ /* yyn is what to do for this token type in this state.
+ Negative => reduce, -yyn is rule number.
+ Positive => shift, yyn is new state.
+ New state is final state => don't bother to shift,
+ just return success.
+ 0, or most negative number => error. */
+
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrlab;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the lookahead token. */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
+#endif
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ /* count tokens shifted since error; after three, turn off error status. */
+ if (yyerrstatus) yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+/* Do the default action for the current state. */
+yydefault:
+
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+
+/* Do a reduction. yyn is the number of a rule to reduce with. */
+yyreduce:
+ yylen = yyr2[yyn];
+ if (yylen > 0)
+ yyval = yyvsp[1-yylen]; /* implement default value of the action */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ int i;
+
+ fprintf (stderr, "Reducing via rule %d (line %d), ",
+ yyn, yyrline[yyn]);
+
+ /* Print the symbols being reduced, and their result. */
+ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
+ fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+ fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+ }
+#endif
+
+
+ switch (yyn) {
+
+case 1:
+#line 175 "plural.y"
+{
+ if (yyvsp[0].exp == NULL)
+ YYABORT;
+ ((struct parse_args *) arg)->res = yyvsp[0].exp;
+ ;
+ break;}
+case 2:
+#line 183 "plural.y"
+{
+ yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp);
+ ;
+ break;}
+case 3:
+#line 187 "plural.y"
+{
+ yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp);
+ ;
+ break;}
+case 4:
+#line 191 "plural.y"
+{
+ yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp);
+ ;
+ break;}
+case 5:
+#line 195 "plural.y"
+{
+ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
+ ;
+ break;}
+case 6:
+#line 199 "plural.y"
+{
+ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
+ ;
+ break;}
+case 7:
+#line 203 "plural.y"
+{
+ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
+ ;
+ break;}
+case 8:
+#line 207 "plural.y"
+{
+ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
+ ;
+ break;}
+case 9:
+#line 211 "plural.y"
+{
+ yyval.exp = new_exp_1 (lnot, yyvsp[0].exp);
+ ;
+ break;}
+case 10:
+#line 215 "plural.y"
+{
+ yyval.exp = new_exp_0 (var);
+ ;
+ break;}
+case 11:
+#line 219 "plural.y"
+{
+ if ((yyval.exp = new_exp_0 (num)) != NULL)
+ yyval.exp->val.num = yyvsp[0].num;
+ ;
+ break;}
+case 12:
+#line 224 "plural.y"
+{
+ yyval.exp = yyvsp[-1].exp;
+ ;
+ break;}
+}
+ /* the action file gets copied in in place of this dollarsign */
+#line 543 "/usr/local/share/bison.simple"
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+#ifdef YYLSP_NEEDED
+ yylsp -= yylen;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
+
+ *++yyvsp = yyval;
+
+#ifdef YYLSP_NEEDED
+ yylsp++;
+ if (yylen == 0)
+ {
+ yylsp->first_line = yylloc.first_line;
+ yylsp->first_column = yylloc.first_column;
+ yylsp->last_line = (yylsp-1)->last_line;
+ yylsp->last_column = (yylsp-1)->last_column;
+ yylsp->text = 0;
+ }
+ else
+ {
+ yylsp->last_line = (yylsp+yylen-1)->last_line;
+ yylsp->last_column = (yylsp+yylen-1)->last_column;
+ }
+#endif
+
+ /* Now "shift" the result of the reduction.
+ Determine what state that goes to,
+ based on the state we popped back to
+ and the rule number reduced by. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+ if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTBASE];
+
+ goto yynewstate;
+
+yyerrlab: /* here on detecting error */
+
+ if (! yyerrstatus)
+ /* If not already recovering from an error, report this error. */
+ {
+ ++yynerrs;
+
+#ifdef YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+ if (yyn > YYFLAG && yyn < YYLAST)
+ {
+ int size = 0;
+ char *msg;
+ int x, count;
+
+ count = 0;
+ /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ size += strlen(yytname[x]) + 15, count++;
+ msg = (char *) malloc(size + 15);
+ if (msg != 0)
+ {
+ strcpy(msg, "parse error");
+
+ if (count < 5)
+ {
+ count = 0;
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ {
+ strcat(msg, count == 0 ? ", expecting `" : " or `");
+ strcat(msg, yytname[x]);
+ strcat(msg, "'");
+ count++;
+ }
+ }
+ yyerror(msg);
+ free(msg);
+ }
+ else
+ yyerror ("parse error; also virtual memory exceeded");
+ }
+ else
+#endif /* YYERROR_VERBOSE */
+ yyerror("parse error");
+ }
+
+ goto yyerrlab1;
+yyerrlab1: /* here on error raised explicitly by an action */
+
+ if (yyerrstatus == 3)
+ {
+ /* if just tried and failed to reuse lookahead token after an error, discard it. */
+
+ /* return failure if at end of input */
+ if (yychar == YYEOF)
+ YYABORT;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
+#endif
+
+ yychar = YYEMPTY;
+ }
+
+ /* Else will try to reuse lookahead token
+ after shifting the error token. */
+
+ yyerrstatus = 3; /* Each real token shifted decrements this */
+
+ goto yyerrhandle;
+
+yyerrdefault: /* current state does not do anything special for the error token. */
+
+#if 0
+ /* This is wrong; only states that explicitly want error tokens
+ should shift them. */
+ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
+ if (yyn) goto yydefault;
+#endif
+
+yyerrpop: /* pop the current state because it cannot handle the error token */
+
+ if (yyssp == yyss) YYABORT;
+ yyvsp--;
+ yystate = *--yyssp;
+#ifdef YYLSP_NEEDED
+ yylsp--;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "Error: state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
+
+yyerrhandle:
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yyerrdefault;
+
+ yyn += YYTERROR;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+ goto yyerrdefault;
+
+ yyn = yytable[yyn];
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrpop;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrpop;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting error token, ");
+#endif
+
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ yystate = yyn;
+ goto yynewstate;
+
+ yyacceptlab:
+ /* YYACCEPT comes here. */
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 0;
+
+ yyabortlab:
+ /* YYABORT comes here. */
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 1;
+}
+#line 229 "plural.y"
+
+
+void
+internal_function
+FREE_EXPRESSION (exp)
+ struct expression *exp;
+{
+ if (exp == NULL)
+ return;
+
+ /* Handle the recursive case. */
+ switch (exp->nargs)
+ {
+ case 3:
+ FREE_EXPRESSION (exp->val.args[2]);
+ /* FALLTHROUGH */
+ case 2:
+ FREE_EXPRESSION (exp->val.args[1]);
+ /* FALLTHROUGH */
+ case 1:
+ FREE_EXPRESSION (exp->val.args[0]);
+ /* FALLTHROUGH */
+ default:
+ break;
+ }
+
+ free (exp);
+}
+
+
+static int
+yylex (lval, pexp)
+ YYSTYPE *lval;
+ const char **pexp;
+{
+ const char *exp = *pexp;
+ int result;
+
+ while (1)
+ {
+ if (exp[0] == '\0')
+ {
+ *pexp = exp;
+ return YYEOF;
+ }
+
+ if (exp[0] != ' ' && exp[0] != '\t')
+ break;
+
+ ++exp;
+ }
+
+ result = *exp++;
+ switch (result)
+ {
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ {
+ unsigned long int n = result - '0';
+ while (exp[0] >= '0' && exp[0] <= '9')
+ {
+ n *= 10;
+ n += exp[0] - '0';
+ ++exp;
+ }
+ lval->num = n;
+ result = NUMBER;
+ }
+ break;
+
+ case '=':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = equal;
+ result = EQUOP2;
+ }
+ else
+ result = YYERRCODE;
+ break;
+
+ case '!':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = not_equal;
+ result = EQUOP2;
+ }
+ break;
+
+ case '&':
+ case '|':
+ if (exp[0] == result)
+ ++exp;
+ else
+ result = YYERRCODE;
+ break;
+
+ case '<':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = less_or_equal;
+ }
+ else
+ lval->op = less_than;
+ result = CMPOP2;
+ break;
+
+ case '>':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = greater_or_equal;
+ }
+ else
+ lval->op = greater_than;
+ result = CMPOP2;
+ break;
+
+ case '*':
+ lval->op = mult;
+ result = MULOP2;
+ break;
+
+ case '/':
+ lval->op = divide;
+ result = MULOP2;
+ break;
+
+ case '%':
+ lval->op = module;
+ result = MULOP2;
+ break;
+
+ case '+':
+ lval->op = plus;
+ result = ADDOP2;
+ break;
+
+ case '-':
+ lval->op = minus;
+ result = ADDOP2;
+ break;
+
+ case 'n':
+ case '?':
+ case ':':
+ case '(':
+ case ')':
+ /* Nothing, just return the character. */
+ break;
+
+ case ';':
+ case '\n':
+ case '\0':
+ /* Be safe and let the user call this function again. */
+ --exp;
+ result = YYEOF;
+ break;
+
+ default:
+ result = YYERRCODE;
+#if YYDEBUG != 0
+ --exp;
+#endif
+ break;
+ }
+
+ *pexp = exp;
+
+ return result;
+}
+
+
+static void
+yyerror (str)
+ const char *str;
+{
+ /* Do nothing. We don't print error messages here. */
+}
diff --git a/intl/plural.y b/intl/plural.y
new file mode 100644
index 00000000..616b7c11
--- /dev/null
+++ b/intl/plural.y
@@ -0,0 +1,409 @@
+%{
+/* Expression parsing for plural form selection.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+/* The bison generated parser uses alloca. AIX 3 forces us to put this
+ declaration at the beginning of the file. The declaration in bison's
+ skeleton file comes too late. This must come before <config.h>
+ because <config.h> may include arbitrary system headers. */
+#if defined _AIX && !defined __GNUC__
+ #pragma alloca
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#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 <op> EQUOP2 CMPOP2 ADDOP2 MULOP2
+%token <num> NUMBER
+%type <exp> exp
+
+%%
+
+start: exp
+ {
+ if ($1 == NULL)
+ YYABORT;
+ ((struct parse_args *) arg)->res = $1;
+ }
+ ;
+
+exp: exp '?' exp ':' exp
+ {
+ $$ = new_exp_3 (qmop, $1, $3, $5);
+ }
+ | exp '|' exp
+ {
+ $$ = new_exp_2 (lor, $1, $3);
+ }
+ | exp '&' exp
+ {
+ $$ = new_exp_2 (land, $1, $3);
+ }
+ | exp EQUOP2 exp
+ {
+ $$ = new_exp_2 ($2, $1, $3);
+ }
+ | exp CMPOP2 exp
+ {
+ $$ = new_exp_2 ($2, $1, $3);
+ }
+ | exp ADDOP2 exp
+ {
+ $$ = new_exp_2 ($2, $1, $3);
+ }
+ | exp MULOP2 exp
+ {
+ $$ = new_exp_2 ($2, $1, $3);
+ }
+ | '!' exp
+ {
+ $$ = new_exp_1 (lnot, $2);
+ }
+ | 'n'
+ {
+ $$ = new_exp_0 (var);
+ }
+ | NUMBER
+ {
+ if (($$ = new_exp_0 (num)) != NULL)
+ $$->val.num = $1;
+ }
+ | '(' exp ')'
+ {
+ $$ = $2;
+ }
+ ;
+
+%%
+
+void
+internal_function
+FREE_EXPRESSION (exp)
+ struct expression *exp;
+{
+ if (exp == NULL)
+ return;
+
+ /* Handle the recursive case. */
+ switch (exp->nargs)
+ {
+ case 3:
+ FREE_EXPRESSION (exp->val.args[2]);
+ /* FALLTHROUGH */
+ case 2:
+ FREE_EXPRESSION (exp->val.args[1]);
+ /* FALLTHROUGH */
+ case 1:
+ FREE_EXPRESSION (exp->val.args[0]);
+ /* FALLTHROUGH */
+ default:
+ break;
+ }
+
+ free (exp);
+}
+
+
+static int
+yylex (lval, pexp)
+ YYSTYPE *lval;
+ const char **pexp;
+{
+ const char *exp = *pexp;
+ int result;
+
+ while (1)
+ {
+ if (exp[0] == '\0')
+ {
+ *pexp = exp;
+ return YYEOF;
+ }
+
+ if (exp[0] != ' ' && exp[0] != '\t')
+ break;
+
+ ++exp;
+ }
+
+ result = *exp++;
+ switch (result)
+ {
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ {
+ unsigned long int n = result - '0';
+ while (exp[0] >= '0' && exp[0] <= '9')
+ {
+ n *= 10;
+ n += exp[0] - '0';
+ ++exp;
+ }
+ lval->num = n;
+ result = NUMBER;
+ }
+ break;
+
+ case '=':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = equal;
+ result = EQUOP2;
+ }
+ else
+ result = YYERRCODE;
+ break;
+
+ case '!':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = not_equal;
+ result = EQUOP2;
+ }
+ break;
+
+ case '&':
+ case '|':
+ if (exp[0] == result)
+ ++exp;
+ else
+ result = YYERRCODE;
+ break;
+
+ case '<':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = less_or_equal;
+ }
+ else
+ lval->op = less_than;
+ result = CMPOP2;
+ break;
+
+ case '>':
+ if (exp[0] == '=')
+ {
+ ++exp;
+ lval->op = greater_or_equal;
+ }
+ else
+ lval->op = greater_than;
+ result = CMPOP2;
+ break;
+
+ case '*':
+ lval->op = mult;
+ result = MULOP2;
+ break;
+
+ case '/':
+ lval->op = divide;
+ result = MULOP2;
+ break;
+
+ case '%':
+ lval->op = module;
+ result = MULOP2;
+ break;
+
+ case '+':
+ lval->op = plus;
+ result = ADDOP2;
+ break;
+
+ case '-':
+ lval->op = minus;
+ result = ADDOP2;
+ break;
+
+ case 'n':
+ case '?':
+ case ':':
+ case '(':
+ case ')':
+ /* Nothing, just return the character. */
+ break;
+
+ case ';':
+ case '\n':
+ case '\0':
+ /* Be safe and let the user call this function again. */
+ --exp;
+ result = YYEOF;
+ break;
+
+ default:
+ result = YYERRCODE;
+#if YYDEBUG != 0
+ --exp;
+#endif
+ break;
+ }
+
+ *pexp = exp;
+
+ return result;
+}
+
+
+static void
+yyerror (str)
+ const char *str;
+{
+ /* Do nothing. We don't print error messages here. */
+}
diff --git a/intl/po2tbl.sed.in b/intl/po2tbl.sed.in
deleted file mode 100644
index b3bcca4d..00000000
--- a/intl/po2tbl.sed.in
+++ /dev/null
@@ -1,102 +0,0 @@
-# po2tbl.sed - Convert Uniforum style .po file to lookup table for catgets
-# Copyright (C) 1995 Free Software Foundation, Inc.
-# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-1 {
- i\
-/* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot. */\
-\
-#if HAVE_CONFIG_H\
-# include <config.h>\
-#endif\
-\
-#include "libgettext.h"\
-\
-const struct _msg_ent _msg_tbl[] = {
- h
- s/.*/0/
- x
-}
-#
-# Write msgid entries in C array form.
-#
-/^msgid/ {
- s/msgid[ ]*\(".*"\)/ {\1/
- tb
-# Append the next line
- :b
- N
-# Look whether second part is continuation line.
- s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/
-# Yes, then branch.
- ta
-# Because we assume that the input file correctly formed the line
-# just read cannot be again be a msgid line. So it's safe to ignore
-# it.
- s/\(.*\)\n.*/\1/
- bc
-# We found a continuation line. But before printing insert '\'.
- :a
- s/\(.*\)\(\n.*\)/\1\\\2/
- P
-# We cannot use D here.
- s/.*\n\(.*\)/\1/
-# Some buggy seds do not clear the `successful substitution since last ``t'''
-# flag on `N', so we do a `t' here to clear it.
- tb
-# Not reached
- :c
- x
-# The following nice solution is by
-# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
- td
-# Increment a decimal number in pattern space.
-# First hide trailing `9' digits.
- :d
- s/9\(_*\)$/_\1/
- td
-# Assure at least one digit is available.
- s/^\(_*\)$/0\1/
-# Increment the last digit.
- s/8\(_*\)$/9\1/
- s/7\(_*\)$/8\1/
- s/6\(_*\)$/7\1/
- s/5\(_*\)$/6\1/
- s/4\(_*\)$/5\1/
- s/3\(_*\)$/4\1/
- s/2\(_*\)$/3\1/
- s/1\(_*\)$/2\1/
- s/0\(_*\)$/1\1/
-# Convert the hidden `9' digits to `0's.
- s/_/0/g
- x
- G
- s/\(.*\)\n\([0-9]*\)/\1, \2},/
- s/\(.*\)"$/\1/
- p
-}
-#
-# Last line.
-#
-$ {
- i\
-};\
-
- g
- s/0*\(.*\)/int _msg_tbl_length = \1;/p
-}
-d
diff --git a/intl/ref-add.sin b/intl/ref-add.sin
new file mode 100644
index 00000000..167374e3
--- /dev/null
+++ b/intl/ref-add.sin
@@ -0,0 +1,31 @@
+# Add this package to a list of references stored in a text file.
+#
+# Copyright (C) 2000 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Library General Public License as published
+# by the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+# USA.
+#
+# Written by Bruno Haible <haible@clisp.cons.org>.
+#
+/^# Packages using this file: / {
+ s/# Packages using this file://
+ ta
+ :a
+ s/ @PACKAGE@ / @PACKAGE@ /
+ tb
+ s/ $/ @PACKAGE@ /
+ :b
+ s/^/# Packages using this file:/
+}
diff --git a/intl/ref-del.sin b/intl/ref-del.sin
new file mode 100644
index 00000000..613cf37f
--- /dev/null
+++ b/intl/ref-del.sin
@@ -0,0 +1,26 @@
+# Remove this package from a list of references stored in a text file.
+#
+# Copyright (C) 2000 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Library General Public License as published
+# by the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+# USA.
+#
+# Written by Bruno Haible <haible@clisp.cons.org>.
+#
+/^# Packages using this file: / {
+ s/# Packages using this file://
+ s/ @PACKAGE@ / /
+ s/^/# Packages using this file:/
+}
diff --git a/intl/textdomain.c b/intl/textdomain.c
index 88557460..8fb4ea08 100644
--- a/intl/textdomain.c
+++ b/intl/textdomain.c
@@ -1,51 +1,60 @@
/* Implementation of the textdomain(3) function.
- Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
- Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+ 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 General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ 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 General Public License for more details.
+ 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. */
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#if defined STDC_HEADERS || defined _LIBC
-# include <stdlib.h>
-#endif
+#include <stdlib.h>
+#include <string.h>
-#if defined STDC_HEADERS || defined HAVE_STRING_H || defined _LIBC
-# include <string.h>
+#ifdef _LIBC
+# include <libintl.h>
#else
-# include <strings.h>
-# ifndef memcpy
-# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
-# endif
+# include "libgnuintl.h"
#endif
+#include "gettextP.h"
#ifdef _LIBC
-# include <libintl.h>
+/* We have to handle multi-threaded applications. */
+# include <bits/libc-lock.h>
#else
-# include "libgettext.h"
+/* 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[];
+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;
+extern const char *_nl_current_default_domain attribute_hidden;
/* Names for the libintl functions are a problem. They must not clash
@@ -61,6 +70,9 @@ extern const char *_nl_current_default_domain;
# 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". */
@@ -68,38 +80,60 @@ char *
TEXTDOMAIN (domainname)
const char *domainname;
{
- char *old;
+ char *new_domain;
+ char *old_domain;
/* A NULL pointer requests the current setting. */
if (domainname == NULL)
return (char *) _nl_current_default_domain;
- old = (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;
+ {
+ _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
- _nl_current_default_domain = strdup (domainname);
+ new_domain = strdup (domainname);
#else
size_t len = strlen (domainname) + 1;
- char *cp = (char *) malloc (len);
- if (cp != NULL)
- memcpy (cp, domainname, len);
- _nl_current_default_domain = cp;
+ 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);
}
- if (old != _nl_default_default_domain)
- free (old);
+ __libc_rwlock_unlock (_nl_state_lock);
- return (char *) _nl_current_default_domain;
+ return new_domain;
}
#ifdef _LIBC
diff --git a/intl/xopen-msg.sed b/intl/xopen-msg.sed
deleted file mode 100644
index b19c0bbd..00000000
--- a/intl/xopen-msg.sed
+++ /dev/null
@@ -1,104 +0,0 @@
-# po2msg.sed - Convert Uniforum style .po file to X/Open style .msg file
-# Copyright (C) 1995 Free Software Foundation, Inc.
-# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-#
-# The first directive in the .msg should be the definition of the
-# message set number. We use always set number 1.
-#
-1 {
- i\
-$set 1 # Automatically created by po2msg.sed
- h
- s/.*/0/
- x
-}
-#
-# We copy all comments into the .msg file. Perhaps they can help.
-#
-/^#/ s/^#[ ]*/$ /p
-#
-# We copy the original message as a comment into the .msg file.
-#
-/^msgid/ {
-# Does not work now
-# /"$/! {
-# s/\\$//
-# s/$/ ... (more lines following)"/
-# }
- s/^msgid[ ]*"\(.*\)"$/$ Original Message: \1/
- p
-}
-#
-# The .msg file contains, other then the .po file, only the translations
-# but each given a unique ID. Starting from 1 and incrementing by 1 for
-# each message we assign them to the messages.
-# It is important that the .po file used to generate the cat-id-tbl.c file
-# (with po-to-tbl) is the same as the one used here. (At least the order
-# of declarations must not be changed.)
-#
-/^msgstr/ {
- s/msgstr[ ]*"\(.*\)"/\1/
- x
-# The following nice solution is by
-# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
- td
-# Increment a decimal number in pattern space.
-# First hide trailing `9' digits.
- :d
- s/9\(_*\)$/_\1/
- td
-# Assure at least one digit is available.
- s/^\(_*\)$/0\1/
-# Increment the last digit.
- s/8\(_*\)$/9\1/
- s/7\(_*\)$/8\1/
- s/6\(_*\)$/7\1/
- s/5\(_*\)$/6\1/
- s/4\(_*\)$/5\1/
- s/3\(_*\)$/4\1/
- s/2\(_*\)$/3\1/
- s/1\(_*\)$/2\1/
- s/0\(_*\)$/1\1/
-# Convert the hidden `9' digits to `0's.
- s/_/0/g
- x
-# Bring the line in the format `<number> <message>'
- G
- s/^[^\n]*$/& /
- s/\(.*\)\n\([0-9]*\)/\2 \1/
-# Clear flag from last substitution.
- tb
-# Append the next line.
- :b
- N
-# Look whether second part is a continuation line.
- s/\(.*\n\)"\(.*\)"/\1\2/
-# Yes, then branch.
- ta
- P
- D
-# Note that `D' includes a jump to the start!!
-# We found a continuation line. But before printing insert '\'.
- :a
- s/\(.*\)\(\n.*\)/\1\\\2/
- P
-# We cannot use the sed command `D' here
- s/.*\n\(.*\)/\1/
- tb
-}
-d
diff --git a/io.c b/io.c
index 7589185c..bfd0b9bd 100644
--- a/io.c
+++ b/io.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1976, 1988, 1989, 1991-2001 the Free Software Foundation, Inc.
+ * 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,8 +57,8 @@
#endif /* HAVE_NETDB_H */
#endif /* HAVE_SOCKETS */
-#if ! defined(S_ISREG) && defined(S_IFREG)
-#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#ifdef __EMX__
+#include <process.h>
#endif
#ifndef ENFILE
@@ -88,7 +88,7 @@ enum inet_prot { INET_NONE, INET_TCP, INET_UDP, INET_RAW };
#include <stddef.h>
#endif
-#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(TANDEM)
+#if defined(MSDOS) || defined(WIN32) || defined(TANDEM)
#define PIPES_SIMULATED
#endif
@@ -135,7 +135,7 @@ extern NODE **fields_arr;
static jmp_buf filebuf; /* for do_nextfile() */
-#if defined(MSDOS) || defined(OS2)
+#if defined(MSDOS) || defined(OS2) || defined(__EMX__)
static const char *
binmode(char *mode)
{
@@ -336,7 +336,7 @@ iop_close(IOBUF *iop)
fields_arr[0] = t;
reset_record();
}
- free(iop->buf);
+ free(iop->buf);
}
if ((iop->flag & IOP_NOFREE_OBJ) == 0)
free((char *) iop);
@@ -595,7 +595,7 @@ redirect(NODE *tree, int *errflg)
/* too many files open -- close one and try again */
if (errno == EMFILE || errno == ENFILE)
close_one();
-#if defined __MINGW32__ || defined solaris
+#if defined __MINGW32__ || defined __sun
else if (errno == 0) /* HACK! */
close_one();
#endif
@@ -1223,7 +1223,7 @@ devopen(const char *name, const char *mode)
/*
* 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.
+ * Therefore no need to patch any string ending.
*
* Here too, require a port, let them explicitly put 0 if
* they don't care.
@@ -1355,10 +1355,6 @@ useropen(IOBUF *iop, const char *name, const char *mode)
{
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'"));
@@ -1366,10 +1362,6 @@ useropen(IOBUF *iop, const char *name, const char *mode)
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]);
@@ -1445,7 +1437,8 @@ strictopen:
if (os_isdir(openfd))
fatal(_("file `%s' is a directory"), name);
- os_close_on_exec(openfd, name, "file", "");
+ if (openfd > fileno(stderr))
+ os_close_on_exec(openfd, name, "file", "");
}
return iop_alloc(openfd, name, iop);
}
@@ -1519,6 +1512,9 @@ two_way_open(char *str, struct redirect *rp)
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,6 +1527,65 @@ two_way_open(char *str, struct redirect *rp)
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,6 +1612,7 @@ two_way_open(char *str, struct redirect *rp)
execl("/bin/sh", "sh", "-c", str, NULL);
_exit(127);
}
+#endif /* NOT __EMX__ */
/* parent */
rp->pid = pid;
@@ -1567,6 +1623,7 @@ two_way_open(char *str, struct redirect *rp)
(void) close(ptoc[0]);
(void) close(ptoc[1]);
(void) kill(pid, SIGKILL); /* overkill? (pardon pun) */
+
return FALSE;
}
rp->fp = fdopen(ptoc[1], "w");
@@ -1578,18 +1635,18 @@ two_way_open(char *str, struct redirect *rp)
(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));;
- }
+
+#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,6 +1707,9 @@ gawk_popen(char *cmd, struct redirect *rp)
{
int p[2];
register int pid;
+#ifdef __EMX__
+ int save_stdout;
+#endif
/*
* used to wait for any children to synchronize input and output,
@@ -1660,6 +1720,32 @@ gawk_popen(char *cmd, struct redirect *rp)
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,15 +1757,20 @@ gawk_popen(char *cmd, struct redirect *rp)
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,7 +1798,7 @@ gawk_pclose(struct redirect *rp)
* except if popen() provides real pipes too
*/
-#if defined(VMS) || defined(OS2) || defined (MSDOS) || defined(WIN32) || defined(TANDEM)
+#if defined(VMS) || defined(OS2) || defined (MSDOS) || defined(WIN32) || defined(TANDEM) || defined(__EMX__)
/* gawk_popen --- open an IOBUF on a child process */
@@ -1923,8 +2014,9 @@ do_pathopen(const char *file)
static const char *savepath = NULL;
static int first = TRUE;
const char *awkpath;
- char *cp, trypath[BUFSIZ];
+ char *cp, *trypath;
int fd;
+ int len;
if (STREQ(file, "-"))
return (0);
@@ -1945,9 +2037,13 @@ do_pathopen(const char *file)
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';
- /* this should take into account limits on size of trypath */
+
for (cp = trypath; *awkpath && *awkpath != envsep; )
*cp++ = *awkpath++;
@@ -1959,13 +2055,17 @@ do_pathopen(const char *file)
strcpy(cp, file);
} else
strcpy(trypath, file);
- if ((fd = devopen(trypath, "r")) > INVALID_HANDLE)
+ 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,6 +2153,10 @@ get_a_record(char **out, /* pointer to pointer to data */
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,6 +2390,12 @@ get_a_record(char **out, /* pointer to pointer to data */
*/
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,6 +2405,25 @@ get_a_record(char **out, /* pointer to pointer to data */
break;
}
/* search for RS, #2, RS = <single char> */
+#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 --git a/m4/ChangeLog b/m4/ChangeLog
new file mode 100644
index 00000000..295e4d0d
--- /dev/null
+++ b/m4/ChangeLog
@@ -0,0 +1,14 @@
+Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.1: Release tar file made.
+
+2002-04-28 gettextize <bug-gnu-gettext@gnu.org>
+
+ * 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 <bug-gnu-gettext@gnu.org>
+
+ * gettext.m4: Upgrade to gettext-0.11.1.
+
diff --git a/m4/codeset.m4 b/m4/codeset.m4
new file mode 100644
index 00000000..59535ebc
--- /dev/null
+++ b/m4/codeset.m4
@@ -0,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 <langinfo.h>],
+ [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 <langinfo.h> and nl_langinfo(CODESET).])
+ fi
+])
diff --git a/m4/gettext.m4 b/m4/gettext.m4
index 8eeb3e34..94bc26c8 100644
--- a/m4/gettext.m4
+++ b/m4/gettext.m4
@@ -1,29 +1,100 @@
-# Macro to add for using GNU gettext.
-# Ulrich Drepper <drepper@cygnus.com>, 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)
+# 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 <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 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
+ ])
- USE_INCLUDED_LIBINTL=no
+ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
- 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 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,290 +104,436 @@ AC_DEFUN(AM_WITH_NLS,
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 <libintl.h>], [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
+ 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 <libintl.h>
+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 <libintl.h>
+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 <libintl.h>
+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
- 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
+ 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)"
- 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
+ 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
- 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
+ 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
+ ])
- # We need to process the po/ directory.
- POSUB=po
+ 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
- DATADIRNAME=share
- nls_cv_header_intl=intl/libintl.h
- nls_cv_header_libgt=intl/libgettext.h
+ USE_NLS=no
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
+
+ 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
- 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])
+ dnl We need to process the po/ directory.
+ POSUB=po
+ fi
- # 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.
+ 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
- USE_NLS=yes
- USE_INCLUDED_LIBINTL=yes
+ BUILD_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(BUILD_INCLUDED_LIBINTL)
AC_SUBST(USE_INCLUDED_LIBINTL)
- AC_SUBST(CATALOGS)
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)
- AC_SUBST(GMOFILES)
+
+ dnl For backward compatibility. Some Makefiles may be using this.
+ INSTOBJEXT=.mo
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 <locale.h> in the installed <libintl.h> 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 <locale.h>"
- else
- INCLUDE_LOCALE_H="\
-/* The system does not provide the header <locale.h>. 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
+ 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 --git a/m4/glibc21.m4 b/m4/glibc21.m4
new file mode 100644
index 00000000..9c9f3db3
--- /dev/null
+++ b/m4/glibc21.m4
@@ -0,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 <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
+ Lucky GNU user
+ #endif
+#endif
+ ],
+ ac_cv_gnu_library_2_1=yes,
+ ac_cv_gnu_library_2_1=no)
+ ]
+ )
+ AC_SUBST(GLIBC21)
+ GLIBC21="$ac_cv_gnu_library_2_1"
+ ]
+)
diff --git a/m4/iconv.m4 b/m4/iconv.m4
new file mode 100644
index 00000000..f81e8b99
--- /dev/null
+++ b/m4/iconv.m4
@@ -0,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 <stdlib.h>
+#include <iconv.h>],
+ [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 <stdlib.h>
+#include <iconv.h>],
+ [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 <stdlib.h>
+#include <iconv.h>
+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 --git a/m4/isc-posix.m4 b/m4/isc-posix.m4
new file mode 100644
index 00000000..1319dd1c
--- /dev/null
+++ b/m4/isc-posix.m4
@@ -0,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 --git a/m4/lcmessage.m4 b/m4/lcmessage.m4
index 7ff8b759..ffbf915f 100644
--- a/m4/lcmessage.m4
+++ b/m4/lcmessage.m4
@@ -1,22 +1,32 @@
-# Check whether LC_MESSAGES is available in <locale.h>.
-# Ulrich Drepper <drepper@cygnus.com>, 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.
+# 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.
-# serial 2
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
-AC_PREREQ(2.13) dnl Minimum Autoconf version required.
+# Check whether LC_MESSAGES is available in <locale.h>.
-AC_DEFUN(AM_LC_MESSAGES,
+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 <locale.h>], [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.])
+ [Define if your <locale.h> file defines LC_MESSAGES.])
fi
fi])
diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4
new file mode 100644
index 00000000..ddb57323
--- /dev/null
+++ b/m4/lib-ld.m4
@@ -0,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 </dev/null | egrep '(GNU|with BFD)' 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 --git a/m4/lib-link.m4 b/m4/lib-link.m4
new file mode 100644
index 00000000..09f7f172
--- /dev/null
+++ b/m4/lib-link.m4
@@ -0,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 --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
new file mode 100644
index 00000000..b8b79ab9
--- /dev/null
+++ b/m4/lib-prefix.m4
@@ -0,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 --git a/m4/progtest.m4 b/m4/progtest.m4
index 2482d4a9..443c8e30 100644
--- a/m4/progtest.m4
+++ b/m4/progtest.m4
@@ -1,16 +1,28 @@
-# Search path for a program which passes the given test.
-# Ulrich Drepper <drepper@cygnus.com>, 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.
+# 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 <drepper@cygnus.com>, 1996.
-# serial 1
+# 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,
+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,7 +50,7 @@ ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
;;
esac])dnl
$1="$ac_cv_path_$1"
-if test -n "[$]$1"; then
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
diff --git a/m4/strtod.m4 b/m4/strtod.m4
index a719fb92..8185e6cf 100644
--- a/m4/strtod.m4
+++ b/m4/strtod.m4
@@ -1,7 +1,7 @@
dnl
dnl strtod.m4 --- autoconf input file for gawk
dnl
-dnl Copyright (C) 2001 the Free Software Foundation, Inc.
+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,6 +49,7 @@ main ()
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 --git a/main.c b/main.c
index 35308f88..bb772d93 100644
--- a/main.c
+++ b/main.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2001 the Free Software Foundation, Inc.
+ * 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,6 +54,7 @@ RETSIGTYPE catchsig P((int sig, int code));
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,11 +120,17 @@ int do_tidy_mem = FALSE; /* release vars when done */
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,6 +186,9 @@ main(int argc, char **argv)
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,7 +197,9 @@ main(int argc, char **argv)
setlocale(LC_CTYPE, "");
setlocale(LC_COLLATE, "");
- /* setlocale (LC_ALL, ""); */
+#if HAVE_LC_MESSAGES
+ setlocale(LC_MESSAGES, "");
+#endif
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
@@ -238,6 +250,9 @@ main(int argc, char **argv)
/* 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,7 +446,7 @@ out:
}
if (do_lint && os_is_setuid())
- warning(_("runing %s setuid root may be a security problem"), myname);
+ warning(_("running %s setuid root may be a security problem"), myname);
/*
* Tell the regex routines how they should work.
@@ -536,8 +551,8 @@ out:
static void
usage(int exitval, FILE *fp)
{
- /* Not factoring out common stuff makes it easier to translate. */
+ /* 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,8 +587,20 @@ usage(int exitval, FILE *fp)
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);
+
+
+ /* 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,7 +610,7 @@ static void
copyleft()
{
static char blurb_part1[] =
- N_("Copyright (C) 1989, 1991-2001 Free Software Foundation.\n\
+ 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,7 +629,7 @@ 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");
/* multiple blurbs are needed for some brain dead compilers. */
- fputs(_(blurb_part1), stdout);
+ printf(_(blurb_part1), 2002); /* Last update year */
fputs(_(blurb_part2), stdout);
fputs(_(blurb_part3), stdout);
fflush(stdout);
@@ -773,10 +800,6 @@ load_procinfo()
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));
@@ -824,11 +847,7 @@ load_procinfo()
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));
-
+#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,7 +988,7 @@ nostalgia()
static void
version()
{
- printf("%s.%d\n", version_string, PATCHLEVEL);
+ printf("%s.%s\n", version_string, PATCHLEVEL);
/*
* Per GNU coding standards, print copyright info,
* then exit successfully, do nothing else.
@@ -1002,3 +1021,28 @@ init_fds()
}
}
}
+
+/* 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 --git a/missing_d/ChangeLog b/missing_d/ChangeLog
new file mode 100644
index 00000000..7220065c
--- /dev/null
+++ b/missing_d/ChangeLog
@@ -0,0 +1,15 @@
+Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.1: Release tar file made.
+
+Tue Dec 4 17:56:46 2001 Arnold D. Robbins <arnold@skeeve.com>
+
+ * strftime.c: Replaced with glibc version.
+ * strftime.3: Removed
+
+Fri Aug 3 09:01:19 2001 Arnold D. Robbins <arnold@skeeve.com>
+
+ ChangeLog created.
+
+ * strtod.c (strtod): Fixed test at end for failure to
+ be a little smarter.
diff --git a/missing_d/strftime.3 b/missing_d/strftime.3
deleted file mode 100644
index b017bf45..00000000
--- a/missing_d/strftime.3
+++ /dev/null
@@ -1,359 +0,0 @@
-.TH STRFTIME 3
-.SH NAME
-strftime \- generate formatted time information
-.SH SYNOPSIS
-.ft B
-.nf
-#include <sys/types.h>
-#include <time.h>
-.sp
-size_t strftime(char *s, size_t maxsize, const char *format,
- const struct tm *timeptr);
-.fi
-.SH DESCRIPTION
-The following description is transcribed verbatim from the January 18, 1999
-draft standard for ISO C.
-This draft is essentially identical in technical content
-to the final version of the standard.
-.LP
-``The
-.B strftime
-function places characters into the array pointed to by
-.B s
-as controlled by the string pointed to by
-.BR format .
-The format shall be a multibyte character sequence, beginning and ending in
-its initial shift state.
-The
-.B format
-string consists of zero or more conversion specifiers and ordinary
-multibyte characters. A conversion specifier consists of a
-.B %
-character, possibly followed by an
-.B E
-or
-.B O
-modifier character (described below),
-followed by a character that determines the behavior of the
-conversion specifier.
-All ordinary multibyte characters (including the terminating null
-character) are copied unchanged into the array.
-If copying takes place between objects that overlap the behavior is undefined.
-No more than
-.B maxsize
-characters are placed into the array.
-.PP
-``Each conversion specifier is replaced by appropriate characters as described
-in the following list.
-The appropriate characters are determined by the
-.B LC_TIME
-category of the current locale and by the values
-of zero or more members of the broken-down time
-structure pointed to by
-.BR timeptr ,
-as specified by brackets in the description.
-If any of the specified values is outside the normal range, the characters
-stored are unspecified.''
-.TP
-.B %a
-is replaced by the locale's abbreviated weekday name.
-.TP
-.B %A
-is replaced by the locale's full weekday name.
-.TP
-.B %b
-is replaced by the locale's abbreviated month name.
-.TP
-.B %B
-is replaced by the locale's full month name.
-.TP
-.B %c
-is replaced by the locale's appropriate date and time representation.
-(This is
-.B "%A %B %d %T %Y"
-in the \fB"C"\fR
-locale.)
-.TP
-.B %C
-is replaced by the year divided by 100 and truncated to an integer,
-as a decimal number
-.RB ( 00 - 99 ).
-.TP
-.B %d
-is replaced by the day of the month as a decimal number
-.RB ( 01 - 31 ).
-.TP
-.B %D
-is equivalent to
-.BR %m/%d/%y .
-.TP
-.B %e
-is replaced by the day of the month as a decimal number
-.RB ( 1 - 31 );
-a single digit is preceded by a space.
-.TP
-.B %F
-is equivalent to
-.B %Y\-%m\-%d
-(the ISO 8601 date format).
-.TP
-.B %g
-is replaced by the year without century of the ISO week number
-as a decimal number
-.RB ( 00 - 99 ).
-.TP
-.B %G
-is replaced by the year with century of the ISO week number
-as a decimal number.
-.TP
-.B %h
-is equivalent to
-.BR %b .
-.TP
-.B %H
-is replaced by the hour (24-hour clock) as a decimal number
-.RB ( 00 - 23 ).
-.TP
-.B %I
-is replaced by the hour (12-hour clock) as a decimal number
-.RB ( 01 - 12 ).
-.TP
-.B %j
-is replaced by the day of the year as a decimal number
-.RB ( 001 - 366 ).
-.TP
-.B %m
-is replaced by the month as a decimal number
-.RB ( 01 - 12 ).
-.TP
-.B %M
-is replaced by the minute as a decimal number
-.RB ( 00 - 59 ).
-.TP
-.B %n
-is replaced with a newline character (\s-1ASCII LF\s+1).
-.TP
-.B %p
-is replaced by the locale's equivalent of the AM/PM designations associated
-with a 12-hour clock.
-.TP
-.B %r
-is replaced by the locale's 12-hour clock time.
-(This is
-.B "%I:%M:%S %p"
-in the \fB"C"\fR
-locale.)
-.TP
-.B %R
-is equivalent to
-.BR %H:%M .
-.TP
-.B %S
-is replaced by the second as a decimal number
-.RB ( 00 - 60 ).
-.TP
-.B %t
-is replaced with a \s-1TAB\s+1 character.
-.TP
-.B %T
-is equivalent to
-.BR %H:%M:%S .
-.TP
-.B %u
-is replaced by the ISO 8601 weekday as a decimal number
-.RB [ "1 " (Monday)- 7 ].
-.TP
-.B %U
-is replaced by the week number of the year (the first Sunday as the first
-day of week 1) as a decimal number
-.RB ( 00 - 53 ).
-.TP
-.B %V
-is replaced by the ISO 8601 week number of the year (the first Monday as the first
-day of week 1) as a decimal number
-.RB ( 01 - 53 ).
-.TP
-.B %w
-is replaced by the weekday as a decimal number
-.RB [ "0 " (Sunday)- 6 ].
-.TP
-.B %W
-is replaced by the week number of the year (the first Monday as the first
-day of week 1) as a decimal number
-.RB ( 00 - 53 ).
-.TP
-.B %x
-is replaced by the locale's appropriate date representation.
-(This is
-.B "%A %B %d %Y"
-in the \fB"C"\fR
-locale.)
-.TP
-.B %X
-is replaced by the locale's appropriate time representation.
-(This is
-.B "%T"
-in the \fB"C"\fR
-locale.)
-.TP
-.B %y
-is replaced by the year without century as a decimal number
-.RB ( 00 - 99 ).
-.TP
-.B %Y
-is replaced by the year with century as a decimal number.
-.TP
-.B %z
-The timezone offset in a +HHMM format (e.g. the format necessary to
-produce RFC-822/RFC-1036 date headers).
-.TP
-.B %Z
-is replaced by the time zone name or abbreviation, or by no characters if
-no time zone is determinable.
-.TP
-.B %%
-is replaced by
-.BR % .
-.LP
-If a conversion specifier is not one of the above, the behavior is
-undefined.
-.SH RETURNS
-If the total number of resulting characters including the terminating null
-character is not more than
-.BR maxsize ,
-the
-.B strftime
-function returns the number of characters placed into the array pointed to
-by
-.B s
-not including the terminating null character.
-Otherwise, zero is returned and the contents of the array are indeterminate.
-.SH ISO 8601
-The method for determining the week number as specified by ISO 8601 is:
-if the week containing January 1 has four or more days in the
-new year, then it is week 1, otherwise it is the highest numbered
-week of the previous year (52 or 53)
-and the next week is week 1.
-All days in a new year preceding the first Monday are considered to be
-in week 0.
-.PP
-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.
-.SH ALTERNATE REPRESENTATIONS
-The alternate representations
-.BR %Ec ,
-.BR %EC ,
-.BR %Ex ,
-.BR %EX ,
-.BR %Ey ,
-.BR %EY ,
-.BR %Od ,
-.BR %Oe ,
-.BR %OH ,
-.BR %OI ,
-.BR %Om ,
-.BR %OM ,
-.BR %OS ,
-.BR %Ou ,
-.BR %OU ,
-.BR %OV ,
-.BR %Ow ,
-.BR %OW ,
-and
-.B %Oy
-are recognized, but their normal representations are used.
-.SH NON-ISO EXTENSIONS
-.SS SunOS Extensions
-If
-.B SUNOS_EXT
-is defined when the routine is compiled, then the following additional
-conversions will be available.
-These are borrowed from the SunOS version of
-.IR strftime .
-.TP
-.B %k
-is replaced by the hour (24-hour clock) as a decimal number
-.RB ( 0 - 23 ).
-Single digit numbers are padded with a blank.
-.TP
-.B %l
-is replaced by the hour (12-hour clock) as a decimal number
-.RB ( 1 - 12 ).
-Single digit numbers are padded with a blank.
-.SS HP/UX Extensions
-If
-.B HPUX_EXT
-is defined when the routine is compiled, then the following additional
-conversions will be available.
-These are borrowed from the HP-UX version of
-.IR date .
-.TP
-.B %N
-The ``Emporer/Era'' name.
-Typically, this is equivalent to the century
-(same as
-.B %C ).
-.TP
-.B %o
-The ``Emporer/Era'' year.
-Typically, this is equivalent to the year
-(same as
-.B %y ).
-.SS VMS Extensions
-If
-.B VMS_EXT
-is defined, then the following additional conversion is available:
-.TP
-.B %v
-The date in VMS format (e.g. 20-JUN-1991).
-.SS Other Extensions
-If
-.B HAVE_MKTIME
-is defined, then this conversion is available:
-.TP
-.B %s
-The time in ``seconds since the Epoch,''
-usually Midnight January 1, 1970, UTC.
-.SH SEE ALSO
-.IR time (2),
-.IR ctime (3),
-.IR localtime (3),
-.IR mktime (3),
-.IR tzset (3)
-.SH BUGS
-This version does not handle multibyte characters or pay attention to the
-setting of the
-.B LC_TIME
-environment variable.
-.LP
-The ``appropriate'' values used for
-.BR %c ,
-.BR %x ,
-are
-.B %X
-are always those specified by the 1999 ISO C standard for the \fB"C"\fR locale.
-.SH CAVEATS
-The pre-processor symbol
-.B POSIX_SEMANTICS
-is automatically defined, which forces the code to call
-.IR tzset (3)
-whenever the
-.B TZ
-environment variable has changed.
-If this routine will be used in an application that will not be changing
-.BR TZ ,
-then there may be some performance improvements by not defining
-.BR POSIX_SEMANTICS .
-.SH AUTHOR
-Arnold Robbins <arnold@skeeve.com>
-.SH ACKNOWLEDGEMENTS
-Thanks to Geoff Clare <gwc@root.co.uk> for helping debug earlier
-versions of this routine, and for advice about POSIX semantics.
-Additional thanks to Arthur David Olsen <ado@elsie.nci.nih.gov>
-for some code improvements.
-Thanks also to Tor Lillqvist <tml@tik.vtt.fi>
-for code fixes to the ISO 8601 code.
-Thanks to Hume Smith for pointing out a problem with the ISO 8601 code
-and to Arthur David Olsen for further discussions.
diff --git a/missing_d/strftime.c b/missing_d/strftime.c
index d291e8fd..18350461 100644
--- a/missing_d/strftime.c
+++ b/missing_d/strftime.c
@@ -1,850 +1,1411 @@
-/*
- * strftime.c
- *
- * Public-domain implementation of ISO C library routine.
- *
- * If you can't do prototypes, get GCC.
- *
- * The C99 standard now specifies just about all of the formats
- * that were additional in the earlier versions of this file.
- *
- * For extensions from SunOS, add SUNOS_EXT.
- * For extensions from HP/UX, add HPUX_EXT.
- * For VMS dates, add VMS_EXT.
- * For complete POSIX semantics, add POSIX_SEMANTICS.
- *
- * The code for %c, %x, and %X follows the C99 specification for
- * the "C" locale.
- *
- * This version ignores LOCALE information.
- * It also doesn't worry about multi-byte characters.
- * So there.
- *
- * This file is also shipped with GAWK (GNU Awk), gawk specific bits of
- * code are included if GAWK is defined.
- *
- * Arnold Robbins
- * January, February, March, 1991
- * Updated March, April 1992
- * Updated April, 1993
- * Updated February, 1994
- * Updated May, 1994
- * Updated January, 1995
- * Updated September, 1995
- * Updated January, 1996
- * Updated July, 1997
- * Updated October, 1999
- * Updated September, 2000
- *
- * Fixes from ado@elsie.nci.nih.gov,
- * February 1991, May 1992
- * Fixes from Tor Lillqvist tml@tik.vtt.fi,
- * May 1993
- * Further fixes from ado@elsie.nci.nih.gov,
- * February 1994
- * %z code from chip@chinacat.unicom.com,
- * Applied September 1995
- * %V code fixed (again) and %G, %g added,
- * January 1996
- * %v code fixed, better configuration,
- * July 1997
- * Moved to C99 specification.
- * September 2000
- */
-
-#ifndef GAWK
-#include <stdio.h>
+/* 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 <config.h>
+#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 <ctype.h>
-#include <time.h>
+#ifdef TIME_T_IN_SYS_TYPES_H
+#include <sys/types.h> /* Some systems define `time_t' here. */
+#endif /* HAVE_SYS_TYPES_H */
+
+#ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
#endif
-#if defined(TM_IN_SYS_TIME) || ! defined(GAWK)
-#include <sys/types.h>
-#include <sys/time.h>
+#if HAVE_TZNAME
+extern char *tzname[];
#endif
-#include <stdlib.h>
-#include <string.h>
+/* 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 <wchar.h>
+# 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
-/* defaults: season to taste */
-#define SUNOS_EXT 1 /* stuff in SunOS strftime routine */
-#define VMS_EXT 1 /* include %v for VMS date format */
-#define HPUX_EXT 1 /* non-conflicting stuff in HP-UX date */
-#ifndef GAWK
-#define POSIX_SEMANTICS 1 /* call tzset() if TZ changes */
+#if HAVE_LIMITS_H
+# include <limits.h>
#endif
-#undef strchr /* avoid AIX weirdness */
+#if STDC_HEADERS
+# include <stddef.h>
+# include <stdlib.h>
+# include <string.h>
+#else
+# ifndef HAVE_MEMCPY
+# define memcpy(d, s, n) bcopy ((s), (d), (n))
+# endif
+#endif
-extern void tzset(void);
-static int weeknumber(const struct tm *timeptr, int firstweekday);
-static int iso8601wknum(const struct tm *timeptr);
+#undef TOUPPER
+#undef TOLOWER
+#undef ISDIGIT
+#ifdef COMPILE_WIDE
+# include <endian.h>
+# 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)
-#ifdef __GNUC__
-#define inline __inline__
#else
-#define inline /**/
+# 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 range(low, item, hi) max(low, min(item, hi))
+#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')
+};
-#if !defined(OS2) && !defined(MSDOS) && defined(HAVE_TZNAME)
-extern char *tzname[2];
-extern int daylight;
-#if defined(SOLARIS) || defined(mips)
-extern long int timezone, altzone;
+# 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
-extern int timezone, altzone;
+# 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
-#undef min /* just in case */
-/* min --- return minimum of two numbers */
+#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;
+}
+
-static inline int
-min(int a, int b)
+#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;
{
- return (a < b ? a : 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 */
-#undef max /* also, just in case */
-/* max --- return maximum of two numbers */
-static inline int
-max(int a, int b)
+/* 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;
{
- return (a > b ? a : b);
+ /* 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);
}
-/* strftime --- produce formatted time */
+#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
-strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr)
+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
{
- char *endp = s + maxsize;
- char *start = s;
- auto char tbuf[100];
- long off;
- int i, w, y;
- static short first = 1;
-#ifdef POSIX_SEMANTICS
- static char *savetz = NULL;
- static int savetzlen = 0;
- char *tz;
-#endif /* POSIX_SEMANTICS */
-#ifndef HAVE_TM_ZONE
-#ifndef HAVE_TM_NAME
-#ifndef HAVE_TZNAME
- extern char *timezone();
- struct timeval tv;
- struct timezone zone;
-#endif /* HAVE_TZNAME */
-#endif /* HAVE_TM_NAME */
-#endif /* HAVE_TM_ZONE */
-
- /* various tables, useful in North America */
- static const char *days_a[] = {
- "Sun", "Mon", "Tue", "Wed",
- "Thu", "Fri", "Sat",
- };
- static const char *days_l[] = {
- "Sunday", "Monday", "Tuesday", "Wednesday",
- "Thursday", "Friday", "Saturday",
- };
- static const char *months_a[] = {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
- };
- static const char *months_l[] = {
- "January", "February", "March", "April",
- "May", "June", "July", "August", "September",
- "October", "November", "December",
- };
- static const char *ampm[] = { "AM", "PM", };
-
- if (s == NULL || format == NULL || timeptr == NULL || maxsize == 0)
- return 0;
-
- /* quick check if we even need to bother */
- if (strchr(format, '%') == NULL && strlen(format) + 1 >= maxsize)
- return 0;
-
-#ifndef POSIX_SEMANTICS
- if (first) {
- tzset();
- first = 0;
+ 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 /* POSIX_SEMANTICS */
- tz = getenv("TZ");
- if (first) {
- if (tz != NULL) {
- int tzlen = strlen(tz);
-
- savetz = (char *) malloc(tzlen + 1);
- if (savetz != NULL) {
- savetzlen = tzlen + 1;
- strcpy(savetz, tz);
- }
- }
- tzset();
- first = 0;
+
+#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;
}
- /* if we have a saved TZ, and it is different, recapture and reset */
- if (tz && savetz && (tz[0] != savetz[0] || strcmp(tz, savetz) != 0)) {
- i = strlen(tz) + 1;
- if (i > savetzlen) {
- savetz = (char *) realloc(savetz, i);
- if (savetz) {
- savetzlen = i;
- strcpy(savetz, tz);
- }
- } else
- strcpy(savetz, tz);
- tzset();
+
+#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;
}
-#endif /* POSIX_SEMANTICS */
- for (; *format && s < endp - 1; format++) {
- tbuf[0] = '\0';
- if (*format != '%') {
- *s++ = *format;
- continue;
- }
- again:
- switch (*++format) {
- case '\0':
- *s++ = '%';
- goto out;
-
- case '%':
- *s++ = '%';
- continue;
-
- case 'a': /* abbreviated weekday name */
- if (timeptr->tm_wday < 0 || timeptr->tm_wday > 6)
- strcpy(tbuf, "?");
- else
- strcpy(tbuf, days_a[timeptr->tm_wday]);
- break;
-
- case 'A': /* full weekday name */
- if (timeptr->tm_wday < 0 || timeptr->tm_wday > 6)
- strcpy(tbuf, "?");
- else
- strcpy(tbuf, days_l[timeptr->tm_wday]);
- break;
-
- case 'b': /* abbreviated month name */
- short_month:
- if (timeptr->tm_mon < 0 || timeptr->tm_mon > 11)
- strcpy(tbuf, "?");
- else
- strcpy(tbuf, months_a[timeptr->tm_mon]);
- break;
-
- case 'B': /* full month name */
- if (timeptr->tm_mon < 0 || timeptr->tm_mon > 11)
- strcpy(tbuf, "?");
- else
- strcpy(tbuf, months_l[timeptr->tm_mon]);
- break;
-
- case 'c': /* appropriate date and time representation */
- /*
- * This used to be:
- *
- * strftime(tbuf, sizeof tbuf, "%a %b %e %H:%M:%S %Y", timeptr);
- *
- * Now, per the ISO 1999 C standard, it this:
- */
- strftime(tbuf, sizeof tbuf, "%A %B %d %T %Y", timeptr);
- break;
-
- case 'C':
- century:
- sprintf(tbuf, "%02d", (timeptr->tm_year + 1900) / 100);
- break;
-
- case 'd': /* day of the month, 01 - 31 */
- i = range(1, timeptr->tm_mday, 31);
- sprintf(tbuf, "%02d", i);
- break;
-
- case 'D': /* date as %m/%d/%y */
- strftime(tbuf, sizeof tbuf, "%m/%d/%y", timeptr);
- break;
-
- case 'e': /* day of month, blank padded */
- sprintf(tbuf, "%2d", range(1, timeptr->tm_mday, 31));
- break;
-
- case 'E':
- /* POSIX (now C99) locale extensions, ignored for now */
- goto again;
-
- case 'F': /* ISO 8601 date representation */
- strftime(tbuf, sizeof tbuf, "%Y-%m-%d", timeptr);
- break;
-
- case 'g':
- case 'G':
- /*
- * Year of ISO week.
- *
- * If it's December but the ISO week number is one,
- * that week is in next year.
- * If it's January but the ISO week number is 52 or
- * 53, that week is in last year.
- * Otherwise, it's this year.
- */
- w = iso8601wknum(timeptr);
- if (timeptr->tm_mon == 11 && w == 1)
- y = 1900 + timeptr->tm_year + 1;
- else if (timeptr->tm_mon == 0 && w >= 52)
- y = 1900 + timeptr->tm_year - 1;
- else
- y = 1900 + timeptr->tm_year;
-
- if (*format == 'G')
- sprintf(tbuf, "%d", y);
- else
- sprintf(tbuf, "%02d", y % 100);
- break;
-
- case 'h': /* abbreviated month name */
- goto short_month;
-
- case 'H': /* hour, 24-hour clock, 00 - 23 */
- i = range(0, timeptr->tm_hour, 23);
- sprintf(tbuf, "%02d", i);
- break;
-
- case 'I': /* hour, 12-hour clock, 01 - 12 */
- i = range(0, timeptr->tm_hour, 23);
- if (i == 0)
- i = 12;
- else if (i > 12)
- i -= 12;
- sprintf(tbuf, "%02d", i);
- break;
-
- case 'j': /* day of the year, 001 - 366 */
- sprintf(tbuf, "%03d", timeptr->tm_yday + 1);
- break;
-
- case 'm': /* month, 01 - 12 */
- i = range(0, timeptr->tm_mon, 11);
- sprintf(tbuf, "%02d", i + 1);
- break;
-
- case 'M': /* minute, 00 - 59 */
- i = range(0, timeptr->tm_min, 59);
- sprintf(tbuf, "%02d", i);
- break;
-
- case 'n': /* same as \n */
- tbuf[0] = '\n';
- tbuf[1] = '\0';
- break;
-
- case 'O':
- /* POSIX (now C99) locale extensions, ignored for now */
- goto again;
-
- case 'p': /* am or pm based on 12-hour clock */
- i = range(0, timeptr->tm_hour, 23);
- if (i < 12)
- strcpy(tbuf, ampm[0]);
- else
- strcpy(tbuf, ampm[1]);
- break;
-
- case 'r': /* time as %I:%M:%S %p */
- strftime(tbuf, sizeof tbuf, "%I:%M:%S %p", timeptr);
- break;
-
- case 'R': /* time as %H:%M */
- strftime(tbuf, sizeof tbuf, "%H:%M", timeptr);
- break;
-
-#if defined(HAVE_MKTIME) || defined(GAWK)
- case 's': /* time as seconds since the Epoch */
+ /* 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)
{
- struct tm non_const_timeptr;
+ *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
- non_const_timeptr = *timeptr;
- sprintf(tbuf, "%ld", mktime(& non_const_timeptr));
- break;
+ 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;
}
-#endif /* defined(HAVE_MKTIME) || defined(GAWK) */
-
- case 'S': /* second, 00 - 60 */
- i = range(0, timeptr->tm_sec, 60);
- sprintf(tbuf, "%02d", i);
- break;
-
- case 't': /* same as \t */
- tbuf[0] = '\t';
- tbuf[1] = '\0';
- break;
-
- case 'T': /* time as %H:%M:%S */
- the_time:
- strftime(tbuf, sizeof tbuf, "%H:%M:%S", timeptr);
- break;
-
- case 'u':
- /* ISO 8601: Weekday as a decimal number [1 (Monday) - 7] */
- sprintf(tbuf, "%d", timeptr->tm_wday == 0 ? 7 :
- timeptr->tm_wday);
- break;
-
- case 'U': /* week of year, Sunday is first day of week */
- sprintf(tbuf, "%02d", weeknumber(timeptr, 0));
- break;
-
- case 'V': /* week of year according ISO 8601 */
- sprintf(tbuf, "%02d", iso8601wknum(timeptr));
- break;
-
- case 'w': /* weekday, Sunday == 0, 0 - 6 */
- i = range(0, timeptr->tm_wday, 6);
- sprintf(tbuf, "%d", i);
- break;
-
- case 'W': /* week of year, Monday is first day of week */
- sprintf(tbuf, "%02d", weeknumber(timeptr, 1));
- break;
-
- case 'x': /* appropriate date representation */
- strftime(tbuf, sizeof tbuf, "%A %B %d %Y", timeptr);
- break;
-
- case 'X': /* appropriate time representation */
- goto the_time;
- break;
-
- case 'y': /* year without a century, 00 - 99 */
- year:
- i = timeptr->tm_year % 100;
- sprintf(tbuf, "%02d", i);
- break;
-
- case 'Y': /* year with century */
- fullyear:
- sprintf(tbuf, "%d", 1900 + timeptr->tm_year);
- break;
-
- /*
- * From: Chip Rosenthal <chip@chinacat.unicom.com>
- * Date: Sun, 19 Mar 1995 00:33:29 -0600 (CST)
- *
- * Warning: the %z [code] is implemented by inspecting the
- * timezone name conditional compile settings, and
- * inferring a method to get timezone offsets. I've tried
- * this code on a couple of machines, but I don't doubt
- * there is some system out there that won't like it.
- * Maybe the easiest thing to do would be to bracket this
- * with an #ifdef that can turn it off. The %z feature
- * would be an admittedly obscure one that most folks can
- * live without, but it would be a great help to those of
- * us that muck around with various message processors.
- */
- case 'z': /* time zone offset east of GMT e.g. -0600 */
-#ifdef HAVE_TM_NAME
- /*
- * Systems with tm_name probably have tm_tzadj as
- * secs west of GMT. Convert to mins east of GMT.
- */
- off = -timeptr->tm_tzadj / 60;
-#else /* !HAVE_TM_NAME */
-#ifdef HAVE_TM_ZONE
- /*
- * Systems with tm_zone probably have tm_gmtoff as
- * secs east of GMT. Convert to mins east of GMT.
- */
- off = timeptr->tm_gmtoff / 60;
-#else /* !HAVE_TM_ZONE */
-#if HAVE_TZNAME
- /*
- * Systems with tzname[] probably have timezone as
- * secs west of GMT. Convert to mins east of GMT.
- */
- off = -(daylight ? timezone : altzone) / 60;
-#else /* !HAVE_TZNAME */
- off = -zone.tz_minuteswest;
-#endif /* !HAVE_TZNAME */
-#endif /* !HAVE_TM_ZONE */
-#endif /* !HAVE_TM_NAME */
- if (off < 0) {
- tbuf[0] = '-';
- off = -off;
- } else {
- tbuf[0] = '+';
- }
- sprintf(tbuf+1, "%02d%02d", off/60, off%60);
- break;
-
- case 'Z': /* time zone name or abbrevation */
-#ifdef HAVE_TZNAME
- i = (daylight && timeptr->tm_isdst > 0); /* 0 or 1 */
- strcpy(tbuf, tzname[i]);
#else
-#ifdef HAVE_TM_ZONE
- strcpy(tbuf, timeptr->tm_zone);
+# 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
-#ifdef HAVE_TM_NAME
- strcpy(tbuf, timeptr->tm_name);
+# 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
- gettimeofday(& tv, & zone);
- strcpy(tbuf, timezone(zone.tz_minuteswest,
- timeptr->tm_isdst > 0));
-#endif /* HAVE_TM_NAME */
-#endif /* HAVE_TM_ZONE */
-#endif /* HAVE_TZNAME */
- break;
-
-#ifdef SUNOS_EXT
- case 'k': /* hour, 24-hour clock, blank pad */
- sprintf(tbuf, "%2d", range(0, timeptr->tm_hour, 23));
- break;
-
- case 'l': /* hour, 12-hour clock, 1 - 12, blank pad */
- i = range(0, timeptr->tm_hour, 23);
- if (i == 0)
- i = 12;
- else if (i > 12)
- i -= 12;
- sprintf(tbuf, "%2d", i);
- break;
-#endif
-
-#ifdef HPUX_EXT
- case 'N': /* Emperor/Era name */
- /* this is essentially the same as the century */
- goto century; /* %C */
-
- case 'o': /* Emperor/Era year */
- goto year; /* %y */
-#endif /* HPUX_EXT */
-
-
-#ifdef VMS_EXT
- case 'v': /* date as dd-bbb-YYYY */
- sprintf(tbuf, "%2d-%3.3s-%4d",
- range(1, timeptr->tm_mday, 31),
- months_a[range(0, timeptr->tm_mon, 11)],
- timeptr->tm_year + 1900);
- for (i = 3; i < 6; i++)
- if (islower(tbuf[i]))
- tbuf[i] = toupper(tbuf[i]);
- break;
-#endif
-
- default:
- tbuf[0] = '%';
- tbuf[1] = *format;
- tbuf[2] = '\0';
- break;
+# 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_(' ');
}
- i = strlen(tbuf);
- if (i) {
- if (s + i < endp - 1) {
- strcpy(s, tbuf);
- s += i;
- } else
- return 0;
+ else
+ {
+ bufp += negative_number;
+ while (0 < padding--)
+ *--bufp = L_('0');
+ if (negative_number)
+ *--bufp = L_('-');
}
- }
-out:
- if (s < endp && *format == '\0') {
- *s = '\0';
- return (s - start);
- } else
- return 0;
-}
+ }
-/* isleap --- is a year a leap year? */
+ cpy (buf + sizeof (buf) / sizeof (buf[0]) - bufp, bufp);
+ break;
-static int
-isleap(int year)
-{
- return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
-}
+ 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;
-/* iso8601wknum --- compute week number according to ISO 8601 */
+ DO_NUMBER (2, tp->tm_hour);
-static int
-iso8601wknum(const struct tm *timeptr)
-{
- /*
- * From 1003.2:
- * If the week (Monday to Sunday) containing January 1
- * has four or more days in the new year, then it is week 1;
- * otherwise it is the highest numbered week of the previous
- * year (52 or 53), and the next week is week 1.
- *
- * ADR: This means if Jan 1 was Monday through Thursday,
- * it was week 1, otherwise week 52 or 53.
- *
- * XPG4 erroneously included POSIX.2 rationale text in the
- * main body of the standard. Thus it requires week 53.
- */
-
- int weeknum, jan1day, diff;
-
- /* get week number, Monday as first day of the week */
- weeknum = weeknumber(timeptr, 1);
-
- /*
- * With thanks and tip of the hatlo to tml@tik.vtt.fi
- *
- * What day of the week does January 1 fall on?
- * We know that
- * (timeptr->tm_yday - jan1.tm_yday) MOD 7 ==
- * (timeptr->tm_wday - jan1.tm_wday) MOD 7
- * and that
- * jan1.tm_yday == 0
- * and that
- * timeptr->tm_wday MOD 7 == timeptr->tm_wday
- * from which it follows that. . .
- */
- jan1day = timeptr->tm_wday - (timeptr->tm_yday % 7);
- if (jan1day < 0)
- jan1day += 7;
-
- /*
- * If Jan 1 was a Monday through Thursday, it was in
- * week 1. Otherwise it was last year's highest week, which is
- * this year's week 0.
- *
- * What does that mean?
- * If Jan 1 was Monday, the week number is exactly right, it can
- * never be 0.
- * If it was Tuesday through Thursday, the weeknumber is one
- * less than it should be, so we add one.
- * Otherwise, Friday, Saturday or Sunday, the week number is
- * OK, but if it is 0, it needs to be 52 or 53.
- */
- switch (jan1day) {
- case 1: /* Monday */
- break;
- case 2: /* Tuesday */
- case 3: /* Wednesday */
- case 4: /* Thursday */
- weeknum++;
- break;
- case 5: /* Friday */
- case 6: /* Saturday */
- case 0: /* Sunday */
- if (weeknum == 0) {
-#ifdef USE_BROKEN_XPG4
- /* XPG4 (as of March 1994) says 53 unconditionally */
- weeknum = 53;
-#else
- /* get week number of last week of last year */
- struct tm dec31ly; /* 12/31 last year */
- dec31ly = *timeptr;
- dec31ly.tm_year--;
- dec31ly.tm_mon = 11;
- dec31ly.tm_mday = 31;
- dec31ly.tm_wday = (jan1day == 0) ? 6 : jan1day - 1;
- dec31ly.tm_yday = 364 + isleap(dec31ly.tm_year + 1900);
- weeknum = iso8601wknum(& dec31ly);
-#endif
- }
- break;
- }
+ case L_('I'):
+ if (modifier == L_('E'))
+ goto bad_format;
- if (timeptr->tm_mon == 11) {
- /*
- * The last week of the year
- * can be in week 1 of next year.
- * Sigh.
- *
- * This can only happen if
- * M T W
- * 29 30 31
- * 30 31
- * 31
- */
- int wday, mday;
-
- wday = timeptr->tm_wday;
- mday = timeptr->tm_mday;
- if ( (wday == 1 && (mday >= 29 && mday <= 31))
- || (wday == 2 && (mday == 30 || mday == 31))
- || (wday == 3 && mday == 31))
- weeknum = 1;
- }
+ DO_NUMBER (2, hour12);
- return weeknum;
-}
+ case L_('k'): /* GNU extension. */
+ if (modifier == L_('E'))
+ goto bad_format;
-/* weeknumber --- figure how many weeks into the year */
+ DO_NUMBER_SPACEPAD (2, tp->tm_hour);
-/* With thanks and tip of the hatlo to ado@elsie.nci.nih.gov */
+ case L_('l'): /* GNU extension. */
+ if (modifier == L_('E'))
+ goto bad_format;
-static int
-weeknumber(const struct tm *timeptr, int firstweekday)
-{
- int wday = timeptr->tm_wday;
- int ret;
-
- if (firstweekday == 1) {
- if (wday == 0) /* sunday */
- wday = 6;
- else
- wday--;
- }
- ret = ((timeptr->tm_yday + 7 - wday) / 7);
- if (ret < 0)
- ret = 0;
- return ret;
-}
+ DO_NUMBER_SPACEPAD (2, hour12);
-#if 0
-/* ADR --- I'm loathe to mess with ado's code ... */
-
-Date: Wed, 24 Apr 91 20:54:08 MDT
-From: Michal Jaegermann <audfax!emory!vm.ucs.UAlberta.CA!NTOMCZAK>
-To: arnold@audiofax.com
-
-Hi Arnold,
-in a process of fixing of strftime() in libraries on Atari ST I grabbed
-some pieces of code from your own strftime. When doing that it came
-to mind that your weeknumber() function compiles a little bit nicer
-in the following form:
-/*
- * firstweekday is 0 if starting in Sunday, non-zero if in Monday
- */
-{
- return (timeptr->tm_yday - timeptr->tm_wday +
- (firstweekday ? (timeptr->tm_wday ? 8 : 1) : 7)) / 7;
-}
-How nicer it depends on a compiler, of course, but always a tiny bit.
-
- Cheers,
- Michal
- ntomczak@vm.ucs.ualberta.ca
-#endif
-
-#ifdef TEST_STRFTIME
-
-/*
- * NAME:
- * tst
- *
- * SYNOPSIS:
- * tst
- *
- * DESCRIPTION:
- * "tst" is a test driver for the function "strftime".
- *
- * OPTIONS:
- * None.
- *
- * AUTHOR:
- * Karl Vogel
- * Control Data Systems, Inc.
- * vogelke@c-17igp.wpafb.af.mil
- *
- * BUGS:
- * None noticed yet.
- *
- * COMPILE:
- * cc -o tst -DTEST_STRFTIME strftime.c
- */
-
-/* ADR: I reformatted this to my liking, and deleted some unneeded code. */
+ case L_('j'):
+ if (modifier == L_('E'))
+ goto bad_format;
-#ifndef NULL
-#include <stdio.h>
-#endif
-#include <sys/time.h>
-#include <string.h>
+ DO_NUMBER (3, 1 + tp->tm_yday);
-#define MAXTIME 132
+ case L_('M'):
+ if (modifier == L_('E'))
+ goto bad_format;
-/*
- * Array of time formats.
- */
+ DO_NUMBER (2, tp->tm_min);
-static char *array[] =
-{
- "(%%A) full weekday name, var length (Sunday..Saturday) %A",
- "(%%B) full month name, var length (January..December) %B",
- "(%%C) Century %C",
- "(%%D) date (%%m/%%d/%%y) %D",
- "(%%E) Locale extensions (ignored) %E",
- "(%%F) full month name, var length (January..December) %F",
- "(%%H) hour (24-hour clock, 00..23) %H",
- "(%%I) hour (12-hour clock, 01..12) %I",
- "(%%M) minute (00..59) %M",
- "(%%N) Emporer/Era Name %N",
- "(%%O) Locale extensions (ignored) %O",
- "(%%R) time, 24-hour (%%H:%%M) %R",
- "(%%S) second (00..60) %S",
- "(%%T) time, 24-hour (%%H:%%M:%%S) %T",
- "(%%U) week of year, Sunday as first day of week (00..53) %U",
- "(%%V) week of year according to ISO 8601 %V",
- "(%%W) week of year, Monday as first day of week (00..53) %W",
- "(%%X) appropriate locale time representation (%H:%M:%S) %X",
- "(%%Y) year with century (1970...) %Y",
- "(%%Z) timezone (EDT), or blank if timezone not determinable %Z",
- "(%%a) locale's abbreviated weekday name (Sun..Sat) %a",
- "(%%b) locale's abbreviated month name (Jan..Dec) %b",
- "(%%c) full date (Sat Nov 4 12:02:33 1989)%n%t%t%t %c",
- "(%%d) day of the month (01..31) %d",
- "(%%e) day of the month, blank-padded ( 1..31) %e",
- "(%%h) should be same as (%%b) %h",
- "(%%j) day of the year (001..366) %j",
- "(%%k) hour, 24-hour clock, blank pad ( 0..23) %k",
- "(%%l) hour, 12-hour clock, blank pad ( 0..12) %l",
- "(%%m) month (01..12) %m",
- "(%%o) Emporer/Era Year %o",
- "(%%p) locale's AM or PM based on 12-hour clock %p",
- "(%%r) time, 12-hour (same as %%I:%%M:%%S %%p) %r",
- "(%%u) ISO 8601: Weekday as decimal number [1 (Monday) - 7] %u",
- "(%%v) VMS date (dd-bbb-YYYY) %v",
- "(%%w) day of week (0..6, Sunday == 0) %w",
- "(%%x) appropriate locale date representation %x",
- "(%%y) last two digits of year (00..99) %y",
- "(%%z) timezone offset east of GMT as HHMM (e.g. -0500) %z",
- (char *) NULL
-};
+ case L_('m'):
+ if (modifier == L_('E'))
+ goto bad_format;
-/* main routine. */
+ DO_NUMBER (2, tp->tm_mon + 1);
-int
-main(argc, argv)
-int argc;
-char **argv;
-{
- long time();
+ case L_('N'): /* GNU extension. */
+ if (modifier == L_('E'))
+ goto bad_format;
- char *next;
- char string[MAXTIME];
+ 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;
+ }
- int k;
- int length;
+ DO_NUMBER (9, number_value);
- struct tm *tm;
+ case L_('n'): /* POSIX.2 extension. */
+ add (1, *p = L_('\n'));
+ break;
- long clock;
+ 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
- /* Call the function. */
+ case L_('R'): /* ISO C99 extension. */
+ subfmt = L_("%H:%M");
+ goto subformat;
- clock = time((long *) 0);
- tm = localtime(&clock);
+ 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 (&ltm);
+
+ /* 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;
- for (k = 0; next = array[k]; k++) {
- length = strftime(string, MAXTIME, next, tm);
- printf("%s\n", string);
+ 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 (&ltm);
+
+ 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 (&lt, &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 (&lt, &gtm))
+ break;
+
+ diff = tm_diff (&ltm, &gtm);
+ }
+#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;
+}
+
- exit(0);
+#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 /* TEST_STRFTIME */
+#endif
diff --git a/missing_d/strtod.c b/missing_d/strtod.c
index cdcefe9f..2c4ee574 100644
--- a/missing_d/strtod.c
+++ b/missing_d/strtod.c
@@ -22,6 +22,9 @@
*
* 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,8 +39,8 @@ register const char *s;
register const char **ptr;
{
double ret = 0.0;
- const char *start = s;
- const char *begin = NULL;
+ 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,7 +101,7 @@ register const char **ptr;
ret = atof(begin);
out:
- if (! success)
+ if (! success && s == begin)
s = start; /* in case all we did was skip whitespace */
if (ptr)
diff --git a/patchlev.h b/patchlev.h
index 2867bba9..2a15071c 100644
--- a/patchlev.h
+++ b/patchlev.h
@@ -1 +1 @@
-#define PATCHLEVEL 0
+#define PATCHLEVEL "1"
diff --git a/pc/ChangeLog b/pc/ChangeLog
index c572b1bb..37a02436 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,58 @@
+Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.1: Release tar file made.
+
+Thu Apr 18 17:29:16 2002 Scott Deifik <scottd@amgen.com>
+
+ * Makefile.tst (strftime): Remove comment on call to $(CMP).
+
+Sun Mar 10 17:05:35 2002 Scott Deifik <scottd@amgen.com>
+
+ * Makefile.tst: More clean up and sync with ../test/Makefile.
+
+Thu Jan 3 15:20:17 2002 Scott Deifik <scottd@amgen.com>
+
+ * Makefile.tst: Minor clean up and sync with ../test/Makefile.
+
+Wed Dec 19 16:01:58 2001 Peter J. Farley III <pjfarley@dorsai.org>
+
+ * gawkmisc.pc: Just use single quote for `quote' for all cases.
+
+Wed Dec 19 15:59:52 2001 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * 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 <andreas.buening@nexgo.de>
+
+ 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 <arnold@skeeve.com>
+
+ * gawkmisc.pc (os_close_on_exec): If fd <= 2, return.
+
Sun Jun 3 13:04:44 2001 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.0: Release tar file made. And there was
diff --git a/pc/Makefile b/pc/Makefile
index 9dd8f350..57b1e0fa 100644
--- a/pc/Makefile
+++ b/pc/Makefile
@@ -37,6 +37,7 @@ default:
#======================= Configuration ==================================
RSPFILE = gawk.rsp
+PRSPFILE = pgawk.rsp
#
# Choose method for passing arguments to the linker.
#
@@ -54,7 +55,9 @@ RSPFILE = gawk.rsp
#
# 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,6 +87,8 @@ install = 1
# 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,19 +98,20 @@ DO_BIND= $($(BIND))
#========================================================================
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 LF=-s LF2=-lm \
- BIND=BDJG
+ LNK=LDJG PLNK=PLDJG LF=-s LF2=-lm \
+ BIND=BDJG PBIND=''
djgpp-debug:
$(MAK) all \
CC=gcc O=.o CF='-O2 -g' \
- LNK=LDJG LF2=-lm \
- BIND=BDJG
+ 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,6 +287,7 @@ vcWin32:
# 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,6 +297,8 @@ CFLAGS = $(CF) -DGAWK -I. -DHAVE_CONFIG_H
# 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,6 +308,7 @@ ALLOBJS = $(AWKOBJS) awkgram$O getid$O $(OBJ)
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,18 +318,27 @@ GAWKOBJS = $(ALLOBJS) $(LIBOBJS)
$(CC) -c $(CFLAGS) $<
# rules to build gawk
-all : gawk.exe
+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 >> $@
-$(ALLOBJS): awk.h dfa.h regex.h config.h
+$(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,6 +348,10 @@ getopt1$O: getopt.h
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,7 +381,7 @@ install2:
gawk -v prefix=$(prefix) -f install.awk
clean:
- rm -rf gawk gawk.exe gawk.map *.o *.obj core a.out $(RSPFILE)
+ 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 --git a/pc/Makefile.tst b/pc/Makefile.tst
index af62e8b8..22928552 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -1,6 +1,6 @@
# Makefile for GNU Awk test suite.
#
-# Copyright (C) 1988-2001 the Free Software Foundation, Inc.
+# Copyright (C) 1988-2002 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
@@ -67,6 +67,8 @@ AWK2 = '..\gawk.exe'
# 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,8 +81,8 @@ AWK2 = '..\gawk.exe'
# 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 = env LFN=n diff
+CMP = diff
#CMP = diff -c
#CMP = gcmp
@@ -105,8 +107,6 @@ DATE = gdate
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 \
@@ -115,19 +115,20 @@ check: msg \
# 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
+ 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,8 +187,6 @@ poundba::
@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 _$@
@@ -231,8 +230,8 @@ regtes::
@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
+# 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,7 +248,6 @@ manyfiles::
@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
@@ -359,11 +357,12 @@ nofmtch::
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.'
+# 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,7 +467,6 @@ clsflnam::
-$(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 _$@
@@ -551,8 +549,7 @@ nfldstr::
-$(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 > _$@
+ @echo A B C D E | tr -d '\12\15' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@
-$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@
fnarydel::
@@ -832,7 +829,7 @@ psx96sub::
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 '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,6 +846,50 @@ 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 *~
diff --git a/pc/awklib/igawk.awk b/pc/awklib/igawk.awk
index dc0ba405..c660b8dc 100644
--- a/pc/awklib/igawk.awk
+++ b/pc/awklib/igawk.awk
@@ -34,16 +34,16 @@ BEGIN {
}
fpath = pathto($2)
if (fpath == "") {
- printf("igawk:%s:%d: cannot find %s\n", \
+ 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
+ input[++stackptr] = fpath # push onto stack
} else
- print $2, "included in", input[stackptr], \
- "already included in", \
+ print $2, "included in", input[stackptr],
+ "already included in",
processed[fpath] > "/dev/stderr"
}
close(input[stackptr])
diff --git a/pc/config.h b/pc/config.h
index 626027cf..6544abb8 100644
--- a/pc/config.h
+++ b/pc/config.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (C) 1995-2001 the Free Software Foundation, Inc.
+ * Copyright (C) 1995-2002 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc
index 860e6b71..10e4b140 100644
--- a/pc/gawkmisc.pc
+++ b/pc/gawkmisc.pc
@@ -1,9 +1,9 @@
/*
- * gawkmisc.c --- miscellanious gawk routines that are OS specific.
+ * gawkmisc.c --- miscellaneous gawk routines that are OS specific.
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991 - 2001 the Free Software Foundation, Inc.
+ * 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,12 +23,19 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-char quote = '"';
-char envsep = ';';
-#ifdef DEFPATH
+char quote = '\'';
+char envsep = ';';
+
+# ifdef DEFPATH
char *defpath = DEFPATH;
-#else
+# 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,10 +67,16 @@ int *argcp;
char ***argvp;
{
#ifdef __EMX__
- _response(argcp, argvp);
+# ifdef initialize_main
+ initialize_main(argcp, argvp);
+# else
_wildcard(argcp, argvp);
+ _response(argcp, argvp);
+# endif
+
setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
-#endif
+ defpath = (char*) _os2_unixroot_path(defpath);
+#endif /* __EMX__ */
return;
}
@@ -74,6 +87,10 @@ os_devopen(name, flag)
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,6 +98,7 @@ int flag;
* return open("???", flag);
*/
return -1;
+#endif
}
/* optimal_bufsize --- determine optimal buffer size */
@@ -101,13 +119,10 @@ struct stat *stb;
*/
#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 */
+ if (S_ISREG(stb->st_mode)
+ && 0 < stb->st_size && stb->st_size < DEFBLKSIZE) /* small file */
return stb->st_size;
return DEFBLKSIZE;
}
@@ -118,6 +133,10 @@ int
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,6 +146,7 @@ const char *file;
}
}
return 0;
+#endif
}
/* isdirpunct --- return true if char is a directory separator */
@@ -146,11 +166,14 @@ int fd;
const char *name, *what, *dir;
{
#if ! defined(_MSC_VER) && ! defined(__MINGW32__)
-#if defined(__DJGPP__) && (__DJGPP__ > 2 || __DJGPP_MINOR__ >= 4)
+# 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
#endif
}
@@ -174,7 +197,16 @@ int fd;
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,3 +242,176 @@ int fd;
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 --git a/pc/install.awk b/pc/install.awk
index 67113898..367e8b98 100644
--- a/pc/install.awk
+++ b/pc/install.awk
@@ -58,4 +58,5 @@ mkinstalldirs(prefix "/lib/awk " prefix "/man/man1 " prefix "/info")
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 --git a/po/ChangeLog b/po/ChangeLog
new file mode 100644
index 00000000..4a5af11e
--- /dev/null
+++ b/po/ChangeLog
@@ -0,0 +1,9 @@
+Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.1: Release tar file made.
+
+2002-04-09 gettextize <bug-gnu-gettext@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.11.1.
+ * remove-potcdate.sin: New file, from gettext-0.11.1.
+
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 00000000..6b500955
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1,7 @@
+es
+fr
+he
+it
+sv
+tr
+de
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
index ea54aaef..ada8bb4f 100644
--- a/po/Makefile.in.in
+++ b/po/Makefile.in.in
@@ -1,10 +1,12 @@
-# -*- Makefile -*- for program source directory in GNU NLS utilities package.
-# Copyright (C) 1995, 1996, 1997, 2000 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+# Makefile for PO directory in any package using GNU gettext.
+# Copyright (C) 1995-1997, 2000-2002 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
+# 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@
@@ -18,246 +20,298 @@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
-datadir = $(prefix)/@DATADIRNAME@
+datadir = @datadir@
localedir = $(datadir)/locale
-gnulocaledir = $(prefix)/share/locale
-gettextsrcdir = $(prefix)/share/gettext/po
-subdir = po
+gettextsrcdir = $(datadir)/gettext/po
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
MKINSTALLDIRS = @MKINSTALLDIRS@
+mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
-CC = @CC@
-GENCAT = @GENCAT@
-GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
+GMSGFMT = @GMSGFMT@
MSGFMT = @MSGFMT@
-XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
-MSGMERGE = PATH=../src:$$PATH msgmerge
+XGETTEXT = @XGETTEXT@
+MSGMERGE = msgmerge
+MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGINIT = msginit
+MSGCONV = msgconv
+MSGFILTER = msgfilter
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-
-INCLUDES = -I.. -I$(top_srcdir)/intl
-
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
-
-SOURCES = cat-id-tbl.c
POFILES = @POFILES@
GMOFILES = @GMOFILES@
-DISTFILES = Makefile.in.in POTFILES.in $(PACKAGE).pot \
-stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
+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@
-CATOBJEXT = @CATOBJEXT@
-INSTOBJEXT = @INSTOBJEXT@
-
-.SUFFIXES:
-.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
-.c.o:
- $(COMPILE) $<
+# Makevars gets inserted here. (Don't remove this line!)
-.po.pox:
- $(MAKE) $(PACKAGE).pot
- $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
+.SUFFIXES:
+.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update
.po.mo:
- $(MSGFMT) -o $@ $<
+ @echo "$(MSGFMT) -c -o $@ $<"; \
+ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
.po.gmo:
- file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
- && rm -f $$file && $(GMSGFMT) -o $$file $<
+ @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
-.po.cat:
- sed -f ../intl/po2msg.sed < $< > $*.msg \
- && rm -f $@ && $(GENCAT) $@ $*.msg
+.sin.sed:
+ sed -e '/^#/d' $< > t-$@
+ mv t-$@ $@
all: all-@USE_NLS@
-all-yes: cat-id-tbl.c $(CATALOGS)
+all-yes: $(CATALOGS)
all-no:
-$(srcdir)/$(PACKAGE).pot: $(POTFILES)
- $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
- --add-comments --keyword=_ --keyword=N_ \
+# 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 \
- && test ! -f $(PACKAGE).po \
- || ( rm -f $(srcdir)/$(PACKAGE).pot \
- && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
-
-$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
-$(srcdir)/stamp-cat-id: $(PACKAGE).pot
- rm -f cat-id-tbl.tmp
- sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
- | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
- if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
- rm cat-id-tbl.tmp; \
- else \
- echo cat-id-tbl.c changed; \
- rm -f $(srcdir)/cat-id-tbl.c; \
- mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
- fi
- cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
+ --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@
-install-data-no: all
-install-data-yes: all
- if test -x "$(MKINSTALLDIRS)"; then \
- $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
+ if test "$(PACKAGE)" = "gettext"; then \
+ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+ for file in $(DISTFILES.common); do \
+ $(INSTALL_DATA) $(srcdir)/$$file \
+ $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
else \
- $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
+ : ; \
fi
+install-data-no: all
+install-data-yes: all
+ $(mkinstalldirs) $(DESTDIR)$(datadir)
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
- case "$$cat" in \
- *.gmo) destdir=$(DESTDIR)$(gnulocaledir);; \
- *) destdir=$(DESTDIR)$(localedir);; \
- esac; \
- lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
- dir=$$destdir/$$lang/LC_MESSAGES; \
- if test -r "$(MKINSTALLDIRS)"; then \
- $(MKINSTALLDIRS) $$dir; \
- else \
- $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
- fi; \
- if test -r $$cat; then \
- $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
- echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
- else \
- $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
- echo "installing $(srcdir)/$$cat as" \
- "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
- fi; \
- if test -r $$cat.m; then \
- $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
- echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
- else \
- if test -r $(srcdir)/$$cat.m ; then \
- $(INSTALL_DATA) $(srcdir)/$$cat.m \
- $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
- echo "installing $(srcdir)/$$cat as" \
- "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
- else \
- true; \
+ 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; \
- fi; \
- timedir=$$destdir/$$lang/LC_TIME; \
- rm -fr $$timedir; \
- ln -s LC_MESSAGES $$timedir \
- || (mkdir $$timedir && ln $$dir/* $$timedir); \
- echo "installing $$timedir as an alias for $$dir"; \
+ done; \
done
+
+install-strip: install
+
+installdirs: installdirs-exec installdirs-data
+installdirs-exec:
+installdirs-data: installdirs-data-@USE_NLS@
if test "$(PACKAGE)" = "gettext"; then \
- if test -x "$(MKINSTALLDIRS)"; then \
- $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
- else \
- $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
- fi; \
- $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
- $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
+ $(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: 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 's/\$(CATOBJEXT)$$//'`; \
- for dir in $(localedir) $(gnulocaledir); do \
- for lc in LC_MESSAGES LC_TIME; do \
- for x in '' .m; do \
- rm -f $(DESTDIR)$$dir/$$lang/$$lc/$(PACKAGE)$(INSTOBJEXT)$$x; \
- done; \
- done; \
+ 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
-cat-id-tbl.o: ../intl/libgettext.h
-
dvi info tags TAGS ID:
mostlyclean:
- rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
+ rm -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 *.msg *.cat *.cat.m
+ 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 = ../$(PACKAGE)-$(VERSION)/$(subdir)
-dist distdir: update-po $(DISTFILES)
+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 \
- cp -p $(srcdir)/$$file $(distdir); \
+ if test -f $$file; then \
+ cp -p $$file $(distdir); \
+ else \
+ cp -p $(srcdir)/$$file $(distdir); \
+ fi; \
done
update-po: Makefile
- $(MAKE) $(PACKAGE).pot
- catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
- echo "$$lang:"; \
- if $(MSGMERGE) $(srcdir)/$$lang.po \
- $(srcdir)/$(PACKAGE).pot -o $$lang.new.po; then \
- if cmp $$lang.new.po $(srcdir)/$$lang.po >/dev/null; then \
- echo "$$lang.po is unchanged"; \
- rm -f $$lang.new.po; \
+ $(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 "updating $$lang.po"; \
- rm -f $(srcdir)/$$lang.po; \
- mv $$lang.new.po $(srcdir)/$$lang.po; \
+ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ exit 1; \
fi; \
- else \
- echo "msgmerge for $$cat failed!"; \
- rm -f $$lang.new.po; \
- exit 1; \
fi; \
- done
+ else \
+ echo "msgmerge for $$lang.po failed!" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi
-POTFILES: POTFILES.in
- ( if test 'x$(srcdir)' != 'x.'; then \
- posrcprefix='$(top_srcdir)/'; \
- else \
- posrcprefix="../"; \
- fi; \
- rm -f $@-t $@ \
- && (sed -e '/^#/d' -e '/^[ ]*$$/d' \
- -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
- | sed -e '$$s/\\$$//') > $@-t \
- && chmod a-w $@-t \
- && mv $@-t $@ )
-
-Makefile: Makefile.in.in ../config.status POTFILES
- cd .. \
+$(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:
-
-# Tell version 3.79 and up of GNU make to not build goals in this
-# directory in parallel.
-.NOTPARALLEL:
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 00000000..8b09f53b
--- /dev/null
+++ b/po/Makevars
@@ -0,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 --git a/po/Rules-quot b/po/Rules-quot
new file mode 100644
index 00000000..5f46d237
--- /dev/null
+++ b/po/Rules-quot
@@ -0,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 --git a/po/boldquot.sed b/po/boldquot.sed
new file mode 100644
index 00000000..4b937aa5
--- /dev/null
+++ b/po/boldquot.sed
@@ -0,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 --git a/po/cat-id-tbl.c b/po/cat-id-tbl.c
deleted file mode 100644
index ba3581c3..00000000
--- a/po/cat-id-tbl.c
+++ /dev/null
@@ -1,411 +0,0 @@
-/* Automatically generated by po2tbl.sed from gawk.pot. */
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "libgettext.h"
-
-const struct _msg_ent _msg_tbl[] = {
- {"", 1},
- {"attempt to use scalar `%s' as array", 2},
- {"reference to uninitialized element `%s[\"%s\"]'", 3},
- {"subscript of array `%s' is null string", 4},
- {"delete: illegal use of variable `%s' as array", 5},
- {"delete: index `%s' not in array `%s'", 6},
- {"%s: empty (null)\n", 7},
- {"%s: empty (zero)\n", 8},
- {"%s: table_size = %d, array_size = %d\n", 9},
- {"%s: is paramater\n", 10},
- {"%s: array_ref to %s\n", 11},
- {"asort: first argument is not an array", 12},
- {"asort: second argument is not an array", 13},
- {"%s to \"%s\" failed (%s)", 14},
- {"standard output", 15},
- {"reason unknown", 16},
- {"exp: received non-numeric argument", 17},
- {"exp: argument %g is out of range", 18},
- {"fflush: cannot flush: pipe `%s' opened for reading, not writing", 19},
- {"fflush: cannot flush: file `%s' opened for reading, not writing", 20},
- {"fflush: `%s' is not an open file, pipe or co-process", 21},
- {"index: received non-string first argument", 22},
- {"index: received non-string second argument", 23},
- {"int: received non-numeric argument", 24},
- {"length: received non-string argument", 25},
- {"log: received non-numeric argument", 26},
- {"log: received negative argument %g", 27},
- {"`$' is not permitted in awk formats", 28},
- {"arg count with `$' must be > 0", 29},
- {"arg count %d greater than total number of supplied arguments", 30},
- {"`$' not permitted after period in format", 31},
- {"no `$' supplied for positional field width or precision", 32},
- {"`l' is meaningless in awk formats; ignored", 33},
- {"`l' is not permitted in POSIX awk formats", 34},
- {"`L' is meaningless in awk formats; ignored", 35},
- {"`L' is not permitted in POSIX awk formats", 36},
- {"`h' is meaningless in awk formats; ignored", 37},
- {"`h' is not permitted in POSIX awk formats", 38},
- {"not enough arguments to satisfy format string", 39},
- {"^ ran out for this one", 40},
- {"[s]printf: format specifier does not have control letter", 41},
- {"too many arguments supplied for format string", 42},
- {"printf: no arguments", 43},
- {"sqrt: received non-numeric argument", 44},
- {"sqrt: called with negative argument %g", 45},
- {"substr: start index %g is invalid, using 1", 46},
- {"substr: non-integer start index %g will be truncated", 47},
- {"substr: length %g is <= 0", 48},
- {"substr: non-integer length %g will be truncated", 49},
- {"substr: source string is zero length", 50},
- {"\
-substr: length %d at start index %d exceeds length of first argument (%d)", 51},
- {"substr: start index %d is past end of string", 52},
- {"strftime: recieved non-string first argument", 53},
- {"strftime: received empty format string", 54},
- {"strftime: recieved non-numeric second argument", 55},
- {"mktime: received non-string argument", 56},
- {"system: recieved non-string argument", 57},
- {"tolower: recieved non-string argument", 58},
- {"toupper: recieved non-string argument", 59},
- {"atan2: received non-numeric first argument", 60},
- {"atan2: received non-numeric second argument", 61},
- {"sin: received non-numeric argument", 62},
- {"cos: received non-numeric argument", 63},
- {"srand: received non-numeric argument", 64},
- {"match: third argument is not an array", 65},
- {"gensub: 3rd argument of 0 treated as 1", 66},
- {"lshift: received non-numeric first argument", 67},
- {"lshift(%lf, %lf): negative values will give strange results", 68},
- {"lshift(%lf, %lf): fractional values will be truncated", 69},
- {"lshift(%lf, %lf): too large shift value will give strange results", 70},
- {"rshift: received non-numeric first argument", 71},
- {"rshift(%lf, %lf): negative values will give strange results", 72},
- {"rshift(%lf, %lf): fractional values will be truncated", 73},
- {"rshift(%lf, %lf): too large shift value will give strange results", 74},
- {"and: received non-numeric first argument", 75},
- {"and(%lf, %lf): negative values will give strange results", 76},
- {"and(%lf, %lf): fractional values will be truncated", 77},
- {"or: received non-numeric first argument", 78},
- {"or(%lf, %lf): negative values will give strange results", 79},
- {"or(%lf, %lf): fractional values will be truncated", 80},
- {"xor: received non-numeric first argument", 81},
- {"xor(%lf, %lf): negative values will give strange results", 82},
- {"xor(%lf, %lf): fractional values will be truncated", 83},
- {"compl: received non-numeric argument", 84},
- {"compl(%lf): negative value will give strange results", 85},
- {"compl(%lf): fractional value will be truncated", 86},
- {"dcgettext: `%s' is not a valid locale category", 87},
- {"`extension' is a gawk extension", 88},
- {"extension: cannot open `%s' (%s)\n", 89},
- {"extension: library `%s': cannot call function `%s' (%s)\n", 90},
- {"Operation Not Supported", 91},
- {"%s: option `%s' is ambiguous\n", 92},
- {"%s: option `--%s' doesn't allow an argument\n", 93},
- {"%s: option `%c%s' doesn't allow an argument\n", 94},
- {"%s: option `%s' requires an argument\n", 95},
- {"%s: unrecognized option `--%s'\n", 96},
- {"%s: unrecognized option `%c%s'\n", 97},
- {"%s: illegal option -- %c\n", 98},
- {"%s: invalid option -- %c\n", 99},
- {"%s: option requires an argument -- %c\n", 100},
- {"%s: option `-W %s' is ambiguous\n", 101},
- {"%s: option `-W %s' doesn't allow an argument\n", 102},
- {"`-m[fr]' option irrelevant in gawk", 103},
- {"-m option usage: `-m[fr] nnn'", 104},
- {"%s: option `-W %s' unrecognized, ignored\n", 105},
- {"empty argument to `--source' ignored", 106},
- {"environment variable `POSIXLY_CORRECT' set: turning on `--posix'", 107},
- {"`--posix' overrides `--traditional'", 108},
- {"`--posix'/`--traditional' overrides `--non-decimal-data'", 109},
- {"runing %s setuid root may be a security problem", 110},
- {"can't set mode on stdin (%s)", 111},
- {"can't set mode on stdout (%s)", 112},
- {"can't set mode on stderr (%s)", 113},
- {"no program text at all!", 114},
- {"Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n", 115},
- {"Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n", 116},
- {"POSIX options:\t\tGNU long options:\n", 117},
- {"\t-f progfile\t\t--file=progfile\n", 118},
- {"\t-F fs\t\t\t--field-separator=fs\n", 119},
- {"\t-v var=val\t\t--assign=var=val\n", 120},
- {"\t-m[fr] val\n", 121},
- {"\t-W compat\t\t--compat\n", 122},
- {"\t-W copyleft\t\t--copyleft\n", 123},
- {"\t-W copyright\t\t--copyright\n", 124},
- {"\t-W dump-variables[=file]\t--dump-variables[=file]\n", 125},
- {"\t-W gen-po\t\t--gen-po\n", 126},
- {"\t-W help\t\t\t--help\n", 127},
- {"\t-W lint[=fatal]\t\t--lint[=fatal]\n", 128},
- {"\t-W lint-old\t\t--lint-old\n", 129},
- {"\t-W non-decimal-data\t--non-decimal-data\n", 130},
- {"\t-W nostalgia\t\t--nostalgia\n", 131},
- {"\t-W parsedebug\t\t--parsedebug\n", 132},
- {"\t-W profile[=file]\t--profile[=file]\n", 133},
- {"\t-W posix\t\t--posix\n", 134},
- {"\t-W re-interval\t\t--re-interval\n", 135},
- {"\t-W source=program-text\t--source=program-text\n", 136},
- {"\t-W traditional\t\t--traditional\n", 137},
- {"\t-W usage\t\t--usage\n", 138},
- {"\t-W version\t\t--version\n", 139},
- {"\
-\n\
-To report bugs, see node `Bugs' in `gawk.info', which is\n", 140},
- {"section `Reporting Problems and Bugs' in the printed version.\n", 141},
- {"\
-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\
-the Free Software Foundation; either version 2 of the License, or\n\
-(at your option) any later version.\n\
-\n", 142},
- {"\
-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", 143},
- {"\
-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", 144},
- {"-Ft does not set FS to tab in POSIX awk", 145},
- {"could not find groups: %s", 146},
- {"invalid syntax in name `%s' for variable assignment", 147},
- {"floating point exception", 148},
- {"fatal error: internal error", 149},
- {"no pre-opened fd %d", 150},
- {"could not pre-open /dev/null for fd %d", 151},
- {"could not open `%s' for writing: %s", 152},
- {"sending profile to standard error", 153},
- {"internal error: Node_var with null vname", 154},
- {"internal error: Node_var_array with null vname", 155},
- {"\
-function `%s' called with space between name and `(',\n\
-%s", 156},
- {"or used in other expression context", 157},
- {"attempt to use array `%s' in a scalar context", 158},
- {"illegal type (%s) in tree_eval", 159},
- {"attempt to use function `%s' as array", 160},
- {"`%s' is a function, assignment is not allowed", 161},
- {"assignment is not allowed to result of builtin function", 162},
- {"\t# gawk profile, created %s\n", 163},
- {"\
-\t# BEGIN block(s)\n\
-\n", 164},
- {"\
-\t# Rule(s)\n\
-\n", 165},
- {"\
-\t# END block(s)\n\
-\n", 166},
- {"\
-\n\
-\t# Functions, listed alphabetically\n", 167},
- {"unexpected type %s in prec_level", 168},
- {"Success", 169},
- {"No match", 170},
- {"Invalid regular expression", 171},
- {"Invalid collation character", 172},
- {"Invalid character class name", 173},
- {"Trailing backslash", 174},
- {"Invalid back reference", 175},
- {"Unmatched [ or [^", 176},
- {"Unmatched ( or \\(", 177},
- {"Unmatched \\{", 178},
- {"Invalid content of \\{\\}", 179},
- {"Invalid range end", 180},
- {"Memory exhausted", 181},
- {"Invalid preceding regular expression", 182},
- {"Premature end of regular expression", 183},
- {"Regular expression too big", 184},
- {"Unmatched ) or \\)", 185},
- {"No previous regular expression", 186},
- {"BEGIN blocks must have an action part", 187},
- {"END blocks must have an action part", 188},
- {"`%s' is a built-in function, it cannot be redefined", 189},
- {"statement may have no effect", 190},
- {"plain `print' in BEGIN or END rule should probably be `print \"\"'", 191},
- {"`next' used in BEGIN or END action", 192},
- {"`nextfile' is a gawk extension", 193},
- {"`nextfile' used in BEGIN or END action", 194},
- {"`return' used outside function context", 195},
- {"`delete array' is a gawk extension", 196},
- {"multistage two-way pipelines don't work", 197},
- {"regular expression on right of assignment", 198},
- {"non-redirected `getline' undefined inside END action", 199},
- {"regular expression on left of `~' or `!~' operator", 200},
- {"regexp constant `/%s/' looks like a C comment, but is not", 201},
- {"regular expression on right of comparison", 202},
- {"non-redirected `getline' undefined inside BEGIN or END action", 203},
- {"call of `length' without parentheses is not portable", 204},
- {"call of `length' without parentheses is deprecated by POSIX", 205},
- {"invalid subscript expression", 206},
- {"fptr %x not in tokentab\n", 207},
- {"unexpected newline", 208},
- {"empty program text on command line", 209},
- {"can't open source file `%s' for reading (%s)", 210},
- {"can't read sourcefile `%s' (%s)", 211},
- {"source file `%s' is empty", 212},
- {"source file does not end in newline", 213},
- {"unterminated regexp ends with `\\' at end of file", 214},
- {"unterminated regexp", 215},
- {"unterminated regexp at end of file", 216},
- {"use of `\\ #...' line continuation is not portable", 217},
- {"backslash not last character on line", 218},
- {"POSIX does not allow operator `**='", 219},
- {"old awk does not support operator `**='", 220},
- {"POSIX does not allow operator `**'", 221},
- {"old awk does not support operator `**'", 222},
- {"operator `^=' is not supported in old awk", 223},
- {"operator `^' is not supported in old awk", 224},
- {"unterminated string", 225},
- {"invalid char '%c' in expression", 226},
- {"`%s' is a gawk extension", 227},
- {"`%s' is a Bell Labs extension", 228},
- {"POSIX does not allow `%s'", 229},
- {"`%s' is not supported in old awk", 230},
- {"`goto' considered harmful!\n", 231},
- {"%d is invalid as number of arguments for %s", 232},
- {"match: third argument is a gawk extension", 233},
- {"%s: string literal as last arg of substitute has no effect", 234},
- {"sub third parameter is not a changeable object", 235},
- {"gsub third parameter is not a changeable object", 236},
- {"close: second argument is a gawk extension", 237},
- {"use of dcgettext(_\"...\") is incorrect: remove leading underscore", 238},
- {"function `%s': parameter #%d, `%s', duplicates parameter #%d", 239},
- {"function `%s': parameter `%s' shadows global variable", 240},
- {"could not open `%s' for writing (%s)", 241},
- {"%s: close failed (%s)", 242},
- {"shadow_funcs() called twice!", 243},
- {"function `%s': can't use function name as parameter name", 244},
- {"function name `%s' previously defined", 245},
- {"function `%s' called but never defined", 246},
- {"function `%s' defined but never called", 247},
- {"regexp constant for parameter #%d yields boolean value", 248},
- {"Unfinished \\ escape", 249},
- {"unfinished repeat count", 250},
- {"malformed repeat count", 251},
- {"Unbalanced [", 252},
- {"Unbalanced (", 253},
- {"No regexp syntax bits specified", 254},
- {"Unbalanced )", 255},
- {"out of memory", 256},
- {"split: second argument is not an array", 257},
- {"split: null string for third arg is a gawk extension", 258},
- {"`FIELDWIDTHS' is a gawk extension", 259},
- {"field %d in FIELDWIDTHS, must be > 0", 260},
- {"null string for `FS' is a gawk extension", 261},
- {"cmd. line:", 262},
- {"warning: ", 263},
- {"error: ", 264},
- {"fatal: ", 265},
- {"unknown nodetype %d", 266},
- {"buffer overflow in genflags2str", 267},
- {"for loop: array `%s' changed size from %d to %d during loop execution", 268},
- {"`break' outside a loop is not portable", 269},
- {"`break' outside a loop is not allowed", 270},
- {"`continue' outside a loop is not portable", 271},
- {"`continue' outside a loop is not allowed", 272},
- {"`next' cannot be called from a BEGIN rule", 273},
- {"`next' cannot be called from an END rule", 274},
- {"`nextfile' cannot be called from a BEGIN rule", 275},
- {"`nextfile' cannot be called from an END rule", 276},
- {"statement has no effect", 277},
- {"reference to uninitialized variable `%s'", 278},
- {"can't use function name `%s' as variable or array", 279},
- {"reference to uninitialized argument `%s'", 280},
- {"assignment used in conditional context", 281},
- {"\
-concatenation: side effects in one expression have changed the length of \
-another!", 282},
- {"division by zero attempted", 283},
- {"division by zero attempted in `%%'", 284},
- {"division by zero attempted in `/='", 285},
- {"division by zero attempted in `%%='", 286},
- {"%s (from %s)", 287},
- {"function `%s' called with more arguments than declared", 288},
- {"function `%s' not defined", 289},
- {"function %s called\n", 290},
- {"\
-\n\
-\t# Function Call Stack:\n\
-\n", 291},
- {"\t# -- main --\n", 292},
- {"attempt to field reference from non-numeric value", 293},
- {"attempt to reference from null string", 294},
- {"attempt to access field %d", 295},
- {"attempt to use scalar parameter `%s' as an array", 296},
- {"`IGNORECASE' is a gawk extension", 297},
- {"`BINMODE' is a gawk extension", 298},
- {"bad `%sFMT' specification `%s'", 299},
- {"turning off `--lint' due to assignment to `LINT'", 300},
- {"cannot open file `%s' for reading (%s)", 301},
- {"close of fd %d (`%s') failed (%s)", 302},
- {"invalid tree type %s in redirect()", 303},
- {"expression in `%s' redirection only has numeric value", 304},
- {"expression for `%s' redirection has null string value", 305},
- {"filename `%s' for `%s' redirection may be result of logical expression", 306},
- {"unnecessary mixing of `>' and `>>' for file `%.*s'", 307},
- {"can't open pipe `%s' for output (%s)", 308},
- {"can't open pipe `%s' for input (%s)", 309},
- {"can't open two way socket `%s' for input/output (%s)", 310},
- {"can't open two way pipe `%s' for input/output (%s)", 311},
- {"can't redirect from `%s' (%s)", 312},
- {"can't redirect to `%s' (%s)", 313},
- {"\
-reached system limit for open files: starting to multiplex file descriptors", 314},
- {"close of `%s' failed (%s).", 315},
- {"too many pipes or input files open", 316},
- {"close: second argument must be `to' or `from'", 317},
- {"close: `%.*s' is not an open file, pipe or co-process", 318},
- {"close of redirection that was never opened", 319},
- {"close: redirection `%s' not opened with `|&', second argument ignored", 320},
- {"failure status (%d) on pipe close of `%s' (%s)", 321},
- {"failure status (%d) on file close of `%s' (%s)", 322},
- {"no explicit close of socket `%s' provided", 323},
- {"no explicit close of co-process `%s' provided", 324},
- {"no explicit close of pipe `%s' provided", 325},
- {"no explicit close of file `%s' provided", 326},
- {"error writing standard output (%s)", 327},
- {"error writing standard error (%s)", 328},
- {"pipe flush of `%s' failed (%s).", 329},
- {"co-process flush of pipe to `%s' failed (%s).", 330},
- {"file flush of `%s' failed (%s).", 331},
- {"/inet/raw client not ready yet, sorry", 332},
- {"only root may use `/inet/raw'.", 333},
- {"/inet/raw server not ready yet, sorry", 334},
- {"no (known) protocol supplied in special filename `%s'", 335},
- {"special file name `%s' is incomplete", 336},
- {"local port invalid in `%s'", 337},
- {"must supply a remote hostname to `/inet'", 338},
- {"must supply a remote port to `/inet'", 339},
- {"remote port invalid in `%s'", 340},
- {"TCP/IP communications are not supported", 341},
- {"file `%s' is a directory", 342},
- {"use `PROCINFO[\"%s\"]' instead of `%s'", 343},
- {"use `PROCINFO[...]' instead of `/dev/user'", 344},
- {"could not open `%s', mode `%s'", 345},
- {"close of stdout in child failed (%s)", 346},
- {"moving pipe to stdout in child failed (dup: %s)", 347},
- {"close of stdin in child failed (%s)", 348},
- {"moving pipe to stdin in child failed (dup: %s)", 349},
- {"close of pipe failed (%s)", 350},
- {"pipe from `%s': could not set close-on-exec (fcntl: %s)", 351},
- {"pipe to `%s': could not set close-on-exec (fcntl: %s)", 352},
- {"`|&' not supported", 353},
- {"cannot open pipe `%s' (%s)", 354},
- {"cannot create child process for `%s' (fork: %s)", 355},
- {"data file `%s' is empty", 356},
- {"internal error: file `%s', line %d\n", 357},
- {"error reading input file `%s': %s", 358},
- {"multicharacter value of `RS' is a gawk extension", 359},
- {"can't convert string to float", 360},
- {"backslash at end of string", 361},
- {"POSIX does not allow `\\x' escapes", 362},
- {"no hex digits in `\\x' escape sequence", 363},
- {"escape sequence `\\%c' treated as plain `%c'", 364},
- {"%s %s `%s': could not set close-on-exec: %s", 365},
-};
-
-int _msg_tbl_length = 365;
diff --git a/po/de.gmo b/po/de.gmo
new file mode 100644
index 00000000..829881cf
--- /dev/null
+++ b/po/de.gmo
Binary files differ
diff --git a/po/de.po b/po/de.po
new file mode 100644
index 00000000..675a69d9
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,1778 @@
+# GNU awk message strings
+# Copyright (C) 2000 Free Software Foundation, Inc.
+# Unknown Author, <info@gnu.org>, 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 <ck@held.mind.de>\n"
+"Language-Team: German <de@li.org>\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 --git a/po/en@boldquot.header b/po/en@boldquot.header
new file mode 100644
index 00000000..fedb6a06
--- /dev/null
+++ b/po/en@boldquot.header
@@ -0,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 --git a/po/en@quot.header b/po/en@quot.header
new file mode 100644
index 00000000..a9647fc3
--- /dev/null
+++ b/po/en@quot.header
@@ -0,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 --git a/po/es.gmo b/po/es.gmo
new file mode 100644
index 00000000..1f8fed83
--- /dev/null
+++ b/po/es.gmo
Binary files differ
diff --git a/po/es.po b/po/es.po
new file mode 100644
index 00000000..3aadcc2f
--- /dev/null
+++ b/po/es.po
@@ -0,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 <cfuga@itam.mx>, 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 <cfuga@itam.mx>\n"
+"Language-Team: Spanish <es@li.org>\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 --git a/po/fr.gmo b/po/fr.gmo
new file mode 100644
index 00000000..79cc9fd2
--- /dev/null
+++ b/po/fr.gmo
Binary files differ
diff --git a/po/fr.po b/po/fr.po
new file mode 100644
index 00000000..4d209dbb
--- /dev/null
+++ b/po/fr.po
@@ -0,0 +1,1788 @@
+# Messages français pour gawk.
+# Copyright © 1996 Free Software Foundation, Inc.
+# Michel Robitaille <robitail@IRO.UMontreal.CA>, 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 <robitail@IRO.UMontreal.CA>\n"
+"Language-Team: French <traduc@traduc.org>\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 --git a/po/gawk.pot b/po/gawk.pot
index 57a26254..d0672df2 100644
--- a/po/gawk.pot
+++ b/po/gawk.pot
@@ -1,74 +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 <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2001-05-15 19:48+0300\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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: ENCODING\n"
+"Content-Transfer-Encoding: 8bit\n"
-#: array.c:243 array.c:278 eval.c:483
+#: 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:302
+#: array.c:304
#, c-format
msgid "reference to uninitialized element `%s[\"%s\"]'"
msgstr ""
-#: array.c:308
+#: array.c:310
#, c-format
msgid "subscript of array `%s' is null string"
msgstr ""
-#: array.c:371 array.c:454
+#: array.c:373 array.c:456
#, c-format
msgid "delete: illegal use of variable `%s' as array"
msgstr ""
-#: array.c:404
+#: array.c:406
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr ""
-#: array.c:569
+#: array.c:571
#, c-format
msgid "%s: empty (null)\n"
msgstr ""
-#: array.c:574
+#: array.c:576
#, c-format
msgid "%s: empty (zero)\n"
msgstr ""
-#: array.c:578
+#: array.c:580
#, c-format
msgid "%s: table_size = %d, array_size = %d\n"
msgstr ""
-#: array.c:610
+#: array.c:612
#, c-format
-msgid "%s: is paramater\n"
+msgid "%s: is parameter\n"
msgstr ""
-#: array.c:615
+#: array.c:617
#, c-format
msgid "%s: array_ref to %s\n"
msgstr ""
-#: array.c:842
+#: array.c:844
msgid "asort: first argument is not an array"
msgstr ""
-#: array.c:851
+#: array.c:853
msgid "asort: second argument is not an array"
msgstr ""
@@ -109,292 +110,295 @@ msgstr ""
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr ""
-#: builtin.c:222
+#: builtin.c:295
msgid "index: received non-string first argument"
msgstr ""
-#: builtin.c:224
+#: builtin.c:297
msgid "index: received non-string second argument"
msgstr ""
-#: builtin.c:287
+#: builtin.c:407
msgid "int: received non-numeric argument"
msgstr ""
-#: builtin.c:304
+#: builtin.c:424
msgid "length: received non-string argument"
msgstr ""
-#: builtin.c:320
+#: builtin.c:440
msgid "log: received non-numeric argument"
msgstr ""
-#: builtin.c:323
+#: builtin.c:443
#, c-format
msgid "log: received negative argument %g"
msgstr ""
-#: builtin.c:583
+#: 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:589
+#: builtin.c:709
msgid "arg count with `$' must be > 0"
msgstr ""
-#: builtin.c:591
+#: builtin.c:711
#, c-format
msgid "arg count %d greater than total number of supplied arguments"
msgstr ""
-#: builtin.c:593
+#: builtin.c:713
msgid "`$' not permitted after period in format"
msgstr ""
-#: builtin.c:606
+#: builtin.c:726
msgid "no `$' supplied for positional field width or precision"
msgstr ""
-#: builtin.c:664
+#: builtin.c:784
msgid "`l' is meaningless in awk formats; ignored"
msgstr ""
-#: builtin.c:668
+#: builtin.c:788
msgid "`l' is not permitted in POSIX awk formats"
msgstr ""
-#: builtin.c:679
+#: builtin.c:799
msgid "`L' is meaningless in awk formats; ignored"
msgstr ""
-#: builtin.c:683
+#: builtin.c:803
msgid "`L' is not permitted in POSIX awk formats"
msgstr ""
-#: builtin.c:694
+#: builtin.c:814
msgid "`h' is meaningless in awk formats; ignored"
msgstr ""
-#: builtin.c:698
+#: builtin.c:818
msgid "`h' is not permitted in POSIX awk formats"
msgstr ""
-#: builtin.c:947
+#: builtin.c:1067
msgid "not enough arguments to satisfy format string"
msgstr ""
-#: builtin.c:949
+#: builtin.c:1069
msgid "^ ran out for this one"
msgstr ""
-#: builtin.c:954
+#: builtin.c:1074
msgid "[s]printf: format specifier does not have control letter"
msgstr ""
-#: builtin.c:957
+#: builtin.c:1077
msgid "too many arguments supplied for format string"
msgstr ""
-#: builtin.c:1000 builtin.c:1003
+#: builtin.c:1120 builtin.c:1123
msgid "printf: no arguments"
msgstr ""
-#: builtin.c:1036
+#: builtin.c:1156
msgid "sqrt: received non-numeric argument"
msgstr ""
-#: builtin.c:1040
+#: builtin.c:1160
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr ""
-#: builtin.c:1062
+#: builtin.c:1182
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr ""
-#: builtin.c:1067
+#: builtin.c:1187
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr ""
-#: builtin.c:1081
+#: builtin.c:1201
#, c-format
msgid "substr: length %g is <= 0"
msgstr ""
-#: builtin.c:1087
+#: builtin.c:1207
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr ""
-#: builtin.c:1094
+#: builtin.c:1214
msgid "substr: source string is zero length"
msgstr ""
-#: builtin.c:1101
+#: builtin.c:1221
#, c-format
msgid ""
"substr: length %d at start index %d exceeds length of first argument (%d)"
msgstr ""
-#: builtin.c:1107
+#: builtin.c:1227
#, c-format
msgid "substr: start index %d is past end of string"
msgstr ""
-#: builtin.c:1143
-msgid "strftime: recieved non-string first argument"
+#: builtin.c:1263
+msgid "strftime: received non-string first argument"
msgstr ""
-#: builtin.c:1149
+#: builtin.c:1269
msgid "strftime: received empty format string"
msgstr ""
-#: builtin.c:1158
-msgid "strftime: recieved non-numeric second argument"
+#: builtin.c:1278
+msgid "strftime: received non-numeric second argument"
msgstr ""
-#: builtin.c:1221
+#: builtin.c:1341
msgid "mktime: received non-string argument"
msgstr ""
-#: builtin.c:1266
-msgid "system: recieved non-string argument"
+#: builtin.c:1386
+msgid "system: received non-string argument"
msgstr ""
-#: builtin.c:1386
-msgid "tolower: recieved non-string argument"
+#: builtin.c:1512
+msgid "tolower: received non-string argument"
msgstr ""
-#: builtin.c:1407
-msgid "toupper: recieved non-string argument"
+#: builtin.c:1561
+msgid "toupper: received non-string argument"
msgstr ""
-#: builtin.c:1430
+#: builtin.c:1606
msgid "atan2: received non-numeric first argument"
msgstr ""
-#: builtin.c:1432
+#: builtin.c:1608
msgid "atan2: received non-numeric second argument"
msgstr ""
-#: builtin.c:1451
+#: builtin.c:1627
msgid "sin: received non-numeric argument"
msgstr ""
-#: builtin.c:1467
+#: builtin.c:1643
msgid "cos: received non-numeric argument"
msgstr ""
-#: builtin.c:1511
+#: builtin.c:1687
msgid "srand: received non-numeric argument"
msgstr ""
-#: builtin.c:1545
+#: builtin.c:1721
msgid "match: third argument is not an array"
msgstr ""
-#: builtin.c:1942
+#: builtin.c:2157
msgid "gensub: 3rd argument of 0 treated as 1"
msgstr ""
-#: builtin.c:2053 builtin.c:2055
+#: builtin.c:2268 builtin.c:2270
msgid "lshift: received non-numeric first argument"
msgstr ""
-#: builtin.c:2057
+#: builtin.c:2272
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr ""
-#: builtin.c:2059
+#: builtin.c:2274
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr ""
-#: builtin.c:2061
+#: builtin.c:2276
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
-#: builtin.c:2090 builtin.c:2092
+#: builtin.c:2305 builtin.c:2307
msgid "rshift: received non-numeric first argument"
msgstr ""
-#: builtin.c:2094
+#: builtin.c:2309
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr ""
-#: builtin.c:2096
+#: builtin.c:2311
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr ""
-#: builtin.c:2098
+#: builtin.c:2313
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
-#: builtin.c:2127 builtin.c:2129
+#: builtin.c:2342 builtin.c:2344
msgid "and: received non-numeric first argument"
msgstr ""
-#: builtin.c:2131
+#: builtin.c:2346
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr ""
-#: builtin.c:2133
+#: builtin.c:2348
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr ""
-#: builtin.c:2162 builtin.c:2164
+#: builtin.c:2377 builtin.c:2379
msgid "or: received non-numeric first argument"
msgstr ""
-#: builtin.c:2166
+#: builtin.c:2381
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr ""
-#: builtin.c:2168
+#: builtin.c:2383
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr ""
-#: builtin.c:2197 builtin.c:2199
+#: builtin.c:2412 builtin.c:2414
msgid "xor: received non-numeric first argument"
msgstr ""
-#: builtin.c:2201
+#: builtin.c:2416
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr ""
-#: builtin.c:2203
+#: builtin.c:2418
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr ""
-#: builtin.c:2231
+#: builtin.c:2446
msgid "compl: received non-numeric argument"
msgstr ""
-#: builtin.c:2233
+#: builtin.c:2448
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr ""
-#: builtin.c:2235
+#: builtin.c:2450
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr ""
-#. not there
-#: builtin.c:2429
+#: builtin.c:2621
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr ""
@@ -417,237 +421,242 @@ msgstr ""
msgid "Operation Not Supported"
msgstr ""
-#: getopt.c:688
+#: getopt.c:692 getopt.c:704
#, c-format
msgid "%s: option `%s' is ambiguous\n"
msgstr ""
-#: getopt.c:713
+#: getopt.c:737 getopt.c:741
#, c-format
msgid "%s: option `--%s' doesn't allow an argument\n"
msgstr ""
-#: getopt.c:718
+#: getopt.c:750 getopt.c:755
#, c-format
msgid "%s: option `%c%s' doesn't allow an argument\n"
msgstr ""
-#: getopt.c:736 getopt.c:909
+#: getopt.c:791 getopt.c:804 getopt.c:1093 getopt.c:1106
#, c-format
msgid "%s: option `%s' requires an argument\n"
msgstr ""
-#. --option
-#: getopt.c:765
+#: getopt.c:842 getopt.c:845
#, c-format
msgid "%s: unrecognized option `--%s'\n"
msgstr ""
-#. +option or -option
-#: getopt.c:769
+#: getopt.c:853 getopt.c:856
#, c-format
msgid "%s: unrecognized option `%c%s'\n"
msgstr ""
-#. 1003.2 specifies the format of this message.
-#: getopt.c:795
+#: getopt.c:903 getopt.c:906
#, c-format
msgid "%s: illegal option -- %c\n"
msgstr ""
-#: getopt.c:798
+#: getopt.c:912 getopt.c:915
#, 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
+#: 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:875
+#: getopt.c:1025 getopt.c:1036
#, c-format
msgid "%s: option `-W %s' is ambiguous\n"
msgstr ""
-#: getopt.c:893
+#: getopt.c:1060 getopt.c:1072
#, c-format
msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr ""
-#: main.c:292
+#: main.c:307
msgid "`-m[fr]' option irrelevant in gawk"
msgstr ""
-#: main.c:294
+#: main.c:309
msgid "-m option usage: `-m[fr] nnn'"
msgstr ""
-#. gawk specific options - now in getopt_long
-#: main.c:311
+#: main.c:326
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr ""
-#: main.c:342
+#: main.c:357
msgid "empty argument to `--source' ignored"
msgstr ""
-#: main.c:414
+#: main.c:429
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr ""
-#. both on command line
-#: main.c:419
+#: main.c:434
msgid "`--posix' overrides `--traditional'"
msgstr ""
-#: main.c:430
+#: main.c:445
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr ""
-#: main.c:434
+#: main.c:449
#, c-format
-msgid "runing %s setuid root may be a security problem"
+msgid "running %s setuid root may be a security problem"
msgstr ""
-#: main.c:463
+#: main.c:478
#, c-format
msgid "can't set mode on stdin (%s)"
msgstr ""
-#: main.c:466
+#: main.c:481
#, c-format
msgid "can't set mode on stdout (%s)"
msgstr ""
-#: main.c:468
+#: main.c:483
#, c-format
msgid "can't set mode on stderr (%s)"
msgstr ""
-#: main.c:497
+#: main.c:512
msgid "no program text at all!"
msgstr ""
-#. Not factoring out common stuff makes it easier to translate.
-#: main.c:541
+#: main.c:556
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr ""
-#: main.c:543
+#: main.c:558
#, 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
+#: main.c:563
msgid "POSIX options:\t\tGNU long options:\n"
msgstr ""
-#: main.c:549
+#: main.c:564
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr ""
-#: main.c:550
+#: main.c:565
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr ""
-#: main.c:551
+#: main.c:566
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr ""
-#: main.c:552
+#: main.c:567
msgid "\t-m[fr] val\n"
msgstr ""
-#: main.c:553
+#: main.c:568
msgid "\t-W compat\t\t--compat\n"
msgstr ""
-#: main.c:554
+#: main.c:569
msgid "\t-W copyleft\t\t--copyleft\n"
msgstr ""
-#: main.c:555
+#: main.c:570
msgid "\t-W copyright\t\t--copyright\n"
msgstr ""
-#: main.c:556
+#: main.c:571
msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
msgstr ""
-#: main.c:557
+#: main.c:572
msgid "\t-W gen-po\t\t--gen-po\n"
msgstr ""
-#: main.c:558
+#: main.c:573
msgid "\t-W help\t\t\t--help\n"
msgstr ""
-#: main.c:559
+#: main.c:574
msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
msgstr ""
-#: main.c:560
+#: main.c:575
msgid "\t-W lint-old\t\t--lint-old\n"
msgstr ""
-#: main.c:561
+#: main.c:576
msgid "\t-W non-decimal-data\t--non-decimal-data\n"
msgstr ""
-#: main.c:563
+#: main.c:578
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr ""
-#: main.c:566
+#: main.c:581
msgid "\t-W parsedebug\t\t--parsedebug\n"
msgstr ""
-#: main.c:568
+#: main.c:583
msgid "\t-W profile[=file]\t--profile[=file]\n"
msgstr ""
-#: main.c:569
+#: main.c:584
msgid "\t-W posix\t\t--posix\n"
msgstr ""
-#: main.c:570
+#: main.c:585
msgid "\t-W re-interval\t\t--re-interval\n"
msgstr ""
-#: main.c:571
+#: main.c:586
msgid "\t-W source=program-text\t--source=program-text\n"
msgstr ""
-#: main.c:572
+#: main.c:587
msgid "\t-W traditional\t\t--traditional\n"
msgstr ""
-#: main.c:573
+#: main.c:588
msgid "\t-W usage\t\t--usage\n"
msgstr ""
-#: main.c:574
+#: main.c:589
msgid "\t-W version\t\t--version\n"
msgstr ""
-#: main.c:575
+#: 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:576
-msgid "section `Reporting Problems and Bugs' in the printed version.\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:586
+#: main.c:601
msgid ""
-"Copyright (C) 1989, 1991-2001 Free Software Foundation.\n"
+"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,7 +665,7 @@ msgid ""
"\n"
msgstr ""
-#: main.c:594
+#: 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,546 +674,529 @@ msgid ""
"\n"
msgstr ""
-#: main.c:600
+#: 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:630
+#: main.c:657
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
+#: main.c:888
#, c-format
msgid "invalid syntax in name `%s' for variable assignment"
msgstr ""
-#: main.c:938
+#: main.c:957
msgid "floating point exception"
msgstr ""
-#: main.c:945
+#: main.c:964
msgid "fatal error: internal error"
msgstr ""
-#: main.c:995
+#: main.c:1014
#, c-format
msgid "no pre-opened fd %d"
msgstr ""
-#: main.c:1000
+#: 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 ""
-#: awkgram.y:2281 profile.c:96
+#: profile.c:96 awkgram.y:2465
msgid "sending profile to standard error"
msgstr ""
-#: profile.c:402
+#: profile.c:409
msgid "internal error: Node_var with null vname"
msgstr ""
-#: profile.c:508
+#: profile.c:524
msgid "internal error: Node_var_array with null vname"
msgstr ""
-#: eval.c:816 profile.c:531
+#: profile.c:554 eval.c:813
#, c-format
msgid ""
"function `%s' called with space between name and `(',\n"
"%s"
msgstr ""
-#: eval.c:818 profile.c:533
+#: profile.c:556 eval.c:815
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
+#: 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 ""
-#: eval.c:1046 profile.c:614
+#: profile.c:637 eval.c:1047
#, c-format
msgid "illegal type (%s) in tree_eval"
msgstr ""
-#: eval.c:1785 profile.c:815
+#: profile.c:842 eval.c:1790
#, c-format
msgid "attempt to use function `%s' as array"
msgstr ""
-#: eval.c:1792 profile.c:829
+#: profile.c:856 eval.c:1797
#, 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
+#: profile.c:860 eval.c:1803 eval.c:1810
msgid "assignment is not allowed to result of builtin function"
msgstr ""
-#. \n on purpose, with \n in ctime() output
-#: profile.c:1083
+#: profile.c:1108
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr ""
-#: profile.c:1086
+#: profile.c:1111
msgid ""
"\t# BEGIN block(s)\n"
"\n"
msgstr ""
-#: profile.c:1096
+#: profile.c:1121
msgid ""
"\t# Rule(s)\n"
"\n"
msgstr ""
-#: profile.c:1102
+#: profile.c:1127
msgid ""
"\t# END block(s)\n"
"\n"
msgstr ""
-#: profile.c:1122
+#: profile.c:1147
msgid ""
"\n"
"\t# Functions, listed alphabetically\n"
msgstr ""
-#: profile.c:1325
+#: profile.c:1357
#, c-format
msgid "unexpected type %s in prec_level"
msgstr ""
-#: regex.c:1017
+#: regex.c:1322
msgid "Success"
msgstr ""
-#. REG_NOERROR
-#: regex.c:1018
+#: regex.c:1323
msgid "No match"
msgstr ""
-#. REG_NOMATCH
-#: regex.c:1019
+#: regex.c:1324
msgid "Invalid regular expression"
msgstr ""
-#. REG_BADPAT
-#: regex.c:1020
+#: regex.c:1325
msgid "Invalid collation character"
msgstr ""
-#. REG_ECOLLATE
-#: regex.c:1021
+#: regex.c:1326
msgid "Invalid character class name"
msgstr ""
-#. REG_ECTYPE
-#: regex.c:1022
+#: regex.c:1327
msgid "Trailing backslash"
msgstr ""
-#. REG_EESCAPE
-#: regex.c:1023
+#: regex.c:1328
msgid "Invalid back reference"
msgstr ""
-#. REG_ESUBREG
-#: regex.c:1024
+#: regex.c:1329
msgid "Unmatched [ or [^"
msgstr ""
-#. REG_EBRACK
-#: regex.c:1025
+#: regex.c:1330
msgid "Unmatched ( or \\("
msgstr ""
-#. REG_EPAREN
-#: regex.c:1026
+#: regex.c:1331
msgid "Unmatched \\{"
msgstr ""
-#. REG_EBRACE
-#: regex.c:1027
+#: regex.c:1332
msgid "Invalid content of \\{\\}"
msgstr ""
-#. REG_BADBR
-#: regex.c:1028
+#: regex.c:1333
msgid "Invalid range end"
msgstr ""
-#. REG_ERANGE
-#: dfa.c:167 dfa.c:178 dfa.c:189 regex.c:1029
+#: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204
msgid "Memory exhausted"
msgstr ""
-#. REG_ESPACE
-#: regex.c:1030
+#: regex.c:1335
msgid "Invalid preceding regular expression"
msgstr ""
-#. REG_BADRPT
-#: regex.c:1031
+#: regex.c:1336
msgid "Premature end of regular expression"
msgstr ""
-#. REG_EEND
-#: regex.c:1032
+#: regex.c:1337
msgid "Regular expression too big"
msgstr ""
-#. REG_ESIZE
-#: regex.c:1033
+#: regex.c:1338
msgid "Unmatched ) or \\)"
msgstr ""
-#: regex.c:5531
+#: regex.c:7365
msgid "No previous regular expression"
msgstr ""
-#: awkgram.y:230
+#: awkgram.y:232
msgid "BEGIN blocks must have an action part"
msgstr ""
-#: awkgram.y:236
+#: awkgram.y:238
msgid "END blocks must have an action part"
msgstr ""
-#: awkgram.y:272
+#: awkgram.y:274
#, c-format
msgid "`%s' is a built-in function, it cannot be redefined"
msgstr ""
-#: awkgram.y:360
+#: awkgram.y:362
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
+#: awkgram.y:455
msgid "`next' used in BEGIN or END action"
msgstr ""
-#: awkgram.y:476 awkgram.y:483
+#: awkgram.y:462 awkgram.y:469
msgid "`nextfile' is a gawk extension"
msgstr ""
-#: awkgram.y:488
+#: awkgram.y:474
msgid "`nextfile' used in BEGIN or END action"
msgstr ""
-#: awkgram.y:497
+#: awkgram.y:483
msgid "`return' used outside function context"
msgstr ""
-#: awkgram.y:506 awkgram.y:513
+#: 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:571
+#: awkgram.y:604
msgid "multistage two-way pipelines don't work"
msgstr ""
-#: awkgram.y:662
+#: awkgram.y:695
msgid "regular expression on right of assignment"
msgstr ""
-#: awkgram.y:680
+#: awkgram.y:713
msgid "non-redirected `getline' undefined inside END action"
msgstr ""
-#: awkgram.y:690
+#: awkgram.y:723
msgid "regular expression on left of `~' or `!~' operator"
msgstr ""
-#: awkgram.y:700
+#: awkgram.y:733
#, c-format
msgid "regexp constant `/%s/' looks like a C comment, but is not"
msgstr ""
-#: awkgram.y:716
+#: awkgram.y:749
msgid "regular expression on right of comparison"
msgstr ""
-#: awkgram.y:743
+#: awkgram.y:776
msgid "non-redirected `getline' undefined inside BEGIN or END action"
msgstr ""
-#: awkgram.y:798
+#: awkgram.y:831
msgid "call of `length' without parentheses is not portable"
msgstr ""
-#: awkgram.y:801
+#: awkgram.y:834
msgid "call of `length' without parentheses is deprecated by POSIX"
msgstr ""
-#: awkgram.y:851
+#: awkgram.y:884
msgid "invalid subscript expression"
msgstr ""
-#: awkgram.y:985
+#: awkgram.y:1033
#, c-format
msgid "fptr %x not in tokentab\n"
msgstr ""
-#: awkgram.y:1019
+#: awkgram.y:1068
msgid "unexpected newline"
msgstr ""
-#: awkgram.y:1098
+#: awkgram.y:1152
msgid "empty program text on command line"
msgstr ""
-#: awkgram.y:1155
+#: awkgram.y:1209
#, c-format
msgid "can't open source file `%s' for reading (%s)"
msgstr ""
-#: awkgram.y:1190
+#: awkgram.y:1244
#, c-format
msgid "can't read sourcefile `%s' (%s)"
msgstr ""
-#: awkgram.y:1198
+#: awkgram.y:1252
#, c-format
msgid "source file `%s' is empty"
msgstr ""
-#: awkgram.y:1312 awkgram.y:1417 awkgram.y:1435 awkgram.y:1778 awkgram.y:1840
+#: 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:1373
+#: awkgram.y:1518
msgid "unterminated regexp ends with `\\' at end of file"
msgstr ""
-#: awkgram.y:1394
+#: awkgram.y:1539
msgid "unterminated regexp"
msgstr ""
-#: awkgram.y:1397
+#: awkgram.y:1542
msgid "unterminated regexp at end of file"
msgstr ""
-#: awkgram.y:1461
+#: awkgram.y:1609
msgid "use of `\\ #...' line continuation is not portable"
msgstr ""
-#: awkgram.y:1473
+#: awkgram.y:1621
msgid "backslash not last character on line"
msgstr ""
-#: awkgram.y:1514
+#: awkgram.y:1662
msgid "POSIX does not allow operator `**='"
msgstr ""
-#: awkgram.y:1516
+#: awkgram.y:1664
msgid "old awk does not support operator `**='"
msgstr ""
-#: awkgram.y:1525
+#: awkgram.y:1673
msgid "POSIX does not allow operator `**'"
msgstr ""
-#: awkgram.y:1527
+#: awkgram.y:1675
msgid "old awk does not support operator `**'"
msgstr ""
-#: awkgram.y:1560
+#: awkgram.y:1708
msgid "operator `^=' is not supported in old awk"
msgstr ""
-#: awkgram.y:1568
+#: awkgram.y:1716
msgid "operator `^' is not supported in old awk"
msgstr ""
-#: awkgram.y:1650 awkgram.y:1664
+#: awkgram.y:1798 awkgram.y:1815
msgid "unterminated string"
msgstr ""
-#: awkgram.y:1815
+#: awkgram.y:1972
#, c-format
msgid "invalid char '%c' in expression"
msgstr ""
-#: awkgram.y:1861
+#: awkgram.y:2032
#, c-format
msgid "`%s' is a gawk extension"
msgstr ""
-#: awkgram.y:1864
+#: awkgram.y:2035
#, c-format
msgid "`%s' is a Bell Labs extension"
msgstr ""
-#: awkgram.y:1867
+#: awkgram.y:2038
#, c-format
msgid "POSIX does not allow `%s'"
msgstr ""
-#: awkgram.y:1871
+#: awkgram.y:2042
#, c-format
msgid "`%s' is not supported in old awk"
msgstr ""
-#: awkgram.y:1899
+#: awkgram.y:2070
msgid "`goto' considered harmful!\n"
msgstr ""
-#: awkgram.y:1963
+#: awkgram.y:2134
#, c-format
msgid "%d is invalid as number of arguments for %s"
msgstr ""
-#: awkgram.y:1982 awkgram.y:1985
+#: awkgram.y:2153 awkgram.y:2156
msgid "match: third argument is a gawk extension"
msgstr ""
-#: awkgram.y:2001
+#: awkgram.y:2172
#, c-format
msgid "%s: string literal as last arg of substitute has no effect"
msgstr ""
-#: awkgram.y:2005
+#: awkgram.y:2176
msgid "sub third parameter is not a changeable object"
msgstr ""
-#: awkgram.y:2007
+#: awkgram.y:2178
msgid "gsub third parameter is not a changeable object"
msgstr ""
-#: awkgram.y:2033 awkgram.y:2036
+#: awkgram.y:2204 awkgram.y:2207
msgid "close: second argument is a gawk extension"
msgstr ""
-#: awkgram.y:2046
+#: awkgram.y:2217
msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
-#: awkgram.y:2139
+#: 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:2171
+#: awkgram.y:2355
#, c-format
msgid "function `%s': parameter `%s' shadows global variable"
msgstr ""
-#: awkgram.y:2280
+#: awkgram.y:2464
#, c-format
msgid "could not open `%s' for writing (%s)"
msgstr ""
-#: awkgram.y:2311
+#: awkgram.y:2495
#, c-format
msgid "%s: close failed (%s)"
msgstr ""
-#: awkgram.y:2421
+#: awkgram.y:2605
msgid "shadow_funcs() called twice!"
msgstr ""
-#: awkgram.y:2496
+#: awkgram.y:2680
#, c-format
msgid "function `%s': can't use function name as parameter name"
msgstr ""
-#: awkgram.y:2506
+#: awkgram.y:2690
#, c-format
msgid "function name `%s' previously defined"
msgstr ""
-#: awkgram.y:2654 awkgram.y:2660
+#: awkgram.y:2838 awkgram.y:2844
#, c-format
msgid "function `%s' called but never defined"
msgstr ""
-#: awkgram.y:2663
+#: awkgram.y:2847
#, c-format
msgid "function `%s' defined but never called"
msgstr ""
-#: awkgram.y:2690
+#: awkgram.y:2874
#, c-format
msgid "regexp constant for parameter #%d yields boolean value"
msgstr ""
-#: dfa.c:451
+#: 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 ""
-#. 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
+#: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955
msgid "unfinished repeat count"
msgstr ""
-#: dfa.c:597 dfa.c:614 dfa.c:622 dfa.c:626
+#: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958
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
+#: dfa.c:1285
msgid "Unbalanced ("
msgstr ""
-#: dfa.c:1003
+#: dfa.c:1407
msgid "No regexp syntax bits specified"
msgstr ""
-#: dfa.c:1011
+#: dfa.c:1415
msgid "Unbalanced )"
msgstr ""
-#: dfa.c:2002
+#: dfa.c:3014
msgid "out of memory"
msgstr ""
-#: field.c:787
+#: field.c:849
msgid "split: second argument is not an array"
msgstr ""
-#: field.c:814
+#: field.c:876
msgid "split: null string for third arg is a gawk extension"
msgstr ""
-#: field.c:854
+#: field.c:916
msgid "`FIELDWIDTHS' is a gawk extension"
msgstr ""
-#: field.c:881
+#: field.c:943
#, c-format
msgid "field %d in FIELDWIDTHS, must be > 0"
msgstr ""
-#: field.c:935
+#: field.c:997
msgid "null string for `FS' is a gawk extension"
msgstr ""
@@ -1224,163 +1216,169 @@ msgstr ""
msgid "fatal: "
msgstr ""
-#: eval.c:258
+#: eval.c:259
#, c-format
msgid "unknown nodetype %d"
msgstr ""
-#: eval.c:306
+#: eval.c:307
msgid "buffer overflow in genflags2str"
msgstr ""
-#: eval.c:545
+#: eval.c:541
#, c-format
msgid "for loop: array `%s' changed size from %d to %d during loop execution"
msgstr ""
-#: eval.c:569
+#: eval.c:565
msgid "`break' outside a loop is not portable"
msgstr ""
-#: eval.c:573
+#: eval.c:569
msgid "`break' outside a loop is not allowed"
msgstr ""
-#: eval.c:592
+#: eval.c:588
msgid "`continue' outside a loop is not portable"
msgstr ""
-#: eval.c:596
+#: eval.c:592
msgid "`continue' outside a loop is not allowed"
msgstr ""
-#: eval.c:626
+#: eval.c:622
msgid "`next' cannot be called from a BEGIN rule"
msgstr ""
-#: eval.c:628
+#: eval.c:624
msgid "`next' cannot be called from an END rule"
msgstr ""
-#: eval.c:640
+#: eval.c:636
msgid "`nextfile' cannot be called from a BEGIN rule"
msgstr ""
-#: eval.c:642
+#: eval.c:638
msgid "`nextfile' cannot be called from an END rule"
msgstr ""
-#: eval.c:683
+#: eval.c:679
msgid "statement has no effect"
msgstr ""
-#: eval.c:717 eval.c:747 eval.c:1617
+#: eval.c:713 eval.c:743 eval.c:1622
#, c-format
msgid "reference to uninitialized variable `%s'"
msgstr ""
-#: eval.c:725 eval.c:1603
+#: eval.c:721 eval.c:1608
#, c-format
msgid "can't use function name `%s' as variable or array"
msgstr ""
-#: eval.c:732 eval.c:738 eval.c:1742
+#: eval.c:728 eval.c:734 eval.c:1747
#, c-format
msgid "reference to uninitialized argument `%s'"
msgstr ""
-#: eval.c:826
+#: eval.c:823
msgid "assignment used in conditional context"
msgstr ""
-#: eval.c:917
+#: eval.c:914
msgid ""
"concatenation: side effects in one expression have changed the length of "
"another!"
msgstr ""
-#: eval.c:1012
+#: eval.c:1013
msgid "division by zero attempted"
msgstr ""
-#: eval.c:1027
+#: eval.c:1028
+#, c-format
msgid "division by zero attempted in `%%'"
msgstr ""
-#: eval.c:1228
+#: eval.c:1236
msgid "division by zero attempted in `/='"
msgstr ""
-#: eval.c:1246
+#: eval.c:1254
+#, c-format
msgid "division by zero attempted in `%%='"
msgstr ""
-#: eval.c:1419
+#: eval.c:1424
#, c-format
msgid "%s (from %s)"
msgstr ""
-#: eval.c:1467
+#: eval.c:1472
#, c-format
msgid "function `%s' called with more arguments than declared"
msgstr ""
-#: eval.c:1514
+#: eval.c:1519
#, c-format
msgid "function `%s' not defined"
msgstr ""
-#: eval.c:1516
+#: eval.c:1521
#, c-format
msgid "function %s called\n"
msgstr ""
-#: eval.c:1575
+#: eval.c:1580
msgid ""
"\n"
"\t# Function Call Stack:\n"
"\n"
msgstr ""
-#: eval.c:1578
+#: eval.c:1583
msgid "\t# -- main --\n"
msgstr ""
-#: eval.c:1754
+#: eval.c:1759
msgid "attempt to field reference from non-numeric value"
msgstr ""
-#: eval.c:1756
+#: eval.c:1761
msgid "attempt to reference from null string"
msgstr ""
-#: eval.c:1762
+#: eval.c:1767
#, c-format
msgid "attempt to access field %d"
msgstr ""
-#: eval.c:1778
+#: eval.c:1783
#, c-format
msgid "attempt to use scalar parameter `%s' as an array"
msgstr ""
-#: eval.c:1869
+#: eval.c:1874
msgid "`IGNORECASE' is a gawk extension"
msgstr ""
-#: eval.c:1897
+#: eval.c:1902
msgid "`BINMODE' is a gawk extension"
msgstr ""
-#: eval.c:2009
+#: eval.c:2014
#, c-format
msgid "bad `%sFMT' specification `%s'"
msgstr ""
-#: eval.c:2075
+#: 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,13 +1449,11 @@ msgid ""
"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 ""
@@ -1471,7 +1467,6 @@ msgstr ""
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 ""
@@ -1536,7 +1531,6 @@ msgstr ""
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 ""
@@ -1545,7 +1539,6 @@ msgstr ""
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 ""
@@ -1582,7 +1575,7 @@ msgstr ""
msgid "TCP/IP communications are not supported"
msgstr ""
-#: io.c:1257 io.c:1446
+#: io.c:1257 io.c:1438
#, c-format
msgid "file `%s' is a directory"
msgstr ""
@@ -1592,80 +1585,78 @@ msgstr ""
msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
msgstr ""
-#: io.c:1363
+#: io.c:1359
msgid "use `PROCINFO[...]' instead of `/dev/user'"
msgstr ""
-#: io.c:1432
+#: io.c:1424
#, c-format
msgid "could not open `%s', mode `%s'"
msgstr ""
-#: io.c:1544 io.c:1665
+#: io.c:1550 io.c:1602 io.c:1732 io.c:1754
#, c-format
-msgid "close of stdout in child failed (%s)"
+msgid "moving pipe to stdout in child failed (dup: %s)"
msgstr ""
-#: io.c:1547 io.c:1668
+#: io.c:1554 io.c:1607
#, c-format
-msgid "moving pipe to stdout in child failed (dup: %s)"
+msgid "moving pipe to stdin in child failed (dup: %s)"
msgstr ""
-#: io.c:1549
-#, c-format
-msgid "close of stdin in child failed (%s)"
+#: io.c:1571 io.c:1745
+msgid "restoring stdout in parent process failed\n"
msgstr ""
-#: io.c:1552
-#, c-format
-msgid "moving pipe to stdin in child failed (dup: %s)"
+#: io.c:1576
+msgid "restoring stdin in parent process failed\n"
msgstr ""
-#: io.c:1555 io.c:1670 io.c:1678
+#: io.c:1599 io.c:1751
#, c-format
-msgid "close of pipe failed (%s)"
+msgid "close of stdout in child failed (%s)"
msgstr ""
-#: io.c:1584
+#: io.c:1604
#, c-format
-msgid "pipe from `%s': could not set close-on-exec (fcntl: %s)"
+msgid "close of stdin in child failed (%s)"
msgstr ""
-#: io.c:1588
+#: io.c:1610 io.c:1756 io.c:1767
#, c-format
-msgid "pipe to `%s': could not set close-on-exec (fcntl: %s)"
+msgid "close of pipe failed (%s)"
msgstr ""
-#: io.c:1598
+#: io.c:1655
msgid "`|&' not supported"
msgstr ""
-#: io.c:1662
+#: io.c:1722
#, c-format
msgid "cannot open pipe `%s' (%s)"
msgstr ""
-#: io.c:1675
+#: io.c:1763
#, c-format
msgid "cannot create child process for `%s' (fork: %s)"
msgstr ""
-#: io.c:2004
+#: io.c:2104
#, c-format
msgid "data file `%s' is empty"
msgstr ""
-#: io.c:2071
+#: io.c:2175
#, c-format
msgid "internal error: file `%s', line %d\n"
msgstr ""
-#: io.c:2173
+#: io.c:2277
#, c-format
msgid "error reading input file `%s': %s"
msgstr ""
-#: io.c:2392
+#: io.c:2521
msgid "multicharacter value of `RS' is a gawk extension"
msgstr ""
@@ -1690,7 +1681,12 @@ msgstr ""
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: %s"
+msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
msgstr ""
diff --git a/po/he.gmo b/po/he.gmo
index 1905a85d..42c880b6 100644
--- a/po/he.gmo
+++ b/po/he.gmo
Binary files differ
diff --git a/po/he.po b/po/he.po
index 519aadd0..9773f94e 100644
--- a/po/he.po
+++ b/po/he.po
@@ -1,73 +1,73 @@
# Hebrew messages for GNU Awk -*- coding: hebrew-iso-8bit -*-
# Copyright (C) 2001 Free Software Foundation, Inc.
-# Eli Zaretskii <eliz@is.elta.co.il>, 2001.
+# Eli Zaretskii <eliz@is.elta.co.il>, 2001, 2002.
#
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"
+"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 <eliz@gnu.org>\n"
"Language-Team: Hebrew <eliz@gnu.org>\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
+#: 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:302
+#: array.c:304
#, c-format
msgid "reference to uninitialized element `%s[\"%s\"]'"
msgstr "ìçåúî åðéàù `%s[\"%s\"]' èðîìàì äééðô"
-#: array.c:308
+#: array.c:310
#, c-format
msgid "subscript of array `%s' is null string"
msgstr "`%s' êøòî ïééöîë ä÷éø úæåøçîá ùåîéù"
-#: array.c:371 array.c:454
+#: array.c:373 array.c:456
#, c-format
msgid "delete: illegal use of variable `%s' as array"
msgstr "êøòîë `%s' äðúùîá éåâù ùåîéù :delete"
-#: array.c:404
+#: array.c:406
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "`%s' ïééöî ìéëî åðéà `%s' êøòî :delete"
-#: array.c:569
+#: array.c:571
#, c-format
msgid "%s: empty (null)\n"
msgstr "%s: (ñôåàî) ÷éø\n"
-#: array.c:574
+#: array.c:576
#, c-format
msgid "%s: empty (zero)\n"
msgstr "%s: (ä÷éø hash úìáè) ÷éø\n"
-#: array.c:578
+#: array.c:580
#, c-format
msgid "%s: table_size = %d, array_size = %d\n"
-msgstr ""
+msgstr "%s: table_size = %d, array_size = %d\n"
-#: array.c:610
+#: array.c:612
#, c-format
-msgid "%s: is paramater\n"
+msgid "%s: is parameter\n"
msgstr "øèîøô åðéä %s\n"
-#: array.c:615
+#: array.c:617
#, c-format
msgid "%s: array_ref to %s\n"
msgstr "%s: %s-ì (array_ref) äéðôä\n"
-#: array.c:842
+#: array.c:844
msgid "asort: first argument is not an array"
msgstr "êøòî åðéà ïåùàø èðîåâøà :asort"
-#: array.c:851
+#: array.c:853
msgid "asort: second argument is not an array"
msgstr "êøòî åðéà éðù èðîåâøà :asort"
@@ -108,293 +108,296 @@ msgstr "äáéúëì àì ,äàéø÷ì çåúô `%s' õáå÷ :õöåçä ï÷åøì ïúéð àì :fflush"
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "ìéá÷î êéìäú åà çåúô ÷éôà ,çåúô õáå÷ åðéà `%s' :fflush"
-#: builtin.c:222
+#: builtin.c:295
msgid "index: received non-string first argument"
msgstr "úæåøçî åðéà ïåùàø èðîåâøà :index"
-#: builtin.c:224
+#: builtin.c:297
msgid "index: received non-string second argument"
msgstr "úæåøçî åðéà éðù èðîåâøà :index"
-#: builtin.c:287
+#: builtin.c:407
msgid "int: received non-numeric argument"
msgstr "øôñî åðéà èðîåâøà :int"
-#: builtin.c:304
+#: builtin.c:424
msgid "length: received non-string argument"
msgstr "úæåøçî åðéà èðîåâøà :length"
-#: builtin.c:320
+#: builtin.c:440
msgid "log: received non-numeric argument"
msgstr "øôñî åðéà èðîåâøà :log"
-#: builtin.c:323
+#: builtin.c:443
#, c-format
msgid "log: received negative argument %g"
msgstr "%g éìéìù èðîåâøà íò àø÷ð :log"
-#: builtin.c:583
+#: 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:589
+#: builtin.c:709
msgid "arg count with `$' must be > 0"
msgstr "0-î ìåãâ úåéäì áééç `$' ãéì èðîåâøàä äðåî"
-#: builtin.c:591
+#: builtin.c:711
#, c-format
msgid "arg count %d greater than total number of supplied arguments"
msgstr "íéèðîåâøàä ìù ììåëä íøôñîî ìåãâ %d èðîåâøàä äðåî"
-#: builtin.c:593
+#: builtin.c:713
msgid "`$' not permitted after period in format"
msgstr "èîøåôá äãå÷ðä éøçà òéôåäì ìåëé åðéà `$'"
-#: builtin.c:606
+#: builtin.c:726
msgid "no `$' supplied for positional field width or precision"
msgstr "å÷åéã åà äãù áçåø ïééöîá èðîåâøàä äðåî øåáò `$' àöîð àì"
-#: builtin.c:664
+#: builtin.c:784
msgid "`l' is meaningless in awk formats; ignored"
msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `l'"
-#: builtin.c:668
+#: builtin.c:788
msgid "`l' is not permitted in POSIX awk formats"
msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `l'"
-#: builtin.c:679
+#: builtin.c:799
msgid "`L' is meaningless in awk formats; ignored"
msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `L'"
-#: builtin.c:683
+#: builtin.c:803
msgid "`L' is not permitted in POSIX awk formats"
msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `L'"
-#: builtin.c:694
+#: builtin.c:814
msgid "`h' is meaningless in awk formats; ignored"
msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `h'"
-#: builtin.c:698
+#: builtin.c:818
msgid "`h' is not permitted in POSIX awk formats"
msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `h'"
-#: builtin.c:947
+#: builtin.c:1067
msgid "not enough arguments to satisfy format string"
msgstr "èîøåôä øåáò íéèðîåâøà ÷éôñî ïéà"
-#: builtin.c:949
+#: builtin.c:1069
msgid "^ ran out for this one"
msgstr "^ íéèðîåâøàä éì åøîâð ïàë"
-#: builtin.c:954
+#: builtin.c:1074
msgid "[s]printf: format specifier does not have control letter"
msgstr "äøîää úø÷á úåà ìéëî åðéà èîøåôä :[s]printf"
-#: builtin.c:957
+#: builtin.c:1077
msgid "too many arguments supplied for format string"
msgstr "èîøåôä øåáò íéèðîåâøà éãî øúåé"
-#: builtin.c:1000 builtin.c:1003
+#: builtin.c:1120 builtin.c:1123
msgid "printf: no arguments"
msgstr "èðîåâøà óà ïéà :printf"
-#: builtin.c:1036
+#: builtin.c:1156
msgid "sqrt: received non-numeric argument"
msgstr "øôñî åðéà èðîåâøà :sqrt"
-#: builtin.c:1040
+#: builtin.c:1160
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "%g éìéìù èðîåâøà íò àø÷ð :sqrt"
-#: builtin.c:1062
+#: builtin.c:1182
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "1-á óìçåä ,éåâù åðéä %g äìçúä ïééöî :substr"
-#: builtin.c:1067
+#: builtin.c:1187
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "õöå÷é ,íìù øôñî åðéàù, %g äìçúä ïééöî ìù åëøò :substr"
-#: builtin.c:1081
+#: builtin.c:1201
#, c-format
msgid "substr: length %g is <= 0"
msgstr "0-î ìåãâ øôñî åððéà %g êøåà :substr"
-#: builtin.c:1087
+#: builtin.c:1207
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "õöå÷é ,íìù øôñî åðéàù ,%g êøåà :substr"
-#: builtin.c:1094
+#: builtin.c:1214
msgid "substr: source string is zero length"
msgstr "ñôà êøåàá äðéä øå÷îä úæåøçî :substr"
-#: builtin.c:1101
+#: 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:1107
+#: builtin.c:1227
#, 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"
+#: builtin.c:1263
+msgid "strftime: received non-string first argument"
msgstr "úæåøçî åðéà ïåùàø èðîåâøà :strftime"
-#: builtin.c:1149
+#: builtin.c:1269
msgid "strftime: received empty format string"
msgstr "ä÷éø èîøåô úæåøçî :strftime"
-#: builtin.c:1158
-msgid "strftime: recieved non-numeric second argument"
+#: builtin.c:1278
+msgid "strftime: received non-numeric second argument"
msgstr "øôñî åðéà éðù èðîåâøà :strftime"
-#: builtin.c:1221
+#: builtin.c:1341
msgid "mktime: received non-string argument"
msgstr "úæåøçî åðéà èðîåâøà :mktime"
-#: builtin.c:1266
-msgid "system: recieved non-string argument"
+#: builtin.c:1386
+msgid "system: received non-string argument"
msgstr "úæåøçî åðéà èðîåâøà :system"
-#: builtin.c:1386
-msgid "tolower: recieved non-string argument"
+#: builtin.c:1512
+msgid "tolower: received non-string argument"
msgstr "úæåøçî åðéà èðîåâøà :tolower"
-#: builtin.c:1407
-msgid "toupper: recieved non-string argument"
+#: builtin.c:1561
+msgid "toupper: received non-string argument"
msgstr "úæåøçî åðéà èðîåâøà :toupper"
-#: builtin.c:1430
+#: builtin.c:1606
msgid "atan2: received non-numeric first argument"
msgstr "øôñî åðéà ïåùàø èðîåâøà :atan2"
-#: builtin.c:1432
+#: builtin.c:1608
msgid "atan2: received non-numeric second argument"
msgstr "øôñî åðéà éðù èðîåâøà :atan2"
-#: builtin.c:1451
+#: builtin.c:1627
msgid "sin: received non-numeric argument"
msgstr "øôñî åðéà èðîåâøà :sin"
-#: builtin.c:1467
+#: builtin.c:1643
msgid "cos: received non-numeric argument"
msgstr "øôñî åðéà èðîåâøà :cos"
-#: builtin.c:1511
+#: builtin.c:1687
msgid "srand: received non-numeric argument"
msgstr "øôñî åðéà èðîåâøà :srand"
-#: builtin.c:1545
+#: builtin.c:1721
msgid "match: third argument is not an array"
msgstr "êøòî åðéà éùéìù èðîåâøà :match"
-#: builtin.c:1942
+#: builtin.c:2157
msgid "gensub: 3rd argument of 0 treated as 1"
msgstr "1-á óìçåä 0 åëøòù éùéìù èðîåâøà :gensub"
-#: builtin.c:2053 builtin.c:2055
+#: builtin.c:2268 builtin.c:2270
msgid "lshift: received non-numeric first argument"
msgstr "øôñî åðéà ïåùàø èðîåâøà :lshift"
-#: builtin.c:2057
+#: builtin.c:2272
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :lshift(%lf, %lf)"
-#: builtin.c:2059
+#: builtin.c:2274
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "åööå÷é íéøåáù íéëøò :lshift(%lf, %lf)"
-#: builtin.c:2061
+#: builtin.c:2276
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr "úåéåôö-éúìá úåàöåú áéðé éãî ìåãâ äææä øåòéù :lshift(%lf, %lf)"
-#: builtin.c:2090 builtin.c:2092
+#: builtin.c:2305 builtin.c:2307
msgid "rshift: received non-numeric first argument"
msgstr "øôñî åðéà ïåùàø èðîåâøà :rshift"
-#: builtin.c:2094
+#: builtin.c:2309
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :rshift(%lf, %lf)"
-#: builtin.c:2096
+#: builtin.c:2311
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "åööå÷é íéøåáù íéëøò :rshift(%lf, %lf)"
-#: builtin.c:2098
+#: builtin.c:2313
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr "úåéåôö-éúìá úåàöåú áéðé éãî ìåãâ äææä øåòéù :rshift(%lf, %lf)"
-#: builtin.c:2127 builtin.c:2129
+#: builtin.c:2342 builtin.c:2344
msgid "and: received non-numeric first argument"
msgstr "øôñî åðéà ïåùàø èðîåâøà :and"
-#: builtin.c:2131
+#: builtin.c:2346
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :and(%lf, %lf)"
-#: builtin.c:2133
+#: builtin.c:2348
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "åööå÷é íéøåáù íéëøò :and(%lf, %lf)"
-#: builtin.c:2162 builtin.c:2164
+#: builtin.c:2377 builtin.c:2379
msgid "or: received non-numeric first argument"
msgstr "øôñî åðéà ïåùàø èðîåâøà :or"
-#: builtin.c:2166
+#: builtin.c:2381
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :or(%lf, %lf)"
-#: builtin.c:2168
+#: builtin.c:2383
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "åööå÷é íéøåáù íéëøò :or(%lf, %lf)"
-#: builtin.c:2197 builtin.c:2199
+#: builtin.c:2412 builtin.c:2414
msgid "xor: received non-numeric first argument"
msgstr "øôñî åðéà ïåùàø èðîåâøà :xor"
-#: builtin.c:2201
+#: builtin.c:2416
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :xor(%lf, %lf)"
-#: builtin.c:2203
+#: builtin.c:2418
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "åööå÷é íéøåáù íéëøò :xor(%lf, %lf)"
-#: builtin.c:2231
+#: builtin.c:2446
msgid "compl: received non-numeric argument"
msgstr "øôñî åðéà èðîåâøà :compl"
-#: builtin.c:2233
+#: builtin.c:2448
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "úåéåôö-éúìá úåàöåú áéðé éìéìù êøò :compl(%lf)"
-#: builtin.c:2235
+#: builtin.c:2450
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "õöå÷é øåáù êøò :compl(%lf)"
-#. not there
-#: builtin.c:2429
+#: builtin.c:2621
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "äðé÷ú íå÷éî úééøåâè÷ åðéà `%s' :dcgettext"
@@ -419,244 +422,255 @@ msgstr "úëîúð äðéà åæ äìåòô"
# The way the leading "%s:" is translated is a terrible kludge,
# but what can I do? FIXME.
-#: getopt.c:688
+#: getopt.c:692 getopt.c:704
#, c-format
msgid "%s: option `%s' is ambiguous\n"
msgstr "%s úéðëú øåáò éòîùî-ãç åðéà `%s' ïééôàî\n"
-#: getopt.c:713
+#: getopt.c:737 getopt.c:741
#, c-format
msgid "%s: option `--%s' doesn't allow an argument\n"
msgstr "%s úéðëú øåáò èðîåâøà ìá÷î åðéà `--%s' ïééôàî\n"
-#: getopt.c:718
+#: 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:736 getopt.c:909
+#: 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"
-#. --option
-#: getopt.c:765
+#: getopt.c:842 getopt.c:845
#, c-format
msgid "%s: unrecognized option `--%s'\n"
msgstr "%s úéðëú øåáò `--%s' ääåæî-éúìá ïééôàî\n"
-#. +option or -option
-#: getopt.c:769
+#: 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...
-#. 1003.2 specifies the format of this message.
-#: getopt.c:795
+#: getopt.c:903 getopt.c:906
#, c-format
msgid "%s: illegal option -- %c\n"
msgstr "%s: é÷åç-éúìá ïééôàî -- %c\n"
-#: getopt.c:798
+#: getopt.c:912 getopt.c:915
#, 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
+#: 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:875
+#: getopt.c:1025 getopt.c:1036
#, c-format
msgid "%s: option `-W %s' is ambiguous\n"
msgstr "%s úéðëú øåáò éòîùî-ãç åðéà `-W %s' ïééôàî\n"
-#: getopt.c:893
+#: 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:292
+#: main.c:307
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "gawk øåáò éèðååìø åðéà `-m[fr]' ïééôàî"
-#: main.c:294
+#: main.c:309
msgid "-m option usage: `-m[fr] nnn'"
msgstr "`-m[fr] nnn' :-m ïééôàîá ùåîéù ïôåà"
-#. gawk specific options - now in getopt_long
-#: main.c:311
+#: main.c:326
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "çðæåä ,%s úéðëú øåáò øëåî åðéà `-W %s' ïééôàî\n"
-#: main.c:342
+#: main.c:357
msgid "empty argument to `--source' ignored"
msgstr "çðæåä `--source'-ì ÷éø èðîåâøà"
-#: main.c:414
+#: main.c:429
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr "`--posix' ìéòôî :øãâåî `POSIXLY_CORRECT' äáéáñ äðúùî"
-#. both on command line
-#: main.c:419
+#: main.c:434
msgid "`--posix' overrides `--traditional'"
msgstr "`--traditional' ìò øáåâ `--posix'"
-#: main.c:430
+#: main.c:445
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr "`--non-decimal-data' ìò øáåâ `--posix'/`--traditional'"
-#: main.c:434
+#: main.c:449
#, c-format
-msgid "runing %s setuid root may be a security problem"
+msgid "running %s setuid root may be a security problem"
msgstr "òãéî úçèáàá òåâôì äìåìò setuid root-ë %s úöøä"
-#: main.c:463
+#: main.c:478
#, c-format
msgid "can't set mode on stdin (%s)"
msgstr "stdin úìåòô ïôåà úòéá÷á (%s) äì÷ú"
-#: main.c:466
+#: main.c:481
#, c-format
msgid "can't set mode on stdout (%s)"
msgstr "stdout úìåòô ïôåà úòéá÷á (%s) äì÷ú"
-#: main.c:468
+#: main.c:483
#, c-format
msgid "can't set mode on stderr (%s)"
msgstr "stderr úìåòô ïôåà úòéá÷á (%s) äì÷ú"
-#: main.c:497
+#: main.c:512
msgid "no program text at all!"
msgstr "!ììë àöîðá äéä àì úéðëú ìù èñ÷è"
-#. Not factoring out common stuff makes it easier to translate.
-#: main.c:541
+#: 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:543
+#: main.c:558
#, 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
+#: main.c:563
msgid "POSIX options:\t\tGNU long options:\n"
msgstr ":POSIX éðééôàî\t\t:íéëåøà GNU éðééôàî\n"
-#: main.c:549
+#: main.c:564
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f úéðëú-õáå÷\t\t--file=úéðëú-õáå÷\n"
-#: main.c:550
+#: main.c:565
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F úåãù-ãéøôî\t\t--field-separator=úåãù-ãéøôî\n"
-#: main.c:551
+#: main.c:566
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "\t-v äðúùî=êøò\t\t--assign=äðúùî=êøò\n"
-#: main.c:552
+#: main.c:567
msgid "\t-m[fr] val\n"
msgstr "\t-m[fr] êøò\n"
-#: main.c:553
+#: main.c:568
msgid "\t-W compat\t\t--compat\n"
-msgstr ""
+msgstr "\t-W compat\t\t--compat\n"
-#: main.c:554
+#: main.c:569
msgid "\t-W copyleft\t\t--copyleft\n"
-msgstr ""
+msgstr "\t-W copyleft\t\t--copyleft\n"
-#: main.c:555
+#: main.c:570
msgid "\t-W copyright\t\t--copyright\n"
-msgstr ""
+msgstr "\t-W copyright\t\t--copyright\n"
-#: main.c:556
+#: 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:557
+#: main.c:572
msgid "\t-W gen-po\t\t--gen-po\n"
-msgstr ""
+msgstr "\t-W gen-po\t\t--gen-po\n"
-#: main.c:558
+#: main.c:573
msgid "\t-W help\t\t\t--help\n"
-msgstr ""
+msgstr "\t-W help\t\t\t--help\n"
-#: main.c:559
+#: main.c:574
msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
-msgstr ""
+msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
-#: main.c:560
+#: main.c:575
msgid "\t-W lint-old\t\t--lint-old\n"
-msgstr ""
+msgstr "\t-W lint-old\t\t--lint-old\n"
-#: main.c:561
+#: main.c:576
msgid "\t-W non-decimal-data\t--non-decimal-data\n"
-msgstr ""
+msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
-#: main.c:563
+#: main.c:578
msgid "\t-W nostalgia\t\t--nostalgia\n"
-msgstr ""
+msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:566
+#: main.c:581
msgid "\t-W parsedebug\t\t--parsedebug\n"
-msgstr ""
+msgstr "\t-W parsedebug\t\t--parsedebug\n"
-#: main.c:568
+#: main.c:583
msgid "\t-W profile[=file]\t--profile[=file]\n"
msgstr "\t-W profile[=õáå÷-íù]\t--profile[=õáå÷-íù]\n"
-#: main.c:569
+#: main.c:584
msgid "\t-W posix\t\t--posix\n"
-msgstr ""
+msgstr "\t-W posix\t\t--posix\n"
-#: main.c:570
+#: main.c:585
msgid "\t-W re-interval\t\t--re-interval\n"
-msgstr ""
+msgstr "\t-W re-interval\t\t--re-interval\n"
-#: main.c:571
+#: main.c:586
msgid "\t-W source=program-text\t--source=program-text\n"
msgstr "\t-W source=úéðëú-èñ÷è\t--source=úéðëú-èñ÷è\n"
-#: main.c:572
+#: main.c:587
msgid "\t-W traditional\t\t--traditional\n"
-msgstr ""
+msgstr "\t-W traditional\t\t--traditional\n"
-#: main.c:573
+#: main.c:588
msgid "\t-W usage\t\t--usage\n"
-msgstr ""
+msgstr "\t-W usage\t\t--usage\n"
-#: main.c:574
+#: main.c:589
msgid "\t-W version\t\t--version\n"
-msgstr ""
+msgstr "\t-W version\t\t--version\n"
-#: main.c:575
+#: 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:576
-msgid "section `Reporting Problems and Bugs' in the printed version.\n"
-msgstr ".ñôãåîä êéøãîá `Reporting Problems and Bugs' ä÷ñô\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:586
-#, fuzzy
+#: main.c:601
msgid ""
-"Copyright (C) 1989, 1991-2001 Free Software Foundation.\n"
+"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,14 +678,14 @@ msgid ""
"(at your option) any later version.\n"
"\n"
msgstr ""
-"Free Software Foundation-ì úåøåîù úåéåëæä ìë (C) 1989, 1991-2000\n"
+"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
"\n"
"óåôëá äúåðùì åà/å äöéôäì íëúåëæ ;úéùôç äðëú äðéä åæ úéðëú\n"
-"é\"ò øåàì àöåéä ,GNU General Public License ïåéùøä éàðúì\n"
-"íàå ,ïåéùøä ìù 2 àñøâá íà ;Free Software Foundation\n"
-" .øúåé úøçåàî àñøâ ìëá (íëì äøåîùä äéöôåàë)\n"
+" é\"ò øåàì àöåéä ,GNU General Public License ïåéùøä éàðúì\n"
+" íàå ,ïåéùøä ìù 2 àñøâá íà ;Free Software Foundation\n"
+" .øúåé úøçåàî àñøâ ìëá (íëì äøåîùä äéöôåàë)\n"
-#: main.c:594
+#: 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,7 +698,7 @@ msgstr ""
",íéèøôì .úîéåñî úéìëú åæéàì äîàúä åà úåøéçñ ìù\n"
" .GNU General Public License-á åðééò àðà\n"
-#: main.c:600
+#: 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,58 +708,58 @@ msgstr ""
"Free Software Foundation, Inc.-ì åáúë àðà ,åúåà íúìáé÷ àì íà\n"
".59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\n"
-#: main.c:630
+#: main.c:657
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
+#: main.c:888
#, c-format
msgid "invalid syntax in name `%s' for variable assignment"
msgstr "êøò úîùäá `%s' äðúùî íù ìù éåâù øéáçú"
-#: main.c:938
+#: main.c:957
msgid "floating point exception"
msgstr "äôö äãå÷ð éáåùéçá äâéøç"
-#: main.c:945
+#: main.c:964
msgid "fatal error: internal error"
msgstr "úéîéðô äðëú úàéâù :äøåîç äì÷ú"
# FIXME: I wonder how many people will understand what "fd 2" means.
-#: main.c:995
+#: main.c:1014
#, c-format
msgid "no pre-opened fd %d"
msgstr "ùàøî çåúô åðéà %d èìô/èì÷ õåøò"
# FIXME: /dev/null might not be known to all.
-#: main.c:1000
+#: 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) äì÷ú"
-#: awkgram.y:2281 profile.c:96
+#: profile.c:96 awkgram.y:2465
msgid "sending profile to standard error"
msgstr "éð÷ú úåàéâù õåøòì çìùð òåöéá ìéôåøô"
-#: profile.c:402
+#: profile.c:409
msgid "internal error: Node_var with null vname"
msgstr "ñôåàî åìù vname-äù Node_var :úéîéðô äðëú úàéâù"
-#: profile.c:508
+#: profile.c:524
msgid "internal error: Node_var_array with null vname"
msgstr "ñôåàî åìù vname-äù Node_var_array :úéîéðô äðëú úàéâù"
-#: eval.c:816 profile.c:531
+#: profile.c:554 eval.c:813
#, c-format
msgid ""
"function `%s' called with space between name and `(',\n"
@@ -754,42 +768,40 @@ msgstr ""
",`(' ïéáì äîù ïéá íéçååø íò `%s' äéö÷ðåôì äàéø÷\n"
"%s"
-#: eval.c:818 profile.c:533
+#: profile.c:556 eval.c:815
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
+#: 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' êøòîá ùåîéù ïåéñð"
-#: eval.c:1046 profile.c:614
+#: profile.c:637 eval.c:1047
#, c-format
msgid "illegal type (%s) in tree_eval"
msgstr "tree_eval-á (%s) éåâù âåñ"
-#: eval.c:1785 profile.c:815
+#: profile.c:842 eval.c:1790
#, c-format
msgid "attempt to use function `%s' as array"
msgstr "êøòîë `%s' äéö÷ðåôá ùåîéù ïåéñð"
-#: eval.c:1792 profile.c:829
+#: profile.c:856 eval.c:1797
#, 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
+#: profile.c:860 eval.c:1803 eval.c:1810
msgid "assignment is not allowed to result of builtin function"
msgstr "úéðáåî äéö÷ðåô ìù äàöåúá êøò áéöäì ïéà"
-#. \n on purpose, with \n in ctime() output
-#: profile.c:1083
+#: profile.c:1108
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# %s êéøàúî gawk ìù ìéôåøô\n"
-#: profile.c:1086
+#: profile.c:1111
msgid ""
"\t# BEGIN block(s)\n"
"\n"
@@ -797,7 +809,7 @@ msgstr ""
"\t# BEGIN ÷åìá\n"
"\n"
-#: profile.c:1096
+#: profile.c:1121
msgid ""
"\t# Rule(s)\n"
"\n"
@@ -805,7 +817,7 @@ msgstr ""
"\t# (íé)ììë\n"
"\n"
-#: profile.c:1102
+#: profile.c:1127
msgid ""
"\t# END block(s)\n"
"\n"
@@ -813,7 +825,7 @@ msgstr ""
"\t# END ÷åìá\n"
"\n"
-#: profile.c:1122
+#: profile.c:1147
msgid ""
"\n"
"\t# Functions, listed alphabetically\n"
@@ -821,424 +833,409 @@ msgstr ""
"\n"
"\t# úéá-óìà øãñá ,úåéö÷ðåô\n"
-#: profile.c:1325
+#: profile.c:1357
#, c-format
msgid "unexpected type %s in prec_level"
msgstr "prec_level-á %s éåâù âåñ"
-#: regex.c:1017
+#: regex.c:1322
msgid "Success"
msgstr "äçìöä"
-#. REG_NOERROR
-#: regex.c:1018
+#: regex.c:1323
msgid "No match"
msgstr "äîéàúî úæåøçî äàöîð àì"
-#. REG_NOMATCH
-#: regex.c:1019
+#: regex.c:1324
msgid "Invalid regular expression"
msgstr "éåâù éøìåâø éåèéá"
-#. REG_BADPAT
-#: regex.c:1020
+#: regex.c:1325
msgid "Invalid collation character"
msgstr "øãâåî-éúìá øåãéñ åú"
-#. REG_ECOLLATE
-#: regex.c:1021
+#: regex.c:1326
msgid "Invalid character class name"
msgstr "íéåú úöåá÷ ìù øãâåî-éúìá íù"
-#. REG_ECTYPE
-#: regex.c:1022
+#: regex.c:1327
msgid "Trailing backslash"
msgstr "`\\' éøåçà ïñëåìá íééúñî éøìåâø éåèéá"
-#. REG_EESCAPE
-#: regex.c:1023
+#: regex.c:1328
msgid "Invalid back reference"
msgstr "íãå÷ éåèéá-úúì äéåâù äééðôä"
-#. REG_ESUBREG
-#: regex.c:1024
+#: regex.c:1329
msgid "Unmatched [ or [^"
msgstr "âåæ-ïá åì ïéàù [^ åà ["
-#. REG_EBRACK
-#: regex.c:1025
+#: regex.c:1330
msgid "Unmatched ( or \\("
msgstr "âåæ-ïá åì ïéàù \\( åà ("
-#. REG_EPAREN
-#: regex.c:1026
+#: regex.c:1331
msgid "Unmatched \\{"
msgstr "âåæ-ïá åì ïéàù \\{"
-#. REG_EBRACE
-#: regex.c:1027
+#: regex.c:1332
msgid "Invalid content of \\{\\}"
msgstr "\\{\\} êåúá éåâù äðáî"
-#. REG_BADBR
-#: regex.c:1028
+#: regex.c:1333
msgid "Invalid range end"
msgstr "íéåú íåçú ìù äéåâù äøãâä"
-#. REG_ERANGE
-#: dfa.c:167 dfa.c:178 dfa.c:189 regex.c:1029
+#: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204
msgid "Memory exhausted"
msgstr "ïåøëæä øîâð"
-#. REG_ESPACE
-#: regex.c:1030
+#: regex.c:1335
msgid "Invalid preceding regular expression"
msgstr "íéé÷ åðéà åà éåâù íãå÷ éøìåâø éåèéá"
-#. REG_BADRPT
-#: regex.c:1031
+#: regex.c:1336
msgid "Premature end of regular expression"
msgstr "éãî íã÷åî íééúñî éøìåâø éåèéá"
-#. REG_EEND
-#: regex.c:1032
+#: regex.c:1337
msgid "Regular expression too big"
msgstr "éãî áëøåî åà ìåãâ éøìåâø éåèéá"
-#. REG_ESIZE
-#: regex.c:1033
+#: regex.c:1338
msgid "Unmatched ) or \\)"
msgstr "âåæ-ïá åì ïéàù \\) åà )"
-#: regex.c:5531
+#: regex.c:7365
msgid "No previous regular expression"
msgstr "íãå÷ éøìåâø éåèéá ïéà"
-#: awkgram.y:230
+#: awkgram.y:232
msgid "BEGIN blocks must have an action part"
msgstr "äìåòô úøãâä ìåìëì áééç BEGIN ÷åìá"
-#: awkgram.y:236
+#: awkgram.y:238
msgid "END blocks must have an action part"
msgstr "äìåòô úøãâä ìåìëì áééç END ÷åìá"
-#: awkgram.y:272
+#: awkgram.y:274
#, c-format
msgid "`%s' is a built-in function, it cannot be redefined"
msgstr "äúøãâä úà úåðùì ïéà ,úéðáåî äéö÷ðåô äðéä `%s'"
-#: awkgram.y:360
+#: awkgram.y:362
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
+#: awkgram.y:455
msgid "`next' used in BEGIN or END action"
msgstr "END åà BEGIN ìù äìåòô úøãâäá `next'-á ùåîéù"
-#: awkgram.y:476 awkgram.y:483
+#: awkgram.y:462 awkgram.y:469
msgid "`nextfile' is a gawk extension"
msgstr "gawk-ì úéôéöôñ äáçøä åðéä `nextfile'"
-#: awkgram.y:488
+#: awkgram.y:474
msgid "`nextfile' used in BEGIN or END action"
msgstr "END åà BEGIN ìù äìåòô úøãâäá `nextfile'-á ùåîéù"
-#: awkgram.y:497
+#: awkgram.y:483
msgid "`return' used outside function context"
msgstr "äéö÷ðåô ìù èñ÷èðå÷á àìù `return'-á ùåîéù"
-#: awkgram.y:506 awkgram.y:513
+#: 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:571
+#: awkgram.y:604
msgid "multistage two-way pipelines don't work"
msgstr "íéãáåò íðéà íéáìù éáåøî íééðååéë-åã íé÷éôà"
-#: awkgram.y:662
+#: awkgram.y:695
msgid "regular expression on right of assignment"
msgstr "êøò úîùä úàøåä ìù ïéîé ãöá éøìåâø éåèéá"
-#: awkgram.y:680
+#: awkgram.y:713
msgid "non-redirected `getline' undefined inside END action"
msgstr "END úìåòô êåúá øãâåî åðéà äééðôä àìì `getline'"
-#: awkgram.y:690
+#: awkgram.y:723
msgid "regular expression on left of `~' or `!~' operator"
msgstr "`!~' åà `~' øåèøôåàì ìàîùî éøìåâø éåèéá"
-#: awkgram.y:700
+#: awkgram.y:733
#, c-format
msgid "regexp constant `/%s/' looks like a C comment, but is not"
msgstr "äøòä åðéà êà ,C úôùá äøòä åîë äàøð `/%s/' éøìåâø éåèéá"
-#: awkgram.y:716
+#: awkgram.y:749
msgid "regular expression on right of comparison"
msgstr "äàååùä ìù ïéîé ãöá éøìåâø éåèéá"
-#: awkgram.y:743
+#: awkgram.y:776
msgid "non-redirected `getline' undefined inside BEGIN or END action"
msgstr "END åà BEGIN úìåòô êåúá øãâåî åðéà äééðôä àìì `getline'"
-#: awkgram.y:798
+#: awkgram.y:831
msgid "call of `length' without parentheses is not portable"
msgstr "úéìéáèøåô äðéà íééøâåñ àìì `length'-ì äàéø÷"
-#: awkgram.y:801
+#: awkgram.y:834
msgid "call of `length' without parentheses is deprecated by POSIX"
msgstr "POSIX ï÷úì ãåâéðá äðéä íééøâåñ àìì `length'-ì äàéø÷"
-#: awkgram.y:851
+#: awkgram.y:884
msgid "invalid subscript expression"
msgstr "êøòî ïééöîá éåâù øéáçú ìòá éåèéá"
-#: awkgram.y:985
+#: awkgram.y:1033
#, c-format
msgid "fptr %x not in tokentab\n"
msgstr "tokentab-á àöîð àì fptr %x\n"
-#: awkgram.y:1019
+#: awkgram.y:1068
msgid "unexpected newline"
msgstr "éåôö-éúìá íå÷îá äøåù óåñ"
-#: awkgram.y:1098
+#: awkgram.y:1152
msgid "empty program text on command line"
msgstr "äãå÷ôä úøåùî äìá÷úä ä÷éø úéðëú"
-#: awkgram.y:1155
+#: awkgram.y:1209
#, c-format
msgid "can't open source file `%s' for reading (%s)"
msgstr "åúàéø÷ íùì `%s' øå÷î õáå÷ úçéúôá (%s) äì÷ú"
-#: awkgram.y:1190
+#: awkgram.y:1244
#, c-format
msgid "can't read sourcefile `%s' (%s)"
msgstr "`%s' øå÷î õáå÷î äàéø÷á (%s) äì÷ú"
-#: awkgram.y:1198
+#: awkgram.y:1252
#, 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
+#: 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:1373
+#: awkgram.y:1518
msgid "unterminated regexp ends with `\\' at end of file"
msgstr "õáå÷ä óñá `\\'-á íééúñî øåîâ-éúìá éøìåâø éåèéá"
-#: awkgram.y:1394
+#: awkgram.y:1539
msgid "unterminated regexp"
msgstr "øåîâ-éúìá éøìåâø éåèéá"
-#: awkgram.y:1397
+#: awkgram.y:1542
msgid "unterminated regexp at end of file"
msgstr "õáå÷ä óåñá øåîâ-éúìá éøìåâø éåèéá"
-#: awkgram.y:1461
+#: awkgram.y:1609
msgid "use of `\\ #...' line continuation is not portable"
msgstr "éìéáèøåô åðéà äøåù êùîäì ïîéñë `\\ #...'-á ùåîéù"
-#: awkgram.y:1473
+#: awkgram.y:1621
msgid "backslash not last character on line"
msgstr "äøåùá ïåøçà åú åðéàù êåôä ïñëåì"
-#: awkgram.y:1514
+#: awkgram.y:1662
msgid "POSIX does not allow operator `**='"
msgstr "`**=' øåèøôåà äùøî åðéà POSIX"
-#: awkgram.y:1516
+#: awkgram.y:1664
msgid "old awk does not support operator `**='"
msgstr "`**=' øåèøôåàá êîåú åðéà ïùé awk"
-#: awkgram.y:1525
+#: awkgram.y:1673
msgid "POSIX does not allow operator `**'"
msgstr "`**' øåèøôåà äùøî åðéà POSIX"
-#: awkgram.y:1527
+#: awkgram.y:1675
msgid "old awk does not support operator `**'"
msgstr "`**' øåèøôåàá êîåú åðéà ïùé awk"
-#: awkgram.y:1560
+#: awkgram.y:1708
msgid "operator `^=' is not supported in old awk"
msgstr "ïùé awk-á êîúð åðéà `^=' øåèøôåà"
-#: awkgram.y:1568
+#: awkgram.y:1716
msgid "operator `^' is not supported in old awk"
msgstr "ïùé awk-á êîúð åðéà `^' øåèøôåà"
-#: awkgram.y:1650 awkgram.y:1664
+#: awkgram.y:1798 awkgram.y:1815
msgid "unterminated string"
msgstr "äøåîâ-éúìá úæåøçî"
-#: awkgram.y:1815
+#: awkgram.y:1972
#, c-format
msgid "invalid char '%c' in expression"
msgstr "éåèéáá '%c' éåâù åú"
-#: awkgram.y:1861
+#: awkgram.y:2032
#, c-format
msgid "`%s' is a gawk extension"
msgstr "gawk-ì úéôéöôñ äáçøä äðéä `%s'"
-#: awkgram.y:1864
+#: awkgram.y:2035
#, c-format
msgid "`%s' is a Bell Labs extension"
msgstr "Bell úåãáòî úñøâá awk-ì úéôéöôñ äáçøä åðéä `%s'"
-#: awkgram.y:1867
+#: awkgram.y:2038
#, c-format
msgid "POSIX does not allow `%s'"
msgstr "`%s' äùøî åðéà POSIX"
-#: awkgram.y:1871
+#: awkgram.y:2042
#, c-format
msgid "`%s' is not supported in old awk"
msgstr "ïùé awk-á êîúð åðéà `%s'"
-#: awkgram.y:1899
+#: awkgram.y:2070
msgid "`goto' considered harmful!\n"
msgstr "!òø-òâô áùçð `goto'\n"
-#: awkgram.y:1963
+#: awkgram.y:2134
#, c-format
msgid "%d is invalid as number of arguments for %s"
msgstr "íéèðîåâøà øôñîë %d ìá÷ì ìåëé åðéà %s"
-#: awkgram.y:1982 awkgram.y:1985
+#: awkgram.y:2153 awkgram.y:2156
msgid "match: third argument is a gawk extension"
msgstr "gawk-ì úéôéöôñ äáçøä åðéä `match' ìù éùéìù èðîåâøà"
-#: awkgram.y:2001
+#: awkgram.y:2172
#, c-format
msgid "%s: string literal as last arg of substitute has no effect"
msgstr "úéìëú íåù äì ïéà `%s' ìù ïåøçà èðîåâøàë äòåá÷ úæåøçî"
-#: awkgram.y:2005
+#: awkgram.y:2176
msgid "sub third parameter is not a changeable object"
msgstr "éåðéù-øá è÷ééáåà åðéà `sub' ìù éùéìù èðîåâøà"
-#: awkgram.y:2007
+#: awkgram.y:2178
msgid "gsub third parameter is not a changeable object"
msgstr "éåðéù-øá è÷ééáåà åðéà `gsub' ìù éùéìù èðîåâøà"
-#: awkgram.y:2033 awkgram.y:2036
+#: awkgram.y:2204 awkgram.y:2207
msgid "close: second argument is a gawk extension"
msgstr "gawk-ì úéôéöôñ äáçøä åðéä `close' ìù éðù èðîåâøà"
-#: awkgram.y:2046
+#: awkgram.y:2217
msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
msgstr "èðîåâøà úîã÷áù ïåúçú-ó÷î ÷ìñì ùé :dcgettext(_\"...\")-á éåâù ùåîéù"
-#: awkgram.y:2139
+#: 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:2171
+#: awkgram.y:2355
#, c-format
msgid "function `%s': parameter `%s' shadows global variable"
msgstr "éìáåìâ äðúùî ìò ìéôàî `%s' äéö÷ðåôá `%s' øèîøô"
-#: awkgram.y:2280
+#: awkgram.y:2464
#, c-format
msgid "could not open `%s' for writing (%s)"
msgstr "äáéúë íùì `%s' úçéúôá (%s) äì÷ú"
-#: awkgram.y:2311
+#: awkgram.y:2495
#, c-format
msgid "%s: close failed (%s)"
msgstr "`%s' úøéâñ úòá (%s) äì÷ú"
-#: awkgram.y:2421
+#: awkgram.y:2605
msgid "shadow_funcs() called twice!"
msgstr "!íééîòô äàø÷ð shadow_funcs()"
-#: awkgram.y:2496
+#: awkgram.y:2680
#, c-format
msgid "function `%s': can't use function name as parameter name"
msgstr "øèîøô íùë ùîùì ìåëé åðéà äéö÷ðåô íù :`%s' äéö÷ðåôá"
-#: awkgram.y:2506
+#: awkgram.y:2690
#, c-format
msgid "function name `%s' previously defined"
msgstr "úøãâåî øáë `%s' íùá äéö÷ðåô"
-#: awkgram.y:2654 awkgram.y:2660
+#: awkgram.y:2838 awkgram.y:2844
#, c-format
msgid "function `%s' called but never defined"
msgstr "úøãâåî äðéàù `%s' äéö÷ðåôì äàéø÷"
-#: awkgram.y:2663
+#: awkgram.y:2847
#, c-format
msgid "function `%s' defined but never called"
msgstr "úàø÷ð àì êà ,äøãâåä `%s' äéö÷ðåô"
-#: awkgram.y:2690
+#: awkgram.y:2874
#, c-format
msgid "regexp constant for parameter #%d yields boolean value"
msgstr "éðàéìåá êøò áéðî %d 'ñî øèîøôë òåá÷ éøìåâø éåèéá"
-#: dfa.c:451
+#: 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 "äøåîâ-éúìá \\ äø÷á úøãñ"
-#. 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
+#: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955
msgid "unfinished repeat count"
msgstr "äøåîâ-éúìá úåðùéä äðåî úøãâä"
-#: dfa.c:597 dfa.c:614 dfa.c:622 dfa.c:626
+#: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958
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
+#: dfa.c:1285
msgid "Unbalanced ("
msgstr "âåæ-ïá åì ïéàù ("
-#: dfa.c:1003
+#: dfa.c:1407
msgid "No regexp syntax bits specified"
msgstr "íééøìåâø íééåèéá ìù øéáçú úøãâä ïéà"
-#: dfa.c:1011
+#: dfa.c:1415
msgid "Unbalanced )"
msgstr "âåæ-ïá åì ïéàù )"
-#: dfa.c:2002
+#: dfa.c:3014
msgid "out of memory"
msgstr "ïåøëæä øîâð"
-#: field.c:787
+#: field.c:849
msgid "split: second argument is not an array"
msgstr "êøòî åðéà `split' ìù éðùä èðîåâøàä"
-#: field.c:814
+#: field.c:876
msgid "split: null string for third arg is a gawk extension"
msgstr "gawk-ì úéôéöôñ äáçøä äðéä `split'-ì éùéìù èðåîâøàë úñôåàî úæåøçî"
-#: field.c:854
+#: field.c:916
msgid "`FIELDWIDTHS' is a gawk extension"
msgstr "gawk-ì úéôéöôñ äáçøä åðéä `FIELDWIDTHS'"
-#: field.c:881
+#: field.c:943
#, c-format
msgid "field %d in FIELDWIDTHS, must be > 0"
msgstr "0-î ìåãâ úåéäì áééç FIELDWIDTHS-á %d 'ñî äãù"
-#: field.c:935
+#: field.c:997
msgid "null string for `FS' is a gawk extension"
msgstr "gawk-ì úéôéöôñ äáçøä äðéä `FS'-ë úñôåàî úæåøçî"
@@ -1248,135 +1245,137 @@ msgstr "gawk-ì úéôéöôñ äáçøä äðéä `FS'-ë úñôåàî úæåøçî"
# Hebrew, due to changed directionality.
#: msg.c:57
msgid "cmd. line:"
-msgstr ""
+msgstr "cmd. line:"
#: msg.c:123
msgid "warning: "
-msgstr ""
+msgstr "warning: "
#: msg.c:145
msgid "error: "
-msgstr ""
+msgstr "error: "
#: msg.c:178
msgid "fatal: "
-msgstr ""
+msgstr "fatal: "
-#: eval.c:258
+#: eval.c:259
#, c-format
msgid "unknown nodetype %d"
msgstr "%d ääåæî-éúìá âåñ ìòá node"
-#: eval.c:306
+#: eval.c:307
msgid "buffer overflow in genflags2str"
msgstr "genflags2str-á õöåç úùéìâ"
-#: eval.c:545
+#: 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:569
+#: eval.c:565
msgid "`break' outside a loop is not portable"
msgstr "éìéáèøåô åðéà äàìåìì õåçî `break'"
-#: eval.c:573
+#: eval.c:569
msgid "`break' outside a loop is not allowed"
msgstr "äàìåìì õåçî `break'-á ùîúùäì ïéà"
-#: eval.c:592
+#: eval.c:588
msgid "`continue' outside a loop is not portable"
msgstr "éìéáèøåô åðéà äàìåìì õåçî `continue'"
-#: eval.c:596
+#: eval.c:592
msgid "`continue' outside a loop is not allowed"
msgstr "äàìåìì õåçî `continue'-á ùîúùäì ïéà"
-#: eval.c:626
+#: eval.c:622
msgid "`next' cannot be called from a BEGIN rule"
msgstr "BEGIN éììë êåúî `next'-ì àåø÷ì ïéà"
-#: eval.c:628
+#: eval.c:624
msgid "`next' cannot be called from an END rule"
msgstr "END éììë êåúî `next'-ì àåø÷ì ïéà"
-#: eval.c:640
+#: eval.c:636
msgid "`nextfile' cannot be called from a BEGIN rule"
msgstr "BEGIN éììë êåúî `nextfile'-ì àåø÷ì ïéà"
-#: eval.c:642
+#: eval.c:638
msgid "`nextfile' cannot be called from an END rule"
msgstr "END éììë êåúî `nextfile'-ì àåø÷ì ïéà"
-#: eval.c:683
+#: eval.c:679
msgid "statement has no effect"
msgstr "úéìëú-úìåèð äàøåä"
-#: eval.c:717 eval.c:747 eval.c:1617
+#: eval.c:713 eval.c:743 eval.c:1622
#, c-format
msgid "reference to uninitialized variable `%s'"
msgstr "`%s' ìçåúî-éúìá äðúùîì äéðôä"
-#: eval.c:725 eval.c:1603
+#: eval.c:721 eval.c:1608
#, c-format
msgid "can't use function name `%s' as variable or array"
msgstr "êøòî åà äðúùîë `%s' äéö÷ðåô íùá ùîúùäì ïéà"
-#: eval.c:732 eval.c:738 eval.c:1742
+#: eval.c:728 eval.c:734 eval.c:1747
#, c-format
msgid "reference to uninitialized argument `%s'"
msgstr "`%s' ìçåúî-éúìá èðîåâøàì äéðôä"
-#: eval.c:826
+#: eval.c:823
msgid "assignment used in conditional context"
msgstr "éàðú ìù èñ÷èðå÷á äîùäá ùåîéù"
-#: eval.c:917
+#: eval.c:914
msgid ""
"concatenation: side effects in one expression have changed the length of "
"another!"
msgstr ""
"!øçà éåèéá ìù åëøåà éåðéùì åîøâ ãçà éåèéá áåùéç ìù éàåì-úåòôåú :concatenation"
-#: eval.c:1012
+#: eval.c:1013
msgid "division by zero attempted"
msgstr "ñôàá ä÷åìç ïåéñð"
-#: eval.c:1027
+#: eval.c:1028
+#, c-format
msgid "division by zero attempted in `%%'"
msgstr "`%%'-á ñôàá ä÷åìç ïåéñð"
-#: eval.c:1228
+#: eval.c:1236
msgid "division by zero attempted in `/='"
msgstr "`/='-á ñôàá ä÷åìç ïåéñð"
-#: eval.c:1246
+#: 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:1419
+#: eval.c:1424
#, c-format
msgid "%s (from %s)"
-msgstr ""
+msgstr "%s (from %s)"
-#: eval.c:1467
+#: eval.c:1472
#, c-format
msgid "function `%s' called with more arguments than declared"
msgstr "äúæøëäá øùàî íéèðîåâøà øúåé íò `%s' äéö÷ðåôì äàéø÷"
-#: eval.c:1514
+#: eval.c:1519
#, c-format
msgid "function `%s' not defined"
msgstr "úøãâåî äðéà `%s' äéö÷ðåô"
-#: eval.c:1516
+#: eval.c:1521
#, c-format
msgid "function %s called\n"
msgstr "`%s' äéö÷ðåôì äàéø÷\n"
-#: eval.c:1575
+#: eval.c:1580
msgid ""
"\n"
"\t# Function Call Stack:\n"
@@ -1386,45 +1385,49 @@ msgstr ""
"\t# :úåéö÷ðåôì úåàéø÷ä úéðñçî\n"
"\n"
-#: eval.c:1578
+#: eval.c:1583
msgid "\t# -- main --\n"
-msgstr ""
+msgstr "\t# -- main --\n"
-#: eval.c:1754
+#: eval.c:1759
msgid "attempt to field reference from non-numeric value"
msgstr "øôñî åðéàù êøò úåòöîàá äãùì äéðôä ïåéñð"
-#: eval.c:1756
+#: eval.c:1761
msgid "attempt to reference from null string"
msgstr "ä÷éø úæåøçî úåòöîàá äãùì äéðôä ïåéñð"
-#: eval.c:1762
+#: eval.c:1767
#, c-format
msgid "attempt to access field %d"
msgstr "%d 'ñî äãùì äùéâ ïåéñð"
-#: eval.c:1778
+#: eval.c:1783
#, c-format
msgid "attempt to use scalar parameter `%s' as an array"
msgstr "êøòî äéä åìéàë `%s' éøì÷ñ øèîøôá ùåîéù ïåéñð"
-#: eval.c:1869
+#: eval.c:1874
msgid "`IGNORECASE' is a gawk extension"
msgstr "gawk-ì úéôéöôñ äáçøä åðéä `IGNORECASE'"
-#: eval.c:1897
+#: eval.c:1902
msgid "`BINMODE' is a gawk extension"
msgstr "gawk-ì úéôéöôñ äáçøä åðéä `BINMODE'"
-#: eval.c:2009
+#: eval.c:2014
#, c-format
msgid "bad `%sFMT' specification `%s'"
msgstr "äðé÷ú `%sFMT' úøãâä åðéà `%s'"
-#: eval.c:2075
+#: 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,13 +1498,11 @@ msgid ""
"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) íé÷éôà éãî øúåé"
@@ -1515,7 +1516,6 @@ msgstr "`from' åà `to' úåéäì áééç `close' ìù éðùä èðîåâøàä"
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 "íìåòî äçúôð àìù äééðôä úøéâñ"
@@ -1580,7 +1580,6 @@ msgstr "`%s'-ì ìéá÷î êéìäú ÷éôà ìù õöåç ïå÷éøá (%s) äì÷ú"
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 çå÷ì ,íéøòèöî"
@@ -1589,7 +1588,6 @@ msgstr "ïëåî íøè /inet/raw çå÷ì ,íéøòèöî"
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 úøù ,íéøòèöî"
@@ -1626,7 +1624,7 @@ msgstr "`%s'-á äéåâù ú÷çåøî äàéöé"
msgid "TCP/IP communications are not supported"
msgstr "TCP/IP úøåù÷úá äëéîú ïéà"
-#: io.c:1257 io.c:1446
+#: io.c:1257 io.c:1438
#, c-format
msgid "file `%s' is a directory"
msgstr "äé÷éú åðéä `%s' õáå÷"
@@ -1636,82 +1634,80 @@ msgstr "äé÷éú åðéä `%s' õáå÷"
msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
msgstr "`PROCINFO[\"%s\"]'-á ùîúùäì óéãò `%s' íå÷îá"
-#: io.c:1363
+#: 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:1432
+#: io.c:1424
#, 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
+#: 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:1549
-#, c-format
-msgid "close of stdin in child failed (%s)"
-msgstr "úá-úéðëúá stdin úøéâñá (%s) äì÷ú"
-
-#: io.c:1552
+#: io.c:1554 io.c:1607
#, 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
+#: 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 pipe failed (%s)"
-msgstr "÷éôà úøéâñá (%s) äì÷ú"
+msgid "close of stdout in child failed (%s)"
+msgstr "úá-úéðëúá stdout úøéâñá (%s) äì÷ú"
-#: io.c:1584
+#: io.c:1604
#, c-format
-msgid "pipe from `%s': could not set close-on-exec (fcntl: %s)"
-msgstr "`%s'-î èì÷ ÷éôà øåáò close-on-exec ïééôàî úìòôäá (fcntl: %s) äì÷ú"
+msgid "close of stdin in child failed (%s)"
+msgstr "úá-úéðëúá stdin úøéâñá (%s) äì÷ú"
-#: io.c:1588
+#: io.c:1610 io.c:1756 io.c:1767
#, c-format
-msgid "pipe to `%s': could not set close-on-exec (fcntl: %s)"
-msgstr "`%s'-ì èìô ÷éôà øåáò close-on-exec ïééôàî úìòôäá (fcntl: %s) äì÷ú"
+msgid "close of pipe failed (%s)"
+msgstr "÷éôà úøéâñá (%s) äì÷ú"
-#: io.c:1598
+#: io.c:1655
msgid "`|&' not supported"
msgstr "`|&'-á äëéîú ïéà"
-#: io.c:1662
+#: io.c:1722
#, c-format
msgid "cannot open pipe `%s' (%s)"
msgstr "`%s' ÷éôà úçéúôá (%s) äì÷ú"
-#: io.c:1675
+#: io.c:1763
#, c-format
msgid "cannot create child process for `%s' (fork: %s)"
msgstr "`%s' úá-úéðëúì êéìäú úøéöéá (fork: %s) äì÷ú"
-#: io.c:2004
+#: io.c:2104
#, c-format
msgid "data file `%s' is empty"
msgstr "÷éø åðéä `%s' íéðåúð õáå÷"
-#: io.c:2071
+#: io.c:2175
#, c-format
msgid "internal error: file `%s', line %d\n"
msgstr "`%s' õáå÷ ìù %d äøåùá úéîéðô äðëú äàéâù\n"
-#: io.c:2173
+#: io.c:2277
#, c-format
msgid "error reading input file `%s': %s"
msgstr "`%s' õáå÷ úàéø÷á (%s) äì÷ú"
-#: io.c:2392
+#: io.c:2521
msgid "multicharacter value of `RS' is a gawk extension"
msgstr "gawk-ì úéôéöôñ äáçøä äðéä `RS' ìù êøòá íéåú øôñîá äëéîú"
@@ -1736,10 +1732,12 @@ msgstr "`\\x' äø÷á úøãñá úåéìîéöãñ÷ä úåøôñá ùîúùäì ïéà"
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.
+#: 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: %s"
-msgstr ""
+msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
+msgstr "%s %s `%s' øåáò close-on-exec ïééôàî úìòôäá (fcntl: %s) äì÷ú"
diff --git a/po/insert-header.sin b/po/insert-header.sin
new file mode 100644
index 00000000..b26de01f
--- /dev/null
+++ b/po/insert-header.sin
@@ -0,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 --git a/po/it.gmo b/po/it.gmo
new file mode 100644
index 00000000..a2f12bcb
--- /dev/null
+++ b/po/it.gmo
Binary files differ
diff --git a/po/it.po b/po/it.po
new file mode 100644
index 00000000..5ca93516
--- /dev/null
+++ b/po/it.po
@@ -0,0 +1,1749 @@
+# Italian messages for GNU Awk
+# Copyright (C) 2002 Free Software Foundation, Inc.
+# Antonio Colombo <azc10@amdahl.com>, 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 <azc10@amdahl.com>\n"
+"Language-Team: Italian <it@li.org>\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 --git a/po/quot.sed b/po/quot.sed
new file mode 100644
index 00000000..0122c463
--- /dev/null
+++ b/po/quot.sed
@@ -0,0 +1,6 @@
+s/"\([^"]*\)"/“\1â€/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“â€/""/g
diff --git a/po/remove-potcdate.sin b/po/remove-potcdate.sin
new file mode 100644
index 00000000..2436c49e
--- /dev/null
+++ b/po/remove-potcdate.sin
@@ -0,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 --git a/po/stamp-cat-id b/po/stamp-cat-id
deleted file mode 100644
index 9788f702..00000000
--- a/po/stamp-cat-id
+++ /dev/null
@@ -1 +0,0 @@
-timestamp
diff --git a/po/sv.gmo b/po/sv.gmo
new file mode 100644
index 00000000..1864923f
--- /dev/null
+++ b/po/sv.gmo
Binary files differ
diff --git a/po/sv.po b/po/sv.po
new file mode 100644
index 00000000..a9699c63
--- /dev/null
+++ b/po/sv.po
@@ -0,0 +1,1757 @@
+# Swedish translation of gawk
+# Copyright (C) 2001 Free Software Foundation, Inc.
+# Martin Sjögren <md9ms@mdstud.chalmers.se>, 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 <md9ms@mdstud.chalmers.se>\n"
+"Language-Team: Swedish <sv@li.org>\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 <sv@li.org>.\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 --git a/po/tr.gmo b/po/tr.gmo
new file mode 100644
index 00000000..d6569cff
--- /dev/null
+++ b/po/tr.gmo
Binary files differ
diff --git a/po/tr.po b/po/tr.po
new file mode 100644
index 00000000..9c707ffc
--- /dev/null
+++ b/po/tr.po
@@ -0,0 +1,1761 @@
+# Turkish translations for GNU awk messages
+# Copyright (C) 2002 Free Software Foundation, Inc.
+# Nilgün Belma Bugüner <nilgun@fide.org>, 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 <nilgun@fide.org>\n"
+"Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\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ı <gnu-tr-u12a@lists.sourceforge.net> 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 --git a/posix/ChangeLog b/posix/ChangeLog
index 359a635a..0325c92e 100644
--- a/posix/ChangeLog
+++ b/posix/ChangeLog
@@ -1,3 +1,11 @@
+Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.1: Release tar file made.
+
+Tue Sep 25 15:19:53 2001 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.c (os_close_on_exec): If fd <= 2, return.
+
Sun Jun 3 13:04:44 2001 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.0: Release tar file made. And there was
diff --git a/posix/gawkmisc.c b/posix/gawkmisc.c
index 4f94683d..7f5e47ab 100644
--- a/posix/gawkmisc.c
+++ b/posix/gawkmisc.c
@@ -1,6 +1,6 @@
-/* gawkmisc.c --- miscellanious gawk routines that are OS specific.
+/* gawkmisc.c --- miscellaneous gawk routines that are OS specific.
- Copyright (C) 1986, 1988, 1989, 1991 - 98, 2001 the Free Software Foundation, Inc.
+ 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,13 +82,10 @@ struct stat *stb;
#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 */
+ if (S_ISREG(stb->st_mode)
+ && 0 < stb->st_size && stb->st_size < DEFBLKSIZE) /* small file */
return stb->st_size;
return DEFBLKSIZE;
}
@@ -118,8 +115,11 @@ os_close_on_exec(fd, name, what, dir)
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: %s"),
+ warning(_("%s %s `%s': could not set close-on-exec: (fcntl: %s)"),
what, dir, name, strerror(errno));
}
diff --git a/profile.c b/profile.c
index 1dced87a..1065d535 100644
--- a/profile.c
+++ b/profile.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1999-2001 the Free Software Foundation, Inc.
+ * Copyright (C) 1999-2002 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -98,17 +98,24 @@ set_prof_file(const char *file)
}
}
+/* 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
+#endif /* !__DJGPP__ */
+#endif /* PROFILING */
}
/* indent --- print out enough tabs */
@@ -403,7 +410,7 @@ tree_eval(register NODE *tree)
return;
case Node_val:
- if ((tree->flags & (NUM|NUMBER)) != 0)
+ if ((tree->flags & NUMBER) != 0)
fprintf(prof_fp, "%g", tree->numbr);
else {
if ((tree->flags & INTLSTR) != 0)
@@ -447,6 +454,11 @@ tree_eval(register NODE *tree)
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,6 +508,10 @@ tree_eval(register NODE *tree)
fprintf(prof_fp, "BINMODE");
return;
+ case Node_TEXTDOMAIN:
+ fprintf(prof_fp, "TEXTDOMAIN");
+ return;
+
case Node_field_spec:
case Node_subscript:
pp_lhs(tree);
@@ -510,7 +526,13 @@ tree_eval(register NODE *tree)
case Node_unary_minus:
fprintf(prof_fp, " -");
- tree_eval(tree->subnode);
+ 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,6 +546,7 @@ tree_eval(register NODE *tree)
case Node_match:
case Node_nomatch:
case Node_regex:
+ case Node_dynregex:
pp_match_op(tree);
return;
@@ -794,6 +817,10 @@ pp_lhs(register NODE *ptr)
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,26 +875,24 @@ pp_match_op(register NODE *tree)
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 (tree->type == Node_dynregex) {
+ tree_eval(tree->re_exp);
+ return;
}
- if ((re->re_flags & CONST) != 0) {
- restr = re->stptr;
- relen = re->stlen;
- } else {
+ if (tree->type == Node_regex) {
+ re = tree->re_exp;
restr = re->stptr;
relen = re->stlen;
- }
-
- if (tree->type == Node_regex) {
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,7 +902,7 @@ pp_match_op(register NODE *tree)
tree_eval(text);
fprintf(prof_fp, " %s ", op);
- fprintf(prof_fp, "/%.*s/", (int) relen, restr);
+ tree_eval(re);
}
/* pp_redir --- print a redirection */
@@ -1192,7 +1217,11 @@ pp_string_fp(FILE *fp, char *in_str, size_t len, int delim, int breaklines)
} else {
char buf[10];
- sprintf(buf, "\\%03o", *str & 0xff);
+ /* 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,6 +1251,7 @@ is_scalar(NODETYPE type)
case Node_OFS:
case Node_ORS:
case Node_RS:
+ case Node_TEXTDOMAIN:
case Node_subscript:
return TRUE;
default:
@@ -1240,6 +1270,7 @@ prec_level(NODETYPE type)
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,6 +1286,7 @@ prec_level(NODETYPE type)
case Node_OFS:
case Node_ORS:
case Node_RS:
+ case Node_TEXTDOMAIN:
return 15;
case Node_field_spec:
diff --git a/protos.h b/protos.h
index 02f1f3fd..b7b80074 100644
--- a/protos.h
+++ b/protos.h
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1991 - 2001 the Free Software Foundation, Inc.
+ * Copyright (C) 1991 - 2002 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -102,7 +102,6 @@ extern double strtod P((const char *, char **));
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, ...));
diff --git a/random.c b/random.c
index ac7f217b..723da48a 100644
--- a/random.c
+++ b/random.c
@@ -40,12 +40,18 @@ static char sccsid[] = "@(#)random.c 8.2 (Berkeley) 5/19/95";
#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 <sys/time.h> /* for srandomdev() */
#else
#include <time.h> /* for clock() */
#define ssize_t size_t
#endif /* !defined (_MSC_VER) && !defined (__MINGW32__) && !defined (VMS) */
+#endif
#include <stdio.h>
@@ -54,12 +60,15 @@ static char sccsid[] = "@(#)random.c 8.2 (Berkeley) 5/19/95";
#include <stdlib.h>
#endif
+/* same thing here: */
+#if 0
#ifdef HAVE_UNISTD_H
#include <unistd.h> /* for srandomdev() */
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h> /* for srandomdev() */
#endif
+#endif
/*
* random.c:
@@ -303,6 +312,7 @@ srandom(x)
* state buffer are no longer derived from the LC algorithm applied to
* a fixed seed.
*/
+#if 0
void
srandomdev()
{
@@ -349,6 +359,7 @@ srandomdev()
rptr = &state[0];
}
}
+#endif
/*
* initstate:
diff --git a/re.c b/re.c
index 2ee9e6d9..221f3891 100644
--- a/re.c
+++ b/re.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1991-2001 the Free Software Foundation, Inc.
+ * Copyright (C) 1991-2002 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -39,6 +39,14 @@ make_regexp(char *s, size_t len, int ignorecase, int dfa)
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,7 +59,26 @@ make_regexp(char *s, size_t len, int ignorecase, int dfa)
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,6 +132,10 @@ make_regexp(char *s, size_t len, int ignorecase, int dfa)
} /* 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,6 +194,21 @@ research(Regexp *rp, register char *str, int start,
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,8 +248,10 @@ re_update(NODE *t)
NODE *t1;
if ((t->re_flags & CASE) == IGNORECASE) {
- if ((t->re_flags & CONST) != 0)
+ 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 --git a/regex.c b/regex.c
index 1da69e2c..9ea11811 100644
--- a/regex.c
+++ b/regex.c
@@ -2,7 +2,7 @@
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.
+ 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,6 +38,12 @@
# endif /* GCC. */
#endif /* Not PARAMS. */
+#ifndef INSIDE_RECURSION
+
+#if !defined __GNUC__
+# define __alignof__(type) sizeof(type)
+#endif
+
#if defined STDC_HEADERS && !defined emacs
# include <stddef.h>
#else
@@ -45,7 +51,21 @@
# include <sys/types.h>
#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,9 +100,14 @@
#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 <libintl.h>
+# if HAVE_LIBINTL_H || defined _LIBC
+# include <libintl.h>
+# else
+# define gettext(msgid) (msgid)
+# endif
#else
# define gettext(msgid) (msgid)
#endif
@@ -165,6 +190,14 @@ char *realloc ();
#endif /* not emacs */
+# if defined _LIBC || HAVE_LIMITS_H
+# include <limits.h>
+# endif
+
+# ifndef MB_LEN_MAX
+# define MB_LEN_MAX 1
+# endif
+
/* Get the interface, including the syntax bits. */
#include <regex.h>
@@ -374,12 +407,46 @@ typedef char boolean;
#define false 0
#define true 1
-static int re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp,
+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,6 +463,11 @@ typedef enum
/* 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,6 +477,13 @@ typedef enum
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,6 +533,7 @@ typedef enum
/* 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,6 +542,7 @@ typedef enum
/* 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,6 +552,7 @@ typedef enum
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,6 +560,7 @@ typedef enum
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,15 +569,18 @@ typedef enum
/* 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,51 +605,131 @@ typedef enum
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. */
-#define STORE_NUMBER(destination, number) \
+# 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) += 2; \
+ (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. */
-#define EXTRACT_NUMBER(destination, source) \
+# 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 extract_number _RE_ARGS ((int *dest, unsigned char *source));
+static void PREFIX(extract_number) _RE_ARGS ((int *dest, UCHAR_T *source));
static void
-extract_number (dest, source)
+PREFIX(extract_number) (dest, source)
int *dest;
- unsigned char *source;
+ 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) extract_number (&dest, src)
+# define EXTRACT_NUMBER(dest, src) PREFIX(extract_number) (&dest, src)
# endif /* not EXTRACT_MACROS */
#endif /* DEBUG */
@@ -574,25 +740,25 @@ extract_number (dest, source)
#define EXTRACT_NUMBER_AND_INCR(destination, source) \
do { \
EXTRACT_NUMBER (destination, source); \
- (source) += 2; \
+ (source) += OFFSET_ADDRESS_SIZE; \
} while (0)
#ifdef DEBUG
-static void extract_number_and_incr _RE_ARGS ((int *destination,
- unsigned char **source));
+static void PREFIX(extract_number_and_incr) _RE_ARGS ((int *destination,
+ UCHAR_T **source));
static void
-extract_number_and_incr (destination, source)
+PREFIX(extract_number_and_incr) (destination, source)
int *destination;
- unsigned char **source;
+ UCHAR_T **source;
{
- extract_number (destination, *source);
- *source += 2;
+ PREFIX(extract_number) (destination, *source);
+ *source += OFFSET_ADDRESS_SIZE;
}
# ifndef EXTRACT_MACROS
# undef EXTRACT_NUMBER_AND_INCR
# define EXTRACT_NUMBER_AND_INCR(dest, src) \
- extract_number_and_incr (&dest, &src)
+ PREFIX(extract_number_and_incr) (&dest, &src)
# endif /* not EXTRACT_MACROS */
#endif /* DEBUG */
@@ -605,6 +771,8 @@ extract_number_and_incr (destination, source)
#ifdef DEBUG
+#ifndef DEFINED_ONCE
+
/* We use standard I/O for debugging. */
# include <stdio.h>
@@ -618,14 +786,17 @@ static int debug;
# 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) print_partial_compiled_pattern (s, e)
+ if (debug) PREFIX(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)
+ 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,20 +824,21 @@ print_fastmap (fastmap)
}
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
-print_partial_compiled_pattern (start, end)
- unsigned char *start;
- unsigned char *end;
+PREFIX(print_partial_compiled_pattern) (start, end)
+ UCHAR_T *start;
+ UCHAR_T *end;
{
int mcnt, mcnt2;
- unsigned char *p1;
- unsigned char *p = start;
- unsigned char *pend = end;
+ UCHAR_T *p1;
+ UCHAR_T *p = start;
+ UCHAR_T *pend = end;
if (start == NULL)
{
@@ -691,10 +863,22 @@ print_partial_compiled_pattern (start, end)
do
{
putchar ('/');
- putchar (*p++);
+ 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,6 +901,45 @@ print_partial_compiled_pattern (start, end)
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 ; i<length ; i++)
+ printf("[:%lx:]", (long int) *p++);
+ length = *workp++; /* the length of collating_symbol */
+ for (i=0 ; i<length ;)
+ {
+ printf("[.");
+ while(*p != 0)
+ PUT_CHAR((i++,*p++));
+ i++,p++;
+ printf(".]");
+ }
+ length = *workp++; /* the length of equivalence_class */
+ for (i=0 ; i<length ;)
+ {
+ printf("[=");
+ while(*p != 0)
+ PUT_CHAR((i++,*p++));
+ i++,p++;
+ printf("=]");
+ }
+ length = *workp++; /* the length of char_range */
+ for (i=0 ; i<length ; i++)
+ {
+ wchar_t range_start = *p++;
+ wchar_t range_end = *p++;
+ printf("%C-%C", range_start, range_end);
+ }
+ length = *workp++; /* the length of char */
+ for (i=0 ; i<length ; i++)
+ printf("%C", *p++);
+ putchar (']');
+# else
register int c, last = -100;
register int in_range = 0;
@@ -754,6 +977,7 @@ print_partial_compiled_pattern (start, end)
putchar (']');
p += 1 + *p;
+# endif /* WCHAR */
}
break;
@@ -766,17 +990,17 @@ print_partial_compiled_pattern (start, end)
break;
case on_failure_jump:
- extract_number_and_incr (&mcnt, &p);
+ PREFIX(extract_number_and_incr) (&mcnt, &p);
printf ("/on_failure_jump to %d", p + mcnt - start);
break;
case on_failure_keep_string_jump:
- extract_number_and_incr (&mcnt, &p);
+ PREFIX(extract_number_and_incr) (&mcnt, &p);
printf ("/on_failure_keep_string_jump to %d", p + mcnt - start);
break;
case dummy_failure_jump:
- extract_number_and_incr (&mcnt, &p);
+ PREFIX(extract_number_and_incr) (&mcnt, &p);
printf ("/dummy_failure_jump to %d", p + mcnt - start);
break;
@@ -785,43 +1009,43 @@ print_partial_compiled_pattern (start, end)
break;
case maybe_pop_jump:
- extract_number_and_incr (&mcnt, &p);
+ PREFIX(extract_number_and_incr) (&mcnt, &p);
printf ("/maybe_pop_jump to %d", p + mcnt - start);
break;
case pop_failure_jump:
- extract_number_and_incr (&mcnt, &p);
+ PREFIX(extract_number_and_incr) (&mcnt, &p);
printf ("/pop_failure_jump to %d", p + mcnt - start);
break;
case jump_past_alt:
- extract_number_and_incr (&mcnt, &p);
+ PREFIX(extract_number_and_incr) (&mcnt, &p);
printf ("/jump_past_alt to %d", p + mcnt - start);
break;
case jump:
- extract_number_and_incr (&mcnt, &p);
+ PREFIX(extract_number_and_incr) (&mcnt, &p);
printf ("/jump to %d", p + mcnt - start);
break;
case succeed_n:
- extract_number_and_incr (&mcnt, &p);
+ PREFIX(extract_number_and_incr) (&mcnt, &p);
p1 = p + mcnt;
- extract_number_and_incr (&mcnt2, &p);
+ PREFIX(extract_number_and_incr) (&mcnt2, &p);
printf ("/succeed_n to %d, %d times", p1 - start, mcnt2);
break;
case jump_n:
- extract_number_and_incr (&mcnt, &p);
+ PREFIX(extract_number_and_incr) (&mcnt, &p);
p1 = p + mcnt;
- extract_number_and_incr (&mcnt2, &p);
+ PREFIX(extract_number_and_incr) (&mcnt2, &p);
printf ("/jump_n to %d, %d times", p1 - start, mcnt2);
break;
case set_number_at:
- extract_number_and_incr (&mcnt, &p);
+ PREFIX(extract_number_and_incr) (&mcnt, &p);
p1 = p + mcnt;
- extract_number_and_incr (&mcnt2, &p);
+ PREFIX(extract_number_and_incr) (&mcnt2, &p);
printf ("/set_number_at location %d to %d", p1 - start, mcnt2);
break;
@@ -894,12 +1118,13 @@ print_partial_compiled_pattern (start, end)
void
-print_compiled_pattern (bufp)
+PREFIX(print_compiled_pattern) (bufp)
struct re_pattern_buffer *bufp;
{
- unsigned char *buffer = bufp->buffer;
+ UCHAR_T *buffer = (UCHAR_T*) bufp->buffer;
- print_partial_compiled_pattern (buffer, buffer + bufp->used);
+ 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,10 +1147,10 @@ print_compiled_pattern (bufp)
void
-print_double_string (where, string1, size1, string2, size2)
- const char *where;
- const char *string1;
- const char *string2;
+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,25 +1163,28 @@ print_double_string (where, string1, size1, string2, size2)
if (FIRST_STRING_P (where))
{
for (this_char = where - string1; this_char < size1; this_char++)
- putchar (string1[this_char]);
+ PUT_CHAR (string1[this_char]);
where = string2;
}
for (this_char = where - string2; this_char < size2; this_char++)
- putchar (string2[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,11 +1193,88 @@ printchar (c)
# 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,6 +1338,9 @@ static const char *re_error_msgid[] =
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,8 +1377,10 @@ static const char *re_error_msgid[] =
#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,59 +1400,93 @@ static const char *re_error_msgid[] =
#ifdef INT_IS_16BIT
-# if defined MATCH_MAY_ALLOCATE
+#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
+# else
long int re_max_failures = 2000;
-# endif
+# endif
+# endif /* ! not REGEX_MALLOC */
+#endif /* ! DEFINED_ONCE */
-union fail_stack_elt
+union PREFIX(fail_stack_elt)
{
- unsigned char *pointer;
+ UCHAR_T *pointer;
long int integer;
};
-typedef union fail_stack_elt fail_stack_elt_t;
+typedef union PREFIX(fail_stack_elt) PREFIX(fail_stack_elt_t);
typedef struct
{
- fail_stack_elt_t *stack;
+ PREFIX(fail_stack_elt_t) *stack;
unsigned long int size;
unsigned long int avail; /* Offset of next open position. */
-} fail_stack_type;
+} PREFIX(fail_stack_type);
#else /* not INT_IS_16BIT */
-# if defined MATCH_MAY_ALLOCATE
+#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
+# else
int re_max_failures = 2000;
-# endif
+# endif
+# endif /* ! not REGEX_MALLOC */
+#endif
-union fail_stack_elt
+union PREFIX(fail_stack_elt)
{
- unsigned char *pointer;
+ UCHAR_T *pointer;
int integer;
};
-typedef union fail_stack_elt fail_stack_elt_t;
+typedef union PREFIX(fail_stack_elt) PREFIX(fail_stack_elt_t);
typedef struct
{
- fail_stack_elt_t *stack;
+ PREFIX(fail_stack_elt_t) *stack;
unsigned size;
unsigned avail; /* Offset of next open position. */
-} fail_stack_type;
+} 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,8 +1495,8 @@ typedef struct
#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)); \
+ 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,10 +1526,10 @@ typedef struct
#define DOUBLE_FAIL_STACK(fail_stack) \
((fail_stack).size > (unsigned) (re_max_failures * MAX_FAILURE_ITEMS) \
? 0 \
- : ((fail_stack).stack = (fail_stack_elt_t *) \
+ : ((fail_stack).stack = (PREFIX(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).size * sizeof (PREFIX(fail_stack_elt_t)), \
+ ((fail_stack).size << 1) * sizeof (PREFIX(fail_stack_elt_t))),\
\
(fail_stack).stack == NULL \
? 0 \
@@ -1207,7 +1551,7 @@ typedef struct
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)
+ 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,6 +1669,7 @@ typedef struct
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,6 +1696,7 @@ typedef struct
/* 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,7 +1715,7 @@ typedef struct
{ \
DEBUG_STATEMENT (unsigned failure_id;) \
active_reg_t this_reg; \
- const unsigned char *string_temp; \
+ const UCHAR_T *string_temp; \
\
assert (!FAIL_STACK_EMPTY ()); \
\
@@ -1388,13 +1734,13 @@ typedef struct
saved NULL, thus retaining our current position in the string. */ \
string_temp = POP_FAILURE_POINTER (); \
if (string_temp != NULL) \
- str = (const char *) string_temp; \
+ 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 = (unsigned char *) POP_FAILURE_POINTER (); \
+ pat = (UCHAR_T *) POP_FAILURE_POINTER (); \
DEBUG_PRINT2 (" Popping pattern %p:\n", pat); \
DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \
\
@@ -1414,10 +1760,10 @@ typedef struct
DEBUG_PRINT2 (" info: %p\n", \
reg_info[this_reg].word.pointer); \
\
- regend[this_reg] = (const char *) POP_FAILURE_POINTER (); \
+ regend[this_reg] = (const CHAR_T *) POP_FAILURE_POINTER (); \
DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \
\
- regstart[this_reg] = (const char *) POP_FAILURE_POINTER (); \
+ regstart[this_reg] = (const CHAR_T *) POP_FAILURE_POINTER (); \
DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \
} \
else \
@@ -1453,7 +1799,7 @@ typedef struct
typedef union
{
- fail_stack_elt_t word;
+ PREFIX(fail_stack_elt_t) word;
struct
{
/* This field is one if this group can match the empty string,
@@ -1464,8 +1810,9 @@ typedef union
unsigned matched_something : 1;
unsigned ever_matched_something : 1;
} bits;
-} register_info_type;
+} 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,51 +1838,71 @@ typedef union
} \
} \
while (0)
+#endif /* not DEFINED_ONCE */
/* Registers are set to a sentinel when they haven't yet matched. */
-static char reg_unset_dummy;
-#define REG_UNSET_VALUE (&reg_unset_dummy)
+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 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,
+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 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,
+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 at_endline_loc_p _RE_ARGS ((const char *p, const char *pend,
+static boolean PREFIX(at_endline_loc_p) _RE_ARGS ((const CHAR_T *p, const CHAR_T *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));
+# 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
-# define PATFETCH(c) \
+# 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 = (unsigned char) *p++; \
+ c = (UCHAR_T) *p++; \
} while (0)
/* Go backwards one character in the pattern. */
@@ -1546,27 +1913,43 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
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
-# define TRANSLATE(d) \
+# 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
+# define INIT_BUF_SIZE (32 * sizeof(UCHAR_T))
/* Make sure we have at least N more bytes of space in buffer. */
-#define GET_BUFFER_SPACE(n) \
+# 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++ = (unsigned char) (c); \
+ *b++ = (UCHAR_T) (c); \
} while (0)
@@ -1574,8 +1957,8 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
#define BUF_PUSH_2(c1, c2) \
do { \
GET_BUFFER_SPACE (2); \
- *b++ = (unsigned char) (c1); \
- *b++ = (unsigned char) (c2); \
+ *b++ = (UCHAR_T) (c1); \
+ *b++ = (UCHAR_T) (c2); \
} while (0)
@@ -1583,28 +1966,28 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
#define BUF_PUSH_3(c1, c2, c3) \
do { \
GET_BUFFER_SPACE (3); \
- *b++ = (unsigned char) (c1); \
- *b++ = (unsigned char) (c2); \
- *b++ = (unsigned char) (c3); \
+ *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) \
- store_op1 (op, loc, (int) ((to) - (loc) - 3))
+ 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) \
- store_op2 (op, loc, (int) ((to) - (loc) - 3), 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) \
- insert_op1 (op, loc, (int) ((to) - (loc) - 3), b)
+ 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) \
- insert_op2 (op, loc, (int) ((to) - (loc) - 3), arg, b)
+ 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,6 +1998,7 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
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,34 +2034,72 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
# 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) \
+#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; \
- bufp->buffer = (unsigned char *) REALLOC (bufp->buffer, bufp->allocated);\
- if (bufp->buffer == NULL) \
+ 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 != bufp->buffer) \
+ if (old_buffer != COMPILED_BUFFER_VAR) \
{ \
- int incr = bufp->buffer - old_buffer; \
+ 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) \
+ if (fixup_alt_jump) \
MOVE_BUFFER_POINTER (fixup_alt_jump); \
- if (laststart) \
+ if (laststart) \
MOVE_BUFFER_POINTER (laststart); \
- if (pending_exact) \
+ 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,12 +2143,15 @@ typedef struct
/* 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,6 +2170,7 @@ typedef struct
} \
}
+#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,6 +2198,7 @@ typedef struct
|| STREQ (string, "punct") || STREQ (string, "graph") \
|| STREQ (string, "cntrl") || STREQ (string, "blank"))
#endif
+#endif /* DEFINED_ONCE */
#ifndef MATCH_MAY_ALLOCATE
@@ -1782,25 +2209,28 @@ typedef struct
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;
+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 register_info_type *reg_info;
static const char **reg_dummy;
-static register_info_type *reg_info_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
-regex_grow_registers (num_regs)
+static void
+PREFIX(regex_grow_registers) (num_regs)
int num_regs;
{
if (num_regs > regs_allocated_size)
@@ -1811,9 +2241,9 @@ regex_grow_registers (num_regs)
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 (PREFIX(reg_info), num_regs, PREFIX(register_info_type));
RETALLOC_IF (reg_dummy, num_regs, const char *);
- RETALLOC_IF (reg_info_dummy, num_regs, register_info_type);
+ RETALLOC_IF (PREFIX(reg_info_dummy), num_regs, PREFIX(register_info_type));
regs_allocated_size = num_regs;
}
@@ -1821,9 +2251,11 @@ regex_grow_registers (num_regs)
#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,33 +2276,55 @@ static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type
examined nor set. */
/* Return, freeing storage we allocated. */
-#define FREE_STACK_RETURN(value) \
+# 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
-regex_compile (pattern, size, syntax, bufp)
- const char *pattern;
- size_t size;
+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 unsigned char c, c1;
+ 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 *p1;
+ const CHAR_T *p1;
/* Points to the end of the buffer, where we should append. */
- register unsigned char *b;
+ register UCHAR_T *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;
+#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,30 +2333,54 @@ regex_compile (pattern, size, syntax, bufp)
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;
+ 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. */
- unsigned char *laststart = 0;
+ UCHAR_T *laststart = 0;
/* Address of beginning of regexp, or inside of last group. */
- unsigned char *begalt;
+ UCHAR_T *begalt;
/* Place in the uncompiled pattern (i.e., the {) to
which to go back if the interval is invalid. */
- const char *beg_interval;
+ 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. */
- unsigned char *fixup_alt_jump = 0;
+ 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,7 +2388,7 @@ regex_compile (pattern, size, syntax, bufp)
unsigned debug_count;
for (debug_count = 0; debug_count < size; debug_count++)
- putchar (pattern[debug_count]);
+ PUT_CHAR (pattern[debug_count]);
putchar ('\n');
}
#endif /* DEBUG */
@@ -1918,7 +2396,15 @@ regex_compile (pattern, size, syntax, bufp)
/* Initialize the compile stack. */
compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t);
if (compile_stack.stack == NULL)
- return REG_ESPACE;
+ {
+#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,18 +2433,34 @@ regex_compile (pattern, size, syntax, bufp)
{ /* 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);
+#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. */
- bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char);
+ COMPILED_BUFFER_VAR = TALLOC (INIT_BUF_SIZE / sizeof(UCHAR_T),
+ UCHAR_T);
}
- if (!bufp->buffer) FREE_STACK_RETURN (REG_ESPACE);
+ 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 = bufp->buffer;
+ begalt = b = COMPILED_BUFFER_VAR;
/* Loop through the uncompiled pattern until we're at the end. */
while (p != pend)
@@ -1974,7 +2476,7 @@ regex_compile (pattern, size, syntax, bufp)
/* 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))
+ || PREFIX(at_begline_loc_p) (pattern, p, syntax))
BUF_PUSH (begline);
else
goto normal_char;
@@ -1989,7 +2491,7 @@ regex_compile (pattern, size, syntax, bufp)
/* 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))
+ || PREFIX(at_endline_loc_p) (p, pend, syntax))
BUF_PUSH (endline);
else
goto normal_char;
@@ -2083,7 +2585,7 @@ regex_compile (pattern, size, syntax, bufp)
assert (p - 1 > pattern);
/* Allocate the space for the jump. */
- GET_BUFFER_SPACE (3);
+ 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,20 +2602,23 @@ regex_compile (pattern, size, syntax, bufp)
}
else
/* Anything else. */
- STORE_JUMP (maybe_pop_jump, b, laststart - 3);
+ STORE_JUMP (maybe_pop_jump, b, laststart -
+ (1 + OFFSET_ADDRESS_SIZE));
/* We've added more stuff to the buffer. */
- b += 3;
+ 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. */
- GET_BUFFER_SPACE (3);
+ /* 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 + 3);
+ laststart, b + 1 + OFFSET_ADDRESS_SIZE);
pending_exact = 0;
- b += 3;
+ b += 1 + OFFSET_ADDRESS_SIZE;
if (!zero_times_ok)
{
@@ -2122,9 +2627,10 @@ regex_compile (pattern, size, syntax, bufp)
`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;
+ 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,9 +2645,343 @@ regex_compile (pattern, size, syntax, bufp)
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,6 +3022,7 @@ regex_compile (pattern, size, syntax, bufp)
PATFETCH (c1);
SET_LIST_BIT (c1);
+ range_start = c1;
continue;
}
@@ -2206,8 +3047,10 @@ regex_compile (pattern, size, syntax, bufp)
&& *p != ']')
{
reg_errcode_t ret
- = compile_range (&p, pend, translate, syntax, b);
+ = 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,8 +3060,9 @@ regex_compile (pattern, size, syntax, bufp)
/* Move past the `-'. */
PATFETCH (c1);
- ret = compile_range (&p, pend, translate, syntax, b);
+ 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,6 +3185,119 @@ regex_compile (pattern, size, syntax, bufp)
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,6 +3305,7 @@ regex_compile (pattern, size, syntax, bufp)
{
had_char_class = false;
SET_LIST_BIT (c);
+ range_start = c;
}
}
@@ -2356,6 +3314,7 @@ regex_compile (pattern, size, syntax, bufp)
while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
b[-1]--;
b += b[-1];
+#endif /* WCHAR */
}
break;
@@ -2426,10 +3385,10 @@ regex_compile (pattern, size, syntax, bufp)
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.begalt_offset = begalt - COMPILED_BUFFER_VAR;
COMPILE_STACK_TOP.fixup_alt_jump
- = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
- COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
+ = 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,7 +3397,8 @@ regex_compile (pattern, size, syntax, bufp)
represent in the compiled pattern. */
if (regnum <= MAX_REGNUM)
{
- COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
+ COMPILE_STACK_TOP.inner_group_offset = b
+ - COMPILED_BUFFER_VAR + 2;
BUF_PUSH_3 (start_memory, regnum, 0);
}
@@ -2497,12 +3457,12 @@ regex_compile (pattern, size, syntax, bufp)
regnum_t this_group_regnum;
compile_stack.avail--;
- begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
+ begalt = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.begalt_offset;
fixup_alt_jump
= COMPILE_STACK_TOP.fixup_alt_jump
- ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
+ ? COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.fixup_alt_jump - 1
: 0;
- laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
+ 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,8 +3473,8 @@ regex_compile (pattern, size, syntax, bufp)
groups were inside this one. */
if (this_group_regnum <= MAX_REGNUM)
{
- unsigned char *inner_group_loc
- = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
+ 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,10 +3493,11 @@ regex_compile (pattern, size, syntax, bufp)
/* 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);
+ GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE);
+ INSERT_JUMP (on_failure_jump, begalt,
+ b + 2 + 2 * OFFSET_ADDRESS_SIZE);
pending_exact = 0;
- b += 3;
+ 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,8 +3522,8 @@ regex_compile (pattern, size, syntax, bufp)
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;
+ GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE);
+ b += 1 + OFFSET_ADDRESS_SIZE;
laststart = 0;
begalt = b;
@@ -2646,11 +3607,13 @@ regex_compile (pattern, size, syntax, bufp)
/* 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 (3);
- INSERT_JUMP (jump, laststart, b + 3);
- b += 3;
+ 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,7 +3628,8 @@ regex_compile (pattern, size, syntax, bufp)
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;
+ unsigned nbytes = 2 + 4 * OFFSET_ADDRESS_SIZE +
+ (upper_bound > 1) * (2 + 4 * OFFSET_ADDRESS_SIZE);
GET_BUFFER_SPACE (nbytes);
@@ -2675,16 +3639,21 @@ regex_compile (pattern, size, syntax, bufp)
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,
+ b + 1 + 2 * OFFSET_ADDRESS_SIZE +
+ (upper_bound > 1) * (1 + 2 * OFFSET_ADDRESS_SIZE),
lower_bound);
- b += 5;
+ 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'. */
- insert_op2 (set_number_at, laststart, 5, lower_bound, b);
- b += 5;
+ /* 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,9 +3663,10 @@ regex_compile (pattern, size, syntax, bufp)
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,
+ STORE_JUMP2 (jump_n, b, laststart +
+ 1 + 2 * OFFSET_ADDRESS_SIZE,
upper_bound - 1);
- b += 5;
+ 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,9 +3682,10 @@ regex_compile (pattern, size, syntax, bufp)
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;
+ PREFIX(insert_op2) (set_number_at, laststart,
+ b - laststart,
+ upper_bound - 1, b);
+ b += 1 + 2 * OFFSET_ADDRESS_SIZE;
}
}
pending_exact = 0;
@@ -2853,6 +3824,11 @@ regex_compile (pattern, size, syntax, bufp)
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,7 +3850,16 @@ regex_compile (pattern, size, syntax, bufp)
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,16 +3883,25 @@ regex_compile (pattern, size, syntax, bufp)
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");
- print_compiled_pattern (bufp);
+ PREFIX(print_compiled_pattern) (bufp);
}
#endif /* DEBUG */
@@ -2928,27 +3922,27 @@ regex_compile (pattern, size, syntax, bufp)
# ifdef emacs
if (! fail_stack.stack)
fail_stack.stack
- = (fail_stack_elt_t *) xmalloc (fail_stack.size
- * sizeof (fail_stack_elt_t));
+ = (PREFIX(fail_stack_elt_t) *) xmalloc (fail_stack.size
+ * sizeof (PREFIX(fail_stack_elt_t)));
else
fail_stack.stack
- = (fail_stack_elt_t *) xrealloc (fail_stack.stack,
+ = (PREFIX(fail_stack_elt_t) *) xrealloc (fail_stack.stack,
(fail_stack.size
- * sizeof (fail_stack_elt_t)));
+ * sizeof (PREFIX(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));
+ = (PREFIX(fail_stack_elt_t) *) malloc (fail_stack.size
+ * sizeof (PREFIX(fail_stack_elt_t)));
else
fail_stack.stack
- = (fail_stack_elt_t *) realloc (fail_stack.stack,
+ = (PREFIX(fail_stack_elt_t) *) realloc (fail_stack.stack,
(fail_stack.size
- * sizeof (fail_stack_elt_t)));
+ * sizeof (PREFIX(fail_stack_elt_t))));
# endif /* not emacs */
}
- regex_grow_registers (num_regs);
+ PREFIX(regex_grow_registers (num_regs));
}
#endif /* not MATCH_MAY_ALLOCATE */
@@ -2958,68 +3952,72 @@ regex_compile (pattern, size, syntax, bufp)
/* 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
-store_op1 (op, loc, arg)
+PREFIX(store_op1) (op, loc, arg)
re_opcode_t op;
- unsigned char *loc;
+ UCHAR_T *loc;
int arg;
{
- *loc = (unsigned char) op;
+ *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
-store_op2 (op, loc, arg1, arg2)
+PREFIX(store_op2) (op, loc, arg1, arg2)
re_opcode_t op;
- unsigned char *loc;
+ UCHAR_T *loc;
int arg1, arg2;
{
- *loc = (unsigned char) op;
+ *loc = (UCHAR_T) op;
STORE_NUMBER (loc + 1, arg1);
- STORE_NUMBER (loc + 3, arg2);
+ 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
-insert_op1 (op, loc, arg, end)
+PREFIX(insert_op1) (op, loc, arg, end)
re_opcode_t op;
- unsigned char *loc;
+ UCHAR_T *loc;
int arg;
- unsigned char *end;
+ UCHAR_T *end;
{
- register unsigned char *pfrom = end;
- register unsigned char *pto = end + 3;
+ register UCHAR_T *pfrom = end;
+ register UCHAR_T *pto = end + 1 + OFFSET_ADDRESS_SIZE;
while (pfrom != loc)
*--pto = *--pfrom;
- store_op1 (op, loc, arg);
+ 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
-insert_op2 (op, loc, arg1, arg2, end)
+PREFIX(insert_op2) (op, loc, arg1, arg2, end)
re_opcode_t op;
- unsigned char *loc;
+ UCHAR_T *loc;
int arg1, arg2;
- unsigned char *end;
+ UCHAR_T *end;
{
- register unsigned char *pfrom = end;
- register unsigned char *pto = end + 5;
+ register UCHAR_T *pfrom = end;
+ register UCHAR_T *pto = end + 1 + 2 * OFFSET_ADDRESS_SIZE;
while (pfrom != loc)
*--pto = *--pfrom;
- store_op2 (op, loc, arg1, arg2);
+ PREFIX(store_op2) (op, loc, arg1, arg2);
}
@@ -3028,11 +4026,11 @@ insert_op2 (op, loc, arg1, arg2, end)
least one character before the ^. */
static boolean
-at_begline_loc_p (pattern, p, syntax)
- const char *pattern, *p;
+PREFIX(at_begline_loc_p) (pattern, p, syntax)
+ const CHAR_T *pattern, *p;
reg_syntax_t syntax;
{
- const char *prev = p - 2;
+ const CHAR_T *prev = p - 2;
boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
return
@@ -3047,13 +4045,13 @@ at_begline_loc_p (pattern, p, syntax)
at least one character after the $, i.e., `P < PEND'. */
static boolean
-at_endline_loc_p (p, pend, syntax)
- const char *p, *pend;
+PREFIX(at_endline_loc_p) (p, pend, syntax)
+ const CHAR_T *p, *pend;
reg_syntax_t syntax;
{
- const char *next = p;
+ const CHAR_T *next = p;
boolean next_backslash = *next == '\\';
- const char *next_next = p + 1 < pend ? p + 1 : 0;
+ const CHAR_T *next_next = p + 1 < pend ? p + 1 : 0;
return
/* Before a subexpression? */
@@ -3064,6 +4062,7 @@ at_endline_loc_p (p, pend, syntax)
: 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,7 +4083,63 @@ group_in_compile_stack (compile_stack, regnum)
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,52 +4150,51 @@ group_in_compile_stack (compile_stack, regnum)
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;
+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;
- unsigned int range_start, range_end;
+ reg_errcode_t ret;
+ unsigned end_char;
+
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;
+ /* 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' -- 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++)
+ 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 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,27 +4209,50 @@ compile_range (p_ptr, pend, translate, syntax, b)
Returns 0 if we succeed, -2 if an internal error. */
-int
-re_compile_fastmap (bufp)
+#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
- fail_stack_type fail_stack;
+ PREFIX(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 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. */
- fail_stack_elt_t *failure_stack_ptr;
+ PREFIX(fail_stack_elt_t) *failure_stack_ptr;
#endif
/* Assume that each path through the pattern can be null until
@@ -3233,11 +4310,32 @@ re_compile_fastmap (bufp)
/* 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,6 +4366,7 @@ re_compile_fastmap (bufp)
if (SYNTAX (j) != Sword)
fastmap[j] = 1;
break;
+#endif /* WCHAR */
case anychar:
@@ -3398,13 +4497,13 @@ re_compile_fastmap (bufp)
case succeed_n:
/* Get to the number of times to succeed. */
- p += 2;
+ p += OFFSET_ADDRESS_SIZE;
/* Increment p past the n for when k != 0. */
EXTRACT_NUMBER_AND_INCR (k, p);
if (k == 0)
{
- p -= 4;
+ p -= 2 * OFFSET_ADDRESS_SIZE;
succeed_n_p = true; /* Spaghetti code alert. */
goto handle_on_failure_jump;
}
@@ -3412,7 +4511,7 @@ re_compile_fastmap (bufp)
case set_number_at:
- p += 4;
+ p += 2 * OFFSET_ADDRESS_SIZE;
continue;
@@ -3443,6 +4542,20 @@ re_compile_fastmap (bufp)
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,11 +4650,84 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
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,6 +4771,80 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
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,9 +4880,9 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
}
else /* Searching backwards. */
{
- register char c = (size1 == 0 || startpos >= size1
- ? string2[startpos - size1]
- : string1[startpos]);
+ register CHAR_T c = (size1 == 0 || startpos >= size1
+ ? string2[startpos - size1]
+ : string1[startpos]);
if (!fastmap[(unsigned char) TRANSLATE (c)])
goto advance;
@@ -3632,10 +4892,24 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
/* 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;
+ {
+#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 */
- val = re_match_2_internal (bufp, string1, size1, string2, size2,
- startpos, regs, stop);
#ifndef REGEX_MALLOC
# ifdef C_ALLOCA
alloca (0);
@@ -3643,10 +4917,20 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
#endif
if (val >= 0)
- return startpos;
+ {
+#ifdef WCHAR
+ FREE_WCS_BUFFERS ();
+#endif
+ return startpos;
+ }
if (val == -2)
- return -2;
+ {
+#ifdef WCHAR
+ FREE_WCS_BUFFERS ();
+#endif
+ return -2;
+ }
advance:
if (!range)
@@ -3662,18 +4946,31 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
startpos--;
}
}
+#ifdef WCHAR
+ FREE_WCS_BUFFERS ();
+#endif
return -1;
+
} /* re_search_2 */
-#ifdef _LIBC
-weak_alias (__re_search_2, re_search_2)
-#endif
-
+
+#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,10 +5000,19 @@ weak_alias (__re_search_2, re_search_2)
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,7 +5025,7 @@ weak_alias (__re_search_2, re_search_2)
/* Free everything we malloc. */
#ifdef MATCH_MAY_ALLOCATE
-# define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL
+# ifdef WCHAR
# define FREE_VARIABLES() \
do { \
REGEX_FREE_STACK (fail_stack.stack); \
@@ -3732,9 +5038,44 @@ weak_alias (__re_search_2, re_search_2)
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,6 +5087,7 @@ weak_alias (__re_search_2, re_search_2)
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,7 +5101,15 @@ re_match (bufp, string, size, pos, regs)
int size, pos;
struct re_registers *regs;
{
- int result = re_match_2_internal (bufp, NULL, 0, string, size,
+ 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,17 +5123,21 @@ weak_alias (__re_match, re_match)
# 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,
+#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,8 +5161,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
struct re_registers *regs;
int stop;
{
- int result = re_match_2_internal (bufp, string1, size1, string2, size2,
- pos, regs, 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,38 +5182,123 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
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
-re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
+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;
- unsigned char *p1;
+ 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 *end1, *end2;
+ const CHAR_T *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;
+ const CHAR_T *end_match_1, *end_match_2;
/* Where we are in the data, and the end of the current string. */
- const char *d, *dend;
+ const CHAR_T *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;
+#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. */
- unsigned char *just_past_start_mem = 0;
+ UCHAR_T *just_past_start_mem = 0;
/* We use this to map every character in the string. */
RE_TRANSLATE_TYPE translate = bufp->translate;
@@ -3866,7 +5313,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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;
+ PREFIX(fail_stack_type) fail_stack;
#endif
#ifdef DEBUG
static unsigned failure_id;
@@ -3896,7 +5343,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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;
+ const CHAR_T **regstart, **regend;
#endif
/* If a group that's operated upon by a repetition operator fails to
@@ -3905,7 +5352,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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;
+ const CHAR_T **old_regstart, **old_regend;
#endif
/* The is_active field of reg_info helps us keep track of which (possibly
@@ -3915,7 +5362,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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;
+ PREFIX(register_info_type) *reg_info;
#endif
/* The following record the register info as found in the above
@@ -3924,7 +5371,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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;
+ const CHAR_T **best_regstart, **best_regend;
#endif
/* Logically, this is `best_regend[0]'. But we don't want to have to
@@ -3935,15 +5382,15 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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;
+ 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 **reg_dummy;
- register_info_type *reg_info_dummy;
+ const CHAR_T **reg_dummy;
+ PREFIX(register_info_type) *reg_info_dummy;
#endif
#ifdef DEBUG
@@ -3963,15 +5410,15 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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);
+ 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,17 +5433,72 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
`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;
+ 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,11 +5521,38 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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,6 +5563,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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,6 +5571,26 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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,6 +5601,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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,9 +5739,18 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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,9 +5783,18 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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,6 +5819,9 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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,9 +5832,23 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
do
{
PREFETCH ();
- if ((unsigned char) translate[(unsigned char) *d++]
- != (unsigned char) *p++)
+#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,7 +5857,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
do
{
PREFETCH ();
- if (*d++ != (char) *p++) goto fail;
+ if (*d++ != (CHAR_T) *p++) goto fail;
}
while (--mcnt);
}
@@ -4298,7 +5884,14 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
case charset:
case charset_not:
{
- register unsigned char c;
+#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,6 +5899,199 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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,7 +6101,8 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
p += 1 + *p;
if (!not) goto fail;
-
+#undef WORK_BUFFER_SIZE
+#endif /* WCHAR */
SET_REGS_MATCHED ();
d++;
break;
@@ -4335,7 +6122,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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);
+ = 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,7 +6197,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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;
+ UCHAR_T r = *p - 1;
while (r > 0 && !IS_ACTIVE (reg_info[r]))
r--;
@@ -4453,7 +6240,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
case dummy_failure_jump:
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
if (is_a_jump_n)
- p1 += 2;
+ p1 += OFFSET_ADDRESS_SIZE;
break;
default:
@@ -4467,7 +6254,8 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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)
+ && (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,7 +6301,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
followed by the numeric value of <digit> as the register number. */
case duplicate:
{
- register const char *d2, *dend2;
+ register const CHAR_T *d2, *dend2;
int regno = *p++; /* Get which register to match against. */
DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno);
@@ -4562,8 +6350,8 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Compare that many; failure if mismatch, else move
past them. */
if (translate
- ? bcmp_translate (d, d2, mcnt, translate)
- : memcmp (d, d2, mcnt))
+ ? PREFIX(bcmp_translate) (d, d2, mcnt, translate)
+ : memcmp (d, d2, mcnt*sizeof(UCHAR_T)))
goto fail;
d += mcnt, d2 += mcnt;
@@ -4719,7 +6507,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
EXTRACT_NUMBER_AND_INCR (mcnt, p);
DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt);
{
- register unsigned char *p2 = p;
+ 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,9 +6532,9 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
&& ((re_opcode_t) *p2 == stop_memory
|| (re_opcode_t) *p2 == start_memory))
p2 += 3;
- else if (p2 + 6 < pend
+ else if (p2 + 2 + 2 * OFFSET_ADDRESS_SIZE < pend
&& (re_opcode_t) *p2 == dummy_failure_jump)
- p2 += 6;
+ p2 += 2 + 2 * OFFSET_ADDRESS_SIZE;
else
break;
}
@@ -4762,24 +6550,39 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Consider what happens when matching ":\(.*\)"
against ":/". I don't really understand this code
yet. */
- p[-3] = (unsigned char) pop_failure_jump;
+ 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 unsigned char c
- = *p2 == (unsigned char) endline ? '\n' : p2[2];
+ register UCHAR_T c
+ = *p2 == (UCHAR_T) endline ? '\n' : p2[2];
- if ((re_opcode_t) p1[3] == exactn && p1[5] != c)
+ 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[-3] = (unsigned char) pop_failure_jump;
- DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
- c, p1[5]);
+ 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,7 +6600,9 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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,11 +6651,12 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
}
}
}
+#endif /* not WCHAR */
}
- p -= 2; /* Point at relative address again. */
+ p -= OFFSET_ADDRESS_SIZE; /* Point at relative address again. */
if ((re_opcode_t) p[-1] != pop_failure_jump)
{
- p[-1] = (unsigned char) jump;
+ p[-1] = (UCHAR_T) jump;
DEBUG_PRINT1 (" Match => jump.\n");
goto unconditional_jump;
}
@@ -4871,8 +6677,8 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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;
+ UCHAR_T *pdummy = NULL;
+ const CHAR_T *sdummy = NULL;
DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n");
POP_FAILURE_POINT (sdummy, pdummy,
@@ -4937,7 +6743,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
/* 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);
+ EXTRACT_NUMBER (mcnt, p + OFFSET_ADDRESS_SIZE);
DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
assert (mcnt >= 0);
@@ -4945,46 +6751,57 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
if (mcnt > 0)
{
mcnt--;
- p += 2;
+ p += OFFSET_ADDRESS_SIZE;
STORE_NUMBER_AND_INCR (p, mcnt);
#ifdef _LIBC
- DEBUG_PRINT3 (" Setting %p to %d.\n", p - 2, mcnt);
+ DEBUG_PRINT3 (" Setting %p to %d.\n", p - OFFSET_ADDRESS_SIZE,
+ mcnt);
#else
- DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p - 2, mcnt);
+ 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+2);
+ 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+2);
+ DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n",
+ p + OFFSET_ADDRESS_SIZE);
#endif
- p[2] = (unsigned char) no_op;
- p[3] = (unsigned char) no_op;
+
+#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 + 2);
+ 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 + 2, mcnt);
+ STORE_NUMBER (p + OFFSET_ADDRESS_SIZE, mcnt);
#ifdef _LIBC
- DEBUG_PRINT3 (" Setting %p to %d.\n", p + 2, mcnt);
+ DEBUG_PRINT3 (" Setting %p to %d.\n", p + OFFSET_ADDRESS_SIZE,
+ mcnt);
#else
- DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p + 2, mcnt);
+ 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 += 4;
+ p += 2 * OFFSET_ADDRESS_SIZE;
break;
case set_number_at:
@@ -5215,13 +7032,13 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
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;
+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. */
- unsigned char *p1 = *p + 2;
+ UCHAR_T *p1 = *p + 2;
while (p1 < end)
{
@@ -5259,14 +7076,16 @@ group_match_null_string_p (p, end, reg_info)
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)
+ while ((re_opcode_t) p1[mcnt-(1+OFFSET_ADDRESS_SIZE)] ==
+ jump_past_alt)
{
/* `mcnt' holds how many bytes long the alternative
is, including the ending `jump_past_alt' and
its number. */
- if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
- reg_info))
+ 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,10 +7101,11 @@ group_match_null_string_p (p, end, reg_info)
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)
+ if ((re_opcode_t) p1[mcnt-(1+OFFSET_ADDRESS_SIZE)] !=
+ jump_past_alt)
{
/* Get to the beginning of the n-th alternative. */
- p1 -= 3;
+ p1 -= 1 + OFFSET_ADDRESS_SIZE;
break;
}
}
@@ -5293,9 +7113,9 @@ group_match_null_string_p (p, end, reg_info)
/* 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);
+ EXTRACT_NUMBER (mcnt, p1 - OFFSET_ADDRESS_SIZE);
- if (!alt_match_null_string_p (p1, p1 + mcnt, reg_info))
+ if (!PREFIX(alt_match_null_string_p) (p1, p1 + mcnt, reg_info))
return false;
p1 += mcnt; /* Get past the n-th alternative. */
@@ -5310,7 +7130,7 @@ group_match_null_string_p (p, end, reg_info)
default:
- if (!common_op_match_null_string_p (&p1, end, reg_info))
+ if (!PREFIX(common_op_match_null_string_p) (&p1, end, reg_info))
return false;
}
} /* while p1 < end */
@@ -5324,12 +7144,12 @@ group_match_null_string_p (p, end, reg_info)
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;
+PREFIX(alt_match_null_string_p) (p, end, reg_info)
+ UCHAR_T *p, *end;
+ PREFIX(register_info_type) *reg_info;
{
int mcnt;
- unsigned char *p1 = p;
+ UCHAR_T *p1 = p;
while (p1 < end)
{
@@ -5346,7 +7166,7 @@ alt_match_null_string_p (p, end, reg_info)
break;
default:
- if (!common_op_match_null_string_p (&p1, end, reg_info))
+ if (!PREFIX(common_op_match_null_string_p) (&p1, end, reg_info))
return false;
}
} /* while p1 < end */
@@ -5361,14 +7181,14 @@ alt_match_null_string_p (p, end, reg_info)
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;
+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;
- unsigned char *p1 = *p;
+ UCHAR_T *p1 = *p;
switch ((re_opcode_t) *p1++)
{
@@ -5391,7 +7211,7 @@ common_op_match_null_string_p (p, end, reg_info)
case start_memory:
reg_no = *p1;
assert (reg_no > 0 && reg_no <= MAX_REGNUM);
- ret = group_match_null_string_p (&p1, end, reg_info);
+ 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,12 +7234,12 @@ common_op_match_null_string_p (p, end, reg_info)
case succeed_n:
/* Get to the number of times to succeed. */
- p1 += 2;
+ p1 += OFFSET_ADDRESS_SIZE;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
if (mcnt == 0)
{
- p1 -= 4;
+ p1 -= 2 * OFFSET_ADDRESS_SIZE;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
p1 += mcnt;
}
@@ -5433,7 +7253,7 @@ common_op_match_null_string_p (p, end, reg_info)
break;
case set_number_at:
- p1 += 4;
+ p1 += 2 * OFFSET_ADDRESS_SIZE;
default:
/* All other opcodes mean we cannot match the empty string. */
@@ -5449,21 +7269,30 @@ common_op_match_null_string_p (p, end, reg_info)
bytes; nonzero otherwise. */
static int
-bcmp_translate (s1, s2, len, translate)
- const char *s1, *s2;
+PREFIX(bcmp_translate) (s1, s2, len, translate)
+ const CHAR_T *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;
+ 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,7 +7324,12 @@ re_compile_pattern (pattern, length, bufp)
/* Match anchors at newline. */
bufp->newline_anchor = 1;
- ret = regex_compile (pattern, length, re_syntax_options, bufp);
+# 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,7 +7384,12 @@ re_comp (s)
/* Match anchors at newlines. */
re_comp_buf.newline_anchor = 1;
- ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
+# 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,7 +7506,12 @@ regcomp (preg, pattern, cflags)
/* 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);
+# 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,3 +7696,73 @@ weak_alias (__regfree, regfree)
#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 --git a/regex.h b/regex.h
index 57719957..955fa04e 100644
--- a/regex.h
+++ b/regex.h
@@ -1,6 +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.
+ 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 --git a/test/ChangeLog b/test/ChangeLog
index aa3b6645..10fc85a8 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,83 @@
+Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.1: Release tar file made.
+
+Tue Apr 16 17:07:25 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * 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 <scottd@amgen.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * Makefile.am (longsub): new test case.
+ * longsub.awk, longsub.in, longsub.ok: new files.
+
+Wed Jan 23 15:03:36 2002 Andreas Buening <andreas.buening@nexgo.de>
+
+ * Makefile.am (PATH_SEPARATOR): Added.
+ (awkpath): Make use of PATH_SEPARATOR.
+
+Wed Jan 23 14:50:38 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (concat1): new test case.
+ * concat1.awk, concat1.in, concat1.ok: new files.
+
+Mon Jan 7 22:21:25 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (forsimp): new test case.
+ * forsimp.awk, forsimp.ok: new files.
+
+Wed Dec 26 22:01:52 2001 Arnold D. Robbins <arnold@skeeve.com>
+
+ * 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 <pjfarley@dorsai.org>
+
+ * Makefile.am (manyfiles): Also delete \15 in tr.
+
+Tue Dec 18 20:56:07 2001 Andreas Buening <andreas.buening@nexgo.de>
+
+ * 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 <arnold@skeeve.com>
+
+ * Makefile.am (membug1): new test case.
+ * membug1.awk, membug1.in, membug1.ok: new files.
+
+Thu Aug 23 14:04:10 2001 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (minusstr): new test case.
+ * minusstr.awk, minusstr.ok: new files.
+
+Sat Aug 4 23:42:37 2001 Arnold D. Robbins <arnold@skeeve.com>
+
+ * 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 <arnold@skeeve.com>
+
+ * Makefile.am (onlynl): new test case.
+ * onlynl.awk, onlynl.in, onlynl.ok: new files.
+
+Wed Jun 13 18:12:43 2001 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (ofmtfidl): new test case.
+ * ofmtfidl.awk, ofmtfidl.in, ofmtfidl.ok: new files.
+
Sun Jun 3 13:04:44 2001 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.0: Release tar file made. And there was
diff --git a/test/Makefile.am b/test/Makefile.am
index e1dbdfd8..be4acada 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,7 +1,7 @@
#
# test/Makefile.am --- automake input file for gawk
#
-# Copyright (C) 1988-2001 the Free Software Foundation, Inc.
+# Copyright (C) 1988-2002 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
@@ -49,6 +49,8 @@ EXTRA_DIST = \
arynocls.ok \
arysubnm.awk \
arysubnm.ok \
+ arrymem1.awk \
+ arrymem1.ok \
asgext.awk \
asgext.in \
asgext.ok \
@@ -70,6 +72,11 @@ EXTRA_DIST = \
compare.awk \
compare.in \
compare.ok \
+ compare2.awk \
+ compare2.ok \
+ concat1.awk \
+ concat1.in \
+ concat1.ok \
convfmt.awk \
convfmt.ok \
datanonl.awk \
@@ -106,6 +113,8 @@ EXTRA_DIST = \
fnasgnm.ok \
fnparydl.awk \
fnparydl.ok \
+ forsimp.awk \
+ forsimp.ok \
fsbs.in \
fsbs.ok \
fsfwfs.awk \
@@ -172,13 +181,21 @@ EXTRA_DIST = \
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,9 +240,15 @@ EXTRA_DIST = \
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,27 +373,32 @@ EXTRA_DIST = \
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
+ extend-msg-start gawk-extensions extend-msg-end \
+ pass-fail
# 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
+ 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,7 +492,7 @@ 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.awk
+ AWK=`pwd`/$(AWK) $(srcdir)/regtest.sh
posix::
@echo '1:2,3 4' | $(AWK) -f $(srcdir)/posix.awk >_$@
@@ -475,7 +503,7 @@ manyfiles::
@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'
+ @echo "This number better be 1 ->" | tr -d '\012\015'
@wc -l junk/* | $(AWK) '$$1 != 2' | wc -l
@rm -rf junk _$@
@@ -497,7 +525,7 @@ fsbs::
inftest::
@echo This test is very machine specific...
- @$(AWK) -f $(srcdir)/inftest.awk >_$@
+ @$(AWK) -f $(srcdir)/inftest.awk | sed 's/inf/Inf/g' >_$@
-$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@
getline::
@@ -525,7 +553,7 @@ splitargv::
-$(CMP) $(srcdir)/splitargv.ok _$@ && rm -f _$@
awkpath::
- @AWKPATH="$(srcdir):$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@
+ @AWKPATH="$(srcdir)$(PATH_SEPARATOR)$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@
-$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@
nfset::
@@ -572,6 +600,7 @@ 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
@@ -750,7 +779,7 @@ nfldstr::
-$(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 '\12\15' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@
-$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@
fnarydel::
@@ -1024,9 +1053,53 @@ 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 _* ; \
diff --git a/test/Makefile.in b/test/Makefile.in
index a02467ee..a05e0e45 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4a from Makefile.am
+# Makefile.in generated automatically by automake 1.5 from Makefile.am.
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# 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,
@@ -11,6 +11,31 @@
# 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@
@@ -31,11 +56,9 @@ infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-
top_builddir = ..
ACLOCAL = @ACLOCAL@
@@ -47,44 +70,45 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_FLAG =
+INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
-
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-
-@SET_MAKE@
-AMDEP = @AMDEP@
+host_alias = @host_alias@
+host_triplet = @host@
AMTAR = @AMTAR@
-CATALOGS = @CATALOGS@
+BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CFLAGS = @CFLAGS@
CPP = @CPP@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
+EXEEXT = @EXEEXT@
GENCAT = @GENCAT@
-GMOFILES = @GMOFILES@
+GLIBC21 = @GLIBC21@
GMSGFMT = @GMSGFMT@
-GT_NO = @GT_NO@
-GT_YES = @GT_YES@
-INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
+HAVE_LIB = @HAVE_LIB@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
-INTLDEPS = @INTLDEPS@
+INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
+LIB = @LIB@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
LN_S = @LN_S@
-MAKEINFO = @MAKEINFO@
+LTLIB = @LTLIB@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
+OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
-POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
SOCKET_LIBS = @SOCKET_LIBS@
@@ -93,32 +117,13 @@ 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@
-l = @l@
-
-#
-# 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.
-#
-# 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
-#
+AWK = ../gawk
+# Special stuff for OS/2
+PATH_SEPARATOR = @PATH_SEPARATOR@
EXTRA_DIST = \
reg \
@@ -146,6 +151,8 @@ EXTRA_DIST = \
arynocls.ok \
arysubnm.awk \
arysubnm.ok \
+ arrymem1.awk \
+ arrymem1.ok \
asgext.awk \
asgext.in \
asgext.ok \
@@ -167,6 +174,11 @@ EXTRA_DIST = \
compare.awk \
compare.in \
compare.ok \
+ compare2.awk \
+ compare2.ok \
+ concat1.awk \
+ concat1.in \
+ concat1.ok \
convfmt.awk \
convfmt.ok \
datanonl.awk \
@@ -203,6 +215,8 @@ EXTRA_DIST = \
fnasgnm.ok \
fnparydl.awk \
fnparydl.ok \
+ forsimp.awk \
+ forsimp.ok \
fsbs.in \
fsbs.ok \
fsfwfs.awk \
@@ -269,13 +283,21 @@ EXTRA_DIST = \
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 \
@@ -320,9 +342,15 @@ EXTRA_DIST = \
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 \
@@ -446,36 +474,39 @@ EXTRA_DIST = \
CMP = cmp
-AWK = ../gawk
subdir = test
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-DIST_SOURCES =
-DIST_COMMON = README ChangeLog Makefile.am Makefile.in
-
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+DIST_COMMON = README ChangeLog Makefile.am Makefile.in
+all: all-am
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-GZIP_ENV = --best
-all: all-redirect
.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_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
+$(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:
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
- d=$(srcdir); \
+ 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; \
@@ -485,89 +516,103 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-exec-am:
-install-exec: install-exec-am
+all-am: Makefile
-install-data-am:
-install-data: install-data-am
+installdirs:
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
-uninstall-am:
+install-exec: install-exec-am
+install-data: install-data-am
uninstall: uninstall-am
-all-am: Makefile
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
-installdirs:
+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)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
maintainer-clean-generic:
- -rm -f Makefile.in
-mostlyclean-am: mostlyclean-generic
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
-mostlyclean: mostlyclean-am
+clean-am: clean-generic mostlyclean-am
-clean-am: clean-generic mostlyclean-am
+distclean: distclean-am
-clean: clean-am
+distclean-am: clean-am distclean-generic
-distclean-am: distclean-generic clean-am
+dvi: dvi-am
-distclean: distclean-am
+dvi-am:
-maintainer-clean-am: maintainer-clean-generic distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+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
-.PHONY: tags distdir info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all install-strip installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+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
+ extend-msg-start gawk-extensions extend-msg-end \
+ pass-fail
# 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
+ 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
@@ -660,7 +705,7 @@ 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.awk
+ AWK=`pwd`/$(AWK) $(srcdir)/regtest.sh
posix::
@echo '1:2,3 4' | $(AWK) -f $(srcdir)/posix.awk >_$@
@@ -671,7 +716,7 @@ manyfiles::
@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'
+ @echo "This number better be 1 ->" | tr -d '\012\015'
@wc -l junk/* | $(AWK) '$$1 != 2' | wc -l
@rm -rf junk _$@
@@ -693,7 +738,7 @@ fsbs::
inftest::
@echo This test is very machine specific...
- @$(AWK) -f $(srcdir)/inftest.awk >_$@
+ @$(AWK) -f $(srcdir)/inftest.awk | sed 's/inf/Inf/g' >_$@
-$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@
getline::
@@ -721,7 +766,7 @@ splitargv::
-$(CMP) $(srcdir)/splitargv.ok _$@ && rm -f _$@
awkpath::
- @AWKPATH="$(srcdir):$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@
+ @AWKPATH="$(srcdir)$(PATH_SEPARATOR)$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@
-$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@
nfset::
@@ -768,6 +813,7 @@ 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
@@ -946,7 +992,7 @@ nfldstr::
-$(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 '\12\15' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@
-$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@
fnarydel::
@@ -1220,9 +1266,53 @@ 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 _* ; \
@@ -1230,7 +1320,6 @@ diffout:
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 --git a/test/arrymem1.awk b/test/arrymem1.awk
new file mode 100644
index 00000000..561cc956
--- /dev/null
+++ b/test/arrymem1.awk
@@ -0,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 <arobbins@actcom.co.il>;
+# 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 <arobbins@actcom.co.il>; 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 <arnold@skeeve.com>; 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 <bug-gawk@gnu.org>; Wed, 13 Jun 2001 23:34:38 -0400
+# Date: Wed, 13 Jun 2001 20:32:42 -0700
+# From: "John H. DuBois III" <spcecdt@armory.com>
+# 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 --git a/test/arrymem1.ok b/test/arrymem1.ok
new file mode 100644
index 00000000..9daeafb9
--- /dev/null
+++ b/test/arrymem1.ok
@@ -0,0 +1 @@
+test
diff --git a/test/badargs.ok b/test/badargs.ok
index b6f9cfea..443edc7c 100644
--- a/test/badargs.ok
+++ b/test/badargs.ok
@@ -25,3 +25,10 @@ POSIX options: GNU long options:
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 --git a/test/compare2.awk b/test/compare2.awk
new file mode 100644
index 00000000..f2c2786e
--- /dev/null
+++ b/test/compare2.awk
@@ -0,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 <arobbins@actcom.co.il>;
+# 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 <arobbins@actcom.co.il>; 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 <arnold@skeeve.com>; 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 <arnold@gnu.org>; 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" <beebe@math.utah.edu>
+# 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: <CMM.0.92.0.996755823.beebe@suncore.math.utah.edu>
+# 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 --git a/test/compare2.ok b/test/compare2.ok
new file mode 100644
index 00000000..fd1043a3
--- /dev/null
+++ b/test/compare2.ok
@@ -0,0 +1 @@
+OK: zero strings compare equal to number zero
diff --git a/test/concat1.awk b/test/concat1.awk
new file mode 100644
index 00000000..6e77846a
--- /dev/null
+++ b/test/concat1.awk
@@ -0,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" <deep@cicada-semi.com>
+#To: <bug-gawk@gnu.org>
+#Subject: gawk version 3.1.0 will not print a ";"
+#Date: Tue, 22 Jan 2002 17:23:57 -0600
+#Message-ID: <NCBBLGONGLINHCDGFCPNOENHCOAA.deep@cicada-semi.com>
+#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 --git a/test/concat1.in b/test/concat1.in
new file mode 100644
index 00000000..8422d40f
--- /dev/null
+++ b/test/concat1.in
@@ -0,0 +1,4 @@
+A
+B
+C
+D
diff --git a/test/concat1.ok b/test/concat1.ok
new file mode 100644
index 00000000..b0aad60e
--- /dev/null
+++ b/test/concat1.ok
@@ -0,0 +1,4 @@
+Input = A ;
+Input = B ;
+Input = C ;
+Input = D ;
diff --git a/test/forsimp.awk b/test/forsimp.awk
new file mode 100644
index 00000000..880548ba
--- /dev/null
+++ b/test/forsimp.awk
@@ -0,0 +1 @@
+BEGIN { for (print 9; 0;); }
diff --git a/test/forsimp.ok b/test/forsimp.ok
new file mode 100644
index 00000000..ec635144
--- /dev/null
+++ b/test/forsimp.ok
@@ -0,0 +1 @@
+9
diff --git a/test/lint.ok b/test/lint.ok
index ec24d831..fb6e3dfc 100644
--- a/test/lint.ok
+++ b/test/lint.ok
@@ -1,5 +1,5 @@
-gawk: lint.awk:7: warning: delete: index `2' not in array `a'
+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:11: warning: delete: index `4' not in array `a'
+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 --git a/test/longsub.awk b/test/longsub.awk
new file mode 100644
index 00000000..07a4a85f
--- /dev/null
+++ b/test/longsub.awk
@@ -0,0 +1 @@
+{sub( "^.*AA", "BB"); print}
diff --git a/test/longsub.in b/test/longsub.in
new file mode 100644
index 00000000..ab95ee1f
--- /dev/null
+++ b/test/longsub.in
@@ -0,0 +1 @@
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
diff --git a/test/longsub.ok b/test/longsub.ok
new file mode 100644
index 00000000..a85633e2
--- /dev/null
+++ b/test/longsub.ok
@@ -0,0 +1 @@
+BB000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
diff --git a/test/membug1.awk b/test/membug1.awk
new file mode 100644
index 00000000..cb769581
--- /dev/null
+++ b/test/membug1.awk
@@ -0,0 +1 @@
+{ one != one = $1 }
diff --git a/test/membug1.in b/test/membug1.in
new file mode 100644
index 00000000..af7e09de
--- /dev/null
+++ b/test/membug1.in
@@ -0,0 +1,2 @@
+yes
+yes
diff --git a/test/membug1.ok b/test/membug1.ok
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/membug1.ok
diff --git a/test/minusstr.awk b/test/minusstr.awk
new file mode 100644
index 00000000..d427719f
--- /dev/null
+++ b/test/minusstr.awk
@@ -0,0 +1 @@
+BEGIN { print-"6" }
diff --git a/test/minusstr.ok b/test/minusstr.ok
new file mode 100644
index 00000000..3cfb5efd
--- /dev/null
+++ b/test/minusstr.ok
@@ -0,0 +1 @@
+-6
diff --git a/test/noeffect.ok b/test/noeffect.ok
index 792ff66a..ea2d0965 100644
--- a/test/noeffect.ok
+++ b/test/noeffect.ok
@@ -1,4 +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'
+gawk: noeffect.awk:3: warning: reference to uninitialized variable `s'
diff --git a/test/ofmtfidl.awk b/test/ofmtfidl.awk
new file mode 100644
index 00000000..67f173c8
--- /dev/null
+++ b/test/ofmtfidl.awk
@@ -0,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 <arobbins@actcom.co.il>;
+# 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 <arobbins@actcom.co.il>; 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 <arnold@skeeve.com>; 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 <bug-gawk@gnu.org>; 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 <drj@pobox.com>
+# Subject: 3.1.0 core dumps. Fiddling with OFMT?
+# Date: Wed, 13 Jun 2001 14:45:54 +0000
+# From: David Jones <djones@zoonami.com>
+# 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 --git a/test/ofmtfidl.in b/test/ofmtfidl.in
new file mode 100644
index 00000000..f00c965d
--- /dev/null
+++ b/test/ofmtfidl.in
@@ -0,0 +1,10 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
diff --git a/test/ofmtfidl.ok b/test/ofmtfidl.ok
new file mode 100644
index 00000000..f00c965d
--- /dev/null
+++ b/test/ofmtfidl.ok
@@ -0,0 +1,10 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
diff --git a/test/onlynl.awk b/test/onlynl.awk
new file mode 100644
index 00000000..97a8d94b
--- /dev/null
+++ b/test/onlynl.awk
@@ -0,0 +1,2 @@
+BEGIN { RS = "" }
+{ print "got", $0 }
diff --git a/test/onlynl.in b/test/onlynl.in
new file mode 100644
index 00000000..fd40910d
--- /dev/null
+++ b/test/onlynl.in
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/test/onlynl.ok b/test/onlynl.ok
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/onlynl.ok
diff --git a/test/prmarscl.ok b/test/prmarscl.ok
index 41784fdc..1c8db51e 100644
--- a/test/prmarscl.ok
+++ b/test/prmarscl.ok
@@ -1 +1 @@
-gawk: prmarscl.awk:4: fatal: attempt to use scalar parameter `a' as an array
+gawk: prmarscl.awk:3: fatal: attempt to use scalar parameter `a' as an array
diff --git a/test/reg/func2.good b/test/reg/func2.good
index ae87bc3d..3d7b5bae 100644
--- a/test/reg/func2.good
+++ b/test/reg/func2.good
@@ -1,2 +1,2 @@
-gawk: reg/func2.awk:2: fatal: function `dummy' called with space between name and (,
+gawk: reg/func2.awk:2: fatal: function `dummy' called with space between name and `(',
or used in other expression context
diff --git a/unsupported/atari/ChangeLog b/unsupported/atari/ChangeLog
index 3e13117e..8a93397a 100644
--- a/unsupported/atari/ChangeLog
+++ b/unsupported/atari/ChangeLog
@@ -1,3 +1,7 @@
+Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.1: Release tar file made.
+
Sun Jun 3 13:04:44 2001 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.0: Release tar file made. And there was
diff --git a/unsupported/atari/gawkmisc.atr b/unsupported/atari/gawkmisc.atr
index 85bfa29d..f4ee1fc1 100644
--- a/unsupported/atari/gawkmisc.atr
+++ b/unsupported/atari/gawkmisc.atr
@@ -1,5 +1,5 @@
/*
- * gawkmisc.atr --- miscellanious gawk routines that are OS specific.
+ * gawkmisc.atr --- miscellaneous gawk routines that are OS specific.
*/
/*
@@ -94,13 +94,12 @@ struct stat *stb;
* 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))
+ if (fd == 0)
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 */
+ if (S_ISREG(stb->st_mode)
+ && 0 < stb->st_size && stb->st_size < DEFBLKSIZE) /* small file */
return stb->st_size;
return DEFBLKSIZE;
}
diff --git a/unsupported/tandem/ChangeLog b/unsupported/tandem/ChangeLog
index 9447e874..f0af15b7 100644
--- a/unsupported/tandem/ChangeLog
+++ b/unsupported/tandem/ChangeLog
@@ -1,3 +1,7 @@
+Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.1: Release tar file made.
+
Sun Jun 3 13:04:44 2001 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.0: Release tar file made. And there was
diff --git a/vms/ChangeLog b/vms/ChangeLog
index d7745d3c..162b2fb5 100644
--- a/vms/ChangeLog
+++ b/vms/ChangeLog
@@ -1,3 +1,16 @@
+Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.1: Release tar file made.
+
+Wed Apr 17 15:57:30 2002 Pat Rankin <rankin@eql.caltech.edu>
+
+ * 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 <rankin@eql.caltech.edu>
+
+ * redirect.h (tzset): Declare.
+
Sun Jun 3 13:04:44 2001 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.0: Release tar file made. And there was
diff --git a/vms/descrip.mms b/vms/descrip.mms
index 98024abb..c9e979d2 100644
--- a/vms/descrip.mms
+++ b/vms/descrip.mms
@@ -120,7 +120,7 @@ DOCS= $(DOCDIR)gawk.1,$(DOCDIR)gawk.texi,$(DOCDIR)texinfo.tex
# Release of gawk
REL=3.1
-PATCHLVL=0
+PATCHLVL=1
# generic target
all : gawk
diff --git a/vms/redirect.h b/vms/redirect.h
index 1ef3f061..707e2a28 100644
--- a/vms/redirect.h
+++ b/vms/redirect.h
@@ -115,6 +115,7 @@ extern int dup P((int));
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 --git a/vms/vms-conf.h b/vms/vms-conf.h
index 555178d3..92794d2d 100644
--- a/vms/vms-conf.h
+++ b/vms/vms-conf.h
@@ -7,7 +7,7 @@
*/
/*
- * Copyright (C) 1991-1992, 1995-1996, 1999, 2001 the Free Software Foundation, Inc.
+ * 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,7 +298,7 @@
#define PACKAGE "gawk"
/* Version number of package */
-#define VERSION "3.0.93"
+#define VERSION "3.1.1"
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
diff --git a/vms/vmsbuild.com b/vms/vmsbuild.com
index 1501c85a..206ec37a 100644
--- a/vms/vmsbuild.com
+++ b/vms/vmsbuild.com
@@ -6,9 +6,10 @@ $! gawk 2.15 revised, Oct'93
$! 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 = "0"
+$ PATCHLVL = "1"
$!
$!
$ CCFLAGS = "/noList" ! "/noOpt/Debug"
diff --git a/vms/vmstest.com b/vms/vmstest.com
index af38e162..6bff4e22 100644
--- a/vms/vmstest.com
+++ b/vms/vmstest.com
@@ -49,6 +49,9 @@ $ basic_lst2 = "nlfldsep splitvar intest nfldstr nors" -
+ " 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,6 +61,10 @@ $basic_loop2: basic_test = f$element(0," ",basic_lst2)
$ 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,12 +381,22 @@ $strftime: echo "strftime"
$ ! 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}"
+$ 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;*
+$ if $status then rm tmp.;,strftime.ok;*,strftime.in;*
$ set On
$ return
$
@@ -636,6 +653,7 @@ $ return
$
$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,7 +1015,7 @@ BEGIN { print "" |& "/inet/udp/0/127.0.0.1/13";
$ set On
$ return
$
-$inetdayt: echo "netdayt"
+$inetdayt: echo "inetdayt"
$ echo "this test is for bidirectional TCP transmission"
$ set noOn
$ gawk -f - nl:
@@ -1096,6 +1114,88 @@ $ cmp gnuops2.ok tmp.
$ 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 --git a/ylwrap b/ylwrap
new file mode 100755
index 00000000..5ea68e4f
--- /dev/null
+++ b/ylwrap
@@ -0,0 +1,143 @@
+#! /bin/sh
+# ylwrap - wrapper for lex/yacc invocations.
+# Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# 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