summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorwiz <wiz@NetBSD.org>2003-10-06 15:43:45 +0000
committerwiz <wiz@NetBSD.org>2003-10-06 15:43:45 +0000
commitb83f0ec8299370bbca9177e5b2e7778fdb67be12 (patch)
treee9652f2574948bef1fb5f541c360039fe1ef2216 /gnu
parentdf011fda1deaf1967934e10c9a26bf9fb9c67410 (diff)
Initial import of gawk-3.1.3.
Seven releases since the last import, so the ChangeLog is quite big; please refer to the NEWS file included in the import for details. Among others, this also addresses PR 23054.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/dist/gawk/FUTURES97
-rw-r--r--gnu/dist/gawk/POSIX.STD10
-rw-r--r--gnu/dist/gawk/PROBLEMS7
-rw-r--r--gnu/dist/gawk/README_d/README.FIRST2
-rw-r--r--gnu/dist/gawk/README_d/README.VMS26
-rw-r--r--gnu/dist/gawk/README_d/README.aix6
-rw-r--r--gnu/dist/gawk/README_d/README.atari5
-rw-r--r--gnu/dist/gawk/README_d/README.beos86
-rw-r--r--gnu/dist/gawk/README_d/README.hpux43
-rw-r--r--gnu/dist/gawk/README_d/README.ia6430
-rw-r--r--gnu/dist/gawk/README_d/README.linux10
-rw-r--r--gnu/dist/gawk/README_d/README.macos14
-rw-r--r--gnu/dist/gawk/README_d/README.multibyte22
-rw-r--r--gnu/dist/gawk/README_d/README.pc153
-rw-r--r--gnu/dist/gawk/README_d/README.pcdynamic93
-rw-r--r--gnu/dist/gawk/README_d/README.sco48
-rw-r--r--gnu/dist/gawk/README_d/README.sgi34
-rw-r--r--gnu/dist/gawk/README_d/README.solaris119
-rw-r--r--gnu/dist/gawk/README_d/README.sony1
-rw-r--r--gnu/dist/gawk/README_d/README.sunos42
-rw-r--r--gnu/dist/gawk/README_d/README.tandem33
-rw-r--r--gnu/dist/gawk/README_d/README.tests46
-rw-r--r--gnu/dist/gawk/README_d/README.ultrix19
-rw-r--r--gnu/dist/gawk/README_d/README.yacc2
-rw-r--r--gnu/dist/gawk/awkgram.y3230
-rw-r--r--gnu/dist/gawk/awklib/ChangeLog70
-rw-r--r--gnu/dist/gawk/awklib/Makefile.am79
-rw-r--r--gnu/dist/gawk/awklib/Makefile.in527
-rw-r--r--gnu/dist/gawk/awklib/eg/data/guide-mellow.po8
-rw-r--r--gnu/dist/gawk/awklib/eg/data/guide.po8
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/assert.awk4
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/bits2str.awk16
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/cliff_rand.awk14
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/ftrans.awk4
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/getopt.awk20
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/gettime.awk17
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/grcat.c27
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/groupawk.in13
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/join.awk3
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/libintl.awk14
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/nextfile.awk3
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/noassign.awk17
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/ord.awk18
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/passwdawk.in11
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/pwcat.c25
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/readable.awk16
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/rewind.awk20
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/round.awk6
-rw-r--r--gnu/dist/gawk/awklib/eg/lib/zerofile.awk19
-rw-r--r--gnu/dist/gawk/awklib/eg/misc/findpat.awk10
-rw-r--r--gnu/dist/gawk/awklib/eg/network/PostAgent.sh9
-rw-r--r--gnu/dist/gawk/awklib/eg/network/coreserv.awk113
-rw-r--r--gnu/dist/gawk/awklib/eg/network/eliza.awk270
-rw-r--r--gnu/dist/gawk/awklib/eg/network/fingerclient.awk7
-rw-r--r--gnu/dist/gawk/awklib/eg/network/geturl.awk24
-rw-r--r--gnu/dist/gawk/awklib/eg/network/hello-serv.awk14
-rw-r--r--gnu/dist/gawk/awklib/eg/network/maze.awk73
-rw-r--r--gnu/dist/gawk/awklib/eg/network/mobag.awk72
-rw-r--r--gnu/dist/gawk/awklib/eg/network/panic.awk18
-rw-r--r--gnu/dist/gawk/awklib/eg/network/protbase.awk11
-rw-r--r--gnu/dist/gawk/awklib/eg/network/protbase.request7
-rw-r--r--gnu/dist/gawk/awklib/eg/network/protbase.result9
-rw-r--r--gnu/dist/gawk/awklib/eg/network/remconf.awk54
-rw-r--r--gnu/dist/gawk/awklib/eg/network/statist.awk85
-rw-r--r--gnu/dist/gawk/awklib/eg/network/stoxdata.txt4
-rw-r--r--gnu/dist/gawk/awklib/eg/network/stoxpred.awk116
-rw-r--r--gnu/dist/gawk/awklib/eg/network/testserv.awk12
-rw-r--r--gnu/dist/gawk/awklib/eg/network/urlchk.awk28
-rw-r--r--gnu/dist/gawk/awklib/eg/network/webgrab.awk6
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/alarm.awk12
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/awksed.awk4
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/cut.awk15
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/dupword.awk11
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/egrep.awk28
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/extract.awk11
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/guide.awk7
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/histsort.awk5
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/id.awk44
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/igawk.sh87
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/labels.awk11
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/split.awk10
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/tee.awk3
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/testbits.awk27
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/translate.awk7
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/uniq.awk9
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/wc.awk7
-rw-r--r--gnu/dist/gawk/awklib/eg/prog/wordfreq.awk13
-rw-r--r--gnu/dist/gawk/awklib/extract.awk11
-rw-r--r--gnu/dist/gawk/bisonfix.sed3
-rwxr-xr-xgnu/dist/gawk/config.guess1391
-rwxr-xr-xgnu/dist/gawk/config.rpath548
-rwxr-xr-xgnu/dist/gawk/config.sub1489
-rw-r--r--gnu/dist/gawk/configh.in517
-rwxr-xr-xgnu/dist/gawk/configure14413
-rw-r--r--gnu/dist/gawk/configure.ac244
-rw-r--r--gnu/dist/gawk/custom.h65
-rwxr-xr-xgnu/dist/gawk/depcomp464
-rw-r--r--gnu/dist/gawk/doc/ChangeLog284
-rw-r--r--gnu/dist/gawk/doc/Makefile.am105
-rw-r--r--gnu/dist/gawk/doc/Makefile.in551
-rw-r--r--gnu/dist/gawk/doc/texinfo.tex5940
-rw-r--r--gnu/dist/gawk/eval_p.c29
-rw-r--r--gnu/dist/gawk/ext.c191
-rw-r--r--gnu/dist/gawk/extension/Makefile.pc55
-rw-r--r--gnu/dist/gawk/extension/arrayparm.c91
-rw-r--r--gnu/dist/gawk/extension/dl.c98
-rwxr-xr-xgnu/dist/gawk/extension/doit1
-rw-r--r--gnu/dist/gawk/extension/filefuncs.c343
-rw-r--r--gnu/dist/gawk/extension/foo.awk9
-rw-r--r--gnu/dist/gawk/extension/fork.c107
-rw-r--r--gnu/dist/gawk/extension/ordchr.c108
-rw-r--r--gnu/dist/gawk/extension/pcext.def2
-rw-r--r--gnu/dist/gawk/extension/readfile.c117
-rwxr-xr-xgnu/dist/gawk/extension/steps17
-rw-r--r--gnu/dist/gawk/extension/testarrayparm.awk10
-rw-r--r--gnu/dist/gawk/extension/testff.awk30
-rw-r--r--gnu/dist/gawk/extension/testfork.awk20
-rw-r--r--gnu/dist/gawk/extension/testordchr.awk6
-rw-r--r--gnu/dist/gawk/field.c561
-rwxr-xr-xgnu/dist/gawk/fixvers58
-rw-r--r--gnu/dist/gawk/gawkmisc.c33
-rw-r--r--gnu/dist/gawk/getopt.h118
-rw-r--r--gnu/dist/gawk/getopt1.c29
-rw-r--r--gnu/dist/gawk/gettext.h77
-rwxr-xr-xgnu/dist/gawk/install-sh148
-rwxr-xr-xgnu/dist/gawk/mkinstalldirs111
-rw-r--r--gnu/dist/gawk/msg.c79
-rw-r--r--gnu/dist/gawk/node.c249
-rw-r--r--gnu/dist/gawk/patchlev.h3
-rw-r--r--gnu/dist/gawk/po/ChangeLog42
-rw-r--r--gnu/dist/gawk/po/LINGUAS10
-rw-r--r--gnu/dist/gawk/po/Makefile.in.in353
-rw-r--r--gnu/dist/gawk/po/Makevars41
-rw-r--r--gnu/dist/gawk/po/POTFILES.in25
-rw-r--r--gnu/dist/gawk/po/Rules-quot42
-rw-r--r--gnu/dist/gawk/po/boldquot.sed10
-rw-r--r--gnu/dist/gawk/po/ca.gmobin0 -> 35138 bytes
-rw-r--r--gnu/dist/gawk/po/ca.po1863
-rw-r--r--gnu/dist/gawk/po/da.gmobin0 -> 33520 bytes
-rw-r--r--gnu/dist/gawk/po/da.po1842
-rw-r--r--gnu/dist/gawk/po/de.gmobin0 -> 33081 bytes
-rw-r--r--gnu/dist/gawk/po/de.po1865
-rw-r--r--gnu/dist/gawk/po/en@boldquot.header25
-rw-r--r--gnu/dist/gawk/po/en@quot.header22
-rw-r--r--gnu/dist/gawk/po/es.gmobin0 -> 41045 bytes
-rw-r--r--gnu/dist/gawk/po/es.po1872
-rw-r--r--gnu/dist/gawk/po/fr.gmobin0 -> 41241 bytes
-rw-r--r--gnu/dist/gawk/po/fr.po1866
-rw-r--r--gnu/dist/gawk/po/gawk.pot1695
-rw-r--r--gnu/dist/gawk/po/he.gmobin0 -> 33710 bytes
-rw-r--r--gnu/dist/gawk/po/he.po1830
-rw-r--r--gnu/dist/gawk/po/insert-header.sin23
-rw-r--r--gnu/dist/gawk/po/it.gmobin0 -> 39787 bytes
-rw-r--r--gnu/dist/gawk/po/it.po1761
-rw-r--r--gnu/dist/gawk/po/pt_BR.gmobin0 -> 39118 bytes
-rw-r--r--gnu/dist/gawk/po/pt_BR.po1766
-rw-r--r--gnu/dist/gawk/po/quot.sed6
-rw-r--r--gnu/dist/gawk/po/remove-potcdate.sin19
-rw-r--r--gnu/dist/gawk/po/stamp-po1
-rw-r--r--gnu/dist/gawk/po/sv.gmobin0 -> 38453 bytes
-rw-r--r--gnu/dist/gawk/po/sv.po1844
-rw-r--r--gnu/dist/gawk/po/tr.gmobin0 -> 40702 bytes
-rw-r--r--gnu/dist/gawk/po/tr.po1836
-rw-r--r--gnu/dist/gawk/posix/ChangeLog80
-rw-r--r--gnu/dist/gawk/posix/gawkmisc.c156
-rw-r--r--gnu/dist/gawk/profile.c1471
-rw-r--r--gnu/dist/gawk/profile_p.c29
-rw-r--r--gnu/dist/gawk/protos.h5
-rw-r--r--gnu/dist/gawk/random.c674
-rw-r--r--gnu/dist/gawk/random.h17
-rw-r--r--gnu/dist/gawk/re.c253
-rw-r--r--gnu/dist/gawk/regcomp.c3561
-rw-r--r--gnu/dist/gawk/regex.c5751
-rw-r--r--gnu/dist/gawk/regex.h127
-rw-r--r--gnu/dist/gawk/regex_internal.c1268
-rw-r--r--gnu/dist/gawk/regex_internal.h755
-rw-r--r--gnu/dist/gawk/regexec.c3985
-rw-r--r--gnu/dist/gawk/replace.c72
-rw-r--r--gnu/dist/gawk/version.c10
-rw-r--r--gnu/dist/gawk/version.in56
-rwxr-xr-xgnu/dist/gawk/ylwrap160
181 files changed, 62925 insertions, 11239 deletions
diff --git a/gnu/dist/gawk/FUTURES b/gnu/dist/gawk/FUTURES
index 13a312c133b..ee1858e7d43 100644
--- a/gnu/dist/gawk/FUTURES
+++ b/gnu/dist/gawk/FUTURES
@@ -10,99 +10,82 @@ know where to get it.")
The focus on the future is thus narrowed to performance and functional
enhancements, with only minor plans for significant new features.
-For 3.0
-=======
- DONE: Move to autoconf-based configure system.
-
- DONE: Allow RS to be a regexp.
-
- DONE: RT variable to hold text of record terminator
-
- DONE: split() with null string as third arg to split up strings
+(OK, so 3.1 had a bad case of feature-itis. I think I'm mostly over it
+now, though. :-)
- DONE: Analogously, setting FS="" would split the input record into
- individual characters.
+In 3.1
+======
+ DONE: A PROCINFO array to replace /dev/pid, /dev/user, et al.
- DONE: Generalize IGNORECASE
- - any value makes it work, not just numeric non-zero
- - make it apply to *all* string comparisons
+ DONE: Provide awk profiling.
- DONE: Incorporate newer dfa.c and regex.c
+ DONE: Integrate GNU NLS support.
- DONE: Go to POSIX regexps
+ DONE: Bring out hooks for NLS support into gawk itself.
- DONE: Make regex + dfa less dependant on gawk header file includes
+ DONE: Do a reference card.
- DONE: Source code formatting cleaned up and regularized
+ DONE: Switch to full ANSI C and use ansi2kr.
- DONE: Clean up code by isolating system-specific functions in
- separate files.
+ Additional manual features:
+ DONE: Document NLS support
- DONE: General sub function:
- gensub(pat, sub, global_flag[, line])
- that return the substituted strings and allow \1 etc.
- in the sub string.
+ DONE: Use a new or improved dfa and/or regex library.
- DONE: Add AWKPATH to ENVIRON if it's not there
+For 3.2
+=======
+ Simplify awk.h.
- DONE: Undertake significant directory reorganization.
+ Consider moving var_value info into Node_var itself
+ to reduce memory usage.
- DONE: Extensive manual cleanup:
- Use of texinfo 2.0 features
- Lots more examples
- Document posix regexps
- Document all of the above.
+ Add IPv6 support.
-In 3.1
-======
- A PROCINFO array to replace /dev/pid, /dev/user, et al.
+ Look at ISO C 99 printf features.
- DONE: Use mmap to read input files on systems that support it.
+ Add %'d for putting in commas in formatting?
- Add `abort' statement a la Thompson awk.
+ Consider integrating Fred Fish's DBUG library into gawk.
- Consider removing use of and/or need for the protos.h file.
+ Move the loadable modules interface to libtool.
- Use a new or improved dfa.
+ Redo the loadable modules interface from the awk level.
- Integrate GNU NLS support.
+ Rework management of array index storage.
- Bring out hooks for NLS support into gawk itself.
+ A RECLEN variable for fixed-length record input. PROCINFO["RS"]
+ would be "RS" or "RECLEN" depending upon what's in use.
DBM storage of awk arrays. Try to allow multiple dbm packages.
- Use GNU malloc.
+ Consider removing use of and/or need for the protos.h file.
- Use rx instead of regex.
+ Additional manual features:
+ ? Add exercises
+ Document use of dbm arrays
+ ? Add an error messages section to the manual
- DONE: Do a reference card.
+For 3.3
+=======
? Have strftime() pay attention to the value of ENVIRON["TZ"]
+ Add a lint check if the return value of a function is used but
+ the function did not supply a value.
+
Additional manual features:
- Document use of dbm arrays
- Document NLS support
- ? Add exercises
- ? Add an error messages section to the manual
? A section on where gawk is bounded
regex
i/o
sun fp conversions
-For 3.2
+For 3.4
=======
- Add a lint check if the return value of a function is used but
- the function did not supply a value.
-
Do an optimization pass over parse tree?
- Make awk '/foo/' files... run at egrep speeds
+ Make awk '/foo/' files... run at egrep speeds (how?)
For 4.x:
========
-Create a gawk compiler?
-
-Create a gawk-to-C translator? (or C++??)
-
-Provide awk profiling and debugging.
+Provide awk debugging.
diff --git a/gnu/dist/gawk/POSIX.STD b/gnu/dist/gawk/POSIX.STD
index ac8e1abf6ce..04d31fcf32b 100644
--- a/gnu/dist/gawk/POSIX.STD
+++ b/gnu/dist/gawk/POSIX.STD
@@ -1,3 +1,13 @@
+March 2001:
+
+It looks like the revised 1003.2 standard will actually follow the
+rules given below. Hallelujah!
+
+October 1998:
+
+The 1003.2 work has been at a stand-still for ages. Who knows if or
+when a new revision will actually happen...
+
August 1995:
Although the published 1003.2 standard contained the incorrect
diff --git a/gnu/dist/gawk/PROBLEMS b/gnu/dist/gawk/PROBLEMS
index 8f7d954a9a8..0a2f77d5233 100644
--- a/gnu/dist/gawk/PROBLEMS
+++ b/gnu/dist/gawk/PROBLEMS
@@ -1,7 +1,6 @@
-This is a list of known problems in gawk 3.0.
-Hopefully they will all be fixed in the next major release of gawk.
-
-Please keep in mind that the code is still undergoing significant evolution.
+This is a list of known problems in gawk 3.1.
+I don't know when this will be fixed, if ever. See also FUTURES
+and the gawk.texi doc for other things that need doing.
1. The interactions with the lexer and yyerror need reworking. It is possible
to get line numbers that are one line off if --compat or --posix is
diff --git a/gnu/dist/gawk/README_d/README.FIRST b/gnu/dist/gawk/README_d/README.FIRST
index 2ebd5b7e646..ef527f2074b 100644
--- a/gnu/dist/gawk/README_d/README.FIRST
+++ b/gnu/dist/gawk/README_d/README.FIRST
@@ -18,4 +18,4 @@ If you send me email about this, without having read this
file, I will yell at you.
Arnold Robbins
-arnold@gnu.ai.mit.edu
+arnold@gnu.org
diff --git a/gnu/dist/gawk/README_d/README.VMS b/gnu/dist/gawk/README_d/README.VMS
index 40442b143db..4d193981b33 100644
--- a/gnu/dist/gawk/README_d/README.VMS
+++ b/gnu/dist/gawk/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/gnu/dist/gawk/README_d/README.aix b/gnu/dist/gawk/README_d/README.aix
new file mode 100644
index 00000000000..283d3873cf9
--- /dev/null
+++ b/gnu/dist/gawk/README_d/README.aix
@@ -0,0 +1,6 @@
+Tue Mar 11 13:21:26 IST 2003
+============================
+
+On AIX 4.2 systems, you need:
+
+ ./configure --disable-nls && make all check install
diff --git a/gnu/dist/gawk/README_d/README.atari b/gnu/dist/gawk/README_d/README.atari
index ffbb12acf8d..0c7fd74b474 100644
--- a/gnu/dist/gawk/README_d/README.atari
+++ b/gnu/dist/gawk/README_d/README.atari
@@ -1,3 +1,8 @@
+Sun May 2 18:40:46 IDT 1999
+
+See the README.1st file in the atari directory.
+
+--------------------------------------------------------
Gawk on the Atari has been compiled and tested using gcc, both
with and without -mshort flag. Other compilers can be used but if
sizeof(pointer) != sizeof(int) this code will not compile correctly
diff --git a/gnu/dist/gawk/README_d/README.beos b/gnu/dist/gawk/README_d/README.beos
new file mode 100644
index 00000000000..e0a8189a01d
--- /dev/null
+++ b/gnu/dist/gawk/README_d/README.beos
@@ -0,0 +1,86 @@
+README for GNU awk under BeOS
+Last updated MCB, Tue Feb 6 10:15:46 GMT 2001
+
+BeOS port contact: Martin C Brown (mc@whoever.com)
+
+Building/Installing
+--------------------------
+
+Since BeOS DR9, all the tools that you should need to build gawk are now
+included with BeOS. The process is basically identical to the Unix process
+of running configure and then make. Full instructions are given below:
+
+You can compile gawk under BeOS by extracting the standard sources,
+and running the configure script. You MUST specify the location prefix
+for the installation directory. Under BeOS DR9 and beyond the best
+directory to use is /boot/home/config, so the configure command
+would be:
+
+$ configure --prefix=/boot/home/config
+
+This will install the compiled application into /boot/home/config/bin,
+which is already specified in the standard PATH.
+
+Once the configuration process has been completed, you can run make and
+then make install:
+
+$ make
+....
+$ make install
+
+Socket Notes
+----------------------
+
+Due to the socket implementation under BeOS not all of the features under
+gawk's socket implementation may work properly. In particular:
+
+ BeOS does not support a BSD SO_LINGER option, so sockets cannot remain
+ open after a close if data is still present on the incoming buffer.
+
+ BeOS does not allow data to be read from a socket without removing the data
+ from the buffer (peek). If you need to use this feature in gawk, create a
+ separate input buffer and peek into your own copy, rather than the OS version.
+
+ BeOS does not support RAW socket connections, only UDP or TCP.
+
+Note that these are BeOS Unix-layer compatibility problems, and only affect certain
+aspects of network communication. Most socket based gawk scripts, and any scripts
+that do not rely on sockets should work fine (excepting any other notes in this section).
+
+File Handle Notes
+---------------------------
+
+Expect the multiple file test (when running make check) to fail. The reason for this is
+explained in the email shown below:
+
+-------------------------------------------------------
+From mc@whoever.com Sun Jul 23 17:06:38 2000
+Date: Sun, 23 Jul 2000 07:23:49 +0100
+Subject: Re: gawk-3.0.5 results on BeOS
+From: Martin C Brown <mc@whoever.com>
+To: Aharon Robbins <arnold@skeeve.com>, <haible@ilog.fr>
+
+Arnold/Bruno,
+
+> This is a known BeOS problem. I am cc'ing the BeOS port person.
+> Sorry I don't have a fix.
+
+This problem is directly related to the FOPEN_MAX/OPEN_MAX parameter used in
+the stdio library by the BeOS. It seems that the BeOS strictly enforces this
+number to the point that opening the 128th file causes all previously opened
+files (except stdin/out/err) to be closed - hence the bad number.
+
+I've tried this outside of gawk and the same thing happens, so it's not a
+gawk problem.
+
+I've spent the past few days trying to find a suitable workaround, but it's
+obviously difficult trying to patch a kernel from the outside :))
+
+I'll be reporting this as a bug to Be shortly.
+
+MC
+
+--
+Martin 'MC' Brown, mc@mcslp.com http://www.mcwords.com
+Writer, Author, Consultant
+'Life is pain, anyone who says differently is selling something'
diff --git a/gnu/dist/gawk/README_d/README.hpux b/gnu/dist/gawk/README_d/README.hpux
new file mode 100644
index 00000000000..59f8753906b
--- /dev/null
+++ b/gnu/dist/gawk/README_d/README.hpux
@@ -0,0 +1,43 @@
+Mon, 27 May 2002 17:55:46 +0800
+-------------------------------
+
+The network support "|&" may not work under HP-UX 11.
+An error message appears similar to this:
+gawk: test_script.awk:3: fatal: get_a_record: iop->buf: can't allocate -61246
+bytes of memory (not enough space)
+
+Solution:
+This is a bug in the fstat() call of HP-UX 11.00, please apply
+the cumulative ARPA Transport patch PHNE_26771 to fix it.
+
+The following is the related description in PHNE_26771:
+
+ Customer's application gets the wrong value from fstat().
+ Resolution:
+ The value returned via st_blksize is now retrieved
+ from the same info as in 10.20.
+
+In case you cannot apply the HP patch, the attached patch to gawk source
+might work.
+
+Xiang Zhao <xiangz@163.net>
+Stepan Kasal <kasal@math.cas.cz>
+
+--- gawk-3.1.2-plain/posix/gawkmisc.c Tue Apr 16 13:58:41 2002
++++ gawk-3.1.2-hpux/posix/gawkmisc.c Fri May 24 11:46:35 2002
+@@ -77,7 +77,13 @@
+ * meant for in the first place.
+ */
+ #ifdef HAVE_ST_BLKSIZE
+-#define DEFBLKSIZE (stb->st_blksize > 0 ? stb->st_blksize : BUFSIZ)
++ /*
++ * 100k must be enough for everybody,
++ * bigger number means probably a bug in fstat()
++ */
++#define MAXBLKSIZE 102400
++#define DEFBLKSIZE (stb->st_blksize > 0 && stb->st_blksize <= MAXBLKSIZE \
++ ? stb->st_blksize : BUFSIZ)
+ #else
+ #define DEFBLKSIZE BUFSIZ
+ #endif
+
diff --git a/gnu/dist/gawk/README_d/README.ia64 b/gnu/dist/gawk/README_d/README.ia64
new file mode 100644
index 00000000000..844d6a6a7bf
--- /dev/null
+++ b/gnu/dist/gawk/README_d/README.ia64
@@ -0,0 +1,30 @@
+Tue Mar 11 13:19:45 IST 2003
+============================
+
+On real Itanium systems, builds with GCC are fine. If you're using the
+Intel compiler `ecc', you need:
+
+ CC=ecc ./configure && make all check install CFLAGS='-g -Drestrict='
+
+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
+============================
+
+The Intel IA-64 emulation environment that sits on top of 32-bit Linux
+has problems. Gawk does not work on it.
+
+1. The `sgicc' compiler lies to `configure' and pretends it's gcc. But it
+really isn't, and several things don't work.
+
+2. Even if used with gcc, the executable doesn't run; somehow quoted
+strings don't stay as one argument to gawk, which is, of course,
+disastrous.
+
+3. It's flaky; initially `configure' wouldn't even get past the getpgrp
+test. Then later it would.
+
+Arnold Robbins
+arnold@skeeve.com
diff --git a/gnu/dist/gawk/README_d/README.linux b/gnu/dist/gawk/README_d/README.linux
index 85973a2f5ac..a4cdb69d021 100644
--- a/gnu/dist/gawk/README_d/README.linux
+++ b/gnu/dist/gawk/README_d/README.linux
@@ -10,4 +10,12 @@ Removing and redoing the symlinks fixes the problem. It is fixed in
post-4.1 RedHat Linux.
Arnold Robbins
-arnold@gnu.ai.mit.edu
+arnold@gnu.org
+
+Sun Aug 3 15:07:06 EDT 1997
+
+As of version 3.1 of gawk, this is no longer a problem, since gawk now
+completely interprets the special file names internally.
+
+Arnold Robbins
+arnold@gnu.org
diff --git a/gnu/dist/gawk/README_d/README.macos b/gnu/dist/gawk/README_d/README.macos
new file mode 100644
index 00000000000..9c84b88078e
--- /dev/null
+++ b/gnu/dist/gawk/README_d/README.macos
@@ -0,0 +1,14 @@
+Sun Dec 3 18:11:09 IST 2000
+============================
+
+The `posix' test will fail because of output format differences but this
+is apparently otherwise benign.
+
+Gawk uses the system's mktime(3) routine, even though Autoconf thinks
+it's broken, so Caveat Emptor.
+
+If you ask me about either of these I will fuss at you for not having
+done your homework.
+
+Arnold Robbins
+arnold@gnu.org
diff --git a/gnu/dist/gawk/README_d/README.multibyte b/gnu/dist/gawk/README_d/README.multibyte
new file mode 100644
index 00000000000..6bc973a6b3b
--- /dev/null
+++ b/gnu/dist/gawk/README_d/README.multibyte
@@ -0,0 +1,22 @@
+Wed Jun 18 16:47:31 IDT 2003
+============================
+
+Multibyte locales can cause occasional weirdness, in particular with
+ranges inside brackets: /[....]/. Something that works great for ASCII
+will choke for, e.g., en_US.UTF-8. One such program is test/gsubtst5.awk.
+
+By default, the test suite runs with LC_ALL=C and LANG=C. You
+can change this by doing (from a Bourne-style shell):
+
+ $ GAWKLOCALE=some_locale make check
+
+Then the test suite will set LC_ALL and LANG to the given locale.
+
+As of this writing, this works for en_US.UTF-8, and all tests
+pass except gsubtst5.
+
+For the normal case of RS = "\n", the locale is largely irrelevant.
+For other single byte record separators, using LC_ALL=C will give you
+much better performance when reading records. Otherwise, gawk has to
+make several function calls, *per input character* to find the record
+terminator. You have been warned.
diff --git a/gnu/dist/gawk/README_d/README.pc b/gnu/dist/gawk/README_d/README.pc
index ddf2eb4be6c..5022596bc98 100644
--- a/gnu/dist/gawk/README_d/README.pc
+++ b/gnu/dist/gawk/README_d/README.pc
@@ -1,16 +1,44 @@
-This is the README for GNU awk 3.0 under OS/2 and DOS.
+This is the README for GNU awk 3.1 under Windows32, OS/2, and DOS.
- Gawk has been compiled and tested under OS/2, DOS, and Win32 using
-the GNU development tools from DJ Delorie (DJGPP; DOS with special support
-for long filenames under Win95) and Eberhard Mattes (EMX; OS/2, DOS, and
-Win32 with rsxnt). Microsoft Visual C/C++ can be used to build a Win32
-version for Windows 95/NT, and MSC can be used to build 16-bit versions
-for DOS and OS/2.
+ Gawk has been compiled and tested under OS/2, DOS, and Windows32 using
+the GNU development tools from DJ Delorie (DJGPP; DOS with special
+support for long filenames under Win95), Eberhard Mattes (EMX; OS/2,
+DOS, and Windows32 with rsxnt), and Jan-Jaap van der Heijden and Mumit Khan
+(Mingw32; Windows32). Microsoft Visual C/C++ can be used to build a Windows32
+version for Windows 9x/NT, and MSC can be used to build 16-bit versions
+for DOS and OS/2. (As of 3.1.2, the MSC version doesn't work, but the
+maintainer for it is working on fixing it.)
+ 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
-------------
+Building on DOS or Windows environments can be troublesome, in part due
+to shell limitations, the long filename issue, and various Windows32 pipe
+considerations. The situation is somewhat better on OS/2. The general
+recommendation is to use tools (especially make) which are compatible
+or built with the compiler to be used on gawk.
+
+Building versions which do not understand long filenames on systems
+that offer long names is a special case. The maintainers unpack the
+distribution and process using utilities (unzip, make, cmp) which do not
+use long filenames. (For example, the djgpp tools will work if LFN=n is
+set in the environment.)
+
Copy the files in the `pc' directory (EXCEPT for `ChangeLog') to the
directory with the rest of the gawk sources. (The subdirectories of
`pc' need not be copied.) The makefile contains a configuration
@@ -45,6 +73,13 @@ used to modify test/Makefile for your platform. In addition, some
files in the test directory may need to have their end-of-line markers
converted, as described in Makefile.tst.
+As with building gawk, the OS, shell, and long filename issues come into
+play when testing, too. If you are testing gawk on a LFN aware system with
+some LFN aware tools, you may have problems if the shell that you specify in
+test/Makefile is not LFN aware. This problem will apply whether or not
+you are building a LFN aware gawk. See the comments in pc/Makefile.tst
+for more information on this.
+
It is routine to install by hand, but note that the install target also
builds igawk.bat and igawk.cmd, which are used to add an include
facility to gawk (and which require sh).
@@ -59,16 +94,12 @@ djgpp collection.
The GNUish Project was designed to bring GNU-like programs to small
systems running OS/2 and DOS. Binary distributions of gawk are
-maintained in GNUish, and include 16bit OS/2 and DOS versions and a
-djgpp-compiled version. Information on GNUish is available via
+maintained in GNUish, and include 16bit OS/2 and DOS, 32bit djgpp,
+and Windows32 versions. Information on GNUish is available via
http://www.simtel.net/simtel.net/
- http://www.leo.org/pub/comp/platforms/pc/gnuish
- http://wuarchive.wustl.edu/systems/msdos/gnuish/
or
ftp://ftp.simtel.net/simtelnet/gnu/gnuish
- ftp://oak.oakland.edu/pub/simtelnet/gnu/gnuish
- ftp://wuarchive.wustl.edu/systems/msdos/gnuish/
Documentation appears in gnuish.htm (html) or gnuish.inf (info).
@@ -76,7 +107,7 @@ Kai Uwe Rommel <rommel@leo.org> maintains a (mostly OS/2) collection at
http://www.leo.org/archiv/os2 or ftp://ftp.leo.org
-It contains emx-compiled (32bit) versions of gawk for OS/2, DOS, and Win32,
+It contains emx-compiled (32bit) versions of gawk for OS/2, DOS, and Windows32,
along with many OS/2 utilities.
The djgpp collection at
@@ -87,24 +118,33 @@ The djgpp collection at
contains a djgpp-compiled (32bit) version of gawk, along with many
djgpp-compiled utilities.
+The Mingw32 collection at http://www.mingw.org contains links to ported
+software. The site by Jan-Jaap van der Heijden
+
+ http://agnes.dida.physik.uni-essen.de/~janjaap/
+
+is apparently no longer maintained, but it was accessible as of Jan 2001
+and may contain files of interest.
+
2. The following table illustrates some of the differences among the various
compiled versions of gawk. For example, the djgpp version runs on all the
systems, but with differing capabilities: it supports long filenames under
-Win-95 but not under NT, and it runs as a DPMI application under OS/2 (which
+Win-9x but not under NT, and it runs as a DPMI application under OS/2 (which
translates into "works in the DOS-box under OS/2, but not as a true OS/2
application").
- DOS Win/WfW Win95 NT OS/2
+ DOS Win/WfW Win9x NT OS/2
-------------------------------------------------------
djgpp | DPMI DPMI DPMI DPMI,NoLFN DPMI
emx(1) | N N N N OS2
emxbnd(2) | VCPI,DPMI DPMI DPMI,NoLFN DPMI,NoLFN DPMI,OS2
- emxnt(3) | N N Win32 Win32 N
- msc | 16 16 16,NoLFN 16,NoLFN 16,DOS
+ emxnt(3) | N N Windows32 Windows32 N
+ msc(4) | 16 16 16,NoLFN 16,NoLFN 16,DOS
msc6bnd | 16 16 16,NoLFN 16,NoLFN 16,DOS,OS2
msc6os2 | N N N N 16,OS2
- vcWin32 | N N Win32 Win32 N
+ vcWin32 | N N Windows32 Windows32 N
+ mingw32 | N N Windows32 Windows32 N
(1) Requires emxrt.
@@ -114,6 +154,10 @@ application").
(3) Requires rsxnt.
+ (4) When compiling, MSC 8, when run in Windows 9x, will require that if
+ files are listed in #include statements with LFNs
+ (eg. <patchlevel.h>), that the file be named with the LFN.
+
16 16bit; limited capacity, especially under DOS.
DOS Runs as a DOS application.
@@ -130,22 +174,24 @@ application").
OS2 Runs as an OS/2 application.
- rsxnt Runtimes for use with DPMI or Win32.
+ rsxnt Runtimes for use with DPMI or Windows32.
VCPI Virtual Control Program Interface; program runs as a DOS app.
Memory managers (such as emm386) may need adjustment. VCPI cannot
be used under OS/2, Win/WfW, Win-95, or NT. See also DPMI.
- Win32 Uses/supports Win32 features (such as long filenames).
+Windows32 Uses/supports Windows32 features (such as long filenames).
-Reportedly, NTEmacs (another Win32 program) can run programs such as
-Win32-gawk asynchronously. Currently, NTEmacs supports async subprocesses
-only if the child is a Win32 app. Similarly, like native OS/2 versions are
-a plus under OS/2 even for command-line programs, native Win32 versions are
-nice to have under NT and Win95.
+Reportedly, NTEmacs (another Windows32 program) can run programs such as
+Windows32-gawk asynchronously. Similarly, as native OS/2 versions are a
+plus under OS/2 even for command-line programs, native Windows32 versions
+may be desired under NT and Win95.
-Users interested in Win32 applications may also wish to examine the Cygnus
-GNU-Win32 Project at http://www.cygnus.com.
+Users interested in Windows32 applications may also wish to examine the
+Cygnus cygwin project at http://sources.redhat.com/cygwin/ or the
+Mingw32 work at http://www.mingw.org. Windows32 gawk will often require
+that utilities run from within gawk be Windows32 (e.g., the tests place this
+requirement on the cat utility).
3. An sh-like shell may be useful for awk programming (and is essential
@@ -169,11 +215,10 @@ for other other utilities (such as sed and wc) may need to be edited
in order to match your specific collection of programs.
Daisuke Aoyama <jack@st.rim.or.jp> has ported Bash 1.14.7 to djgpp.
-This version worked flawlessly in tests with djgpp gawk and make. It
-is now part of the djgpp collection and also from
+This version worked flawlessly in tests with djgpp gawk and make. bash
+is now part of the djgpp collection; the older port may be found on
- http://www.st.rim.or.jp/~jack/alpha/
- http://www.neongenesis.com/~jack/djgpp-work/alpha/
+ http://www.neongenesis.com/~jack/djgpp-work/beta/index.html
Under OS/2, bash should be a good choice; however, there has been some
trouble getting a solid version. As of Feb-95, there are two bash ports,
@@ -192,9 +237,15 @@ continues to be a problem. Stewartson's shell may be the best choice
for emx-compiled programs (although djgpp-bash almost works with
emx on DOS). GNU make is recommended if using djgpp-bash.
+Beginning with 3.0.4, the MSC (DOS/Windows32) and Mingw32 versions write
+pipe and system() commands to a temporary file, and then execute
+with SHELL or COMSPEC. The current mechanism defaults to dos-style
+shell conventions unless the shell is one of sh, bash, csh, tcsh, sh32,
+sh16, or ksh.
+
-4. GNU make is available at LEO for OS/2 and in the djgpp collection
-for DOS.
+4. GNU make is available at LEO for OS/2, in the djgpp collection
+for DOS, and in the Mingw32 collection for Windows32.
dmake is by Dennis Vadura (dvadura@watdragon.uwaterloo.ca), CS
Dept., University of Waterloo. OS/2 and DOS versions can be found as
@@ -266,7 +317,7 @@ found in /usr/share/zoneinfo/*. The setting of the TZ environment variable
3. The 16-bit DOS version can exhaust memory on scripts such as Henry
Spencer's "awf". Use GNU C versions if possible.
-4. builtin.c of gawk-3.0.[1-3] triggers a bug in MSC 6.00A. The makefile
+4. builtin.c of gawk-3.0.[1-6] triggers a bug in MSC 6.00A. The makefile
works around the bug by compiling builtin.c without optimizations (-Od).
In limited testing, it appears that inserting some dummy code in
builtin.c can provide a better solution than disabling optimizations.
@@ -284,18 +335,30 @@ surprising to many.
7. MSC 6 fails the strftlng test. The funstack test exhausts memory
on the 16bit DOS versions.
+8. Eli Zaretskii writes: "Make can crash with SIGFPE after finishing all
+the tests. This happens on Windows 95 only, and Gawk 3.0.3 does that as
+well (as do older versions of Make). The cause for this is the log(-1)
+call in the last test. Based on some limited testing, I'd say that the
+problem is in sloppy Windows handling of the FPU: it doesn't clean up the
+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-3.0.3 thanks
------------------
+Gawk thanks
+-----------
The DOS maintainers wish to express their thanks to Eli Zaretskii
<eliz@is.elta.co.il> for his work and for the many conversations
-concerning gawk-3.0, make, and djgpp. His FAQ for djgpp is essential
+concerning gawk, make, and djgpp. His FAQ for djgpp is essential
reading, and he was always willing to answer our questions (even when
we didn't read the relevant portions of the FAQ :).
-We are indebted to Juan Grigera <j-grigera@usa.net> for the
-Visual C++ target, and for additional help on changes for Win32.
+We are indebted to Juan Grigera <juan@biophnet.unlp.edu.ar> for the
+Visual C++ target, and for additional help on changes for Windows32.
----
@@ -304,13 +367,13 @@ 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 Windows32 started in gawk-3.0.3. Reports on
the Visual C++ version (vcWin32) may be sent to
- Juan Grigera, j-grigera@usa.net (Visual C++ version)
+ Juan Grigera, juan@biophnet.unlp.edu.ar (Visual C++ version)
-with a copy to Scott Deifik.
+with a copy to Scott Deifik. Other Windows32 reports may go to Darrel
+Hankerson.
diff --git a/gnu/dist/gawk/README_d/README.pcdynamic b/gnu/dist/gawk/README_d/README.pcdynamic
new file mode 100644
index 00000000000..678206e6082
--- /dev/null
+++ b/gnu/dist/gawk/README_d/README.pcdynamic
@@ -0,0 +1,93 @@
+This is the README for dynamic extension support for GNU awk 3.1.2 under Windows32
+This part of the README is directed to the gawk maintainers.
+
+The implementation consists of
+
+pc/dlfcn.h
+pc/dlfcn.c
+ An implementation of the POSIX dynamic loading functions for Windows32.
+ Bugs and limitations:
+ the RTLD_* flags are ignored
+ passing NULL as the module name is not really supported.
+ dlerror() doesn't always generate useful output.
+
+pc/w32dynamic.patch
+ A patch to pc/Makefile. This adds macros to allow dynamic loading
+ to be compiled in. The macros (DYN_EXP, DYN_OBJ, DYN_FLAGS, and
+ DYN_MAKEXP) are commented-out by default (which is the default on
+ Unix as well). I've added definitions only for MS VC and MinGW.
+ I also added support for pgawk under MS VC and MinGW.
+
+pc/gawkw32.def
+ A list of functions to export from gawk.exe. Every function used
+ in an extension DLL needs to be in this file. I've added the ones
+ required by the provided examples, but some thought should go into
+ determining a useful set of API functions. From a maintenance
+ perspective, it's important that the ordinals (the number following @)
+ never change. You can use an existing DLL with a gawk.exe which has
+ new exported functions, but if you change the ordinal of an existing
+ function, you have to recompile all the extensions that use it.
+
+extension/Makefile.pc
+ A make file which compiles a few of the extension examples.
+ Only readfile, ordchr, and arrayparm are built, since the
+ other functions didn't compile without sizeable modifications.
+
+extension/pcext.def
+ A module definition file which exports dlload.
+
+extension/w32dynamic.patch
+ A patch to readfile.c to have it open files in binary mode. Without
+ this, the bytes read doesn't always match the file size.
+
+w32dynamic.patch
+ A patch to awk.h. This makes the temporary variable _t static and
+ adds an attribute to some data declarations when WIN32_EXTENSION is
+ defined. The issue is that data imported from a separate module has
+ a different level of indirection from the same data in the
+ original module. The difference can be made transparent by adding
+ __declspec(dllimport)) to the declarations used in the importing module.
+ Since _t doesn't actually have to be shared, I've just made it
+ static to the extension module and avoided the problem.
+
+README_d/README.pcdynamic
+ This file.
+
+The remainder of the file is intended for people installing and using gawk
+and probably ought to be added to README.pc
+---
+To compile gawk with dynamic extension support, uncomment the
+definitions of DYN_FLAGS, DYN_EXP, DYN_OBJ, and DYN_MAKEXP in the
+configuration section of Makefile. There are two definitions for
+DYN_MAKEXP -- pick the one that matches your target.
+
+To build some of the example extension libraries, cd to the extension
+directory and copy Makefile.pc to Makefile. You can then build using the same
+two targets. To run the example awk scripts, you'll need to either change the
+call to the `extension' function to match the name of the library (for
+instance, change "./ordchr.so" to "ordchr.dll" or simply "ordchr"), or rename
+the library to match the call (for instance, rename ordchr.dll to ordchr.so).
+
+If you build gawk.exe with one compiler but want to build an extension library
+with the other, you need to copy the import library. Visual C uses a library
+called gawk.lib, while MinGW uses a library called libgawk.a. These files
+are equivalent and will interoperate if you give them the correct name.
+The resulting shared libraries are also interoperable.
+
+To create your own extension library, you can use the examples as models, but
+you're essentially on your own. Post to comp.lang.awk or send e-mail to
+ptjm@interlog.com if you have problems getting started. If you need to access
+functions or variables which are not exported by gawk.exe, add them to
+gawkw32.def and rebuild. You should also add ATTRIBUTE_EXPORTED to the
+declaration in awk.h of any variables you add to gawkw32.def.
+
+Note that extension libraries have the name of the awk executable embedded in
+them at link time, so they will work only with gawk.exe. In particular, they won't
+work if you rename gawk.exe to awk.exe or if you try to use pgawk.exe. You can
+perform profiling by temporarily renaming pgawk.exe to gawk.exe. You can resolve
+this problem by changing the program name in the definition of DYN_MAKEXP for
+your compiler.
+
+On Windows32, libraries are sought first in the current directory, then in the
+directory containing gawk.exe, and finally through the PATH environment
+variable.
diff --git a/gnu/dist/gawk/README_d/README.sco b/gnu/dist/gawk/README_d/README.sco
index f40cf646a9a..81307443366 100644
--- a/gnu/dist/gawk/README_d/README.sco
+++ b/gnu/dist/gawk/README_d/README.sco
@@ -19,4 +19,50 @@ If you complain to me about this, I will fuss at you for not having
done your homework.
Arnold Robbins
-arnold@gnu.ai.mit.edu
+arnold@gnu.org
+
+---------------------------
+Date: 14 Oct 1997 12:17 +0000
+From: Leigh Hebblethwaite <LHebblethwaite@transoft.com>
+To: bug-gnu-utils@prep.ai.mit.edu
+To: arnold@gnu.org
+
+I've just built gawk 3.0.3 on my system and have experienced a problem
+with the routine pipeio2.awk in the test suite. However the problem
+appears to be in the tr command rather than gawk.
+
+I'm using SCO Open Server 5. On the version I have there appears to be
+a problem with tr such that:
+
+ tr [0-9]. ...........
+
+does NOT translate 9s. This means that the output from:
+
+ echo " 5 6 7 8 9 10 11" | tr [0-9]. ...........
+
+is:
+
+ . . . . 9 .. ..
+
+This problem causes the pipeio2 test to be reported as a failure.
+
+Note that the following variation on the tr command works fine:
+
+ tr 0123456789. ...........
+
+For your info the details of my system are summarised by the out put
+of the uname -X command, which is:
+
+System = SCO_SV
+Node = sgscos5
+Release = 3.2v5.0.2
+KernelID = 96/01/23
+Machine = Pentium
+BusType = EISA
+Serial = 4EC023443
+Users = 5-user
+OEM# = 0
+Origin# = 1
+NumCPU = 1
+
+
diff --git a/gnu/dist/gawk/README_d/README.sgi b/gnu/dist/gawk/README_d/README.sgi
index 69b11cd5a58..ef22dfa6e57 100644
--- a/gnu/dist/gawk/README_d/README.sgi
+++ b/gnu/dist/gawk/README_d/README.sgi
@@ -1,20 +1,20 @@
-From emory!hawkwind.utcs.toronto.edu!cks Mon Dec 30 20:12:35 1996
-Return-Path: <emory!hawkwind.utcs.toronto.edu!cks>
-To: arnold@skeeve.atl.ga.us (Arnold D. Robbins)
-Subject: Re: gawk regex bug
-In-Reply-To: Your message of Tue, 30 Jul 1996 21:45:00 -0400.
- <m0ulQME-000GWyC@skeeve.atl.ga.us>
-Date: Mon, 30 Dec 1996 19:37:30 -0500
-From: Chris Siebenmann <emory!hawkwind.utcs.toronto.edu!cks>
-Message-Id: <96Dec30.193738est.24603@hawkwind.utcs.utoronto.ca>
-Status: OR
-Content-Length: 196
-X-Lines: 5
-X-Display-Position: 2
+Tue Jan 30 10:51:39 IST 2001
- The latest in my 'gawk on SGIs' stuff: with the newest SGI compilers
-(MIPSPro 7.1, just released) gawk 3.0 compiles and passes the selftests
-even at the highest (-O3) optimization level.
+There will be linker warnings on SGI Irix will be building gawk.
+These are related to use of dlopen and the dynamic loading of
+builtins. The warnings can be ignored.
+======================================
+Tue May 2 11:40:54 IDT 2000
- - cks
+GCC and gawk often don't mix on SGI systems. Use the native C compiler to
+compile gawk. `make test' should work ok, although the `tweakfld' test
+may fail. That's ok; see README.ultrix for the details on that one.
+Note that the SGI compiler will complain about some constructs in
+regex.c and dfa.c. It's ok to ignore those complaints.
+
+If you ask me about this, I will fuss at you for not having done
+your homework!
+
+Arnold Robbins
+arnold@gnu.org
diff --git a/gnu/dist/gawk/README_d/README.solaris b/gnu/dist/gawk/README_d/README.solaris
index e83d57e588f..499ea4d80ce 100644
--- a/gnu/dist/gawk/README_d/README.solaris
+++ b/gnu/dist/gawk/README_d/README.solaris
@@ -1,16 +1,9 @@
-From dragon!lehman.com!carson Fri Feb 7 01:12:09 1997
-Return-Path: <dragon!lehman.com!carson>
+Solaris Problem #1:
+===================
From: carson@lehman.com
Date: Fri, 7 Feb 1997 01:05:58 -0500
-Message-ID: <199702070605.BAA09185@dragon.lehman.com>
To: arnold@gnu.ai.mit.edu
Subject: Solaris 2.5.1 x86 bug in gawk-3.0.2
-Reply-To: carson@lehman.com
-Status: R
-Content-Length: 630
-X-Lines: 23
-X-Display-Position: 0
-
awktab.c has the following bogus logic:
@@ -35,3 +28,111 @@ Carson Gaspar -- carson@cs.columbia.edu carson@lehman.com
http://www.cs.columbia.edu/~carson/home.html
<This is the boring business .sig - no outre sayings here>
+ * * * * * * *
+
+Solution to Problem #1:
+=======================
+Tue Oct 20 21:25:11 IST 1998
+
+This has been fixed in 3.1.0 with the bisonfix.sed script.
+
+Arnold Robbins
+arnold@gnu.org
+
+Solaris Problem #2:
+===================
+Tue Apr 13 16:57:45 IDT 1999
+
+There is a known problem in that the `manyfiles' test will fail under
+Solaris if you set your soft limit on the number of file descriptors to
+above 256. This is due to a "feature" of fdopen that an fd must be
+less than 256 (see fdopen(3)).
+
+IMHO this is Sun's problem, not mine.
+
+Arnold Robbins
+arnold@gnu.org
+
+Solution (a) to Problem #2:
+===========================
+Now fixed in the code via Paul Eggert's 2001-09-0 patch. See the
+ChangeLog.
+
+Solution (b) to Problem #2:
+===========================
+From: Paul Nevai <nevai@math.ohio-state.edu>
+Subject: Re: gawk-3.0.4
+To: arnold@skeeve.com (Aharon Robbins)
+Date: Tue, 6 Jul 1999 09:09:05 -0400 (EDT)
+
+Dear Aharon:
+
+Toda raba. Why don't you add something like that to README_d/README.solaris
+file:
+
+for the SunOS do in
+
+/bin/sh: ulimit -n 256; ulimit -a; make test
+/bin/tcsh: limit descriptors 256; ulimit -a; make test
+
+otherwise "make test" will fail
+
+Shalom, Paul
+
+Aharon Robbins wrote to Paul Nevai:
+# >From the README_d/README.solaris file:
+#
+# Tue Apr 13 16:57:45 IDT 1999
+#
+# There is a known problem in that the `manyfiles' test will fail under
+# Solaris if you set your soft limit on the number of file descriptors to
+# above 256. This is due to a "feature" of fdopen that an fd must be
+# less than 256 (see fdopen(3)).
+#
+# IMHO this is Sun's problem, not mine.
+#
+# Arnold Robbins
+# arnold@gnu.org
+#
+# Double check your settings with ulimit; I suspect that this is
+# your problem.
+#
+# Thanks,
+#
+# Arnold
+# --
+# Aharon (Arnold) Robbins arnold@skeeve.com [ <<=== NOTE: NEW ADDRESS!! ]
+# P.O. Box 354 Home Phone: +972 8 979-0381 Fax: +1 603 761-6761
+# Nof Ayalon Cell Phone: +972 51 297-545 (See www.efax.com)
+# D.N. Shimshon 99784 Laundry increases exponentially in the
+# ISRAEL number of children. -- Miriam Robbins
+#
+#
+
+
+
+Paul Nevai pali+@osu.edu
+Department of Mathematics nevai@math.ohio-state.edu
+The Ohio State University http://www.math.ohio-state.edu/~nevai/
+231 West Eighteenth Avenue http://www.math.ohio-state.edu/~jat/
+Columbus, Ohio 43210-1174 1-614-292-5310 (Office/Answering Device)
+The United States of America 1-614-292-1479 (Math Dept Fax)
+
+Solaris Problem #3:
+===================
+Sun Feb 9 10:35:51 IST 2003
+
+Certain versions of Sun C give compilation errors under Solaris 5.5, 5.6 and
+possibly later. Here's what I was told:
+
+> We have this version of cc here:
+> cc -V
+> cc: Sun WorkShop 6 update 1 C 5.2 2000/09/11
+>
+> Probably, the others use different combinations of OS and CC.
+> A quick fix was this (we use csh-syntax here):
+>
+> setenv CC "/opt/SUNWspro/bin/cc -Xc"
+> ./configure
+> make check
+
diff --git a/gnu/dist/gawk/README_d/README.sony b/gnu/dist/gawk/README_d/README.sony
index 32af9aa55ca..61f1be8e9eb 100644
--- a/gnu/dist/gawk/README_d/README.sony
+++ b/gnu/dist/gawk/README_d/README.sony
@@ -9,3 +9,4 @@ This system has the same problem with the test/tweakfld case that Ultrix MIPS
has. See the README.ultrix file for details.
Arnold Robbins
+arnold@gnu.org
diff --git a/gnu/dist/gawk/README_d/README.sunos4 b/gnu/dist/gawk/README_d/README.sunos4
index ea9a1952cab..da3f0cb1513 100644
--- a/gnu/dist/gawk/README_d/README.sunos4
+++ b/gnu/dist/gawk/README_d/README.sunos4
@@ -8,7 +8,7 @@ If you send me email about this without having read this file, I will
fuss at you!
Arnold Robbins
-arnold@gnu.ai.mit.edu
+arnold@gnu.org
Tue Jan 30 07:01:39 EST 1996
diff --git a/gnu/dist/gawk/README_d/README.tandem b/gnu/dist/gawk/README_d/README.tandem
new file mode 100644
index 00000000000..3f7ba93056f
--- /dev/null
+++ b/gnu/dist/gawk/README_d/README.tandem
@@ -0,0 +1,33 @@
+The Tandem port was done on a Cyclone machine running D20.
+The port is pretty clean and all facilities seem to work except for
+some of the I/O piping stuff which is just too foreign a concept for
+Tandem.
+
+Usage is as for UNIX except that D20 requires all "{" and "}" characters
+to be escaped with "~" on the command line (not in script files) and the
+standard Tandem syntax for "/in filename,out filename/" must be used
+instead of the usual UNIX "<" and ">" for file redirection. (Redirection
+options on getline, print etc are supported.)
+
+The -mr=val option has been "stolen" to enable Tandem users to
+process fixed-length records with no "end-of-line" character. That
+is, -mr=74 tells gawk to read the input file as fixed 74-byte
+records.
+
+To build a Tandem executable from source, down-load all of the files
+so that the file names on the Tandem box are, for example ARRAYC or
+AWKH. That is, make all of the file names conform to the restrictions
+of D20. The "totally Tandem-specific" files are in the tandem
+"subvolume" and should be copied to the main src directory before
+building gawk.
+
+The file compit can then be used to compile and bind an executable.
+Sorry, no make and no autoconfig.
+
+This is my first UNIX port to Tandem so I may well have missed the best
+way of doing things: I just desperately needed a working awk at a
+Tandem shop.
+
+Cheers,
+Stephen Davies
+(scldad@sdc.com.au)
diff --git a/gnu/dist/gawk/README_d/README.tests b/gnu/dist/gawk/README_d/README.tests
new file mode 100644
index 00000000000..1c969d754d4
--- /dev/null
+++ b/gnu/dist/gawk/README_d/README.tests
@@ -0,0 +1,46 @@
+Date: Sat, 22 Apr 2000 06:07:06 -0600 (MDT)
+From: "Nelson H. F. Beebe" <beebe@math.utah.edu>
+To: arnold@gnu.org
+Cc: beebe@math.utah.edu, sysstaff@math.utah.edu, othmer@math.utah.edu
+Subject: gawk-3.0.4 and a GNU/Linux gotcha
+
+Yesterday, I was assisting a colleague install some software on his
+GNU/Linux machine for which uname -r reports 2.2.14.
+
+A (mis)feature of this system, which I've never encountered before,
+broke the build of one of my programs, and also of gawk-3.0.4.
+
+Namely, the kernel will not execute anything that resides in /tmp,
+though it will if the same script is in /usr/tmp!
+
+% cat /tmp/foo.sh
+#! /bin/sh
+echo hello
+
+ls -l /tmp/foo.sh
+-rwxr-xr-x 1 othmer math 22 Apr 21 10:34 /tmp/foo.sh*
+
+% /tmp/foo.sh
+bash: /tmp/foo.sh: Permission denied
+
+% cp /tmp/foo.sh /usr/tmp
+
+% /usr/tmp/foo.sh
+hello
+
+Thus, programs that do a temporary install in /tmp, as some of mine do
+in order to run the validation suite, will fail.
+
+gawk-3.0.4, and likely other gawk versions, hits this problem too. It
+fails because test/poundbang starts with
+
+#! /tmp/gawk -f
+
+I tracked down where it comes from:
+
+% grep /tmp /etc/fstab
+/dev/hda3 /tmp ext2 rw,nosuid,noexec,nouser,auto,async,nodev 1 1
+ !!!!!!
+
+Since this is done via a mount command, potentially ANY directory tree
+could be mounted with noexec.
diff --git a/gnu/dist/gawk/README_d/README.ultrix b/gnu/dist/gawk/README_d/README.ultrix
index 4943409cfe8..917f02f514a 100644
--- a/gnu/dist/gawk/README_d/README.ultrix
+++ b/gnu/dist/gawk/README_d/README.ultrix
@@ -25,3 +25,22 @@ Date: Sun Sep 8 07:05:07 EDT 1996
On Decstations using Ultrix 4.3, the tweakfld test case will fail. It
appears that routines in the math library return very small but non-zero
numbers in cases where most other systems return zero.
+
+From: Juergen Kahrs <jkahrs@castor.atlas.de>
+Date: Wed Jan 17 13:15:34 MET 2001
+
+On Ultrix 4.3, configure like this:
+
+ ./configure --disable-nls
+
+In custom.h, we defined HAVE_MKTIME in order to avoid a linker error.
+If you compile with
+
+ make check
+
+every test will pass, except for the badargs test:
+
+ *** Error code 1 (ignored)
+
+This shouldnt cause problems.
+
diff --git a/gnu/dist/gawk/README_d/README.yacc b/gnu/dist/gawk/README_d/README.yacc
index aa8ee8ef46f..e198c070b5e 100644
--- a/gnu/dist/gawk/README_d/README.yacc
+++ b/gnu/dist/gawk/README_d/README.yacc
@@ -7,4 +7,4 @@ nested control structures, such as those in `awf'.
The problem goes away if you use either bison or Berkeley yacc.
Arnold Robbins
-arnold@gnu.ai.mit.edu
+arnold@gnu.org
diff --git a/gnu/dist/gawk/awkgram.y b/gnu/dist/gawk/awkgram.y
new file mode 100644
index 00000000000..56ec45d397f
--- /dev/null
+++ b/gnu/dist/gawk/awkgram.y
@@ -0,0 +1,3230 @@
+/* $NetBSD: awkgram.y,v 1.1.1.1 2003/10/06 15:45:41 wiz Exp $ */
+
+/*
+ * awkgram.y --- yacc/bison parser
+ */
+
+/*
+ * Copyright (C) 1986, 1988, 1989, 1991-2003 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
+ */
+
+%{
+#ifdef GAWKDEBUG
+#define YYDEBUG 12
+#endif
+
+#include "awk.h"
+
+#define CAN_FREE TRUE
+#define DONT_FREE FALSE
+
+#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
+static void yyerror(const char *m, ...) ATTRIBUTE_PRINTF_1;
+#else
+static void yyerror(); /* va_alist */
+#endif
+static char *get_src_buf P((void));
+static int yylex P((void));
+static NODE *node_common P((NODETYPE op));
+static NODE *snode P((NODE *subn, NODETYPE op, int sindex));
+static NODE *make_for_loop P((NODE *init, NODE *cond, NODE *incr));
+static NODE *append_right P((NODE *list, NODE *new));
+static inline NODE *append_pattern P((NODE **list, NODE *patt));
+static void func_install P((NODE *params, NODE *def));
+static void pop_var P((NODE *np, int freeit));
+static void pop_params P((NODE *params));
+static NODE *make_param P((char *name));
+static NODE *mk_rexp P((NODE *exp));
+static int dup_parms P((NODE *func));
+static void param_sanity P((NODE *arglist));
+static int parms_shadow P((const char *fname, NODE *func));
+static int isnoeffect P((NODETYPE t));
+static int isassignable P((NODE *n));
+static void dumpintlstr P((const char *str, size_t len));
+static void dumpintlstr2 P((const char *str1, size_t len1, const char *str2, size_t len2));
+static void count_args P((NODE *n));
+static int isarray P((NODE *n));
+
+enum defref { FUNC_DEFINE, FUNC_USE };
+static void func_use P((const char *name, enum defref how));
+static void check_funcs P((void));
+
+static int want_regexp; /* lexical scanning kludge */
+static int can_return; /* parsing kludge */
+static int begin_or_end_rule = FALSE; /* parsing kludge */
+static int parsing_end_rule = FALSE; /* for warnings */
+static int in_print = FALSE; /* lexical scanning kludge for print */
+static int in_parens = 0; /* lexical scanning kludge for print */
+static char *lexptr; /* pointer to next char during parsing */
+static char *lexend;
+static char *lexptr_begin; /* keep track of where we were for error msgs */
+static char *lexeme; /* beginning of lexeme for debugging */
+static char *thisline = NULL;
+#define YYDEBUG_LEXER_TEXT (lexeme)
+static int param_counter;
+static char *tokstart = NULL;
+static char *tok = NULL;
+static char *tokend;
+
+static long func_count; /* total number of functions */
+
+#define HASHSIZE 1021 /* this constant only used here */
+NODE *variables[HASHSIZE];
+static int var_count; /* total number of global variables */
+
+extern char *source;
+extern int sourceline;
+extern struct src *srcfiles;
+extern int numfiles;
+extern int errcount;
+extern NODE *begin_block;
+extern NODE *end_block;
+
+/*
+ * This string cannot occur as a real awk identifier.
+ * Use it as a special token to make function parsing
+ * uniform, but if it's seen, don't install the function.
+ * e.g.
+ * function split(x) { return x }
+ * function x(a) { return a }
+ * should only produce one error message, and not core dump.
+ */
+static char builtin_func[] = "@builtin";
+%}
+
+%union {
+ long lval;
+ AWKNUM fval;
+ NODE *nodeval;
+ NODETYPE nodetypeval;
+ char *sval;
+ NODE *(*ptrval) P((void));
+}
+
+%type <nodeval> function_prologue pattern action variable param_list
+%type <nodeval> exp common_exp
+%type <nodeval> simp_exp non_post_simp_exp
+%type <nodeval> expression_list opt_expression_list print_expression_list
+%type <nodeval> statements statement if_statement switch_body case_statements case_statement case_value 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
+%type <nodetypeval> assign_operator a_relop relop_or_less
+%type <sval> func_name
+%type <lval> lex_builtin
+
+%token <sval> FUNC_CALL NAME REGEXP
+%token <lval> ERROR
+%token <nodeval> YNUMBER YSTRING
+%token <nodetypeval> RELOP IO_OUT IO_IN
+%token <nodetypeval> ASSIGNOP ASSIGN MATCHOP CONCAT_OP
+%token <nodetypeval> LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE
+%token <nodetypeval> LEX_SWITCH LEX_CASE LEX_DEFAULT LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE
+%token <nodetypeval> LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION
+%token <nodetypeval> LEX_GETLINE LEX_NEXTFILE
+%token <nodetypeval> LEX_IN
+%token <lval> LEX_AND LEX_OR INCREMENT DECREMENT
+%token <lval> LEX_BUILTIN LEX_LENGTH
+%token NEWLINE
+
+/* these are just yylval numbers */
+
+/* Lowest to highest */
+%right ASSIGNOP ASSIGN SLASH_BEFORE_EQUAL
+%right '?' ':'
+%left LEX_OR
+%left LEX_AND
+%left LEX_GETLINE
+%nonassoc LEX_IN
+%left FUNC_CALL LEX_BUILTIN LEX_LENGTH
+%nonassoc ','
+%nonassoc MATCHOP
+%nonassoc RELOP '<' '>' IO_IN IO_OUT
+%left CONCAT_OP
+%left YSTRING YNUMBER
+%left '+' '-'
+%left '*' '/' '%'
+%right '!' UNARY
+%right '^'
+%left INCREMENT DECREMENT
+%left '$'
+%left '(' ')'
+%%
+
+start
+ : opt_nls program opt_nls
+ {
+ check_funcs();
+ }
+ ;
+
+program
+ : /* empty */
+ | program rule
+ {
+ begin_or_end_rule = parsing_end_rule = FALSE;
+ yyerrok;
+ }
+ | program error
+ {
+ begin_or_end_rule = parsing_end_rule = FALSE;
+ /*
+ * If errors, give up, don't produce an infinite
+ * stream of syntax error messages.
+ */
+ /* yyerrok; */
+ }
+ ;
+
+rule
+ : pattern action
+ {
+ $1->rnode = $2;
+ }
+ | pattern statement_term
+ {
+ if ($1->lnode != NULL) {
+ /* pattern rule with non-empty pattern */
+ $1->rnode = node(NULL, Node_K_print_rec, NULL);
+ } else {
+ /* an error */
+ if (begin_or_end_rule)
+ warning(_("%s blocks must have an action part"),
+ (parsing_end_rule ? "END" : "BEGIN"));
+ else
+ warning(_("each rule must have a pattern or an action part"));
+ errcount++;
+ }
+ }
+ | function_prologue action
+ {
+ can_return = FALSE;
+ if ($1)
+ func_install($1, $2);
+ yyerrok;
+ }
+ ;
+
+pattern
+ : /* empty */
+ {
+ $$ = append_pattern(&expression_value, (NODE *) NULL);
+ }
+ | exp
+ {
+ $$ = append_pattern(&expression_value, $1);
+ }
+ | exp ',' exp
+ {
+ NODE *r;
+
+ getnode(r);
+ r->type = Node_line_range;
+ r->condpair = node($1, Node_cond_pair, $3);
+ r->triggered = FALSE;
+ $$ = append_pattern(&expression_value, r);
+ }
+ | LEX_BEGIN
+ {
+ begin_or_end_rule = TRUE;
+ $$ = append_pattern(&begin_block, (NODE *) NULL);
+ }
+ | LEX_END
+ {
+ begin_or_end_rule = parsing_end_rule = TRUE;
+ $$ = append_pattern(&end_block, (NODE *) NULL);
+ }
+ ;
+
+action
+ : l_brace statements r_brace opt_semi opt_nls
+ { $$ = $2; }
+ ;
+
+func_name
+ : NAME
+ { $$ = $1; }
+ | FUNC_CALL
+ { $$ = $1; }
+ | lex_builtin
+ {
+ yyerror(_("`%s' is a built-in function, it cannot be redefined"),
+ tokstart);
+ errcount++;
+ $$ = builtin_func;
+ /* yyerrok; */
+ }
+ ;
+
+lex_builtin
+ : LEX_BUILTIN
+ | LEX_LENGTH
+ ;
+
+function_prologue
+ : LEX_FUNCTION
+ {
+ param_counter = 0;
+ }
+ func_name '(' opt_param_list r_paren opt_nls
+ {
+ NODE *t;
+
+ t = make_param($3);
+ t->flags |= FUNC;
+ $$ = append_right(t, $5);
+ can_return = TRUE;
+ /* check for duplicate parameter names */
+ if (dup_parms($$))
+ errcount++;
+ }
+ ;
+
+regexp
+ /*
+ * In this rule, want_regexp tells yylex that the next thing
+ * is a regexp so it should read up to the closing slash.
+ */
+ : a_slash
+ { ++want_regexp; }
+ REGEXP /* The terminating '/' is consumed by yylex(). */
+ {
+ NODE *n;
+ size_t len = strlen($3);
+
+ if (do_lint && ($3)[0] == '*') {
+ /* possible C comment */
+ if (($3)[len-1] == '*')
+ lintwarn(_("regexp constant `/%s/' looks like a C comment, but is not"), tokstart);
+ }
+ getnode(n);
+ n->type = Node_regex;
+ n->re_exp = make_string($3, len);
+ n->re_reg = make_regexp($3, len, FALSE);
+ n->re_text = NULL;
+ n->re_flags = CONST;
+ $$ = n;
+ }
+ ;
+
+a_slash
+ : '/'
+ | SLASH_BEFORE_EQUAL
+ ;
+
+statements
+ : /* empty */
+ { $$ = NULL; }
+ | statements statement
+ {
+ if ($2 == NULL)
+ $$ = $1;
+ else {
+ if (do_lint && isnoeffect($2->type))
+ lintwarn(_("statement may have no effect"));
+ if ($1 == NULL)
+ $$ = $2;
+ else
+ $$ = append_right(
+ ($1->type == Node_statement_list ? $1
+ : node($1, Node_statement_list, (NODE *) NULL)),
+ ($2->type == Node_statement_list ? $2
+ : node($2, Node_statement_list, (NODE *) NULL)));
+ }
+ yyerrok;
+ }
+ | statements error
+ { $$ = NULL; }
+ ;
+
+statement_term
+ : nls
+ | semi opt_nls
+ ;
+
+statement
+ : semi opt_nls
+ { $$ = NULL; }
+ | l_brace statements r_brace
+ { $$ = $2; }
+ | if_statement
+ { $$ = $1; }
+ | LEX_SWITCH '(' exp r_paren opt_nls l_brace switch_body opt_nls r_brace
+ { $$ = node($3, Node_K_switch, $7); }
+ | LEX_WHILE '(' exp r_paren opt_nls statement
+ { $$ = node($3, Node_K_while, $6); }
+ | LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls
+ { $$ = node($6, Node_K_do, $3); }
+ | LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement
+ {
+ /*
+ * Efficiency hack. Recognize the special case of
+ *
+ * for (iggy in foo)
+ * delete foo[iggy]
+ *
+ * and treat it as if it were
+ *
+ * delete foo
+ *
+ * Check that the body is a `delete a[i]' statement,
+ * and that both the loop var and array names match.
+ */
+ if ($8 != NULL && $8->type == Node_K_delete) {
+ NODE *arr, *sub;
+
+ assert($8->rnode->type == Node_expression_list);
+ arr = $8->lnode; /* array var */
+ sub = $8->rnode->lnode; /* index var */
+
+ if ( (arr->type == Node_var_new
+ || arr->type == Node_var_array
+ || arr->type == Node_param_list)
+ && (sub->type == Node_var_new
+ || sub->type == Node_var
+ || sub->type == Node_param_list)
+ && strcmp($3, sub->vname) == 0
+ && strcmp($5, arr->vname) == 0) {
+ $8->type = Node_K_delete_loop;
+ $$ = $8;
+ }
+ else
+ goto regular_loop;
+ } else {
+ regular_loop:
+ $$ = node($8, Node_K_arrayfor,
+ make_for_loop(variable($3, CAN_FREE, Node_var),
+ (NODE *) NULL, variable($5, CAN_FREE, Node_var_array)));
+ }
+ }
+ | LEX_FOR '(' opt_simple_stmt semi opt_nls exp semi opt_nls opt_simple_stmt r_paren opt_nls statement
+ {
+ $$ = node($12, Node_K_for, (NODE *) make_for_loop($3, $6, $9));
+ }
+ | LEX_FOR '(' opt_simple_stmt semi opt_nls semi opt_nls opt_simple_stmt r_paren opt_nls statement
+ {
+ $$ = node($11, Node_K_for,
+ (NODE *) make_for_loop($3, (NODE *) NULL, $8));
+ }
+ | LEX_BREAK statement_term
+ /* for break, maybe we'll have to remember where to break to */
+ { $$ = node((NODE *) NULL, Node_K_break, (NODE *) NULL); }
+ | LEX_CONTINUE statement_term
+ /* similarly */
+ { $$ = node((NODE *) NULL, Node_K_continue, (NODE *) NULL); }
+ | LEX_NEXT statement_term
+ { NODETYPE type;
+
+ if (begin_or_end_rule)
+ yyerror(_("`%s' used in %s action"), "next",
+ (parsing_end_rule ? "END" : "BEGIN"));
+ type = Node_K_next;
+ $$ = node((NODE *) NULL, type, (NODE *) NULL);
+ }
+ | LEX_NEXTFILE statement_term
+ {
+ if (do_traditional) {
+ /*
+ * can't use yyerror, since may have overshot
+ * the source line
+ */
+ errcount++;
+ error(_("`nextfile' is a gawk extension"));
+ }
+ if (do_lint)
+ lintwarn(_("`nextfile' is a gawk extension"));
+ if (begin_or_end_rule) {
+ /* same thing */
+ errcount++;
+ error(_("`%s' used in %s action"), "nextfile",
+ (parsing_end_rule ? "END" : "BEGIN"));
+ }
+ $$ = node((NODE *) NULL, Node_K_nextfile, (NODE *) NULL);
+ }
+ | LEX_EXIT opt_exp statement_term
+ { $$ = node($2, Node_K_exit, (NODE *) NULL); }
+ | LEX_RETURN
+ {
+ if (! can_return)
+ yyerror(_("`return' used outside function context"));
+ }
+ opt_exp statement_term
+ { $$ = node($3, Node_K_return, (NODE *) NULL); }
+ | simple_stmt statement_term
+ ;
+
+ /*
+ * A simple_stmt exists to satisfy a constraint in the POSIX
+ * grammar allowing them to occur as the 1st and 3rd parts
+ * in a `for (...;...;...)' loop. This is a historical oddity
+ * inherited from Unix awk, not at all documented in the AK&W
+ * awk book. We support it, as this was reported as a bug.
+ * We don't bother to document it though. So there.
+ */
+simple_stmt
+ : print { in_print = TRUE; in_parens = 0; } print_expression_list output_redir
+ {
+ /*
+ * Optimization: plain `print' has no expression list, so $3 is null.
+ * If $3 is an expression list with one element (rnode == null)
+ * and lnode is a field spec for field 0, we have `print $0'.
+ * For both, use Node_K_print_rec, which is faster for these two cases.
+ */
+ if ($1 == Node_K_print &&
+ ($3 == NULL
+ || ($3->type == Node_expression_list
+ && $3->rnode == NULL
+ && $3->lnode->type == Node_field_spec
+ && $3->lnode->lnode->type == Node_val
+ && $3->lnode->lnode->numbr == 0.0))
+ ) {
+ static int warned = FALSE;
+
+ $$ = node(NULL, Node_K_print_rec, $4);
+
+ if (do_lint && $3 == NULL && begin_or_end_rule && ! warned) {
+ warned = TRUE;
+ lintwarn(
+ _("plain `print' in BEGIN or END rule should probably be `print \"\"'"));
+ }
+ } else {
+ $$ = node($3, $1, $4);
+ if ($$->type == Node_K_printf)
+ count_args($$);
+ }
+ }
+ | LEX_DELETE NAME '[' expression_list ']'
+ { $$ = node(variable($2, CAN_FREE, Node_var_array), Node_K_delete, $4); }
+ | LEX_DELETE NAME
+ {
+ if (do_lint)
+ lintwarn(_("`delete array' is a gawk extension"));
+ if (do_traditional) {
+ /*
+ * can't use yyerror, since may have overshot
+ * the source line
+ */
+ errcount++;
+ error(_("`delete array' is a gawk extension"));
+ }
+ $$ = node(variable($2, CAN_FREE, Node_var_array), Node_K_delete, (NODE *) NULL);
+ }
+ | LEX_DELETE '(' NAME ')'
+ {
+ /* this is for tawk compatibility. maybe the warnings should always be done. */
+ if (do_lint)
+ lintwarn(_("`delete(array)' is a non-portable tawk extension"));
+ if (do_traditional) {
+ /*
+ * can't use yyerror, since may have overshot
+ * the source line
+ */
+ errcount++;
+ error(_("`delete(array)' is a non-portable tawk extension"));
+ }
+ $$ = node(variable($3, CAN_FREE, Node_var_array), Node_K_delete, (NODE *) NULL);
+ }
+ | exp
+ { $$ = $1; }
+ ;
+
+opt_simple_stmt
+ : /* empty */
+ { $$ = NULL; }
+ | simple_stmt
+ { $$ = $1; }
+ ;
+
+switch_body
+ : case_statements
+ {
+ if ($1 == NULL) {
+ $$ = NULL;
+ } else {
+ NODE *dflt = NULL;
+ NODE *head = $1;
+ NODE *curr;
+
+ const char **case_values = NULL;
+
+ int maxcount = 128;
+ int case_count = 0;
+ int i;
+
+ emalloc(case_values, const char **, sizeof(char*) * maxcount, "switch_body");
+ for (curr = $1; curr != NULL; curr = curr->rnode) {
+ /* Assure that case statement values are unique. */
+ if (curr->lnode->type == Node_K_case) {
+ char *caseval;
+
+ if (curr->lnode->lnode->type == Node_regex)
+ caseval = curr->lnode->lnode->re_exp->stptr;
+ else
+ caseval = force_string(tree_eval(curr->lnode->lnode))->stptr;
+
+ for (i = 0; i < case_count; i++)
+ if (strcmp(caseval, case_values[i]) == 0)
+ yyerror(_("duplicate case values in switch body: %s"), caseval);
+
+ if (case_count >= maxcount) {
+ maxcount += 128;
+ erealloc(case_values, const char **, sizeof(char*) * maxcount, "switch_body");
+ }
+ case_values[case_count++] = caseval;
+ } else {
+ /* Otherwise save a pointer to the default node. */
+ if (dflt != NULL)
+ yyerror(_("Duplicate `default' detected in switch body"));
+ dflt = curr;
+ }
+ }
+
+ free(case_values);
+
+ /* Create the switch body. */
+ $$ = node(head, Node_switch_body, dflt);
+ }
+ }
+ ;
+
+case_statements
+ : /* empty */
+ { $$ = NULL; }
+ | case_statements case_statement
+ {
+ if ($2 == NULL)
+ $$ = $1;
+ else {
+ if (do_lint && isnoeffect($2->type))
+ lintwarn(_("statement may have no effect"));
+ if ($1 == NULL)
+ $$ = node($2, Node_case_list, (NODE *) NULL);
+ else
+ $$ = append_right(
+ ($1->type == Node_case_list ? $1 : node($1, Node_case_list, (NODE *) NULL)),
+ ($2->type == Node_case_list ? $2 : node($2, Node_case_list, (NODE *) NULL))
+ );
+ }
+ yyerrok;
+ }
+ | case_statements error
+ { $$ = NULL; }
+ ;
+
+case_statement
+ : LEX_CASE case_value colon opt_nls statements
+ { $$ = node($2, Node_K_case, $5); }
+ | LEX_DEFAULT colon opt_nls statements
+ { $$ = node((NODE *) NULL, Node_K_default, $4); }
+ ;
+
+case_value
+ : YNUMBER
+ { $$ = $1; }
+ | '-' YNUMBER %prec UNARY
+ {
+ $2->numbr = -(force_number($2));
+ $$ = $2;
+ }
+ | '+' YNUMBER %prec UNARY
+ { $$ = $2; }
+ | YSTRING
+ { $$ = $1; }
+ | regexp
+ { $$ = $1; }
+ ;
+
+print
+ : LEX_PRINT
+ | LEX_PRINTF
+ ;
+
+ /*
+ * Note: ``print(x)'' is already parsed by the first rule,
+ * so there is no good in covering it by the second one too.
+ */
+print_expression_list
+ : opt_expression_list
+ | '(' exp comma expression_list r_paren
+ { $$ = node($2, Node_expression_list, $4); }
+ ;
+
+output_redir
+ : /* empty */
+ {
+ in_print = FALSE;
+ in_parens = 0;
+ $$ = NULL;
+ }
+ | IO_OUT { in_print = FALSE; in_parens = 0; } common_exp
+ {
+ $$ = node($3, $1, (NODE *) NULL);
+ if ($1 == Node_redirect_twoway
+ && $3->type == Node_K_getline
+ && $3->rnode->type == Node_redirect_twoway)
+ yyerror(_("multistage two-way pipelines don't work"));
+ }
+ ;
+
+if_statement
+ : LEX_IF '(' exp r_paren opt_nls statement
+ {
+ $$ = node($3, Node_K_if,
+ node($6, Node_if_branches, (NODE *) NULL));
+ }
+ | LEX_IF '(' exp r_paren opt_nls statement
+ LEX_ELSE opt_nls statement
+ { $$ = node($3, Node_K_if,
+ node($6, Node_if_branches, $9)); }
+ ;
+
+nls
+ : NEWLINE
+ | nls NEWLINE
+ ;
+
+opt_nls
+ : /* empty */
+ | nls
+ ;
+
+input_redir
+ : /* empty */
+ { $$ = NULL; }
+ | '<' simp_exp
+ { $$ = node($2, Node_redirect_input, (NODE *) NULL); }
+ ;
+
+opt_param_list
+ : /* empty */
+ { $$ = NULL; }
+ | param_list
+ { $$ = $1; }
+ ;
+
+param_list
+ : NAME
+ { $$ = make_param($1); }
+ | param_list comma NAME
+ { $$ = append_right($1, make_param($3)); yyerrok; }
+ | error
+ { $$ = NULL; }
+ | param_list error
+ { $$ = NULL; }
+ | param_list comma error
+ { $$ = NULL; }
+ ;
+
+/* optional expression, as in for loop */
+opt_exp
+ : /* empty */
+ { $$ = NULL; }
+ | exp
+ { $$ = $1; }
+ ;
+
+opt_expression_list
+ : /* empty */
+ { $$ = NULL; }
+ | expression_list
+ { $$ = $1; }
+ ;
+
+expression_list
+ : exp
+ { $$ = node($1, Node_expression_list, (NODE *) NULL); }
+ | expression_list comma exp
+ {
+ $$ = append_right($1,
+ node($3, Node_expression_list, (NODE *) NULL));
+ yyerrok;
+ }
+ | error
+ { $$ = NULL; }
+ | expression_list error
+ { $$ = NULL; }
+ | expression_list error exp
+ { $$ = NULL; }
+ | expression_list comma error
+ { $$ = NULL; }
+ ;
+
+/* Expressions, not including the comma operator. */
+exp : variable assign_operator exp %prec ASSIGNOP
+ {
+ if (do_lint && $3->type == Node_regex)
+ lintwarn(_("regular expression on right of assignment"));
+ $$ = node($1, $2, $3);
+ }
+ | exp LEX_AND exp
+ { $$ = node($1, Node_and, $3); }
+ | exp LEX_OR exp
+ { $$ = node($1, Node_or, $3); }
+ | exp MATCHOP exp
+ {
+ if ($1->type == Node_regex)
+ warning(_("regular expression on left of `~' or `!~' operator"));
+ $$ = node($1, $2, mk_rexp($3));
+ }
+ | exp LEX_IN NAME
+ { $$ = node(variable($3, CAN_FREE, Node_var_array), Node_in_array, $1); }
+ | exp a_relop exp %prec RELOP
+ {
+ if (do_lint && $3->type == Node_regex)
+ lintwarn(_("regular expression on right of comparison"));
+ $$ = node($1, $2, $3);
+ }
+ | exp '?' exp ':' exp
+ { $$ = node($1, Node_cond_exp, node($3, Node_if_branches, $5));}
+ | common_exp
+ { $$ = $1; }
+ ;
+
+assign_operator
+ : ASSIGN
+ { $$ = $1; }
+ | ASSIGNOP
+ { $$ = $1; }
+ | SLASH_BEFORE_EQUAL ASSIGN /* `/=' */
+ { $$ = Node_assign_quotient; }
+ ;
+
+relop_or_less
+ : RELOP
+ { $$ = $1; }
+ | '<'
+ { $$ = Node_less; }
+ ;
+a_relop
+ : relop_or_less
+ | '>'
+ { $$ = Node_greater; }
+ ;
+
+common_exp
+ : regexp
+ { $$ = $1; }
+ | '!' regexp %prec UNARY
+ {
+ $$ = node(node(make_number(0.0),
+ Node_field_spec,
+ (NODE *) NULL),
+ Node_nomatch,
+ $2);
+ }
+ | '(' expression_list r_paren LEX_IN NAME
+ { $$ = node(variable($5, CAN_FREE, Node_var_array), Node_in_array, $2); }
+ | simp_exp
+ { $$ = $1; }
+ | common_exp simp_exp %prec CONCAT_OP
+ { $$ = node($1, Node_concat, $2); }
+ ;
+
+simp_exp
+ : non_post_simp_exp
+ /* Binary operators in order of decreasing precedence. */
+ | simp_exp '^' simp_exp
+ { $$ = node($1, Node_exp, $3); }
+ | simp_exp '*' simp_exp
+ { $$ = node($1, Node_times, $3); }
+ | simp_exp '/' simp_exp
+ { $$ = node($1, Node_quotient, $3); }
+ | simp_exp '%' simp_exp
+ { $$ = node($1, Node_mod, $3); }
+ | simp_exp '+' simp_exp
+ { $$ = node($1, Node_plus, $3); }
+ | simp_exp '-' simp_exp
+ { $$ = node($1, Node_minus, $3); }
+ | LEX_GETLINE opt_variable input_redir
+ {
+ if (do_lint && parsing_end_rule && $3 == NULL)
+ lintwarn(_("non-redirected `getline' undefined inside END action"));
+ $$ = node($2, Node_K_getline, $3);
+ }
+ | simp_exp IO_IN LEX_GETLINE opt_variable
+ {
+ $$ = node($4, Node_K_getline,
+ node($1, $2, (NODE *) NULL));
+ }
+ | variable INCREMENT
+ { $$ = node($1, Node_postincrement, (NODE *) NULL); }
+ | variable DECREMENT
+ { $$ = node($1, Node_postdecrement, (NODE *) NULL); }
+ ;
+
+non_post_simp_exp
+ : '!' simp_exp %prec UNARY
+ { $$ = node($2, Node_not, (NODE *) NULL); }
+ | '(' exp r_paren
+ { $$ = $2; }
+ | LEX_BUILTIN
+ '(' opt_expression_list r_paren
+ { $$ = snode($3, Node_builtin, (int) $1); }
+ | LEX_LENGTH '(' opt_expression_list r_paren
+ { $$ = snode($3, Node_builtin, (int) $1); }
+ | LEX_LENGTH
+ {
+ if (do_lint)
+ lintwarn(_("call of `length' without parentheses is not portable"));
+ $$ = snode((NODE *) NULL, Node_builtin, (int) $1);
+ if (do_posix)
+ warning(_("call of `length' without parentheses is deprecated by POSIX"));
+ }
+ | FUNC_CALL '(' opt_expression_list r_paren
+ {
+ $$ = node($3, Node_func_call, make_string($1, strlen($1)));
+ $$->funcbody = NULL;
+ func_use($1, FUNC_USE);
+ param_sanity($3);
+ free($1);
+ }
+ | variable
+ | INCREMENT variable
+ { $$ = node($2, Node_preincrement, (NODE *) NULL); }
+ | DECREMENT variable
+ { $$ = node($2, Node_predecrement, (NODE *) NULL); }
+ | YNUMBER
+ { $$ = $1; }
+ | YSTRING
+ { $$ = $1; }
+
+ | '-' simp_exp %prec UNARY
+ {
+ if ($2->type == Node_val && ($2->flags & (STRCUR|STRING)) == 0) {
+ $2->numbr = -(force_number($2));
+ $$ = $2;
+ } else
+ $$ = node($2, Node_unary_minus, (NODE *) NULL);
+ }
+ | '+' simp_exp %prec UNARY
+ {
+ /*
+ * was: $$ = $2
+ * POSIX semantics: force a conversion to numeric type
+ */
+ $$ = node (make_number(0.0), Node_plus, $2);
+ }
+ ;
+
+opt_variable
+ : /* empty */
+ { $$ = NULL; }
+ | variable
+ { $$ = $1; }
+ ;
+
+variable
+ : NAME
+ { $$ = variable($1, CAN_FREE, Node_var_new); }
+ | NAME '[' expression_list ']'
+ {
+ NODE *n;
+
+ if ((n = lookup($1)) != NULL && ! isarray(n))
+ yyerror(_("use of non-array as array"));
+ else if ($3 == NULL) {
+ fatal(_("invalid subscript expression"));
+ } else if ($3->rnode == NULL) {
+ $$ = node(variable($1, CAN_FREE, Node_var_array), Node_subscript, $3->lnode);
+ freenode($3);
+ } else
+ $$ = node(variable($1, CAN_FREE, Node_var_array), Node_subscript, $3);
+ }
+ | '$' non_post_simp_exp
+ { $$ = node($2, Node_field_spec, (NODE *) NULL); }
+ ;
+
+l_brace
+ : '{' opt_nls
+ ;
+
+r_brace
+ : '}' opt_nls { yyerrok; }
+ ;
+
+r_paren
+ : ')' { yyerrok; }
+ ;
+
+opt_semi
+ : /* empty */
+ | semi
+ ;
+
+semi
+ : ';' { yyerrok; }
+ ;
+
+colon
+ : ':' { yyerrok; }
+ ;
+
+comma : ',' opt_nls { yyerrok; }
+ ;
+
+%%
+
+struct token {
+ const char *operator; /* text to match */
+ NODETYPE value; /* node type */
+ int class; /* lexical class */
+ unsigned flags; /* # of args. allowed and compatability */
+# define ARGS 0xFF /* 0, 1, 2, 3 args allowed (any combination */
+# define A(n) (1<<(n))
+# define VERSION_MASK 0xFF00 /* old awk is zero */
+# define NOT_OLD 0x0100 /* feature not in old awk */
+# define NOT_POSIX 0x0200 /* feature not in POSIX */
+# define GAWKX 0x0400 /* gawk extension */
+# define RESX 0x0800 /* Bell Labs Research extension */
+ NODE *(*ptr) P((NODE *)); /* function that implements this keyword */
+};
+
+/* Tokentab is sorted ascii ascending order, so it can be binary searched. */
+/* Function pointers come from declarations in awk.h. */
+
+static const struct token tokentab[] = {
+{"BEGIN", Node_illegal, LEX_BEGIN, 0, 0},
+{"END", Node_illegal, LEX_END, 0, 0},
+#ifdef ARRAYDEBUG
+{"adump", Node_builtin, LEX_BUILTIN, GAWKX|A(1), do_adump},
+#endif
+{"and", Node_builtin, LEX_BUILTIN, GAWKX|A(2), do_and},
+{"asort", Node_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_asort},
+{"asorti", Node_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_asorti},
+{"atan2", Node_builtin, LEX_BUILTIN, NOT_OLD|A(2), do_atan2},
+{"bindtextdomain", Node_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2), do_bindtextdomain},
+{"break", Node_K_break, LEX_BREAK, 0, 0},
+#ifdef ALLOW_SWITCH
+{"case", Node_K_case, LEX_CASE, GAWKX, 0},
+#endif
+{"close", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1)|A(2), do_close},
+{"compl", Node_builtin, LEX_BUILTIN, GAWKX|A(1), do_compl},
+{"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},
+#ifdef ALLOW_SWITCH
+{"default", Node_K_default, LEX_DEFAULT, GAWKX, 0},
+#endif
+{"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},
+{"exit", Node_K_exit, LEX_EXIT, 0, 0},
+{"exp", Node_builtin, LEX_BUILTIN, A(1), do_exp},
+{"extension", Node_builtin, LEX_BUILTIN, GAWKX|A(2), do_ext},
+{"fflush", Node_builtin, LEX_BUILTIN, RESX|A(0)|A(1), do_fflush},
+{"for", Node_K_for, LEX_FOR, 0, 0},
+{"func", Node_K_function, LEX_FUNCTION, NOT_POSIX|NOT_OLD, 0},
+{"function", Node_K_function, LEX_FUNCTION, NOT_OLD, 0},
+{"gensub", Node_builtin, LEX_BUILTIN, GAWKX|A(3)|A(4), do_gensub},
+{"getline", Node_K_getline, LEX_GETLINE, NOT_OLD, 0},
+{"gsub", Node_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), do_gsub},
+{"if", Node_K_if, LEX_IF, 0, 0},
+{"in", Node_illegal, LEX_IN, 0, 0},
+{"index", Node_builtin, LEX_BUILTIN, A(2), do_index},
+{"int", Node_builtin, LEX_BUILTIN, A(1), do_int},
+{"length", Node_builtin, LEX_LENGTH, A(0)|A(1), do_length},
+{"log", Node_builtin, LEX_BUILTIN, A(1), do_log},
+{"lshift", Node_builtin, LEX_BUILTIN, GAWKX|A(2), do_lshift},
+{"match", Node_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), do_match},
+{"mktime", Node_builtin, LEX_BUILTIN, GAWKX|A(1), do_mktime},
+{"next", Node_K_next, LEX_NEXT, 0, 0},
+{"nextfile", Node_K_nextfile, LEX_NEXTFILE, GAWKX, 0},
+{"or", Node_builtin, LEX_BUILTIN, GAWKX|A(2), do_or},
+{"print", Node_K_print, LEX_PRINT, 0, 0},
+{"printf", Node_K_printf, LEX_PRINTF, 0, 0},
+{"rand", Node_builtin, LEX_BUILTIN, NOT_OLD|A(0), do_rand},
+{"return", Node_K_return, LEX_RETURN, NOT_OLD, 0},
+{"rshift", Node_builtin, LEX_BUILTIN, GAWKX|A(2), do_rshift},
+{"sin", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_sin},
+{"split", Node_builtin, LEX_BUILTIN, A(2)|A(3), do_split},
+{"sprintf", Node_builtin, LEX_BUILTIN, 0, do_sprintf},
+{"sqrt", Node_builtin, LEX_BUILTIN, A(1), do_sqrt},
+{"srand", Node_builtin, LEX_BUILTIN, NOT_OLD|A(0)|A(1), do_srand},
+#if defined(GAWKDEBUG) || defined(ARRAYDEBUG) /* || ... */
+{"stopme", Node_builtin, LEX_BUILTIN, GAWKX|A(0), stopme},
+#endif
+{"strftime", Node_builtin, LEX_BUILTIN, GAWKX|A(0)|A(1)|A(2), do_strftime},
+{"strtonum", Node_builtin, LEX_BUILTIN, GAWKX|A(1), do_strtonum},
+{"sub", Node_builtin, LEX_BUILTIN, NOT_OLD|A(2)|A(3), do_sub},
+{"substr", Node_builtin, LEX_BUILTIN, A(2)|A(3), do_substr},
+#ifdef ALLOW_SWITCH
+{"switch", Node_K_switch, LEX_SWITCH, GAWKX, 0},
+#endif
+{"system", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_system},
+{"systime", Node_builtin, LEX_BUILTIN, GAWKX|A(0), do_systime},
+{"tolower", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_tolower},
+{"toupper", Node_builtin, LEX_BUILTIN, NOT_OLD|A(1), do_toupper},
+{"while", Node_K_while, LEX_WHILE, 0, 0},
+{"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 *
+getfname(register NODE *(*fptr)(NODE *))
+{
+ register int i, j;
+
+ j = sizeof(tokentab) / sizeof(tokentab[0]);
+ /* linear search, no other way to do it */
+ for (i = 0; i < j; i++)
+ if (tokentab[i].ptr == fptr)
+ return tokentab[i].operator;
+
+ return NULL;
+}
+
+/* yyerror --- print a syntax error message, show where */
+
+/*
+ * Function identifier purposely indented to avoid mangling
+ * by ansi2knr. Sigh.
+ */
+
+static void
+#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
+ yyerror(const char *m, ...)
+#else
+/* VARARGS0 */
+ yyerror(va_alist)
+ va_dcl
+#endif
+{
+ va_list args;
+ const char *mesg = NULL;
+ register char *bp, *cp;
+ char *scan;
+ char *buf;
+ int count;
+ static char end_of_file_line[] = "(END OF FILE)";
+ char save;
+
+ errcount++;
+ /* Find the current line in the input file */
+ if (lexptr && lexeme) {
+ if (thisline == NULL) {
+ cp = lexeme;
+ if (*cp == '\n') {
+ cp--;
+ mesg = _("unexpected newline or end of string");
+ }
+ for (; cp != lexptr_begin && *cp != '\n'; --cp)
+ continue;
+ if (*cp == '\n')
+ cp++;
+ thisline = cp;
+ }
+ /* NL isn't guaranteed */
+ bp = lexeme;
+ while (bp < lexend && *bp && *bp != '\n')
+ bp++;
+ } else {
+ thisline = end_of_file_line;
+ bp = thisline + strlen(thisline);
+ }
+
+ /*
+ * Saving and restoring *bp keeps valgrind happy,
+ * since the guts of glibc uses strlen, even though
+ * we're passing an explict precision. Sigh.
+ */
+ save = *bp;
+ *bp = '\0';
+
+ msg("%.*s", (int) (bp - thisline), thisline);
+
+ *bp = save;
+
+#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
+ va_start(args, m);
+ if (mesg == NULL)
+ mesg = m;
+#else
+ va_start(args);
+ if (mesg == NULL)
+ mesg = va_arg(args, char *);
+#endif
+ count = (bp - thisline) + strlen(mesg) + 2 + 1;
+ emalloc(buf, char *, count, "yyerror");
+
+ bp = buf;
+
+ if (lexptr != NULL) {
+ scan = thisline;
+ while (scan < lexeme)
+ if (*scan++ == '\t')
+ *bp++ = '\t';
+ else
+ *bp++ = ' ';
+ *bp++ = '^';
+ *bp++ = ' ';
+ }
+ strcpy(bp, mesg);
+ err("", buf, args);
+ va_end(args);
+ free(buf);
+}
+
+/* get_src_buf --- read the next buffer of source program */
+
+static char *
+get_src_buf()
+{
+ static int samefile = FALSE;
+ static int nextfile = 0;
+ static char *buf = NULL;
+ static int fd;
+ int n;
+ register char *scan;
+ static size_t len = 0;
+ static int did_newline = FALSE;
+ int newfile;
+ struct stat sbuf;
+
+# define SLOP 128 /* enough space to hold most source lines */
+
+again:
+ newfile = FALSE;
+ if (nextfile > numfiles)
+ return NULL;
+
+ if (srcfiles[nextfile].stype == CMDLINE) {
+ if (len == 0) {
+ len = strlen(srcfiles[nextfile].val);
+ if (len == 0) {
+ /*
+ * Yet Another Special case:
+ * gawk '' /path/name
+ * Sigh.
+ */
+ static int warned = FALSE;
+
+ if (do_lint && ! warned) {
+ warned = TRUE;
+ lintwarn(_("empty program text on command line"));
+ }
+ ++nextfile;
+ goto again;
+ }
+ sourceline = 1;
+ lexptr = lexptr_begin = srcfiles[nextfile].val;
+ lexend = lexptr + len;
+ } else if (! did_newline && *(lexptr-1) != '\n') {
+ /*
+ * The following goop is to ensure that the source
+ * ends with a newline and that the entire current
+ * line is available for error messages.
+ */
+ int offset;
+
+ did_newline = TRUE;
+ offset = lexptr - lexeme;
+ for (scan = lexeme; scan > lexptr_begin; scan--)
+ if (*scan == '\n') {
+ scan++;
+ break;
+ }
+ len = lexptr - scan;
+ emalloc(buf, char *, len+1, "get_src_buf");
+ memcpy(buf, scan, len);
+ thisline = buf;
+ lexptr = buf + len;
+ *lexptr = '\n';
+ lexeme = lexptr - offset;
+ lexptr_begin = buf;
+ lexend = lexptr + 1;
+ } else {
+ len = 0;
+ lexeme = lexptr = lexptr_begin = NULL;
+ }
+ if (lexptr == NULL && ++nextfile <= numfiles)
+ goto again;
+ return lexptr;
+ }
+ if (! samefile) {
+ source = srcfiles[nextfile].val;
+ if (source == NULL) {
+ if (buf != NULL) {
+ free(buf);
+ buf = NULL;
+ }
+ len = 0;
+ return lexeme = lexptr = lexptr_begin = NULL;
+ }
+ fd = pathopen(source);
+ if (fd <= INVALID_HANDLE) {
+ char *in;
+
+ /* suppress file name and line no. in error mesg */
+ in = source;
+ source = NULL;
+ fatal(_("can't open source file `%s' for reading (%s)"),
+ in, strerror(errno));
+ }
+ len = optimal_bufsize(fd, & sbuf);
+ newfile = TRUE;
+ if (buf != NULL)
+ free(buf);
+ emalloc(buf, char *, len + SLOP, "get_src_buf");
+ lexptr_begin = buf + SLOP;
+ samefile = TRUE;
+ sourceline = 1;
+ } else {
+ /*
+ * Here, we retain the current source line (up to length SLOP)
+ * in the beginning of the buffer that was overallocated above
+ */
+ int offset;
+ int linelen;
+
+ offset = lexptr - lexeme;
+ for (scan = lexeme; scan > lexptr_begin; scan--)
+ if (*scan == '\n') {
+ scan++;
+ break;
+ }
+ linelen = lexptr - scan;
+ if (linelen > SLOP)
+ linelen = SLOP;
+ thisline = buf + SLOP - linelen;
+ memcpy(thisline, scan, linelen);
+ lexeme = buf + SLOP - offset;
+ lexptr_begin = thisline;
+ }
+ n = read(fd, buf + SLOP, len);
+ if (n == -1)
+ fatal(_("can't read sourcefile `%s' (%s)"),
+ source, strerror(errno));
+ if (n == 0) {
+ if (newfile) {
+ static int warned = FALSE;
+
+ if (do_lint && ! warned) {
+ warned = TRUE;
+ lintwarn(_("source file `%s' is empty"), source);
+ }
+ }
+ if (fd != fileno(stdin)) /* safety */
+ close(fd);
+ samefile = FALSE;
+ nextfile++;
+ if (lexeme)
+ *lexeme = '\0';
+ len = 0;
+ goto again;
+ }
+ lexptr = buf + SLOP;
+ lexend = lexptr + n;
+ return buf;
+}
+
+/* tokadd --- add a character to the token buffer */
+
+#define tokadd(x) (*tok++ = (x), tok == tokend ? tokexpand() : tok)
+
+/* tokexpand --- grow the token buffer */
+
+char *
+tokexpand()
+{
+ static int toksize = 60;
+ int tokoffset;
+
+ tokoffset = tok - tokstart;
+ toksize *= 2;
+ if (tokstart != NULL)
+ erealloc(tokstart, char *, toksize, "tokexpand");
+ else
+ emalloc(tokstart, char *, toksize, "tokexpand");
+ tokend = tokstart + toksize;
+ tok = tokstart + tokoffset;
+ return tok;
+}
+
+/* nextc --- get the next input character */
+
+#ifdef MBS_SUPPORT
+
+static int
+nextc(void)
+{
+ if (gawk_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(void)
+{
+ 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
+#define nextc() ((lexptr && lexptr < lexend) ? \
+ ((int) (unsigned char) *lexptr++) : \
+ (get_src_buf() ? ((int) (unsigned char) *lexptr++) : EOF) \
+ )
+#endif
+
+#endif /* MBS_SUPPORT */
+
+/* pushback --- push a character back on the input */
+
+#ifdef MBS_SUPPORT
+
+static void
+pushback(void)
+{
+ if (gawk_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
+allow_newline(void)
+{
+ int c;
+
+ for (;;) {
+ c = nextc();
+ if (c == EOF)
+ break;
+ if (c == '#') {
+ while ((c = nextc()) != '\n' && c != EOF)
+ continue;
+ if (c == EOF)
+ break;
+ }
+ if (c == '\n')
+ sourceline++;
+ if (! ISSPACE(c)) {
+ pushback();
+ break;
+ }
+ }
+}
+
+/* yylex --- Read the input and turn it into tokens. */
+
+static int
+yylex(void)
+{
+ register int c;
+ int seen_e = FALSE; /* These are for numbers */
+ int seen_point = FALSE;
+ int esc_seen; /* for literal strings */
+ int low, mid, high;
+ static int did_newline = FALSE;
+ char *tokkey;
+ static int lasttok = 0, eof_warned = FALSE;
+ int inhex = FALSE;
+ int intlstr = FALSE;
+
+ if (nextc() == EOF) {
+ if (lasttok != NEWLINE) {
+ lasttok = NEWLINE;
+ if (do_lint && ! eof_warned) {
+ lintwarn(_("source file does not end in newline"));
+ eof_warned = TRUE;
+ }
+ return NEWLINE; /* fake it */
+ }
+ return 0;
+ }
+ pushback();
+#if defined OS2 || defined __EMX__
+ /*
+ * added for OS/2's extproc feature of cmd.exe
+ * (like #! in BSD sh)
+ */
+ if (strncasecmp(lexptr, "extproc ", 8) == 0) {
+ while (*lexptr && *lexptr != '\n')
+ lexptr++;
+ }
+#endif
+ lexeme = lexptr;
+ thisline = NULL;
+ if (want_regexp) {
+ int in_brack = 0; /* count brackets, [[:alnum:]] allowed */
+ /*
+ * Counting brackets is non-trivial. [[] is ok,
+ * and so is [\]], with a point being that /[/]/ as a regexp
+ * constant has to work.
+ *
+ * Do not count [ or ] if either one is preceded by a \.
+ * A `[' should be counted if
+ * a) it is the first one so far (in_brack == 0)
+ * b) it is the `[' in `[:'
+ * A ']' should be counted if not preceded by a \, since
+ * it is either closing `:]' or just a plain list.
+ * According to POSIX, []] is how you put a ] into a set.
+ * Try to handle that too.
+ *
+ * The code for \ handles \[ and \].
+ */
+
+ want_regexp = FALSE;
+ tok = tokstart;
+ for (;;) {
+ c = nextc();
+#ifdef MBS_SUPPORT
+ if (gawk_mb_cur_max == 1 || nextc_is_1stbyte)
+#endif
+ switch (c) {
+ case '[':
+ /* one day check for `.' and `=' too */
+ if (nextc() == ':' || in_brack == 0)
+ in_brack++;
+ pushback();
+ break;
+ case ']':
+ if (tokstart[0] == '['
+ && (tok == tokstart + 1
+ || (tok == tokstart + 2
+ && tokstart[1] == '^')))
+ /* do nothing */;
+ else
+ in_brack--;
+ break;
+ case '\\':
+ if ((c = nextc()) == EOF) {
+ yyerror(_("unterminated regexp ends with `\\' at end of file"));
+ goto end_regexp; /* kludge */
+ } else if (c == '\n') {
+ sourceline++;
+ continue;
+ } else {
+ tokadd('\\');
+ tokadd(c);
+ continue;
+ }
+ break;
+ case '/': /* end of the regexp */
+ if (in_brack > 0)
+ break;
+end_regexp:
+ tokadd('\0');
+ yylval.sval = tokstart;
+ return lasttok = REGEXP;
+ case '\n':
+ pushback();
+ yyerror(_("unterminated regexp"));
+ goto end_regexp; /* kludge */
+ case EOF:
+ yyerror(_("unterminated regexp at end of file"));
+ goto end_regexp; /* kludge */
+ }
+ tokadd(c);
+ }
+ }
+retry:
+ while ((c = nextc()) == ' ' || c == '\t')
+ continue;
+
+ lexeme = lexptr ? lexptr - 1 : lexptr;
+ thisline = NULL;
+ tok = tokstart;
+ yylval.nodetypeval = Node_illegal;
+
+#ifdef MBS_SUPPORT
+ if (gawk_mb_cur_max == 1 || nextc_is_1stbyte)
+#endif
+ switch (c) {
+ case EOF:
+ if (lasttok != NEWLINE) {
+ lasttok = NEWLINE;
+ if (do_lint && ! eof_warned) {
+ lintwarn(_("source file does not end in newline"));
+ eof_warned = TRUE;
+ }
+ return NEWLINE; /* fake it */
+ }
+ return 0;
+
+ case '\n':
+ sourceline++;
+ return lasttok = NEWLINE;
+
+ case '#': /* it's a comment */
+ while ((c = nextc()) != '\n') {
+ if (c == EOF) {
+ if (lasttok != NEWLINE) {
+ lasttok = NEWLINE;
+ if (do_lint && ! eof_warned) {
+ lintwarn(
+ _("source file does not end in newline"));
+ eof_warned = TRUE;
+ }
+ return NEWLINE; /* fake it */
+ }
+ return 0;
+ }
+ }
+ sourceline++;
+ return lasttok = NEWLINE;
+
+ case '\\':
+#ifdef RELAXED_CONTINUATION
+ /*
+ * This code puports to allow comments and/or whitespace
+ * after the `\' at the end of a line used for continuation.
+ * Use it at your own risk. We think it's a bad idea, which
+ * is why it's not on by default.
+ */
+ if (! do_traditional) {
+ /* strip trailing white-space and/or comment */
+ while ((c = nextc()) == ' ' || c == '\t')
+ continue;
+ if (c == '#') {
+ if (do_lint)
+ lintwarn(
+ _("use of `\\ #...' line continuation is not portable"));
+ while ((c = nextc()) != '\n')
+ if (c == EOF)
+ break;
+ }
+ pushback();
+ }
+#endif /* RELAXED_CONTINUATION */
+ if (nextc() == '\n') {
+ sourceline++;
+ goto retry;
+ } else {
+ yyerror(_("backslash not last character on line"));
+ exit(1);
+ }
+ break;
+
+ case ':':
+ case '?':
+ if (! do_posix)
+ allow_newline();
+ return lasttok = c;
+
+ /*
+ * in_parens is undefined unless we are parsing a print
+ * statement (in_print), but why bother with a check?
+ */
+ case ')':
+ in_parens--;
+ return lasttok = c;
+
+ case '(':
+ in_parens++;
+ /* FALL THROUGH */
+ case '$':
+ case ';':
+ case '{':
+ case ',':
+ case '[':
+ case ']':
+ return lasttok = c;
+
+ case '*':
+ if ((c = nextc()) == '=') {
+ yylval.nodetypeval = Node_assign_times;
+ return lasttok = ASSIGNOP;
+ } else if (do_posix) {
+ pushback();
+ return lasttok = '*';
+ } else if (c == '*') {
+ /* make ** and **= aliases for ^ and ^= */
+ static int did_warn_op = FALSE, did_warn_assgn = FALSE;
+
+ if (nextc() == '=') {
+ if (! did_warn_assgn) {
+ did_warn_assgn = TRUE;
+ if (do_lint)
+ lintwarn(_("POSIX does not allow operator `**='"));
+ if (do_lint_old)
+ warning(_("old awk does not support operator `**='"));
+ }
+ yylval.nodetypeval = Node_assign_exp;
+ return ASSIGNOP;
+ } else {
+ pushback();
+ if (! did_warn_op) {
+ did_warn_op = TRUE;
+ if (do_lint)
+ lintwarn(_("POSIX does not allow operator `**'"));
+ if (do_lint_old)
+ warning(_("old awk does not support operator `**'"));
+ }
+ return lasttok = '^';
+ }
+ }
+ pushback();
+ return lasttok = '*';
+
+ case '/':
+ if (nextc() == '=') {
+ pushback();
+ return lasttok = SLASH_BEFORE_EQUAL;
+ }
+ pushback();
+ return lasttok = '/';
+
+ case '%':
+ if (nextc() == '=') {
+ yylval.nodetypeval = Node_assign_mod;
+ return lasttok = ASSIGNOP;
+ }
+ pushback();
+ return lasttok = '%';
+
+ case '^':
+ {
+ static int did_warn_op = FALSE, did_warn_assgn = FALSE;
+
+ if (nextc() == '=') {
+ if (do_lint_old && ! did_warn_assgn) {
+ did_warn_assgn = TRUE;
+ warning(_("operator `^=' is not supported in old awk"));
+ }
+ yylval.nodetypeval = Node_assign_exp;
+ return lasttok = ASSIGNOP;
+ }
+ pushback();
+ if (do_lint_old && ! did_warn_op) {
+ did_warn_op = TRUE;
+ warning(_("operator `^' is not supported in old awk"));
+ }
+ return lasttok = '^';
+ }
+
+ case '+':
+ if ((c = nextc()) == '=') {
+ yylval.nodetypeval = Node_assign_plus;
+ return lasttok = ASSIGNOP;
+ }
+ if (c == '+')
+ return lasttok = INCREMENT;
+ pushback();
+ return lasttok = '+';
+
+ case '!':
+ if ((c = nextc()) == '=') {
+ yylval.nodetypeval = Node_notequal;
+ return lasttok = RELOP;
+ }
+ if (c == '~') {
+ yylval.nodetypeval = Node_nomatch;
+ return lasttok = MATCHOP;
+ }
+ pushback();
+ return lasttok = '!';
+
+ case '<':
+ if (nextc() == '=') {
+ yylval.nodetypeval = Node_leq;
+ return lasttok = RELOP;
+ }
+ yylval.nodetypeval = Node_less;
+ pushback();
+ return lasttok = '<';
+
+ case '=':
+ if (nextc() == '=') {
+ yylval.nodetypeval = Node_equal;
+ return lasttok = RELOP;
+ }
+ yylval.nodetypeval = Node_assign;
+ pushback();
+ return lasttok = ASSIGN;
+
+ case '>':
+ if ((c = nextc()) == '=') {
+ yylval.nodetypeval = Node_geq;
+ return lasttok = RELOP;
+ } else if (c == '>') {
+ yylval.nodetypeval = Node_redirect_append;
+ return lasttok = IO_OUT;
+ }
+ pushback();
+ if (in_print && in_parens == 0) {
+ yylval.nodetypeval = Node_redirect_output;
+ return lasttok = IO_OUT;
+ }
+ yylval.nodetypeval = Node_greater;
+ return lasttok = '>';
+
+ case '~':
+ yylval.nodetypeval = Node_match;
+ return lasttok = MATCHOP;
+
+ case '}':
+ /*
+ * Added did newline stuff. Easier than
+ * hacking the grammar.
+ */
+ if (did_newline) {
+ did_newline = FALSE;
+ return lasttok = c;
+ }
+ did_newline++;
+ --lexptr; /* pick up } next time */
+ return lasttok = NEWLINE;
+
+ case '"':
+ string:
+ esc_seen = FALSE;
+ while ((c = nextc()) != '"') {
+ if (c == '\n') {
+ pushback();
+ yyerror(_("unterminated string"));
+ exit(1);
+ }
+#ifdef MBS_SUPPORT
+ if (gawk_mb_cur_max == 1 || nextc_is_1stbyte)
+#endif
+ if (c == '\\') {
+ c = nextc();
+ if (c == '\n') {
+ sourceline++;
+ continue;
+ }
+ esc_seen = TRUE;
+ tokadd('\\');
+ }
+ if (c == EOF) {
+ pushback();
+ yyerror(_("unterminated string"));
+ exit(1);
+ }
+ tokadd(c);
+ }
+ yylval.nodeval = make_str_node(tokstart,
+ tok - tokstart, esc_seen ? SCAN : 0);
+ yylval.nodeval->flags |= PERM;
+ if (intlstr) {
+ yylval.nodeval->flags |= INTLSTR;
+ intlstr = FALSE;
+ if (do_intl)
+ dumpintlstr(yylval.nodeval->stptr,
+ yylval.nodeval->stlen);
+ }
+ return lasttok = YSTRING;
+
+ case '-':
+ if ((c = nextc()) == '=') {
+ yylval.nodetypeval = Node_assign_minus;
+ return lasttok = ASSIGNOP;
+ }
+ if (c == '-')
+ return lasttok = DECREMENT;
+ pushback();
+ return lasttok = '-';
+
+ case '.':
+ c = nextc();
+ pushback();
+ if (! ISDIGIT(c))
+ return lasttok = '.';
+ else
+ c = '.';
+ /* FALL THROUGH */
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ /* It's a number */
+ for (;;) {
+ int gotnumber = FALSE;
+
+ tokadd(c);
+ switch (c) {
+ case 'x':
+ case 'X':
+ if (do_traditional)
+ goto done;
+ if (tok == tokstart + 2)
+ inhex = TRUE;
+ break;
+ case '.':
+ if (seen_point) {
+ gotnumber = TRUE;
+ break;
+ }
+ seen_point = TRUE;
+ break;
+ case 'e':
+ case 'E':
+ if (inhex)
+ break;
+ if (seen_e) {
+ gotnumber = TRUE;
+ break;
+ }
+ seen_e = TRUE;
+ if ((c = nextc()) == '-' || c == '+')
+ tokadd(c);
+ else
+ pushback();
+ break;
+ case 'a':
+ case 'A':
+ case 'b':
+ case 'B':
+ case 'c':
+ case 'C':
+ case 'D':
+ case 'd':
+ case 'f':
+ case 'F':
+ if (do_traditional || ! inhex)
+ goto done;
+ /* fall through */
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ break;
+ default:
+ done:
+ gotnumber = TRUE;
+ }
+ if (gotnumber)
+ break;
+ c = nextc();
+ }
+ if (c != EOF)
+ pushback();
+ else if (do_lint && ! eof_warned) {
+ lintwarn(_("source file does not end in newline"));
+ eof_warned = TRUE;
+ }
+ tokadd('\0');
+ if (! do_traditional && isnondecimal(tokstart)) {
+ static short warned = FALSE;
+ if (do_lint && ! warned) {
+ warned = TRUE;
+ lintwarn("numeric constant `%.*s' treated as octal or hexadecimal",
+ strlen(tokstart)-1, tokstart);
+ }
+ yylval.nodeval = make_number(nondec2awknum(tokstart, strlen(tokstart)));
+ } else
+ yylval.nodeval = make_number(atof(tokstart));
+ yylval.nodeval->flags |= PERM;
+ return lasttok = YNUMBER;
+
+ case '&':
+ if ((c = nextc()) == '&') {
+ yylval.nodetypeval = Node_and;
+ allow_newline();
+ return lasttok = LEX_AND;
+ }
+ pushback();
+ return lasttok = '&';
+
+ case '|':
+ if ((c = nextc()) == '|') {
+ yylval.nodetypeval = Node_or;
+ allow_newline();
+ return lasttok = LEX_OR;
+ } else if (! do_traditional && c == '&') {
+ yylval.nodetypeval = Node_redirect_twoway;
+ return lasttok = (in_print && in_parens == 0 ? IO_OUT : IO_IN);
+ }
+ pushback();
+ if (in_print && in_parens == 0) {
+ yylval.nodetypeval = Node_redirect_pipe;
+ return lasttok = IO_OUT;
+ } else {
+ yylval.nodetypeval = Node_redirect_pipein;
+ return lasttok = IO_IN;
+ }
+ }
+
+ if (c != '_' && ! ISALPHA(c)) {
+ yyerror(_("invalid char '%c' in expression"), c);
+ exit(1);
+ }
+
+ /*
+ * Lots of fog here. Consider:
+ *
+ * print "xyzzy"$_"foo"
+ *
+ * Without the check for ` lasttok != '$'' ', this is parsed as
+ *
+ * print "xxyzz" $(_"foo")
+ *
+ * With the check, it is "correctly" parsed as three
+ * string concatenations. Sigh. This seems to be
+ * "more correct", but this is definitely one of those
+ * occasions where the interactions are funny.
+ */
+ if (! do_traditional && c == '_' && lasttok != '$') {
+ if ((c = nextc()) == '"') {
+ intlstr = TRUE;
+ goto string;
+ }
+ pushback();
+ c = '_';
+ }
+
+ /* it's some type of name-type-thing. Find its length. */
+ tok = tokstart;
+ while (is_identchar(c)) {
+ tokadd(c);
+ c = nextc();
+ }
+ tokadd('\0');
+ emalloc(tokkey, char *, tok - tokstart, "yylex");
+ memcpy(tokkey, tokstart, tok - tokstart);
+ if (c != EOF)
+ pushback();
+ else if (do_lint && ! eof_warned) {
+ lintwarn(_("source file does not end in newline"));
+ eof_warned = TRUE;
+ }
+
+ /* See if it is a special token. */
+ low = 0;
+ high = (sizeof(tokentab) / sizeof(tokentab[0])) - 1;
+ while (low <= high) {
+ int i;
+
+ mid = (low + high) / 2;
+ c = *tokstart - tokentab[mid].operator[0];
+ i = c ? c : strcmp(tokstart, tokentab[mid].operator);
+
+ if (i < 0) /* token < mid */
+ high = mid - 1;
+ else if (i > 0) /* token > mid */
+ low = mid + 1;
+ else {
+ if (do_lint) {
+ if (tokentab[mid].flags & GAWKX)
+ lintwarn(_("`%s' is a gawk extension"),
+ tokentab[mid].operator);
+ if (tokentab[mid].flags & RESX)
+ lintwarn(_("`%s' is a Bell Labs extension"),
+ tokentab[mid].operator);
+ if (tokentab[mid].flags & NOT_POSIX)
+ lintwarn(_("POSIX does not allow `%s'"),
+ tokentab[mid].operator);
+ }
+ if (do_lint_old && (tokentab[mid].flags & NOT_OLD))
+ warning(_("`%s' is not supported in old awk"),
+ tokentab[mid].operator);
+ if ((do_traditional && (tokentab[mid].flags & GAWKX))
+ || (do_posix && (tokentab[mid].flags & NOT_POSIX)))
+ break;
+ if (tokentab[mid].class == LEX_BUILTIN
+ || tokentab[mid].class == LEX_LENGTH
+ )
+ yylval.lval = mid;
+ else
+ yylval.nodetypeval = tokentab[mid].value;
+
+ free(tokkey);
+ return lasttok = tokentab[mid].class;
+ }
+ }
+
+ yylval.sval = tokkey;
+ if (*lexptr == '(')
+ return lasttok = FUNC_CALL;
+ else {
+ static short goto_warned = FALSE;
+
+#define SMART_ALECK 1
+ if (SMART_ALECK && do_lint
+ && ! goto_warned && strcasecmp(tokkey, "goto") == 0) {
+ goto_warned = TRUE;
+ lintwarn(_("`goto' considered harmful!\n"));
+ }
+ return lasttok = NAME;
+ }
+}
+
+/* node_common --- common code for allocating a new node */
+
+static NODE *
+node_common(NODETYPE op)
+{
+ register NODE *r;
+
+ getnode(r);
+ r->type = op;
+ r->flags = MALLOC;
+ /* if lookahead is NL, lineno is 1 too high */
+ if (lexeme && *lexeme == '\n')
+ r->source_line = sourceline - 1;
+ else
+ r->source_line = sourceline;
+ r->source_file = source;
+ return r;
+}
+
+/* node --- allocates a node with defined lnode and rnode. */
+
+NODE *
+node(NODE *left, NODETYPE op, NODE *right)
+{
+ register NODE *r;
+
+ r = node_common(op);
+ r->lnode = left;
+ r->rnode = right;
+ return r;
+}
+
+/* snode --- allocate a node with defined subnode and builtin for builtin
+ functions. Checks for arg. count and supplies defaults where
+ possible. */
+
+static NODE *
+snode(NODE *subn, NODETYPE op, int idx)
+{
+ register NODE *r;
+ register NODE *n;
+ int nexp = 0;
+ int args_allowed;
+
+ r = node_common(op);
+
+ /* traverse expression list to see how many args. given */
+ for (n = subn; n != NULL; n = n->rnode) {
+ nexp++;
+ if (nexp > 5)
+ break;
+ }
+
+ /* check against how many args. are allowed for this builtin */
+ args_allowed = tokentab[idx].flags & ARGS;
+ if (args_allowed && (args_allowed & A(nexp)) == 0)
+ fatal(_("%d is invalid as number of arguments for %s"),
+ nexp, tokentab[idx].operator);
+
+ r->builtin = tokentab[idx].ptr;
+
+ /* special case processing for a few builtins */
+ if (nexp == 0 && r->builtin == do_length) {
+ subn = node(node(make_number(0.0), Node_field_spec, (NODE *) NULL),
+ Node_expression_list,
+ (NODE *) NULL);
+ } else if (r->builtin == do_match) {
+ static short warned = FALSE;
+
+ if (subn->rnode->lnode->type != Node_regex)
+ subn->rnode->lnode = mk_rexp(subn->rnode->lnode);
+
+ if (subn->rnode->rnode != NULL) { /* 3rd argument there */
+ if (do_lint && ! warned) {
+ warned = TRUE;
+ lintwarn(_("match: third argument is a gawk extension"));
+ }
+ if (do_traditional)
+ fatal(_("match: third argument is a gawk extension"));
+ }
+ } else if (r->builtin == do_sub || r->builtin == do_gsub) {
+ if (subn->lnode->type != Node_regex)
+ subn->lnode = mk_rexp(subn->lnode);
+ if (nexp == 2)
+ append_right(subn, node(node(make_number(0.0),
+ Node_field_spec,
+ (NODE *) NULL),
+ Node_expression_list,
+ (NODE *) NULL));
+ else if (subn->rnode->rnode->lnode->type == Node_val) {
+ if (do_lint)
+ lintwarn(_("%s: string literal as last arg of substitute has no effect"),
+ (r->builtin == do_sub) ? "sub" : "gsub");
+ } else if (! isassignable(subn->rnode->rnode->lnode)) {
+ yyerror(_("%s third parameter is not a changeable object"),
+ (r->builtin == do_sub) ? "sub" : "gsub");
+ }
+ } else if (r->builtin == do_gensub) {
+ if (subn->lnode->type != Node_regex)
+ subn->lnode = mk_rexp(subn->lnode);
+ if (nexp == 3)
+ append_right(subn, node(node(make_number(0.0),
+ Node_field_spec,
+ (NODE *) NULL),
+ Node_expression_list,
+ (NODE *) NULL));
+ } else if (r->builtin == do_split) {
+ if (nexp == 2)
+ append_right(subn,
+ node(FS_node, Node_expression_list, (NODE *) NULL));
+ n = subn->rnode->rnode->lnode;
+ if (n->type != Node_regex)
+ subn->rnode->rnode->lnode = mk_rexp(n);
+ if (nexp == 2)
+ subn->rnode->rnode->lnode->re_flags |= FS_DFLT;
+ } else if (r->builtin == do_close) {
+ static short warned = FALSE;
+
+ if ( nexp == 2) {
+ if (do_lint && nexp == 2 && ! warned) {
+ warned = TRUE;
+ lintwarn(_("close: second argument is a gawk extension"));
+ }
+ if (do_traditional)
+ fatal(_("close: second argument is a gawk extension"));
+ }
+ } else if (do_intl /* --gen-po */
+ && r->builtin == do_dcgettext /* dcgettext(...) */
+ && subn->lnode->type == Node_val /* 1st arg is constant */
+ && (subn->lnode->flags & STRCUR) != 0) { /* it's a string constant */
+ /* ala xgettext, dcgettext("some string" ...) dumps the string */
+ NODE *str = subn->lnode;
+
+ if ((str->flags & INTLSTR) != 0)
+ warning(_("use of dcgettext(_\"...\") is incorrect: remove leading underscore"));
+ /* don't dump it, the lexer already did */
+ else
+ dumpintlstr(str->stptr, str->stlen);
+ } else if (do_intl /* --gen-po */
+ && r->builtin == do_dcngettext /* dcngettext(...) */
+ && subn->lnode->type == Node_val /* 1st arg is constant */
+ && (subn->lnode->flags & STRCUR) != 0 /* it's a string constant */
+ && subn->rnode->lnode->type == Node_val /* 2nd arg is constant too */
+ && (subn->rnode->lnode->flags & STRCUR) != 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->builtin == do_sprintf) {
+ count_args(r);
+ r->lnode->printf_count = r->printf_count; /* hack */
+ }
+ return r;
+}
+
+/* make_for_loop --- build a for loop */
+
+static NODE *
+make_for_loop(NODE *init, NODE *cond, NODE *incr)
+{
+ register FOR_LOOP_HEADER *r;
+ NODE *n;
+
+ emalloc(r, FOR_LOOP_HEADER *, sizeof(FOR_LOOP_HEADER), "make_for_loop");
+ getnode(n);
+ n->type = Node_illegal;
+ r->init = init;
+ r->cond = cond;
+ r->incr = incr;
+ n->sub.nodep.r.hd = r;
+ return n;
+}
+
+/* dup_parms --- return TRUE if there are duplicate parameters */
+
+static int
+dup_parms(NODE *func)
+{
+ register NODE *np;
+ const char *fname, **names;
+ int count, i, j, dups;
+ NODE *params;
+
+ if (func == NULL) /* error earlier */
+ return TRUE;
+
+ fname = func->param;
+ count = func->param_cnt;
+ params = func->rnode;
+
+ if (count == 0) /* no args, no problem */
+ return FALSE;
+
+ if (params == NULL) /* error earlier */
+ return TRUE;
+
+ emalloc(names, const char **, count * sizeof(char *), "dup_parms");
+
+ i = 0;
+ for (np = params; np != NULL; np = np->rnode) {
+ if (np->param == NULL) { /* error earlier, give up, go home */
+ free(names);
+ return TRUE;
+ }
+ names[i++] = np->param;
+ }
+
+ dups = 0;
+ for (i = 1; i < count; i++) {
+ for (j = 0; j < i; j++) {
+ if (strcmp(names[i], names[j]) == 0) {
+ dups++;
+ error(
+ _("function `%s': parameter #%d, `%s', duplicates parameter #%d"),
+ fname, i+1, names[j], j+1);
+ }
+ }
+ }
+
+ free(names);
+ return (dups > 0 ? TRUE : FALSE);
+}
+
+/* parms_shadow --- check if parameters shadow globals */
+
+static int
+parms_shadow(const char *fname, NODE *func)
+{
+ int count, i;
+ int ret = FALSE;
+
+ if (fname == NULL || func == NULL) /* error earlier */
+ return FALSE;
+
+ count = func->lnode->param_cnt;
+
+ if (count == 0) /* no args, no problem */
+ return FALSE;
+
+ /*
+ * Use warning() and not lintwarn() so that can warn
+ * about all shadowed parameters.
+ */
+ for (i = 0; i < count; i++) {
+ if (lookup(func->parmlist[i]) != NULL) {
+ warning(
+ _("function `%s': parameter `%s' shadows global variable"),
+ fname, func->parmlist[i]);
+ ret = TRUE;
+ }
+ }
+
+ return ret;
+}
+
+/*
+ * install:
+ * Install a name in the symbol table, even if it is already there.
+ * Caller must check against redefinition if that is desired.
+ */
+
+NODE *
+install(char *name, NODE *value)
+{
+ register NODE *hp;
+ register size_t len;
+ register int bucket;
+
+ var_count++;
+ len = strlen(name);
+ bucket = hash(name, len, (unsigned long) HASHSIZE);
+ getnode(hp);
+ hp->type = Node_hashnode;
+ hp->hnext = variables[bucket];
+ variables[bucket] = hp;
+ hp->hlength = len;
+ hp->hvalue = value;
+ hp->hname = name;
+ hp->hvalue->vname = name;
+ return hp->hvalue;
+}
+
+/* lookup --- find the most recent hash node for name installed by install */
+
+NODE *
+lookup(const char *name)
+{
+ register NODE *bucket;
+ register size_t len;
+
+ len = strlen(name);
+ for (bucket = variables[hash(name, len, (unsigned long) HASHSIZE)];
+ bucket != NULL; bucket = bucket->hnext)
+ if (bucket->hlength == len && STREQN(bucket->hname, name, len))
+ return bucket->hvalue;
+
+ return NULL;
+}
+
+/* var_comp --- compare two variable names */
+
+static int
+var_comp(const void *v1, const void *v2)
+{
+ const NODE *const *npp1, *const *npp2;
+ const NODE *n1, *n2;
+ int minlen;
+
+ npp1 = (const NODE *const *) v1;
+ npp2 = (const NODE *const *) v2;
+ n1 = *npp1;
+ n2 = *npp2;
+
+ if (n1->hlength > n2->hlength)
+ minlen = n1->hlength;
+ else
+ minlen = n2->hlength;
+
+ return strncmp(n1->hname, n2->hname, minlen);
+}
+
+/* valinfo --- dump var info */
+
+static void
+valinfo(NODE *n, FILE *fp)
+{
+ if (n->flags & STRING) {
+ fprintf(fp, "string (");
+ pp_string_fp(fp, n->stptr, n->stlen, '"', FALSE);
+ fprintf(fp, ")\n");
+ } else if (n->flags & NUMBER)
+ fprintf(fp, "number (%.17g)\n", n->numbr);
+ else if (n->flags & STRCUR) {
+ fprintf(fp, "string value (");
+ pp_string_fp(fp, n->stptr, n->stlen, '"', FALSE);
+ fprintf(fp, ")\n");
+ } else if (n->flags & NUMCUR)
+ fprintf(fp, "number value (%.17g)\n", n->numbr);
+ else
+ fprintf(fp, "?? flags %s\n", flags2str(n->flags));
+}
+
+
+/* dump_vars --- dump the symbol table */
+
+void
+dump_vars(const char *fname)
+{
+ int i, j;
+ NODE **table;
+ NODE *p;
+ FILE *fp;
+
+ emalloc(table, NODE **, var_count * sizeof(NODE *), "dump_vars");
+
+ if (fname == NULL)
+ fp = stderr;
+ else if ((fp = fopen(fname, "w")) == NULL) {
+ warning(_("could not open `%s' for writing (%s)"), fname, strerror(errno));
+ warning(_("sending profile to standard error"));
+ fp = stderr;
+ }
+
+ for (i = j = 0; i < HASHSIZE; i++)
+ for (p = variables[i]; p != NULL; p = p->hnext)
+ table[j++] = p;
+
+ assert(j == var_count);
+
+ /* Shazzam! */
+ qsort(table, j, sizeof(NODE *), var_comp);
+
+ for (i = 0; i < j; i++) {
+ p = table[i];
+ if (p->hvalue->type == Node_func)
+ continue;
+ fprintf(fp, "%.*s: ", (int) p->hlength, p->hname);
+ if (p->hvalue->type == Node_var_array)
+ fprintf(fp, "array, %ld elements\n", p->hvalue->table_size);
+ else if (p->hvalue->type == Node_var_new)
+ fprintf(fp, "unused variable\n");
+ else if (p->hvalue->type == Node_var)
+ valinfo(p->hvalue->var_value, fp);
+ else {
+ NODE **lhs = get_lhs(p->hvalue, NULL, FALSE);
+
+ valinfo(*lhs, fp);
+ }
+ }
+
+ if (fp != stderr && fclose(fp) != 0)
+ warning(_("%s: close failed (%s)"), fname, strerror(errno));
+
+ free(table);
+}
+
+/* release_all_vars --- free all variable memory */
+
+void
+release_all_vars()
+{
+ int i;
+ NODE *p, *next;
+
+ for (i = 0; i < HASHSIZE; i++)
+ for (p = variables[i]; p != NULL; p = next) {
+ next = p->hnext;
+
+ if (p->hvalue->type == Node_func)
+ continue;
+ else if (p->hvalue->type == Node_var_array)
+ assoc_clear(p->hvalue);
+ else if (p->hvalue->type != Node_var_new) {
+ NODE **lhs = get_lhs(p->hvalue, NULL, FALSE);
+
+ unref(*lhs);
+ }
+ unref(p);
+ }
+}
+
+/* finfo --- for use in comparison and sorting of function names */
+
+struct finfo {
+ const char *name;
+ size_t nlen;
+ NODE *func;
+};
+
+/* fcompare --- comparison function for qsort */
+
+static int
+fcompare(const void *p1, const void *p2)
+{
+ const struct finfo *f1, *f2;
+ int minlen;
+
+ f1 = (const struct finfo *) p1;
+ f2 = (const struct finfo *) p2;
+
+ if (f1->nlen > f2->nlen)
+ minlen = f2->nlen;
+ else
+ minlen = f1->nlen;
+
+ return strncmp(f1->name, f2->name, minlen);
+}
+
+/* dump_funcs --- print all functions */
+
+void
+dump_funcs()
+{
+ int i, j;
+ NODE *p;
+ static struct finfo *tab = NULL;
+
+ if (func_count == 0)
+ return;
+
+ /*
+ * Walk through symbol table countng functions.
+ * Could be more than func_count if there are
+ * extension functions.
+ */
+ for (i = j = 0; i < HASHSIZE; i++) {
+ for (p = variables[i]; p != NULL; p = p->hnext) {
+ if (p->hvalue->type == Node_func) {
+ j++;
+ }
+ }
+ }
+
+ if (tab == NULL)
+ emalloc(tab, struct finfo *, j * sizeof(struct finfo), "dump_funcs");
+
+ /* now walk again, copying info */
+ for (i = j = 0; i < HASHSIZE; i++) {
+ for (p = variables[i]; p != NULL; p = p->hnext) {
+ if (p->hvalue->type == Node_func) {
+ tab[j].name = p->hname;
+ tab[j].nlen = p->hlength;
+ tab[j].func = p->hvalue;
+ j++;
+ }
+ }
+ }
+
+
+ /* Shazzam! */
+ qsort(tab, j, sizeof(struct finfo), fcompare);
+
+ for (i = 0; i < j; i++)
+ pp_func(tab[i].name, tab[i].nlen, tab[i].func);
+
+ free(tab);
+}
+
+/* shadow_funcs --- check all functions for parameters that shadow globals */
+
+void
+shadow_funcs()
+{
+ int i, j;
+ NODE *p;
+ struct finfo *tab;
+ static int calls = 0;
+ int shadow = FALSE;
+
+ if (func_count == 0)
+ return;
+
+ if (calls++ != 0)
+ fatal(_("shadow_funcs() called twice!"));
+
+ emalloc(tab, struct finfo *, func_count * sizeof(struct finfo), "shadow_funcs");
+
+ for (i = j = 0; i < HASHSIZE; i++) {
+ for (p = variables[i]; p != NULL; p = p->hnext) {
+ if (p->hvalue->type == Node_func) {
+ tab[j].name = p->hname;
+ tab[j].nlen = p->hlength;
+ tab[j].func = p->hvalue;
+ j++;
+ }
+ }
+ }
+
+ assert(j == func_count);
+
+ /* Shazzam! */
+ qsort(tab, func_count, sizeof(struct finfo), fcompare);
+
+ for (i = 0; i < j; i++)
+ shadow |= parms_shadow(tab[i].name, tab[i].func);
+
+ free(tab);
+
+ /* End with fatal if the user requested it. */
+ if (shadow && lintfunc != warning)
+ lintwarn(_("there were shadowed variables."));
+}
+
+/*
+ * append_right:
+ * Add new to the rightmost branch of LIST. This uses n^2 time, so we make
+ * a simple attempt at optimizing it.
+ */
+
+static NODE *
+append_right(NODE *list, NODE *new)
+{
+ register NODE *oldlist;
+ static NODE *savefront = NULL, *savetail = NULL;
+
+ if (list == NULL || new == NULL)
+ return list;
+
+ oldlist = list;
+ if (savefront == oldlist)
+ list = savetail; /* Be careful: maybe list->rnode != NULL */
+ else
+ savefront = oldlist;
+
+ while (list->rnode != NULL)
+ list = list->rnode;
+ savetail = list->rnode = new;
+ return oldlist;
+}
+
+/*
+ * append_pattern:
+ * A wrapper around append_right, used for rule lists.
+ */
+static inline NODE *
+append_pattern(NODE **list, NODE *patt)
+{
+ NODE *n = node(patt, Node_rule_node, (NODE *) NULL);
+
+ if (*list == NULL)
+ *list = n;
+ else {
+ NODE *n1 = node(n, Node_rule_list, (NODE *) NULL);
+ if ((*list)->type != Node_rule_list)
+ *list = node(*list, Node_rule_list, n1);
+ else
+ (void) append_right(*list, n1);
+ }
+ return n;
+}
+
+/*
+ * func_install:
+ * check if name is already installed; if so, it had better have Null value,
+ * in which case def is added as the value. Otherwise, install name with def
+ * as value.
+ *
+ * Extra work, build up and save a list of the parameter names in a table
+ * and hang it off params->parmlist. This is used to set the `vname' field
+ * of each function parameter during a function call. See eval.c.
+ */
+
+static void
+func_install(NODE *params, NODE *def)
+{
+ NODE *r, *n, *thisfunc;
+ char **pnames, *names, *sp;
+ size_t pcount = 0, space = 0;
+ int i;
+
+ /* check for function foo(foo) { ... }. bleah. */
+ for (n = params->rnode; n != NULL; n = n->rnode) {
+ if (strcmp(n->param, params->param) == 0)
+ fatal(_("function `%s': can't use function name as parameter name"),
+ params->param);
+ }
+
+ thisfunc = NULL; /* turn off warnings */
+
+ /* symbol table managment */
+ pop_var(params, FALSE);
+ r = lookup(params->param);
+ if (r != NULL) {
+ fatal(_("function name `%s' previously defined"), params->param);
+ } else if (params->param == builtin_func) /* not a valid function name */
+ goto remove_params;
+
+ /* install the function */
+ thisfunc = node(params, Node_func, def);
+ (void) install(params->param, thisfunc);
+
+ /* figure out amount of space to allocate for variable names */
+ for (n = params->rnode; n != NULL; n = n->rnode) {
+ pcount++;
+ space += strlen(n->param) + 1;
+ }
+
+ /* allocate it and fill it in */
+ if (pcount != 0) {
+ emalloc(names, char *, space, "func_install");
+ emalloc(pnames, char **, pcount * sizeof(char *), "func_install");
+ sp = names;
+ for (i = 0, n = params->rnode; i < pcount; i++, n = n->rnode) {
+ pnames[i] = sp;
+ strcpy(sp, n->param);
+ sp += strlen(n->param) + 1;
+ }
+ thisfunc->parmlist = pnames;
+ } else {
+ thisfunc->parmlist = NULL;
+ }
+
+ /* update lint table info */
+ func_use(params->param, FUNC_DEFINE);
+
+ func_count++; /* used by profiling / pretty printer */
+
+remove_params:
+ /* remove params from symbol table */
+ pop_params(params->rnode);
+}
+
+/* pop_var --- remove a variable from the symbol table */
+
+static void
+pop_var(NODE *np, int freeit)
+{
+ register NODE *bucket, **save;
+ register size_t len;
+ char *name;
+
+ name = np->param;
+ len = strlen(name);
+ save = &(variables[hash(name, len, (unsigned long) HASHSIZE)]);
+ for (bucket = *save; bucket != NULL; bucket = bucket->hnext) {
+ if (len == bucket->hlength && STREQN(bucket->hname, name, len)) {
+ var_count--;
+ *save = bucket->hnext;
+ freenode(bucket);
+ if (freeit)
+ free(np->param);
+ return;
+ }
+ save = &(bucket->hnext);
+ }
+}
+
+/* pop_params --- remove list of function parameters from symbol table */
+
+/*
+ * pop parameters out of the symbol table. do this in reverse order to
+ * avoid reading freed memory if there were duplicated parameters.
+ */
+static void
+pop_params(NODE *params)
+{
+ if (params == NULL)
+ return;
+ pop_params(params->rnode);
+ pop_var(params, TRUE);
+}
+
+/* make_param --- make NAME into a function parameter */
+
+static NODE *
+make_param(char *name)
+{
+ NODE *r;
+
+ getnode(r);
+ r->type = Node_param_list;
+ r->rnode = NULL;
+ r->param = name;
+ r->param_cnt = param_counter++;
+ return (install(name, r));
+}
+
+static struct fdesc {
+ char *name;
+ short used;
+ short defined;
+ struct fdesc *next;
+} *ftable[HASHSIZE];
+
+/* func_use --- track uses and definitions of functions */
+
+static void
+func_use(const char *name, enum defref how)
+{
+ struct fdesc *fp;
+ int len;
+ int ind;
+
+ len = strlen(name);
+ ind = hash(name, len, HASHSIZE);
+
+ for (fp = ftable[ind]; fp != NULL; fp = fp->next) {
+ if (strcmp(fp->name, name) == 0) {
+ if (how == FUNC_DEFINE)
+ fp->defined++;
+ else
+ fp->used++;
+ return;
+ }
+ }
+
+ /* not in the table, fall through to allocate a new one */
+
+ emalloc(fp, struct fdesc *, sizeof(struct fdesc), "func_use");
+ memset(fp, '\0', sizeof(struct fdesc));
+ emalloc(fp->name, char *, len + 1, "func_use");
+ strcpy(fp->name, name);
+ if (how == FUNC_DEFINE)
+ fp->defined++;
+ else
+ fp->used++;
+ fp->next = ftable[ind];
+ ftable[ind] = fp;
+}
+
+/* check_funcs --- verify functions that are called but not defined */
+
+static void
+check_funcs()
+{
+ struct fdesc *fp, *next;
+ int i;
+
+ for (i = 0; i < HASHSIZE; i++) {
+ for (fp = ftable[i]; fp != NULL; fp = fp->next) {
+#ifdef REALLYMEAN
+ /* making this the default breaks old code. sigh. */
+ if (fp->defined == 0) {
+ error(
+ _("function `%s' called but never defined"), fp->name);
+ errcount++;
+ }
+#else
+ if (do_lint && fp->defined == 0)
+ lintwarn(
+ _("function `%s' called but never defined"), fp->name);
+#endif
+ if (do_lint && fp->used == 0) {
+ lintwarn(_("function `%s' defined but never called"),
+ fp->name);
+ }
+ }
+ }
+
+ /* now let's free all the memory */
+ for (i = 0; i < HASHSIZE; i++) {
+ for (fp = ftable[i]; fp != NULL; fp = next) {
+ next = fp->next;
+ free(fp->name);
+ free(fp);
+ }
+ }
+}
+
+/* param_sanity --- look for parameters that are regexp constants */
+
+static void
+param_sanity(NODE *arglist)
+{
+ NODE *argp, *arg;
+ int i;
+
+ for (i = 1, argp = arglist; argp != NULL; argp = argp->rnode, i++) {
+ arg = argp->lnode;
+ if (arg->type == Node_regex)
+ warning(_("regexp constant for parameter #%d yields boolean value"), i);
+ }
+}
+
+/* variable --- make sure NAME is in the symbol table */
+
+NODE *
+variable(char *name, int can_free, NODETYPE type)
+{
+ register NODE *r;
+
+ if ((r = lookup(name)) != NULL) {
+ if (r->type == Node_func)
+ fatal(_("function `%s' called with space between name and `(',\n%s"),
+ r->vname,
+ _("or used as a variable or an array"));
+ } else {
+ /* not found */
+ if (! do_traditional && STREQ(name, "PROCINFO"))
+ r = load_procinfo();
+ else if (STREQ(name, "ENVIRON"))
+ r = load_environ();
+ else {
+ /*
+ * This is the only case in which we may not free the string.
+ */
+ NODE *n;
+
+ if (type == Node_var)
+ n = node(Nnull_string, type, (NODE *) NULL);
+ else
+ n = node((NODE *) NULL, type, (NODE *) NULL);
+
+ return install(name, n);
+ }
+ }
+ if (can_free)
+ free(name);
+ return r;
+}
+
+/* mk_rexp --- make a regular expression constant */
+
+static NODE *
+mk_rexp(NODE *exp)
+{
+ NODE *n;
+
+ if (exp->type == Node_regex)
+ return exp;
+
+ getnode(n);
+ n->type = Node_dynregex;
+ n->re_exp = exp;
+ n->re_text = NULL;
+ n->re_reg = NULL;
+ n->re_flags = 0;
+ return n;
+}
+
+/* isnoeffect --- when used as a statement, has no side effects */
+
+/*
+ * To be completely general, we should recursively walk the parse
+ * tree, to make sure that all the subexpressions also have no effect.
+ * Instead, we just weaken the actual warning that's printed, up above
+ * in the grammar.
+ */
+
+static int
+isnoeffect(NODETYPE type)
+{
+ switch (type) {
+ case Node_times:
+ case Node_quotient:
+ case Node_mod:
+ case Node_plus:
+ case Node_minus:
+ case Node_subscript:
+ case Node_concat:
+ case Node_exp:
+ case Node_unary_minus:
+ case Node_field_spec:
+ case Node_and:
+ case Node_or:
+ case Node_equal:
+ case Node_notequal:
+ case Node_less:
+ case Node_greater:
+ case Node_leq:
+ case Node_geq:
+ case Node_match:
+ case Node_nomatch:
+ case Node_not:
+ case Node_val:
+ case Node_in_array:
+ case Node_NF:
+ case Node_NR:
+ case Node_FNR:
+ case Node_FS:
+ case Node_RS:
+ case Node_FIELDWIDTHS:
+ case Node_IGNORECASE:
+ case Node_OFS:
+ case Node_ORS:
+ case Node_OFMT:
+ case Node_CONVFMT:
+ case Node_BINMODE:
+ case Node_LINT:
+ case Node_TEXTDOMAIN:
+ return TRUE;
+ default:
+ break; /* keeps gcc -Wall happy */
+ }
+
+ return FALSE;
+}
+
+/* isassignable --- can this node be assigned to? */
+
+static int
+isassignable(register NODE *n)
+{
+ switch (n->type) {
+ case Node_var_new:
+ case Node_var:
+ case Node_FIELDWIDTHS:
+ case Node_RS:
+ case Node_FS:
+ case Node_FNR:
+ case Node_NR:
+ case Node_NF:
+ case Node_IGNORECASE:
+ case Node_OFMT:
+ case Node_CONVFMT:
+ case Node_ORS:
+ case Node_OFS:
+ case Node_LINT:
+ case Node_BINMODE:
+ case Node_TEXTDOMAIN:
+ case Node_field_spec:
+ case Node_subscript:
+ return TRUE;
+ case Node_param_list:
+ return ((n->flags & FUNC) == 0); /* ok if not func name */
+ default:
+ break; /* keeps gcc -Wall happy */
+ }
+ return FALSE;
+}
+
+/* stopme --- for debugging */
+
+NODE *
+stopme(NODE *tree ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+/* dumpintlstr --- write out an initial .po file entry for the string */
+
+static void
+dumpintlstr(const char *str, size_t len)
+{
+ 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, 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(const char *str1, size_t len1, const 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 */
+
+static void
+count_args(NODE *tree)
+{
+ size_t count = 0;
+ NODE *save_tree;
+
+ assert(tree->type == Node_K_printf
+ || (tree->type == Node_builtin && tree->builtin == do_sprintf));
+ save_tree = tree;
+
+ tree = tree->lnode; /* printf format string */
+
+ for (count = 0; tree != NULL; tree = tree->rnode)
+ count++;
+
+ save_tree->printf_count = count;
+}
+
+/* isarray --- can this type be subscripted? */
+
+static int
+isarray(NODE *n)
+{
+ switch (n->type) {
+ case Node_var_new:
+ case Node_var_array:
+ return TRUE;
+ case Node_param_list:
+ return ((n->flags & FUNC) == 0);
+ case Node_array_ref:
+ cant_happen();
+ break;
+ default:
+ break; /* keeps gcc -Wall happy */
+ }
+
+ return FALSE;
+}
diff --git a/gnu/dist/gawk/awklib/ChangeLog b/gnu/dist/gawk/awklib/ChangeLog
index c27d3b2f54c..57eaf7320eb 100644
--- a/gnu/dist/gawk/awklib/ChangeLog
+++ b/gnu/dist/gawk/awklib/ChangeLog
@@ -1,3 +1,73 @@
+Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.3: Release tar file made.
+
+Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ This time for sure.
+ -- Bullwinkle
+
+ * Release 3.1.2: Release tar file made.
+
+Thu Oct 10 13:24:09 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (INCLUDES): Added to get .. for build dir
+ which will have config.h in it.
+ (grcat,pwcat): Use $(COMPILE) instead of $(CC) to get
+ $(INCLUDES) included.
+
+Tue Jun 11 23:43:36 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (grcat): Add def for config.h and -I flag.
+
+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
+ rejoicing.
+
+2001-02-26 Paul Eggert <eggert@twinsun.com>
+
+ * Makefile.am (stamp-eg): Use $(AWK), not awk, as the
+ native awk might not work.
+
+2001-02-26 Andreas Schwab <schwab@suse.de>
+
+ * Makefile.am: Install igawk as script.
+
+Mon Nov 6 15:29:08 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am: Fixed to have all functionality from before
+ the switch to automake.
+ * extract.awk: Updated to match version in the doc.
+
+Sat Jul 26 23:08:29 1997 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.in (install-strip): new target.
+
+Mon Aug 7 15:23:00 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.0.6: Release tar file made.
+
+Sun Jun 25 15:08:19 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.0.5: Release tar file made.
+
+Wed Jun 30 16:14:36 1999 Arnold D. Robbins <arnold@gnu.org>
+
+ * Release 3.0.4: Release tar file made. This time for sure.
+
Thu May 15 12:49:08 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Release 3.0.3: Release tar file made.
diff --git a/gnu/dist/gawk/awklib/Makefile.am b/gnu/dist/gawk/awklib/Makefile.am
new file mode 100644
index 00000000000..4662ffc922b
--- /dev/null
+++ b/gnu/dist/gawk/awklib/Makefile.am
@@ -0,0 +1,79 @@
+#
+# awklib/Makefile.am --- automake input file for gawk
+#
+# Copyright (C) 1995-2003 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
+#
+
+## process this file with automake to produce Makefile.in
+
+EXTRA_DIST = ChangeLog extract.awk eg stamp-eg
+
+# This is so we get config.h. It'll be in the build directory,
+# not the source directory.
+INCLUDES = -I..
+
+datadir = @datadir@/awk
+libexecdir = @libexecdir@/awk
+
+bin_SCRIPTS = igawk
+libexec_PROGRAMS = pwcat grcat
+AUXAWK = passwd.awk group.awk
+nodist_grcat_SOURCES = grcat.c
+nodist_pwcat_SOURCES = pwcat.c
+
+all: stamp-eg $(AUXPROGS) igawk $(AUXAWK)
+
+install-exec-hook: $(AUXAWK)
+ $(mkinstalldirs) $(DESTDIR)$(datadir)
+ for i in $(AUXAWK) $(srcdir)/eg/lib/*.awk ; do \
+ progname=`echo $$i | sed 's;.*/;;'` ; \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(datadir)/$$progname ; \
+ done
+
+# libexecdir and datadir are removed in the top level Makefile's uninstall
+uninstall-local:
+ rm -fr $(DESTDIR)$(libexecdir)/* $(DESTDIR)$(datadir)/*
+ rm -f $(DESTDIR)$(bindir)/igawk
+
+clean-local:
+ rm -f $(AUXAWK) igawk *.exe
+
+stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi
+ rm -fr eg stamp-eg
+ $(AWK) -f $(srcdir)/extract.awk $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi
+ @echo 'some makes are stupid and will not check a directory' > stamp-eg
+ @echo 'against a file, so this file is a place holder. gack.' >> stamp-eg
+
+pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c
+ $(COMPILE) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@
+
+grcat$(EXEEXT): $(srcdir)/eg/lib/grcat.c
+ $(COMPILE) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@
+
+igawk: $(srcdir)/eg/prog/igawk.sh
+ cp $(srcdir)/eg/prog/igawk.sh $@ ; chmod 755 $@
+
+passwd.awk: $(srcdir)/eg/lib/passwdawk.in
+ (cd $(srcdir)/eg/lib ; \
+ sed 's;/usr/local/libexec/awk;$(libexecdir);' < passwdawk.in) > passwd.awk
+
+group.awk: $(srcdir)/eg/lib/groupawk.in
+ (cd $(srcdir)/eg/lib ; \
+ sed 's;/usr/local/libexec/awk;$(libexecdir);' < groupawk.in) > group.awk
diff --git a/gnu/dist/gawk/awklib/Makefile.in b/gnu/dist/gawk/awklib/Makefile.in
index c63947b3af2..9ae786a9699 100644
--- a/gnu/dist/gawk/awklib/Makefile.in
+++ b/gnu/dist/gawk/awklib/Makefile.in
@@ -1,65 +1,509 @@
-# Makefile for GNU Awk support library.
+# Makefile.in generated by automake 1.7.5 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#
+# awklib/Makefile.am --- automake input file for gawk
+#
+# Copyright (C) 1995-2003 the Free Software Foundation, Inc.
#
-# Copyright (C) 1995-1997 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 = /bin/sh
+#
srcdir = @srcdir@
+top_srcdir = @top_srcdir@
VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_triplet = @host@
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
+CATOBJEXT = @CATOBJEXT@
CC = @CC@
+CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATADIRNAME = @DATADIRNAME@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GENCAT = @GENCAT@
+GLIBC21 = @GLIBC21@
+GMSGFMT = @GMSGFMT@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTOBJEXT = @INSTOBJEXT@
+INTLBISON = @INTLBISON@
+INTLLIBS = @INTLLIBS@
+INTLOBJS = @INTLOBJS@
+INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOCKET_LIBS = @SOCKET_LIBS@
+STRIP = @STRIP@
+U = @U@
+USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+YACC = @YACC@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
-prefix = @prefix@
+datadir = @datadir@/awk
exec_prefix = @exec_prefix@
-binprefix =
-manprefix =
-
-bindir = @bindir@
-libdir = @libdir@
-mandir = @mandir@/man1
-manext = .1
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
infodir = @infodir@
-datadir = @datadir@/awk
+install_sh = @install_sh@
+libdir = @libdir@
libexecdir = @libexecdir@/awk
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+
+EXTRA_DIST = ChangeLog extract.awk eg stamp-eg
-AUXPROGS = pwcat grcat
+# This is so we get config.h. It'll be in the build directory,
+# not the source directory.
+INCLUDES = -I..
+
+bin_SCRIPTS = igawk
+libexec_PROGRAMS = pwcat grcat
AUXAWK = passwd.awk group.awk
+nodist_grcat_SOURCES = grcat.c
+nodist_pwcat_SOURCES = pwcat.c
+subdir = awklib
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+libexec_PROGRAMS = pwcat$(EXEEXT) grcat$(EXEEXT)
+PROGRAMS = $(libexec_PROGRAMS)
+
+nodist_grcat_OBJECTS = grcat.$(OBJEXT)
+grcat_OBJECTS = $(nodist_grcat_OBJECTS)
+grcat_LDADD = $(LDADD)
+grcat_DEPENDENCIES =
+grcat_LDFLAGS =
+nodist_pwcat_OBJECTS = pwcat.$(OBJEXT)
+pwcat_OBJECTS = $(nodist_pwcat_OBJECTS)
+pwcat_LDADD = $(LDADD)
+pwcat_DEPENDENCIES =
+pwcat_LDFLAGS =
+SCRIPTS = $(bin_SCRIPTS)
+
+
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/grcat.Po ./$(DEPDIR)/pwcat.Po
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+DIST_SOURCES =
+DIST_COMMON = ChangeLog Makefile.am Makefile.in
+SOURCES = $(nodist_grcat_SOURCES) $(nodist_pwcat_SOURCES)
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu awklib/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+install-libexecPROGRAMS: $(libexec_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(libexecdir)
+ @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(libexecPROGRAMS_INSTALL) $$p $(DESTDIR)$(libexecdir)/$$f"; \
+ $(INSTALL_PROGRAM_ENV) $(libexecPROGRAMS_INSTALL) $$p $(DESTDIR)$(libexecdir)/$$f || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-libexecPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f $(DESTDIR)$(libexecdir)/$$f"; \
+ rm -f $(DESTDIR)$(libexecdir)/$$f; \
+ done
+
+clean-libexecPROGRAMS:
+ -test -z "$(libexec_PROGRAMS)" || rm -f $(libexec_PROGRAMS)
+binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f $$d$$p; then \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f"; \
+ $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f; \
+ else :; fi; \
+ done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
+ rm -f $(DESTDIR)$(bindir)/$$f; \
+ done
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT) core *.core
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grcat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwcat.Po@am__quote@
+
+distclean-depend:
+ -rm -rf ./$(DEPDIR)
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+@am__fastdepCC_TRUE@ fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+@am__fastdepCC_TRUE@ fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
+uninstall-info-am:
+
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
+
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(SCRIPTS)
+
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(bindir)
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libexecPROGRAMS clean-local mostlyclean-am
+
+distclean: distclean-am
+
+distclean-am: clean-am distclean-compile distclean-depend \
+ distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binSCRIPTS install-libexecPROGRAMS
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS uninstall-info-am \
+ uninstall-libexecPROGRAMS uninstall-local
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libexecPROGRAMS clean-local ctags 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 pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-binSCRIPTS uninstall-info-am \
+ uninstall-libexecPROGRAMS uninstall-local
+
all: stamp-eg $(AUXPROGS) igawk $(AUXAWK)
-stamp-eg: $(srcdir)/../doc/gawk.texi
+install-exec-hook: $(AUXAWK)
+ $(mkinstalldirs) $(DESTDIR)$(datadir)
+ for i in $(AUXAWK) $(srcdir)/eg/lib/*.awk ; do \
+ progname=`echo $$i | sed 's;.*/;;'` ; \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(datadir)/$$progname ; \
+ done
+
+# libexecdir and datadir are removed in the top level Makefile's uninstall
+uninstall-local:
+ rm -fr $(DESTDIR)$(libexecdir)/* $(DESTDIR)$(datadir)/*
+ rm -f $(DESTDIR)$(bindir)/igawk
+
+clean-local:
+ rm -f $(AUXAWK) igawk *.exe
+
+stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi
rm -fr eg stamp-eg
- ../gawk -f $(srcdir)/extract.awk $(srcdir)/../doc/gawk.texi
+ $(AWK) -f $(srcdir)/extract.awk $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi
@echo 'some makes are stupid and will not check a directory' > stamp-eg
@echo 'against a file, so this file is a place holder. gack.' >> stamp-eg
-pwcat: $(srcdir)/eg/lib/pwcat.c
- $(CC) $(CFLAGS) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@
+pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c
+ $(COMPILE) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@
-grcat: $(srcdir)/eg/lib/grcat.c
- $(CC) $(CFLAGS) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@
+grcat$(EXEEXT): $(srcdir)/eg/lib/grcat.c
+ $(COMPILE) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@
igawk: $(srcdir)/eg/prog/igawk.sh
cp $(srcdir)/eg/prog/igawk.sh $@ ; chmod 755 $@
@@ -71,29 +515,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
-
-install: igawk $(AUXPROGS) $(AUXAWK)
- $(INSTALL_PROGRAM) igawk $(bindir)/igawk
- for i in $(AUXPROGS) ; do \
- $(INSTALL_PROGRAM) $$i $(libexecdir)/$$i ; \
- done
- for i in $(AUXAWK) $(srcdir)/eg/lib/*.awk ; do \
- progname=`echo $$i | sed 's;.*/;;'` ; \
- $(INSTALL_DATA) $$i $(datadir)/$$progname ; \
- done
-
-# libexecdir and datadir are removed in the top level Makefile's uninstall
-uninstall:
- rm -fr $(libexecdir)/* $(datadir)/*
- rm -f $(bindir)/igawk
-
-clean:
- rm -f $(AUXPROGS) $(AUXAWK) igawk *~
-
-distclean: clean
- rm -f Makefile
-
-maintainer-clean: distclean
- @echo "This command is intended for maintainers to use; it"
- @echo "deletes files that may require special tools to rebuild."
- rm -fr eg stamp-eg
+# 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/gnu/dist/gawk/awklib/eg/data/guide-mellow.po b/gnu/dist/gawk/awklib/eg/data/guide-mellow.po
new file mode 100644
index 00000000000..98c388d8698
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/data/guide-mellow.po
@@ -0,0 +1,8 @@
+#: guide.awk:4
+msgid "Don't Panic"
+msgstr "Hey man, relax!"
+
+#: guide.awk:5
+msgid "The Answer Is"
+msgstr "Like, the scoop is"
+
diff --git a/gnu/dist/gawk/awklib/eg/data/guide.po b/gnu/dist/gawk/awklib/eg/data/guide.po
new file mode 100644
index 00000000000..de21218a52b
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/data/guide.po
@@ -0,0 +1,8 @@
+#: guide.awk:4
+msgid "Don't Panic"
+msgstr ""
+
+#: guide.awk:5
+msgid "The Answer Is"
+msgstr ""
+
diff --git a/gnu/dist/gawk/awklib/eg/lib/assert.awk b/gnu/dist/gawk/awklib/eg/lib/assert.awk
index 914aa632226..bbfc0669bb7 100644
--- a/gnu/dist/gawk/awklib/eg/lib/assert.awk
+++ b/gnu/dist/gawk/awklib/eg/lib/assert.awk
@@ -1,5 +1,7 @@
# assert --- assert that a condition is true. Otherwise exit.
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May, 1993
function assert(condition, string)
diff --git a/gnu/dist/gawk/awklib/eg/lib/bits2str.awk b/gnu/dist/gawk/awklib/eg/lib/bits2str.awk
new file mode 100644
index 00000000000..9725ee8fa7d
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/lib/bits2str.awk
@@ -0,0 +1,16 @@
+# bits2str --- turn a byte into readable 1's and 0's
+
+function bits2str(bits, data, mask)
+{
+ if (bits == 0)
+ return "0"
+
+ mask = 1
+ for (; bits != 0; bits = rshift(bits, 1))
+ data = (and(bits, mask) ? "1" : "0") data
+
+ while ((length(data) % 8) != 0)
+ data = "0" data
+
+ return data
+}
diff --git a/gnu/dist/gawk/awklib/eg/lib/cliff_rand.awk b/gnu/dist/gawk/awklib/eg/lib/cliff_rand.awk
new file mode 100644
index 00000000000..345447ec82a
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/lib/cliff_rand.awk
@@ -0,0 +1,14 @@
+# cliff_rand.awk --- generate Cliff random numbers
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
+# December 2000
+
+BEGIN { _cliff_seed = 0.1 }
+
+function cliff_rand()
+{
+ _cliff_seed = (100 * log(_cliff_seed)) % 1
+ if (_cliff_seed < 0)
+ _cliff_seed = - _cliff_seed
+ return _cliff_seed
+}
diff --git a/gnu/dist/gawk/awklib/eg/lib/ftrans.awk b/gnu/dist/gawk/awklib/eg/lib/ftrans.awk
index 0d6e8108416..b0743e2889b 100644
--- a/gnu/dist/gawk/awklib/eg/lib/ftrans.awk
+++ b/gnu/dist/gawk/awklib/eg/lib/ftrans.awk
@@ -2,8 +2,8 @@
#
# user supplies beginfile() and endfile() functions
#
-# Arnold Robbins, arnold@gnu.ai.mit.edu. November 1992
-# Public Domain
+# Arnold Robbins, arnold@gnu.org, Public Domain
+# November 1992
FNR == 1 {
if (_filename_ != "")
diff --git a/gnu/dist/gawk/awklib/eg/lib/getopt.awk b/gnu/dist/gawk/awklib/eg/lib/getopt.awk
index 70a1ec0f033..4f2686d6cd3 100644
--- a/gnu/dist/gawk/awklib/eg/lib/getopt.awk
+++ b/gnu/dist/gawk/awklib/eg/lib/getopt.awk
@@ -1,28 +1,26 @@
-# getopt --- do C library getopt(3) function in awk
+# getopt.awk --- do C library getopt(3) function in awk
#
-# arnold@gnu.ai.mit.edu
-# Public domain
+# Arnold Robbins, arnold@gnu.org, Public Domain
#
# Initial version: March, 1991
# Revised: May, 1993
# External variables:
-# Optind -- index of ARGV for first non-option argument
+# Optind -- index in ARGV of first nonoption argument
# Optarg -- string value of argument to current option
-# Opterr -- if non-zero, print our own diagnostic
+# Opterr -- if nonzero, print our own diagnostic
# Optopt -- current option letter
-# Returns
+# Returns:
# -1 at end of options
# ? for unrecognized option
# <c> a character representing the current option
-# Private Data
-# _opti index in multi-flag option, e.g., -abc
-function getopt(argc, argv, options, optl, thisopt, i)
+# Private Data:
+# _opti -- index in multi-flag option, e.g., -abc
+function getopt(argc, argv, options, thisopt, i)
{
- optl = length(options)
- if (optl == 0) # no options given
+ if (length(options) == 0) # no options given
return -1
if (argv[Optind] == "--") { # all done
diff --git a/gnu/dist/gawk/awklib/eg/lib/gettime.awk b/gnu/dist/gawk/awklib/eg/lib/gettime.awk
index 500dfcefbbf..c425123c626 100644
--- a/gnu/dist/gawk/awklib/eg/lib/gettime.awk
+++ b/gnu/dist/gawk/awklib/eg/lib/gettime.awk
@@ -1,6 +1,8 @@
-# gettimeofday --- get the time of day in a usable format
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain, May 1993
+# gettimeofday.awk --- get the time of day in a usable format
#
+# Arnold Robbins, arnold@gnu.org, Public Domain, May 1993
+#
+
# Returns a string in the format of output of date(1)
# Populates the array argument time with individual values:
# time["second"] -- seconds (0 - 59)
@@ -11,17 +13,17 @@
# time["month"] -- month of year (1 - 12)
# time["monthname"] -- name of the month
# time["shortmonth"] -- short name of the month
-# time["year"] -- year within century (0 - 99)
-# time["fullyear"] -- year with century (19xx or 20xx)
+# time["year"] -- year modulo 100 (0 - 99)
+# time["fullyear"] -- full year
# time["weekday"] -- day of week (Sunday = 0)
# time["altweekday"] -- day of week (Monday = 0)
-# time["weeknum"] -- week number, Sunday first day
-# time["altweeknum"] -- week number, Monday first day
# time["dayname"] -- name of weekday
# time["shortdayname"] -- short name of weekday
# time["yearday"] -- day of year (0 - 365)
# time["timezone"] -- abbreviation of timezone name
# time["ampm"] -- AM or PM designation
+# time["weeknum"] -- week number, Sunday first day
+# time["altweeknum"] -- week number, Monday first day
function gettimeofday(time, ret, now, i)
{
@@ -32,8 +34,7 @@ function gettimeofday(time, ret, now, i)
ret = strftime("%a %b %d %H:%M:%S %Z %Y", now)
# clear out target array
- for (i in time)
- delete time[i]
+ delete time
# fill in values, force numeric values to be
# numeric by adding 0
diff --git a/gnu/dist/gawk/awklib/eg/lib/grcat.c b/gnu/dist/gawk/awklib/eg/lib/grcat.c
index 9742c5922d7..b384f27b4de 100644
--- a/gnu/dist/gawk/awklib/eg/lib/grcat.c
+++ b/gnu/dist/gawk/awklib/eg/lib/grcat.c
@@ -1,13 +1,27 @@
+/* $NetBSD: grcat.c,v 1.1.1.2 2003/10/06 15:50:57 wiz Exp $ */
+
/*
* grcat.c
*
* Generate a printable version of the group database
- *
- * Arnold Robbins, arnold@gnu.ai.mit.edu
- * May 1993
+ */
+/*
+ * Arnold Robbins, arnold@gnu.org, May 1993
* Public Domain
*/
+/* For OS/2, do nothing. */
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined (STDC_HEADERS)
+#include <stdlib.h>
+#endif
+
+#ifndef HAVE_GETGRENT
+int main() { return 0; }
+#else
#include <stdio.h>
#include <grp.h>
@@ -20,8 +34,8 @@ char **argv;
int i;
while ((g = getgrent()) != NULL) {
- printf("%s:%s:%d:", g->gr_name, g->gr_passwd,
- g->gr_gid);
+ printf("%s:%s:%ld:", g->gr_name, g->gr_passwd,
+ (long) g->gr_gid);
for (i = 0; g->gr_mem[i] != NULL; i++) {
printf("%s", g->gr_mem[i]);
if (g->gr_mem[i+1] != NULL)
@@ -30,5 +44,6 @@ char **argv;
putchar('\n');
}
endgrent();
- exit(0);
+ return 0;
}
+#endif /* HAVE_GETGRENT */
diff --git a/gnu/dist/gawk/awklib/eg/lib/groupawk.in b/gnu/dist/gawk/awklib/eg/lib/groupawk.in
index a8103a04b28..9d8b402197e 100644
--- a/gnu/dist/gawk/awklib/eg/lib/groupawk.in
+++ b/gnu/dist/gawk/awklib/eg/lib/groupawk.in
@@ -1,13 +1,17 @@
# group.awk --- functions for dealing with the group file
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May 1993
+# Revised October 2000
BEGIN \
{
# Change to suit your system
_gr_awklib = "/usr/local/libexec/awk/"
}
-function _gr_init( oldfs, oldrs, olddol0, grcat, n, a, i)
+
+function _gr_init( oldfs, oldrs, olddol0, grcat,
+ using_fw, n, a, i)
{
if (_gr_inited)
return
@@ -15,6 +19,7 @@ function _gr_init( oldfs, oldrs, olddol0, grcat, n, a, i)
oldfs = FS
oldrs = RS
olddol0 = $0
+ using_fw = (PROCINFO["FS"] == "FIELDWIDTHS")
FS = ":"
RS = "\n"
@@ -43,6 +48,8 @@ function _gr_init( oldfs, oldrs, olddol0, grcat, n, a, i)
_gr_count = 0
_gr_inited++
FS = oldfs
+ if (using_fw)
+ FIELDWIDTHS = FIELDWIDTHS
RS = oldrs
$0 = olddol0
}
@@ -70,7 +77,7 @@ function getgruser(user)
function getgrent()
{
_gr_init()
- if (++gr_count in _gr_bycount)
+ if (++_gr_count in _gr_bycount)
return _gr_bycount[_gr_count]
return ""
}
diff --git a/gnu/dist/gawk/awklib/eg/lib/join.awk b/gnu/dist/gawk/awklib/eg/lib/join.awk
index e6b81656d3f..e17b4270ca3 100644
--- a/gnu/dist/gawk/awklib/eg/lib/join.awk
+++ b/gnu/dist/gawk/awklib/eg/lib/join.awk
@@ -1,5 +1,6 @@
# join.awk --- join an array into a string
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May 1993
function join(array, start, end, sep, result, i)
diff --git a/gnu/dist/gawk/awklib/eg/lib/libintl.awk b/gnu/dist/gawk/awklib/eg/lib/libintl.awk
new file mode 100644
index 00000000000..7efd2b47cad
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/lib/libintl.awk
@@ -0,0 +1,14 @@
+function bindtextdomain(dir, domain)
+{
+ return dir
+}
+
+function dcgettext(string, domain, category)
+{
+ return string
+}
+
+function dcngettext(string1, string2, number, domain, category)
+{
+ return (number == 1 ? string1 : string2)
+}
diff --git a/gnu/dist/gawk/awklib/eg/lib/nextfile.awk b/gnu/dist/gawk/awklib/eg/lib/nextfile.awk
index 0f729a8795e..caedf0e478e 100644
--- a/gnu/dist/gawk/awklib/eg/lib/nextfile.awk
+++ b/gnu/dist/gawk/awklib/eg/lib/nextfile.awk
@@ -1,6 +1,7 @@
# nextfile --- skip remaining records in current file
# correctly handle successive occurrences of the same file
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May, 1993
# this should be read in before the "main" awk program
diff --git a/gnu/dist/gawk/awklib/eg/lib/noassign.awk b/gnu/dist/gawk/awklib/eg/lib/noassign.awk
new file mode 100644
index 00000000000..d6d176e40e9
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/lib/noassign.awk
@@ -0,0 +1,17 @@
+# noassign.awk --- library file to avoid the need for a
+# special option that disables command-line assignments
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
+# October 1999
+
+function disable_assigns(argc, argv, i)
+{
+ for (i = 1; i < argc; i++)
+ if (argv[i] ~ /^[A-Za-z_][A-Za-z_0-9]*=.*/)
+ argv[i] = ("./" argv[i])
+}
+
+BEGIN {
+ if (No_command_assign)
+ disable_assigns(ARGC, ARGV)
+}
diff --git a/gnu/dist/gawk/awklib/eg/lib/ord.awk b/gnu/dist/gawk/awklib/eg/lib/ord.awk
index 7e62cb88b96..3eacbcc576d 100644
--- a/gnu/dist/gawk/awklib/eg/lib/ord.awk
+++ b/gnu/dist/gawk/awklib/eg/lib/ord.awk
@@ -1,16 +1,15 @@
# ord.awk --- do ord and chr
-#
+
# Global identifiers:
# _ord_: numerical values indexed by characters
# _ord_init: function to initialize _ord_
#
-# Arnold Robbins
-# arnold@gnu.ai.mit.edu
-# Public Domain
+# Arnold Robbins, arnold@gnu.org, Public Domain
# 16 January, 1992
# 20 July, 1992, revised
BEGIN { _ord_init() }
+
function _ord_init( low, high, i, t)
{
low = sprintf("%c", 7) # BEL is ascii 7
@@ -37,18 +36,9 @@ function ord(str, c)
c = substr(str, 1, 1)
return _ord_[c]
}
+
function chr(c)
{
# force c to be numeric by adding 0
return sprintf("%c", c + 0)
}
-#### test code ####
-# BEGIN \
-# {
-# for (;;) {
-# printf("enter a character: ")
-# if (getline var <= 0)
-# break
-# printf("ord(%s) = %d\n", var, ord(var))
-# }
-# }
diff --git a/gnu/dist/gawk/awklib/eg/lib/passwdawk.in b/gnu/dist/gawk/awklib/eg/lib/passwdawk.in
index 7b64f60d9c8..5f6f9e2657f 100644
--- a/gnu/dist/gawk/awklib/eg/lib/passwdawk.in
+++ b/gnu/dist/gawk/awklib/eg/lib/passwdawk.in
@@ -1,21 +1,26 @@
# passwd.awk --- access password file information
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May 1993
+# Revised October 2000
BEGIN {
# tailor this to suit your system
_pw_awklib = "/usr/local/libexec/awk/"
}
-function _pw_init( oldfs, oldrs, olddol0, pwcat)
+function _pw_init( oldfs, oldrs, olddol0, pwcat, using_fw)
{
if (_pw_inited)
return
+
oldfs = FS
oldrs = RS
olddol0 = $0
+ using_fw = (PROCINFO["FS"] == "FIELDWIDTHS")
FS = ":"
RS = "\n"
+
pwcat = _pw_awklib "pwcat"
while ((pwcat | getline) > 0) {
_pw_byname[$1] = $0
@@ -26,6 +31,8 @@ function _pw_init( oldfs, oldrs, olddol0, pwcat)
_pw_count = 0
_pw_inited = 1
FS = oldfs
+ if (using_fw)
+ FIELDWIDTHS = FIELDWIDTHS
RS = oldrs
$0 = olddol0
}
diff --git a/gnu/dist/gawk/awklib/eg/lib/pwcat.c b/gnu/dist/gawk/awklib/eg/lib/pwcat.c
index ecd25861bee..dd6e9b6a1c6 100644
--- a/gnu/dist/gawk/awklib/eg/lib/pwcat.c
+++ b/gnu/dist/gawk/awklib/eg/lib/pwcat.c
@@ -1,17 +1,26 @@
+/* $NetBSD: pwcat.c,v 1.1.1.2 2003/10/06 15:50:57 wiz Exp $ */
+
/*
* pwcat.c
*
* Generate a printable version of the password database
- *
- * Arnold Robbins
- * arnold@gnu.ai.mit.edu
- * May 1993
+ */
+/*
+ * Arnold Robbins, arnold@gnu.org, May 1993
* Public Domain
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdio.h>
#include <pwd.h>
+#if defined (STDC_HEADERS)
+#include <stdlib.h>
+#endif
+
int
main(argc, argv)
int argc;
@@ -20,10 +29,10 @@ char **argv;
struct passwd *p;
while ((p = getpwent()) != NULL)
- printf("%s:%s:%d:%d:%s:%s:%s\n",
- p->pw_name, p->pw_passwd, p->pw_uid,
- p->pw_gid, p->pw_gecos, p->pw_dir, p->pw_shell);
+ printf("%s:%s:%ld:%ld:%s:%s:%s\n",
+ p->pw_name, p->pw_passwd, (long) p->pw_uid,
+ (long) p->pw_gid, p->pw_gecos, p->pw_dir, p->pw_shell);
endpwent();
- exit(0);
+ return 0;
}
diff --git a/gnu/dist/gawk/awklib/eg/lib/readable.awk b/gnu/dist/gawk/awklib/eg/lib/readable.awk
new file mode 100644
index 00000000000..51705aea0a5
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/lib/readable.awk
@@ -0,0 +1,16 @@
+# readable.awk --- library file to skip over unreadable files
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
+# October 2000
+
+BEGIN {
+ for (i = 1; i < ARGC; i++) {
+ if (ARGV[i] ~ /^[A-Za-z_][A-Za-z0-9_]*=.*/ \
+ || ARGV[i] == "-")
+ continue # assignment or standard input
+ else if ((getline junk < ARGV[i]) < 0) # unreadable
+ delete ARGV[i]
+ else
+ close(ARGV[i])
+ }
+}
diff --git a/gnu/dist/gawk/awklib/eg/lib/rewind.awk b/gnu/dist/gawk/awklib/eg/lib/rewind.awk
new file mode 100644
index 00000000000..33286611341
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/lib/rewind.awk
@@ -0,0 +1,20 @@
+# rewind.awk --- rewind the current file and start over
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
+# September 2000
+
+function rewind( i)
+{
+ # shift remaining arguments up
+ for (i = ARGC; i > ARGIND; i--)
+ ARGV[i] = ARGV[i-1]
+
+ # make sure gawk knows to keep going
+ ARGC++
+
+ # make current file next to get done
+ ARGV[ARGIND+1] = FILENAME
+
+ # do it
+ nextfile
+}
diff --git a/gnu/dist/gawk/awklib/eg/lib/round.awk b/gnu/dist/gawk/awklib/eg/lib/round.awk
index d484e14807c..55ef7dc2536 100644
--- a/gnu/dist/gawk/awklib/eg/lib/round.awk
+++ b/gnu/dist/gawk/awklib/eg/lib/round.awk
@@ -1,7 +1,7 @@
-# round --- do normal rounding
+# round.awk --- do normal rounding
#
-# Arnold Robbins, arnold@gnu.ai.mit.edu, August, 1996
-# Public Domain
+# Arnold Robbins, arnold@gnu.org, Public Domain
+# August, 1996
function round(x, ival, aval, fraction)
{
diff --git a/gnu/dist/gawk/awklib/eg/lib/zerofile.awk b/gnu/dist/gawk/awklib/eg/lib/zerofile.awk
new file mode 100644
index 00000000000..01926fdd5f4
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/lib/zerofile.awk
@@ -0,0 +1,19 @@
+# zerofile.awk --- library file to process empty input files
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
+# June 2003
+
+BEGIN { Argind = 0 }
+
+ARGIND > Argind + 1 {
+ for (Argind++; Argind < ARGIND; Argind++)
+ zerofile(ARGV[Argind], Argind)
+}
+
+ARGIND != Argind { Argind = ARGIND }
+
+END {
+ if (ARGIND > Argind)
+ for (Argind++; Argind <= ARGIND; Argind++)
+ zerofile(ARGV[Argind], Argind)
+}
diff --git a/gnu/dist/gawk/awklib/eg/misc/findpat.awk b/gnu/dist/gawk/awklib/eg/misc/findpat.awk
new file mode 100644
index 00000000000..e9bef9eaf5d
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/misc/findpat.awk
@@ -0,0 +1,10 @@
+{
+ if ($1 == "FIND")
+ regex = $2
+ else {
+ where = match($0, regex)
+ if (where != 0)
+ print "Match of", regex, "found at",
+ where, "in", $0
+ }
+}
diff --git a/gnu/dist/gawk/awklib/eg/network/PostAgent.sh b/gnu/dist/gawk/awklib/eg/network/PostAgent.sh
new file mode 100644
index 00000000000..ccf9a6874b4
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/PostAgent.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+MobAg=/tmp/MobileAgent.$$
+# direct script to mobile agent file
+cat > $MobAg
+# execute agent concurrently
+gawk -f $MobAg $MobAg > /dev/null &
+# HTTP header, terminator and body
+gawk 'BEGIN { print "\r\nAgent started" }'
+rm $MobAg # delete script file of agent
diff --git a/gnu/dist/gawk/awklib/eg/network/coreserv.awk b/gnu/dist/gawk/awklib/eg/network/coreserv.awk
new file mode 100644
index 00000000000..348568e0c37
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/coreserv.awk
@@ -0,0 +1,113 @@
+# CGI Library and core of a web server
+#
+# Juergen Kahrs, Juergen.Kahrs@vr-web.de
+# with Arnold Robbins, arnold@gnu.org
+# September 2000
+
+# Global arrays
+# GETARG --- arguments to CGI GET command
+# MENU --- menu items (path names)
+# PARAM --- parameters of form x=y
+
+# Optional variable MyHost contains host address
+# Optional variable MyPort contains port number
+# Needs TopHeader, TopDoc, TopFooter
+# Sets MyPrefix, HttpService, Status, Reason
+
+BEGIN {
+ if (MyHost == "") {
+ "uname -n" | getline MyHost
+ close("uname -n")
+ }
+ if (MyPort == 0) MyPort = 8080
+ HttpService = "/inet/tcp/" MyPort "/0/0"
+ MyPrefix = "http://" MyHost ":" MyPort
+ SetUpServer()
+ while ("awk" != "complex") {
+ # header lines are terminated this way
+ RS = ORS = "\r\n"
+ Status = 200 # this means OK
+ Reason = "OK"
+ Header = TopHeader
+ Document = TopDoc
+ Footer = TopFooter
+ if (GETARG["Method"] == "GET") {
+ HandleGET()
+ } else if (GETARG["Method"] == "HEAD") {
+ # not yet implemented
+ } else if (GETARG["Method"] != "") {
+ print "bad method", GETARG["Method"]
+ }
+ Prompt = Header Document Footer
+ print "HTTP/1.0", Status, Reason |& HttpService
+ print "Connection: Close" |& HttpService
+ print "Pragma: no-cache" |& HttpService
+ len = length(Prompt) + length(ORS)
+ print "Content-length:", len |& HttpService
+ print ORS Prompt |& HttpService
+ # ignore all the header lines
+ while ((HttpService |& getline) > 0)
+ continue
+ # stop talking to this client
+ close(HttpService)
+ # wait for new client request
+ HttpService |& getline
+ # do some logging
+ print systime(), strftime(), $0
+ CGI_setup($1, $2, $3)
+ }
+}
+
+function CGI_setup( method, uri, version, i)
+{
+ delete GETARG
+ delete MENU
+ delete PARAM
+ GETARG["Method"] = method
+ GETARG["URI"] = uri
+ GETARG["Version"] = version
+
+ i = index(uri, "?")
+ if (i > 0) { # is there a "?" indicating a CGI request?
+ split(substr(uri, 1, i-1), MENU, "[/:]")
+ split(substr(uri, i+1), PARAM, "&")
+ for (i in PARAM) {
+ PARAM[i] = _CGI_decode(PARAM[i])
+ j = index(PARAM[i], "=")
+ GETARG[substr(PARAM[i], 1, j-1)] = \
+ substr(PARAM[i], j+1)
+ }
+ } else { # there is no "?", no need for splitting PARAMs
+ split(uri, MENU, "[/:]")
+ }
+ for (i in MENU) # decode characters in path
+ if (i > 4) # but not those in host name
+ MENU[i] = _CGI_decode(MENU[i])
+}
+function _CGI_decode(str, hexdigs, i, pre, code1, code2,
+ val, result)
+{
+ hexdigs = "123456789abcdef"
+
+ i = index(str, "%")
+ if (i == 0) # no work to do
+ return str
+
+ do {
+ pre = substr(str, 1, i-1) # part before %xx
+ code1 = substr(str, i+1, 1) # first hex digit
+ code2 = substr(str, i+2, 1) # second hex digit
+ str = substr(str, i+3) # rest of string
+
+ code1 = tolower(code1)
+ code2 = tolower(code2)
+ val = index(hexdigs, code1) * 16 \
+ + index(hexdigs, code2)
+
+ result = result pre sprintf("%c", val)
+ i = index(str, "%")
+ } while (i != 0)
+ if (length(str) > 0)
+ result = result str
+ return result
+}
diff --git a/gnu/dist/gawk/awklib/eg/network/eliza.awk b/gnu/dist/gawk/awklib/eg/network/eliza.awk
new file mode 100644
index 00000000000..75e353a7811
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/eliza.awk
@@ -0,0 +1,270 @@
+function SetUpServer() {
+ SetUpEliza()
+ TopHeader = \
+ "<HTML><title>An HTTP-based System with GAWK</title>\
+ <HEAD><META HTTP-EQUIV=\"Content-Type\"\
+ CONTENT=\"text/html; charset=iso-8859-1\"></HEAD>\
+ <BODY BGCOLOR=\"#ffffff\" TEXT=\"#000000\"\
+ LINK=\"#0000ff\" VLINK=\"#0000ff\"\
+ ALINK=\"#0000ff\"> <A NAME=\"top\">"
+ TopDoc = "\
+ <h2>Please choose one of the following actions:</h2>\
+ <UL>\
+ <LI>\
+ <A HREF=" MyPrefix "/AboutServer>About this server</A>\
+ </LI><LI>\
+ <A HREF=" MyPrefix "/AboutELIZA>About Eliza</A></LI>\
+ <LI>\
+ <A HREF=" MyPrefix \
+ "/StartELIZA>Start talking to Eliza</A></LI></UL>"
+ TopFooter = "</BODY></HTML>"
+}
+function HandleGET() {
+ # A real HTTP server would treat some parts of the URI as a file name.
+ # We take parts of the URI as menu choices and go on accordingly.
+ if(MENU[2] == "AboutServer") {
+ Document = "This is not a CGI script.\
+ This is an httpd, an HTML file, and a CGI script all \
+ in one GAWK script. It needs no separate www-server, \
+ no installation, and no root privileges.\
+ <p>To run it, do this:</p><ul>\
+ <li> start this script with \"gawk -f httpserver.awk\",</li>\
+ <li> and on the same host let your www browser open location\
+ \"http://localhost:8080\"</li>\
+ </ul>\<p>\ Details of HTTP come from:</p><ul>\
+ <li>Hethmon: Illustrated Guide to HTTP</p>\
+ <li>RFC 2068</li></ul><p>JK 14.9.1997</p>"
+ } else if (MENU[2] == "AboutELIZA") {
+ Document = "This is an implementation of the famous ELIZA\
+ program by Joseph Weizenbaum. It is written in GAWK and\
+/bin/sh: expad: command not found
+ } else if (MENU[2] == "StartELIZA") {
+ gsub(/\+/, " ", GETARG["YouSay"])
+ # Here we also have to substitute coded special characters
+ Document = "<form method=GET>" \
+ "<h3>" ElizaSays(GETARG["YouSay"]) "</h3>\
+ <p><input type=text name=YouSay value=\"\" size=60>\
+ <br><input type=submit value=\"Tell her about it\"></p></form>"
+ }
+}
+function ElizaSays(YouSay) {
+ if (YouSay == "") {
+ cost = 0
+ answer = "HI, IM ELIZA, TELL ME YOUR PROBLEM"
+ } else {
+ q = toupper(YouSay)
+ gsub("'", "", q)
+ if(q == qold) {
+ answer = "PLEASE DONT REPEAT YOURSELF !"
+ } else {
+ if (index(q, "SHUT UP") > 0) {
+ answer = "WELL, PLEASE PAY YOUR BILL. ITS EXACTLY ... $"\
+ int(100*rand()+30+cost/100)
+ } else {
+ qold = q
+ w = "-" # no keyword recognized yet
+ for (i in k) { # search for keywords
+ if (index(q, i) > 0) {
+ w = i
+ break
+ }
+ }
+ if (w == "-") { # no keyword, take old subject
+ w = wold
+ subj = subjold
+ } else { # find subject
+ subj = substr(q, index(q, w) + length(w)+1)
+ wold = w
+ subjold = subj # remember keyword and subject
+ }
+ for (i in conj)
+ gsub(i, conj[i], q) # conjugation
+ # from all answers to this keyword, select one randomly
+ answer = r[indices[int(split(k[w], indices) * rand()) + 1]]
+ # insert subject into answer
+ gsub("_", subj, answer)
+ }
+ }
+ }
+ cost += length(answer) # for later payment : 1 cent per character
+ return answer
+}
+function SetUpEliza() {
+ srand()
+ wold = "-"
+ subjold = " "
+
+ # table for conjugation
+ conj[" ARE " ] = " AM "
+ conj["WERE " ] = "WAS "
+ conj[" YOU " ] = " I "
+ conj["YOUR " ] = "MY "
+ conj[" IVE " ] =\
+ conj[" I HAVE " ] = " YOU HAVE "
+ conj[" YOUVE " ] =\
+ conj[" YOU HAVE "] = " I HAVE "
+ conj[" IM " ] =\
+ conj[" I AM " ] = " YOU ARE "
+ conj[" YOURE " ] =\
+ conj[" YOU ARE " ] = " I AM "
+
+ # table of all answers
+ r[1] = "DONT YOU BELIEVE THAT I CAN _"
+ r[2] = "PERHAPS YOU WOULD LIKE TO BE ABLE TO _ ?"
+ r[3] = "YOU WANT ME TO BE ABLE TO _ ?"
+ r[4] = "PERHAPS YOU DONT WANT TO _ "
+ r[5] = "DO YOU WANT TO BE ABLE TO _ ?"
+ r[6] = "WHAT MAKES YOU THINK I AM _ ?"
+ r[7] = "DOES IT PLEASE YOU TO BELIEVE I AM _ ?"
+ r[8] = "PERHAPS YOU WOULD LIKE TO BE _ ?"
+ r[9] = "DO YOU SOMETIMES WISH YOU WERE _ ?"
+ r[10] = "DONT YOU REALLY _ ?"
+ r[11] = "WHY DONT YOU _ ?"
+ r[12] = "DO YOU WISH TO BE ABLE TO _ ?"
+ r[13] = "DOES THAT TROUBLE YOU ?"
+ r[14] = "TELL ME MORE ABOUT SUCH FEELINGS"
+ r[15] = "DO YOU OFTEN FEEL _ ?"
+ r[16] = "DO YOU ENJOY FEELING _ ?"
+ r[17] = "DO YOU REALLY BELIEVE I DONT _ ?"
+ r[18] = "PERHAPS IN GOOD TIME I WILL _ "
+ r[19] = "DO YOU WANT ME TO _ ?"
+ r[20] = "DO YOU THINK YOU SHOULD BE ABLE TO _ ?"
+ r[21] = "WHY CANT YOU _ ?"
+ r[22] = "WHY ARE YOU INTERESTED IN WHETHER OR NOT I AM _ ?"
+ r[23] = "WOULD YOU PREFER IF I WERE NOT _ ?"
+ r[24] = "PERHAPS IN YOUR FANTASIES I AM _ "
+ r[25] = "HOW DO YOU KNOW YOU CANT _ ?"
+ r[26] = "HAVE YOU TRIED ?"
+ r[27] = "PERHAPS YOU CAN NOW _ "
+ r[28] = "DID YOU COME TO ME BECAUSE YOU ARE _ ?"
+ r[29] = "HOW LONG HAVE YOU BEEN _ ?"
+ r[30] = "DO YOU BELIEVE ITS NORMAL TO BE _ ?"
+ r[31] = "DO YOU ENJOY BEING _ ?"
+ r[32] = "WE WERE DISCUSSING YOU -- NOT ME"
+ r[33] = "Oh, I _"
+ r[34] = "YOU'RE NOT REALLY TALKING ABOUT ME, ARE YOU ?"
+ r[35] = "WHAT WOULD IT MEAN TO YOU, IF YOU GOT _ ?"
+ r[36] = "WHY DO YOU WANT _ ?"
+ r[37] = "SUPPOSE YOU SOON GOT _"
+ r[38] = "WHAT IF YOU NEVER GOT _ ?"
+ r[39] = "I SOMETIMES ALSO WANT _"
+ r[40] = "WHY DO YOU ASK ?"
+ r[41] = "DOES THAT QUESTION INTEREST YOU ?"
+ r[42] = "WHAT ANSWER WOULD PLEASE YOU THE MOST ?"
+ r[43] = "WHAT DO YOU THINK ?"
+ r[44] = "ARE SUCH QUESTIONS IN YOUR MIND OFTEN ?"
+ r[45] = "WHAT IS IT THAT YOU REALLY WANT TO KNOW ?"
+ r[46] = "HAVE YOU ASKED ANYONE ELSE ?"
+ r[47] = "HAVE YOU ASKED SUCH QUESTIONS BEFORE ?"
+ r[48] = "WHAT ELSE COMES TO MIND WHEN YOU ASK THAT ?"
+ r[49] = "NAMES DON'T INTEREST ME"
+ r[50] = "I DONT CARE ABOUT NAMES -- PLEASE GO ON"
+ r[51] = "IS THAT THE REAL REASON ?"
+ r[52] = "DONT ANY OTHER REASONS COME TO MIND ?"
+ r[53] = "DOES THAT REASON EXPLAIN ANYTHING ELSE ?"
+ r[54] = "WHAT OTHER REASONS MIGHT THERE BE ?"
+ r[55] = "PLEASE DON'T APOLOGIZE !"
+ r[56] = "APOLOGIES ARE NOT NECESSARY"
+ r[57] = "WHAT FEELINGS DO YOU HAVE WHEN YOU APOLOGIZE ?"
+ r[58] = "DON'T BE SO DEFENSIVE"
+ r[59] = "WHAT DOES THAT DREAM SUGGEST TO YOU ?"
+ r[60] = "DO YOU DREAM OFTEN ?"
+ r[61] = "WHAT PERSONS APPEAR IN YOUR DREAMS ?"
+ r[62] = "ARE YOU DISTURBED BY YOUR DREAMS ?"
+ r[63] = "HOW DO YOU DO ... PLEASE STATE YOUR PROBLEM"
+ r[64] = "YOU DON'T SEEM QUITE CERTAIN"
+ r[65] = "WHY THE UNCERTAIN TONE ?"
+ r[66] = "CAN'T YOU BE MORE POSITIVE ?"
+ r[67] = "YOU AREN'T SURE ?"
+ r[68] = "DON'T YOU KNOW ?"
+ r[69] = "WHY NO _ ?"
+ r[70] = "DON'T SAY NO, IT'S ALWAYS SO NEGATIVE"
+ r[71] = "WHY NOT ?"
+ r[72] = "ARE YOU SURE ?"
+ r[73] = "WHY NO ?"
+ r[74] = "WHY ARE YOU CONCERNED ABOUT MY _ ?"
+ r[75] = "WHAT ABOUT YOUR OWN _ ?"
+ r[76] = "CAN'T YOU THINK ABOUT A SPECIFIC EXAMPLE ?"
+ r[77] = "WHEN ?"
+ r[78] = "WHAT ARE YOU THINKING OF ?"
+ r[79] = "REALLY, ALWAYS ?"
+ r[80] = "DO YOU REALLY THINK SO ?"
+ r[81] = "BUT YOU ARE NOT SURE YOU _ "
+ r[82] = "DO YOU DOUBT YOU _ ?"
+ r[83] = "IN WHAT WAY ?"
+ r[84] = "WHAT RESEMBLANCE DO YOU SEE ?"
+ r[85] = "WHAT DOES THE SIMILARITY SUGGEST TO YOU ?"
+ r[86] = "WHAT OTHER CONNECTION DO YOU SEE ?"
+ r[87] = "COULD THERE REALLY BE SOME CONNECTIONS ?"
+ r[88] = "HOW ?"
+ r[89] = "YOU SEEM QUITE POSITIVE"
+ r[90] = "ARE YOU SURE ?"
+ r[91] = "I SEE"
+ r[92] = "I UNDERSTAND"
+ r[93] = "WHY DO YOU BRING UP THE TOPIC OF FRIENDS ?"
+ r[94] = "DO YOUR FRIENDS WORRY YOU ?"
+ r[95] = "DO YOUR FRIENDS PICK ON YOU ?"
+ r[96] = "ARE YOU SURE YOU HAVE ANY FRIENDS ?"
+ r[97] = "DO YOU IMPOSE ON YOUR FRIENDS ?"
+ r[98] = "PERHAPS YOUR LOVE FOR FRIENDS WORRIES YOU"
+ r[99] = "DO COMPUTERS WORRY YOU ?"
+ r[100] = "ARE YOU TALKING ABOUT ME IN PARTICULAR ?"
+ r[101] = "ARE YOU FRIGHTENED BY MACHINES ?"
+ r[102] = "WHY DO YOU MENTION COMPUTERS ?"
+ r[103] = "WHAT DO YOU THINK MACHINES HAVE TO DO WITH YOUR PROBLEMS ?"
+ r[104] = "DON'T YOU THINK COMPUTERS CAN HELP PEOPLE ?"
+ r[105] = "WHAT IS IT ABOUT MACHINES THAT WORRIES YOU ?"
+ r[106] = "SAY, DO YOU HAVE ANY PSYCHOLOGICAL PROBLEMS ?"
+ r[107] = "WHAT DOES THAT SUGGEST TO YOU ?"
+ r[108] = "I SEE"
+ r[109] = "IM NOT SURE I UNDERSTAND YOU FULLY"
+ r[110] = "COME COME ELUCIDATE YOUR THOUGHTS"
+ r[111] = "CAN YOU ELABORATE ON THAT ?"
+ r[112] = "THAT IS QUITE INTERESTING"
+ r[113] = "WHY DO YOU HAVE PROBLEMS WITH MONEY ?"
+ r[114] = "DO YOU THINK MONEY IS EVERYTHING ?"
+ r[115] = "ARE YOU SURE THAT MONEY IS THE PROBLEM ?"
+ r[116] = "I THINK WE WANT TO TALK ABOUT YOU, NOT ABOUT ME"
+ r[117] = "WHAT'S ABOUT ME ?"
+ r[118] = "WHY DO YOU ALWAYS BRING UP MY NAME ?"
+ # table for looking up answers that
+ # fit to a certain keyword
+ k["CAN YOU"] = "1 2 3"
+ k["CAN I"] = "4 5"
+ k["YOU ARE"] =\
+ k["YOURE"] = "6 7 8 9"
+ k["I DONT"] = "10 11 12 13"
+ k["I FEEL"] = "14 15 16"
+ k["WHY DONT YOU"] = "17 18 19"
+ k["WHY CANT I"] = "20 21"
+ k["ARE YOU"] = "22 23 24"
+ k["I CANT"] = "25 26 27"
+ k["I AM"] =\
+ k["IM "] = "28 29 30 31"
+ k["YOU "] = "32 33 34"
+ k["I WANT"] = "35 36 37 38 39"
+ k["WHAT"] =\
+ k["HOW"] =\
+ k["WHO"] =\
+ k["WHERE"] =\
+ k["WHEN"] =\
+ k["WHY"] = "40 41 42 43 44 45 46 47 48"
+ k["NAME"] = "49 50"
+ k["CAUSE"] = "51 52 53 54"
+ k["SORRY"] = "55 56 57 58"
+ k["DREAM"] = "59 60 61 62"
+ k["HELLO"] =\
+ k["HI "] = "63"
+ k["MAYBE"] = "64 65 66 67 68"
+ k[" NO "] = "69 70 71 72 73"
+ k["YOUR"] = "74 75"
+ k["ALWAYS"] = "76 77 78 79"
+ k["THINK"] = "80 81 82"
+ k["LIKE"] = "83 84 85 86 87 88 89"
+ k["YES"] = "90 91 92"
+ k["FRIEND"] = "93 94 95 96 97 98"
+ k["COMPUTER"] = "99 100 101 102 103 104 105"
+ k["-"] = "106 107 108 109 110 111 112"
+ k["MONEY"] = "113 114 115"
+ k["ELIZA"] = "116 117 118"
+}
diff --git a/gnu/dist/gawk/awklib/eg/network/fingerclient.awk b/gnu/dist/gawk/awklib/eg/network/fingerclient.awk
new file mode 100644
index 00000000000..bcc2c94cfa5
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/fingerclient.awk
@@ -0,0 +1,7 @@
+BEGIN {
+ NetService = "/inet/tcp/0/localhost/finger"
+ print "var{name}" |& NetService
+ while ((NetService |& getline) > 0)
+ print $0
+ close(NetService)
+}
diff --git a/gnu/dist/gawk/awklib/eg/network/geturl.awk b/gnu/dist/gawk/awklib/eg/network/geturl.awk
new file mode 100644
index 00000000000..53853e50283
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/geturl.awk
@@ -0,0 +1,24 @@
+BEGIN {
+ if (ARGC != 2) {
+ print "GETURL - retrieve Web page via HTTP 1.0"
+ print "IN:\n the URL as a command-line parameter"
+ print "PARAM(S):\n -v Proxy=MyProxy"
+ print "OUT:\n the page content on stdout"
+ print " the page header on stderr"
+ print "JK 16.05.1997"
+ print "ADR 13.08.2000"
+ exit
+ }
+ URL = ARGV[1]; ARGV[1] = ""
+ if (Proxy == "") Proxy = "127.0.0.1"
+ if (ProxyPort == 0) ProxyPort = 80
+ if (Method == "") Method = "GET"
+ HttpService = "/inet/tcp/0/" Proxy "/" ProxyPort
+ ORS = RS = "\r\n\r\n"
+ print Method " " URL " HTTP/1.0" |& HttpService
+ HttpService |& getline Header
+ print Header > "/dev/stderr"
+ while ((HttpService |& getline) > 0)
+ printf "%s", $0
+ close(HttpService)
+}
diff --git a/gnu/dist/gawk/awklib/eg/network/hello-serv.awk b/gnu/dist/gawk/awklib/eg/network/hello-serv.awk
new file mode 100644
index 00000000000..003ee088ac4
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/hello-serv.awk
@@ -0,0 +1,14 @@
+BEGIN {
+ RS = ORS = "\r\n"
+ HttpService = "/inet/tcp/8080/0/0"
+ Hello = "<HTML><HEAD>" \
+ "<TITLE>A Famous Greeting</TITLE></HEAD>" \
+ "<BODY><H1>Hello, world</H1></BODY></HTML>"
+ Len = length(Hello) + length(ORS)
+ print "HTTP/1.0 200 OK" |& HttpService
+ print "Content-Length: " Len ORS |& HttpService
+ print Hello |& HttpService
+ while ((HttpService |& getline) > 0)
+ continue;
+ close(HttpService)
+}
diff --git a/gnu/dist/gawk/awklib/eg/network/maze.awk b/gnu/dist/gawk/awklib/eg/network/maze.awk
new file mode 100644
index 00000000000..94888f8c61f
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/maze.awk
@@ -0,0 +1,73 @@
+function SetUpServer() {
+ TopHeader = "<HTML><title>Walk through a maze</title>"
+ TopDoc = "\
+ <h2>Please choose one of the following actions:</h2>\
+ <UL>\
+ <LI><A HREF=" MyPrefix "/AboutServer>About this server</A>\
+ <LI><A HREF=" MyPrefix "/VRMLtest>Watch a simple VRML scene</A>\
+ </UL>"
+ TopFooter = "</HTML>"
+ srand()
+}
+function HandleGET() {
+ if (MENU[2] == "AboutServer") {
+ Document = "If your browser has a VRML 2 plugin,\
+ this server shows you a simple VRML scene."
+ } else if (MENU[2] == "VRMLtest") {
+ XSIZE = YSIZE = 11 # initially, everything is wall
+ for (y = 0; y < YSIZE; y++)
+ for (x = 0; x < XSIZE; x++)
+ Maze[x, y] = "#"
+ delete Maze[0, 1] # entry is not wall
+ delete Maze[XSIZE-1, YSIZE-2] # exit is not wall
+ MakeMaze(1, 1)
+ Document = "\
+#VRML V2.0 utf8\n\
+Group {\n\
+ children [\n\
+ PointLight {\n\
+ ambientIntensity 0.2\n\
+ color 0.7 0.7 0.7\n\
+ location 0.0 8.0 10.0\n\
+ }\n\
+ DEF B1 Background {\n\
+ skyColor [0 0 0, 1.0 1.0 1.0 ]\n\
+ skyAngle 1.6\n\
+ groundColor [1 1 1, 0.8 0.8 0.8, 0.2 0.2 0.2 ]\n\
+ groundAngle [ 1.2 1.57 ]\n\
+ }\n\
+ DEF Wall Shape {\n\
+ geometry Box {size 1 1 1}\n\
+ appearance Appearance { material Material { diffuseColor 0 0 1 } }\n\
+ }\n\
+ DEF Entry Viewpoint {\n\
+ position 0.5 1.0 5.0\n\
+ orientation 0.0 0.0 -1.0 0.52\n\
+ }\n"
+ for (i in Maze) {
+ split(i, t, SUBSEP)
+ Document = Document " Transform { translation "
+ Document = Document t[1] " 0 -" t[2] " children USE Wall }\n"
+ }
+ Document = Document " ] # end of group for world\n}"
+ Reason = "OK" ORS "Content-type: model/vrml"
+ Header = Footer = ""
+ }
+}
+function MakeMaze(x, y) {
+ delete Maze[x, y] # here we are, we have no wall here
+ p = 0 # count unvisited fields in all directions
+ if (x-2 SUBSEP y in Maze) d[p++] = "-x"
+ if (x SUBSEP y-2 in Maze) d[p++] = "-y"
+ if (x+2 SUBSEP y in Maze) d[p++] = "+x"
+ if (x SUBSEP y+2 in Maze) d[p++] = "+y"
+ if (p>0) { # if there are univisited fields, go there
+ p = int(p*rand()) # choose one unvisited field at random
+ if (d[p] == "-x") { delete Maze[x - 1, y]; MakeMaze(x - 2, y)
+ } else if (d[p] == "-y") { delete Maze[x, y - 1]; MakeMaze(x, y - 2)
+ } else if (d[p] == "+x") { delete Maze[x + 1, y]; MakeMaze(x + 2, y)
+ } else if (d[p] == "+y") { delete Maze[x, y + 1]; MakeMaze(x, y + 2)
+ } # we are back from recursion
+ MakeMaze(x, y); # try again while there are unvisited fields
+ }
+}
diff --git a/gnu/dist/gawk/awklib/eg/network/mobag.awk b/gnu/dist/gawk/awklib/eg/network/mobag.awk
new file mode 100644
index 00000000000..a8c55008b78
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/mobag.awk
@@ -0,0 +1,72 @@
+BEGIN {
+ if (ARGC != 2) {
+ print "MOBAG - a simple mobile agent"
+ print "CALL:\n gawk -f mobag.awk mobag.awk"
+ print "IN:\n the name of this script as a command-line parameter"
+ print "PARAM:\n -v MyOrigin=myhost.com"
+ print "OUT:\n the result on stdout"
+ print "JK 29.03.1998 01.04.1998"
+ exit
+ }
+ if (MyOrigin == "") {
+ "uname -n" | getline MyOrigin
+ close("uname -n")
+ }
+}
+#ReadMySelf
+/^function / { FUNC = $2 }
+/^END/ || /^#ReadMySelf/ { FUNC = $1 }
+FUNC != "" { MOBFUN[FUNC] = MOBFUN[FUNC] RS $0 }
+(FUNC != "") && (/^}/ || /^#EndOfMySelf/) \
+ { FUNC = "" }
+#EndOfMySelf
+function migrate(Destination, MobCode, Label) {
+ MOBVAR["Label"] = Label
+ MOBVAR["Destination"] = Destination
+ RS = ORS = "\r\n"
+ HttpService = "/inet/tcp/0/" Destination
+ for (i in MOBFUN)
+ MobCode = (MobCode "\n" MOBFUN[i])
+ MobCode = MobCode "\n\nBEGIN {"
+ for (i in MOBVAR)
+ MobCode = (MobCode "\n MOBVAR[\"" i "\"] = \"" MOBVAR[i] "\"")
+ MobCode = MobCode "\n}\n"
+ print "POST /cgi-bin/PostAgent.sh HTTP/1.0" |& HttpService
+ print "Content-length:", length(MobCode) ORS |& HttpService
+ printf "%s", MobCode |& HttpService
+ while ((HttpService |& getline) > 0)
+ print $0
+ close(HttpService)
+}
+END {
+ if (ARGC != 2) exit # stop when called with wrong parameters
+ if (MyOrigin != "") # is this the originating host?
+ MyInit() # if so, initialize the application
+ else # we are on a host with migrated data
+ MyJob() # so we do our job
+}
+function MyInit() {
+ MOBVAR["MyOrigin"] = MyOrigin
+ MOBVAR["Machines"] = "localhost/80 max/80 moritz/80 castor/80"
+ split(MOBVAR["Machines"], Machines) # which host is the first?
+ migrate(Machines[1], "", "") # go to the first host
+ while (("/inet/tcp/8080/0/0" |& getline) > 0) # wait for result
+ print $0 # print result
+ close("/inet/tcp/8080/0/0")
+}
+function MyJob() {
+ # forget this host
+ sub(MOBVAR["Destination"], "", MOBVAR["Machines"])
+ MOBVAR["Result"]=MOBVAR["Result"] SUBSEP SUBSEP MOBVAR["Destination"] ":"
+ while (("who" | getline) > 0) # who is logged in?
+ MOBVAR["Result"] = MOBVAR["Result"] SUBSEP $0
+ close("who")
+ if (index(MOBVAR["Machines"], "/") > 0) { # any more machines to visit?
+ split(MOBVAR["Machines"], Machines) # which host is next?
+ migrate(Machines[1], "", "") # go there
+ } else { # no more machines
+ gsub(SUBSEP, "\n", MOBVAR["Result"]) # send result to origin
+ print MOBVAR["Result"] |& "/inet/tcp/0/" MOBVAR["MyOrigin"] "/8080"
+ close("/inet/tcp/0/" MOBVAR["MyOrigin"] "/8080")
+ }
+}
diff --git a/gnu/dist/gawk/awklib/eg/network/panic.awk b/gnu/dist/gawk/awklib/eg/network/panic.awk
new file mode 100644
index 00000000000..6db8c46d4b0
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/panic.awk
@@ -0,0 +1,18 @@
+BEGIN {
+ RS = ORS = "\r\n"
+ if (MyPort == 0) MyPort = 8080
+ HttpService = "/inet/tcp/" MyPort "/0/0"
+ Hello = "<HTML><HEAD><TITLE>Out Of Service</TITLE>" \
+ "</HEAD><BODY><H1>" \
+ "This site is temporarily out of service." \
+ "</H1></BODY></HTML>"
+ Len = length(Hello) + length(ORS)
+ while ("awk" != "complex") {
+ print "HTTP/1.0 200 OK" |& HttpService
+ print "Content-Length: " Len ORS |& HttpService
+ print Hello |& HttpService
+ while ((HttpService |& getline) > 0)
+ continue;
+ close(HttpService)
+ }
+}
diff --git a/gnu/dist/gawk/awklib/eg/network/protbase.awk b/gnu/dist/gawk/awklib/eg/network/protbase.awk
new file mode 100644
index 00000000000..f4a911c9f59
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/protbase.awk
@@ -0,0 +1,11 @@
+{ request = request "\n" $0 }
+
+END {
+ BLASTService = "/inet/tcp/0/www.ncbi.nlm.nih.gov/80"
+ printf "POST /cgi-bin/BLAST/nph-blast_report HTTP/1.0\n" |& BLASTService
+ printf "Content-Length: " length(request) "\n\n" |& BLASTService
+ printf request |& BLASTService
+ while ((BLASTService |& getline) > 0)
+ print $0
+ close(BLASTService)
+}
diff --git a/gnu/dist/gawk/awklib/eg/network/protbase.request b/gnu/dist/gawk/awklib/eg/network/protbase.request
new file mode 100644
index 00000000000..4c5c3d2c1d2
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/protbase.request
@@ -0,0 +1,7 @@
+PROGRAM blastn
+DATALIB month
+EXPECT 0.75
+BEGIN
+>GAWK310 the gawking gene GNU AWK
+tgcttggctgaggagccataggacgagagcttcctggtgaagtgtgtttcttgaaatcat
+caccaccatggacagcaaa
diff --git a/gnu/dist/gawk/awklib/eg/network/protbase.result b/gnu/dist/gawk/awklib/eg/network/protbase.result
new file mode 100644
index 00000000000..a087af43fef
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/protbase.result
@@ -0,0 +1,9 @@
+Sequences producing significant alignments: (bits) Value
+
+gb|AC021182.14|AC021182 Homo sapiens chromosome 7 clone RP11-733... 38 0.20
+gb|AC021056.12|AC021056 Homo sapiens chromosome 3 clone RP11-115... 38 0.20
+emb|AL160278.10|AL160278 Homo sapiens chromosome 9 clone RP11-57... 38 0.20
+emb|AL391139.11|AL391139 Homo sapiens chromosome X clone RP11-35... 38 0.20
+emb|AL365192.6|AL365192 Homo sapiens chromosome 6 clone RP3-421H... 38 0.20
+emb|AL138812.9|AL138812 Homo sapiens chromosome 11 clone RP1-276... 38 0.20
+gb|AC073881.3|AC073881 Homo sapiens chromosome 15 clone CTD-2169... 38 0.20
diff --git a/gnu/dist/gawk/awklib/eg/network/remconf.awk b/gnu/dist/gawk/awklib/eg/network/remconf.awk
new file mode 100644
index 00000000000..ef9222657e7
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/remconf.awk
@@ -0,0 +1,54 @@
+function SetUpServer() {
+ TopHeader = "<HTML><title>Remote Configuration</title>"
+ TopDoc = "<BODY>\
+ <h2>Please choose one of the following actions:</h2>\
+ <UL>\
+ <LI><A HREF=" MyPrefix "/AboutServer>About this server</A></LI>\
+ <LI><A HREF=" MyPrefix "/ReadConfig>Read Configuration</A></LI>\
+ <LI><A HREF=" MyPrefix "/CheckConfig>Check Configuration</A></LI>\
+ <LI><A HREF=" MyPrefix "/ChangeConfig>Change Configuration</A></LI>\
+ <LI><A HREF=" MyPrefix "/SaveConfig>Save Configuration</A></LI>\
+ </UL>"
+ TopFooter = "</BODY></HTML>"
+ if (ConfigFile == "") ConfigFile = "config.asc"
+}
+function HandleGET() {
+ if(MENU[2] == "AboutServer") {
+ Document = "This is a GUI for remote configuration of an\
+ embedded system. It is is implemented as one GAWK script."
+ } else if (MENU[2] == "ReadConfig") {
+ RS = "\n"
+ while ((getline < ConfigFile) > 0)
+ config[$1] = $2;
+ close(ConfigFile)
+ RS = "\r\n"
+ Document = "Configuration has been read."
+ } else if (MENU[2] == "CheckConfig") {
+ Document = "<TABLE BORDER=1 CELLPADDING=5>"
+ for (i in config)
+ Document = Document "<TR><TD>" i "</TD>" \
+ "<TD>" config[i] "</TD></TR>"
+ Document = Document "</TABLE>"
+ } else if (MENU[2] == "ChangeConfig") {
+ if ("Param" in GETARG) { # any parameter to set?
+ if (GETARG["Param"] in config) { # is parameter valid?
+ config[GETARG["Param"]] = GETARG["Value"]
+ Document = (GETARG["Param"] " = " GETARG["Value"] ".")
+ } else {
+ Document = "Parameter <b>" GETARG["Param"] "</b> is invalid."
+ }
+ } else {
+ Document = "<FORM method=GET><h4>Change one parameter</h4>\
+ <TABLE BORDER CELLPADDING=5>\
+ <TR><TD>Parameter</TD><TD>Value</TD></TR>\
+ <TR><TD><input type=text name=Param value=\"\" size=20></TD>\
+ <TD><input type=text name=Value value=\"\" size=40></TD>\
+ </TR></TABLE><input type=submit value=\"Set\"></FORM>"
+ }
+ } else if (MENU[2] == "SaveConfig") {
+ for (i in config)
+ printf("%s %s\n", i, config[i]) > ConfigFile
+ close(ConfigFile)
+ Document = "Configuration has been saved."
+ }
+}
diff --git a/gnu/dist/gawk/awklib/eg/network/statist.awk b/gnu/dist/gawk/awklib/eg/network/statist.awk
new file mode 100644
index 00000000000..a4fc55cf39f
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/statist.awk
@@ -0,0 +1,85 @@
+function SetUpServer() {
+ TopHeader = "<HTML><title>Statistics with GAWK</title>"
+ TopDoc = "<BODY>\
+ <h2>Please choose one of the following actions:</h2>\
+ <UL>\
+ <LI><A HREF=" MyPrefix "/AboutServer>About this server</A></LI>\
+ <LI><A HREF=" MyPrefix "/EnterParameters>Enter Parameters</A></LI>\
+ </UL>"
+ TopFooter = "</BODY></HTML>"
+ GnuPlot = "gnuplot 2>&1"
+ m1=m2=0; v1=v2=1; n1=n2=10
+}
+function HandleGET() {
+ if(MENU[2] == "AboutServer") {
+ Document = "This is a GUI for a statistical computation.\
+ It compares means and variances of two distributions.\
+ It is implemented as one GAWK script and uses GNUPLOT."
+ } else if (MENU[2] == "EnterParameters") {
+ Document = ""
+ if ("m1" in GETARG) { # are there parameters to compare?
+ Document = Document "<SCRIPT LANGUAGE=\"JavaScript\">\
+ setTimeout(\"window.open(\\\"" MyPrefix "/Image" systime()\
+ "\\\",\\\"dist\\\", \\\"status=no\\\");\", 1000); </SCRIPT>"
+ m1 = GETARG["m1"]; v1 = GETARG["v1"]; n1 = GETARG["n1"]
+ m2 = GETARG["m2"]; v2 = GETARG["v2"]; n2 = GETARG["n2"]
+ t = (m1-m2)/sqrt(v1/n1+v2/n2)
+ df = (v1/n1+v2/n2)*(v1/n1+v2/n2)/((v1/n1)*(v1/n1)/(n1-1) \
+ + (v2/n2)*(v2/n2) /(n2-1))
+ if (v1>v2) {
+ f = v1/v2
+ df1 = n1 - 1
+ df2 = n2 - 1
+ } else {
+ f = v2/v1
+ df1 = n2 - 1
+ df2 = n1 - 1
+ }
+ print "pt=ibeta(" df/2 ",0.5," df/(df+t*t) ")" |& GnuPlot
+ print "pF=2.0*ibeta(" df2/2 "," df1/2 "," \
+ df2/(df2+df1*f) ")" |& GnuPlot
+ print "print pt, pF" |& GnuPlot
+ RS="\n"; GnuPlot |& getline; RS="\r\n" # $1 is pt, $2 is pF
+ print "invsqrt2pi=1.0/sqrt(2.0*pi)" |& GnuPlot
+ print "nd(x)=invsqrt2pi/sd*exp(-0.5*((x-mu)/sd)**2)" |& GnuPlot
+ print "set term png small color" |& GnuPlot
+ #print "set term postscript color" |& GnuPlot
+ #print "set term gif medium size 320,240" |& GnuPlot
+ print "set yrange[-0.3:]" |& GnuPlot
+ print "set label 'p(m1=m2) =" $1 "' at 0,-0.1 left" |& GnuPlot
+ print "set label 'p(v1=v2) =" $2 "' at 0,-0.2 left" |& GnuPlot
+ print "plot mu=" m1 ",sd=" sqrt(v1) ", nd(x) title 'sample 1',\
+ mu=" m2 ",sd=" sqrt(v2) ", nd(x) title 'sample 2'" |& GnuPlot
+ print "quit" |& GnuPlot
+ GnuPlot |& getline Image
+ while ((GnuPlot |& getline) > 0)
+ Image = Image RS $0
+ close(GnuPlot)
+ }
+ Document = Document "\
+ <h3>Do these samples have the same Gaussian distribution?</h3>\
+ <FORM METHOD=GET> <TABLE BORDER CELLPADDING=5>\
+ <TR>\
+ <TD>1. Mean </TD>
+ <TD><input type=text name=m1 value=" m1 " size=8></TD>\
+ <TD>1. Variance</TD>
+ <TD><input type=text name=v1 value=" v1 " size=8></TD>\
+ <TD>1. Count </TD>
+ <TD><input type=text name=n1 value=" n1 " size=8></TD>\
+ </TR><TR>\
+ <TD>2. Mean </TD>
+ <TD><input type=text name=m2 value=" m2 " size=8></TD>\
+ <TD>2. Variance</TD>
+ <TD><input type=text name=v2 value=" v2 " size=8></TD>\
+ <TD>2. Count </TD>
+ <TD><input type=text name=n2 value=" n2 " size=8></TD>\
+ </TR> <input type=submit value=\"Compute\">\
+ </TABLE></FORM><BR>"
+ } else if (MENU[2] ~ "Image") {
+ Reason = "OK" ORS "Content-type: image/png"
+ #Reason = "OK" ORS "Content-type: application/x-postscript"
+ #Reason = "OK" ORS "Content-type: image/gif"
+ Header = Footer = ""
+ Document = Image
+ }
+}
diff --git a/gnu/dist/gawk/awklib/eg/network/stoxdata.txt b/gnu/dist/gawk/awklib/eg/network/stoxdata.txt
new file mode 100644
index 00000000000..1b6d015eef1
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/stoxdata.txt
@@ -0,0 +1,4 @@
+Date,Open,High,Low,Close,Volume
+9-Oct-00,22.75,22.75,21.375,22.375,7888500
+6-Oct-00,23.8125,24.9375,21.5625,22,10701100
+5-Oct-00,24.4375,24.625,23.125,23.50,5810300
diff --git a/gnu/dist/gawk/awklib/eg/network/stoxpred.awk b/gnu/dist/gawk/awklib/eg/network/stoxpred.awk
new file mode 100644
index 00000000000..62744c14845
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/stoxpred.awk
@@ -0,0 +1,116 @@
+function ReadQuotes() {
+ # Retrieve historical data for each ticker symbol
+ FS = ","
+ for (stock = 1; stock <= StockCount; stock++) {
+ URL = "http://chart.yahoo.com/table.csv?s=" name[stock] \
+ "&a=" month "&b=" day "&c=" year-1 \
+ "&d=" month "&e=" day "&f=" year \
+ "g=d&q=q&y=0&z=" name[stock] "&x=.csv"
+ printf("GET " URL " HTTP/1.0\r\n\r\n") |& YahooData
+ while ((YahooData |& getline) > 0) {
+ if (NF == 6 && $1 ~ /Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec/) {
+ if (stock == 1)
+ days[++daycount] = $1;
+ quote[$1, stock] = $5
+ }
+ }
+ close(YahooData)
+ }
+ FS = " "
+}
+function CleanUp() {
+ # clean up time series; eliminate incomplete data sets
+ for (d = 1; d <= daycount; d++) {
+ for (stock = 1; stock <= StockCount; stock++)
+ if (! ((days[d], stock) in quote))
+ stock = StockCount + 10
+ if (stock > StockCount + 1)
+ continue
+ datacount++
+ for (stock = 1; stock <= StockCount; stock++)
+ data[datacount, stock] = int(0.5 + quote[days[d], stock])
+ }
+ delete quote
+ delete days
+}
+function Prediction() {
+ # Predict each ticker symbol by prolonging yesterday's trend
+ for (stock = 1; stock <= StockCount; stock++) {
+ if (data[1, stock] > data[2, stock]) {
+ predict[stock] = "up"
+ } else if (data[1, stock] < data[2, stock]) {
+ predict[stock] = "down"
+ } else {
+ predict[stock] = "neutral"
+ }
+ if ((data[1, stock] > data[2, stock]) && (data[2, stock] > data[3, stock]))
+ hot[stock] = 1
+ if ((data[1, stock] < data[2, stock]) && (data[2, stock] < data[3, stock]))
+ avoid[stock] = 1
+ }
+ # Do a plausibility check: how many predictions proved correct?
+ for (s = 1; s <= StockCount; s++) {
+ for (d = 1; d <= datacount-2; d++) {
+ if (data[d+1, s] > data[d+2, s]) {
+ UpCount++
+ } else if (data[d+1, s] < data[d+2, s]) {
+ DownCount++
+ } else {
+ NeutralCount++
+ }
+ if (((data[d, s] > data[d+1, s]) && (data[d+1, s] > data[d+2, s])) ||
+ ((data[d, s] < data[d+1, s]) && (data[d+1, s] < data[d+2, s])) ||
+ ((data[d, s] == data[d+1, s]) && (data[d+1, s] == data[d+2, s])))
+ CorrectCount++
+ }
+ }
+}
+function Report() {
+ # Generate report
+ report = "\nThis is your daily "
+ report = report "stock market report for "strftime("%A, %B %d, %Y")".\n"
+ report = report "Here are the predictions for today:\n\n"
+ for (stock = 1; stock <= StockCount; stock++)
+ report = report "\t" name[stock] "\t" predict[stock] "\n"
+ for (stock in hot) {
+ if (HotCount++ == 0)
+ report = report "\nThe most promising shares for today are these:\n\n"
+ report = report "\t" name[stock] "\t\thttp://biz.yahoo.com/n/" \
+ tolower(substr(name[stock], 1, 1)) "/" tolower(name[stock]) ".html\n"
+ }
+ for (stock in avoid) {
+ if (AvoidCount++ == 0)
+ report = report "\nThe stock shares to avoid today are these:\n\n"
+ report = report "\t" name[stock] "\t\thttp://biz.yahoo.com/n/" \
+ tolower(substr(name[stock], 1, 1)) "/" tolower(name[stock]) ".html\n"
+ }
+ report = report "\nThis sums up to " HotCount+0 " winners and " AvoidCount+0
+ report = report " losers. When using this kind\nof prediction scheme for"
+ report = report " the 12 months which lie behind us,\nwe get " UpCount
+ report = report " 'ups' and " DownCount " 'downs' and " NeutralCount
+ report = report " 'neutrals'. Of all\nthese " UpCount+DownCount+NeutralCount
+ report = report " predictions " CorrectCount " proved correct next day.\n"
+ report = report "A success rate of "\
+ int(100*CorrectCount/(UpCount+DownCount+NeutralCount)) "%.\n"
+ report = report "Random choice would have produced a 33% success rate.\n"
+ report = report "Disclaimer: Like every other prediction of the stock\n"
+ report = report "market, this report is, of course, complete nonsense.\n"
+ report = report "If you are stupid enough to believe these predictions\n"
+ report = report "you should visit a doctor who can treat your ailment."
+}
+function SendMail() {
+ # send report to customers
+ customer["uncle.scrooge@ducktown.gov"] = "Uncle Scrooge"
+ customer["more@utopia.org" ] = "Sir Thomas More"
+ customer["spinoza@denhaag.nl" ] = "Baruch de Spinoza"
+ customer["marx@highgate.uk" ] = "Karl Marx"
+ customer["keynes@the.long.run" ] = "John Maynard Keynes"
+ customer["bierce@devil.hell.org" ] = "Ambrose Bierce"
+ customer["laplace@paris.fr" ] = "Pierre Simon de Laplace"
+ for (c in customer) {
+ MailPipe = "mail -s 'Daily Stock Prediction Newsletter'" c
+ print "Good morning " customer[c] "," | MailPipe
+ print report "\n.\n" | MailPipe
+ close(MailPipe)
+ }
+}
diff --git a/gnu/dist/gawk/awklib/eg/network/testserv.awk b/gnu/dist/gawk/awklib/eg/network/testserv.awk
new file mode 100644
index 00000000000..812bfe6a617
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/testserv.awk
@@ -0,0 +1,12 @@
+BEGIN {
+ CGI_setup("GET",
+ "http://www.gnu.org/cgi-bin/foo?p1=stuff&p2=stuff%26junk" \
+ "&percent=a %25 sign",
+ "1.0")
+ for (i in MENU)
+ printf "MENU[\"%s\"] = %s\n", i, MENU[i]
+ for (i in PARAM)
+ printf "PARAM[\"%s\"] = %s\n", i, PARAM[i]
+ for (i in GETARG)
+ printf "GETARG[\"%s\"] = %s\n", i, GETARG[i]
+}
diff --git a/gnu/dist/gawk/awklib/eg/network/urlchk.awk b/gnu/dist/gawk/awklib/eg/network/urlchk.awk
new file mode 100644
index 00000000000..6ddedfa854d
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/urlchk.awk
@@ -0,0 +1,28 @@
+BEGIN {
+ if (ARGC != 2) {
+ print "URLCHK - check if URLs have changed"
+ print "IN:\n the file with URLs as a command-line parameter"
+ print " file contains URL, old length, new length"
+ print "PARAMS:\n -v Proxy=MyProxy -v ProxyPort=8080"
+ print "OUT:\n same as file with URLs"
+ print "JK 02.03.1998"
+ exit
+ }
+ URLfile = ARGV[1]; ARGV[1] = ""
+ if (Proxy != "") Proxy = " -v Proxy=" Proxy
+ if (ProxyPort != "") ProxyPort = " -v ProxyPort=" ProxyPort
+ while ((getline < URLfile) > 0)
+ Length[$1] = $3 + 0
+ close(URLfile) # now, URLfile is read in and can be updated
+ GetHeader = "gawk " Proxy ProxyPort " -v Method=\"HEAD\" -f geturl.awk "
+ for (i in Length) {
+ GetThisHeader = GetHeader i " 2>&1"
+ while ((GetThisHeader | getline) > 0)
+ if (toupper($0) ~ /CONTENT-LENGTH/) NewLength = $2 + 0
+ close(GetThisHeader)
+ print i, Length[i], NewLength > URLfile
+ if (Length[i] != NewLength) # report only changed URLs
+ print i, Length[i], NewLength
+ }
+ close(URLfile)
+}
diff --git a/gnu/dist/gawk/awklib/eg/network/webgrab.awk b/gnu/dist/gawk/awklib/eg/network/webgrab.awk
new file mode 100644
index 00000000000..41738805afb
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/network/webgrab.awk
@@ -0,0 +1,6 @@
+BEGIN { RS = "http://[#%&\\+\\-\\./0-9\\:;\\?A-Z_a-z\\~]*" }
+RT != "" {
+ command = ("gawk -v Proxy=MyProxy -f geturl.awk " RT \
+ " > doc" NR ".html")
+ print command
+}
diff --git a/gnu/dist/gawk/awklib/eg/prog/alarm.awk b/gnu/dist/gawk/awklib/eg/prog/alarm.awk
index fa42dce0ef5..26252fa1a82 100644
--- a/gnu/dist/gawk/awklib/eg/prog/alarm.awk
+++ b/gnu/dist/gawk/awklib/eg/prog/alarm.awk
@@ -1,5 +1,8 @@
-# alarm --- set an alarm
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+# alarm.awk --- set an alarm
+#
+# Requires gettimeofday library function
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May 1993
# usage: alarm time [ "message" [ count [ delay ] ] ]
@@ -11,7 +14,8 @@ BEGIN \
usage2 = sprintf("\t(%s) time ::= hh:mm", ARGV[1])
if (ARGC < 2) {
- print usage > "/dev/stderr"
+ print usage1 > "/dev/stderr"
+ print usage2 > "/dev/stderr"
exit 1
} else if (ARGC == 5) {
delay = ARGV[4] + 0
@@ -37,7 +41,7 @@ BEGIN \
message = sprintf("\aIt is now %s!\a", ARGV[1])
else if (index(message, "\a") == 0)
message = "\a" message "\a"
- # split up dest time
+ # split up alarm time
split(ARGV[1], atime, ":")
hour = atime[1] + 0 # force numeric
minute = atime[2] + 0 # force numeric
diff --git a/gnu/dist/gawk/awklib/eg/prog/awksed.awk b/gnu/dist/gawk/awklib/eg/prog/awksed.awk
index cd96ddebf75..4b188c64d0a 100644
--- a/gnu/dist/gawk/awklib/eg/prog/awksed.awk
+++ b/gnu/dist/gawk/awklib/eg/prog/awksed.awk
@@ -1,7 +1,7 @@
# awksed.awk --- do s/foo/bar/g using just print
# Thanks to Michael Brennan for the idea
-
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# August 1995
function usage()
diff --git a/gnu/dist/gawk/awklib/eg/prog/cut.awk b/gnu/dist/gawk/awklib/eg/prog/cut.awk
index 7c0da75e326..d9c6c9b945f 100644
--- a/gnu/dist/gawk/awklib/eg/prog/cut.awk
+++ b/gnu/dist/gawk/awklib/eg/prog/cut.awk
@@ -1,13 +1,16 @@
# cut.awk --- implement cut in awk
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May 1993
# Options:
-# -f list Cut fields
-# -d c Field delimiter character
-# -c list Cut characters
+# -f list Cut fields
+# -d c Field delimiter character
+# -c list Cut characters
+#
+# -s Suppress lines without the delimiter
#
-# -s Suppress lines without the delimiter character
+# Requires getopt and join library functions
function usage( e1, e2)
{
@@ -122,7 +125,7 @@ function set_charlist( field, i, j, f, g, t,
nfields = j - 1
}
{
- if (by_fields && suppress && $0 !~ FS)
+ if (by_fields && suppress && index($0, FS) != 0)
next
for (i = 1; i <= nfields; i++) {
diff --git a/gnu/dist/gawk/awklib/eg/prog/dupword.awk b/gnu/dist/gawk/awklib/eg/prog/dupword.awk
index 8ae0fdc76d2..a2cc7d2b2b1 100644
--- a/gnu/dist/gawk/awklib/eg/prog/dupword.awk
+++ b/gnu/dist/gawk/awklib/eg/prog/dupword.awk
@@ -1,10 +1,15 @@
-# dupword --- find duplicate words in text
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+# dupword.awk --- find duplicate words in text
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# December 1991
+# Revised October 2000
{
$0 = tolower($0)
- gsub(/[^A-Za-z0-9 \t]/, "");
+ gsub(/[^[:alnum:][:blank:]]/, " ");
+ $0 = $0 # re-split
+ if (NF == 0)
+ next
if ($1 == prev)
printf("%s:%d: duplicate %s\n",
FILENAME, FNR, $1)
diff --git a/gnu/dist/gawk/awklib/eg/prog/egrep.awk b/gnu/dist/gawk/awklib/eg/prog/egrep.awk
index 5a5ec98828c..73f175ca6ce 100644
--- a/gnu/dist/gawk/awklib/eg/prog/egrep.awk
+++ b/gnu/dist/gawk/awklib/eg/prog/egrep.awk
@@ -1,5 +1,6 @@
# egrep.awk --- simulate egrep in awk
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May 1993
# Options:
@@ -9,6 +10,8 @@
# -i ignore case
# -l print filenames only
# -e argument is pattern
+#
+# Requires getopt and file transition library functions
BEGIN {
while ((c = getopt(ARGC, ARGV, "ce:svil")) != -1) {
@@ -69,18 +72,20 @@ function endfile(file)
if (! matches)
next
- if (no_print && ! count_only)
- nextfile
+ if (! count_only) {
+ if (no_print)
+ nextfile
- if (filenames_only && ! count_only) {
- print FILENAME
- nextfile
- }
+ if (filenames_only) {
+ print FILENAME
+ nextfile
+ }
- if (do_filenames && ! count_only)
- print FILENAME ":" $0
- else if (! count_only)
- print
+ if (do_filenames)
+ print FILENAME ":" $0
+ else
+ print
+ }
}
END \
{
@@ -91,6 +96,7 @@ END \
function usage( e)
{
e = "Usage: egrep [-csvil] [-e pat] [files ...]"
+ e = e "\n\tegrep [-csvil] pat [files ...]"
print e > "/dev/stderr"
exit 1
}
diff --git a/gnu/dist/gawk/awklib/eg/prog/extract.awk b/gnu/dist/gawk/awklib/eg/prog/extract.awk
index a9f5b80fd38..5cb191ae1cd 100644
--- a/gnu/dist/gawk/awklib/eg/prog/extract.awk
+++ b/gnu/dist/gawk/awklib/eg/prog/extract.awk
@@ -1,7 +1,9 @@
# extract.awk --- extract files and run programs
# from texinfo files
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May 1993
+# Revised September 2000
BEGIN { IGNORECASE = 1 }
@@ -42,6 +44,8 @@ BEGIN { IGNORECASE = 1 }
break
else if (line ~ /^@(end[ \t]+)?group/)
continue
+ else if (line ~ /^@c(omment+)?[ \t]+/)
+ continue
if (index(line, "@") == 0) {
print line > curfile
continue
@@ -59,9 +63,8 @@ BEGIN { IGNORECASE = 1 }
print join(a, 1, n, SUBSEP) > curfile
}
}
-function unexpected_eof()
-{
- printf("%s:%d: unexpected EOF or error\n", \
+function unexpected_eof() {
+ printf("%s:%d: unexpected EOF or error\n",
FILENAME, FNR) > "/dev/stderr"
exit 1
}
diff --git a/gnu/dist/gawk/awklib/eg/prog/guide.awk b/gnu/dist/gawk/awklib/eg/prog/guide.awk
new file mode 100644
index 00000000000..a2dea1b7f64
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/prog/guide.awk
@@ -0,0 +1,7 @@
+BEGIN {
+ TEXTDOMAIN = "guide"
+ bindtextdomain(".") # for testing
+ print _"Don't Panic"
+ print _"The Answer Is", 42
+ print "Pardon me, Zaphod who?"
+}
diff --git a/gnu/dist/gawk/awklib/eg/prog/histsort.awk b/gnu/dist/gawk/awklib/eg/prog/histsort.awk
index c2c9d1a710e..c0a9165a12e 100644
--- a/gnu/dist/gawk/awklib/eg/prog/histsort.awk
+++ b/gnu/dist/gawk/awklib/eg/prog/histsort.awk
@@ -1,8 +1,9 @@
# histsort.awk --- compact a shell history file
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+# Thanks to Byron Rakitzis for the general idea
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May 1993
-# Thanks to Byron Rakitzis for the general idea
{
if (data[$0]++ == 0)
lines[++count] = $0
diff --git a/gnu/dist/gawk/awklib/eg/prog/id.awk b/gnu/dist/gawk/awklib/eg/prog/id.awk
index b29ef61a376..af78f7600a9 100644
--- a/gnu/dist/gawk/awklib/eg/prog/id.awk
+++ b/gnu/dist/gawk/awklib/eg/prog/id.awk
@@ -1,6 +1,10 @@
# id.awk --- implement id in awk
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Requires user and group library functions
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May 1993
+# Revised February 1996
# output is:
# uid=12(foo) euid=34(bar) gid=3(baz) \
@@ -8,17 +12,10 @@
BEGIN \
{
- if ((getline < "/dev/user") < 0) {
- err = "id: no /dev/user support - cannot run"
- print err > "/dev/stderr"
- exit 1
- }
- close("/dev/user")
-
- uid = $1
- euid = $2
- gid = $3
- egid = $4
+ uid = PROCINFO["uid"]
+ euid = PROCINFO["euid"]
+ gid = PROCINFO["gid"]
+ egid = PROCINFO["egid"]
printf("uid=%d", uid)
pw = getpwuid(uid)
@@ -52,18 +49,19 @@ BEGIN \
}
}
- if (NF > 4) {
- printf(" groups=");
- for (i = 5; i <= NF; i++) {
- printf("%d", $i)
- pw = getgrgid($i)
- if (pw != "") {
- split(pw, a, ":")
- printf("(%s)", a[1])
- }
- if (i < NF)
- printf(",")
+ for (i = 1; ("group" i) in PROCINFO; i++) {
+ if (i == 1)
+ printf(" groups=")
+ group = PROCINFO["group" i]
+ printf("%d", group)
+ pw = getgrgid(group)
+ if (pw != "") {
+ split(pw, a, ":")
+ printf("(%s)", a[1])
}
+ if (("group" (i+1)) in PROCINFO)
+ printf(",")
}
+
print ""
}
diff --git a/gnu/dist/gawk/awklib/eg/prog/igawk.sh b/gnu/dist/gawk/awklib/eg/prog/igawk.sh
index a9fff180022..9fce9a503d6 100644
--- a/gnu/dist/gawk/awklib/eg/prog/igawk.sh
+++ b/gnu/dist/gawk/awklib/eg/prog/igawk.sh
@@ -1,81 +1,81 @@
#! /bin/sh
-
# igawk --- like gawk but do @include processing
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# July 1993
if [ "$1" = debug ]
then
set -x
shift
-else
- # cleanup on exit, hangup, interrupt, quit, termination
- trap 'rm -f /tmp/ig.[se].$$' 0 1 2 3 15
fi
+# A literal newline, so that program text is formmatted correctly
+n='
+'
+
+# Initialize variables to empty
+program=
+opts=
+
while [ $# -ne 0 ] # loop over arguments
do
case $1 in
--) shift; break;;
-W) shift
- set -- -W"$@"
+ # The ${x?'message here'} construct prints a
+ # diagnostic if $x is the null string
+ set -- -W"${@?'missing operand'}"
continue;;
- -[vF]) opts="$opts $1 '$2'"
+ -[vF]) opts="$opts $1 '${2?'missing operand'}'"
shift;;
-[vF]*) opts="$opts '$1'" ;;
- -f) echo @include "$2" >> /tmp/ig.s.$$
+ -f) program="$program$n@include ${2?'missing operand'}"
shift;;
- -f*) f=`echo "$1" | sed 's/-f//'`
- echo @include "$f" >> /tmp/ig.s.$$ ;;
+ -f*) f=`expr "$1" : '-f\(.*\)'`
+ program="$program$n@include $f";;
- -?file=*) # -Wfile or --file
- f=`echo "$1" | sed 's/-.file=//'`
- echo @include "$f" >> /tmp/ig.s.$$ ;;
+ -[W-]file=*)
+ f=`expr "$1" : '-.file=\(.*\)'`
+ program="$program$n@include $f";;
- -?file) # get arg, $2
- echo @include "$2" >> /tmp/ig.s.$$
+ -[W-]file)
+ program="$program$n@include ${2?'missing operand'}"
shift;;
- -?source=*) # -Wsource or --source
- t=`echo "$1" | sed 's/-.source=//'`
- echo "$t" >> /tmp/ig.s.$$ ;;
+ -[W-]source=*)
+ t=`expr "$1" : '-.source=\(.*\)'`
+ program="$program$n$t";;
- -?source) # get arg, $2
- echo "$2" >> /tmp/ig.s.$$
+ -[W-]source)
+ program="$program$n${2?'missing operand'}"
shift;;
- -?version)
- echo igawk: version 1.0 1>&2
+ -[W-]version)
+ echo igawk: version 2.0 1>&2
gawk --version
exit 0 ;;
- -[W-]*) opts="$opts '$1'" ;;
+ -[W-]*) opts="$opts '$1'" ;;
*) break;;
esac
shift
done
-if [ ! -s /tmp/ig.s.$$ ]
+if [ -z "$program" ]
then
- if [ -z "$1" ]
- then
- echo igawk: no program! 1>&2
- exit 1
- else
- echo "$1" > /tmp/ig.s.$$
- shift
- fi
+ program=${1?'missing program'}
+ shift
fi
-# at this point, /tmp/ig.s.$$ has the program
-gawk -- '
-# process @include directives
+# At this point, `program' has the program.
+expand_prog='
function pathto(file, i, t, junk)
{
@@ -110,21 +110,24 @@ 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])
}
-}' /tmp/ig.s.$$ > /tmp/ig.e.$$
-eval gawk -f /tmp/ig.e.$$ $opts -- "$@"
+}' # close quote ends `expand_prog' variable
-exit $?
+processed_program=`gawk -- "$expand_prog" /dev/stdin <<EOF
+$program
+EOF
+`
+eval gawk $opts -- '"$processed_program"' '"$@"'
diff --git a/gnu/dist/gawk/awklib/eg/prog/labels.awk b/gnu/dist/gawk/awklib/eg/prog/labels.awk
index 55815d200b4..fa9c4dab538 100644
--- a/gnu/dist/gawk/awklib/eg/prog/labels.awk
+++ b/gnu/dist/gawk/awklib/eg/prog/labels.awk
@@ -1,10 +1,11 @@
-# labels.awk
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+# labels.awk --- print mailing labels
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# June 1992
-# Program to print labels. Each label is 5 lines of data
-# that may have blank lines. The label sheets have 2
-# blank lines at the top and 2 at the bottom.
+# Each label is 5 lines of data that may have blank lines.
+# The label sheets have 2 blank lines at the top and 2 at
+# the bottom.
BEGIN { RS = "" ; MAXLINES = 100 }
diff --git a/gnu/dist/gawk/awklib/eg/prog/split.awk b/gnu/dist/gawk/awklib/eg/prog/split.awk
index 593e3c645f3..2906a853151 100644
--- a/gnu/dist/gawk/awklib/eg/prog/split.awk
+++ b/gnu/dist/gawk/awklib/eg/prog/split.awk
@@ -1,5 +1,8 @@
# split.awk --- do split in awk
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Requires ord and chr library functions
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May 1993
# usage: split [-num] [file] [outname]
@@ -32,13 +35,14 @@ BEGIN {
close(out)
if (s2 == "z") {
if (s1 == "z") {
- printf("split: %s is too large to split\n", \
+ printf("split: %s is too large to split\n",
FILENAME) > "/dev/stderr"
exit 1
}
s1 = chr(ord(s1) + 1)
s2 = "a"
- } else
+ }
+ else
s2 = chr(ord(s2) + 1)
out = (outfile s1 s2)
tcount = 1
diff --git a/gnu/dist/gawk/awklib/eg/prog/tee.awk b/gnu/dist/gawk/awklib/eg/prog/tee.awk
index 895e4398068..eafc4b9ae7b 100644
--- a/gnu/dist/gawk/awklib/eg/prog/tee.awk
+++ b/gnu/dist/gawk/awklib/eg/prog/tee.awk
@@ -1,5 +1,6 @@
# tee.awk --- tee in awk
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May 1993
# Revised December 1995
diff --git a/gnu/dist/gawk/awklib/eg/prog/testbits.awk b/gnu/dist/gawk/awklib/eg/prog/testbits.awk
new file mode 100644
index 00000000000..143cd9167c7
--- /dev/null
+++ b/gnu/dist/gawk/awklib/eg/prog/testbits.awk
@@ -0,0 +1,27 @@
+# bits2str --- turn a byte into readable 1's and 0's
+
+function bits2str(bits, data, mask)
+{
+ if (bits == 0)
+ return "0"
+
+ mask = 1
+ for (; bits != 0; bits = rshift(bits, 1))
+ data = (and(bits, mask) ? "1" : "0") data
+
+ while ((length(data) % 8) != 0)
+ data = "0" data
+
+ return data
+}
+BEGIN {
+ printf "123 = %s\n", bits2str(123)
+ printf "0123 = %s\n", bits2str(0123)
+ printf "0x99 = %s\n", bits2str(0x99)
+ comp = compl(0x99)
+ printf "compl(0x99) = %#x = %s\n", comp, bits2str(comp)
+ shift = lshift(0x99, 2)
+ printf "lshift(0x99, 2) = %#x = %s\n", shift, bits2str(shift)
+ shift = rshift(0x99, 2)
+ printf "rshift(0x99, 2) = %#x = %s\n", shift, bits2str(shift)
+}
diff --git a/gnu/dist/gawk/awklib/eg/prog/translate.awk b/gnu/dist/gawk/awklib/eg/prog/translate.awk
index 6e9aa5a512f..803700c44d4 100644
--- a/gnu/dist/gawk/awklib/eg/prog/translate.awk
+++ b/gnu/dist/gawk/awklib/eg/prog/translate.awk
@@ -1,8 +1,9 @@
-# translate --- do tr like stuff
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+# translate.awk --- do tr-like stuff
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# August 1989
-# bugs: does not handle things like: tr A-Z a-z, it has
+# Bugs: does not handle things like: tr A-Z a-z, it has
# to be spelled out. However, if `to' is shorter than `from',
# the last character in `to' is used for the rest of `from'.
diff --git a/gnu/dist/gawk/awklib/eg/prog/uniq.awk b/gnu/dist/gawk/awklib/eg/prog/uniq.awk
index 5f63ef0fd7b..cfb50c79789 100644
--- a/gnu/dist/gawk/awklib/eg/prog/uniq.awk
+++ b/gnu/dist/gawk/awklib/eg/prog/uniq.awk
@@ -1,5 +1,8 @@
# uniq.awk --- do uniq in awk
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Requires getopt and join library functions
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May 1993
function usage( e)
@@ -15,7 +18,7 @@ function usage( e)
# -n skip n fields
# +n skip n characters, skip fields first
-BEGIN \
+BEGIN \
{
count = 1
outputfile = "/dev/stdout"
@@ -81,7 +84,7 @@ NR == 1 {
last = $0
next
}
-
+
{
equal = are_equal()
diff --git a/gnu/dist/gawk/awklib/eg/prog/wc.awk b/gnu/dist/gawk/awklib/eg/prog/wc.awk
index e5553116915..f46616b906a 100644
--- a/gnu/dist/gawk/awklib/eg/prog/wc.awk
+++ b/gnu/dist/gawk/awklib/eg/prog/wc.awk
@@ -1,5 +1,6 @@
# wc.awk --- count lines, words, characters
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May 1993
# Options:
@@ -8,6 +9,8 @@
# -c only count characters
#
# Default is to count lines, words, characters
+#
+# Requires getopt and file transition library functions
BEGIN {
# let getopt print a message about
@@ -34,7 +37,6 @@ function beginfile(file)
chars = lines = words = 0
fname = FILENAME
}
-
function endfile(file)
{
tchars += chars
@@ -54,7 +56,6 @@ function endfile(file)
lines++
words += NF
}
-
END {
if (print_total) {
if (do_lines)
diff --git a/gnu/dist/gawk/awklib/eg/prog/wordfreq.awk b/gnu/dist/gawk/awklib/eg/prog/wordfreq.awk
index b67fed472fb..f364c75216d 100644
--- a/gnu/dist/gawk/awklib/eg/prog/wordfreq.awk
+++ b/gnu/dist/gawk/awklib/eg/prog/wordfreq.awk
@@ -1,12 +1,19 @@
-# Print list of word frequencies
+# wordfreq.awk --- print list of word frequencies
+
{
$0 = tolower($0) # remove case distinctions
- gsub(/[^a-z0-9_ \t]/, "", $0) # remove punctuation
+ # remove punctuation
+ gsub(/[^[:alnum:]_[:blank:]]/, "", $0)
for (i = 1; i <= NF; i++)
freq[$i]++
}
+
END {
- sort = "sort +1 -nr"
+ for (word in freq)
+ printf "%s\t%d\n", word, freq[word]
+}
+END {
+ sort = "sort -k 2nr"
for (word in freq)
printf "%s\t%d\n", word, freq[word] | sort
close(sort)
diff --git a/gnu/dist/gawk/awklib/extract.awk b/gnu/dist/gawk/awklib/extract.awk
index 4f4648c484a..1b052e738b6 100644
--- a/gnu/dist/gawk/awklib/extract.awk
+++ b/gnu/dist/gawk/awklib/extract.awk
@@ -1,7 +1,9 @@
# extract.awk --- extract files and run programs
# from texinfo files
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May 1993
+# Revised September 2000
BEGIN { IGNORECASE = 1 }
@@ -42,6 +44,8 @@ BEGIN { IGNORECASE = 1 }
break
else if (line ~ /^@(end[ \t]+)?group/)
continue
+ else if (line ~ /^@c(omment+)?[ \t]+/)
+ continue
if (index(line, "@") == 0) {
print line > curfile
continue
@@ -61,7 +65,7 @@ BEGIN { IGNORECASE = 1 }
}
function unexpected_eof()
{
- printf("%s:%d: unexpected EOF or error\n", \
+ printf("%s:%d: unexpected EOF or error\n",
FILENAME, FNR) > "/dev/stderr"
exit 1
}
@@ -71,7 +75,8 @@ END {
close(curfile)
}
# join.awk --- join an array into a string
-# Arnold Robbins, arnold@gnu.ai.mit.edu, Public Domain
+#
+# Arnold Robbins, arnold@gnu.org, Public Domain
# May 1993
function join(array, start, end, sep, result, i)
diff --git a/gnu/dist/gawk/bisonfix.sed b/gnu/dist/gawk/bisonfix.sed
new file mode 100644
index 00000000000..c18103be0a2
--- /dev/null
+++ b/gnu/dist/gawk/bisonfix.sed
@@ -0,0 +1,3 @@
+/\/\* The parser invokes alloca or malloc; define the necessary symbols. *\*\//a\
+\
+#undef YYSTACK_USE_ALLOCA /* Gawk: nuke alloca once and for all */
diff --git a/gnu/dist/gawk/config.guess b/gnu/dist/gawk/config.guess
new file mode 100755
index 00000000000..4fc21ecc3aa
--- /dev/null
+++ b/gnu/dist/gawk/config.guess
@@ -0,0 +1,1391 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2003-01-30'
+
+# 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
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ 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
+ armeb) machine=armeb-unknown ;;
+ 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
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # 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 ;;
+ *:MicroBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-microbsd${UNAME_RELEASE}
+ exit 0 ;;
+ alpha:OSF1:*:*)
+ if test $UNAME_RELEASE = "V4.0"; then
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ fi
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # 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.
+ 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 ;;
+ DRS?6000:UNIX_SV:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7 && exit 0 ;;
+ esac ;;
+ 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 -o $dummy $dummy.c \
+ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && exit 0
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit 0 ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-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 -o $dummy $dummy.c && $dummy && exit 0
+ 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 -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ # avoid double evaluation of $set_cc_for_build
+ test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ 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 -o $dummy $dummy.c && $dummy && exit 0
+ 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*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 ;;
+ *:UNICOS/mp:*:*)
+ echo nv1-cray-unicosmp${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:*:*)
+ # Determine whether the default compiler uses glibc.
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #if __GLIBC__ >= 2
+ LIBC=gnu
+ #else
+ LIBC=
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+ 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 i586-pc-interix3
+ exit 0 ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ 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 i586-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=`
+ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-unknown-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=`
+ 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:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit 0 ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit 0 ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit 0 ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ 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|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ 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 ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit 0 ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ 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 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*: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 ;;
+ 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 ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-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:*:*)
+ case `uname -p` in
+ *86) UNAME_PROCESSOR=i686 ;;
+ powerpc) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-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-[DGKLNPTVW]: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 ;;
+ *: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 ;;
+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 -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+
+# 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/gnu/dist/gawk/config.rpath b/gnu/dist/gawk/config.rpath
new file mode 100755
index 00000000000..fa24bfc2d78
--- /dev/null
+++ b/gnu/dist/gawk/config.rpath
@@ -0,0 +1,548 @@
+#! /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-2003 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.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ mingw* | pw32* | os2*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ newsos6)
+ ;;
+ linux*)
+ case $CC in
+ icc|ecc)
+ wl='-Wl,'
+ ;;
+ ccc)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ sco3.2v5*)
+ ;;
+ solaris*)
+ wl='-Wl,'
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
+
+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/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ 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'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ 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
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ 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
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ fi
+ if test -z "$aix_libpath"; then
+ aix_libpath="/usr/lib:/lib"
+ fi
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 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
+ ;;
+ bsdi4*)
+ ;;
+ 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*)
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ hardcode_direct=no
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ 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*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10* | hpux11*)
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=no
+ ;;
+ ia64*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=no
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ 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)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4.2uw2*)
+ hardcode_direct=yes
+ hardcode_minus_L=no
+ ;;
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+ ;;
+ sysv5*)
+ hardcode_libdir_flag_spec=
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ ;;
+ aix4* | aix5*)
+ ;;
+ amigaos*)
+ ;;
+ beos*)
+ ;;
+ bsdi4*)
+ ;;
+ cygwin* | mingw* | pw32*)
+ shrext=.dll
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ ;;
+ dgux*)
+ ;;
+ freebsd1*)
+ ;;
+ freebsd*)
+ ;;
+ gnu*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case "$host_cpu" in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux*)
+ ;;
+ netbsd*)
+ ;;
+ newsos6)
+ ;;
+ nto-qnx)
+ ;;
+ openbsd*)
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ ;;
+ osf3* | osf4* | osf5*)
+ ;;
+ sco3.2v5*)
+ ;;
+ solaris*)
+ ;;
+ sunos4*)
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ ;;
+ sysv4*MP*)
+ ;;
+ uts4*)
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_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"
+
+EOF
diff --git a/gnu/dist/gawk/config.sub b/gnu/dist/gawk/config.sub
new file mode 100755
index 00000000000..5f94062aafd
--- /dev/null
+++ b/gnu/dist/gawk/config.sub
@@ -0,0 +1,1489 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2003-02-03'
+
+# 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* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | 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 \
+ | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k \
+ | m32r | m68000 | m68k | m88k | mcore \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | msp430 \
+ | ns16k | ns32k \
+ | openrisc | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | 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-* | armeb-* | armv*-* \
+ | avr-* \
+ | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* \
+ | m32r-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | mcore-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | msp430-* \
+ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | 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
+ ;;
+ nv1)
+ basic_machine=nv1-cray
+ os=-unicosmp
+ ;;
+ 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 | 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
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ 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
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic4x | c4x*)
+ basic_machine=tic4x-unknown
+ os=-coff
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-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
+ ;;
+ 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 | sh[34]eb | sh[1234]le | sh[23]ele)
+ 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
+ ;;
+ *-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* | -mks* | -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* \
+ | -powermax* | -dnix* | -microbsd*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|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
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -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/gnu/dist/gawk/configh.in b/gnu/dist/gawk/configh.in
index 34e89b57cf1..917559b70e8 100644
--- a/gnu/dist/gawk/configh.in
+++ b/gnu/dist/gawk/configh.in
@@ -1,206 +1,449 @@
-/* configh.in. Generated automatically from configure.in by autoheader. */
-/*
- * acconfig.h -- configuration definitions for gawk.
- */
-
-/*
- * Copyright (C) 1995-1997 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
- */
-
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-#undef _ALL_SOURCE
-#endif
+/* configh.in. Generated from configure.ac by autoheader. */
-/* Define if using alloca.c. */
-#undef C_ALLOCA
+/* switch statements are enabled in awk programs */
+#undef ALLOW_SWITCH
-/* Define if type char is unsigned and you are not using gcc. */
-#ifndef __CHAR_UNSIGNED__
-#undef __CHAR_UNSIGNED__
-#endif
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for `alloca.c' support on those systems.
+ */
+#undef CRAY_STACKSEG_END
-/* Define to empty if the keyword does not work. */
-#undef const
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-#undef CRAY_STACKSEG_END
+/* dynamic loading is possible */
+#undef DYNAMIC
-/* Define to the type of elements in the array set by `getgroups'.
- Usually this is either `int' or `gid_t'. */
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+#undef ENABLE_NLS
+
+/* Define to the type of elements in the array set by `getgroups'. Usually
+ this is either `int' or `gid_t'. */
#undef GETGROUPS_T
-/* Define if the `getpgrp' function takes no argument. */
+/* Define to 1 if the `getpgrp' function requires zero arguments. */
#undef GETPGRP_VOID
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef gid_t
+/* Define to 1 if you have the `alarm' function. */
+#undef HAVE_ALARM
-/* Define if you have alloca, as a function or macro. */
+/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
#undef HAVE_ALLOCA_H
-/* Define if you don't have vprintf but do have _doprnt. */
+/* Define to 1 if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+#undef HAVE_DCGETTEXT
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
-/* Define if you have a working `mmap' system call. */
-#undef HAVE_MMAP
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
-/* Define if your struct stat has st_blksize. */
-#undef HAVE_ST_BLKSIZE
+/* Define to 1 if you have the `feof_unlocked' function. */
+#undef HAVE_FEOF_UNLOCKED
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
-#undef HAVE_SYS_WAIT_H
+/* Define to 1 if you have the `fgets_unlocked' function. */
+#undef HAVE_FGETS_UNLOCKED
-/* Define if your struct tm has tm_zone. */
-#undef HAVE_TM_ZONE
+/* Define to 1 if you have the `fmod' function. */
+#undef HAVE_FMOD
-/* Define if you don't have tm_zone but do have the external array
- tzname. */
-#undef HAVE_TZNAME
+/* Define to 1 if you have the `getcwd' function. */
+#undef HAVE_GETCWD
-/* Define if you have the vprintf function. */
-#undef HAVE_VPRINTF
+/* Define to 1 if you have the `getc_unlocked' function. */
+#undef HAVE_GETC_UNLOCKED
-/* Define if on MINIX. */
-#undef _MINIX
+/* Define to 1 if you have the `getegid' function. */
+#undef HAVE_GETEGID
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef pid_t
+/* Define to 1 if you have the `geteuid' function. */
+#undef HAVE_GETEUID
-/* Define if the system does not provide POSIX.1 features except
- with this defined. */
-#undef _POSIX_1_SOURCE
+/* Define to 1 if you have the `getgid' function. */
+#undef HAVE_GETGID
-/* Define if you need to in order for stat and other things to work. */
-#undef _POSIX_SOURCE
+/* Define to 1 if you have the `getgrent' function. */
+#undef HAVE_GETGRENT
-/* Define as the return type of signal handlers (int or void). */
-#undef RETSIGTYPE
+/* Define to 1 if you have the `getgroups' function. */
+#undef HAVE_GETGROUPS
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
+/* Define to 1 if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-#undef STACK_DIRECTION
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#undef HAVE_GETTEXT
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
+/* Define to 1 if you have the `getuid' function. */
+#undef HAVE_GETUID
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
+/* Define to 1 if you have the `grantpt' function. */
+#undef HAVE_GRANTPT
-/* Define if your <sys/time.h> declares struct tm. */
-#undef TM_IN_SYS_TIME
+/* Define if you have the iconv() function. */
+#undef HAVE_ICONV
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef uid_t
+/* Define if <inttypes.h> exists and doesn't clash with <sys/types.h>. */
+#undef HAVE_INTTYPES_H
-#undef HAVE_STRINGIZE /* can use ANSI # operator in cpp */
-#undef REGEX_MALLOC /* use malloc instead of alloca in regex.c */
-#undef SPRINTF_RET /* return type of sprintf */
-#undef BITOPS /* bitwise ops (undocumented feature) */
-#undef NONDECDATA /* non-decimal input data (undocumented feature) */
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
-/* Define if you have the fmod function. */
-#undef HAVE_FMOD
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
-/* Define if you have the getpagesize function. */
-#undef HAVE_GETPAGESIZE
+/* Define to 1 if you have the `dl' library (-ldl). */
+#undef HAVE_LIBDL
-/* Define if you have the madvise function. */
-#undef HAVE_MADVISE
+/* Define to 1 if you have the <libintl.h> header file. */
+#undef HAVE_LIBINTL_H
-/* Define if you have the memcmp function. */
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define if you have the long long type. */
+#undef HAVE_LONG_LONG
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define to 1 if you have the `mbrlen' function. */
+#undef HAVE_MBRLEN
+
+/* Define to 1 if you have the `mbrtowc' function. */
+#undef HAVE_MBRTOWC
+
+/* Define to 1 if you have the <mcheck.h> header file. */
+#undef HAVE_MCHECK_H
+
+/* Define to 1 if you have the `memcmp' function. */
#undef HAVE_MEMCMP
-/* Define if you have the memcpy function. */
+/* Define to 1 if you have the `memcpy' function. */
#undef HAVE_MEMCPY
-/* Define if you have the memset function. */
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `mempcpy' function. */
+#undef HAVE_MEMPCPY
+
+/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
-/* Define if you have the setlocale function. */
+/* we have the mktime function */
+#undef HAVE_MKTIME
+
+/* Define to 1 if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the `munmap' function. */
+#undef HAVE_MUNMAP
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the <nl_types.h> header file. */
+#undef HAVE_NL_TYPES_H
+
+/* we have portals on /p on this system */
+#undef HAVE_PORTALS
+
+/* Define to 1 if you have the `putenv' function. */
+#undef HAVE_PUTENV
+
+/* Define to 1 if you have the `setenv' function. */
+#undef HAVE_SETENV
+
+/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
-/* Define if you have the strchr function. */
+/* Define to 1 if you have the <signum.h> header file. */
+#undef HAVE_SIGNUM_H
+
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
+/* we have sockets on this system */
+#undef HAVE_SOCKETS
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#undef HAVE_STDARG_H
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `stpcpy' function. */
+#undef HAVE_STPCPY
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR
-/* Define if you have the strerror function. */
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
+/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
-/* Define if you have the strftime function. */
+/* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME
-/* Define if you have the strncasecmp function. */
+/* Define to 1 if cpp supports the ANSI # stringizing operator. */
+#undef HAVE_STRINGIZE
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strncasecmp' function. */
#undef HAVE_STRNCASECMP
-/* Define if you have the strtod function. */
+/* Define to 1 if you have the <stropts.h> header file. */
+#undef HAVE_STROPTS_H
+
+/* Define to 1 if you have the `strtod' function. */
#undef HAVE_STRTOD
-/* Define if you have the system function. */
+/* Define to 1 if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
+
+/* Define to 1 if `st_blksize' is member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if `tm_zone' is member of `struct tm'. */
+#undef HAVE_STRUCT_TM_TM_ZONE
+
+/* Define to 1 if your `struct stat' has `st_blksize'. Deprecated, use
+ `HAVE_STRUCT_STAT_ST_BLKSIZE' instead. */
+#undef HAVE_ST_BLKSIZE
+
+/* Define to 1 if you have the `system' function. */
#undef HAVE_SYSTEM
-/* Define if you have the tzset function. */
-#undef HAVE_TZSET
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
-/* Define if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
-/* Define if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
-/* Define if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
-/* Define if you have the <signum.h> header file. */
-#undef HAVE_SIGNUM_H
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
-/* Define if you have the <stdarg.h> header file. */
-#undef HAVE_STDARG_H
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
-/* Define if you have the <string.h> header file. */
-#undef HAVE_STRING_H
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
-/* Define if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
+/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
+ `HAVE_STRUCT_TM_TM_ZONE' instead. */
+#undef HAVE_TM_ZONE
-/* Define if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
+/* Define to 1 if you have the `tsearch' function. */
+#undef HAVE_TSEARCH
-/* Define if you have the <unistd.h> header file. */
+/* Define to 1 if you don't have `tm_zone' but do have the external array
+ `tzname'. */
+#undef HAVE_TZNAME
+
+/* Define to 1 if you have the `tzset' function. */
+#undef HAVE_TZSET
+
+/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define if you have the m library (-lm). */
-#undef HAVE_LIBM
+/* Define if you have the unsigned long long type. */
+#undef HAVE_UNSIGNED_LONG_LONG
+
+/* Define to 1 if you have the `vprintf' function. */
+#undef HAVE_VPRINTF
+
+/* Define to 1 if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
+
+/* Define to 1 if you have the `wcrtomb' function. */
+#undef HAVE_WCRTOMB
+
+/* Define to 1 if you have the `wcscoll' function. */
+#undef HAVE_WCSCOLL
+
+/* Define to 1 if you have the <wctype.h> header file. */
+#undef HAVE_WCTYPE_H
+
+/* Define to 1 if you have the `__argz_count' function. */
+#undef HAVE___ARGZ_COUNT
+
+/* Define to 1 if you have the `__argz_next' function. */
+#undef HAVE___ARGZ_NEXT
+
+/* Define to 1 if you have the `__argz_stringify' function. */
+#undef HAVE___ARGZ_STRINGIFY
+
+/* Define to 1 if you have the `__fsetlocking' function. */
+#undef HAVE___FSETLOCKING
+
+/* Define as const if the declaration of iconv() needs const. */
+#undef ICONV_CONST
+
+/* Define if integer division by zero raises signal SIGFPE. */
+#undef INTDIV0_RAISES_SIGFPE
+
+/* disable lint checks */
+#undef NO_LINT
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define if <inttypes.h> exists and defines unusable PRI* macros. */
+#undef PRI_MACROS_BROKEN
+
+/* Define if compiler has function prototypes */
+#undef PROTOTYPES
+
+/* use malloc instead of alloca in regex.c */
+#undef REGEX_MALLOC
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* return type of sprintf */
+#undef SPRINTF_RET
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* strtod doesn't have C89 semantics */
+#undef STRTOD_NOT_C89
+
+/* some systems define this type here */
+#undef TIME_T_IN_SYS_TYPES_H
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
+
+/* force use of our version of strftime */
+#undef USE_INCLUDED_STRFTIME
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to 1 if type `char' is unsigned and you are not using gcc. */
+#ifndef __CHAR_UNSIGNED__
+# undef __CHAR_UNSIGNED__
+#endif
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+ if it is not supported. */
+#undef inline
+
+/* Define to widest signed type if <inttypes.h> doesn't define. */
+#undef intmax_t
+
+/* Define to `long' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef ssize_t
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
-#include <custom.h> /* overrides for stuff autoconf can't deal with */
+/* Define to widest unsigned type if <inttypes.h> doesn't define. */
+#undef uintmax_t
diff --git a/gnu/dist/gawk/configure b/gnu/dist/gawk/configure
index 63a0d99d680..9f10d0a506e 100755
--- a/gnu/dist/gawk/configure
+++ b/gnu/dist/gawk/configure
@@ -1,30 +1,325 @@
#! /bin/sh
-
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Generated by GNU Autoconf 2.57 for GNU Awk 3.1.3.
+#
+# Report bugs to <bug-gawk@gnu.org>.
#
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
-# Defaults:
-ac_help=
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
ac_default_prefix=/usr/local
-# Any additions from configure.in:
-ac_help="$ac_help
- --enable-bitops Enable Octal and Hex constants and bit functions"
-ac_help="$ac_help
- --enable-non-decimal-data Enable Octal and Hex constants as valid input data"
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME='GNU Awk'
+PACKAGE_TARNAME='gawk'
+PACKAGE_VERSION='3.1.3'
+PACKAGE_STRING='GNU Awk 3.1.3'
+PACKAGE_BUGREPORT='bug-gawk@gnu.org'
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot EGREP YACC LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP RANLIB ac_ct_RANLIB U ANSI2KNR MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE build build_cpu build_vendor build_os host host_cpu host_vendor host_os ALLOCA GLIBC21 LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB LIBOBJS SOCKET_LIBS LTLIBOBJS'
+ac_subst_files=''
# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
# The variables have the same names as the options, with
# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
+cache_file=/dev/null
exec_prefix=NONE
-host=NONE
no_create=
-nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
@@ -33,10 +328,15 @@ program_transform_name=s,x,x,
silent=
site=
srcdir=
-target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
@@ -50,16 +350,9 @@ oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
ac_prev=
for ac_option
do
-
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval "$ac_prev=\$ac_option"
@@ -67,59 +360,59 @@ do
continue
fi
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
# Accept the important Cygnus configure options, so we can diagnose typos.
- case "$ac_option" in
+ case $ac_option in
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
+ bindir=$ac_optarg ;;
-build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
+ ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
+ build_alias=$ac_optarg ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
-datadir | --datadir | --datadi | --datad | --data | --dat | --da)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
| --da=*)
- datadir="$ac_optarg" ;;
+ datadir=$ac_optarg ;;
-disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
-enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
+ eval "enable_$ac_feature='$ac_optarg'" ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -128,95 +421,47 @@ do
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
+ exec_prefix=$ac_optarg ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
-host | --host | --hos | --ho)
- ac_prev=host ;;
+ ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
+ host_alias=$ac_optarg ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
+ includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
+ infodir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
+ libdir=$ac_optarg ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
+ libexecdir=$ac_optarg ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst \
@@ -225,19 +470,19 @@ EOF
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* \
| --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
+ localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
+ mandir=$ac_optarg ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
+ | --no-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
@@ -251,26 +496,26 @@ EOF
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
+ oldincludedir=$ac_optarg ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
+ prefix=$ac_optarg ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
+ program_prefix=$ac_optarg ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
+ program_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
@@ -287,7 +532,7 @@ EOF
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
+ program_transform_name=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
@@ -297,7 +542,7 @@ EOF
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
+ sbindir=$ac_optarg ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
@@ -308,58 +553,57 @@ EOF
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
+ sharedstatedir=$ac_optarg ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
+ site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
+ srcdir=$ac_optarg ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
+ sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
+ ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
+ target_alias=$ac_optarg ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12"
- exit 0 ;;
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
-with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
- eval "with_${ac_package}='$ac_optarg'" ;;
+ eval "with_$ac_package='$ac_optarg'" ;;
-without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
--x)
# Obsolete; use --with-x.
@@ -370,99 +614,110 @@ EOF
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
+ x_includes=$ac_optarg ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
+ x_libraries=$ac_optarg ;;
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
;;
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
*)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
;;
esac
done
if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
fi
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
esac
done
-# NLS nuisances.
-# Only set these to C if already set. These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=awk.h
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
@@ -472,13 +727,459 @@ else
fi
if test ! -r $srcdir/$ac_unique_file; then
if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
fi
fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures GNU Awk 3.1.3 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of GNU Awk 3.1.3:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-portals Enable /p as path prefix for portals
+ --disable-lint Disable gawk lint checking
+ --enable-switch Enable switch statements for awk programs
+ --disable-dependency-tracking Speeds up one-time builds
+ --enable-dependency-tracking Do not reject slow dependency extractors
+ --disable-largefile omit support for large files
+ --disable-nls do not use Native Language Support
+ --disable-rpath do not hardcode runtime library paths
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-whiny-user-strftime Force use of included version of strftime for deficient systems
+ --with-gnu-ld assume the C compiler uses GNU ld default=no
+ --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
+ --with-included-gettext use the GNU gettext library included here
+ --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
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <bug-gawk@gnu.org>.
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+GNU Awk configure 3.1.3
+generated by GNU Autoconf 2.57
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by GNU Awk $as_me 3.1.3, which was
+generated by GNU Autoconf 2.57. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core core.* *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
if test "x$prefix" != xNONE; then
@@ -489,369 +1190,1989 @@ if test -z "$CONFIG_SITE"; then
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file"
fi
done
if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
else
- echo "creating cache $cache_file"
- > $cache_file
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
fi
ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# This is a hack. Different versions of install on different systems
+# are just too different. Chuck it and use install-sh.
+#
+# If the user supplies $INSTALL, figure they know what they're doing.
+#
+# With Autoconf 2.5x, this needs to come very early on, but *after*
+# the INIT macro. Sigh.
+
+if test "x$INSTALL" = "x"
+then
+ INSTALL="$srcdir/install-sh -c"
+ export INSTALL
+fi
+
+
+ ac_config_headers="$ac_config_headers config.h:configh.in"
+
+am__api_version="1.7"
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
else
- ac_n=-n ac_c= ac_t=
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
else
- ac_n= ac_c='\c' ac_t=
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
+all:
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ SET_MAKE=
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+ # test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE=gawk
+ VERSION=3.1.3
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-# Check whether --enable-bitops or --disable-bitops was given.
-if test "${enable_bitops+set}" = set; then
- enableval="$enable_bitops"
- cat >> confdefs.h <<\EOF
-#define BITOPS 1
-EOF
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-# Check whether --enable-non-decimal-data or --disable-non-decimal-data was given.
-if test "${enable_non_decimal_data+set}" = set; then
- enableval="$enable_non_decimal_data"
- cat >> confdefs.h <<\EOF
-#define NONDECDATA 1
-EOF
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+ STRIP=$ac_ct_STRIP
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+
+
+
+
+# Check whether --enable-portals or --disable-portals was given.
+if test "${enable_portals+set}" = set; then
+ enableval="$enable_portals"
+ if test "$enableval" = yes
+ then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PORTALS 1
+_ACEOF
+
+ fi
+
+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 <<\_ACEOF
+#define USE_INCLUDED_STRFTIME 1
+_ACEOF
+
+ fi
+
+fi;
+# Check whether --enable-lint or --disable-lint was given.
+if test "${enable_lint+set}" = set; then
+ enableval="$enable_lint"
+ if test "$enableval" = no
+ then
+
+cat >>confdefs.h <<\_ACEOF
+#define NO_LINT 1
+_ACEOF
+
+ fi
+
+fi;
+# Check whether --enable-switch or --disable-switch was given.
+if test "${enable_switch+set}" = set; then
+ enableval="$enable_switch"
+ if test "$enableval" = yes
+ then
+
+cat >>confdefs.h <<\_ACEOF
+#define ALLOW_SWITCH 1
+_ACEOF
+
+ fi
+
+fi;
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
for ac_prog in 'bison -y' byacc
do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
+ # 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:553: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_YACC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$YACC"; then
ac_cv_prog_YACC="$YACC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_YACC="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_YACC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-YACC="$ac_cv_prog_YACC"
+YACC=$ac_cv_prog_YACC
if test -n "$YACC"; then
- echo "$ac_t""$YACC" 1>&6
+ echo "$as_me:$LINENO: result: $YACC" >&5
+echo "${ECHO_T}$YACC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-test -n "$YACC" && break
+ test -n "$YACC" && break
done
test -n "$YACC" || YACC="yacc"
-echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:583: 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
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
else
- rm -f conftestdata
-if ln -s X conftestdata 2>/dev/null
-then
- rm -f conftestdata
- ac_cv_prog_LN_S="ln -s"
+ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_prog_LN_S=ln
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-LN_S="$ac_cv_prog_LN_S"
-if test "$ac_cv_prog_LN_S" = "ln -s"; then
- echo "$ac_t""yes" 1>&6
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-# Extract the first word of "gcc", so it can be a program name with args.
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:606: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- 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
- ac_cv_prog_CC="gcc"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:635: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
ac_prog_rejected=no
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
set dummy $ac_cv_prog_CC
shift
- if test $# -gt 0; then
+ if test $# != 0; then
# We chose a different compiler from the bogus one.
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
- set dummy "$ac_dir/$ac_word" "$@"
- shift
- ac_cv_prog_CC="$@"
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
fi
fi
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:683: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-cat > conftest.$ac_ext <<EOF
-#line 693 "configure"
-#include "confdefs.h"
-main(){return(0);}
-EOF
-if { (eval echo configure:697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- ac_cv_prog_cc_works=yes
- # If we can't run a trivial program, we are probably using a cross compiler.
- if (./conftest; exit) 2>/dev/null; then
- ac_cv_prog_cc_cross=no
- else
- ac_cv_prog_cc_cross=yes
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_prog_cc_works=no
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-rm -fr conftest*
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:717: 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 "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:722: 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
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:731: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
else
- ac_cv_prog_gcc=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+int
+main ()
+{
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
- 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:746: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_prog_cc_g=yes
else
- ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_prog_cc_g=no
fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ ''\
+ '#include <stdlib.h>' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
fi
+ for depmode in $am_compiler_list; do
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ echo '#include "conftest.h"' > conftest.c
+ echo 'int i;' > conftest.h
+ echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=conftest.c object=conftest.o \
+ depfile=conftest.Po tmpdepfile=conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o conftest.o conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep conftest.h conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored.
+ if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
fi
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:774: checking how to run the C preprocessor" >&5
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 789 "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:795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- :
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
else
- 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 806 "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:812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
:
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
fi
- CPP="$ac_cv_prog_CPP"
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
else
- ac_cv_prog_CPP="$CPP"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
-echo "$ac_t""$CPP" 1>&6
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
-# This is a hack. Different versions of install on different systems
-# are just too different. Chuck it and use install-sh.
-INSTALL="$srcdir/install-sh -c"; export INSTALL
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
done
-if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-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.
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ RANLIB=$ac_ct_RANLIB
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+
+
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -860,234 +3181,284 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:868: checking for a BSD compatible install" >&5
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- # OSF/1 installbsd also uses dspmsg, but is usable.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
+ done
+ ;;
+esac
+done
+
fi
if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
+ INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. We don't cache a
# path for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the path is relative.
- INSTALL="$ac_install_sh"
+ INSTALL=$ac_install_sh
fi
fi
-echo "$ac_t""$INSTALL" 1>&6
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:919: 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
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftestmake <<\EOF
+ cat >conftest.make <<\_ACEOF
all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
eval ac_cv_prog_make_${ac_make}_set=yes
else
eval ac_cv_prog_make_${ac_make}_set=no
fi
-rm -f conftestmake
+rm -f conftest.make
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
SET_MAKE=
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
SET_MAKE="MAKE=${MAKE-make}"
fi
-if test "$CFLAGS" = ""
+# This is mainly for my use during testing and development.
+# Yes, it's a bit of a hack.
+echo "$as_me:$LINENO: checking for special development options" >&5
+echo $ECHO_N "checking for special development options... $ECHO_C" >&6
+if test -f $srcdir/.developing
then
+ # add other debug flags as appropriate, save GAWKDEBUG for emergencies
+ CFLAGS="$CFLAGS -DARRAYDEBUG"
+ # turn on compiler warnings if we're doing development
if test "$GCC" = yes
then
- CFLAGS="-g -O"
- else
- CFLAGS="-O"
+ CFLAGS="$CFLAGS -Wall"
fi
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:958: checking for AIX" >&5
-cat > conftest.$ac_ext <<EOF
-#line 960 "configure"
-#include "confdefs.h"
+
+
+
+
+echo "$as_me:$LINENO: checking for AIX" >&5
+echo $ECHO_N "checking for AIX... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#ifdef _AIX
yes
#endif
-EOF
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "yes" >/dev/null 2>&1; then
- rm -rf conftest*
- echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+ $EGREP "yes" >/dev/null 2>&1; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+cat >>confdefs.h <<\_ACEOF
#define _ALL_SOURCE 1
-EOF
+_ACEOF
else
- rm -rf conftest*
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
rm -f conftest*
-echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:982: 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
-EOF
- if test "$GCC" = yes; then
- CC="$CC -posix"
- else
- CC="$CC -Xp"
- fi
+ echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5
+echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6
+if test "${ac_cv_lib_cposix_strerror+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
- ISC=
-fi
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcposix $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:1004: 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
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strerror ();
+int
+main ()
+{
+strerror ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_cposix_strerror=yes
else
- cat > conftest.$ac_ext <<EOF
-#line 1009 "configure"
-#include "confdefs.h"
-#include <minix/config.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-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"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_cposix_strerror=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- MINIX=yes
-else
- echo "$ac_t""no" 1>&6
-MINIX=
+echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5
+echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6
+if test $ac_cv_lib_cposix_strerror = yes; then
+ LIBS="$LIBS -lcposix"
fi
-if test "$MINIX" = yes; then
- cat >> confdefs.h <<\EOF
-#define _POSIX_SOURCE 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define _POSIX_1_SOURCE 2
-EOF
-
- cat >> confdefs.h <<\EOF
-#define _MINIX 1
-EOF
-
-fi
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1053: 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
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1058 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- rm -rf conftest*
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_header_stdc=yes
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_stdc=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1083 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <string.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
+ $EGREP "memchr" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
@@ -1096,16 +3467,20 @@ 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 1101 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdlib.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
+ $EGREP "free" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
@@ -1114,639 +3489,1987 @@ fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
+ if test "$cross_compiling" = yes; then
:
else
- cat > conftest.$ac_ext <<EOF
-#line 1122 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
-EOF
-if { (eval echo configure:1133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
:
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define STDC_HEADERS 1
-EOF
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+if test "${ac_cv_header_minix_config_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for minix/config.h" >&5
+echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6
+if test "${ac_cv_header_minix_config_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking minix/config.h usability" >&5
+echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <minix/config.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking minix/config.h presence" >&5
+echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <minix/config.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for minix/config.h" >&5
+echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6
+if test "${ac_cv_header_minix_config_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_minix_config_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6
fi
+if test $ac_cv_header_minix_config_h = yes; then
+ MINIX=yes
+else
+ MINIX=
+fi
+
-echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1157: 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
+if test "$MINIX" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_SOURCE 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_1_SOURCE 2
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _MINIX 1
+_ACEOF
+
+fi
+
+# Check whether --enable-largefile or --disable-largefile was given.
+if test "${enable_largefile+set}" = set; then
+ enableval="$enable_largefile"
+
+fi;
+if test "$enable_largefile" != no; then
+
+ echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
+echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_largefile_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1162 "configure"
-#include "confdefs.h"
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # 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 <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/types.h>
-#include <sys/wait.h>
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif
-int main() {
-int s;
-wait (&s);
-s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
-; return 0; }
-EOF
-if { (eval echo configure:1178: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_header_sys_wait_h=yes
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext
+ CC="$CC -n32"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sys_largefile_CC=' -n32'; break
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_sys_wait_h=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
-echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
-if test $ac_cv_header_sys_wait_h = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_SYS_WAIT_H 1
-EOF
+ echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ while :; do
+ ac_cv_sys_file_offset_bits=no
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sys_file_offset_bits=64; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ break
+done
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
+echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
+if test "$ac_cv_sys_file_offset_bits" != no; then
+
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
-for ac_hdr in limits.h locale.h stdarg.h unistd.h signum.h sys/param.h string.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1202: 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 1207 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1212: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-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
-
+ echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
+echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_large_files+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ while :; do
+ ac_cv_sys_large_files=no
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sys_large_files=1; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ break
done
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
+echo "${ECHO_T}$ac_cv_sys_large_files" >&6
+if test "$ac_cv_sys_large_files" != no; then
+
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
-if test "$ac_cv_header_string_h" = yes
-then
- for ac_hdr in memory.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1244: 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 1249 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-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
-
+
+
+echo "$as_me:$LINENO: checking for AIX compilation hacks" >&5
+echo $ECHO_N "checking for AIX compilation hacks... $ECHO_C" >&6
+if test "${gawk_cv_aix_hack+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+if test -d /lpp
+then
+ CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED=1 -DGAWK_AIX=1"
+ gawk_cv_aix_hack=yes
else
- echo "$ac_t""no" 1>&6
+ gawk_cv_aix_hack=no
fi
-done
+fi
+echo "$as_me:$LINENO: result: ${gawk_cv_aix_hack}" >&5
+echo "${ECHO_T}${gawk_cv_aix_hack}" >&6
+
+
+echo "$as_me:$LINENO: checking for Linux/Alpha compilation hacks" >&5
+echo $ECHO_N "checking for Linux/Alpha compilation hacks... $ECHO_C" >&6
+if test "${gawk_cv_linux_alpha_hack+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- for ac_hdr in strings.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1285: 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 1290 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-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"
+
+if test "Linux" = "`uname`" && test "alpha" = "`uname -m`"
+then
+ # this isn't necessarily always true,
+ # the vendor's compiler is also often found
+ if test "$GCC" = yes
+ then
+ CFLAGS="$CFLAGS -mieee"
+ gawk_cv_linux_alpha_hack=yes
+ else
+ gawk_cv_linux_alpha_hack=no
+ fi
+else
+ gawk_cv_linux_alpha_hack=no
fi
-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
-
+echo "$as_me:$LINENO: result: ${gawk_cv_linux_alpha_hack}" >&5
+echo "${ECHO_T}${gawk_cv_linux_alpha_hack}" >&6
+
+
+if test "$ISC" = 1 # will be set by test for ISC
+then
+ CFLAGS="$CFLAGS -D_SYSV3"
+fi
+
+
+
+
+echo "$as_me:$LINENO: checking for ${CC-cc} option to accept ANSI C" >&5
+echo $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6
+if test "${am_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ am_cv_prog_cc_stdc=no
+ac_save_CC="$CC"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+
+int
+main ()
+{
+
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_prog_cc_stdc="$ac_arg"; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
+rm -f conftest.$ac_objext conftest.$ac_ext
done
+CC="$ac_save_CC"
fi
-echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1324: 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
+if test -z "$am_cv_prog_cc_stdc"; then
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1329 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
+ echo "$as_me:$LINENO: result: $am_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$am_cv_prog_cc_stdc" >&6
+fi
+case "x$am_cv_prog_cc_stdc" in
+ x|xno) ;;
+ *) CC="$CC $am_cv_prog_cc_stdc" ;;
+esac
+
+
+
+echo "$as_me:$LINENO: checking for function prototypes" >&5
+echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6
+if test "$am_cv_prog_cc_stdc" != no; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define PROTOTYPES 1
+_ACEOF
+
+ U= ANSI2KNR=
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ U=_ ANSI2KNR=./ansi2knr
+fi
+# Ensure some checks needed by ansi2knr itself.
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_pid_t=yes
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
else
- rm -rf conftest*
- ac_cv_type_pid_t=no
+ ac_cv_header_stdc=no
fi
rm -f conftest*
fi
-echo "$ac_t""$ac_cv_type_pid_t" 1>&6
-if test $ac_cv_type_pid_t = no; then
- cat >> confdefs.h <<\EOF
-#define pid_t int
-EOF
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
fi
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1357: 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
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
else
- cat > conftest.$ac_ext <<EOF
-#line 1362 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-#undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
-void (*signal ()) ();
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif
-int main() {
-int i;
-; return 0; }
-EOF
-if { (eval echo configure:1379: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_type_signal=void
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_type_signal=int
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
fi
-rm -f conftest*
fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
-#define RETSIGTYPE $ac_cv_type_signal
-EOF
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+fi
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1398: 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
+
+for ac_header in string.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1403 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_size_t=yes
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
else
- rm -rf conftest*
- ac_cv_type_size_t=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&6
-if test $ac_cv_type_size_t = no; then
- cat >> confdefs.h <<\EOF
-#define size_t unsigned
-EOF
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
fi
-echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:1431: 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
+done
+
+
+
+case `(uname) 2> /dev/null` in
+*CYGWIN*)
+ with_libiconv_prefix=no
+ with_libintl_prefix=no
+ ;;
+*)
+ ;;
+esac
+
+
+ MKINSTALLDIRS=
+ if test -n "$ac_aux_dir"; then
+ case "$ac_aux_dir" in
+ /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
+ *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
+ esac
+ fi
+ if test -z "$MKINSTALLDIRS"; then
+ MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking whether NLS is requested" >&5
+echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6
+ # Check whether --enable-nls or --disable-nls was given.
+if test "${enable_nls+set}" = set; then
+ enableval="$enable_nls"
+ USE_NLS=$enableval
else
- cat > conftest.$ac_ext <<EOF
-#line 1436 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "uid_t" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_uid_t=yes
+ USE_NLS=yes
+fi;
+ echo "$as_me:$LINENO: result: $USE_NLS" >&5
+echo "${ECHO_T}$USE_NLS" >&6
+
+
+
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
else
- rm -rf conftest*
- ac_cv_type_uid_t=no
+ ac_executable_p="test -f"
fi
-rm -f conftest*
+rm -f conf$$.file
+# Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_MSGFMT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case "$MSGFMT" in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; 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$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
+ ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test "$MSGFMT" != ":"; then
+ echo "$as_me:$LINENO: result: $MSGFMT" >&5
+echo "${ECHO_T}$MSGFMT" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo "$ac_t""$ac_cv_type_uid_t" 1>&6
-if test $ac_cv_type_uid_t = no; then
- cat >> confdefs.h <<\EOF
-#define uid_t int
-EOF
+ # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GMSGFMT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $GMSGFMT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
- cat >> confdefs.h <<\EOF
-#define gid_t int
-EOF
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+ ;;
+esac
+fi
+GMSGFMT=$ac_cv_path_GMSGFMT
+if test -n "$GMSGFMT"; then
+ echo "$as_me:$LINENO: result: $GMSGFMT" >&5
+echo "${ECHO_T}$GMSGFMT" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:1465: 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
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
else
- if test "$cross_compiling" = yes; then
- ac_cv_type_getgroups=cross
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "xgettext", so it can be a program name with args.
+set dummy xgettext; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_XGETTEXT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case "$XGETTEXT" in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+ if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
+ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /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$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+ ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test "$XGETTEXT" != ":"; then
+ echo "$as_me:$LINENO: result: $XGETTEXT" >&5
+echo "${ECHO_T}$XGETTEXT" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1473 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
-/* Thanks to Mike Rendell for this test. */
-#include <sys/types.h>
-#define NGID 256
-#undef MAX
-#define MAX(x, y) ((x) > (y) ? (x) : (y))
-main()
-{
- gid_t gidset[NGID];
- int i, n;
- union { gid_t gval; long lval; } val;
+ rm -f messages.po
- val.lval = -1;
- for (i = 0; i < NGID; i++)
- gidset[i] = val.gval;
- n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
- gidset);
- /* Exit non-zero if getgroups seems to require an array of ints. This
- happens when gid_t is short but getgroups modifies an array of ints. */
- exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
-}
-EOF
-if { (eval echo configure:1498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
- ac_cv_type_getgroups=gid_t
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_type_getgroups=int
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "msgmerge", so it can be a program name with args.
+set dummy msgmerge; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_MSGMERGE+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case "$MSGMERGE" in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$ac_save_IFS"
+ test -z "$ac_dir" && ac_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; 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$ac_exec_ext"
+ break 2
+ fi
+ fi
+ done
+ done
+ IFS="$ac_save_IFS"
+ test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":"
+ ;;
+esac
fi
-rm -fr conftest*
+MSGMERGE="$ac_cv_path_MSGMERGE"
+if test "$MSGMERGE" != ":"; then
+ echo "$as_me:$LINENO: result: $MSGMERGE" >&5
+echo "${ECHO_T}$MSGMERGE" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-if test $ac_cv_type_getgroups = cross; then
- cat > conftest.$ac_ext <<EOF
-#line 1512 "configure"
-#include "confdefs.h"
-#include <unistd.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_getgroups=gid_t
+
+ 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 "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5
+echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6
+ GMSGFMT=":"
+ fi
+ fi
+
+ if test "$XGETTEXT" != ":"; then
+ if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
+ (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+ : ;
+ else
+ echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5
+echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6
+ XGETTEXT=":"
+ fi
+ rm -f messages.po
+ fi
+
+ ac_config_commands="$ac_config_commands default-1"
+
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- rm -rf conftest*
- ac_cv_type_getgroups=int
+ ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+ ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+ ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset x;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *ccp;
+ char **p;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ ccp = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++ccp;
+ p = (char**) ccp;
+ ccp = (char const *const *) p;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ }
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_const=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_const=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
+if test $ac_cv_c_const = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
fi
+
+echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_inline=$ac_kw; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
-echo "$ac_t""$ac_cv_type_getgroups" 1>&6
-cat >> confdefs.h <<EOF
-#define GETGROUPS_T $ac_cv_type_getgroups
-EOF
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ no)
+cat >>confdefs.h <<\_ACEOF
+#define inline
+_ACEOF
+ ;;
+ *) cat >>confdefs.h <<_ACEOF
+#define inline $ac_cv_c_inline
+_ACEOF
+ ;;
+esac
+echo "$as_me:$LINENO: checking for off_t" >&5
+echo $ECHO_N "checking for off_t... $ECHO_C" >&6
+if test "${ac_cv_type_off_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((off_t *) 0)
+ return 0;
+if (sizeof (off_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_off_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-cat > conftest.$ac_ext <<EOF
-#line 1536 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "int.*sprintf" >/dev/null 2>&1; then
- rm -rf conftest*
- cat >> confdefs.h <<\EOF
-#define SPRINTF_RET int
-EOF
+ac_cv_type_off_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+echo "${ECHO_T}$ac_cv_type_off_t" >&6
+if test $ac_cv_type_off_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define off_t long
+_ACEOF
+
+fi
+echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6
+if test "${ac_cv_type_size_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- rm -rf conftest*
- cat >> confdefs.h <<\EOF
-#define SPRINTF_RET char *
-EOF
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((size_t *) 0)
+ return 0;
+if (sizeof (size_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_size_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_size_t=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6
+if test $ac_cv_type_size_t = yes; then
+ :
+else
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned
+_ACEOF
-if test "$YACC" = "bison -y" ||
- { test -f $srcdir/awktab.c && grep 'alloca *(' $srcdir/awktab.c > /dev/null; }
-then
- # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+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:1563: 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 1568 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking for working alloca.h" >&5
+echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6
+if test "${ac_cv_working_alloca_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <alloca.h>
-int main() {
-char *p = alloca(2 * sizeof(int));
-; return 0; }
-EOF
-if { (eval echo configure:1575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- ac_cv_header_alloca_h=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_alloca_h=no
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_working_alloca_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_working_alloca_h=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
+echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
+if test $ac_cv_working_alloca_h = yes; then
-echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
-if test $ac_cv_header_alloca_h = yes; then
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define HAVE_ALLOCA_H 1
-EOF
+_ACEOF
fi
-echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1596: checking for alloca" >&5
-if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for alloca" >&5
+echo $ECHO_N "checking for alloca... $ECHO_C" >&6
+if test "${ac_cv_func_alloca_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1601 "configure"
-#include "confdefs.h"
-
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#ifdef __GNUC__
# define alloca __builtin_alloca
#else
-# if HAVE_ALLOCA_H
-# include <alloca.h>
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
# else
-# ifdef _AIX
- #pragma alloca
+# if HAVE_ALLOCA_H
+# include <alloca.h>
# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
+# endif
# endif
# endif
# endif
#endif
-int main() {
-char *p = (char *) alloca(1);
-; return 0; }
-EOF
-if { (eval echo configure:1624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
+int
+main ()
+{
+char *p = (char *) alloca (1);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_func_alloca_works=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_func_alloca_works=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_alloca_works=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
+echo "${ECHO_T}$ac_cv_func_alloca_works" >&6
-echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
if test $ac_cv_func_alloca_works = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_ALLOCA 1
-EOF
-fi
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALLOCA 1
+_ACEOF
-if test $ac_cv_func_alloca_works = no; then
+else
# The SVR3 libPW and SVR4 libucb both contain incompatible functions
- # that cause trouble. Some versions do not even contain alloca or
- # contain a buggy version. If you still want to use their alloca,
- # use ar to extract alloca.o from them instead of compiling alloca.c.
- ALLOCA=alloca.o
- cat >> confdefs.h <<\EOF
+# that cause trouble. Some versions do not even contain alloca or
+# contain a buggy version. If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+ALLOCA=alloca.$ac_objext
+
+cat >>confdefs.h <<\_ACEOF
#define C_ALLOCA 1
-EOF
+_ACEOF
-echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1656: 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
+echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
+echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
+if test "${ac_cv_os_cray+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1661 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#if defined(CRAY) && ! defined(CRAY2)
webecray
#else
wenotbecray
#endif
-EOF
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "webecray" >/dev/null 2>&1; then
- rm -rf conftest*
+ $EGREP "webecray" >/dev/null 2>&1; then
ac_cv_os_cray=yes
else
- rm -rf conftest*
ac_cv_os_cray=no
fi
rm -f conftest*
fi
-
-echo "$ac_t""$ac_cv_os_cray" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
+echo "${ECHO_T}$ac_cv_os_cray" >&6
if test $ac_cv_os_cray = yes; then
-for ac_func in _getb67 GETB67 getb67; do
- echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1686: 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 1691 "configure"
-#include "confdefs.h"
+ for ac_func in _getb67 GETB67 getb67; do
+ as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* 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();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:1714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
#define CRAY_STACKSEG_END $ac_func
-EOF
+_ACEOF
- break
-else
- echo "$ac_t""no" 1>&6
+ break
fi
-done
+ done
fi
-echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1741: 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
+echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
+if test "${ac_cv_c_stack_direction+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
ac_cv_c_stack_direction=0
else
- cat > conftest.$ac_ext <<EOF
-#line 1749 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+int
find_stack_direction ()
{
static char *addr = 0;
@@ -1759,1405 +5482,7893 @@ find_stack_direction ()
else
return (&dummy > addr) ? 1 : -1;
}
+
+int
main ()
{
- exit (find_stack_direction() < 0);
+ exit (find_stack_direction () < 0);
}
-EOF
-if { (eval echo configure:1768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_stack_direction=1
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_c_stack_direction=-1
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_stack_direction=-1
fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
+echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
-echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
#define STACK_DIRECTION $ac_cv_c_stack_direction
-EOF
+_ACEOF
+
fi
+
+
+for ac_header in stdlib.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
-cat >> confdefs.h <<\EOF
-#define REGEX_MALLOC 1
-EOF
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
-echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:1795: checking for vprintf" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+for ac_func in getpagesize
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1800 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char vprintf(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char vprintf();
-
-int main() {
-
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_vprintf) || defined (__stub___vprintf)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-vprintf();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+echo "$as_me:$LINENO: checking for working mmap" >&5
+echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
+if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_mmap_fixed_mapped=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+/* malloc might have been renamed as rpl_malloc. */
+#undef malloc
+
+/* Thanks to Mike Haertel and Jim Avera for this test.
+ Here is a matrix of mmap possibilities:
+ mmap private not fixed
+ mmap private fixed at somewhere currently unmapped
+ mmap private fixed at somewhere already mapped
+ mmap shared not fixed
+ mmap shared fixed at somewhere currently unmapped
+ mmap shared fixed at somewhere already mapped
+ For private mappings, we should verify that changes cannot be read()
+ back from the file, nor mmap's back from the file at a different
+ address. (There have been systems where private was not correctly
+ implemented like the infamous i386 svr4.0, and systems where the
+ VM page cache was not coherent with the file system buffer cache
+ like early versions of FreeBSD and possibly contemporary NetBSD.)
+ For shared mappings, we should conversely verify that changes get
+ propagated back to all the places they're supposed to be.
+
+ Grep wants private fixed already mapped.
+ The main things grep needs to know about mmap are:
+ * does it exist and is it safe to write into the mmap'd area
+ * how to use it (BSD variants) */
+
+#include <fcntl.h>
+#include <sys/mman.h>
+
+#if !STDC_HEADERS && !HAVE_STDLIB_H
+char *malloc ();
+#endif
+
+/* This mess was copied from the GNU getpagesize.h. */
+#if !HAVE_GETPAGESIZE
+/* Assume that all systems that can run configure have sys/param.h. */
+# if !HAVE_SYS_PARAM_H
+# define HAVE_SYS_PARAM_H 1
+# endif
+
+# ifdef _SC_PAGESIZE
+# define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+# if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+# ifdef EXEC_PAGESIZE
+# define getpagesize() EXEC_PAGESIZE
+# else /* no EXEC_PAGESIZE */
+# ifdef NBPG
+# define getpagesize() NBPG * CLSIZE
+# ifndef CLSIZE
+# define CLSIZE 1
+# endif /* no CLSIZE */
+# else /* no NBPG */
+# ifdef NBPC
+# define getpagesize() NBPC
+# else /* no NBPC */
+# ifdef PAGESIZE
+# define getpagesize() PAGESIZE
+# endif /* PAGESIZE */
+# endif /* no NBPC */
+# endif /* no NBPG */
+# endif /* no EXEC_PAGESIZE */
+# else /* no HAVE_SYS_PARAM_H */
+# define getpagesize() 8192 /* punt totally */
+# endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
+int
+main ()
+{
+ char *data, *data2, *data3;
+ int i, pagesize;
+ int fd;
+
+ pagesize = getpagesize ();
+
+ /* First, make a file with some known garbage in it. */
+ data = (char *) malloc (pagesize);
+ if (!data)
+ exit (1);
+ for (i = 0; i < pagesize; ++i)
+ *(data + i) = rand ();
+ umask (0);
+ fd = creat ("conftest.mmap", 0600);
+ if (fd < 0)
+ exit (1);
+ if (write (fd, data, pagesize) != pagesize)
+ exit (1);
+ close (fd);
+
+ /* Next, try to mmap the file at a fixed address which already has
+ something else allocated at it. If we can, also make sure that
+ we see the same garbage. */
+ fd = open ("conftest.mmap", O_RDWR);
+ if (fd < 0)
+ exit (1);
+ data2 = (char *) malloc (2 * pagesize);
+ if (!data2)
+ exit (1);
+ data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
+ if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_FIXED, fd, 0L))
+ exit (1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data2 + i))
+ exit (1);
+
+ /* Finally, make sure that changes to the mapped area do not
+ percolate back to the file as seen by read(). (This is a bug on
+ some variants of i386 svr4.0.) */
+ for (i = 0; i < pagesize; ++i)
+ *(data2 + i) = *(data2 + i) + 1;
+ data3 = (char *) malloc (pagesize);
+ if (!data3)
+ exit (1);
+ if (read (fd, data3, pagesize) != pagesize)
+ exit (1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data3 + i))
+ exit (1);
+ close (fd);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_mmap_fixed_mapped=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_mmap_fixed_mapped=no
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
+echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MMAP 1
+_ACEOF
+
+fi
+rm -f conftest.mmap
+
+
+ echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5
+echo $ECHO_N "checking whether we are using the GNU C Library 2.1 or newer... $ECHO_C" >&6
+if test "${ac_cv_gnu_library_2_1+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#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:1823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func_vprintf=yes"
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "Lucky GNU user" >/dev/null 2>&1; then
+ ac_cv_gnu_library_2_1=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_vprintf=no"
+ ac_cv_gnu_library_2_1=no
fi
rm -f conftest*
+
+
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5
+echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6
+
+ GLIBC21="$ac_cv_gnu_library_2_1"
+
+
+
+
+ echo "$as_me:$LINENO: checking whether integer division by zero raises SIGFPE" >&5
+echo $ECHO_N "checking whether integer division by zero raises SIGFPE... $ECHO_C" >&6
+if test "${gt_cv_int_divbyzero_sigfpe+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ if test "$cross_compiling" = yes; then
+
+ # Guess based on the CPU.
+ case "$host_cpu" in
+ alpha* | i3456786 | m68k | s390*)
+ gt_cv_int_divbyzero_sigfpe="guessing yes";;
+ *)
+ gt_cv_int_divbyzero_sigfpe="guessing no";;
+ esac
+
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <stdlib.h>
+#include <signal.h>
+
+static void
+#ifdef __cplusplus
+sigfpe_handler (int sig)
+#else
+sigfpe_handler (sig) int sig;
+#endif
+{
+ /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
+ exit (sig != SIGFPE);
+}
+
+int x = 1;
+int y = 0;
+int z;
+int nan;
+
+int main ()
+{
+ signal (SIGFPE, sigfpe_handler);
+/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
+#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
+ signal (SIGTRAP, sigfpe_handler);
+#endif
+/* Linux/SPARC yields signal SIGILL. */
+#if defined (__sparc__) && defined (__linux__)
+ signal (SIGILL, sigfpe_handler);
+#endif
+
+ z = x / y;
+ nan = y / y;
+ exit (1);
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ gt_cv_int_divbyzero_sigfpe=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gt_cv_int_divbyzero_sigfpe=no
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+fi
+echo "$as_me:$LINENO: result: $gt_cv_int_divbyzero_sigfpe" >&5
+echo "${ECHO_T}$gt_cv_int_divbyzero_sigfpe" >&6
+ case "$gt_cv_int_divbyzero_sigfpe" in
+ *yes) value=1;;
+ *) value=0;;
+ esac
+
+cat >>confdefs.h <<_ACEOF
+#define INTDIV0_RAISES_SIGFPE $value
+_ACEOF
+
+
+
+ echo "$as_me:$LINENO: checking for unsigned long long" >&5
+echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6
+if test "${ac_cv_type_unsigned_long_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+unsigned long long ull = 1; int i = 63;
+int
+main ()
+{
+unsigned long long ullmax = (unsigned long long) -1;
+ return ull << i | ull >> i | ullmax / ull | ullmax % ull;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_unsigned_long_long=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_unsigned_long_long=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5
+echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6
+ if test $ac_cv_type_unsigned_long_long = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UNSIGNED_LONG_LONG 1
+_ACEOF
+
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for uintmax_t" >&5
+echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6
+if test "${ac_cv_type_uintmax_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((uintmax_t *) 0)
+ return 0;
+if (sizeof (uintmax_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_uintmax_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_uintmax_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5
+echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6
+if test $ac_cv_type_uintmax_t = yes; then
+ :
+else
+ test $ac_cv_type_unsigned_long_long = yes \
+ && ac_type='unsigned long long' \
+ || ac_type='unsigned long'
+
+cat >>confdefs.h <<_ACEOF
+#define uintmax_t $ac_type
+_ACEOF
+
+fi
+
+
+
+ echo "$as_me:$LINENO: checking for inttypes.h" >&5
+echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6
+if test "${gt_cv_header_inttypes_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <inttypes.h>
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ gt_cv_header_inttypes_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gt_cv_header_inttypes_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $gt_cv_header_inttypes_h" >&5
+echo "${ECHO_T}$gt_cv_header_inttypes_h" >&6
+ if test $gt_cv_header_inttypes_h = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INTTYPES_H 1
+_ACEOF
+
+ fi
+
+
+
+ if test $gt_cv_header_inttypes_h = yes; then
+ echo "$as_me:$LINENO: checking whether the inttypes.h PRIxNN macros are broken" >&5
+echo $ECHO_N "checking whether the inttypes.h PRIxNN macros are broken... $ECHO_C" >&6
+if test "${gt_cv_inttypes_pri_broken+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <inttypes.h>
+#ifdef PRId32
+char *p = PRId32;
+#endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ gt_cv_inttypes_pri_broken=no
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gt_cv_inttypes_pri_broken=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $gt_cv_inttypes_pri_broken" >&5
+echo "${ECHO_T}$gt_cv_inttypes_pri_broken" >&6
+ fi
+ if test "$gt_cv_inttypes_pri_broken" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define PRI_MACROS_BROKEN 1
+_ACEOF
+
+ fi
+
+
+ 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"
+
+
+# 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;
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo "$as_me:$LINENO: checking for ld used by GCC" >&5
+echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6
+ 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 "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
fi
+if test "${acl_cv_path_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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 "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${acl_cv_prog_gnu_ld+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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 "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6
+with_gnu_ld=$acl_cv_prog_gnu_ld
+
+
+
+ echo "$as_me:$LINENO: checking for shared library run path origin" >&5
+echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6
+if test "${acl_cv_rpath+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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 "$as_me:$LINENO: result: $acl_cv_rpath" >&5
+echo "${ECHO_T}$acl_cv_rpath" >&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"
+ # Check whether --enable-rpath or --disable-rpath was given.
+if test "${enable_rpath+set}" = set; then
+ enableval="$enable_rpath"
+ :
+else
+ enable_rpath=yes
+fi;
+
+
+
+
-if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_VPRINTF 1
-EOF
+
+ use_additional=yes
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+
+# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given.
+if test "${with_libiconv_prefix+set}" = set; then
+ withval="$with_libiconv_prefix"
+
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/lib"
+ fi
+ fi
+
+fi;
+ LIBICONV=
+ LTLIBICONV=
+ INCICONV=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='iconv '
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value"
+ else
+ :
+ fi
+ else
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ if test $use_additional = yes; then
+ if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
+ found_dir="$additional_libdir"
+ found_so="$additional_libdir/lib$name.$shlibext"
+ if test -f "$additional_libdir/lib$name.la"; then
+ found_la="$additional_libdir/lib$name.la"
+ fi
+ else
+ if test -f "$additional_libdir/lib$name.$libext"; then
+ found_dir="$additional_libdir"
+ found_a="$additional_libdir/lib$name.$libext"
+ if test -f "$additional_libdir/lib$name.la"; then
+ found_la="$additional_libdir/lib$name.la"
+ fi
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIBICONV; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
+ found_dir="$dir"
+ found_so="$dir/lib$name.$shlibext"
+ if test -f "$dir/lib$name.la"; then
+ found_la="$dir/lib$name.la"
+ fi
+ else
+ if test -f "$dir/lib$name.$libext"; then
+ found_dir="$dir"
+ found_a="$dir/lib$name.$libext"
+ if test -f "$dir/lib$name.la"; then
+ found_la="$dir/lib$name.la"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ if test "$enable_rpath" = no || 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//'`
+ if test "$enable_rpath" != no; then
+ 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
+ fi
+ ;;
+ -l*)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$dep"
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$hardcode_libdir_separator"; then
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
+ else
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ for found_dir in $ltrpathdirs; do
+ LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir"
+ done
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
+stdlib.h string.h unistd.h sys/param.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-if test "$ac_cv_func_vprintf" != yes; then
-echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:1847: checking for _doprnt" >&5
-if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+fi
+
+done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
+geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
+strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \
+__fsetlocking
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1852 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char _doprnt(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char _doprnt();
-
-int main() {
-
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub__doprnt) || defined (__stub____doprnt)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-_doprnt();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:1875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func__doprnt=yes"
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func__doprnt=no"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+
+
+ am_save_CPPFLAGS="$CPPFLAGS"
+
+ for element in $INCICONV; do
+ haveit=
+ for x in $CPPFLAGS; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ if test "X$x" = "X$element"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+ fi
+ done
+
+
+ echo "$as_me:$LINENO: checking for iconv" >&5
+echo $ECHO_N "checking for iconv... $ECHO_C" >&6
+if test "${am_cv_func_iconv+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <iconv.h>
+int
+main ()
+{
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_func_iconv=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <iconv.h>
+int
+main ()
+{
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ LIBS="$am_save_LIBS"
+ fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5
+echo "${ECHO_T}$am_cv_func_iconv" >&6
+ if test "$am_cv_func_iconv" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ICONV 1
+_ACEOF
+
+ fi
+ if test "$am_cv_lib_iconv" = yes; then
+ echo "$as_me:$LINENO: checking how to link with libiconv" >&5
+echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: $LIBICONV" >&5
+echo "${ECHO_T}$LIBICONV" >&6
+ else
+ CPPFLAGS="$am_save_CPPFLAGS"
+ LIBICONV=
+ LTLIBICONV=
+ fi
+
+
+
+ if test "$am_cv_func_iconv" = yes; then
+ echo "$as_me:$LINENO: checking for iconv declaration" >&5
+echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6
+ if test "${am_cv_proto_iconv+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#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;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_proto_iconv_arg1=""
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+am_cv_proto_iconv_arg1="const"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
+fi
+
+ am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ echo "$as_me:$LINENO: result: ${ac_t:-
+ }$am_cv_proto_iconv" >&5
+echo "${ECHO_T}${ac_t:-
+ }$am_cv_proto_iconv" >&6
+
+cat >>confdefs.h <<_ACEOF
+#define ICONV_CONST $am_cv_proto_iconv_arg1
+_ACEOF
+
+ fi
+
+
+ echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5
+echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
+if test "${am_cv_langinfo_codeset+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <langinfo.h>
+int
+main ()
+{
+char* cs = nl_langinfo(CODESET);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_langinfo_codeset=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+am_cv_langinfo_codeset=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5
+echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
+ if test $am_cv_langinfo_codeset = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LANGINFO_CODESET 1
+_ACEOF
+
+ fi
+
+ if test $ac_cv_header_locale_h = yes; then
+
+ echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5
+echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6
+if test "${am_cv_val_LC_MESSAGES+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <locale.h>
+int
+main ()
+{
+return LC_MESSAGES
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_val_LC_MESSAGES=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+am_cv_val_LC_MESSAGES=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5
+echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6
+ if test $am_cv_val_LC_MESSAGES = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LC_MESSAGES 1
+_ACEOF
+
+ fi
+
+ fi
+
+ for ac_prog in bison
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_INTLBISON+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$INTLBISON"; then
+ ac_cv_prog_INTLBISON="$INTLBISON" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_INTLBISON="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+INTLBISON=$ac_cv_prog_INTLBISON
+if test -n "$INTLBISON"; then
+ echo "$as_me:$LINENO: result: $INTLBISON" >&5
+echo "${ECHO_T}$INTLBISON" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$INTLBISON" && break
+done
+
+ if test -z "$INTLBISON"; then
+ ac_verc_fail=yes
+ else
+ echo "$as_me:$LINENO: checking version of bison" >&5
+echo $ECHO_N "checking version of bison... $ECHO_C" >&6
+ ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+ 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+ esac
+ echo "$as_me:$LINENO: result: $ac_prog_version" >&5
+echo "${ECHO_T}$ac_prog_version" >&6
+ fi
+ if test $ac_verc_fail = yes; then
+ INTLBISON=:
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ echo "$as_me:$LINENO: checking whether NLS is requested" >&5
+echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6
+ # Check whether --enable-nls or --disable-nls was given.
+if test "${enable_nls+set}" = set; then
+ enableval="$enable_nls"
+ USE_NLS=$enableval
+else
+ USE_NLS=yes
+fi;
+ echo "$as_me:$LINENO: result: $USE_NLS" >&5
+echo "${ECHO_T}$USE_NLS" >&6
+
+
+
+
+ BUILD_INCLUDED_LIBINTL=no
+ USE_INCLUDED_LIBINTL=no
+
+ LIBINTL=
+ LTLIBINTL=
+ POSUB=
+
+ if test "$USE_NLS" = "yes"; then
+ gt_use_preinstalled_gnugettext=no
+
+ echo "$as_me:$LINENO: checking whether included gettext is requested" >&5
+echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6
+
+# Check whether --with-included-gettext or --without-included-gettext was given.
+if test "${with_included_gettext+set}" = set; then
+ withval="$with_included_gettext"
+ nls_cv_force_use_gnu_gettext=$withval
+else
+ nls_cv_force_use_gnu_gettext=no
+fi;
+ echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5
+echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6
+
+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+
+
+
+
+
+
+ echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5
+echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6
+if test "${gt_cv_func_gnugettext2_libc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ gt_cv_func_gnugettext2_libc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gt_cv_func_gnugettext2_libc=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext2_libc" >&5
+echo "${ECHO_T}$gt_cv_func_gnugettext2_libc" >&6
+
+ if test "$gt_cv_func_gnugettext2_libc" != "yes"; then
+
+
+
+ use_additional=yes
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+
+# Check whether --with-libintl-prefix or --without-libintl-prefix was given.
+if test "${with_libintl_prefix+set}" = set; then
+ withval="$with_libintl_prefix"
+
+ if test "X$withval" = "Xno"; then
+ use_additional=no
+ else
+ if test "X$withval" = "X"; then
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+
+ eval additional_includedir=\"$includedir\"
+ eval additional_libdir=\"$libdir\"
+
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ else
+ additional_includedir="$withval/include"
+ additional_libdir="$withval/lib"
+ fi
+ fi
+
+fi;
+ LIBINTL=
+ LTLIBINTL=
+ INCINTL=
+ rpathdirs=
+ ltrpathdirs=
+ names_already_handled=
+ names_next_round='intl '
+ while test -n "$names_next_round"; do
+ names_this_round="$names_next_round"
+ names_next_round=
+ for name in $names_this_round; do
+ already_handled=
+ for n in $names_already_handled; do
+ if test "$n" = "$name"; then
+ already_handled=yes
+ break
+ fi
+ done
+ if test -z "$already_handled"; then
+ names_already_handled="$names_already_handled $name"
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ eval value=\"\$HAVE_LIB$uppername\"
+ if test -n "$value"; then
+ if test "$value" = yes; then
+ eval value=\"\$LIB$uppername\"
+ test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value"
+ eval value=\"\$LTLIB$uppername\"
+ test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value"
+ else
+ :
+ fi
+ else
+ found_dir=
+ found_la=
+ found_so=
+ found_a=
+ if test $use_additional = yes; then
+ if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
+ found_dir="$additional_libdir"
+ found_so="$additional_libdir/lib$name.$shlibext"
+ if test -f "$additional_libdir/lib$name.la"; then
+ found_la="$additional_libdir/lib$name.la"
+ fi
+ else
+ if test -f "$additional_libdir/lib$name.$libext"; then
+ found_dir="$additional_libdir"
+ found_a="$additional_libdir/lib$name.$libext"
+ if test -f "$additional_libdir/lib$name.la"; then
+ found_la="$additional_libdir/lib$name.la"
+ fi
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIBINTL; do
+
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ acl_save_exec_prefix="$exec_prefix"
+ exec_prefix="$acl_final_exec_prefix"
+ eval x=\"$x\"
+ exec_prefix="$acl_save_exec_prefix"
+ prefix="$acl_save_prefix"
+
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
+ found_dir="$dir"
+ found_so="$dir/lib$name.$shlibext"
+ if test -f "$dir/lib$name.la"; then
+ found_la="$dir/lib$name.la"
+ fi
+ else
+ if test -f "$dir/lib$name.$libext"; then
+ found_dir="$dir"
+ found_a="$dir/lib$name.$libext"
+ if test -f "$dir/lib$name.la"; then
+ found_la="$dir/lib$name.la"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name"
+ if test "X$found_so" != "X"; then
+ if test "$enable_rpath" = no || 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//'`
+ if test "$enable_rpath" != no; then
+ 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
+ fi
+ ;;
+ -l*)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ ;;
+ *.la)
+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+ ;;
+ *)
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$dep"
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep"
+ ;;
+ esac
+ done
+ fi
+ else
+ LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name"
+ fi
+ fi
+ fi
+ done
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n "$hardcode_libdir_separator"; then
+ alldirs=
+ for found_dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
+ else
+ for found_dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$found_dir"
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
+ done
+ fi
+ fi
+ if test "X$ltrpathdirs" != "X"; then
+ for found_dir in $ltrpathdirs; do
+ LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir"
+ done
+ fi
+
+ echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5
+echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6
+if test "${gt_cv_func_gnugettext2_libintl+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ gt_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $INCINTL"
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBINTL"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ gt_cv_func_gnugettext2_libintl=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gt_cv_func_gnugettext2_libintl=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ if test "$gt_cv_func_gnugettext2_libintl" != yes && test -n "$LIBICONV"; then
+ LIBS="$LIBS $LIBICONV"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ LIBINTL="$LIBINTL $LIBICONV"
+ LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+ gt_cv_func_gnugettext2_libintl=yes
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ fi
+ CPPFLAGS="$gt_save_CPPFLAGS"
+ LIBS="$gt_save_LIBS"
+fi
+echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext2_libintl" >&5
+echo "${ECHO_T}$gt_cv_func_gnugettext2_libintl" >&6
+ fi
+
+ if test "$gt_cv_func_gnugettext2_libc" = "yes" \
+ || { test "$gt_cv_func_gnugettext2_libintl" = "yes" \
+ && test "$PACKAGE" != gettext-runtime \
+ && test "$PACKAGE" != gettext-tools; }; then
+ gt_use_preinstalled_gnugettext=yes
+ else
+ LIBINTL=
+ LTLIBINTL=
+ INCINTL=
+ fi
+
+
+ if test "$gt_use_preinstalled_gnugettext" != "yes"; then
+ nls_cv_use_gnu_gettext=yes
+ fi
+ fi
+
+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
+ BUILD_INCLUDED_LIBINTL=yes
+ USE_INCLUDED_LIBINTL=yes
+ LIBINTL="\${top_builddir}/intl/libintl.a $LIBICONV"
+ LTLIBINTL="\${top_builddir}/intl/libintl.a $LTLIBICONV"
+ LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
+ fi
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ CATOBJEXT=.gmo
+ fi
+
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define ENABLE_NLS 1
+_ACEOF
+
+ else
+ USE_NLS=no
+ fi
+ fi
+
+ echo "$as_me:$LINENO: checking whether to use NLS" >&5
+echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: $USE_NLS" >&5
+echo "${ECHO_T}$USE_NLS" >&6
+ if test "$USE_NLS" = "yes"; then
+ echo "$as_me:$LINENO: checking where the gettext function comes from" >&5
+echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if test "$gt_cv_func_gnugettext2_libintl" = "yes"; then
+ gt_source="external libintl"
+ else
+ gt_source="libc"
+ fi
+ else
+ gt_source="included intl directory"
+ fi
+ echo "$as_me:$LINENO: result: $gt_source" >&5
+echo "${ECHO_T}$gt_source" >&6
+ 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 "$as_me:$LINENO: checking how to link with libintl" >&5
+echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: $LIBINTL" >&5
+echo "${ECHO_T}$LIBINTL" >&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 <<\_ACEOF
+#define HAVE_GETTEXT 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DCGETTEXT 1
+_ACEOF
+
+ fi
+
+ POSUB=po
+ fi
+
+
+ if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
+ BUILD_INCLUDED_LIBINTL=yes
+ fi
+
+
+
+
+
+ nls_cv_header_intl=
+ nls_cv_header_libgt=
+
+ DATADIRNAME=share
+
+
+ INSTOBJEXT=.mo
+
+
+ GENCAT=gencat
+
+
+ if test "$USE_INCLUDED_LIBINTL" = yes; then
+ INTLOBJS="\$(GETTOBJS)"
+ fi
+
+
+ INTL_LIBTOOL_SUFFIX_PREFIX=
+
+
+
+ INTLLIBS="$LIBINTL"
+
+
+
+
+
+
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
fi
rm -f conftest*
+
fi
-if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_DOPRNT 1
-EOF
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
else
- echo "$ac_t""no" 1>&6
+ ac_cv_header_stdc=no
fi
+rm -f conftest*
fi
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
-echo $ac_n "checking for fmod in -lm""... $ac_c" 1>&6
-echo "configure:1901: 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
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
else
- ac_save_LIBS="$LIBS"
-LIBS="-lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1909 "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 fmod();
-
-int main() {
-fmod()
-; return 0; }
-EOF
-if { (eval echo configure:1920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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"
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6
+if test "${ac_cv_header_sys_wait_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+int
+main ()
+{
+ int s;
+ wait (&s);
+ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_sys_wait_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_sys_wait_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
+if test $ac_cv_header_sys_wait_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SYS_WAIT_H 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
+if test "${ac_cv_header_time+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_time=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_time=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6
+if test $ac_cv_header_time = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TIME_WITH_SYS_TIME 1
+_ACEOF
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in fcntl.h limits.h locale.h libintl.h mcheck.h \
+ netdb.h netinet/in.h signum.h stdarg.h string.h \
+ sys/param.h sys/socket.h sys/time.h unistd.h \
+ termios.h stropts.h wchar.h wctype.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+if test "$ac_cv_header_string_h" = yes
+then
+
+for ac_header in memory.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+else
+
+for ac_header in strings.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+fi
+
+echo "$as_me:$LINENO: checking for pid_t" >&5
+echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
+if test "${ac_cv_type_pid_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((pid_t *) 0)
+ return 0;
+if (sizeof (pid_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_pid_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_pid_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+echo "${ECHO_T}$ac_cv_type_pid_t" >&6
+if test $ac_cv_type_pid_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
+if test "${ac_cv_type_signal+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+# undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
+
+int
+main ()
+{
+int i;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_signal=void
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_signal=int
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6
+
+cat >>confdefs.h <<_ACEOF
+#define RETSIGTYPE $ac_cv_type_signal
+_ACEOF
+
+
+echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6
+if test "${ac_cv_type_size_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((size_t *) 0)
+ return 0;
+if (sizeof (size_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_size_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_size_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6
+if test $ac_cv_type_size_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
+echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6
+if test "${ac_cv_type_uid_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "uid_t" >/dev/null 2>&1; then
+ ac_cv_type_uid_t=yes
+else
+ ac_cv_type_uid_t=no
fi
rm -f conftest*
-LIBS="$ac_save_LIBS"
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
+echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
+echo "${ECHO_T}$ac_cv_type_uid_t" >&6
+if test $ac_cv_type_uid_t = no; then
- LIBS="-lm $LIBS"
+cat >>confdefs.h <<\_ACEOF
+#define uid_t int
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define gid_t int
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking type of array argument to getgroups" >&5
+echo $ECHO_N "checking type of array argument to getgroups... $ECHO_C" >&6
+if test "${ac_cv_type_getgroups+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_type_getgroups=cross
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Thanks to Mike Rendell for this test. */
+#include <sys/types.h>
+#define NGID 256
+#undef MAX
+#define MAX(x, y) ((x) > (y) ? (x) : (y))
+
+int
+main ()
+{
+ gid_t gidset[NGID];
+ int i, n;
+ union { gid_t gval; long lval; } val;
+
+ val.lval = -1;
+ for (i = 0; i < NGID; i++)
+ gidset[i] = val.gval;
+ n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
+ gidset);
+ /* Exit non-zero if getgroups seems to require an array of ints. This
+ happens when gid_t is short but getgroups modifies an array of ints. */
+ exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_getgroups=gid_t
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_type_getgroups=int
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+if test $ac_cv_type_getgroups = cross; then
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <unistd.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then
+ ac_cv_type_getgroups=gid_t
+else
+ ac_cv_type_getgroups=int
+fi
+rm -f conftest*
+
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_getgroups" >&5
+echo "${ECHO_T}$ac_cv_type_getgroups" >&6
+
+cat >>confdefs.h <<_ACEOF
+#define GETGROUPS_T $ac_cv_type_getgroups
+_ACEOF
+
+
+
+ echo "$as_me:$LINENO: checking for long long" >&5
+echo $ECHO_N "checking for long long... $ECHO_C" >&6
+if test "${ac_cv_type_long_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+long long ll = 1; int i = 63;
+int
+main ()
+{
+long long llmax = (long long) -1;
+ return ll << i | ll >> i | llmax / ll | llmax % ll;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_long_long=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_long_long=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
+echo "${ECHO_T}$ac_cv_type_long_long" >&6
+ if test $ac_cv_type_long_long = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LONG_LONG 1
+_ACEOF
+
+ fi
+
+
+ echo "$as_me:$LINENO: checking for unsigned long long" >&5
+echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6
+if test "${ac_cv_type_unsigned_long_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+unsigned long long ull = 1; int i = 63;
+int
+main ()
+{
+unsigned long long ullmax = (unsigned long long) -1;
+ return ull << i | ull >> i | ullmax / ull | ullmax % ull;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_unsigned_long_long=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_unsigned_long_long=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5
+echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6
+ if test $ac_cv_type_unsigned_long_long = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UNSIGNED_LONG_LONG 1
+_ACEOF
+
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for intmax_t" >&5
+echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6
+if test "${ac_cv_type_intmax_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((intmax_t *) 0)
+ return 0;
+if (sizeof (intmax_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_intmax_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_intmax_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5
+echo "${ECHO_T}$ac_cv_type_intmax_t" >&6
+if test $ac_cv_type_intmax_t = yes; then
+ :
+else
+ test $ac_cv_type_long_long = yes \
+ && ac_type='long long' \
+ || ac_type='long'
+
+cat >>confdefs.h <<_ACEOF
+#define intmax_t $ac_type
+_ACEOF
+
+fi
+
+
+
+
+ echo "$as_me:$LINENO: checking for uintmax_t" >&5
+echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6
+if test "${ac_cv_type_uintmax_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((uintmax_t *) 0)
+ return 0;
+if (sizeof (uintmax_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_uintmax_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_uintmax_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5
+echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6
+if test $ac_cv_type_uintmax_t = yes; then
+ :
+else
+ test $ac_cv_type_unsigned_long_long = yes \
+ && ac_type='unsigned long long' \
+ || ac_type='unsigned long'
+
+cat >>confdefs.h <<_ACEOF
+#define uintmax_t $ac_type
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking for ssize_t" >&5
+echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6
+if test "${ac_cv_type_ssize_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((ssize_t *) 0)
+ return 0;
+if (sizeof (ssize_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_ssize_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_ssize_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5
+echo "${ECHO_T}$ac_cv_type_ssize_t" >&6
+if test $ac_cv_type_ssize_t = yes; then
+ :
else
- echo "$ac_t""no" 1>&6
+
+cat >>confdefs.h <<_ACEOF
+#define ssize_t int
+_ACEOF
+
fi
-for ac_func in madvise memset memcpy memcmp fmod setlocale strchr strerror \
- strftime strncasecmp strtod system tzset
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdio.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "int.*sprintf" >/dev/null 2>&1; then
+
+cat >>confdefs.h <<\_ACEOF
+#define SPRINTF_RET int
+_ACEOF
+
+else
+ cat >>confdefs.h <<\_ACEOF
+#define SPRINTF_RET char *
+_ACEOF
+
+fi
+rm -f conftest*
+
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+int
+main ()
+{
+
+ time_t foo;
+ foo = 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TIME_T_IN_SYS_TYPES_H 1
+_ACEOF
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+
+cat >>confdefs.h <<\_ACEOF
+#define REGEX_MALLOC 1
+_ACEOF
+
+
+for ac_func in vprintf
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1951: 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 1956 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* 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();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:1979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-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
-
+echo "$as_me:$LINENO: checking for _doprnt" >&5
+echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6
+if test "${ac_cv_func__doprnt+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char _doprnt (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char _doprnt ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub__doprnt) || defined (__stub____doprnt)
+choke me
+#else
+char (*f) () = _doprnt;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != _doprnt;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func__doprnt=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func__doprnt=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
+echo "${ECHO_T}$ac_cv_func__doprnt" >&6
+if test $ac_cv_func__doprnt = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DOPRNT 1
+_ACEOF
+
+fi
+
fi
done
-for ac_hdr in unistd.h
+
+
+for ac_header 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:2008: 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 2013 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2018: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-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*
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
-if 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
-
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ eval "$as_ac_Header=$ac_header_preproc"
fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
done
-for ac_func in getpagesize
+
+for ac_func in strtod
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2047: 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 2052 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* 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
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+echo "$as_me:$LINENO: checking for strtod with C89 semantics" >&5
+echo $ECHO_N "checking for strtod with C89 semantics... $ECHO_C" >&6
+if test "${gawk_ac_cv_func_strtod_c89+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ gawk_ac_cv_func_strtod_c89=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Test program from Arnold Robbins (arnold@skeeve.com) */
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#else
+extern double strtod();
+#endif
+
+int
+main ()
+{
+#if ! HAVE_STRTOD
+ exit(1);
+#else
+ double d;
+ char *str = "0x345a";
+
+ d = strtod(str, 0);
+ if (d == 0)
+ exit (0);
+ else
+ exit (1);
+#endif
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ gawk_ac_cv_func_strtod_c89=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+gawk_ac_cv_func_strtod_c89=no
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $gawk_ac_cv_func_strtod_c89" >&5
+echo "${ECHO_T}$gawk_ac_cv_func_strtod_c89" >&6
+if test $gawk_ac_cv_func_strtod_c89 = no; then
-int main() {
+cat >>confdefs.h <<\_ACEOF
+#define STRTOD_NOT_C89 1
+_ACEOF
+fi
+
+
+
+for ac_header in sys/time.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_func in alarm
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* 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();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:2075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-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_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2100: 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
+echo "$as_me:$LINENO: checking for working mktime" >&5
+echo $ECHO_N "checking for working mktime... $ECHO_C" >&6
+if test "${ac_cv_func_working_mktime+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
- ac_cv_func_mmap_fixed_mapped=no
+ ac_cv_func_working_mktime=no
else
- cat > conftest.$ac_ext <<EOF
-#line 2108 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Test program from Paul Eggert and Tony Leneis. */
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
-/* Thanks to Mike Haertel and Jim Avera for this test.
- Here is a matrix of mmap possibilities:
- mmap private not fixed
- mmap private fixed at somewhere currently unmapped
- mmap private fixed at somewhere already mapped
- mmap shared not fixed
- mmap shared fixed at somewhere currently unmapped
- mmap shared fixed at somewhere already mapped
- For private mappings, we should verify that changes cannot be read()
- back from the file, nor mmap's back from the file at a different
- address. (There have been systems where private was not correctly
- implemented like the infamous i386 svr4.0, and systems where the
- VM page cache was not coherent with the filesystem buffer cache
- like early versions of FreeBSD and possibly contemporary NetBSD.)
- For shared mappings, we should conversely verify that changes get
- propogated back to all the places they're supposed to be.
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
- Grep wants private fixed already mapped.
- The main things grep needs to know about mmap are:
- * does it exist and is it safe to write into the mmap'd area
- * how to use it (BSD variants) */
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/mman.h>
+#if !HAVE_ALARM
+# define alarm(X) /* empty */
+#endif
-/* This mess was copied from the GNU getpagesize.h. */
-#ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-# include <unistd.h>
-# endif
+/* Work around redefinition to rpl_putenv by other config tests. */
+#undef putenv
-/* Assume that all systems that can run configure have sys/param.h. */
-# ifndef HAVE_SYS_PARAM_H
-# define HAVE_SYS_PARAM_H 1
-# endif
+static time_t time_t_max;
-# ifdef _SC_PAGESIZE
-# define getpagesize() sysconf(_SC_PAGESIZE)
-# else /* no _SC_PAGESIZE */
-# ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
-# ifdef EXEC_PAGESIZE
-# define getpagesize() EXEC_PAGESIZE
-# else /* no EXEC_PAGESIZE */
-# ifdef NBPG
-# define getpagesize() NBPG * CLSIZE
-# ifndef CLSIZE
-# define CLSIZE 1
-# endif /* no CLSIZE */
-# else /* no NBPG */
-# ifdef NBPC
-# define getpagesize() NBPC
-# else /* no NBPC */
-# ifdef PAGESIZE
-# define getpagesize() PAGESIZE
-# endif /* PAGESIZE */
-# endif /* no NBPC */
-# endif /* no NBPG */
-# endif /* no EXEC_PAGESIZE */
-# else /* no HAVE_SYS_PARAM_H */
-# define getpagesize() 8192 /* punt totally */
-# endif /* no HAVE_SYS_PARAM_H */
-# endif /* no _SC_PAGESIZE */
+/* Values we'll use to set the TZ environment variable. */
+static const char *const tz_strings[] = {
+ (const char *) 0, "TZ=GMT0", "TZ=JST-9",
+ "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
+};
+#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
-#endif /* no HAVE_GETPAGESIZE */
+/* Fail if mktime fails to convert a date in the spring-forward gap.
+ Based on a problem report from Andreas Jaeger. */
+static void
+spring_forward_gap ()
+{
+ /* glibc (up to about 1998-10-07) failed this test. */
+ struct tm tm;
+
+ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+ instead of "TZ=America/Vancouver" in order to detect the bug even
+ on systems that don't support the Olson extension, or don't have the
+ full zoneinfo tables installed. */
+ putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
+
+ tm.tm_year = 98;
+ tm.tm_mon = 3;
+ tm.tm_mday = 5;
+ tm.tm_hour = 2;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ if (mktime (&tm) == (time_t)-1)
+ exit (1);
+}
+
+static void
+mktime_test (now)
+ time_t now;
+{
+ struct tm *lt;
+ if ((lt = localtime (&now)) && mktime (lt) != now)
+ exit (1);
+ now = time_t_max - now;
+ if ((lt = localtime (&now)) && mktime (lt) != now)
+ exit (1);
+}
+
+static void
+irix_6_4_bug ()
+{
+ /* Based on code from Ariel Faigon. */
+ struct tm tm;
+ tm.tm_year = 96;
+ tm.tm_mon = 3;
+ tm.tm_mday = 0;
+ tm.tm_hour = 0;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ mktime (&tm);
+ if (tm.tm_mon != 2 || tm.tm_mday != 31)
+ exit (1);
+}
+static void
+bigtime_test (j)
+ int j;
+{
+ struct tm tm;
+ time_t now;
+ tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
+ now = mktime (&tm);
+ if (now != (time_t) -1)
+ {
+ struct tm *lt = localtime (&now);
+ if (! (lt
+ && lt->tm_year == tm.tm_year
+ && lt->tm_mon == tm.tm_mon
+ && lt->tm_mday == tm.tm_mday
+ && lt->tm_hour == tm.tm_hour
+ && lt->tm_min == tm.tm_min
+ && lt->tm_sec == tm.tm_sec
+ && lt->tm_yday == tm.tm_yday
+ && lt->tm_wday == tm.tm_wday
+ && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
+ == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
+ exit (1);
+ }
+}
+
+int
+main ()
+{
+ time_t t, delta;
+ int i, j;
+
+ /* This test makes some buggy mktime implementations loop.
+ Give up after 60 seconds; a mktime slower than that
+ isn't worth using anyway. */
+ alarm (60);
+
+ for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
+ continue;
+ time_t_max--;
+ delta = time_t_max / 997; /* a suitable prime number */
+ for (i = 0; i < N_STRINGS; i++)
+ {
+ if (tz_strings[i])
+ putenv (tz_strings[i]);
+
+ for (t = 0; t <= time_t_max - delta; t += delta)
+ mktime_test (t);
+ mktime_test ((time_t) 60 * 60);
+ mktime_test ((time_t) 60 * 60 * 24);
+
+ for (j = 1; 0 < j; j *= 2)
+ bigtime_test (j);
+ bigtime_test (j - 1);
+ }
+ irix_6_4_bug ();
+ spring_forward_gap ();
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_working_mktime=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_working_mktime=no
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_working_mktime" >&5
+echo "${ECHO_T}$ac_cv_func_working_mktime" >&6
+if test $ac_cv_func_working_mktime = no; then
+ LIBOBJS="$LIBOBJS mktime.$ac_objext"
+fi
+
+case "$ac_cv_func_working_mktime" in
+yes)
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MKTIME 1
+_ACEOF
+
+ ;;
+esac
+
+
+echo "$as_me:$LINENO: checking for fmod in -lm" >&5
+echo $ECHO_N "checking for fmod in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_fmod+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
-extern "C" { void *malloc(unsigned); }
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char fmod ();
+int
+main ()
+{
+fmod ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_m_fmod=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_fmod=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_fmod" >&5
+echo "${ECHO_T}$ac_cv_lib_m_fmod" >&6
+if test $ac_cv_lib_m_fmod = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+ LIBS="-lm $LIBS"
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in fmod getgrent getgroups grantpt mbrlen mbrtowc memcmp \
+ memcpy memset setlocale snprintf strchr strerror \
+ strftime strncasecmp strtod system tzset wcrtomb wcscoll
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
#else
-char *malloc();
-#endif
-
-int
-main()
-{
- char *data, *data2, *data3;
- int i, pagesize;
- int fd;
-
- pagesize = getpagesize();
-
- /*
- * First, make a file with some known garbage in it.
- */
- data = malloc(pagesize);
- if (!data)
- exit(1);
- for (i = 0; i < pagesize; ++i)
- *(data + i) = rand();
- umask(0);
- fd = creat("conftestmmap", 0600);
- if (fd < 0)
- exit(1);
- if (write(fd, data, pagesize) != pagesize)
- exit(1);
- close(fd);
-
- /*
- * Next, try to mmap the file at a fixed address which
- * already has something else allocated at it. If we can,
- * also make sure that we see the same garbage.
- */
- fd = open("conftestmmap", O_RDWR);
- if (fd < 0)
- exit(1);
- data2 = malloc(2 * pagesize);
- if (!data2)
- exit(1);
- data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
- if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_FIXED, fd, 0L))
- exit(1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data2 + i))
- exit(1);
-
- /*
- * Finally, make sure that changes to the mapped area
- * do not percolate back to the file as seen by read().
- * (This is a bug on some variants of i386 svr4.0.)
- */
- for (i = 0; i < pagesize; ++i)
- *(data2 + i) = *(data2 + i) + 1;
- data3 = malloc(pagesize);
- if (!data3)
- exit(1);
- if (read(fd, data3, pagesize) != pagesize)
- exit(1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data3 + i))
- exit(1);
- close(fd);
- unlink("conftestmmap");
- exit(0);
-}
-
-EOF
-if { (eval echo configure:2248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
- ac_cv_func_mmap_fixed_mapped=yes
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* 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
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_mmap_fixed_mapped=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
-rm -fr conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
fi
+done
-echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
-if test $ac_cv_func_mmap_fixed_mapped = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_MMAP 1
-EOF
+if test "${ac_cv_header_dlfcn_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for dlfcn.h" >&5
+echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6
+if test "${ac_cv_header_dlfcn_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
+echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking dlfcn.h usability" >&5
+echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <dlfcn.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking dlfcn.h presence" >&5
+echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <dlfcn.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for dlfcn.h" >&5
+echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6
+if test "${ac_cv_header_dlfcn_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_dlfcn_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
+echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6
+fi
+if test $ac_cv_header_dlfcn_h = yes; then
-if (uname) > /dev/null 2>&1
-then
- case `uname` in
- *VMS*) cat >> confdefs.h <<\EOF
-#define GETPGRP_VOID 1
-EOF
- ;;
- *) echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:2279: 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
+cat >>confdefs.h <<\_ACEOF
+#define DYNAMIC 1
+_ACEOF
+
+ if test "$GCC" = yes
+ then
+ # Add others here as appropriate,
+ # one day use GNU libtool.
+ if uname | $EGREP -i 'linux|freebsd|cygwin' > /dev/null
+ then
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ fi
+ fi
+
+ # Check this separately. Some systems have dlopen
+ # in libc. Notably freebsd and cygwin.
+
+echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test "$cross_compiling" = yes; then
- { echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; }
-else
- cat > conftest.$ac_ext <<EOF
-#line 2287 "configure"
-#include "confdefs.h"
-
-/*
- * If this system has a BSD-style getpgrp(),
- * which takes a pid argument, exit unsuccessfully.
- *
- * Snarfed from Chet Ramey's bash pgrp.c test program
- */
-#include <stdio.h>
-#include <sys/types.h>
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-int pid;
-int pg1, pg2, pg3, pg4;
-int ng, np, s, child;
-
-main()
-{
- pid = getpid();
- pg1 = getpgrp(0);
- pg2 = getpgrp();
- pg3 = getpgrp(pid);
- pg4 = getpgrp(1);
-
- /*
- * If all of these values are the same, it's pretty sure that
- * we're on a system that ignores getpgrp's first argument.
- */
- if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
- exit(0);
-
- child = fork();
- if (child < 0)
- exit(1);
- else if (child == 0) {
- np = getpid();
- /*
- * If this is Sys V, this will not work; pgrp will be
- * set to np because setpgrp just changes a pgrp to be
- * the same as the pid.
- */
- setpgrp(np, pg1);
- ng = getpgrp(0); /* Same result for Sys V and BSD */
- if (ng == pg1) {
- exit(1);
- } else {
- exit(0);
- }
- } else {
- wait(&s);
- exit(s>>8);
- }
-}
-
-EOF
-if { (eval echo configure:2342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
- ac_cv_func_getpgrp_void=yes
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_getpgrp_void=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
fi
-rm -fr conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDL 1
+_ACEOF
+ LIBS="-ldl $LIBS"
fi
-echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
+
+fi
+
+
+
+case `(uname) 2> /dev/null` in
+*VMS*|*BeOS*|*OS/2*|*MS-DOS*)
+
+cat >>confdefs.h <<\_ACEOF
+#define GETPGRP_VOID 1
+_ACEOF
+
+ ;;
+*) echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5
+echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6
+if test "${ac_cv_func_getpgrp_void+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Use it with a single arg.
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+getpgrp (0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_getpgrp_void=no
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_getpgrp_void=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5
+echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6
if test $ac_cv_func_getpgrp_void = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define GETPGRP_VOID 1
-EOF
+_ACEOF
fi
- ;;
- esac
+ ;;
+esac
+
+
+gawk_have_sockets=no
+# Check for system-dependent location of socket libraries
+
+SOCKET_LIBS=
+if test "$ISC" = yes; then
+ SOCKET_LIBS="-lnsl_s -linet"
else
- echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:2369: 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
+ # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
+ # libraries were built with DECnet support. And karl@cs.umb.edu says
+ # the Alpha needs dnet_stub (dnet does not exist).
+ #
+ # ADR: Is this needed just for sockets???
+# AC_CHECK_LIB(dnet, dnet_ntoa, [SOCKET_LIBS="$SOCKET_LIBS -ldnet"])
+# if test $ac_cv_lib_dnet_ntoa = no; then
+# AC_CHECK_LIB(dnet_stub, dnet_ntoa,
+# [SOCKET_LIBS="$SOCKET_LIBS -ldnet_stub"])
+# fi
+
+ # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+ # to get the SysV transport functions.
+ # chad@anasazi.com says the Pyramid MIS-ES running DC/OSx (SVR4)
+ # needs -lnsl.
+ # The nsl library prevents programs from opening the X display
+ # on Irix 5.2, according to dickey@clark.net.
+ echo "$as_me:$LINENO: checking for gethostbyname" >&5
+echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
+if test "${ac_cv_func_gethostbyname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test "$cross_compiling" = yes; then
- { echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; }
-else
- cat > conftest.$ac_ext <<EOF
-#line 2377 "configure"
-#include "confdefs.h"
-
-/*
- * If this system has a BSD-style getpgrp(),
- * which takes a pid argument, exit unsuccessfully.
- *
- * Snarfed from Chet Ramey's bash pgrp.c test program
- */
-#include <stdio.h>
-#include <sys/types.h>
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char gethostbyname (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
+choke me
+#else
+char (*f) () = gethostbyname;
+#endif
+#ifdef __cplusplus
+}
+#endif
-int pid;
-int pg1, pg2, pg3, pg4;
-int ng, np, s, child;
-
-main()
-{
- pid = getpid();
- pg1 = getpgrp(0);
- pg2 = getpgrp();
- pg3 = getpgrp(pid);
- pg4 = getpgrp(1);
-
- /*
- * If all of these values are the same, it's pretty sure that
- * we're on a system that ignores getpgrp's first argument.
- */
- if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
- exit(0);
-
- child = fork();
- if (child < 0)
- exit(1);
- else if (child == 0) {
- np = getpid();
- /*
- * If this is Sys V, this will not work; pgrp will be
- * set to np because setpgrp just changes a pgrp to be
- * the same as the pid.
- */
- setpgrp(np, pg1);
- ng = getpgrp(0); /* Same result for Sys V and BSD */
- if (ng == pg1) {
- exit(1);
- } else {
- exit(0);
- }
- } else {
- wait(&s);
- exit(s>>8);
- }
-}
-
-EOF
-if { (eval echo configure:2432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
- ac_cv_func_getpgrp_void=yes
+int
+main ()
+{
+return f != gethostbyname;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_gethostbyname=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_getpgrp_void=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_gethostbyname=no
fi
-rm -fr conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
+ if test $ac_cv_func_gethostbyname = no; then
+ echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_nsl_gethostbyname=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_nsl_gethostbyname=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
+if test $ac_cv_lib_nsl_gethostbyname = yes; then
+ SOCKET_LIBS="$SOCKET_LIBS -lnsl"
fi
-echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
-if test $ac_cv_func_getpgrp_void = yes; then
- cat >> confdefs.h <<\EOF
-#define GETPGRP_VOID 1
-EOF
+ fi
+
+ # lieder@skyler.mavd.honeywell.com says without -lsocket,
+ # socket/setsockopt and other routines are undefined under SCO ODT
+ # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
+ # on later versions), says simon@lia.di.epfl.ch: it contains
+ # gethostby* variants that don't use the nameserver (or something).
+ # -lsocket must be given before -lnsl if both are needed.
+ # We assume that if connect needs -lnsl, so does gethostbyname.
+ echo "$as_me:$LINENO: checking for connect" >&5
+echo $ECHO_N "checking for connect... $ECHO_C" >&6
+if test "${ac_cv_func_connect+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char connect (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char connect ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_connect) || defined (__stub___connect)
+choke me
+#else
+char (*f) () = connect;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != connect;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_connect=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_connect=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
+echo "${ECHO_T}$ac_cv_func_connect" >&6
+
+ if test $ac_cv_func_connect = no; then
+ echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
+echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
+if test "${ac_cv_lib_socket_connect+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $SOCKET_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char connect ();
+int
+main ()
+{
+connect ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_socket_connect=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_socket_connect=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
+if test $ac_cv_lib_socket_connect = yes; then
+ SOCKET_LIBS="-lsocket $SOCKET_LIBS"
+ gawk_have_sockets=yes
fi
+ else
+ gawk_have_sockets=yes
+ fi
+fi
+
+if test "${gawk_have_sockets}" = "yes"
+then
+ echo "$as_me:$LINENO: checking where to find the socket library calls" >&5
+echo $ECHO_N "checking where to find the socket library calls... $ECHO_C" >&6
+ case "${SOCKET_LIBS}" in
+ ?*) gawk_lib_loc="${SOCKET_LIBS}" ;;
+ *) gawk_lib_loc="the standard library" ;;
+ esac
+ echo "$as_me:$LINENO: result: ${gawk_lib_loc}" >&5
+echo "${ECHO_T}${gawk_lib_loc}" >&6
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SOCKETS 1
+_ACEOF
+
fi
-echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:2458: 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
+
+
+echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5
+echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6
+if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2463 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-int main() {
-struct stat s; s.st_blksize;
-; return 0; }
-EOF
-if { (eval echo configure:2471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_struct_st_blksize=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_struct_st_blksize=no
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (ac_aggr.st_blksize)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_stat_st_blksize=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static struct stat ac_aggr;
+if (sizeof ac_aggr.st_blksize)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_stat_st_blksize=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_struct_stat_st_blksize=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5
+echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6
+if test $ac_cv_member_struct_stat_st_blksize = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+_ACEOF
-echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
-if test $ac_cv_struct_st_blksize = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_ST_BLKSIZE 1
-EOF
+_ACEOF
fi
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2492: 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
+
+echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
+if test "${ac_cv_header_time+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2497 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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:2506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
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
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_time=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-
-echo "$ac_t""$ac_cv_header_time" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6
if test $ac_cv_header_time = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define TIME_WITH_SYS_TIME 1
-EOF
+_ACEOF
fi
-echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:2527: 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
+echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
+echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6
+if test "${ac_cv_struct_tm+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2532 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/types.h>
#include <time.h>
-int main() {
+
+int
+main ()
+{
struct tm *tp; tp->tm_sec;
-; return 0; }
-EOF
-if { (eval echo configure:2540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_struct_tm=time.h
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_struct_tm=sys/time.h
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_struct_tm=sys/time.h
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-
-echo "$ac_t""$ac_cv_struct_tm" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
+echo "${ECHO_T}$ac_cv_struct_tm" >&6
if test $ac_cv_struct_tm = sys/time.h; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define TM_IN_SYS_TIME 1
-EOF
+_ACEOF
fi
-echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:2561: 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
+echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5
+echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6
+if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2566 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/types.h>
#include <$ac_cv_struct_tm>
-int main() {
-struct tm tm; tm.tm_zone;
-; return 0; }
-EOF
-if { (eval echo configure:2574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_struct_tm_zone=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_struct_tm_zone=no
+
+
+int
+main ()
+{
+static struct tm ac_aggr;
+if (ac_aggr.tm_zone)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_tm_tm_zone=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <$ac_cv_struct_tm>
+
+
+int
+main ()
+{
+static struct tm ac_aggr;
+if (sizeof ac_aggr.tm_zone)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_tm_tm_zone=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_struct_tm_tm_zone=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5
+echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6
+if test $ac_cv_member_struct_tm_tm_zone = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_TM_TM_ZONE 1
+_ACEOF
+
+
fi
-echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
-if test "$ac_cv_struct_tm_zone" = yes; then
- cat >> confdefs.h <<\EOF
+if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_TM_ZONE 1
-EOF
+_ACEOF
else
- echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:2594: checking for tzname" >&5
-if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ echo "$as_me:$LINENO: checking for tzname" >&5
+echo $ECHO_N "checking for tzname... $ECHO_C" >&6
+if test "${ac_cv_var_tzname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2599 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <time.h>
#ifndef tzname /* For SGI. */
extern char *tzname[]; /* RS6000 and others reject char **tzname. */
#endif
-int main() {
+
+int
+main ()
+{
atoi(*tzname);
-; return 0; }
-EOF
-if { (eval echo configure:2609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_var_tzname=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_var_tzname=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_var_tzname=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-
-echo "$ac_t""$ac_cv_var_tzname" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5
+echo "${ECHO_T}$ac_cv_var_tzname" >&6
if test $ac_cv_var_tzname = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_TZNAME 1
-EOF
+_ACEOF
fi
fi
-echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
-echo "configure:2632: 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 2639 "configure"
-#include "confdefs.h"
-#ifdef __CHAR_UNSIGNED__
- yes
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "yes" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_c_char_unsigned=yes
+echo "$as_me:$LINENO: checking whether char is unsigned" >&5
+echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6
+if test "${ac_cv_c_char_unsigned+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- rm -rf conftest*
- ac_cv_c_char_unsigned=no
-fi
-rm -f conftest*
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((char) -1) < 0)];
+test_array [0] = 0
-else
-if test "$cross_compiling" = yes; then
- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
-else
- cat > conftest.$ac_ext <<EOF
-#line 2661 "configure"
-#include "confdefs.h"
-/* volatile prevents gcc2 from optimizing the test away on sparcs. */
-#if !defined(__STDC__) || __STDC__ != 1
-#define volatile
-#endif
-main() {
- volatile char c = 255; exit(c < 0);
+ ;
+ return 0;
}
-EOF
-if { (eval echo configure:2671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
- ac_cv_c_char_unsigned=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_char_unsigned=no
-fi
-rm -fr conftest*
-fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_c_char_unsigned=yes
fi
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-
-echo "$ac_t""$ac_cv_c_char_unsigned" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5
+echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6
if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define __CHAR_UNSIGNED__ 1
-EOF
-
-fi
-
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2695: 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 2700 "configure"
-#include "confdefs.h"
-
-int main() {
-
-/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this. */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this. */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in an arm
- of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
-}
-
-; return 0; }
-EOF
-if { (eval echo configure:2749: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset x;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *ccp;
+ char **p;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ ccp = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++ccp;
+ p = (char**) ccp;
+ ccp = (char const *const *) p;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ }
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_const=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_c_const=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_const=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-
-echo "$ac_t""$ac_cv_c_const" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
if test $ac_cv_c_const = no; then
- cat >> confdefs.h <<\EOF
-#define const
-EOF
-fi
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
+fi
+echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
-echo $ac_n "checking for ANSI stringizing capability""... $ac_c" 1>&6
-echo "configure:2772: checking for ANSI stringizing capability" >&5
-if eval "test \"`echo '$''{'gawk_cv_c_stringize'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_inline=$ac_kw; break
else
- cat > conftest.$ac_ext <<EOF
-#line 2777 "configure"
-#include "confdefs.h"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ no)
+cat >>confdefs.h <<\_ACEOF
+#define inline
+_ACEOF
+ ;;
+ *) cat >>confdefs.h <<_ACEOF
+#define inline $ac_cv_c_inline
+_ACEOF
+ ;;
+esac
+echo "$as_me:$LINENO: checking for preprocessor stringizing operator" >&5
+echo $ECHO_N "checking for preprocessor stringizing operator... $ECHO_C" >&6
+if test "${ac_cv_c_stringize+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#define x(y) #y
char *s = x(teststring);
-
-EOF
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "#teststring" >/dev/null 2>&1; then
- rm -rf conftest*
- gawk_cv_c_stringize=no
+ $EGREP "#teststring" >/dev/null 2>&1; then
+ ac_cv_c_stringize=no
else
- rm -rf conftest*
- gawk_cv_c_stringize=yes
+ ac_cv_c_stringize=yes
fi
rm -f conftest*
fi
+echo "$as_me:$LINENO: result: $ac_cv_c_stringize" >&5
+echo "${ECHO_T}$ac_cv_c_stringize" >&6
+if test $ac_cv_c_stringize = yes; then
-if test "${gawk_cv_c_stringize}" = yes
-then
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define HAVE_STRINGIZE 1
-EOF
+_ACEOF
fi
-echo "$ac_t""${gawk_cv_c_stringize}" 1>&6
-trap '' 1 2 15
-cat > confcache <<\EOF
+ ac_config_files="$ac_config_files Makefile awklib/Makefile doc/Makefile intl/Makefile po/Makefile.in test/Makefile"
+cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
#
-EOF
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
else
echo "not updating unwritable cache $cache_file"
fi
fi
rm -f confcache
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
fi
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
DEFS=-DHAVE_CONFIG_H
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.12"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
done
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
-trap 'rm -fr `echo "Makefile doc/Makefile test/Makefile awklib/Makefile config.h:configh.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@YACC@%$YACC%g
-s%@LN_S@%$LN_S%g
-s%@CC@%$CC%g
-s%@CPP@%$CPP%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@ALLOCA@%$ALLOCA%g
-CEOF
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
- else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ as_ln_s='ln -s'
fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by GNU Awk $as_me 3.1.3, which was
+generated by GNU Autoconf 2.57. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+GNU Awk config.status 3.1.3
+configured by $0, generated by GNU Autoconf 2.57,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
-EOF
-cat >> $CONFIG_STATUS <<EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
-CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile test/Makefile awklib/Makefile"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+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 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+ # Capture the value of LINGUAS because we need it to compute CATALOGS.
+ LINGUAS="${LINGUAS-%UNSET%}"
+
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "awklib/Makefile" ) CONFIG_FILES="$CONFIG_FILES awklib/Makefile" ;;
+ "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+ "intl/Makefile" ) CONFIG_FILES="$CONFIG_FILES intl/Makefile" ;;
+ "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
+ "test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
+ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:configh.in" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+# Create a (secure) tmp directory for tmp files.
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CYGPATH_W@,$CYGPATH_W,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@VERSION@,$VERSION,;t t
+s,@ACLOCAL@,$ACLOCAL,;t t
+s,@AUTOCONF@,$AUTOCONF,;t t
+s,@AUTOMAKE@,$AUTOMAKE,;t t
+s,@AUTOHEADER@,$AUTOHEADER,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@install_sh@,$install_sh,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@am__leading_dot@,$am__leading_dot,;t t
+s,@EGREP@,$EGREP,;t t
+s,@YACC@,$YACC,;t t
+s,@LN_S@,$LN_S,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@DEPDIR@,$DEPDIR,;t t
+s,@am__include@,$am__include,;t t
+s,@am__quote@,$am__quote,;t t
+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s,@CCDEPMODE@,$CCDEPMODE,;t t
+s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@CPP@,$CPP,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@U@,$U,;t t
+s,@ANSI2KNR@,$ANSI2KNR,;t t
+s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t
+s,@USE_NLS@,$USE_NLS,;t t
+s,@MSGFMT@,$MSGFMT,;t t
+s,@GMSGFMT@,$GMSGFMT,;t t
+s,@XGETTEXT@,$XGETTEXT,;t t
+s,@MSGMERGE@,$MSGMERGE,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@ALLOCA@,$ALLOCA,;t t
+s,@GLIBC21@,$GLIBC21,;t t
+s,@LIBICONV@,$LIBICONV,;t t
+s,@LTLIBICONV@,$LTLIBICONV,;t t
+s,@INTLBISON@,$INTLBISON,;t t
+s,@BUILD_INCLUDED_LIBINTL@,$BUILD_INCLUDED_LIBINTL,;t t
+s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t
+s,@CATOBJEXT@,$CATOBJEXT,;t t
+s,@DATADIRNAME@,$DATADIRNAME,;t t
+s,@INSTOBJEXT@,$INSTOBJEXT,;t t
+s,@GENCAT@,$GENCAT,;t t
+s,@INTLOBJS@,$INTLOBJS,;t t
+s,@INTL_LIBTOOL_SUFFIX_PREFIX@,$INTL_LIBTOOL_SUFFIX_PREFIX,;t t
+s,@INTLLIBS@,$INTLLIBS,;t t
+s,@LIBINTL@,$LIBINTL,;t t
+s,@LTLIBINTL@,$LTLIBINTL,;t t
+s,@POSUB@,$POSUB,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@SOCKET_LIBS@,$SOCKET_LIBS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
fi
+fi # test -n "$CONFIG_FILES"
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
esac
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
esac
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='\([ ]\)%\1#\2define\3'
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='$,\1#\2define\3'
ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
-
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-cat >> $CONFIG_STATUS <<EOF
- CONFIG_HEADERS="config.h:configh.in"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-fi
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
esac
- echo creating $ac_file
-
- rm -f conftest.frag conftest.in conftest.out
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- cat $ac_file_inputs > conftest.in
-
-EOF
-
-# Transform confdefs.h into a sed script conftest.vals that substitutes
-# the proper values into config.h.in to produce config.h. And first:
-# Protect against being on the right side of a sed subst in config.status.
-# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
-cat > conftest.hdr <<\EOF
-s/[\\&%]/\\&/g
-s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-s%ac_d%ac_u%gp
-s%ac_u%ac_e%gp
-EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h. The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status. Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
# This sed command replaces #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-EOF
-
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
+cat >>conftest.undefs <<\_ACEOF
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo ' :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo ' fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
rm -f conftest.tail
-while :
+while grep . conftest.undefs >/dev/null
do
- ac_lines=`grep -c . conftest.vals`
- # grep -c gives empty output for an empty file on some AIX systems.
- if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
echo 'CEOF
- sed -f conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-' >> $CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
- rm -f conftest.vals
- mv conftest.tail conftest.vals
-done
-rm -f conftest.vals
-
-cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
- echo "$ac_file is unchanged"
- rm -f conftest.h
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+ rm -f conftest.undefs
+ mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated by configure. */" >$tmp/config.h
+ else
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
+ fi
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
+ if test x"$ac_file" != x-; then
+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
else
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
fi
- rm -f $ac_file
- mv conftest.h $ac_file
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
fi
-fi; done
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $ac_file | $ac_file:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X$ac_file : 'X\(//\)[^/]' \| \
+ X$ac_file : 'X\(//\)$' \| \
+ X$ac_file : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ # Run the commands associated with the file.
+ case $ac_file in
+ config.h ) cat $srcdir/custom.h >> config.h ;;
+ esac
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
-EOF
-cat >> $CONFIG_STATUS <<EOF
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-date > stamp-h
-exit 0
-EOF
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p $dirpart/$fdir
+ else
+ as_dir=$dirpart/$fdir
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+ default-1 )
+ 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"
+ POMAKEFILEDEPS="POTFILES.in"
+ # 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 "$OBSOLETE_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_'
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # The set of available languages was given in configure.in.
+ eval 'ALL_LINGUAS''=$OBSOLETE_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" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|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 ;;
+ esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
diff --git a/gnu/dist/gawk/configure.ac b/gnu/dist/gawk/configure.ac
new file mode 100644
index 00000000000..0fc2afb9c74
--- /dev/null
+++ b/gnu/dist/gawk/configure.ac
@@ -0,0 +1,244 @@
+dnl
+dnl configure.ac --- autoconf input file for gawk
+dnl
+dnl Copyright (C) 1995-2003 the Free Software Foundation, Inc.
+dnl
+dnl This file is part of GAWK, the GNU implementation of the
+dnl AWK Programming Language.
+dnl
+dnl GAWK is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl GAWK is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+dnl
+
+dnl Process this file with autoconf to produce a configure script.
+
+dnl *** IMPORTANT ***: Fix version in both AC_INIT and AM_INIT_AUTOMAKE
+AC_INIT([GNU Awk], 3.1.3, bug-gawk@gnu.org, gawk)
+
+# This is a hack. Different versions of install on different systems
+# are just too different. Chuck it and use install-sh.
+#
+# If the user supplies $INSTALL, figure they know what they're doing.
+#
+# With Autoconf 2.5x, this needs to come very early on, but *after*
+# the INIT macro. Sigh.
+
+if test "x$INSTALL" = "x"
+then
+ INSTALL="$srcdir/install-sh -c"
+ export INSTALL
+fi
+
+AC_PREREQ(2.57)
+AC_CONFIG_HEADERS([config.h:configh.in], [cat $srcdir/custom.h >> config.h])
+AM_INIT_AUTOMAKE(gawk, 3.1.3)
+
+dnl Additional argument stuff
+AC_ARG_ENABLE(portals, [ --enable-portals Enable /p as path prefix for portals],
+ if test "$enableval" = yes
+ then
+ AC_DEFINE(HAVE_PORTALS, 1, [we have portals on /p on this system])
+ fi
+)
+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, 1,
+ [force use of our version of strftime])
+ fi
+)
+AC_ARG_ENABLE([lint], [ --disable-lint Disable gawk lint checking],
+ if test "$enableval" = no
+ then
+ AC_DEFINE(NO_LINT, 1, [disable lint checks])
+ fi
+)
+AC_ARG_ENABLE(switch, [ --enable-switch Enable switch statements for awk programs],
+ if test "$enableval" = yes
+ then
+ AC_DEFINE(ALLOW_SWITCH, 1, [switch statements are enabled in awk programs])
+ fi
+)
+
+dnl checks for programs
+AC_PROG_EGREP
+AC_PROG_YACC
+AC_PROG_LN_S
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_RANLIB
+
+AC_OBJEXT
+AC_EXEEXT
+
+AC_PROG_INSTALL
+
+AC_PROG_MAKE_SET
+
+# This is mainly for my use during testing and development.
+# Yes, it's a bit of a hack.
+AC_MSG_CHECKING([for special development options])
+if test -f $srcdir/.developing
+then
+ # add other debug flags as appropriate, save GAWKDEBUG for emergencies
+ CFLAGS="$CFLAGS -DARRAYDEBUG"
+ # turn on compiler warnings if we're doing development
+ if test "$GCC" = yes
+ then
+ CFLAGS="$CFLAGS -Wall"
+ fi
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+
+AC_SUBST(CFLAGS)
+
+dnl checks for systems
+AC_AIX
+AC_ISC_POSIX
+AC_MINIX
+AC_SYS_LARGEFILE
+GAWK_AC_AIX_TWEAK
+GAWK_AC_LINUX_ALPHA
+
+if test "$ISC" = 1 # will be set by test for ISC
+then
+dnl need -D_SYSV3 for ISC
+ CFLAGS="$CFLAGS -D_SYSV3"
+fi
+
+dnl check for C compiler for automake
+AM_PROG_CC_STDC
+AM_C_PROTOTYPES
+
+dnl Cygwin doesn't like to get libs with full paths
+dnl since that overrides linking against DLLs.
+case `(uname) 2> /dev/null` in
+*CYGWIN*)
+ with_libiconv_prefix=no
+ with_libintl_prefix=no
+ ;;
+*)
+ ;;
+esac
+
+dnl initialize GNU gettext
+AM_GNU_GETTEXT([no-libtool], [need-ngettext])
+AM_GNU_GETTEXT_VERSION(0.12.1)
+
+dnl checks for header files
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_HEADER_TIME
+AC_CHECK_HEADERS(fcntl.h limits.h locale.h libintl.h mcheck.h \
+ netdb.h netinet/in.h signum.h stdarg.h string.h \
+ sys/param.h sys/socket.h sys/time.h unistd.h \
+ termios.h stropts.h wchar.h wctype.h)
+
+if test "$ac_cv_header_string_h" = yes
+then
+ AC_CHECK_HEADERS(memory.h)
+else
+ AC_CHECK_HEADERS(strings.h)
+fi
+
+dnl checks for typedefs
+AC_TYPE_PID_T
+AC_TYPE_SIGNAL
+AC_SIZE_T
+AC_TYPE_GETGROUPS
+jm_AC_TYPE_LONG_LONG
+jm_AC_TYPE_UNSIGNED_LONG_LONG
+jm_AC_TYPE_INTMAX_T
+jm_AC_TYPE_UINTMAX_T
+AC_CHECK_TYPE(ssize_t, int)
+AC_EGREP_HEADER([int.*sprintf], stdio.h,
+ AC_DEFINE(SPRINTF_RET, int, [return type of sprintf]),
+ 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, 1,
+ [some systems define this type here]))
+
+dnl checks for functions
+AC_DEFINE(REGEX_MALLOC, 1, [use malloc instead of alloca in regex.c])
+AC_FUNC_VPRINTF
+GAWK_AC_FUNC_STRTOD_C89
+AC_FUNC_MKTIME
+case "$ac_cv_func_working_mktime" in
+yes) AC_DEFINE(HAVE_MKTIME, 1, [we have the mktime function])
+ ;;
+esac
+
+AC_CHECK_LIB(m, fmod)
+AC_CHECK_FUNCS(fmod getgrent getgroups grantpt mbrlen mbrtowc memcmp \
+ memcpy memset setlocale snprintf strchr strerror \
+ strftime strncasecmp strtod system tzset wcrtomb wcscoll)
+
+dnl check for dynamic linking
+dnl This is known to be very primitive
+AC_CHECK_HEADER(dlfcn.h,
+ [AC_DEFINE([DYNAMIC], 1, [dynamic loading is possible])
+ if test "$GCC" = yes
+ then
+ # Add others here as appropriate,
+ # one day use GNU libtool.
+ if uname | $EGREP -i 'linux|freebsd|cygwin' > /dev/null
+ then
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ fi
+ fi
+
+ # Check this separately. Some systems have dlopen
+ # in libc. Notably freebsd and cygwin.
+ AC_CHECK_LIB(dl, dlopen)
+])
+
+dnl check for how to use getpgrp
+dnl have to hardwire it for VMS POSIX. Sigh.
+dnl ditto for BeOS, OS/2, and MS-DOS.
+case `(uname) 2> /dev/null` in
+*VMS*|*BeOS*|*OS/2*|*MS-DOS*)
+ AC_DEFINE(GETPGRP_VOID, 1,
+ [Define to 1 if the getpgrp function requires zero arguments.])
+ ;;
+*) AC_FUNC_GETPGRP
+ ;;
+esac
+
+dnl check for sockets
+GAWK_AC_LIB_SOCKETS
+
+dnl checks for structure members
+AC_STRUCT_ST_BLKSIZE
+AC_HEADER_TIME
+AC_STRUCT_TM
+AC_STRUCT_TIMEZONE
+
+dnl checks for compiler characteristics
+AC_C_CHAR_UNSIGNED
+AC_C_CONST
+AC_C_INLINE
+AC_C_STRINGIZE
+
+AC_OUTPUT(Makefile \
+ awklib/Makefile \
+ doc/Makefile \
+ intl/Makefile \
+ po/Makefile.in \
+ test/Makefile)
diff --git a/gnu/dist/gawk/custom.h b/gnu/dist/gawk/custom.h
index 833bb62319c..08f043bd655 100644
--- a/gnu/dist/gawk/custom.h
+++ b/gnu/dist/gawk/custom.h
@@ -1,17 +1,19 @@
+/* $NetBSD: custom.h,v 1.1.1.2 2003/10/06 15:45:47 wiz Exp $ */
+
/*
* custom.h
*
* This file is for use on systems where Autoconf isn't quite able to
- * get things right. It is included after config.h in awk.h, to override
- * definitions from Autoconf that are erroneous. See the manual for more
- * information.
+ * get things right. It is appended to the bottom of config.h by configure,
+ * in order to override definitions from Autoconf that are erroneous. See
+ * the manual for more information.
*
* If you make additions to this file for your system, please send me
- * the information, to arnold@gnu.ai.mit.edu.
+ * the information, to arnold@skeeve.com.
*/
/*
- * Copyright (C) 1995-1997 the Free Software Foundation, Inc.
+ * Copyright (C) 1995-2003 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -37,7 +39,7 @@
#undef HAVE_STRERROR
#endif
-/* for VMS POSIX, from Pat Rankin, rankin@eql.caltech.edu */
+/* for VMS POSIX, from Pat Rankin, rankin@pactechdata.com */
#ifdef VMS_POSIX
#undef VMS
#include "vms/redirect.h"
@@ -53,7 +55,52 @@
#define fork vfork
#endif
-/* For sequent, based on email with Aron Griffis <agriffis@calypso.coat.com> */
-#ifdef _SEQUENT_
-#undef HAVE_MMAP
+/* For BeOS, from mc@whoever.com */
+#if defined(__dest_os) && __dest_os == __be_os
+#define BROKEN_STRNCASECMP
+#define ELIDE_CODE
+#include <alloca.h>
+#endif
+
+/* For Tandems, based on code from scldad@sdc.com.au */
+#ifdef TANDEM
+#define tempnam(a,b) tmpnam(NULL)
+#define variable(a,b,c) variabl(a,b,c)
+#define srandom srand
+#define random rand
+
+#include <cextdecs(PROCESS_GETINFO_)>
+#endif
+
+/* For 16-bit DOS */
+#if defined(MSC_VER) && defined(MSDOS)
+#define NO_PROFILING 1
+#endif
+
+/* For MacOS X, which is almost BSD Unix */
+#ifdef __APPLE__
+#define HAVE_MKTIME 1
+#endif
+
+#ifdef __WIN32__
+#undef HAVE_STRFTIME
+/* #define system(s) os_system(s) */
+#endif
+
+/* For ULTRIX 4.3 */
+#ifdef ultrix
+#define HAVE_MKTIME 1
+#define GETGROUPS_NOT_STANDARD 1
+#endif
+
+/* For whiny users */
+#ifdef USE_INCLUDED_STRFTIME
+#undef HAVE_STRFTIME
+#endif
+
+/* For HP/UX with gcc */
+#if defined(hpux) || defined(_HPUX_SOURCE)
+#undef HAVE_TZSET
+#define HAVE_TZSET 1
+#define _TZSET 1
#endif
diff --git a/gnu/dist/gawk/depcomp b/gnu/dist/gawk/depcomp
new file mode 100755
index 00000000000..51606f8c463
--- /dev/null
+++ b/gnu/dist/gawk/depcomp
@@ -0,0 +1,464 @@
+#! /bin/sh
+
+# depcomp - compile a program generating dependencies as side-effects
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+# `libtool' can also be set to `yes' or `no'.
+
+if test -z "$depfile"; then
+ base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
+ dir=`echo "$object" | sed 's,/.*$,/,'`
+ if test "$dir" = "$object"; then
+ dir=
+ fi
+ # FIXME: should be _deps on DOS.
+ depfile="$dir.deps/$base"
+fi
+
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+ "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> $depfile
+ echo >> $depfile
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. This file always lives in the current directory.
+ # Also, the AIX compiler puts `$object:' at the start of each line;
+ # $object doesn't have directory information.
+ stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
+ tmpdepfile="$stripped.u"
+ outname="$stripped.o"
+ if test "$libtool" = yes; then
+ "$@" -Wc,-M
+ else
+ "$@" -M
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Must come before tru64.
+
+ # Intel's C compiler understands `-MD -MF file'. However
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^[^:]*: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ tmpdepfile1="$dir.libs/$base.lo.d"
+ tmpdepfile2="$dir.libs/$base.d"
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1="$dir$base.o.d"
+ tmpdepfile2="$dir$base.d"
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile1"; then
+ tmpdepfile="$tmpdepfile1"
+ else
+ tmpdepfile="$tmpdepfile2"
+ fi
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a space and a tab in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ "$@" || exit $?
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/gnu/dist/gawk/doc/ChangeLog b/gnu/dist/gawk/doc/ChangeLog
index 660436a19ac..d81e9e254be 100644
--- a/gnu/dist/gawk/doc/ChangeLog
+++ b/gnu/dist/gawk/doc/ChangeLog
@@ -1,3 +1,287 @@
+Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.3: Release tar file made.
+
+Mon Jun 9 16:06:30 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: Set automatic-xref-title and change all cross
+ references to be of the single-argument type. Made all
+ @node lines have just the node name.
+
+ Should have done both of these years ago.
+
+Sun May 11 16:08:58 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (html, gawk.html, gawkinet.html): New targets.
+
+Mon Mar 31 17:15:23 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (install-data-hook, uninstall-hook): Added code to
+ hard link gawk.1 to pgawk.1 upon install and remove pgawk.1 upon
+ uninstall. Avoids MANPATH search problems, etc. etc.
+ (man_MANS): Removed pgawk.1 from the list.
+ * pgawk.1: Removed.
+
+Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ This time for sure.
+ -- Bullwinkle
+
+ * Release 3.1.2: Release tar file made.
+
+Tue Mar 11 11:22:36 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (man_MANS): Add pgawk.1.
+ * pgawk.1: New file, does `.so gawk.1' so that `man pgawk' will work.
+ Thanks to Nelson Beebe for pointing the need for this.
+
+Sun Feb 9 09:45:06 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi, gawkinet.texi: Per Karl Berry, change dircategory
+ to follow current standards. In gawkinet.texi, remove
+ bracketing ifinfo.
+
+Thu Feb 6 12:06:22 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * texinfo.tex: Updated to version 2003-02-03.16 from Texinfo 4.5.
+
+Tue Feb 4 15:21:46 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkcard.in: Redid the page-breaking.
+
+Tue Feb 4 14:28:06 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ All relevant files: Copyright year updated to 2003.
+
+Sun Jan 26 11:13:01 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * texinfo.tex: Updated to version 2003-01-24.17 from prep.
+ * gawk.texi: Documented asorti(), new elements in match() 3rd arg,
+ misc cleanups. Updated to FDL 1.2.
+ * awkcard.in, gawk.1: Ditto for asorti(), match().
+ * gawkinet.texi: Updated to FDL 1.2.
+
+Thu Jan 16 18:34:54 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * texinfo.tex: Updated to version 2003-01-12.11 from prep.
+
+Sun Nov 24 17:55:23 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * texinfo.tex: Updated to version 2002-11-05.11 from Texinfo 4.3.
+
+Sun Nov 17 21:34:35 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * texinfo.tex: Updated to version 2002-10-13.14 from automake 1.7.1.
+
+Fri Nov 1 11:25:00 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ From Kaveh Ghazi:
+
+ * gawk.texi (grcat.c): Include stdlib.h.
+ (main): Fix format specifier warnings.
+ * gawk.texi (pwcat.c): Include config.h/stdlib.h.
+ (main): Fix format specifier warnings.
+
+Tue Jun 11 23:08:04 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: Fix grcat code ifdef for HAVE_GETGRENT.
+
+2002-05-09 Paul Eggert <eggert@twinsun.com>
+
+ [ ADR: Some minor post-patch editing was required. ]
+
+ * gawk.texi (igawk): Do not put temporary files in /tmp, as that
+ has some security problems. This fixes a problem originally
+ reported by Jarno Huuskonen via solar@openwall.com.
+
+ Fix the following problems with igawk while we're at it.
+
+ * Report missing operands of options; this fixes e.g. an
+ infinite loop with "igawk -W".
+
+ * Check for --source and -Wsource only, not -.source (which matches
+ errors). Similarly for other multichar options.
+
+ * Do not use 'echo', as that mishandles backslashes.
+
+Mon May 13 01:25:40 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkinet.texi: Change `ifinfo' to `ifnottex' around
+ the Top node. Thanks to Eli Zaretskii.
+
+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
+ rejoicing.
+
+Mon May 14 19:57:31 2001 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi, gawkinet.texi: Versions for distribution
+ put in place.
+ * gawk.1, awkcard.in: Minor edits for consistency of
+ usage, formatting.
+
+Wed Nov 22 14:57:59 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi, gawk.1, awkcard.in: Removed all documentation
+ of abort.
+
+Sun Aug 13 11:23:50 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi, gawk.1, awkcard.in: documented sort function
+ and optional third argument to match.
+
+Sun Aug 13 00:40:41 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: hardwired publisher info.
+ * publisher.texi: Removed. Not needed any more.
+ * gawkinet.texi: Added title page stuff.
+
+Thu Jul 5 21:05:57 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: moved to use of @command, @option everywhere
+ appropriate. Removed all @page and @group in anticipation
+ of re-page breaking. Updated stuff for install-info.
+ Added FDL.
+
+Tue Nov 10 11:42:26 1998 Arnold D. Robbins <arnold@gnu.org>
+
+ * publisher.texi: new file with publisher related info.
+ * Makefile.in: updated dvi and postscript targets to make
+ them lots smarter about not reformatting if need be.
+
+Mon Aug 7 15:23:00 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.0.6: Release tar file made.
+
+Sun Jun 25 15:08:19 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.0.5: Release tar file made.
+
+Wed May 17 19:04:54 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi, gawk.1, awkcard.in: Documented %u. Ooops.
+
+Tue May 2 11:44:13 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * texinfo.tex: Updated to version 1999-10-01.07.
+ * gawk.texi: Redid page breaking for new texinfo.tex.
+
+Thu Apr 6 12:32:49 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: Change info dir file entry to `(gawk)' from
+ `(gawk.info)'.
+ * Makefile.in [$(infodir)/gawk.info]: Fix grep test is
+ accordance with above.
+
+Sun Feb 13 15:36:32 2000 Paul Eggert <eggert@twinsun.com>
+
+ * gawk.texi: Mention that arithmetic is done in double
+ precision floating point, and point to Goldberg's paper for
+ people who want to know more. Fix some other minor floating
+ point discussion issues.
+
+Wed Nov 3 17:04:35 1999 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.1: Lots of troff ``lint'' from Paul Eggert. Not all
+ of his changes, just the ones I thought worth doing.
+
+Mon Oct 11 16:53:54 1999 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.in (gawk.dvi): Put $(srcdir) first in TEXINPUTS,
+ and also just use texi2dvi, don't run texindex and tex
+ manually. Doing so is no longer necessary.
+
+Mon Aug 9 13:06:01 1999 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi: New node `Array Efficiency' on the best use
+ of subscripting to avoid memory bloat.
+
+Thu Jul 29 23:15:34 1999 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.in ($(infodir)/gawk.info): Removed loop around
+ $(INSTALL_DATA), since there's only one Info file to install,
+ install it directly.
+
+Wed Jun 30 16:14:36 1999 Arnold D. Robbins <arnold@gnu.org>
+
+ * Release 3.0.4: Release tar file made. This time for sure.
+
+Wed Oct 7 21:59:33 1998 Arnold D. Robbins <arnold@gnu.org>
+
+ * texinfo.tex: Updated to version 2.227, from Texinfo 3.12.
+
+Sun Oct 19 12:26:08 1997 Arnold D. Robbins <arnold@gnu.org>
+
+ * ALL: change references to arnold@gnu.ai.mit.edu to arnold@gnu.org.
+
+Tue Sep 23 10:31:17 1997 Arnold D. Robbins <arnold@gnu.org>
+
+ * texinfo.tex: Updated to version 2.218, from Texinfo 3.11.
+
+Fri Jul 4 08:19:00 1997 Arnold D. Robbins <arnold@gnu.org>
+
+ * Makefile.in ($(infodir)/gawk.info): Don't make dependent upon
+ gawk.info, in case installed one is newer. Instead, check that
+ an installed gawk.info exists and is identical to current one.
+ If so, just exit; otherwise do the install.
+
+Wed Jul 2 14:55:12 1997 Arnold D. Robbins <arnold@gnu.org>
+
+ * Makefile.in ($(infodir)/gawk.info): typo fix.
+
Thu May 15 12:49:08 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Release 3.0.3: Release tar file made.
diff --git a/gnu/dist/gawk/doc/Makefile.am b/gnu/dist/gawk/doc/Makefile.am
new file mode 100644
index 00000000000..28f58bc3625
--- /dev/null
+++ b/gnu/dist/gawk/doc/Makefile.am
@@ -0,0 +1,105 @@
+#
+# 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
+#
+
+## process this file with automake to produce Makefile.in
+
+info_TEXINFOS = gawk.texi gawkinet.texi
+
+man_MANS = gawk.1 igawk.1
+
+EXTRA_DIST = ChangeLog README.card ad.block setter.outline \
+ awkcard.in awkforai.txt texinfo.tex cardfonts \
+ macros colors no.colors $(man_MANS) \
+ lflashlight.eps rflashlight.eps \
+ statist.jpg statist.eps
+
+MAKEINFO = @MAKEINFO@ --no-split
+
+TROFF = groff -t -Tps
+SEDME = sed -e "s/^level0 restore/level0 restore flashme 100 72 moveto (Copyright `date '+%m-%d-%y %T'`, FSF, Inc. (all)) show/" \
+ -e "s/^\/level0 save def/\/level0 save def 30 -48 translate/"
+
+CARDSRC = $(srcdir)/macros $(srcdir)/cardfonts $(srcdir)/colors awkcard.tr
+CARDSRC_N = $(srcdir)/macros $(srcdir)/cardfonts $(srcdir)/no.colors awkcard.tr
+CARDFILES= $(CARDSRC) ad.block awkcard.in setter.outline
+
+# Use this if your troff can correctly handle macros from 'colors' file
+AWKCARD = awkcard.ps
+
+# Uncomment the following definition of AWKCARD if your troff can produce
+# Postscript but still has troubles with macros from 'colors'. As this
+# is not groff you will have to change TROFF macro as well. Do not forget
+# to ensure that awkcard.tr is processed by tbl.
+#AWKCARD = awkcard.nc
+
+# The following is patterned after the main Makefile.am. The point is to
+# make pgawk.1 a link to gawk.1 in the installed man directory.
+
+# We want hard links for install-data-hook, below
+LN= ln
+
+# Link gawk.1 to pgawk.1
+install-data-hook:
+ (cd $(DESTDIR)$(man1dir); \
+ $(LN) gawk.1 pgawk.1 2>/dev/null ; \
+ exit 0)
+
+# Undo the above when uninstalling
+uninstall-hook:
+ cd $(DESTDIR)$(man1dir); rm -f pgawk.1 ; exit 0
+
+postscript: gawk.ps gawkinet.ps gawk.1.ps igawk.1.ps $(AWKCARD)
+
+gawk.ps: gawk.dvi
+ dvips -o gawk.ps gawk.dvi
+
+gawkinet.ps: gawkinet.dvi
+ dvips -o gawkinet.ps gawkinet.dvi
+
+gawk.1.ps: gawk.1
+ -groff -man $(srcdir)/gawk.1 > gawk.1.ps
+
+igawk.1.ps: igawk.1
+ -groff -man $(srcdir)/igawk.1 > igawk.1.ps
+
+awkcard.tr: awkcard.in
+ sed 's:SRCDIR:$(srcdir):' < $(srcdir)/awkcard.in > awkcard.tr
+
+awkcard.ps: $(CARDFILES)
+ $(TROFF) $(CARDSRC) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps
+
+awkcard.nc: $(CARDFILES)
+ $(TROFF) $(CARDSRC_N) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps && touch awkcard.nc
+
+html: gawk.html gawkinet.html
+
+gawk.html: gawk.texi
+ $(MAKEINFO) --html $<
+
+gawkinet.html: gawkinet.texi
+ $(MAKEINFO) --html $<
+
+clean:
+ rm -f *.ps *~ awkcard.nc awkcard.tr *.html
+
+distclean: clean
diff --git a/gnu/dist/gawk/doc/Makefile.in b/gnu/dist/gawk/doc/Makefile.in
index 293676b5b65..f6a9c33c0ad 100644
--- a/gnu/dist/gawk/doc/Makefile.in
+++ b/gnu/dist/gawk/doc/Makefile.in
@@ -1,62 +1,190 @@
-# Makefile for GNU Awk documentation.
+# Makefile.in generated by automake 1.7.5 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#
+# doc/Makefile.am --- automake input file for gawk
+#
+# Copyright (C) 2000, 2001, 2002 the Free Software Foundation, Inc.
#
-# Copyright (C) 1993-1997 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 = /bin/sh
+#
srcdir = @srcdir@
+top_srcdir = @top_srcdir@
VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_triplet = @host@
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
+CATOBJEXT = @CATOBJEXT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATADIRNAME = @DATADIRNAME@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GENCAT = @GENCAT@
+GLIBC21 = @GLIBC21@
+GMSGFMT = @GMSGFMT@
INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTOBJEXT = @INSTOBJEXT@
+INTLBISON = @INTLBISON@
+INTLLIBS = @INTLLIBS@
+INTLOBJS = @INTLOBJS@
+INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-binprefix =
-manprefix =
-
+MAKEINFO = @MAKEINFO@ --no-split
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOCKET_LIBS = @SOCKET_LIBS@
+STRIP = @STRIP@
+U = @U@
+USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+YACC = @YACC@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
bindir = @bindir@
-libdir = @libdir@
-mandir = @mandir@/man1
-manext = .1
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
infodir = @infodir@
-datadir = @datadir@/awk
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+
+info_TEXINFOS = gawk.texi gawkinet.texi
+
+man_MANS = gawk.1 igawk.1
+
+EXTRA_DIST = ChangeLog README.card ad.block setter.outline \
+ awkcard.in awkforai.txt texinfo.tex cardfonts \
+ macros colors no.colors $(man_MANS) \
+ lflashlight.eps rflashlight.eps \
+ statist.jpg statist.eps
+
-TEXI2DVI = texi2dvi
-TEX = tex
-MAKEINFO = makeinfo --no-split
TROFF = groff -t -Tps
SEDME = sed -e "s/^level0 restore/level0 restore flashme 100 72 moveto (Copyright `date '+%m-%d-%y %T'`, FSF, Inc. (all)) show/" \
-e "s/^\/level0 save def/\/level0 save def 30 -48 translate/"
-DOCS= gawk.1 igawk.1 gawk.texi
-
-TEXFILES= gawk.aux gawk.cp gawk.cps gawk.fn gawk.fns gawk.ky gawk.kys \
- gawk.pg gawk.pgs gawk.toc gawk.tp gawk.tps gawk.vr gawk.vrs
-
-ALLDOC= gawk.dvi $(TEXFILES) gawk.log awkcard.tr
CARDSRC = $(srcdir)/macros $(srcdir)/cardfonts $(srcdir)/colors awkcard.tr
CARDSRC_N = $(srcdir)/macros $(srcdir)/cardfonts $(srcdir)/no.colors awkcard.tr
-CARDFILES= $(CARDSRC) ad.block awkcard.in setter.outline
+CARDFILES = $(CARDSRC) ad.block awkcard.in setter.outline
# Use this if your troff can correctly handle macros from 'colors' file
AWKCARD = awkcard.ps
@@ -67,45 +195,341 @@ AWKCARD = awkcard.ps
# to ensure that awkcard.tr is processed by tbl.
#AWKCARD = awkcard.nc
-all: $(DOCS) info
+# The following is patterned after the main Makefile.am. The point is to
+# make pgawk.1 a link to gawk.1 in the installed man directory.
+
+# We want hard links for install-data-hook, below
+LN = ln
+subdir = doc
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+am__TEXINFO_TEX_DIR = $(srcdir)
+INFO_DEPS = gawk.info gawkinet.info
+DVIS = gawk.dvi gawkinet.dvi
+PDFS = gawk.pdf gawkinet.pdf
+PSS = gawk.ps gawkinet.ps
+TEXINFOS = gawk.texi gawkinet.texi
+
+NROFF = nroff
+MANS = $(man_MANS)
+DIST_COMMON = ChangeLog Makefile.am Makefile.in texinfo.tex
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .dvi .info .pdf .ps .texi
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu doc/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
-install: $(mandir)/gawk$(manext) $(mandir)/igawk$(manext) $(infodir)/gawk.info
+.texi.info:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]
+ $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+ -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
-$(infodir)/gawk.info: gawk.info
- -if test -f gawk.info; then d=.; \
- else d=$(srcdir); fi; \
- for i in $$d/gawk.info*; do \
- $(INSTALL_DATA) $$i $(infodir)/$i ; \
+.texi.dvi:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+ $(TEXI2DVI) `test -f '$<' || echo '$(srcdir)/'`$<
+
+.texi.pdf:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+ $(TEXI2PDF) `test -f '$<' || echo '$(srcdir)/'`$<
+gawk.info: gawk.texi
+gawk.dvi: gawk.texi
+gawk.pdf: gawk.texi
+gawkinet.info: gawkinet.texi
+gawkinet.dvi: gawkinet.texi
+gawkinet.pdf: gawkinet.texi
+TEXI2DVI = texi2dvi
+
+TEXI2PDF = $(TEXI2DVI) --pdf --batch
+DVIPS = dvips
+.dvi.ps:
+ $(DVIPS) -o $@ $<
+
+uninstall-info-am:
+ $(PRE_UNINSTALL)
+ @if (install-info --version && \
+ install-info --version | grep -i -v debian) >/dev/null 2>&1; then \
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile"; \
+ install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile; \
+ done; \
+ else :; fi
+ @$(NORMAL_UNINSTALL)
+ @list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
+ (if cd $(DESTDIR)$(infodir); then \
+ echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \
+ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
+ else :; fi); \
+ done
+
+dist-info: $(INFO_DEPS)
+ list='$(INFO_DEPS)'; \
+ for base in $$list; do \
+ if test -f $$base; then d=.; else d=$(srcdir); fi; \
+ for file in $$d/$$base*; do \
+ relfile=`expr "$$file" : "$$d/\(.*\)"`; \
+ test -f $(distdir)/$$relfile || \
+ cp -p $$file $(distdir)/$$relfile; \
+ done; \
+ done
+
+mostlyclean-aminfo:
+ -rm -f gawk.aux gawk.cp gawk.cps gawk.fn gawk.ky gawk.kys gawk.log gawk.pg \
+ gawk.pgs gawk.tmp gawk.toc gawk.tp gawk.tps gawk.vr gawk.dvi \
+ gawk.pdf gawk.ps gawkinet.aux gawkinet.cp gawkinet.cps \
+ gawkinet.fn gawkinet.ky gawkinet.kys gawkinet.log gawkinet.pg \
+ gawkinet.pgs gawkinet.tmp gawkinet.toc gawkinet.tp \
+ gawkinet.tps gawkinet.vr gawkinet.dvi gawkinet.pdf \
+ gawkinet.ps
+
+maintainer-clean-aminfo:
+ @list='$(INFO_DEPS)'; for i in $$list; do \
+ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
+ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
+ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
+ done
+
+man1dir = $(mandir)/man1
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(man1dir)
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
+ esac; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+ done
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
done; \
- if $(SHELL) -c 'install-info --version' > /dev/null 2>&1 ; \
- then install-info --info-dir=$(infodir) gawk.info ; \
- else true ; fi; exit 0
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
+ esac; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+ rm -f $(DESTDIR)$(man1dir)/$$inst; \
+ done
+tags: TAGS
+TAGS:
-$(mandir)/gawk$(manext): gawk.1
- $(INSTALL_DATA) $(srcdir)/gawk.1 $(mandir)/gawk$(manext)
+ctags: CTAGS
+CTAGS:
-$(mandir)/igawk$(manext): igawk.1
- $(INSTALL_DATA) $(srcdir)/igawk.1 $(mandir)/igawk$(manext)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-uninstall:
- rm -f $(mandir)/gawk$(manext) $(mandir)/igawk$(manext) $(infodir)/gawk.info*
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
-dvi: gawk.dvi
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-info
+check-am: all-am
+check: check-am
+all-am: Makefile $(INFO_DEPS) $(MANS)
-gawk.dvi: gawk.texi
- -TEXINPUTS=$$TEXINPUTS:$(srcdir) $(TEXI2DVI) $(srcdir)/gawk.texi
- texindex gawk.??
- TEXINPUTS=$$TEXINPUTS:$(srcdir) $(TEX) $(srcdir)/gawk.texi
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(man1dir)
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
-info: gawk.info
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-gawk.info: gawk.texi
- $(MAKEINFO) $(srcdir)/gawk.texi
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
-postscript: dvi gawk.1 igawk.1 $(AWKCARD)
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am: $(DVIS)
+
+info: info-am
+
+info-am: $(INFO_DEPS)
+
+install-data-am: install-info-am install-man
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+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 \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
+ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
+ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
+ if test -f $$ifile; then \
+ relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
+ echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \
+ $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile; \
+ else : ; fi; \
+ done; \
+ done
+ @$(POST_INSTALL)
+ @if (install-info --version && \
+ install-info --version | grep -i -v debian) >/dev/null 2>&1; then \
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile";\
+ install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile || :;\
+ done; \
+ else : ; fi
+install-man: install-man1
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+
+maintainer-clean-am: distclean-am maintainer-clean-aminfo \
+ maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-aminfo mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am: $(PDFS)
+
+ps: ps-am
+
+ps-am: $(PSS)
+
+uninstall-am: uninstall-info-am uninstall-man
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) uninstall-hook
+
+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 pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am uninstall-man uninstall-man1
+
+
+# Link gawk.1 to pgawk.1
+install-data-hook:
+ (cd $(DESTDIR)$(man1dir); \
+ $(LN) gawk.1 pgawk.1 2>/dev/null ; \
+ exit 0)
+
+# Undo the above when uninstalling
+uninstall-hook:
+ cd $(DESTDIR)$(man1dir); rm -f pgawk.1 ; exit 0
+
+postscript: gawk.ps gawkinet.ps gawk.1.ps igawk.1.ps $(AWKCARD)
+
+gawk.ps: gawk.dvi
+ dvips -o gawk.ps gawk.dvi
+
+gawkinet.ps: gawkinet.dvi
+ dvips -o gawkinet.ps gawkinet.dvi
+
+gawk.1.ps: gawk.1
-groff -man $(srcdir)/gawk.1 > gawk.1.ps
+
+igawk.1.ps: igawk.1
-groff -man $(srcdir)/igawk.1 > igawk.1.ps
- dvips -o gawk.ps gawk.dvi
awkcard.tr: awkcard.in
sed 's:SRCDIR:$(srcdir):' < $(srcdir)/awkcard.in > awkcard.tr
@@ -116,13 +540,18 @@ awkcard.ps: $(CARDFILES)
awkcard.nc: $(CARDFILES)
$(TROFF) $(CARDSRC_N) | $(SEDME) | cat $(srcdir)/setter.outline - > awkcard.ps && touch awkcard.nc
+html: gawk.html gawkinet.html
+
+gawk.html: gawk.texi
+ $(MAKEINFO) --html $<
+
+gawkinet.html: gawkinet.texi
+ $(MAKEINFO) --html $<
+
clean:
- rm -f *.ps $(ALLDOC) *~ awkcard.nc
+ rm -f *.ps *~ awkcard.nc awkcard.tr *.html
distclean: clean
- rm -f Makefile
-
-maintainer-clean: distclean
- @echo "This command is intended for maintainers to use; it"
- @echo "deletes files that may require special tools to rebuild."
- rm -f gawk.info
+# 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/gnu/dist/gawk/doc/texinfo.tex b/gnu/dist/gawk/doc/texinfo.tex
index 38a8dc366ba..e9293f3b9d5 100644
--- a/gnu/dist/gawk/doc/texinfo.tex
+++ b/gnu/dist/gawk/doc/texinfo.tex
@@ -1,52 +1,81 @@
-%% TeX macros to handle Texinfo files.
-%% $Id: texinfo.tex,v 1.1.1.1 1999/06/13 20:39:17 tron Exp $
-
-% Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
-% 94, 95, 1996 Free Software Foundation, Inc.
-
-%This texinfo.tex file is free software; you can redistribute it and/or
-%modify it under the terms of the GNU General Public License as
-%published by the Free Software Foundation; either version 2, or (at
-%your option) any later version.
-
-%This texinfo.tex file is distributed in the hope that it will be
-%useful, but WITHOUT ANY WARRANTY; without even the implied warranty
-%of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-%General Public License for more details.
-
-%You should have received a copy of the GNU General Public License
-%along with this texinfo.tex file; see the file COPYING. If not, write
-%to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-%Boston, MA 02111-1307, USA.
-
-
-%In other words, you are welcome to use, share and improve this program.
-%You are forbidden to forbid anyone else to use, share and improve
-%what you give them. Help stamp out software-hoarding!
-
-
-% Send bug reports to bug-texinfo@prep.ai.mit.edu.
-% Please include a *precise* test case in each bug report.
-
-
-% Make it possible to create a .fmt file just by loading this file:
-% if the underlying format is not loaded, start by loading it now.
-% Added by gildea November 1993.
+% texinfo.tex -- TeX macros to handle Texinfo files.
+%
+% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+%
+\def\texinfoversion{2003-05-04.08}
+%
+% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
+% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+%
+% This texinfo.tex file is free software; you can redistribute it and/or
+% modify it under the terms of the GNU General Public License as
+% published by the Free Software Foundation; either version 2, or (at
+% your option) any later version.
+%
+% This texinfo.tex file is distributed in the hope that it will be
+% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this texinfo.tex file; see the file COPYING. If not, write
+% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+% Boston, MA 02111-1307, USA.
+%
+% In other words, you are welcome to use, share and improve this program.
+% You are forbidden to forbid anyone else to use, share and improve
+% what you give them. Help stamp out software-hoarding!
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+% ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex
+% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
+% 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 GNU Texinfo home page is http://www.gnu.org/software/texinfo.
+%
+% The texinfo.tex in any given Texinfo distribution could well be out
+% of date, so if that's what you're using, please check.
+%
+% Send bug reports to bug-texinfo@gnu.org. Please include including a
+% complete document in each bug report with which we can reproduce the
+% problem. Patches are, of course, greatly appreciated.
+%
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution. For a simple
+% manual foo.texi, however, you can get away with this:
+% tex foo.texi
+% texindex foo.??
+% tex foo.texi
+% tex foo.texi
+% dvips foo.dvi -o # or whatever; 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, to some
+% extent. You can get the existing language-specific files from the
+% full Texinfo distribution.
-% This automatically updates the version number based on RCS.
-\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
-\deftexinfoversion$Revision: 1.1.1.1 $
-\message{Loading texinfo package [Version \texinfoversion]:}
+\message{Loading texinfo [version \texinfoversion]:}
% If in a .fmt file, print the version number
% and turn on active characters that we couldn't do earlier because
% they might have appeared in the input file name.
-\everyjob{\message{[Texinfo version \texinfoversion]}\message{}
+\everyjob{\message{[Texinfo version \texinfoversion]}%
\catcode`+=\active \catcode`\_=\active}
-% Save some parts of plain tex whose names we will redefine.
+\message{Basics,}
+\chardef\other=12
+
+% We never want plain's \outer definition of \+ in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
+% Save some plain tex macros whose names we will redefine.
\let\ptexb=\b
\let\ptexbullet=\bullet
\let\ptexc=\c
@@ -54,99 +83,162 @@
\let\ptexdot=\.
\let\ptexdots=\dots
\let\ptexend=\end
-\let\ptexequiv = \equiv
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
+\let\ptexgtr=>
+\let\ptexhat=^
\let\ptexi=\i
+\let\ptexindent=\indent
\let\ptexlbrace=\{
+\let\ptexless=<
+\let\ptexplus=+
\let\ptexrbrace=\}
+\let\ptexslash=\/
\let\ptexstar=\*
\let\ptext=\t
-\let\ptextilde=\~
-
-% Be sure we're in horizontal mode when doing a tie, since we make space
-% equivalent to this in @example-like environments. Otherwise, a space
-% at the beginning of a line will start with \penalty -- and
-% since \penalty is valid in vertical mode, we'd end up putting the
-% penalty on the vertical list instead of in the new paragraph.
-{\catcode`@ = 11
- % Avoid using \@M directly, because that causes trouble
- % if the definition is written into an index file.
- \global\let\tiepenalty = \@M
- \gdef\tie{\leavevmode\penalty\tiepenalty\ }
-}
-\let\~ = \tie % And make it available as @~.
-
-
-\message{Basics,}
-\chardef\other=12
% If this character appears in an error message or help string, it
% starts a new line in the output.
\newlinechar = `^^J
-% Set up fixed words for English.
-\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi%
-\def\putwordInfo{Info}%
-\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi%
-\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi%
-\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi%
-\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi%
-\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi%
-\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi%
-\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi%
-\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi%
-\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi%
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
+\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
+\ifx\putwordin\undefined \gdef\putwordin{in}\fi
+\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
+\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
+\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
+\ifx\putwordof\undefined \gdef\putwordof{of}\fi
+\ifx\putwordon\undefined \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
+\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
+\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
+%
+\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
+\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
+\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
+\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
+\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
+\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
+\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
+\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
+\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
+\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
+\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
+\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
+%
+\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
+\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
+\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
+\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
+\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi
+\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
+\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
+
+% In some macros, we cannot use the `\? notation---the left quote is
+% in some cases the escape char.
+\chardef\colonChar = `\:
+\chardef\commaChar = `\,
+\chardef\dotChar = `\.
+\chardef\equalChar = `\=
+\chardef\exclamChar= `\!
+\chardef\questChar = `\?
+\chardef\semiChar = `\;
+\chardef\spaceChar = `\ %
+\chardef\underChar = `\_
% Ignore a token.
%
\def\gobble#1{}
+% True if #1 is the empty string, i.e., called like `\ifempty{}'.
+%
+\def\ifempty#1{\ifemptyx #1\emptymarkA\emptymarkB}%
+\def\ifemptyx#1#2\emptymarkB{\ifx #1\emptymarkA}%
+
+% Hyphenation fixes.
\hyphenation{ap-pen-dix}
-\hyphenation{mini-buf-fer mini-buf-fers}
\hyphenation{eshell}
+\hyphenation{mini-buf-fer mini-buf-fers}
+\hyphenation{time-stamp}
+\hyphenation{white-space}
% Margin to add to right of even pages, to left of odd pages.
-\newdimen \bindingoffset
-\newdimen \normaloffset
+\newdimen\bindingoffset
+\newdimen\normaloffset
\newdimen\pagewidth \newdimen\pageheight
% Sometimes it is convenient to have everything in the transcript file
% and nothing on the terminal. We don't just call \tracingall here,
-% since that produces some useless output on the terminal.
+% since that produces some useless output on the terminal. We also make
+% some effort to order the tracing commands to reduce output in the log
+% file; cf. trace.sty in LaTeX.
%
\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
-\def\loggingall{\tracingcommands2 \tracingstats2
- \tracingpages1 \tracingoutput1 \tracinglostchars1
- \tracingmacros2 \tracingparagraphs1 \tracingrestores1
- \showboxbreadth\maxdimen\showboxdepth\maxdimen
+\def\loggingall{%
+ \tracingstats2
+ \tracingpages1
+ \tracinglostchars2 % 2 gives us more in etex
+ \tracingparagraphs1
+ \tracingoutput1
+ \tracingmacros2
+ \tracingrestores1
+ \showboxbreadth\maxdimen \showboxdepth\maxdimen
+ \ifx\eTeXversion\undefined\else % etex gives us more logging
+ \tracingscantokens1
+ \tracingifs1
+ \tracinggroups1
+ \tracingnesting2
+ \tracingassigns1
+ \fi
+ \tracingcommands3 % 3 gives us more in etex
+ \errorcontextlines\maxdimen
}%
-%---------------------Begin change-----------------------
+% 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.
%
-%%%% For @cropmarks command.
-% Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
+\newif\ifcropmarks
+\let\cropmarks = \cropmarkstrue
%
-\newdimen\cornerlong \newdimen\cornerthick
-\newdimen \topandbottommargin
-\newdimen \outerhsize \newdimen \outervsize
-\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
-\outerhsize=7in
-%\outervsize=9.5in
-% Alternative @smallbook page size is 9.25in
-\outervsize=9.25in
-\topandbottommargin=.75in
+% Dimensions to add cropmarks at corners.
+% Added by P. A. MacKay, 12 Nov. 1986
%
-%---------------------End change-----------------------
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
% Main output routine.
\chardef\PAGE = 255
\output = {\onepageout{\pagecontents\PAGE}}
-\newbox\headlinebox \newbox\footlinebox
+\newbox\headlinebox
+\newbox\footlinebox
% \onepageout takes a vbox as an argument. Note that \pagecontents
% does insertions, but you have to call it yourself.
\def\onepageout#1{%
- \hoffset=\normaloffset
+ \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+ %
\ifodd\pageno \advance\hoffset by \bindingoffset
\else \advance\hoffset by -\bindingoffset\fi
%
@@ -165,53 +257,60 @@
\normalturnoffactive % \ in index entries must not stay \, e.g., if
% the page break happens to be in the middle of an example.
\shipout\vbox{%
+ % Do this early so pdf references go to the beginning of the page.
+ \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi
+ %
+ \ifcropmarks \vbox to \outervsize\bgroup
+ \hsize = \outerhsize
+ \vskip-\topandbottommargin
+ \vtop to0pt{%
+ \line{\ewtop\hfil\ewtop}%
+ \nointerlineskip
+ \line{%
+ \vbox{\moveleft\cornerthick\nstop}%
+ \hfill
+ \vbox{\moveright\cornerthick\nstop}%
+ }%
+ \vss}%
+ \vskip\topandbottommargin
+ \line\bgroup
+ \hfil % center the page within the outer (page) hsize.
+ \ifodd\pageno\hskip\bindingoffset\fi
+ \vbox\bgroup
+ \fi
+ %
\unvbox\headlinebox
\pagebody{#1}%
- \unvbox\footlinebox
- }%
- }%
+ \ifdim\ht\footlinebox > 0pt
+ % Only leave this space if the footline is nonempty.
+ % (We lessened \vsize for it in \oddfootingxxx.)
+ % The \baselineskip=24pt in plain's \makefootline has no effect.
+ \vskip 2\baselineskip
+ \unvbox\footlinebox
+ \fi
+ %
+ \ifcropmarks
+ \egroup % end of \vbox\bgroup
+ \hfil\egroup % end of (centering) \line\bgroup
+ \vskip\topandbottommargin plus1fill minus1fill
+ \boxmaxdepth = \cornerthick
+ \vbox to0pt{\vss
+ \line{%
+ \vbox{\moveleft\cornerthick\nsbot}%
+ \hfill
+ \vbox{\moveright\cornerthick\nsbot}%
+ }%
+ \nointerlineskip
+ \line{\ewbot\hfil\ewbot}%
+ }%
+ \egroup % \vbox from first cropmarks clause
+ \fi
+ }% end of \shipout\vbox
+ }% end of group with \normalturnoffactive
\advancepageno
\ifnum\outputpenalty>-20000 \else\dosupereject\fi
}
-%%%% For @cropmarks command %%%%
-
-% Here is a modification of the main output routine for Near East Publications
-% This provides right-angle cropmarks at all four corners.
-% The contents of the page are centerlined into the cropmarks,
-% and any desired binding offset is added as an \hskip on either
-% site of the centerlined box. (P. A. MacKay, 12 November, 1986)
-%
-\def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
-{\escapechar=`\\\relax % makes sure backslash is used in output files.
- \shipout
- \vbox to \outervsize{\hsize=\outerhsize
- \vbox{\line{\ewtop\hfill\ewtop}}
- \nointerlineskip
- \line{\vbox{\moveleft\cornerthick\nstop}
- \hfill
- \vbox{\moveright\cornerthick\nstop}}
- \vskip \topandbottommargin
- \centerline{\ifodd\pageno\hskip\bindingoffset\fi
- \vbox{
- {\let\hsize=\pagewidth \makeheadline}
- \pagebody{#1}
- {\let\hsize=\pagewidth \makefootline}}
- \ifodd\pageno\else\hskip\bindingoffset\fi}
- \vskip \topandbottommargin plus1fill minus1fill
- \boxmaxdepth\cornerthick
- \line{\vbox{\moveleft\cornerthick\nsbot}
- \hfill
- \vbox{\moveright\cornerthick\nsbot}}
- \nointerlineskip
- \vbox{\line{\ewbot\hfill\ewbot}}
- }}
- \advancepageno
- \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
-%
-% Do @cropmarks to get crop marks
-\def\cropmarks{\let\onepageout=\croppageout }
-
\newinsert\margin \dimen\margin=\maxdimen
\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
@@ -225,7 +324,6 @@
\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
}
-%
% Here are the rules for the cropmarks. Note that they are
% offset so that the space between them is truly \outerhsize or \outervsize
% (P. A. MacKay, 12 November, 1986)
@@ -320,11 +418,11 @@
%% Call \inENV within environments (after a \begingroup)
\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
\def\ENVcheck{%
-\ifENV\errmessage{Still within an environment. Type Return to continue.}
+\ifENV\errmessage{Still within an environment; press RETURN to continue}
\endgroup\fi} % This is not perfect, but it should reduce lossage
% @begin foo is the same as @foo, for now.
-\newhelp\EMsimple{Type <Return> to continue.}
+\newhelp\EMsimple{Press RETURN to continue.}
\outer\def\begin{\parsearg\beginxxx}
@@ -368,22 +466,11 @@
}
-% Single-spacing is done by various environments (specifically, in
-% \nonfillstart and \quotations).
-\newskip\singlespaceskip \singlespaceskip = 12.5pt
-\def\singlespace{%
- % Why was this kern here? It messes up equalizing space above and below
- % environments. --karl, 6may93
- %{\advance \baselineskip by -\singlespaceskip
- %\kern \baselineskip}%
- \setleading \singlespaceskip
-}
-
%% Simple single-character @ commands
% @@ prints an @
% Kludge this until the fonts are right (grr).
-\def\@{{\tt \char '100}}
+\def\@{{\tt\char64}}
% This is turned off because it was never documented
% and you can use @w{...} around a quote to suppress ligatures.
@@ -393,21 +480,24 @@
%\def\'{{'}}
% Used to generate quoted braces.
-\def\mylbrace {{\tt \char '173}}
-\def\myrbrace {{\tt \char '175}}
+\def\mylbrace {{\tt\char123}}
+\def\myrbrace {{\tt\char125}}
\let\{=\mylbrace
\let\}=\myrbrace
\begingroup
- % Definitions to produce actual \{ & \} command in an index.
- \catcode`\{ = 12 \catcode`\} = 12
+ % Definitions to produce \{ and \} commands for indices,
+ % and @{ and @} for the aux file.
+ \catcode`\{ = \other \catcode`\} = \other
\catcode`\[ = 1 \catcode`\] = 2
- \catcode`\@ = 0 \catcode`\\ = 12
- @gdef@lbracecmd[\{]%
- @gdef@rbracecmd[\}]%
-@endgroup
+ \catcode`\! = 0 \catcode`\\ = \other
+ !gdef!lbracecmd[\{]%
+ !gdef!rbracecmd[\}]%
+ !gdef!lbraceatcmd[@{]%
+ !gdef!rbraceatcmd[@}]%
+!endgroup
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
-% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
\let\, = \c
\let\dotaccent = \.
\def\ringaccent#1{{\accent23 #1}}
@@ -416,7 +506,7 @@
\let\udotaccent = \d
% Other special characters: @questiondown @exclamdown
-% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
+% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
\def\questiondown{?`}
\def\exclamdown{!`}
@@ -431,23 +521,35 @@
\fi\fi
}
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
% @: forces normal size whitespace following.
\def\:{\spacefactor=1000 }
% @* forces a line break.
\def\*{\hfil\break\hbox{}\ignorespaces}
+% @/ allows a line break.
+\let\/=\allowbreak
+
% @. is an end-of-sentence period.
\def\.{.\spacefactor=3000 }
-% @enddots{} is an end-of-sentence ellipsis.
-\gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000}
-
% @! is an end-of-sentence bang.
-\gdef\!{!\spacefactor=3000 }
+\def\!{!\spacefactor=3000 }
% @? is an end-of-sentence query.
-\gdef\?{?\spacefactor=3000 }
+\def\?{?\spacefactor=3000 }
% @w prevents a word break. Without the \leavevmode, @w at the
% beginning of a paragraph, when TeX is still in vertical mode, would
@@ -462,6 +564,16 @@
% therefore, no glue is inserted, and the space between the headline and
% the text is small, which looks bad.
%
+% Another complication is that the group might be very large. This can
+% cause the glue on the previous page to be unduly stretched, because it
+% does not have much material. In this case, it's better to add an
+% explicit \vfill so that the extra space is at the bottom. The
+% threshold for doing this is if the group is more than \vfilllimit
+% percent of a page (\vfilllimit can be changed inside of @tex).
+%
+\newbox\groupbox
+\def\vfilllimit{0.7}
+%
\def\group{\begingroup
\ifnum\catcode13=\active \else
\errhelp = \groupinvalidhelp
@@ -475,10 +587,22 @@
% above. But it's pretty close.
\def\Egroup{%
\egroup % End the \vtop.
+ % \dimen0 is the vertical size of the group's box.
+ \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
+ % \dimen2 is how much space is left on the page (more or less).
+ \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
+ % if the group doesn't fit on the current page, and it's a big big
+ % group, force a page break.
+ \ifdim \dimen0 > \dimen2
+ \ifdim \pagetotal < \vfilllimit\pageheight
+ \page
+ \fi
+ \fi
+ \copy\groupbox
\endgroup % End the \group.
}%
%
- \vtop\bgroup
+ \setbox\groupbox = \vtop\bgroup
% We have to put a strut on the last line in case the @group is in
% the midst of an example, rather than completely enclosing it.
% Otherwise, the interline space between the last line of the group
@@ -531,53 +655,80 @@ where each line of input produces a line of output.}
%% This method tries to make TeX break the page naturally
%% if the depth of the box does not fit.
%{\baselineskip=0pt%
-%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
+%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
%\prevdepth=-1000pt
%}}
\def\needx#1{%
- % Go into vertical mode, so we don't make a big box in the middle of a
+ % Ensure vertical mode, so we don't make a big box in the middle of a
% paragraph.
\par
%
- % Don't add any leading before our big empty box, but allow a page
- % break, since the best break might be right here.
- \allowbreak
- \nointerlineskip
- \vtop to #1\mil{\vfil}%
- %
- % TeX does not even consider page breaks if a penalty added to the
- % main vertical list is 10000 or more. But in order to see if the
- % empty box we just added fits on the page, we must make it consider
- % page breaks. On the other hand, we don't want to actually break the
- % page after the empty box. So we use a penalty of 9999.
- %
- % There is an extremely small chance that TeX will actually break the
- % page at this \penalty, if there are no other feasible breakpoints in
- % sight. (If the user is using lots of big @group commands, which
- % almost-but-not-quite fill up a page, TeX will have a hard time doing
- % good page breaking, for example.) However, I could not construct an
- % example where a page broke at this \penalty; if it happens in a real
- % document, then we can reconsider our strategy.
- \penalty9999
- %
- % Back up by the size of the box, whether we did a page break or not.
- \kern -#1\mil
- %
- % Do not allow a page break right after this kern.
- \nobreak
+ % If the @need value is less than one line space, it's useless.
+ \dimen0 = #1\mil
+ \dimen2 = \ht\strutbox
+ \advance\dimen2 by \dp\strutbox
+ \ifdim\dimen0 > \dimen2
+ %
+ % Do a \strut just to make the height of this box be normal, so the
+ % normal leading is inserted relative to the preceding line.
+ % And a page break here is fine.
+ \vtop to #1\mil{\strut\vfil}%
+ %
+ % TeX does not even consider page breaks if a penalty added to the
+ % main vertical list is 10000 or more. But in order to see if the
+ % empty box we just added fits on the page, we must make it consider
+ % page breaks. On the other hand, we don't want to actually break the
+ % page after the empty box. So we use a penalty of 9999.
+ %
+ % There is an extremely small chance that TeX will actually break the
+ % page at this \penalty, if there are no other feasible breakpoints in
+ % sight. (If the user is using lots of big @group commands, which
+ % almost-but-not-quite fill up a page, TeX will have a hard time doing
+ % good page breaking, for example.) However, I could not construct an
+ % example where a page broke at this \penalty; if it happens in a real
+ % document, then we can reconsider our strategy.
+ \penalty9999
+ %
+ % Back up by the size of the box, whether we did a page break or not.
+ \kern -#1\mil
+ %
+ % Do not allow a page break right after this kern.
+ \nobreak
+ \fi
}
% @br forces paragraph break
\let\br = \par
-% @dots{} output some dots
-
-\def\dots{$\ldots$}
+% @dots{} output an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in a typewriter
+% font as three actual period characters.
+%
+\def\dots{%
+ \leavevmode
+ \hbox to 1.5em{%
+ \hskip 0pt plus 0.25fil minus 0.25fil
+ .\hss.\hss.%
+ \hskip 0pt plus 0.5fil minus 0.5fil
+ }%
+}
-% @page forces the start of a new page
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+ \leavevmode
+ \hbox to 2em{%
+ \hskip 0pt plus 0.25fil minus 0.25fil
+ .\hss.\hss.\hss.%
+ \hskip 0pt plus 0.5fil minus 0.5fil
+ }%
+ \spacefactor=3000
+}
+% @page forces the start of a new page.
+%
\def\page{\par\vfill\supereject}
% @exdent text....
@@ -596,44 +747,88 @@ where each line of input produces a line of output.}
\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
\leftline{\hskip\leftskip{\rm#1}}}}
-% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
-
-\def\inmargin#1{%
-\strut\vadjust{\nobreak\kern-\strutdepth
- \vtop to \strutdepth{\baselineskip\strutdepth\vss
- \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
+% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
+% paragraph. For more general purposes, use the \margin insertion
+% class. WHICH is `l' or `r'.
+%
\newskip\inmarginspacing \inmarginspacing=1cm
\def\strutdepth{\dp\strutbox}
-
-%\hbox{{\rm#1}}\hfil\break}}
+%
+\def\doinmargin#1#2{\strut\vadjust{%
+ \nobreak
+ \kern-\strutdepth
+ \vtop to \strutdepth{%
+ \baselineskip=\strutdepth
+ \vss
+ % if you have multiple lines of stuff to put here, you'll need to
+ % make the vbox yourself of the appropriate size.
+ \ifx#1l%
+ \llap{\ignorespaces #2\hskip\inmarginspacing}%
+ \else
+ \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
+ \fi
+ \null
+ }%
+}}
+\def\inleftmargin{\doinmargin l}
+\def\inrightmargin{\doinmargin r}
+%
+% @inmargin{TEXT [, RIGHT-TEXT]}
+% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
+% else use TEXT for both).
+%
+\def\inmargin#1{\parseinmargin #1,,\finish}
+\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \def\lefttext{#1}% have both texts
+ \def\righttext{#2}%
+ \else
+ \def\lefttext{#1}% have only one text
+ \def\righttext{#1}%
+ \fi
+ %
+ \ifodd\pageno
+ \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
+ \else
+ \def\temp{\inleftmargin\lefttext}%
+ \fi
+ \temp
+}
% @include file insert text of that file as input.
% Allow normal characters that we make active in the argument (a file name).
\def\include{\begingroup
- \catcode`\\=12
- \catcode`~=12
- \catcode`^=12
- \catcode`_=12
- \catcode`|=12
- \catcode`<=12
- \catcode`>=12
- \catcode`+=12
+ \catcode`\\=\other
+ \catcode`~=\other
+ \catcode`^=\other
+ \catcode`_=\other
+ \catcode`|=\other
+ \catcode`<=\other
+ \catcode`>=\other
+ \catcode`+=\other
\parsearg\includezzz}
% Restore active chars for included file.
\def\includezzz#1{\endgroup\begingroup
% Read the included file in a group so nested @include's work.
\def\thisfile{#1}%
+ \let\value=\expandablevalue
\input\thisfile
\endgroup}
\def\thisfile{}
-% @center line outputs that line, centered
-
-\def\center{\parsearg\centerzzz}
-\def\centerzzz #1{{\advance\hsize by -\leftskip
-\advance\hsize by -\rightskip
-\centerline{#1}}}
+% @center line
+% outputs that line, centered.
+%
+\def\center{\parsearg\docenter}
+\def\docenter#1{{%
+ \ifhmode \hfil\break \fi
+ \advance\hsize by -\leftskip
+ \advance\hsize by -\rightskip
+ \line{\hfil \ignorespaces#1\unskip \hfil}%
+ \ifhmode \break \fi
+}}
% @sp n outputs n lines of vertical space
@@ -644,401 +839,389 @@ where each line of input produces a line of output.}
% @c is the same as @comment
% @ignore ... @end ignore is another way to write a comment
-\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
-\parsearg \commentxxx}
-
-\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
+\def\comment{\begingroup \catcode`\^^M=\other%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\commentxxx}
+{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
\let\c=\comment
-% @paragraphindent is defined for the Info formatting commands only.
-\let\paragraphindent=\comment
-
-% Prevent errors for section commands.
-% Used in @ignore and in failing conditionals.
-\def\ignoresections{%
-\let\chapter=\relax
-\let\unnumbered=\relax
-\let\top=\relax
-\let\unnumberedsec=\relax
-\let\unnumberedsection=\relax
-\let\unnumberedsubsec=\relax
-\let\unnumberedsubsection=\relax
-\let\unnumberedsubsubsec=\relax
-\let\unnumberedsubsubsection=\relax
-\let\section=\relax
-\let\subsec=\relax
-\let\subsubsec=\relax
-\let\subsection=\relax
-\let\subsubsection=\relax
-\let\appendix=\relax
-\let\appendixsec=\relax
-\let\appendixsection=\relax
-\let\appendixsubsec=\relax
-\let\appendixsubsection=\relax
-\let\appendixsubsubsec=\relax
-\let\appendixsubsubsection=\relax
-\let\contents=\relax
-\let\smallbook=\relax
-\let\titlepage=\relax
-}
-
-% Used in nested conditionals, where we have to parse the Texinfo source
-% and so want to turn off most commands, in case they are used
-% incorrectly.
-%
-\def\ignoremorecommands{%
- \let\defcodeindex = \relax
- \let\defcv = \relax
- \let\deffn = \relax
- \let\deffnx = \relax
- \let\defindex = \relax
- \let\defivar = \relax
- \let\defmac = \relax
- \let\defmethod = \relax
- \let\defop = \relax
- \let\defopt = \relax
- \let\defspec = \relax
- \let\deftp = \relax
- \let\deftypefn = \relax
- \let\deftypefun = \relax
- \let\deftypevar = \relax
- \let\deftypevr = \relax
- \let\defun = \relax
- \let\defvar = \relax
- \let\defvr = \relax
- \let\ref = \relax
- \let\xref = \relax
- \let\printindex = \relax
- \let\pxref = \relax
- \let\settitle = \relax
- \let\setchapternewpage = \relax
- \let\setchapterstyle = \relax
- \let\everyheading = \relax
- \let\evenheading = \relax
- \let\oddheading = \relax
- \let\everyfooting = \relax
- \let\evenfooting = \relax
- \let\oddfooting = \relax
- \let\headings = \relax
- \let\include = \relax
- \let\lowersections = \relax
- \let\down = \relax
- \let\raisesections = \relax
- \let\up = \relax
- \let\set = \relax
- \let\clear = \relax
- \let\item = \relax
-}
-
-% Ignore @ignore ... @end ignore.
-%
-\def\ignore{\doignore{ignore}}
-
-% Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text.
-%
-\def\ifinfo{\doignore{ifinfo}}
-\def\ifhtml{\doignore{ifhtml}}
-\def\html{\doignore{html}}
-\def\menu{\doignore{menu}}
-\def\direntry{\doignore{direntry}}
-
-% Also ignore @macro ... @end macro. The user must run texi2dvi,
-% which runs makeinfo to do macro expansion. Ignore @unmacro, too.
-\def\macro{\doignore{macro}}
-\let\unmacro = \comment
-
-
-% @dircategory CATEGORY -- specify a category of the dir file
-% which this file should belong to. Ignore this in TeX.
-\let\dircategory = \comment
-
-% Ignore text until a line `@end #1'.
+% @paragraphindent NCHARS
+% We'll use ems for NCHARS, close enough.
+% NCHARS can also be the word `asis' or `none'.
+% We cannot feasibly implement @paragraphindent asis, though.
%
-\def\doignore#1{\begingroup
- % Don't complain about control sequences we have declared \outer.
- \ignoresections
- %
- % Define a command to swallow text until we reach `@end #1'.
- \long\def\doignoretext##1\end #1{\enddoignore}%
- %
- % Make sure that spaces turn into tokens that match what \doignoretext wants.
- \catcode32 = 10
- %
- % And now expand that command.
- \doignoretext
-}
-
-% What we do to finish off ignored text.
+\def\asisword{asis} % no translation, these are keywords
+\def\noneword{none}
%
-\def\enddoignore{\endgroup\ignorespaces}%
-
-\newif\ifwarnedobs\warnedobsfalse
-\def\obstexwarn{%
- \ifwarnedobs\relax\else
- % We need to warn folks that they may have trouble with TeX 3.0.
- % This uses \immediate\write16 rather than \message to get newlines.
- \immediate\write16{}
- \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
- \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
- \immediate\write16{If you are running another version of TeX, relax.}
- \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
- \immediate\write16{ Then upgrade your TeX installation if you can.}
- \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)}
- \immediate\write16{If you are stuck with version 3.0, run the}
- \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
- \immediate\write16{ to use a workaround.}
- \immediate\write16{}
- \global\warnedobstrue
+\def\paragraphindent{\parsearg\doparagraphindent}
+\def\doparagraphindent#1{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \defaultparindent = 0pt
+ \else
+ \defaultparindent = #1em
\fi
+ \fi
+ \parindent = \defaultparindent
}
-% **In TeX 3.0, setting text in \nullfont hangs tex. For a
-% workaround (which requires the file ``dummy.tfm'' to be installed),
-% uncomment the following line:
-%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
-
-% Ignore text, except that we keep track of conditional commands for
-% purposes of nesting, up to an `@end #1' command.
-%
-\def\nestedignore#1{%
- \obstexwarn
- % We must actually expand the ignored text to look for the @end
- % command, so that nested ignore constructs work. Thus, we put the
- % text into a \vbox and then do nothing with the result. To minimize
- % the change of memory overflow, we follow the approach outlined on
- % page 401 of the TeXbook: make the current font be a dummy font.
- %
- \setbox0 = \vbox\bgroup
- % Don't complain about control sequences we have declared \outer.
- \ignoresections
- %
- % Define `@end #1' to end the box, which will in turn undefine the
- % @end command again.
- \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
- %
- % We are going to be parsing Texinfo commands. Most cause no
- % trouble when they are used incorrectly, but some commands do
- % complicated argument parsing or otherwise get confused, so we
- % undefine them.
- %
- % We can't do anything about stray @-signs, unfortunately;
- % they'll produce `undefined control sequence' errors.
- \ignoremorecommands
- %
- % Set the current font to be \nullfont, a TeX primitive, and define
- % all the font commands to also use \nullfont. We don't use
- % dummy.tfm, as suggested in the TeXbook, because not all sites
- % might have that installed. Therefore, math mode will still
- % produce output, but that should be an extremely small amount of
- % stuff compared to the main input.
- %
- \nullfont
- \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont
- \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont
- \let\tensf = \nullfont
- % Similarly for index fonts (mostly for their use in
- % smallexample)
- \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont
- \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont
- \let\indsf = \nullfont
- %
- % Don't complain when characters are missing from the fonts.
- \tracinglostchars = 0
- %
- % Don't bother to do space factor calculations.
- \frenchspacing
- %
- % Don't report underfull hboxes.
- \hbadness = 10000
- %
- % Do minimal line-breaking.
- \pretolerance = 10000
- %
- % Do not execute instructions in @tex
- \def\tex{\doignore{tex}}
-}
-
-% @set VAR sets the variable VAR to an empty value.
-% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
-%
-% Since we want to separate VAR from REST-OF-LINE (which might be
-% empty), we can't just use \parsearg; we have to insert a space of our
-% own to delimit the rest of the line, and then take it out again if we
-% didn't need it. Make sure the catcode of space is correct to avoid
-% losing inside @example, for instance.
-%
-\def\set{\begingroup\catcode` =10
- \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
- \parsearg\setxxx}
-\def\setxxx#1{\setyyy#1 \endsetyyy}
-\def\setyyy#1 #2\endsetyyy{%
- \def\temp{#2}%
- \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
- \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
+% @exampleindent NCHARS
+% We'll use ems for NCHARS like @paragraphindent.
+% It seems @exampleindent asis isn't necessary, but
+% I preserve it to make it similar to @paragraphindent.
+\def\exampleindent{\parsearg\doexampleindent}
+\def\doexampleindent#1{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \lispnarrowing = 0pt
+ \else
+ \lispnarrowing = #1em
+ \fi
\fi
- \endgroup
}
-% Can't use \xdef to pre-expand #2 and save some time, since \temp or
-% \next or other control sequences that we've defined might get us into
-% an infinite loop. Consider `@set foo @cite{bar}'.
-\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
-% @clear VAR clears (i.e., unsets) the variable VAR.
+% @firstparagraphindent WORD
+% If WORD is `none', then suppress indentation of the first paragraph
+% after a section heading. If WORD is `insert', then do indentat such
+% paragraphs.
%
-\def\clear{\parsearg\clearxxx}
-\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
-
-% @value{foo} gets the text saved in variable foo.
+% The paragraph indentation is suppressed or not by calling
+% \suppressfirstparagraphindent, which the sectioning commands do. We
+% switch the definition of this back and forth according to WORD. By
+% default, we suppress indentation.
%
-\def\value{\begingroup
- \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
- \valuexxx}
-\def\valuexxx#1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- {\{No value for ``#1''\}}%
- \else
- \csname SET#1\endcsname
- \fi
-\endgroup}
-
-% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
-% with @set.
+\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
+\newdimen\currentparindent
%
-\def\ifset{\parsearg\ifsetxxx}
-\def\ifsetxxx #1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifsetfail
- \else
- \expandafter\ifsetsucceed
- \fi
-}
-\def\ifsetsucceed{\conditionalsucceed{ifset}}
-\def\ifsetfail{\nestedignore{ifset}}
-\defineunmatchedend{ifset}
-
-% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
-% defined with @set, or has been undefined with @clear.
+\def\insertword{insert}
%
-\def\ifclear{\parsearg\ifclearxxx}
-\def\ifclearxxx #1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifclearsucceed
+\def\firstparagraphindent{\parsearg\dofirstparagraphindent}
+\def\dofirstparagraphindent#1{%
+ \def\temp{#1}%
+ \ifx\temp\noneword
+ \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
+ \else\ifx\temp\insertword
+ \let\suppressfirstparagraphindent = \relax
\else
- \expandafter\ifclearfail
- \fi
+ \errhelp = \EMsimple
+ \errmessage{Unknown @firstparagraphindent option `\temp'}%
+ \fi\fi
}
-\def\ifclearsucceed{\conditionalsucceed{ifclear}}
-\def\ifclearfail{\nestedignore{ifclear}}
-\defineunmatchedend{ifclear}
-% @iftex always succeeds; we read the text following, through @end
-% iftex). But `@end iftex' should be valid only after an @iftex.
+% Here is how we actually suppress indentation. Redefine \everypar to
+% \kern backwards by \parindent, and then reset itself to empty.
%
-\def\iftex{\conditionalsucceed{iftex}}
-\defineunmatchedend{iftex}
-
-% We can't just want to start a group at @iftex (for example) and end it
-% at @end iftex, since then @set commands inside the conditional have no
-% effect (they'd get reverted at the end of the group). So we must
-% define \Eiftex to redefine itself to be its previous value. (We can't
-% just define it to fail again with an ``unmatched end'' error, since
-% the @ifset might be nested.)
-%
-\def\conditionalsucceed#1{%
- \edef\temp{%
- % Remember the current value of \E#1.
- \let\nece{prevE#1} = \nece{E#1}%
- %
- % At the `@end #1', redefine \E#1 to be its previous value.
- \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
+% We also make \indent itself not actually do anything until the next
+% paragraph.
+%
+\gdef\dosuppressfirstparagraphindent{%
+ \gdef\indent{%
+ \global\let\indent=\ptexindent
+ \global\everypar = {}%
}%
- \temp
-}
+ \global\everypar = {%
+ \kern-\parindent
+ \global\let\indent=\ptexindent
+ \global\everypar = {}%
+ }%
+}%
-% We need to expand lots of \csname's, but we don't want to expand the
-% control sequences after we've constructed them.
-%
-\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
% @asis just yields its argument. Used with @table, for example.
%
\def\asis#1{#1}
-% @math means output in math mode.
-% We don't use $'s directly in the definition of \math because control
-% sequences like \math are expanded when the toc file is written. Then,
-% we read the toc file back, the $'s will be normal characters (as they
-% should be, according to the definition of Texinfo). So we must use a
-% control sequence to switch into and out of math mode.
+% @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.
%
-% This isn't quite enough for @math to work properly in indices, but it
-% seems unlikely it will ever be needed there.
+\let\implicitmath = $%$ font-lock fix
%
-\let\implicitmath = $
-\def\math#1{\implicitmath #1\implicitmath}
+% One complication: _ usually means subscripts, but it could also mean
+% an actual _ character, as in @math{@var{some_variable} + 1}. So make
+% _ within @math be active (mathcode "8000), and distinguish by seeing
+% if the current family is \slfam, which is what @var uses.
+%
+{\catcode\underChar = \active
+\gdef\mathunderscore{%
+ \catcode\underChar=\active
+ \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
+}}
+%
+% Another complication: we want \\ (and @\) to output a \ character.
+% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
+% this is not advertised and we don't care. Texinfo does not
+% otherwise define @\.
+%
+% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
+\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
+%
+\def\math{%
+ \tex
+ \mathcode`\_="8000 \mathunderscore
+ \let\\ = \mathbackslash
+ \mathactive
+ \implicitmath\finishmath}
+\def\finishmath#1{#1\implicitmath\Etex}
+
+% Some active characters (such as <) are spaced differently in math.
+% We have to reset their definitions in case the @math was an
+% argument to a command which set the catcodes (such as @item or @section).
+%
+{
+ \catcode`^ = \active
+ \catcode`< = \active
+ \catcode`> = \active
+ \catcode`+ = \active
+ \gdef\mathactive{%
+ \let^ = \ptexhat
+ \let< = \ptexless
+ \let> = \ptexgtr
+ \let+ = \ptexplus
+ }
+}
% @bullet and @minus need the same treatment as @math, just above.
\def\bullet{\implicitmath\ptexbullet\implicitmath}
\def\minus{\implicitmath-\implicitmath}
-\def\node{\ENVcheck\parsearg\nodezzz}
-\def\nodezzz#1{\nodexxx [#1,]}
-\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
-\let\nwnode=\node
-\let\lastnode=\relax
-
-\def\donoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\setref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
-\def\unnumbnoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
-\def\appendixnoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
% @refill is a no-op.
\let\refill=\relax
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
% @setfilename is done at the beginning of every texinfo file.
% So open here the files we need to have open while reading the input.
% This makes it possible to make a .fmt file for texinfo.
\def\setfilename{%
- \readauxfile
- \opencontents
+ \iflinks
+ \readauxfile
+ \fi % \openindices needs to do some work in any case.
\openindices
\fixbackslash % Turn off hack to swallow `\input texinfo'.
\global\let\setfilename=\comment % Ignore extra @setfilename cmds.
+ %
+ % If texinfo.cnf is present on the system, read it.
+ % Useful for site-wide @afourpaper, etc.
+ % Just to be on the safe side, close the input stream before the \input.
+ \openin 1 texinfo.cnf
+ \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
+ \closein1
+ \temp
+ %
\comment % Ignore the actual filename.
}
+% Called from \setfilename.
+%
+\def\openindices{%
+ \newindex{cp}%
+ \newcodeindex{fn}%
+ \newcodeindex{vr}%
+ \newcodeindex{tp}%
+ \newcodeindex{ky}%
+ \newcodeindex{pg}%
+}
+
% @bye.
\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
-% \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx}
-% \def\macroxxx#1#2 \end macro{%
-% \expandafter\gdef\macrotemp#1{#2}%
-% \endgroup}
-%\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx}
-%\def\linemacroxxx#1#2 \end linemacro{%
-%\let\parsearg=\relax
-%\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}%
-%\expandafter\xdef\macrotemp{\parsearg\macrotempx}%
-%\expandafter\gdef\macrotempx#1{#2}%
-%\endgroup}
-
-%\def\butfirst#1{}
+\message{pdf,}
+% adobe `portable' document format
+\newcount\tempnum
+\newcount\lnkcount
+\newtoks\filename
+\newcount\filenamelength
+\newcount\pgn
+\newtoks\toksA
+\newtoks\toksB
+\newtoks\toksC
+\newtoks\toksD
+\newbox\boxA
+\newcount\countA
+\newif\ifpdf
+\newif\ifpdfmakepagedest
+
+\ifx\pdfoutput\undefined
+ \pdffalse
+ \let\pdfmkdest = \gobble
+ \let\pdfurl = \gobble
+ \let\endlink = \relax
+ \let\linkcolor = \relax
+ \let\pdfmakeoutlines = \relax
+\else
+ \pdftrue
+ \pdfoutput = 1
+ \input pdfcolor
+ \def\dopdfimage#1#2#3{%
+ \def\imagewidth{#2}%
+ \def\imageheight{#3}%
+ % without \immediate, pdftex seg faults when the same image is
+ % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
+ \ifnum\pdftexversion < 14
+ \immediate\pdfimage
+ \else
+ \immediate\pdfximage
+ \fi
+ \ifx\empty\imagewidth\else width \imagewidth \fi
+ \ifx\empty\imageheight\else height \imageheight \fi
+ \ifnum\pdftexversion<13
+ #1.pdf%
+ \else
+ {#1.pdf}%
+ \fi
+ \ifnum\pdftexversion < 14 \else
+ \pdfrefximage \pdflastximage
+ \fi}
+ \def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}}
+ \def\pdfmkpgn#1{#1}
+ \let\linkcolor = \Blue % was Cyan, but that seems light?
+ \def\endlink{\Black\pdfendlink}
+ % Adding outlines to PDF; macros for calculating structure of outlines
+ % come from Petr Olsak
+ \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
+ \else \csname#1\endcsname \fi}
+ \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
+ \advance\tempnum by1
+ \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
+ \def\pdfmakeoutlines{{%
+ \openin 1 \jobname.toc
+ \ifeof 1\else\begingroup
+ \closein 1
+ % Thanh's hack / proper braces in bookmarks
+ \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
+ \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
+ %
+ \def\chapentry ##1##2##3{}
+ \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
+ \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
+ \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
+ \let\appendixentry = \chapentry
+ \let\unnumbchapentry = \chapentry
+ \let\unnumbsecentry = \secentry
+ \let\unnumbsubsecentry = \subsecentry
+ \let\unnumbsubsubsecentry = \subsubsecentry
+ \input \jobname.toc
+ \def\chapentry ##1##2##3{%
+ \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
+ \def\secentry ##1##2##3##4{%
+ \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
+ \def\subsecentry ##1##2##3##4##5{%
+ \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
+ \def\subsubsecentry ##1##2##3##4##5##6{%
+ \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
+ \let\appendixentry = \chapentry
+ \let\unnumbchapentry = \chapentry
+ \let\unnumbsecentry = \secentry
+ \let\unnumbsubsecentry = \subsecentry
+ \let\unnumbsubsubsecentry = \subsubsecentry
+ %
+ % Make special characters normal for writing to the pdf file.
+ %
+ \indexnofonts
+ \let\tt=\relax
+ \turnoffactive
+ \input \jobname.toc
+ \endgroup\fi
+ }}
+ \def\makelinks #1,{%
+ \def\params{#1}\def\E{END}%
+ \ifx\params\E
+ \let\nextmakelinks=\relax
+ \else
+ \let\nextmakelinks=\makelinks
+ \ifnum\lnkcount>0,\fi
+ \picknum{#1}%
+ \startlink attr{/Border [0 0 0]}
+ goto name{\pdfmkpgn{\the\pgn}}%
+ \linkcolor #1%
+ \advance\lnkcount by 1%
+ \endlink
+ \fi
+ \nextmakelinks
+ }
+ \def\picknum#1{\expandafter\pn#1}
+ \def\pn#1{%
+ \def\p{#1}%
+ \ifx\p\lbrace
+ \let\nextpn=\ppn
+ \else
+ \let\nextpn=\ppnn
+ \def\first{#1}
+ \fi
+ \nextpn
+ }
+ \def\ppn#1{\pgn=#1\gobble}
+ \def\ppnn{\pgn=\first}
+ \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+ \ifx\PP\D\let\nextsp\relax
+ \else\let\nextsp\skipspaces
+ \ifx\p\space\else\addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
+ \fi
+ \fi
+ \nextsp}
+ \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
+ \ifnum\pdftexversion < 14
+ \let \startlink \pdfannotlink
+ \else
+ \let \startlink \pdfstartlink
+ \fi
+ \def\pdfurl#1{%
+ \begingroup
+ \normalturnoffactive\def\@{@}%
+ \let\value=\expandablevalue
+ \leavevmode\Red
+ \startlink attr{/Border [0 0 0]}%
+ user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
+ % #1
+ \endgroup}
+ \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+ \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+ \def\maketoks{%
+ \expandafter\poptoks\the\toksA|ENDTOKS|
+ \ifx\first0\adn0
+ \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+ \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else
+ \ifnum0=\countA\else\makelink\fi
+ \ifx\first.\let\next=\done\else
+ \let\next=\maketoks
+ \addtokens{\toksB}{\the\toksD}
+ \ifx\first,\addtokens{\toksB}{\space}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \next}
+ \def\makelink{\addtokens{\toksB}%
+ {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+ \def\pdflink#1{%
+ \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
+ \linkcolor #1\endlink}
+ \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+\fi % \ifx\pdfoutput
\message{fonts,}
-
% Font-change commands.
-% Texinfo supports the sans serif font style, which plain TeX does not.
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
% So we set up a \sf analogous to plain's \rm, etc.
\newfam\sffam
\def\sf{\fam=\sffam \tensf}
@@ -1047,8 +1230,26 @@ where each line of input produces a line of output.}
% We don't need math for this one.
\def\ttsl{\tenttsl}
-%% Try out Computer Modern fonts at \magstephalf
-\let\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').
@@ -1078,17 +1279,21 @@ 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.
+ \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.
+% Instead of cmb10, you may want to use cmbx10.
% cmbx10 is a prettier font on its own, but cmb10
-% looks better when embedded in a line with cmr10.
+% looks better when embedded in a line with cmr10
+% (in Bob's opinion).
\setfont\textbf\bfshape{10}{\mainmagstep}
\setfont\textit\itshape{10}{\mainmagstep}
\setfont\textsl\slshape{10}{\mainmagstep}
@@ -1103,22 +1308,43 @@ where each line of input produces a line of output.}
\setfont\deftt\ttshape{10}{\magstep1}
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
-% Fonts for indices and small examples (9pt).
-% We actually use the slanted font rather than the italic,
-% because texinfo normally uses the slanted fonts for that.
-% Do not make many font distinctions in general in the index, since they
-% aren't very useful.
-\setfont\ninett\ttshape{9}{1000}
-\setfont\indrm\rmshape{9}{1000}
-\setfont\indit\slshape{9}{1000}
-\let\indsl=\indit
-\let\indtt=\ninett
-\let\indttsl=\ninett
-\let\indsf=\indrm
-\let\indbf=\indrm
-\setfont\indsc\scshape{10}{900}
-\font\indi=cmmi9
-\font\indsy=cmsy9
+% Fonts for indices, footnotes, small examples (9pt).
+\setfont\smallrm\rmshape{9}{1000}
+\setfont\smalltt\ttshape{9}{1000}
+\setfont\smallbf\bfshape{10}{900}
+\setfont\smallit\itshape{9}{1000}
+\setfont\smallsl\slshape{9}{1000}
+\setfont\smallsf\sfshape{9}{1000}
+\setfont\smallsc\scshape{10}{900}
+\setfont\smallttsl\ttslshape{10}{900}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+
+% Fonts for 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}
+\setfont\titlesl\slbshape{10}{\magstep4}
+\setfont\titlett\ttbshape{12}{\magstep3}
+\setfont\titlettsl\ttslshape{10}{\magstep4}
+\setfont\titlesf\sfbshape{17}{\magstep1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\authorrm{\secrm}
+\def\authortt{\sectt}
% Chapter (and unnumbered) fonts (17.28pt).
\setfont\chaprm\rmbshape{12}{\magstep2}
@@ -1126,7 +1352,7 @@ where each line of input produces a line of output.}
\setfont\chapsl\slbshape{10}{\magstep3}
\setfont\chaptt\ttbshape{12}{\magstep2}
\setfont\chapttsl\ttslshape{10}{\magstep3}
-\setfont\chapsf\sfbshape{12}{\magstep2}
+\setfont\chapsf\sfbshape{17}{1000}
\let\chapbf=\chaprm
\setfont\chapsc\scbshape{10}{\magstep3}
\font\chapi=cmmi12 scaled \magstep2
@@ -1144,51 +1370,32 @@ 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}
\setfont\ssecsl\slbshape{10}{1315}
\setfont\ssectt\ttbshape{12}{\magstephalf}
-\setfont\ssecttsl\ttslshape{10}{\magstep1}
+\setfont\ssecttsl\ttslshape{10}{1315}
\setfont\ssecsf\sfbshape{12}{\magstephalf}
\let\ssecbf\ssecrm
\setfont\ssecsc\scbshape{10}{\magstep1}
\font\sseci=cmmi12 scaled \magstephalf
-\font\ssecsy=cmsy10 scaled \magstep1
+\font\ssecsy=cmsy10 scaled 1315
% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
% but that is not a standard magnification.
-% Fonts for title page:
-\setfont\titlerm\rmbshape{12}{\magstep3}
-\let\authorrm = \secrm
-
% 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
@@ -1199,7 +1406,14 @@ 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
+ \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
+ \let\tenttsl=\titlettsl
+ \resetmathfonts \setleading{25pt}}
+\def\titlefont#1{{\titlefonts\rm #1}}
\def\chapfonts{%
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
@@ -1216,16 +1430,46 @@ where each line of input produces a line of output.}
\let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
\resetmathfonts \setleading{15pt}}
\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
-\def\indexfonts{%
- \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
- \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
- \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
- \resetmathfonts \setleading{12pt}}
+\def\smallfonts{%
+ \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
+ \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
+ \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
+ \let\tenttsl=\smallttsl
+ \resetmathfonts \setleading{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}}
+
+% Set the fonts to use with the @small... environments.
+\let\smallexamplefonts = \smallfonts
+
+% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
+% can fit this many characters:
+% 8.5x11=86 smallbook=72 a4=90 a5=69
+% If we use \smallerfonts (8pt), then we can fit this many characters:
+% 8.5x11=90+ smallbook=80 a4=90+ a5=77
+% For me, subjectively, the few extra characters that fit aren't worth
+% the additional smallness of 8pt. So I'm making the default 9pt.
+%
+% By the way, for comparison, here's what fits with @example (10pt):
+% 8.5x11=71 smallbook=60 a4=75 a5=58
+%
+% I wish we used A4 paper on this side of the Atlantic.
+%
+% --karl, 24jan03.
+
% Set up the default fonts, so we can use them for creating boxes.
%
\textfonts
+% Define these so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
% Count depth in font-changes, for error checks
\newcount\fontdepth \fontdepth=0
@@ -1233,20 +1477,23 @@ where each line of input produces a line of output.}
\setfont\shortcontrm\rmshape{12}{1000}
\setfont\shortcontbf\bxshape{12}{1000}
\setfont\shortcontsl\slshape{12}{1000}
+\setfont\shortconttt\ttshape{12}{1000}
%% Add scribe-like font environments, plus @l for inline lisp (usually sans
%% serif) and @ii for TeX italic
% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
% unless the following character is such as not to need one.
-\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
-\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
+\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
+ \ptexslash\fi\fi\fi}
+\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
+\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
\let\i=\smartitalic
-\let\var=\smartitalic
-\let\dfn=\smartitalic
+\let\var=\smartslanted
+\let\dfn=\smartslanted
\let\emph=\smartitalic
-\let\cite=\smartitalic
+\let\cite=\smartslanted
\def\b#1{{\bf #1}}
\let\strong=\b
@@ -1258,27 +1505,38 @@ where each line of input produces a line of output.}
\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
\def\restorehyphenation{\hyphenchar\font = `- }
+% Set sfcode to normal for the chars that usually have another value.
+% Can't use plain's \frenchspacing because it uses the `\x notation, and
+% sometimes \x has an active definition that messes things up.
+%
+\catcode`@=11
+ \def\frenchspacing{%
+ \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
+ \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
+ }
+\catcode`@=\other
+
\def\t#1{%
{\tt \rawbackslash \frenchspacing #1}%
\null
}
\let\ttfont=\t
-\def\samp #1{`\tclose{#1}'\null}
-\setfont\smallrm\rmshape{8}{1000}
-\font\smallsy=cmsy9
-\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
- \raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{%
+\def\samp#1{`\tclose{#1}'\null}
+\setfont\keyrm\rmshape{8}{1000}
+\font\keysy=cmsy9
+\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+ \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
\vbox{\hrule\kern-0.4pt
- \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}%
+ \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
\kern-0.4pt\hrule}%
- \kern-.06em\raise0.4pt\hbox{$\rangle$}}}}
+ \kern-.06em\raise0.4pt\hbox{\angleright}}}}
% The old definition, with no lozenge:
%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+% @file, @option are the same as @samp.
\let\file=\samp
-\let\url=\samp % perhaps include a hypertex \special eventually
-\def\email#1{$\langle${\tt #1}$\rangle$}
+\let\option=\samp
% @code is a modification of @t,
% which makes spaces the same size as normal in the surrounding text.
@@ -1313,48 +1571,127 @@ where each line of input produces a line of output.}
% and arrange explicitly to hyphenate at a dash.
% -- rms.
{
-\catcode`\-=\active
-\catcode`\_=\active
-\catcode`\|=\active
-\global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex}
-% The following is used by \doprintindex to insure that long function names
-% wrap around. It is necessary for - and _ to be active before the index is
-% read from the file, as \entry parses the arguments long before \code is
-% ever called. -- mycroft
-% _ is always active; and it shouldn't be \let = to an _ that is a
-% subscript character anyway. Then, @cindex @samp{_} (for example)
-% fails. --karl
-\global\def\indexbreaks{%
- \catcode`\-=\active \let-\realdash
-}
+ \catcode`\-=\active
+ \catcode`\_=\active
+ %
+ \global\def\code{\begingroup
+ \catcode`\-=\active \let-\codedash
+ \catcode`\_=\active \let_\codeunder
+ \codex
+ }
+ %
+ % If we end up with any active - characters when handling the index,
+ % just treat them as a normal -.
+ \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
}
\def\realdash{-}
\def\codedash{-\discretionary{}{}{}}
-\def\codeunder{\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.
-%
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+% `example' (@kbd uses ttsl only inside of @example and friends),
+% or `code' (@kbd uses normal tty font always).
+\def\kbdinputstyle{\parsearg\kbdinputstylexxx}
+\def\kbdinputstylexxx#1{%
+ \def\arg{#1}%
+ \ifx\arg\worddistinct
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+ \else\ifx\arg\wordexample
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+ \else\ifx\arg\wordcode
+ \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @kbdinputstyle option `\arg'}%
+ \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is `distinct.'
+\kbdinputstyle distinct
+
\def\xkey{\key}
\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
\ifx\one\xkey\ifx\threex\three \key{#2}%
-\else{\tclose{\ttsl\look}}\fi
-\else{\tclose{\ttsl\look}}\fi}
+\else{\tclose{\kbdfont\look}}\fi
+\else{\tclose{\kbdfont\look}}\fi}
+
+% For @url, @env, @command quotes seem unnecessary, so use \code.
+\let\url=\code
+\let\env=\code
+\let\command=\code
+
+% @uref (abbreviation for `urlref') takes an optional (comma-separated)
+% second argument specifying the text to display and an optional third
+% arg as text to display instead of (rather than in addition to) the url
+% itself. First (mandatory) arg is the url. Perhaps eventually put in
+% a hypertex \special here.
+%
+\def\uref#1{\douref #1,,,\finish}
+\def\douref#1,#2,#3,#4\finish{\begingroup
+ \unsepspaces
+ \pdfurl{#1}%
+ \setbox0 = \hbox{\ignorespaces #3}%
+ \ifdim\wd0 > 0pt
+ \unhbox0 % third arg given, show only that
+ \else
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \ifpdf
+ \unhbox0 % PDF: 2nd arg given, show only it
+ \else
+ \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
+ \fi
+ \else
+ \code{#1}% only url given, so show it
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% rms does not like angle brackets --karl, 17may97.
+% So now @email is just like @uref, unless we are pdf.
+%
+%\def\email#1{\angleleft{\tt #1}\angleright}
+\ifpdf
+ \def\email#1{\doemail#1,,\finish}
+ \def\doemail#1,#2,#3\finish{\begingroup
+ \unsepspaces
+ \pdfurl{mailto:#1}%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+ \endlink
+ \endgroup}
+\else
+ \let\email=\uref
+\fi
% Check if we are currently using a typewriter font. Since all the
% Computer Modern typewriter fonts have zero interword stretch (and
% shrink), and it is reasonable to expect all typewriter fonts to have
% this property, we can check that font parameter.
-%
+%
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
-% argument is to make the input look right: @dmn{pt} instead of
-% @dmn{}pt.
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
%
\def\dmn#1{\thinspace #1}
@@ -1365,14 +1702,27 @@ where each line of input produces a line of output.}
% Polish suppressed-l. --karl, 22sep96.
%\def\l#1{{\li #1}\null}
+% Explicit font changes: @r, @sc, undocumented @ii.
\def\r#1{{\rm #1}} % roman font
-% Use of \lowercase was suggested.
\def\sc#1{{\smallcaps#1}} % smallcaps font
\def\ii#1{{\it #1}} % italic font
+% @acronym downcases the argument and prints in smallcaps.
+\def\acronym#1{{\smallcaps \lowercase{#1}}}
+
% @pounds{} is a sterling sign.
\def\pounds{{\it\$}}
+% @registeredsymbol - R in a circle. For now, only works in text size;
+% we'd have to redo the font mechanism to change the \scriptstyle and
+% \scriptscriptstyle font sizes to make it look right in headings.
+% Adapted from the plain.tex definition of \copyright.
+%
+\def\registeredsymbol{%
+ $^{{\ooalign{\hfil\raise.07ex\hbox{$\scriptstyle\rm R$}\hfil\crcr\Orb}}%
+ }$%
+}
+
\message{page headings,}
@@ -1380,30 +1730,34 @@ where each line of input produces a line of output.}
\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
% First the title page. Must do @settitle before @titlepage.
-\def\titlefont#1{{\titlerm #1}}
-
\newif\ifseenauthor
\newif\iffinishedtitlepage
+% Do an implicit @contents or @shortcontents after @end titlepage if the
+% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
+%
+\newif\ifsetcontentsaftertitlepage
+ \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
+\newif\ifsetshortcontentsaftertitlepage
+ \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+
\def\shorttitlepage{\parsearg\shorttitlepagezzz}
\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
\endgroup\page\hbox{}\page}
\def\titlepage{\begingroup \parindent=0pt \textfonts
\let\subtitlerm=\tenrm
-% I deinstalled the following change because \cmr12 is undefined.
-% This change was not in the ChangeLog anyway. --rms.
-% \let\subtitlerm=\cmr12
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
%
- \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
+ \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines
+ \let\tt=\authortt}%
%
% Leave some space at the very top of the page.
\vglue\titlepagetopglue
%
% Now you can print the title using @title.
\def\title{\parsearg\titlezzz}%
- \def\titlezzz##1{\leftline{\titlefont{##1}}
+ \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
% print a rule at the page bottom also.
\finishedtitlepagefalse
\vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
@@ -1442,7 +1796,24 @@ where each line of input produces a line of output.}
% after the title page, which we certainly don't want.
\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
+ \contents
+ \global\let\shortcontents = \relax
+ \global\let\contents = \relax
+ \fi
+ %
+ \ifsetcontentsaftertitlepage
+ \contents
+ \global\let\contents = \relax
+ \global\let\shortcontents = \relax
+ \fi
}
\def\finishtitlepage{%
@@ -1455,10 +1826,10 @@ where each line of input produces a line of output.}
\let\thispage=\folio
-\newtoks \evenheadline % Token sequence for heading line of even pages
-\newtoks \oddheadline % Token sequence for heading line of odd pages
-\newtoks \evenfootline % Token sequence for footing line of even pages
-\newtoks \oddfootline % Token sequence for footing line of odd pages
+\newtoks\evenheadline % headline on even pages
+\newtoks\oddheadline % headline on odd pages
+\newtoks\evenfootline % footline on even pages
+\newtoks\oddfootline % footline on odd pages
% Now make Tex use those variables
\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
@@ -1492,10 +1863,7 @@ where each line of input produces a line of output.}
\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-\gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
-\gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
-\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
@@ -1503,12 +1871,15 @@ where each line of input produces a line of output.}
\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
-\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+ \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+ %
+ % Leave some space for the footline. Hopefully ok to assume
+ % @evenfooting will not be used by itself.
+ \global\advance\pageheight by -\baselineskip
+ \global\advance\vsize by -\baselineskip
+}
-\gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
-\gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
-\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
%
}% unbind the catcode of @.
@@ -1575,40 +1946,28 @@ where each line of input produces a line of output.}
}
% Subroutines used in generating headings
-% Produces Day Month Year style of output.
-\def\today{\number\day\space
-\ifcase\month\or
-January\or February\or March\or April\or May\or June\or
-July\or August\or September\or October\or November\or December\fi
-\space\number\year}
-
-% Use this if you want the Month Day, Year style of output.
-%\def\today{\ifcase\month\or
-%January\or February\or March\or April\or May\or June\or
-%July\or August\or September\or October\or November\or December\fi
-%\space\number\day, \number\year}
-
-% @settitle line... specifies the title of the document, for headings
-% It generates no output of its own
-
-\def\thistitle{No Title}
+% This produces Day Month Year style of output.
+% Only define if not already defined, in case a txi-??.tex file has set
+% up a different format (e.g., txi-cs.tex does this).
+\ifx\today\undefined
+\def\today{%
+ \number\day\space
+ \ifcase\month
+ \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
+ \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
+ \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
+ \fi
+ \space\number\year}
+\fi
+
+% @settitle line... specifies the title of the document, for headings.
+% It generates no output of its own.
+\def\thistitle{\putwordNoTitle}
\def\settitle{\parsearg\settitlezzz}
\def\settitlezzz #1{\gdef\thistitle{#1}}
\message{tables,}
-
-% @tabs -- simple alignment
-
-% These don't work. For one thing, \+ is defined as outer.
-% So these macros cannot even be defined.
-
-%\def\tabs{\parsearg\tabszzz}
-%\def\tabszzz #1{\settabs\+#1\cr}
-%\def\tabline{\parsearg\tablinezzz}
-%\def\tablinezzz #1{\+#1\cr}
-%\def\&{&}
-
% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
% default indentation of table text
@@ -1652,11 +2011,6 @@ July\or August\or September\or October\or November\or December\fi
\itemindex{#1}%
\nobreak % This prevents a break before @itemx.
%
- % Be sure we are not still in the middle of a paragraph.
- %{\parskip = 0in
- %\par
- %}%
- %
% If the item text does not fit in the space we have, put it on a line
% by itself, and do not allow a page break either before or after that
% line. We do not start a paragraph here because then if the next
@@ -1677,21 +2031,33 @@ July\or August\or September\or October\or November\or December\fi
% \parskip glue -- logically it's part of the @item we just started.
\nobreak \vskip-\parskip
%
- % Stop a page break at the \parskip glue coming up. Unfortunately
+ % Stop a page break at the \parskip glue coming up. (Unfortunately
% we can't prevent a possible page break at the following
- % \baselineskip glue.
- \nobreak
+ % \baselineskip glue.) However, if what follows is an environment
+ % such as @example, there will be no \parskip glue; then
+ % the negative vskip we just would cause the example and the item to
+ % crash together. So we use this bizarre value of 10001 as a signal
+ % to \aboveenvbreak to insert \parskip glue after all.
+ % (Possibly there are other commands that could be followed by
+ % @example which need the same treatment, but not section titles; or
+ % maybe section titles are the only special case and they should be
+ % penalty 10001...)
+ \penalty 10001
\endgroup
\itemxneedsnegativevskipfalse
\else
% The item text fits into the space. Start a paragraph, so that the
- % following text (if any) will end up on the same line. Since that
- % text will be indented by \tableindent, we make the item text be in
- % a zero-width box.
+ % following text (if any) will end up on the same line.
\noindent
- \rlap{\hskip -\tableindent\box0}\ignorespaces%
- \endgroup%
- \itemxneedsnegativevskiptrue%
+ % Do this with kerns and \unhbox so that if there is a footnote in
+ % the item text, it can migrate to the main vertical list and
+ % eventually be printed.
+ \nobreak\kern-\tableindent
+ \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+ \unhbox0
+ \nobreak\kern\dimen0
+ \endgroup
+ \itemxneedsnegativevskiptrue
\fi
}
@@ -1702,9 +2068,10 @@ July\or August\or September\or October\or November\or December\fi
\def\xitem{\errmessage{@xitem while not in a table}}
\def\xitemx{\errmessage{@xitemx while not in a table}}
-%% Contains a kludge to get @end[description] to work
+% Contains a kludge to get @end[description] to work.
\def\description{\tablez{\dontindex}{1}{}{}{}{}}
+% @table, @ftable, @vtable.
\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
{\obeylines\obeyspaces%
\gdef\tablex #1^^M{%
@@ -1764,27 +2131,25 @@ July\or August\or September\or October\or November\or December\fi
\def\itemize{\parsearg\itemizezzz}
\def\itemizezzz #1{%
- \begingroup % ended by the @end itemsize
+ \begingroup % ended by the @end itemize
\itemizey {#1}{\Eitemize}
}
-\def\itemizey #1#2{%
-\aboveenvbreak %
-\itemmax=\itemindent %
-\advance \itemmax by -\itemmargin %
-\advance \leftskip by \itemindent %
-\exdentamount=\itemindent
-\parindent = 0pt %
-\parskip = \smallskipamount %
-\ifdim \parskip=0pt \parskip=2pt \fi%
-\def#2{\endgraf\afterenvbreak\endgroup}%
-\def\itemcontents{#1}%
-\let\item=\itemizeitem}
-
-% Set sfcode to normal for the chars that usually have another value.
-% These are `.?!:;,'
-\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
- \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
+\def\itemizey#1#2{%
+ \aboveenvbreak
+ \itemmax=\itemindent
+ \advance\itemmax by -\itemmargin
+ \advance\leftskip by \itemindent
+ \exdentamount=\itemindent
+ \parindent=0pt
+ \parskip=\smallskipamount
+ \ifdim\parskip=0pt \parskip=2pt \fi
+ \def#2{\endgraf\afterenvbreak\endgroup}%
+ \def\itemcontents{#1}%
+ % @itemize with no arg is equivalent to @itemize @bullet.
+ \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
+ \let\item=\itemizeitem
+}
% \splitoff TOKENS\endmark defines \first to be the first token in
% TOKENS, and \rest to be the remainder.
@@ -1892,7 +2257,7 @@ July\or August\or September\or October\or November\or December\fi
\def\itemizeitem{%
\advance\itemno by 1
{\let\par=\endgraf \smallbreak}%
-\ifhmode \errmessage{\in hmode at itemizeitem}\fi
+\ifhmode \errmessage{In hmode at itemizeitem}\fi
{\parskip=0in \hskip 0pt
\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
\vadjust{\penalty 1200}}%
@@ -1910,7 +2275,7 @@ July\or August\or September\or October\or November\or December\fi
% To make preamble:
%
-% Either define widths of columns in terms of percent of \hsize:
+% Either define widths of columns in terms of percent of \hsize:
% @multitable @columnfractions .25 .3 .45
% @item ...
%
@@ -1928,13 +2293,13 @@ July\or August\or September\or October\or November\or December\fi
% the preamble, break the line within one argument and it
% will parse correctly, i.e.,
%
-% @multitable {Column 1 template} {Column 2 template} {Column 3
+% @multitable {Column 1 template} {Column 2 template} {Column 3
% template}
% Not:
-% @multitable {Column 1 template} {Column 2 template}
+% @multitable {Column 1 template} {Column 2 template}
% {Column 3 template}
-% Each new table line starts with @item, each subsequent new column
+% Each new table line starts with @item, each subsequent new column
% starts with @tab. Empty columns may be produced by supplying @tab's
% with nothing between them for as many times as empty columns are needed,
% ie, @tab@tab@tab will produce two empty columns.
@@ -1946,15 +2311,15 @@ July\or August\or September\or October\or November\or December\fi
% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
% @item first col stuff @tab second col stuff @tab third col
-% @item
-% first col stuff
-% @tab
-% second col stuff
-% @tab
-% third col
-% @item first col stuff @tab second col stuff
+% @item
+% first col stuff
+% @tab
+% second col stuff
+% @tab
+% third col
+% @item first col stuff @tab second col stuff
% @tab Many paragraphs of text may be used in any column.
-%
+%
% They will wrap at the width determined by the template.
% @item@tab@tab This will be in third column.
% @end multitable
@@ -1966,10 +2331,7 @@ July\or August\or September\or October\or November\or December\fi
% @multitablelinespace is space to leave between table items, baseline
% to baseline.
% 0pt means it depends on current normal line spacing.
-
-%%%%
-% Dimensions
-
+%
\newskip\multitableparskip
\newskip\multitableparindent
\newdimen\multitablecolspace
@@ -1979,129 +2341,154 @@ July\or August\or September\or October\or November\or December\fi
\multitablecolspace=12pt
\multitablelinespace=0pt
-%%%%
% Macros used to set up halign preamble:
+%
\let\endsetuptable\relax
\def\xendsetuptable{\endsetuptable}
\let\columnfractions\relax
\def\xcolumnfractions{\columnfractions}
\newif\ifsetpercent
-%% 2/1/96, to allow fractions to be given with more than one digit.
-\def\pickupwholefraction#1 {\global\advance\colcount by1 %
-\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
-\setuptable}
+% #1 is the part of the @columnfraction before the decimal point, which
+% is presumably either 0 or the empty string (but we don't check, we
+% just throw it away). #2 is the decimal part, which we use as the
+% percent of \hsize for this column.
+\def\pickupwholefraction#1.#2 {%
+ \global\advance\colcount by 1
+ \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}%
+ \setuptable
+}
\newcount\colcount
-\def\setuptable#1{\def\firstarg{#1}%
-\ifx\firstarg\xendsetuptable\let\go\relax%
-\else
- \ifx\firstarg\xcolumnfractions\global\setpercenttrue%
+\def\setuptable#1{%
+ \def\firstarg{#1}%
+ \ifx\firstarg\xendsetuptable
+ \let\go = \relax
\else
- \ifsetpercent
- \let\go\pickupwholefraction % In this case arg of setuptable
- % is the decimal point before the
- % number given in percent of hsize.
- % We don't need this so we don't use it.
+ \ifx\firstarg\xcolumnfractions
+ \global\setpercenttrue
+ \else
+ \ifsetpercent
+ \let\go\pickupwholefraction
+ \else
+ \global\advance\colcount by 1
+ \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
+ % separator; typically that is always in the input, anyway.
+ \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \fi
+ \fi
+ \ifx\go\pickupwholefraction
+ % Put the argument back for the \pickupwholefraction call, so
+ % we'll always have a period there to be parsed.
+ \def\go{\pickupwholefraction#1}%
\else
- \global\advance\colcount by1
- \setbox0=\hbox{#1 }% Add a normal word space as a separator;
- % typically that is always in the input, anyway.
- \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \let\go = \setuptable
\fi%
- \fi%
-\ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
-\fi\go}
-
-%%%%
-% multitable syntax
-\def\tab{&\hskip1sp\relax} % 2/2/96
- % tiny skip here makes sure this column space is
- % maintained, even if it is never used.
-
+ \fi
+ \go
+}
-%%%%
% @multitable ... @end multitable definitions:
-
+%
\def\multitable{\parsearg\dotable}
-
\def\dotable#1{\bgroup
-\let\item\cr
-\tolerance=9500
-\hbadness=9500
-\setmultitablespacing
-\parskip=\multitableparskip
-\parindent=\multitableparindent
-\overfullrule=0pt
-\global\colcount=0\relax%
-\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
- % To parse everything between @multitable and @item :
-\setuptable#1 \endsetuptable
- % Need to reset this to 0 after \setuptable.
-\global\colcount=0\relax%
- %
- % This preamble sets up a generic column definition, which will
- % be used as many times as user calls for columns.
- % \vtop will set a single line and will also let text wrap and
- % continue for many paragraphs if desired.
-\halign\bgroup&\global\advance\colcount by 1\relax%
-\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
- % In order to keep entries from bumping into each other
- % we will add a \leftskip of \multitablecolspace to all columns after
- % the first one.
- % If a template has been used, we will add \multitablecolspace
- % to the width of each template entry.
- % If user has set preamble in terms of percent of \hsize
- % we will use that dimension as the width of the column, and
- % the \leftskip will keep entries from bumping into each other.
- % Table will start at left margin and final column will justify at
- % right margin.
-\ifnum\colcount=1
-\else
- \ifsetpercent
+ \vskip\parskip
+ \let\item=\crcrwithfootnotes
+ % A \tab used to include \hskip1sp. But then the space in a template
+ % line is not enough. That is bad. So let's go back to just & until
+ % we encounter the problem it was intended to solve again. --karl,
+ % nathan@acm.org, 20apr99.
+ \let\tab=&%
+ \let\startfootins=\startsavedfootnote
+ \tolerance=9500
+ \hbadness=9500
+ \setmultitablespacing
+ \parskip=\multitableparskip
+ \parindent=\multitableparindent
+ \overfullrule=0pt
+ \global\colcount=0
+ \def\Emultitable{%
+ \global\setpercentfalse
+ \crcrwithfootnotes\crcr
+ \egroup\egroup
+ }%
+ %
+ % To parse everything between @multitable and @item:
+ \setuptable#1 \endsetuptable
+ %
+ % \everycr will reset column counter, \colcount, at the end of
+ % each line. Every column entry will cause \colcount to advance by one.
+ % The table preamble
+ % looks at the current \colcount to find the correct column width.
+ \everycr{\noalign{%
+ %
+ % \filbreak%% keeps underfull box messages off when table breaks over pages.
+ % Maybe so, but it also creates really weird page breaks when the table
+ % breaks over pages. Wouldn't \vfil be better? Wait until the problem
+ % manifests itself, so it can be fixed for real --karl.
+ \global\colcount=0\relax}}%
+ %
+ % This preamble sets up a generic column definition, which will
+ % be used as many times as user calls for columns.
+ % \vtop will set a single line and will also let text wrap and
+ % continue for many paragraphs if desired.
+ \halign\bgroup&\global\advance\colcount by 1\relax
+ \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
+ %
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ %
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ %
+ % If the user has set preamble in terms of percent of \hsize we will
+ % use that dimension as the width of the column, and the \leftskip
+ % will keep entries from bumping into each other. Table will start at
+ % left margin and final column will justify at right margin.
+ %
+ % Make sure we don't inherit \rightskip from the outer environment.
+ \rightskip=0pt
+ \ifnum\colcount=1
+ % The first column will be indented with the surrounding text.
+ \advance\hsize by\leftskip
\else
- % If user has <not> set preamble in terms of percent of \hsize
- % we will advance \hsize by \multitablecolspace
- \advance\hsize by \multitablecolspace
+ \ifsetpercent \else
+ % If user has not set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace.
+ \advance\hsize by \multitablecolspace
+ \fi
+ % In either case we will make \leftskip=\multitablecolspace:
+ \leftskip=\multitablecolspace
\fi
- % In either case we will make \leftskip=\multitablecolspace:
-\leftskip=\multitablecolspace
-\fi
- % Ignoring space at the beginning and end avoids an occasional spurious
- % blank line, when TeX decides to break the line at the space before the
- % box from the multistrut, so the strut ends up on a line by itself.
- % For example:
- % @multitable @columnfractions .11 .89
- % @item @code{#}
- % @tab Legal holiday which is valid in major parts of the whole country.
- % Is automatically provided with highlighing sequences respectively marking
- % characters.
- \noindent\ignorespaces##\unskip\multistrut}\cr
- % \everycr will reset column counter, \colcount, at the end of
- % each line. Every column entry will cause \colcount to advance by one.
- % The table preamble
- % looks at the current \colcount to find the correct column width.
-\global\everycr{\noalign{%
-% \filbreak%% keeps underfull box messages off when table breaks over pages.
-% Maybe so, but it also creates really weird page breaks when the table
-% breaks over pages Wouldn't \vfil be better? Wait until the problem
-% manifests itself, so it can be fixed for real --karl.
-\global\colcount=0\relax}}
+ % Ignoring space at the beginning and end avoids an occasional spurious
+ % blank line, when TeX decides to break the line at the space before the
+ % box from the multistrut, so the strut ends up on a line by itself.
+ % For example:
+ % @multitable @columnfractions .11 .89
+ % @item @code{#}
+ % @tab Legal holiday which is valid in major parts of the whole country.
+ % Is automatically provided with highlighting sequences respectively marking
+ % characters.
+ \noindent\ignorespaces##\unskip\multistrut}\cr
}
\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
% If so, do nothing. If not, give it an appropriate dimension based on
% current baselineskip.
\ifdim\multitablelinespace=0pt
+\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
+\global\advance\multitablelinespace by-\ht0
%% strut to put in table in case some entry doesn't have descenders,
%% to keep lines equally spaced
\let\multistrut = \strut
-%% Test to see if parskip is larger than space between lines of
-%% table. If not, do nothing.
-%% If so, set to same dimension as multitablelinespace.
\else
+%% FIXME: what is \box0 supposed to be?
\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
width0pt\relax} \fi
+%% Test to see if parskip is larger than space between lines of
+%% table. If not, do nothing.
+%% If so, set to same dimension as multitablelinespace.
\ifdim\multitableparskip>\multitablelinespace
\global\multitableparskip=\multitablelinespace
\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
@@ -2113,6 +2500,430 @@ width0pt\relax} \fi
%% than skip between lines in the table.
\fi}
+% In case a @footnote appears inside an alignment, save the footnote
+% text to a box and make the \insert when a row of the table is
+% finished. Otherwise, the insertion is lost, it never migrates to the
+% main vertical list. --kasal, 22jan03.
+%
+\newbox\savedfootnotes
+%
+% \dotable \let's \startfootins to this, so that \dofootnote will call
+% it instead of starting the insertion right away.
+\def\startsavedfootnote{%
+ \global\setbox\savedfootnotes = \vbox\bgroup
+ \unvbox\savedfootnotes
+}
+\def\crcrwithfootnotes{%
+ \crcr
+ \ifvoid\savedfootnotes \else
+ \noalign{\insert\footins{\box\savedfootnotes}}%
+ \fi
+}
+
+\message{conditionals,}
+% Prevent errors for section commands.
+% Used in @ignore and in failing conditionals.
+\def\ignoresections{%
+ \let\chapter=\relax
+ \let\unnumbered=\relax
+ \let\top=\relax
+ \let\unnumberedsec=\relax
+ \let\unnumberedsection=\relax
+ \let\unnumberedsubsec=\relax
+ \let\unnumberedsubsection=\relax
+ \let\unnumberedsubsubsec=\relax
+ \let\unnumberedsubsubsection=\relax
+ \let\section=\relax
+ \let\subsec=\relax
+ \let\subsubsec=\relax
+ \let\subsection=\relax
+ \let\subsubsection=\relax
+ \let\appendix=\relax
+ \let\appendixsec=\relax
+ \let\appendixsection=\relax
+ \let\appendixsubsec=\relax
+ \let\appendixsubsection=\relax
+ \let\appendixsubsubsec=\relax
+ \let\appendixsubsubsection=\relax
+ \let\contents=\relax
+ \let\smallbook=\relax
+ \let\titlepage=\relax
+}
+
+% Used in nested conditionals, where we have to parse the Texinfo source
+% and so want to turn off most commands, in case they are used
+% incorrectly.
+%
+% We use \empty instead of \relax for the @def... commands, so that \end
+% doesn't throw an error. For instance:
+% @ignore
+% @deffn ...
+% @end deffn
+% @end ignore
+%
+% The @end deffn is going to get expanded, because we're trying to allow
+% nested conditionals. But we don't want to expand the actual @deffn,
+% since it might be syntactically correct and intended to be ignored.
+% Since \end checks for \relax, using \empty does not cause an error.
+%
+\def\ignoremorecommands{%
+ \let\defcodeindex = \relax
+ \let\defcv = \empty
+ \let\defcvx = \empty
+ \let\Edefcv = \empty
+ \let\deffn = \empty
+ \let\deffnx = \empty
+ \let\Edeffn = \empty
+ \let\defindex = \relax
+ \let\defivar = \empty
+ \let\defivarx = \empty
+ \let\Edefivar = \empty
+ \let\defmac = \empty
+ \let\defmacx = \empty
+ \let\Edefmac = \empty
+ \let\defmethod = \empty
+ \let\defmethodx = \empty
+ \let\Edefmethod = \empty
+ \let\defop = \empty
+ \let\defopx = \empty
+ \let\Edefop = \empty
+ \let\defopt = \empty
+ \let\defoptx = \empty
+ \let\Edefopt = \empty
+ \let\defspec = \empty
+ \let\defspecx = \empty
+ \let\Edefspec = \empty
+ \let\deftp = \empty
+ \let\deftpx = \empty
+ \let\Edeftp = \empty
+ \let\deftypefn = \empty
+ \let\deftypefnx = \empty
+ \let\Edeftypefn = \empty
+ \let\deftypefun = \empty
+ \let\deftypefunx = \empty
+ \let\Edeftypefun = \empty
+ \let\deftypeivar = \empty
+ \let\deftypeivarx = \empty
+ \let\Edeftypeivar = \empty
+ \let\deftypemethod = \empty
+ \let\deftypemethodx = \empty
+ \let\Edeftypemethod = \empty
+ \let\deftypeop = \empty
+ \let\deftypeopx = \empty
+ \let\Edeftypeop = \empty
+ \let\deftypevar = \empty
+ \let\deftypevarx = \empty
+ \let\Edeftypevar = \empty
+ \let\deftypevr = \empty
+ \let\deftypevrx = \empty
+ \let\Edeftypevr = \empty
+ \let\defun = \empty
+ \let\defunx = \empty
+ \let\Edefun = \empty
+ \let\defvar = \empty
+ \let\defvarx = \empty
+ \let\Edefvar = \empty
+ \let\defvr = \empty
+ \let\defvrx = \empty
+ \let\Edefvr = \empty
+ \let\clear = \relax
+ \let\down = \relax
+ \let\evenfooting = \relax
+ \let\evenheading = \relax
+ \let\everyfooting = \relax
+ \let\everyheading = \relax
+ \let\headings = \relax
+ \let\include = \relax
+ \let\item = \relax
+ \let\lowersections = \relax
+ \let\oddfooting = \relax
+ \let\oddheading = \relax
+ \let\printindex = \relax
+ \let\pxref = \relax
+ \let\raisesections = \relax
+ \let\ref = \relax
+ \let\set = \relax
+ \let\setchapternewpage = \relax
+ \let\setchapterstyle = \relax
+ \let\settitle = \relax
+ \let\up = \relax
+ \let\verbatiminclude = \relax
+ \let\xref = \relax
+}
+
+% Ignore @ignore, @ifhtml, @ifinfo, and the like.
+%
+\def\direntry{\doignore{direntry}}
+\def\documentdescriptionword{documentdescription}
+\def\documentdescription{\doignore{documentdescription}}
+\def\html{\doignore{html}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\ifplaintext{\doignore{ifplaintext}}
+\def\ifxml{\doignore{ifxml}}
+\def\ignore{\doignore{ignore}}
+\def\menu{\doignore{menu}}
+\def\xml{\doignore{xml}}
+
+% @dircategory CATEGORY -- specify a category of the dir file
+% which this file should belong to. Ignore this in TeX.
+\let\dircategory = \comment
+
+% Ignore text until a line `@end #1'.
+%
+\def\doignore#1{\begingroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define a command to swallow text until we reach `@end #1'.
+ % This @ is a catcode 12 token (that is the normal catcode of @ in
+ % this texinfo.tex file). We change the catcode of @ below to match.
+ \long\def\doignoretext##1@end #1{\enddoignore}%
+ %
+ % Make sure that spaces turn into tokens that match what \doignoretext wants.
+ \catcode\spaceChar = 10
+ %
+ % Ignore braces, too, so mismatched braces don't cause trouble.
+ \catcode`\{ = 9
+ \catcode`\} = 9
+ %
+ % We must not have @c interpreted as a control sequence.
+ \catcode`\@ = 12
+ %
+ \def\ignoreword{#1}%
+ \ifx\ignoreword\documentdescriptionword
+ % The c kludge breaks documentdescription, since
+ % `documentdescription' contains a `c'. Means not everything will
+ % be ignored inside @documentdescription, but oh well...
+ \else
+ % Make the letter c a comment character so that the rest of the line
+ % will be ignored. This way, the document can have (for example)
+ % @c @end ifinfo
+ % and the @end ifinfo will be properly ignored.
+ % (We've just changed @ to catcode 12.)
+ \catcode`\c = 14
+ \fi
+ %
+ % And now expand the command defined above.
+ \doignoretext
+}
+
+% What we do to finish off ignored text.
+%
+\def\enddoignore{\endgroup\ignorespaces}%
+
+\newif\ifwarnedobs\warnedobsfalse
+\def\obstexwarn{%
+ \ifwarnedobs\relax\else
+ % We need to warn folks that they may have trouble with TeX 3.0.
+ % This uses \immediate\write16 rather than \message to get newlines.
+ \immediate\write16{}
+ \immediate\write16{WARNING: for users of Unix TeX 3.0!}
+ \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
+ \immediate\write16{If you are running another version of TeX, relax.}
+ \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
+ \immediate\write16{ Then upgrade your TeX installation if you can.}
+ \immediate\write16{ (See ftp://ftp.gnu.org/non-gnu/TeX.README.)}
+ \immediate\write16{If you are stuck with version 3.0, run the}
+ \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
+ \immediate\write16{ to use a workaround.}
+ \immediate\write16{}
+ \global\warnedobstrue
+ \fi
+}
+
+% **In TeX 3.0, setting text in \nullfont hangs tex. For a
+% workaround (which requires the file ``dummy.tfm'' to be installed),
+% uncomment the following line:
+%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
+
+% Ignore text, except that we keep track of conditional commands for
+% purposes of nesting, up to an `@end #1' command.
+%
+\def\nestedignore#1{%
+ \obstexwarn
+ % We must actually expand the ignored text to look for the @end
+ % command, so that nested ignore constructs work. Thus, we put the
+ % text into a \vbox and then do nothing with the result. To minimize
+ % the chance of memory overflow, we follow the approach outlined on
+ % page 401 of the TeXbook.
+ %
+ \setbox0 = \vbox\bgroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define `@end #1' to end the box, which will in turn undefine the
+ % @end command again.
+ \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
+ %
+ % We are going to be parsing Texinfo commands. Most cause no
+ % trouble when they are used incorrectly, but some commands do
+ % complicated argument parsing or otherwise get confused, so we
+ % undefine them.
+ %
+ % We can't do anything about stray @-signs, unfortunately;
+ % they'll produce `undefined control sequence' errors.
+ \ignoremorecommands
+ %
+ % Set the current font to be \nullfont, a TeX primitive, and define
+ % all the font commands to also use \nullfont. We don't use
+ % dummy.tfm, as suggested in the TeXbook, because some sites
+ % might not have that installed. Therefore, math mode will still
+ % produce output, but that should be an extremely small amount of
+ % stuff compared to the main input.
+ %
+ \nullfont
+ \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont
+ \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
+ \let\tensf=\nullfont
+ % Similarly for index fonts.
+ \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
+ %
+ % Don't bother to do space factor calculations.
+ \frenchspacing
+ %
+ % Don't report underfull hboxes.
+ \hbadness = 10000
+ %
+ % Do minimal line-breaking.
+ \pretolerance = 10000
+ %
+ % Do not execute instructions in @tex.
+ \def\tex{\doignore{tex}}%
+ % Do not execute macro definitions.
+ % `c' is a comment character, so the word `macro' will get cut off.
+ \def\macro{\doignore{ma}}%
+}
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it. Make sure the catcode of space is correct to avoid
+% losing inside @example, for instance.
+%
+\def\set{\begingroup\catcode` =10
+ \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
+ \parsearg\setxxx}
+\def\setxxx#1{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+ \def\temp{#2}%
+ \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
+ \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
+ \fi
+ \endgroup
+}
+% Can't use \xdef to pre-expand #2 and save some time, since \temp or
+% \next or other control sequences that we've defined might get us into
+% an infinite loop. Consider `@set foo @cite{bar}'.
+\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\def\clear{\parsearg\clearxxx}
+\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
+
+% @value{foo} gets the text saved in variable foo.
+{
+ \catcode`\_ = \active
+ %
+ % We might end up with active _ or - characters in the argument if
+ % we're called from @code, as @code{@value{foo-bar_}}. So \let any
+ % such active characters to their normal equivalents.
+ \gdef\value{\begingroup
+ \catcode`\-=\other \catcode`\_=\other
+ \indexbreaks \let_\normalunderscore
+ \valuexxx}
+}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we \let\value to this in \indexdummies). Ones
+% whose names contain - or _ still won't work, but we can't do anything
+% about that. The command has to be fully expandable (if the variable
+% is set), since the result winds up in the index file. This means that
+% if the variable's value contains other Texinfo commands, it's almost
+% certain it will fail (although perhaps we could fix that with
+% sufficient work to do a one-level expansion on the result, instead of
+% complete).
+%
+\def\expandablevalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ {[No value for ``#1'']}%
+ \message{Variable `#1', used in @value, is not set.}%
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+\def\ifset{\parsearg\doifset}
+\def\doifset#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \let\next=\ifsetfail
+ \else
+ \let\next=\ifsetsucceed
+ \fi
+ \next
+}
+\def\ifsetsucceed{\conditionalsucceed{ifset}}
+\def\ifsetfail{\nestedignore{ifset}}
+\defineunmatchedend{ifset}
+
+% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+\def\ifclear{\parsearg\doifclear}
+\def\doifclear#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \let\next=\ifclearsucceed
+ \else
+ \let\next=\ifclearfail
+ \fi
+ \next
+}
+\def\ifclearsucceed{\conditionalsucceed{ifclear}}
+\def\ifclearfail{\nestedignore{ifclear}}
+\defineunmatchedend{ifclear}
+
+% @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we
+% read the text following, through the first @end iftex (etc.). Make
+% `@end iftex' (etc.) valid only after an @iftex.
+%
+\def\iftex{\conditionalsucceed{iftex}}
+\def\ifnothtml{\conditionalsucceed{ifnothtml}}
+\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
+\def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}}
+\defineunmatchedend{iftex}
+\defineunmatchedend{ifnothtml}
+\defineunmatchedend{ifnotinfo}
+\defineunmatchedend{ifnotplaintext}
+
+% True conditional. Since \set globally defines its variables, we can
+% just start and end a group (to keep the @end definition undefined at
+% the outer level).
+%
+\def\conditionalsucceed#1{\begingroup
+ \expandafter\def\csname E#1\endcsname{\endgroup}%
+}
+
+% @defininfoenclose.
+\let\definfoenclose=\comment
+
\message{indexing,}
% Index generation facilities
@@ -2129,45 +2940,59 @@ width0pt\relax} \fi
% the file that accumulates this index. The file's extension is foo.
% The name of an index should be no more than 2 characters long
% for the sake of vms.
-
-\def\newindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\doindex {#1}}
+%
+\def\newindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
+ \noexpand\doindex{#1}}
}
% @defindex foo == \newindex{foo}
-
+%
\def\defindex{\parsearg\newindex}
% Define @defcodeindex, like @defindex except put all entries in @code.
-
-\def\newcodeindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\docodeindex {#1}}
+%
+\def\defcodeindex{\parsearg\newcodeindex}
+%
+\def\newcodeindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{%
+ \noexpand\docodeindex{#1}}%
}
-\def\defcodeindex{\parsearg\newcodeindex}
% @synindex foo bar makes index foo feed into index bar.
% Do this instead of @defindex foo if you don't want it as a separate index.
-\def\synindex #1 #2 {%
-\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
-\expandafter\let\csname#1indfile\endcsname=\synindexfoo
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\doindex {#2}}%
-}
-
+%
% @syncodeindex foo bar similar, but put all entries made for index foo
% inside @code.
-\def\syncodeindex #1 #2 {%
-\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
-\expandafter\let\csname#1indfile\endcsname=\synindexfoo
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\docodeindex {#2}}%
+%
+\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
+\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
+
+% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
+% #3 the target index (bar).
+\def\dosynindex#1#2#3{%
+ % Only do \closeout if we haven't already done it, else we'll end up
+ % closing the target index.
+ \expandafter \ifx\csname donesynindex#2\endcsname \undefined
+ % The \closeout helps reduce unnecessary open files; the limit on the
+ % Acorn RISC OS is a mere 16 files.
+ \expandafter\closeout\csname#2indfile\endcsname
+ \expandafter\let\csname\donesynindex#2\endcsname = 1
+ \fi
+ % redefine \fooindfile:
+ \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
+ \expandafter\let\csname#2indfile\endcsname=\temp
+ % redefine \fooindex:
+ \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
}
% Define \doindex, the driver for all \fooindex macros.
@@ -2187,148 +3012,271 @@ width0pt\relax} \fi
\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
+% Take care of Texinfo commands that can appear in an index entry.
+% Since there are some commands we want to expand, and others we don't,
+% we have to laboriously prevent expansion for those that we don't.
+%
\def\indexdummies{%
-% Take care of the plain tex accent commands.
-\def\"{\realbackslash "}%
-\def\`{\realbackslash `}%
-\def\'{\realbackslash '}%
-\def\^{\realbackslash ^}%
-\def\~{\realbackslash ~}%
-\def\={\realbackslash =}%
-\def\b{\realbackslash b}%
-\def\c{\realbackslash c}%
-\def\d{\realbackslash d}%
-\def\u{\realbackslash u}%
-\def\v{\realbackslash v}%
-\def\H{\realbackslash H}%
-% Take care of the plain tex special European modified letters.
-\def\oe{\realbackslash oe}%
-\def\ae{\realbackslash ae}%
-\def\aa{\realbackslash aa}%
-\def\OE{\realbackslash OE}%
-\def\AE{\realbackslash AE}%
-\def\AA{\realbackslash AA}%
-\def\o{\realbackslash o}%
-\def\O{\realbackslash O}%
-\def\l{\realbackslash l}%
-\def\L{\realbackslash L}%
-\def\ss{\realbackslash ss}%
-% Take care of texinfo commands likely to appear in an index entry.
-% (Must be a way to avoid doing expansion at all, and thus not have to
-% laboriously list every single command here.)
-\def\@{@}% will be @@ when we switch to @ as escape char.
-%\let\{ = \lbracecmd
-%\let\} = \rbracecmd
-\def\_{{\realbackslash _}}%
-\def\w{\realbackslash w }%
-\def\bf{\realbackslash bf }%
-%\def\rm{\realbackslash rm }%
-\def\sl{\realbackslash sl }%
-\def\sf{\realbackslash sf}%
-\def\tt{\realbackslash tt}%
-\def\gtr{\realbackslash gtr}%
-\def\less{\realbackslash less}%
-\def\hat{\realbackslash hat}%
-%\def\char{\realbackslash char}%
-\def\TeX{\realbackslash TeX}%
-\def\dots{\realbackslash dots }%
-\def\copyright{\realbackslash copyright }%
-\def\tclose##1{\realbackslash tclose {##1}}%
-\def\code##1{\realbackslash code {##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\cite##1{\realbackslash cite {##1}}%
-\def\key##1{\realbackslash key {##1}}%
-\def\file##1{\realbackslash file {##1}}%
-\def\var##1{\realbackslash var {##1}}%
-\def\kbd##1{\realbackslash kbd {##1}}%
-\def\dfn##1{\realbackslash dfn {##1}}%
-\def\emph##1{\realbackslash emph {##1}}%
-\unsepspaces
+ \def\@{@}% change to @@ when we switch to @ as escape char in index files.
+ \def\ {\realbackslash\space }%
+ % 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
+ %
+ % \definedummyword defines \#1 as \realbackslash #1\space, thus
+ % effectively preventing its expansion. This is used only for control
+ % words, not control letters, because the \space would be incorrect
+ % for control characters, but is needed to separate the control word
+ % from whatever follows.
+ %
+ % For control letters, we have \definedummyletter, which omits the
+ % space.
+ %
+ % These can be used both for control words that take an argument and
+ % those that do not. If it is followed by {arg} in the input, then
+ % that will dutifully get written to the index (or wherever).
+ %
+ \def\definedummyword##1{%
+ \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}%
+ }%
+ \def\definedummyletter##1{%
+ \expandafter\def\csname ##1\endcsname{\realbackslash ##1}%
+ }%
+ %
+ % Do the redefinitions.
+ \commondummies
+}
+
+% For the aux file, @ is the escape character. So we want to redefine
+% everything using @ instead of \realbackslash. When everything uses
+% @, this will be simpler.
+%
+\def\atdummies{%
+ \def\@{@@}%
+ \def\ {@ }%
+ \let\{ = \lbraceatcmd
+ \let\} = \rbraceatcmd
+ %
+ % (See comments in \indexdummies.)
+ \def\definedummyword##1{%
+ \expandafter\def\csname ##1\endcsname{@##1\space}%
+ }%
+ \def\definedummyletter##1{%
+ \expandafter\def\csname ##1\endcsname{@##1}%
+ }%
+ %
+ % Do the redefinitions.
+ \commondummies
+}
+
+% Called from \indexdummies and \atdummies. \definedummyword and
+% \definedummyletter must be defined first.
+%
+\def\commondummies{%
+ %
+ \normalturnoffactive
+ %
+ % Control letters and accents.
+ \definedummyletter{_}%
+ \definedummyletter{,}%
+ \definedummyletter{"}%
+ \definedummyletter{`}%
+ \definedummyletter{'}%
+ \definedummyletter{^}%
+ \definedummyletter{~}%
+ \definedummyletter{=}%
+ \definedummyword{u}%
+ \definedummyword{v}%
+ \definedummyword{H}%
+ \definedummyword{dotaccent}%
+ \definedummyword{ringaccent}%
+ \definedummyword{tieaccent}%
+ \definedummyword{ubaraccent}%
+ \definedummyword{udotaccent}%
+ \definedummyword{dotless}%
+ %
+ % Other non-English letters.
+ \definedummyword{AA}%
+ \definedummyword{AE}%
+ \definedummyword{L}%
+ \definedummyword{OE}%
+ \definedummyword{O}%
+ \definedummyword{aa}%
+ \definedummyword{ae}%
+ \definedummyword{l}%
+ \definedummyword{oe}%
+ \definedummyword{o}%
+ \definedummyword{ss}%
+ %
+ % Although these internal commands shouldn't show up, sometimes they do.
+ \definedummyword{bf}%
+ \definedummyword{gtr}%
+ \definedummyword{hat}%
+ \definedummyword{less}%
+ \definedummyword{sf}%
+ \definedummyword{sl}%
+ \definedummyword{tclose}%
+ \definedummyword{tt}%
+ %
+ % Texinfo font commands.
+ \definedummyword{b}%
+ \definedummyword{i}%
+ \definedummyword{r}%
+ \definedummyword{sc}%
+ \definedummyword{t}%
+ %
+ \definedummyword{TeX}%
+ \definedummyword{acronym}%
+ \definedummyword{cite}%
+ \definedummyword{code}%
+ \definedummyword{command}%
+ \definedummyword{dfn}%
+ \definedummyword{dots}%
+ \definedummyword{emph}%
+ \definedummyword{env}%
+ \definedummyword{file}%
+ \definedummyword{kbd}%
+ \definedummyword{key}%
+ \definedummyword{math}%
+ \definedummyword{option}%
+ \definedummyword{samp}%
+ \definedummyword{strong}%
+ \definedummyword{uref}%
+ \definedummyword{url}%
+ \definedummyword{var}%
+ \definedummyword{w}%
+ %
+ % Assorted special characters.
+ \definedummyword{bullet}%
+ \definedummyword{copyright}%
+ \definedummyword{dots}%
+ \definedummyword{enddots}%
+ \definedummyword{equiv}%
+ \definedummyword{error}%
+ \definedummyword{expansion}%
+ \definedummyword{minus}%
+ \definedummyword{pounds}%
+ \definedummyword{point}%
+ \definedummyword{print}%
+ \definedummyword{result}%
+ %
+ % Handle some cases of @value -- where the variable name does not
+ % contain - or _, and the value does not contain any
+ % (non-fully-expandable) commands.
+ \let\value = \expandablevalue
+ %
+ % Normal spaces, not active ones.
+ \unsepspaces
+ %
+ % No macro expansion.
+ \turnoffmacros
}
% If an index command is used in an @example environment, any spaces
% therein should become regular spaces in the raw index file, not the
-% expansion of \tie (\\leavevmode \penalty \@M \ ).
+% expansion of \tie (\leavevmode \penalty \@M \ ).
{\obeyspaces
\gdef\unsepspaces{\obeyspaces\let =\space}}
-% \indexnofonts no-ops all font-change commands.
-% This is used when outputting the strings to sort the index by.
-\def\indexdummyfont#1{#1}
+
+% \indexnofonts is used when outputting the strings to sort the index
+% by, and when constructing control sequence names. It eliminates all
+% control sequences and just writes whatever the best ASCII sort string
+% would be for a given command (usually its argument).
+%
\def\indexdummytex{TeX}
\def\indexdummydots{...}
-
+%
\def\indexnofonts{%
-% Just ignore accents.
-\let\,=\indexdummyfont
-\let\"=\indexdummyfont
-\let\`=\indexdummyfont
-\let\'=\indexdummyfont
-\let\^=\indexdummyfont
-\let\~=\indexdummyfont
-\let\==\indexdummyfont
-\let\b=\indexdummyfont
-\let\c=\indexdummyfont
-\let\d=\indexdummyfont
-\let\u=\indexdummyfont
-\let\v=\indexdummyfont
-\let\H=\indexdummyfont
-\let\dotless=\indexdummyfont
-% Take care of the plain tex special European modified letters.
-\def\oe{oe}%
-\def\ae{ae}%
-\def\aa{aa}%
-\def\OE{OE}%
-\def\AE{AE}%
-\def\AA{AA}%
-\def\o{o}%
-\def\O{O}%
-\def\l{l}%
-\def\L{L}%
-\def\ss{ss}%
-\let\w=\indexdummyfont
-\let\t=\indexdummyfont
-\let\r=\indexdummyfont
-\let\i=\indexdummyfont
-\let\b=\indexdummyfont
-\let\emph=\indexdummyfont
-\let\strong=\indexdummyfont
-\let\cite=\indexdummyfont
-\let\sc=\indexdummyfont
-%Don't no-op \tt, since it isn't a user-level command
-% and is used in the definitions of the active chars like <, >, |...
-%\let\tt=\indexdummyfont
-\let\tclose=\indexdummyfont
-\let\code=\indexdummyfont
-\let\file=\indexdummyfont
-\let\samp=\indexdummyfont
-\let\kbd=\indexdummyfont
-\let\key=\indexdummyfont
-\let\var=\indexdummyfont
-\let\TeX=\indexdummytex
-\let\dots=\indexdummydots
-\def\@{@}%
-}
-
-% To define \realbackslash, we must make \ not be an escape.
-% We must first make another character (@) an escape
-% so we do not become unable to do a definition.
-
-{\catcode`\@=0 \catcode`\\=\other
-@gdef@realbackslash{\}}
+ \def\ { }%
+ \def\@{@}%
+ % how to handle braces?
+ \def\_{\normalunderscore}%
+ %
+ \let\,=\asis
+ \let\"=\asis
+ \let\`=\asis
+ \let\'=\asis
+ \let\^=\asis
+ \let\~=\asis
+ \let\==\asis
+ \let\u=\asis
+ \let\v=\asis
+ \let\H=\asis
+ \let\dotaccent=\asis
+ \let\ringaccent=\asis
+ \let\tieaccent=\asis
+ \let\ubaraccent=\asis
+ \let\udotaccent=\asis
+ \let\dotless=\asis
+ %
+ % Other non-English letters.
+ \def\AA{AA}%
+ \def\AE{AE}%
+ \def\L{L}%
+ \def\OE{OE}%
+ \def\O{O}%
+ \def\aa{aa}%
+ \def\ae{ae}%
+ \def\l{l}%
+ \def\oe{oe}%
+ \def\o{o}%
+ \def\ss{ss}%
+ \def\exclamdown{!}%
+ \def\questiondown{?}%
+ %
+ % 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=\asis
+ %
+ % Texinfo font commands.
+ \let\b=\asis
+ \let\i=\asis
+ \let\r=\asis
+ \let\sc=\asis
+ \let\t=\asis
+ %
+ \let\TeX=\indexdummytex
+ \let\acronym=\asis
+ \let\cite=\asis
+ \let\code=\asis
+ \let\command=\asis
+ \let\dfn=\asis
+ \let\dots=\indexdummydots
+ \let\emph=\asis
+ \let\env=\asis
+ \let\file=\asis
+ \let\kbd=\asis
+ \let\key=\asis
+ \let\math=\asis
+ \let\option=\asis
+ \let\samp=\asis
+ \let\strong=\asis
+ \let\uref=\asis
+ \let\url=\asis
+ \let\var=\asis
+ \let\w=\asis
+}
\let\indexbackslash=0 %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
-\let\SETmarginindex=\relax %initialize!
-% workhorse for all \fooindexes
-% #1 is name of index, #2 is stuff to put there
-\def\doind #1#2{%
+% For \ifx comparisons.
+\def\emptymacro{\empty}
+
+% Most index entries go through here, but \dosubind is the general case.
+%
+\def\doind#1#2{\dosubind{#1}{#2}\empty}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% \empty if called from \doind, as we usually are. The main exception
+% is with defuns, which call us directly.
+%
+\def\dosubind#1#2#3{%
% Put the index entry in the margin if desired.
\ifx\SETmarginindex\relax\else
\insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
@@ -2339,48 +3287,71 @@ width0pt\relax} \fi
\indexdummies % Must do this here, since \bf, etc expand at this stage
\escapechar=`\\
{%
- \let\folio=0% We will expand all macros now EXCEPT \folio.
+ \let\folio = 0% We will expand all macros now EXCEPT \folio.
\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
% so it will be output as is; and it will print as backslash.
%
- % First process the index-string with all font commands turned off
- % to get the string to sort by.
- {\indexnofonts \xdef\indexsorttmp{#2}}%
- %
- % Now produce the complete index entry, with both the sort key and the
- % original text, including any font commands.
+ % The main index entry text.
\toks0 = {#2}%
+ %
+ % If third arg is present, precede it with space in sort key.
+ \def\thirdarg{#3}%
+ \ifx\thirdarg\emptymacro \else
+ % If the third (subentry) arg is present, add it to the index
+ % line to write.
+ \toks0 = \expandafter{\the\toks0 \space #3}%
+ \fi
+ %
+ % Process the index entry with all font commands turned off, to
+ % get the string to sort by.
+ {\indexnofonts
+ \edef\temp{\the\toks0}% need full expansion
+ \xdef\indexsorttmp{\temp}%
+ }%
+ %
+ % Set up the complete index entry, with both the sort key and
+ % the original text, including any font commands. We write
+ % three arguments to \entry to the .?? file (four in the
+ % subentry case), texindex reduces to two when writing the .??s
+ % sorted result.
\edef\temp{%
\write\csname#1indfile\endcsname{%
\realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
}%
- \temp
+ %
+ % If a skip is the last thing on the list now, preserve it
+ % by backing up by \lastskip, doing the \write, then inserting
+ % the skip again. Otherwise, the whatsit generated by the
+ % \write will make \lastskip zero. The result is that sequences
+ % like this:
+ % @end defun
+ % @tindex whatever
+ % @defun ...
+ % will have extra space inserted, because the \medbreak in the
+ % start of the @defun won't see the skip inserted by the @end of
+ % the previous defun.
+ %
+ % But don't do any of this if we're not in vertical mode. We
+ % don't want to do a \vskip and prematurely end a paragraph.
+ %
+ % Avoid page breaks due to these extra skips, too.
+ %
+ \iflinks
+ \ifvmode
+ \skip0 = \lastskip
+ \ifdim\lastskip = 0pt \else \nobreak\vskip-\skip0 \fi
+ \fi
+ %
+ \temp % do the write
+ %
+ \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
+ \fi
}%
}%
\penalty\count255
}%
}
-\def\dosubind #1#2#3{%
-{\count10=\lastpenalty %
-{\indexdummies % Must do this here, since \bf, etc expand at this stage
-\escapechar=`\\%
-{\let\folio=0%
-\def\rawbackslashxx{\indexbackslash}%
-%
-% Now process the index-string once, with all font commands turned off,
-% to get the string to sort the index by.
-{\indexnofonts
-\xdef\temp1{#2 #3}%
-}%
-% Now produce the complete index entry. We process the index-string again,
-% this time with font commands expanded, to get what to print in the index.
-\edef\temp{%
-\write \csname#1indfile\endcsname{%
-\realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
-\temp }%
-}\penalty\count10}}
-
% The index entry written in the file actually looks like
% \entry {sortstring}{page}{topic}
% or
@@ -2413,36 +3384,31 @@ width0pt\relax} \fi
% Define the macros used in formatting output of the sorted index material.
-% This is what you call to cause a particular index to get printed.
-% Write
-% @unnumbered Function Index
-% @printindex fn
-
+% @printindex causes a particular index (the ??s file) to get printed.
+% It does not print any chapter heading (usually an @unnumbered).
+%
\def\printindex{\parsearg\doprintindex}
-
\def\doprintindex#1{\begingroup
\dobreak \chapheadingskip{10000}%
%
- \indexfonts \rm
+ \smallfonts \rm
\tolerance = 9500
+ \everypar = {}% don't want the \kern\-parindent from indentation suppression.
\indexbreaks
- \def\indexbackslash{\rawbackslashxx}%
- % Index files are almost Texinfo source, but we use \ as the escape
- % character. It would be better to use @, but that's too big a change
- % to make right now.
- \catcode`\\ = 0
- \catcode`\@ = 11
- \escapechar = `\\
- \begindoublecolumns
%
% See if the index file exists and is nonempty.
+ % Change catcode of @ here so that if the index file contains
+ % \initial {@}
+ % as its first line, TeX doesn't complain about mismatched braces
+ % (because it thinks @} is a control sequence).
+ \catcode`\@ = 11
\openin 1 \jobname.#1s
\ifeof 1
% \enddoublecolumns gets confused if there is no text in the index,
% and it loses the chapter title and the aux file entries for the
% index. The easiest way to prevent this problem is to make sure
% there is some text.
- (Index is nonexistent)
+ \putwordIndexNonexistent
\else
%
% If the index file exists but is empty, then \openin leaves \ifeof
@@ -2450,33 +3416,54 @@ width0pt\relax} \fi
% it can discover if there is anything in it.
\read 1 to \temp
\ifeof 1
- (Index is empty)
+ \putwordIndexIsEmpty
\else
+ % Index files are almost Texinfo source, but we use \ as the escape
+ % character. It would be better to use @, but that's too big a change
+ % to make right now.
+ \def\indexbackslash{\rawbackslashxx}%
+ \catcode`\\ = 0
+ \escapechar = `\\
+ \begindoublecolumns
\input \jobname.#1s
+ \enddoublecolumns
\fi
\fi
\closein 1
- \enddoublecolumns
\endgroup}
% These macros are used by the sorted index file itself.
% Change them to control the appearance of the index.
-% Same as \bigskipamount except no shrink.
-% \balancecolumns gets confused if there is any shrink.
-\newskip\initialskipamount \initialskipamount 12pt plus4pt
-
-\def\initial #1{%
-{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
-\ifdim\lastskip<\initialskipamount
-\removelastskip \penalty-200 \vskip \initialskipamount\fi
-\line{\secbf#1\hfill}\kern 2pt\penalty10000}}
+\def\initial#1{{%
+ % Some minor font changes for the special characters.
+ \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+ %
+ % Remove any glue we may have, we'll be inserting our own.
+ \removelastskip
+ %
+ % We like breaks before the index initials, so insert a bonus.
+ \penalty -300
+ %
+ % Typeset the initial. Making this add up to a whole number of
+ % baselineskips increases the chance of the dots lining up from column
+ % to column. It still won't often be perfect, because of the stretch
+ % we need before each entry, but it's better.
+ %
+ % No shrink because it confuses \balancecolumns.
+ \vskip 1.67\baselineskip plus .5\baselineskip
+ \leftline{\secbf #1}%
+ \vskip .33\baselineskip plus .1\baselineskip
+ %
+ % Do our best not to break after the initial.
+ \nobreak
+}}
% This typesets a paragraph consisting of #1, dot leaders, and then #2
% flush to the right margin. It is used for index and table of contents
% entries. The paragraph is indented by \leftskip.
%
-\def\entry #1#2{\begingroup
+\def\entry#1#2{\begingroup
%
% Start a new paragraph if necessary, so our assignments below can't
% affect previous text.
@@ -2499,12 +3486,15 @@ width0pt\relax} \fi
%
% \hangafter is reset to 1 (which is the value we want) at the start
% of each paragraph, so we need not do anything with that.
- \hangindent=2em
+ \hangindent = 2em
%
% When the entry text needs to be broken, just fill out the first line
% with blank space.
\rightskip = 0pt plus1fil
%
+ % A bit of stretch before each entry for the benefit of balancing columns.
+ \vskip 0pt plus1pt
+ %
% Start a ``paragraph'' for the index entry so the line breaking
% parameters we've set above will have an effect.
\noindent
@@ -2529,7 +3519,11 @@ width0pt\relax} \fi
% The `\ ' here is removed by the implicit \unskip that TeX does as
% part of (the primitive) \par. Without it, a spurious underfull
% \hbox ensues.
- \ #2% The page number ends the paragraph.
+ \ifpdf
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \else
+ \ #2% The page number ends the paragraph.
+ \fi
\fi%
\par
\endgroup}
@@ -2541,11 +3535,18 @@ width0pt\relax} \fi
\def\primary #1{\line{#1\hfil}}
\newskip\secondaryindent \secondaryindent=0.5cm
-
-\def\secondary #1#2{
-{\parfillskip=0in \parskip=0in
-\hangindent =1in \hangafter=1
-\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
+\def\secondary#1#2{{%
+ \parfillskip=0in
+ \parskip=0in
+ \hangindent=1in
+ \hangafter=1
+ \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
+ \ifpdf
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \else
+ #2
+ \fi
+ \par
}}
% Define two-column mode, which we use to typeset indexes.
@@ -2558,24 +3559,41 @@ width0pt\relax} \fi
\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
% Grab any single-column material above us.
- \output = {\global\setbox\partialpage
- =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}%
- \eject
+ \output = {%
+ %
+ % Here is a possibility not foreseen in manmac: if we accumulate a
+ % whole lot of material, we might end up calling this \output
+ % routine twice in a row (see the doublecol-lose test, which is
+ % essentially a couple of indexes with @setchapternewpage off). In
+ % that case we just ship out what is in \partialpage with the normal
+ % output routine. Generally, \partialpage will be empty when this
+ % runs and this will be a no-op. See the indexspread.tex test case.
+ \ifvoid\partialpage \else
+ \onepageout{\pagecontents\partialpage}%
+ \fi
+ %
+ \global\setbox\partialpage = \vbox{%
+ % Unvbox the main output page.
+ \unvbox\PAGE
+ \kern-\topskip \kern\baselineskip
+ }%
+ }%
+ \eject % run that output routine to set \partialpage
%
- % Now switch to the double-column output routine.
- \output={\doublecolumnout}%
+ % Use the double-column output routine for subsequent pages.
+ \output = {\doublecolumnout}%
%
% Change the page size parameters. We could do this once outside this
% routine, in each of @smallbook, @afourpaper, and the default 8.5x11
% format, but then we repeat the same computation. Repeating a couple
% of assignments once per index is clearly meaningless for the
- % execution time, so we may as well do it once.
+ % execution time, so we may as well do it in one place.
%
% First we halve the line length, less a little for the gutter between
% the columns. We compute the gutter based on the line length, so it
% changes automatically with the paper format. The magic constant
- % below is chosen so that the gutter has the same value (well, +- <
- % 1pt) as it did when we hard-coded it.
+ % below is chosen so that the gutter has the same value (well, +-<1pt)
+ % as it did when we hard-coded it.
%
% We put the result in a separate register, \doublecolumhsize, so we
% can restore it in \pagesofar, after \hsize itself has (potentially)
@@ -2590,107 +3608,142 @@ width0pt\relax} \fi
% since nobody clobbers \vsize.)
\vsize = 2\vsize
}
+
+% The double-column output routine for all double-column pages except
+% the last.
+%
\def\doublecolumnout{%
\splittopskip=\topskip \splitmaxdepth=\maxdepth
% Get the available space for the double columns -- the normal
% (undoubled) page height minus any material left over from the
% previous page.
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
- % box0 will be the left-hand column, box1 the right.
+ \dimen@ = \vsize
+ \divide\dimen@ by 2
+ \advance\dimen@ by -\ht\partialpage
+ %
+ % box0 will be the left-hand column, box2 the right.
\setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
\onepageout\pagesofar
- \unvbox255 \penalty\outputpenalty
+ \unvbox255
+ \penalty\outputpenalty
}
+%
+% Re-output the contents of the output page -- any previous material,
+% followed by the two boxes we just split, in box0 and box2.
\def\pagesofar{%
- % The contents of the output page -- any previous material,
- % followed by the two boxes we just split.
\unvbox\partialpage
+ %
\hsize = \doublecolumnhsize
- \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}%
+ \wd0=\hsize \wd2=\hsize
+ \hbox to\pagewidth{\box0\hfil\box2}%
}
+%
+% All done with double columns.
\def\enddoublecolumns{%
- \output={\balancecolumns}\eject % split what we have
- \endgroup
- % Back to normal single-column typesetting, but take account of the
- % fact that we just accumulated some stuff on the output page.
- \pagegoal=\vsize
+ \output = {%
+ % Split the last of the double-column material. Leave it on the
+ % current page, no automatic page break.
+ \balancecolumns
+ %
+ % If we end up splitting too much material for the current page,
+ % though, there will be another page break right after this \output
+ % invocation ends. Having called \balancecolumns once, we do not
+ % want to call it again. Therefore, reset \output to its normal
+ % definition right away. (We hope \balancecolumns will never be
+ % called on to balance too much material, but if it is, this makes
+ % the output somewhat more palatable.)
+ \global\output = {\onepageout{\pagecontents\PAGE}}%
+ }%
+ \eject
+ \endgroup % started in \begindoublecolumns
+ %
+ % \pagegoal was set to the doubled \vsize above, since we restarted
+ % the current page. We're now back to normal single-column
+ % typesetting, so reset \pagegoal to the normal \vsize (after the
+ % \endgroup where \vsize got restored).
+ \pagegoal = \vsize
}
+%
+% Called at the end of the double column material.
\def\balancecolumns{%
- % Called on the last page of the double column material.
- \setbox0=\vbox{\unvbox255}%
+ \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
\dimen@ = \ht0
\advance\dimen@ by \topskip
\advance\dimen@ by-\baselineskip
- \divide\dimen@ by 2
+ \divide\dimen@ by 2 % target to split to
+ %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
\splittopskip = \topskip
% Loop until we get a decent breakpoint.
- {\vbadness=10000 \loop \global\setbox3=\copy0
- \global\setbox1=\vsplit3 to\dimen@
- \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}%
+ {%
+ \vbadness = 10000
+ \loop
+ \global\setbox3 = \copy0
+ \global\setbox1 = \vsplit3 to \dimen@
+ \ifdim\ht3>\dimen@
+ \global\advance\dimen@ by 1pt
+ \repeat
+ }%
+ %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
\setbox0=\vbox to\dimen@{\unvbox1}%
\setbox2=\vbox to\dimen@{\unvbox3}%
+ %
\pagesofar
}
-\catcode `\@=\other
+\catcode`\@ = \other
\message{sectioning,}
-% Define chapters, sections, etc.
+% Chapters, sections, etc.
-\newcount \chapno
-\newcount \secno \secno=0
-\newcount \subsecno \subsecno=0
-\newcount \subsubsecno \subsubsecno=0
+\newcount\chapno
+\newcount\secno \secno=0
+\newcount\subsecno \subsecno=0
+\newcount\subsubsecno \subsubsecno=0
% This counter is funny since it counts through charcodes of letters A, B, ...
-\newcount \appendixno \appendixno = `\@
-\def\appendixletter{\char\the\appendixno}
-
-\newwrite \contentsfile
-% This is called from \setfilename.
-\def\opencontents{\openout \contentsfile = \jobname.toc}
+\newcount\appendixno \appendixno = `\@
+% \def\appendixletter{\char\the\appendixno}
+% We do the following for the sake of pdftex, which needs the actual
+% letter in the expansion, not just typeset.
+\def\appendixletter{%
+ \ifnum\appendixno=`A A%
+ \else\ifnum\appendixno=`B B%
+ \else\ifnum\appendixno=`C C%
+ \else\ifnum\appendixno=`D D%
+ \else\ifnum\appendixno=`E E%
+ \else\ifnum\appendixno=`F F%
+ \else\ifnum\appendixno=`G G%
+ \else\ifnum\appendixno=`H H%
+ \else\ifnum\appendixno=`I I%
+ \else\ifnum\appendixno=`J J%
+ \else\ifnum\appendixno=`K K%
+ \else\ifnum\appendixno=`L L%
+ \else\ifnum\appendixno=`M M%
+ \else\ifnum\appendixno=`N N%
+ \else\ifnum\appendixno=`O O%
+ \else\ifnum\appendixno=`P P%
+ \else\ifnum\appendixno=`Q Q%
+ \else\ifnum\appendixno=`R R%
+ \else\ifnum\appendixno=`S S%
+ \else\ifnum\appendixno=`T T%
+ \else\ifnum\appendixno=`U U%
+ \else\ifnum\appendixno=`V V%
+ \else\ifnum\appendixno=`W W%
+ \else\ifnum\appendixno=`X X%
+ \else\ifnum\appendixno=`Y Y%
+ \else\ifnum\appendixno=`Z Z%
+ % The \the is necessary, despite appearances, because \appendixletter is
+ % expanded while writing the .toc file. \char\appendixno is not
+ % expandable, thus it is written literally, thus all appendixes come out
+ % with the same letter (or @) in the toc without it.
+ \else\char\the\appendixno
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
% Each @chapter defines this as the name of the chapter.
-% page headings and footings can use it. @section does likewise
-
-\def\thischapter{} \def\thissection{}
-\def\seccheck#1{\if \pageno<0 %
-\errmessage{@#1 not allowed after generating table of contents}\fi
-%
-}
-
-\def\chapternofonts{%
-\let\rawbackslash=\relax%
-\let\frenchspacing=\relax%
-\def\result{\realbackslash result}
-\def\equiv{\realbackslash equiv}
-\def\expansion{\realbackslash expansion}
-\def\print{\realbackslash print}
-\def\TeX{\realbackslash TeX}
-\def\dots{\realbackslash dots}
-\def\copyright{\realbackslash copyright}
-\def\tt{\realbackslash tt}
-\def\bf{\realbackslash bf }
-\def\w{\realbackslash w}
-\def\less{\realbackslash less}
-\def\gtr{\realbackslash gtr}
-\def\hat{\realbackslash hat}
-\def\char{\realbackslash char}
-\def\tclose##1{\realbackslash tclose {##1}}
-\def\code##1{\realbackslash code {##1}}
-\def\samp##1{\realbackslash samp {##1}}
-\def\r##1{\realbackslash r {##1}}
-\def\b##1{\realbackslash b {##1}}
-\def\key##1{\realbackslash key {##1}}
-\def\file##1{\realbackslash file {##1}}
-\def\kbd##1{\realbackslash kbd {##1}}
-% These are redefined because @smartitalic wouldn't work inside xdef.
-\def\i##1{\realbackslash i {##1}}
-\def\cite##1{\realbackslash cite {##1}}
-\def\var##1{\realbackslash var {##1}}
-\def\emph##1{\realbackslash emph {##1}}
-\def\dfn##1{\realbackslash dfn {##1}}
-}
+% page headings and footings can use it. @section does likewise.
+\def\thischapter{}
+\def\thissection{}
\newcount\absseclevel % used to calculate proper heading level
\newcount\secbase\secbase=0 % @raise/lowersections modify this count
@@ -2722,6 +3775,7 @@ width0pt\relax} \fi
\numberedsubsubseczzz{#2}
\fi
\fi
+\suppressfirstparagraphindent
}
% like \numhead, but chooses appendix heading levels
@@ -2741,6 +3795,7 @@ width0pt\relax} \fi
\appendixsubsubseczzz{#2}
\fi
\fi
+\suppressfirstparagraphindent
}
% like \numhead, but chooses numberless heading levels
@@ -2760,210 +3815,177 @@ width0pt\relax} \fi
\unnumberedsubsubseczzz{#2}
\fi
\fi
+\suppressfirstparagraphindent
}
-
+% @chapter, @appendix, @unnumbered.
\def\thischaptername{No Chapter Title}
\outer\def\chapter{\parsearg\chapteryyy}
\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
-\def\chapterzzz #1{\seccheck{chapter}%
-\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \chapno by 1 \message{\putwordChapter \the\chapno}%
-\chapmacro {#1}{\the\chapno}%
-\gdef\thissection{#1}%
-\gdef\thischaptername{#1}%
-% We don't substitute the actual chapter name into \thischapter
-% because we don't want its macros evaluated now.
-\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
-{\chapternofonts%
-\edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\global\let\section = \numberedsec
-\global\let\subsection = \numberedsubsec
-\global\let\subsubsection = \numberedsubsubsec
-}}
+\def\chapterzzz #1{%
+ \secno=0 \subsecno=0 \subsubsecno=0
+ \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
+ \chapmacro {#1}{\the\chapno}%
+ \gdef\thissection{#1}%
+ \gdef\thischaptername{#1}%
+ % We don't substitute the actual chapter name into \thischapter
+ % because we don't want its macros evaluated now.
+ \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
+ \writetocentry{chap}{#1}{{\the\chapno}}
+ \donoderef
+ \global\let\section = \numberedsec
+ \global\let\subsection = \numberedsubsec
+ \global\let\subsubsection = \numberedsubsubsec
+}
+
+% we use \chapno to avoid indenting back
+\def\appendixbox#1{%
+ \setbox0 = \hbox{\putwordAppendix{} \the\chapno}%
+ \hbox to \wd0{#1\hss}}
\outer\def\appendix{\parsearg\appendixyyy}
\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
-\def\appendixzzz #1{\seccheck{appendix}%
-\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \appendixno by 1 \message{Appendix \appendixletter}%
-\chapmacro {#1}{\putwordAppendix{} \appendixletter}%
-\gdef\thissection{#1}%
-\gdef\thischaptername{#1}%
-\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
-{\chapternofonts%
-\edef\temp{{\realbackslash chapentry
- {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\global\let\section = \appendixsec
-\global\let\subsection = \appendixsubsec
-\global\let\subsubsection = \appendixsubsubsec
-}}
+\def\appendixzzz #1{%
+ \secno=0 \subsecno=0 \subsubsecno=0
+ \global\advance \appendixno by 1
+ \message{\putwordAppendix\space \appendixletter}%
+ \chapmacro {#1}{\appendixbox{\putwordAppendix{} \appendixletter}}%
+ \gdef\thissection{#1}%
+ \gdef\thischaptername{#1}%
+ \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
+ \writetocentry{appendix}{#1}{{\appendixletter}}
+ \appendixnoderef
+ \global\let\section = \appendixsec
+ \global\let\subsection = \appendixsubsec
+ \global\let\subsubsection = \appendixsubsubsec
+}
% @centerchap is like @unnumbered, but the heading is centered.
\outer\def\centerchap{\parsearg\centerchapyyy}
\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
+% @top is like @unnumbered.
\outer\def\top{\parsearg\unnumberedyyy}
+
\outer\def\unnumbered{\parsearg\unnumberedyyy}
\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
-\def\unnumberedzzz #1{\seccheck{unnumbered}%
-\secno=0 \subsecno=0 \subsubsecno=0
-%
-% This used to be simply \message{#1}, but TeX fully expands the
-% argument to \message. Therefore, if #1 contained @-commands, TeX
-% expanded them. For example, in `@unnumbered The @cite{Book}', TeX
-% expanded @cite (which turns out to cause errors because \cite is meant
-% to be executed, not expanded).
-%
-% Anyway, we don't want the fully-expanded definition of @cite to appear
-% as a result of the \message, we just want `@cite' itself. We use
-% \the<toks register> to achieve this: TeX expands \the<toks> only once,
-% simply yielding the contents of the <toks register>.
-\toks0 = {#1}\message{(\the\toks0)}%
-%
-\unnumbchapmacro {#1}%
-\gdef\thischapter{#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\global\let\section = \unnumberedsec
-\global\let\subsection = \unnumberedsubsec
-\global\let\subsubsection = \unnumberedsubsubsec
-}}
+\def\unnumberedzzz #1{%
+ \secno=0 \subsecno=0 \subsubsecno=0
+ %
+ % This used to be simply \message{#1}, but TeX fully expands the
+ % argument to \message. Therefore, if #1 contained @-commands, TeX
+ % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
+ % expanded @cite (which turns out to cause errors because \cite is meant
+ % to be executed, not expanded).
+ %
+ % Anyway, we don't want the fully-expanded definition of @cite to appear
+ % as a result of the \message, we just want `@cite' itself. We use
+ % \the<toks register> to achieve this: TeX expands \the<toks> only once,
+ % simply yielding the contents of <toks register>. (We also do this for
+ % the toc entries.)
+ \toks0 = {#1}\message{(\the\toks0)}%
+ %
+ \unnumbchapmacro {#1}%
+ \gdef\thischapter{#1}\gdef\thissection{#1}%
+ \writetocentry{unnumbchap}{#1}{{\the\chapno}}
+ \unnumbnoderef
+ \global\let\section = \unnumberedsec
+ \global\let\subsection = \unnumberedsubsec
+ \global\let\subsubsection = \unnumberedsubsubsec
+}
+% Sections.
\outer\def\numberedsec{\parsearg\secyyy}
\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
-\def\seczzz #1{\seccheck{section}%
-\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
-\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash secentry %
-{#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
+\def\seczzz #1{%
+ \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+ \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
+ \writetocentry{sec}{#1}{{\the\chapno}{\the\secno}}
+ \donoderef
+ \nobreak
+}
\outer\def\appendixsection{\parsearg\appendixsecyyy}
\outer\def\appendixsec{\parsearg\appendixsecyyy}
\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
-\def\appendixsectionzzz #1{\seccheck{appendixsection}%
-\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
-\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash secentry %
-{#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
+\def\appendixsectionzzz #1{%
+ \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+ \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
+ \writetocentry{sec}{#1}{{\appendixletter}{\the\secno}}
+ \appendixnoderef
+ \nobreak
+}
\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
-\def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
-\plainsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
+\def\unnumberedseczzz #1{%
+ \plainsecheading {#1}\gdef\thissection{#1}%
+ \writetocentry{unnumbsec}{#1}{{\the\chapno}{\the\secno}}
+ \unnumbnoderef
+ \nobreak
+}
+% Subsections.
\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
-\def\numberedsubseczzz #1{\seccheck{subsection}%
-\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
-\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash subsecentry %
-{#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
+\def\numberedsubseczzz #1{%
+ \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+ \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
+ \writetocentry{subsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
+ \donoderef
+ \nobreak
+}
\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
-\def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
-\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
-\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash subsecentry %
-{#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
+\def\appendixsubseczzz #1{%
+ \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+ \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
+ \writetocentry{subsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}}
+ \appendixnoderef
+ \nobreak
+}
\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
-\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
-\plainsubsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
+\def\unnumberedsubseczzz #1{%
+ \plainsubsecheading {#1}\gdef\thissection{#1}%
+ \writetocentry{unnumbsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
+ \unnumbnoderef
+ \nobreak
+}
+% Subsubsections.
\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
-\def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
-\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
-\subsubsecheading {#1}
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash subsubsecentry %
- {#1}
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
- {\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
+\def\numberedsubsubseczzz #1{%
+ \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+ \subsubsecheading {#1}
+ {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+ \writetocentry{subsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
+ \donoderef
+ \nobreak
+}
\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
-\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
-\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
-\subsubsecheading {#1}
- {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash subsubsecentry{#1}%
- {\appendixletter}
- {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
+\def\appendixsubsubseczzz #1{%
+ \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+ \subsubsecheading {#1}
+ {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+ \writetocentry{subsubsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
+ \appendixnoderef
+ \nobreak
+}
\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
-\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
-\plainsubsubsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
+\def\unnumberedsubsubseczzz #1{%
+ \plainsubsubsecheading {#1}\gdef\thissection{#1}%
+ \writetocentry{unnumbsubsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
+ \unnumbnoderef
+ \nobreak
+}
% These are variants which are not "outer", so they can appear in @ifinfo.
% Actually, they should now be obsolete; ordinary section commands should work.
@@ -2992,8 +4014,7 @@ width0pt\relax} \fi
% Define @majorheading, @heading and @subheading
-% NOTE on use of \vbox for chapter headings, section headings, and
-% such:
+% NOTE on use of \vbox for chapter headings, section headings, and such:
% 1) We use \vbox rather than the earlier \line to permit
% overlong headings to fold.
% 2) \hyphenpenalty is set to 10000 because hyphenation in a
@@ -3004,16 +4025,16 @@ width0pt\relax} \fi
\def\majorheading{\parsearg\majorheadingzzz}
\def\majorheadingzzz #1{%
-{\advance\chapheadingskip by 10pt \chapbreak }%
-{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 200}
+ {\advance\chapheadingskip by 10pt \chapbreak }%
+ {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\penalty 200}
\def\chapheading{\parsearg\chapheadingzzz}
\def\chapheadingzzz #1{\chapbreak %
-{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 200}
+ {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\penalty 200}
% @heading, @subheading, @subsubheading.
\def\heading{\parsearg\plainsecheading}
@@ -3040,12 +4061,12 @@ width0pt\relax} \fi
\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
-\def\CHAPPAGoff{
+\def\CHAPPAGoff{%
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chapbreak
\global\let\pagealignmacro=\chappager}
-\def\CHAPPAGon{
+\def\CHAPPAGon{%
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chappager
\global\let\pagealignmacro=\chappager
@@ -3099,7 +4120,7 @@ width0pt\relax} \fi
\def\unnchfopen #1{%
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 10000 %
+ \rm #1\hfill}}\bigskip \par\nobreak
}
\def\chfopen #1#2{\chapoddpage {\chapfonts
@@ -3110,7 +4131,7 @@ width0pt\relax} \fi
\def\centerchfopen #1{%
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt
- \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 %
+ \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
}
\def\CHAPFopen{
@@ -3139,7 +4160,7 @@ width0pt\relax} \fi
% Print any size section title.
-%
+%
% #1 is the section type (sec/subsec/subsubsec), #2 is the section
% number (maybe empty), #3 the text.
\def\sectionheading#1#2#3{%
@@ -3159,118 +4180,193 @@ width0pt\relax} \fi
\hangindent = \wd0 % zero if no section number
\unhbox0 #3}%
}%
- \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
+ % Add extra space after the heading -- either a line space or a
+ % paragraph space, whichever is more. (Some people like to set
+ % \parskip to large values for some reason.) Don't allow stretch, though.
+ \nobreak
+ \ifdim\parskip>\normalbaselineskip
+ \kern\parskip
+ \else
+ \kern\normalbaselineskip
+ \fi
+ \nobreak
}
-\message{toc printing,}
-% Finish up the main text and prepare to read what we've written
-% to \contentsfile.
+\message{toc,}
+% Table of contents.
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc. We supply {\folio} at the end of the
+% argument, which will end up as the last argument to the \...entry macro.
+%
+% Usage: \writetocentry{chap}{The Name of The Game}{{\the\chapno}}
+% We open the .toc file for writing here instead of at @setfilename (or
+% any other fixed time) so that @contents can be anywhere in the document.
+%
+\newif\iftocfileopened
+\def\writetocentry#1#2#3{%
+ \iftocfileopened\else
+ \immediate\openout\tocfile = \jobname.toc
+ \global\tocfileopenedtrue
+ \fi
+ %
+ \iflinks
+ \toks0 = {#2}%
+ \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}#3{\folio}}}%
+ \temp
+ \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
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Finish up the main text and prepare to read what we've written
+% to \tocfile.
+%
\def\startcontents#1{%
% If @setchapternewpage on, and @headings double, the contents should
% start on an odd page, unlike chapters. Thus, we maintain
% \contentsalignmacro in parallel with \pagealignmacro.
% From: Torbjorn Granlund <tege@matematik.su.se>
\contentsalignmacro
- \immediate\closeout \contentsfile
- \ifnum \pageno>0
- \pageno = -1 % Request roman numbered pages.
- \fi
+ \immediate\closeout\tocfile
+ %
% Don't need to put `Contents' or `Short Contents' in the headline.
% It is abundantly clear what they are.
\unnumbchapmacro{#1}\def\thischapter{}%
+ \savepageno = \pageno
\begingroup % Set up to handle contents files properly.
\catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
- \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
+ % We can't do this, because then an actual ^ in a section
+ % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
+ %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
\raggedbottom % Worry more about breakpoints than the bottom.
\advance\hsize by -\contentsrightmargin % Don't use the full line length.
+ %
+ % Roman numerals for page numbers.
+ \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
}
% Normal (long) toc.
-\outer\def\contents{%
- \startcontents{\putwordTableofContents}%
- \input \jobname.toc
+\def\contents{%
+ \startcontents{\putwordTOC}%
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.toc
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \pdfmakeoutlines
\endgroup
- \vfill \eject
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
}
% And just the chapters.
-\outer\def\summarycontents{%
- \startcontents{\putwordShortContents}%
+\def\summarycontents{%
+ \startcontents{\putwordShortTOC}%
%
\let\chapentry = \shortchapentry
+ \let\appendixentry = \shortappendixentry
\let\unnumbchapentry = \shortunnumberedentry
% We want a true roman here for the page numbers.
\secfonts
- \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
+ \let\rm=\shortcontrm \let\bf=\shortcontbf
+ \let\sl=\shortcontsl \let\tt=\shortconttt
\rm
\hyphenpenalty = 10000
\advance\baselineskip by 1pt % Open it up a little.
\def\secentry ##1##2##3##4{}
- \def\unnumbsecentry ##1##2{}
\def\subsecentry ##1##2##3##4##5{}
- \def\unnumbsubsecentry ##1##2{}
\def\subsubsecentry ##1##2##3##4##5##6{}
- \def\unnumbsubsubsecentry ##1##2{}
- \input \jobname.toc
+ \let\unnumbsecentry = \secentry
+ \let\unnumbsubsecentry = \subsecentry
+ \let\unnumbsubsubsecentry = \subsubsecentry
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.toc
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
\endgroup
- \vfill \eject
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
}
\let\shortcontents = \summarycontents
+\ifpdf
+ \pdfcatalog{/PageMode /UseOutlines}%
+\fi
+
% These macros generate individual entries in the table of contents.
% The first argument is the chapter or section name.
% The last argument is the page number.
% The arguments in between are the chapter number, section number, ...
-% Chapter-level things, for both the long and short contents.
+% 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{#3}}%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}%
}
+% Appendices, in the main contents.
+\def\appendixentry#1#2#3{%
+ \dochapentry{\appendixbox{\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.
-\setbox0 = \hbox{\shortcontrm \putwordAppendix }
-\newdimen\shortappendixwidth \shortappendixwidth = \wd0
-
+%
+\newdimen\shortappendixwidth
+%
\def\shortchaplabel#1{%
- % 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}%
}
-\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
-\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
+% Unnumbered chapters.
+\def\unnumbchapentry#1#2#3{\dochapentry{#1}{#3}}
+\def\shortunnumberedentry#1#2#3{\tocentry{#1}{\doshortpageno\bgroup#3\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#4{\dosecentry{#1}{#4}}
% 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#5{\dosubsecentry{#1}{#5}}
% 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#6{\dosubsubsecentry{#1}{#6}}
% This parameter controls the indentation of the various levels.
\newdimen\tocindent \tocindent = 3pc
@@ -3284,35 +4380,36 @@ width0pt\relax} \fi
\penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
\begingroup
\chapentryfonts
- \tocentry{#1}{\dopageno{#2}}%
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup
\nobreak\vskip .25\baselineskip plus.1\baselineskip
}
\def\dosecentry#1#2{\begingroup
\secentryfonts \leftskip=\tocindent
- \tocentry{#1}{\dopageno{#2}}%
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
\def\dosubsecentry#1#2{\begingroup
\subsecentryfonts \leftskip=2\tocindent
- \tocentry{#1}{\dopageno{#2}}%
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
\def\dosubsubsecentry#1#2{\begingroup
\subsubsecentryfonts \leftskip=3\tocindent
- \tocentry{#1}{\dopageno{#2}}%
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
% Final typesetting of a toc entry; we use the same \entry macro as for
% the index entries, but we want to suppress hyphenation here. (We
% can't do that in the \entry macro, since index entries might consist
% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
-%
-% \turnoffactive is for the sake of @" used for umlauts.
\def\tocentry#1#2{\begingroup
\vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
- \entry{\turnoffactive #1}{\turnoffactive #2}%
+ % Do not use \turnoffactive in these arguments. Since the toc is
+ % typeset in cmr, characters such as _ would come out wrong; we
+ % have to do the usual translation tricks.
+ \entry{#1}{#2}%
\endgroup}
% Space between chapter (or whatever) number and the title.
@@ -3328,37 +4425,29 @@ 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.
@@ -3369,8 +4458,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.
@@ -3378,36 +4466,43 @@ width0pt\relax} \fi
% But \@ or @@ will get a plain tex @ character.
\def\tex{\begingroup
-\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
-\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
-\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
-\catcode `\%=14
-\catcode 43=12 % plus
-\catcode`\"=12
-\catcode`\==12
-\catcode`\|=12
-\catcode`\<=12
-\catcode`\>=12
-\escapechar=`\\
-%
-\let\,=\ptexcomma
-\let\~=\ptextilde
-\let\{=\ptexlbrace
-\let\}=\ptexrbrace
-\let\.=\ptexdot
-\let\*=\ptexstar
-\let\dots=\ptexdots
-\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}
-\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}
-\def\@{@}%
-\let\bullet=\ptexbullet
-\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext
-%
+ \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+ \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+ \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
+ \catcode `\%=14
+ \catcode `\+=\other
+ \catcode `\"=\other
+ \catcode `\==\other
+ \catcode `\|=\other
+ \catcode `\<=\other
+ \catcode `\>=\other
+ \escapechar=`\\
+ %
+ \let\b=\ptexb
+ \let\bullet=\ptexbullet
+ \let\c=\ptexc
+ \let\,=\ptexcomma
+ \let\.=\ptexdot
+ \let\dots=\ptexdots
+ \let\equiv=\ptexequiv
+ \let\!=\ptexexclam
+ \let\i=\ptexi
+ \let\indent=\ptexindent
+ \let\{=\ptexlbrace
+ \let\+=\tabalign
+ \let\}=\ptexrbrace
+ \let\/=\ptexslash
+ \let\*=\ptexstar
+ \let\t=\ptext
+ %
+ \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+ \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+ \def\@{@}%
\let\Etex=\endgroup}
-% Define @lisp ... @endlisp.
+% 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
@@ -3436,19 +4531,30 @@ width0pt\relax} \fi
% Make spacing and below environment symmetrical. We use \parskip here
% to help in doing that, since in @example-like environments \parskip
% is reset to zero; thus the \afterenvbreak inserts no space -- but the
-% start of the next paragraph will insert \parskip
+% 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{{%
+ % =10000 instead of <10000 because of a special case in \itemzzz, q.v.
+ \ifnum \lastpenalty=10000 \else
+ \advance\envskipamount by \parskip
+ \endgraf
+ \ifdim\lastskip<\envskipamount
+ \removelastskip
+ % it's not a good place to break if the last penalty was \nobreak
+ % or better ...
+ \ifnum\lastpenalty>10000 \else \penalty-50 \fi
+ \vskip\envskipamount
+ \fi
+ \fi
+}}
\let\afterenvbreak = \aboveenvbreak
% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
\let\nonarrowing=\relax
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \cartouche: draw rectangle w/rounded corners around argument
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
\font\circle=lcircle10
\newdimen\circthick
\newdimen\cartouter\newdimen\cartinner
@@ -3468,16 +4574,17 @@ width0pt\relax} \fi
%
\newskip\lskip\newskip\rskip
-\long\def\cartouche{%
+\def\cartouche{%
+\par % can't be in the midst of a paragraph.
\begingroup
\lskip=\leftskip \rskip=\rightskip
\leftskip=0pt\rightskip=0pt %we want these *outside*.
\cartinner=\hsize \advance\cartinner by-\lskip
\advance\cartinner by-\rskip
\cartouter=\hsize
- \advance\cartouter by 18pt % allow for 3pt kerns on either
+ \advance\cartouter by 18.4pt % allow for 3pt kerns on either
% side, and for 6pt waste from
-% each corner char
+% each corner char, and rule thickness
\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
% Flag to tell @lisp, etc., not to narrow margin.
\let\nonarrowing=\comment
@@ -3515,7 +4622,6 @@ width0pt\relax} \fi
\inENV % This group ends at the end of the body
\hfuzz = 12pt % Don't be fussy
\sepspaces % Make spaces be word-separators rather than space tokens.
- \singlespace
\let\par = \lisppar % don't ignore blank lines
\obeylines % each line of input is a line of output
\parskip = 0pt
@@ -3531,56 +4637,57 @@ width0pt\relax} \fi
\fi
}
-% To ending an @example-like environment, we first end the paragraph
-% (via \afterenvbreak's vertical glue), and then the group. That way we
-% keep the zero \parskip that the environments set -- \parskip glue
-% will be inserted at the beginning of the next paragraph in the
-% document, after the environment.
+% Define the \E... control sequence only if we are inside the particular
+% environment, so the error checking in \end will work.
%
-\def\nonfillfinish{\afterenvbreak\endgroup}%
+% To end an @example-like environment, we first end the paragraph (via
+% \afterenvbreak's vertical glue), and then the group. That way we keep
+% the zero \parskip that the environments set -- \parskip glue will be
+% inserted at the beginning of the next paragraph in the document, after
+% the environment.
+%
+\def\nonfillfinish{\afterenvbreak\endgroup}
-% This macro is
+% @lisp: indented, narrowed, typewriter font.
\def\lisp{\begingroup
\nonfillstart
\let\Elisp = \nonfillfinish
\tt
- \rawbackslash % have \ input char produce \ char from current font
- \gobble
+ \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+ \gobble % eat return
}
-% Define the \E... control sequence only if we are inside the
-% environment, so the error checking in \end will work.
-%
-% We must call \lisp last in the definition, since it reads the
-% return following the @example (or whatever) command.
-%
+% @example: Same as @lisp.
\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
-\def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp}
-\def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
-% @smallexample and @smalllisp. This is not used unless the @smallbook
-% command is given. Originally contributed by Pavel@xerox.
-%
-\def\smalllispx{\begingroup
- \nonfillstart
- \let\Esmalllisp = \nonfillfinish
- \let\Esmallexample = \nonfillfinish
- %
- % Smaller fonts for small examples.
- \indexfonts \tt
- \rawbackslash % make \ output the \ character from the current font (tt)
- \gobble
+% @smallexample and @smalllisp: use smaller fonts.
+% Originally contributed by Pavel@xerox.
+\def\smalllisp{\begingroup
+ \def\Esmalllisp{\nonfillfinish\endgroup}%
+ \def\Esmallexample{\nonfillfinish\endgroup}%
+ \smallexamplefonts
+ \lisp
}
+\let\smallexample = \smalllisp
+
-% This is @display; same as @lisp except use roman font.
+% @display: same as @lisp except keep current font.
%
\def\display{\begingroup
\nonfillstart
\let\Edisplay = \nonfillfinish
\gobble
}
+%
+% @smalldisplay: @display plus smaller fonts.
+%
+\def\smalldisplay{\begingroup
+ \def\Esmalldisplay{\nonfillfinish\endgroup}%
+ \smallexamplefonts \rm
+ \display
+}
-% This is @format; same as @display except don't narrow margins.
+% @format: same as @display except don't narrow margins.
%
\def\format{\begingroup
\let\nonarrowing = t
@@ -3588,21 +4695,29 @@ width0pt\relax} \fi
\let\Eformat = \nonfillfinish
\gobble
}
-
-% @flushleft (same as @format) and @flushright.
%
-\def\flushleft{\begingroup
- \let\nonarrowing = t
- \nonfillstart
- \let\Eflushleft = \nonfillfinish
- \gobble
+% @smallformat: @format plus smaller fonts.
+%
+\def\smallformat{\begingroup
+ \def\Esmallformat{\nonfillfinish\endgroup}%
+ \smallexamplefonts \rm
+ \format
}
+
+% @flushleft (same as @format).
+%
+\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
+
+% @flushright.
+%
\def\flushright{\begingroup
\let\nonarrowing = t
\nonfillstart
\let\Eflushright = \nonfillfinish
\advance\leftskip by 0pt plus 1fill
- \gobble}
+ \gobble
+}
+
% @quotation does normal linebreaking (hence we can't use \nonfillstart)
% and narrows the margins.
@@ -3610,7 +4725,6 @@ width0pt\relax} \fi
\def\quotation{%
\begingroup\inENV %This group ends at the end of the @quotation body
{\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
- \singlespace
\parindent=0pt
% We have retained a nonzero parskip for the environment, since we're
% doing normal filling. So to avoid extra space below the environment...
@@ -3625,22 +4739,258 @@ width0pt\relax} \fi
\fi
}
+
+% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
+% If we want to allow any <char> as delimiter,
+% we need the curly braces so that makeinfo sees the @verb command, eg:
+% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
+%
+% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
+%
+% [Knuth] p.344; only we need to do the other characters Texinfo sets
+% active too. Otherwise, they get lost as the first character on a
+% verbatim line.
+\def\dospecials{%
+ \do\ \do\\\do\{\do\}\do\$\do\&%
+ \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
+ \do\<\do\>\do\|\do\@\do+\do\"%
+}
+%
+% [Knuth] p. 380
+\def\uncatcodespecials{%
+ \def\do##1{\catcode`##1=12}\dospecials}
+%
+% [Knuth] pp. 380,381,391
+% Disable Spanish ligatures ?` and !` of \tt font
+\begingroup
+ \catcode`\`=\active\gdef`{\relax\lq}
+\endgroup
+%
+% Setup for the @verb command.
+%
+% Eight spaces for a tab
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
+\endgroup
+%
+\def\setupverb{%
+ \tt % easiest (and conventionally used) font for verbatim
+ \def\par{\leavevmode\endgraf}%
+ \catcode`\`=\active
+ \tabeightspaces
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count
+ % must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+}
+
+% Setup for the @verbatim environment
+%
+% Real tab expansion
+\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
+%
+\def\starttabbox{\setbox0=\hbox\bgroup}
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabexpand{%
+ \catcode`\^^I=\active
+ \def^^I{\leavevmode\egroup
+ \dimen0=\wd0 % the width so far, or since the previous tab
+ \divide\dimen0 by\tabw
+ \multiply\dimen0 by\tabw % compute previous multiple of \tabw
+ \advance\dimen0 by\tabw % advance to next multiple of \tabw
+ \wd0=\dimen0 \box0 \starttabbox
+ }%
+ }
+\endgroup
+\def\setupverbatim{%
+ % Easiest (and conventionally used) font for verbatim
+ \tt
+ \def\par{\leavevmode\egroup\box0\endgraf}%
+ \catcode`\`=\active
+ \tabexpand
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count
+ % must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+ \everypar{\starttabbox}%
+}
+
+% Do the @verb magic: verbatim text is quoted by unique
+% delimiter characters. Before first delimiter expect a
+% right brace, after last delimiter expect closing brace:
+%
+% \def\doverb'{'<char>#1<char>'}'{#1}
+%
+% [Knuth] p. 382; only eat outer {}
+\begingroup
+ \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12
+ \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
+\endgroup
+%
+\def\verb{\begingroup\setupverb\doverb}
+%
+%
+% Do the @verbatim magic: define the macro \doverbatim so that
+% the (first) argument ends when '@end verbatim' is reached, ie:
+%
+% \def\doverbatim#1@end verbatim{#1}
+%
+% For Texinfo it's a lot easier than for LaTeX,
+% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
+% we need not redefine '\', '{' and '}'.
+%
+% Inspired by LaTeX's verbatim command set [latex.ltx]
+%% Include LaTeX hack for completeness -- never know
+%% \begingroup
+%% \catcode`|=0 \catcode`[=1
+%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active
+%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[
+%% #1|endgroup|def|Everbatim[]|end[verbatim]]
+%% |endgroup
+%
+\begingroup
+ \catcode`\ =\active
+ \obeylines %
+ % ignore everything up to the first ^^M, that's the newline at the end
+ % of the @verbatim input line itself. Otherwise we get an extra blank
+ % line in the output.
+ \gdef\doverbatim#1^^M#2@end verbatim{#2\end{verbatim}}%
+\endgroup
+%
+\def\verbatim{%
+ \def\Everbatim{\nonfillfinish\endgroup}%
+ \begingroup
+ \nonfillstart
+ \advance\leftskip by -\defbodyindent
+ \begingroup\setupverbatim\doverbatim
+}
+
+% @verbatiminclude FILE - insert text of file in verbatim environment.
+%
+% Allow normal characters that we make active in the argument (a file name).
+\def\verbatiminclude{%
+ \begingroup
+ \catcode`\\=\other
+ \catcode`~=\other
+ \catcode`^=\other
+ \catcode`_=\other
+ \catcode`|=\other
+ \catcode`<=\other
+ \catcode`>=\other
+ \catcode`+=\other
+ \parsearg\doverbatiminclude
+}
+\def\setupverbatiminclude{%
+ \begingroup
+ \nonfillstart
+ \advance\leftskip by -\defbodyindent
+ \begingroup\setupverbatim
+}
+%
+\def\doverbatiminclude#1{%
+ % Restore active chars for included file.
+ \endgroup
+ \begingroup
+ \let\value=\expandablevalue
+ \def\thisfile{#1}%
+ \expandafter\expandafter\setupverbatiminclude\input\thisfile
+ \endgroup
+ \nonfillfinish
+ \endgroup
+}
+
+% @copying ... @end copying.
+% Save the text away for @insertcopying later. Many commands won't be
+% allowed in this context, but that's ok.
+%
+% We save the uninterpreted tokens, rather than creating a box.
+% Saving the text in a box would be much easier, but then all the
+% typesetting commands (@smallbook, font changes, etc.) have to be done
+% beforehand -- and a) we want @copying to be done first in the source
+% file; b) letting users define the frontmatter in as flexible order as
+% possible is very desirable.
+%
+\def\copying{\begingroup
+ % Define a command to swallow text until we reach `@end copying'.
+ % \ is the escape char in this texinfo.tex file, so it is the
+ % delimiter for the command; @ will be the escape char when we read
+ % it, but that doesn't matter.
+ \long\def\docopying##1\end copying{\gdef\copyingtext{##1}\enddocopying}%
+ %
+ % We must preserve ^^M's in the input file; see \insertcopying below.
+ \catcode`\^^M = \active
+ \docopying
+}
+
+% What we do to finish off the copying text.
+%
+\def\enddocopying{\endgroup\ignorespaces}
+
+% @insertcopying. Here we must play games with ^^M's. On the one hand,
+% we need them to delimit commands such as `@end quotation', so they
+% must be active. On the other hand, we certainly don't want every
+% end-of-line to be a \par, as would happen with the normal active
+% definition of ^^M. On the third hand, two ^^M's in a row should still
+% generate a \par.
+%
+% Our approach is to make ^^M insert a space and a penalty1 normally;
+% then it can also check if \lastpenalty=1. If it does, then manually
+% do \par.
+%
+% This messes up the normal definitions of @c[omment], so we redefine
+% it. Similarly for @ignore. (These commands are used in the gcc
+% manual for man page generation.)
+%
+% Seems pretty fragile, most line-oriented commands will presumably
+% fail, but for the limited use of getting the copying text (which
+% should be quite simple) inserted, we can hope it's ok.
+%
+{\catcode`\^^M=\active %
+\gdef\insertcopying{\begingroup %
+ \parindent = 0pt % looks wrong on title page
+ \def^^M{%
+ \ifnum \lastpenalty=1 %
+ \par %
+ \else %
+ \space \penalty 1 %
+ \fi %
+ }%
+ %
+ % Fix @c[omment] for catcode 13 ^^M's.
+ \def\c##1^^M{\ignorespaces}%
+ \let\comment = \c %
+ %
+ % Don't bother jumping through all the hoops that \doignore does, it
+ % would be very hard since the catcodes are already set.
+ \long\def\ignore##1\end ignore{\ignorespaces}%
+ %
+ \copyingtext %
+\endgroup}%
+}
+
\message{defuns,}
-% Define formatter for defuns
-% First, allow user to change definition object font (\df) internally
-\def\setdeffont #1 {\csname DEF#1\endcsname}
+% @defun etc.
+
+% Allow user to change definition object font (\df) internally
+\def\setdeffont#1 {\csname DEF#1\endcsname}
\newskip\defbodyindent \defbodyindent=.4in
\newskip\defargsindent \defargsindent=50pt
-\newskip\deftypemargin \deftypemargin=12pt
\newskip\deflastargmargin \deflastargmargin=18pt
\newcount\parencount
-% define \functionparens, which makes ( and ) and & do special things.
-% \functionparens affects the group it is contained in.
+
+% We want ()&[] to print specially on the defun line.
+%
\def\activeparens{%
-\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
-\catcode`\[=\active \catcode`\]=\active}
+ \catcode`\(=\active \catcode`\)=\active
+ \catcode`\&=\active
+ \catcode`\[=\active \catcode`\]=\active
+}
% Make control sequences which act like normal parenthesis chars.
\let\lparen = ( \let\rparen = )
@@ -3661,16 +5011,17 @@ width0pt\relax} \fi
% Definitions of (, ) and & used in args for functions.
% This is the definition of ( outside of all parentheses.
-\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
-\global\advance\parencount by 1 }
+\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
+ \global\advance\parencount by 1
+}
%
% This is the definition of ( when already inside a level of parens.
\gdef\opnested{\char`\(\global\advance\parencount by 1 }
%
\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
-% also in that case restore the outer-level definition of (.
-\ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
-\global\advance \parencount by -1 }
+ % also in that case restore the outer-level definition of (.
+ \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
+ \global\advance \parencount by -1 }
% If we encounter &foo, then turn on ()-hacking afterwards
\gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
%
@@ -3678,116 +5029,182 @@ width0pt\relax} \fi
} % End of definition inside \activeparens
%% These parens (in \boldbrax) actually are a little bolder than the
%% contained text. This is especially needed for [ and ]
-\def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
-\def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}}
-
-% First, defname, which formats the header line itself.
-% #1 should be the function name.
-% #2 should be the type of definition, such as "Function".
-
-\def\defname #1#2{%
-% Get the values of \leftskip and \rightskip as they were
-% outside the @def...
-\dimen2=\leftskip
-\advance\dimen2 by -\defbodyindent
-\dimen3=\rightskip
-\advance\dimen3 by -\defbodyindent
-\noindent %
-\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
-\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
-\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
-\parshape 2 0in \dimen0 \defargsindent \dimen1 %
-% Now output arg 2 ("Function" or some such)
-% ending at \deftypemargin from the right margin,
-% but stuck inside a box of width 0 so it does not interfere with linebreaking
-{% Adjust \hsize to exclude the ambient margins,
-% so that \rightline will obey them.
-\advance \hsize by -\dimen2 \advance \hsize by -\dimen3
-\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
-% Make all lines underfull and no complaints:
-\tolerance=10000 \hbadness=10000
-\advance\leftskip by -\defbodyindent
-\exdentamount=\defbodyindent
-{\df #1}\enskip % Generate function name
-}
-
-% Actually process the body of a definition
-% #1 should be the terminating control sequence, such as \Edefun.
-% #2 should be the "another name" control sequence, such as \defunx.
-% #3 should be the control sequence that actually processes the header,
-% such as \defunheader.
-
-\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup %
-\catcode 61=\active % 61 is `='
-\obeylines\activeparens\spacesplit#3}
-
-\def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
-
-\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 ##2 {\def#4{##1}%
-\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
+\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
+\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
+\let\ampnr = \&
+\def\lbrb{{\bf\char`\[}}
+\def\rbrb{{\bf\char`\]}}
-% These parsing functions are similar to the preceding ones
-% except that they do not make parens into active characters.
-% These are used for "variables" since they have no arguments.
+% Active &'s sneak into the index arguments, so make sure it's defined.
+{
+ \catcode`& = \active
+ \global\let& = \ampnr
+}
-\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2{\begingroup\obeylines\spacesplit#3}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup %
-\catcode 61=\active %
-\obeylines\spacesplit#3}
+% \defname, which formats the name of the @def (not the args).
+% #1 is the function name.
+% #2 is the type of definition, such as "Function".
+%
+\def\defname#1#2{%
+ % How we'll output the type name. Putting it in brackets helps
+ % distinguish it from the body text that may end up on the next line
+ % just below it.
+ \ifempty{#2}%
+ \def\defnametype{}%
+ \else
+ \def\defnametype{[\rm #2]}%
+ \fi
+ %
+ % Get the values of \leftskip and \rightskip as they were outside the @def...
+ \dimen2=\leftskip
+ \advance\dimen2 by -\defbodyindent
+ %
+ % Figure out values for the paragraph shape.
+ \setbox0=\hbox{\hskip \deflastargmargin{\defnametype}}%
+ \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
+ \dimen1=\hsize \advance \dimen1 by -\defargsindent % size for continuations
+ \parshape 2 0in \dimen0 \defargsindent \dimen1
+ %
+ % Output arg 2 ("Function" or some such) but stuck inside a box of
+ % width 0 so it does not interfere with linebreaking.
+ \noindent
+ %
+ {% Adjust \hsize to exclude the ambient margins,
+ % so that \rightline will obey them.
+ \advance \hsize by -\dimen2
+ \dimen3 = 0pt % was -1.25pc
+ \rlap{\rightline{\defnametype\kern\dimen3}}%
+ }%
+ %
+ % Allow all lines to be underfull without complaint:
+ \tolerance=10000 \hbadness=10000
+ \advance\leftskip by -\defbodyindent
+ \exdentamount=\defbodyindent
+ {\df #1}\enskip % output function name
+ % \defunargs will be called next to output the arguments, if any.
+}
-% This is used for \def{tp,vr}parsebody. It could probably be used for
-% some of the others, too, with some judicious conditionals.
-%
+% Common pieces to start any @def...
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence (which our caller defines).
+% #3 is the control sequence to process the header, such as \defunheader.
+%
\def\parsebodycommon#1#2#3{%
- \begingroup\inENV %
- \medbreak %
- % Define the end token that this defining construct specifies
+ \begingroup\inENV
+ % If there are two @def commands in a row, we'll have a \nobreak,
+ % which is there to keep the function description together with its
+ % header. But if there's nothing but headers, we want to allow a
+ % break after all. Check for penalty 10002 (inserted by
+ % \defargscommonending) instead of 10000, since the sectioning
+ % commands insert a \penalty10000, and we don't want to allow a break
+ % between a section heading and a defun.
+ \ifnum\lastpenalty=10002 \penalty0 \fi
+ \medbreak
+ %
+ % Define the \E... end token that this defining construct specifies
% so that it will exit this group.
\def#1{\endgraf\endgroup\medbreak}%
- \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
+ %
\parindent=0in
- \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
+ \advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
+}
+
+% Common part of the \...x definitions.
+%
+\def\defxbodycommon{%
+ % As with \parsebodycommon above, allow line break if we have multiple
+ % x headers in a row. It's not a great place, though.
+ \ifnum\lastpenalty=10000 \penalty1000 \fi
+ %
\begingroup\obeylines
}
+% Process body of @defun, @deffn, @defmac, etc.
+%
+\def\defparsebody#1#2#3{%
+ \parsebodycommon{#1}{#2}{#3}%
+ \def#2{\defxbodycommon \activeparens \spacesplit#3}%
+ \catcode\equalChar=\active
+ \begingroup\obeylines\activeparens
+ \spacesplit#3%
+}
+
+% #1, #2, #3 are the common arguments (see \parsebodycommon above).
+% #4, delimited by the space, is the class name.
+%
+\def\defmethparsebody#1#2#3#4 {%
+ \parsebodycommon{#1}{#2}{#3}%
+ \def#2##1 {\defxbodycommon \activeparens \spacesplit{#3{##1}}}%
+ \begingroup\obeylines\activeparens
+ % The \empty here prevents misinterpretation of a construct such as
+ % @deffn {whatever} {Enharmonic comma}
+ % See comments at \deftpparsebody, although in our case we don't have
+ % to remove the \empty afterwards, since it is empty.
+ \spacesplit{#3{#4}}\empty
+}
+
+% Used for @deftypemethod and @deftypeivar.
+% #1, #2, #3 are the common arguments (see \defparsebody).
+% #4, delimited by a space, is the class name.
+% #5 is the method's return type.
+%
+\def\deftypemethparsebody#1#2#3#4 #5 {%
+ \parsebodycommon{#1}{#2}{#3}%
+ \def#2##1 ##2 {\defxbodycommon \activeparens \spacesplit{#3{##1}{##2}}}%
+ \begingroup\obeylines\activeparens
+ \spacesplit{#3{#4}{#5}}%
+}
+
+% Used for @deftypeop. The change from \deftypemethparsebody is an
+% extra argument at the beginning which is the `category', instead of it
+% being the hardwired string `Method' or `Instance Variable'. We have
+% to account for this both in the \...x definition and in parsing the
+% input at hand. Thus also need a control sequence (passed as #5) for
+% the \E... definition to assign the category name to.
+%
+\def\deftypeopparsebody#1#2#3#4#5 #6 {%
+ \parsebodycommon{#1}{#2}{#3}%
+ \def#2##1 ##2 ##3 {\def#4{##1}%
+ \defxbodycommon \activeparens \spacesplit{#3{##2}{##3}}}%
+ \begingroup\obeylines\activeparens
+ \spacesplit{#3{#5}{#6}}%
+}
+
+% For @defop.
+\def\defopparsebody #1#2#3#4#5 {%
+ \parsebodycommon{#1}{#2}{#3}%
+ \def#2##1 ##2 {\def#4{##1}%
+ \defxbodycommon \activeparens \spacesplit{#3{##2}}}%
+ \begingroup\obeylines\activeparens
+ \spacesplit{#3{#5}}%
+}
+
+% These parsing functions are similar to the preceding ones
+% except that they do not make parens into active characters.
+% These are used for "variables" since they have no arguments.
+%
+\def\defvarparsebody #1#2#3{%
+ \parsebodycommon{#1}{#2}{#3}%
+ \def#2{\defxbodycommon \spacesplit#3}%
+ \catcode\equalChar=\active
+ \begingroup\obeylines
+ \spacesplit#3%
+}
+
+% @defopvar.
+\def\defopvarparsebody #1#2#3#4#5 {%
+ \parsebodycommon{#1}{#2}{#3}%
+ \def#2##1 ##2 {\def#4{##1}%
+ \defxbodycommon \spacesplit{#3{##2}}}%
+ \begingroup\obeylines
+ \spacesplit{#3{#5}}%
+}
+
\def\defvrparsebody#1#2#3#4 {%
\parsebodycommon{#1}{#2}{#3}%
+ \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}%
+ \begingroup\obeylines
\spacesplit{#3{#4}}%
}
@@ -3802,64 +5219,64 @@ width0pt\relax} \fi
%
\def\deftpparsebody #1#2#3#4 {%
\parsebodycommon{#1}{#2}{#3}%
+ \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}%
+ \begingroup\obeylines
\spacesplit{\parsetpheaderline{#3{#4}}}\empty
}
% Fine, but then we have to eventually remove the \empty *and* the
% braces (if any). That's what this does.
-%
+%
\def\removeemptybraces\empty#1\relax{#1}
% After \spacesplit has done its work, this is called -- #1 is the final
% thing to call, #2 the type name (which starts with \empty), and #3
% (which might be empty) the arguments.
-%
+%
\def\parsetpheaderline#1#2#3{%
#1{\removeemptybraces#2\relax}{#3}%
}%
-\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 ##2 {\def#4{##1}%
-\begingroup\obeylines\spacesplit{#3{##2}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\spacesplit{#3{#5}}}
-
-% Split up #2 at the first space token.
+% Split up #2 (the rest of the input line) at the first space token.
% call #1 with two arguments:
% the first is all of #2 before the space token,
% the second is all of #2 after that space token.
% If #2 contains no space token, all of it is passed as the first arg
% and the second is passed as empty.
-
-{\obeylines
-\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
-\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
-\ifx\relax #3%
-#1{#2}{}\else #1{#2}{#3#4}\fi}}
-
-% So much for the things common to all kinds of definitions.
+%
+{\obeylines %
+ \gdef\spacesplit#1#2^^M{\endgroup\spacesplitx{#1}#2 \relax\spacesplitx}%
+ \long\gdef\spacesplitx#1#2 #3#4\spacesplitx{%
+ \ifx\relax #3%
+ #1{#2}{}%
+ \else %
+ #1{#2}{#3#4}%
+ \fi}%
+}
% Define @defun.
-% First, define the processing that is wanted for arguments of \defun
-% Use this to expand the args and terminate the paragraph they make up
+% This is called to end the arguments processing for all the @def... commands.
+%
+\def\defargscommonending{%
+ \interlinepenalty = 10000
+ \advance\rightskip by 0pt plus 1fil
+ \endgraf
+ \nobreak\vskip -\parskip
+ \penalty 10002 % signal to \parsebodycommon.
+}
-\def\defunargs #1{\functionparens \sl
+% This expands the args and terminates the paragraph they comprise.
+%
+\def\defunargs#1{\functionparens \sl
% Expand, preventing hyphenation at `-' chars.
% Note that groups don't affect changes in \hyphenchar.
-\hyphenchar\tensl=0
+% Set the font temporarily and use \font in case \setfont made \tensl a macro.
+{\tensl\hyphenchar\font=0}%
#1%
-\hyphenchar\tensl=45
-\ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
-\interlinepenalty=10000
-\advance\rightskip by 0pt plus 1fil
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
+{\tensl\hyphenchar\font=45}%
+\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
+ \defargscommonending
}
\def\deftypefunargs #1{%
@@ -3868,9 +5285,7 @@ width0pt\relax} \fi
% Use \boldbraxnoamp, not \functionparens, so that & is not special.
\boldbraxnoamp
\tclose{#1}% avoid \code because of side effects on active chars
-\interlinepenalty=10000
-\advance\rightskip by 0pt plus 1fil
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
+ \defargscommonending
}
% Do complete processing of one @defun or @defunx line already parsed.
@@ -3881,7 +5296,7 @@ width0pt\relax} \fi
\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @defun == @deffn Function
@@ -3889,9 +5304,9 @@ width0pt\relax} \fi
\def\defun{\defparsebody\Edefun\defunx\defunheader}
\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Function}%
+\begingroup\defname {#1}{\putwordDeffunc}%
\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @deftypefun int foobar (int @var{foo}, float @var{bar})
@@ -3903,18 +5318,18 @@ 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}{Function}%
+\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}%
\deftypefunargs {#3}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
-% \defheaderxcond#1\relax$$$
+% \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}
@@ -3924,9 +5339,9 @@ 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
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @defmac == @deffn Macro
@@ -3934,9 +5349,9 @@ width0pt\relax} \fi
\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Macro}%
+\begingroup\defname {#1}{\putwordDefmac}%
\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @defspec == @deffn Special Form
@@ -3944,42 +5359,80 @@ width0pt\relax} \fi
\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Special Form}%
+\begingroup\defname {#1}{\putwordDefspec}%
\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
-% This definition is run if you use @defunx
-% anywhere other than immediately after a @defun or @defunx.
-
-\def\deffnx #1 {\errmessage{@deffnx in invalid context}}
-\def\defunx #1 {\errmessage{@defunx in invalid context}}
-\def\defmacx #1 {\errmessage{@defmacx in invalid context}}
-\def\defspecx #1 {\errmessage{@defspecx in invalid context}}
-\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
-\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
-
-% @defmethod, and so on
-
-% @defop {Funny Method} foo-class frobnicate argument
-
+% @defop CATEGORY CLASS OPERATION ARG...
+%
\def\defop #1 {\def\defoptype{#1}%
\defopparsebody\Edefop\defopx\defopheader\defoptype}
+%
+\def\defopheader#1#2#3{%
+ \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% function index entry
+ \begingroup
+ \defname{#2}{\defoptype\ \putwordon\ #1}%
+ \defunargs{#3}%
+ \endgroup
+}
-\def\defopheader #1#2#3{%
-\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
-\begingroup\defname {#2}{\defoptype{} on #1}%
-\defunargs {#3}\endgroup %
+% @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
+%
+\def\deftypeop #1 {\def\deftypeopcategory{#1}%
+ \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader
+ \deftypeopcategory}
+%
+% #1 is the class name, #2 the data type, #3 the operation name, #4 the args.
+\def\deftypeopheader#1#2#3#4{%
+ \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$.$#3}
+ {\deftypeopcategory\ \putwordon\ \code{#1}}%
+ \deftypefunargs{#4}%
+ \endgroup
}
-% @defmethod == @defop Method
+% @deftypemethod CLASS TYPE METHOD ARG...
+%
+\def\deftypemethod{%
+ \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
+%
+% #1 is the class name, #2 the data type, #3 the method name, #4 the args.
+\def\deftypemethodheader#1#2#3#4{%
+ \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}%
+ \deftypefunargs{#4}%
+ \endgroup
+}
-\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
+% @deftypeivar CLASS TYPE VARNAME
+%
+\def\deftypeivar{%
+ \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader}
+%
+% #1 is the class name, #2 the data type, #3 the variable name.
+\def\deftypeivarheader#1#2#3{%
+ \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$.$#3}
+ {\putwordInstanceVariableof\ \code{#1}}%
+ \defvarargs{#3}%
+ \endgroup
+}
-\def\defmethodheader #1#2#3{%
-\dosubind {fn}{\code{#2}}{on #1}% entry in function index
-\begingroup\defname {#2}{Method on #1}%
-\defunargs {#3}\endgroup %
+% @defmethod == @defop Method
+%
+\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
+%
+% #1 is the class name, #2 the method name, #3 the args.
+\def\defmethodheader#1#2#3{%
+ \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{#2}{\putwordMethodon\ \code{#1}}%
+ \defunargs{#3}%
+ \endgroup
}
% @defcv {Class Option} foo-class foo-flag
@@ -3988,37 +5441,32 @@ width0pt\relax} \fi
\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
\def\defcvarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
-\begingroup\defname {#2}{\defcvtype{} of #1}%
-\defvarargs {#3}\endgroup %
+ \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% variable index entry
+ \begingroup
+ \defname{#2}{\defcvtype\ \putwordof\ #1}%
+ \defvarargs{#3}%
+ \endgroup
}
-% @defivar == @defcv {Instance Variable}
-
+% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
+%
\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
-
-\def\defivarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
-\begingroup\defname {#2}{Instance Variable of #1}%
-\defvarargs {#3}\endgroup %
+%
+\def\defivarheader#1#2#3{%
+ \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% entry in var index
+ \begingroup
+ \defname{#2}{\putwordInstanceVariableof\ #1}%
+ \defvarargs{#3}%
+ \endgroup
}
-% These definitions are run if you use @defmethodx, etc.,
-% anywhere other than immediately after a @defmethod, etc.
-
-\def\defopx #1 {\errmessage{@defopx in invalid context}}
-\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
-\def\defcvx #1 {\errmessage{@defcvx in invalid context}}
-\def\defivarx #1 {\errmessage{@defivarx in invalid context}}
-
-% Now @defvar
-
+% @defvar
% First, define the processing that is wanted for arguments of @defvar.
% This is actually simple: just print them in roman.
% This must expand the args and terminate the paragraph they make up
\def\defvarargs #1{\normalparens #1%
-\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000}
+ \defargscommonending
+}
% @defvr Counter foo-count
@@ -4032,7 +5480,7 @@ width0pt\relax} \fi
\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{Variable}%
+\begingroup\defname {#1}{\putwordDefvar}%
\defvarargs {#2}\endgroup %
}
@@ -4041,7 +5489,7 @@ width0pt\relax} \fi
\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{User Option}%
+\begingroup\defname {#1}{\putwordDefopt}%
\defvarargs {#2}\endgroup %
}
@@ -4053,9 +5501,8 @@ 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}{Variable}%
-\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000
+\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
+ \defargscommonending
\endgroup}
\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
@@ -4064,20 +5511,10 @@ width0pt\relax} \fi
\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
-\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
-\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000
+\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
+ \defargscommonending
\endgroup}
-% This definition is run if you use @defvarx
-% anywhere other than immediately after a @defvar or @defvarx.
-
-\def\defvrx #1 {\errmessage{@defvrx in invalid context}}
-\def\defvarx #1 {\errmessage{@defvarx in invalid context}}
-\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
-\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
-\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
-
% Now define @deftp
% Args are printed in bold, a slight difference from @defvar.
@@ -4090,51 +5527,403 @@ width0pt\relax} \fi
\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
-% This definition is run if you use @deftpx, etc
-% anywhere other than immediately after a @deftp, etc.
+% These definitions are used if you use @defunx (etc.)
+% anywhere other than immediately after a @defun or @defunx.
+%
+\def\defcvx#1 {\errmessage{@defcvx in invalid context}}
+\def\deffnx#1 {\errmessage{@deffnx in invalid context}}
+\def\defivarx#1 {\errmessage{@defivarx in invalid context}}
+\def\defmacx#1 {\errmessage{@defmacx in invalid context}}
+\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}}
+\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
+\def\defopx#1 {\errmessage{@defopx in invalid context}}
+\def\defspecx#1 {\errmessage{@defspecx in invalid context}}
+\def\deftpx#1 {\errmessage{@deftpx in invalid context}}
+\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}}
+\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}}
+\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}}
+\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}}
+\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}}
+\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}}
+\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}}
+\def\defunx#1 {\errmessage{@defunx in invalid context}}
+\def\defvarx#1 {\errmessage{@defvarx in invalid context}}
+\def\defvrx#1 {\errmessage{@defvrx in invalid context}}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\undefined
+ \newwrite\macscribble
+ \def\scanmacro#1{%
+ \begingroup \newlinechar`\^^M
+ % Undo catcode changes of \startcontents and \doprintindex
+ \catcode`\@=0 \catcode`\\=\other \escapechar=`\@
+ % Append \endinput to make sure that TeX does not see the ending newline.
+ \toks0={#1\endinput}%
+ \immediate\openout\macscribble=\jobname.tmp
+ \immediate\write\macscribble{\the\toks0}%
+ \immediate\closeout\macscribble
+ \let\xeatspaces\eatspaces
+ \input \jobname.tmp
+ \endgroup
+}
+\else
+\def\scanmacro#1{%
+\begingroup \newlinechar`\^^M
+% Undo catcode changes of \startcontents and \doprintindex
+\catcode`\@=0 \catcode`\\=\other \escapechar=`\@
+\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
+\fi
+
+\newcount\paramno % Count of parameters
+\newtoks\macname % Macro name
+\newif\ifrecursive % Is it recursive?
+\def\macrolist{} % List of all defined macros in the form
+ % \do\macro1\do\macro2...
+
+% Utility routines.
+% Thisdoes \let #1 = #2, except with \csnames.
+\def\cslet#1#2{%
+\expandafter\expandafter
+\expandafter\let
+\expandafter\expandafter
+\csname#1\endcsname
+\csname#2\endcsname}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=\other \catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \.
+
+% It's necessary to have hard CRs when the macro is executed. This is
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
+% body, and then making it the \newlinechar in \scanmacro.
+
+\def\macrobodyctxt{%
+ \catcode`\~=\other
+ \catcode`\^=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\+=\other
+ \catcode`\{=\other
+ \catcode`\}=\other
+ \catcode`\@=\other
+ \catcode`\^^M=\other
+ \usembodybackslash}
+
+\def\macroargctxt{%
+ \catcode`\~=\other
+ \catcode`\^=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\+=\other
+ \catcode`\@=\other
+ \catcode`\\=\other}
-\def\deftpx #1 {\errmessage{@deftpx in invalid context}}
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+{\catcode`@=0 @catcode`@\=@active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
-\message{cross reference,}
-% Define cross-reference macros
-\newwrite \auxfile
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
+
+\def\macroxxx#1{%
+ \getargs{#1}% now \macname is the macname and \argl the arglist
+ \ifx\argl\empty % no arguments
+ \paramno=0%
+ \else
+ \expandafter\parsemargdef \argl;%
+ \fi
+ \if1\csname ismacro.\the\macname\endcsname
+ \message{Warning: redefining \the\macname}%
+ \else
+ \expandafter\ifx\csname \the\macname\endcsname \relax
+ \else \errmessage{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
+ \toks0 = \expandafter{\macrolist\do}%
+ \xdef\macrolist{\the\toks0
+ \expandafter\noexpand\csname\the\macname\endcsname}%
+ \fi
+ \begingroup \macrobodyctxt
+ \ifrecursive \expandafter\parsermacbody
+ \else \expandafter\parsemacbody
+ \fi}
+
+\def\unmacro{\parsearg\dounmacro}
+\def\dounmacro#1{%
+ \if1\csname ismacro.#1\endcsname
+ \global\cslet{#1}{macsave.#1}%
+ \global\expandafter\let \csname ismacro.#1\endcsname=0%
+ % Remove the macro name from \macrolist:
+ \begingroup
+ \expandafter\let\csname#1\endcsname \relax
+ \let\do\unmacrodo
+ \xdef\macrolist{\macrolist}%
+ \endgroup
+ \else
+ \errmessage{Macro #1 not defined}%
+ \fi
+}
+
+% Called by \do from \dounmacro on each macro. The idea is to omit any
+% macro definitions that have been changed to \relax.
+%
+\def\unmacrodo#1{%
+ \ifx#1\relax
+ % remove this
+ \else
+ \noexpand\do \noexpand #1%
+ \fi
+}
+
+% This makes use of the obscure feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname #1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+
+% Parse the optional {params} list. Set up \paramno and \paramlist
+% so \defmacro knows what to do. Define \macarg.blah for each blah
+% in the params list, to be ##N where N is the position in that list.
+% That gets used by \mbodybackslash (above).
+
+% We need to get `macro parameter char #' into several definitions.
+% The technique used is stolen from LaTeX: let \hash be something
+% unexpandable, insert that wherever you need a #, and then redefine
+% it to # just before using the token list produced.
+%
+% The same technique is used to protect \eatspaces till just before
+% the macro is used.
+
+\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
+ \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
+\def\parsemargdefxxx#1,{%
+ \if#1;\let\next=\relax
+ \else \let\next=\parsemargdefxxx
+ \advance\paramno by 1%
+ \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+ {\xeatspaces{\hash\the\paramno}}%
+ \edef\paramlist{\paramlist\hash\the\paramno,}%
+ \fi\next}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+
+\long\def\parsemacbody#1@end macro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\long\def\parsermacbody#1@end rmacro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+
+% This defines the macro itself. There are six cases: recursive and
+% nonrecursive macros of zero, one, and many arguments.
+% Much magic with \expandafter here.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in; @include reads the file inside a group.
+\def\defmacro{%
+ \let\hash=##% convert placeholders to macro parameter chars
+ \ifrecursive
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\scanmacro{\temp}}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup\noexpand\scanmacro{\temp}}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+ \fi
+ \else
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \expandafter\noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \fi
+ \fi}
-\newif\ifhavexrefs % True if xref values are known.
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {. If so it reads up to the closing }, if not, it reads the whole
+% line. Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg)
+\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+ \ifx\nchar\bgroup\else
+ \expandafter\parsearg
+ \fi \next}
+
+% We mant to disable all macros during \shipout so that they are not
+% expanded by \write.
+\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}%
+ \edef\next{\macrolist}\expandafter\endgroup\next}
+
+
+% @alias.
+% We need some trickery to remove the optional spaces around the equal
+% sign. Just make them active and then expand them all to nothing.
+\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx}
+\def\aliasxxx #1{\aliasyyy#1\relax}
+\def\aliasyyy #1=#2\relax{\ignoreactivespaces
+\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=%
+ \expandafter\noexpand\csname#2\endcsname}%
+\expandafter\endgroup\next}
+
+
+\message{cross references,}
+% @xref etc.
+
+\newwrite\auxfile
+
+\newif\ifhavexrefs % True if xref values are known.
\newif\ifwarnedxrefs % True if we warned once that they aren't known.
-% @inforef is simple.
+% @inforef is relatively simple.
\def\inforef #1{\inforefzzz #1,,,,**}
\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
node \samp{\ignorespaces#1{}}}
-% \setref{foo} defines a cross-reference point named foo.
+% @node's job is to define \lastnode.
+\def\node{\ENVcheck\parsearg\nodezzz}
+\def\nodezzz#1{\nodexxx #1,\finishnodeparse}
+\def\nodexxx#1,#2\finishnodeparse{\gdef\lastnode{#1}}
+\let\nwnode=\node
+\let\lastnode=\relax
-\def\setref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Ysectionnumberandtype}}
+% The sectioning commands (@chapter, etc.) call these.
+\def\donoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}%
+ {Ysectionnumberandtype}%
+ \global\let\lastnode=\relax
+ \fi
+}
+\def\unnumbnoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}%
+ \global\let\lastnode=\relax
+ \fi
+}
+\def\appendixnoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}%
+ {Yappendixletterandtype}%
+ \global\let\lastnode=\relax
+ \fi
+}
-\def\unnumbsetref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Ynothing}}
-\def\appendixsetref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Yappendixletterandtype}}
+% @anchor{NAME} -- define xref target at arbitrary point.
+%
+\newcount\savesfregister
+\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
+\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
+\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
+% anchor), namely NAME-title (the corresponding @chapter/etc. name),
+% NAME-pg (the page number), and NAME-snt (section number and type).
+% Called from \foonoderef.
+%
+% We have to set \indexdummies so commands such as @code in a section
+% title aren't expanded. It would be nicer not to expand the titles in
+% the first place, but there's so many layers that that is hard to do.
+%
+% Likewise, use \turnoffactive so that punctuation chars such as underscore
+% and backslash work in node names.
+%
+\def\setref#1#2{{%
+ \atdummies
+ \pdfmkdest{#1}%
+ %
+ \turnoffactive
+ \dosetq{#1-title}{Ytitle}%
+ \dosetq{#1-pg}{Ypagenumber}%
+ \dosetq{#1-snt}{#2}%
+}}
-% \xref, \pxref, and \ref generate cross-references to specified points.
-% For \xrefX, #1 is the node name, #2 the name of the Info
-% cross-reference, #3 the printed node name, #4 the name of the Info
-% file, #5 the name of the printed manual. All but the node name can be
-% omitted.
+% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual. All but the node name can be omitted.
%
\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
\def\ref#1{\xrefX[#1,,,,,,,]}
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+ \unsepspaces
\def\printedmanual{\ignorespaces #5}%
\def\printednodename{\ignorespaces #3}%
\setbox1=\hbox{\printedmanual}%
@@ -4147,7 +5936,7 @@ width0pt\relax} \fi
\else
% Use the actual chapter/section title appear inside
% the square brackets. Use the real section title if we have it.
- \ifdim \wd1>0pt%
+ \ifdim \wd1 > 0pt
% It is in another manual, so we don't have it.
\def\printednodename{\ignorespaces #1}%
\else
@@ -4168,133 +5957,170 @@ width0pt\relax} \fi
% are best written with fairly long node names, containing hyphens, this
% is a loss. Therefore, we give the text of the node name again, so it
% is as if TeX is seeing it for the first time.
+ \ifpdf
+ \leavevmode
+ \getfilename{#4}%
+ {\turnoffactive \otherbackslash
+ \ifnum\filenamelength>0
+ \startlink attr{/Border [0 0 0]}%
+ goto file{\the\filename.pdf} name{#1}%
+ \else
+ \startlink attr{/Border [0 0 0]}%
+ goto name{#1}%
+ \fi
+ }%
+ \linkcolor
+ \fi
+ %
\ifdim \wd1 > 0pt
- \putwordsection{} ``\printednodename'' in \cite{\printedmanual}%
+ \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}%
\else
% _ (for example) has to be the character _ for the purposes of the
% control sequence corresponding to the node, but it has to expand
% into the usual \leavevmode...\vrule stuff for purposes of
% printing. So we \turnoffactive for the \refx-snt, back on for the
% printing, back off for the \refx-pg.
- {\turnoffactive \refx{#1-snt}{}}%
- \space [\printednodename],\space
- \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+ {\turnoffactive \otherbackslash
+ % Only output a following space if the -snt ref is nonempty; for
+ % @unnumbered and @anchor, it won't be.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ }%
+ % output the `[mynode]' via a macro.
+ \xrefprintnodename\printednodename
+ %
+ % But we always want a comma and a space:
+ ,\space
+ %
+ % output the `page 3'.
+ \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}%
\fi
+ \endlink
\endgroup}
-% \dosetq is the interface for calls from other macros
-
-% Use \turnoffactive so that punctuation chars such as underscore
-% work in node names.
-\def\dosetq #1#2{{\let\folio=0 \turnoffactive
-\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
-\next}}
-
-% \internalsetq {foo}{page} expands into
-% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
-% When the aux file is read, ' is the escape character
+% This macro is called from \xrefX for the `[nodename]' part of xref
+% output. It's a separate macro only so it can be changed more easily,
+% since not square brackets don't work in some documents. Particularly
+% one that Bob is working on :).
+%
+\def\xrefprintnodename#1{[#1]}
-\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
+% \dosetq is called from \setref to do the actual \write (\iflinks).
+%
+\def\dosetq#1#2{%
+ {\let\folio=0%
+ \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
+ \iflinks \next \fi
+ }%
+}
-% Things to be expanded by \internalsetq
+% \internalsetq{foo}{page} expands into
+% CHARACTERS @xrdef{foo}{...expansion of \page...}
+\def\internalsetq#1#2{@xrdef{#1}{\csname #2\endcsname}}
+% Things to be expanded by \internalsetq.
+%
\def\Ypagenumber{\folio}
-
\def\Ytitle{\thissection}
-
\def\Ynothing{}
-
\def\Ysectionnumberandtype{%
-\ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
-\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
-\else \ifnum \subsubsecno=0 %
-\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
-\else %
-\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
-\fi \fi \fi }
+ \ifnum\secno=0
+ \putwordChapter@tie \the\chapno
+ \else \ifnum\subsecno=0
+ \putwordSection@tie \the\chapno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
\def\Yappendixletterandtype{%
-\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
-\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
-\else \ifnum \subsubsecno=0 %
-\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
-\else %
-\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
-\fi \fi \fi }
-
-\gdef\xreftie{'tie}
+ \ifnum\secno=0
+ \putwordAppendix@tie @char\the\appendixno{}%
+ \else \ifnum\subsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie
+ @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
% Use TeX 3.0's \inputlineno to get the line number, for better error
% messages, but if we're using an old version of TeX, don't do anything.
%
\ifx\inputlineno\thisisundefined
- \let\linenumber = \empty % Non-3.0.
+ \let\linenumber = \empty % Pre-3.0.
\else
\def\linenumber{\the\inputlineno:\space}
\fi
% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
% If its value is nonempty, SUFFIX is output afterward.
-
+%
\def\refx#1#2{%
- \expandafter\ifx\csname X#1\endcsname\relax
+ {%
+ \indexnofonts
+ \otherbackslash
+ \expandafter\global\expandafter\let\expandafter\thisrefX
+ \csname X#1\endcsname
+ }%
+ \ifx\thisrefX\relax
% If not defined, say something at least.
- $\langle$un\-de\-fined$\rangle$%
- \ifhavexrefs
- \message{\linenumber Undefined cross reference `#1'.}%
- \else
- \ifwarnedxrefs\else
- \global\warnedxrefstrue
- \message{Cross reference values unknown; you must run TeX again.}%
+ \angleleft un\-de\-fined\angleright
+ \iflinks
+ \ifhavexrefs
+ \message{\linenumber Undefined cross reference `#1'.}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
+ \fi
\fi
\fi
\else
% It's defined, so just use it.
- \csname X#1\endcsname
+ \thisrefX
\fi
#2% Output the suffix in any case.
}
% This is the macro invoked by entries in the aux file.
-\def\xrdef #1#2{{%
- \catcode`\'=\other
- \expandafter\gdef\csname X#1\endcsname{#2}%
-}}
+%
+\def\xrdef#1{\expandafter\gdef\csname X#1\endcsname}
% Read the last existing aux file, if any. No error if none exists.
\def\readauxfile{\begingroup
\catcode`\^^@=\other
- \catcode`\=\other
- \catcode`\=\other
+ \catcode`\^^A=\other
+ \catcode`\^^B=\other
\catcode`\^^C=\other
\catcode`\^^D=\other
\catcode`\^^E=\other
\catcode`\^^F=\other
\catcode`\^^G=\other
\catcode`\^^H=\other
- \catcode`\ =\other
+ \catcode`\^^K=\other
\catcode`\^^L=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode26=\other
+ \catcode`\^^N=\other
+ \catcode`\^^P=\other
+ \catcode`\^^Q=\other
+ \catcode`\^^R=\other
+ \catcode`\^^S=\other
+ \catcode`\^^T=\other
+ \catcode`\^^U=\other
+ \catcode`\^^V=\other
+ \catcode`\^^W=\other
+ \catcode`\^^X=\other
+ \catcode`\^^Z=\other
\catcode`\^^[=\other
\catcode`\^^\=\other
\catcode`\^^]=\other
\catcode`\^^^=\other
\catcode`\^^_=\other
- \catcode`\@=\other
- \catcode`\^=\other
- % It was suggested to define this as 7, which would allow ^^e4 etc.
+ % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
% in xref tags, i.e., node names. But since ^^e4 notation isn't
% supported in the main text, it doesn't seem desirable. Furthermore,
% that is not enough: for node names that actually contain a ^
@@ -4302,11 +6128,14 @@ width0pt\relax} \fi
% b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
% argument, and \hat is not an expandable control sequence. It could
% all be worked out, but why? Either we support ^^ or we don't.
- %
+ %
% The other change necessary for this was to define \auxhat:
% \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
% and then to call \auxhat in \setq.
- %
+ %
+ \catcode`\^=\other
+ %
+ % Special characters. Should be turned off anyway, but...
\catcode`\~=\other
\catcode`\[=\other
\catcode`\]=\other
@@ -4318,8 +6147,9 @@ width0pt\relax} \fi
\catcode`\$=\other
\catcode`\#=\other
\catcode`\&=\other
- % `\+ does not work, so use 43.
- \catcode43=\other
+ \catcode`\%=\other
+ \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+ %
% Make the characters 128-255 be printing characters
{%
\count 1=128
@@ -4329,17 +6159,18 @@ width0pt\relax} \fi
\ifnum \count 1<256 \loop \fi
}%
}%
- % The aux file uses ' as the escape (for now).
+ %
% Turn off \ as an escape so we do not lose on
% entries which were dumped with control sequences in their names.
- % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
+ % For example, @xrdef{$\leq $-fun}{page ...} made by @defun ^^
% Reference to such entries still does not work the way one would wish,
% but at least they do not bomb out when the aux file is read in.
+ \catcode`\\=\other
+ %
+ % @ is our escape character in .aux files.
\catcode`\{=1
\catcode`\}=2
- \catcode`\%=\other
- \catcode`\'=0
- \catcode`\\=\other
+ \catcode`\@=0
%
\openin 1 \jobname.aux
\ifeof 1 \else
@@ -4364,7 +6195,7 @@ width0pt\relax} \fi
% space to prevent strange expansion errors.)
\def\supereject{\par\penalty -20000\footnoteno =0 }
-% @footnotestyle is meaningful for info output only..
+% @footnotestyle is meaningful for info output only.
\let\footnotestyle=\comment
\let\ptexfootnote=\footnote
@@ -4373,31 +6204,39 @@ width0pt\relax} \fi
%
% Auto-number footnotes. Otherwise like plain.
\gdef\footnote{%
+ \let\indent=\ptexindent
\global\advance\footnoteno by \@ne
\edef\thisfootno{$^{\the\footnoteno}$}%
%
% In case the footnote comes at the end of a sentence, preserve the
% extra spacing after we do the footnote number.
\let\@sf\empty
- \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
%
% Remove inadvertent blank space before typesetting the footnote number.
\unskip
\thisfootno\@sf
- \footnotezzz
+ \dofootnote
}%
% Don't bother with the trickery in plain.tex to not require the
% footnote text as a parameter. Our footnotes don't need to be so general.
-%
+%
% Oh yes, they do; otherwise, @ifset and anything else that uses
% \parseargline fail inside footnotes because the tokens are fixed when
% the footnote is read. --karl, 16nov96.
%
-\long\gdef\footnotezzz{\insert\footins\bgroup
+% The start of the footnote looks usually like this:
+\gdef\startfootins{\insert\footins\bgroup}
+%
+% ... but this macro is redefined inside @multitable.
+%
+\gdef\dofootnote{%
+ \startfootins
% We want to typeset this text as a normal paragraph, even if the
% footnote reference occurs in (for example) a display environment.
% So reset some parameters.
+ \hsize=\pagewidth
\interlinepenalty\interfootnotelinepenalty
\splittopskip\ht\strutbox % top baseline for broken footnotes
\splitmaxdepth\dp\strutbox
@@ -4408,8 +6247,17 @@ width0pt\relax} \fi
\xspaceskip\z@skip
\parindent\defaultparindent
%
- % Hang the footnote text off the number.
- \hang
+ \smallfonts \rm
+ %
+ % Because we use hanging indentation in footnotes, a @noindent appears
+ % to exdent this text, so make it be a no-op. makeinfo does not use
+ % hanging indentation so @noindent can still be needed within footnote
+ % text after an @example or the like (not that this is good style).
+ \let\noindent = \relax
+ %
+ % Hang the footnote text off the number. Use \everypar in case the
+ % footnote extends for more than one paragraph.
+ \everypar = {\hang}%
\textindent{\thisfootno}%
%
% Don't crash into the line above the footnote text. Since this
@@ -4418,32 +6266,8 @@ width0pt\relax} \fi
\footstrut
\futurelet\next\fo@t
}
-\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
- \else\let\next\f@t\fi \next}
-\def\f@@t{\bgroup\aftergroup\@foot\let\next}
-\def\f@t#1{#1\@foot}
-\def\@foot{\strut\egroup}
-
}%end \catcode `\@=11
-% Set the baselineskip to #1, and the lineskip and strut size
-% correspondingly. There is no deep meaning behind these magic numbers
-% used as factors; they just match (closely enough) what Knuth defined.
-%
-\def\lineskipfactor{.08333}
-\def\strutheightpercent{.70833}
-\def\strutdepthpercent {.29167}
-%
-\def\setleading#1{%
- \normalbaselineskip = #1\relax
- \normallineskip = \lineskipfactor\normalbaselineskip
- \normalbaselines
- \setbox\strutbox =\hbox{%
- \vrule width0pt height\strutheightpercent\baselineskip
- depth \strutdepthpercent \baselineskip
- }%
-}
-
% @| inserts a changebar to the left of the current line. It should
% surround any changed text. This approach does *not* work if the
% change spans more than two lines of output. To handle that, we would
@@ -4479,36 +6303,121 @@ width0pt\relax} \fi
%
\def\finalout{\overfullrule=0pt}
+% @image. We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+%
+% Check for and read epsf.tex up front. If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = epsf.tex
+\ifeof 1 \else
+ \closein 1
+ % Do not bother showing banner with epsf.tex v2.7k (available in
+ % doc/epsf.tex and on ctan).
+ \def\epsfannounce{\toks0 = }%
+ \input epsf.tex
+\fi
+%
+% We will only complain once about lack of epsf.tex.
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+ work. It is also included in the Texinfo distribution, or you can get
+ it from ftp://tug.org/tex/epsf.tex.}
+%
+\def\image#1{%
+ \ifx\epsfbox\undefined
+ \ifwarnednoepsf \else
+ \errhelp = \noepsfhelp
+ \errmessage{epsf.tex not found, images will be ignored}%
+ \global\warnednoepsftrue
+ \fi
+ \else
+ \imagexxx #1,,,,,\finish
+ \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is (ignored optional) html alt text.
+% #5 is (ignored optional) extension.
+% #6 is just the usual extra ignored arg for parsing this stuff.
+\newif\ifimagevmode
+\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
+ \catcode`\^^M = 5 % in case we're inside an example
+ \normalturnoffactive % allow _ et al. in names
+ % If the image is by itself, center it.
+ \ifvmode
+ \imagevmodetrue
+ \nobreak\bigskip
+ % Usually we'll have text after the image which will insert
+ % \parskip glue, so insert it here too to equalize the space
+ % above and below.
+ \nobreak\vskip\parskip
+ \nobreak
+ \line\bgroup\hss
+ \fi
+ %
+ % Output the image.
+ \ifpdf
+ \dopdfimage{#1}{#2}{#3}%
+ \else
+ % \epsfbox itself resets \epsf?size at each figure.
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+ \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+ \epsfbox{#1.eps}%
+ \fi
+ %
+ \ifimagevmode \hss \egroup \bigbreak \fi % space after the image
+\endgroup}
-% End of control word definitions.
-\message{and turning on texinfo input format.}
+\message{localization,}
+% and i18n.
-\def\openindices{%
- \newindex{cp}%
- \newcodeindex{fn}%
- \newcodeindex{vr}%
- \newcodeindex{tp}%
- \newcodeindex{ky}%
- \newcodeindex{pg}%
+% @documentlanguage is usually given very early, just after
+% @setfilename. If done too late, it may not override everything
+% properly. Single argument is the language abbreviation.
+% It would be nice if we could set up a hyphenation file here.
+%
+\def\documentlanguage{\parsearg\dodocumentlanguage}
+\def\dodocumentlanguage#1{%
+ \tex % read txi-??.tex file in plain TeX.
+ % Read the file if it exists.
+ \openin 1 txi-#1.tex
+ \ifeof1
+ \errhelp = \nolanghelp
+ \errmessage{Cannot read language file txi-#1.tex}%
+ \let\temp = \relax
+ \else
+ \def\temp{\input txi-#1.tex }%
+ \fi
+ \temp
+ \endgroup
}
+\newhelp\nolanghelp{The given language definition file cannot be found or
+is empty. Maybe you need to install it? In the current directory
+should work if nowhere else does.}
+
-% Set some numeric style parameters, for 8.5 x 11 format.
+% @documentencoding should change something in TeX eventually, most
+% likely, but for now just recognize it.
+\let\documentencoding = \comment
-\hsize = 6in
-\hoffset = .25in
+
+% Page size parameters.
+%
\newdimen\defaultparindent \defaultparindent = 15pt
-\parindent = \defaultparindent
-\parskip 3pt plus 2pt minus 1pt
-\setleading{13.2pt}
-\advance\topskip by 1.2cm
\chapheadingskip = 15pt plus 4pt minus 2pt
\secheadingskip = 12pt plus 3pt minus 2pt
\subsecheadingskip = 9pt plus 2pt minus 2pt
% Prevent underfull vbox error messages.
-\vbadness=10000
+\vbadness = 10000
+
+% Don't be so finicky about underfull hboxes, either.
+\hbadness = 2000
% Following George Bush, just get rid of widows and orphans.
\widowpenalty=10000
@@ -4517,101 +6426,182 @@ width0pt\relax} \fi
% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
% using an old version of TeX, don't do anything. We want the amount of
% stretch added to depend on the line length, hence the dependence on
-% \hsize. This makes it come to about 9pt for the 8.5x11 format.
+% \hsize. We call this whenever the paper size is set.
%
-\ifx\emergencystretch\thisisundefined
- % Allow us to assign to \emergencystretch anyway.
- \def\emergencystretch{\dimen0}%
-\else
- \emergencystretch = \hsize
- \divide\emergencystretch by 45
-\fi
+\def\setemergencystretch{%
+ \ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+ \else
+ \emergencystretch = .15\hsize
+ \fi
+}
-% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
-\def\smallbook{
- \global\chapheadingskip = 15pt plus 4pt minus 2pt
- \global\secheadingskip = 12pt plus 3pt minus 2pt
- \global\subsecheadingskip = 9pt plus 2pt minus 2pt
+% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
+% 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8)
+% physical page width.
+%
+% 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#7#8{%
+ \voffset = #3\relax
+ \topskip = #6\relax
+ \splittopskip = \topskip
+ %
+ \vsize = #1\relax
+ \advance\vsize by \topskip
+ \outervsize = \vsize
+ \advance\outervsize by 2\topandbottommargin
+ \pageheight = \vsize
+ %
+ \hsize = #2\relax
+ \outerhsize = \hsize
+ \advance\outerhsize by 0.5in
+ \pagewidth = \hsize
%
- \global\lispnarrowing = 0.3in
- \setleading{12pt}
- \advance\topskip by -1cm
- \global\parskip 2pt plus 1pt
- \global\hsize = 5in
- \global\vsize=7.5in
- \global\tolerance=700
- \global\hfuzz=1pt
- \global\contentsrightmargin=0pt
- \global\deftypemargin=0pt
- \global\defbodyindent=.5cm
+ \normaloffset = #4\relax
+ \bindingoffset = #5\relax
+ %
+ \ifpdf
+ \pdfpageheight #7\relax
+ \pdfpagewidth #8\relax
+ \fi
%
- \global\pagewidth=\hsize
- \global\pageheight=\vsize
+ \setleading{\textleading}
%
- \global\let\smalllisp=\smalllispx
- \global\let\smallexample=\smalllispx
- \global\def\Esmallexample{\Esmalllisp}
+ \parindent = \defaultparindent
+ \setemergencystretch
}
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \textleading = 13.2pt
+ %
+ % If page is nothing but text, make it come out even.
+ \internalpagesizes{46\baselineskip}{6in}%
+ {\voffset}{.25in}%
+ {\bindingoffset}{36pt}%
+ {11in}{8.5in}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.5 (or so) format.
+\def\smallbook{{\globaldefs = 1
+ \parskip = 2pt plus 1pt
+ \textleading = 12pt
+ %
+ \internalpagesizes{7.5in}{5in}%
+ {\voffset}{.25in}%
+ {\bindingoffset}{16pt}%
+ {9.25in}{7in}%
+ %
+ \lispnarrowing = 0.3in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = .5cm
+}}
+
% Use @afourpaper to print on European A4 paper.
-\def\afourpaper{
-\global\tolerance=700
-\global\hfuzz=1pt
-\setleading{12pt}
-\global\parskip 15pt plus 1pt
-
-\global\vsize= 53\baselineskip
-\advance\vsize by \topskip
-%\global\hsize= 5.85in % A4 wide 10pt
-\global\hsize= 6.5in
-\global\outerhsize=\hsize
-\global\advance\outerhsize by 0.5in
-\global\outervsize=\vsize
-\global\advance\outervsize by 0.6in
-
-\global\pagewidth=\hsize
-\global\pageheight=\vsize
-}
-
-\bindingoffset=0pt
-\normaloffset=\hoffset
-\pagewidth=\hsize
-\pageheight=\vsize
-
-% Allow control of the text dimensions. Parameters in order: textheight;
-% textwidth; voffset; hoffset; binding offset; topskip.
-% All require a dimension;
-% header is additional; added length extends the bottom of the page.
-
-\def\changepagesizes#1#2#3#4#5#6{
- \global\vsize= #1
- \global\topskip= #6
- \advance\vsize by \topskip
- \global\voffset= #3
- \global\hsize= #2
- \global\outerhsize=\hsize
- \global\advance\outerhsize by 0.5in
- \global\outervsize=\vsize
- \global\advance\outervsize by 0.6in
- \global\pagewidth=\hsize
- \global\pageheight=\vsize
- \global\normaloffset= #4
- \global\bindingoffset= #5}
-
-% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
-% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
-\def\afourlatex
- {\global\tolerance=700
- \global\hfuzz=1pt
- \setleading{12pt}
- \global\parskip 15pt plus 1pt
- \advance\baselineskip by 1.6pt
- \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}
- }
-
-% Use @afourwide to print on European A4 paper in wide format.
-\def\afourwide{\afourpaper
-\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}}
+\def\afourpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \textleading = 13.2pt
+ %
+ % Double-side printing via postscript on Laserjet 4050
+ % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
+ % To change the settings for a different printer or situation, adjust
+ % \normaloffset until the front-side and back-side texts align. Then
+ % do the same for \bindingoffset. You can set these for testing in
+ % your texinfo source file like this:
+ % @tex
+ % \global\normaloffset = -6mm
+ % \global\bindingoffset = 10mm
+ % @end tex
+ \internalpagesizes{51\baselineskip}{160mm}
+ {\voffset}{\hoffset}%
+ {\bindingoffset}{44pt}%
+ {297mm}{210mm}%
+ %
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = 5mm
+}}
+
+% Use @afivepaper to print on European A5 paper.
+% From romildo@urano.iceb.ufop.br, 2 July 2000.
+% He also recommends making @example and @lisp be small.
+\def\afivepaper{{\globaldefs = 1
+ \parskip = 2pt plus 1pt minus 0.1pt
+ \textleading = 12.5pt
+ %
+ \internalpagesizes{160mm}{120mm}%
+ {\voffset}{\hoffset}%
+ {\bindingoffset}{8pt}%
+ {210mm}{148mm}%
+ %
+ \lispnarrowing = 0.2in
+ \tolerance = 800
+ \hfuzz = 1.2pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = 2mm
+ \tableindent = 12mm
+}}
+
+% A specific text layout, 24x15cm overall, intended for A4 paper.
+\def\afourlatex{{\globaldefs = 1
+ \afourpaper
+ \internalpagesizes{237mm}{150mm}%
+ {\voffset}{4.6mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
+ %
+ % Must explicitly reset to 0 because we call \afourpaper.
+ \globaldefs = 0
+}}
+
+% Use @afourwide to print on A4 paper in landscape format.
+\def\afourwide{{\globaldefs = 1
+ \afourpaper
+ \internalpagesizes{241mm}{165mm}%
+ {\voffset}{-2.95mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
+ \globaldefs = 0
+}}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\def\pagesizes{\parsearg\pagesizesxxx}
+\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+ \globaldefs = 1
+ %
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{\textleading}%
+ %
+ \dimen0 = #1
+ \advance\dimen0 by \voffset
+ %
+ \dimen2 = \hsize
+ \advance\dimen2 by \normaloffset
+ %
+ \internalpagesizes{#1}{\hsize}%
+ {\voffset}{\normaloffset}%
+ {\bindingoffset}{44pt}%
+ {\dimen0}{\dimen2}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+
+\message{and turning on texinfo input format.}
% Define macros to output various characters with catcode for normal text.
\catcode`\"=\other
@@ -4622,6 +6612,7 @@ width0pt\relax} \fi
\catcode`\<=\other
\catcode`\>=\other
\catcode`\+=\other
+\catcode`\$=\other
\def\normaldoublequote{"}
\def\normaltilde{~}
\def\normalcaret{^}
@@ -4630,6 +6621,7 @@ width0pt\relax} \fi
\def\normalless{<}
\def\normalgreater{>}
\def\normalplus{+}
+\def\normaldollar{$}%$ font-lock fix
% This macro is used to make a character print one way in ttfont
% where it can probably just be output, and another way in other fonts,
@@ -4640,7 +6632,13 @@ width0pt\relax} \fi
% interword stretch (and shrink), and it is reasonable to expect all
% typewriter fonts to have this, we can check that font parameter.
%
-\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
+\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
+
+% Same as above, but check for italic font. Actually this also catches
+% non-italic slanted fonts since it is impossible to distinguish them from
+% italic fonts. But since this is only used by $ and it uses \sl anyway
+% this is not a problem.
+\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
% Turn off all special characters except @
% (and those which the user can use as if they were ordinary).
@@ -4648,10 +6646,10 @@ width0pt\relax} \fi
% use math or other variants that look better in normal text.
\catcode`\"=\active
-\def\activedoublequote{{\tt \char '042}}
+\def\activedoublequote{{\tt\char34}}
\let"=\activedoublequote
\catcode`\~=\active
-\def~{{\tt \char '176}}
+\def~{{\tt\char126}}
\chardef\hat=`\^
\catcode`\^=\active
\def^{{\tt \hat}}
@@ -4659,10 +6657,10 @@ width0pt\relax} \fi
\catcode`\_=\active
\def_{\ifusingtt\normalunderscore\_}
% Subroutine for the previous macro.
-\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
+\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
\catcode`\|=\active
-\def|{{\tt \char '174}}
+\def|{{\tt\char124}}
\chardef \less=`\<
\catcode`\<=\active
\def<{{\tt \less}}
@@ -4671,8 +6669,8 @@ width0pt\relax} \fi
\def>{{\tt \gtr}}
\catcode`\+=\active
\def+{{\tt \char 43}}
-%\catcode 27=\active
-%\def^^[{$\diamondsuit$}
+\catcode`\$=\active
+\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
% Set up an active definition for =, but don't enable it most of the time.
{\catcode`\==\active
@@ -4689,45 +6687,46 @@ width0pt\relax} \fi
\catcode`\@=0
-% \rawbackslashxx output one backslash character in current font
+% \rawbackslashxx outputs one backslash character in current font,
+% as in \char`\\.
\global\chardef\rawbackslashxx=`\\
-%{\catcode`\\=\other
-%@gdef@rawbackslashxx{\}}
-% \rawbackslash redefines \ as input to do \rawbackslashxx.
+% \rawbackslash defines an active \ to do \rawbackslashxx.
+% \otherbackslash defines an active \ to be a literal `\' character with
+% catcode other.
{\catcode`\\=\active
-@gdef@rawbackslash{@let\=@rawbackslashxx }}
+ @gdef@rawbackslash{@let\=@rawbackslashxx}
+ @gdef@otherbackslash{@let\=@realbackslash}
+}
+
+% \realbackslash is an actual character `\' with catcode other.
+{\catcode`\\=\other @gdef@realbackslash{\}}
% \normalbackslash outputs one backslash in fixed width font.
\def\normalbackslash{{\tt\rawbackslashxx}}
-% Say @foo, not \foo, in error messages.
-\escapechar=`\@
-
-% \catcode 17=0 % Define control-q
\catcode`\\=\active
% Used sometimes to turn off (effectively) the active characters
% even after parsing them.
-@def@turnoffactive{@let"=@normaldoublequote
-@let\=@realbackslash
-@let~=@normaltilde
-@let^=@normalcaret
-@let_=@normalunderscore
-@let|=@normalverticalbar
-@let<=@normalless
-@let>=@normalgreater
-@let+=@normalplus}
-
-@def@normalturnoffactive{@let"=@normaldoublequote
-@let\=@normalbackslash
-@let~=@normaltilde
-@let^=@normalcaret
-@let_=@normalunderscore
-@let|=@normalverticalbar
-@let<=@normalless
-@let>=@normalgreater
-@let+=@normalplus}
+@def@turnoffactive{%
+ @let"=@normaldoublequote
+ @let\=@realbackslash
+ @let~=@normaltilde
+ @let^=@normalcaret
+ @let_=@normalunderscore
+ @let|=@normalverticalbar
+ @let<=@normalless
+ @let>=@normalgreater
+ @let+=@normalplus
+ @let$=@normaldollar %$ font-lock fix
+}
+
+% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
+% the literal character `\'. (Thus, \ is not expandable when this is in
+% effect.)
+%
+@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash}
% Make _ and + \other characters, temporarily.
% This is canceled by @fixbackslash.
@@ -4746,16 +6745,29 @@ width0pt\relax} \fi
% Also back turn on active characters that might appear in the input
% file name, in case not using a pre-dumped format.
%
-@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
- @catcode`+=@active @catcode`@_=@active}
+@gdef@fixbackslash{%
+ @ifx\@eatinput @let\ = @normalbackslash @fi
+ @catcode`+=@active
+ @catcode`@_=@active
+}
-%% These look ok in all fonts, so just make them not special. The @rm below
-%% makes sure that the current font starts out as the newly loaded cmr10
-@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
+% Say @foo, not \foo, in error messages.
+@escapechar = `@@
+% These look ok in all fonts, so just make them not special.
+@catcode`@& = @other
+@catcode`@# = @other
+@catcode`@% = @other
+
+@c Set initial fonts.
@textfonts
@rm
+
@c Local variables:
+@c eval: (add-hook 'write-file-hooks 'time-stamp)
@c page-delimiter: "^\\\\message"
+@c time-stamp-start: "def\\\\texinfoversion{"
+@c time-stamp-format: "%:y-%02m-%02d.%02H"
+@c time-stamp-end: "}"
@c End:
diff --git a/gnu/dist/gawk/eval_p.c b/gnu/dist/gawk/eval_p.c
new file mode 100644
index 00000000000..e396f291712
--- /dev/null
+++ b/gnu/dist/gawk/eval_p.c
@@ -0,0 +1,29 @@
+/* $NetBSD: eval_p.c,v 1.1.1.1 2003/10/06 15:46:56 wiz Exp $ */
+
+/*
+ * eval_p.c - compile eval.c with profiling turned on.
+ */
+
+/*
+ * 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
+ */
+
+#define PROFILING 1
+#include "eval.c"
diff --git a/gnu/dist/gawk/ext.c b/gnu/dist/gawk/ext.c
new file mode 100644
index 00000000000..c759d2f7dfe
--- /dev/null
+++ b/gnu/dist/gawk/ext.c
@@ -0,0 +1,191 @@
+/* $NetBSD: ext.c,v 1.1.1.1 2003/10/06 15:45:47 wiz Exp $ */
+
+/*
+ * ext.c - Builtin function that links external gawk functions and related
+ * utilities.
+ *
+ * Christos Zoulas, Thu Jun 29 17:40:41 EDT 1995
+ * Arnold Robbins, update for 3.1, Mon Nov 23 12:53:39 EST 1998
+ */
+
+/*
+ * Copyright (C) 1995 - 2001, 2003 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"
+
+#ifdef DYNAMIC
+
+#include <dlfcn.h>
+
+#ifdef __GNUC__
+static unsigned long long dummy; /* fake out gcc for dynamic loading? */
+#endif
+
+extern int errcount;
+
+/* do_ext --- load an extension */
+
+NODE *
+do_ext(NODE *tree)
+{
+ NODE *obj;
+ NODE *fun;
+ NODE *(*func) P((NODE *, void *));
+ void *dl;
+ int flags = RTLD_LAZY;
+
+#ifdef __GNUC__
+ AWKNUM junk;
+
+ junk = (AWKNUM) dummy;
+#endif
+
+ if (do_lint)
+ lintwarn(_("`extension' is a gawk extension"));
+
+ if (do_traditional || do_posix) {
+ errcount++;
+ error(_("`extension' is a gawk extension"));
+ }
+
+ obj = tree_eval(tree->lnode);
+ force_string(obj);
+
+#ifdef RTLD_GLOBAL
+ flags |= RTLD_GLOBAL;
+#endif
+ if ((dl = dlopen(obj->stptr, flags)) == NULL)
+ fatal(_("extension: cannot open `%s' (%s)\n"), obj->stptr,
+ dlerror());
+
+ fun = tree_eval(tree->rnode->lnode);
+ force_string(fun);
+
+ func = (NODE *(*) P((NODE *, void *))) dlsym(dl, fun->stptr);
+ if (func == NULL)
+ fatal(_("extension: library `%s': cannot call function `%s' (%s)\n"),
+ obj->stptr, fun->stptr, dlerror());
+ free_temp(obj);
+ free_temp(fun);
+
+ return (*func)(tree, dl);
+}
+
+/* make_builtin --- register name to be called as func with a builtin body */
+
+void
+make_builtin(char *name, NODE *(*func) P((NODE *)), int count)
+{
+ NODE *p, *b, *f;
+ char **vnames, *parm_names, *sp;
+ char buf[200];
+ int space_needed, i;
+
+ /* count parameters, create artificial list of param names */
+ space_needed = 0;
+ for (i = 0; i < count; i++) {
+ sprintf(buf, "p%d", i);
+ space_needed += strlen(buf) + 1;
+ }
+ emalloc(parm_names, char *, space_needed, "make_builtin");
+ emalloc(vnames, char **, count * sizeof(char *), "make_builtin");
+ sp = parm_names;
+ for (i = 0; i < count; i++) {
+ sprintf(sp, "p%d",i);
+ vnames[i] = sp;
+ sp += strlen(sp) + 1;
+ }
+
+ getnode(p);
+ p->type = Node_param_list;
+ p->flags |= FUNC;
+ p->rnode = NULL;
+ p->param = name;
+ p->param_cnt = count;
+#if 0
+ /* setting these blows away the param_cnt. dang unions! */
+ p->source_line = __LINE__;
+ p->source_file = __FILE__;
+#endif
+
+ getnode(b);
+ b->type = Node_builtin;
+ b->builtin = func;
+ b->subnode = p;
+ b->source_line = __LINE__;
+ b->source_file = __FILE__;
+
+ f = node(p, Node_func, b);
+ f->parmlist = vnames;
+ install(name, f);
+}
+
+/* get_argument --- Get the n'th argument of a dynamically linked function */
+
+NODE *
+get_argument(NODE *tree, int i)
+{
+ extern NODE **stack_ptr;
+
+ if (i < 0 || i >= tree->param_cnt)
+ return NULL;
+
+ tree = stack_ptr[i];
+ if (tree->lnode == Nnull_string)
+ return NULL;
+
+ if (tree->type == Node_array_ref) {
+ tree = tree->orig_array;
+ return tree;
+ }
+
+ if (tree->type == Node_var_array)
+ return tree;
+
+ return tree->lnode;
+}
+
+/* set_value --- set the return value of a dynamically linked function */
+
+void
+set_value(NODE *tree)
+{
+ extern NODE *ret_node;
+
+ if (tree)
+ ret_node = tree;
+ else
+ ret_node = Nnull_string;
+}
+#else
+
+/* do_ext --- dummy version if extensions not available */
+
+NODE *
+do_ext(NODE *tree)
+{
+ const char *emsg = _("Operation Not Supported");
+
+ unref(ERRNO_node->var_value);
+ ERRNO_node->var_value = make_string((char *) emsg, strlen(emsg));
+ return tmp_number((AWKNUM) -1);
+}
+#endif
diff --git a/gnu/dist/gawk/extension/Makefile.pc b/gnu/dist/gawk/extension/Makefile.pc
new file mode 100644
index 00000000000..fe8f5b479dc
--- /dev/null
+++ b/gnu/dist/gawk/extension/Makefile.pc
@@ -0,0 +1,55 @@
+# Makefile for gawk extensions Mar 2003
+
+# - for GNU C (mingw32) [Windows32 executable for Windows 9x/NT]
+# - for Microsoft C 7 [16bit ececutable for DOS]
+
+# see README.pc for comments
+
+#------------------------------------------------------------------------
+# Some makes do not define MAKE (and ndmake does not allow a define).
+# Define MAK to be your make command.
+#MAKE = dmake
+MAK = $(MAKE) $(MAKEFILE)
+#MAK = $(MAKE)
+#MAKEFILE = -f Makefile
+#MAK = make45 $(MAKEFILE)
+
+VCCFLAGS=-nologo -O2 -DWIN32 -DWIN32_EXTENSION -D__STDC__=0 -DGAWK -I.. -DHAVE_CONFIG_H -DDYNAMIC
+VCLDFLAGS=-LD ../gawk.lib
+VCCC=cl -nologo
+
+MWCFLAGS=-O -shared -DWIN32 -DWIN32_EXTENSION -DGAWK -I.. -DHAVE_CONFIG_H -DDYNAMIC
+MWLDFLAGS=-s -Wl,--enable-stdcall-fixup -L.. -lgawk
+MWCC=gcc
+
+# this DEFFILE will work provided the exported function is always called
+# dlload
+DEFFILE=pcext.def
+
+
+default:
+ @echo "Enter $(MAK) target "
+ @echo " where 'target' is chosen from "
+ @echo " mingw32 . Windows32 exe [Mingw32 GNU C] "
+ @echo " vcWin32 . Windows32 exe [Microsoft Visual C] "
+
+.SUFFIXES: .c .dll
+
+.c.dll:
+ $(CC) $(CFLAGS) $< -o$@ $(LDFLAGS) $(DEFFILE)
+
+
+# dl.c, fork.c, and filefuncs.c don't compile cleanly...
+all : readfile.dll ordchr.dll arrayparm.dll
+
+vcWin32:
+ $(MAK) CFLAGS="$(VCCFLAGS)" LDFLAGS="$(VCLDFLAGS)" CC="$(VCCC)" all
+
+mingw32:
+ $(MAK) CFLAGS="$(MWCFLAGS)" LDFLAGS="$(MWLDFLAGS)" CC="$(MWCC)" all
+
+clean:
+ -rm *.dll
+ -rm *.o
+ -rm *.obj
+ -rm *.lib
diff --git a/gnu/dist/gawk/extension/arrayparm.c b/gnu/dist/gawk/extension/arrayparm.c
new file mode 100644
index 00000000000..321ce3030c9
--- /dev/null
+++ b/gnu/dist/gawk/extension/arrayparm.c
@@ -0,0 +1,91 @@
+/* $NetBSD: arrayparm.c,v 1.1.1.1 2003/10/06 15:50:50 wiz Exp $ */
+
+/*
+ * arrayparm.c --- figure out how to make a parameter be an array
+ *
+ * Arnold Robbins
+ * arnold@skeeve.com
+ * 10/2001
+ *
+ * Revised 7/2003
+ */
+
+/*
+ * Copyright (C) 2001, 2003 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];
+
+ var = get_array(var);
+ 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));
+
+ 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/gnu/dist/gawk/extension/dl.c b/gnu/dist/gawk/extension/dl.c
new file mode 100644
index 00000000000..54103a653a1
--- /dev/null
+++ b/gnu/dist/gawk/extension/dl.c
@@ -0,0 +1,98 @@
+/* $NetBSD: dl.c,v 1.1.1.1 2003/10/06 15:50:48 wiz Exp $ */
+
+/*
+ * dl.c - Example of adding a new builtin function to gawk.
+ *
+ * Christos Zoulas, Thu Jun 29 17:40:41 EDT 1995
+ * Arnold Robbins, update for 3.1, Wed Sep 13 09:38:56 2000
+ */
+
+/*
+ * 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
+ */
+
+#include "awk.h"
+#include <dlfcn.h>
+
+static void *sdl = NULL;
+
+static NODE *
+zaxxon(tree)
+NODE *tree;
+{
+ NODE *obj;
+ int i;
+ int comma = 0;
+
+ /*
+ * Print the arguments
+ */
+ printf("External linkage %s(", tree->param);
+
+ for (i = 0; i < tree->param_cnt; i++) {
+
+ obj = get_argument(tree, i);
+
+ if (obj == NULL)
+ break;
+
+ force_string(obj);
+
+ printf(comma ? ", %s" : "%s", obj->stptr);
+ free_temp(obj);
+ comma = 1;
+ }
+
+ printf(");\n");
+
+ /*
+ * Do something useful
+ */
+ obj = get_argument(tree, 0);
+
+ if (obj != NULL) {
+ force_string(obj);
+ if (strcmp(obj->stptr, "unload") == 0 && sdl) {
+ /*
+ * XXX: How to clean up the function?
+ * I would like the ability to remove a function...
+ */
+ dlclose(sdl);
+ sdl = NULL;
+ }
+ free_temp(obj);
+ }
+
+ /* Set the return value */
+ set_value(tmp_number((AWKNUM) 3.14));
+
+ /* Just to make the interpreter happy */
+ return tmp_number((AWKNUM) 0);
+}
+
+NODE *
+dlload(tree, dl)
+NODE *tree;
+void *dl;
+{
+ sdl = dl;
+ make_builtin("zaxxon", zaxxon, 4);
+ return tmp_number((AWKNUM) 0);
+}
diff --git a/gnu/dist/gawk/extension/doit b/gnu/dist/gawk/extension/doit
new file mode 100755
index 00000000000..29dff7d85ae
--- /dev/null
+++ b/gnu/dist/gawk/extension/doit
@@ -0,0 +1 @@
+../gawk -f foo.awk
diff --git a/gnu/dist/gawk/extension/filefuncs.c b/gnu/dist/gawk/extension/filefuncs.c
new file mode 100644
index 00000000000..0b78b159f6d
--- /dev/null
+++ b/gnu/dist/gawk/extension/filefuncs.c
@@ -0,0 +1,343 @@
+/* $NetBSD: filefuncs.c,v 1.1.1.1 2003/10/06 15:50:48 wiz Exp $ */
+
+/*
+ * filefuncs.c - Builtin functions that provide initial minimal iterface
+ * to the file system.
+ *
+ * Arnold Robbins, update for 3.1, Mon Nov 23 12:53:39 EST 1998
+ */
+
+/*
+ * 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"
+
+#include <sys/sysmacros.h>
+
+/* do_chdir --- provide dynamically loaded chdir() builtin for gawk */
+
+static NODE *
+do_chdir(tree)
+NODE *tree;
+{
+ NODE *newdir;
+ int ret = -1;
+
+ if (do_lint && tree->param_cnt > 1)
+ lintwarn("chdir: called with too many arguments");
+
+ newdir = get_argument(tree, 0);
+ if (newdir != NULL) {
+ (void) force_string(newdir);
+ ret = chdir(newdir->stptr);
+ if (ret < 0)
+ update_ERRNO();
+
+ free_temp(newdir);
+ } else if (do_lint)
+ lintwarn("chdir: 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);
+}
+
+/* format_mode --- turn a stat mode field into something readable */
+
+static char *
+format_mode(fmode)
+unsigned long fmode;
+{
+ static char outbuf[12];
+ int i;
+
+ strcpy(outbuf, "----------");
+ /* first, get the file type */
+ i = 0;
+ switch (fmode & S_IFMT) {
+#ifdef S_IFSOCK
+ case S_IFSOCK:
+ outbuf[i] = 's';
+ break;
+#endif
+#ifdef S_IFLNK
+ case S_IFLNK:
+ outbuf[i] = 'l';
+ break;
+#endif
+ case S_IFREG:
+ outbuf[i] = '-'; /* redundant */
+ break;
+ case S_IFBLK:
+ outbuf[i] = 'b';
+ break;
+ case S_IFDIR:
+ outbuf[i] = 'd';
+ break;
+#ifdef S_IFDOOR /* Solaris weirdness */
+ case S_IFDOOR:
+ outbuf[i] = 'D';
+ break;
+#endif /* S_IFDOOR */
+ case S_IFCHR:
+ outbuf[i] = 'c';
+ break;
+#ifdef S_IFIFO
+ case S_IFIFO:
+ outbuf[i] = 'p';
+ break;
+#endif
+ }
+
+ i++;
+ if ((fmode & S_IRUSR) != 0)
+ outbuf[i] = 'r';
+ i++;
+ if ((fmode & S_IWUSR) != 0)
+ outbuf[i] = 'w';
+ i++;
+ if ((fmode & S_IXUSR) != 0)
+ outbuf[i] = 'x';
+ i++;
+
+ if ((fmode & S_IRGRP) != 0)
+ outbuf[i] = 'r';
+ i++;
+ if ((fmode & S_IWGRP) != 0)
+ outbuf[i] = 'w';
+ i++;
+ if ((fmode & S_IXGRP) != 0)
+ outbuf[i] = 'x';
+ i++;
+
+ if ((fmode & S_IROTH) != 0)
+ outbuf[i] = 'r';
+ i++;
+ if ((fmode & S_IWOTH) != 0)
+ outbuf[i] = 'w';
+ i++;
+ if ((fmode & S_IXOTH) != 0)
+ outbuf[i] = 'x';
+ i++;
+
+ outbuf[i] = '\0';
+
+ if ((fmode & S_ISUID) != 0) {
+ if (outbuf[3] == 'x')
+ outbuf[3] = 's';
+ else
+ outbuf[3] = 'S';
+ }
+
+ /* setgid without execute == locking */
+ if ((fmode & S_ISGID) != 0) {
+ if (outbuf[6] == 'x')
+ outbuf[6] = 's';
+ else
+ outbuf[6] = 'l';
+ }
+
+ if ((fmode & S_ISVTX) != 0) {
+ if (outbuf[9] == 'x')
+ outbuf[9] = 't';
+ else
+ outbuf[9] = 'T';
+ }
+
+ return outbuf;
+}
+
+/* do_stat --- provide a stat() function for gawk */
+
+static NODE *
+do_stat(tree)
+NODE *tree;
+{
+ NODE *file, *array;
+ struct stat sbuf;
+ int ret;
+ NODE **aptr;
+ char *pmode; /* printable mode */
+ char *type = "unknown";
+
+ /* check arg count */
+ if (tree->param_cnt != 2)
+ fatal(
+ "stat: called with incorrect number of arguments (%d), should be 2",
+ tree->param_cnt);
+
+ /* directory is first arg, array to hold results is second */
+ file = get_argument(tree, 0);
+ array = get_argument(tree, 1);
+
+ array = get_array(array);
+
+ /* empty out the array */
+ assoc_clear(array);
+
+ /* lstat the file, if error, set ERRNO and return */
+ (void) force_string(file);
+ ret = lstat(file->stptr, & sbuf);
+ if (ret < 0) {
+ update_ERRNO();
+
+ set_value(tmp_number((AWKNUM) ret));
+
+ free_temp(file);
+ return tmp_number((AWKNUM) 0);
+ }
+
+ /* fill in the array */
+ aptr = assoc_lookup(array, tmp_string("name", 4), FALSE);
+ *aptr = dupnode(file);
+
+ aptr = assoc_lookup(array, tmp_string("dev", 3), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_dev);
+
+ aptr = assoc_lookup(array, tmp_string("ino", 3), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_ino);
+
+ aptr = assoc_lookup(array, tmp_string("mode", 4), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_mode);
+
+ aptr = assoc_lookup(array, tmp_string("nlink", 5), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_nlink);
+
+ aptr = assoc_lookup(array, tmp_string("uid", 3), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_uid);
+
+ aptr = assoc_lookup(array, tmp_string("gid", 3), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_gid);
+
+ aptr = assoc_lookup(array, tmp_string("size", 4), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_size);
+
+ aptr = assoc_lookup(array, tmp_string("blocks", 6), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_blocks);
+
+ aptr = assoc_lookup(array, tmp_string("atime", 5), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_atime);
+
+ aptr = assoc_lookup(array, tmp_string("mtime", 5), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_mtime);
+
+ aptr = assoc_lookup(array, tmp_string("ctime", 5), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_ctime);
+
+ /* for block and character devices, add rdev, major and minor numbers */
+ if (S_ISBLK(sbuf.st_mode) || S_ISCHR(sbuf.st_mode)) {
+ aptr = assoc_lookup(array, tmp_string("rdev", 4), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_rdev);
+
+ aptr = assoc_lookup(array, tmp_string("major", 5), FALSE);
+ *aptr = make_number((AWKNUM) major(sbuf.st_rdev));
+
+ aptr = assoc_lookup(array, tmp_string("minor", 5), FALSE);
+ *aptr = make_number((AWKNUM) minor(sbuf.st_rdev));
+ }
+
+#ifdef HAVE_ST_BLKSIZE
+ aptr = assoc_lookup(array, tmp_string("blksize", 7), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_blksize);
+#endif /* HAVE_ST_BLKSIZE */
+
+ aptr = assoc_lookup(array, tmp_string("pmode", 5), FALSE);
+ pmode = format_mode(sbuf.st_mode);
+ *aptr = make_string(pmode, strlen(pmode));
+
+ /* for symbolic links, add a linkval field */
+ if (S_ISLNK(sbuf.st_mode)) {
+ char buf[BUFSIZ*2];
+ int linksize;
+
+ linksize = readlink(file->stptr, buf, sizeof buf);
+ /* should make this smarter */
+ if (linksize == sizeof(buf))
+ fatal("size of symbolic link too big");
+ buf[linksize] = '\0';
+
+ aptr = assoc_lookup(array, tmp_string("linkval", 7), FALSE);
+ *aptr = make_string(buf, linksize);
+ }
+
+ /* add a type field */
+ switch (sbuf.st_mode & S_IFMT) {
+#ifdef S_IFSOCK
+ case S_IFSOCK:
+ type = "socket";
+ break;
+#endif
+#ifdef S_IFLNK
+ case S_IFLNK:
+ type = "symlink";
+ break;
+#endif
+ case S_IFREG:
+ type = "file";
+ break;
+ case S_IFBLK:
+ type = "blockdev";
+ break;
+ case S_IFDIR:
+ type = "directory";
+ break;
+#ifdef S_IFDOOR
+ case S_IFDOOR:
+ type = "door";
+ break;
+#endif
+ case S_IFCHR:
+ type = "chardev";
+ break;
+#ifdef S_IFIFO
+ case S_IFIFO:
+ type = "fifo";
+ break;
+#endif
+ }
+
+ aptr = assoc_lookup(array, tmp_string("type", 4), FALSE);
+ *aptr = make_string(type, strlen(type));
+
+ free_temp(file);
+
+ /* 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("chdir", do_chdir, 1);
+ make_builtin("stat", do_stat, 2);
+
+ return tmp_number((AWKNUM) 0);
+}
diff --git a/gnu/dist/gawk/extension/foo.awk b/gnu/dist/gawk/extension/foo.awk
new file mode 100644
index 00000000000..00a89e5b240
--- /dev/null
+++ b/gnu/dist/gawk/extension/foo.awk
@@ -0,0 +1,9 @@
+BEGIN {
+ extension("./dl.so","dlload")
+ zaxxon("hi there", "this is", "a test", "of argument passing")
+ zaxxon(1)
+ zaxxon(1,2)
+ z = zaxxon(1,2,3,4)
+ z = zaxxon(1,zaxxon(zaxxon("foo")),3,4)
+ print z
+}
diff --git a/gnu/dist/gawk/extension/fork.c b/gnu/dist/gawk/extension/fork.c
new file mode 100644
index 00000000000..1457301730a
--- /dev/null
+++ b/gnu/dist/gawk/extension/fork.c
@@ -0,0 +1,107 @@
+/* $NetBSD: fork.c,v 1.1.1.1 2003/10/06 15:50:50 wiz Exp $ */
+
+/*
+ * fork.c - Provide fork and waitpid functions for gawk.
+ */
+
+/*
+ * 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_fork --- provide dynamically loaded fork() builtin for gawk */
+
+static NODE *
+do_fork(tree)
+NODE *tree;
+{
+ int ret = -1;
+ NODE **aptr;
+
+ if (do_lint && tree->param_cnt > 0)
+ lintwarn("fork: called with too many arguments");
+
+ ret = fork();
+
+ if (ret < 0)
+ update_ERRNO();
+ else if (ret == 0) {
+ /* update PROCINFO in the child */
+
+ aptr = assoc_lookup(PROCINFO_node, tmp_string("pid", 3), FALSE);
+ (*aptr)->numbr = (AWKNUM) getpid();
+
+ aptr = assoc_lookup(PROCINFO_node, tmp_string("ppid", 4), FALSE);
+ (*aptr)->numbr = (AWKNUM) getppid();
+ }
+
+ /* Set the return value */
+ set_value(tmp_number((AWKNUM) ret));
+
+ /* Just to make the interpreter happy */
+ return tmp_number((AWKNUM) 0);
+}
+
+
+/* do_waitpid --- provide dynamically loaded waitpid() builtin for gawk */
+
+static NODE *
+do_waitpid(tree)
+NODE *tree;
+{
+ NODE *pidnode;
+ int ret = -1;
+ double pidval;
+ pid_t pid;
+ int options = 0;
+
+ if (do_lint && tree->param_cnt > 1)
+ lintwarn("waitpid: called with too many arguments");
+
+ pidnode = get_argument(tree, 0);
+ if (pidnode != NULL) {
+ pidval = force_number(pidnode);
+ pid = (int) pidval;
+ options = WNOHANG|WUNTRACED;
+ ret = waitpid(pid, NULL, options);
+ if (ret < 0)
+ update_ERRNO();
+ } else if (do_lint)
+ lintwarn("wait: 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);
+}
+
+/* dlload --- load new builtins in this library */
+
+NODE *
+dlload(tree, dl)
+NODE *tree;
+void *dl;
+{
+ make_builtin("fork", do_fork, 0);
+ make_builtin("waitpid", do_waitpid, 1);
+ return tmp_number((AWKNUM) 0);
+}
diff --git a/gnu/dist/gawk/extension/ordchr.c b/gnu/dist/gawk/extension/ordchr.c
new file mode 100644
index 00000000000..78b52a4dca5
--- /dev/null
+++ b/gnu/dist/gawk/extension/ordchr.c
@@ -0,0 +1,108 @@
+/* $NetBSD: ordchr.c,v 1.1.1.1 2003/10/06 15:50:50 wiz Exp $ */
+
+/*
+ * 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/gnu/dist/gawk/extension/pcext.def b/gnu/dist/gawk/extension/pcext.def
new file mode 100644
index 00000000000..696907f6d68
--- /dev/null
+++ b/gnu/dist/gawk/extension/pcext.def
@@ -0,0 +1,2 @@
+EXPORTS
+dlload @1
diff --git a/gnu/dist/gawk/extension/readfile.c b/gnu/dist/gawk/extension/readfile.c
new file mode 100644
index 00000000000..87061caa73c
--- /dev/null
+++ b/gnu/dist/gawk/extension/readfile.c
@@ -0,0 +1,117 @@
+/* $NetBSD: readfile.c,v 1.1.1.1 2003/10/06 15:50:50 wiz Exp $ */
+
+/*
+ * readfile.c - Read an entire file into a string.
+ *
+ * Arnold Robbins
+ * Tue Apr 23 17:43:30 IDT 2002
+ * Revised per Peter Tillier
+ * Mon Jun 9 17:05:11 IDT 2003
+ */
+
+/*
+ * Copyright (C) 2002, 2003 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>
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+/* 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|O_BINARY)) < 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/gnu/dist/gawk/extension/steps b/gnu/dist/gawk/extension/steps
new file mode 100755
index 00000000000..8bac5d85615
--- /dev/null
+++ b/gnu/dist/gawk/extension/steps
@@ -0,0 +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/gnu/dist/gawk/extension/testarrayparm.awk b/gnu/dist/gawk/extension/testarrayparm.awk
new file mode 100644
index 00000000000..08178f3e89e
--- /dev/null
+++ b/gnu/dist/gawk/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/gnu/dist/gawk/extension/testff.awk b/gnu/dist/gawk/extension/testff.awk
new file mode 100644
index 00000000000..0a0a9b2f478
--- /dev/null
+++ b/gnu/dist/gawk/extension/testff.awk
@@ -0,0 +1,30 @@
+BEGIN {
+ extension("./filefuncs.so", "dlload")
+
+# printf "before: "
+# fflush()
+# system("pwd")
+#
+# chdir("..")
+#
+# printf "after: "
+# fflush()
+# system("pwd")
+
+ chdir(".")
+
+ data[1] = 1
+ print "Info for testff.awk"
+ ret = stat("testff.awk", data)
+ print "ret =", ret
+ for (i in data)
+ printf "data[\"%s\"] = %s\n", i, data[i]
+ print "testff.awk modified:", strftime("%m %d %y %H:%M:%S", data["mtime"])
+
+ print "\nInfo for JUNK"
+ ret = stat("JUNK", data)
+ print "ret =", ret
+ for (i in data)
+ printf "data[\"%s\"] = %s\n", i, data[i]
+ print "JUNK modified:", strftime("%m %d %y %H:%M:%S", data["mtime"])
+}
diff --git a/gnu/dist/gawk/extension/testfork.awk b/gnu/dist/gawk/extension/testfork.awk
new file mode 100644
index 00000000000..ca00dca8c52
--- /dev/null
+++ b/gnu/dist/gawk/extension/testfork.awk
@@ -0,0 +1,20 @@
+BEGIN {
+ extension("./fork.so", "dlload")
+
+ printf "before fork, pid = %d, ppid = %d\n", PROCINFO["pid"],
+ PROCINFO["ppid"]
+
+ fflush()
+ ret = fork()
+ if (ret < 0)
+ printf("ret = %d, ERRNO = %s\n", ret, ERRNO)
+ else if (ret == 0)
+ printf "child, pid = %d, ppid = %d\n", PROCINFO["pid"],
+ PROCINFO["ppid"]
+ else {
+ system("sleep 3")
+ printf "parent, ret = %d\n", ret
+ printf "parent, pid = %d, ppid = %d\n", PROCINFO["pid"],
+ PROCINFO["ppid"]
+ }
+}
diff --git a/gnu/dist/gawk/extension/testordchr.awk b/gnu/dist/gawk/extension/testordchr.awk
new file mode 100644
index 00000000000..64e53d16be6
--- /dev/null
+++ b/gnu/dist/gawk/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/gnu/dist/gawk/field.c b/gnu/dist/gawk/field.c
index 31c96287958..a37c8fd8e9f 100644
--- a/gnu/dist/gawk/field.c
+++ b/gnu/dist/gawk/field.c
@@ -1,9 +1,11 @@
+/* $NetBSD: field.c,v 1.1.1.2 2003/10/06 15:45:57 wiz Exp $ */
+
/*
* field.c - routines for dealing with fields and record parsing
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-1997 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-2003 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -24,7 +26,6 @@
*/
#include "awk.h"
-#include <assert.h>
typedef void (* Setfunc) P((long, char *, long, NODE *));
@@ -46,6 +47,7 @@ static long fw_parse_field P((long, char **, int, NODE *,
static void set_element P((long num, char * str, long len, NODE *arr));
static void grow_fields_arr P((long num));
static void set_field P((long num, char *str, long len, NODE *dummy));
+static void update_PROCINFO P((char *subscript, char *str));
static char *parse_extent; /* marks where to restart parse of record */
@@ -60,36 +62,34 @@ static int *FIELDWIDTHS = NULL;
NODE **fields_arr; /* array of pointers to the field nodes */
int field0_valid; /* $(>0) has not been changed yet */
int default_FS; /* TRUE when FS == " " */
+Regexp *FS_re_yes_case = NULL;
+Regexp *FS_re_no_case = NULL;
Regexp *FS_regexp = NULL;
-static NODE *Null_field = NULL;
+NODE *Null_field = NULL;
+
+/* using_FIELDWIDTHS --- static function, macro to avoid overhead */
+#define using_FIELDWIDTHS() (parse_field == fw_parse_field)
/* init_fields --- set up the fields array to start with */
void
init_fields()
{
- NODE *n;
-
emalloc(fields_arr, NODE **, sizeof(NODE *), "init_fields");
- getnode(n);
- *n = *Nnull_string;
- n->flags |= (SCALAR|FIELD);
- n->flags &= ~PERM;
- fields_arr[0] = n;
+ fields_arr[0] = Nnull_string;
parse_extent = fields_arr[0]->stptr;
save_FS = dupnode(FS_node->var_value);
getnode(Null_field);
*Null_field = *Nnull_string;
- Null_field->flags |= (SCALAR|FIELD);
- Null_field->flags &= ~(NUM|NUMBER|MAYBE_NUM|PERM);
+ Null_field->flags |= FIELD;
+ Null_field->flags &= ~(NUMCUR|NUMBER|MAYBE_NUM|PERM);
field0_valid = TRUE;
}
/* grow_fields --- acquire new fields as needed */
static void
-grow_fields_arr(num)
-long num;
+grow_fields_arr(long num)
{
register int t;
register NODE *n;
@@ -107,11 +107,10 @@ long num;
/*ARGSUSED*/
static void
-set_field(num, str, len, dummy)
-long num;
-char *str;
-long len;
-NODE *dummy; /* not used -- just to make interface same as set_element */
+set_field(long num,
+ char *str,
+ long len,
+ NODE *dummy ATTRIBUTE_UNUSED) /* just to make interface same as set_element */
{
register NODE *n;
@@ -120,7 +119,7 @@ NODE *dummy; /* not used -- just to make interface same as set_element */
n = fields_arr[num];
n->stptr = str;
n->stlen = len;
- n->flags = (STR|STRING|MAYBE_NUM|SCALAR|FIELD);
+ n->flags = (STRCUR|STRING|MAYBE_NUM|FIELD);
}
/* rebuild_record --- Someone assigned a value to $(something).
@@ -140,7 +139,6 @@ rebuild_record()
char *ops;
register char *cops;
long i;
- char *f0start, *f0end;
assert(NF != -1);
@@ -182,17 +180,30 @@ rebuild_record()
/*
* Since we are about to unref fields_arr[0], we want to find
* any fields that still point into it, and have them point
- * into the new field zero.
+ * into the new field zero. This has to be done intelligently,
+ * so that unrefing a field doesn't try to unref into the old $0.
*/
- f0start = fields_arr[0]->stptr;
- f0end = fields_arr[0]->stptr + fields_arr[0]->stlen;
for (cops = ops, i = 1; i <= NF; i++) {
- char *field_data = fields_arr[i]->stptr;
+ if (fields_arr[i]->stlen > 0) {
+ NODE *n;
+ getnode(n);
- if (fields_arr[i]->stlen > 0
- && f0start <= field_data && field_data < f0end)
- fields_arr[i]->stptr = cops;
+ if ((fields_arr[i]->flags & FIELD) == 0) {
+ *n = *Null_field;
+ n->stlen = fields_arr[i]->stlen;
+ if ((fields_arr[i]->flags & (NUMCUR|NUMBER)) != 0) {
+ n->flags |= (fields_arr[i]->flags & (NUMCUR|NUMBER));
+ n->numbr = fields_arr[i]->numbr;
+ }
+ } else {
+ *n = *(fields_arr[i]);
+ n->flags &= ~(MALLOC|TEMP|PERM|STRING);
+ }
+ n->stptr = cops;
+ unref(fields_arr[i]);
+ fields_arr[i] = n;
+ }
cops += fields_arr[i]->stlen + ofslen;
}
@@ -206,16 +217,69 @@ rebuild_record()
* set_record:
* setup $0, but defer parsing rest of line until reference is made to $(>0)
* or to NF. At that point, parse only as much as necessary.
+ *
+ * Manage a private buffer for the contents of $0. Doing so keeps us safe
+ * if `getline var' decides to rearrange the contents of the IOBUF that
+ * $0 might have been pointing into. The cost is the copying of the buffer;
+ * but better correct than fast.
*/
void
-set_record(buf, cnt, freeold)
-char *buf; /* ignored if ! freeold */
-int cnt; /* ignored if ! freeold */
-int freeold;
+set_record(const char *buf, int cnt)
+{
+ NODE *n;
+ static char *databuf;
+ static unsigned long databuf_size;
+#define INITIAL_SIZE 512
+#define MAX_SIZE ((unsigned long) ~0) /* maximally portable ... */
+
+ reset_record();
+
+ /* buffer management: */
+ if (databuf_size == 0) { /* first time */
+ emalloc(databuf, char *, INITIAL_SIZE, "set_record");
+ databuf_size = INITIAL_SIZE;
+ memset(databuf, '\0', INITIAL_SIZE);
+
+ }
+ /*
+ * Make sure there's enough room. Since we sometimes need
+ * to place a sentinel at the end, we make sure
+ * databuf_size is > cnt after allocation.
+ */
+ if (cnt >= databuf_size) {
+ while (cnt >= databuf_size && databuf_size <= MAX_SIZE)
+ databuf_size *= 2;
+ erealloc(databuf, char *, databuf_size, "set_record");
+ memset(databuf, '\0', databuf_size);
+ }
+ /* copy the data */
+ memcpy(databuf, buf, cnt);
+
+ /* manage field 0: */
+ unref(fields_arr[0]);
+ getnode(n);
+ n->stptr = databuf;
+ n->stlen = cnt;
+ n->stref = 1;
+ n->type = Node_val;
+ n->stfmt = -1;
+ n->flags = (STRING|STRCUR|MAYBE_NUM|FIELD);
+ fields_arr[0] = n;
+
+#undef INITIAL_SIZE
+#undef MAX_SIZE
+}
+
+/* reset_record --- start over again with current $0 */
+
+void
+reset_record()
{
register int i;
NODE *n;
+ (void) force_string(fields_arr[0]);
+
NF = -1;
for (i = 1; i <= parse_high_water; i++) {
unref(fields_arr[i]);
@@ -226,36 +290,15 @@ int freeold;
parse_high_water = 0;
/*
- * $0 = $0 should resplit using the current value of FS, thus,
- * this is executed orthogonally to the value of freeold.
+ * $0 = $0 should resplit using the current value of FS.
*/
if (resave_fs) {
resave_fs = FALSE;
unref(save_FS);
save_FS = dupnode(FS_node->var_value);
}
- if (freeold) {
- unref(fields_arr[0]);
- getnode(n);
- n->stptr = buf;
- n->stlen = cnt;
- n->stref = 1;
- n->type = Node_val;
- n->stfmt = -1;
- n->flags = (STRING|STR|MAYBE_NUM|SCALAR|FIELD);
- fields_arr[0] = n;
- }
- fields_arr[0]->flags |= MAYBE_NUM;
- field0_valid = TRUE;
-}
-
-/* reset_record --- start over again with current $0 */
-void
-reset_record()
-{
- (void) force_string(fields_arr[0]);
- set_record(fields_arr[0]->stptr, fields_arr[0]->stlen, FALSE);
+ field0_valid = TRUE;
}
/* set_NF --- handle what happens to $0 and fields when NF is changed */
@@ -269,17 +312,21 @@ set_NF()
assert(NF != -1);
NF = (long) force_number(NF_node->var_value);
+
+ if (NF < 0)
+ fatal(_("NF set to negative 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;
@@ -298,19 +345,24 @@ set_NF()
* expression -- either user-defined or because RS=="" and FS==" "
*/
static long
-re_parse_field(up_to, buf, len, fs, rp, set, n)
-long up_to; /* parse only up to this field number */
-char **buf; /* on input: string to parse; on output: point to start next */
-int len;
-NODE *fs;
-Regexp *rp;
-Setfunc set; /* routine to set the value of the parsed field */
-NODE *n;
+re_parse_field(long up_to, /* parse only up to this field number */
+ char **buf, /* on input: string to parse; on output: point to start next */
+ int len,
+ NODE *fs ATTRIBUTE_UNUSED,
+ Regexp *rp,
+ Setfunc set, /* routine to set the value of the parsed field */
+ NODE *n)
{
register char *scan = *buf;
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 (gawk_mb_cur_max > 1)
+ memset(&mbs, 0, sizeof(mbstate_t));
+#endif
if (up_to == HUGE)
nf = 0;
@@ -325,6 +377,17 @@ NODE *n;
&& research(rp, scan, 0, (end - scan), TRUE) != -1
&& nf < up_to) {
if (REEND(rp, scan) == RESTART(rp, scan)) { /* null match */
+#ifdef MBS_SUPPORT
+ if (gawk_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);
@@ -357,14 +420,13 @@ NODE *n;
*/
static long
-def_parse_field(up_to, buf, len, fs, rp, set, n)
-long up_to; /* parse only up to this field number */
-char **buf; /* on input: string to parse; on output: point to start next */
-int len;
-NODE *fs;
-Regexp *rp;
-Setfunc set; /* routine to set the value of the parsed field */
-NODE *n;
+def_parse_field(long up_to, /* parse only up to this field number */
+ char **buf, /* on input: string to parse; on output: point to start next */
+ int len,
+ NODE *fs,
+ Regexp *rp ATTRIBUTE_UNUSED,
+ Setfunc set, /* routine to set the value of the parsed field */
+ NODE *n)
{
register char *scan = *buf;
register long nf = parse_high_water;
@@ -425,14 +487,13 @@ NODE *n;
*/
static long
-posix_def_parse_field(up_to, buf, len, fs, rp, set, n)
-long up_to; /* parse only up to this field number */
-char **buf; /* on input: string to parse; on output: point to start next */
-int len;
-NODE *fs;
-Regexp *rp;
-Setfunc set; /* routine to set the value of the parsed field */
-NODE *n;
+posix_def_parse_field(long up_to, /* parse only up to this field number */
+ char **buf, /* on input: string to parse; on output: point to start next */
+ int len,
+ NODE *fs,
+ Regexp *rp ATTRIBUTE_UNUSED,
+ Setfunc set, /* routine to set the value of the parsed field */
+ NODE *n)
{
register char *scan = *buf;
register long nf = parse_high_water;
@@ -490,14 +551,13 @@ NODE *n;
* via (*parse_field)(). This variation is for when FS is the null string.
*/
static long
-null_parse_field(up_to, buf, len, fs, rp, set, n)
-long up_to; /* parse only up to this field number */
-char **buf; /* on input: string to parse; on output: point to start next */
-int len;
-NODE *fs;
-Regexp *rp;
-Setfunc set; /* routine to set the value of the parsed field */
-NODE *n;
+null_parse_field(long up_to, /* parse only up to this field number */
+ char **buf, /* on input: string to parse; on output: point to start next */
+ int len,
+ NODE *fs ATTRIBUTE_UNUSED,
+ Regexp *rp ATTRIBUTE_UNUSED,
+ Setfunc set, /* routine to set the value of the parsed field */
+ NODE *n)
{
register char *scan = *buf;
register long nf = parse_high_water;
@@ -508,6 +568,22 @@ NODE *n;
if (len == 0)
return nf;
+#ifdef MBS_SUPPORT
+ if (gawk_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);
@@ -523,22 +599,26 @@ NODE *n;
* other than space.
*/
static long
-sc_parse_field(up_to, buf, len, fs, rp, set, n)
-long up_to; /* parse only up to this field number */
-char **buf; /* on input: string to parse; on output: point to start next */
-int len;
-NODE *fs;
-Regexp *rp;
-Setfunc set; /* routine to set the value of the parsed field */
-NODE *n;
+sc_parse_field(long up_to, /* parse only up to this field number */
+ char **buf, /* on input: string to parse; on output: point to start next */
+ int len,
+ NODE *fs,
+ Regexp *rp ATTRIBUTE_UNUSED,
+ Setfunc set, /* routine to set the value of the parsed field */
+ NODE *n)
{
register char *scan = *buf;
register char fschar;
register long nf = parse_high_water;
register char *field;
register char *end = scan + len;
- int onecase;
char sav;
+#ifdef MBS_SUPPORT
+ size_t mbclen = 0;
+ mbstate_t mbs;
+ if (gawk_mb_cur_max > 1)
+ memset(&mbs, 0, sizeof(mbstate_t));
+#endif
if (up_to == HUGE)
nf = 0;
@@ -550,10 +630,6 @@ NODE *n;
else
fschar = fs->stptr[0];
- onecase = (IGNORECASE && isalpha(fschar));
- if (onecase)
- fschar = casetable[(int) fschar];
-
/* before doing anything save the char at *end */
sav = *end;
/* because it will be destroyed now: */
@@ -561,13 +637,21 @@ NODE *n;
for (; nf < up_to;) {
field = scan;
- if (onecase) {
- while (casetable[(int) *scan] != fschar)
- scan++;
- } else {
- while (*scan != fschar)
- scan++;
- }
+#ifdef MBS_SUPPORT
+ if (gawk_mb_cur_max > 1) {
+ while (*scan != fschar) {
+ 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
+ while (*scan != fschar)
+ scan++;
(*set)(++nf, field, (long)(scan - field), n);
if (scan == end)
break;
@@ -588,18 +672,17 @@ NODE *n;
/*
* fw_parse_field --- field parsing using FIELDWIDTHS spec
*
- * This is called both from get_field() and from do_split()
- * via (*parse_field)(). This variation is for fields are fixed widths.
+ * This is called from get_field() via (*parse_field)().
+ * This variation is for fields are fixed widths.
*/
static long
-fw_parse_field(up_to, buf, len, fs, rp, set, n)
-long up_to; /* parse only up to this field number */
-char **buf; /* on input: string to parse; on output: point to start next */
-int len;
-NODE *fs;
-Regexp *rp;
-Setfunc set; /* routine to set the value of the parsed field */
-NODE *n;
+fw_parse_field(long up_to, /* parse only up to this field number */
+ char **buf, /* on input: string to parse; on output: point to start next */
+ int len,
+ NODE *fs ATTRIBUTE_UNUSED,
+ Regexp *rp ATTRIBUTE_UNUSED,
+ Setfunc set, /* routine to set the value of the parsed field */
+ NODE *n)
{
register char *scan = *buf;
register long nf = parse_high_water;
@@ -624,10 +707,10 @@ NODE *n;
/* get_field --- return a particular $n */
+/* assign is not NULL if this field is on the LHS of an assign */
+
NODE **
-get_field(requested, assign)
-register long requested;
-Func_ptr *assign; /* this field is on the LHS of an assign */
+get_field(register long requested, Func_ptr *assign)
{
/*
* if requesting whole line but some other field has been altered,
@@ -700,67 +783,68 @@ Func_ptr *assign; /* this field is on the LHS of an assign */
/* set_element --- set an array element, used by do_split() */
static void
-set_element(num, s, len, n)
-long num;
-char *s;
-long len;
-NODE *n;
+set_element(long num, char *s, long len, NODE *n)
{
register NODE *it;
it = make_string(s, len);
it->flags |= MAYBE_NUM;
- *assoc_lookup(n, tmp_number((AWKNUM) (num))) = it;
+ *assoc_lookup(n, tmp_number((AWKNUM) (num)), FALSE) = it;
}
/* do_split --- implement split(), semantics are same as for field splitting */
NODE *
-do_split(tree)
-NODE *tree;
+do_split(NODE *tree)
{
- NODE *src, *arr, *sep, *tmp;
- NODE *fs;
+ NODE *src, *arr, *sep, *fs, *src2, *fs2, *tmp;
char *s;
long (*parseit) P((long, char **, int, NODE *,
Regexp *, Setfunc, NODE *));
Regexp *rp = NULL;
- /*
- * do dupnode(), to avoid problems like
- * x = split(a[1], a, "blah")
- * since we assoc_clear the array. gack.
- * this also gives us complete call by value semantics.
- */
- tmp = tree_eval(tree->lnode);
- src = dupnode(tmp);
- free_temp(tmp);
+ src = force_string(tree_eval(tree->lnode));
- arr = tree->rnode->lnode;
- if (tree->rnode->rnode != NULL)
- sep = tree->rnode->rnode->lnode; /* 3rd arg */
- else
- sep = NULL;
+ arr = get_param(tree->rnode->lnode);
+ if (arr->type != Node_var_array)
+ fatal(_("split: second argument is not an array"));
- (void) force_string(src);
+ sep = tree->rnode->rnode->lnode;
- if (arr->type == Node_param_list)
- arr = stack_ptr[arr->param_cnt];
- if (arr->type != Node_var && arr->type != Node_var_array)
- fatal("second argument of split is not an array");
- arr->type = Node_var_array;
- assoc_clear(arr);
+ if (src->stlen == 0) {
+ /*
+ * Skip the work if first arg is the null string.
+ */
+ free_temp(src);
+ /*
+ * Evaluate sep if it may have side effects.
+ */
+ if ((sep->re_flags & (FS_DFLT|CONST)) == 0)
+ free_temp(tree_eval(sep->re_exp));
+ /*
+ * And now we can safely turn off the array.
+ */
+ assoc_clear(arr);
+ return tmp_number((AWKNUM) 0);
+ }
- if (sep->re_flags & FS_DFLT) {
+ if ((sep->re_flags & FS_DFLT) != 0 && ! using_FIELDWIDTHS() && ! RS_is_null) {
parseit = parse_field;
fs = force_string(FS_node->var_value);
rp = FS_regexp;
} else {
- tmp = force_string(tree_eval(sep->re_exp));
- if (tmp->stlen == 0)
+ fs = force_string(tree_eval(sep->re_exp));
+ if (fs->stlen == 0) {
+ static short warned = FALSE;
+
parseit = null_parse_field;
- else if (tmp->stlen == 1 && (sep->re_flags & CONST) == 0) {
- if (tmp->stptr[0] == ' ') {
+
+ if (do_lint && ! warned) {
+ warned = TRUE;
+ lintwarn(_("split: null string for third arg is a gawk extension"));
+ }
+ } else if (fs->stlen == 1 && (sep->re_flags & CONST) == 0) {
+ if (fs->stptr[0] == ' ') {
if (do_posix)
parseit = posix_def_parse_field;
else
@@ -771,14 +855,27 @@ NODE *tree;
parseit = re_parse_field;
rp = re_update(sep);
}
- fs = tmp;
}
- s = src->stptr;
- tmp = tmp_number((AWKNUM) (*parseit)(HUGE, &s, (int) src->stlen,
- fs, rp, set_element, arr));
- unref(src);
- free_temp(sep);
+ /*
+ * do dupnode(), to avoid problems like
+ * x = split(a["LINE"], a, a["FS"])
+ * since we assoc_clear the array. gack.
+ * this also gives us complete call by value semantics.
+ */
+ src2 = dupnode(src);
+ free_temp(src);
+
+ fs2 = dupnode(fs);
+ free_temp(fs);
+
+ assoc_clear(arr);
+
+ s = src2->stptr;
+ tmp = tmp_number((AWKNUM) (*parseit)(HUGE, &s, (int) src2->stlen,
+ fs2, rp, set_element, arr));
+ unref(src2);
+ unref(fs2);
return tmp;
}
@@ -790,13 +887,13 @@ set_FIELDWIDTHS()
register char *scan;
char *end;
register int i;
- static int fw_alloc = 1;
+ static int fw_alloc = 4;
static int warned = FALSE;
extern double strtod();
if (do_lint && ! warned) {
warned = TRUE;
- warning("use of FIELDWIDTHS is a gawk extension");
+ lintwarn(_("`FIELDWIDTHS' is a gawk extension"));
}
if (do_traditional) /* quick and dirty, does the trick */
return;
@@ -822,16 +919,13 @@ set_FIELDWIDTHS()
FIELDWIDTHS[i] = (int) strtod(scan, &end);
if (end == scan)
break;
+ if (FIELDWIDTHS[i] <= 0)
+ fatal(_("field %d in FIELDWIDTHS, must be > 0"), i);
scan = end;
}
FIELDWIDTHS[i] = -1;
-}
-void
-set_FS_if_not_FIELDWIDTHS()
-{
- if (parse_field != fw_parse_field)
- set_FS();
+ update_PROCINFO("FS", "FIELDWIDTHS");
}
/* set_FS --- handle things when FS is assigned to */
@@ -843,6 +937,7 @@ set_FS()
NODE *fs;
static NODE *save_fs = NULL;
static NODE *save_rs = NULL;
+ int remake_re = TRUE;
/*
* If changing the way fields are split, obey least-suprise
@@ -851,31 +946,67 @@ set_FS()
if (fields_arr != NULL)
(void) get_field(HUGE - 1, 0);
- if (save_fs && cmp_nodes(FS_node->var_value, save_fs) == 0
- && save_rs && cmp_nodes(RS_node->var_value, save_rs) == 0)
- return;
+ /* It's possible that only IGNORECASE changed, or FS = FS */
+ /*
+ * This comparison can't use cmp_nodes(), which pays attention
+ * to IGNORECASE, and that's not what we want.
+ */
+ if (save_fs
+ && FS_node->var_value->stlen == save_fs->stlen
+ && STREQN(FS_node->var_value->stptr, save_fs->stptr, save_fs->stlen)
+ && save_rs
+ && RS_node->var_value->stlen == save_rs->stlen
+ && STREQN(RS_node->var_value->stptr, save_rs->stptr, save_rs->stlen)) {
+ if (FS_regexp != NULL)
+ FS_regexp = (IGNORECASE ? FS_re_no_case : FS_re_yes_case);
+
+ /* FS = FS */
+ if (! using_FIELDWIDTHS())
+ return;
+ else {
+ remake_re = FALSE;
+ goto choose_fs_function;
+ }
+ }
+
unref(save_fs);
save_fs = dupnode(FS_node->var_value);
unref(save_rs);
save_rs = dupnode(RS_node->var_value);
resave_fs = TRUE;
- buf[0] = '\0';
- default_FS = FALSE;
- if (FS_regexp) {
- refree(FS_regexp);
- FS_regexp = NULL;
+ if (FS_regexp != NULL) {
+ refree(FS_re_yes_case);
+ refree(FS_re_no_case);
+ FS_re_yes_case = FS_re_no_case = FS_regexp = NULL;
}
+
+
+choose_fs_function:
+ buf[0] = '\0';
+ default_FS = FALSE;
fs = force_string(FS_node->var_value);
- if (! do_traditional && fs->stlen == 0)
+
+ if (! do_traditional && fs->stlen == 0) {
+ static short warned = FALSE;
+
parse_field = null_parse_field;
- else if (fs->stlen > 1)
+
+ if (do_lint && ! warned) {
+ warned = TRUE;
+ lintwarn(_("null string for `FS' is a gawk extension"));
+ }
+ } else if (fs->stlen > 1) {
parse_field = re_parse_field;
- else if (RS_is_null) {
+ } else if (RS_is_null) {
+ /* we know that fs->stlen <= 1 */
parse_field = sc_parse_field;
if (fs->stlen == 1) {
if (fs->stptr[0] == ' ') {
default_FS = TRUE;
strcpy(buf, "[ \t\n]+");
+ } else if (fs->stptr[0] == '\\') {
+ /* yet another special case */
+ strcpy(buf, "[\\\\\n]");
} else if (fs->stptr[0] != '\n')
sprintf(buf, "[%c\n]", fs->stptr[0]);
}
@@ -884,25 +1015,46 @@ set_FS()
parse_field = posix_def_parse_field;
else
parse_field = def_parse_field;
- if (fs->stptr[0] == ' ' && fs->stlen == 1)
- default_FS = TRUE;
- else if (fs->stptr[0] != ' ' && fs->stlen == 1) {
- if (! IGNORECASE)
- parse_field = sc_parse_field;
+
+ if (fs->stlen == 1) {
+ if (fs->stptr[0] == ' ')
+ default_FS = TRUE;
else if (fs->stptr[0] == '\\')
- /* yet another special case */
+ /* same special case */
strcpy(buf, "[\\\\]");
else
- sprintf(buf, "[%c]", fs->stptr[0]);
+ parse_field = sc_parse_field;
}
}
- if (buf[0] != '\0') {
- FS_regexp = make_regexp(buf, strlen(buf), IGNORECASE, TRUE);
- parse_field = re_parse_field;
- } else if (parse_field == re_parse_field) {
- FS_regexp = make_regexp(fs->stptr, fs->stlen, IGNORECASE, TRUE);
- } else
- FS_regexp = NULL;
+ if (remake_re) {
+ if (FS_regexp != NULL) {
+ refree(FS_re_yes_case);
+ refree(FS_re_no_case);
+ FS_re_yes_case = FS_re_no_case = FS_regexp = NULL;
+ }
+
+ if (buf[0] != '\0') {
+ FS_re_yes_case = make_regexp(buf, strlen(buf), FALSE);
+ FS_re_no_case = make_regexp(buf, strlen(buf), TRUE);
+ FS_regexp = (IGNORECASE ? FS_re_no_case : FS_re_yes_case);
+ parse_field = re_parse_field;
+ } else if (parse_field == re_parse_field) {
+ FS_re_yes_case = make_regexp(fs->stptr, fs->stlen, FALSE);
+ FS_re_no_case = make_regexp(fs->stptr, fs->stlen, TRUE);
+ FS_regexp = (IGNORECASE ? FS_re_no_case : FS_re_yes_case);
+ } else
+ FS_re_yes_case = FS_re_no_case = FS_regexp = NULL;
+ }
+
+ /*
+ * For FS = "c", we don't use IGNORECASE. But we must use
+ * re_parse_field to get the character and the newline as
+ * field separators.
+ */
+ if (fs->stlen == 1 && parse_field == re_parse_field)
+ FS_regexp = FS_re_yes_case;
+
+ update_PROCINFO("FS", "FS");
}
/* using_fieldwidths --- is FS or FIELDWIDTHS in use? */
@@ -910,6 +1062,19 @@ set_FS()
int
using_fieldwidths()
{
- return parse_field == fw_parse_field;
+ return using_FIELDWIDTHS();
}
+/* update_PROCINFO --- update PROCINFO[sub] when FS or FIELDWIDTHS set */
+
+static void
+update_PROCINFO(char *subscript, char *str)
+{
+ NODE **aptr;
+
+ if (PROCINFO_node == NULL)
+ return;
+
+ aptr = assoc_lookup(PROCINFO_node, tmp_string(subscript, strlen(subscript)), FALSE);
+ assign_val(aptr, tmp_string(str, strlen(str)));
+}
diff --git a/gnu/dist/gawk/fixvers b/gnu/dist/gawk/fixvers
new file mode 100755
index 00000000000..928bd4a09b4
--- /dev/null
+++ b/gnu/dist/gawk/fixvers
@@ -0,0 +1,58 @@
+#! /bin/sh
+
+# fixvers --- make sure version.c and patchlev.h reflect
+# the reality in configure.ac
+#
+# Copyright (C) 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
+
+line=`grep '^AM_INIT_AUTOMAKE' configure.ac`
+
+case $1 in
+-v)
+ VERS=`echo $line | sed 's/.*, *\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9a-z]*\))/\1.\2/'`
+ sed "s/X\.Y/$VERS/" < version.in > version.new
+ if [ -f version.c ] && cmp version.c version.new
+ then
+ rm version.new
+ else
+ mv version.new version.c
+ fi
+ touch version.c
+ ;;
+
+-p)
+ LEV=`echo $line | sed 's/.*, *\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9a-z]*\))/\"\3\"/'`
+ echo "#define PATCHLEVEL $LEV" > patchlev.new
+ if [ -f patchlev.h ] && cmp patchlev.h patchlev.new
+ then
+ rm patchlev.new
+ else
+ mv patchlev.new patchlev.h
+ fi
+ touch patchlev.h
+ ;;
+
+*)
+ echo "usage: $0 -v|-p" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/gnu/dist/gawk/gawkmisc.c b/gnu/dist/gawk/gawkmisc.c
index 0707971484b..9f26036d1a1 100644
--- a/gnu/dist/gawk/gawkmisc.c
+++ b/gnu/dist/gawk/gawkmisc.c
@@ -1,9 +1,11 @@
+/* $NetBSD: gawkmisc.c,v 1.1.1.2 2003/10/06 15:45:57 wiz Exp $ */
+
/*
* gawkmisc.c --- miscellanious gawk routines that are OS specific.
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991 - 97 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-2003 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -25,21 +27,33 @@
#include "awk.h"
+#if defined(HAVE_FCNTL_H)
+#include <fcntl.h>
+#endif
+
/* 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
+#else /* not MSDOS, not OS2, not WIN32 */
#if defined(VMS)
#include "vms/gawkmisc.vms"
-#else
+#else /* not VMS */
#if defined(atarist)
-#include "atari/gawkmisc.atr"
-#else
+#include "unsupported/atari/gawkmisc.atr"
+#else /* not atarist */
+#if defined(TANDEM)
+#include "tmiscc"
+#else /* not TANDEM */
#include "posix/gawkmisc.c"
-#endif
-#endif
-#endif
+#endif /* not TANDEM */
+#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 */
@@ -52,8 +66,7 @@ typedef char *pointer;
extern pointer xmalloc P((size_t bytes)); /* get rid of gcc warning */
pointer
-xmalloc(bytes)
-size_t bytes;
+xmalloc(size_t bytes)
{
pointer p;
diff --git a/gnu/dist/gawk/getopt.h b/gnu/dist/gawk/getopt.h
index 7dad11b79ff..5ff18a841ec 100644
--- a/gnu/dist/gawk/getopt.h
+++ b/gnu/dist/gawk/getopt.h
@@ -1,26 +1,40 @@
-/* Declarations for getopt.
- Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
+/* $NetBSD: getopt.h,v 1.1.1.2 2003/10/06 15:46:04 wiz Exp $ */
- This file is part of the GNU C Library. Its master source is NOT part of
- the C library, however. The master source lives in /gd/gnu/lib.
+/* Declarations for getopt.
+ Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU 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
-#define _GETOPT_H 1
+
+#ifndef __need_getopt
+# define _GETOPT_H 1
+#endif
+
+/* If __GNU_LIBRARY__ is not already defined, either we are being used
+ standalone, or this is the first header included in the source file.
+ If we are being used with glibc, we need to include <features.h>, but
+ that does not exist if we are standalone. So: if __GNU_LIBRARY__ is
+ not defined, include <ctype.h>, which will pull in <features.h> for us
+ if it's from glibc. (Why ctype.h? It's guaranteed to exist and it
+ doesn't flood the namespace with stuff the way some other headers do.) */
+#if !defined __GNU_LIBRARY__
+# include <ctype.h>
+#endif
#ifdef __cplusplus
extern "C" {
@@ -57,6 +71,7 @@ extern int opterr;
extern int optopt;
+#ifndef __need_getopt
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
of `struct option' terminated by an element containing a name which is
@@ -80,11 +95,11 @@ extern int optopt;
struct option
{
-#if defined (__STDC__) && __STDC__
+# if (defined __STDC__ && __STDC__) || defined __cplusplus
const char *name;
-#else
+# else
char *name;
-#endif
+# endif
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
@@ -94,40 +109,75 @@ struct option
/* Names for the values of the `has_arg' field of `struct option'. */
-#define no_argument 0
-#define required_argument 1
-#define optional_argument 2
+# define no_argument 0
+# define required_argument 1
+# define optional_argument 2
+#endif /* need getopt */
+
-#if defined (__STDC__) && __STDC__
-#ifdef __GNU_LIBRARY__
+/* Get definitions and prototypes for functions to process the
+ arguments in ARGV (ARGC of them, minus the program name) for
+ options given in OPTS.
+
+ Return the option character from OPTS just read. Return -1 when
+ there are no more options. For unrecognized options, or options
+ missing arguments, `optopt' is set to the option letter, and '?' is
+ returned.
+
+ The OPTS string is a list of characters which are recognized option
+ letters, optionally followed by colons, specifying that that letter
+ takes an argument, to be placed in `optarg'.
+
+ If a letter in OPTS is followed by two colons, its argument is
+ optional. This behavior is specific to the GNU `getopt'.
+
+ The argument `--' causes premature termination of argument
+ scanning, explicitly telling `getopt' that there are no more
+ options.
+
+ If OPTS begins with `--', then non-option arguments are treated as
+ arguments to the option '\0'. This behavior is specific to the GNU
+ `getopt'. */
+
+#if (defined __STDC__ && __STDC__) || defined __cplusplus
+# ifdef __GNU_LIBRARY__
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
-extern int getopt (int argc, char *const *argv, const char *shortopts);
-#else /* not __GNU_LIBRARY__ */
+extern int getopt (int ___argc, char *const *___argv, const char *__shortopts);
+# else /* not __GNU_LIBRARY__ */
extern int getopt ();
-#endif /* __GNU_LIBRARY__ */
-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);
+# endif /* __GNU_LIBRARY__ */
+
+# ifndef __need_getopt
+extern int getopt_long (int ___argc, char *const *___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind);
+extern int getopt_long_only (int ___argc, char *const *___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind);
/* Internal only. Users should not call this directly. */
-extern int _getopt_internal (int argc, char *const *argv,
- const char *shortopts,
- const struct option *longopts, int *longind,
- int long_only);
+extern int _getopt_internal (int ___argc, char *const *___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ int __long_only);
+# endif
#else /* not __STDC__ */
extern int getopt ();
+# ifndef __need_getopt
extern int getopt_long ();
extern int getopt_long_only ();
extern int _getopt_internal ();
+# endif
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
-#endif /* _GETOPT_H */
+/* Make sure we later can get all the definitions and declarations. */
+#undef __need_getopt
+
+#endif /* getopt.h */
diff --git a/gnu/dist/gawk/getopt1.c b/gnu/dist/gawk/getopt1.c
index 8347bb13315..b8c74ca50a2 100644
--- a/gnu/dist/gawk/getopt1.c
+++ b/gnu/dist/gawk/getopt1.c
@@ -1,23 +1,24 @@
-/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
+/* $NetBSD: getopt1.c,v 1.1.1.2 2003/10/06 15:46:04 wiz Exp $ */
- This file is part of the GNU C Library. Its master source is NOT part of
- the C library, however. The master source lives in /gd/gnu/lib.
+/* getopt_long and getopt_long_only entry points for GNU getopt.
+ Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
+ Free Software Foundation, Inc.
+ 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>
@@ -25,7 +26,7 @@
#include "getopt.h"
-#if !defined (__STDC__) || !__STDC__
+#if !defined __STDC__ || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const
@@ -44,7 +45,7 @@
it is simpler to just do this in the source for each such file. */
#define GETOPT_INTERFACE_VERSION 2
-#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
+#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
#include <gnu-versions.h>
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
#define ELIDE_CODE
diff --git a/gnu/dist/gawk/gettext.h b/gnu/dist/gawk/gettext.h
new file mode 100644
index 00000000000..8976b365816
--- /dev/null
+++ b/gnu/dist/gawk/gettext.h
@@ -0,0 +1,77 @@
+/* $NetBSD: gettext.h,v 1.1.1.1 2003/10/06 15:46:04 wiz Exp $ */
+
+/* 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
+
+/* ADR: Need this so gcc -g without -O works. */
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
+/* Get declarations of GNU message catalog functions. */
+# include <libintl.h>
+
+#else
+
+/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
+ chokes if dcgettext is defined as a macro. So include it now, to make
+ later inclusions of <locale.h> a NOP. We don't include <libintl.h>
+ as well because people using "gettext.h" will not include <libintl.h>,
+ and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
+ is OK. */
+#if defined(__sun)
+# include <locale.h>
+#endif
+
+/* 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/gnu/dist/gawk/install-sh b/gnu/dist/gawk/install-sh
index ab74c882e92..36f96f3e033 100755
--- a/gnu/dist/gawk/install-sh
+++ b/gnu/dist/gawk/install-sh
@@ -1,15 +1,27 @@
#!/bin/sh
#
# install - install a program, script, or datafile
-# This comes from X11R5.
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
-# from scratch.
-#
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
# set DOITPROG to echo to test this script
@@ -29,7 +41,7 @@ stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
-tranformbasename=""
+transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
@@ -44,7 +56,7 @@ dir_arg=""
while [ x"$1" != x ]; do
case $1 in
- -c) instcmd="$cpprog"
+ -c) instcmd=$cpprog
shift
continue;;
@@ -67,7 +79,7 @@ while [ x"$1" != x ]; do
shift
continue;;
- -s) stripcmd="$stripprog"
+ -s) stripcmd=$stripprog
shift
continue;;
@@ -94,127 +106,132 @@ done
if [ x"$src" = x ]
then
- echo "install: no input file specified"
+ echo "$0: no input file specified" >&2
exit 1
else
- true
+ :
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
-
- if [ -d $dst ]; then
+
+ if [ -d "$dst" ]; then
instcmd=:
+ chmodcmd=""
else
- instcmd=mkdir
+ instcmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
+# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
- if [ -f $src -o -d $src ]
+ if [ -f "$src" ] || [ -d "$src" ]
then
- true
+ :
else
- echo "install: $src does not exist"
+ echo "$0: $src does not exist" >&2
exit 1
fi
-
+
if [ x"$dst" = x ]
then
- echo "install: no destination specified"
+ echo "$0: no destination specified" >&2
exit 1
else
- true
+ :
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
- if [ -d $dst ]
+ if [ -d "$dst" ]
then
- dst="$dst"/`basename $src`
+ dst=$dst/`basename "$src"`
else
- true
+ :
fi
fi
## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
+defaultIFS='
+ '
+IFS="${IFS-$defaultIFS}"
-oIFS="${IFS}"
+oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
+set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS=$oIFS
pathcomp=''
while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
+ pathcomp=$pathcomp$1
shift
- if [ ! -d "${pathcomp}" ] ;
+ if [ ! -d "$pathcomp" ] ;
then
- $mkdirprog "${pathcomp}"
+ $mkdirprog "$pathcomp"
else
- true
+ :
fi
- pathcomp="${pathcomp}/"
+ pathcomp=$pathcomp/
done
fi
if [ x"$dir_arg" != x ]
then
- $doit $instcmd $dst &&
+ $doit $instcmd "$dst" &&
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
- if [ x"$transformarg" = x ]
+ if [ x"$transformarg" = x ]
then
- dstfile=`basename $dst`
+ dstfile=`basename "$dst"`
else
- dstfile=`basename $dst $transformbasename |
+ dstfile=`basename "$dst" $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
- if [ x"$dstfile" = x ]
+ if [ x"$dstfile" = x ]
then
- dstfile=`basename $dst`
+ dstfile=`basename "$dst"`
else
- true
+ :
fi
-# Make a temp file name in the proper directory.
+# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/#inst.$$#
+ rmtmp=$dstdir/#rm.$$#
-# Move or copy the file name to the temp name
+# Trap to clean up temp files at exit.
+
+ trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
+ trap '(exit $?); exit' 1 2 13 15
- $doit $instcmd $src $dsttmp &&
+# Move or copy the file name to the temp name
- trap "rm -f ${dsttmp}" 0 &&
+ $doit $instcmd "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits
@@ -222,17 +239,38 @@ else
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
+
+# Now remove or move aside any old file at destination location. We try this
+# two ways since rm can't unlink itself on some systems and the destination
+# file might be busy for other reasons. In this case, the final cleanup
+# might fail but the new file should still install successfully.
+
+{
+ if [ -f "$dstdir/$dstfile" ]
+ then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
+ $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
+ {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit
+ }
+ else
+ :
+ fi
+} &&
# Now rename the file to the real destination.
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
fi &&
+# The final little trick to "correctly" pass the exit status to the exit trap.
-exit 0
+{
+ (exit 0); exit
+}
diff --git a/gnu/dist/gawk/mkinstalldirs b/gnu/dist/gawk/mkinstalldirs
index 0801ec2c966..d2d5f21b611 100755
--- a/gnu/dist/gawk/mkinstalldirs
+++ b/gnu/dist/gawk/mkinstalldirs
@@ -2,31 +2,110 @@
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
-# Last modified: 1994-03-25
# Public domain
errstatus=0
+dirmode=""
-for file in ${1+"$@"} ; do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
+usage="\
+Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
- pathcomp=
- for d in ${1+"$@"} ; do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
- -* ) pathcomp=./$pathcomp ;;
- esac
+# process command line arguments
+while test $# -gt 0 ; do
+ case $1 in
+ -h | --help | --h*) # -h for help
+ echo "$usage" 1>&2
+ exit 0
+ ;;
+ -m) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+ dirmode=$1
+ shift
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
+
+for file
+do
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
+
+case $# in
+ 0) exit 0 ;;
+esac
+
+case $dirmode in
+ '')
+ if mkdir -p -- . 2>/dev/null; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ fi
+ ;;
+ *)
+ if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ fi
+ ;;
+esac
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+ lasterr=""
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp" 1>&2
- mkdir "$pathcomp" || errstatus=$?
- fi
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
- pathcomp="$pathcomp/"
- done
+ pathcomp="$pathcomp/"
+ done
done
exit $errstatus
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# End:
# mkinstalldirs ends here
diff --git a/gnu/dist/gawk/msg.c b/gnu/dist/gawk/msg.c
index 82fa422e62e..3ea6b37010b 100644
--- a/gnu/dist/gawk/msg.c
+++ b/gnu/dist/gawk/msg.c
@@ -1,9 +1,11 @@
+/* $NetBSD: msg.c,v 1.1.1.2 2003/10/06 15:46:22 wiz Exp $ */
+
/*
* msg.c - routines for error messages
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-1997 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-2001, 2003 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -28,36 +30,30 @@
int sourceline = 0;
char *source = NULL;
-static char *srcfile = NULL;
+static const char *srcfile = NULL;
static int srcline;
-/* prototype needed for ansi / gcc */
-void err P((const char *s, const char *emsg, va_list argp));
-
/* err --- print an error message with source line and file and record */
/* VARARGS2 */
void
-err(s, emsg, argp)
-const char *s;
-const char *emsg;
-va_list argp;
+err(const char *s, const char *emsg, va_list argp)
{
char *file;
(void) fflush(stdout);
(void) fprintf(stderr, "%s: ", myname);
-#ifdef DEBUG
+#ifdef GAWKDEBUG
if (srcfile != NULL) {
fprintf(stderr, "%s:%d:", srcfile, srcline);
srcfile = NULL;
}
-#endif /* DEBUG */
+#endif /* GAWKDEBUG */
if (sourceline != 0) {
if (source != NULL)
(void) fprintf(stderr, "%s:", source);
else
- (void) fprintf(stderr, "cmd. line:");
+ (void) fprintf(stderr, _("cmd. line:"));
(void) fprintf(stderr, "%d: ", sourceline);
}
@@ -68,7 +64,7 @@ va_list argp;
(void) fprintf(stderr, "FILENAME=%s ", file);
(void) fprintf(stderr, "FNR=%ld) ", FNR);
}
- (void) fprintf(stderr, s);
+ (void) fprintf(stderr, "%s", s);
vfprintf(stderr, emsg, argp);
(void) fprintf(stderr, "\n");
(void) fflush(stderr);
@@ -76,14 +72,18 @@ va_list argp;
/* msg --- take a varargs error message and print it */
-#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
+/*
+ * Function identifier purposely indented to avoid mangling
+ * by ansi2knr. Sigh.
+ */
+
void
-msg(char *mesg, ...)
+#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
+ msg(const char *mesg, ...)
#else
/*VARARGS0*/
-void
-msg(va_alist)
-va_dcl
+ msg(va_alist)
+ va_dcl
#endif
{
va_list args;
@@ -101,14 +101,13 @@ va_dcl
/* warning --- print a warning message */
-#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
void
-warning(char *mesg, ...)
+#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
+ warning(const char *mesg, ...)
#else
/*VARARGS0*/
-void
-warning(va_alist)
-va_dcl
+ warning(va_alist)
+ va_dcl
#endif
{
va_list args;
@@ -120,18 +119,17 @@ va_dcl
va_start(args);
mesg = va_arg(args, char *);
#endif
- err("warning: ", mesg, args);
+ err(_("warning: "), mesg, args);
va_end(args);
}
-#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
void
-error(char *mesg, ...)
+#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
+ error(const char *mesg, ...)
#else
/*VARARGS0*/
-void
-error(va_alist)
-va_dcl
+ error(va_alist)
+ va_dcl
#endif
{
va_list args;
@@ -143,31 +141,31 @@ va_dcl
va_start(args);
mesg = va_arg(args, char *);
#endif
- err("error: ", mesg, args);
+ err(_("error: "), mesg, args);
va_end(args);
}
/* set_loc --- set location where a fatal error happened */
void
-set_loc(file, line)
-char *file;
-int line;
+set_loc(const char *file, int line)
{
srcfile = file;
srcline = line;
+
+ /* This stupid line keeps some compilers happy: */
+ file = srcfile; line = srcline;
}
/* fatal --- print an error message and die */
-#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
void
-r_fatal(char *mesg, ...)
+#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
+ r_fatal(const char *mesg, ...)
#else
/*VARARGS0*/
-void
-r_fatal(va_alist)
-va_dcl
+ r_fatal(va_alist)
+ va_dcl
#endif
{
va_list args;
@@ -179,11 +177,10 @@ va_dcl
va_start(args);
mesg = va_arg(args, char *);
#endif
- err("fatal: ", mesg, args);
+ err(_("fatal: "), mesg, args);
va_end(args);
-#ifdef DEBUG
+#ifdef GAWKDEBUG
abort();
#endif
exit(2);
}
-
diff --git a/gnu/dist/gawk/node.c b/gnu/dist/gawk/node.c
index 6f10b9f3c6d..b480c2d8500 100644
--- a/gnu/dist/gawk/node.c
+++ b/gnu/dist/gawk/node.c
@@ -1,9 +1,11 @@
+/* $NetBSD: node.c,v 1.1.1.2 2003/10/06 15:46:24 wiz Exp $ */
+
/*
* node.c -- routines for node management
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-1997 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-2001, 2003 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -28,43 +30,52 @@
/* r_force_number --- force a value to be numeric */
AWKNUM
-r_force_number(n)
-register NODE *n;
+r_force_number(register NODE *n)
{
register char *cp;
register char *cpend;
char save;
char *ptr;
unsigned int newflags;
+ extern double strtod();
-#ifdef DEBUG
+#ifdef GAWKDEBUG
if (n == NULL)
cant_happen();
if (n->type != Node_val)
cant_happen();
- if(n->flags == 0)
+ if (n->flags == 0)
cant_happen();
- if (n->flags & NUM)
+ if (n->flags & NUMCUR)
return n->numbr;
#endif
/* all the conditionals are an attempt to avoid the expensive strtod */
n->numbr = 0.0;
- n->flags |= NUM;
+ n->flags |= NUMCUR;
- if (n->stlen == 0)
+ if (n->stlen == 0) {
+ if (0 && do_lint)
+ lintwarn(_("can't convert string to float"));
return 0.0;
+ }
cp = n->stptr;
- if (ISALPHA(*cp))
+ if (ISALPHA(*cp)) {
+ if (0 && do_lint)
+ lintwarn(_("can't convert string to float"));
return 0.0;
+ }
cpend = cp + n->stlen;
- while (cp < cpend && isspace(*cp))
+ while (cp < cpend && ISSPACE(*cp))
cp++;
- if (cp == cpend || isalpha(*cp))
+ if (cp == cpend || ISALPHA(*cp)) {
+ if (0 && do_lint)
+ lintwarn(_("can't convert string to float"));
return 0.0;
+ }
if (n->flags & MAYBE_NUM) {
newflags = NUMBER;
@@ -75,17 +86,18 @@ register NODE *n;
if (ISDIGIT(*cp)) {
n->numbr = (AWKNUM)(*cp - '0');
n->flags |= newflags;
- }
+ } else if (0 && do_lint)
+ lintwarn(_("can't convert string to float"));
return n->numbr;
}
-#ifdef NONDECDATA
- errno = 0;
- if (! do_traditional && isnondecimal(cp)) {
- n->numbr = nondec2awknum(cp, cpend - cp);
- goto finish;
+ if (do_non_decimal_data) {
+ errno = 0;
+ if (! do_traditional && isnondecimal(cp)) {
+ n->numbr = nondec2awknum(cp, cpend - cp);
+ goto finish;
+ }
}
-#endif /* NONDECDATA */
errno = 0;
save = *cpend;
@@ -98,10 +110,13 @@ register NODE *n;
*cpend = save;
finish:
/* the >= should be ==, but for SunOS 3.5 strtod() */
- if (errno == 0 && ptr >= cpend)
+ if (errno == 0 && ptr >= cpend) {
n->flags |= newflags;
- else
+ } else {
+ if (0 && do_lint && ptr < cpend)
+ lintwarn(_("can't convert string to float"));
errno = 0;
+ }
return n->numbr;
}
@@ -111,7 +126,7 @@ finish:
* (more complicated) variations on this theme didn't seem to pay off, but
* systematic testing might be in order at some point
*/
-static const char *values[] = {
+static const char *const values[] = {
"0",
"1",
"2",
@@ -128,31 +143,49 @@ static const char *values[] = {
/* format_val --- format a numeric value based on format */
NODE *
-format_val(format, index, s)
-char *format;
-int index;
-register NODE *s;
+format_val(const char *format, int index, register NODE *s)
{
- char buf[128];
+ char buf[BUFSIZ];
register char *sp = buf;
double val;
+ char *orig, *trans, save;
+
+ if (! do_traditional && (s->flags & INTLSTR) != 0) {
+ save = s->stptr[s->stlen];
+ s->stptr[s->stlen] = '\0';
+
+ orig = s->stptr;
+ trans = dgettext(TEXTDOMAIN, orig);
+
+ s->stptr[s->stlen] = save;
+ return tmp_string(trans, strlen(trans));
+ }
/* not an integral value, or out of range */
if ((val = double_to_int(s->numbr)) != s->numbr
|| val < LONG_MIN || val > LONG_MAX) {
-#ifdef GFMT_WORKAROUND
+ /*
+ * Once upon a time, if GFMT_WORKAROUND wasn't defined,
+ * we just blindly did this:
+ * sprintf(sp, format, s->numbr);
+ * s->stlen = strlen(sp);
+ * s->stfmt = (char) index;
+ * but that's no good if, e.g., OFMT is %s. So we punt,
+ * and just always format the value ourselves.
+ */
+
NODE *dummy, *r;
unsigned short oflags;
- extern NODE *format_tree P((const char *, int, NODE *));
extern NODE **fmt_list; /* declared in eval.c */
/* create dummy node for a sole use of format_tree */
getnode(dummy);
+ dummy->type = Node_expression_list;
dummy->lnode = s;
dummy->rnode = NULL;
oflags = s->flags;
s->flags |= PERM; /* prevent from freeing by format_tree() */
- r = format_tree(format, fmt_list[index]->stlen, dummy);
+ r = format_tree(format, fmt_list[index]->stlen, dummy, 2);
s->flags = oflags;
s->stfmt = (char) index;
s->stlen = r->stlen;
@@ -161,15 +194,6 @@ register NODE *s;
freenode(dummy); /* to keep s->stptr == r->stpr. */
goto no_malloc;
-#else
- /*
- * no need for a "replacement" formatting by gawk,
- * just use sprintf
- */
- sprintf(sp, format, s->numbr);
- s->stlen = strlen(sp);
- s->stfmt = (char) index;
-#endif /* GFMT_WORKAROUND */
} else {
/* integral value */
/* force conversion to long only once */
@@ -183,37 +207,34 @@ register NODE *s;
}
s->stfmt = -1;
}
- emalloc(s->stptr, char *, s->stlen + 2, "force_string");
+ emalloc(s->stptr, char *, s->stlen + 2, "format_val");
memcpy(s->stptr, sp, s->stlen+1);
-#ifdef GFMT_WORKAROUND
no_malloc:
-#endif /* GFMT_WORKAROUND */
s->stref = 1;
- s->flags |= STR;
+ s->flags |= STRCUR;
return s;
}
/* r_force_string --- force a value to be a string */
NODE *
-r_force_string(s)
-register NODE *s;
+r_force_string(register NODE *s)
{
-#ifdef DEBUG
+ NODE *ret;
+#ifdef GAWKDEBUG
if (s == NULL)
cant_happen();
if (s->type != Node_val)
cant_happen();
- if ((s->flags & NUM) == 0)
- cant_happen();
if (s->stref <= 0)
cant_happen();
- if ((s->flags & STR) != 0
+ if ((s->flags & STRCUR) != 0
&& (s->stfmt == -1 || s->stfmt == CONVFMTidx))
return s;
#endif
- return format_val(CONVFMT, CONVFMTidx, s);
+ ret = format_val(CONVFMT, CONVFMTidx, s);
+ return ret;
}
/*
@@ -223,48 +244,78 @@ register NODE *s;
*/
NODE *
-dupnode(n)
-NODE *n;
+r_dupnode(NODE *n)
{
register NODE *r;
+#ifndef DUPNODE_MACRO
if ((n->flags & TEMP) != 0) {
n->flags &= ~TEMP;
n->flags |= MALLOC;
return n;
}
- if ((n->flags & (MALLOC|STR)) == (MALLOC|STR)) {
+ if ((n->flags & PERM) != 0)
+ return n;
+#endif
+ if ((n->flags & (MALLOC|STRCUR)) == (MALLOC|STRCUR)) {
if (n->stref < LONG_MAX)
n->stref++;
+ else
+ n->flags |= PERM;
+ return n;
+ } else if ((n->flags & MALLOC) != 0 && n->type == Node_ahash) {
+ if (n->ahname_ref < LONG_MAX)
+ n->ahname_ref++;
+ else
+ n->flags |= PERM;
return n;
}
getnode(r);
*r = *n;
- r->flags &= ~(PERM|TEMP);
+ r->flags &= ~(PERM|TEMP|FIELD);
r->flags |= MALLOC;
- if (n->type == Node_val && (n->flags & STR) != 0) {
+ if (n->type == Node_val && (n->flags & STRCUR) != 0) {
r->stref = 1;
emalloc(r->stptr, char *, r->stlen + 2, "dupnode");
memcpy(r->stptr, n->stptr, r->stlen);
r->stptr[r->stlen] = '\0';
+ } else if (n->type == Node_ahash && (n->flags & MALLOC) != 0) {
+ r->ahname_ref = 1;
+ emalloc(r->ahname_str, char *, r->ahname_len + 2, "dupnode");
+ memcpy(r->ahname_str, n->ahname_str, r->ahname_len);
+ r->ahname_str[r->ahname_len] = '\0';
}
return r;
}
+/* copy_node --- force a brand new copy of a node to be allocated */
+
+NODE *
+copynode(NODE *old)
+{
+ NODE *new;
+ int saveflags;
+
+ assert(old != NULL);
+ saveflags = old->flags;
+ old->flags &= ~(MALLOC|PERM);
+ new = dupnode(old);
+ old->flags = saveflags;
+ return new;
+}
+
/* mk_number --- allocate a node with defined number */
NODE *
-mk_number(x, flags)
-AWKNUM x;
-unsigned int flags;
+mk_number(AWKNUM x, unsigned int flags)
{
register NODE *r;
getnode(r);
r->type = Node_val;
r->numbr = x;
- r->flags = flags | SCALAR;
-#ifdef DEBUG
+ r->flags = flags;
+#ifdef GAWKDEBUG
r->stref = 1;
r->stptr = NULL;
r->stlen = 0;
@@ -275,16 +326,13 @@ unsigned int flags;
/* make_str_node --- make a string node */
NODE *
-make_str_node(s, len, flags)
-char *s;
-size_t len;
-int flags;
+make_str_node(char *s, unsigned long len, int flags)
{
register NODE *r;
getnode(r);
r->type = Node_val;
- r->flags = (STRING|STR|MALLOC|SCALAR);
+ r->flags = (STRING|STRCUR|MALLOC);
if (flags & ALREADY_MALLOCED)
r->stptr = s;
else {
@@ -294,10 +342,10 @@ int flags;
r->stptr[len] = '\0';
if ((flags & SCAN) != 0) { /* scan for escape sequences */
- char *pf;
+ const char *pf;
register char *ptm;
register int c;
- register char *end;
+ register const char *end;
end = &(r->stptr[len]);
for (pf = ptm = r->stptr; pf < end;) {
@@ -306,7 +354,7 @@ int flags;
c = parse_escape(&pf);
if (c < 0) {
if (do_lint)
- warning("backslash at end of string");
+ lintwarn(_("backslash at end of string"));
c = '\\';
}
*ptm++ = c;
@@ -328,9 +376,7 @@ int flags;
/* tmp_string --- allocate a temporary string */
NODE *
-tmp_string(s, len)
-char *s;
-size_t len;
+tmp_string(char *s, size_t len)
{
register NODE *r;
@@ -351,9 +397,12 @@ more_nodes()
register NODE *np;
/* get more nodes and initialize list */
- emalloc(nextfree, NODE *, NODECHUNK * sizeof(NODE), "newnode");
+ emalloc(nextfree, NODE *, NODECHUNK * sizeof(NODE), "more_nodes");
for (np = nextfree; np <= &nextfree[NODECHUNK - 1]; np++) {
np->flags = 0;
+#ifndef NO_PROFILING
+ np->exec_count = 0;
+#endif
np->nextp = np + 1;
}
--np;
@@ -363,41 +412,47 @@ more_nodes()
return np;
}
-#ifdef DEBUG
+#ifdef MEMDEBUG
+#undef freenode
/* freenode --- release a node back to the pool */
void
-freenode(it)
-NODE *it;
+freenode(NODE *it)
{
- it->flags &= ~SCALAR;
#ifdef MPROF
it->stref = 0;
free((char *) it);
#else /* not MPROF */
+#ifndef NO_PROFILING
+ it->exec_count = 0;
+#endif
/* add it to head of freelist */
it->nextp = nextfree;
nextfree = it;
#endif /* not MPROF */
}
-#endif /* DEBUG */
+#endif /* GAWKDEBUG */
/* unref --- remove reference to a particular node */
void
-unref(tmp)
-register NODE *tmp;
+unref(register NODE *tmp)
{
if (tmp == NULL)
return;
if ((tmp->flags & PERM) != 0)
return;
- if ((tmp->flags & (MALLOC|TEMP)) != 0) {
- tmp->flags &= ~TEMP;
- if ((tmp->flags & STR) != 0) {
+ tmp->flags &= ~TEMP;
+ if ((tmp->flags & MALLOC) != 0) {
+ if (tmp->type == Node_ahash) {
+ if (tmp->ahname_ref > 1) {
+ tmp->ahname_ref--;
+ return;
+ }
+ free(tmp->ahname_str);
+ } else if ((tmp->flags & STRCUR) != 0) {
if (tmp->stref > 1) {
- if (tmp->stref != LONG_MAX)
- tmp->stref--;
+ tmp->stref--;
return;
}
free(tmp->stptr);
@@ -431,8 +486,7 @@ register NODE *tmp;
*/
int
-parse_escape(string_ptr)
-char **string_ptr;
+parse_escape(const char **string_ptr)
{
register int c = *(*string_ptr)++;
register int i;
@@ -484,18 +538,20 @@ char **string_ptr;
if (! didwarn) {
didwarn = TRUE;
- warning("POSIX does not allow \"\\x\" escapes");
+ lintwarn(_("POSIX does not allow `\\x' escapes"));
}
}
if (do_posix)
return ('x');
- if (! isxdigit((*string_ptr)[0])) {
- warning("no hex digits in \\x escape sequence");
+ if (! ISXDIGIT((*string_ptr)[0])) {
+ warning(_("no hex digits in `\\x' escape sequence"));
return ('x');
}
i = 0;
for (;;) {
- if (ISXDIGIT((c = *(*string_ptr)++))) {
+ /* do outside test to avoid multiple side effects */
+ c = *(*string_ptr)++;
+ if (ISXDIGIT(c)) {
i *= 16;
if (ISDIGIT(c))
i += c - '0';
@@ -509,7 +565,22 @@ char **string_ptr;
}
}
return i;
+ case '\\':
+ case '"':
+ return c;
default:
+ {
+ static short warned[256];
+ unsigned char uc = (unsigned char) c;
+
+ /* N.B.: use unsigned char here to avoid Latin-1 problems */
+
+ if (! warned[uc]) {
+ warned[uc] = TRUE;
+
+ warning(_("escape sequence `\\%c' treated as plain `%c'"), uc, uc);
+ }
+ }
return c;
}
}
diff --git a/gnu/dist/gawk/patchlev.h b/gnu/dist/gawk/patchlev.h
new file mode 100644
index 00000000000..1031539ec30
--- /dev/null
+++ b/gnu/dist/gawk/patchlev.h
@@ -0,0 +1,3 @@
+/* $NetBSD: patchlev.h,v 1.1.1.1 2003/10/06 15:46:24 wiz Exp $ */
+
+#define PATCHLEVEL "3"
diff --git a/gnu/dist/gawk/po/ChangeLog b/gnu/dist/gawk/po/ChangeLog
new file mode 100644
index 00000000000..5b6336f6403
--- /dev/null
+++ b/gnu/dist/gawk/po/ChangeLog
@@ -0,0 +1,42 @@
+Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.3: Release tar file made.
+
+2003-06-16 gettextize <bug-gnu-gettext@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.12.1.
+ * Rules-quot: New file, from gettext-0.12.1.
+ * boldquot.sed: New file, from gettext-0.12.1.
+ * en@boldquot.header: New file, from gettext-0.12.1.
+ * en@quot.header: New file, from gettext-0.12.1.
+ * insert-header.sin: New file, from gettext-0.12.1.
+ * quot.sed: New file, from gettext-0.12.1.
+
+Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ This time for sure.
+ -- Bullwinkle
+
+ * Release 3.1.2: Release tar file made.
+
+Mon Dec 2 11:49:59 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Rules-quot, en@quot.reader, en@boldquot.reader: removed.
+
+Thu Sep 19 11:00:00 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Updatedated to gettext 0.11.5.
+
+Mon Jun 17 18:26:23 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * POTFILES.in: Updated with list of new regex files.
+
+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/gnu/dist/gawk/po/LINGUAS b/gnu/dist/gawk/po/LINGUAS
new file mode 100644
index 00000000000..2d9b51e1e4e
--- /dev/null
+++ b/gnu/dist/gawk/po/LINGUAS
@@ -0,0 +1,10 @@
+es
+fr
+he
+it
+sv
+tr
+de
+da
+pt_BR
+ca
diff --git a/gnu/dist/gawk/po/Makefile.in.in b/gnu/dist/gawk/po/Makefile.in.in
new file mode 100644
index 00000000000..27b721aa8a7
--- /dev/null
+++ b/gnu/dist/gawk/po/Makefile.in.in
@@ -0,0 +1,353 @@
+# Makefile for PO directory in any package using GNU gettext.
+# Copyright (C) 1995-1997, 2000-2003 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU General Public
+# License but which still want to provide support for the GNU gettext
+# functionality.
+# Please note that the actual code of GNU gettext is covered by the GNU
+# General Public License and is *not* in the public domain.
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = /bin/sh
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datadir = @datadir@
+localedir = $(datadir)/locale
+gettextsrcdir = $(datadir)/gettext/po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
+
+GMSGFMT = @GMSGFMT@
+MSGFMT = @MSGFMT@
+XGETTEXT = @XGETTEXT@
+MSGMERGE = msgmerge
+MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGINIT = msginit
+MSGCONV = msgconv
+MSGFILTER = msgfilter
+
+POFILES = @POFILES@
+GMOFILES = @GMOFILES@
+UPDATEPOFILES = @UPDATEPOFILES@
+DUMMYPOFILES = @DUMMYPOFILES@
+DISTFILES.common = Makefile.in.in remove-potcdate.sin \
+$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \
+$(POFILES) $(GMOFILES) \
+$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+
+# Makevars gets inserted here. (Don't remove this line!)
+
+.SUFFIXES:
+.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update
+
+.po.mo:
+ @echo "$(MSGFMT) -c -o $@ $<"; \
+ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
+
+.po.gmo:
+ @lang=`echo $* | sed -e 's,.*/,,'`; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
+ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+
+.sin.sed:
+ sed -e '/^#/d' $< > t-$@
+ mv t-$@ $@
+
+
+all: all-@USE_NLS@
+
+all-yes: stamp-po
+all-no:
+
+# stamp-po is a timestamp denoting the last time at which the CATALOGS have
+# been loosely updated. Its purpose is that when a developer or translator
+# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
+# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
+# invocations of "make" will do nothing. This timestamp would not be necessary
+# if updating the $(CATALOGS) would always touch them; however, the rule for
+# $(POFILES) has been designed to not touch files that don't need to be
+# changed.
+stamp-po: $(srcdir)/$(DOMAIN).pot
+ test -z "$(CATALOGS)" || $(MAKE) $(CATALOGS)
+ @echo "touch stamp-po"
+ @echo timestamp > stamp-poT
+ @mv stamp-poT stamp-po
+
+# 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.
+
+# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
+# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
+ --files-from=$(srcdir)/POTFILES.in \
+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
+ --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)'
+ 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; \
+ }
+
+# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
+# every "make" invocation, only create it when it is missing.
+# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
+$(srcdir)/$(DOMAIN).pot:
+ $(MAKE) $(DOMAIN).pot-update
+
+# This target rebuilds a PO file if $(DOMAIN).pot has changed.
+# Note that a PO file is not touched if it doesn't need to be changed.
+$(POFILES): $(srcdir)/$(DOMAIN).pot
+ @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
+ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot
+
+
+install: install-exec install-data
+install-exec:
+install-data: install-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ $(INSTALL_DATA) $(srcdir)/$$file \
+ $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ for file in Makevars; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+install-data-no: all
+install-data-yes: all
+ $(mkinstalldirs) $(DESTDIR)$(datadir)
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkinstalldirs) $(DESTDIR)$$dir; \
+ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
+ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
+ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
+ fi; \
+ done; \
+ done
+
+install-strip: install
+
+installdirs: installdirs-exec installdirs-data
+installdirs-exec:
+installdirs-data: installdirs-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+ else \
+ : ; \
+ fi
+installdirs-data-no:
+installdirs-data-yes:
+ $(mkinstalldirs) $(DESTDIR)$(datadir)
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkinstalldirs) $(DESTDIR)$$dir; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ fi; \
+ done; \
+ done
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall: uninstall-exec uninstall-data
+uninstall-exec:
+uninstall-data: uninstall-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+uninstall-data-no:
+uninstall-data-yes:
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ done; \
+ done
+
+check: all
+
+info dvi ps pdf html tags TAGS ctags CTAGS ID:
+
+mostlyclean:
+ rm -f remove-potcdate.sed
+ rm -f stamp-poT
+ rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
+ rm -fr *.o
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES *.mo
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f stamp-po $(GMOFILES)
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir:
+ $(MAKE) update-po
+ @$(MAKE) dist2
+# This is a separate target because 'update-po' must be executed before.
+dist2: $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ dists="$$dists Makevars.template"; \
+ fi; \
+ if test -f $(srcdir)/ChangeLog; then \
+ dists="$$dists ChangeLog"; \
+ fi; \
+ for i in 0 1 2 3 4 5 6 7 8 9; do \
+ if test -f $(srcdir)/ChangeLog.$$i; then \
+ dists="$$dists ChangeLog.$$i"; \
+ fi; \
+ done; \
+ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
+ for file in $$dists; do \
+ if test -f $$file; then \
+ cp -p $$file $(distdir); \
+ else \
+ cp -p $(srcdir)/$$file $(distdir); \
+ fi; \
+ done
+
+update-po: Makefile
+ $(MAKE) $(DOMAIN).pot-update
+ test -z "$(UPDATEPOFILES)" || $(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-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
+ tmpdir=`pwd`; \
+ echo "$$lang:"; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
+ cd $(srcdir); \
+ if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "msgmerge for $$lang.po failed!" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi
+
+$(DUMMYPOFILES):
+
+update-gmo: Makefile $(GMOFILES)
+ @:
+
+Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
+ $(SHELL) ./config.status
+
+force:
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gnu/dist/gawk/po/Makevars b/gnu/dist/gawk/po/Makevars
new file mode 100644
index 00000000000..c5a271db1ed
--- /dev/null
+++ b/gnu/dist/gawk/po/Makevars
@@ -0,0 +1,41 @@
+# 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 email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+# in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+# understood.
+# - Strings which make invalid assumptions about notation of date, time or
+# money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = arnold@skeeve.com
+
+# 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/gnu/dist/gawk/po/POTFILES.in b/gnu/dist/gawk/po/POTFILES.in
new file mode 100644
index 00000000000..a23ba31d13b
--- /dev/null
+++ b/gnu/dist/gawk/po/POTFILES.in
@@ -0,0 +1,25 @@
+# List of source files containing translatable strings.
+# Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+
+array.c
+awkgram.c
+builtin.c
+eval.c
+ext.c
+field.c
+gawkmisc.c
+getopt.c
+getopt1.c
+io.c
+main.c
+msg.c
+node.c
+posix/gawkmisc.c
+profile.c
+random.c
+re.c
+regcomp.c
+regex_internal.c
+regexec.c
+replace.c
+version.c
diff --git a/gnu/dist/gawk/po/Rules-quot b/gnu/dist/gawk/po/Rules-quot
new file mode 100644
index 00000000000..5f46d237d25
--- /dev/null
+++ b/gnu/dist/gawk/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/gnu/dist/gawk/po/boldquot.sed b/gnu/dist/gawk/po/boldquot.sed
new file mode 100644
index 00000000000..4b937aa517b
--- /dev/null
+++ b/gnu/dist/gawk/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/gnu/dist/gawk/po/ca.gmo b/gnu/dist/gawk/po/ca.gmo
new file mode 100644
index 00000000000..bed9a5af9a6
--- /dev/null
+++ b/gnu/dist/gawk/po/ca.gmo
Binary files differ
diff --git a/gnu/dist/gawk/po/ca.po b/gnu/dist/gawk/po/ca.po
new file mode 100644
index 00000000000..1d746271841
--- /dev/null
+++ b/gnu/dist/gawk/po/ca.po
@@ -0,0 +1,1863 @@
+# translation of gawk.po to Catalan
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# Antoni Bella Perez <bella5@teleline.es>, 2003.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gawk 3.1.31\n"
+"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
+"POT-Creation-Date: 2003-07-07 11:20-0700\n"
+"PO-Revision-Date: 2003-05-07 21:13+0100\n"
+"Last-Translator: Antoni Bella Perez <bella5@teleline.es>\n"
+"Language-Team: Catalan <ca@dodds.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.0.1\n"
+
+#: array.c:112
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr "s'ha intentat usar un paràmetre escalar «%s» com a una matriu"
+
+#: array.c:113
+#, c-format
+msgid "attempt to use scalar `%s' as array"
+msgstr "s'ha intentat usar la dada escalar «%s» com a una matriu"
+
+#: array.c:151
+#, fuzzy, c-format
+msgid "from %s"
+msgstr "%s (de %s)"
+
+#: array.c:506
+#, c-format
+msgid "reference to uninitialized element `%s[\"%s\"]'"
+msgstr "referència a un element sense valor inicial «%s[\"%s\"]»"
+
+#: array.c:512
+#, c-format
+msgid "subscript of array `%s' is null string"
+msgstr "el subscript de la matriu «%s» és una cadena nul·la"
+
+#: array.c:609
+#, c-format
+msgid "delete: index `%s' not in array `%s'"
+msgstr "delete: l'índex «%s» no està en la matriu «%s»"
+
+#: array.c:769
+#, c-format
+msgid "%s: empty (null)\n"
+msgstr "%s: buit (nul)\n"
+
+#: array.c:774
+#, c-format
+msgid "%s: empty (zero)\n"
+msgstr "%s: buit (zero)\n"
+
+#: array.c:778
+#, c-format
+msgid "%s: table_size = %d, array_size = %d\n"
+msgstr "%s: mida_taula = %d, mida_matriu = %d\n"
+
+#: array.c:807
+#, fuzzy, c-format
+msgid "%s: is parameter\n"
+msgstr "%s: és un paràmetre\n"
+
+#: array.c:812
+#, c-format
+msgid "%s: array_ref to %s\n"
+msgstr "%s: ref_matriu a %s\n"
+
+#: awkgram.y:208
+#, fuzzy, c-format
+msgid "%s blocks must have an action part"
+msgstr "Els blocs FINAL han de tindre una part d'acció"
+
+#: awkgram.y:211
+#, fuzzy
+msgid "each rule must have a pattern or an action part"
+msgstr "Els blocs FINAL han de tindre una part d'acció"
+
+#: awkgram.y:267
+#, c-format
+msgid "`%s' is a built-in function, it cannot be redefined"
+msgstr "«%s» és una funció interna, no pot ser redefinida"
+
+#: awkgram.y:314
+#, c-format
+msgid "regexp constant `/%s/' looks like a C comment, but is not"
+msgstr ""
+"la constant d'expressió regular «/%s/» sembla un comentari en C, perà no ho "
+"és"
+
+#: awkgram.y:340 awkgram.y:615
+msgid "statement may have no effect"
+msgstr "la declaració podria no tindre efecte"
+
+#: awkgram.y:435 awkgram.y:455
+#, fuzzy, c-format
+msgid "`%s' used in %s action"
+msgstr "«next» és usat dintre de l'acció BEGIN o END"
+
+#: awkgram.y:448 awkgram.y:451
+msgid "`nextfile' is a gawk extension"
+msgstr "«nextfile» és una extensió de gawk"
+
+#: awkgram.y:465
+msgid "`return' used outside function context"
+msgstr "«return» és usat fora del context d'una funció"
+
+#: awkgram.y:504
+msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
+msgstr ""
+"el «print» simple en la regla BEGIN o END probablement ha de ser «print \"\"»"
+
+#: awkgram.y:517 awkgram.y:524
+msgid "`delete array' is a gawk extension"
+msgstr "«delete array» és una extensió de gawk"
+
+#: awkgram.y:532 awkgram.y:539
+#, fuzzy
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "«delete array» és una extensió de gawk"
+
+#: awkgram.y:583
+#, c-format
+msgid "duplicate case values in switch body: %s"
+msgstr ""
+
+#: awkgram.y:593
+msgid "Duplicate `default' detected in switch body"
+msgstr ""
+
+#: awkgram.y:681
+msgid "multistage two-way pipelines don't work"
+msgstr "les canonades bidireccionals multi-etapes no funcionen"
+
+#: awkgram.y:772
+msgid "regular expression on right of assignment"
+msgstr "expressió regular a la dreta d'una assignació"
+
+#: awkgram.y:782
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "expressió regular a l'esquerra de l'operador «~» o «!~»"
+
+#: awkgram.y:790
+msgid "regular expression on right of comparison"
+msgstr "expressió regular a la derta de la comparació"
+
+#: awkgram.y:857
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "«getline» no redirigit sense definir dintre de l'acció FINAL"
+
+#: awkgram.y:884
+msgid "call of `length' without parentheses is not portable"
+msgstr "la crida de «length» sense parèntesis no és portable"
+
+#: awkgram.y:887
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "la crida de «length» sense parèntesis està desaprovada per POSIX"
+
+#: awkgram.y:940
+msgid "use of non-array as array"
+msgstr ""
+
+#: awkgram.y:942
+msgid "invalid subscript expression"
+msgstr "expressió de subscript no vàlida"
+
+#: awkgram.y:1140
+#, fuzzy
+msgid "unexpected newline or end of string"
+msgstr "nova línia inesperada"
+
+#: awkgram.y:1235
+msgid "empty program text on command line"
+msgstr "el text del programa en la línia de comandaments està buit"
+
+#: awkgram.y:1292
+#, c-format
+msgid "can't open source file `%s' for reading (%s)"
+msgstr "no es pot obrir el fitxer font «%s» per a lectura (%s)"
+
+#: awkgram.y:1327
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "no es pot llegir el fitxer font «%s» (%s)"
+
+#: awkgram.y:1335
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "el fitxer font «%s» està buit"
+
+#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100
+msgid "source file does not end in newline"
+msgstr "el fitxer font no finalitza amb un retorn de carro"
+
+#: awkgram.y:1601
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr "expressió regular sense finalitzar acaba amb «\\» al final del fitxer"
+
+#: awkgram.y:1621
+msgid "unterminated regexp"
+msgstr "expressió regular sense finalitzar"
+
+#: awkgram.y:1624
+msgid "unterminated regexp at end of file"
+msgstr "expressió regular sense finalitzar al final del fitxer"
+
+#: awkgram.y:1691
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr "l'ús de «\\ #...» com a continuació de línia no és portable"
+
+#: awkgram.y:1703
+msgid "backslash not last character on line"
+msgstr "la barra invertida no és l'últim caràcter en la línia"
+
+#: awkgram.y:1748
+msgid "POSIX does not allow operator `**='"
+msgstr "POSIX no permet l'operador «**=»"
+
+#: awkgram.y:1750
+msgid "old awk does not support operator `**='"
+msgstr "l'antic awk no suporta l'operador «**=»"
+
+#: awkgram.y:1759
+msgid "POSIX does not allow operator `**'"
+msgstr "POSIX no permet l'operador «**»"
+
+#: awkgram.y:1761
+msgid "old awk does not support operator `**'"
+msgstr "l'antic awk no suporta l'operador «**=»"
+
+#: awkgram.y:1792
+msgid "operator `^=' is not supported in old awk"
+msgstr "l'operador «^=» no està suportat en l'antic awk"
+
+#: awkgram.y:1800
+msgid "operator `^' is not supported in old awk"
+msgstr "l'operador «^» no està suportat en l'antic awk"
+
+#: awkgram.y:1884 awkgram.y:1901
+msgid "unterminated string"
+msgstr "cadena sense finalitzar"
+
+#: awkgram.y:2061
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "caràcter «%c» no vàlid en l'expressió"
+
+#: awkgram.y:2121
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "«%s» és una extensió de gawk"
+
+#: awkgram.y:2124
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "«%s» és una extensió de Bell Labs"
+
+#: awkgram.y:2127
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "POSIX no permet «%s»"
+
+#: awkgram.y:2131
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "«%s» no està suportat en l'antic awk"
+
+#: awkgram.y:2158
+msgid "`goto' considered harmful!\n"
+msgstr "«goto» se considera nefast!\n"
+
+#: awkgram.y:2220
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
+msgstr "%d no és vàlid com a nombre d'arguments per a %s"
+
+#: awkgram.y:2239 awkgram.y:2242
+msgid "match: third argument is a gawk extension"
+msgstr "match: el tercer argument és una extensió de gawk"
+
+#: awkgram.y:2255
+#, c-format
+msgid "%s: string literal as last arg of substitute has no effect"
+msgstr "%s: la cadena literal com a últim argument de substitució no té efecte"
+
+#: awkgram.y:2258
+#, fuzzy, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "sub: el tercer argument no és un objecte intercanviable"
+
+#: awkgram.y:2285 awkgram.y:2288
+msgid "close: second argument is a gawk extension"
+msgstr "close: el segon argument és una extensió de gawk"
+
+#: awkgram.y:2298
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"l'ús de dcgettext(_\"...\") no és correcte: elimineu el guió baix inicial"
+
+#: awkgram.y:2313
+#, fuzzy
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"l'ús de dcgettext(_\"...\") no és correcte: elimineu el guió baix inicial"
+
+#: awkgram.y:2384
+#, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "funció «%s»: paràmetre #%d, «%s», duplica al paràmetre #%d"
+
+#: awkgram.y:2417
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "funció «%s»: paràmetre «%s» ofusca la variable global"
+
+#: awkgram.y:2529
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "no es pot obrir «%s» per a escriptura (%s)"
+
+#: awkgram.y:2530 profile.c:93
+msgid "sending profile to standard error"
+msgstr "enviant el perfil a l'eixida d'error estàndard"
+
+#: awkgram.y:2562
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: tancament erroni (%s)"
+
+#: awkgram.y:2684
+msgid "shadow_funcs() called twice!"
+msgstr "shadow_funcs() crida dos vegades!"
+
+#: awkgram.y:2711
+msgid "there were shadowed variables."
+msgstr ""
+
+#: awkgram.y:2784
+#, c-format
+msgid "function `%s': can't use function name as parameter name"
+msgstr "funció «%s»: no pot usar el nom de la funció com a paràmetre"
+
+#: awkgram.y:2794
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "nom de la funció «%s» definida prèviament"
+
+#: awkgram.y:2945 awkgram.y:2951
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "es crida a la funció «%s» però no s'ha definit"
+
+#: awkgram.y:2954
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "es defineix la funció «%s» però no s'ha cridat mai"
+
+#: awkgram.y:2981
+#, c-format
+msgid "regexp constant for parameter #%d yields boolean value"
+msgstr ""
+"l'expressió regular constant per al paràmetre #%d condueix a un valor booleà"
+
+#: awkgram.y:2994
+#, c-format
+msgid ""
+"function `%s' called with space between name and `(',\n"
+"%s"
+msgstr ""
+"s'ha cridat a la funció «%s» amb espai entre el nom i el «(»,\n"
+"%s"
+
+#: awkgram.y:2996
+#, fuzzy
+msgid "or used as a variable or an array"
+msgstr "no es pot usar el nom de la funció «%s» com a variable o matriu"
+
+#: builtin.c:137
+#, c-format
+msgid "%s to \"%s\" failed (%s)"
+msgstr "%s a \"%s\" ha fallat (%s)"
+
+#: builtin.c:138
+msgid "standard output"
+msgstr "eixida estàndard"
+
+#: builtin.c:139
+msgid "reason unknown"
+msgstr "motiu desconegut"
+
+#: builtin.c:152
+msgid "exp: received non-numeric argument"
+msgstr "exp: s'ha rebut un argument que no és un número"
+
+#: builtin.c:158
+#, c-format
+msgid "exp: argument %g is out of range"
+msgstr "exp: l'argument %g està fora de rang"
+
+#: builtin.c:216
+#, c-format
+msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
+msgstr ""
+"fflush: no es pot netejar: la canonada «%s» s'ha obert per a lectura, no per "
+"a escriptura"
+
+#: builtin.c:219
+#, c-format
+msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
+msgstr ""
+"fflush: no es pot netejar: el fitxer «%s» s'ha obert per a lectura, no per a "
+"escriptura"
+
+#: builtin.c:231
+#, c-format
+msgid "fflush: `%s' is not an open file, pipe or co-process"
+msgstr "fflush: «%s» no és un fitxer obert, canonada o co-procés"
+
+#: builtin.c:325
+msgid "index: received non-string first argument"
+msgstr "índex: el primer argument rebut no és una cadena"
+
+#: builtin.c:327
+msgid "index: received non-string second argument"
+msgstr "índex: el segon argument rebut no és una cadena"
+
+#: builtin.c:437
+msgid "int: received non-numeric argument"
+msgstr "int: s'ha rebut un argument no numèric"
+
+#: builtin.c:454
+msgid "length: received non-string argument"
+msgstr "length: s'ha rebut un argument que no és una cadena"
+
+#: builtin.c:470
+msgid "log: received non-numeric argument"
+msgstr "log: s'ha rebut un argument no numèric"
+
+#: builtin.c:473
+#, c-format
+msgid "log: received negative argument %g"
+msgstr "log: s'ha rebut l'argument negatiu %g"
+
+#: builtin.c:635 builtin.c:638
+msgid "must use `count$' on all formats or none"
+msgstr ""
+
+#: builtin.c:740
+msgid "`$' is not permitted in awk formats"
+msgstr "no es permeten «$» en els formats awk"
+
+#: builtin.c:746
+msgid "arg count with `$' must be > 0"
+msgstr "el compte d'arguments amb «$» ha de ser > 0"
+
+#: builtin.c:748
+#, fuzzy, c-format
+msgid "arg count %ld greater than total number of supplied arguments"
+msgstr ""
+"el comte d'arguments %d és major que el nombre total d'arguments "
+"proporcionats"
+
+#: builtin.c:750
+msgid "`$' not permitted after period in format"
+msgstr "no es permet «$» després d'un punt en el format"
+
+#: builtin.c:763
+msgid "no `$' supplied for positional field width or precision"
+msgstr "no es proporciona «$» per a l'ample o precisió del camp de posició"
+
+#: builtin.c:821
+msgid "`l' is meaningless in awk formats; ignored"
+msgstr "«l» manca de significat en els formats awk; serà ignorat"
+
+#: builtin.c:825
+msgid "`l' is not permitted in POSIX awk formats"
+msgstr "«l» no està permés en els formats POSIX de awk"
+
+#: builtin.c:836
+msgid "`L' is meaningless in awk formats; ignored"
+msgstr "«L» manca de significat en els formats awk; serà ignorat"
+
+#: builtin.c:840
+msgid "`L' is not permitted in POSIX awk formats"
+msgstr "«L» no està permés en els formats POSIX de awk"
+
+#: builtin.c:851
+msgid "`h' is meaningless in awk formats; ignored"
+msgstr "«h» manca de significat en els formats awk; serà ignorat"
+
+#: builtin.c:855
+msgid "`h' is not permitted in POSIX awk formats"
+msgstr "«h» no està permés en els formats POSIX de awk"
+
+#: builtin.c:1055
+#, c-format
+msgid "[s]printf: value %g is out of range for `%%%c' format"
+msgstr ""
+
+#: builtin.c:1108
+msgid "not enough arguments to satisfy format string"
+msgstr "no hi ha prou arguments per a satisfer el format d'una cadena"
+
+#: builtin.c:1110
+msgid "^ ran out for this one"
+msgstr "^ desbordament per a aquest"
+
+#: builtin.c:1115
+msgid "[s]printf: format specifier does not have control letter"
+msgstr "[s]printf: l'especificador de format no conté lletra de control"
+
+#: builtin.c:1118
+msgid "too many arguments supplied for format string"
+msgstr "s'han proporcionat masses arguments per a la cadena de format"
+
+#: builtin.c:1184 builtin.c:1187
+msgid "printf: no arguments"
+msgstr "printf: sense arguments"
+
+#: builtin.c:1211
+msgid "sqrt: received non-numeric argument"
+msgstr "sqrt: s'ha rebut un argument no numèric"
+
+#: builtin.c:1215
+#, c-format
+msgid "sqrt: called with negative argument %g"
+msgstr "sqrt: cridat amb l'argument negatiu %g"
+
+#: builtin.c:1238
+#, c-format
+msgid "substr: start index %g is invalid, using 1"
+msgstr "substr: l'índex d'inici %g no és vàlid, usant 1"
+
+#: builtin.c:1243
+#, c-format
+msgid "substr: non-integer start index %g will be truncated"
+msgstr "substr: l'índex d'inici no enter %g serà truncat"
+
+#: builtin.c:1262
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 1"
+msgstr "substr: la longitud %g és <= 0"
+
+#: builtin.c:1264
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 0"
+msgstr "substr: la longitud %g és <= 0"
+
+#: builtin.c:1271
+#, c-format
+msgid "substr: non-integer length %g will be truncated"
+msgstr "substr: la longitud sobre un nombre no enter %g serà truncada"
+
+#: builtin.c:1276
+#, c-format
+msgid "substr: length %g too big for string indexing, truncating to %g"
+msgstr ""
+
+#: builtin.c:1288
+msgid "substr: source string is zero length"
+msgstr "substr: la cadena font és de longitud zero"
+
+#: builtin.c:1294
+#, fuzzy, c-format
+msgid "substr: start index %g is past end of string"
+msgstr "substr: l'índex d'inici %d sobrepassa l'acabament de la cadena"
+
+#: builtin.c:1302
+#, fuzzy, c-format
+msgid ""
+"substr: length %g at start index %g exceeds length of first argument (%lu)"
+msgstr ""
+"substr: la longitud %d a l'índex d'inici %d excedeix la longitud del 1er "
+"argument (%d)"
+
+#: builtin.c:1337
+#, fuzzy
+msgid "strftime: received non-string first argument"
+msgstr "strftime: el primer argument rebut no és una cadena"
+
+#: builtin.c:1343
+msgid "strftime: received empty format string"
+msgstr "strftime: s'ha rebut una cadena de format buida"
+
+#: builtin.c:1352
+#, fuzzy
+msgid "strftime: received non-numeric second argument"
+msgstr "strftime: el segon argument rebut no és numèric"
+
+#: builtin.c:1415
+msgid "mktime: received non-string argument"
+msgstr "mktime: s'ha rebut un argument que no és una cadena"
+
+#: builtin.c:1460
+#, fuzzy
+msgid "system: received non-string argument"
+msgstr "system: s'ha rebut un argument que no és una cadena"
+
+#: builtin.c:1581 eval.c:1883
+#, fuzzy, c-format
+msgid "reference to uninitialized field `$%d'"
+msgstr "referència a una variable sense inicialitzar «%s»"
+
+#: builtin.c:1608
+#, fuzzy
+msgid "tolower: received non-string argument"
+msgstr "tolower: s'ha rebut un argument que no és una cadena"
+
+#: builtin.c:1657
+#, fuzzy
+msgid "toupper: received non-string argument"
+msgstr "toupper: s'ha rebut un argument que no és una cadena"
+
+#: builtin.c:1702
+msgid "atan2: received non-numeric first argument"
+msgstr "atan2: el primer argument rebut no és numèric"
+
+#: builtin.c:1704
+msgid "atan2: received non-numeric second argument"
+msgstr "atan2: el segon argument rebut no és numèric"
+
+#: builtin.c:1723
+msgid "sin: received non-numeric argument"
+msgstr "sin: s'ha rebut un argument que no és numèric"
+
+#: builtin.c:1739
+msgid "cos: received non-numeric argument"
+msgstr "cos: s'ha rebut un argument que no és numèric"
+
+#: builtin.c:1788
+msgid "srand: received non-numeric argument"
+msgstr "srand: s'ha rebut un argument que no és numèric"
+
+#: builtin.c:1823
+msgid "match: third argument is not an array"
+msgstr "match: el tercer argument no és una matriu"
+
+#: builtin.c:2307
+msgid "gensub: third argument of 0 treated as 1"
+msgstr "gensub: el tercer argument de 0 és tractat com a 1"
+
+#: builtin.c:2416 builtin.c:2418
+msgid "lshift: received non-numeric first argument"
+msgstr "lshift: el primer argument rebut no és numèric"
+
+#: builtin.c:2420
+#, c-format
+msgid "lshift(%lf, %lf): negative values will give strange results"
+msgstr "lshift(%lf, %lf): els valors negatius donaran resultats estranys"
+
+#: builtin.c:2422
+#, c-format
+msgid "lshift(%lf, %lf): fractional values will be truncated"
+msgstr "lshift(%lf, %lf): els valors fraccionaris sernn truncats"
+
+#: builtin.c:2424
+#, c-format
+msgid "lshift(%lf, %lf): too large shift value will give strange results"
+msgstr ""
+"lshift(%lf, %lf): un valor de desplaçament massa gran donarà resultats "
+"estranys"
+
+#: builtin.c:2453 builtin.c:2455
+msgid "rshift: received non-numeric first argument"
+msgstr "rshift: el primer argument rebut no és numèric"
+
+#: builtin.c:2457
+#, c-format
+msgid "rshift(%lf, %lf): negative values will give strange results"
+msgstr "rshift(%lf, %lf): els valors negatius donaran resultats estranys"
+
+#: builtin.c:2459
+#, c-format
+msgid "rshift(%lf, %lf): fractional values will be truncated"
+msgstr "rshift(%lf, %lf): els valors fraccionaris seran truncats"
+
+#: builtin.c:2461
+#, c-format
+msgid "rshift(%lf, %lf): too large shift value will give strange results"
+msgstr ""
+"rshift(%lf, %lf): un valor de desplaçament massa gran donarà resultats "
+"estranys"
+
+#: builtin.c:2490 builtin.c:2492
+msgid "and: received non-numeric first argument"
+msgstr "and: el primer argument rebut no és numèric"
+
+#: builtin.c:2494
+#, c-format
+msgid "and(%lf, %lf): negative values will give strange results"
+msgstr "and(%lf, %lf): els valors negatius donaran resultats estranys"
+
+#: builtin.c:2496
+#, c-format
+msgid "and(%lf, %lf): fractional values will be truncated"
+msgstr "and(%lf, %lf): els valors fraccionaris seran truncats"
+
+#: builtin.c:2525 builtin.c:2527
+msgid "or: received non-numeric first argument"
+msgstr "or: el primer argument rebut no és numèric"
+
+#: builtin.c:2529
+#, c-format
+msgid "or(%lf, %lf): negative values will give strange results"
+msgstr "or(%lf, %lf): els valors negatius donaran resultats estranys"
+
+#: builtin.c:2531
+#, c-format
+msgid "or(%lf, %lf): fractional values will be truncated"
+msgstr "or(%lf, %lf): els valors fraccionaris seran truncats"
+
+#: builtin.c:2560 builtin.c:2562
+msgid "xor: received non-numeric first argument"
+msgstr "xor: el primer argument rebut no és numèric"
+
+#: builtin.c:2564
+#, c-format
+msgid "xor(%lf, %lf): negative values will give strange results"
+msgstr "xor(%lf, %lf): els valors negatius donaran resultats estranys"
+
+#: builtin.c:2566
+#, c-format
+msgid "xor(%lf, %lf): fractional values will be truncated"
+msgstr "xor(%lf, %lf): els valors fraccionaris seran truncats"
+
+#: builtin.c:2594
+msgid "compl: received non-numeric argument"
+msgstr "compl: s'ha rebut un argument que no és numèric"
+
+#: builtin.c:2596
+#, c-format
+msgid "compl(%lf): negative value will give strange results"
+msgstr "compl(%lf): el valor negatiu donarà resultats estranys"
+
+#: builtin.c:2598
+#, c-format
+msgid "compl(%lf): fractional value will be truncated"
+msgstr "compl(%lf): el valor fraccionari serà truncat"
+
+#: builtin.c:2771
+#, c-format
+msgid "dcgettext: `%s' is not a valid locale category"
+msgstr "dcgettext: «%s» no és una categoria local vàlida"
+
+#: eval.c:266
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "tipo de node %d desconegut"
+
+#: eval.c:312
+msgid "buffer overflow in genflags2str"
+msgstr "desbordament del cau temporal en genflags2str"
+
+#: eval.c:647
+#, fuzzy, c-format
+msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
+msgstr ""
+"bucle for: la matriu «%s» ha canviat de mida de %d a %d durant l'execució "
+"del bucle"
+
+#: eval.c:668
+msgid "`break' outside a loop is not portable"
+msgstr "«break» a fora d'un bucle no és portable"
+
+#: eval.c:672
+msgid "`break' outside a loop is not allowed"
+msgstr "no es permet «break» a fora d'un bucle"
+
+#: eval.c:689
+msgid "`continue' outside a loop is not portable"
+msgstr "«continue» fora d'un bucle no és portable"
+
+#: eval.c:693
+msgid "`continue' outside a loop is not allowed"
+msgstr "no es permet «continue» a fora d'un bucle"
+
+#: eval.c:727
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "«next» no es pot cridar des d'una regla BEGIN"
+
+#: eval.c:729
+msgid "`next' cannot be called from an END rule"
+msgstr "«next» no es pot cridar des d'una regla FINAL"
+
+#: eval.c:738
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "«nextfile» no es pot cridar des d'una regla BEGIN"
+
+#: eval.c:740
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "«nextfile» no es pot cridar des d'una regla FINAL"
+
+#: eval.c:785
+msgid "statement has no effect"
+msgstr "la sentència no té efecte"
+
+#: eval.c:828 eval.c:1726
+#, c-format
+msgid "can't use function name `%s' as variable or array"
+msgstr "no es pot usar el nom de la funció «%s» com a variable o matriu"
+
+#: eval.c:835 eval.c:841
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "referència a un argument sense inicialitzar «%s»"
+
+#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807
+#, c-format
+msgid "attempt to use array `%s' in a scalar context"
+msgstr "s'ha intentat usar la matriu «%s» en un context escalar"
+
+#: eval.c:858 eval.c:1752
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "referència a una variable sense inicialitzar «%s»"
+
+#: eval.c:1007
+msgid ""
+"concatenation: side effects in one expression have changed the length of "
+"another!"
+msgstr ""
+"concatenació: els efectes colaterals en una expressió han canviat la "
+"longitud d'una altra!"
+
+#: eval.c:1032
+msgid "assignment used in conditional context"
+msgstr "assignació usada en un context condicional"
+
+#: eval.c:1122
+msgid "division by zero attempted"
+msgstr "s'ha intentat una divisió per zero"
+
+#: eval.c:1137
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "s'ha intentat una divisió per zero en «%%»"
+
+#: eval.c:1152 profile.c:683
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "tipus il·legal (%s) en tree_eval"
+
+#: eval.c:1328
+msgid "division by zero attempted in `/='"
+msgstr "s'ha intentat una divisió per zero en «/=»"
+
+#: eval.c:1346
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "s'ha intentat una divisió per zero en «%%=»"
+
+#: eval.c:1586
+#, c-format
+msgid "function `%s' called with more arguments than declared"
+msgstr "s'ha cridat a la funció «%s» amb més arguments dels declarats"
+
+#: eval.c:1633
+#, c-format
+msgid "function `%s' not defined"
+msgstr "la funció «%s» no està definida"
+
+#: eval.c:1639
+#, c-format
+msgid "function %s called\n"
+msgstr "s'ha cridat a la funció %s\n"
+
+#: eval.c:1698
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# Pila de Crides a les Funcions:\n"
+"\n"
+
+#: eval.c:1701
+msgid "\t# -- main --\n"
+msgstr "\t# -- principal --\n"
+
+#: eval.c:1867
+msgid "attempt to field reference from non-numeric value"
+msgstr "s'ha intentat una referència de camp a partir d'un valor no numèric"
+
+#: eval.c:1869
+msgid "attempt to reference from null string"
+msgstr "s'ha intentat una referència a partir d'una cadena nul·la"
+
+#: eval.c:1875
+#, c-format
+msgid "attempt to access field %d"
+msgstr "s'ha intentat accedir al camp %d"
+
+#: eval.c:1896 eval.c:1903 profile.c:900
+msgid "assignment is not allowed to result of builtin function"
+msgstr ""
+"no es permet l'assignació per a obtindre un resultat d'una funció interna"
+
+#: eval.c:1951
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "«IGNORECASE» és una extensió de gawk"
+
+#: eval.c:1980
+msgid "`BINMODE' is a gawk extension"
+msgstr "«BINMODE» és una extensió de gawk"
+
+#: eval.c:2092
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "«%sFMT» especificació errònia «%s»"
+
+#: eval.c:2170
+msgid "turning off `--lint' due to assignment to `LINT'"
+msgstr "desactivant «--lint» degut a una assignació a «LINT»"
+
+#: ext.c:60 ext.c:64
+msgid "`extension' is a gawk extension"
+msgstr "«extension» és una extensió gawk"
+
+#: ext.c:74
+#, c-format
+msgid "extension: cannot open `%s' (%s)\n"
+msgstr "extension: no es pot obrir «%s» (%s)\n"
+
+#: ext.c:82
+#, c-format
+msgid "extension: library `%s': cannot call function `%s' (%s)\n"
+msgstr "extension: biblioteca «%s»: no es pot cridar a la funció «%s» (%s)\n"
+
+#: ext.c:183
+msgid "Operation Not Supported"
+msgstr "Operació No Suportada"
+
+#: field.c:315
+msgid "NF set to negative value"
+msgstr "NF s'inicialitza sobre un valor negatiu"
+
+#: field.c:808
+msgid "split: second argument is not an array"
+msgstr "split: el segon argument no és una matriu"
+
+#: field.c:842
+msgid "split: null string for third arg is a gawk extension"
+msgstr "split: la cadena nul·la per al tercer argument és una extensió de gawk"
+
+#: field.c:894
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "«FIELDWIDTHS» és una extensió de gawk"
+
+#: field.c:921
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "el camp %d en FIELDWIDTHS, hauria de ser > 0"
+
+#: field.c:994
+msgid "null string for `FS' is a gawk extension"
+msgstr "la cadena nul·la per a «FS» és una extensió de gawk"
+
+#: getopt.c:692 getopt.c:704
+#, c-format
+msgid "%s: option `%s' is ambiguous\n"
+msgstr "%s: l'opció «%s» és ambigua\n"
+
+#: getopt.c:737 getopt.c:741
+#, c-format
+msgid "%s: option `--%s' doesn't allow an argument\n"
+msgstr "%s: l'opció «--%s» no admet cap argument\n"
+
+#: getopt.c:750 getopt.c:755
+#, c-format
+msgid "%s: option `%c%s' doesn't allow an argument\n"
+msgstr "%s: l'opció «%c%s» no admet cap 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'opció «%s» requereix un argument\n"
+
+#: getopt.c:842 getopt.c:845
+#, c-format
+msgid "%s: unrecognized option `--%s'\n"
+msgstr "%s: no es reconeix l'opció «--%s»\n"
+
+#: getopt.c:853 getopt.c:856
+#, c-format
+msgid "%s: unrecognized option `%c%s'\n"
+msgstr "%s: no es reconeix l'opció «%c%s»\n"
+
+#: getopt.c:903 getopt.c:906
+#, c-format
+msgid "%s: illegal option -- %c\n"
+msgstr "%s: opció il·legal -- %c\n"
+
+#: getopt.c:912 getopt.c:915
+#, c-format
+msgid "%s: invalid option -- %c\n"
+msgstr "%s: opció no vàlida -- %c\n"
+
+#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434
+#, c-format
+msgid "%s: option requires an argument -- %c\n"
+msgstr "%s: l'opció requereix un argument -- %c\n"
+
+#: getopt.c:1025 getopt.c:1036
+#, c-format
+msgid "%s: option `-W %s' is ambiguous\n"
+msgstr "%s: l'opció «-W %s» és ambigua\n"
+
+#: getopt.c:1060 getopt.c:1072
+#, c-format
+msgid "%s: option `-W %s' doesn't allow an argument\n"
+msgstr "%s: l'opció «-W %s» no admet cap argument\n"
+
+#: io.c:305
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "no es pot obrir el fitxer «%s» per a lectura (%s)"
+
+#: io.c:392
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "la finalització del descriptor fd %d («%s») ha fallat (%s)"
+
+#: io.c:530
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "tipus d'arbre %s no vàlid dintre de redirect()"
+
+#: io.c:536
+#, c-format
+msgid "expression in `%s' redirection only has numeric value"
+msgstr "l'expressió en la redirecció «%s» solt té un valor numèric"
+
+#: io.c:542
+#, c-format
+msgid "expression for `%s' redirection has null string value"
+msgstr "l'expressió per a la redirecció «%s» té un valor de cadena nul·la"
+
+#: io.c:547
+#, c-format
+msgid "filename `%s' for `%s' redirection may be result of logical expression"
+msgstr ""
+"el fitxer «%s» per a la redirecció «%s» pot ser resultat d'una expressió "
+"lògica"
+
+#: io.c:569
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "mescla innecessària de «>» i «>>» per al fitxer «%.*s»"
+
+#: io.c:621
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "no es pot obrir la canonada «%s» per a l'eixida (%s)"
+
+#: io.c:630
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "no es pot obrir la canonada «%s» per a l'entrada (%s)"
+
+#: io.c:643
+#, c-format
+msgid "can't open two way socket `%s' for input/output (%s)"
+msgstr ""
+"no es pot obrir un socket bidireccional «%s» per a les entrades/eixides (%s)"
+
+#: io.c:647
+#, c-format
+msgid "can't open two way pipe `%s' for input/output (%s)"
+msgstr ""
+"no es pot obrir una canonada bidireccional «%s» per a les entrades/eixides (%"
+"s)"
+
+#: io.c:723
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "no es pot redirigir des de «%s» (%s)"
+
+#: io.c:726
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "no es pot redirigir cap a «%s» (%s)"
+
+#: io.c:765
+msgid ""
+"reached system limit for open files: starting to multiplex file descriptors"
+msgstr ""
+"s'ha arribat al límit del sistema per a fitxers oberts: es començarà a "
+"multiplexar els descriptors de fitxer"
+
+#: io.c:777
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "la finalització de «%s» ha fallat (%s)"
+
+#: io.c:784
+msgid "too many pipes or input files open"
+msgstr "masses canonades o fitxers d'entrada oberts"
+
+#: io.c:807
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: el segon argument hauria de ser «to» o «from»"
+
+#: io.c:821
+#, c-format
+msgid "close: `%.*s' is not an open file, pipe or co-process"
+msgstr "close: «%.*s» no és un fitxer obert, canonada o co-procés"
+
+#: io.c:825
+msgid "close of redirection that was never opened"
+msgstr "finalització d'una redirecció que no s'ha obert"
+
+#: io.c:862
+#, c-format
+msgid "close: redirection `%s' not opened with `|&', second argument ignored"
+msgstr ""
+"close: la redirecció «%s» no s'obre amb «|&», s'ignora el segon argument"
+
+#: io.c:924
+#, c-format
+msgid "failure status (%d) on pipe close of `%s' (%s)"
+msgstr "estaus de falla (%d) en la finalització de la canonada «%s» (%s)"
+
+#: io.c:927
+#, c-format
+msgid "failure status (%d) on file close of `%s' (%s)"
+msgstr "estatus de falla (%d) en la finalització del fitxer «%s» (%s)"
+
+#: io.c:946
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "no s'aporta la finalització explícita del socket «%s»"
+
+#: io.c:949
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "no s'aporta la finalització explícita del co-procés «%s»"
+
+#: io.c:952
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "no s'aporta la finalització explícita de la canonada «%s»"
+
+#: io.c:955
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "no s'aporta la finalització explícita del fitxer «%s»"
+
+#: io.c:984 io.c:1038
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "error a l'escriure en l'eixida estàndard (%s)"
+
+#: io.c:988 io.c:1042
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "error a l'escriure en l'eixida d'error estàndard (%s)"
+
+#: io.c:996
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "la neteja de la canonada de «%sx» ha fallat (%s)."
+
+#: io.c:999
+#, c-format
+msgid "co-process flush of pipe to `%s' failed (%s)."
+msgstr "la neteja de la canonada per al co-procés de «%sx» ha fallat (%s)."
+
+#: io.c:1002
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "la neteja del fitxer «%sx» ha fallat (%s)."
+
+#: io.c:1161
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "el client /inet/raw encara no està a punt, ho sento"
+
+#: io.c:1163 io.c:1200
+msgid "only root may use `/inet/raw'."
+msgstr "sols el root pot usar «/inet/raw»."
+
+#: io.c:1198
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "el servidor /inet/raw encara no està a punt, ho sento"
+
+#: io.c:1288
+#, c-format
+msgid "no (known) protocol supplied in special filename `%s'"
+msgstr "no s'aporta cap protocol (conegut) en el nom del fitxer especial «%s»"
+
+#: io.c:1306
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "el nom del fitxer especial «%s» està incomplet"
+
+#: io.c:1318
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "port local no vàlid en «%s»"
+
+#: io.c:1330
+msgid "must supply a remote hostname to `/inet'"
+msgstr "s'ha de subministrar un nom de sistema remot a «/inet»"
+
+#: io.c:1345
+msgid "must supply a remote port to `/inet'"
+msgstr "s'ha de subministrar un port remot a «/inet»"
+
+#: io.c:1351
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "port remot no vàlid en «%s»"
+
+#: io.c:1361
+msgid "TCP/IP communications are not supported"
+msgstr "les comunicacions TCP/IP no estan suportades"
+
+#: io.c:1370 io.c:1551
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "el fitxer «%s» és un directori"
+
+#: io.c:1440
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "useu «PROCINFO[\"%s\"]» en comptes de «%s»"
+
+#: io.c:1472
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "useu «PROCINFO[...]» en comptes de «/dev/user»"
+
+#: io.c:1537 io.c:1711
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "no es pot obrir «%s», mode «%s»"
+
+#: io.c:1762
+#, fuzzy, c-format
+msgid "close of master pty failed (%s)"
+msgstr "ha fallat la finalització de la canonada (%s)"
+
+#: io.c:1764 io.c:1916 io.c:2068
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr ""
+"ha fallat la finalització de l'eixida estàndard en els processos fills (%s)"
+
+#: io.c:1767
+#, fuzzy, c-format
+msgid "moving slave pty to stdout in child failed (dup: %s)"
+msgstr ""
+"ha fallat la redirecció cap a l'eixida estàndard dels processos fills (dup: %"
+"s)"
+
+#: io.c:1769 io.c:1921
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr ""
+"ha fallat la finalització de l'entrada estàndard en els processos fills (%s)"
+
+#: io.c:1772
+#, fuzzy, c-format
+msgid "moving slave pty to stdin in child failed (dup: %s)"
+msgstr ""
+"ha fallat la redirecció cap a l'entrada estàndard dels processos fills (dup: "
+"%s)"
+
+#: io.c:1774 io.c:1793
+#, fuzzy, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "ha fallat la finalització de la canonada (%s)"
+
+#: io.c:1867 io.c:1919 io.c:2049 io.c:2071
+#, c-format
+msgid "moving pipe to stdout in child failed (dup: %s)"
+msgstr ""
+"ha fallat la redirecció cap a l'eixida estàndard dels processos fills (dup: %"
+"s)"
+
+#: io.c:1871 io.c:1924
+#, c-format
+msgid "moving pipe to stdin in child failed (dup: %s)"
+msgstr ""
+"ha fallat la redirecció cap a l'entrada estàndard dels processos fills (dup: "
+"%s)"
+
+#: io.c:1888 io.c:2062
+msgid "restoring stdout in parent process failed\n"
+msgstr "ha fallat la restauració de l'eixida estàndard en el procés pare\n"
+
+#: io.c:1893
+msgid "restoring stdin in parent process failed\n"
+msgstr "ha fallat la restauració de l'entrada estàndard en el procés pare\n"
+
+#: io.c:1927 io.c:2073 io.c:2084
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "ha fallat la finalització de la canonada (%s)"
+
+#: io.c:1972
+msgid "`|&' not supported"
+msgstr "«|&» no està suportat"
+
+#: io.c:2039
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "no es pot obrir la canonada «%s» (%s)"
+
+#: io.c:2080
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr "no es pot crear el procés fill per a «%s» (fork: %s)"
+
+#: io.c:2423
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "el fitxer de dades «%s» està buit"
+
+#: io.c:2466 io.c:2474
+msgid "could not allocate more input memory"
+msgstr ""
+
+#: io.c:2832 io.c:2895
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "error en llegir el fitxer d'entrada «%s»: %s"
+
+#: io.c:3020
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "el valor multicaràcter de «RS» és una extensió de gawk"
+
+#: main.c:324
+msgid "`-m[fr]' option irrelevant in gawk"
+msgstr "l'opción «-m[fr]» és irrellevant en gawk"
+
+#: main.c:326
+msgid "-m option usage: `-m[fr] nnn'"
+msgstr "ús de l'opció -m: «-m[fr] nnn»"
+
+#: main.c:343
+#, c-format
+msgid "%s: option `-W %s' unrecognized, ignored\n"
+msgstr "%s: no es reconeix l'opció «-W %s», serà ignorada\n"
+
+#: main.c:380
+msgid "empty argument to `--source' ignored"
+msgstr "s'igonarà l'argument buit per a l'opció «--source»"
+
+#: main.c:451
+msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
+msgstr ""
+"la variable d'entorn «POSIXLY_CORRECT» està establerta: usant «--posix»"
+
+#: main.c:456
+msgid "`--posix' overrides `--traditional'"
+msgstr "«--posix» solapa a «--traditional»"
+
+#: main.c:467
+msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
+msgstr "«--posix» i «--traditional» solapen a «--non-decimal-data»"
+
+#: main.c:471
+#, fuzzy, c-format
+msgid "running %s setuid root may be a security problem"
+msgstr "executar %s com a setuid root pot ser un problema de seguretat"
+
+#: main.c:512
+#, fuzzy, c-format
+msgid "can't set binary mode on stdin (%s)"
+msgstr "no es pot establir el mode en l'entrada estàndard (%s)"
+
+#: main.c:515
+#, fuzzy, c-format
+msgid "can't set binary mode on stdout (%s)"
+msgstr "no es pot establir el mode en l'eixida estàndard (%s)"
+
+#: main.c:517
+#, fuzzy, c-format
+msgid "can't set binary mode on stderr (%s)"
+msgstr "no es pot establir el mode en l'eixida d'error estàndard (%s)"
+
+#: main.c:547
+msgid "no program text at all!"
+msgstr "no hi ha cap text per al programa!"
+
+#: main.c:620
+#, c-format
+msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
+msgstr "Ús: %s [opcions d'estil POSIX o GNU] -f fitx_prog [--] fitxer ...\n"
+
+#: main.c:622
+#, c-format
+msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
+msgstr "Ús: %s [opcions d'estil POSIX o GNU] [--] %cprograma%c fitxer ...\n"
+
+#: main.c:627
+msgid "POSIX options:\t\tGNU long options:\n"
+msgstr "Opcions POSIX:\t\tOpcions llargues GNU:\n"
+
+#: main.c:628
+msgid "\t-f progfile\t\t--file=progfile\n"
+msgstr "\t-f fitx_prog\t\t--file=fitx_prog\n"
+
+#: main.c:629
+msgid "\t-F fs\t\t\t--field-separator=fs\n"
+msgstr "\t-F fs\t\t\t--field-separator=fs (fs=sep_camp)\n"
+
+#: main.c:630
+msgid "\t-v var=val\t\t--assign=var=val\n"
+msgstr "\t-v var=valor\t\t--assign=var=valor\n"
+
+#: main.c:631
+msgid "\t-m[fr] val\n"
+msgstr "\t-m[fr] valor\n"
+
+#: main.c:632
+msgid "\t-W compat\t\t--compat\n"
+msgstr "\t-W compat\t\t--compat\n"
+
+#: main.c:633
+msgid "\t-W copyleft\t\t--copyleft\n"
+msgstr "\t-W copyleft\t\t--copyleft\n"
+
+#: main.c:634
+msgid "\t-W copyright\t\t--copyright\n"
+msgstr "\t-W copyright\t\t--copyright\n"
+
+#: main.c:635
+msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
+msgstr "\t-W dump-variables[=fitxer] --dump-variables[=fitxer]\n"
+
+#: main.c:636
+msgid "\t-W gen-po\t\t--gen-po\n"
+msgstr "\t-W gen-po\t\t--gen-po\n"
+
+#: main.c:637
+msgid "\t-W help\t\t\t--help\n"
+msgstr "\t-W help\t\t\t--help\n"
+
+#: main.c:638
+msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+
+#: main.c:639
+msgid "\t-W lint-old\t\t--lint-old\n"
+msgstr "\t-W lint-old\t\t--lint-old\n"
+
+#: main.c:640
+msgid "\t-W non-decimal-data\t--non-decimal-data\n"
+msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
+
+#: main.c:642
+msgid "\t-W nostalgia\t\t--nostalgia\n"
+msgstr "\t-W nostalgia\t\t--nostalgia\n"
+
+#: main.c:645
+msgid "\t-W parsedebug\t\t--parsedebug\n"
+msgstr "\t-W parsedebug\t\t--parsedebug\n"
+
+#: main.c:647
+msgid "\t-W profile[=file]\t--profile[=file]\n"
+msgstr "\t-W profile[=fitxer]\t--profile[=fitxer]\n"
+
+#: main.c:648
+msgid "\t-W posix\t\t--posix\n"
+msgstr "\t-W posix\t\t--posix\n"
+
+#: main.c:649
+msgid "\t-W re-interval\t\t--re-interval\n"
+msgstr "\t-W re-interval\t\t--re-interval\n"
+
+#: main.c:650
+msgid "\t-W source=program-text\t--source=program-text\n"
+msgstr "\t-W source=text_prog\t--source=text_prog\n"
+
+#: main.c:651
+msgid "\t-W traditional\t\t--traditional\n"
+msgstr "\t-W traditional\t\t--traditional\n"
+
+#: main.c:652
+msgid "\t-W usage\t\t--usage\n"
+msgstr "\t-W usage\t\t--usage\n"
+
+#: main.c:653
+msgid "\t-W version\t\t--version\n"
+msgstr "\t-W version\t\t--version\n"
+
+#: main.c:657
+#, 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 "a la secció «Reporting Problems and Bugs» de la versió impresa.\n"
+
+#: main.c:661
+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:665
+msgid ""
+"Examples:\n"
+"\tgawk '{ sum += $1 }; END { print sum }' file\n"
+"\tgawk -F: '{ print $1 }' /etc/passwd\n"
+msgstr ""
+
+#: main.c:682
+#, 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"
+"Aquest programa és programari lliure; pot redistribuir-se i/o modificar-se\n"
+"sota els termes de la Llicència Pública General de GNU tal i como està\n"
+"publicada per la Free Software Foundation; ja siga en la versió 2 de la\n"
+"Llicència, o (a la vostra elecció) qualsevol versió posterior.\n"
+"\n"
+
+#: main.c:690
+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 ""
+"Aquest programa es distribueix amb l'esperança de que serà d'utilitat,\n"
+"però SENSE CAP GARANTIA; fins i tot sense la garantia implícita de\n"
+"COMERCIABILITAT o IDONEÏTAT PER A UN PROPÒSIT EN PARTICULAR.\n"
+"Per a més detalls consulteu la Llicència Pública General de GNU.\n"
+"\n"
+
+#: main.c:696
+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 ""
+"Junt amb aquest programa hauríeu d'haber rebut una còpia de la Llicència\n"
+"Pública General de GNU; si no és així, escriviu a la Free Software\n"
+"Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"
+
+#: main.c:730
+msgid "-Ft does not set FS to tab in POSIX awk"
+msgstr "-Ft no permet inicialitzar FS a un tabulador en la versió POSIX de awk"
+
+#: main.c:956
+#, c-format
+msgid ""
+"%s: `%s' argument to `-v' not in `var=value' form\n"
+"\n"
+msgstr ""
+
+#: main.c:976
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr ""
+
+#: main.c:979
+#, c-format
+msgid "`%s' is not a variable name, looking for file `%s=%s'"
+msgstr ""
+
+#: main.c:1012
+msgid "floating point exception"
+msgstr "excepció de coma flotant"
+
+#: main.c:1019
+msgid "fatal error: internal error"
+msgstr "error fatal: error intern"
+
+#: main.c:1069
+#, c-format
+msgid "no pre-opened fd %d"
+msgstr "no s'ha pre-obert el descriptor fd per a %d"
+
+#: main.c:1074
+#, c-format
+msgid "could not pre-open /dev/null for fd %d"
+msgstr "no es pot pre-obrir /dev/null per al descriptor fd %d"
+
+#: main.c:1097 main.c:1106
+#, c-format
+msgid "could not find groups: %s"
+msgstr "no es poden trobar els grups: %s"
+
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "línia cmd.:"
+
+#: msg.c:120
+msgid "warning: "
+msgstr "ADVERTIMENT: "
+
+#: msg.c:142
+msgid "error: "
+msgstr "Error: "
+
+#: msg.c:178
+msgid "fatal: "
+msgstr "Fatal: "
+
+#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115
+msgid "can't convert string to float"
+msgstr "no es pot convertir la cadena a coma flotant"
+
+#: node.c:355
+msgid "backslash at end of string"
+msgstr "barra invertida al final de la cadena"
+
+#: node.c:539
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX no permet seqüències d'escapada «\\x»"
+
+#: node.c:545
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "no hi ha dígits hexadecimals en la seqüència d'escapada «\\x»"
+
+#: node.c:579
+#, c-format
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr "la seqüència d'escapada «\\%c» és tractada com a una simple «%c»"
+
+#: posix/gawkmisc.c:172
+#, c-format
+msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
+msgstr "%s %s «%s»: no es pot inicialitzar close-on-exec: (fcntl: %s)"
+
+#: profile.c:91
+#, c-format
+msgid "could not open `%s' for writing: %s"
+msgstr "no es pot obrir «%s» per a escriptura: %s"
+
+#: profile.c:449
+#, fuzzy, c-format
+msgid "internal error: %s with null vname"
+msgstr "error intern: Node_var amb vname nul"
+
+#: profile.c:512
+msgid "# treated internally as `delete'"
+msgstr ""
+
+#: profile.c:1162
+#, c-format
+msgid "\t# gawk profile, created %s\n"
+msgstr "\t# perfil gawk, creat %s\n"
+
+#: profile.c:1165
+msgid ""
+"\t# BEGIN block(s)\n"
+"\n"
+msgstr ""
+"\t# Bloc(s) INICI\n"
+"\n"
+
+#: profile.c:1175
+msgid ""
+"\t# Rule(s)\n"
+"\n"
+msgstr ""
+"\t# Regla(es)\n"
+"\n"
+
+#: profile.c:1181
+msgid ""
+"\t# END block(s)\n"
+"\n"
+msgstr ""
+"\t# Bloc(s) FINAL\n"
+"\n"
+
+#: profile.c:1201
+msgid ""
+"\n"
+"\t# Functions, listed alphabetically\n"
+msgstr ""
+"\n"
+"\t# Funcions, llistades alfabèticament\n"
+
+#: profile.c:1413
+#, c-format
+msgid "unexpected type %s in prec_level"
+msgstr "tipus %s inesperat en prec_level"
+
+#: re.c:193
+#, c-format
+msgid "regex match failed, not enough memory to match string \"%.*s%s\""
+msgstr ""
+
+#: regcomp.c:136
+msgid "Success"
+msgstr "Èxit"
+
+#: regcomp.c:139
+msgid "No match"
+msgstr "No hi ha concordança"
+
+#: regcomp.c:142
+msgid "Invalid regular expression"
+msgstr "Expressió regular no vàlida"
+
+#: regcomp.c:145
+msgid "Invalid collation character"
+msgstr "Caràcter de comparació no vàlid"
+
+#: regcomp.c:148
+msgid "Invalid character class name"
+msgstr "Nom de classe de caràcters no vàlid"
+
+#: regcomp.c:151
+msgid "Trailing backslash"
+msgstr "Barra invertida extra al final"
+
+#: regcomp.c:154
+msgid "Invalid back reference"
+msgstr "Referència cap enradera no vàlida"
+
+#: regcomp.c:157
+msgid "Unmatched [ or [^"
+msgstr "[ o [^ desemparellats"
+
+#: regcomp.c:160
+msgid "Unmatched ( or \\("
+msgstr "( o \\( desemparellats"
+
+#: regcomp.c:163
+msgid "Unmatched \\{"
+msgstr "\\{ desemparellat"
+
+#: regcomp.c:166
+msgid "Invalid content of \\{\\}"
+msgstr "Contingut no vàlid de \\{\\}"
+
+#: regcomp.c:169
+msgid "Invalid range end"
+msgstr "Final de rang no vàlid"
+
+#: regcomp.c:172
+msgid "Memory exhausted"
+msgstr "Memòria exhaurida"
+
+#: regcomp.c:175
+msgid "Invalid preceding regular expression"
+msgstr "Expressió regular precedent no vàlida"
+
+#: regcomp.c:178
+msgid "Premature end of regular expression"
+msgstr "Fí prematura de l'expressió regular"
+
+#: regcomp.c:181
+msgid "Regular expression too big"
+msgstr "L'expressió regular és massa gran"
+
+#: regcomp.c:184
+msgid "Unmatched ) or \\)"
+msgstr ") o \\) desemparellats"
+
+#: regcomp.c:621
+msgid "No previous regular expression"
+msgstr "No hi ha una expressió regular prèvia"
+
+#, fuzzy
+#~ msgid "substr: length %g is < 0"
+#~ msgstr "substr: la longitud %g és <= 0"
+
+#~ msgid "delete: illegal use of variable `%s' as array"
+#~ msgstr "delete: ús il·legal de la variable «%s» com a una matriu"
+
+#, fuzzy
+#~ msgid "%s: gvar_ref to %s\n"
+#~ msgstr "%s: ref_matriu a %s\n"
+
+#~ msgid "asort: first argument is not an array"
+#~ msgstr "asort: el primer argument no és una matriu"
+
+#~ msgid "asort: second argument is not an array"
+#~ msgstr "asort: el segon argument no és una matriu"
+
+#, fuzzy
+#~ msgid ""
+#~ "attempt to use array parameter `%s' that was passed from global scalar `%"
+#~ "s'"
+#~ msgstr "s'ha intentat usar un paràmetre escalar «%s» com a una matriu"
+
+#~ msgid "internal error: Node_var_array with null vname"
+#~ msgstr "error intern: Node_var_array amb vname nul"
+
+#~ msgid ""
+#~ "\n"
+#~ "To report bugs, see node `Bugs' in `gawk.info', which is\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Per a informar d'errors, consulteu el node «Bugs» en «gawk.info», que "
+#~ "està\n"
+
+#~ msgid "invalid syntax in name `%s' for variable assignment"
+#~ msgstr "sintaxi no vàlida en el nom «%s» per a l'asignació de la variable"
+
+#~ msgid "or used in other expression context"
+#~ msgstr "o s'ha emprat en un altre context de l'expressió"
+
+#~ msgid "attempt to use function `%s' as array"
+#~ msgstr "s'ha intentat usar la funció «%s» com a una matriu"
+
+#~ msgid "`%s' is a function, assignment is not allowed"
+#~ msgstr "«%s» és una funció, l'assignació no és permesa"
+
+#~ msgid "BEGIN blocks must have an action part"
+#~ msgstr "Els blocs INICI han de tindre una part d'acció"
+
+#~ msgid "`nextfile' used in BEGIN or END action"
+#~ msgstr "«nextfile» és usat dintre de l'acció BEGIN o END"
+
+#~ msgid "non-redirected `getline' undefined inside BEGIN or END action"
+#~ msgstr "«getline» no redirigit sense definir dintre de l'acció BEGIN o END"
+
+#~ msgid "fptr %x not in tokentab\n"
+#~ msgstr "fptr %x no està en la taula de referència\n"
+
+#~ msgid "gsub third parameter is not a changeable object"
+#~ msgstr "gsub: el tercer argument no és un objecte intercanviable"
+
+#~ msgid "Unfinished \\ escape"
+#~ msgstr "seqüència d'escapada \\ sense finalitzar"
+
+#~ msgid "unfinished repeat count"
+#~ msgstr "repetició del comptador sense finalitzar"
+
+#~ msgid "malformed repeat count"
+#~ msgstr "repetició del comptador malformada"
+
+#~ msgid "Unbalanced ["
+#~ msgstr "[ sense aparellar"
+
+#~ msgid "Unbalanced ("
+#~ msgstr "( sense aparellar"
+
+#~ msgid "No regexp syntax bits specified"
+#~ msgstr "No s'especifiquen els bits de sintaxi de l'expressió regular"
+
+#~ msgid "Unbalanced )"
+#~ msgstr ") sense aparellar"
+
+#~ msgid "out of memory"
+#~ msgstr "memòria esgotada"
+
+#~ msgid "internal error: file `%s', line %d\n"
+#~ msgstr "error intern: fitxer «%s», línia %d\n"
diff --git a/gnu/dist/gawk/po/da.gmo b/gnu/dist/gawk/po/da.gmo
new file mode 100644
index 00000000000..76ba08150ab
--- /dev/null
+++ b/gnu/dist/gawk/po/da.gmo
Binary files differ
diff --git a/gnu/dist/gawk/po/da.po b/gnu/dist/gawk/po/da.po
new file mode 100644
index 00000000000..f2913c9f908
--- /dev/null
+++ b/gnu/dist/gawk/po/da.po
@@ -0,0 +1,1842 @@
+# Danish translation of gawk
+# Copyright (C) 2001 Free Software Foundation, Inc.
+# Keld Simonsen <keld@dkuug.dk>, 2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gawk 3.1.31\n"
+"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
+"POT-Creation-Date: 2003-07-07 11:20-0700\n"
+"PO-Revision-Date: 2002-11-09 10:09+0100\n"
+"Last-Translator: Keld Simonsen <keld@dkuug.dk>\n"
+"Language-Team: Danish <dansk@klid.dk>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: array.c:112
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr "forsøg på at bruge skalarparameteren \"%s\" som en vektor"
+
+#: array.c:113
+#, c-format
+msgid "attempt to use scalar `%s' as array"
+msgstr "forsøg på at bruge skalaren \"%s\" som vektor"
+
+#: array.c:151
+#, fuzzy, c-format
+msgid "from %s"
+msgstr "%s (fra %s)"
+
+#: array.c:506
+#, c-format
+msgid "reference to uninitialized element `%s[\"%s\"]'"
+msgstr "reference til ikke-initieret element \"%s[\"%s\"]\""
+
+#: array.c:512
+#, c-format
+msgid "subscript of array `%s' is null string"
+msgstr "indeks i vektoren \"%s\" er en tom streng"
+
+#: array.c:609
+#, c-format
+msgid "delete: index `%s' not in array `%s'"
+msgstr "delete: indeks \"%s\" findes ikke i vektoren \"%s\""
+
+#: array.c:769
+#, c-format
+msgid "%s: empty (null)\n"
+msgstr "%s: tom (nil)\n"
+
+#: array.c:774
+#, c-format
+msgid "%s: empty (zero)\n"
+msgstr "%s: tom (nul)\n"
+
+#: array.c:778
+#, c-format
+msgid "%s: table_size = %d, array_size = %d\n"
+msgstr "%s: tabelstørrelse = %d, vektorstørrelse = %d\n"
+
+#: array.c:807
+#, fuzzy, c-format
+msgid "%s: is parameter\n"
+msgstr "%s: er en parameter\n"
+
+#: array.c:812
+#, c-format
+msgid "%s: array_ref to %s\n"
+msgstr "%s: vektorreference til %s\n"
+
+#: awkgram.y:208
+#, fuzzy, c-format
+msgid "%s blocks must have an action part"
+msgstr "END-blok skal have en handlingsdel"
+
+#: awkgram.y:211
+#, fuzzy
+msgid "each rule must have a pattern or an action part"
+msgstr "END-blok skal have en handlingsdel"
+
+#: awkgram.y:267
+#, c-format
+msgid "`%s' is a built-in function, it cannot be redefined"
+msgstr "\"%s\" er en indbygget funktion, den kan ikke omdefineres"
+
+#: awkgram.y:314
+#, c-format
+msgid "regexp constant `/%s/' looks like a C comment, but is not"
+msgstr "regexp-konstanten \"/%s/\" ser ud som en C-kommentar, men er det ikke"
+
+#: awkgram.y:340 awkgram.y:615
+msgid "statement may have no effect"
+msgstr "kommandoen har måske ikke nogen effekt"
+
+#: awkgram.y:435 awkgram.y:455
+#, fuzzy, c-format
+msgid "`%s' used in %s action"
+msgstr "\"next\" brugt i BEGIN- eller END-handling"
+
+#: awkgram.y:448 awkgram.y:451
+msgid "`nextfile' is a gawk extension"
+msgstr "\"nextfile\" er en gawk-udvidelse"
+
+#: awkgram.y:465
+msgid "`return' used outside function context"
+msgstr "\"return\" brugt uden for funktion"
+
+#: awkgram.y:504
+msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
+msgstr ""
+"alenestående \"print\" i BEGIN eller END-regel bør muligvis være 'print \"\"'"
+
+#: awkgram.y:517 awkgram.y:524
+msgid "`delete array' is a gawk extension"
+msgstr "\"delete array\" er en gawk-udvidelse"
+
+#: awkgram.y:532 awkgram.y:539
+#, fuzzy
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "\"delete array\" er en gawk-udvidelse"
+
+#: awkgram.y:583
+#, c-format
+msgid "duplicate case values in switch body: %s"
+msgstr ""
+
+#: awkgram.y:593
+msgid "Duplicate `default' detected in switch body"
+msgstr ""
+
+#: awkgram.y:681
+msgid "multistage two-way pipelines don't work"
+msgstr "flertrins dobbeltrettede datakanaler fungerer ikke"
+
+#: awkgram.y:772
+msgid "regular expression on right of assignment"
+msgstr "regulært udtryk i højreleddet af en tildeling"
+
+#: awkgram.y:782
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "regulært udtryk på venstre side af en \"~\"- eller \"!~\"-operator"
+
+#: awkgram.y:790
+msgid "regular expression on right of comparison"
+msgstr "regulært udtryk i højreleddet af en sammenligning"
+
+#: awkgram.y:857
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "ikke-omdirigeret \"getline\" udefineret inde i END-handling"
+
+#: awkgram.y:884
+msgid "call of `length' without parentheses is not portable"
+msgstr "kald af \"length\" uden parenteser er ikke portabelt"
+
+#: awkgram.y:887
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "kald af \"length\" uden parenteser er forældet ifølge POSIX"
+
+#: awkgram.y:940
+msgid "use of non-array as array"
+msgstr ""
+
+#: awkgram.y:942
+msgid "invalid subscript expression"
+msgstr "ugyldig indeksudtryk"
+
+#: awkgram.y:1140
+#, fuzzy
+msgid "unexpected newline or end of string"
+msgstr "uventet nylinjetegn"
+
+#: awkgram.y:1235
+msgid "empty program text on command line"
+msgstr "tom programtekst på kommandolinjen"
+
+#: awkgram.y:1292
+#, c-format
+msgid "can't open source file `%s' for reading (%s)"
+msgstr "kan ikke åbne kildefilen \"%s\" for læsning (%s)"
+
+#: awkgram.y:1327
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "kan ikke læse kildefilen \"%s\" (%s)"
+
+#: awkgram.y:1335
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "kildefilen \"%s\" er tom"
+
+#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100
+msgid "source file does not end in newline"
+msgstr "kildefilen slutter ikke med en ny linje"
+
+#: awkgram.y:1601
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr "uafsluttet regulært udtryk slutter med \"\\\" i slutningen af filen"
+
+#: awkgram.y:1621
+msgid "unterminated regexp"
+msgstr "uafsluttet regulært udtryk"
+
+#: awkgram.y:1624
+msgid "unterminated regexp at end of file"
+msgstr "uafsluttet regulært udtryk i slutningen af filen"
+
+#: awkgram.y:1691
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr "Brug af \"\\ #...\" for linjefortsættelse er ikke portabelt"
+
+#: awkgram.y:1703
+msgid "backslash not last character on line"
+msgstr "sidste tegn på linjen er ikke en omvendt skråstreg"
+
+#: awkgram.y:1748
+msgid "POSIX does not allow operator `**='"
+msgstr "POSIX tillader ikke operatoren \"**=\""
+
+#: awkgram.y:1750
+msgid "old awk does not support operator `**='"
+msgstr "gamle awk understøtter ikke operatoren \"**=\""
+
+#: awkgram.y:1759
+msgid "POSIX does not allow operator `**'"
+msgstr "POSIX tillader ikke operatoren \"**\""
+
+#: awkgram.y:1761
+msgid "old awk does not support operator `**'"
+msgstr "gamle awk understøtter ikke operatoren \"**\""
+
+#: awkgram.y:1792
+msgid "operator `^=' is not supported in old awk"
+msgstr "operatoren \"^=\" understøttes ikke i gamle awk"
+
+#: awkgram.y:1800
+msgid "operator `^' is not supported in old awk"
+msgstr "operatoren \"^\" understøttes ikke i gamle awk"
+
+#: awkgram.y:1884 awkgram.y:1901
+msgid "unterminated string"
+msgstr "uafsluttet streng"
+
+#: awkgram.y:2061
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "ugyldigt tegn \"%c\" i udtryk"
+
+#: awkgram.y:2121
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "\"%s\" er en gawk-udvidelse"
+
+#: awkgram.y:2124
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "\"%s\" er en Bell Labs-udvidelse"
+
+#: awkgram.y:2127
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "POSIX tillader ikke \"%s\""
+
+#: awkgram.y:2131
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "\"%s\" understøttes ikke i gamle awk"
+
+#: awkgram.y:2158
+msgid "`goto' considered harmful!\n"
+msgstr "\"goto\" anses for skadlig!\n"
+
+#: awkgram.y:2220
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
+msgstr "%d er et ugyldigt antal argumenter for %s"
+
+#: awkgram.y:2239 awkgram.y:2242
+msgid "match: third argument is a gawk extension"
+msgstr "match: tredje argument er en gawk-udvidelse"
+
+#: awkgram.y:2255
+#, c-format
+msgid "%s: string literal as last arg of substitute has no effect"
+msgstr ""
+"%s: bogstavelig streng som sidste argument til erstatning har ingen effekt"
+
+#: awkgram.y:2258
+#, fuzzy, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "sub: tredje argument er ikke et ændringsbart objekt"
+
+#: awkgram.y:2285 awkgram.y:2288
+msgid "close: second argument is a gawk extension"
+msgstr "close: andet argument er en gawk-udvidelse"
+
+#: awkgram.y:2298
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"brug af dcgettext(_\"...\") er fejlagtigt: fjern det indledende "
+"understregningstegn"
+
+#: awkgram.y:2313
+#, fuzzy
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"brug af dcgettext(_\"...\") er fejlagtigt: fjern det indledende "
+"understregningstegn"
+
+#: awkgram.y:2384
+#, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "funktionen \"%s\": parameter %d, \"%s\", er samme som parameter %d"
+
+#: awkgram.y:2417
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "funktionen \"%s\": parameteren \"%s\" overskygger en global variabel"
+
+#: awkgram.y:2529
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "kunne ikke åbne \"%s\" for skrivning (%s)"
+
+#: awkgram.y:2530 profile.c:93
+msgid "sending profile to standard error"
+msgstr "sender profilen til standard fejl"
+
+#: awkgram.y:2562
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: mislykkedes at lukke (%s)"
+
+#: awkgram.y:2684
+msgid "shadow_funcs() called twice!"
+msgstr "shadow_funcs() kaldt to gange!"
+
+#: awkgram.y:2711
+msgid "there were shadowed variables."
+msgstr ""
+
+#: awkgram.y:2784
+#, c-format
+msgid "function `%s': can't use function name as parameter name"
+msgstr "funktionen \"%s\": kan ikke bruge funktionsnavn som parameternavn"
+
+#: awkgram.y:2794
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "funktionsnavnet \"%s\" er allerede defineret"
+
+#: awkgram.y:2945 awkgram.y:2951
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "funktionen \"%s\" kaldt, men aldrig defineret"
+
+#: awkgram.y:2954
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "funktionen \"%s\" defineret, men aldrig kaldt"
+
+#: awkgram.y:2981
+#, c-format
+msgid "regexp constant for parameter #%d yields boolean value"
+msgstr "konstant regulært udtryk for parameter %d giver en boolesk værdi"
+
+#: awkgram.y:2994
+#, c-format
+msgid ""
+"function `%s' called with space between name and `(',\n"
+"%s"
+msgstr ""
+"funktionen \"%s\" kaldt med blanktegn mellem navnet og \"(\",\n"
+"%s"
+
+#: awkgram.y:2996
+#, fuzzy
+msgid "or used as a variable or an array"
+msgstr "kan ikke bruge funktionsnavnet \"%s\" som variabel eller vektor"
+
+#: builtin.c:137
+#, c-format
+msgid "%s to \"%s\" failed (%s)"
+msgstr "%s til \"%s\" mislykkedes (%s)"
+
+#: builtin.c:138
+msgid "standard output"
+msgstr "standard ud"
+
+#: builtin.c:139
+msgid "reason unknown"
+msgstr "ukendt årsag"
+
+#: builtin.c:152
+msgid "exp: received non-numeric argument"
+msgstr "exp: fik et ikke-numerisk argument"
+
+#: builtin.c:158
+#, c-format
+msgid "exp: argument %g is out of range"
+msgstr "exp: argumentet %g er uden for tilladt område"
+
+#: builtin.c:216
+#, c-format
+msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
+msgstr ""
+"fflush: kan ikke spole: datakanalen \"%s\" åbnet for læsning, ikke skrivning"
+
+#: builtin.c:219
+#, c-format
+msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
+msgstr "fflush: kan ikke spole: filen \"%s\" åbnet for læsning, ikke skrivning"
+
+#: builtin.c:231
+#, c-format
+msgid "fflush: `%s' is not an open file, pipe or co-process"
+msgstr "fflush: \"%s\" er ikke en åben fil, datakanal eller ko proces"
+
+#: builtin.c:325
+msgid "index: received non-string first argument"
+msgstr "indeks: første argument er ikke en streng"
+
+#: builtin.c:327
+msgid "index: received non-string second argument"
+msgstr "indeks: andet argument er ikke en streng"
+
+#: builtin.c:437
+msgid "int: received non-numeric argument"
+msgstr "int: fik et ikke-numerisk argument"
+
+#: builtin.c:454
+msgid "length: received non-string argument"
+msgstr "length: fik et argument som ikke er en streng"
+
+#: builtin.c:470
+msgid "log: received non-numeric argument"
+msgstr "log: fik et ikke-numerisk argument"
+
+#: builtin.c:473
+#, c-format
+msgid "log: received negative argument %g"
+msgstr "log: fik et negativt argument %g"
+
+#: builtin.c:635 builtin.c:638
+msgid "must use `count$' on all formats or none"
+msgstr ""
+
+#: builtin.c:740
+msgid "`$' is not permitted in awk formats"
+msgstr "\"$\" tillades ikke i awkformat"
+
+#: builtin.c:746
+msgid "arg count with `$' must be > 0"
+msgstr "argumentantallet med \"$\" skal være > 0"
+
+#: builtin.c:748
+#, fuzzy, c-format
+msgid "arg count %ld greater than total number of supplied arguments"
+msgstr "argumentantallet %d er større end antal givne argumenter"
+
+#: builtin.c:750
+msgid "`$' not permitted after period in format"
+msgstr "\"$\" tillades ikke efter et punktum i formatet"
+
+#: builtin.c:763
+msgid "no `$' supplied for positional field width or precision"
+msgstr "intet \"$\" angivet for positionsangivet feltbredde eller præcision"
+
+#: builtin.c:821
+msgid "`l' is meaningless in awk formats; ignored"
+msgstr "\"l\" er meningsløst i awk-formater, ignoreret"
+
+#: builtin.c:825
+msgid "`l' is not permitted in POSIX awk formats"
+msgstr "\"l\" tillades ikke i POSIX awk-formater"
+
+#: builtin.c:836
+msgid "`L' is meaningless in awk formats; ignored"
+msgstr "\"L\" er meningsløst i awk-formater, ignoreret"
+
+#: builtin.c:840
+msgid "`L' is not permitted in POSIX awk formats"
+msgstr "\"L\" tillades ikke i POSIX awk-formater"
+
+#: builtin.c:851
+msgid "`h' is meaningless in awk formats; ignored"
+msgstr "\"h\" er meningsløst i awk-formater, ignoreret"
+
+#: builtin.c:855
+msgid "`h' is not permitted in POSIX awk formats"
+msgstr "\"h\" tillades ikke i POSIX awk-formater"
+
+#: builtin.c:1055
+#, c-format
+msgid "[s]printf: value %g is out of range for `%%%c' format"
+msgstr ""
+
+#: builtin.c:1108
+msgid "not enough arguments to satisfy format string"
+msgstr "for få argumenter til formatstrengen"
+
+#: builtin.c:1110
+msgid "^ ran out for this one"
+msgstr "^ sluttede her"
+
+#: builtin.c:1115
+msgid "[s]printf: format specifier does not have control letter"
+msgstr "[s]printf: formatspecifiereren har intet kommandobogstav"
+
+#: builtin.c:1118
+msgid "too many arguments supplied for format string"
+msgstr "for mange argumenter til formatstrengen"
+
+#: builtin.c:1184 builtin.c:1187
+msgid "printf: no arguments"
+msgstr "printf: ingen argumenter"
+
+#: builtin.c:1211
+msgid "sqrt: received non-numeric argument"
+msgstr "sqrt: fik ikke-numerisk argument"
+
+#: builtin.c:1215
+#, c-format
+msgid "sqrt: called with negative argument %g"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: builtin.c:1238
+#, c-format
+msgid "substr: start index %g is invalid, using 1"
+msgstr "substr: startindeks %g er ugyldigt, bruger 1"
+
+#: builtin.c:1243
+#, c-format
+msgid "substr: non-integer start index %g will be truncated"
+msgstr "substr: startindeks %g som ikke er et heltal bliver trunkeret"
+
+#: builtin.c:1262
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 1"
+msgstr "substr: længden %g er <= 0"
+
+#: builtin.c:1264
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 0"
+msgstr "substr: længden %g er <= 0"
+
+#: builtin.c:1271
+#, c-format
+msgid "substr: non-integer length %g will be truncated"
+msgstr "substr: længden %g som ikke er et heltal bliver trunkeret"
+
+#: builtin.c:1276
+#, c-format
+msgid "substr: length %g too big for string indexing, truncating to %g"
+msgstr ""
+
+#: builtin.c:1288
+msgid "substr: source string is zero length"
+msgstr "substr: kildestrengen er tom"
+
+#: builtin.c:1294
+#, fuzzy, c-format
+msgid "substr: start index %g is past end of string"
+msgstr "substr: startindeks %d er forbi slutningen på strengen"
+
+#: builtin.c:1302
+#, fuzzy, c-format
+msgid ""
+"substr: length %g at start index %g exceeds length of first argument (%lu)"
+msgstr ""
+"substr: længden %d ved startindeks %d overskrider længden af første argument "
+"(%d)"
+
+#: builtin.c:1337
+#, fuzzy
+msgid "strftime: received non-string first argument"
+msgstr "strftime: fik et første argument som ikke er en streng"
+
+#: builtin.c:1343
+msgid "strftime: received empty format string"
+msgstr "strftime: fik en tom formatstreng"
+
+#: builtin.c:1352
+#, fuzzy
+msgid "strftime: received non-numeric second argument"
+msgstr "strftime: fik et ikke-numerisk andet argument"
+
+#: builtin.c:1415
+msgid "mktime: received non-string argument"
+msgstr "mktime: fik et argument som ikke er en streng"
+
+#: builtin.c:1460
+#, fuzzy
+msgid "system: received non-string argument"
+msgstr "system: fik et argument som ikke er en streng"
+
+#: builtin.c:1581 eval.c:1883
+#, fuzzy, c-format
+msgid "reference to uninitialized field `$%d'"
+msgstr "reference til ikke-initieret variabel \"%s\""
+
+#: builtin.c:1608
+#, fuzzy
+msgid "tolower: received non-string argument"
+msgstr "tolower: fik et argument som ikke er en streng"
+
+#: builtin.c:1657
+#, fuzzy
+msgid "toupper: received non-string argument"
+msgstr "toupper: fik et argument som ikke er en streng"
+
+#: builtin.c:1702
+msgid "atan2: received non-numeric first argument"
+msgstr "atan2: fik et ikke-numerisk første argument"
+
+#: builtin.c:1704
+msgid "atan2: received non-numeric second argument"
+msgstr "atan2: fik et ikke-numerisk andet argument"
+
+#: builtin.c:1723
+msgid "sin: received non-numeric argument"
+msgstr "sin: fik et ikke-numerisk argument"
+
+#: builtin.c:1739
+msgid "cos: received non-numeric argument"
+msgstr "cos: fik et ikke-numerisk argument"
+
+#: builtin.c:1788
+msgid "srand: received non-numeric argument"
+msgstr "srand: fik et ikke-numerisk argument"
+
+#: builtin.c:1823
+msgid "match: third argument is not an array"
+msgstr "match: tredje argument er ikke en vektor"
+
+#: builtin.c:2307
+msgid "gensub: third argument of 0 treated as 1"
+msgstr "gensub: Nullet i tredje argument behandlet som et ét-tal"
+
+#: builtin.c:2416 builtin.c:2418
+msgid "lshift: received non-numeric first argument"
+msgstr "lshift: fik et ikke-numerisk første argument"
+
+#: builtin.c:2420
+#, c-format
+msgid "lshift(%lf, %lf): negative values will give strange results"
+msgstr "lshift(%lf, %lf): negative værdier vil give mærkelige resultater"
+
+#: builtin.c:2422
+#, c-format
+msgid "lshift(%lf, %lf): fractional values will be truncated"
+msgstr "lshift(%lf, %lf): flydendetalsværdier vil blive trunkeret"
+
+#: builtin.c:2424
+#, c-format
+msgid "lshift(%lf, %lf): too large shift value will give strange results"
+msgstr ""
+"lshift(%lf, %lf): for store skifteværdier vil give mærkelige resultater"
+
+#: builtin.c:2453 builtin.c:2455
+msgid "rshift: received non-numeric first argument"
+msgstr "rshift: fik et ikke-numerisk første argument"
+
+#: builtin.c:2457
+#, c-format
+msgid "rshift(%lf, %lf): negative values will give strange results"
+msgstr "rshift(%lf, %lf): negative værdier vil give mærkelige resultater"
+
+#: builtin.c:2459
+#, c-format
+msgid "rshift(%lf, %lf): fractional values will be truncated"
+msgstr "rshift(%lf, %lf): flydendetalsværdier vil blive trunkeret"
+
+#: builtin.c:2461
+#, c-format
+msgid "rshift(%lf, %lf): too large shift value will give strange results"
+msgstr ""
+"rshift(%lf, %lf): for store skifteværdier vil give mærkelige resultater"
+
+#: builtin.c:2490 builtin.c:2492
+msgid "and: received non-numeric first argument"
+msgstr "and: fik et ikke-numerisk første argument"
+
+#: builtin.c:2494
+#, c-format
+msgid "and(%lf, %lf): negative values will give strange results"
+msgstr "and(%lf, %lf): negative værdier vil give mærkelige resultater"
+
+#: builtin.c:2496
+#, c-format
+msgid "and(%lf, %lf): fractional values will be truncated"
+msgstr "and(%lf, %lf): flydendetalsværdier vil blive trunkeret"
+
+#: builtin.c:2525 builtin.c:2527
+msgid "or: received non-numeric first argument"
+msgstr "or: fik et ikke-numerisk første argument"
+
+#: builtin.c:2529
+#, c-format
+msgid "or(%lf, %lf): negative values will give strange results"
+msgstr "or(%lf, %lf): negative værdier vil give mærkelige resultater"
+
+#: builtin.c:2531
+#, c-format
+msgid "or(%lf, %lf): fractional values will be truncated"
+msgstr "or(%lf, %lf): flydendetalsværdier vil blive trunkeret"
+
+#: builtin.c:2560 builtin.c:2562
+msgid "xor: received non-numeric first argument"
+msgstr "xor: fik et ikke-numerisk første argument"
+
+#: builtin.c:2564
+#, c-format
+msgid "xor(%lf, %lf): negative values will give strange results"
+msgstr "xor(%lf, %lf): negative værdier vil give mærkelige resultater"
+
+#: builtin.c:2566
+#, c-format
+msgid "xor(%lf, %lf): fractional values will be truncated"
+msgstr "xor(%lf, %lf): flydendetalsværdier vil blive trunkeret"
+
+#: builtin.c:2594
+msgid "compl: received non-numeric argument"
+msgstr "compl: fik et ikke-numerisk argument"
+
+#: builtin.c:2596
+#, c-format
+msgid "compl(%lf): negative value will give strange results"
+msgstr "compl(%lf): negative værdier vil give mærkelige resultater"
+
+#: builtin.c:2598
+#, c-format
+msgid "compl(%lf): fractional value will be truncated"
+msgstr "compl(%lf): flydendetalsværdier vil blive trunkeret"
+
+#: builtin.c:2771
+#, c-format
+msgid "dcgettext: `%s' is not a valid locale category"
+msgstr "dcgettext: \"%s\" er ikke en gyldig lokalekategori"
+
+#: eval.c:266
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "ukendt nodetype %d"
+
+#: eval.c:312
+msgid "buffer overflow in genflags2str"
+msgstr "bufferoverløb i genflags2str"
+
+#: eval.c:647
+#, fuzzy, c-format
+msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
+msgstr ""
+"for-løkke: vektoren \"%s\" ændrede størrelse fra %d til %d under løkke-"
+"udførelsen"
+
+#: eval.c:668
+msgid "`break' outside a loop is not portable"
+msgstr "\"break\" uden for en løkke er ikke portabelt"
+
+#: eval.c:672
+msgid "`break' outside a loop is not allowed"
+msgstr "\"break\" uden for en løkke er ikke tilladt"
+
+#: eval.c:689
+msgid "`continue' outside a loop is not portable"
+msgstr "\"continue\" uden for en løkke er ikke portabelt"
+
+#: eval.c:693
+msgid "`continue' outside a loop is not allowed"
+msgstr "\"continue\" uden for en løkke er ikke tilladt"
+
+#: eval.c:727
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "\"next\" kan ikke kaldes fra en BEGIN-regel"
+
+#: eval.c:729
+msgid "`next' cannot be called from an END rule"
+msgstr "\"next\" kan ikke kaldes fra en END-regel"
+
+#: eval.c:738
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "\"nextfile\" kan ikke kaldes fra en BEGIN-regel"
+
+#: eval.c:740
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "\"nextfile\" kan ikke kaldes fra en END-regel"
+
+#: eval.c:785
+msgid "statement has no effect"
+msgstr "kommandoen har ingen effekt"
+
+#: eval.c:828 eval.c:1726
+#, c-format
+msgid "can't use function name `%s' as variable or array"
+msgstr "kan ikke bruge funktionsnavnet \"%s\" som variabel eller vektor"
+
+#: eval.c:835 eval.c:841
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "reference til ikke-initieret argument \"%s\""
+
+#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807
+#, c-format
+msgid "attempt to use array `%s' in a scalar context"
+msgstr "forsøg på at bruge vektoren \"%s\" i skalarsammenhæng"
+
+#: eval.c:858 eval.c:1752
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "reference til ikke-initieret variabel \"%s\""
+
+#: eval.c:1007
+msgid ""
+"concatenation: side effects in one expression have changed the length of "
+"another!"
+msgstr ""
+"concatenation: sideeffekter i et udtryk har ændret længden af et andet!"
+
+#: eval.c:1032
+msgid "assignment used in conditional context"
+msgstr "tildeling brugt i sammenligningsammenhæng"
+
+#: eval.c:1122
+msgid "division by zero attempted"
+msgstr "forsøgte at dividere med nul"
+
+#: eval.c:1137
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "forsøgte at dividere med nul i \"%%\""
+
+#: eval.c:1152 profile.c:683
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "ikke tilladt type (%s) i tree_eval"
+
+#: eval.c:1328
+msgid "division by zero attempted in `/='"
+msgstr "forsøgte at dividere med nul i \"/=\""
+
+#: eval.c:1346
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "forsøgte at dividere med nul i \"%%=\""
+
+#: eval.c:1586
+#, c-format
+msgid "function `%s' called with more arguments than declared"
+msgstr "funktionen \"%s\" kaldt med flere argumenter end deklareret"
+
+#: eval.c:1633
+#, c-format
+msgid "function `%s' not defined"
+msgstr "funktionen \"%s\" er ikke defineret"
+
+#: eval.c:1639
+#, c-format
+msgid "function %s called\n"
+msgstr "funktionen %s kaldt\n"
+
+#: eval.c:1698
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# Funktionskaldsstak:\n"
+"\n"
+
+#: eval.c:1701
+msgid "\t# -- main --\n"
+msgstr "\t# -- main --\n"
+
+#: eval.c:1867
+msgid "attempt to field reference from non-numeric value"
+msgstr "forsøg på at feltreferere fra ikke-numerisk værdi"
+
+#: eval.c:1869
+msgid "attempt to reference from null string"
+msgstr "forsøg på at referere fra tom streng"
+
+#: eval.c:1875
+#, c-format
+msgid "attempt to access field %d"
+msgstr "forsøg på at få adgang til felt nummer %d"
+
+#: eval.c:1896 eval.c:1903 profile.c:900
+msgid "assignment is not allowed to result of builtin function"
+msgstr "tildeling er ikke tilladt til resultatet fra en indbygget funktion"
+
+#: eval.c:1951
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "\"IGNORECASE\" er en gawk-udvidelse"
+
+#: eval.c:1980
+msgid "`BINMODE' is a gawk extension"
+msgstr "\"BINMODE\" er en gawk-udvidelse"
+
+#: eval.c:2092
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "fejlagtig \"%sFMT\"-specifikation \"%s\""
+
+#: eval.c:2170
+msgid "turning off `--lint' due to assignment to `LINT'"
+msgstr "deaktiverer \"--lint\" på grund af en tildeling til \"LINT\""
+
+#: ext.c:60 ext.c:64
+msgid "`extension' is a gawk extension"
+msgstr "\"extension\" er en gawk-udvidelse"
+
+#: ext.c:74
+#, c-format
+msgid "extension: cannot open `%s' (%s)\n"
+msgstr "extension: kan ikke åbne \"%s\" (%s)\n"
+
+#: ext.c:82
+#, c-format
+msgid "extension: library `%s': cannot call function `%s' (%s)\n"
+msgstr "extension: bibliotek \"%s\": kan ikke kalde funktionen \"%s\" (%s)\n"
+
+#: ext.c:183
+msgid "Operation Not Supported"
+msgstr "Operationen understøttes ikke"
+
+#: field.c:315
+msgid "NF set to negative value"
+msgstr "NF sat til en negativ værdi"
+
+#: field.c:808
+msgid "split: second argument is not an array"
+msgstr "split: andet argument er ikke en vektor"
+
+#: field.c:842
+msgid "split: null string for third arg is a gawk extension"
+msgstr "split: tom streng som tredje argument er en gawk-udvidelse"
+
+#: field.c:894
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "\"FIELDWIDTHS\" er en gawk-udvidelse"
+
+#: field.c:921
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "felt %d i FIELDWIDTHS skal være > 0"
+
+#: field.c:994
+msgid "null string for `FS' is a gawk extension"
+msgstr "tom streng som \"FS\" er en gawk-udvidelse"
+
+#: getopt.c:692 getopt.c:704
+#, c-format
+msgid "%s: option `%s' is ambiguous\n"
+msgstr "%s: flaget \"%s\" er flertydigt\n"
+
+#: getopt.c:737 getopt.c:741
+#, c-format
+msgid "%s: option `--%s' doesn't allow an argument\n"
+msgstr "%s: flaget \"--%s\" tillader ikke noget argument\n"
+
+#: getopt.c:750 getopt.c:755
+#, c-format
+msgid "%s: option `%c%s' doesn't allow an argument\n"
+msgstr "%s: flaget \"%c%s\" tillader ikke noget 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: flaget \"%s\" kræver et argument\n"
+
+#: getopt.c:842 getopt.c:845
+#, c-format
+msgid "%s: unrecognized option `--%s'\n"
+msgstr "%s: ukendt flag \"--%s\"\n"
+
+#: getopt.c:853 getopt.c:856
+#, c-format
+msgid "%s: unrecognized option `%c%s'\n"
+msgstr "%s: ukendt flag \"%c%s\"\n"
+
+#: getopt.c:903 getopt.c:906
+#, c-format
+msgid "%s: illegal option -- %c\n"
+msgstr "%s: ikke tilladt flag -- %c\n"
+
+#: getopt.c:912 getopt.c:915
+#, c-format
+msgid "%s: invalid option -- %c\n"
+msgstr "%s: ugyldig flag -- %c\n"
+
+#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434
+#, c-format
+msgid "%s: option requires an argument -- %c\n"
+msgstr "%s: flaget kræver et argument -- %c\n"
+
+#: getopt.c:1025 getopt.c:1036
+#, c-format
+msgid "%s: option `-W %s' is ambiguous\n"
+msgstr "%s: flaget \"-W %s\" er flertydigt\n"
+
+#: getopt.c:1060 getopt.c:1072
+#, c-format
+msgid "%s: option `-W %s' doesn't allow an argument\n"
+msgstr "%s: flaget \"-W %s\" tillader ikke noget argument\n"
+
+#: io.c:305
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "kan ikke åbne filen \"%s\" for læsning (%s)"
+
+#: io.c:392
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "lukning af fd %d (\"%s\") mislykkedes (%s)"
+
+#: io.c:530
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "ugyldig trætype %s i redirect()"
+
+#: io.c:536
+#, c-format
+msgid "expression in `%s' redirection only has numeric value"
+msgstr "udtrykket i \"%s\"-omdirigering har kun numerisk værdi"
+
+#: io.c:542
+#, c-format
+msgid "expression for `%s' redirection has null string value"
+msgstr "udtrykket for \"%s\"-omdirigering har en tom streng som værdi"
+
+#: io.c:547
+#, c-format
+msgid "filename `%s' for `%s' redirection may be result of logical expression"
+msgstr ""
+"filnavnet \"%s\" for \"%s\"-omdirigering kan være resultatet af et logisk "
+"udtryk"
+
+#: io.c:569
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "unødig blanding af \">\" og \">>\" for filen \"%.*s\""
+
+#: io.c:621
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "kan ikke åbne røret \"%s\" for udskrivning (%s)"
+
+#: io.c:630
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "kan ikke åbne røret \"%s\" for indtastning (%s)"
+
+#: io.c:643
+#, c-format
+msgid "can't open two way socket `%s' for input/output (%s)"
+msgstr "kan ikke åbne tovejssoklen \"%s\" for ind-/uddata (%s)"
+
+#: io.c:647
+#, c-format
+msgid "can't open two way pipe `%s' for input/output (%s)"
+msgstr "kan ikke åbne tovejsrøret \"%s\" for ind-/uddata (%s)"
+
+#: io.c:723
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "kan ikke omdirigere fra \"%s\" (%s)"
+
+#: io.c:726
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "kan ikke omdirigere til \"%s\" (%s)"
+
+#: io.c:765
+msgid ""
+"reached system limit for open files: starting to multiplex file descriptors"
+msgstr ""
+"nåede systembegrænsningen for åbne filer: begynder at multiplekse "
+"fildeskriptorer"
+
+#: io.c:777
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "lukning af \"%s\" mislykkedes (%s)"
+
+#: io.c:784
+msgid "too many pipes or input files open"
+msgstr "for mange rør eller inddatafiler åbne"
+
+#: io.c:807
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: andet argument skal være \"to\" eller \"from\""
+
+#: io.c:821
+#, c-format
+msgid "close: `%.*s' is not an open file, pipe or co-process"
+msgstr "close: \"%.*s\" er ikke en åben fil, datakanal eller ko-proces"
+
+#: io.c:825
+msgid "close of redirection that was never opened"
+msgstr "lukning af omdirigering som aldrig åbnedes"
+
+#: io.c:862
+#, c-format
+msgid "close: redirection `%s' not opened with `|&', second argument ignored"
+msgstr ""
+"close: omdirigeringen \"%s\" åbnedes ikke med \"|&\", andet argument "
+"ignoreret"
+
+#: io.c:924
+#, c-format
+msgid "failure status (%d) on pipe close of `%s' (%s)"
+msgstr "fejlstatus (%d) fra rørlukning af \"%s\" (%s)"
+
+#: io.c:927
+#, c-format
+msgid "failure status (%d) on file close of `%s' (%s)"
+msgstr "fejlstatus (%d) fra fillukning af \"%s\" (%s)"
+
+#: io.c:946
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "ingen eksplicit lukning af soklen \"%s\" angivet"
+
+#: io.c:949
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "ingen eksplicit lukning af ko-processen \"%s\" angivet"
+
+#: io.c:952
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "ingen eksplicit lukning af røret \"%s\" angivet"
+
+#: io.c:955
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "ingen eksplicit lukning af filen \"%s\" angivet"
+
+#: io.c:984 io.c:1038
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "fejl ved skrivning til standard ud (%s)"
+
+#: io.c:988 io.c:1042
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "fejl ved skrivning til standard fejl (%s)"
+
+#: io.c:996
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "rørspuling af \"%s\" mislykkedes (%s)"
+
+#: io.c:999
+#, c-format
+msgid "co-process flush of pipe to `%s' failed (%s)."
+msgstr "ko-processpuling af røret til \"%s\" mislykkedes (%s)"
+
+#: io.c:1002
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "filspuling af \"%s\" mislykkedes (%s)"
+
+#: io.c:1161
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "/inet/raw-klient er desværre ikke klar endnu"
+
+#: io.c:1163 io.c:1200
+msgid "only root may use `/inet/raw'."
+msgstr "kun root kan bruge \"/inet/raw\"."
+
+#: io.c:1198
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "/inet/raw-server er desværre ikke klar endnu"
+
+#: io.c:1288
+#, c-format
+msgid "no (known) protocol supplied in special filename `%s'"
+msgstr "ingen (kendt) protokol opgivet i special-filnavn \"%s\""
+
+#: io.c:1306
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "special-filnavn \"%s\" er ufuldstændigt"
+
+#: io.c:1318
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "lokal port ugyldig i \"%s\""
+
+#: io.c:1330
+msgid "must supply a remote hostname to `/inet'"
+msgstr "skal angive et fjernmaskinenavn til \"/inet\""
+
+#: io.c:1345
+msgid "must supply a remote port to `/inet'"
+msgstr "skal angive en fjernport til \"/inet\""
+
+#: io.c:1351
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "fjernporten ugyldig i \"%s\""
+
+#: io.c:1361
+msgid "TCP/IP communications are not supported"
+msgstr "TCP/IP-kommunikation understøttes ikke"
+
+#: io.c:1370 io.c:1551
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "filen \"%s\" er et katalog"
+
+#: io.c:1440
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "brug \"PROCINFO[\"%s\"]\" i stedet for \"%s\""
+
+#: io.c:1472
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "brug \"PROCINFO[...]\" i stedet for \"dev/user\""
+
+#: io.c:1537 io.c:1711
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "kunne ikke åbne \"%s\", tilstand \"%s\""
+
+#: io.c:1762
+#, fuzzy, c-format
+msgid "close of master pty failed (%s)"
+msgstr "lukning af røret mislykkedes (%s)"
+
+#: io.c:1764 io.c:1916 io.c:2068
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "lukning af standard ud i barnet mislykkedes (%s)"
+
+#: io.c:1767
+#, fuzzy, c-format
+msgid "moving slave pty to stdout in child failed (dup: %s)"
+msgstr "flytning af rør til standard ud i barnet mislykkedes (dup: %s)"
+
+#: io.c:1769 io.c:1921
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "lukning af standard ind i barnet mislykkedes (%s)"
+
+#: io.c:1772
+#, fuzzy, c-format
+msgid "moving slave pty to stdin in child failed (dup: %s)"
+msgstr "flytning af rør til standard ind i barnet mislykkedes (dup: %s)"
+
+#: io.c:1774 io.c:1793
+#, fuzzy, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "lukning af røret mislykkedes (%s)"
+
+#: io.c:1867 io.c:1919 io.c:2049 io.c:2071
+#, c-format
+msgid "moving pipe to stdout in child failed (dup: %s)"
+msgstr "flytning af rør til standard ud i barnet mislykkedes (dup: %s)"
+
+#: io.c:1871 io.c:1924
+#, c-format
+msgid "moving pipe to stdin in child failed (dup: %s)"
+msgstr "flytning af rør til standard ind i barnet mislykkedes (dup: %s)"
+
+#: io.c:1888 io.c:2062
+msgid "restoring stdout in parent process failed\n"
+msgstr "genskabelse af standard ud i forælderprocessen mislykkedes\n"
+
+#: io.c:1893
+msgid "restoring stdin in parent process failed\n"
+msgstr "genskabelse af standard ind i forælderprocessen mislykkedes\n"
+
+#: io.c:1927 io.c:2073 io.c:2084
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "lukning af røret mislykkedes (%s)"
+
+#: io.c:1972
+msgid "`|&' not supported"
+msgstr "\"|&\" understøttes ikke"
+
+#: io.c:2039
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "kan ikke åbne røret \"%s\" (%s)"
+
+#: io.c:2080
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr "kan ikke oprette barneproces for \"%s\" (fork: %s)"
+
+#: io.c:2423
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "datafilen \"%s\" er tom"
+
+#: io.c:2466 io.c:2474
+msgid "could not allocate more input memory"
+msgstr ""
+
+#: io.c:2832 io.c:2895
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "fejl ved læsning af inddatafilen \"%s\": %s"
+
+#: io.c:3020
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "flertegnsværdien af \"RS\" er en gawk-udvidelse"
+
+#: main.c:324
+msgid "`-m[fr]' option irrelevant in gawk"
+msgstr "\"-m[fr]\"-flaget er irrelevant i gawk"
+
+#: main.c:326
+msgid "-m option usage: `-m[fr] nnn'"
+msgstr "-m-flagets brug: \"-m[fr] nnn\""
+
+#: main.c:343
+#, c-format
+msgid "%s: option `-W %s' unrecognized, ignored\n"
+msgstr "%s: flaget \"-W %s\" ukendt, ignoreret\n"
+
+#: main.c:380
+msgid "empty argument to `--source' ignored"
+msgstr "tomt argument til \"--source\" ignoreret"
+
+#: main.c:451
+msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
+msgstr "miljøvariablen \"POSIXLY_CORRECT\" sat: aktiverer \"--posix\""
+
+#: main.c:456
+msgid "`--posix' overrides `--traditional'"
+msgstr "\"--posix\" tilsidesætter \"--traditional\""
+
+#: main.c:467
+msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
+msgstr "\"--posix\"/\"--traditional\" tilsidesætter \"--non-decimal-data\""
+
+#: main.c:471
+#, fuzzy, c-format
+msgid "running %s setuid root may be a security problem"
+msgstr "at køre %s setuid root kan være et sikkerhedsproblem"
+
+#: main.c:512
+#, fuzzy, c-format
+msgid "can't set binary mode on stdin (%s)"
+msgstr "kan ikke sætte tilstand på standard ind (%s)"
+
+#: main.c:515
+#, fuzzy, c-format
+msgid "can't set binary mode on stdout (%s)"
+msgstr "kan ikke sætte tilstand på standard ud (%s)"
+
+#: main.c:517
+#, fuzzy, c-format
+msgid "can't set binary mode on stderr (%s)"
+msgstr "kan ikke sætte tilstand på standard fejl (%s)"
+
+#: main.c:547
+msgid "no program text at all!"
+msgstr "ingen programtekst overhovedet!"
+
+#: main.c:620
+#, c-format
+msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
+msgstr "Brug: %s [POSIX- eller GNU-stilflag] -f progfil [--] fil ...\n"
+
+#: main.c:622
+#, c-format
+msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
+msgstr "Brug: %s [POSIX- eller GNU-stilflag] %cprogram%c fil ...\n"
+
+#: main.c:627
+msgid "POSIX options:\t\tGNU long options:\n"
+msgstr "POSIX-flag:\t\tGNU lange flag:\n"
+
+#: main.c:628
+msgid "\t-f progfile\t\t--file=progfile\n"
+msgstr "\t-f progfil\t\t--file=progfil\n"
+
+#: main.c:629
+msgid "\t-F fs\t\t\t--field-separator=fs\n"
+msgstr "\t-F fs\t\t\t--field-separator=fs\n"
+
+#: main.c:630
+msgid "\t-v var=val\t\t--assign=var=val\n"
+msgstr "\t-v var=værdi\t\t--assign=var=værdi\n"
+
+#: main.c:631
+msgid "\t-m[fr] val\n"
+msgstr "\t-m[fr] værdi\n"
+
+#: main.c:632
+msgid "\t-W compat\t\t--compat\n"
+msgstr "\t-W compat\t\t--compat\n"
+
+#: main.c:633
+msgid "\t-W copyleft\t\t--copyleft\n"
+msgstr "\t-W copyleft\t\t--copyleft\n"
+
+#: main.c:634
+msgid "\t-W copyright\t\t--copyright\n"
+msgstr "\t-W copyright\t\t--copyright\n"
+
+#: main.c:635
+msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
+msgstr "\t-W dump-variables[=fil]\t--dump-variables[=fil]\n"
+
+#: main.c:636
+msgid "\t-W gen-po\t\t--gen-po\n"
+msgstr "\t-W gen-po\t\t--gen-po\n"
+
+#: main.c:637
+msgid "\t-W help\t\t\t--help\n"
+msgstr "\t-W help\t\t\t--help\n"
+
+#: main.c:638
+msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+
+#: main.c:639
+msgid "\t-W lint-old\t\t--lint-old\n"
+msgstr "\t-W lint-old\t\t--lint-old\n"
+
+#: main.c:640
+msgid "\t-W non-decimal-data\t--non-decimal-data\n"
+msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
+
+#: main.c:642
+msgid "\t-W nostalgia\t\t--nostalgia\n"
+msgstr "\t-W nostalgia\t\t--nostalgia\n"
+
+#: main.c:645
+msgid "\t-W parsedebug\t\t--parsedebug\n"
+msgstr "\t-W parsedebug\t\t--parsedebug\n"
+
+#: main.c:647
+msgid "\t-W profile[=file]\t--profile[=file]\n"
+msgstr "\t-W profile[=fil]\t--profile[=fil]\n"
+
+#: main.c:648
+msgid "\t-W posix\t\t--posix\n"
+msgstr "\t-W posix\t\t--posix\n"
+
+#: main.c:649
+msgid "\t-W re-interval\t\t--re-interval\n"
+msgstr "\t-W re-interval\t\t--re-interval\n"
+
+#: main.c:650
+msgid "\t-W source=program-text\t--source=program-text\n"
+msgstr "\t-W source=programtekst\t--source=programtekst\n"
+
+#: main.c:651
+msgid "\t-W traditional\t\t--traditional\n"
+msgstr "\t-W traditional\t\t--traditional\n"
+
+#: main.c:652
+msgid "\t-W usage\t\t--usage\n"
+msgstr "\t-W usage\t\t--usage\n"
+
+#: main.c:653
+msgid "\t-W version\t\t--version\n"
+msgstr "\t-W version\t\t--version\n"
+
+#: main.c:657
+#, 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 trykte version.\n"
+"Rapportér synpunkter på oversættelsen til <dansk@klid.dk>.\n"
+
+#: main.c:661
+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:665
+msgid ""
+"Examples:\n"
+"\tgawk '{ sum += $1 }; END { print sum }' file\n"
+"\tgawk -F: '{ print $1 }' /etc/passwd\n"
+msgstr ""
+
+#: main.c:682
+#, 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"
+"Dette program er frit programmel. Du kan distribuere det og/eller\n"
+"ændre det under betingelserne i GNU General Public License, offentliggjort\n"
+"af Free Software Foundation, enten version 2 eller (hvis du vil)\n"
+"enhver senere version.\n"
+"\n"
+
+#: main.c:690
+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 ""
+"Dette program distribueres i håb om at det vil være nyttigt,\n"
+"men UDEN NOGEN SOM HELST GARANTI, også uden underforstået garanti\n"
+"om SALGBARHED eller EGNETHED FOR NOGET SPECIELT FORMÅL. Se GNU\n"
+"General Public License for yderligere information.\n"
+"\n"
+
+#: main.c:696
+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 have fået en kopi af GNU General Public License sammen\n"
+"med dette program. Hvis ikke, så skriv til Free Software Foundation,\n"
+"Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"
+
+#: main.c:730
+msgid "-Ft does not set FS to tab in POSIX awk"
+msgstr "-Ft sætter ikke FS til tab i POSIX-awk"
+
+#: main.c:956
+#, c-format
+msgid ""
+"%s: `%s' argument to `-v' not in `var=value' form\n"
+"\n"
+msgstr ""
+
+#: main.c:976
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr ""
+
+#: main.c:979
+#, c-format
+msgid "`%s' is not a variable name, looking for file `%s=%s'"
+msgstr ""
+
+#: main.c:1012
+msgid "floating point exception"
+msgstr "flydendetalsundtagelse"
+
+#: main.c:1019
+msgid "fatal error: internal error"
+msgstr "fatal fejl: intern fejl"
+
+#: main.c:1069
+#, c-format
+msgid "no pre-opened fd %d"
+msgstr "ingen for-åbnet fd %d"
+
+#: main.c:1074
+#, c-format
+msgid "could not pre-open /dev/null for fd %d"
+msgstr "kunne ikke for-åbne /dev/null for fd %d"
+
+#: main.c:1097 main.c:1106
+#, c-format
+msgid "could not find groups: %s"
+msgstr "kunne ikke finde grupper: %s"
+
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "kommandolinje:"
+
+#: msg.c:120
+msgid "warning: "
+msgstr "advarsel: "
+
+#: msg.c:142
+msgid "error: "
+msgstr "fejl: "
+
+#: msg.c:178
+msgid "fatal: "
+msgstr "fatal: "
+
+#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115
+msgid "can't convert string to float"
+msgstr "kan ikke konvertere en streng til flydende tal"
+
+#: node.c:355
+msgid "backslash at end of string"
+msgstr "omvendt skråstreg i slutningen af strengen"
+
+#: node.c:539
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX tillader ikke \"\\x\"-kontrolsekvenser"
+
+#: node.c:545
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "ingen heksadecimale cifre i \"\\x\"-kontrolsekvenser"
+
+#: node.c:579
+#, c-format
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr "kontrolsekvensen \"\\%c\" behandlet som kun \"%c\""
+
+#: posix/gawkmisc.c:172
+#, c-format
+msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
+msgstr "%s %s \"%s\": kunne ikke sætte luk-ved-exec (fcntl: %s)"
+
+#: profile.c:91
+#, c-format
+msgid "could not open `%s' for writing: %s"
+msgstr "kunne ikke åbne \"%s\" for skrivning: %s"
+
+#: profile.c:449
+#, fuzzy, c-format
+msgid "internal error: %s with null vname"
+msgstr "intern fejl: Node_var med null vname"
+
+#: profile.c:512
+msgid "# treated internally as `delete'"
+msgstr ""
+
+#: profile.c:1162
+#, c-format
+msgid "\t# gawk profile, created %s\n"
+msgstr "\t# gawkprofil, oprettet %s\n"
+
+#: profile.c:1165
+msgid ""
+"\t# BEGIN block(s)\n"
+"\n"
+msgstr ""
+"\t# BEGIN-blok\n"
+"\n"
+
+#: profile.c:1175
+msgid ""
+"\t# Rule(s)\n"
+"\n"
+msgstr ""
+"\t# Regel/regler\n"
+"\n"
+
+#: profile.c:1181
+msgid ""
+"\t# END block(s)\n"
+"\n"
+msgstr ""
+"\t# END-blok\n"
+"\n"
+
+#: profile.c:1201
+msgid ""
+"\n"
+"\t# Functions, listed alphabetically\n"
+msgstr ""
+"\n"
+"\t# Funktioner, listede alfabetisk\n"
+
+#: profile.c:1413
+#, c-format
+msgid "unexpected type %s in prec_level"
+msgstr "uventet type %s i prec_level"
+
+#: re.c:193
+#, c-format
+msgid "regex match failed, not enough memory to match string \"%.*s%s\""
+msgstr ""
+
+#: regcomp.c:136
+msgid "Success"
+msgstr "Lykkedes"
+
+#: regcomp.c:139
+msgid "No match"
+msgstr "Mislykkedes"
+
+#: regcomp.c:142
+msgid "Invalid regular expression"
+msgstr "Ugyldigt regulært udtryk"
+
+#: regcomp.c:145
+msgid "Invalid collation character"
+msgstr "Ugyldigt kollationeringstegn"
+
+#: regcomp.c:148
+msgid "Invalid character class name"
+msgstr "Ugyldigt tegnklassenavn"
+
+#: regcomp.c:151
+msgid "Trailing backslash"
+msgstr "Efterfølgende omvendt skråstreg"
+
+#: regcomp.c:154
+msgid "Invalid back reference"
+msgstr "Ugyldig bagudreference"
+
+#: regcomp.c:157
+msgid "Unmatched [ or [^"
+msgstr "Ubalanceret [ eller [^"
+
+#: regcomp.c:160
+msgid "Unmatched ( or \\("
+msgstr "Ubalanceret ( eller \\("
+
+#: regcomp.c:163
+msgid "Unmatched \\{"
+msgstr "Ubalanceret \\{"
+
+#: regcomp.c:166
+msgid "Invalid content of \\{\\}"
+msgstr "Ugyldigt indhold i \\{\\}"
+
+#: regcomp.c:169
+msgid "Invalid range end"
+msgstr "Ugyldig intervalslutning"
+
+#: regcomp.c:172
+msgid "Memory exhausted"
+msgstr "Hukommelsen opbrugt"
+
+#: regcomp.c:175
+msgid "Invalid preceding regular expression"
+msgstr "Ugyldigt foregående regulært udtryk"
+
+#: regcomp.c:178
+msgid "Premature end of regular expression"
+msgstr "For tidligt slut på regulært udtryk"
+
+#: regcomp.c:181
+msgid "Regular expression too big"
+msgstr "Regulært udtryk for stort"
+
+#: regcomp.c:184
+msgid "Unmatched ) or \\)"
+msgstr "Ubalanceret ) eller \\)"
+
+#: regcomp.c:621
+msgid "No previous regular expression"
+msgstr "Intet foregående regulært udtryk"
+
+#, fuzzy
+#~ msgid "substr: length %g is < 0"
+#~ msgstr "substr: længden %g er <= 0"
+
+#~ msgid "delete: illegal use of variable `%s' as array"
+#~ msgstr "delete: ikke tilladt brug af variablen \"%s\" som vektor"
+
+#, fuzzy
+#~ msgid "%s: gvar_ref to %s\n"
+#~ msgstr "%s: vektorreference til %s\n"
+
+#~ msgid "asort: first argument is not an array"
+#~ msgstr "asort: første argument er ikke en vektor"
+
+#~ msgid "asort: second argument is not an array"
+#~ msgstr "asort: andet argument er ikke en vektor"
+
+#, fuzzy
+#~ msgid ""
+#~ "attempt to use array parameter `%s' that was passed from global scalar `%"
+#~ "s'"
+#~ msgstr "forsøg på at bruge skalarparameteren \"%s\" som en vektor"
+
+#~ msgid "internal error: Node_var_array with null vname"
+#~ msgstr "intern fejl: Node_var_vektor med null vname"
+
+#~ msgid "BEGIN blocks must have an action part"
+#~ msgstr "BEGIN-blok skal have en handlingsdel"
+
+#~ msgid "`nextfile' used in BEGIN or END action"
+#~ msgstr "\"nextfile\" brugt i BEGIN- eller END-handling"
+
+#~ msgid "gsub third parameter is not a changeable object"
+#~ msgstr "gsub: tredje argument er ikke et ændringsbart objekt"
+
+#~ msgid "or used in other expression context"
+#~ msgstr "eller brugt i andre udtrykssammenhænge"
+
+#~ msgid "attempt to use function `%s' as array"
+#~ msgstr "forsøg på at bruge funktionen \"%s\" som vektor"
+
+#~ msgid "`%s' is a function, assignment is not allowed"
+#~ msgstr "\"%s\" er en funktion, tildeling er ikke tilladt"
+
+#~ msgid "internal error: file `%s', line %d\n"
+#~ msgstr "intern fejl: filen \"%s\", linje %d\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "To report bugs, see node `Bugs' in `gawk.info', which is\n"
+#~ msgstr ""
+#~ "\n"
+#~ "For at rapportere fejl, se knuden \"Bugs\" i \"gawk.info\" som findes i\n"
+
+#~ msgid "invalid syntax in name `%s' for variable assignment"
+#~ msgstr "ugyldig syntaks i navnet \"%s\" for variabeltildeling"
+
+#~ msgid "non-redirected `getline' undefined inside BEGIN or END action"
+#~ msgstr ""
+#~ "ikke-omdirigeret \"getline\" udefineret inde i BEGIN- eller END-handling"
+
+#~ msgid "fptr %x not in tokentab\n"
+#~ msgstr "fptr %x er ikke i tokentab\n"
+
+#~ msgid "Unfinished \\ escape"
+#~ msgstr "Uafsluttet \\-kontrolsekvens"
+
+#~ msgid "unfinished repeat count"
+#~ msgstr "uafsluttet gentagelsesantal"
+
+#~ msgid "malformed repeat count"
+#~ msgstr "fejlagtigt udformet gentagelsesantal"
+
+#~ msgid "Unbalanced ["
+#~ msgstr "Ubalanceret ["
+
+#~ msgid "Unbalanced ("
+#~ msgstr "Ubalanceret ("
+
+#~ msgid "No regexp syntax bits specified"
+#~ msgstr "Ingen syntaksbit for regulære udtryk angivet"
+
+#~ msgid "Unbalanced )"
+#~ msgstr "Ubalanceret )"
+
+#~ msgid "out of memory"
+#~ msgstr "slut på hukommelsen"
diff --git a/gnu/dist/gawk/po/de.gmo b/gnu/dist/gawk/po/de.gmo
new file mode 100644
index 00000000000..667d62d8f44
--- /dev/null
+++ b/gnu/dist/gawk/po/de.gmo
Binary files differ
diff --git a/gnu/dist/gawk/po/de.po b/gnu/dist/gawk/po/de.po
new file mode 100644
index 00000000000..6e288623714
--- /dev/null
+++ b/gnu/dist/gawk/po/de.po
@@ -0,0 +1,1865 @@
+# 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"
+"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
+"POT-Creation-Date: 2003-07-07 11:20-0700\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:112
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr "Versuch den skalaren Parameter '%s' als Array zu benutzen."
+
+#: array.c:113
+#, c-format
+msgid "attempt to use scalar `%s' as array"
+msgstr "Versuch, Skalar '%s' als Array zu verwenden."
+
+#: array.c:151
+#, fuzzy, c-format
+msgid "from %s"
+msgstr "%s (von %s)"
+
+#: array.c:506
+#, c-format
+msgid "reference to uninitialized element `%s[\"%s\"]'"
+msgstr "Bezug auf nicht-initialisiertes Element »%s[\"%s\"]«"
+
+#: array.c:512
+#, c-format
+msgid "subscript of array `%s' is null string"
+msgstr "Index in Array »%s« ist Nullstring."
+
+#: array.c:609
+#, c-format
+msgid "delete: index `%s' not in array `%s'"
+msgstr "delete: Index »%s« nicht in Feld »%s« vorhanden."
+
+#: array.c:769
+#, c-format
+msgid "%s: empty (null)\n"
+msgstr "%s: leer (Null)\n"
+
+#: array.c:774
+#, c-format
+msgid "%s: empty (zero)\n"
+msgstr "%s: leer (0)\n"
+
+#: array.c:778
+#, c-format
+msgid "%s: table_size = %d, array_size = %d\n"
+msgstr "%s: Table_size = %d, array_size = %d\n"
+
+#: array.c:807
+#, fuzzy, c-format
+msgid "%s: is parameter\n"
+msgstr "%s: ist ein Parameter\n"
+
+#: array.c:812
+#, c-format
+msgid "%s: array_ref to %s\n"
+msgstr "%s: Array-Referenz auf %s\n"
+
+#: awkgram.y:208
+#, fuzzy, c-format
+msgid "%s blocks must have an action part"
+msgstr "END-Blöcke müssen einen Aktionsteil haben."
+
+#: awkgram.y:211
+#, fuzzy
+msgid "each rule must have a pattern or an action part"
+msgstr "END-Blöcke müssen einen Aktionsteil haben."
+
+#: awkgram.y:267
+#, 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:314
+#, 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:340 awkgram.y:615
+msgid "statement may have no effect"
+msgstr "Statement möglicherweise ohne Effekt."
+
+#: awkgram.y:435 awkgram.y:455
+#, fuzzy, c-format
+msgid "`%s' used in %s action"
+msgstr "'next' in BEGIN- oder END-Aktion benutzt."
+
+#: awkgram.y:448 awkgram.y:451
+msgid "`nextfile' is a gawk extension"
+msgstr "'nextfile' ist eine gawk-Erweiterung."
+
+#: awkgram.y:465
+msgid "`return' used outside function context"
+msgstr "'return' außerhalb einer Funktion benutzt."
+
+#: awkgram.y:504
+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:517 awkgram.y:524
+msgid "`delete array' is a gawk extension"
+msgstr "'delete array' ist eine gawk-Erweiterung."
+
+#: awkgram.y:532 awkgram.y:539
+#, fuzzy
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "'delete array' ist eine gawk-Erweiterung."
+
+#: awkgram.y:583
+#, c-format
+msgid "duplicate case values in switch body: %s"
+msgstr ""
+
+#: awkgram.y:593
+msgid "Duplicate `default' detected in switch body"
+msgstr ""
+
+#: awkgram.y:681
+msgid "multistage two-way pipelines don't work"
+msgstr "'multistage' Zweiwege-Pipes funktionieren nicht."
+
+#: awkgram.y:772
+msgid "regular expression on right of assignment"
+msgstr "Regulärer Ausdruck auf der rechten Seite einer Zuweisung."
+
+#: awkgram.y:782
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "Regulärer Ausdruck links vom '~'- oder '!~'-Operator."
+
+#: awkgram.y:790
+msgid "regular expression on right of comparison"
+msgstr "Regulärer Ausdruck rechts von einem Vergleich."
+
+#: awkgram.y:857
+msgid "non-redirected `getline' undefined inside END action"
+msgstr ""
+"Nicht-umgelenktes 'getline' ist innerhalb der END-Aktion nicht definiert."
+
+#: awkgram.y:884
+msgid "call of `length' without parentheses is not portable"
+msgstr "Aufruf von 'length' ohne Klammern ist nicht portabel."
+
+#: awkgram.y:887
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "Aufruf von 'length' ohne Klammern ist in POSIX-Mode veraltet."
+
+#: awkgram.y:940
+msgid "use of non-array as array"
+msgstr ""
+
+#: awkgram.y:942
+msgid "invalid subscript expression"
+msgstr "Ungültiger Index-Ausdruck."
+
+#: awkgram.y:1140
+#, fuzzy
+msgid "unexpected newline or end of string"
+msgstr "Unerwartetes Zeilenende"
+
+#: awkgram.y:1235
+msgid "empty program text on command line"
+msgstr "Kein Programmtext auf der Kommandozeile."
+
+#: awkgram.y:1292
+#, c-format
+msgid "can't open source file `%s' for reading (%s)"
+msgstr "Kann Quelldatei '%s' nicht zum Lesen öffnen (%s)."
+
+#: awkgram.y:1327
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "Kann Quelldatei '%s' nicht lesen (%s)."
+
+#: awkgram.y:1335
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "Quelldatei '%s' ist leer."
+
+#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100
+msgid "source file does not end in newline"
+msgstr "Quelldatei hört nicht mit Zeilenende auf."
+
+#: awkgram.y:1601
+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:1621
+msgid "unterminated regexp"
+msgstr "Nicht-beendeter Regulärer Ausdruck"
+
+#: awkgram.y:1624
+msgid "unterminated regexp at end of file"
+msgstr "Nicht-beendeter Regulärer Ausdruck am Dateiende."
+
+#: awkgram.y:1691
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr ""
+"Die Verwendung von '\\#...' zur Fortsetzung von Zeilen ist nicht portabel."
+
+#: awkgram.y:1703
+msgid "backslash not last character on line"
+msgstr "Backslash ist nicht letztes Zeichen auf der Zeile."
+
+#: awkgram.y:1748
+msgid "POSIX does not allow operator `**='"
+msgstr "POSIX erlaubt den Operator '**=' nicht."
+
+#: awkgram.y:1750
+msgid "old awk does not support operator `**='"
+msgstr "Das alte awk erlaubt den Operator '**=' nicht."
+
+#: awkgram.y:1759
+msgid "POSIX does not allow operator `**'"
+msgstr "POSIX erlaubt den Operator '**' nicht."
+
+#: awkgram.y:1761
+msgid "old awk does not support operator `**'"
+msgstr "Das alte awk erlaubt den Operator '**' nicht."
+
+#: awkgram.y:1792
+msgid "operator `^=' is not supported in old awk"
+msgstr "Das alte awk kennt den Operator '^=' nicht."
+
+#: awkgram.y:1800
+msgid "operator `^' is not supported in old awk"
+msgstr "Das alte awk kennt den Operator '^' nicht."
+
+#: awkgram.y:1884 awkgram.y:1901
+msgid "unterminated string"
+msgstr "Nicht-beendeter String"
+
+#: awkgram.y:2061
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "Ungültiges Zeichen '%c' in einem Ausdruck."
+
+#: awkgram.y:2121
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "'%s' ist eine gawk-Erweiterung"
+
+#: awkgram.y:2124
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "'%s' ist eine Erweiterung der Bell Labs."
+
+#: awkgram.y:2127
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "POSIX gestattet '%s' nicht."
+
+#: awkgram.y:2131
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "Das alte awk gestattet '%s' nicht."
+
+#: awkgram.y:2158
+msgid "`goto' considered harmful!\n"
+msgstr "'goto' gilt als schlechter Stil!\n"
+
+#: awkgram.y:2220
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
+msgstr "Unzulässige Argumentzahl %d für %s."
+
+#: awkgram.y:2239 awkgram.y:2242
+msgid "match: third argument is a gawk extension"
+msgstr "match: Das dritte Argument ist eine gawk-Erweiterung."
+
+#: awkgram.y:2255
+#, 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:2258
+#, fuzzy, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "Der dritte Parameter von sub ist ein unveränderliches Objekt."
+
+#: awkgram.y:2285 awkgram.y:2288
+msgid "close: second argument is a gawk extension"
+msgstr "close: Das zweite Argument ist eine gawk-Erweiterung."
+
+#: awkgram.y:2298
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"Fehlerhafte Verwendung von dcgettext(_\"...\"): \n"
+"Entfernen Sie den führenden Unterstrich."
+
+#: awkgram.y:2313
+#, fuzzy
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"Fehlerhafte Verwendung von dcgettext(_\"...\"): \n"
+"Entfernen Sie den führenden Unterstrich."
+
+#: awkgram.y:2384
+#, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "Funktion '%s': Parameter #%d, '%s' wiederholt Parameter #%d."
+
+#: awkgram.y:2417
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "Funktion '%s': Parameter '%s' verdeckt eine globale Variable."
+
+#: awkgram.y:2529
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "Kann '%s' nicht zum Schreiben öffnen (%s)."
+
+#: awkgram.y:2530 profile.c:93
+msgid "sending profile to standard error"
+msgstr "Schicke Profile auf Stadard-Fehlerausgabe."
+
+#: awkgram.y:2562
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: close gescheitert (%s)."
+
+#: awkgram.y:2684
+msgid "shadow_funcs() called twice!"
+msgstr "shadow_funcs() zweimal aufgerufen!"
+
+#: awkgram.y:2711
+msgid "there were shadowed variables."
+msgstr ""
+
+#: awkgram.y:2784
+#, c-format
+msgid "function `%s': can't use function name as parameter name"
+msgstr "Funktion '%s': Kann Funktionsnamen nicht als Parameternamen benutzen."
+
+#: awkgram.y:2794
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "Funktion '%s' ist bereits definiert."
+
+#: awkgram.y:2945 awkgram.y:2951
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "Aufgerufene funktion '%s' ist nirgends definiert."
+
+#: awkgram.y:2954
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "Funktion '%s' wird nirgends aufgerufen."
+
+#: awkgram.y:2981
+#, c-format
+msgid "regexp constant for parameter #%d yields boolean value"
+msgstr ""
+"Konstanter Regulärer Ausdruck für Parameter #%d ergibt einen logischen Wert."
+
+#: awkgram.y:2994
+#, c-format
+msgid ""
+"function `%s' called with space between name and `(',\n"
+"%s"
+msgstr ""
+"Funktion '%s' mit Leerzeichen zwischen Name und '(' aufgerufen, \n"
+"%s"
+
+#: awkgram.y:2996
+#, fuzzy
+msgid "or used as a variable or an array"
+msgstr "Kann Funktion '%s' nicht als Variable oder Array verwenden."
+
+#: builtin.c:137
+#, c-format
+msgid "%s to \"%s\" failed (%s)"
+msgstr "%s to \"%s\" fehlgeschlagen (%s)"
+
+#: builtin.c:138
+msgid "standard output"
+msgstr "Standardausgabe"
+
+#: builtin.c:139
+msgid "reason unknown"
+msgstr "Unbekannte Ursache"
+
+#: builtin.c:152
+msgid "exp: received non-numeric argument"
+msgstr "exp: Argument ist keine Zahl."
+
+#: builtin.c:158
+#, c-format
+msgid "exp: argument %g is out of range"
+msgstr "exp: Argument %g außerhalb des gültigen Zahlenbereichs."
+
+#: builtin.c:216
+#, 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:219
+#, 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:231
+#, 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:325
+msgid "index: received non-string first argument"
+msgstr "index: Erstes Argument ist kein String."
+
+#: builtin.c:327
+msgid "index: received non-string second argument"
+msgstr "index: Zweites Argument ist kein string."
+
+#: builtin.c:437
+msgid "int: received non-numeric argument"
+msgstr "Argument ist keine Zahl."
+
+#: builtin.c:454
+msgid "length: received non-string argument"
+msgstr "length: Argument ist kein String."
+
+#: builtin.c:470
+msgid "log: received non-numeric argument"
+msgstr "log: Argument ist keine Zahl."
+
+#: builtin.c:473
+#, c-format
+msgid "log: received negative argument %g"
+msgstr "log: Negatives Argument %g."
+
+#: builtin.c:635 builtin.c:638
+msgid "must use `count$' on all formats or none"
+msgstr ""
+
+#: builtin.c:740
+msgid "`$' is not permitted in awk formats"
+msgstr "»$« ist in awk-Formaten nicht zulässig."
+
+#: builtin.c:746
+msgid "arg count with `$' must be > 0"
+msgstr "Argumentnummer bei »$« muss > 0 sein."
+
+#: builtin.c:748
+#, fuzzy, c-format
+msgid "arg count %ld greater than total number of supplied arguments"
+msgstr "Argumentnummer %d ist größer als Anzahl angegebener Argumente."
+
+#: builtin.c:750
+msgid "`$' not permitted after period in format"
+msgstr "»$« nach Punkt in Formatangabe nicht zulässig."
+
+#: builtin.c:763
+msgid "no `$' supplied for positional field width or precision"
+msgstr "»$« fehlt in positionsabhängiger Feldbreite oder Genauigkeit."
+
+#
+#: builtin.c:821
+msgid "`l' is meaningless in awk formats; ignored"
+msgstr "»l« ist in awk-Formaten bedeutungslos, ignoriert."
+
+#: builtin.c:825
+msgid "`l' is not permitted in POSIX awk formats"
+msgstr "»l« in POSIX-awk-Formaten nicht zulässig."
+
+#: builtin.c:836
+msgid "`L' is meaningless in awk formats; ignored"
+msgstr "»L« ist in awk-Formaten bedeutungslos, ignoriert."
+
+#: builtin.c:840
+msgid "`L' is not permitted in POSIX awk formats"
+msgstr "»L« in POSIX-awk-Formaten nicht zulässig."
+
+#: builtin.c:851
+msgid "`h' is meaningless in awk formats; ignored"
+msgstr "»h« ist in awk-Formaten bedeutungslos, ignoriert."
+
+#: builtin.c:855
+msgid "`h' is not permitted in POSIX awk formats"
+msgstr "»h« in POSIX-awk-Formaten nicht zulässig.<"
+
+#: builtin.c:1055
+#, c-format
+msgid "[s]printf: value %g is out of range for `%%%c' format"
+msgstr ""
+
+#: builtin.c:1108
+msgid "not enough arguments to satisfy format string"
+msgstr "Nicht genügend Argumente für Formatangabe."
+
+#: builtin.c:1110
+msgid "^ ran out for this one"
+msgstr "^ ran out for this one"
+
+#: builtin.c:1115
+msgid "[s]printf: format specifier does not have control letter"
+msgstr "[s]printf: Format-Specifier hat keinen Controlcode."
+
+#: builtin.c:1118
+msgid "too many arguments supplied for format string"
+msgstr "Zu viele Argumente für Formatstring."
+
+#: builtin.c:1184 builtin.c:1187
+msgid "printf: no arguments"
+msgstr "printf: Keine Argumente"
+
+#: builtin.c:1211
+msgid "sqrt: received non-numeric argument"
+msgstr "sqrt: Argument ist keine Zahl."
+
+#: builtin.c:1215
+#, c-format
+msgid "sqrt: called with negative argument %g"
+msgstr "sqrt: Argument %g ist negativ."
+
+#: builtin.c:1238
+#, c-format
+msgid "substr: start index %g is invalid, using 1"
+msgstr "substr: Start-Index %g ist ungültig, 1 wird benutzt."
+
+#: builtin.c:1243
+#, c-format
+msgid "substr: non-integer start index %g will be truncated"
+msgstr "substr: Start-Wert %g wird abgeschnitten."
+
+#: builtin.c:1262
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 1"
+msgstr "substr: Länge %g ist kleiner oder gleich 0."
+
+#: builtin.c:1264
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 0"
+msgstr "substr: Länge %g ist kleiner oder gleich 0."
+
+#: builtin.c:1271
+#, c-format
+msgid "substr: non-integer length %g will be truncated"
+msgstr "substr: Länge %g wird abgeschnitten."
+
+#: builtin.c:1276
+#, c-format
+msgid "substr: length %g too big for string indexing, truncating to %g"
+msgstr ""
+
+#: builtin.c:1288
+msgid "substr: source string is zero length"
+msgstr "substr: String ist leer."
+
+#: builtin.c:1294
+#, fuzzy, c-format
+msgid "substr: start index %g is past end of string"
+msgstr "substr: Start-Wert %d liegt hinter dem Ende des Strings."
+
+#: builtin.c:1302
+#, fuzzy, c-format
+msgid ""
+"substr: length %g at start index %g exceeds length of first argument (%lu)"
+msgstr ""
+"substr: Länge %d am Start-Wert %d überschreitet Länge des ersten Arguments (%"
+"d)."
+
+#: builtin.c:1337
+#, fuzzy
+msgid "strftime: received non-string first argument"
+msgstr "strftime: Erstes Argument ist kein String."
+
+#: builtin.c:1343
+msgid "strftime: received empty format string"
+msgstr "strftime: Format-String ist leer."
+
+#: builtin.c:1352
+#, fuzzy
+msgid "strftime: received non-numeric second argument"
+msgstr "strftime. Zweites Argument ist keine Zahl."
+
+#: builtin.c:1415
+msgid "mktime: received non-string argument"
+msgstr "mktime: Argument ist kein String."
+
+#: builtin.c:1460
+#, fuzzy
+msgid "system: received non-string argument"
+msgstr "system: Argument ist kein String."
+
+#: builtin.c:1581 eval.c:1883
+#, fuzzy, c-format
+msgid "reference to uninitialized field `$%d'"
+msgstr "Referenz auf die nicht-initialisierte Variable '%s'."
+
+#: builtin.c:1608
+#, fuzzy
+msgid "tolower: received non-string argument"
+msgstr "tolower: Argument ist kein String."
+
+#: builtin.c:1657
+#, fuzzy
+msgid "toupper: received non-string argument"
+msgstr "toupper: Argument ist kein String."
+
+#: builtin.c:1702
+msgid "atan2: received non-numeric first argument"
+msgstr "atan2: Erstes Argument ist keine Zahl."
+
+#: builtin.c:1704
+msgid "atan2: received non-numeric second argument"
+msgstr "atan2: Zweites Argument ist keine Zahl."
+
+#: builtin.c:1723
+msgid "sin: received non-numeric argument"
+msgstr "sin: Argument istk eine Zahl."
+
+#: builtin.c:1739
+msgid "cos: received non-numeric argument"
+msgstr "cos: Argument ist keine Zahl."
+
+#: builtin.c:1788
+msgid "srand: received non-numeric argument"
+msgstr "srand: Argument ist keine Zahl."
+
+#: builtin.c:1823
+msgid "match: third argument is not an array"
+msgstr "match: Drittes Argument ist kein Array."
+
+#: builtin.c:2307
+msgid "gensub: third argument of 0 treated as 1"
+msgstr "gensub: Drittes Argument 0 als 1 interpretiert"
+
+#: builtin.c:2416 builtin.c:2418
+msgid "lshift: received non-numeric first argument"
+msgstr "lshift: Erstes Argument ist keine Zahl."
+
+#: builtin.c:2420
+#, 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:2422
+#, c-format
+msgid "lshift(%lf, %lf): fractional values will be truncated"
+msgstr "lshift(%lf, %lf): Dezimalteil wird abgeschnitten."
+
+#: builtin.c:2424
+#, 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:2453 builtin.c:2455
+msgid "rshift: received non-numeric first argument"
+msgstr "rshift: Erstes Argument ist keine Zahl."
+
+#: builtin.c:2457
+#, 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:2459
+#, c-format
+msgid "rshift(%lf, %lf): fractional values will be truncated"
+msgstr "rshift(%lf, %lf): Dezimalteil wird abgeschnitten."
+
+#: builtin.c:2461
+#, 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:2490 builtin.c:2492
+msgid "and: received non-numeric first argument"
+msgstr "and: Erstes Argument ist keine Zahl."
+
+#: builtin.c:2494
+#, 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:2496
+#, c-format
+msgid "and(%lf, %lf): fractional values will be truncated"
+msgstr "and(%lf, %lf): Dezimalteil wird abgeschnitten."
+
+#: builtin.c:2525 builtin.c:2527
+msgid "or: received non-numeric first argument"
+msgstr "or: Erstes Argument ist keine Zahl."
+
+#: builtin.c:2529
+#, 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:2531
+#, c-format
+msgid "or(%lf, %lf): fractional values will be truncated"
+msgstr "or(%lf, %lf): Dezimalteil wird abgeschnitten."
+
+#: builtin.c:2560 builtin.c:2562
+msgid "xor: received non-numeric first argument"
+msgstr "xor: Erstes Argument ist keine Zahl."
+
+#: builtin.c:2564
+#, 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:2566
+#, c-format
+msgid "xor(%lf, %lf): fractional values will be truncated"
+msgstr "xor(%lf, %lf): Dezimalteil wird abgeschnitten."
+
+#: builtin.c:2594
+msgid "compl: received non-numeric argument"
+msgstr "compl: Erstes Argument ist keine Zahl."
+
+#: builtin.c:2596
+#, c-format
+msgid "compl(%lf): negative value will give strange results"
+msgstr "compl(%lf): Negativer Wert wird merkwürdige Ergebnisse liefern."
+
+#: builtin.c:2598
+#, c-format
+msgid "compl(%lf): fractional value will be truncated"
+msgstr "compl(%lf): Dezimalteil wird abgeschnitten."
+
+#: builtin.c:2771
+#, c-format
+msgid "dcgettext: `%s' is not a valid locale category"
+msgstr "dcgettext: '%s' ist keine gültige Locale-Kategorie."
+
+#: eval.c:266
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "Unbekannter Knotentyp %d"
+
+#: eval.c:312
+msgid "buffer overflow in genflags2str"
+msgstr "Pufferüberlauf in genflags2str."
+
+#: eval.c:647
+#, fuzzy, c-format
+msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
+msgstr ""
+"for-Schleife: Array '%s' ändert Größse von %d zu %d innerhalb der Schleife."
+
+#: eval.c:668
+msgid "`break' outside a loop is not portable"
+msgstr "'break' außerhalb einer Schleife ist nicht portabel."
+
+#: eval.c:672
+msgid "`break' outside a loop is not allowed"
+msgstr "'break' außerhalb einer Schleife ist nicht zulässig."
+
+#: eval.c:689
+msgid "`continue' outside a loop is not portable"
+msgstr "'continue' außerhalb einer Schleife ist nicht portabel."
+
+#: eval.c:693
+msgid "`continue' outside a loop is not allowed"
+msgstr "'continue' außerhalb einer Schleife ist nicht zulässig."
+
+#: eval.c:727
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "'next' kann nicht in einer BEGIN-Regel benutzt werden."
+
+#: eval.c:729
+msgid "`next' cannot be called from an END rule"
+msgstr "'next' kann nicht in einer END-Regel benutzt werden."
+
+#: eval.c:738
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "'nextfile' kann nicht in einer BEGIN-Regel benutzt werden."
+
+#: eval.c:740
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "'nextfile' kann nicht in einer END-Regel benutzt werden."
+
+#: eval.c:785
+msgid "statement has no effect"
+msgstr "Anweisung hat keinen Effekt."
+
+#: eval.c:828 eval.c:1726
+#, 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:835 eval.c:841
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "Referenz auf nicht-initialisiertes Argument '%s'."
+
+#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807
+#, c-format
+msgid "attempt to use array `%s' in a scalar context"
+msgstr "Versuch, das Array '%s' in Skalarkontext zu verwenden."
+
+#: eval.c:858 eval.c:1752
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "Referenz auf die nicht-initialisierte Variable '%s'."
+
+#: eval.c:1007
+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:1032
+msgid "assignment used in conditional context"
+msgstr "Zuweisung in einer Bedingung."
+
+#: eval.c:1122
+msgid "division by zero attempted"
+msgstr "Division durch Null versucht."
+
+#: eval.c:1137
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "Division durch Null versucht in '%%'."
+
+#: eval.c:1152 profile.c:683
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "Illegaler Typ (%s) in tree_eval"
+
+#: eval.c:1328
+msgid "division by zero attempted in `/='"
+msgstr "Division durch Null versucht in '/='."
+
+#: eval.c:1346
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "Division durch Null versucht in '%%='."
+
+#: eval.c:1586
+#, c-format
+msgid "function `%s' called with more arguments than declared"
+msgstr "Funktion '%s' mit zu vielen Argumenten aufgerufen."
+
+#: eval.c:1633
+#, c-format
+msgid "function `%s' not defined"
+msgstr "Funktion '%s' ist nicht definiert."
+
+#: eval.c:1639
+#, c-format
+msgid "function %s called\n"
+msgstr "Funktion %s aufgerufen\n"
+
+#: eval.c:1698
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# Funktion Aufruf-Stack\n"
+"\n"
+
+#: eval.c:1701
+msgid "\t# -- main --\n"
+msgstr "\t# -- main --\n"
+
+#: eval.c:1867
+msgid "attempt to field reference from non-numeric value"
+msgstr "Nicht-numerischer Wert für Feldreferenz verwendet."
+
+#: eval.c:1869
+msgid "attempt to reference from null string"
+msgstr "Referenz von einem Null-String"
+
+#: eval.c:1875
+#, c-format
+msgid "attempt to access field %d"
+msgstr "Versuch des Zugriffs auf Feld %d."
+
+#: eval.c:1896 eval.c:1903 profile.c:900
+msgid "assignment is not allowed to result of builtin function"
+msgstr ""
+"Zuweisungen an das Ergebnis einer eingebauten Funktion sind nicht erlaubt."
+
+#: eval.c:1951
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "'IGNORECASE' ist eine gawk-Erweiterung"
+
+#: eval.c:1980
+msgid "`BINMODE' is a gawk extension"
+msgstr "'BINMODE' ist eine gawk-Erweiterung."
+
+#: eval.c:2092
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "Falsche '%sFMT'-Angabe '%s'"
+
+#: eval.c:2170
+msgid "turning off `--lint' due to assignment to `LINT'"
+msgstr "'--lint' wird abgeschaltet, da 'LINT' gesetzt ist."
+
+#: 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:183
+msgid "Operation Not Supported"
+msgstr "Operation nicht möglich."
+
+#: field.c:315
+msgid "NF set to negative value"
+msgstr ""
+
+#: field.c:808
+msgid "split: second argument is not an array"
+msgstr "split: Zweites Argument ist kein Array."
+
+#: field.c:842
+msgid "split: null string for third arg is a gawk extension"
+msgstr "split: Null-String als drittes Argument ist eine gawk-Erweiterung."
+
+#: field.c:894
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "'FIELDWIDTHS' ist eine gawk-Erweiterung."
+
+#: field.c:921
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "Feld %d in FIELDWIDTHS muss > 0 sein."
+
+#: field.c:994
+msgid "null string for `FS' is a gawk extension"
+msgstr "Null-String für 'FS' ist eine gawk-Erweiterung."
+
+#: 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:434
+#, 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"
+
+#: io.c:305
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "Kann Datei '%s' nicht zum Lesen öffnen (%s)."
+
+#: io.c:392
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "Schließen von Dateideskriptor %d ('%s') gescheitert (%s)."
+
+#: io.c:530
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "Ungültiger Tree-Typ %s in redirect()."
+
+#: io.c:536
+#, c-format
+msgid "expression in `%s' redirection only has numeric value"
+msgstr "Ausdruck in '%s' Umlenkung hat nur einen numerischen Wert."
+
+#: io.c:542
+#, c-format
+msgid "expression for `%s' redirection has null string value"
+msgstr "Ausdruck für '%s' Umlenkung ist ein leerer String."
+
+#: io.c:547
+#, 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:569
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "Unnötige Kombination von '>' und '>>' für Datei '%.*s'."
+
+#: io.c:621
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "Kann Pipe '%s' nicht für Ausgabe öffnen (%s)."
+
+#: io.c:630
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "Kann Pipe '%s' nicht für Eingabe öffnen (%s)."
+
+#: io.c:643
+#, 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:647
+#, 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:723
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "Kann nicht von '%s' umlenken (%s)."
+
+#: io.c:726
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "Kann nicht auf '%s' umlenken (%s)."
+
+#: io.c:765
+msgid ""
+"reached system limit for open files: starting to multiplex file descriptors"
+msgstr ""
+"Systemgrenze offener Dateien erreicht; beginne mit Multiplexing von "
+"Dateideskriptoren."
+
+#: io.c:777
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "Schließen von '%s' gescheitert (%s)."
+
+#: io.c:784
+msgid "too many pipes or input files open"
+msgstr "Zu viele Pipes oder Eingabedateien offen."
+
+#: io.c:807
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: Zweites Argument muss 'to' oder 'from' sein."
+
+#: io.c:821
+#, 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:825
+msgid "close of redirection that was never opened"
+msgstr "'close' für eine Umlenkung, die nie geöffnet wurde."
+
+#: io.c:862
+#, 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:924
+#, c-format
+msgid "failure status (%d) on pipe close of `%s' (%s)"
+msgstr "Fehlerstatus (%d) beim Schließen der Pipe '%s' (%s)."
+
+#: io.c:927
+#, c-format
+msgid "failure status (%d) on file close of `%s' (%s)"
+msgstr "Fehlerstatus (%d) beim Schließen de rDatei '%s' (%s)."
+
+#: io.c:946
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "Das explizite des Sockets '%s' fehlt."
+
+#: io.c:949
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "Das explizite Schließen des Ko-Prozesses '%s' fehlt."
+
+#: io.c:952
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "Das explizite Schließen der Pipe '%s' fehlt."
+
+#: io.c:955
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "Das explizite Schließen der Datei '%s' fehlt."
+
+#: io.c:984 io.c:1038
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "Fehler beim Schreiben auf stdout (%s)."
+
+#: io.c:988 io.c:1042
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "Fehler beim Schreiben auf stderr (%s)."
+
+#: io.c:996
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "Leeren der Pipe '%s' gescheitert (%s)."
+
+#: io.c:999
+#, c-format
+msgid "co-process flush of pipe to `%s' failed (%s)."
+msgstr "Ko-Prozess: Leeren der Pipe zu '%s' gescheitert (%s)."
+
+#: io.c:1002
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "Flush der Datei '%s' gescheitert (%s)."
+
+#: io.c:1161
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "/inet/raw Client noch nicht fertig."
+
+#: io.c:1163 io.c:1200
+msgid "only root may use `/inet/raw'."
+msgstr "Nur root darf '/inet/raw' benutzen"
+
+#: io.c:1198
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "'/inet/raw'-Server noch nicht fertig."
+
+#: io.c:1288
+#, c-format
+msgid "no (known) protocol supplied in special filename `%s'"
+msgstr "Kein bekanntes Protokoll in Dateinamen '%s' angegeben."
+
+#: io.c:1306
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "Dateiname '%s' ist unvollständig."
+
+#: io.c:1318
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "Lokaler Port in '%s' ist ungültig."
+
+#: io.c:1330
+msgid "must supply a remote hostname to `/inet'"
+msgstr "Sie müssen einen Rechnernamen in '/inet' angeben."
+
+#: io.c:1345
+msgid "must supply a remote port to `/inet'"
+msgstr "Sie müssen einen Port in '/inet' angeben."
+
+#: io.c:1351
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "Port-Angabe in '%s' ist ungültig."
+
+#: io.c:1361
+msgid "TCP/IP communications are not supported"
+msgstr "TCP/IP-Verbindungen sind nicht möglich."
+
+#: io.c:1370 io.c:1551
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "Datei '%s' ist ein Verzeichnis."
+
+#: io.c:1440
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "Benutzen Sie 'PROCINFO[\"%s\"]' statt '%s'"
+
+#: io.c:1472
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "Benutzen Sie 'PROCINFO[...] statt '/dev/user'."
+
+#: io.c:1537 io.c:1711
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "Konnte '%s' nicht öffnen, Mode '%s'."
+
+#: io.c:1762
+#, fuzzy, c-format
+msgid "close of master pty failed (%s)"
+msgstr "Schließen der Pipe gescheitert (%s)."
+
+#: io.c:1764 io.c:1916 io.c:2068
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "Schließen von stdout in Kindprozess gescheitert (%s)."
+
+#: io.c:1767
+#, fuzzy, c-format
+msgid "moving slave pty to stdout in child failed (dup: %s)"
+msgstr "Verschieben der Pipe zu stdout in Kindprozess gescheitert (dup: %s)."
+
+#: io.c:1769 io.c:1921
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "Schließen von stdin im Kindprozess gescheitert (%s)."
+
+#: io.c:1772
+#, fuzzy, c-format
+msgid "moving slave pty to stdin in child failed (dup: %s)"
+msgstr "Verschieben der Pipe zu stdin in Kindprozess gescheitert (dup: %s)."
+
+#: io.c:1774 io.c:1793
+#, fuzzy, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "Schließen der Pipe gescheitert (%s)."
+
+#: io.c:1867 io.c:1919 io.c:2049 io.c:2071
+#, 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:1871 io.c:1924
+#, 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:1888 io.c:2062
+msgid "restoring stdout in parent process failed\n"
+msgstr ""
+
+#: io.c:1893
+msgid "restoring stdin in parent process failed\n"
+msgstr ""
+
+#: io.c:1927 io.c:2073 io.c:2084
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "Schließen der Pipe gescheitert (%s)."
+
+#: io.c:1972
+msgid "`|&' not supported"
+msgstr "'|&' nicht möglich."
+
+#: io.c:2039
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "Kann Pipe '%s' nicht öffnen (%s)."
+
+#: io.c:2080
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr "Kann Kindprozess für '%s' nicht erzeugen (fork: %s)."
+
+#: io.c:2423
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "Datei '%s' ist leer."
+
+#: io.c:2466 io.c:2474
+msgid "could not allocate more input memory"
+msgstr ""
+
+#: io.c:2832 io.c:2895
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "Fehler beim Lesen der Eingabedatei '%s': %s."
+
+#: io.c:3020
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "Multicharacter-Wert von 'RS' ist eine gawk-Erweiterung."
+
+#: main.c:324
+msgid "`-m[fr]' option irrelevant in gawk"
+msgstr "Option '-m[fr]' ist in gawk bedeutungslos."
+
+#: main.c:326
+msgid "-m option usage: `-m[fr] nnn'"
+msgstr "Anwendung der Option -m: '-m[fr] nnn'"
+
+#: main.c:343
+#, c-format
+msgid "%s: option `-W %s' unrecognized, ignored\n"
+msgstr "%s: Option '-W %s' unbekannt, ignoriert.\n"
+
+#: main.c:380
+msgid "empty argument to `--source' ignored"
+msgstr "Leeres Argument für '--source' ignoriert."
+
+#: main.c:451
+msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
+msgstr ""
+"Umgebungsvariable 'POSIXLY_CORRECT' ist gesetzt: '--posix' angeschaltet."
+
+#: main.c:456
+msgid "`--posix' overrides `--traditional'"
+msgstr "'--posix' hat Vorrang vor '--traditional'"
+
+#: main.c:467
+msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
+msgstr "'--posix' /'--traditional' hat Vorrang vor '--non-decimal-data'."
+
+#: main.c:471
+#, 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:512
+#, fuzzy, c-format
+msgid "can't set binary mode on stdin (%s)"
+msgstr "Kann Mode für stdin nicht setzen (%s)."
+
+#: main.c:515
+#, fuzzy, c-format
+msgid "can't set binary mode on stdout (%s)"
+msgstr "Kann Mode für stdout nicht setzen (%s)."
+
+#: main.c:517
+#, fuzzy, c-format
+msgid "can't set binary mode on stderr (%s)"
+msgstr "Kann Mode für stderr nicht setzen (%s)."
+
+#: main.c:547
+msgid "no program text at all!"
+msgstr "Kein Programmtext."
+
+#: main.c:620
+#, 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:622
+#, 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:627
+msgid "POSIX options:\t\tGNU long options:\n"
+msgstr "POSIX-Optionen\t\tGNU-Optionen (lang):\n"
+
+#: main.c:628
+msgid "\t-f progfile\t\t--file=progfile\n"
+msgstr "\t-f PROGRAM\t\t--file=PROGRAM\n"
+
+#: main.c:629
+msgid "\t-F fs\t\t\t--field-separator=fs\n"
+msgstr "\t-F Feldtrenner\t\t\t--field-separator=Feldtrenner\n"
+
+#: main.c:630
+msgid "\t-v var=val\t\t--assign=var=val\n"
+msgstr "\t-v var=Wert\t\t--assign=var=Wert\n"
+
+#: main.c:631
+msgid "\t-m[fr] val\n"
+msgstr "\t-m[fr] Wert\n"
+
+#: main.c:632
+msgid "\t-W compat\t\t--compat\n"
+msgstr "\t-W compat\t\t--compat\n"
+
+#: main.c:633
+msgid "\t-W copyleft\t\t--copyleft\n"
+msgstr "\t-W copyleft\t\t--copyleft\n"
+
+#: main.c:634
+msgid "\t-W copyright\t\t--copyright\n"
+msgstr "\t-W copyright\t\t--copyright\n"
+
+#: main.c:635
+msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
+msgstr "\t-W dump-variables[=Datei]\t--dump-variables[=Datei]\n"
+
+#: main.c:636
+msgid "\t-W gen-po\t\t--gen-po\n"
+msgstr "\t-W gen-po\t\t--gen-po\n"
+
+#: main.c:637
+msgid "\t-W help\t\t\t--help\n"
+msgstr "\t-W help\t\t\t--help\n"
+
+#: main.c:638
+msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+
+#: main.c:639
+msgid "\t-W lint-old\t\t--lint-old\n"
+msgstr "\t-W lint-old\t\t--lint-old\n"
+
+#: main.c:640
+msgid "\t-W non-decimal-data\t--non-decimal-data\n"
+msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
+
+#: main.c:642
+msgid "\t-W nostalgia\t\t--nostalgia\n"
+msgstr "\t-W nostalgia\t\t--nostalgia\n"
+
+#: main.c:645
+msgid "\t-W parsedebug\t\t--parsedebug\n"
+msgstr "\t-W parsedebug\t\t--parsedebug\n"
+
+#: main.c:647
+msgid "\t-W profile[=file]\t--profile[=file]\n"
+msgstr "\t-W profile[=Datei]\t--profile[=Datei]\n"
+
+#: main.c:648
+msgid "\t-W posix\t\t--posix\n"
+msgstr "\t-W posix\t\t--posix\n"
+
+#: main.c:649
+msgid "\t-W re-interval\t\t--re-interval\n"
+msgstr "\t-W re-interval\t\t--re-interval\n"
+
+#: main.c:650
+msgid "\t-W source=program-text\t--source=program-text\n"
+msgstr "\t-W source=Programmtext\t--source=Programmtext\n"
+
+#: main.c:651
+msgid "\t-W traditional\t\t--traditional\n"
+msgstr "\t-W traditional\t\t--traditional\n"
+
+#: main.c:652
+msgid "\t-W usage\t\t--usage\n"
+msgstr "\t-W usage\t\t--usage\n"
+
+#: main.c:653
+msgid "\t-W version\t\t--version\n"
+msgstr "\t-W version\t\t--version\n"
+
+#: main.c:657
+#, 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:661
+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:665
+msgid ""
+"Examples:\n"
+"\tgawk '{ sum += $1 }; END { print sum }' file\n"
+"\tgawk -F: '{ print $1 }' /etc/passwd\n"
+msgstr ""
+
+#: main.c:682
+#, 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:690
+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:696
+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:730
+msgid "-Ft does not set FS to tab in POSIX awk"
+msgstr "-Ft setzt FS im POSIX-awk nicht auf Tab."
+
+#: main.c:956
+#, c-format
+msgid ""
+"%s: `%s' argument to `-v' not in `var=value' form\n"
+"\n"
+msgstr ""
+
+#: main.c:976
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr ""
+
+#: main.c:979
+#, c-format
+msgid "`%s' is not a variable name, looking for file `%s=%s'"
+msgstr ""
+
+#: main.c:1012
+msgid "floating point exception"
+msgstr "Floating point exception"
+
+#: main.c:1019
+msgid "fatal error: internal error"
+msgstr "Fataler Fehler: interner Fehler"
+
+#: main.c:1069
+#, c-format
+msgid "no pre-opened fd %d"
+msgstr "Kein geöffneter Dateideskriptor %d"
+
+#: main.c:1074
+#, c-format
+msgid "could not pre-open /dev/null for fd %d"
+msgstr "Konnte /dev/null nicht für Dateideskriptor %d öffnen."
+
+#: main.c:1097 main.c:1106
+#, c-format
+msgid "could not find groups: %s"
+msgstr "Konnte Gruppen nicht finden: %s"
+
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "Kommandozeile:"
+
+#: msg.c:120
+msgid "warning: "
+msgstr "Warnung: "
+
+#: msg.c:142
+msgid "error: "
+msgstr "Fehler: "
+
+#: msg.c:178
+msgid "fatal: "
+msgstr "Fatal: "
+
+#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115
+msgid "can't convert string to float"
+msgstr "Kann String nicht in Gleitkommazahl konvertieren."
+
+#: node.c:355
+msgid "backslash at end of string"
+msgstr "Backslash am String-Ende."
+
+#: node.c:539
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX erlabut keine '\\x'-Escapes."
+
+#: node.c:545
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "Keine Hex-Ziffern in '\\x'-Escape."
+
+#: node.c:579
+#, c-format
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr "Escape-Sequenz '\\%c' als '%c' behandelt."
+
+#: posix/gawkmisc.c:172
+#, 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"
+
+#: profile.c:91
+#, c-format
+msgid "could not open `%s' for writing: %s"
+msgstr "Konnte '%s' nicht zum Schreiben öffnen: %s"
+
+#: profile.c:449
+#, fuzzy, c-format
+msgid "internal error: %s with null vname"
+msgstr "Interner Fehler: Node_var with null vname."
+
+#: profile.c:512
+msgid "# treated internally as `delete'"
+msgstr ""
+
+#: profile.c:1162
+#, c-format
+msgid "\t# gawk profile, created %s\n"
+msgstr "\t# gawk-Profil, erzeugt %s\n"
+
+#: profile.c:1165
+msgid ""
+"\t# BEGIN block(s)\n"
+"\n"
+msgstr ""
+"\t# BEGIN block(s)\n"
+"\n"
+
+#: profile.c:1175
+msgid ""
+"\t# Rule(s)\n"
+"\n"
+msgstr ""
+"\t# Rule(s)\n"
+"\n"
+
+#: profile.c:1181
+msgid ""
+"\t# END block(s)\n"
+"\n"
+msgstr ""
+"\t# END block(s)\n"
+"\n"
+
+#: profile.c:1201
+msgid ""
+"\n"
+"\t# Functions, listed alphabetically\n"
+msgstr ""
+"\n"
+"\t# Functionen, alphabetisch sortiert\n"
+
+#: profile.c:1413
+#, c-format
+msgid "unexpected type %s in prec_level"
+msgstr "Unerwarteter Typ %s in prec_level."
+
+#: re.c:193
+#, c-format
+msgid "regex match failed, not enough memory to match string \"%.*s%s\""
+msgstr ""
+
+#: regcomp.c:136
+msgid "Success"
+msgstr "Erfolg"
+
+#: regcomp.c:139
+msgid "No match"
+msgstr "Kein Treffer"
+
+#: regcomp.c:142
+msgid "Invalid regular expression"
+msgstr "Ungültiger Regulärer Ausdruck."
+
+#: regcomp.c:145
+msgid "Invalid collation character"
+msgstr "Ungültiges Zeichen."
+
+#: regcomp.c:148
+msgid "Invalid character class name"
+msgstr "Ungültier Name für Zeichenklasse."
+
+#: regcomp.c:151
+msgid "Trailing backslash"
+msgstr "Angehängter Backslash"
+
+#: regcomp.c:154
+msgid "Invalid back reference"
+msgstr "Ungültige Referenze"
+
+#: regcomp.c:157
+msgid "Unmatched [ or [^"
+msgstr "[ oder [^ nicht geschlossen"
+
+#: regcomp.c:160
+msgid "Unmatched ( or \\("
+msgstr "( oder \\( nicht geschlossen"
+
+#: regcomp.c:163
+msgid "Unmatched \\{"
+msgstr "\\{ nicht geschlossen"
+
+#: regcomp.c:166
+msgid "Invalid content of \\{\\}"
+msgstr "Ungültiger Inhalt von \\{\\}"
+
+#: regcomp.c:169
+msgid "Invalid range end"
+msgstr "Ungültiges Bereichsende"
+
+#: regcomp.c:172
+msgid "Memory exhausted"
+msgstr "Kein Speicher mehr."
+
+#: regcomp.c:175
+msgid "Invalid preceding regular expression"
+msgstr "Vorangehender Regulärer Ausdruck ist ungültig."
+
+#: regcomp.c:178
+msgid "Premature end of regular expression"
+msgstr "Vorzeitiges Ende des Regulären Ausdrucks."
+
+#: regcomp.c:181
+msgid "Regular expression too big"
+msgstr "Regulärer Ausdruck zu groß."
+
+#: regcomp.c:184
+msgid "Unmatched ) or \\)"
+msgstr ") oder \\) nicht geöffnet"
+
+#: regcomp.c:621
+msgid "No previous regular expression"
+msgstr "Kein vorangehender Regulärer Ausdruck."
+
+#, fuzzy
+#~ msgid "substr: length %g is < 0"
+#~ msgstr "substr: Länge %g ist kleiner oder gleich 0."
+
+#~ msgid "delete: illegal use of variable `%s' as array"
+#~ msgstr "delete: Benutzung der Variablen »%s« als Array ist nicht zulässig."
+
+#, fuzzy
+#~ msgid "%s: gvar_ref to %s\n"
+#~ msgstr "%s: Array-Referenz auf %s\n"
+
+#~ msgid "asort: first argument is not an array"
+#~ msgstr "asort: Erstes Argument ist kein Array."
+
+#~ msgid "asort: second argument is not an array"
+#~ msgstr "asort: Zweites Argument ist kein array."
+
+#, fuzzy
+#~ msgid ""
+#~ "attempt to use array parameter `%s' that was passed from global scalar `%"
+#~ "s'"
+#~ msgstr "Versuch den skalaren Parameter '%s' als Array zu benutzen."
+
+#~ msgid "internal error: Node_var_array with null vname"
+#~ msgstr "Interner Fehler: Node_var_array with null vname."
+
+#~ msgid "BEGIN blocks must have an action part"
+#~ msgstr "BEGIN-Blöcke müssen einen Aktionsteil haben."
+
+#~ msgid "`nextfile' used in BEGIN or END action"
+#~ msgstr "'nextfile' in BEGIN- oder END-Aktion benutzt."
+
+#~ msgid "gsub third parameter is not a changeable object"
+#~ msgstr "Der dritte Parameter von gsub ist ein unveränderliches Objekt."
+
+#~ msgid "or used in other expression context"
+#~ msgstr "or in anderem Kontext benutzt"
+
+#~ msgid "attempt to use function `%s' as array"
+#~ msgstr "Versuch, die Funktion '%s' als Array zu verwenden."
+
+#~ msgid "`%s' is a function, assignment is not allowed"
+#~ msgstr "'%s' ist eine Funktion, Zuweisungen sind nicht erlaubt."
+
+#~ msgid "internal error: file `%s', line %d\n"
+#~ msgstr "Interner Fehler: Datei '%s', Zeile %d\n"
+
+#~ msgid "non-redirected `getline' undefined inside BEGIN or END action"
+#~ msgstr ""
+#~ "Nicht-umgelenktes 'getline' ist innerhalb der BEGIN- und END-Aktion nicht "
+#~ "definiert."
+
+#~ msgid "fptr %x not in tokentab\n"
+#~ msgstr "fptr %x nicht in tokentab\n"
+
+#~ msgid "Unbalanced ["
+#~ msgstr "[ wird nicht geschlossen."
+
+#~ msgid "Unfinished \\ escape"
+#~ msgstr "Nicht-beendetes \\\\-Escape."
+
+#~ msgid "unfinished repeat count"
+#~ msgstr "Nicht-beendeter Wiederholungszähler."
+
+#~ msgid "malformed repeat count"
+#~ msgstr "Fehlerhafter Wiederholungszähler."
+
+#~ msgid "Unbalanced ("
+#~ msgstr "( wird nicht geschlossen."
+
+#~ msgid "No regexp syntax bits specified"
+#~ msgstr "Kein Regulärer Ausdruck angegeben."
+
+#~ msgid "Unbalanced )"
+#~ msgstr ") wird nicht geöffnet."
+
+#~ msgid "out of memory"
+#~ msgstr "Kein Speicher mehr."
+
+#~ msgid "invalid syntax in name `%s' for variable assignment"
+#~ msgstr "Ungültige Syntax im Namen '%s' für Variablenzuweisung."
+
+#~ 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/gnu/dist/gawk/po/en@boldquot.header b/gnu/dist/gawk/po/en@boldquot.header
new file mode 100644
index 00000000000..fedb6a06d12
--- /dev/null
+++ b/gnu/dist/gawk/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/gnu/dist/gawk/po/en@quot.header b/gnu/dist/gawk/po/en@quot.header
new file mode 100644
index 00000000000..a9647fc35c3
--- /dev/null
+++ b/gnu/dist/gawk/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/gnu/dist/gawk/po/es.gmo b/gnu/dist/gawk/po/es.gmo
new file mode 100644
index 00000000000..afc22a4654d
--- /dev/null
+++ b/gnu/dist/gawk/po/es.gmo
Binary files differ
diff --git a/gnu/dist/gawk/po/es.po b/gnu/dist/gawk/po/es.po
new file mode 100644
index 00000000000..585b8cb8c6c
--- /dev/null
+++ b/gnu/dist/gawk/po/es.po
@@ -0,0 +1,1872 @@
+# Mensajes en español para gawk-3.1.2g.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+# Cristian Othón Martínez Vera <cfuga@itam.mx>, 2001, 2002, 2003.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gawk 3.1.2g\n"
+"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
+"POT-Creation-Date: 2003-07-07 11:20-0700\n"
+"PO-Revision-Date: 2003-06-29 14:53-0500\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:112
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr "se intentó usar el parámetro escalar `%s como una matriz'"
+
+#: array.c:113
+#, c-format
+msgid "attempt to use scalar `%s' as array"
+msgstr "se intentó usar el dato escalar `%s' como una matriz"
+
+#: array.c:151
+#, c-format
+msgid "from %s"
+msgstr "desde %s"
+
+#: array.c:506
+#, c-format
+msgid "reference to uninitialized element `%s[\"%s\"]'"
+msgstr "referencia al elemento sin valor inicial `%s[\"%s\"]'"
+
+#: array.c:512
+#, c-format
+msgid "subscript of array `%s' is null string"
+msgstr "el subíndice de la matriz `%s' es la cadena nula"
+
+#: array.c:609
+#, c-format
+msgid "delete: index `%s' not in array `%s'"
+msgstr "delete: el índice `%s' no está en la matriz `%s'"
+
+#: array.c:769
+#, c-format
+msgid "%s: empty (null)\n"
+msgstr "%s: vacío (nulo)\n"
+
+#: array.c:774
+#, c-format
+msgid "%s: empty (zero)\n"
+msgstr "%s: vacío (cero)\n"
+
+#: array.c:778
+#, c-format
+msgid "%s: table_size = %d, array_size = %d\n"
+msgstr "%s: tamaño_tabla = %d, tamaño_matriz = %d\n"
+
+#: array.c:807
+#, c-format
+msgid "%s: is parameter\n"
+msgstr "%s: es un parámetro\n"
+
+#: array.c:812
+#, c-format
+msgid "%s: array_ref to %s\n"
+msgstr "%s: array_ref a %s\n"
+
+#: awkgram.y:208
+#, c-format
+msgid "%s blocks must have an action part"
+msgstr "Los bloques %s deben tener una parte de acción"
+
+#: awkgram.y:211
+msgid "each rule must have a pattern or an action part"
+msgstr "cada regla debe tener un patrón o una parte de acción"
+
+#: awkgram.y:267
+#, c-format
+msgid "`%s' is a built-in function, it cannot be redefined"
+msgstr "`%s' es una función interna, no se puede redefinir"
+
+#: awkgram.y:314
+#, 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:340 awkgram.y:615
+msgid "statement may have no effect"
+msgstr "la sentencia puede no tener efecto"
+
+#: awkgram.y:435 awkgram.y:455
+#, c-format
+msgid "`%s' used in %s action"
+msgstr "se usó `%s' en la acción %s"
+
+#: awkgram.y:448 awkgram.y:451
+msgid "`nextfile' is a gawk extension"
+msgstr "`nextfile' es una extensión de gawk"
+
+#: awkgram.y:465
+msgid "`return' used outside function context"
+msgstr "se usó `return' fuera del contexto de la función"
+
+#: awkgram.y:504
+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:517 awkgram.y:524
+msgid "`delete array' is a gawk extension"
+msgstr "`delete array' es una extensión de gawk"
+
+#: awkgram.y:532 awkgram.y:539
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "`delete(array)' es una extensión de gawk que no es transportable"
+
+#: awkgram.y:583
+#, c-format
+msgid "duplicate case values in switch body: %s"
+msgstr "valores case duplicados en el cuerpo de un switch: %s"
+
+#: awkgram.y:593
+msgid "Duplicate `default' detected in switch body"
+msgstr "Se detectó un `default' duplicado en el cuerpo de un switch"
+
+#: awkgram.y:681
+msgid "multistage two-way pipelines don't work"
+msgstr "las líneas de trabajo de dos vías multiestado no funcionan"
+
+#: awkgram.y:772
+msgid "regular expression on right of assignment"
+msgstr "expresión regular del lado derecho de una asignación"
+
+#: awkgram.y:782
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "expresión regular a la izquierda del operador `~' o `!~'"
+
+#: awkgram.y:790
+msgid "regular expression on right of comparison"
+msgstr "expresión regular a la derecha de una comparación"
+
+#: awkgram.y:857
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "`getline' no redirigido indefinido dentro de la acción de END"
+
+#: awkgram.y:884
+msgid "call of `length' without parentheses is not portable"
+msgstr "la llamada de `length' sin paréntesis no es transportable"
+
+#: awkgram.y:887
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "la llamada de `length' sin paréntesis está obsoleta por POSIX"
+
+#: awkgram.y:940
+msgid "use of non-array as array"
+msgstr "uso de una matriz que no es matriz"
+
+#: awkgram.y:942
+msgid "invalid subscript expression"
+msgstr "expresión de subíndice inválida"
+
+#: awkgram.y:1140
+msgid "unexpected newline or end of string"
+msgstr "nueva línea o fin de la cadena inesperados"
+
+#: awkgram.y:1235
+msgid "empty program text on command line"
+msgstr "texto de programa vacío en la linea de comando"
+
+#: awkgram.y:1292
+#, 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:1327
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "no se puede leer el fichero fuente `%s' (%s)"
+
+#: awkgram.y:1335
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "el fichero fuente `%s' está vacío"
+
+#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100
+msgid "source file does not end in newline"
+msgstr "el fichero fuente no termina con línea nueva"
+
+#: awkgram.y:1601
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr "expresión regular sin terminar termina con `\\` al final del fichero"
+
+#: awkgram.y:1621
+msgid "unterminated regexp"
+msgstr "expresión regular sin terminar"
+
+#: awkgram.y:1624
+msgid "unterminated regexp at end of file"
+msgstr "expresión regular sin terminar al final del fichero"
+
+#: awkgram.y:1691
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr "el uso de la continuación de línea `\\ #...' no es transportable"
+
+#: awkgram.y:1703
+msgid "backslash not last character on line"
+msgstr "la barra invertida no es el último caracter en la línea"
+
+#: awkgram.y:1748
+msgid "POSIX does not allow operator `**='"
+msgstr "POSIX no permite el operador `**='"
+
+#: awkgram.y:1750
+msgid "old awk does not support operator `**='"
+msgstr "el awk antiguo no da soporte al operador `**='"
+
+#: awkgram.y:1759
+msgid "POSIX does not allow operator `**'"
+msgstr "POSIX no permite el operador `**'"
+
+#: awkgram.y:1761
+msgid "old awk does not support operator `**'"
+msgstr "el awk antiguo no da soporte al operador `**='"
+
+#: awkgram.y:1792
+msgid "operator `^=' is not supported in old awk"
+msgstr "el operador `^=' no tiene soporte en el awk antiguo"
+
+#: awkgram.y:1800
+msgid "operator `^' is not supported in old awk"
+msgstr "el operador `^' no tiene soporte en el awk antiguo"
+
+#: awkgram.y:1884 awkgram.y:1901
+msgid "unterminated string"
+msgstr "cadena sin terminar"
+
+#: awkgram.y:2061
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "caracter '%c' inválido en la expresión"
+
+#: awkgram.y:2121
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "`%s' es una extensión de gawk"
+
+#: awkgram.y:2124
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "`%s' es una extensión de Bell Labs"
+
+#: awkgram.y:2127
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "POSIX no permite `%s'"
+
+#: awkgram.y:2131
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "`%s' no tiene soporte en el awk antiguo"
+
+#: awkgram.y:2158
+msgid "`goto' considered harmful!\n"
+msgstr "¡`goto' se considera dañino!\n"
+
+#: awkgram.y:2220
+#, 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:2239 awkgram.y:2242
+msgid "match: third argument is a gawk extension"
+msgstr "match: el tercer argumento es una extensión de gawk"
+
+#: awkgram.y:2255
+#, 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:2258
+#, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "el tercer argumento de %s no es un objecto que se puede cambiar"
+
+#: awkgram.y:2285 awkgram.y:2288
+msgid "close: second argument is a gawk extension"
+msgstr "close: el segundo argumento es una extensión de gawk"
+
+#: awkgram.y:2298
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"el uso de dcgettext(_\"...\") es incorrecto: quite el subrayado inicial"
+
+#: awkgram.y:2313
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"el uso de dcngettext(_\"...\") es incorrecto: quite el subrayado inicial"
+
+#: awkgram.y:2384
+#, 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:2417
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "función `%s': parámetro `%s' obscurece la variable global"
+
+#: awkgram.y:2529
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "no se puede abrir `%s' para escritura (%s)"
+
+#: awkgram.y:2530 profile.c:93
+msgid "sending profile to standard error"
+msgstr "enviando perfil a la salida estándar de error"
+
+#: awkgram.y:2562
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: falló close (%s)"
+
+#: awkgram.y:2684
+msgid "shadow_funcs() called twice!"
+msgstr "¡shadow_funcs() llamada dos veces!"
+
+#: awkgram.y:2711
+msgid "there were shadowed variables."
+msgstr "hay variables opacadas."
+
+#: awkgram.y:2784
+#, 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:2794
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "el nombre de función `%s' se definió previamente"
+
+#: awkgram.y:2945 awkgram.y:2951
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "se llamó a la función `%s' pero nunca se definió"
+
+#: awkgram.y:2954
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "la función `%s' está definida pero nunca se llamó"
+
+#: awkgram.y:2981
+#, 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"
+
+#: awkgram.y:2994
+#, 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"
+
+#: awkgram.y:2996
+msgid "or used as a variable or an array"
+msgstr "o se usó como una variable o una matriz"
+
+#: builtin.c:137
+#, c-format
+msgid "%s to \"%s\" failed (%s)"
+msgstr "falló %s a \"%s\" (%s)"
+
+#: builtin.c:138
+msgid "standard output"
+msgstr "salida estándar"
+
+#: builtin.c:139
+msgid "reason unknown"
+msgstr "razón desconocida"
+
+#: builtin.c:152
+msgid "exp: received non-numeric argument"
+msgstr "exp: se recibió un argumento que no es un número"
+
+#: builtin.c:158
+#, c-format
+msgid "exp: argument %g is out of range"
+msgstr "exp: el argumento %g está fuera de rango"
+
+#: builtin.c:216
+#, 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:219
+#, 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:231
+#, 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:325
+msgid "index: received non-string first argument"
+msgstr "index: el primer argumento recibido no es una cadena"
+
+#: builtin.c:327
+msgid "index: received non-string second argument"
+msgstr "index: el segundo argumento recibido no es una cadena"
+
+#: builtin.c:437
+msgid "int: received non-numeric argument"
+msgstr "int: se recibió un argumento que no es un número"
+
+#: builtin.c:454
+msgid "length: received non-string argument"
+msgstr "length: se recibió un argumento que no es una cadena"
+
+#: builtin.c:470
+msgid "log: received non-numeric argument"
+msgstr "log: se recibió un argumento que no es un número"
+
+#: builtin.c:473
+#, c-format
+msgid "log: received negative argument %g"
+msgstr "log: se recibió el argumento negativo %g"
+
+#: builtin.c:635 builtin.c:638
+msgid "must use `count$' on all formats or none"
+msgstr "se debe utilizar `count$' en todos los formatos o en ninguno"
+
+#: builtin.c:740
+msgid "`$' is not permitted in awk formats"
+msgstr "no se permite `$' en los formatos de awk"
+
+#: builtin.c:746
+msgid "arg count with `$' must be > 0"
+msgstr "la cuenta de argumentos con `$' debe ser > 0"
+
+#: builtin.c:748
+#, c-format
+msgid "arg count %ld greater than total number of supplied arguments"
+msgstr ""
+"la cuenta de argumentos %ld es mayor que el número total de argumentos "
+"proporcionados"
+
+#: builtin.c:750
+msgid "`$' not permitted after period in format"
+msgstr "no se permite `$' después de un punto en el formato"
+
+#: builtin.c:763
+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:821
+msgid "`l' is meaningless in awk formats; ignored"
+msgstr "`l' no tiene significado en los formatos de awk; ignorado"
+
+#: builtin.c:825
+msgid "`l' is not permitted in POSIX awk formats"
+msgstr "no se permite `l' en los formatos POSIX de awk"
+
+#: builtin.c:836
+msgid "`L' is meaningless in awk formats; ignored"
+msgstr "`L' no tiene significado en los formatos de awk; ignorado"
+
+#: builtin.c:840
+msgid "`L' is not permitted in POSIX awk formats"
+msgstr "no se permite `L' en los formatos POSIX de awk"
+
+#: builtin.c:851
+msgid "`h' is meaningless in awk formats; ignored"
+msgstr "`h' no tiene significado en los formatos de awk; ignorado"
+
+#: builtin.c:855
+msgid "`h' is not permitted in POSIX awk formats"
+msgstr "no se permite `h' en los formatos POSIX de awk"
+
+#: builtin.c:1055
+#, c-format
+msgid "[s]printf: value %g is out of range for `%%%c' format"
+msgstr "[s]printf: el valor %g está fuera del rango del formato `%%%c'"
+
+#: builtin.c:1108
+msgid "not enough arguments to satisfy format string"
+msgstr "no hay suficientes argumentos para satisfacer a la cadena de formato"
+
+#: builtin.c:1110
+msgid "^ ran out for this one"
+msgstr "se acabó ^ para éste"
+
+#: builtin.c:1115
+msgid "[s]printf: format specifier does not have control letter"
+msgstr "[s]printf: el especificador de formato no tiene letras de control"
+
+#: builtin.c:1118
+msgid "too many arguments supplied for format string"
+msgstr "se proporcionaron demasiados argumentos para la cadena de formato"
+
+#: builtin.c:1184 builtin.c:1187
+msgid "printf: no arguments"
+msgstr "printf: sin argumentos"
+
+#: builtin.c:1211
+msgid "sqrt: received non-numeric argument"
+msgstr "sqrt: se recibió un argumento que no es un número"
+
+#: builtin.c:1215
+#, c-format
+msgid "sqrt: called with negative argument %g"
+msgstr "sqrt: llamado con el argumento negativo %g"
+
+#: builtin.c:1238
+#, 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:1243
+#, 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:1262
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 1"
+msgstr "substr: la longitud %g es <= 0"
+
+#: builtin.c:1264
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 0"
+msgstr "substr: la longitud %g es <= 0"
+
+#: builtin.c:1271
+#, c-format
+msgid "substr: non-integer length %g will be truncated"
+msgstr "substr: la longitud no entera %g será truncada"
+
+#: builtin.c:1276
+#, c-format
+msgid "substr: length %g too big for string indexing, truncating to %g"
+msgstr ""
+"substr: la longitud %g es demasiado grande para ser índice de cadena, se "
+"trunca a %g"
+
+#: builtin.c:1288
+msgid "substr: source string is zero length"
+msgstr "substr: la cadena de origen es de longitud cero"
+
+#: builtin.c:1294
+#, c-format
+msgid "substr: start index %g is past end of string"
+msgstr "substr: el índice de inicio %g está después del fin de la cadena"
+
+#: builtin.c:1302
+#, c-format
+msgid ""
+"substr: length %g at start index %g exceeds length of first argument (%lu)"
+msgstr ""
+"substr: la cadena %g en el índice de inicio %g excede la longitud del primer "
+"argumento (%lu)"
+
+#: builtin.c:1337
+msgid "strftime: received non-string first argument"
+msgstr "strftime: el primer argumento que se recibió no es una cadena"
+
+#: builtin.c:1343
+msgid "strftime: received empty format string"
+msgstr "strftime: se recibió una cadena de formato vacía"
+
+#: builtin.c:1352
+msgid "strftime: received non-numeric second argument"
+msgstr "strftime: el segundo argumento que se recibió no es un número"
+
+#: builtin.c:1415
+msgid "mktime: received non-string argument"
+msgstr "mktime: se recibió un argumento que no es una cadena"
+
+#: builtin.c:1460
+msgid "system: received non-string argument"
+msgstr "system: se recibió un argumento que no es una cadena"
+
+#: builtin.c:1581 eval.c:1883
+#, c-format
+msgid "reference to uninitialized field `$%d'"
+msgstr "referencia al campo sin inicializar `$%d'"
+
+#: builtin.c:1608
+msgid "tolower: received non-string argument"
+msgstr "tolower: se recibió un argumento que no es una cadena"
+
+#: builtin.c:1657
+msgid "toupper: received non-string argument"
+msgstr "toupper: se recibió un argumento que no es una cadena"
+
+#: builtin.c:1702
+msgid "atan2: received non-numeric first argument"
+msgstr "atan2: el primer argumento recibido no es un número"
+
+#: builtin.c:1704
+msgid "atan2: received non-numeric second argument"
+msgstr "atan2: el segundo argumento recibido no es un número"
+
+#: builtin.c:1723
+msgid "sin: received non-numeric argument"
+msgstr "sin: se recibió un argumento que no es un número"
+
+#: builtin.c:1739
+msgid "cos: received non-numeric argument"
+msgstr "cos: se recibió un argumento que no es un número"
+
+#: builtin.c:1788
+msgid "srand: received non-numeric argument"
+msgstr "srand: se recibió un argumento que no es un número"
+
+#: builtin.c:1823
+msgid "match: third argument is not an array"
+msgstr "match: el tercer argumento no es una matriz"
+
+#: builtin.c:2307
+msgid "gensub: third argument of 0 treated as 1"
+msgstr "gensub: el tercer argumento de 0 se trata como 1"
+
+#: builtin.c:2416 builtin.c:2418
+msgid "lshift: received non-numeric first argument"
+msgstr "lshift: el primer argumento recibido no es un número"
+
+#: builtin.c:2420
+#, 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:2422
+#, c-format
+msgid "lshift(%lf, %lf): fractional values will be truncated"
+msgstr "lshift(%lf, %lf): los valores fraccionarios serán truncados"
+
+#: builtin.c:2424
+#, 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:2453 builtin.c:2455
+msgid "rshift: received non-numeric first argument"
+msgstr "rshift: el primer argumento recibido no es un número"
+
+#: builtin.c:2457
+#, 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:2459
+#, c-format
+msgid "rshift(%lf, %lf): fractional values will be truncated"
+msgstr "rshift(%lf, %lf): los valores fraccionarios serán truncados"
+
+#: builtin.c:2461
+#, 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:2490 builtin.c:2492
+msgid "and: received non-numeric first argument"
+msgstr "and: el primer argumento recibido no es un número"
+
+#: builtin.c:2494
+#, 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:2496
+#, c-format
+msgid "and(%lf, %lf): fractional values will be truncated"
+msgstr "and(%lf, %lf): los valores fraccionarios serán truncados"
+
+#: builtin.c:2525 builtin.c:2527
+msgid "or: received non-numeric first argument"
+msgstr "or: el primer argumento recibido no es un número"
+
+#: builtin.c:2529
+#, 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:2531
+#, c-format
+msgid "or(%lf, %lf): fractional values will be truncated"
+msgstr "or(%lf, %lf): los valores fraccionarios serán truncados"
+
+#: builtin.c:2560 builtin.c:2562
+msgid "xor: received non-numeric first argument"
+msgstr "xor: el primer argumento recibido no es un número"
+
+#: builtin.c:2564
+#, 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:2566
+#, c-format
+msgid "xor(%lf, %lf): fractional values will be truncated"
+msgstr "xor(%lf, %lf): los valores fraccionarios serán truncados"
+
+#: builtin.c:2594
+msgid "compl: received non-numeric argument"
+msgstr "compl: se recibió un argumento que no es un número"
+
+#: builtin.c:2596
+#, c-format
+msgid "compl(%lf): negative value will give strange results"
+msgstr "compl(%lf): el valor negativo dará resultados extraños"
+
+#: builtin.c:2598
+#, c-format
+msgid "compl(%lf): fractional value will be truncated"
+msgstr "compl(%lf): el valor fraccionario será truncado"
+
+#: builtin.c:2771
+#, c-format
+msgid "dcgettext: `%s' is not a valid locale category"
+msgstr "dcgettext: `%s' no es una categoría local válida"
+
+#: eval.c:266
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "tipo de nodo %d desconocido"
+
+#: eval.c:312
+msgid "buffer overflow in genflags2str"
+msgstr "desbordamiento de almacenamiento temporal en genflags2str"
+
+#: eval.c:647
+#, c-format
+msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
+msgstr ""
+"ciclo for: la matriz `%s' cambió de tamaño de %ld a %ld durante la ejecución "
+"del ciclo"
+
+#: eval.c:668
+msgid "`break' outside a loop is not portable"
+msgstr "`break' fuera de un ciclo no es transportable"
+
+#: eval.c:672
+msgid "`break' outside a loop is not allowed"
+msgstr "no se permite `break' fuera de un ciclo"
+
+#: eval.c:689
+msgid "`continue' outside a loop is not portable"
+msgstr "`continue' fuera de un ciclo no es transportable"
+
+#: eval.c:693
+msgid "`continue' outside a loop is not allowed"
+msgstr "no se permite `continue' fuera de un ciclo"
+
+#: eval.c:727
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "`next' no se puede llamar desde una regla BEGIN"
+
+#: eval.c:729
+msgid "`next' cannot be called from an END rule"
+msgstr "`next' no se puede llamar desde una regla END"
+
+#: eval.c:738
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "`nextfile' no se puede llamar desde una regla BEGIN"
+
+#: eval.c:740
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "`nextfile' no se puede llamar desde una regla END"
+
+#: eval.c:785
+msgid "statement has no effect"
+msgstr "la sentencia no tiene efecto"
+
+#: eval.c:828 eval.c:1726
+#, 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:835 eval.c:841
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "referencia al argumento sin inicializar `%s'"
+
+#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807
+#, c-format
+msgid "attempt to use array `%s' in a scalar context"
+msgstr "se intentó usar la matriz `%s' en un contexto escalar"
+
+#: eval.c:858 eval.c:1752
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "referencia a la variable sin inicializar `%s'"
+
+#: eval.c:1007
+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:1032
+msgid "assignment used in conditional context"
+msgstr "se usó una asignación en un contexto condicional"
+
+#: eval.c:1122
+msgid "division by zero attempted"
+msgstr "se intentó una división por cero"
+
+#: eval.c:1137
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "se intentó una división por cero en `%%'"
+
+#: eval.c:1152 profile.c:683
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "tipo ilegal (%s) en tree_eval"
+
+#: eval.c:1328
+msgid "division by zero attempted in `/='"
+msgstr "se intentó una división por cero en `/='"
+
+#: eval.c:1346
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "se intentó una división por cero en `%%='"
+
+#: eval.c:1586
+#, 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:1633
+#, c-format
+msgid "function `%s' not defined"
+msgstr "la función `%s' no está definida"
+
+#: eval.c:1639
+#, c-format
+msgid "function %s called\n"
+msgstr "se llamó a la función %s\n"
+
+#: eval.c:1698
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# Pila de Llamadas de Funciones:\n"
+"\n"
+
+#: eval.c:1701
+msgid "\t# -- main --\n"
+msgstr "\t# -- principal --\n"
+
+#: eval.c:1867
+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:1869
+msgid "attempt to reference from null string"
+msgstr "se intentó una referencia desde una cadena nula"
+
+#: eval.c:1875
+#, c-format
+msgid "attempt to access field %d"
+msgstr "se intentó accesar al campo %d"
+
+#: eval.c:1896 eval.c:1903 profile.c:900
+msgid "assignment is not allowed to result of builtin function"
+msgstr "no se permite asignación como resultado de una función interna"
+
+#: eval.c:1951
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "`IGNORECASE' es una extensión de gawk"
+
+#: eval.c:1980
+msgid "`BINMODE' is a gawk extension"
+msgstr "`BINMODE' es una extensión de gawk"
+
+#: eval.c:2092
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "especificación `%sFMT' `%s' errónea"
+
+#: eval.c:2170
+msgid "turning off `--lint' due to assignment to `LINT'"
+msgstr "desactivando `--lint' debido a una asignación a `LINT'"
+
+#: 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:183
+msgid "Operation Not Supported"
+msgstr "No Se Da Soporte A La Operación"
+
+#: field.c:315
+msgid "NF set to negative value"
+msgstr "NF con un valor negativo"
+
+#: field.c:808
+msgid "split: second argument is not an array"
+msgstr "split: el segundo argumento no es una matriz"
+
+#: field.c:842
+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:894
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "`FIELDWIDTHS' es una extensión gawk"
+
+#: field.c:921
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "el campo %d en FIELDWIDTHS, debe ser > 0"
+
+#: field.c:994
+msgid "null string for `FS' is a gawk extension"
+msgstr "la cadena nula para `FS' es una extensión de gawk"
+
+#: 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:434
+#, 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"
+
+#: io.c:305
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "no se puede abrir el fichero `%s' para lectura (%s)"
+
+#: io.c:392
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "falló al cerrar el df %d (`%s') (%s)"
+
+#: io.c:530
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "tipo de árbol %s inválido en redirect()"
+
+#: io.c:536
+#, 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:542
+#, 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:547
+#, 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:569
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "mezcla innecesaria de `>' y `>>' para el fichero `%.*s'"
+
+#: io.c:621
+#, 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:630
+#, 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:643
+#, 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:647
+#, 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:723
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "no se puede redirigir desde `%s' (%s)"
+
+#: io.c:726
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "no se puede redirigir a `%s' (%s)"
+
+#: io.c:765
+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:777
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "falló al cerrar `%s' (%s)."
+
+#: io.c:784
+msgid "too many pipes or input files open"
+msgstr "demasiadas tuberías o ficheros de entrada abiertos"
+
+#: io.c:807
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: el segundo argumento debe ser `to' o `from'"
+
+#: io.c:821
+#, 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:825
+msgid "close of redirection that was never opened"
+msgstr "cerrado de una redirección que nunca fue abierta"
+
+#: io.c:862
+#, 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:924
+#, c-format
+msgid "failure status (%d) on pipe close of `%s' (%s)"
+msgstr "estado de fallo (%d) al cerrar la tubería de `%s' (%s)"
+
+#: io.c:927
+#, c-format
+msgid "failure status (%d) on file close of `%s' (%s)"
+msgstr "estado de fallo (%d) al cerrar el fichero de `%s' (%s)"
+
+#: io.c:946
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "no se provee el cerrado explícito del `socket' `%s'"
+
+#: io.c:949
+#, 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:952
+#, 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:955
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "no se provee el cerrado explícito del fichero `%s'"
+
+#: io.c:984 io.c:1038
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "error al escribir en la salida estándar (%s)"
+
+#: io.c:988 io.c:1042
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "error al escribir en la salida estándar de error (%s)"
+
+#: io.c:996
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "falló la limpieza de la tubería de `%s' (%s)."
+
+#: io.c:999
+#, 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:1002
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "falló la limpieza del fichero de `%s' (%s)."
+
+#: io.c:1161
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "el cliente /inet/raw no está listo aún, perdón"
+
+#: io.c:1163 io.c:1200
+msgid "only root may use `/inet/raw'."
+msgstr "sólo root puede utilizar `/inet/raw'."
+
+#: io.c:1198
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "el servidor /inet/raw no está listo aún, perdón"
+
+#: io.c:1288
+#, 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:1306
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "el nombre de fichero especial `%s' está incompleto"
+
+#: io.c:1318
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "puerto local inválido en `%s'"
+
+#: io.c:1330
+msgid "must supply a remote hostname to `/inet'"
+msgstr "se debe proporcionar a `/inet' un nombre de anfitrión remoto"
+
+#: io.c:1345
+msgid "must supply a remote port to `/inet'"
+msgstr "se debe proporcionar a `/inet' un puerto remoto"
+
+#: io.c:1351
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "puerto remoto inválido en `%s'"
+
+#: io.c:1361
+msgid "TCP/IP communications are not supported"
+msgstr "No tienen soporte las comunicaciones TCP/IP"
+
+#: io.c:1370 io.c:1551
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "el fichero `%s' es un directorio"
+
+#: io.c:1440
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "use `PROCINFO[\"%s\"]' en lugar de `%s'"
+
+#: io.c:1472
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "use `PROCINFO[...]' en lugar de `/dev/user'"
+
+#: io.c:1537 io.c:1711
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "no se puede abrir `%s', modo `%s'"
+
+#: io.c:1762
+#, c-format
+msgid "close of master pty failed (%s)"
+msgstr "falló al cerrar el pty maestro (%s)"
+
+#: io.c:1764 io.c:1916 io.c:2068
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "falló al cerrar la salida estándar en el hijo (%s)"
+
+#: io.c:1767
+#, c-format
+msgid "moving slave pty to stdout in child failed (dup: %s)"
+msgstr ""
+"falló el movimiento del pty esclavo a la salida estándar en el hijo (dup: %s)"
+
+#: io.c:1769 io.c:1921
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "falló al cerrar la entrada estándar en el hijo (%s)"
+
+#: io.c:1772
+#, c-format
+msgid "moving slave pty to stdin in child failed (dup: %s)"
+msgstr ""
+"falló el movimiento del pty esclavo a la entrada estándar en el hijo (dup: %"
+"s)"
+
+#: io.c:1774 io.c:1793
+#, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "falló al cerrar el pty esclavo (%s)"
+
+#: io.c:1867 io.c:1919 io.c:2049 io.c:2071
+#, 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:1871 io.c:1924
+#, 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:1888 io.c:2062
+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:1893
+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:1927 io.c:2073 io.c:2084
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "falló al cerrar la tubería (%s)"
+
+#: io.c:1972
+msgid "`|&' not supported"
+msgstr "`|&' no tiene soporte"
+
+#: io.c:2039
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "no se puede abrir la tubería `%s' (%s)"
+
+#: io.c:2080
+#, 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:2423
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "el fichero de datos `%s' está vacío"
+
+#: io.c:2466 io.c:2474
+msgid "could not allocate more input memory"
+msgstr "no se puede reservar más memoria de entrada"
+
+#: io.c:2832 io.c:2895
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "error al leer el fichero de entrada `%s': %s"
+
+#: io.c:3020
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "el valor multicaracter de `RS' es una extensión de gawk"
+
+#: main.c:324
+msgid "`-m[fr]' option irrelevant in gawk"
+msgstr "la opción -m[fr] es irrelevante en gawk"
+
+#: main.c:326
+msgid "-m option usage: `-m[fr] nnn'"
+msgstr "uso de la opción -m: `-m[fr]' nnn"
+
+#: main.c:343
+#, c-format
+msgid "%s: option `-W %s' unrecognized, ignored\n"
+msgstr "%s: no se reconoce la opción `-W %s', se ignora\n"
+
+#: main.c:380
+msgid "empty argument to `--source' ignored"
+msgstr "se ignora el argumento vacío para `--source'"
+
+#: main.c:451
+msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
+msgstr ""
+"la variable de ambiente `POSIXLY_CORRECT' está establecida: activando `--"
+"posix'"
+
+#: main.c:456
+msgid "`--posix' overrides `--traditional'"
+msgstr "`--posix' se impone a `--traditional'"
+
+#: main.c:467
+msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
+msgstr "`--posix'/`--traditional' se imponen a `--non-decimal-data'"
+
+#: main.c:471
+#, 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:512
+#, c-format
+msgid "can't set binary mode on stdin (%s)"
+msgstr "no se puede establecer el modo binario en la entrada estándar (%s)"
+
+#: main.c:515
+#, c-format
+msgid "can't set binary mode on stdout (%s)"
+msgstr "no se puede establecer el modo binario en la salida estándar (%s)"
+
+#: main.c:517
+#, c-format
+msgid "can't set binary mode on stderr (%s)"
+msgstr ""
+"no se puede establecer el modo binario en la salida estándar de error (%s)"
+
+#: main.c:547
+msgid "no program text at all!"
+msgstr "¡No hay ningún programa de texto!"
+
+#: main.c:620
+#, 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:622
+#, 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:627
+msgid "POSIX options:\t\tGNU long options:\n"
+msgstr "Opciones POSIX:\t\tOpciones largas GNU:\n"
+
+#: main.c:628
+msgid "\t-f progfile\t\t--file=progfile\n"
+msgstr "\t-f fichprog\t\t--file=fichprog\n"
+
+#: main.c:629
+msgid "\t-F fs\t\t\t--field-separator=fs\n"
+msgstr "\t-F sc\t\t\t--field-separator=sc\n"
+
+#: main.c:630
+msgid "\t-v var=val\t\t--assign=var=val\n"
+msgstr "\t-v var=valor\t\t--assign=var=valor\n"
+
+#: main.c:631
+msgid "\t-m[fr] val\n"
+msgstr "\t-m[fr] valor\n"
+
+#: main.c:632
+msgid "\t-W compat\t\t--compat\n"
+msgstr "\t-W compat\t\t--compat\n"
+
+#: main.c:633
+msgid "\t-W copyleft\t\t--copyleft\n"
+msgstr "\t-W copyleft\t\t--copyleft\n"
+
+#: main.c:634
+msgid "\t-W copyright\t\t--copyright\n"
+msgstr "\t-W copyright\t\t--copyright\n"
+
+#: main.c:635
+msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
+msgstr "\t-W dump-variables[=fichero]\t--dump-variables[=fichero]\n"
+
+#: main.c:636
+msgid "\t-W gen-po\t\t--gen-po\n"
+msgstr "\t-W gen-po\t\t--gen-po\n"
+
+#: main.c:637
+msgid "\t-W help\t\t\t--help\n"
+msgstr "\t-W help\t\t\t--help\n"
+
+#: main.c:638
+msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+
+#: main.c:639
+msgid "\t-W lint-old\t\t--lint-old\n"
+msgstr "\t-W lint-old\t\t--lint-old\n"
+
+#: main.c:640
+msgid "\t-W non-decimal-data\t--non-decimal-data\n"
+msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
+
+#: main.c:642
+msgid "\t-W nostalgia\t\t--nostalgia\n"
+msgstr "\t-W nostalgia\t\t--nostalgia\n"
+
+#: main.c:645
+msgid "\t-W parsedebug\t\t--parsedebug\n"
+msgstr "\t-W parsedebug\t\t--parsedebug\n"
+
+#: main.c:647
+msgid "\t-W profile[=file]\t--profile[=file]\n"
+msgstr "\t-W profile[=fichero]\t--profile[=fichero]\n"
+
+#: main.c:648
+msgid "\t-W posix\t\t--posix\n"
+msgstr "\t-W posix\t\t--posix\n"
+
+#: main.c:649
+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:650
+msgid "\t-W source=program-text\t--source=program-text\n"
+msgstr "\t-W source=texto-prog\t--source=texto-prog\n"
+
+#: main.c:651
+msgid "\t-W traditional\t\t--traditional\n"
+msgstr "\t-W traditional\t\t--traditional\n"
+
+#: main.c:652
+msgid "\t-W usage\t\t--usage\n"
+msgstr "\t-W usage\t\t--usage\n"
+
+#: main.c:653
+msgid "\t-W version\t\t--version\n"
+msgstr "\t-W version\t\t--version\n"
+
+#: main.c:657
+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:661
+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:665
+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:682
+#, 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:690
+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:696
+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:730
+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:956
+#, c-format
+msgid ""
+"%s: `%s' argument to `-v' not in `var=value' form\n"
+"\n"
+msgstr ""
+"%s: el argumento `%s' para `-v' no es de la forma `var=valor'\n"
+"\n"
+
+#: main.c:976
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr "`%s' no es un nombre de variable legal"
+
+#: main.c:979
+#, c-format
+msgid "`%s' is not a variable name, looking for file `%s=%s'"
+msgstr "`%s' no es un nombre de variable, se busca el fichero `%s=%s'"
+
+#: main.c:1012
+msgid "floating point exception"
+msgstr "excepción de coma flotante"
+
+#: main.c:1019
+msgid "fatal error: internal error"
+msgstr "error fatal: error interno"
+
+#: main.c:1069
+#, c-format
+msgid "no pre-opened fd %d"
+msgstr "no existe el df %d abierto previamente"
+
+#: main.c:1074
+#, 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:1097 main.c:1106
+#, c-format
+msgid "could not find groups: %s"
+msgstr "no se pueden encontrar los grupos: %s"
+
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "línea ord.:"
+
+#: msg.c:120
+msgid "warning: "
+msgstr "aviso: "
+
+#: msg.c:142
+msgid "error: "
+msgstr "error: "
+
+#: msg.c:178
+msgid "fatal: "
+msgstr "fatal: "
+
+#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115
+msgid "can't convert string to float"
+msgstr "no se puede convertir una cadena a coma flotante"
+
+#: node.c:355
+msgid "backslash at end of string"
+msgstr "barra invertida al final de la cadena"
+
+#: node.c:539
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX no permite escapes `\\x'"
+
+#: node.c:545
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "no hay dígitos hexadecimales en la secuencia de escape `\\x'"
+
+#: node.c:579
+#, c-format
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr "la secuencia de escape `\\%c' tratada como una simple `%c'"
+
+#: posix/gawkmisc.c:172
+#, 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)"
+
+#: profile.c:91
+#, c-format
+msgid "could not open `%s' for writing: %s"
+msgstr "no se puede abrir `%s' para escritura: %s"
+
+#: profile.c:449
+#, c-format
+msgid "internal error: %s with null vname"
+msgstr "error interno: %s con vname nulo"
+
+#: profile.c:512
+msgid "# treated internally as `delete'"
+msgstr "# se trata internamente como `delete'"
+
+#: profile.c:1162
+#, c-format
+msgid "\t# gawk profile, created %s\n"
+msgstr "\t# perfil de gawk, creado %s\n"
+
+#: profile.c:1165
+msgid ""
+"\t# BEGIN block(s)\n"
+"\n"
+msgstr ""
+"\t# bloque(s) BEGIN\n"
+"\n"
+
+#: profile.c:1175
+msgid ""
+"\t# Rule(s)\n"
+"\n"
+msgstr ""
+"\t# Regla(s)\n"
+"\n"
+
+#: profile.c:1181
+msgid ""
+"\t# END block(s)\n"
+"\n"
+msgstr ""
+"\t# bloque(s) END\n"
+"\n"
+
+#: profile.c:1201
+msgid ""
+"\n"
+"\t# Functions, listed alphabetically\n"
+msgstr ""
+"\n"
+"\t# Funciones, enumeradas alfabéticamente\n"
+
+#: profile.c:1413
+#, c-format
+msgid "unexpected type %s in prec_level"
+msgstr "tipo %s inesperado en prec_level"
+
+#: re.c:193
+#, 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\""
+
+#: regcomp.c:136
+msgid "Success"
+msgstr "Éxito"
+
+#: regcomp.c:139
+msgid "No match"
+msgstr "No hay coincidencia"
+
+#: regcomp.c:142
+msgid "Invalid regular expression"
+msgstr "Expresión regular inválida"
+
+#: regcomp.c:145
+msgid "Invalid collation character"
+msgstr "Caracter de ordenación inválido"
+
+#: regcomp.c:148
+msgid "Invalid character class name"
+msgstr "Nombre de clase de caracter inválido"
+
+#: regcomp.c:151
+msgid "Trailing backslash"
+msgstr "Barra invertida extra al final"
+
+#: regcomp.c:154
+msgid "Invalid back reference"
+msgstr "Referencia hacia atrás inválida"
+
+#: regcomp.c:157
+msgid "Unmatched [ or [^"
+msgstr "[ o [^ desemparejados"
+
+#: regcomp.c:160
+msgid "Unmatched ( or \\("
+msgstr "( o \\( desemparejados"
+
+#: regcomp.c:163
+msgid "Unmatched \\{"
+msgstr "\\{ desemparejado"
+
+#: regcomp.c:166
+msgid "Invalid content of \\{\\}"
+msgstr "Contenido inválido de \\{\\}"
+
+#: regcomp.c:169
+msgid "Invalid range end"
+msgstr "Final de rango inválido"
+
+#: regcomp.c:172
+msgid "Memory exhausted"
+msgstr "Memoria agotada"
+
+#: regcomp.c:175
+msgid "Invalid preceding regular expression"
+msgstr "Expresión regular precedente inválida"
+
+#: regcomp.c:178
+msgid "Premature end of regular expression"
+msgstr "Fin prematuro de la expresión regular"
+
+#: regcomp.c:181
+msgid "Regular expression too big"
+msgstr "La expresión regular es demasiado grande"
+
+#: regcomp.c:184
+msgid "Unmatched ) or \\)"
+msgstr ") o \\) desemparejados"
+
+#: regcomp.c:621
+msgid "No previous regular expression"
+msgstr "No hay una expresión regular previa"
+
+#~ msgid "substr: length %g is < 0"
+#~ msgstr "substr: la longitud %g es < 0"
+
+#~ msgid "delete: illegal use of variable `%s' as array"
+#~ msgstr "delete: uso ilegal de la variable `%s' como una matriz"
+
+#~ msgid "asort: first argument is not an array"
+#~ msgstr "asort: el primer argumento no es una matriz"
+
+#~ msgid "asort: second argument is not an array"
+#~ msgstr "asort: el segundo argumento no es una matriz"
+
+#~ msgid "internal error: Node_var_array with null vname"
+#~ msgstr "error interno: Node_var_array con vname nulo"
+
+#~ msgid "invalid syntax in name `%s' for variable assignment"
+#~ msgstr "sintaxis inválida en el nombre `%s' para la asignación de variable"
+
+#~ msgid "or used in other expression context"
+#~ msgstr "se usó or en otro contexto de la expresión"
+
+#~ msgid "attempt to use function `%s' as array"
+#~ msgstr "se intentó usar la función `%s' como una matriz"
+
+#~ msgid "`%s' is a function, assignment is not allowed"
+#~ msgstr "`%s' es una función, no se permite asignación"
+
+#~ msgid "BEGIN blocks must have an action part"
+#~ msgstr "Los bloques BEGIN deben tener una parte de acción"
+
+#~ msgid "`nextfile' used in BEGIN or END action"
+#~ msgstr "`nextfile' es usado en la acción de BEGIN o END"
+
+#~ msgid "non-redirected `getline' undefined inside BEGIN or END action"
+#~ msgstr ""
+#~ "`getline' no redirigido indefinido dentro de la acción de BEGIN o END"
+
+# tokentab? cfuga
+#~ msgid "fptr %x not in tokentab\n"
+#~ msgstr "fptr %x no está en tokentab\n"
+
+#~ msgid "gsub third parameter is not a changeable object"
+#~ msgstr "el tercer argumento de gsub no es un objecto que se puede cambiar"
+
+#~ msgid "Unbalanced ["
+#~ msgstr "[ desbalanceado"
+
+#~ msgid "Unfinished \\ escape"
+#~ msgstr "Escape \\ sin terminar"
+
+#~ msgid "unfinished repeat count"
+#~ msgstr "cuenta de repetición sin terminar"
+
+#~ msgid "malformed repeat count"
+#~ msgstr "cuenta de repetición malformada"
+
+#~ msgid "Unbalanced ("
+#~ msgstr "( desbalanceado"
+
+#~ msgid "No regexp syntax bits specified"
+#~ msgstr "No se especifican los bits de sintaxis de la expresión regular"
+
+#~ msgid "Unbalanced )"
+#~ msgstr ") desbalanceado"
+
+#~ msgid "out of memory"
+#~ msgstr "memoria agotada"
+
+#~ msgid "internal error: file `%s', line %d\n"
+#~ msgstr "error interno: fichero `%s', línea %d\n"
+
+#~ 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/gnu/dist/gawk/po/fr.gmo b/gnu/dist/gawk/po/fr.gmo
new file mode 100644
index 00000000000..babf07b8677
--- /dev/null
+++ b/gnu/dist/gawk/po/fr.gmo
Binary files differ
diff --git a/gnu/dist/gawk/po/fr.po b/gnu/dist/gawk/po/fr.po
new file mode 100644
index 00000000000..d0b7e778952
--- /dev/null
+++ b/gnu/dist/gawk/po/fr.po
@@ -0,0 +1,1866 @@
+# 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.2g\n"
+"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
+"POT-Creation-Date: 2003-07-07 11:20-0700\n"
+"PO-Revision-Date: 2003-06-26 08: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:112
+#, 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"
+
+#: array.c:113
+#, c-format
+msgid "attempt to use scalar `%s' as array"
+msgstr "tentative d'utilisation du scalaire « %s » comme un tableau"
+
+#: array.c:151
+#, c-format
+msgid "from %s"
+msgstr "de %s"
+
+#: array.c:506
+#, c-format
+msgid "reference to uninitialized element `%s[\"%s\"]'"
+msgstr "référence à un élément non initialisé « %s[\"%s\"] »"
+
+#: array.c:512
+#, c-format
+msgid "subscript of array `%s' is null string"
+msgstr "sous-description du tableau « %s » contient une chaîne nulle"
+
+#: array.c:609
+#, c-format
+msgid "delete: index `%s' not in array `%s'"
+msgstr "destruction: index « %s » n'est pas dans le tableau « %s »"
+
+#: array.c:769
+#, c-format
+msgid "%s: empty (null)\n"
+msgstr "%s: vide (null)\n"
+
+#: array.c:774
+#, c-format
+msgid "%s: empty (zero)\n"
+msgstr "%s: vide (zéro)\n"
+
+#: array.c:778
+#, c-format
+msgid "%s: table_size = %d, array_size = %d\n"
+msgstr "%s: table_size = %d, array_size = %d\n"
+
+#: array.c:807
+#, c-format
+msgid "%s: is parameter\n"
+msgstr "%s: est un paramètre\n"
+
+#: array.c:812
+#, c-format
+msgid "%s: array_ref to %s\n"
+msgstr "%s: array_ref de %s\n"
+
+#: awkgram.y:208
+#, c-format
+msgid "%s blocks must have an action part"
+msgstr "Les blocs %s doivent avoir une partie action"
+
+#: awkgram.y:211
+msgid "each rule must have a pattern or an action part"
+msgstr "chaque règle doit avoir un pattern ou une partie action"
+
+#: awkgram.y:267
+#, 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:314
+#, 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:340 awkgram.y:615
+msgid "statement may have no effect"
+msgstr "la déclaration peut n'avoir aucun effet"
+
+#: awkgram.y:435 awkgram.y:455
+#, c-format
+msgid "`%s' used in %s action"
+msgstr "« %s » utilisé dans l'action %s"
+
+#: awkgram.y:448 awkgram.y:451
+msgid "`nextfile' is a gawk extension"
+msgstr "« nextfile » est une extension de gawk"
+
+#: awkgram.y:465
+msgid "`return' used outside function context"
+msgstr "« return » utilisé en dehors du contexte d'une fonction"
+
+#: awkgram.y:504
+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:517 awkgram.y:524
+msgid "`delete array' is a gawk extension"
+msgstr "« delete array » est une extension de gawk"
+
+#: awkgram.y:532 awkgram.y:539
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "« delete(array) » est une extension tawk non portable"
+
+#: awkgram.y:583
+#, c-format
+msgid "duplicate case values in switch body: %s"
+msgstr "valeur de case en double dans le corp du switch: %s"
+
+#: awkgram.y:593
+msgid "Duplicate `default' detected in switch body"
+msgstr "Double « default » détecté dans le corps du switch"
+
+#: awkgram.y:681
+msgid "multistage two-way pipelines don't work"
+msgstr "pipelines bidirectionnel à multi-étapes ne fonctionnent pas"
+
+#: awkgram.y:772
+msgid "regular expression on right of assignment"
+msgstr "expression régulière à la droite de l'affectation"
+
+#: awkgram.y:782
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "expression régulière sur la gauche de l'opérateur « ~ » ou « !~ »"
+
+#: awkgram.y:790
+msgid "regular expression on right of comparison"
+msgstr "expression régulière sur la droite de la comparaison"
+
+#: awkgram.y:857
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "« getline » non redirigé indéfini à l'intérieur de l'action END"
+
+#: awkgram.y:884
+msgid "call of `length' without parentheses is not portable"
+msgstr "l'appel de « length » sans les parenthèses n'est pas portable"
+
+#: awkgram.y:887
+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:940
+msgid "use of non-array as array"
+msgstr "utilisation d'un non-tableau comme tableau"
+
+#: awkgram.y:942
+msgid "invalid subscript expression"
+msgstr "sous-expression invalide"
+
+#: awkgram.y:1140
+msgid "unexpected newline or end of string"
+msgstr "nouvelle ligne inattendue ou fin de chaîne"
+
+#: awkgram.y:1235
+msgid "empty program text on command line"
+msgstr "texte du programme sur la ligne de commande est vide"
+
+#: awkgram.y:1292
+#, 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:1327
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "ne peut lire le fichier source « %s » (%s)"
+
+#: awkgram.y:1335
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "fichier source « %s » est vide"
+
+#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100
+msgid "source file does not end in newline"
+msgstr "fichier source ne se termine pas par un retour de chariot"
+
+#: awkgram.y:1601
+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:1621
+msgid "unterminated regexp"
+msgstr "expression régulière non terminée"
+
+#: awkgram.y:1624
+msgid "unterminated regexp at end of file"
+msgstr "expression régulière non terminée à la fin du fichier"
+
+#: awkgram.y:1691
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr ""
+"utilisation de « \\ #... » comme continuation de ligne n'est pas portable"
+
+#: awkgram.y:1703
+msgid "backslash not last character on line"
+msgstr "la barre oblique inverse n'est pas le dernier caractère sur la ligne"
+
+#: awkgram.y:1748
+msgid "POSIX does not allow operator `**='"
+msgstr "POSIX ne permet un opérateur « **= »"
+
+#: awkgram.y:1750
+msgid "old awk does not support operator `**='"
+msgstr "l'ancien awk ne supporte pas l'opérateur « **= »"
+
+#: awkgram.y:1759
+msgid "POSIX does not allow operator `**'"
+msgstr "POSIX ne permet pas l'opérateur « ** »"
+
+#: awkgram.y:1761
+msgid "old awk does not support operator `**'"
+msgstr "l'ancien awk ne supporte pas l'opérateur « ** »"
+
+#: awkgram.y:1792
+msgid "operator `^=' is not supported in old awk"
+msgstr "l'opérateur « ^= » n'est pas supporté dans l'ancien awk"
+
+#: awkgram.y:1800
+msgid "operator `^' is not supported in old awk"
+msgstr "l'opérateur « ^ » n'est pas supporté dans l'ancien awk"
+
+#: awkgram.y:1884 awkgram.y:1901
+msgid "unterminated string"
+msgstr "chaîne non complétée"
+
+#: awkgram.y:2061
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "caractère invalide « %c » dans l'expression"
+
+#: awkgram.y:2121
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "« %s » est une extension de gawk"
+
+#: awkgram.y:2124
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "« %s » est une extension de Bell Labs"
+
+#: awkgram.y:2127
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "POSIX ne permet pas « %s »"
+
+#: awkgram.y:2131
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "« %s » n'est pas supporté dans l'ancien awk"
+
+#: awkgram.y:2158
+msgid "`goto' considered harmful!\n"
+msgstr "« goto » considéré néfaste!\n"
+
+#: awkgram.y:2220
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
+msgstr "%d est invalide comme nombre d'arguments pour %s"
+
+#: awkgram.y:2239 awkgram.y:2242
+msgid "match: third argument is a gawk extension"
+msgstr "match: 3e argument est une extension de gawk"
+
+#: awkgram.y:2255
+#, 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:2258
+#, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "3e paramètre %s n'est pas un objet modifiable"
+
+#: awkgram.y:2285 awkgram.y:2288
+msgid "close: second argument is a gawk extension"
+msgstr "close: 2e argument est une extension de gawk"
+
+#: awkgram.y:2298
+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:2313
+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:2384
+#, 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:2417
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "fonction « %s »: paramètre « %s » porte ombrage à la variable globale"
+
+#: awkgram.y:2529
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "ne peut ourvrir « %s » en écriture (%s)"
+
+#: awkgram.y:2530 profile.c:93
+msgid "sending profile to standard error"
+msgstr "redirection du profile vers stderr"
+
+#: awkgram.y:2562
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: échec de fermeture (%s)"
+
+#: awkgram.y:2684
+msgid "shadow_funcs() called twice!"
+msgstr "shadows_funcs() appelé deux fois!"
+
+#: awkgram.y:2711
+msgid "there were shadowed variables."
+msgstr "il y a quelques variables qui sont cachées par ombrage"
+
+#: awkgram.y:2784
+#, 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:2794
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "nom de la fonction « %s » définie précédemment"
+
+#: awkgram.y:2945 awkgram.y:2951
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "fonction « %s » appelé mais jamais définie"
+
+#: awkgram.y:2954
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "fonction « %s » définie mais jamais utilisée"
+
+#: awkgram.y:2981
+#, 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"
+
+#: awkgram.y:2994
+#, 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"
+
+#: awkgram.y:2996
+msgid "or used as a variable or an array"
+msgstr "ou utilisé comme une variable ou un tableau"
+
+#: builtin.c:137
+#, c-format
+msgid "%s to \"%s\" failed (%s)"
+msgstr "%s vers « %s » échec (%s)"
+
+#: builtin.c:138
+msgid "standard output"
+msgstr "sortie standard"
+
+#: builtin.c:139
+msgid "reason unknown"
+msgstr "raison inconnue"
+
+#: builtin.c:152
+msgid "exp: received non-numeric argument"
+msgstr "exp: argument fourni n'est pas numérique"
+
+#: builtin.c:158
+#, c-format
+msgid "exp: argument %g is out of range"
+msgstr "exp: argument fourni %g est hors gamme"
+
+#: builtin.c:216
+#, 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:219
+#, 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:231
+#, 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:325
+msgid "index: received non-string first argument"
+msgstr "index: premier argument fourni n'est pas une chaîne"
+
+#: builtin.c:327
+msgid "index: received non-string second argument"
+msgstr "index: second argument fourni n'est pas une chaîne"
+
+#: builtin.c:437
+msgid "int: received non-numeric argument"
+msgstr "int: argument fourni n'est pas numérique"
+
+#: builtin.c:454
+msgid "length: received non-string argument"
+msgstr "length: argument fourni n'est pas une chaîne"
+
+#: builtin.c:470
+msgid "log: received non-numeric argument"
+msgstr "log: argument fourni n'est pas numérique"
+
+#: builtin.c:473
+#, c-format
+msgid "log: received negative argument %g"
+msgstr "log: argument fourni négatif %g"
+
+#: builtin.c:635 builtin.c:638
+msgid "must use `count$' on all formats or none"
+msgstr "doit utiliser « count$ » pour tous les formats ou aucun"
+
+#: builtin.c:740
+msgid "`$' is not permitted in awk formats"
+msgstr "« $ » n'est pas permis dans les formats awk"
+
+#: builtin.c:746
+msgid "arg count with `$' must be > 0"
+msgstr "décompte d'arguments avec « $ » doit être > 0"
+
+#: builtin.c:748
+#, c-format
+msgid "arg count %ld greater than total number of supplied arguments"
+msgstr "compteur d'arguments %ld est > que le nombre total fournis d'arguments"
+
+#: builtin.c:750
+msgid "`$' not permitted after period in format"
+msgstr "« $ » n'est pas permis après le point"
+
+#: builtin.c:763
+msgid "no `$' supplied for positional field width or precision"
+msgstr "aucun « $ » fourni dans le champ positionnel (longueur ou précision)"
+
+#: builtin.c:821
+msgid "`l' is meaningless in awk formats; ignored"
+msgstr "« l » n'a aucun sens dans les formats de awk; ignoré"
+
+#: builtin.c:825
+msgid "`l' is not permitted in POSIX awk formats"
+msgstr "« l » n'est pas permis dans les format POSIX de awk"
+
+#: builtin.c:836
+msgid "`L' is meaningless in awk formats; ignored"
+msgstr "« L » n'a aucun sens dans les formats s de awk; ignoré"
+
+#: builtin.c:840
+msgid "`L' is not permitted in POSIX awk formats"
+msgstr "« L » n'est pas permis dans les formats POSIX de awk"
+
+#: builtin.c:851
+msgid "`h' is meaningless in awk formats; ignored"
+msgstr "« h » n'a aucun send dans les formats de awk; ignoré"
+
+#: builtin.c:855
+msgid "`h' is not permitted in POSIX awk formats"
+msgstr "« h » n'est pas permis dans les formats POSIX de awk"
+
+#: builtin.c:1055
+#, c-format
+msgid "[s]printf: value %g is out of range for `%%%c' format"
+msgstr "[s]printf: valeur %g est hors gamme pour le format « %%%c »"
+
+#: builtin.c:1108
+msgid "not enough arguments to satisfy format string"
+msgstr "pas assez d'arguments pour satisfaire le format d'une chaîne"
+
+#: builtin.c:1110
+msgid "^ ran out for this one"
+msgstr "^ débordement pour celle-ci"
+
+#: builtin.c:1115
+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:1118
+msgid "too many arguments supplied for format string"
+msgstr "trop d'arguments pour la chaîne de format"
+
+#: builtin.c:1184 builtin.c:1187
+msgid "printf: no arguments"
+msgstr "printf: aucun argument"
+
+#: builtin.c:1211
+msgid "sqrt: received non-numeric argument"
+msgstr "sqrt: argument fourni n'est pas numérique"
+
+#: builtin.c:1215
+#, c-format
+msgid "sqrt: called with negative argument %g"
+msgstr "sqrt: appelé avec un argument négatif %g"
+
+#: builtin.c:1238
+#, 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:1243
+#, 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:1262
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 1"
+msgstr "substr: longueur %g est <= 0"
+
+#: builtin.c:1264
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 0"
+msgstr "substr: longueur %g est <= 0"
+
+#: builtin.c:1271
+#, c-format
+msgid "substr: non-integer length %g will be truncated"
+msgstr "substr: longueur avec un nombre non entier %g sera tronqué"
+
+#: builtin.c:1276
+#, c-format
+msgid "substr: length %g too big for string indexing, truncating to %g"
+msgstr ""
+"substr: longueur %g trop grande pour l'indexation de chaîne, troncation à %g"
+
+#: builtin.c:1288
+msgid "substr: source string is zero length"
+msgstr "substr: chaîne de départ est de longueur zéro"
+
+#: builtin.c:1294
+#, c-format
+msgid "substr: start index %g is past end of string"
+msgstr "substr: début de l'index %g dépasse la fin de la chaîne"
+
+#: builtin.c:1302
+#, c-format
+msgid ""
+"substr: length %g at start index %g exceeds length of first argument (%lu)"
+msgstr ""
+"substr: longueur %g débute avec l'index %g déborde la longueur du 1er "
+"argument (%lu)"
+
+#: builtin.c:1337
+msgid "strftime: received non-string first argument"
+msgstr "strftime: premier argument fourni n'est pas une chaîne"
+
+#: builtin.c:1343
+msgid "strftime: received empty format string"
+msgstr "strftime: chaîne de format vide"
+
+#: builtin.c:1352
+msgid "strftime: received non-numeric second argument"
+msgstr "strftime: second argument fourni n'est pas numérique"
+
+#: builtin.c:1415
+msgid "mktime: received non-string argument"
+msgstr "mktime: argument fourni n'est pas une chaîne"
+
+#: builtin.c:1460
+msgid "system: received non-string argument"
+msgstr "system: argument fourni n'est pas une chaîne"
+
+#: builtin.c:1581 eval.c:1883
+#, c-format
+msgid "reference to uninitialized field `$%d'"
+msgstr "référence à un champ non initialisée « $%d »"
+
+#: builtin.c:1608
+msgid "tolower: received non-string argument"
+msgstr "tolower: argument fourni n'est pas une chaîne"
+
+#: builtin.c:1657
+msgid "toupper: received non-string argument"
+msgstr "toupper: argument fourni n'est pas une chaîne"
+
+#: builtin.c:1702
+msgid "atan2: received non-numeric first argument"
+msgstr "atan2: premier argument fourni n'est pas numérique"
+
+#: builtin.c:1704
+msgid "atan2: received non-numeric second argument"
+msgstr "atan2: second argument fourni n'est pas numérique"
+
+#: builtin.c:1723
+msgid "sin: received non-numeric argument"
+msgstr "sin: argument fourni n'est pas numérique"
+
+#: builtin.c:1739
+msgid "cos: received non-numeric argument"
+msgstr "cos: argument fourni n'est pas numérique"
+
+#: builtin.c:1788
+msgid "srand: received non-numeric argument"
+msgstr "srand: argument fourni n'est pas numérique"
+
+#: builtin.c:1823
+msgid "match: third argument is not an array"
+msgstr "match: le 3e argument fourni n'est pas un tableau"
+
+#: builtin.c:2307
+msgid "gensub: third argument of 0 treated as 1"
+msgstr "gensub: le 3e argument fourni de 0 traité comme un 1"
+
+#: builtin.c:2416 builtin.c:2418
+msgid "lshift: received non-numeric first argument"
+msgstr "lshift: premier argument fourni n'est pas numérique"
+
+#: builtin.c:2420
+#, 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:2422
+#, c-format
+msgid "lshift(%lf, %lf): fractional values will be truncated"
+msgstr "lshift(%lf, %lf): valeurs fractionnaires seront tronquées"
+
+#: builtin.c:2424
+#, 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:2453 builtin.c:2455
+msgid "rshift: received non-numeric first argument"
+msgstr "rshift: premier argument fourni n'est pas numérique"
+
+#: builtin.c:2457
+#, 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:2459
+#, c-format
+msgid "rshift(%lf, %lf): fractional values will be truncated"
+msgstr "rshift(%lf, %lf): valeurs fractionnaires seront tronquées"
+
+#: builtin.c:2461
+#, 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:2490 builtin.c:2492
+msgid "and: received non-numeric first argument"
+msgstr "and: premier argument fourni n'est pas numérique"
+
+#: builtin.c:2494
+#, 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:2496
+#, c-format
+msgid "and(%lf, %lf): fractional values will be truncated"
+msgstr "and(%lf, %lf): valeurs fractionnaires seront tronquées"
+
+#: builtin.c:2525 builtin.c:2527
+msgid "or: received non-numeric first argument"
+msgstr "or: premier argument fourni n'est pas numérique"
+
+#: builtin.c:2529
+#, 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:2531
+#, c-format
+msgid "or(%lf, %lf): fractional values will be truncated"
+msgstr "or(%lf, %lf): valeurs fractionnaires seront tronquées"
+
+#: builtin.c:2560 builtin.c:2562
+msgid "xor: received non-numeric first argument"
+msgstr "xor: premier argument fourni n'est pas numérique"
+
+#: builtin.c:2564
+#, 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:2566
+#, c-format
+msgid "xor(%lf, %lf): fractional values will be truncated"
+msgstr "xor(%lf, %lf): valeurs fractionnaires seront tronquées"
+
+#: builtin.c:2594
+msgid "compl: received non-numeric argument"
+msgstr "compl: argument fourni n'est pas numérique"
+
+#: builtin.c:2596
+#, c-format
+msgid "compl(%lf): negative value will give strange results"
+msgstr "compl(%lf): valeurs négatives donneront d'étranges résultats"
+
+#: builtin.c:2598
+#, c-format
+msgid "compl(%lf): fractional value will be truncated"
+msgstr "compl(%lf): valeurs fractionnaires seront tronquées"
+
+#: builtin.c:2771
+#, c-format
+msgid "dcgettext: `%s' is not a valid locale category"
+msgstr "dcgettext: « %s » n'est pas dans un catégorie de localisation valide"
+
+#: eval.c:266
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "type de noeud inconnu %d"
+
+#: eval.c:312
+msgid "buffer overflow in genflags2str"
+msgstr "débordement de tampo dans genflag2str"
+
+#: eval.c:647
+#, c-format
+msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
+msgstr ""
+"for loop: tableau « %s » a changé de taille de %ld à %ld durant l'exécution "
+"de la boucle"
+
+#: eval.c:668
+msgid "`break' outside a loop is not portable"
+msgstr "« break » en dehors de la boucle n'est pas portable"
+
+#: eval.c:672
+msgid "`break' outside a loop is not allowed"
+msgstr "« break » en dehors de la boucle n'est pas permis"
+
+#: eval.c:689
+msgid "`continue' outside a loop is not portable"
+msgstr "« continue » en dehors de la boucle n'est pas portable"
+
+#: eval.c:693
+msgid "`continue' outside a loop is not allowed"
+msgstr "« continue » en dehors de la boucle n'est pas permis"
+
+#: eval.c:727
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "« next » ne peut être appelé depuis une règle BEGIN"
+
+#: eval.c:729
+msgid "`next' cannot be called from an END rule"
+msgstr "« next » ne peut être appelé depuis une règle END"
+
+#: eval.c:738
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "« nextfile » ne peut être appelé depuis une règle BEGIN"
+
+#: eval.c:740
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "« nextfile » ne peut être appelé depuis une règle END"
+
+#: eval.c:785
+msgid "statement has no effect"
+msgstr "la déclaration n'a aucun effet"
+
+#: eval.c:828 eval.c:1726
+#, 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:835 eval.c:841
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "référence à un argument non initialisé « %s »"
+
+#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807
+#, c-format
+msgid "attempt to use array `%s' in a scalar context"
+msgstr "tentative d'utilisation du tableau « %s » dans un contexte scalaire"
+
+#: eval.c:858 eval.c:1752
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "référence à une variable non initialisée « %s »"
+
+#: eval.c:1007
+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:1032
+msgid "assignment used in conditional context"
+msgstr "affectation utilisé dans un contexte conditionnel"
+
+#: eval.c:1122
+msgid "division by zero attempted"
+msgstr "tentative de division par zéro"
+
+#: eval.c:1137
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "tentative de division par zéro dans « %% »"
+
+#: eval.c:1152 profile.c:683
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "type illégal (%s) dans tree_eval"
+
+#: eval.c:1328
+msgid "division by zero attempted in `/='"
+msgstr "tentative de division par zéro dans « /= »"
+
+#: eval.c:1346
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "tentative de division par zéro dans « %%= »"
+
+#: eval.c:1586
+#, 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:1633
+#, c-format
+msgid "function `%s' not defined"
+msgstr "fonction « %s » non définie"
+
+#: eval.c:1639
+#, c-format
+msgid "function %s called\n"
+msgstr "fonction %s appelée\n"
+
+#: eval.c:1698
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# Appel d'une fonction sur la pile:\n"
+"\n"
+
+#: eval.c:1701
+msgid "\t# -- main --\n"
+msgstr "#t# -- main --\n"
+
+#: eval.c:1867
+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:1869
+msgid "attempt to reference from null string"
+msgstr "tentative de référence à partir d'une chaîne nulle"
+
+#: eval.c:1875
+#, c-format
+msgid "attempt to access field %d"
+msgstr "tentative d'accès du champ %d"
+
+#: eval.c:1896 eval.c:1903 profile.c:900
+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"
+
+#: eval.c:1951
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "« IGNORECASE » est une extension de gawk"
+
+#: eval.c:1980
+msgid "`BINMODE' is a gawk extension"
+msgstr "« BINMODE » est une extension de gawk"
+
+#: eval.c:2092
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "« %sFMT » spécification erronée « %s »"
+
+#: eval.c:2170
+msgid "turning off `--lint' due to assignment to `LINT'"
+msgstr "désactivation « --lint » en raison d'une affectation à « LINT »"
+
+#: 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:183
+msgid "Operation Not Supported"
+msgstr "Opération non supportée"
+
+#: field.c:315
+msgid "NF set to negative value"
+msgstr "NF initialisé avec une valeur négative"
+
+#: field.c:808
+msgid "split: second argument is not an array"
+msgstr "split: 2e argument n'est pas un tableau"
+
+#: field.c:842
+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:894
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "« FIELDWIDTHS » est une extension de gawk"
+
+#: field.c:921
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "champ %d dans FIELDWIDTHS, doit être > 0"
+
+#: field.c:994
+msgid "null string for `FS' is a gawk extension"
+msgstr "chaîne vide pour « FS » est une extension de gawk"
+
+#: 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:434
+#, 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"
+
+#: io.c:305
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "ne peut ouvrir le fichier « %s » en lecture (%s)"
+
+#: io.c:392
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "fermeture de fd %d (« %s ») en échec (%s)"
+
+#: io.c:530
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "type d'arbre invalide %s dans redirect()"
+
+#: io.c:536
+#, 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:542
+#, 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:547
+#, 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:569
+#, 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:621
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "ne peut ouvrir un pipe « %s » en sortie (%s)"
+
+#: io.c:630
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "ne peut ouvrir un pipe « %s » en entrée (%s)"
+
+#: io.c:643
+#, 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:647
+#, 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:723
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "ne peut rediriger de « %s » (%s)"
+
+#: io.c:726
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "ne peut rediriger vers « %s » (%s)"
+
+#: io.c:765
+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:777
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "fermeture de « %s » en échec (%s)"
+
+#: io.c:784
+msgid "too many pipes or input files open"
+msgstr "trop de pipes ou de fichiers en lecture ouverts"
+
+#: io.c:807
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: 2e argument doit être « to » ou « from »"
+
+#: io.c:821
+#, 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:825
+msgid "close of redirection that was never opened"
+msgstr "fermeture de la redirection qui n'a jamais été ouverte"
+
+#: io.c:862
+#, 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:924
+#, 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:927
+#, 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:946
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "aucune fermeture explicite du socket « %s » fournie"
+
+#: io.c:949
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "aucune fermeture explicite du co-processus « %s » fournie"
+
+#: io.c:952
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "aucune fermeture explicite du pipe « %s » fournie"
+
+#: io.c:955
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "aucune fermeture explicite du fichier « %s » fournie"
+
+#: io.c:984 io.c:1038
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "erreur lors de l'écriture vers stdout (%s)"
+
+#: io.c:988 io.c:1042
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "erreur lors de l'écriture vers stderr (%s)"
+
+#: io.c:996
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "vidange du pipie de « %s » en échec (%s)"
+
+#: io.c:999
+#, 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:1002
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "vidange du fichier « %s » en échec (%s)"
+
+#: io.c:1161
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "le client /inet/raw n'est pas encore prêt, désolé"
+
+#: io.c:1163 io.c:1200
+msgid "only root may use `/inet/raw'."
+msgstr "seul root peut utiliser « /inet/raw »"
+
+#: io.c:1198
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "le serveur /inet/raw n'est pas encore prêt, désolé"
+
+#: io.c:1288
+#, 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:1306
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "nom spécial de fichier « %s » est incomplet"
+
+#: io.c:1318
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "port local invalide dans « %s »"
+
+#: io.c:1330
+msgid "must supply a remote hostname to `/inet'"
+msgstr "un nom de hôte distant doit être fourni à « /inet »"
+
+#: io.c:1345
+msgid "must supply a remote port to `/inet'"
+msgstr "un port distant doit être fournis à « /inet »"
+
+#: io.c:1351
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "port distant invalide dans « %s »"
+
+#: io.c:1361
+msgid "TCP/IP communications are not supported"
+msgstr "les communications TCP/IP ne sont pas supportées"
+
+#: io.c:1370 io.c:1551
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "le fichier « %s » est un répertoire"
+
+#: io.c:1440
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "utliser « PROCINFO[\"%s\"] » au lieu de « %s »"
+
+#: io.c:1472
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "utliser « PROCINFO[\"%s\"] » au lieu de « /dev/user »"
+
+#: io.c:1537 io.c:1711
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "ne peut ouvrir « %s », mode « %s »"
+
+#: io.c:1762
+#, c-format
+msgid "close of master pty failed (%s)"
+msgstr "échec de la fermeture du pty maître (%s)"
+
+#: io.c:1764 io.c:1916 io.c:2068
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "échec de fermeture de stdout du processus fils (%s)"
+
+#: io.c:1767
+#, c-format
+msgid "moving slave pty to stdout in child failed (dup: %s)"
+msgstr ""
+"échec de redirection du pty esclave vers stdout du processus fils (dup: %s)"
+
+#: io.c:1769 io.c:1921
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "échec de fermeture de stdin du processus fils (%s)"
+
+#: io.c:1772
+#, c-format
+msgid "moving slave pty to stdin in child failed (dup: %s)"
+msgstr ""
+"échec de redirection du pty esclave vers stdin du processus fils (dup: %s)"
+
+#: io.c:1774 io.c:1793
+#, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "échec de la fermeture du pty esclave (%s)"
+
+#: io.c:1867 io.c:1919 io.c:2049 io.c:2071
+#, 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:1871 io.c:1924
+#, 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:1888 io.c:2062
+msgid "restoring stdout in parent process failed\n"
+msgstr "restauration de stdout par le processus parent a échoué\n"
+
+#: io.c:1893
+msgid "restoring stdin in parent process failed\n"
+msgstr "restauration de stdin par le processus parent a échoué\n"
+
+#: io.c:1927 io.c:2073 io.c:2084
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "échec de la fermeture du pipe (%s)"
+
+#: io.c:1972
+msgid "`|&' not supported"
+msgstr "« |& » non supporté"
+
+#: io.c:2039
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "ne ouvrir un pipe « %s » (%s)"
+
+#: io.c:2080
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr "ne créer le processus fils pour « %s » (fork: %s)"
+
+#: io.c:2423
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "le fichier de données « %s » est vide"
+
+#: io.c:2466 io.c:2474
+msgid "could not allocate more input memory"
+msgstr "ne peut allouer plus de mémoire pour l'entrée"
+
+#: io.c:2832 io.c:2895
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "erreur lors de la lecture du fichier source « %s »: %s"
+
+#: io.c:3020
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "valeur de « RS » avec multiple caractères est une extension gawk"
+
+#: main.c:324
+msgid "`-m[fr]' option irrelevant in gawk"
+msgstr "« -m[fr] » est une option non pertinente en gawk"
+
+#: main.c:326
+msgid "-m option usage: `-m[fr] nnn'"
+msgstr "-m usage de l'option: « -m[fr] nnn »"
+
+#: main.c:343
+#, 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:380
+msgid "empty argument to `--source' ignored"
+msgstr "argument vide à l'option « --source », ignorée"
+
+#: main.c:451
+msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
+msgstr ""
+"variable d'environnement « POSIXLY__CORRECT » initialisée: utilisation de « "
+"--posix »"
+
+#: main.c:456
+msgid "`--posix' overrides `--traditional'"
+msgstr "« --posix » écrase « --traditional »"
+
+#: main.c:467
+msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
+msgstr "« --posix »/« --traditional » écrase « --non-decimal-data »"
+
+#: main.c:471
+#, 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:512
+#, c-format
+msgid "can't set binary mode on stdin (%s)"
+msgstr "ne peut initialiser le mode binaire sur stdin (%s)"
+
+#: main.c:515
+#, c-format
+msgid "can't set binary mode on stdout (%s)"
+msgstr "ne peut initialiser le mode binaire sur stdout (%s)"
+
+#: main.c:517
+#, c-format
+msgid "can't set binary mode on stderr (%s)"
+msgstr "ne peut initialiser le mode binaire sur stderr (%s)"
+
+#: main.c:547
+msgid "no program text at all!"
+msgstr "aucun programme!"
+
+#: main.c:620
+#, 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:622
+#, 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:627
+msgid "POSIX options:\t\tGNU long options:\n"
+msgstr "Options POSIX:\t\toptions de long format GNU:\n"
+
+#: main.c:628
+msgid "\t-f progfile\t\t--file=progfile\n"
+msgstr "\t-f fichierprog\t\t--file=fichierprog\n"
+
+#: main.c:629
+msgid "\t-F fs\t\t\t--field-separator=fs\n"
+msgstr "#t-F fs\t\t\t--field-separator=fs\n"
+
+#: main.c:630
+msgid "\t-v var=val\t\t--assign=var=val\n"
+msgstr "#t-v var=valeur\t\t--assign=var=valeur\n"
+
+#: main.c:631
+msgid "\t-m[fr] val\n"
+msgstr "\t-m[fr] valeur\n"
+
+#: main.c:632
+msgid "\t-W compat\t\t--compat\n"
+msgstr "\t-W compat\t\t--compat\n"
+
+#: main.c:633
+msgid "\t-W copyleft\t\t--copyleft\n"
+msgstr "\t-W copyleft\t\t--copyleft\n"
+
+#: main.c:634
+msgid "\t-W copyright\t\t--copyright\n"
+msgstr "\t-W copyright\t\t--copyright\n"
+
+#: main.c:635
+msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
+msgstr "\t-W dump-variables[=fichier]\t--dump-variables[=fichier]\n"
+
+#: main.c:636
+msgid "\t-W gen-po\t\t--gen-po\n"
+msgstr "\t-W gen-po\t\t--gen-po\n"
+
+#: main.c:637
+msgid "\t-W help\t\t\t--help\n"
+msgstr "\t-W help\t\t\t--help\n"
+
+#: main.c:638
+msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+
+#: main.c:639
+msgid "\t-W lint-old\t\t--lint-old\n"
+msgstr "\t-W lint-old\t\t--lint-old\n"
+
+#: main.c:640
+msgid "\t-W non-decimal-data\t--non-decimal-data\n"
+msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
+
+#: main.c:642
+msgid "\t-W nostalgia\t\t--nostalgia\n"
+msgstr "\t-W nostalgia\t\t--nostalgia\n"
+
+#: main.c:645
+msgid "\t-W parsedebug\t\t--parsedebug\n"
+msgstr "\t-W parsedebug\t\t--parsedebug\n"
+
+#: main.c:647
+msgid "\t-W profile[=file]\t--profile[=file]\n"
+msgstr "\t-W profile[=fichier]\t--profile[=fichier]\n"
+
+#: main.c:648
+msgid "\t-W posix\t\t--posix\n"
+msgstr "\t-W posix\t\t--posix\n"
+
+#: main.c:649
+msgid "\t-W re-interval\t\t--re-interval\n"
+msgstr "\t-W re-interval\t\t--re-interval\n"
+
+#: main.c:650
+msgid "\t-W source=program-text\t--source=program-text\n"
+msgstr "\t-W source=program-text\t--source=program-text\n"
+
+#: main.c:651
+msgid "\t-W traditional\t\t--traditional\n"
+msgstr "\t-W traditional\t\t--traditional\n"
+
+#: main.c:652
+msgid "\t-W usage\t\t--usage\n"
+msgstr "\t-W usage\t\t--usage\n"
+
+#: main.c:653
+msgid "\t-W version\t\t--version\n"
+msgstr "\t-W version\t\t--version\n"
+
+#: main.c:657
+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:661
+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:665
+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:682
+#, 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:690
+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:696
+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:730
+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:956
+#, c-format
+msgid ""
+"%s: `%s' argument to `-v' not in `var=value' form\n"
+"\n"
+msgstr ""
+"%s: `%s' argument à `-v' n'a pas le format `var=valeur'\n"
+"\n"
+
+#: main.c:976
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr "`%s' n'est pas un nom de variable légal"
+
+#: main.c:979
+#, c-format
+msgid "`%s' is not a variable name, looking for file `%s=%s'"
+msgstr "`%s' n'est pas un nom de variable, recherche du fichier `%s=%s'"
+
+#: main.c:1012
+msgid "floating point exception"
+msgstr "exception de la virgule flottante"
+
+#: main.c:1019
+msgid "fatal error: internal error"
+msgstr "erreur fatale: erreur interne"
+
+#: main.c:1069
+#, c-format
+msgid "no pre-opened fd %d"
+msgstr "aucun fd pré-ouvert pour %d"
+
+#: main.c:1074
+#, 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:1097 main.c:1106
+#, c-format
+msgid "could not find groups: %s"
+msgstr "n'a pu trouvé les groupes: %s"
+
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "cmd. ligne:"
+
+#: msg.c:120
+msgid "warning: "
+msgstr "AVERTISSEMENT:"
+
+#: msg.c:142
+msgid "error: "
+msgstr "Erreur: "
+
+#: msg.c:178
+msgid "fatal: "
+msgstr "Fatal: "
+
+#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115
+msgid "can't convert string to float"
+msgstr "ne peut convertir la chaîne en nombre flottant"
+
+#: node.c:355
+msgid "backslash at end of string"
+msgstr "barre oblique inverse à la fin de la chaîne"
+
+#: node.c:539
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX ne permet pas de séquence d'échappement « \\x »"
+
+#: node.c:545
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "aucun chiffre hexadécimal dans la séquence d'échappement « \\x » "
+
+#: node.c:579
+#, c-format
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr "séquence d'échappement « \\%c » traitée simplement comme « %c »"
+
+#: posix/gawkmisc.c:172
+#, 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)"
+
+#: profile.c:91
+#, c-format
+msgid "could not open `%s' for writing: %s"
+msgstr "ne peut ouvrir « %s » en écriture: %s"
+
+#: profile.c:449
+#, c-format
+msgid "internal error: %s with null vname"
+msgstr "erreur interne: %s avec un vname nul"
+
+#: profile.c:512
+msgid "# treated internally as `delete'"
+msgstr "# traitée de manière interne comme « delete »"
+
+#: profile.c:1162
+#, c-format
+msgid "\t# gawk profile, created %s\n"
+msgstr "\t# profile gawk, créé %s\n"
+
+#: profile.c:1165
+msgid ""
+"\t# BEGIN block(s)\n"
+"\n"
+msgstr ""
+"#t# DÉBUT de bloc(s)\n"
+"\n"
+
+#: profile.c:1175
+msgid ""
+"\t# Rule(s)\n"
+"\n"
+msgstr ""
+"\t# Règle(s)\n"
+"\n"
+
+#: profile.c:1181
+msgid ""
+"\t# END block(s)\n"
+"\n"
+msgstr ""
+"\t# FIN de bloc(s)\n"
+"\n"
+
+#: profile.c:1201
+msgid ""
+"\n"
+"\t# Functions, listed alphabetically\n"
+msgstr ""
+"\n"
+"\t# Liste alphabétique des fonctions\n"
+
+#: profile.c:1413
+#, c-format
+msgid "unexpected type %s in prec_level"
+msgstr "type %s inattendu dans prec_level"
+
+#: re.c:193
+#, 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\""
+
+#: regcomp.c:136
+msgid "Success"
+msgstr "Succès"
+
+#: regcomp.c:139
+msgid "No match"
+msgstr "Aucune concordance"
+
+#: regcomp.c:142
+msgid "Invalid regular expression"
+msgstr "Expression régulière invalide"
+
+#: regcomp.c:145
+msgid "Invalid collation character"
+msgstr "Caractère de collation invalide"
+
+#: regcomp.c:148
+msgid "Invalid character class name"
+msgstr "Nom de classe de caractères invalide"
+
+#: regcomp.c:151
+msgid "Trailing backslash"
+msgstr "Barre oblique inverse de terminaison"
+
+#: regcomp.c:154
+msgid "Invalid back reference"
+msgstr "Mauvaise référence arrière"
+
+#: regcomp.c:157
+msgid "Unmatched [ or [^"
+msgstr "Non appariement de [ ou [^"
+
+#: regcomp.c:160
+msgid "Unmatched ( or \\("
+msgstr "Non appariement de ( ou \\("
+
+#: regcomp.c:163
+msgid "Unmatched \\{"
+msgstr "Non appariement de \\{"
+
+#: regcomp.c:166
+msgid "Invalid content of \\{\\}"
+msgstr "Contenu invalide de \\{\\}"
+
+#: regcomp.c:169
+msgid "Invalid range end"
+msgstr "Borne finale invalide"
+
+#: regcomp.c:172
+msgid "Memory exhausted"
+msgstr "Mémoire épuisée"
+
+#: regcomp.c:175
+msgid "Invalid preceding regular expression"
+msgstr "Expression régulière précédente invalide"
+
+#: regcomp.c:178
+msgid "Premature end of regular expression"
+msgstr "Fin prématurée de l'expression régulière"
+
+#: regcomp.c:181
+msgid "Regular expression too big"
+msgstr "Expression régulière trop grande"
+
+#: regcomp.c:184
+msgid "Unmatched ) or \\)"
+msgstr "Non appariement de ) ou \\)"
+
+#: regcomp.c:621
+msgid "No previous regular expression"
+msgstr "Aucune expression régulière antérieure"
+
+#~ msgid "substr: length %g is < 0"
+#~ msgstr "substr: longueur %g est < 0"
+
+#~ msgid "delete: illegal use of variable `%s' as array"
+#~ msgstr ""
+#~ "destruction: utilisation illégale d'une variable « %s » comme tableau"
+
+#~ msgid "asort: first argument is not an array"
+#~ msgstr "asort(): le premier argument fourni n'est pas dans le tableau"
+
+#~ msgid "asort: second argument is not an array"
+#~ msgstr "asort(): le second argument fourni n'est pas dans le tableau"
+
+#~ msgid "internal error: Node_var_array with null vname"
+#~ msgstr "erreur interne: Node_var_array avec un vname nul"
+
+#~ msgid "invalid syntax in name `%s' for variable assignment"
+#~ msgstr "syntaxe invalide dans le nom « %s » pour l'affectation de variable"
+
+#~ msgid "or used in other expression context"
+#~ msgstr "ou utilisée dans un autre contexte d'expression"
+
+#~ msgid "attempt to use function `%s' as array"
+#~ msgstr "tentative d'utilisation de la fonction « %s » dans le tableau"
+
+#~ msgid "`%s' is a function, assignment is not allowed"
+#~ msgstr "« %s » est une fonction, l'affectation n'est pas permise"
+
+#~ msgid "BEGIN blocks must have an action part"
+#~ msgstr "Les blocs de DÉBUT doitvent avoir une partie action"
+
+#~ msgid "`nextfile' used in BEGIN or END action"
+#~ msgstr "« nextfile » utilisé dans l'action BEGIN ou END"
+
+#~ 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"
+
+#~ msgid "fptr %x not in tokentab\n"
+#~ msgstr "fptr %x n'est pas dans la table des jetons\n"
+
+#~ msgid "gsub third parameter is not a changeable object"
+#~ msgstr "gsub: 3e paramètre n'est pas un objet interchangeable"
+
+#~ msgid "Unbalanced ["
+#~ msgstr "Non appariement de ["
+
+#~ msgid "Unfinished \\ escape"
+#~ msgstr "séquence d'échappement \\ non terminée"
+
+#~ msgid "unfinished repeat count"
+#~ msgstr "répétition de compteur non terminé"
+
+#~ msgid "malformed repeat count"
+#~ msgstr "compteur de répétition mal composé"
+
+#~ msgid "Unbalanced ("
+#~ msgstr "Non appariement de ("
+
+#~ msgid "No regexp syntax bits specified"
+#~ msgstr "Aucune syntaxe d'expression régulière des bits fournie"
+
+#~ msgid "Unbalanced )"
+#~ msgstr "Non appariement de )"
+
+#~ msgid "out of memory"
+#~ msgstr "Mémoire épuisée"
+
+#~ msgid "internal error: file `%s', line %d\n"
+#~ msgstr "erreur interne: fichier « %s », ligne %d\n"
+
+#~ 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/gnu/dist/gawk/po/gawk.pot b/gnu/dist/gawk/po/gawk.pot
new file mode 100644
index 00000000000..125798e34a4
--- /dev/null
+++ b/gnu/dist/gawk/po/gawk.pot
@@ -0,0 +1,1695 @@
+# 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"
+"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
+"POT-Creation-Date: 2003-07-07 11:20-0700\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: 8bit\n"
+
+#: array.c:112
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr ""
+
+#: array.c:113
+#, c-format
+msgid "attempt to use scalar `%s' as array"
+msgstr ""
+
+#: array.c:151
+#, c-format
+msgid "from %s"
+msgstr ""
+
+#: array.c:506
+#, c-format
+msgid "reference to uninitialized element `%s[\"%s\"]'"
+msgstr ""
+
+#: array.c:512
+#, c-format
+msgid "subscript of array `%s' is null string"
+msgstr ""
+
+#: array.c:609
+#, c-format
+msgid "delete: index `%s' not in array `%s'"
+msgstr ""
+
+#: array.c:769
+#, c-format
+msgid "%s: empty (null)\n"
+msgstr ""
+
+#: array.c:774
+#, c-format
+msgid "%s: empty (zero)\n"
+msgstr ""
+
+#: array.c:778
+#, c-format
+msgid "%s: table_size = %d, array_size = %d\n"
+msgstr ""
+
+#: array.c:807
+#, c-format
+msgid "%s: is parameter\n"
+msgstr ""
+
+#: array.c:812
+#, c-format
+msgid "%s: array_ref to %s\n"
+msgstr ""
+
+#: awkgram.y:208
+#, c-format
+msgid "%s blocks must have an action part"
+msgstr ""
+
+#: awkgram.y:211
+msgid "each rule must have a pattern or an action part"
+msgstr ""
+
+#: awkgram.y:267
+#, c-format
+msgid "`%s' is a built-in function, it cannot be redefined"
+msgstr ""
+
+#: awkgram.y:314
+#, c-format
+msgid "regexp constant `/%s/' looks like a C comment, but is not"
+msgstr ""
+
+#: awkgram.y:340 awkgram.y:615
+msgid "statement may have no effect"
+msgstr ""
+
+#: awkgram.y:435 awkgram.y:455
+#, c-format
+msgid "`%s' used in %s action"
+msgstr ""
+
+#: awkgram.y:448 awkgram.y:451
+msgid "`nextfile' is a gawk extension"
+msgstr ""
+
+#: awkgram.y:465
+msgid "`return' used outside function context"
+msgstr ""
+
+#: awkgram.y:504
+msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
+msgstr ""
+
+#: awkgram.y:517 awkgram.y:524
+msgid "`delete array' is a gawk extension"
+msgstr ""
+
+#: awkgram.y:532 awkgram.y:539
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr ""
+
+#: awkgram.y:583
+#, c-format
+msgid "duplicate case values in switch body: %s"
+msgstr ""
+
+#: awkgram.y:593
+msgid "Duplicate `default' detected in switch body"
+msgstr ""
+
+#: awkgram.y:681
+msgid "multistage two-way pipelines don't work"
+msgstr ""
+
+#: awkgram.y:772
+msgid "regular expression on right of assignment"
+msgstr ""
+
+#: awkgram.y:782
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr ""
+
+#: awkgram.y:790
+msgid "regular expression on right of comparison"
+msgstr ""
+
+#: awkgram.y:857
+msgid "non-redirected `getline' undefined inside END action"
+msgstr ""
+
+#: awkgram.y:884
+msgid "call of `length' without parentheses is not portable"
+msgstr ""
+
+#: awkgram.y:887
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr ""
+
+#: awkgram.y:940
+msgid "use of non-array as array"
+msgstr ""
+
+#: awkgram.y:942
+msgid "invalid subscript expression"
+msgstr ""
+
+#: awkgram.y:1140
+msgid "unexpected newline or end of string"
+msgstr ""
+
+#: awkgram.y:1235
+msgid "empty program text on command line"
+msgstr ""
+
+#: awkgram.y:1292
+#, c-format
+msgid "can't open source file `%s' for reading (%s)"
+msgstr ""
+
+#: awkgram.y:1327
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr ""
+
+#: awkgram.y:1335
+#, c-format
+msgid "source file `%s' is empty"
+msgstr ""
+
+#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100
+msgid "source file does not end in newline"
+msgstr ""
+
+#: awkgram.y:1601
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr ""
+
+#: awkgram.y:1621
+msgid "unterminated regexp"
+msgstr ""
+
+#: awkgram.y:1624
+msgid "unterminated regexp at end of file"
+msgstr ""
+
+#: awkgram.y:1691
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr ""
+
+#: awkgram.y:1703
+msgid "backslash not last character on line"
+msgstr ""
+
+#: awkgram.y:1748
+msgid "POSIX does not allow operator `**='"
+msgstr ""
+
+#: awkgram.y:1750
+msgid "old awk does not support operator `**='"
+msgstr ""
+
+#: awkgram.y:1759
+msgid "POSIX does not allow operator `**'"
+msgstr ""
+
+#: awkgram.y:1761
+msgid "old awk does not support operator `**'"
+msgstr ""
+
+#: awkgram.y:1792
+msgid "operator `^=' is not supported in old awk"
+msgstr ""
+
+#: awkgram.y:1800
+msgid "operator `^' is not supported in old awk"
+msgstr ""
+
+#: awkgram.y:1884 awkgram.y:1901
+msgid "unterminated string"
+msgstr ""
+
+#: awkgram.y:2061
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr ""
+
+#: awkgram.y:2121
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr ""
+
+#: awkgram.y:2124
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr ""
+
+#: awkgram.y:2127
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr ""
+
+#: awkgram.y:2131
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr ""
+
+#: awkgram.y:2158
+msgid "`goto' considered harmful!\n"
+msgstr ""
+
+#: awkgram.y:2220
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
+msgstr ""
+
+#: awkgram.y:2239 awkgram.y:2242
+msgid "match: third argument is a gawk extension"
+msgstr ""
+
+#: awkgram.y:2255
+#, c-format
+msgid "%s: string literal as last arg of substitute has no effect"
+msgstr ""
+
+#: awkgram.y:2258
+#, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr ""
+
+#: awkgram.y:2285 awkgram.y:2288
+msgid "close: second argument is a gawk extension"
+msgstr ""
+
+#: awkgram.y:2298
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+
+#: awkgram.y:2313
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+
+#: awkgram.y:2384
+#, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr ""
+
+#: awkgram.y:2417
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr ""
+
+#: awkgram.y:2529
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr ""
+
+#: awkgram.y:2530 profile.c:93
+msgid "sending profile to standard error"
+msgstr ""
+
+#: awkgram.y:2562
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr ""
+
+#: awkgram.y:2684
+msgid "shadow_funcs() called twice!"
+msgstr ""
+
+#: awkgram.y:2711
+msgid "there were shadowed variables."
+msgstr ""
+
+#: awkgram.y:2784
+#, c-format
+msgid "function `%s': can't use function name as parameter name"
+msgstr ""
+
+#: awkgram.y:2794
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr ""
+
+#: awkgram.y:2945 awkgram.y:2951
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr ""
+
+#: awkgram.y:2954
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr ""
+
+#: awkgram.y:2981
+#, c-format
+msgid "regexp constant for parameter #%d yields boolean value"
+msgstr ""
+
+#: awkgram.y:2994
+#, c-format
+msgid ""
+"function `%s' called with space between name and `(',\n"
+"%s"
+msgstr ""
+
+#: awkgram.y:2996
+msgid "or used as a variable or an array"
+msgstr ""
+
+#: builtin.c:137
+#, c-format
+msgid "%s to \"%s\" failed (%s)"
+msgstr ""
+
+#: builtin.c:138
+msgid "standard output"
+msgstr ""
+
+#: builtin.c:139
+msgid "reason unknown"
+msgstr ""
+
+#: builtin.c:152
+msgid "exp: received non-numeric argument"
+msgstr ""
+
+#: builtin.c:158
+#, c-format
+msgid "exp: argument %g is out of range"
+msgstr ""
+
+#: builtin.c:216
+#, c-format
+msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
+msgstr ""
+
+#: builtin.c:219
+#, c-format
+msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
+msgstr ""
+
+#: builtin.c:231
+#, c-format
+msgid "fflush: `%s' is not an open file, pipe or co-process"
+msgstr ""
+
+#: builtin.c:325
+msgid "index: received non-string first argument"
+msgstr ""
+
+#: builtin.c:327
+msgid "index: received non-string second argument"
+msgstr ""
+
+#: builtin.c:437
+msgid "int: received non-numeric argument"
+msgstr ""
+
+#: builtin.c:454
+msgid "length: received non-string argument"
+msgstr ""
+
+#: builtin.c:470
+msgid "log: received non-numeric argument"
+msgstr ""
+
+#: builtin.c:473
+#, c-format
+msgid "log: received negative argument %g"
+msgstr ""
+
+#: builtin.c:635 builtin.c:638
+msgid "must use `count$' on all formats or none"
+msgstr ""
+
+#: builtin.c:740
+msgid "`$' is not permitted in awk formats"
+msgstr ""
+
+#: builtin.c:746
+msgid "arg count with `$' must be > 0"
+msgstr ""
+
+#: builtin.c:748
+#, c-format
+msgid "arg count %ld greater than total number of supplied arguments"
+msgstr ""
+
+#: builtin.c:750
+msgid "`$' not permitted after period in format"
+msgstr ""
+
+#: builtin.c:763
+msgid "no `$' supplied for positional field width or precision"
+msgstr ""
+
+#: builtin.c:821
+msgid "`l' is meaningless in awk formats; ignored"
+msgstr ""
+
+#: builtin.c:825
+msgid "`l' is not permitted in POSIX awk formats"
+msgstr ""
+
+#: builtin.c:836
+msgid "`L' is meaningless in awk formats; ignored"
+msgstr ""
+
+#: builtin.c:840
+msgid "`L' is not permitted in POSIX awk formats"
+msgstr ""
+
+#: builtin.c:851
+msgid "`h' is meaningless in awk formats; ignored"
+msgstr ""
+
+#: builtin.c:855
+msgid "`h' is not permitted in POSIX awk formats"
+msgstr ""
+
+#: builtin.c:1055
+#, c-format
+msgid "[s]printf: value %g is out of range for `%%%c' format"
+msgstr ""
+
+#: builtin.c:1108
+msgid "not enough arguments to satisfy format string"
+msgstr ""
+
+#: builtin.c:1110
+msgid "^ ran out for this one"
+msgstr ""
+
+#: builtin.c:1115
+msgid "[s]printf: format specifier does not have control letter"
+msgstr ""
+
+#: builtin.c:1118
+msgid "too many arguments supplied for format string"
+msgstr ""
+
+#: builtin.c:1184 builtin.c:1187
+msgid "printf: no arguments"
+msgstr ""
+
+#: builtin.c:1211
+msgid "sqrt: received non-numeric argument"
+msgstr ""
+
+#: builtin.c:1215
+#, c-format
+msgid "sqrt: called with negative argument %g"
+msgstr ""
+
+#: builtin.c:1238
+#, c-format
+msgid "substr: start index %g is invalid, using 1"
+msgstr ""
+
+#: builtin.c:1243
+#, c-format
+msgid "substr: non-integer start index %g will be truncated"
+msgstr ""
+
+#: builtin.c:1262
+#, c-format
+msgid "substr: length %g is not >= 1"
+msgstr ""
+
+#: builtin.c:1264
+#, c-format
+msgid "substr: length %g is not >= 0"
+msgstr ""
+
+#: builtin.c:1271
+#, c-format
+msgid "substr: non-integer length %g will be truncated"
+msgstr ""
+
+#: builtin.c:1276
+#, c-format
+msgid "substr: length %g too big for string indexing, truncating to %g"
+msgstr ""
+
+#: builtin.c:1288
+msgid "substr: source string is zero length"
+msgstr ""
+
+#: builtin.c:1294
+#, c-format
+msgid "substr: start index %g is past end of string"
+msgstr ""
+
+#: builtin.c:1302
+#, c-format
+msgid ""
+"substr: length %g at start index %g exceeds length of first argument (%lu)"
+msgstr ""
+
+#: builtin.c:1337
+msgid "strftime: received non-string first argument"
+msgstr ""
+
+#: builtin.c:1343
+msgid "strftime: received empty format string"
+msgstr ""
+
+#: builtin.c:1352
+msgid "strftime: received non-numeric second argument"
+msgstr ""
+
+#: builtin.c:1415
+msgid "mktime: received non-string argument"
+msgstr ""
+
+#: builtin.c:1460
+msgid "system: received non-string argument"
+msgstr ""
+
+#: builtin.c:1581 eval.c:1883
+#, c-format
+msgid "reference to uninitialized field `$%d'"
+msgstr ""
+
+#: builtin.c:1608
+msgid "tolower: received non-string argument"
+msgstr ""
+
+#: builtin.c:1657
+msgid "toupper: received non-string argument"
+msgstr ""
+
+#: builtin.c:1702
+msgid "atan2: received non-numeric first argument"
+msgstr ""
+
+#: builtin.c:1704
+msgid "atan2: received non-numeric second argument"
+msgstr ""
+
+#: builtin.c:1723
+msgid "sin: received non-numeric argument"
+msgstr ""
+
+#: builtin.c:1739
+msgid "cos: received non-numeric argument"
+msgstr ""
+
+#: builtin.c:1788
+msgid "srand: received non-numeric argument"
+msgstr ""
+
+#: builtin.c:1823
+msgid "match: third argument is not an array"
+msgstr ""
+
+#: builtin.c:2307
+msgid "gensub: third argument of 0 treated as 1"
+msgstr ""
+
+#: builtin.c:2416 builtin.c:2418
+msgid "lshift: received non-numeric first argument"
+msgstr ""
+
+#: builtin.c:2420
+#, c-format
+msgid "lshift(%lf, %lf): negative values will give strange results"
+msgstr ""
+
+#: builtin.c:2422
+#, c-format
+msgid "lshift(%lf, %lf): fractional values will be truncated"
+msgstr ""
+
+#: builtin.c:2424
+#, c-format
+msgid "lshift(%lf, %lf): too large shift value will give strange results"
+msgstr ""
+
+#: builtin.c:2453 builtin.c:2455
+msgid "rshift: received non-numeric first argument"
+msgstr ""
+
+#: builtin.c:2457
+#, c-format
+msgid "rshift(%lf, %lf): negative values will give strange results"
+msgstr ""
+
+#: builtin.c:2459
+#, c-format
+msgid "rshift(%lf, %lf): fractional values will be truncated"
+msgstr ""
+
+#: builtin.c:2461
+#, c-format
+msgid "rshift(%lf, %lf): too large shift value will give strange results"
+msgstr ""
+
+#: builtin.c:2490 builtin.c:2492
+msgid "and: received non-numeric first argument"
+msgstr ""
+
+#: builtin.c:2494
+#, c-format
+msgid "and(%lf, %lf): negative values will give strange results"
+msgstr ""
+
+#: builtin.c:2496
+#, c-format
+msgid "and(%lf, %lf): fractional values will be truncated"
+msgstr ""
+
+#: builtin.c:2525 builtin.c:2527
+msgid "or: received non-numeric first argument"
+msgstr ""
+
+#: builtin.c:2529
+#, c-format
+msgid "or(%lf, %lf): negative values will give strange results"
+msgstr ""
+
+#: builtin.c:2531
+#, c-format
+msgid "or(%lf, %lf): fractional values will be truncated"
+msgstr ""
+
+#: builtin.c:2560 builtin.c:2562
+msgid "xor: received non-numeric first argument"
+msgstr ""
+
+#: builtin.c:2564
+#, c-format
+msgid "xor(%lf, %lf): negative values will give strange results"
+msgstr ""
+
+#: builtin.c:2566
+#, c-format
+msgid "xor(%lf, %lf): fractional values will be truncated"
+msgstr ""
+
+#: builtin.c:2594
+msgid "compl: received non-numeric argument"
+msgstr ""
+
+#: builtin.c:2596
+#, c-format
+msgid "compl(%lf): negative value will give strange results"
+msgstr ""
+
+#: builtin.c:2598
+#, c-format
+msgid "compl(%lf): fractional value will be truncated"
+msgstr ""
+
+#: builtin.c:2771
+#, c-format
+msgid "dcgettext: `%s' is not a valid locale category"
+msgstr ""
+
+#: eval.c:266
+#, c-format
+msgid "unknown nodetype %d"
+msgstr ""
+
+#: eval.c:312
+msgid "buffer overflow in genflags2str"
+msgstr ""
+
+#: eval.c:647
+#, c-format
+msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
+msgstr ""
+
+#: eval.c:668
+msgid "`break' outside a loop is not portable"
+msgstr ""
+
+#: eval.c:672
+msgid "`break' outside a loop is not allowed"
+msgstr ""
+
+#: eval.c:689
+msgid "`continue' outside a loop is not portable"
+msgstr ""
+
+#: eval.c:693
+msgid "`continue' outside a loop is not allowed"
+msgstr ""
+
+#: eval.c:727
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr ""
+
+#: eval.c:729
+msgid "`next' cannot be called from an END rule"
+msgstr ""
+
+#: eval.c:738
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr ""
+
+#: eval.c:740
+msgid "`nextfile' cannot be called from an END rule"
+msgstr ""
+
+#: eval.c:785
+msgid "statement has no effect"
+msgstr ""
+
+#: eval.c:828 eval.c:1726
+#, c-format
+msgid "can't use function name `%s' as variable or array"
+msgstr ""
+
+#: eval.c:835 eval.c:841
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr ""
+
+#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807
+#, c-format
+msgid "attempt to use array `%s' in a scalar context"
+msgstr ""
+
+#: eval.c:858 eval.c:1752
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr ""
+
+#: eval.c:1007
+msgid ""
+"concatenation: side effects in one expression have changed the length of "
+"another!"
+msgstr ""
+
+#: eval.c:1032
+msgid "assignment used in conditional context"
+msgstr ""
+
+#: eval.c:1122
+msgid "division by zero attempted"
+msgstr ""
+
+#: eval.c:1137
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr ""
+
+#: eval.c:1152 profile.c:683
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr ""
+
+#: eval.c:1328
+msgid "division by zero attempted in `/='"
+msgstr ""
+
+#: eval.c:1346
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr ""
+
+#: eval.c:1586
+#, c-format
+msgid "function `%s' called with more arguments than declared"
+msgstr ""
+
+#: eval.c:1633
+#, c-format
+msgid "function `%s' not defined"
+msgstr ""
+
+#: eval.c:1639
+#, c-format
+msgid "function %s called\n"
+msgstr ""
+
+#: eval.c:1698
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+
+#: eval.c:1701
+msgid "\t# -- main --\n"
+msgstr ""
+
+#: eval.c:1867
+msgid "attempt to field reference from non-numeric value"
+msgstr ""
+
+#: eval.c:1869
+msgid "attempt to reference from null string"
+msgstr ""
+
+#: eval.c:1875
+#, c-format
+msgid "attempt to access field %d"
+msgstr ""
+
+#: eval.c:1896 eval.c:1903 profile.c:900
+msgid "assignment is not allowed to result of builtin function"
+msgstr ""
+
+#: eval.c:1951
+msgid "`IGNORECASE' is a gawk extension"
+msgstr ""
+
+#: eval.c:1980
+msgid "`BINMODE' is a gawk extension"
+msgstr ""
+
+#: eval.c:2092
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr ""
+
+#: eval.c:2170
+msgid "turning off `--lint' due to assignment to `LINT'"
+msgstr ""
+
+#: ext.c:60 ext.c:64
+msgid "`extension' is a gawk extension"
+msgstr ""
+
+#: ext.c:74
+#, c-format
+msgid "extension: cannot open `%s' (%s)\n"
+msgstr ""
+
+#: ext.c:82
+#, c-format
+msgid "extension: library `%s': cannot call function `%s' (%s)\n"
+msgstr ""
+
+#: ext.c:183
+msgid "Operation Not Supported"
+msgstr ""
+
+#: field.c:315
+msgid "NF set to negative value"
+msgstr ""
+
+#: field.c:808
+msgid "split: second argument is not an array"
+msgstr ""
+
+#: field.c:842
+msgid "split: null string for third arg is a gawk extension"
+msgstr ""
+
+#: field.c:894
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr ""
+
+#: field.c:921
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr ""
+
+#: field.c:994
+msgid "null string for `FS' is a gawk extension"
+msgstr ""
+
+#: getopt.c:692 getopt.c:704
+#, c-format
+msgid "%s: option `%s' is ambiguous\n"
+msgstr ""
+
+#: getopt.c:737 getopt.c:741
+#, c-format
+msgid "%s: option `--%s' doesn't allow an argument\n"
+msgstr ""
+
+#: getopt.c:750 getopt.c:755
+#, c-format
+msgid "%s: option `%c%s' doesn't allow an argument\n"
+msgstr ""
+
+#: getopt.c:791 getopt.c:804 getopt.c:1093 getopt.c:1106
+#, c-format
+msgid "%s: option `%s' requires an argument\n"
+msgstr ""
+
+#: getopt.c:842 getopt.c:845
+#, c-format
+msgid "%s: unrecognized option `--%s'\n"
+msgstr ""
+
+#: getopt.c:853 getopt.c:856
+#, c-format
+msgid "%s: unrecognized option `%c%s'\n"
+msgstr ""
+
+#: getopt.c:903 getopt.c:906
+#, c-format
+msgid "%s: illegal option -- %c\n"
+msgstr ""
+
+#: getopt.c:912 getopt.c:915
+#, c-format
+msgid "%s: invalid option -- %c\n"
+msgstr ""
+
+#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434
+#, c-format
+msgid "%s: option requires an argument -- %c\n"
+msgstr ""
+
+#: getopt.c:1025 getopt.c:1036
+#, c-format
+msgid "%s: option `-W %s' is ambiguous\n"
+msgstr ""
+
+#: getopt.c:1060 getopt.c:1072
+#, c-format
+msgid "%s: option `-W %s' doesn't allow an argument\n"
+msgstr ""
+
+#: io.c:305
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr ""
+
+#: io.c:392
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr ""
+
+#: io.c:530
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr ""
+
+#: io.c:536
+#, c-format
+msgid "expression in `%s' redirection only has numeric value"
+msgstr ""
+
+#: io.c:542
+#, c-format
+msgid "expression for `%s' redirection has null string value"
+msgstr ""
+
+#: io.c:547
+#, c-format
+msgid "filename `%s' for `%s' redirection may be result of logical expression"
+msgstr ""
+
+#: io.c:569
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr ""
+
+#: io.c:621
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr ""
+
+#: io.c:630
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr ""
+
+#: io.c:643
+#, c-format
+msgid "can't open two way socket `%s' for input/output (%s)"
+msgstr ""
+
+#: io.c:647
+#, c-format
+msgid "can't open two way pipe `%s' for input/output (%s)"
+msgstr ""
+
+#: io.c:723
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr ""
+
+#: io.c:726
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr ""
+
+#: io.c:765
+msgid ""
+"reached system limit for open files: starting to multiplex file descriptors"
+msgstr ""
+
+#: io.c:777
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr ""
+
+#: io.c:784
+msgid "too many pipes or input files open"
+msgstr ""
+
+#: io.c:807
+msgid "close: second argument must be `to' or `from'"
+msgstr ""
+
+#: io.c:821
+#, c-format
+msgid "close: `%.*s' is not an open file, pipe or co-process"
+msgstr ""
+
+#: io.c:825
+msgid "close of redirection that was never opened"
+msgstr ""
+
+#: io.c:862
+#, c-format
+msgid "close: redirection `%s' not opened with `|&', second argument ignored"
+msgstr ""
+
+#: io.c:924
+#, c-format
+msgid "failure status (%d) on pipe close of `%s' (%s)"
+msgstr ""
+
+#: io.c:927
+#, c-format
+msgid "failure status (%d) on file close of `%s' (%s)"
+msgstr ""
+
+#: io.c:946
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr ""
+
+#: io.c:949
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr ""
+
+#: io.c:952
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr ""
+
+#: io.c:955
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr ""
+
+#: io.c:984 io.c:1038
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr ""
+
+#: io.c:988 io.c:1042
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr ""
+
+#: io.c:996
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr ""
+
+#: io.c:999
+#, c-format
+msgid "co-process flush of pipe to `%s' failed (%s)."
+msgstr ""
+
+#: io.c:1002
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr ""
+
+#: io.c:1161
+msgid "/inet/raw client not ready yet, sorry"
+msgstr ""
+
+#: io.c:1163 io.c:1200
+msgid "only root may use `/inet/raw'."
+msgstr ""
+
+#: io.c:1198
+msgid "/inet/raw server not ready yet, sorry"
+msgstr ""
+
+#: io.c:1288
+#, c-format
+msgid "no (known) protocol supplied in special filename `%s'"
+msgstr ""
+
+#: io.c:1306
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr ""
+
+#: io.c:1318
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr ""
+
+#: io.c:1330
+msgid "must supply a remote hostname to `/inet'"
+msgstr ""
+
+#: io.c:1345
+msgid "must supply a remote port to `/inet'"
+msgstr ""
+
+#: io.c:1351
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr ""
+
+#: io.c:1361
+msgid "TCP/IP communications are not supported"
+msgstr ""
+
+#: io.c:1370 io.c:1551
+#, c-format
+msgid "file `%s' is a directory"
+msgstr ""
+
+#: io.c:1440
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr ""
+
+#: io.c:1472
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr ""
+
+#: io.c:1537 io.c:1711
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr ""
+
+#: io.c:1762
+#, c-format
+msgid "close of master pty failed (%s)"
+msgstr ""
+
+#: io.c:1764 io.c:1916 io.c:2068
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr ""
+
+#: io.c:1767
+#, c-format
+msgid "moving slave pty to stdout in child failed (dup: %s)"
+msgstr ""
+
+#: io.c:1769 io.c:1921
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr ""
+
+#: io.c:1772
+#, c-format
+msgid "moving slave pty to stdin in child failed (dup: %s)"
+msgstr ""
+
+#: io.c:1774 io.c:1793
+#, c-format
+msgid "close of slave pty failed (%s)"
+msgstr ""
+
+#: io.c:1867 io.c:1919 io.c:2049 io.c:2071
+#, c-format
+msgid "moving pipe to stdout in child failed (dup: %s)"
+msgstr ""
+
+#: io.c:1871 io.c:1924
+#, c-format
+msgid "moving pipe to stdin in child failed (dup: %s)"
+msgstr ""
+
+#: io.c:1888 io.c:2062
+msgid "restoring stdout in parent process failed\n"
+msgstr ""
+
+#: io.c:1893
+msgid "restoring stdin in parent process failed\n"
+msgstr ""
+
+#: io.c:1927 io.c:2073 io.c:2084
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr ""
+
+#: io.c:1972
+msgid "`|&' not supported"
+msgstr ""
+
+#: io.c:2039
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr ""
+
+#: io.c:2080
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr ""
+
+#: io.c:2423
+#, c-format
+msgid "data file `%s' is empty"
+msgstr ""
+
+#: io.c:2466 io.c:2474
+msgid "could not allocate more input memory"
+msgstr ""
+
+#: io.c:2832 io.c:2895
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr ""
+
+#: io.c:3020
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr ""
+
+#: main.c:324
+msgid "`-m[fr]' option irrelevant in gawk"
+msgstr ""
+
+#: main.c:326
+msgid "-m option usage: `-m[fr] nnn'"
+msgstr ""
+
+#: main.c:343
+#, c-format
+msgid "%s: option `-W %s' unrecognized, ignored\n"
+msgstr ""
+
+#: main.c:380
+msgid "empty argument to `--source' ignored"
+msgstr ""
+
+#: main.c:451
+msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
+msgstr ""
+
+#: main.c:456
+msgid "`--posix' overrides `--traditional'"
+msgstr ""
+
+#: main.c:467
+msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
+msgstr ""
+
+#: main.c:471
+#, c-format
+msgid "running %s setuid root may be a security problem"
+msgstr ""
+
+#: main.c:512
+#, c-format
+msgid "can't set binary mode on stdin (%s)"
+msgstr ""
+
+#: main.c:515
+#, c-format
+msgid "can't set binary mode on stdout (%s)"
+msgstr ""
+
+#: main.c:517
+#, c-format
+msgid "can't set binary mode on stderr (%s)"
+msgstr ""
+
+#: main.c:547
+msgid "no program text at all!"
+msgstr ""
+
+#: main.c:620
+#, c-format
+msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
+msgstr ""
+
+#: main.c:622
+#, c-format
+msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
+msgstr ""
+
+#: main.c:627
+msgid "POSIX options:\t\tGNU long options:\n"
+msgstr ""
+
+#: main.c:628
+msgid "\t-f progfile\t\t--file=progfile\n"
+msgstr ""
+
+#: main.c:629
+msgid "\t-F fs\t\t\t--field-separator=fs\n"
+msgstr ""
+
+#: main.c:630
+msgid "\t-v var=val\t\t--assign=var=val\n"
+msgstr ""
+
+#: main.c:631
+msgid "\t-m[fr] val\n"
+msgstr ""
+
+#: main.c:632
+msgid "\t-W compat\t\t--compat\n"
+msgstr ""
+
+#: main.c:633
+msgid "\t-W copyleft\t\t--copyleft\n"
+msgstr ""
+
+#: main.c:634
+msgid "\t-W copyright\t\t--copyright\n"
+msgstr ""
+
+#: main.c:635
+msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
+msgstr ""
+
+#: main.c:636
+msgid "\t-W gen-po\t\t--gen-po\n"
+msgstr ""
+
+#: main.c:637
+msgid "\t-W help\t\t\t--help\n"
+msgstr ""
+
+#: main.c:638
+msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+msgstr ""
+
+#: main.c:639
+msgid "\t-W lint-old\t\t--lint-old\n"
+msgstr ""
+
+#: main.c:640
+msgid "\t-W non-decimal-data\t--non-decimal-data\n"
+msgstr ""
+
+#: main.c:642
+msgid "\t-W nostalgia\t\t--nostalgia\n"
+msgstr ""
+
+#: main.c:645
+msgid "\t-W parsedebug\t\t--parsedebug\n"
+msgstr ""
+
+#: main.c:647
+msgid "\t-W profile[=file]\t--profile[=file]\n"
+msgstr ""
+
+#: main.c:648
+msgid "\t-W posix\t\t--posix\n"
+msgstr ""
+
+#: main.c:649
+msgid "\t-W re-interval\t\t--re-interval\n"
+msgstr ""
+
+#: main.c:650
+msgid "\t-W source=program-text\t--source=program-text\n"
+msgstr ""
+
+#: main.c:651
+msgid "\t-W traditional\t\t--traditional\n"
+msgstr ""
+
+#: main.c:652
+msgid "\t-W usage\t\t--usage\n"
+msgstr ""
+
+#: main.c:653
+msgid "\t-W version\t\t--version\n"
+msgstr ""
+
+#: main.c:657
+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:661
+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:665
+msgid ""
+"Examples:\n"
+"\tgawk '{ sum += $1 }; END { print sum }' file\n"
+"\tgawk -F: '{ print $1 }' /etc/passwd\n"
+msgstr ""
+
+#: main.c:682
+#, 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 ""
+
+#: main.c:690
+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 ""
+
+#: main.c:696
+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:730
+msgid "-Ft does not set FS to tab in POSIX awk"
+msgstr ""
+
+#: main.c:956
+#, c-format
+msgid ""
+"%s: `%s' argument to `-v' not in `var=value' form\n"
+"\n"
+msgstr ""
+
+#: main.c:976
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr ""
+
+#: main.c:979
+#, c-format
+msgid "`%s' is not a variable name, looking for file `%s=%s'"
+msgstr ""
+
+#: main.c:1012
+msgid "floating point exception"
+msgstr ""
+
+#: main.c:1019
+msgid "fatal error: internal error"
+msgstr ""
+
+#: main.c:1069
+#, c-format
+msgid "no pre-opened fd %d"
+msgstr ""
+
+#: main.c:1074
+#, c-format
+msgid "could not pre-open /dev/null for fd %d"
+msgstr ""
+
+#: main.c:1097 main.c:1106
+#, c-format
+msgid "could not find groups: %s"
+msgstr ""
+
+#: msg.c:54
+msgid "cmd. line:"
+msgstr ""
+
+#: msg.c:120
+msgid "warning: "
+msgstr ""
+
+#: msg.c:142
+msgid "error: "
+msgstr ""
+
+#: msg.c:178
+msgid "fatal: "
+msgstr ""
+
+#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115
+msgid "can't convert string to float"
+msgstr ""
+
+#: node.c:355
+msgid "backslash at end of string"
+msgstr ""
+
+#: node.c:539
+msgid "POSIX does not allow `\\x' escapes"
+msgstr ""
+
+#: node.c:545
+msgid "no hex digits in `\\x' escape sequence"
+msgstr ""
+
+#: node.c:579
+#, c-format
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr ""
+
+#: posix/gawkmisc.c:172
+#, c-format
+msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
+msgstr ""
+
+#: profile.c:91
+#, c-format
+msgid "could not open `%s' for writing: %s"
+msgstr ""
+
+#: profile.c:449
+#, c-format
+msgid "internal error: %s with null vname"
+msgstr ""
+
+#: profile.c:512
+msgid "# treated internally as `delete'"
+msgstr ""
+
+#: profile.c:1162
+#, c-format
+msgid "\t# gawk profile, created %s\n"
+msgstr ""
+
+#: profile.c:1165
+msgid ""
+"\t# BEGIN block(s)\n"
+"\n"
+msgstr ""
+
+#: profile.c:1175
+msgid ""
+"\t# Rule(s)\n"
+"\n"
+msgstr ""
+
+#: profile.c:1181
+msgid ""
+"\t# END block(s)\n"
+"\n"
+msgstr ""
+
+#: profile.c:1201
+msgid ""
+"\n"
+"\t# Functions, listed alphabetically\n"
+msgstr ""
+
+#: profile.c:1413
+#, c-format
+msgid "unexpected type %s in prec_level"
+msgstr ""
+
+#: re.c:193
+#, c-format
+msgid "regex match failed, not enough memory to match string \"%.*s%s\""
+msgstr ""
+
+#: regcomp.c:136
+msgid "Success"
+msgstr ""
+
+#: regcomp.c:139
+msgid "No match"
+msgstr ""
+
+#: regcomp.c:142
+msgid "Invalid regular expression"
+msgstr ""
+
+#: regcomp.c:145
+msgid "Invalid collation character"
+msgstr ""
+
+#: regcomp.c:148
+msgid "Invalid character class name"
+msgstr ""
+
+#: regcomp.c:151
+msgid "Trailing backslash"
+msgstr ""
+
+#: regcomp.c:154
+msgid "Invalid back reference"
+msgstr ""
+
+#: regcomp.c:157
+msgid "Unmatched [ or [^"
+msgstr ""
+
+#: regcomp.c:160
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: regcomp.c:163
+msgid "Unmatched \\{"
+msgstr ""
+
+#: regcomp.c:166
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: regcomp.c:169
+msgid "Invalid range end"
+msgstr ""
+
+#: regcomp.c:172
+msgid "Memory exhausted"
+msgstr ""
+
+#: regcomp.c:175
+msgid "Invalid preceding regular expression"
+msgstr ""
+
+#: regcomp.c:178
+msgid "Premature end of regular expression"
+msgstr ""
+
+#: regcomp.c:181
+msgid "Regular expression too big"
+msgstr ""
+
+#: regcomp.c:184
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: regcomp.c:621
+msgid "No previous regular expression"
+msgstr ""
diff --git a/gnu/dist/gawk/po/he.gmo b/gnu/dist/gawk/po/he.gmo
new file mode 100644
index 00000000000..c2e39e54678
--- /dev/null
+++ b/gnu/dist/gawk/po/he.gmo
Binary files differ
diff --git a/gnu/dist/gawk/po/he.po b/gnu/dist/gawk/po/he.po
new file mode 100644
index 00000000000..a64f3a28ee0
--- /dev/null
+++ b/gnu/dist/gawk/po/he.po
@@ -0,0 +1,1830 @@
+# Hebrew messages for GNU Awk -*- coding: hebrew-iso-8bit -*-
+# Copyright (C) 2001 Free Software Foundation, Inc.
+# Eli Zaretskii <eliz@is.elta.co.il>, 2001, 2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gawk 3.1.1a\n"
+"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
+"POT-Creation-Date: 2003-07-07 11:20-0700\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:112
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr "êøòî äéä åìéàë `%s' éøì÷ñ øèîøôá ùåîéù ïåéñð"
+
+#: array.c:113
+#, c-format
+msgid "attempt to use scalar `%s' as array"
+msgstr "êøòîë `%s' øàì÷ñá éåâù ùåîéù"
+
+# This is not translated because it cannot be reworded in Hebrew
+# without looking awkward.
+#: array.c:151
+#, fuzzy, c-format
+msgid "from %s"
+msgstr "%s (from %s)"
+
+#: array.c:506
+#, c-format
+msgid "reference to uninitialized element `%s[\"%s\"]'"
+msgstr "ìçåúî åðéàù `%s[\"%s\"]' èðîìàì äééðô"
+
+#: array.c:512
+#, c-format
+msgid "subscript of array `%s' is null string"
+msgstr "`%s' êøòî ïééöîë ä÷éø úæåøçîá ùåîéù"
+
+#: array.c:609
+#, c-format
+msgid "delete: index `%s' not in array `%s'"
+msgstr "`%s' ïééöî ìéëî åðéà `%s' êøòî :delete"
+
+#: array.c:769
+#, c-format
+msgid "%s: empty (null)\n"
+msgstr "%s: (ñôåàî) ÷éø\n"
+
+#: array.c:774
+#, c-format
+msgid "%s: empty (zero)\n"
+msgstr "%s: (ä÷éø hash úìáè) ÷éø\n"
+
+#: array.c:778
+#, c-format
+msgid "%s: table_size = %d, array_size = %d\n"
+msgstr "%s: table_size = %d, array_size = %d\n"
+
+#: array.c:807
+#, c-format
+msgid "%s: is parameter\n"
+msgstr "øèîøô åðéä %s\n"
+
+#: array.c:812
+#, c-format
+msgid "%s: array_ref to %s\n"
+msgstr "%s: %s-ì (array_ref) äéðôä\n"
+
+#: awkgram.y:208
+#, fuzzy, c-format
+msgid "%s blocks must have an action part"
+msgstr "äìåòô úøãâä ìåìëì áééç END ÷åìá"
+
+#: awkgram.y:211
+#, fuzzy
+msgid "each rule must have a pattern or an action part"
+msgstr "äìåòô úøãâä ìåìëì áééç END ÷åìá"
+
+#: awkgram.y:267
+#, c-format
+msgid "`%s' is a built-in function, it cannot be redefined"
+msgstr "äúøãâä úà úåðùì ïéà ,úéðáåî äéö÷ðåô äðéä `%s'"
+
+#: awkgram.y:314
+#, c-format
+msgid "regexp constant `/%s/' looks like a C comment, but is not"
+msgstr "äøòä åðéà êà ,C úôùá äøòä åîë äàøð `/%s/' éøìåâø éåèéá"
+
+#: awkgram.y:340 awkgram.y:615
+msgid "statement may have no effect"
+msgstr "úéìëú íåù äéäú àì äæ éåèéáìù ïëúé"
+
+#: awkgram.y:435 awkgram.y:455
+#, fuzzy, c-format
+msgid "`%s' used in %s action"
+msgstr "END åà BEGIN ìù äìåòô úøãâäá `next'-á ùåîéù"
+
+#: awkgram.y:448 awkgram.y:451
+msgid "`nextfile' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `nextfile'"
+
+#: awkgram.y:465
+msgid "`return' used outside function context"
+msgstr "äéö÷ðåô ìù èñ÷èðå÷á àìù `return'-á ùåîéù"
+
+#: awkgram.y:504
+msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
+msgstr "`print \"\"' úåéäì íúñä ïî êéøö END åà BEGIN éììëá èåùô `print'"
+
+#: awkgram.y:517 awkgram.y:524
+msgid "`delete array' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `delete array'"
+
+#: awkgram.y:532 awkgram.y:539
+#, fuzzy
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `delete array'"
+
+#: awkgram.y:583
+#, c-format
+msgid "duplicate case values in switch body: %s"
+msgstr ""
+
+#: awkgram.y:593
+msgid "Duplicate `default' detected in switch body"
+msgstr ""
+
+#: awkgram.y:681
+msgid "multistage two-way pipelines don't work"
+msgstr "íéãáåò íðéà íéáìù éáåøî íééðååéë-åã íé÷éôà"
+
+#: awkgram.y:772
+msgid "regular expression on right of assignment"
+msgstr "êøò úîùä úàøåä ìù ïéîé ãöá éøìåâø éåèéá"
+
+#: awkgram.y:782
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "`!~' åà `~' øåèøôåàì ìàîùî éøìåâø éåèéá"
+
+#: awkgram.y:790
+msgid "regular expression on right of comparison"
+msgstr "äàååùä ìù ïéîé ãöá éøìåâø éåèéá"
+
+#: awkgram.y:857
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "END úìåòô êåúá øãâåî åðéà äééðôä àìì `getline'"
+
+#: awkgram.y:884
+msgid "call of `length' without parentheses is not portable"
+msgstr "úéìéáèøåô äðéà íééøâåñ àìì `length'-ì äàéø÷"
+
+#: awkgram.y:887
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "POSIX ï÷úì ãåâéðá äðéä íééøâåñ àìì `length'-ì äàéø÷"
+
+#: awkgram.y:940
+msgid "use of non-array as array"
+msgstr ""
+
+#: awkgram.y:942
+msgid "invalid subscript expression"
+msgstr "êøòî ïééöîá éåâù øéáçú ìòá éåèéá"
+
+#: awkgram.y:1140
+#, fuzzy
+msgid "unexpected newline or end of string"
+msgstr "éåôö-éúìá íå÷îá äøåù óåñ"
+
+#: awkgram.y:1235
+msgid "empty program text on command line"
+msgstr "äãå÷ôä úøåùî äìá÷úä ä÷éø úéðëú"
+
+#: awkgram.y:1292
+#, c-format
+msgid "can't open source file `%s' for reading (%s)"
+msgstr "åúàéø÷ íùì `%s' øå÷î õáå÷ úçéúôá (%s) äì÷ú"
+
+#: awkgram.y:1327
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "`%s' øå÷î õáå÷î äàéø÷á (%s) äì÷ú"
+
+#: awkgram.y:1335
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "÷éø åðéä `%s' øå÷î õáå÷"
+
+#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100
+msgid "source file does not end in newline"
+msgstr "äøåù-óåñ åúá íééúñî åðéà øå÷îä õáå÷"
+
+#: awkgram.y:1601
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr "õáå÷ä óñá `\\'-á íééúñî øåîâ-éúìá éøìåâø éåèéá"
+
+#: awkgram.y:1621
+msgid "unterminated regexp"
+msgstr "øåîâ-éúìá éøìåâø éåèéá"
+
+#: awkgram.y:1624
+msgid "unterminated regexp at end of file"
+msgstr "õáå÷ä óåñá øåîâ-éúìá éøìåâø éåèéá"
+
+#: awkgram.y:1691
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr "éìéáèøåô åðéà äøåù êùîäì ïîéñë `\\ #...'-á ùåîéù"
+
+#: awkgram.y:1703
+msgid "backslash not last character on line"
+msgstr "äøåùá ïåøçà åú åðéàù êåôä ïñëåì"
+
+#: awkgram.y:1748
+msgid "POSIX does not allow operator `**='"
+msgstr "`**=' øåèøôåà äùøî åðéà POSIX"
+
+#: awkgram.y:1750
+msgid "old awk does not support operator `**='"
+msgstr "`**=' øåèøôåàá êîåú åðéà ïùé awk"
+
+#: awkgram.y:1759
+msgid "POSIX does not allow operator `**'"
+msgstr "`**' øåèøôåà äùøî åðéà POSIX"
+
+#: awkgram.y:1761
+msgid "old awk does not support operator `**'"
+msgstr "`**' øåèøôåàá êîåú åðéà ïùé awk"
+
+#: awkgram.y:1792
+msgid "operator `^=' is not supported in old awk"
+msgstr "ïùé awk-á êîúð åðéà `^=' øåèøôåà"
+
+#: awkgram.y:1800
+msgid "operator `^' is not supported in old awk"
+msgstr "ïùé awk-á êîúð åðéà `^' øåèøôåà"
+
+#: awkgram.y:1884 awkgram.y:1901
+msgid "unterminated string"
+msgstr "äøåîâ-éúìá úæåøçî"
+
+#: awkgram.y:2061
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "éåèéáá '%c' éåâù åú"
+
+#: awkgram.y:2121
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä äðéä `%s'"
+
+#: awkgram.y:2124
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "Bell úåãáòî úñøâá awk-ì úéôéöôñ äáçøä åðéä `%s'"
+
+#: awkgram.y:2127
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "`%s' äùøî åðéà POSIX"
+
+#: awkgram.y:2131
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "ïùé awk-á êîúð åðéà `%s'"
+
+#: awkgram.y:2158
+msgid "`goto' considered harmful!\n"
+msgstr "!òø-òâô áùçð `goto'\n"
+
+#: awkgram.y:2220
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
+msgstr "íéèðîåâøà øôñîë %d ìá÷ì ìåëé åðéà %s"
+
+#: awkgram.y:2239 awkgram.y:2242
+msgid "match: third argument is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `match' ìù éùéìù èðîåâøà"
+
+#: awkgram.y:2255
+#, c-format
+msgid "%s: string literal as last arg of substitute has no effect"
+msgstr "úéìëú íåù äì ïéà `%s' ìù ïåøçà èðîåâøàë äòåá÷ úæåøçî"
+
+#: awkgram.y:2258
+#, fuzzy, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "éåðéù-øá è÷ééáåà åðéà `sub' ìù éùéìù èðîåâøà"
+
+#: awkgram.y:2285 awkgram.y:2288
+msgid "close: second argument is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `close' ìù éðù èðîåâøà"
+
+#: awkgram.y:2298
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr "èðîåâøà úîã÷áù ïåúçú-ó÷î ÷ìñì ùé :dcgettext(_\"...\")-á éåâù ùåîéù"
+
+#: awkgram.y:2313
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr "èðîåâøà úîã÷áù ïåúçú-ó÷î ÷ìñì ùé :dncgettext(_\"...\")-á éåâù ùåîéù"
+
+#: awkgram.y:2384
+#, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "`%s' äéö÷ðåôá %d 'ñî øèîøôì ääæ ,`%s' ,%d 'ñî øèîøô ìù åîù"
+
+#: awkgram.y:2417
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "éìáåìâ äðúùî ìò ìéôàî `%s' äéö÷ðåôá `%s' øèîøô"
+
+#: awkgram.y:2529
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "äáéúë íùì `%s' úçéúôá (%s) äì÷ú"
+
+#: awkgram.y:2530 profile.c:93
+msgid "sending profile to standard error"
+msgstr "éð÷ú úåàéâù õåøòì çìùð òåöéá ìéôåøô"
+
+#: awkgram.y:2562
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "`%s' úøéâñ úòá (%s) äì÷ú"
+
+#: awkgram.y:2684
+msgid "shadow_funcs() called twice!"
+msgstr "!íééîòô äàø÷ð shadow_funcs()"
+
+#: awkgram.y:2711
+msgid "there were shadowed variables."
+msgstr ""
+
+#: awkgram.y:2784
+#, c-format
+msgid "function `%s': can't use function name as parameter name"
+msgstr "øèîøô íùë ùîùì ìåëé åðéà äéö÷ðåô íù :`%s' äéö÷ðåôá"
+
+#: awkgram.y:2794
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "úøãâåî øáë `%s' íùá äéö÷ðåô"
+
+#: awkgram.y:2945 awkgram.y:2951
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "úøãâåî äðéàù `%s' äéö÷ðåôì äàéø÷"
+
+#: awkgram.y:2954
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "úàø÷ð àì êà ,äøãâåä `%s' äéö÷ðåô"
+
+#: awkgram.y:2981
+#, c-format
+msgid "regexp constant for parameter #%d yields boolean value"
+msgstr "éðàéìåá êøò áéðî %d 'ñî øèîøôë òåá÷ éøìåâø éåèéá"
+
+#: awkgram.y:2994
+#, c-format
+msgid ""
+"function `%s' called with space between name and `(',\n"
+"%s"
+msgstr ""
+",`(' ïéáì äîù ïéá íéçååø íò `%s' äéö÷ðåôì äàéø÷\n"
+"%s"
+
+#: awkgram.y:2996
+#, fuzzy
+msgid "or used as a variable or an array"
+msgstr "êøòî åà äðúùîë `%s' äéö÷ðåô íùá ùîúùäì ïéà"
+
+#: builtin.c:137
+#, c-format
+msgid "%s to \"%s\" failed (%s)"
+msgstr "%s é\"ò \"%s\"-ì äáéúëá (%s) äì÷ú"
+
+#: builtin.c:138
+msgid "standard output"
+msgstr "úéèøãðèñ èìô úãéçé"
+
+#: builtin.c:139
+msgid "reason unknown"
+msgstr "äòåãé-éúìá äáéñî"
+
+#: builtin.c:152
+msgid "exp: received non-numeric argument"
+msgstr "øôñî åðéà èðîåâøà :exp"
+
+#: builtin.c:158
+#, c-format
+msgid "exp: argument %g is out of range"
+msgstr "øúåîä íåçúá åðéà %g èðîåâøà :exp"
+
+#: builtin.c:216
+#, c-format
+msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
+msgstr "äáéúëì àì ,äàéø÷ì çåúô `%s' ÷éôà :õöåçä ï÷åøì ïúéð àì :fflush"
+
+#: builtin.c:219
+#, c-format
+msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
+msgstr "äáéúëì àì ,äàéø÷ì çåúô `%s' õáå÷ :õöåçä ï÷åøì ïúéð àì :fflush"
+
+#: builtin.c:231
+#, c-format
+msgid "fflush: `%s' is not an open file, pipe or co-process"
+msgstr "ìéá÷î êéìäú åà çåúô ÷éôà ,çåúô õáå÷ åðéà `%s' :fflush"
+
+#: builtin.c:325
+msgid "index: received non-string first argument"
+msgstr "úæåøçî åðéà ïåùàø èðîåâøà :index"
+
+#: builtin.c:327
+msgid "index: received non-string second argument"
+msgstr "úæåøçî åðéà éðù èðîåâøà :index"
+
+#: builtin.c:437
+msgid "int: received non-numeric argument"
+msgstr "øôñî åðéà èðîåâøà :int"
+
+#: builtin.c:454
+msgid "length: received non-string argument"
+msgstr "úæåøçî åðéà èðîåâøà :length"
+
+#: builtin.c:470
+msgid "log: received non-numeric argument"
+msgstr "øôñî åðéà èðîåâøà :log"
+
+#: builtin.c:473
+#, c-format
+msgid "log: received negative argument %g"
+msgstr "%g éìéìù èðîåâøà íò àø÷ð :log"
+
+#: builtin.c:635 builtin.c:638
+msgid "must use `count$' on all formats or none"
+msgstr "ãçà óàá åà íéèîøåôä ìëá åà øúåî `count$'-á ùåîéù"
+
+#: builtin.c:740
+msgid "`$' is not permitted in awk formats"
+msgstr "awk ìù íéèîøåôá ùåîéùì øåñà `$'"
+
+#: builtin.c:746
+msgid "arg count with `$' must be > 0"
+msgstr "0-î ìåãâ úåéäì áééç `$' ãéì èðîåâøàä äðåî"
+
+#: builtin.c:748
+#, fuzzy, c-format
+msgid "arg count %ld greater than total number of supplied arguments"
+msgstr "íéèðîåâøàä ìù ììåëä íøôñîî ìåãâ %d èðîåâøàä äðåî"
+
+#: builtin.c:750
+msgid "`$' not permitted after period in format"
+msgstr "èîøåôá äãå÷ðä éøçà òéôåäì ìåëé åðéà `$'"
+
+#: builtin.c:763
+msgid "no `$' supplied for positional field width or precision"
+msgstr "å÷åéã åà äãù áçåø ïééöîá èðîåâøàä äðåî øåáò `$' àöîð àì"
+
+#: builtin.c:821
+msgid "`l' is meaningless in awk formats; ignored"
+msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `l'"
+
+#: builtin.c:825
+msgid "`l' is not permitted in POSIX awk formats"
+msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `l'"
+
+#: builtin.c:836
+msgid "`L' is meaningless in awk formats; ignored"
+msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `L'"
+
+#: builtin.c:840
+msgid "`L' is not permitted in POSIX awk formats"
+msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `L'"
+
+#: builtin.c:851
+msgid "`h' is meaningless in awk formats; ignored"
+msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `h'"
+
+#: builtin.c:855
+msgid "`h' is not permitted in POSIX awk formats"
+msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `h'"
+
+#: builtin.c:1055
+#, c-format
+msgid "[s]printf: value %g is out of range for `%%%c' format"
+msgstr ""
+
+#: builtin.c:1108
+msgid "not enough arguments to satisfy format string"
+msgstr "èîøåôä øåáò íéèðîåâøà ÷éôñî ïéà"
+
+#: builtin.c:1110
+msgid "^ ran out for this one"
+msgstr "^ íéèðîåâøàä éì åøîâð ïàë"
+
+#: builtin.c:1115
+msgid "[s]printf: format specifier does not have control letter"
+msgstr "äøîää úø÷á úåà ìéëî åðéà èîøåôä :[s]printf"
+
+#: builtin.c:1118
+msgid "too many arguments supplied for format string"
+msgstr "èîøåôä øåáò íéèðîåâøà éãî øúåé"
+
+#: builtin.c:1184 builtin.c:1187
+msgid "printf: no arguments"
+msgstr "èðîåâøà óà ïéà :printf"
+
+#: builtin.c:1211
+msgid "sqrt: received non-numeric argument"
+msgstr "øôñî åðéà èðîåâøà :sqrt"
+
+#: builtin.c:1215
+#, c-format
+msgid "sqrt: called with negative argument %g"
+msgstr "%g éìéìù èðîåâøà íò àø÷ð :sqrt"
+
+#: builtin.c:1238
+#, c-format
+msgid "substr: start index %g is invalid, using 1"
+msgstr "1-á óìçåä ,éåâù åðéä %g äìçúä ïééöî :substr"
+
+#: builtin.c:1243
+#, c-format
+msgid "substr: non-integer start index %g will be truncated"
+msgstr "õöå÷é ,íìù øôñî åðéàù, %g äìçúä ïééöî ìù åëøò :substr"
+
+#: builtin.c:1262
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 1"
+msgstr "0-î ìåãâ øôñî åððéà %g êøåà :substr"
+
+#: builtin.c:1264
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 0"
+msgstr "0-î ìåãâ øôñî åððéà %g êøåà :substr"
+
+#: builtin.c:1271
+#, c-format
+msgid "substr: non-integer length %g will be truncated"
+msgstr "õöå÷é ,íìù øôñî åðéàù ,%g êøåà :substr"
+
+#: builtin.c:1276
+#, c-format
+msgid "substr: length %g too big for string indexing, truncating to %g"
+msgstr ""
+
+#: builtin.c:1288
+msgid "substr: source string is zero length"
+msgstr "ñôà êøåàá äðéä øå÷îä úæåøçî :substr"
+
+#: builtin.c:1294
+#, fuzzy, c-format
+msgid "substr: start index %g is past end of string"
+msgstr "úæåøçîä óåñì øáòî åðéä %d äìçúä ïééöî :substr"
+
+#: builtin.c:1302
+#, fuzzy, c-format
+msgid ""
+"substr: length %g at start index %g exceeds length of first argument (%lu)"
+msgstr ""
+"%d äëøåàå %d ïééöîá äúìéçúù úæåøçî-úúì ÷éôñî åðéà (%d) úæåøçî êøåà :substr"
+
+#: builtin.c:1337
+msgid "strftime: received non-string first argument"
+msgstr "úæåøçî åðéà ïåùàø èðîåâøà :strftime"
+
+#: builtin.c:1343
+msgid "strftime: received empty format string"
+msgstr "ä÷éø èîøåô úæåøçî :strftime"
+
+#: builtin.c:1352
+msgid "strftime: received non-numeric second argument"
+msgstr "øôñî åðéà éðù èðîåâøà :strftime"
+
+#: builtin.c:1415
+msgid "mktime: received non-string argument"
+msgstr "úæåøçî åðéà èðîåâøà :mktime"
+
+#: builtin.c:1460
+msgid "system: received non-string argument"
+msgstr "úæåøçî åðéà èðîåâøà :system"
+
+#: builtin.c:1581 eval.c:1883
+#, fuzzy, c-format
+msgid "reference to uninitialized field `$%d'"
+msgstr "`%s' ìçåúî-éúìá äðúùîì äéðôä"
+
+#: builtin.c:1608
+msgid "tolower: received non-string argument"
+msgstr "úæåøçî åðéà èðîåâøà :tolower"
+
+#: builtin.c:1657
+msgid "toupper: received non-string argument"
+msgstr "úæåøçî åðéà èðîåâøà :toupper"
+
+#: builtin.c:1702
+msgid "atan2: received non-numeric first argument"
+msgstr "øôñî åðéà ïåùàø èðîåâøà :atan2"
+
+#: builtin.c:1704
+msgid "atan2: received non-numeric second argument"
+msgstr "øôñî åðéà éðù èðîåâøà :atan2"
+
+#: builtin.c:1723
+msgid "sin: received non-numeric argument"
+msgstr "øôñî åðéà èðîåâøà :sin"
+
+#: builtin.c:1739
+msgid "cos: received non-numeric argument"
+msgstr "øôñî åðéà èðîåâøà :cos"
+
+#: builtin.c:1788
+msgid "srand: received non-numeric argument"
+msgstr "øôñî åðéà èðîåâøà :srand"
+
+#: builtin.c:1823
+msgid "match: third argument is not an array"
+msgstr "êøòî åðéà éùéìù èðîåâøà :match"
+
+#: builtin.c:2307
+msgid "gensub: third argument of 0 treated as 1"
+msgstr "1-á óìçåä 0 åëøòù éùéìù èðîåâøà :gensub"
+
+#: builtin.c:2416 builtin.c:2418
+msgid "lshift: received non-numeric first argument"
+msgstr "øôñî åðéà ïåùàø èðîåâøà :lshift"
+
+#: builtin.c:2420
+#, c-format
+msgid "lshift(%lf, %lf): negative values will give strange results"
+msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :lshift(%lf, %lf)"
+
+#: builtin.c:2422
+#, c-format
+msgid "lshift(%lf, %lf): fractional values will be truncated"
+msgstr "åööå÷é íéøåáù íéëøò :lshift(%lf, %lf)"
+
+#: builtin.c:2424
+#, c-format
+msgid "lshift(%lf, %lf): too large shift value will give strange results"
+msgstr "úåéåôö-éúìá úåàöåú áéðé éãî ìåãâ äææä øåòéù :lshift(%lf, %lf)"
+
+#: builtin.c:2453 builtin.c:2455
+msgid "rshift: received non-numeric first argument"
+msgstr "øôñî åðéà ïåùàø èðîåâøà :rshift"
+
+#: builtin.c:2457
+#, c-format
+msgid "rshift(%lf, %lf): negative values will give strange results"
+msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :rshift(%lf, %lf)"
+
+#: builtin.c:2459
+#, c-format
+msgid "rshift(%lf, %lf): fractional values will be truncated"
+msgstr "åööå÷é íéøåáù íéëøò :rshift(%lf, %lf)"
+
+#: builtin.c:2461
+#, c-format
+msgid "rshift(%lf, %lf): too large shift value will give strange results"
+msgstr "úåéåôö-éúìá úåàöåú áéðé éãî ìåãâ äææä øåòéù :rshift(%lf, %lf)"
+
+#: builtin.c:2490 builtin.c:2492
+msgid "and: received non-numeric first argument"
+msgstr "øôñî åðéà ïåùàø èðîåâøà :and"
+
+#: builtin.c:2494
+#, c-format
+msgid "and(%lf, %lf): negative values will give strange results"
+msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :and(%lf, %lf)"
+
+#: builtin.c:2496
+#, c-format
+msgid "and(%lf, %lf): fractional values will be truncated"
+msgstr "åööå÷é íéøåáù íéëøò :and(%lf, %lf)"
+
+#: builtin.c:2525 builtin.c:2527
+msgid "or: received non-numeric first argument"
+msgstr "øôñî åðéà ïåùàø èðîåâøà :or"
+
+#: builtin.c:2529
+#, c-format
+msgid "or(%lf, %lf): negative values will give strange results"
+msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :or(%lf, %lf)"
+
+#: builtin.c:2531
+#, c-format
+msgid "or(%lf, %lf): fractional values will be truncated"
+msgstr "åööå÷é íéøåáù íéëøò :or(%lf, %lf)"
+
+#: builtin.c:2560 builtin.c:2562
+msgid "xor: received non-numeric first argument"
+msgstr "øôñî åðéà ïåùàø èðîåâøà :xor"
+
+#: builtin.c:2564
+#, c-format
+msgid "xor(%lf, %lf): negative values will give strange results"
+msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :xor(%lf, %lf)"
+
+#: builtin.c:2566
+#, c-format
+msgid "xor(%lf, %lf): fractional values will be truncated"
+msgstr "åööå÷é íéøåáù íéëøò :xor(%lf, %lf)"
+
+#: builtin.c:2594
+msgid "compl: received non-numeric argument"
+msgstr "øôñî åðéà èðîåâøà :compl"
+
+#: builtin.c:2596
+#, c-format
+msgid "compl(%lf): negative value will give strange results"
+msgstr "úåéåôö-éúìá úåàöåú áéðé éìéìù êøò :compl(%lf)"
+
+#: builtin.c:2598
+#, c-format
+msgid "compl(%lf): fractional value will be truncated"
+msgstr "õöå÷é øåáù êøò :compl(%lf)"
+
+#: builtin.c:2771
+#, c-format
+msgid "dcgettext: `%s' is not a valid locale category"
+msgstr "äðé÷ú íå÷éî úééøåâè÷ åðéà `%s' :dcgettext"
+
+#: eval.c:266
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "%d ääåæî-éúìá âåñ ìòá node"
+
+#: eval.c:312
+msgid "buffer overflow in genflags2str"
+msgstr "genflags2str-á õöåç úùéìâ"
+
+#: eval.c:647
+#, fuzzy, c-format
+msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
+msgstr "(`%s' êøòî) äàìåìä òåöéá êìäîá %d-î %d-ì äðåù êøòî ìù åìãåâ :for úàìåì"
+
+#: eval.c:668
+msgid "`break' outside a loop is not portable"
+msgstr "éìéáèøåô åðéà äàìåìì õåçî `break'"
+
+#: eval.c:672
+msgid "`break' outside a loop is not allowed"
+msgstr "äàìåìì õåçî `break'-á ùîúùäì ïéà"
+
+#: eval.c:689
+msgid "`continue' outside a loop is not portable"
+msgstr "éìéáèøåô åðéà äàìåìì õåçî `continue'"
+
+#: eval.c:693
+msgid "`continue' outside a loop is not allowed"
+msgstr "äàìåìì õåçî `continue'-á ùîúùäì ïéà"
+
+#: eval.c:727
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "BEGIN éììë êåúî `next'-ì àåø÷ì ïéà"
+
+#: eval.c:729
+msgid "`next' cannot be called from an END rule"
+msgstr "END éììë êåúî `next'-ì àåø÷ì ïéà"
+
+#: eval.c:738
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "BEGIN éììë êåúî `nextfile'-ì àåø÷ì ïéà"
+
+#: eval.c:740
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "END éììë êåúî `nextfile'-ì àåø÷ì ïéà"
+
+#: eval.c:785
+msgid "statement has no effect"
+msgstr "úéìëú-úìåèð äàøåä"
+
+#: eval.c:828 eval.c:1726
+#, c-format
+msgid "can't use function name `%s' as variable or array"
+msgstr "êøòî åà äðúùîë `%s' äéö÷ðåô íùá ùîúùäì ïéà"
+
+#: eval.c:835 eval.c:841
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "`%s' ìçåúî-éúìá èðîåâøàì äéðôä"
+
+#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807
+#, c-format
+msgid "attempt to use array `%s' in a scalar context"
+msgstr "øàì÷ñ ùøåãä èñ÷èðå÷á `%s' êøòîá ùåîéù ïåéñð"
+
+#: eval.c:858 eval.c:1752
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "`%s' ìçåúî-éúìá äðúùîì äéðôä"
+
+#: eval.c:1007
+msgid ""
+"concatenation: side effects in one expression have changed the length of "
+"another!"
+msgstr ""
+"!øçà éåèéá ìù åëøåà éåðéùì åîøâ ãçà éåèéá áåùéç ìù éàåì-úåòôåú :concatenation"
+
+#: eval.c:1032
+msgid "assignment used in conditional context"
+msgstr "éàðú ìù èñ÷èðå÷á äîùäá ùåîéù"
+
+#: eval.c:1122
+msgid "division by zero attempted"
+msgstr "ñôàá ä÷åìç ïåéñð"
+
+#: eval.c:1137
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "`%%'-á ñôàá ä÷åìç ïåéñð"
+
+#: eval.c:1152 profile.c:683
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "tree_eval-á (%s) éåâù âåñ"
+
+#: eval.c:1328
+msgid "division by zero attempted in `/='"
+msgstr "`/='-á ñôàá ä÷åìç ïåéñð"
+
+#: eval.c:1346
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "`%%='-á ñôàá ä÷åìç ïåéñð"
+
+#: eval.c:1586
+#, c-format
+msgid "function `%s' called with more arguments than declared"
+msgstr "äúæøëäá øùàî íéèðîåâøà øúåé íò `%s' äéö÷ðåôì äàéø÷"
+
+#: eval.c:1633
+#, c-format
+msgid "function `%s' not defined"
+msgstr "úøãâåî äðéà `%s' äéö÷ðåô"
+
+#: eval.c:1639
+#, c-format
+msgid "function %s called\n"
+msgstr "`%s' äéö÷ðåôì äàéø÷\n"
+
+#: eval.c:1698
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# :úåéö÷ðåôì úåàéø÷ä úéðñçî\n"
+"\n"
+
+#: eval.c:1701
+msgid "\t# -- main --\n"
+msgstr "\t# -- main --\n"
+
+#: eval.c:1867
+msgid "attempt to field reference from non-numeric value"
+msgstr "øôñî åðéàù êøò úåòöîàá äãùì äéðôä ïåéñð"
+
+#: eval.c:1869
+msgid "attempt to reference from null string"
+msgstr "ä÷éø úæåøçî úåòöîàá äãùì äéðôä ïåéñð"
+
+#: eval.c:1875
+#, c-format
+msgid "attempt to access field %d"
+msgstr "%d 'ñî äãùì äùéâ ïåéñð"
+
+#: eval.c:1896 eval.c:1903 profile.c:900
+msgid "assignment is not allowed to result of builtin function"
+msgstr "úéðáåî äéö÷ðåô ìù äàöåúá êøò áéöäì ïéà"
+
+#: eval.c:1951
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `IGNORECASE'"
+
+#: eval.c:1980
+msgid "`BINMODE' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `BINMODE'"
+
+#: eval.c:2092
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "äðé÷ú `%sFMT' úøãâä åðéà `%s'"
+
+#: eval.c:2170
+msgid "turning off `--lint' due to assignment to `LINT'"
+msgstr "`LINT'-ì êøò úîùä á÷ò `--lint' ìèáî"
+
+#: ext.c:60 ext.c:64
+msgid "`extension' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä äðéä `extension'"
+
+#: ext.c:74
+#, c-format
+msgid "extension: cannot open `%s' (%s)\n"
+msgstr "`%s' úçéúô úòá (%s) äì÷ú äòøéà :extension\n"
+
+#: ext.c:82
+#, c-format
+msgid "extension: library `%s': cannot call function `%s' (%s)\n"
+msgstr "`%s' äéøôñî `%s' äéö÷ðåôì äàéø÷á (%s) äì÷ú äòøéà :extension\n"
+
+#: ext.c:183
+msgid "Operation Not Supported"
+msgstr "úëîúð äðéà åæ äìåòô"
+
+#: field.c:315
+msgid "NF set to negative value"
+msgstr "éìéìù êøò ìáé÷ NF"
+
+#: field.c:808
+msgid "split: second argument is not an array"
+msgstr "êøòî åðéà `split' ìù éðùä èðîåâøàä"
+
+#: field.c:842
+msgid "split: null string for third arg is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä äðéä `split'-ì éùéìù èðåîâøàë úñôåàî úæåøçî"
+
+#: field.c:894
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `FIELDWIDTHS'"
+
+#: field.c:921
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "0-î ìåãâ úåéäì áééç FIELDWIDTHS-á %d 'ñî äãù"
+
+#: field.c:994
+msgid "null string for `FS' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä äðéä `FS'-ë úñôåàî úæåøçî"
+
+# The way the leading "%s:" is translated is a terrible kludge,
+# but what can I do? FIXME.
+#: getopt.c:692 getopt.c:704
+#, c-format
+msgid "%s: option `%s' is ambiguous\n"
+msgstr "%s úéðëú øåáò éòîùî-ãç åðéà `%s' ïééôàî\n"
+
+#: getopt.c:737 getopt.c:741
+#, c-format
+msgid "%s: option `--%s' doesn't allow an argument\n"
+msgstr "%s úéðëú øåáò èðîåâøà ìá÷î åðéà `--%s' ïééôàî\n"
+
+#: getopt.c:750 getopt.c:755
+#, c-format
+msgid "%s: option `%c%s' doesn't allow an argument\n"
+msgstr "%s úéðëú øåáò èðîåâøà ìá÷î åðéà `%c%s' ïééôàî\n"
+
+#: getopt.c:791 getopt.c:804 getopt.c:1093 getopt.c:1106
+#, c-format
+msgid "%s: option `%s' requires an argument\n"
+msgstr "%s úéðëú øåáò èðîåâøà áééçî `%s' ïééôàî\n"
+
+#: getopt.c:842 getopt.c:845
+#, c-format
+msgid "%s: unrecognized option `--%s'\n"
+msgstr "%s úéðëú øåáò `--%s' ääåæî-éúìá ïééôàî\n"
+
+#: getopt.c:853 getopt.c:856
+#, c-format
+msgid "%s: unrecognized option `%c%s'\n"
+msgstr "%s úéðëú øåáò `%c%s' ääåæî-éúìá ïééôàî\n"
+
+# "Illegal" is against GNU coding standards, but since Posix requires
+# it (see the comment below), let's say that in Hebrew as well...
+#: getopt.c:903 getopt.c:906
+#, c-format
+msgid "%s: illegal option -- %c\n"
+msgstr "%s: é÷åç-éúìá ïééôàî -- %c\n"
+
+#: getopt.c:912 getopt.c:915
+#, c-format
+msgid "%s: invalid option -- %c\n"
+msgstr "%s úéðëú øåáò éåâù ïééôàî -- %c\n"
+
+#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434
+#, c-format
+msgid "%s: option requires an argument -- %c\n"
+msgstr "%s: èðîåâøà áééçî ïééôàî -- %c\n"
+
+#: getopt.c:1025 getopt.c:1036
+#, c-format
+msgid "%s: option `-W %s' is ambiguous\n"
+msgstr "%s úéðëú øåáò éòîùî-ãç åðéà `-W %s' ïééôàî\n"
+
+#: getopt.c:1060 getopt.c:1072
+#, c-format
+msgid "%s: option `-W %s' doesn't allow an argument\n"
+msgstr "%s úéðëú øåáò èðîåâøà ìá÷î åðéà `-W %s' ïééôàî\n"
+
+#: io.c:305
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "åúàéø÷ íùì `%s' õáå÷ úçéúôá (%s) äì÷ú"
+
+#: io.c:392
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "(%d èìô/èì÷ õåøò) `%s' úøéâñá (%s) äì÷ú"
+
+#: io.c:530
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "redirect() äéö÷ðåôá %s éåâù õò âåñ"
+
+#: io.c:536
+#, c-format
+msgid "expression in `%s' redirection only has numeric value"
+msgstr "ãáìá éøîåð êøò áéðî `%s' èìô/èì÷ úééðôäá éåèéá"
+
+#: io.c:542
+#, c-format
+msgid "expression for `%s' redirection has null string value"
+msgstr "ä÷éø úæåøçî áéðî `%s' èìô/èì÷ úééðôäá éåèéá"
+
+#: io.c:547
+#, c-format
+msgid "filename `%s' for `%s' redirection may be result of logical expression"
+msgstr "éâåì éåèéá ìù äàöåú úåéäì ìåìò `%s' õáå÷ íù `%s' èìô/èì÷ úééðôäá"
+
+#: io.c:569
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "`%.*s' õáå÷ øåáò `>>'-á ïäå `>'-á ïä øúåéî ùåîéù"
+
+#: io.c:621
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "èìô êøåöì `%s' ÷éôà úçéúôá (%s) äì÷ú"
+
+#: io.c:630
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "èì÷ êøåöì `%s' ÷éôà úçéúôá (%s) äì÷ú"
+
+#: io.c:643
+#, c-format
+msgid "can't open two way socket `%s' for input/output (%s)"
+msgstr "èìô/èì÷ êøåöì éðååéë-åã (socket) ò÷ùë `%s' úçéúôá (%s) äì÷ú"
+
+#: io.c:647
+#, c-format
+msgid "can't open two way pipe `%s' for input/output (%s)"
+msgstr "èìô/èì÷ êøåöì éðååéë-åã (pipe) ÷éôàë `%s' úçéúôá (%s) äì÷ú"
+
+#: io.c:723
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "`%s'-î äééðôäá (%s) äì÷ú"
+
+#: io.c:726
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "`%s' ìà äééðôäá (%s) äì÷ú"
+
+#: io.c:765
+msgid ""
+"reached system limit for open files: starting to multiplex file descriptors"
+msgstr "èìô/èì÷ éöåøò áåáéø úìéçú ;íéçåúô íéöá÷ øôñî ìù úëøòî úìáâîì äòâä"
+
+#: io.c:777
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "`%s' úøéâñá (%s) äì÷ú"
+
+#: io.c:784
+msgid "too many pipes or input files open"
+msgstr "úéðîæ-åá íéçåúô èì÷ éöá÷ åà (pipes) íé÷éôà éãî øúåé"
+
+#: io.c:807
+msgid "close: second argument must be `to' or `from'"
+msgstr "`from' åà `to' úåéäì áééç `close' ìù éðùä èðîåâøàä"
+
+#: io.c:821
+#, c-format
+msgid "close: `%.*s' is not an open file, pipe or co-process"
+msgstr "ìéá÷î êéìäú åà çåúô ÷éôà ,çåúô õáå÷ åðéà `%.*s' :close"
+
+#: io.c:825
+msgid "close of redirection that was never opened"
+msgstr "íìåòî äçúôð àìù äééðôä úøéâñ"
+
+#: io.c:862
+#, c-format
+msgid "close: redirection `%s' not opened with `|&', second argument ignored"
+msgstr "çðæåä éðùä èðîåâøàä ,`|&' é\"ò äçúôð àì `%s' äééðôä"
+
+#: io.c:924
+#, c-format
+msgid "failure status (%d) on pipe close of `%s' (%s)"
+msgstr "(%d äì÷ú ãå÷) `%s'-ì ÷éôà úøéâñá (%s) äì÷ú"
+
+#: io.c:927
+#, c-format
+msgid "failure status (%d) on file close of `%s' (%s)"
+msgstr "(%d äì÷ú ãå÷) `%s' õáå÷ úøéâñá (%s) äì÷ú"
+
+#: io.c:946
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "ùøåôîá øâñð àì (socket) `%s' ò÷ù"
+
+#: io.c:949
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "ùøåôîá øâñð àì (co-process) `%s' ìéá÷î êéìäú"
+
+#: io.c:952
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "ùøåôîá øâñð àì (pipe) `%s' ÷éôà"
+
+#: io.c:955
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "ùøåôîá øâñð àì `%s' õáå÷"
+
+#: io.c:984 io.c:1038
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "éð÷ú èìô õåøòì äáéúëá (%s) äì÷ú"
+
+#: io.c:988 io.c:1042
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "éð÷ú úåàéâù õåøòì äáéúëá (%s) äì÷ú"
+
+#: io.c:996
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "`%s'-ì ÷éôà ìù õöåç ïå÷éøá (%s) äì÷ú"
+
+#: io.c:999
+#, c-format
+msgid "co-process flush of pipe to `%s' failed (%s)."
+msgstr "`%s'-ì ìéá÷î êéìäú ÷éôà ìù õöåç ïå÷éøá (%s) äì÷ú"
+
+#: io.c:1002
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "`%s' ìù õáå÷ éðåúð õöåç ïå÷éøá (%s) äì÷ú"
+
+#: io.c:1161
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "ïëåî íøè /inet/raw çå÷ì ,íéøòèöî"
+
+#: io.c:1163 io.c:1200
+msgid "only root may use `/inet/raw'."
+msgstr "ãáìá root ùîúùîì øúåî `inet/raw'-á ùåîéù"
+
+#: io.c:1198
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "ïëåî íøè /inet/raw úøù ,íéøòèöî"
+
+#: io.c:1288
+#, c-format
+msgid "no (known) protocol supplied in special filename `%s'"
+msgstr "`%s' ãçåéî õáå÷ íùá ääåæî-éúìá åà øñç ìå÷åèåøô"
+
+#: io.c:1306
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "íìù åðéà `%s' ãçåéî õáå÷"
+
+#: io.c:1318
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "`%s'-á äéåâù úéîå÷î äàéöé"
+
+#: io.c:1330
+msgid "must supply a remote hostname to `/inet'"
+msgstr "`/inet' øåáò ÷çåøî çøàî-áùçî íù øéãâäì äáåç"
+
+#: io.c:1345
+msgid "must supply a remote port to `/inet'"
+msgstr "`/inet' øåáò ú÷çåøî äàéöé øéãâäì äáåç"
+
+#: io.c:1351
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "`%s'-á äéåâù ú÷çåøî äàéöé"
+
+#: io.c:1361
+msgid "TCP/IP communications are not supported"
+msgstr "TCP/IP úøåù÷úá äëéîú ïéà"
+
+#: io.c:1370 io.c:1551
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "äé÷éú åðéä `%s' õáå÷"
+
+#: io.c:1440
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "`PROCINFO[\"%s\"]'-á ùîúùäì óéãò `%s' íå÷îá"
+
+#: io.c:1472
+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:1537 io.c:1711
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "`%s' øåáò `%s' äìåòô ïôåà úçéúôá ïåìùë"
+
+#: io.c:1762
+#, fuzzy, c-format
+msgid "close of master pty failed (%s)"
+msgstr "÷éôà úøéâñá (%s) äì÷ú"
+
+#: io.c:1764 io.c:1916 io.c:2068
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "úá-úéðëúá stdout úøéâñá (%s) äì÷ú"
+
+#: io.c:1767
+#, fuzzy, c-format
+msgid "moving slave pty to stdout in child failed (dup: %s)"
+msgstr "úá-úéðëúá stdout-ì ÷éôà ìåôëùá (dup: %s) äì÷ú"
+
+#: io.c:1769 io.c:1921
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "úá-úéðëúá stdin úøéâñá (%s) äì÷ú"
+
+#: io.c:1772
+#, fuzzy, c-format
+msgid "moving slave pty to stdin in child failed (dup: %s)"
+msgstr "úá-úéðëúá stdin-ì ÷éôà ìåôëùá (dup: %s) äì÷ú"
+
+#: io.c:1774 io.c:1793
+#, fuzzy, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "÷éôà úøéâñá (%s) äì÷ú"
+
+#: io.c:1867 io.c:1919 io.c:2049 io.c:2071
+#, c-format
+msgid "moving pipe to stdout in child failed (dup: %s)"
+msgstr "úá-úéðëúá stdout-ì ÷éôà ìåôëùá (dup: %s) äì÷ú"
+
+#: io.c:1871 io.c:1924
+#, c-format
+msgid "moving pipe to stdin in child failed (dup: %s)"
+msgstr "úá-úéðëúá stdin-ì ÷éôà ìåôëùá (dup: %s) äì÷ú"
+
+#: io.c:1888 io.c:2062
+msgid "restoring stdout in parent process failed\n"
+msgstr "áà-úéðëúá stdout ÷éôà øåæçùá äì÷ú\n"
+
+#: io.c:1893
+msgid "restoring stdin in parent process failed\n"
+msgstr "áà-úéðëúá stdin ÷éôà øåæçùá äì÷ú\n"
+
+#: io.c:1927 io.c:2073 io.c:2084
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "÷éôà úøéâñá (%s) äì÷ú"
+
+#: io.c:1972
+msgid "`|&' not supported"
+msgstr "`|&'-á äëéîú ïéà"
+
+#: io.c:2039
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "`%s' ÷éôà úçéúôá (%s) äì÷ú"
+
+#: io.c:2080
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr "`%s' úá-úéðëúì êéìäú úøéöéá (fork: %s) äì÷ú"
+
+#: io.c:2423
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "÷éø åðéä `%s' íéðåúð õáå÷"
+
+#: io.c:2466 io.c:2474
+msgid "could not allocate more input memory"
+msgstr ""
+
+#: io.c:2832 io.c:2895
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "`%s' õáå÷ úàéø÷á (%s) äì÷ú"
+
+#: io.c:3020
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä äðéä `RS' ìù êøòá íéåú øôñîá äëéîú"
+
+#: main.c:324
+msgid "`-m[fr]' option irrelevant in gawk"
+msgstr "gawk øåáò éèðååìø åðéà `-m[fr]' ïééôàî"
+
+#: main.c:326
+msgid "-m option usage: `-m[fr] nnn'"
+msgstr "`-m[fr] nnn' :-m ïééôàîá ùåîéù ïôåà"
+
+#: main.c:343
+#, c-format
+msgid "%s: option `-W %s' unrecognized, ignored\n"
+msgstr "çðæåä ,%s úéðëú øåáò øëåî åðéà `-W %s' ïééôàî\n"
+
+#: main.c:380
+msgid "empty argument to `--source' ignored"
+msgstr "çðæåä `--source'-ì ÷éø èðîåâøà"
+
+#: main.c:451
+msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
+msgstr "`--posix' ìéòôî :øãâåî `POSIXLY_CORRECT' äáéáñ äðúùî"
+
+#: main.c:456
+msgid "`--posix' overrides `--traditional'"
+msgstr "`--traditional' ìò øáåâ `--posix'"
+
+#: main.c:467
+msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
+msgstr "`--non-decimal-data' ìò øáåâ `--posix'/`--traditional'"
+
+#: main.c:471
+#, c-format
+msgid "running %s setuid root may be a security problem"
+msgstr "òãéî úçèáàá òåâôì äìåìò setuid root-ë %s úöøä"
+
+#: main.c:512
+#, fuzzy, c-format
+msgid "can't set binary mode on stdin (%s)"
+msgstr "stdin úìåòô ïôåà úòéá÷á (%s) äì÷ú"
+
+#: main.c:515
+#, fuzzy, c-format
+msgid "can't set binary mode on stdout (%s)"
+msgstr "stdout úìåòô ïôåà úòéá÷á (%s) äì÷ú"
+
+#: main.c:517
+#, fuzzy, c-format
+msgid "can't set binary mode on stderr (%s)"
+msgstr "stderr úìåòô ïôåà úòéá÷á (%s) äì÷ú"
+
+#: main.c:547
+msgid "no program text at all!"
+msgstr "!ììë àöîðá äéä àì úéðëú ìù èñ÷è"
+
+#: main.c:620
+#, c-format
+msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
+msgstr ""
+"%s [GNU åà POSIX ïåðâñá íéðééôàî] -f úéðëú-íù [--] õáå÷-íù ... :ùåîéù ïôåà\n"
+
+#: main.c:622
+#, c-format
+msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
+msgstr ""
+"%s [GNU åà POSIX ïåðâñá íéðééôàî] [--] %cúéðëú%c õáå÷-íù ... :ùåîéù ïôåà\n"
+
+#: main.c:627
+msgid "POSIX options:\t\tGNU long options:\n"
+msgstr ":POSIX éðééôàî\t\t:íéëåøà GNU éðééôàî\n"
+
+#: main.c:628
+msgid "\t-f progfile\t\t--file=progfile\n"
+msgstr "\t-f úéðëú-õáå÷\t\t--file=úéðëú-õáå÷\n"
+
+#: main.c:629
+msgid "\t-F fs\t\t\t--field-separator=fs\n"
+msgstr "\t-F úåãù-ãéøôî\t\t--field-separator=úåãù-ãéøôî\n"
+
+#: main.c:630
+msgid "\t-v var=val\t\t--assign=var=val\n"
+msgstr "\t-v äðúùî=êøò\t\t--assign=äðúùî=êøò\n"
+
+#: main.c:631
+msgid "\t-m[fr] val\n"
+msgstr "\t-m[fr] êøò\n"
+
+#: main.c:632
+msgid "\t-W compat\t\t--compat\n"
+msgstr "\t-W compat\t\t--compat\n"
+
+#: main.c:633
+msgid "\t-W copyleft\t\t--copyleft\n"
+msgstr "\t-W copyleft\t\t--copyleft\n"
+
+#: main.c:634
+msgid "\t-W copyright\t\t--copyright\n"
+msgstr "\t-W copyright\t\t--copyright\n"
+
+#: main.c:635
+msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
+msgstr "\t-W dump-variables[=õáå÷-íù]\t--dump-variables[=õáå÷-íù]\n"
+
+#: main.c:636
+msgid "\t-W gen-po\t\t--gen-po\n"
+msgstr "\t-W gen-po\t\t--gen-po\n"
+
+#: main.c:637
+msgid "\t-W help\t\t\t--help\n"
+msgstr "\t-W help\t\t\t--help\n"
+
+#: main.c:638
+msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+
+#: main.c:639
+msgid "\t-W lint-old\t\t--lint-old\n"
+msgstr "\t-W lint-old\t\t--lint-old\n"
+
+#: main.c:640
+msgid "\t-W non-decimal-data\t--non-decimal-data\n"
+msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
+
+#: main.c:642
+msgid "\t-W nostalgia\t\t--nostalgia\n"
+msgstr "\t-W nostalgia\t\t--nostalgia\n"
+
+#: main.c:645
+msgid "\t-W parsedebug\t\t--parsedebug\n"
+msgstr "\t-W parsedebug\t\t--parsedebug\n"
+
+#: main.c:647
+msgid "\t-W profile[=file]\t--profile[=file]\n"
+msgstr "\t-W profile[=õáå÷-íù]\t--profile[=õáå÷-íù]\n"
+
+#: main.c:648
+msgid "\t-W posix\t\t--posix\n"
+msgstr "\t-W posix\t\t--posix\n"
+
+#: main.c:649
+msgid "\t-W re-interval\t\t--re-interval\n"
+msgstr "\t-W re-interval\t\t--re-interval\n"
+
+#: main.c:650
+msgid "\t-W source=program-text\t--source=program-text\n"
+msgstr "\t-W source=úéðëú-èñ÷è\t--source=úéðëú-èñ÷è\n"
+
+#: main.c:651
+msgid "\t-W traditional\t\t--traditional\n"
+msgstr "\t-W traditional\t\t--traditional\n"
+
+#: main.c:652
+msgid "\t-W usage\t\t--usage\n"
+msgstr "\t-W usage\t\t--usage\n"
+
+#: main.c:653
+msgid "\t-W version\t\t--version\n"
+msgstr "\t-W version\t\t--version\n"
+
+#: main.c:657
+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:661
+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:665
+msgid ""
+"Examples:\n"
+"\tgawk '{ sum += $1 }; END { print sum }' file\n"
+"\tgawk -F: '{ print $1 }' /etc/passwd\n"
+msgstr ""
+" :úåàîâåã\n"
+"\tgawk '{ sum += $1 }; END { print sum }' file\n"
+"\tgawk -F: '{ print $1 }' /etc/passwd\n"
+
+#: main.c:682
+#, 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"
+"óåôëá äúåðùì åà/å äöéôäì íëúåëæ ;úéùôç äðëú äðéä åæ úéðëú\n"
+" é\"ò øåàì àöåéä ,GNU General Public License ïåéùøä éàðúì\n"
+" íàå ,ïåéùøä ìù 2 àñøâá íà ;Free Software Foundation\n"
+" .øúåé úøçåàî àñøâ ìëá (íëì äøåîùä äéöôåàë)\n"
+
+#: main.c:690
+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 ""
+",úìòåú àéáú àéäù äåå÷ú êåúî úöôåî åæ úéðëú\n"
+"òîúùîá-úåéøçà àì åìéôà ;úåéøçà áúë ìë àìì íìåà\n"
+",íéèøôì .úîéåñî úéìëú åæéàì äîàúä åà úåøéçñ ìù\n"
+" .GNU General Public License-á åðééò àðà\n"
+
+#: main.c:696
+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 General Public License ìù ÷úåòá äååìî úåéäì äøåîà åæ úéðëú\n"
+"Free Software Foundation, Inc.-ì åáúë àðà ,åúåà íúìáé÷ àì íà\n"
+".59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\n"
+
+#: main.c:730
+msgid "-Ft does not set FS to tab in POSIX awk"
+msgstr "awk ìù POSIX úñøâá TAB úåéäì FS-ì íøåâ åðéà -Ft"
+
+#: main.c:956
+#, c-format
+msgid ""
+"%s: `%s' argument to `-v' not in `var=value' form\n"
+"\n"
+msgstr ""
+
+#: main.c:976
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr ""
+
+#: main.c:979
+#, c-format
+msgid "`%s' is not a variable name, looking for file `%s=%s'"
+msgstr ""
+
+#: main.c:1012
+msgid "floating point exception"
+msgstr "äôö äãå÷ð éáåùéçá äâéøç"
+
+#: main.c:1019
+msgid "fatal error: internal error"
+msgstr "úéîéðô äðëú úàéâù :äøåîç äì÷ú"
+
+# FIXME: I wonder how many people will understand what "fd 2" means.
+#: main.c:1069
+#, c-format
+msgid "no pre-opened fd %d"
+msgstr "ùàøî çåúô åðéà %d èìô/èì÷ õåøò"
+
+# FIXME: /dev/null might not be known to all.
+#: main.c:1074
+#, c-format
+msgid "could not pre-open /dev/null for fd %d"
+msgstr "/dev/null-ì %d èìô/èì÷ õåøò çåúôì ïúéð àì"
+
+#: main.c:1097 main.c:1106
+#, c-format
+msgid "could not find groups: %s"
+msgstr "%s :úëøòîá íéùîúùî úåöåá÷ ìò òãéî ïéà"
+
+# The next 4 strings are untranslated because msg.c prints the actual
+# message after "warning:", "error:", etc., which will look terribly
+# wrong if both these headings and the message text after them is in
+# Hebrew, due to changed directionality.
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "cmd. line:"
+
+#: msg.c:120
+msgid "warning: "
+msgstr "warning: "
+
+#: msg.c:142
+msgid "error: "
+msgstr "error: "
+
+#: msg.c:178
+msgid "fatal: "
+msgstr "fatal: "
+
+#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115
+msgid "can't convert string to float"
+msgstr "øôñîì äøîäì úðúéð äðéà úæåøçî"
+
+#: node.c:355
+msgid "backslash at end of string"
+msgstr "úæåøçî óåñá êåôä ïñëåì"
+
+#: node.c:539
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "`\\x' âåñî äø÷á úåøãñ äùøî åðéà POSIX ï÷ú"
+
+#: node.c:545
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "`\\x' äø÷á úøãñá úåéìîéöãñ÷ä úåøôñá ùîúùäì ïéà"
+
+#: node.c:579
+#, c-format
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr "éìåìéî åúë ìôåè `\\%c' äø÷á úøãñá `%c' åú"
+
+#: posix/gawkmisc.c:172
+#, c-format
+msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
+msgstr "%s %s `%s' øåáò close-on-exec ïééôàî úìòôäá (fcntl: %s) äì÷ú"
+
+#: profile.c:91
+#, c-format
+msgid "could not open `%s' for writing: %s"
+msgstr "äáéúë êøåöì `%s' úçéúô úòá (%s) äì÷ú"
+
+#: profile.c:449
+#, fuzzy, c-format
+msgid "internal error: %s with null vname"
+msgstr "ñôåàî åìù vname-äù Node_var :úéîéðô äðëú úàéâù"
+
+#: profile.c:512
+msgid "# treated internally as `delete'"
+msgstr ""
+
+#: profile.c:1162
+#, c-format
+msgid "\t# gawk profile, created %s\n"
+msgstr "\t# %s êéøàúî gawk ìù ìéôåøô\n"
+
+#: profile.c:1165
+msgid ""
+"\t# BEGIN block(s)\n"
+"\n"
+msgstr ""
+"\t# BEGIN ÷åìá\n"
+"\n"
+
+#: profile.c:1175
+msgid ""
+"\t# Rule(s)\n"
+"\n"
+msgstr ""
+"\t# (íé)ììë\n"
+"\n"
+
+#: profile.c:1181
+msgid ""
+"\t# END block(s)\n"
+"\n"
+msgstr ""
+"\t# END ÷åìá\n"
+"\n"
+
+#: profile.c:1201
+msgid ""
+"\n"
+"\t# Functions, listed alphabetically\n"
+msgstr ""
+"\n"
+"\t# úéá-óìà øãñá ,úåéö÷ðåô\n"
+
+#: profile.c:1413
+#, c-format
+msgid "unexpected type %s in prec_level"
+msgstr "prec_level-á %s éåâù âåñ"
+
+#: re.c:193
+#, c-format
+msgid "regex match failed, not enough memory to match string \"%.*s%s\""
+msgstr "\"%.*s%s\" úæåøçî úîàúäì ïåøëæ éã ïéà ,ìùëð éøìåâø éåèéáì äîàúä ùåôéç"
+
+#: regcomp.c:136
+msgid "Success"
+msgstr "äçìöä"
+
+#: regcomp.c:139
+msgid "No match"
+msgstr "äîéàúî úæåøçî äàöîð àì"
+
+#: regcomp.c:142
+msgid "Invalid regular expression"
+msgstr "éåâù éøìåâø éåèéá"
+
+#: regcomp.c:145
+msgid "Invalid collation character"
+msgstr "øãâåî-éúìá øåãéñ åú"
+
+#: regcomp.c:148
+msgid "Invalid character class name"
+msgstr "íéåú úöåá÷ ìù øãâåî-éúìá íù"
+
+#: regcomp.c:151
+msgid "Trailing backslash"
+msgstr "`\\' éøåçà ïñëåìá íééúñî éøìåâø éåèéá"
+
+#: regcomp.c:154
+msgid "Invalid back reference"
+msgstr "íãå÷ éåèéá-úúì äéåâù äééðôä"
+
+#: regcomp.c:157
+msgid "Unmatched [ or [^"
+msgstr "âåæ-ïá åì ïéàù [^ åà ["
+
+#: regcomp.c:160
+msgid "Unmatched ( or \\("
+msgstr "âåæ-ïá åì ïéàù \\( åà ("
+
+#: regcomp.c:163
+msgid "Unmatched \\{"
+msgstr "âåæ-ïá åì ïéàù \\{"
+
+#: regcomp.c:166
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\} êåúá éåâù äðáî"
+
+#: regcomp.c:169
+msgid "Invalid range end"
+msgstr "íéåú íåçú ìù äéåâù äøãâä"
+
+#: regcomp.c:172
+msgid "Memory exhausted"
+msgstr "ïåøëæä øîâð"
+
+#: regcomp.c:175
+msgid "Invalid preceding regular expression"
+msgstr "íéé÷ åðéà åà éåâù íãå÷ éøìåâø éåèéá"
+
+#: regcomp.c:178
+msgid "Premature end of regular expression"
+msgstr "éãî íã÷åî íééúñî éøìåâø éåèéá"
+
+#: regcomp.c:181
+msgid "Regular expression too big"
+msgstr "éãî áëøåî åà ìåãâ éøìåâø éåèéá"
+
+#: regcomp.c:184
+msgid "Unmatched ) or \\)"
+msgstr "âåæ-ïá åì ïéàù \\) åà )"
+
+#: regcomp.c:621
+msgid "No previous regular expression"
+msgstr "íãå÷ éøìåâø éåèéá ïéà"
+
+#, fuzzy
+#~ msgid "substr: length %g is < 0"
+#~ msgstr "0-î ìåãâ øôñî åððéà %g êøåà :substr"
+
+#~ msgid "delete: illegal use of variable `%s' as array"
+#~ msgstr "êøòîë `%s' äðúùîá éåâù ùåîéù :delete"
+
+#, fuzzy
+#~ msgid "%s: gvar_ref to %s\n"
+#~ msgstr "%s: %s-ì (array_ref) äéðôä\n"
+
+#~ msgid "asort: first argument is not an array"
+#~ msgstr "êøòî åðéà ïåùàø èðîåâøà :asort"
+
+#~ msgid "asort: second argument is not an array"
+#~ msgstr "êøòî åðéà éðù èðîåâøà :asort"
+
+#, fuzzy
+#~ msgid ""
+#~ "attempt to use array parameter `%s' that was passed from global scalar `%"
+#~ "s'"
+#~ msgstr "êøòî äéä åìéàë `%s' éøì÷ñ øèîøôá ùåîéù ïåéñð"
+
+#~ msgid "internal error: Node_var_array with null vname"
+#~ msgstr "ñôåàî åìù vname-äù Node_var_array :úéîéðô äðëú úàéâù"
+
+#~ msgid "BEGIN blocks must have an action part"
+#~ msgstr "äìåòô úøãâä ìåìëì áééç BEGIN ÷åìá"
+
+#~ msgid "`nextfile' used in BEGIN or END action"
+#~ msgstr "END åà BEGIN ìù äìåòô úøãâäá `nextfile'-á ùåîéù"
+
+#~ msgid "gsub third parameter is not a changeable object"
+#~ msgstr "éåðéù-øá è÷ééáåà åðéà `gsub' ìù éùéìù èðîåâøà"
+
+#~ msgid "or used in other expression context"
+#~ msgstr "øçà éåèéá ìù èñ÷èðå÷á äá ùåîéù åà"
+
+#~ msgid "attempt to use function `%s' as array"
+#~ msgstr "êøòîë `%s' äéö÷ðåôá ùåîéù ïåéñð"
+
+#~ msgid "`%s' is a function, assignment is not allowed"
+#~ msgstr "äøåñà äá êøò úîùä ,äéö÷ðåô àéä `%s'"
+
+#~ msgid "internal error: file `%s', line %d\n"
+#~ msgstr "`%s' õáå÷ ìù %d äøåùá úéîéðô äðëú äàéâù\n"
+
+#~ msgid "non-redirected `getline' undefined inside BEGIN or END action"
+#~ msgstr "END åà BEGIN úìåòô êåúá øãâåî åðéà äééðôä àìì `getline'"
+
+#~ msgid "fptr %x not in tokentab\n"
+#~ msgstr "tokentab-á àöîð àì fptr %x\n"
+
+#~ msgid "Unbalanced ["
+#~ msgstr "âåæ-ïá åì ïéàù ["
+
+#~ msgid "Unfinished \\ escape"
+#~ msgstr "äøåîâ-éúìá \\ äø÷á úøãñ"
+
+#~ msgid "unfinished repeat count"
+#~ msgstr "äøåîâ-éúìá úåðùéä äðåî úøãâä"
+
+#~ msgid "malformed repeat count"
+#~ msgstr "úåðùéä äðåî úøãâäá éåâù øéáçú"
+
+#~ msgid "Unbalanced ("
+#~ msgstr "âåæ-ïá åì ïéàù ("
+
+#~ msgid "No regexp syntax bits specified"
+#~ msgstr "íééøìåâø íééåèéá ìù øéáçú úøãâä ïéà"
+
+#~ msgid "Unbalanced )"
+#~ msgstr "âåæ-ïá åì ïéàù )"
+
+#~ msgid "out of memory"
+#~ msgstr "ïåøëæä øîâð"
+
+#~ msgid "invalid syntax in name `%s' for variable assignment"
+#~ msgstr "êøò úîùäá `%s' äðúùî íù ìù éåâù øéáçú"
diff --git a/gnu/dist/gawk/po/insert-header.sin b/gnu/dist/gawk/po/insert-header.sin
new file mode 100644
index 00000000000..b26de01f6c8
--- /dev/null
+++ b/gnu/dist/gawk/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/gnu/dist/gawk/po/it.gmo b/gnu/dist/gawk/po/it.gmo
new file mode 100644
index 00000000000..28c81fea1f8
--- /dev/null
+++ b/gnu/dist/gawk/po/it.gmo
Binary files differ
diff --git a/gnu/dist/gawk/po/it.po b/gnu/dist/gawk/po/it.po
new file mode 100644
index 00000000000..ec8d9f8e00d
--- /dev/null
+++ b/gnu/dist/gawk/po/it.po
@@ -0,0 +1,1761 @@
+# Italian messages for GNU Awk
+# Copyright (C) 2002-2003 Free Software Foundation, Inc.
+# Antonio Colombo <azc10@it.ftsi.fujitsu.com>, 2003.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gawk 3.1.35\n"
+"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
+"POT-Creation-Date: 2003-07-07 11:20-0700\n"
+"PO-Revision-Date: 2003-06-10 11:11+0100\n"
+"Last-Translator: Antonio Colombo <azc10@it.ftsi.fujitsu.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:112
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr "tentativo di unare il parametro scalare `%s' come un vettore"
+
+#: array.c:113
+#, c-format
+msgid "attempt to use scalar `%s' as array"
+msgstr "tentativo di usare scalare '%s' come vettore"
+
+#: array.c:151
+#, c-format
+msgid "from %s"
+msgstr "da %s"
+
+#: array.c:506
+#, c-format
+msgid "reference to uninitialized element `%s[\"%s\"]'"
+msgstr "referenza a elemento non inizializzato `%s[\"%s\"]'"
+
+#: array.c:512
+#, c-format
+msgid "subscript of array `%s' is null string"
+msgstr "l'indice del vettore '%s' è una stringa nulla"
+
+#: array.c:609
+#, c-format
+msgid "delete: index `%s' not in array `%s'"
+msgstr "delete: indice `%s' non presente nel vettore `%s'"
+
+#: array.c:769
+#, c-format
+msgid "%s: empty (null)\n"
+msgstr "%s: vuoto (nullo)\n"
+
+#: array.c:774
+#, c-format
+msgid "%s: empty (zero)\n"
+msgstr "%s: vuoto (zero)\n"
+
+#: array.c:778
+#, c-format
+msgid "%s: table_size = %d, array_size = %d\n"
+msgstr "%s: dimensione_tabella = %d, dimensione_vettore = %d\n"
+
+#: array.c:807
+#, c-format
+msgid "%s: is parameter\n"
+msgstr "%s: è parametro\n"
+
+#: array.c:812
+#, c-format
+msgid "%s: array_ref to %s\n"
+msgstr "%s: referenza_vettoriale a %s\n"
+
+#: awkgram.y:208
+#, c-format
+msgid "%s blocks must have an action part"
+msgstr "blocchi %s richiedono una 'azione'"
+
+#: awkgram.y:211
+msgid "each rule must have a pattern or an action part"
+msgstr "ogni regola deve avere una parte 'espressione' o una parte 'azione'"
+
+#: awkgram.y:267
+#, c-format
+msgid "`%s' is a built-in function, it cannot be redefined"
+msgstr "`%s' è una funzione interna, non si può ridefinire"
+
+#: awkgram.y:314
+#, 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:340 awkgram.y:615
+msgid "statement may have no effect"
+msgstr "istruzione che può non aver alcun effetto"
+
+#: awkgram.y:435 awkgram.y:455
+#, c-format
+msgid "`%s' used in %s action"
+msgstr "`%s' usato in 'azione' %s"
+
+#: awkgram.y:448 awkgram.y:451
+msgid "`nextfile' is a gawk extension"
+msgstr "`nextfile' è un'estensione gawk"
+
+#: awkgram.y:465
+msgid "`return' used outside function context"
+msgstr "`return' usato fuori da una funzione"
+
+#: awkgram.y:504
+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:517 awkgram.y:524
+msgid "`delete array' is a gawk extension"
+msgstr "`delete array' è un'estensione gawk"
+
+#: awkgram.y:532 awkgram.y:539
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "`delete(array)' è un'estensione tawk non-portabile"
+
+#: awkgram.y:583
+#, c-format
+msgid "duplicate case values in switch body: %s"
+msgstr "valori di 'case' doppi all'interno di uno 'switch': %s"
+
+#: awkgram.y:593
+msgid "Duplicate `default' detected in switch body"
+msgstr "Valori per difetto doppi all'interno di uno 'switch'"
+
+#: awkgram.y:681
+msgid "multistage two-way pipelines don't work"
+msgstr "'pipelines' multistadio bidirezionali non funzionano"
+
+#: awkgram.y:772
+msgid "regular expression on right of assignment"
+msgstr "espressione regolare usata per assegnare un valore"
+
+#: awkgram.y:782
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "espressione regolare prima di operatore `~' o `!~'"
+
+#: awkgram.y:790
+msgid "regular expression on right of comparison"
+msgstr "espressione regolare a destra in un confronto"
+
+#: awkgram.y:857
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "`getline' non re-diretta indefinita dentro 'azione' END"
+
+#: awkgram.y:884
+msgid "call of `length' without parentheses is not portable"
+msgstr "chiamata a `length' senza parentesi non portabile"
+
+#: awkgram.y:887
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "chiamata a `length' senza parentesi sconsigliata da POSIX"
+
+#: awkgram.y:940
+msgid "use of non-array as array"
+msgstr "uso di non-vettore come vettore"
+
+#: awkgram.y:942
+msgid "invalid subscript expression"
+msgstr "espressione indice invalida"
+
+#: awkgram.y:1140
+msgid "unexpected newline or end of string"
+msgstr "carattere 'a capo' o fine stringa inaspettati"
+
+#: awkgram.y:1235
+msgid "empty program text on command line"
+msgstr "programma nullo sulla linea comandi"
+
+#: awkgram.y:1292
+#, 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:1327
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "non riesco a leggere file sorgente `%s' (%s)"
+
+#: awkgram.y:1335
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "file sorgente `%s' vuoto"
+
+#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100
+msgid "source file does not end in newline"
+msgstr "file sorgente non termina con carattere 'a capo'"
+
+#: awkgram.y:1601
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr "espressione regolare non completata termina con `\\' a fine file"
+
+#: awkgram.y:1621
+msgid "unterminated regexp"
+msgstr "espressione regolare non completata"
+
+#: awkgram.y:1624
+msgid "unterminated regexp at end of file"
+msgstr "espressione regolare non completata a fine file"
+
+#: awkgram.y:1691
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr "uso di `\\ #...' continuazione linea non portabile"
+
+#: awkgram.y:1703
+msgid "backslash not last character on line"
+msgstr "'\\' non è l'ultimo carattere della linea"
+
+#: awkgram.y:1748
+msgid "POSIX does not allow operator `**='"
+msgstr "POSIX non permette l'operatore `**='"
+
+#: awkgram.y:1750
+msgid "old awk does not support operator `**='"
+msgstr "il vecchio awk non supporta l'operatore `**='"
+
+#: awkgram.y:1759
+msgid "POSIX does not allow operator `**'"
+msgstr "POSIX non permette l'operatore `**'"
+
+#: awkgram.y:1761
+msgid "old awk does not support operator `**'"
+msgstr "il vecchio awk non supporta l'operatore `**'"
+
+#: awkgram.y:1792
+msgid "operator `^=' is not supported in old awk"
+msgstr "l'operatore `^=' non è supportato nel vecchio awk"
+
+#: awkgram.y:1800
+msgid "operator `^' is not supported in old awk"
+msgstr "l'operatore `^' non è supportato nel vecchio awk"
+
+#: awkgram.y:1884 awkgram.y:1901
+msgid "unterminated string"
+msgstr "stringa non terminata"
+
+#: awkgram.y:2061
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "carattere '%c' invalido in un'espressione"
+
+#: awkgram.y:2121
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "`%s' è un'estensione gawk"
+
+#: awkgram.y:2124
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "`%s' è un'estensione Bell Labs"
+
+#: awkgram.y:2127
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "POSIX non permette `%s'"
+
+#: awkgram.y:2131
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "`%s' non è supportato nel vecchio awk"
+
+#: awkgram.y:2158
+msgid "`goto' considered harmful!\n"
+msgstr "`goto' considerato pericoloso!\n"
+
+#: awkgram.y:2220
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
+msgstr "%d invalido come numero di argomenti per %s"
+
+#: awkgram.y:2239 awkgram.y:2242
+msgid "match: third argument is a gawk extension"
+msgstr "match: il terzo argomento è un'estensione gawk"
+
+#: awkgram.y:2255
+#, 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:2258
+#, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "il terzo parametro di '%s' non è un oggetto modificabile"
+
+#: awkgram.y:2285 awkgram.y:2288
+msgid "close: second argument is a gawk extension"
+msgstr "close: il secondo argomento è un'estensione gawk"
+
+#: awkgram.y:2298
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"uso scorretto di dcgettext(_\"...\"): togliere il carattere '_' iniziale"
+
+#: awkgram.y:2313
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"uso scorretto di dcngettext(_\"...\"): togliere il carattere '_' iniziale"
+
+#: awkgram.y:2384
+#, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "funzione `%s': parametro #%d, `%s', duplica parametro #%d"
+
+#: awkgram.y:2417
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "funzione `%s': parametro `%s' nasconde variabile globale"
+
+#: awkgram.y:2529
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "non riesco ad aprire `%s' in scrittura (%s)"
+
+#: awkgram.y:2530 profile.c:93
+msgid "sending profile to standard error"
+msgstr "mando profilo a 'standard error'"
+
+#: awkgram.y:2562
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: 'close' fallita (%s)"
+
+#: awkgram.y:2684
+msgid "shadow_funcs() called twice!"
+msgstr "shadow_funcs() chiamata due volte!"
+
+#: awkgram.y:2711
+msgid "there were shadowed variables."
+msgstr "c'erano variabili nascoste."
+
+#: awkgram.y:2784
+#, 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:2794
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "funzione di nome `%s' definita in precedenza"
+
+#: awkgram.y:2945 awkgram.y:2951
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "funzione `%s' chiamata ma mai definita"
+
+#: awkgram.y:2954
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "funzione `%s' definita ma mai chiamata"
+
+#: awkgram.y:2981
+#, c-format
+msgid "regexp constant for parameter #%d yields boolean value"
+msgstr ""
+"espressione regolare di valore costante per parametro #%d genera valore "
+"booleano"
+
+#: awkgram.y:2994
+#, 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"
+
+#: awkgram.y:2996
+msgid "or used as a variable or an array"
+msgstr "o usato come variabile o come vettore"
+
+#: builtin.c:137
+#, c-format
+msgid "%s to \"%s\" failed (%s)"
+msgstr "%s a \"%s\" fallita (%s)"
+
+#: builtin.c:138
+msgid "standard output"
+msgstr "standard output"
+
+#: builtin.c:139
+msgid "reason unknown"
+msgstr "ragione indeterminata"
+
+#: builtin.c:152
+msgid "exp: received non-numeric argument"
+msgstr "exp: argomento non numerico"
+
+#: builtin.c:158
+#, c-format
+msgid "exp: argument %g is out of range"
+msgstr "exp: argomento %g non accettabile"
+
+#: builtin.c:216
+#, 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:219
+#, 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:231
+#, 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:325
+msgid "index: received non-string first argument"
+msgstr "index: il primo argomento non è una stringa"
+
+#: builtin.c:327
+msgid "index: received non-string second argument"
+msgstr "index: il secondo argomento non è una stringa"
+
+#: builtin.c:437
+msgid "int: received non-numeric argument"
+msgstr "int: argomento non numerico"
+
+#: builtin.c:454
+msgid "length: received non-string argument"
+msgstr "length: l'argomento non è una stringa"
+
+#: builtin.c:470
+msgid "log: received non-numeric argument"
+msgstr "log: argomento non numerico"
+
+#: builtin.c:473
+#, c-format
+msgid "log: received negative argument %g"
+msgstr "log: argomento negativo %g"
+
+#: builtin.c:635 builtin.c:638
+msgid "must use `count$' on all formats or none"
+msgstr "'count$' va usato per tutti i formati o per nessuno"
+
+#: builtin.c:740
+msgid "`$' is not permitted in awk formats"
+msgstr "`$' non permesso nei 'format' awk"
+
+#: builtin.c:746
+msgid "arg count with `$' must be > 0"
+msgstr "il numero di argomento con `$' deve essere > 0"
+
+#: builtin.c:748
+#, c-format
+msgid "arg count %ld greater than total number of supplied arguments"
+msgstr ""
+"numero di argomenti (%ld) maggiore del numero totale di argomenti specificati"
+
+#: builtin.c:750
+msgid "`$' not permitted after period in format"
+msgstr "`$' non permesso dopo un punto nel 'format'"
+
+#: builtin.c:763
+msgid "no `$' supplied for positional field width or precision"
+msgstr ""
+"nessun `$' specificato per larghezza o precisione di un campo posizionale"
+
+#: builtin.c:821
+msgid "`l' is meaningless in awk formats; ignored"
+msgstr "`l' non ha senso nei 'format' awk; ignorata"
+
+#: builtin.c:825
+msgid "`l' is not permitted in POSIX awk formats"
+msgstr "`l' non permessa nei 'format' awk POSIX"
+
+#: builtin.c:836
+msgid "`L' is meaningless in awk formats; ignored"
+msgstr "`L' non ha senso nei 'format' awk; ignorata"
+
+#: builtin.c:840
+msgid "`L' is not permitted in POSIX awk formats"
+msgstr "`L' non permessa nei 'format' awk POSIX"
+
+#: builtin.c:851
+msgid "`h' is meaningless in awk formats; ignored"
+msgstr "`h' non ha senso nei 'format' awk; ignorata"
+
+#: builtin.c:855
+msgid "`h' is not permitted in POSIX awk formats"
+msgstr "`h' non permessa nei 'format' awk POSIX"
+
+#: builtin.c:1055
+#, c-format
+msgid "[s]printf: value %g is out of range for `%%%c' format"
+msgstr "[s]printf: valore %g non accettabile per il 'format' `%%%c'"
+
+#: builtin.c:1108
+msgid "not enough arguments to satisfy format string"
+msgstr "mancano argomenti per completare il 'format'"
+
+#: builtin.c:1110
+msgid "^ ran out for this one"
+msgstr "^ uscito per questo"
+
+#: builtin.c:1115
+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:1118
+msgid "too many arguments supplied for format string"
+msgstr "troppi argomenti specificati per il 'format'"
+
+#: builtin.c:1184 builtin.c:1187
+msgid "printf: no arguments"
+msgstr "printf: manca argomento"
+
+#: builtin.c:1211
+msgid "sqrt: received non-numeric argument"
+msgstr "sqrt: argomento non numerico"
+
+#: builtin.c:1215
+#, c-format
+msgid "sqrt: called with negative argument %g"
+msgstr "sqrt: chiamata con argomento negativo %g"
+
+#: builtin.c:1238
+#, c-format
+msgid "substr: start index %g is invalid, using 1"
+msgstr "substr: indice di partenza %g invalido, uso 1"
+
+#: builtin.c:1243
+#, c-format
+msgid "substr: non-integer start index %g will be truncated"
+msgstr "substr: indice di partenza non intero %g: sarà troncato"
+
+#: builtin.c:1262
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 1"
+msgstr "substr: lunghezza %g <= 0"
+
+#: builtin.c:1264
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 0"
+msgstr "substr: lunghezza %g <= 0"
+
+#: builtin.c:1271
+#, c-format
+msgid "substr: non-integer length %g will be truncated"
+msgstr "substr: lunghezza non intera %g: sarà truncata"
+
+#: builtin.c:1276
+#, c-format
+msgid "substr: length %g too big for string indexing, truncating to %g"
+msgstr "substr: lunghezza %g troppo elevata per indice stringa, tronco a %g"
+
+#: builtin.c:1288
+msgid "substr: source string is zero length"
+msgstr "substr: stringa di partenza lunga zero"
+
+#: builtin.c:1294
+#, c-format
+msgid "substr: start index %g is past end of string"
+msgstr "substr: indice di partenza %g oltre la fine della stringa"
+
+#: builtin.c:1302
+#, c-format
+msgid ""
+"substr: length %g at start index %g exceeds length of first argument (%lu)"
+msgstr ""
+"substr: lunghezza %g all'indice di partenza %g supera la lunghezza del primo "
+"argomento (%lu)"
+
+#: builtin.c:1337
+msgid "strftime: received non-string first argument"
+msgstr "strftime: il primo argomento non è una stringa"
+
+#: builtin.c:1343
+msgid "strftime: received empty format string"
+msgstr "strftime: 'format' è una stringa nulla"
+
+#: builtin.c:1352
+msgid "strftime: received non-numeric second argument"
+msgstr "strftime: il secondo argomento non è numerico"
+
+#: builtin.c:1415
+msgid "mktime: received non-string argument"
+msgstr "mktime: l'argomento non è una stringa"
+
+#: builtin.c:1460
+msgid "system: received non-string argument"
+msgstr "system: l'argomento non è una stringa"
+
+#: builtin.c:1581 eval.c:1883
+#, c-format
+msgid "reference to uninitialized field `$%d'"
+msgstr "referenza a variabile non inizializzata `$%d'"
+
+#: builtin.c:1608
+msgid "tolower: received non-string argument"
+msgstr "tolower: l'argomento non è una stringa"
+
+#: builtin.c:1657
+msgid "toupper: received non-string argument"
+msgstr "toupper: l'argomento non è una stringa"
+
+#: builtin.c:1702
+msgid "atan2: received non-numeric first argument"
+msgstr "atan2: il primo argomento non è numerico"
+
+#: builtin.c:1704
+msgid "atan2: received non-numeric second argument"
+msgstr "atan2: il secondo argomento non è numerico"
+
+#: builtin.c:1723
+msgid "sin: received non-numeric argument"
+msgstr "sin: l'argomento non è numerico"
+
+#: builtin.c:1739
+msgid "cos: received non-numeric argument"
+msgstr "cos: l'argomento non è numerico"
+
+#: builtin.c:1788
+msgid "srand: received non-numeric argument"
+msgstr "srand: l'argomento non è numerico"
+
+#: builtin.c:1823
+msgid "match: third argument is not an array"
+msgstr "match: il terzo argomento non è un vettore"
+
+#: builtin.c:2307
+msgid "gensub: third argument of 0 treated as 1"
+msgstr "gensub: il terzo argomento è 0, trattato come 1"
+
+#: builtin.c:2416 builtin.c:2418
+msgid "lshift: received non-numeric first argument"
+msgstr "lshift: il primo argomento non è numerico"
+
+#: builtin.c:2420
+#, c-format
+msgid "lshift(%lf, %lf): negative values will give strange results"
+msgstr "lshift(%lf, %lf): valori negativi daranno risultati strani"
+
+#: builtin.c:2422
+#, c-format
+msgid "lshift(%lf, %lf): fractional values will be truncated"
+msgstr "lshift(%lf, %lf): valori con decimali verranno troncati"
+
+#: builtin.c:2424
+#, 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:2453 builtin.c:2455
+msgid "rshift: received non-numeric first argument"
+msgstr "rshift: il primo argomento non è numerico"
+
+#: builtin.c:2457
+#, c-format
+msgid "rshift(%lf, %lf): negative values will give strange results"
+msgstr "rshift(%lf, %lf): valori negativi daranno risultati strani"
+
+#: builtin.c:2459
+#, c-format
+msgid "rshift(%lf, %lf): fractional values will be truncated"
+msgstr "rshift(%lf, %lf): valori con decimali verranno troncati"
+
+#: builtin.c:2461
+#, 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:2490 builtin.c:2492
+msgid "and: received non-numeric first argument"
+msgstr "and: il primo argomento non è numerico"
+
+#: builtin.c:2494
+#, c-format
+msgid "and(%lf, %lf): negative values will give strange results"
+msgstr "and(%lf, %lf): valori negativi daranno risultati strani"
+
+#: builtin.c:2496
+#, c-format
+msgid "and(%lf, %lf): fractional values will be truncated"
+msgstr "and(%lf, %lf): valori con decimali verranno troncati"
+
+#: builtin.c:2525 builtin.c:2527
+msgid "or: received non-numeric first argument"
+msgstr "or: il primo argomento non è numerico"
+
+#: builtin.c:2529
+#, c-format
+msgid "or(%lf, %lf): negative values will give strange results"
+msgstr "or(%lf, %lf): valori negativi daranno risultati strani"
+
+#: builtin.c:2531
+#, c-format
+msgid "or(%lf, %lf): fractional values will be truncated"
+msgstr "or(%lf, %lf): valori con decimali verranno troncati"
+
+#: builtin.c:2560 builtin.c:2562
+msgid "xor: received non-numeric first argument"
+msgstr "xor: il primo argomento non è numerico"
+
+#: builtin.c:2564
+#, c-format
+msgid "xor(%lf, %lf): negative values will give strange results"
+msgstr "xor(%lf, %lf): valori negativi daranno risultati strani"
+
+#: builtin.c:2566
+#, c-format
+msgid "xor(%lf, %lf): fractional values will be truncated"
+msgstr "xor(%lf, %lf): valori con decimali verranno troncati"
+
+#: builtin.c:2594
+msgid "compl: received non-numeric argument"
+msgstr "compl: l'argomento non è numerico"
+
+#: builtin.c:2596
+#, c-format
+msgid "compl(%lf): negative value will give strange results"
+msgstr "compl(%lf): valore negativo darà risultati strani"
+
+#: builtin.c:2598
+#, c-format
+msgid "compl(%lf): fractional value will be truncated"
+msgstr "compl(%lf): valore con decimali verrà troncato"
+
+#: builtin.c:2771
+#, c-format
+msgid "dcgettext: `%s' is not a valid locale category"
+msgstr "dcgettext: `%s' non è una categoria 'locale' valida"
+
+#: eval.c:266
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "tipo nodo sconosciuto %d"
+
+#: eval.c:312
+msgid "buffer overflow in genflags2str"
+msgstr "superament limiti buffer in 'genflags2str'"
+
+#: eval.c:647
+#, c-format
+msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
+msgstr ""
+"ciclo for: vettore `%s' ha cambiato dimensione da %ld a %ld durante "
+"l'esecuzione del ciclo"
+
+#: eval.c:668
+msgid "`break' outside a loop is not portable"
+msgstr "`break' all'esterno di un ciclo non è portabile"
+
+#: eval.c:672
+msgid "`break' outside a loop is not allowed"
+msgstr "`break' all'esterno di un ciclo non è consentito"
+
+#: eval.c:689
+msgid "`continue' outside a loop is not portable"
+msgstr "`continue' all'esterno di un ciclo non è portabile"
+
+#: eval.c:693
+msgid "`continue' outside a loop is not allowed"
+msgstr "`continue' all'esterno di un ciclo non è consentito"
+
+#: eval.c:727
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "`next' non può essere chiamato da una regola BEGIN"
+
+#: eval.c:729
+msgid "`next' cannot be called from an END rule"
+msgstr "`next' non può essere chiamato da una regola END"
+
+#: eval.c:738
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "`nextfile' non può essere chiamato da una regola BEGIN"
+
+#: eval.c:740
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "`nextfile' non può essere chiamato da una regola END"
+
+#: eval.c:785
+msgid "statement has no effect"
+msgstr "istruzione che non fa nulla"
+
+#: eval.c:828 eval.c:1726
+#, 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:835 eval.c:841
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "referenza ad argomento non inizializzato `%s'"
+
+#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807
+#, c-format
+msgid "attempt to use array `%s' in a scalar context"
+msgstr "tentativo di usare vettore `%s' in un contesto scalare"
+
+#: eval.c:858 eval.c:1752
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "referenza a variabile non inizializzata `%s'"
+
+#: eval.c:1007
+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:1032
+msgid "assignment used in conditional context"
+msgstr "assegnamento usato nel contesto di un test condizionale"
+
+#: eval.c:1122
+msgid "division by zero attempted"
+msgstr "tentativo di dividere per zero"
+
+#: eval.c:1137
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "divisione per zero tentata in `%%'"
+
+#: eval.c:1152 profile.c:683
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "tipo non ammesso (%s) in 'tree_eval'"
+
+#: eval.c:1328
+msgid "division by zero attempted in `/='"
+msgstr "divisione per zero tentata in `/='"
+
+#: eval.c:1346
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "divisione per zero tentata in `%%='"
+
+#: eval.c:1586
+#, c-format
+msgid "function `%s' called with more arguments than declared"
+msgstr "funzione `%s' chiamata con più argomenti di quelli previsti"
+
+#: eval.c:1633
+#, c-format
+msgid "function `%s' not defined"
+msgstr "funzione `%s' non definita"
+
+#: eval.c:1639
+#, c-format
+msgid "function %s called\n"
+msgstr "funzione %s chiamata\n"
+
+#: eval.c:1698
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# 'Stack' (Pila) Chiamate Funzione:\n"
+"\n"
+
+#: eval.c:1701
+msgid "\t# -- main --\n"
+msgstr "\t# -- principale --\n"
+
+#: eval.c:1867
+msgid "attempt to field reference from non-numeric value"
+msgstr "tentativo di referenziare campo da valore non numerico"
+
+#: eval.c:1869
+msgid "attempt to reference from null string"
+msgstr "tentativo to referenziare da stringa nulla"
+
+#: eval.c:1875
+#, c-format
+msgid "attempt to access field %d"
+msgstr "tentativo di accedere al campo %d"
+
+#: eval.c:1896 eval.c:1903 profile.c:900
+msgid "assignment is not allowed to result of builtin function"
+msgstr "assegnamento non permesso al risultato di una funzione interna"
+
+#: eval.c:1951
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "`IGNORECASE' è un'estensione gawk"
+
+#: eval.c:1980
+msgid "`BINMODE' is a gawk extension"
+msgstr "`BINMODE' è un'estensione gawk"
+
+#: eval.c:2092
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "specificazione invalida `%sFMT' `%s'"
+
+#: eval.c:2170
+msgid "turning off `--lint' due to assignment to `LINT'"
+msgstr "disabilito `--lint' a causa di assegnamento a `LINT'"
+
+#: 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:183
+msgid "Operation Not Supported"
+msgstr "Operazione Non Supportata"
+
+#: field.c:315
+msgid "NF set to negative value"
+msgstr "NF impostato a un valore negativo"
+
+#: field.c:808
+msgid "split: second argument is not an array"
+msgstr "split: il secondo argomento non è un vettore"
+
+#: field.c:842
+msgid "split: null string for third arg is a gawk extension"
+msgstr "split: la stringa nulla come terzo arg. è un'estensione gawk"
+
+#: field.c:894
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "`FIELDWIDTHS' è un'estensione gawk"
+
+#: field.c:921
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "campo %d in FIELDWIDTHS, deve essere > 0"
+
+#: field.c:994
+msgid "null string for `FS' is a gawk extension"
+msgstr "la stringa nulla usata come `FS' è un'estensione gawk"
+
+#: 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:434
+#, 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"
+
+#: io.c:305
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "non riesco ad aprire file `%s' in lettura (%s)"
+
+#: io.c:392
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "chiusura di fd %d (`%s') fallita (%s)"
+
+#: io.c:530
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "tipo di albero invalido %s in redirect()"
+
+#: io.c:536
+#, c-format
+msgid "expression in `%s' redirection only has numeric value"
+msgstr "espressione nella re-direzione `%s' ha solo un valore numerico"
+
+#: io.c:542
+#, 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:547
+#, 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:569
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "mistura non necessaria di `>' e `>>' per il file `%.*s'"
+
+#: io.c:621
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "non posso aprire 'pipe' `%s' in scrittura (%s)"
+
+#: io.c:630
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "non posso aprire 'pipe' `%s' in lettura (%s)"
+
+#: io.c:643
+#, 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:647
+#, 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:723
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "non posso re-dirigere da `%s' (%s)"
+
+#: io.c:726
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "non posso re-dirigere a `%s' (%s)"
+
+#: io.c:765
+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:777
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "chiusura di `%s' fallita (%s)."
+
+#: io.c:784
+msgid "too many pipes or input files open"
+msgstr "troppe 'pipe' o file di input aperti"
+
+#: io.c:807
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: il secondo argomento deve essere `a' o `da'"
+
+#: io.c:821
+#, 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:825
+msgid "close of redirection that was never opened"
+msgstr "chiusura di una re-direzione mai aperta"
+
+#: io.c:862
+#, 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:924
+#, c-format
+msgid "failure status (%d) on pipe close of `%s' (%s)"
+msgstr "errore ritornato (%d) dalla chiusura della 'pipe' `%s' (%s)"
+
+#: io.c:927
+#, c-format
+msgid "failure status (%d) on file close of `%s' (%s)"
+msgstr "errore ritornato (%d) dalla chiusura del file `%s' (%s)"
+
+#: io.c:946
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "nessuna chiusura esplicita richiesta per 'socket' `%s'"
+
+#: io.c:949
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "nessuna chiusura esplicita richiesta per co-processo `%s'"
+
+#: io.c:952
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "nessuna chiusura esplicita richiesta per 'pipe' `%s'"
+
+#: io.c:955
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "nessuna chiusura esplicita richiesta per file `%s'"
+
+#: io.c:984 io.c:1038
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "errore scrivendo 'standard output' (%s)"
+
+#: io.c:988 io.c:1042
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "errore scrivendo 'standard error' (%s)"
+
+#: io.c:996
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "scaricamento di 'pipe' `%s' fallita (%s)."
+
+#: io.c:999
+#, 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:1002
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "scaricamento di file `%s' fallita (%s)."
+
+#: io.c:1161
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "spiacente, 'client' /inet/raw non ancora pronto"
+
+#: io.c:1163 io.c:1200
+msgid "only root may use `/inet/raw'."
+msgstr "solo root può usare `/inet/raw'."
+
+#: io.c:1198
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "spiacente, 'server' /inet/raw non ancora pronto"
+
+#: io.c:1288
+#, c-format
+msgid "no (known) protocol supplied in special filename `%s'"
+msgstr "nessuno protocollo (conosciuto) specificato nel filename speciale `%s'"
+
+#: io.c:1306
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "nome file speciale `%s' incompleto"
+
+#: io.c:1318
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "porta locale invalida in `%s'"
+
+#: io.c:1330
+msgid "must supply a remote hostname to `/inet'"
+msgstr "va fornito nome di 'host' remoto a `/inet'"
+
+#: io.c:1345
+msgid "must supply a remote port to `/inet'"
+msgstr "va fornita porta remota a `/inet'"
+
+#: io.c:1351
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "porta remota invalida in `%s'"
+
+#: io.c:1361
+msgid "TCP/IP communications are not supported"
+msgstr "comunicazioni TCP/IP non supportate"
+
+#: io.c:1370 io.c:1551
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "file `%s' è una 'directory'"
+
+#: io.c:1440
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "usa `PROCINFO[\"%s\"]' invece che `%s'"
+
+#: io.c:1472
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "usa `PROCINFO[...]' invece che `/dev/user'"
+
+#: io.c:1537 io.c:1711
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "non riesco ad aprire `%s', modo `%s'"
+
+#: io.c:1762
+#, c-format
+msgid "close of master pty failed (%s)"
+msgstr "fallita chiusura di 'pty' principale (%s)"
+
+#: io.c:1764 io.c:1916 io.c:2068
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "fallita chiusura di 'stdout' nel processo-figlio (%s)"
+
+#: io.c:1767
+#, c-format
+msgid "moving slave pty to stdout in child failed (dup: %s)"
+msgstr ""
+"fallito trasferimento di 'pty' secondaria a 'stdout' nel processo-figlio "
+"(dup: %s)"
+
+#: io.c:1769 io.c:1921
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "fallita chiusura di 'stdin' nel processo-figlio (%s)"
+
+#: io.c:1772
+#, c-format
+msgid "moving slave pty to stdin in child failed (dup: %s)"
+msgstr ""
+"fallito trasferimento di 'pty' secondaria a 'stdin' nel processo-figlio "
+"(dup: %s)"
+
+#: io.c:1774 io.c:1793
+#, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "fallita chiusura di 'pty' secondaria (%s)"
+
+#: io.c:1867 io.c:1919 io.c:2049 io.c:2071
+#, 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:1871 io.c:1924
+#, 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:1888 io.c:2062
+msgid "restoring stdout in parent process failed\n"
+msgstr "fallito ripristino di 'stdout' nel processo-padre\n"
+
+#: io.c:1893
+msgid "restoring stdin in parent process failed\n"
+msgstr "fallito ripristino di 'stdin' nel processo-padre\n"
+
+#: io.c:1927 io.c:2073 io.c:2084
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "fallita chiusura di 'pipe' (%s)"
+
+#: io.c:1972
+msgid "`|&' not supported"
+msgstr "`|&' non supportato"
+
+#: io.c:2039
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "non riesco ad aprire 'pipe' `%s' (%s)"
+
+#: io.c:2080
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr "non riesco a creare processo-figlio per `%s' (fork: %s)"
+
+#: io.c:2423
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "file dati `%s' vuoto"
+
+#: io.c:2466 io.c:2474
+msgid "could not allocate more input memory"
+msgstr "non riesco ad allocare ulteriore memoria per l'input"
+
+#: io.c:2832 io.c:2895
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "errore leggendo file di input `%s': %s"
+
+#: io.c:3020
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "valore multicarattere per `RS' è un'estensione gawk"
+
+#: main.c:324
+msgid "`-m[fr]' option irrelevant in gawk"
+msgstr "`-m[fr]' opzione irrilevante per gawk"
+
+#: main.c:326
+msgid "-m option usage: `-m[fr] nnn'"
+msgstr "-m uso opzione: `-m[fr] nnn'"
+
+#: main.c:343
+#, c-format
+msgid "%s: option `-W %s' unrecognized, ignored\n"
+msgstr "%s: opzione `-W %s' non riconosciuta, ignorata\n"
+
+#: main.c:380
+msgid "empty argument to `--source' ignored"
+msgstr "argomento di `--source' mancante, comando ignorato"
+
+#: main.c:451
+msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
+msgstr "variable d'ambiente `POSIXLY_CORRECT' impostata: attivo `--posix'"
+
+#: main.c:456
+msgid "`--posix' overrides `--traditional'"
+msgstr "`--posix' annulla `--traditional'"
+
+#: main.c:467
+msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
+msgstr "`--posix'/`--traditional' annulla `--non-decimal-data'"
+
+#: main.c:471
+#, 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:512
+#, c-format
+msgid "can't set binary mode on stdin (%s)"
+msgstr "non posso impostare modalità binaria su 'stdin'(%s)"
+
+#: main.c:515
+#, c-format
+msgid "can't set binary mode on stdout (%s)"
+msgstr "non posso impostare modalità binaria su 'stdout'(%s)"
+
+#: main.c:517
+#, c-format
+msgid "can't set binary mode on stderr (%s)"
+msgstr "non posso impostare modalità binaria su 'stderr'(%s)"
+
+#: main.c:547
+msgid "no program text at all!"
+msgstr "manca del tutto il testo del programma!"
+
+#: main.c:620
+#, 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:622
+#, 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:627
+msgid "POSIX options:\t\tGNU long options:\n"
+msgstr "Opzioni POSIX:\t\topzioni lunghe GNU:\n"
+
+#: main.c:628
+msgid "\t-f progfile\t\t--file=progfile\n"
+msgstr "\t-f fileprog\t\t--file=fileprog\n"
+
+#: main.c:629
+msgid "\t-F fs\t\t\t--field-separator=fs\n"
+msgstr "\t-F fs\t\t\t--field-separator=fs\n"
+
+#: main.c:630
+msgid "\t-v var=val\t\t--assign=var=val\n"
+msgstr "\t-v var=valore\t\t--assign=var=valore\n"
+
+#: main.c:631
+msgid "\t-m[fr] val\n"
+msgstr "\t-m[fr] valore\n"
+
+#: main.c:632
+msgid "\t-W compat\t\t--compat\n"
+msgstr "\t-W compat\t\t--compat\n"
+
+#: main.c:633
+msgid "\t-W copyleft\t\t--copyleft\n"
+msgstr "\t-W copyleft\t\t--copyleft\n"
+
+#: main.c:634
+msgid "\t-W copyright\t\t--copyright\n"
+msgstr "\t-W copyright\t\t--copyright\n"
+
+#: main.c:635
+msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
+msgstr "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
+
+#: main.c:636
+msgid "\t-W gen-po\t\t--gen-po\n"
+msgstr "\t-W gen-po\t\t--gen-po\n"
+
+#: main.c:637
+msgid "\t-W help\t\t\t--help\n"
+msgstr "\t-W help\t\t\t--help\n"
+
+#: main.c:638
+msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+
+#: main.c:639
+msgid "\t-W lint-old\t\t--lint-old\n"
+msgstr "\t-W lint-old\t\t--lint-old\n"
+
+#: main.c:640
+msgid "\t-W non-decimal-data\t--non-decimal-data\n"
+msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
+
+#: main.c:642
+msgid "\t-W nostalgia\t\t--nostalgia\n"
+msgstr "\t-W nostalgia\t\t--nostalgia\n"
+
+#: main.c:645
+msgid "\t-W parsedebug\t\t--parsedebug\n"
+msgstr "\t-W parsedebug\t\t--parsedebug\n"
+
+#: main.c:647
+msgid "\t-W profile[=file]\t--profile[=file]\n"
+msgstr "\t-W profile[=file]\t--profile[=file]\n"
+
+#: main.c:648
+msgid "\t-W posix\t\t--posix\n"
+msgstr "\t-W posix\t\t--posix\n"
+
+#: main.c:649
+msgid "\t-W re-interval\t\t--re-interval\n"
+msgstr "\t-W re-interval\t\t--re-interval\n"
+
+#: main.c:650
+msgid "\t-W source=program-text\t--source=program-text\n"
+msgstr "\t-W source=testo-programma\t--source=testo-programma\n"
+
+#: main.c:651
+msgid "\t-W traditional\t\t--traditional\n"
+msgstr "\t-W traditional\t\t--traditional\n"
+
+#: main.c:652
+msgid "\t-W usage\t\t--usage\n"
+msgstr "\t-W usage\t\t--usage\n"
+
+#: main.c:653
+msgid "\t-W version\t\t--version\n"
+msgstr "\t-W version\t\t--version\n"
+
+#: main.c:657
+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:661
+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:665
+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:682
+#, 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 software è libero; 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:690
+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 IDONEITA' AD UN PARTICOLARE SCOPO.\n"
+"Vedi la 'GNU General Public License' per ulteriori dettagli.\n"
+"\n"
+
+#: main.c:696
+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:730
+msgid "-Ft does not set FS to tab in POSIX awk"
+msgstr "-Ft non imposta FS a 'tab' nell'awk POSIX"
+
+#: main.c:956
+#, c-format
+msgid ""
+"%s: `%s' argument to `-v' not in `var=value' form\n"
+"\n"
+msgstr ""
+"%s: `%s' argomento di `-v' non in forma `var=valore'\n"
+"\n"
+
+#: main.c:976
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr "`%s' non è un nome di variabile ammesso"
+
+#: main.c:979
+#, c-format
+msgid "`%s' is not a variable name, looking for file `%s=%s'"
+msgstr "`%s' non è un nome di variabile, cerco il file `%s=%s'"
+
+#: main.c:1012
+msgid "floating point exception"
+msgstr "eccezione floating point"
+
+#: main.c:1019
+msgid "fatal error: internal error"
+msgstr "errore fatale: errore interno"
+
+#: main.c:1069
+#, c-format
+msgid "no pre-opened fd %d"
+msgstr "manca 'fd' predefinita %d"
+
+#: main.c:1074
+#, c-format
+msgid "could not pre-open /dev/null for fd %d"
+msgstr "non riesco a predefinire /dev/null per 'fd' %d"
+
+#: main.c:1097 main.c:1106
+#, c-format
+msgid "could not find groups: %s"
+msgstr "non riesco a trovare gruppi: %s"
+
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "linea progr.:"
+
+#: msg.c:120
+msgid "warning: "
+msgstr "attenzione: "
+
+#: msg.c:142
+msgid "error: "
+msgstr "errore: "
+
+#: msg.c:178
+msgid "fatal: "
+msgstr "fatale: "
+
+#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115
+msgid "can't convert string to float"
+msgstr "non riesco a convertire stringa a valore in virgola mobile"
+
+#: node.c:355
+msgid "backslash at end of string"
+msgstr "'\\' a fine stringa"
+
+#: node.c:539
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX non permette formato `\\x'"
+
+#: node.c:545
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "niente cifre esadecimanli nel formato `\\x'"
+
+#: node.c:579
+#, c-format
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr " sequenza in formato `\\%c' considerata come semplice `%c'"
+
+#: posix/gawkmisc.c:172
+#, 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)"
+
+#: profile.c:91
+#, c-format
+msgid "could not open `%s' for writing: %s"
+msgstr "non riesco ad aprire `%s' in scrittura: %s"
+
+#: profile.c:449
+#, c-format
+msgid "internal error: %s with null vname"
+msgstr "errore interno: %s con 'vname' nullo"
+
+#: profile.c:512
+msgid "# treated internally as `delete'"
+msgstr "# gestito internamente come 'delete' (cancellazione)"
+
+#: profile.c:1162
+#, c-format
+msgid "\t# gawk profile, created %s\n"
+msgstr "\t# profilo gawk, creato %s\n"
+
+#: profile.c:1165
+msgid ""
+"\t# BEGIN block(s)\n"
+"\n"
+msgstr ""
+"\t# blocco(hi) BEGIN\n"
+"\n"
+
+#: profile.c:1175
+msgid ""
+"\t# Rule(s)\n"
+"\n"
+msgstr ""
+"\t# Regola(e)\n"
+"\n"
+
+#: profile.c:1181
+msgid ""
+"\t# END block(s)\n"
+"\n"
+msgstr ""
+"\t# blocco(hi) END\n"
+"\n"
+
+#: profile.c:1201
+msgid ""
+"\n"
+"\t# Functions, listed alphabetically\n"
+msgstr ""
+"\n"
+"\t# Funzioni, listate in ordine alfabetico\n"
+
+#: profile.c:1413
+#, c-format
+msgid "unexpected type %s in prec_level"
+msgstr "tipo non previsto %s in 'prec_level'"
+
+#: re.c:193
+#, 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\""
+
+#: regcomp.c:136
+msgid "Success"
+msgstr "Successo"
+
+#: regcomp.c:139
+msgid "No match"
+msgstr "Nessuna corrispondenza"
+
+#: regcomp.c:142
+msgid "Invalid regular expression"
+msgstr "Espressione regolare invalida"
+
+#: regcomp.c:145
+msgid "Invalid collation character"
+msgstr "Carattere di ordinamento non valido"
+
+#: regcomp.c:148
+msgid "Invalid character class name"
+msgstr "Nome di 'classe di caratteri' invalido"
+
+#: regcomp.c:151
+msgid "Trailing backslash"
+msgstr "'\\' finale"
+
+#: regcomp.c:154
+msgid "Invalid back reference"
+msgstr "Riferimento indietro invalido"
+
+#: regcomp.c:157
+msgid "Unmatched [ or [^"
+msgstr "[ or [^ non chiusa"
+
+#: regcomp.c:160
+msgid "Unmatched ( or \\("
+msgstr "( or \\( non chiusa"
+
+#: regcomp.c:163
+msgid "Unmatched \\{"
+msgstr "\\{ non chiusa"
+
+#: regcomp.c:166
+msgid "Invalid content of \\{\\}"
+msgstr "Contenuto di \\{\\} invalido"
+
+#: regcomp.c:169
+msgid "Invalid range end"
+msgstr "Fine di intervallo invalido"
+
+#: regcomp.c:172
+msgid "Memory exhausted"
+msgstr "Memoria esaurita"
+
+#: regcomp.c:175
+msgid "Invalid preceding regular expression"
+msgstr "Espressione regolare precedente invalida"
+
+#: regcomp.c:178
+msgid "Premature end of regular expression"
+msgstr "Fine di expressione regolare inaspettata"
+
+#: regcomp.c:181
+msgid "Regular expression too big"
+msgstr "Espressione regolare troppo complessa"
+
+#: regcomp.c:184
+msgid "Unmatched ) or \\)"
+msgstr ") or \\) non aperta"
+
+#: regcomp.c:621
+msgid "No previous regular expression"
+msgstr "Nessuna espressione regolare precedente"
+
+#~ msgid "substr: length %g is < 0"
+#~ msgstr "substr: lunghezza %g < 0"
diff --git a/gnu/dist/gawk/po/pt_BR.gmo b/gnu/dist/gawk/po/pt_BR.gmo
new file mode 100644
index 00000000000..79e02ebb37e
--- /dev/null
+++ b/gnu/dist/gawk/po/pt_BR.gmo
Binary files differ
diff --git a/gnu/dist/gawk/po/pt_BR.po b/gnu/dist/gawk/po/pt_BR.po
new file mode 100644
index 00000000000..49270383185
--- /dev/null
+++ b/gnu/dist/gawk/po/pt_BR.po
@@ -0,0 +1,1766 @@
+# gawk pt_BR translation.
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This file is distributed under the same license as the PACKAGE package.
+# Juan Carlos Castro y Castro <jcastro@vialink.com.br>, 2003.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gawk 3.1.2g\n"
+"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
+"POT-Creation-Date: 2003-07-07 11:20-0700\n"
+"PO-Revision-Date: 2003-06-26 16:18+0300\n"
+"Last-Translator: Juan Carlos Castro y Castro <jcastro@vialink.com.br>\n"
+"Language-Team: Brazilian Portuguese <ldp-br@bazar.conectiva.com.br>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: array.c:112
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr "tentativa de usar parâmetro escalar `%s' como vetor"
+
+#: array.c:113
+#, c-format
+msgid "attempt to use scalar `%s' as array"
+msgstr "tentativa de usar escalar `%s' como vetor"
+
+#: array.c:151
+#, c-format
+msgid "from %s"
+msgstr "de %s"
+
+#: array.c:506
+#, c-format
+msgid "reference to uninitialized element `%s[\"%s\"]'"
+msgstr "referência a elemento não inicializado `%s[\"%s\"]'"
+
+#: array.c:512
+#, c-format
+msgid "subscript of array `%s' is null string"
+msgstr "índice do vetor `%s' é uma string nula"
+
+#: array.c:609
+#, c-format
+msgid "delete: index `%s' not in array `%s'"
+msgstr "delete: índice `%s' não está no vetor `%s'"
+
+#: array.c:769
+#, c-format
+msgid "%s: empty (null)\n"
+msgstr "%s: vazio (nulo)\n"
+
+#: array.c:774
+#, c-format
+msgid "%s: empty (zero)\n"
+msgstr "%s: vazio (zero)\n"
+
+#: array.c:778
+#, c-format
+msgid "%s: table_size = %d, array_size = %d\n"
+msgstr "%s: table_size = %d, array_size = %d\n"
+
+#: array.c:807
+#, c-format
+msgid "%s: is parameter\n"
+msgstr "%s: é parâmetro\n"
+
+#: array.c:812
+#, c-format
+msgid "%s: array_ref to %s\n"
+msgstr "%s: array_ref para %s\n"
+
+#: awkgram.y:208
+#, c-format
+msgid "%s blocks must have an action part"
+msgstr "blocos %s devem ter uma parte de ação"
+
+#: awkgram.y:211
+msgid "each rule must have a pattern or an action part"
+msgstr "cada regra deve ter um padrão ou uma parte de ação"
+
+#: awkgram.y:267
+#, c-format
+msgid "`%s' is a built-in function, it cannot be redefined"
+msgstr "`%s' é uma função intrínseca, não pode ser redefinida"
+
+#: awkgram.y:314
+#, c-format
+msgid "regexp constant `/%s/' looks like a C comment, but is not"
+msgstr "constante de expr. reg. `/%s/' parece um comentário C, mas não é"
+
+#: awkgram.y:340 awkgram.y:615
+msgid "statement may have no effect"
+msgstr "declaração pode não ter efeito"
+
+#: awkgram.y:435 awkgram.y:455
+#, c-format
+msgid "`%s' used in %s action"
+msgstr "`%s' usado em ação %s"
+
+#: awkgram.y:448 awkgram.y:451
+msgid "`nextfile' is a gawk extension"
+msgstr "`nextfile' é uma extensão do gawk"
+
+#: awkgram.y:465
+msgid "`return' used outside function context"
+msgstr "`return' usado fora do contexto de função"
+
+#: awkgram.y:504
+msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
+msgstr ""
+"`print' sozinho em regra BEGIN ou END provavelmente deveria ser `print \"\"'"
+
+#: awkgram.y:517 awkgram.y:524
+msgid "`delete array' is a gawk extension"
+msgstr "`delete array' é uma extensão do gawk"
+
+#: awkgram.y:532 awkgram.y:539
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "`delete(array)' é uma extensão não-portável do tawk"
+
+#: awkgram.y:583
+#, c-format
+msgid "duplicate case values in switch body: %s"
+msgstr "valores de case duplicados no corpo do switch: %s"
+
+#: awkgram.y:593
+msgid "Duplicate `default' detected in switch body"
+msgstr "Detectado `default' duplicado no corpo do switch"
+
+#: awkgram.y:681
+msgid "multistage two-way pipelines don't work"
+msgstr "pipelines bidirecionais de múltiplos estágios não funcionam"
+
+#: awkgram.y:772
+msgid "regular expression on right of assignment"
+msgstr "expressão regular à direita de atribuição"
+
+#: awkgram.y:782
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "expressão regular à esquerda de operador `~' ou `!~'"
+
+#: awkgram.y:790
+msgid "regular expression on right of comparison"
+msgstr "expressão regular à direita de comparação"
+
+#: awkgram.y:857
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "`getline' não-redirecionado não é definido dentro da ação END"
+
+#: awkgram.y:884
+msgid "call of `length' without parentheses is not portable"
+msgstr "chamada a `length' sem parênteses não é portável"
+
+#: awkgram.y:887
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "chamada a `length' sem parênteses é obsoleta de acordo com POSIX"
+
+#: awkgram.y:940
+msgid "use of non-array as array"
+msgstr "uso de não-vetor como vetor"
+
+#: awkgram.y:942
+msgid "invalid subscript expression"
+msgstr "expressão de índice inválida"
+
+#: awkgram.y:1140
+msgid "unexpected newline or end of string"
+msgstr "fim de linha ou de string inesperado"
+
+#: awkgram.y:1235
+msgid "empty program text on command line"
+msgstr "texto de programa vazio na linha de comando"
+
+#: awkgram.y:1292
+#, c-format
+msgid "can't open source file `%s' for reading (%s)"
+msgstr "impossível abrir arquivo-fonte `%s' para leitura (%s)"
+
+#: awkgram.y:1327
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "impossível ler arquivo-fonte `%s' (%s)"
+
+#: awkgram.y:1335
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "arquivo-fonte `%s' está vazio"
+
+#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100
+msgid "source file does not end in newline"
+msgstr "arquivo-fonte não termina em fim-de-linha"
+
+#: awkgram.y:1601
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr "expressão regular inacabada termina com `\\' ao fim do arquivo"
+
+#: awkgram.y:1621
+msgid "unterminated regexp"
+msgstr "expressão regular inacabada"
+
+#: awkgram.y:1624
+msgid "unterminated regexp at end of file"
+msgstr "expressão regular inacabada no fim do arquivo"
+
+#: awkgram.y:1691
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr "uso da continuação de linha `\\ #...' não é portável"
+
+#: awkgram.y:1703
+msgid "backslash not last character on line"
+msgstr "`\\' não é o último caracter da linha"
+
+#: awkgram.y:1748
+msgid "POSIX does not allow operator `**='"
+msgstr "POSIX não permite o operador `**='"
+
+#: awkgram.y:1750
+msgid "old awk does not support operator `**='"
+msgstr "o velho awk não suporta o operador `**='"
+
+#: awkgram.y:1759
+msgid "POSIX does not allow operator `**'"
+msgstr "POSIX não permite o operador `**'"
+
+#: awkgram.y:1761
+msgid "old awk does not support operator `**'"
+msgstr "o velho awk não suporta o operador `**'"
+
+#: awkgram.y:1792
+msgid "operator `^=' is not supported in old awk"
+msgstr "o velho awk não suporta o operador `^='"
+
+#: awkgram.y:1800
+msgid "operator `^' is not supported in old awk"
+msgstr "o velho awk não suporta o operador `^'"
+
+#: awkgram.y:1884 awkgram.y:1901
+msgid "unterminated string"
+msgstr "string inacabada"
+
+#: awkgram.y:2061
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "caracter inválido '%c' em expressão"
+
+#: awkgram.y:2121
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "`%s' é uma extensão do gawk"
+
+#: awkgram.y:2124
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "`%s' é uma extensão da Bell Labs"
+
+#: awkgram.y:2127
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "POSIX não permite `%s'"
+
+#: awkgram.y:2131
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "`%s' não é suportado no velho awk"
+
+#: awkgram.y:2158
+msgid "`goto' considered harmful!\n"
+msgstr "`goto' é considerado danoso!\n"
+
+#: awkgram.y:2220
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
+msgstr "%d é inválido como número de argumentos para %s"
+
+#: awkgram.y:2239 awkgram.y:2242
+msgid "match: third argument is a gawk extension"
+msgstr "match: terceiro argumento é uma extensão do gawk"
+
+#: awkgram.y:2255
+#, c-format
+msgid "%s: string literal as last arg of substitute has no effect"
+msgstr ""
+"%s: string literal como último argumento de substituição não tem efeito"
+
+#: awkgram.y:2258
+#, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "terceiro parâmetro %s não é um objeto modificável"
+
+#: awkgram.y:2285 awkgram.y:2288
+msgid "close: second argument is a gawk extension"
+msgstr "close: segundo argumento é uma extensão do gawk"
+
+#: awkgram.y:2298
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr "uso de dcgettext(_\"...\") é incorreto: remova o `_' precedente"
+
+#: awkgram.y:2313
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr "uso de dcngettext(_\"...\") é incorreto: remova o `_' precedente"
+
+#: awkgram.y:2384
+#, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "função `%s': parâmetro #%d, `%s', duplica parâmetro #%d"
+
+#: awkgram.y:2417
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "função `%s': parâmetro `%s' encobre variável global"
+
+#: awkgram.y:2529
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "impossível abrir `%s' para escrita (%s)"
+
+#: awkgram.y:2530 profile.c:93
+msgid "sending profile to standard error"
+msgstr "enviando perfil para saída de erros"
+
+#: awkgram.y:2562
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: `close' falhou (%s)"
+
+#: awkgram.y:2684
+msgid "shadow_funcs() called twice!"
+msgstr "shadow_funcs() chamada duas vezes!"
+
+#: awkgram.y:2711
+msgid "there were shadowed variables."
+msgstr "houve variáveis encobertas."
+
+#: awkgram.y:2784
+#, c-format
+msgid "function `%s': can't use function name as parameter name"
+msgstr "função `%s': não se pode usar o nome da função como nome de parâmetro"
+
+#: awkgram.y:2794
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "nome de função `%s' definido anteriormente"
+
+#: awkgram.y:2945 awkgram.y:2951
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "função `%s' chamada mas nunca definida"
+
+#: awkgram.y:2954
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "função `%s' definida mas nunca chamada"
+
+#: awkgram.y:2981
+#, c-format
+msgid "regexp constant for parameter #%d yields boolean value"
+msgstr ""
+"constante com expr. regular para parâmetro nº %d retorna valor booleano"
+
+#: awkgram.y:2994
+#, c-format
+msgid ""
+"function `%s' called with space between name and `(',\n"
+"%s"
+msgstr ""
+"função `%s' chamada com espaço entre o nome e o `(',\n"
+"%s"
+
+#: awkgram.y:2996
+msgid "or used as a variable or an array"
+msgstr "ou usado como uma variável ou vetor"
+
+#: builtin.c:137
+#, c-format
+msgid "%s to \"%s\" failed (%s)"
+msgstr "%s para \"%s\" falhou (%s)"
+
+#: builtin.c:138
+msgid "standard output"
+msgstr "saída padrão"
+
+#: builtin.c:139
+msgid "reason unknown"
+msgstr "motivo desconhecido"
+
+#: builtin.c:152
+msgid "exp: received non-numeric argument"
+msgstr "exp: recebeu argumento não-numérico"
+
+#: builtin.c:158
+#, c-format
+msgid "exp: argument %g is out of range"
+msgstr "exp: argumento %g está fora da faixa"
+
+#: builtin.c:216
+#, c-format
+msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
+msgstr ""
+"fflush: erro ao descarregar: pipe `%s' aberto para leitura, não gravação"
+
+#: builtin.c:219
+#, c-format
+msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
+msgstr ""
+"fflush: erro ao descarregar: arquivo `%s' aberto para leitura, não gravação"
+
+#: builtin.c:231
+#, c-format
+msgid "fflush: `%s' is not an open file, pipe or co-process"
+msgstr "fflush: `%s' não é um arquivo aberto, pipe ou co-processo"
+
+#: builtin.c:325
+msgid "index: received non-string first argument"
+msgstr "index: recebeu primeiro argumento não-string"
+
+#: builtin.c:327
+msgid "index: received non-string second argument"
+msgstr "index: recebeu segundo argumento não-string"
+
+#: builtin.c:437
+msgid "int: received non-numeric argument"
+msgstr "int: recebeu argumento não-numérico"
+
+#: builtin.c:454
+msgid "length: received non-string argument"
+msgstr "length: recebeu argumento não-string"
+
+#: builtin.c:470
+msgid "log: received non-numeric argument"
+msgstr "log: recebeu argumento não-numérico"
+
+#: builtin.c:473
+#, c-format
+msgid "log: received negative argument %g"
+msgstr "log: recebeu argumento negativo %g"
+
+#: builtin.c:635 builtin.c:638
+msgid "must use `count$' on all formats or none"
+msgstr "deve usar `count$' em todos os formatos ou nenhum"
+
+#: builtin.c:740
+msgid "`$' is not permitted in awk formats"
+msgstr "`$' não é permitido em formatos awk"
+
+#: builtin.c:746
+msgid "arg count with `$' must be > 0"
+msgstr "nº de argumentos com `$' deve ser > 0"
+
+#: builtin.c:748
+#, c-format
+msgid "arg count %ld greater than total number of supplied arguments"
+msgstr "nº de argumentos %ld maior que nº total de argumentos fornecidos"
+
+#: builtin.c:750
+msgid "`$' not permitted after period in format"
+msgstr "`$' não é permitido depois de ponto no formato"
+
+#: builtin.c:763
+msgid "no `$' supplied for positional field width or precision"
+msgstr "nenhum `$' fornecido para tamanho ou precisão de campo posicional"
+
+#: builtin.c:821
+msgid "`l' is meaningless in awk formats; ignored"
+msgstr "`l' não faz sentido em formatos awk; ignorado"
+
+#: builtin.c:825
+msgid "`l' is not permitted in POSIX awk formats"
+msgstr "`l' não é permitido em formatos POSIX awk"
+
+#: builtin.c:836
+msgid "`L' is meaningless in awk formats; ignored"
+msgstr "`L' não faz sentido em formatos awk; ignorado"
+
+#: builtin.c:840
+msgid "`L' is not permitted in POSIX awk formats"
+msgstr "`L' não é permitido em formatos POSIX awk"
+
+#: builtin.c:851
+msgid "`h' is meaningless in awk formats; ignored"
+msgstr "`h' não faz sentido em formatos awk; ignorado"
+
+#: builtin.c:855
+msgid "`h' is not permitted in POSIX awk formats"
+msgstr "`h' não é permitido em formatos POSIX awk"
+
+#: builtin.c:1055
+#, c-format
+msgid "[s]printf: value %g is out of range for `%%%c' format"
+msgstr "[s]printf: valor %g fora da faixa para formato `%%%c'"
+
+#: builtin.c:1108
+msgid "not enough arguments to satisfy format string"
+msgstr "argumentos insuficientes para a string de formato"
+
+#: builtin.c:1110
+msgid "^ ran out for this one"
+msgstr "^ acabou para este aqui"
+
+#: builtin.c:1115
+msgid "[s]printf: format specifier does not have control letter"
+msgstr "[s]printf: declaração de formato não tem letra de controle"
+
+#: builtin.c:1118
+msgid "too many arguments supplied for format string"
+msgstr "excesso de argumentos para a string de formato"
+
+#: builtin.c:1184 builtin.c:1187
+msgid "printf: no arguments"
+msgstr "printf: nenhum argumento"
+
+#: builtin.c:1211
+msgid "sqrt: received non-numeric argument"
+msgstr "sqrt: recebeu argumento não-numérico"
+
+#: builtin.c:1215
+#, c-format
+msgid "sqrt: called with negative argument %g"
+msgstr "sqrt: chamada com argumento negativo %g"
+
+#: builtin.c:1238
+#, c-format
+msgid "substr: start index %g is invalid, using 1"
+msgstr "substr: posição inicial %g é inválida, usando 1"
+
+#: builtin.c:1243
+#, c-format
+msgid "substr: non-integer start index %g will be truncated"
+msgstr "substr: posição inicial %g não-inteira será truncada"
+
+#: builtin.c:1262
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 1"
+msgstr "substr: comprimento %g é <= 0"
+
+#: builtin.c:1264
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 0"
+msgstr "substr: comprimento %g é <= 0"
+
+#: builtin.c:1271
+#, c-format
+msgid "substr: non-integer length %g will be truncated"
+msgstr "substr: comprimento %g não-inteiro será truncado"
+
+#: builtin.c:1276
+#, c-format
+msgid "substr: length %g too big for string indexing, truncating to %g"
+msgstr "substr: comprimento %g excessivo para indexação, truncando para %g"
+
+#: builtin.c:1288
+msgid "substr: source string is zero length"
+msgstr "substr: string origem tem comprimento zero"
+
+#: builtin.c:1294
+#, c-format
+msgid "substr: start index %g is past end of string"
+msgstr "substr: posição inicial %g além do fim da string"
+
+#: builtin.c:1302
+#, c-format
+msgid ""
+"substr: length %g at start index %g exceeds length of first argument (%lu)"
+msgstr ""
+"substr: comprimento %g a partir da posição %g excede tamanho do 1º argumento "
+"(%lu)"
+
+#: builtin.c:1337
+msgid "strftime: received non-string first argument"
+msgstr "strftime: recebeu primeiro argumento não-string"
+
+#: builtin.c:1343
+msgid "strftime: received empty format string"
+msgstr "strftime: recebeu string de formato vazia"
+
+#: builtin.c:1352
+msgid "strftime: received non-numeric second argument"
+msgstr "strftime: recebeu segundo argumento não-numérico"
+
+#: builtin.c:1415
+msgid "mktime: received non-string argument"
+msgstr "mktime: recebeu argumento não-string"
+
+#: builtin.c:1460
+msgid "system: received non-string argument"
+msgstr "system: recebeu argumento não-string"
+
+#: builtin.c:1581 eval.c:1883
+#, c-format
+msgid "reference to uninitialized field `$%d'"
+msgstr "referência a campo não inicializado `$%d'"
+
+#: builtin.c:1608
+msgid "tolower: received non-string argument"
+msgstr "tolower: recebeu argumento não-string"
+
+#: builtin.c:1657
+msgid "toupper: received non-string argument"
+msgstr "toupper: recebeu argumento não-string"
+
+#: builtin.c:1702
+msgid "atan2: received non-numeric first argument"
+msgstr "atan2: recebeu primeiro argumento não-numérico"
+
+#: builtin.c:1704
+msgid "atan2: received non-numeric second argument"
+msgstr "atan2: recebeu segundo argumento não-numérico"
+
+#: builtin.c:1723
+msgid "sin: received non-numeric argument"
+msgstr "sin: recebeu argumento não-numérico"
+
+#: builtin.c:1739
+msgid "cos: received non-numeric argument"
+msgstr "cos: recebeu argumento não-numérico"
+
+#: builtin.c:1788
+msgid "srand: received non-numeric argument"
+msgstr "srand: recebeu argumento não-numérico"
+
+#: builtin.c:1823
+msgid "match: third argument is not an array"
+msgstr "match: terceiro argumento não é um vetor"
+
+#: builtin.c:2307
+msgid "gensub: third argument of 0 treated as 1"
+msgstr "gensub: 3º argumento 0 tratado como 1"
+
+#: builtin.c:2416 builtin.c:2418
+msgid "lshift: received non-numeric first argument"
+msgstr "lshift: recebeu primeiro argumento não-numérico"
+
+#: builtin.c:2420
+#, c-format
+msgid "lshift(%lf, %lf): negative values will give strange results"
+msgstr "lshift(%lf, %lf): valores negativos darão resultados estranhos"
+
+#: builtin.c:2422
+#, c-format
+msgid "lshift(%lf, %lf): fractional values will be truncated"
+msgstr "lshift(%lf, %lf): valores fracionários serão truncados"
+
+#: builtin.c:2424
+#, c-format
+msgid "lshift(%lf, %lf): too large shift value will give strange results"
+msgstr "lshift(%lf, %lf): deslocamento excessivo dará resultados estranhos"
+
+#: builtin.c:2453 builtin.c:2455
+msgid "rshift: received non-numeric first argument"
+msgstr "rshift: recebeu primeiro argumento não-numérico"
+
+#: builtin.c:2457
+#, c-format
+msgid "rshift(%lf, %lf): negative values will give strange results"
+msgstr "rshift(%lf, %lf): valores negativos darão resultados estranhos"
+
+#: builtin.c:2459
+#, c-format
+msgid "rshift(%lf, %lf): fractional values will be truncated"
+msgstr "rshift(%lf, %lf): valores fracionários serão truncados"
+
+#: builtin.c:2461
+#, c-format
+msgid "rshift(%lf, %lf): too large shift value will give strange results"
+msgstr "rshift(%lf, %lf): deslocamento excessivo dará resultados estranhos"
+
+#: builtin.c:2490 builtin.c:2492
+msgid "and: received non-numeric first argument"
+msgstr "and: recebeu primeiro argumento não-numérico"
+
+#: builtin.c:2494
+#, c-format
+msgid "and(%lf, %lf): negative values will give strange results"
+msgstr "and(%lf, %lf): valores negativos darão resultados estranhos"
+
+#: builtin.c:2496
+#, c-format
+msgid "and(%lf, %lf): fractional values will be truncated"
+msgstr "and(%lf, %lf): valores fracionários serão truncados"
+
+#: builtin.c:2525 builtin.c:2527
+msgid "or: received non-numeric first argument"
+msgstr "or: recebeu primeiro argumento não-numérico"
+
+#: builtin.c:2529
+#, c-format
+msgid "or(%lf, %lf): negative values will give strange results"
+msgstr "or(%lf, %lf): valores negativos darão resultados estranhos"
+
+#: builtin.c:2531
+#, c-format
+msgid "or(%lf, %lf): fractional values will be truncated"
+msgstr "or(%lf, %lf): valores fracionários serão truncados"
+
+#: builtin.c:2560 builtin.c:2562
+msgid "xor: received non-numeric first argument"
+msgstr "xor: recebeu primeiro argumento não-numérico"
+
+#: builtin.c:2564
+#, c-format
+msgid "xor(%lf, %lf): negative values will give strange results"
+msgstr "xor(%lf, %lf): valores negativos darão resultados estranhos"
+
+#: builtin.c:2566
+#, c-format
+msgid "xor(%lf, %lf): fractional values will be truncated"
+msgstr "xor(%lf, %lf): valores fracionários serão truncados"
+
+#: builtin.c:2594
+msgid "compl: received non-numeric argument"
+msgstr "compl: recebeu primeiro argumento não-numérico"
+
+#: builtin.c:2596
+#, c-format
+msgid "compl(%lf): negative value will give strange results"
+msgstr "compl(%lf): valores negativos darão resultados estranhos"
+
+#: builtin.c:2598
+#, c-format
+msgid "compl(%lf): fractional value will be truncated"
+msgstr "compl(%lf): valores fracionários serão truncados"
+
+#: builtin.c:2771
+#, c-format
+msgid "dcgettext: `%s' is not a valid locale category"
+msgstr "dcgettext: `%s' não é uma categoria de \"locale\" válida"
+
+#: eval.c:266
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "tipo de nodo desconhecido %d"
+
+#: eval.c:312
+msgid "buffer overflow in genflags2str"
+msgstr "estouro de buffer em genflags2str"
+
+#: eval.c:647
+#, c-format
+msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
+msgstr ""
+"loop for: vetor `%s' mudou de tamanho de %ld para %ld durante a execução"
+
+#: eval.c:668
+msgid "`break' outside a loop is not portable"
+msgstr "`break' fora de um loop não é portável"
+
+#: eval.c:672
+msgid "`break' outside a loop is not allowed"
+msgstr "`break' fora de um loop não é permitido"
+
+#: eval.c:689
+msgid "`continue' outside a loop is not portable"
+msgstr "`continue' fora de um loop não é portável"
+
+#: eval.c:693
+msgid "`continue' outside a loop is not allowed"
+msgstr "`continue' fora de um loop não é permitido"
+
+#: eval.c:727
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "`next' não pode ser chamado de uma regra BEGIN"
+
+#: eval.c:729
+msgid "`next' cannot be called from an END rule"
+msgstr "`next' não pode ser chamado de uma regra END"
+
+#: eval.c:738
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "`nextfile' não pode ser chamado de uma regra BEGIN"
+
+#: eval.c:740
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "`nextfile' não pode ser chamado de uma regra END"
+
+#: eval.c:785
+msgid "statement has no effect"
+msgstr "declaração não tem efeito"
+
+#: eval.c:828 eval.c:1726
+#, c-format
+msgid "can't use function name `%s' as variable or array"
+msgstr "não se pode usar o nome de função `%s' como variável ou vetor"
+
+#: eval.c:835 eval.c:841
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "referência a argumento não inicializado `%s'"
+
+#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807
+#, c-format
+msgid "attempt to use array `%s' in a scalar context"
+msgstr "tentativa de usar vetor `%s' em um contexto escalar"
+
+#: eval.c:858 eval.c:1752
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "referência a variável não inicializada `%s'"
+
+#: eval.c:1007
+msgid ""
+"concatenation: side effects in one expression have changed the length of "
+"another!"
+msgstr ""
+"concatenação: efeitos colaterais em um contexto mudaram o comprimento de "
+"outro!"
+
+#: eval.c:1032
+msgid "assignment used in conditional context"
+msgstr "atribuição usada em contexto condicional"
+
+#: eval.c:1122
+msgid "division by zero attempted"
+msgstr "tentativa de divisão por zero"
+
+#: eval.c:1137
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "tentativa de divisão por zero em `%%'"
+
+#: eval.c:1152 profile.c:683
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "tipo ilegal (%s) em tree_eval"
+
+#: eval.c:1328
+msgid "division by zero attempted in `/='"
+msgstr "tentativa de divisão por zero em `/='"
+
+#: eval.c:1346
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "tentativa de divisão por zero em `%%='"
+
+#: eval.c:1586
+#, c-format
+msgid "function `%s' called with more arguments than declared"
+msgstr "função `%s' chamada com mais argumentos que os declarados"
+
+#: eval.c:1633
+#, c-format
+msgid "function `%s' not defined"
+msgstr "função `%s' não definida"
+
+#: eval.c:1639
+#, c-format
+msgid "function %s called\n"
+msgstr "função %s chamada\n"
+
+#: eval.c:1698
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# Pilha de Chamadas de Função:\n"
+"\n"
+
+#: eval.c:1701
+msgid "\t# -- main --\n"
+msgstr "\t# -- main --\n"
+
+#: eval.c:1867
+msgid "attempt to field reference from non-numeric value"
+msgstr "tentativa de referência a campo a partir de valor não-numérico"
+
+#: eval.c:1869
+msgid "attempt to reference from null string"
+msgstr "tentativa de referência a partir de string nula"
+
+#: eval.c:1875
+#, c-format
+msgid "attempt to access field %d"
+msgstr "tentativa de acessar campo %d"
+
+#: eval.c:1896 eval.c:1903 profile.c:900
+msgid "assignment is not allowed to result of builtin function"
+msgstr "atribuição não pode resultar de funções intrínsecas"
+
+#: eval.c:1951
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "`IGNORECASE' é uma extensão do gawk"
+
+#: eval.c:1980
+msgid "`BINMODE' is a gawk extension"
+msgstr "`BINMODE' é uma extensão do gawk"
+
+#: eval.c:2092
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "especificação `%sFMT' inválida `%s'"
+
+#: eval.c:2170
+msgid "turning off `--lint' due to assignment to `LINT'"
+msgstr "desativando `--lint' devido a atribuição a `LINT'"
+
+#: ext.c:60 ext.c:64
+msgid "`extension' is a gawk extension"
+msgstr "`extension' é uma extensão do gawk"
+
+#: ext.c:74
+#, c-format
+msgid "extension: cannot open `%s' (%s)\n"
+msgstr "extension: impossível abrir `%s' (%s)\n"
+
+#: ext.c:82
+#, c-format
+msgid "extension: library `%s': cannot call function `%s' (%s)\n"
+msgstr "extension: biblioteca `%s': impossível chamar função `%s' (%s)\n"
+
+#: ext.c:183
+msgid "Operation Not Supported"
+msgstr "Operação Não Suportada"
+
+#: field.c:315
+msgid "NF set to negative value"
+msgstr "valor negativo atribuído a NF"
+
+#: field.c:808
+msgid "split: second argument is not an array"
+msgstr "split: segundo argumento não é um vetor"
+
+#: field.c:842
+msgid "split: null string for third arg is a gawk extension"
+msgstr "split: string nula para segundo argumento é uma extensão do gawk"
+
+#: field.c:894
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "`FIELDWIDTHS' é uma extensão do gawk"
+
+#: field.c:921
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "campo %d em FIELDWIDTHS deve ser > 0"
+
+#: field.c:994
+msgid "null string for `FS' is a gawk extension"
+msgstr "string nula para `FS' é uma extensão do gawk"
+
+#: getopt.c:692 getopt.c:704
+#, c-format
+msgid "%s: option `%s' is ambiguous\n"
+msgstr "%s: opção `%s' é ambígua\n"
+
+#: getopt.c:737 getopt.c:741
+#, c-format
+msgid "%s: option `--%s' doesn't allow an argument\n"
+msgstr "%s: opção `--%s' não aceita argumento\n"
+
+#: getopt.c:750 getopt.c:755
+#, c-format
+msgid "%s: option `%c%s' doesn't allow an argument\n"
+msgstr "%s: opção `%c%s' não aceita 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: opção `%s' requer argumento\n"
+
+#: getopt.c:842 getopt.c:845
+#, c-format
+msgid "%s: unrecognized option `--%s'\n"
+msgstr "%s: opção não reconhecida `--%s'\n"
+
+#: getopt.c:853 getopt.c:856
+#, c-format
+msgid "%s: unrecognized option `%c%s'\n"
+msgstr "%s: opção não reconhecida `%c%s'\n"
+
+#: getopt.c:903 getopt.c:906
+#, c-format
+msgid "%s: illegal option -- %c\n"
+msgstr "%s: opção ilegal -- %c\n"
+
+#: getopt.c:912 getopt.c:915
+#, c-format
+msgid "%s: invalid option -- %c\n"
+msgstr "%s: opção inválida -- %c\n"
+
+#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:434
+#, c-format
+msgid "%s: option requires an argument -- %c\n"
+msgstr "%s: opção requer argumento -- %c\n"
+
+#: getopt.c:1025 getopt.c:1036
+#, c-format
+msgid "%s: option `-W %s' is ambiguous\n"
+msgstr "%s: opção `-W %s' é ambígua\n"
+
+#: getopt.c:1060 getopt.c:1072
+#, c-format
+msgid "%s: option `-W %s' doesn't allow an argument\n"
+msgstr "%s: opção `-W %s' não aceita argumento\n"
+
+#: io.c:305
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "impossível abrir arquivo `%s' para leitura (%s)"
+
+#: io.c:392
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "fechamento do descritor %d (`%s') falhou (%s)"
+
+#: io.c:530
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "tipo de árvore %s inválido em redirect()"
+
+#: io.c:536
+#, c-format
+msgid "expression in `%s' redirection only has numeric value"
+msgstr "expressão no redirecionamento `%s' só tem valor numérico"
+
+#: io.c:542
+#, c-format
+msgid "expression for `%s' redirection has null string value"
+msgstr "expressão para o redirecionamento `%s' tem valor string nulo"
+
+#: io.c:547
+#, c-format
+msgid "filename `%s' for `%s' redirection may be result of logical expression"
+msgstr ""
+"nome de arquivo `%s' para redirecionamento `%s' pode ser resultado de "
+"expressão lógica"
+
+#: io.c:569
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "mistura desnecessária de `>' e `>>' para arquivo `%.*s'"
+
+#: io.c:621
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "impossível abrir pipe `%s' para saída (%s)"
+
+#: io.c:630
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "impossível abrir pipe `%s' para entrada (%s)"
+
+#: io.c:643
+#, c-format
+msgid "can't open two way socket `%s' for input/output (%s)"
+msgstr "impossível abrir socket bidirecional `%s' para entrada/saída (%s)"
+
+#: io.c:647
+#, c-format
+msgid "can't open two way pipe `%s' for input/output (%s)"
+msgstr "impossível abrir pipe bidirecional `%s' para entrada/saída (%s)"
+
+#: io.c:723
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "impossível redirecionar de `%s' (%s)"
+
+#: io.c:726
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "impossível redirecionar para `%s' (%s)"
+
+#: io.c:765
+msgid ""
+"reached system limit for open files: starting to multiplex file descriptors"
+msgstr ""
+"alcançado limite do sistema para arquivos abertos; começando a multiplexar "
+"descritores de arquivos"
+
+#: io.c:777
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "fechamento de `%s' falhou (%s)"
+
+#: io.c:784
+msgid "too many pipes or input files open"
+msgstr "excesso de pipes ou arquivos de entrada abertos"
+
+#: io.c:807
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: segundo argumento deve ser `to' ou `from'"
+
+#: io.c:821
+#, c-format
+msgid "close: `%.*s' is not an open file, pipe or co-process"
+msgstr "close: `%.*s' não é um arquivo aberto, pipe ou co-processo"
+
+#: io.c:825
+msgid "close of redirection that was never opened"
+msgstr "fechamento de redirecionamento que nunca foi aberto"
+
+#: io.c:862
+#, c-format
+msgid "close: redirection `%s' not opened with `|&', second argument ignored"
+msgstr ""
+"close: redirecionamento `%s' não foi aberto com `|&', segundo argumento "
+"ignorado"
+
+#: io.c:924
+#, c-format
+msgid "failure status (%d) on pipe close of `%s' (%s)"
+msgstr "status de falha (%d) ao fechar pipe de `%s' (%s)"
+
+#: io.c:927
+#, c-format
+msgid "failure status (%d) on file close of `%s' (%s)"
+msgstr "status de falha (%d) ao fechar arquivo de `%s' (%s)"
+
+#: io.c:946
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "fechamento explícito do socket `%s' não fornecido"
+
+#: io.c:949
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "fechamento explícito do co-processo `%s' não fornecido"
+
+#: io.c:952
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "fechamento explícito do pipe `%s' não fornecido"
+
+#: io.c:955
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "fechamento explícito do arquivo `%s' não fornecido"
+
+#: io.c:984 io.c:1038
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "erro ao escrever na saída padrão (%s)"
+
+#: io.c:988 io.c:1042
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "erro ao escrever na saída padrão de erros (%s)"
+
+#: io.c:996
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "descarga de pipe de `%s' falhou (%s)."
+
+#: io.c:999
+#, c-format
+msgid "co-process flush of pipe to `%s' failed (%s)."
+msgstr "descarga de co-processo de pipe para `%s' falhou (%s)."
+
+#: io.c:1002
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "descarga de arquivo de `%s' falhou (%s)."
+
+#: io.c:1161
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "infelizmente, o cliente de /inet/raw não está concluído"
+
+#: io.c:1163 io.c:1200
+msgid "only root may use `/inet/raw'."
+msgstr "apenas root pode usar `/inet/raw'."
+
+#: io.c:1198
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "infelizmente, o servidor de /inet/raw não está concluído"
+
+#: io.c:1288
+#, c-format
+msgid "no (known) protocol supplied in special filename `%s'"
+msgstr ""
+"nenhum protocolo (conhecido) fornecido em nome de arquivo especial `%s'"
+
+#: io.c:1306
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "nome de arquivo especial `%s' está incompleto"
+
+#: io.c:1318
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "porta local inválida em `%s'"
+
+#: io.c:1330
+msgid "must supply a remote hostname to `/inet'"
+msgstr "deve ser fornecido um nome de host remoto para `/inet'"
+
+#: io.c:1345
+msgid "must supply a remote port to `/inet'"
+msgstr "deve ser fornecida uma porta remota para `/inet'"
+
+#: io.c:1351
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "porta remota inválida em `%s'"
+
+#: io.c:1361
+msgid "TCP/IP communications are not supported"
+msgstr "comunicação TCP/IP não é suportada"
+
+#: io.c:1370 io.c:1551
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "arquivo `%s' é um diretório"
+
+#: io.c:1440
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "use `PROCINFO[\"%s\"]' em vez de `%s'"
+
+#: io.c:1472
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "use `PROCINFO[...]' em vez de `/dev/user'"
+
+#: io.c:1537 io.c:1711
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "impossível abrir `%s', modo `%s'"
+
+#: io.c:1762
+#, c-format
+msgid "close of master pty failed (%s)"
+msgstr "falha ao fechar pty mestre (%s)"
+
+#: io.c:1764 io.c:1916 io.c:2068
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "falha ao fechar stdout em filho (%s)"
+
+#: io.c:1767
+#, c-format
+msgid "moving slave pty to stdout in child failed (dup: %s)"
+msgstr "falha ao mover pty escrava para stdout em filho (dup: %s)"
+
+#: io.c:1769 io.c:1921
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "falha ao fechar stdin em filho (%s)"
+
+#: io.c:1772
+#, c-format
+msgid "moving slave pty to stdin in child failed (dup: %s)"
+msgstr "falha ao mover pty escrava para stdin em filho (dup: %s)"
+
+#: io.c:1774 io.c:1793
+#, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "falha ao fechar pty escrava (%s)"
+
+#: io.c:1867 io.c:1919 io.c:2049 io.c:2071
+#, c-format
+msgid "moving pipe to stdout in child failed (dup: %s)"
+msgstr "falha ao mover pipe para stdout em processo pai (dup: %s)"
+
+#: io.c:1871 io.c:1924
+#, c-format
+msgid "moving pipe to stdin in child failed (dup: %s)"
+msgstr "falha ao mover pipe para stdin em processo pai (dup: %s)"
+
+#: io.c:1888 io.c:2062
+msgid "restoring stdout in parent process failed\n"
+msgstr "falha ao restaurar stdout em processo pai\n"
+
+#: io.c:1893
+msgid "restoring stdin in parent process failed\n"
+msgstr "falha ao restaurar stdin em processo pai\n"
+
+#: io.c:1927 io.c:2073 io.c:2084
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "falha ao fechar pipe (%s)"
+
+#: io.c:1972
+msgid "`|&' not supported"
+msgstr "`|&' não suportado"
+
+#: io.c:2039
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "impossível abrir pipe `%s' (%s)"
+
+#: io.c:2080
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr "impossível criar processo filho para `%s' (fork: %s)"
+
+#: io.c:2423
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "arquivo de dados `%s' vazio"
+
+#: io.c:2466 io.c:2474
+msgid "could not allocate more input memory"
+msgstr "impossível alocar mais memória de entrada"
+
+#: io.c:2832 io.c:2895
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "erro ao ler arquivo de entrada `%s': %s"
+
+#: io.c:3020
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "valor de múltiplos caracteres para `RS' é uma extensão do gawk"
+
+#: main.c:324
+msgid "`-m[fr]' option irrelevant in gawk"
+msgstr "opção `-m[fr] é irrelevante no gawk"
+
+#: main.c:326
+msgid "-m option usage: `-m[fr] nnn'"
+msgstr "uso da opção -m: `-m[fr] nnn'"
+
+#: main.c:343
+#, c-format
+msgid "%s: option `-W %s' unrecognized, ignored\n"
+msgstr "%s: opção `-W %s' não reconhecida, ignorada\n"
+
+#: main.c:380
+msgid "empty argument to `--source' ignored"
+msgstr "argumento vazio para --source ignorado"
+
+#: main.c:451
+msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
+msgstr "variável de ambiente `POSIXLY_CORRECT' ativada: ligando `--posix'"
+
+#: main.c:456
+msgid "`--posix' overrides `--traditional'"
+msgstr "`--posix' sobrepõe `--traditional'"
+
+#: main.c:467
+msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
+msgstr "`--posix'/`--traditional' sobrepõe `--non-decimal-data'"
+
+#: main.c:471
+#, c-format
+msgid "running %s setuid root may be a security problem"
+msgstr "rodar %s com setuid root pode ser um problema de segurança"
+
+#: main.c:512
+#, c-format
+msgid "can't set binary mode on stdin (%s)"
+msgstr "impossível ativar modo binário em stdin (%s)"
+
+#: main.c:515
+#, c-format
+msgid "can't set binary mode on stdout (%s)"
+msgstr "impossível ativar modo binário em stdout (%s)"
+
+#: main.c:517
+#, c-format
+msgid "can't set binary mode on stderr (%s)"
+msgstr "impossível ativar modo binário em stderr (%s)"
+
+#: main.c:547
+msgid "no program text at all!"
+msgstr "nenhum texto de programa"
+
+#: main.c:620
+#, c-format
+msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
+msgstr "Uso: %s [opções estilo POSIX ou GNU] -f arqprog [--] arquivo ...\n"
+
+#: main.c:622
+#, c-format
+msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
+msgstr "Uso: %s [opções estilo POSIX ou GNU] [--] %cprograma%c arquivo ...\n"
+
+#: main.c:627
+msgid "POSIX options:\t\tGNU long options:\n"
+msgstr "Opções POSIX: \t\tOpções longas GNU:\n"
+
+#: main.c:628
+msgid "\t-f progfile\t\t--file=progfile\n"
+msgstr "\t-f arqprog \t\t--file=arqprog\n"
+
+#: main.c:629
+msgid "\t-F fs\t\t\t--field-separator=fs\n"
+msgstr "\t-F fs\t\t\t--field-separator=fs\n"
+
+#: main.c:630
+msgid "\t-v var=val\t\t--assign=var=val\n"
+msgstr "\t-v var=val\t\t--assign=var=val\n"
+
+#: main.c:631
+msgid "\t-m[fr] val\n"
+msgstr "\t-m[fr] val\n"
+
+#: main.c:632
+msgid "\t-W compat\t\t--compat\n"
+msgstr "\t-W compat\t\t--compat\n"
+
+#: main.c:633
+msgid "\t-W copyleft\t\t--copyleft\n"
+msgstr "\t-W copyleft\t\t--copyleft\n"
+
+#: main.c:634
+msgid "\t-W copyright\t\t--copyright\n"
+msgstr "\t-W copyright\t\t--copyright\n"
+
+#: main.c:635
+msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
+msgstr "\t-W dump-variables[=arq] \t--dump-variables[=arq]\n"
+
+#: main.c:636
+msgid "\t-W gen-po\t\t--gen-po\n"
+msgstr "\t-W gen-po\t\t--gen-po\n"
+
+#: main.c:637
+msgid "\t-W help\t\t\t--help\n"
+msgstr "\t-W help\t\t\t--help\n"
+
+#: main.c:638
+msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+
+#: main.c:639
+msgid "\t-W lint-old\t\t--lint-old\n"
+msgstr "\t-W lint-old\t\t--lint-old\n"
+
+#: main.c:640
+msgid "\t-W non-decimal-data\t--non-decimal-data\n"
+msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
+
+#: main.c:642
+msgid "\t-W nostalgia\t\t--nostalgia\n"
+msgstr "\t-W nostalgia\t\t--nostalgia\n"
+
+#: main.c:645
+msgid "\t-W parsedebug\t\t--parsedebug\n"
+msgstr "\t-W parsedebug\t\t--parsedebug\n"
+
+#: main.c:647
+msgid "\t-W profile[=file]\t--profile[=file]\n"
+msgstr "\t-W profile[=arq] \t--profile[=arq]\n"
+
+#: main.c:648
+msgid "\t-W posix\t\t--posix\n"
+msgstr "\t-W posix\t\t--posix\n"
+
+#: main.c:649
+msgid "\t-W re-interval\t\t--re-interval\n"
+msgstr "\t-W re-interval\t\t--re-interval\n"
+
+#: main.c:650
+msgid "\t-W source=program-text\t--source=program-text\n"
+msgstr "\t-W source=program-text\t--source=program-text\n"
+
+#: main.c:651
+msgid "\t-W traditional\t\t--traditional\n"
+msgstr "\t-W traditional\t\t--traditional\n"
+
+#: main.c:652
+msgid "\t-W usage\t\t--usage\n"
+msgstr "\t-W usage\t\t--usage\n"
+
+#: main.c:653
+msgid "\t-W version\t\t--version\n"
+msgstr "\t-W version\t\t--version\n"
+
+#: main.c:657
+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"
+"Em caso de defeito, veja o nodo `Bugs' em `gawk.info', que é a\n"
+"seção `Reportando Problemas e Bugs' na versão impressa.\n"
+"\n"
+
+#: main.c:661
+msgid ""
+"gawk is a pattern scanning and processing language.\n"
+"By default it reads standard input and writes standard output.\n"
+"\n"
+msgstr ""
+"gawk é uma linguagem de processamento e busca de padrões.\n"
+"Por padrão, o gawk lê a entrada padrão e escreve na saída padrão.\n"
+"\n"
+
+#: main.c:665
+msgid ""
+"Examples:\n"
+"\tgawk '{ sum += $1 }; END { print sum }' file\n"
+"\tgawk -F: '{ print $1 }' /etc/passwd\n"
+msgstr ""
+"Exemplos:\n"
+"\tgawk '{ soma += $1 }; END { print soma }' arquivo\n"
+"\tgawk -F: '{ print $1 }' /etc/passwd\n"
+
+#: main.c:682
+#, 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 é Software Livre; você pode redistribuí-lo e/ou modificá-lo\n"
+"de acordo com os termos da Licença Pública Geral GNU (GNU GPL) na "
+"formapublicada pela Free Software Foundation; ou a versão 2 da licença ou "
+"(aoseu critério) qualquer versão posterior.\n"
+"\n"
+
+#: main.c:690
+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 é distribuído na esperança de ser útil, mas SEM\n"
+"QUALQUER GARANTIA. Veja a Licença Pública Geral GNU (GNU GPL)\n"
+"para mais detalhes.\n"
+
+#: main.c:696
+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 ""
+"Você deve ter recebido uma cópia da Licença Pública Geral GNU (GNU GPL)\n"
+"junto com este programa; caso contrário, escreva à Free Software\n"
+"Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"
+
+#: main.c:730
+msgid "-Ft does not set FS to tab in POSIX awk"
+msgstr "-Ft não faz FS ser tab no awk POSIX"
+
+#: main.c:956
+#, c-format
+msgid ""
+"%s: `%s' argument to `-v' not in `var=value' form\n"
+"\n"
+msgstr ""
+"%s: argumento `%s' para `-v' não está na forma `var=valor'\n"
+"\n"
+
+#: main.c:976
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr "`%s' não é um nome legal de variável"
+
+#: main.c:979
+#, c-format
+msgid "`%s' is not a variable name, looking for file `%s=%s'"
+msgstr "`%s' não é um nome de variável, procurando arquivo `%s=%s'"
+
+#: main.c:1012
+msgid "floating point exception"
+msgstr "exceção de ponto flutuante"
+
+#: main.c:1019
+msgid "fatal error: internal error"
+msgstr "erro fatal: erro interno"
+
+#: main.c:1069
+#, c-format
+msgid "no pre-opened fd %d"
+msgstr "nenhum descritor pré-aberto %d"
+
+#: main.c:1074
+#, c-format
+msgid "could not pre-open /dev/null for fd %d"
+msgstr "impossível pré-abrir /dev/null para descritor %d"
+
+#: main.c:1097 main.c:1106
+#, c-format
+msgid "could not find groups: %s"
+msgstr "impossível achar grupos: %s"
+
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "lin. de com.:"
+
+#: msg.c:120
+msgid "warning: "
+msgstr "aviso: "
+
+#: msg.c:142
+msgid "error: "
+msgstr "erro: "
+
+#: msg.c:178
+msgid "fatal: "
+msgstr "fatal: "
+
+#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115
+msgid "can't convert string to float"
+msgstr "impossível converter string para float"
+
+#: node.c:355
+msgid "backslash at end of string"
+msgstr "barra invertida (\\) no fim da string"
+
+#: node.c:539
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX não permite escapes do tipo `\\x'"
+
+#: node.c:545
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "nenhum dígito hexa em seqüência de escape `\\x'"
+
+#: node.c:579
+#, c-format
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr "seqüência de escape `\\%c' tratada como `%c' normal"
+
+#: posix/gawkmisc.c:172
+#, c-format
+msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
+msgstr "%s %s `%s': impossível ativar fechar-ao-executar: (fcntl: %s)"
+
+#: profile.c:91
+#, c-format
+msgid "could not open `%s' for writing: %s"
+msgstr "impossível abrir `%s' para escrita: %s"
+
+#: profile.c:449
+#, c-format
+msgid "internal error: %s with null vname"
+msgstr "erro interno: %s com vname nulo"
+
+#: profile.c:512
+msgid "# treated internally as `delete'"
+msgstr "# tratado internamente como `delete'"
+
+#: profile.c:1162
+#, c-format
+msgid "\t# gawk profile, created %s\n"
+msgstr "\t# perfil gawk, criado %s\n"
+
+#: profile.c:1165
+msgid ""
+"\t# BEGIN block(s)\n"
+"\n"
+msgstr ""
+"\t# bloco(s) BEGIN\n"
+"\n"
+
+#: profile.c:1175
+msgid ""
+"\t# Rule(s)\n"
+"\n"
+msgstr ""
+"\t# Regra(s)\n"
+"\n"
+
+#: profile.c:1181
+msgid ""
+"\t# END block(s)\n"
+"\n"
+msgstr ""
+"\t# bloco(s) END\n"
+"\n"
+
+#: profile.c:1201
+msgid ""
+"\n"
+"\t# Functions, listed alphabetically\n"
+msgstr ""
+"\n"
+"\t# Funções, listadas alfabeticamente\n"
+
+#: profile.c:1413
+#, c-format
+msgid "unexpected type %s in prec_level"
+msgstr "tipo inesperado %s em prec_level"
+
+#: re.c:193
+#, c-format
+msgid "regex match failed, not enough memory to match string \"%.*s%s\""
+msgstr ""
+"busca por exp. reg. falhou, memória insuficiente para testar string \"%.*s%s"
+"\""
+
+#: regcomp.c:136
+msgid "Success"
+msgstr "Sucesso"
+
+#: regcomp.c:139
+msgid "No match"
+msgstr "Sem combinação"
+
+#: regcomp.c:142
+msgid "Invalid regular expression"
+msgstr "Expressão regular inválida"
+
+#: regcomp.c:145
+msgid "Invalid collation character"
+msgstr "Caracter de combinação inválido"
+
+#: regcomp.c:148
+msgid "Invalid character class name"
+msgstr "Nome de classe de caracter inválido"
+
+#: regcomp.c:151
+msgid "Trailing backslash"
+msgstr "contra-barra (\\) finalizando"
+
+#: regcomp.c:154
+msgid "Invalid back reference"
+msgstr "Referência anterior inválida"
+
+#: regcomp.c:157
+msgid "Unmatched [ or [^"
+msgstr "[ ou [^ não emparelhado"
+
+#: regcomp.c:160
+msgid "Unmatched ( or \\("
+msgstr "( ou \\( não emparelhado"
+
+#: regcomp.c:163
+msgid "Unmatched \\{"
+msgstr "\\{ não emparelhado"
+
+#: regcomp.c:166
+msgid "Invalid content of \\{\\}"
+msgstr "Conteúdo inválido de \\{\\}"
+
+#: regcomp.c:169
+msgid "Invalid range end"
+msgstr "Fim de faixa inválido"
+
+#: regcomp.c:172
+msgid "Memory exhausted"
+msgstr "Memória esgotada"
+
+#: regcomp.c:175
+msgid "Invalid preceding regular expression"
+msgstr "Expressão regular anterior inválida"
+
+#: regcomp.c:178
+msgid "Premature end of regular expression"
+msgstr "Fim prematuro da expressão regular"
+
+#: regcomp.c:181
+msgid "Regular expression too big"
+msgstr "Expressão regular grande demais"
+
+#: regcomp.c:184
+msgid "Unmatched ) or \\)"
+msgstr ") ou \\) desemparelhado"
+
+#: regcomp.c:621
+msgid "No previous regular expression"
+msgstr "Nenhuma expressão regular anterior"
+
+#~ msgid "substr: length %g is < 0"
+#~ msgstr "substr: comprimento %g é < 0"
+
+#~ msgid "delete: illegal use of variable `%s' as array"
+#~ msgstr "delete: uso ilegal da variável `%s' como vetor"
+
+#~ msgid "asort: first argument is not an array"
+#~ msgstr "asort: primeiro argumento não é um vetor"
+
+#~ msgid "asort: second argument is not an array"
+#~ msgstr "asort: segundo argumento não é um vetor"
+
+#~ msgid "internal error: Node_var_array with null vname"
+#~ msgstr "erro interno: Node_var_array com vname nulo"
diff --git a/gnu/dist/gawk/po/quot.sed b/gnu/dist/gawk/po/quot.sed
new file mode 100644
index 00000000000..0122c46318d
--- /dev/null
+++ b/gnu/dist/gawk/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/gnu/dist/gawk/po/remove-potcdate.sin b/gnu/dist/gawk/po/remove-potcdate.sin
new file mode 100644
index 00000000000..2436c49e786
--- /dev/null
+++ b/gnu/dist/gawk/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/gnu/dist/gawk/po/stamp-po b/gnu/dist/gawk/po/stamp-po
new file mode 100644
index 00000000000..9788f70238c
--- /dev/null
+++ b/gnu/dist/gawk/po/stamp-po
@@ -0,0 +1 @@
+timestamp
diff --git a/gnu/dist/gawk/po/sv.gmo b/gnu/dist/gawk/po/sv.gmo
new file mode 100644
index 00000000000..73d6c090ed7
--- /dev/null
+++ b/gnu/dist/gawk/po/sv.gmo
Binary files differ
diff --git a/gnu/dist/gawk/po/sv.po b/gnu/dist/gawk/po/sv.po
new file mode 100644
index 00000000000..60aa4def99a
--- /dev/null
+++ b/gnu/dist/gawk/po/sv.po
@@ -0,0 +1,1844 @@
+# Swedish translation of gawk
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# Martin Sjögren <md9ms@mdstud.chalmers.se>, 2001-2002.
+#
+# Id: sv.po,v 1.23 2003/02/27 18:54:30 martin Exp
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gawk 3.1.1m\n"
+"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
+"POT-Creation-Date: 2003-07-07 11:20-0700\n"
+"PO-Revision-Date: 2003-02-27 19:54+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:112
+#, 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"
+
+#: array.c:113
+#, c-format
+msgid "attempt to use scalar `%s' as array"
+msgstr "försök att använda skalären \"%s\" som vektor"
+
+#: array.c:151
+#, fuzzy, c-format
+msgid "from %s"
+msgstr "%s (från %s)"
+
+#: array.c:506
+#, c-format
+msgid "reference to uninitialized element `%s[\"%s\"]'"
+msgstr "referens till ickeinitierat element \"%s[\"%s\"]\""
+
+#: array.c:512
+#, c-format
+msgid "subscript of array `%s' is null string"
+msgstr "index i vektorn \"%s\" är en tom sträng"
+
+#: array.c:609
+#, c-format
+msgid "delete: index `%s' not in array `%s'"
+msgstr "delete: index \"%s\" finns inte i vektorn \"%s\""
+
+#: array.c:769
+#, c-format
+msgid "%s: empty (null)\n"
+msgstr "%s: tom (null)\n"
+
+#: array.c:774
+#, c-format
+msgid "%s: empty (zero)\n"
+msgstr "%s: tom (noll)\n"
+
+#: array.c:778
+#, c-format
+msgid "%s: table_size = %d, array_size = %d\n"
+msgstr "%s: tabellstorlek = %d, vektorstorlek = %d\n"
+
+#: array.c:807
+#, c-format
+msgid "%s: is parameter\n"
+msgstr "%s: är en parameter\n"
+
+#: array.c:812
+#, c-format
+msgid "%s: array_ref to %s\n"
+msgstr "%s: vektorreferens till %s\n"
+
+#: awkgram.y:208
+#, c-format
+msgid "%s blocks must have an action part"
+msgstr "%s-block måste ha en åtgärdsdel"
+
+#: awkgram.y:211
+msgid "each rule must have a pattern or an action part"
+msgstr "varje regel måste ha ett mönster eller en åtgärdsdel"
+
+#: awkgram.y:267
+#, 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:314
+#, 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:340 awkgram.y:615
+msgid "statement may have no effect"
+msgstr "kommandot kanske inte har någon effekt"
+
+#: awkgram.y:435 awkgram.y:455
+#, c-format
+msgid "`%s' used in %s action"
+msgstr "\"%s\" använd i %s-åtgärden"
+
+#: awkgram.y:448 awkgram.y:451
+msgid "`nextfile' is a gawk extension"
+msgstr "\"nextfile\" är en gawk-utökning"
+
+#: awkgram.y:465
+msgid "`return' used outside function context"
+msgstr "\"return\" använd utanför funktion"
+
+#: awkgram.y:504
+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:517 awkgram.y:524
+msgid "`delete array' is a gawk extension"
+msgstr "\"delete array\" är en gawk-utökning"
+
+#: awkgram.y:532 awkgram.y:539
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "\"delete(array)\" är en icke portabel tawk-utökning"
+
+#: awkgram.y:583
+#, c-format
+msgid "duplicate case values in switch body: %s"
+msgstr ""
+
+#: awkgram.y:593
+msgid "Duplicate `default' detected in switch body"
+msgstr ""
+
+#: awkgram.y:681
+msgid "multistage two-way pipelines don't work"
+msgstr "flerstegs dubbelriktade rör fungerar inte"
+
+#: awkgram.y:772
+msgid "regular expression on right of assignment"
+msgstr "reguljärt uttryck i högerledet av en tilldelning"
+
+#: awkgram.y:782
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "reguljärt uttryck på vänster sida om en \"~\"- eller \"!~\"-operator"
+
+#: awkgram.y:790
+msgid "regular expression on right of comparison"
+msgstr "reguljärt uttryck i högerledet av en jämförelse"
+
+#: awkgram.y:857
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "icke omdirigerad \"getline\" odefinierad inuti END-åtgärd"
+
+#: awkgram.y:884
+msgid "call of `length' without parentheses is not portable"
+msgstr "anrop av \"length\" utan parenteser är inte portabelt"
+
+#: awkgram.y:887
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "anrop av \"length\" utan parenteser är föråldrat enligt POSIX"
+
+#: awkgram.y:940
+msgid "use of non-array as array"
+msgstr ""
+
+#: awkgram.y:942
+msgid "invalid subscript expression"
+msgstr "ogiltig indexuttryck"
+
+#: awkgram.y:1140
+msgid "unexpected newline or end of string"
+msgstr "oväntat nyradstecken eller slut på strängen"
+
+#: awkgram.y:1235
+msgid "empty program text on command line"
+msgstr "tom programtext på kommandoraden"
+
+#: awkgram.y:1292
+#, 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:1327
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "kan inte läsa källfilen \"%s\" (%s)"
+
+#: awkgram.y:1335
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "källfilen \"%s\" är tom"
+
+#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100
+msgid "source file does not end in newline"
+msgstr "källfilen slutar inte med en ny rad"
+
+#: awkgram.y:1601
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr "oavslutat reguljärt uttryck slutar med \"\\\" i slutet av filen"
+
+#: awkgram.y:1621
+msgid "unterminated regexp"
+msgstr "oavslutat reguljärt uttryck"
+
+#: awkgram.y:1624
+msgid "unterminated regexp at end of file"
+msgstr "oavslutat reguljärt uttryck i slutet av filen"
+
+#: awkgram.y:1691
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr "Användning av \"\\ #...\" för radfortsättning är inte portabelt"
+
+#: awkgram.y:1703
+msgid "backslash not last character on line"
+msgstr "sista tecknet på raden är inte ett omvänt snedstreck"
+
+#: awkgram.y:1748
+msgid "POSIX does not allow operator `**='"
+msgstr "POSIX tillåter inte operatorn \"**=\""
+
+#: awkgram.y:1750
+msgid "old awk does not support operator `**='"
+msgstr "gamla awk stöder inte operatorn \"**=\""
+
+#: awkgram.y:1759
+msgid "POSIX does not allow operator `**'"
+msgstr "POSIX tillåter inte operatorn \"**\""
+
+#: awkgram.y:1761
+msgid "old awk does not support operator `**'"
+msgstr "gamla awk stöder inte operatorn \"**\""
+
+#: awkgram.y:1792
+msgid "operator `^=' is not supported in old awk"
+msgstr "operatorn \"^=\" stöds inte i gamla awk"
+
+#: awkgram.y:1800
+msgid "operator `^' is not supported in old awk"
+msgstr "operatorn \"^\" stöds inte i gamla awk"
+
+#: awkgram.y:1884 awkgram.y:1901
+msgid "unterminated string"
+msgstr "oavslutad sträng"
+
+#: awkgram.y:2061
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "ogiltigt tecken \"%c\" i uttryck"
+
+#: awkgram.y:2121
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "\"%s\" är en gawk-utökning"
+
+#: awkgram.y:2124
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "\"%s\" är en Bell Labs-utökning"
+
+#: awkgram.y:2127
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "POSIX tillåter inte \"%s\""
+
+#: awkgram.y:2131
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "\"%s\" stöds inte i gamla awk"
+
+#: awkgram.y:2158
+msgid "`goto' considered harmful!\n"
+msgstr "\"goto\" anses skadlig!\n"
+
+#: awkgram.y:2220
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
+msgstr "%d är ett ogiltigt antal argument för %s"
+
+#: awkgram.y:2239 awkgram.y:2242
+msgid "match: third argument is a gawk extension"
+msgstr "match: tredje argumentet är en gawk-utökning"
+
+#: awkgram.y:2255
+#, 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:2258
+#, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "%s: tredje argumentet är inte ett ändringsbart objekt"
+
+#: awkgram.y:2285 awkgram.y:2288
+msgid "close: second argument is a gawk extension"
+msgstr "close: andra argumentet är en gawk-utökning"
+
+#: awkgram.y:2298
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"användandet av dcgettext(_\"...\") är felaktigt: ta bort det inledande "
+"understrykningstecknet"
+
+#: awkgram.y:2313
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"användandet av dcngettext(_\"...\") är felaktigt: ta bort det inledande "
+"understrykningstecknet"
+
+#: awkgram.y:2384
+#, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "funktionen \"%s\": parameter %d, \"%s\", är samma som parameter %d"
+
+#: awkgram.y:2417
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "funktionen \"%s\": parametern \"%s\" överskuggar en global variabel"
+
+#: awkgram.y:2529
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "kunde inte öpnna \"%s\" för skrivning (%s)"
+
+#: awkgram.y:2530 profile.c:93
+msgid "sending profile to standard error"
+msgstr "skickar profilen till standard fel"
+
+#: awkgram.y:2562
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: misslyckades att stänga (%s)"
+
+#: awkgram.y:2684
+msgid "shadow_funcs() called twice!"
+msgstr "shadow_funcs() anropad två gånger!"
+
+#: awkgram.y:2711
+msgid "there were shadowed variables."
+msgstr "det fanns överskuggade variabler."
+
+#: awkgram.y:2784
+#, 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:2794
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "funktionsnamnet \"%s\" är definierat sedan tidigare"
+
+#: awkgram.y:2945 awkgram.y:2951
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "funktionen \"%s\" anropad men aldrig definierad"
+
+#: awkgram.y:2954
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "funktionen \"%s\" definierad men aldrig anropad"
+
+#: awkgram.y:2981
+#, 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"
+
+#: awkgram.y:2994
+#, c-format
+msgid ""
+"function `%s' called with space between name and `(',\n"
+"%s"
+msgstr ""
+"funktionen \"%s\" anropad med blanktecken mellan namnet och \"(\",\n"
+"%s"
+
+#: awkgram.y:2996
+msgid "or used as a variable or an array"
+msgstr "eller använd som variabel eller vektor"
+
+#: builtin.c:137
+#, c-format
+msgid "%s to \"%s\" failed (%s)"
+msgstr "%s till \"%s\" misslyckades (%s)"
+
+#: builtin.c:138
+msgid "standard output"
+msgstr "standard ut"
+
+#: builtin.c:139
+msgid "reason unknown"
+msgstr "okänd anledning"
+
+#: builtin.c:152
+msgid "exp: received non-numeric argument"
+msgstr "exp: fick ett ickenumeriskt argument"
+
+#: builtin.c:158
+#, c-format
+msgid "exp: argument %g is out of range"
+msgstr "exp: argumentet %g är inte inom tillåten gräns"
+
+#: builtin.c:216
+#, 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:219
+#, 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:231
+#, 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:325
+msgid "index: received non-string first argument"
+msgstr "index: första argumentet är inte en sträng"
+
+#: builtin.c:327
+msgid "index: received non-string second argument"
+msgstr "index: andra argumentet är inte en sträng"
+
+#: builtin.c:437
+msgid "int: received non-numeric argument"
+msgstr "int: fick ett ickenumeriskt argument"
+
+#: builtin.c:454
+msgid "length: received non-string argument"
+msgstr "length: fick ett argument som inte är en sträng"
+
+#: builtin.c:470
+msgid "log: received non-numeric argument"
+msgstr "log: fick ett ickenumeriskt argument"
+
+#: builtin.c:473
+#, c-format
+msgid "log: received negative argument %g"
+msgstr "log: fick ett negativt argumentet %g"
+
+#: builtin.c:635 builtin.c:638
+msgid "must use `count$' on all formats or none"
+msgstr "måste använda \"count$\" på alla eller inga format"
+
+#: builtin.c:740
+msgid "`$' is not permitted in awk formats"
+msgstr "\"$\" tillåts inte i awkformat"
+
+#: builtin.c:746
+msgid "arg count with `$' must be > 0"
+msgstr "argumentantalet med \"$\" måste vara > 0"
+
+#: builtin.c:748
+#, c-format
+msgid "arg count %ld greater than total number of supplied arguments"
+msgstr "argumentantalet %ld är större än antalet givna argument"
+
+#: builtin.c:750
+msgid "`$' not permitted after period in format"
+msgstr "\"$\" tillåts inte efter en punkt i formatet"
+
+#: builtin.c:763
+msgid "no `$' supplied for positional field width or precision"
+msgstr "inget \"$\" bifogat för positionsangiven fältbredd eller precision"
+
+#: builtin.c:821
+msgid "`l' is meaningless in awk formats; ignored"
+msgstr "\"l\" är meningslös i awk-format, ignorerad"
+
+#: builtin.c:825
+msgid "`l' is not permitted in POSIX awk formats"
+msgstr "\"l\" tillåts inte i POSIX awk-format"
+
+#: builtin.c:836
+msgid "`L' is meaningless in awk formats; ignored"
+msgstr "\"L\" är meningslös i awk-format, ignorerad"
+
+#: builtin.c:840
+msgid "`L' is not permitted in POSIX awk formats"
+msgstr "\"L\" tillåts inte i POSIX awk-format"
+
+#: builtin.c:851
+msgid "`h' is meaningless in awk formats; ignored"
+msgstr "\"h\" är meningslös i awk-format, ignorerad"
+
+#: builtin.c:855
+msgid "`h' is not permitted in POSIX awk formats"
+msgstr "\"h\" tillåts inte i POSIX awk-format"
+
+#: builtin.c:1055
+#, c-format
+msgid "[s]printf: value %g is out of range for `%%%c' format"
+msgstr ""
+
+#: builtin.c:1108
+msgid "not enough arguments to satisfy format string"
+msgstr "för få argument för formatsträngen"
+
+#: builtin.c:1110
+msgid "^ ran out for this one"
+msgstr "^ tog slut här"
+
+#: builtin.c:1115
+msgid "[s]printf: format specifier does not have control letter"
+msgstr "[s]printf: formatspecifieraren har ingen kommandobokstav"
+
+#: builtin.c:1118
+msgid "too many arguments supplied for format string"
+msgstr "för många argument för formatsträngen"
+
+#: builtin.c:1184 builtin.c:1187
+msgid "printf: no arguments"
+msgstr "printf: inga argument"
+
+#: builtin.c:1211
+msgid "sqrt: received non-numeric argument"
+msgstr "sqrt: fick ickenumeriskt argument"
+
+#: builtin.c:1215
+#, c-format
+msgid "sqrt: called with negative argument %g"
+msgstr "sqrt: anropad med negativt argument %g"
+
+#: builtin.c:1238
+#, c-format
+msgid "substr: start index %g is invalid, using 1"
+msgstr "substr: startindex %g är ogiltigt, använder 1"
+
+#: builtin.c:1243
+#, 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:1262
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 1"
+msgstr "substr: längden %g är <= 0"
+
+#: builtin.c:1264
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 0"
+msgstr "substr: längden %g är <= 0"
+
+#: builtin.c:1271
+#, 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:1276
+#, c-format
+msgid "substr: length %g too big for string indexing, truncating to %g"
+msgstr "substr: längden %g är för stor för strängindexering, trunkeras till %g"
+
+#: builtin.c:1288
+msgid "substr: source string is zero length"
+msgstr "substr: källsträngen är tom"
+
+#: builtin.c:1294
+#, c-format
+msgid "substr: start index %g is past end of string"
+msgstr "substr: startindex %g är bortom strängens slut"
+
+#: builtin.c:1302
+#, c-format
+msgid ""
+"substr: length %g at start index %g exceeds length of first argument (%lu)"
+msgstr ""
+"substr: längden %g vid startindex %g överskrider det första argumentets "
+"längd (%lu)"
+
+#: builtin.c:1337
+msgid "strftime: received non-string first argument"
+msgstr "strftime: fick ett första argument som inte är en sträng"
+
+#: builtin.c:1343
+msgid "strftime: received empty format string"
+msgstr "strftime: fick en tom formatsträng"
+
+#: builtin.c:1352
+msgid "strftime: received non-numeric second argument"
+msgstr "strftime: fick ett ickenumeriskt andra argument"
+
+#: builtin.c:1415
+msgid "mktime: received non-string argument"
+msgstr "mktime: fick ett argument som inte är en sträng"
+
+#: builtin.c:1460
+msgid "system: received non-string argument"
+msgstr "system: fick ett argument som inte är en sträng"
+
+#: builtin.c:1581 eval.c:1883
+#, fuzzy, c-format
+msgid "reference to uninitialized field `$%d'"
+msgstr "referens till icke initierad variabel \"%s\""
+
+#: builtin.c:1608
+msgid "tolower: received non-string argument"
+msgstr "tolower: fick ett argument som inte är en sträng"
+
+#: builtin.c:1657
+msgid "toupper: received non-string argument"
+msgstr "toupper: fick ett argument som inte är en sträng"
+
+#: builtin.c:1702
+msgid "atan2: received non-numeric first argument"
+msgstr "atan2: fick ett ickenumeriskt första argument"
+
+#: builtin.c:1704
+msgid "atan2: received non-numeric second argument"
+msgstr "atan2: fick ett ickenumeriskt andra argument"
+
+#: builtin.c:1723
+msgid "sin: received non-numeric argument"
+msgstr "sin: fick ett ickenumeriskt argument"
+
+#: builtin.c:1739
+msgid "cos: received non-numeric argument"
+msgstr "cos: fick ett ickenumeriskt argument"
+
+#: builtin.c:1788
+msgid "srand: received non-numeric argument"
+msgstr "srand: fick ett ickenumeriskt argument"
+
+#: builtin.c:1823
+msgid "match: third argument is not an array"
+msgstr "match: tredje argumentet är inte en vektor"
+
+#: builtin.c:2307
+msgid "gensub: third argument of 0 treated as 1"
+msgstr "gensub: Nollan i tredje argumentet behandlad som en etta"
+
+#: builtin.c:2416 builtin.c:2418
+msgid "lshift: received non-numeric first argument"
+msgstr "lshift: fick ett ickenumeriskt första argument"
+
+#: builtin.c:2420
+#, 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:2422
+#, c-format
+msgid "lshift(%lf, %lf): fractional values will be truncated"
+msgstr "lshift(%lf, %lf): flyttalsvärden kommer trunkeras"
+
+#: builtin.c:2424
+#, 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:2453 builtin.c:2455
+msgid "rshift: received non-numeric first argument"
+msgstr "rshift: fick ett ickenumeriskt första argument"
+
+#: builtin.c:2457
+#, 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:2459
+#, c-format
+msgid "rshift(%lf, %lf): fractional values will be truncated"
+msgstr "rshift(%lf, %lf): flyttalsvärden kommer trunkeras"
+
+#: builtin.c:2461
+#, 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:2490 builtin.c:2492
+msgid "and: received non-numeric first argument"
+msgstr "and: fick ett ickenumeriskt första argument"
+
+#: builtin.c:2494
+#, 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:2496
+#, c-format
+msgid "and(%lf, %lf): fractional values will be truncated"
+msgstr "and(%lf, %lf): flyttalsvärden kommer trunkeras"
+
+#: builtin.c:2525 builtin.c:2527
+msgid "or: received non-numeric first argument"
+msgstr "or: fick ett ickenumeriskt första argument"
+
+#: builtin.c:2529
+#, 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:2531
+#, c-format
+msgid "or(%lf, %lf): fractional values will be truncated"
+msgstr "or(%lf, %lf): flyttalsvärden kommer trunkeras"
+
+#: builtin.c:2560 builtin.c:2562
+msgid "xor: received non-numeric first argument"
+msgstr "xor: fick ett ickenumeriskt första argument"
+
+#: builtin.c:2564
+#, 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:2566
+#, c-format
+msgid "xor(%lf, %lf): fractional values will be truncated"
+msgstr "xor(%lf, %lf): flyttalsvärden kommer trunkeras"
+
+#: builtin.c:2594
+msgid "compl: received non-numeric argument"
+msgstr "compl: fick ett ickenumeriskt argument"
+
+#: builtin.c:2596
+#, c-format
+msgid "compl(%lf): negative value will give strange results"
+msgstr "compl(%lf): negativa värden kommer ge konstiga resultat"
+
+#: builtin.c:2598
+#, c-format
+msgid "compl(%lf): fractional value will be truncated"
+msgstr "compl(%lf): flyttalsvärden kommer trunkeras"
+
+#: builtin.c:2771
+#, c-format
+msgid "dcgettext: `%s' is not a valid locale category"
+msgstr "dcgettext: \"%s\" är inte en giltig lokalkategori"
+
+#: eval.c:266
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "okänd nodtyp %d"
+
+#: eval.c:312
+msgid "buffer overflow in genflags2str"
+msgstr "buffertöverflöd i genflags2str"
+
+#: eval.c:647
+#, c-format
+msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
+msgstr ""
+"forslinga: vektorn \"%s\" ändrade storlek från %ld till %ld under "
+"slingexekvering"
+
+#: eval.c:668
+msgid "`break' outside a loop is not portable"
+msgstr "\"break\" utanför en slinga är inte portabelt"
+
+#: eval.c:672
+msgid "`break' outside a loop is not allowed"
+msgstr "\"break\" utanför en slinga är inte tillåtet"
+
+#: eval.c:689
+msgid "`continue' outside a loop is not portable"
+msgstr "\"continue\" utanför en slinga är inte portabelt"
+
+#: eval.c:693
+msgid "`continue' outside a loop is not allowed"
+msgstr "\"continue\" utanför en slinga är inte tillåtet"
+
+#: eval.c:727
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "\"next\" kan inte anropas från en BEGIN-regel"
+
+#: eval.c:729
+msgid "`next' cannot be called from an END rule"
+msgstr "\"next\" kan inte anropas från en END-regel"
+
+#: eval.c:738
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "\"nextfile\" kan inte anropas från en BEGIN-regel"
+
+#: eval.c:740
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "\"nextfile\" kan inte anropas från en END-regel"
+
+#: eval.c:785
+msgid "statement has no effect"
+msgstr "kommandot har ingen effekt"
+
+#: eval.c:828 eval.c:1726
+#, 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:835 eval.c:841
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "referens till icke initierat argument \"%s\""
+
+#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807
+#, c-format
+msgid "attempt to use array `%s' in a scalar context"
+msgstr "försök att använda vektorn \"%s\" i skalärsammanhang"
+
+#: eval.c:858 eval.c:1752
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "referens till icke initierad variabel \"%s\""
+
+#: eval.c:1007
+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:1032
+msgid "assignment used in conditional context"
+msgstr "tilldelning använt i jämförelsesammanhang"
+
+#: eval.c:1122
+msgid "division by zero attempted"
+msgstr "försökte dividera med noll"
+
+#: eval.c:1137
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "försökte dividera med noll i \"%%\""
+
+#: eval.c:1152 profile.c:683
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "otillåten typ (%s) i tree_eval"
+
+#: eval.c:1328
+msgid "division by zero attempted in `/='"
+msgstr "försökte dividera med noll i \"/=\""
+
+#: eval.c:1346
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "försökte dividera med noll i \"%%=\""
+
+#: eval.c:1586
+#, c-format
+msgid "function `%s' called with more arguments than declared"
+msgstr "funktionen \"%s\" anropad med fler argument än vad som deklarerats"
+
+#: eval.c:1633
+#, c-format
+msgid "function `%s' not defined"
+msgstr "funktionen \"%s\" är inte definierad"
+
+#: eval.c:1639
+#, c-format
+msgid "function %s called\n"
+msgstr "funktionen %s anropad\n"
+
+#: eval.c:1698
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# Funktionsanropsstack:\n"
+"\n"
+
+#: eval.c:1701
+msgid "\t# -- main --\n"
+msgstr "\t# -- main --\n"
+
+#: eval.c:1867
+msgid "attempt to field reference from non-numeric value"
+msgstr "försök att fältreferera från ickenumeriskt värde"
+
+#: eval.c:1869
+msgid "attempt to reference from null string"
+msgstr "försök att referera från tom sträng"
+
+#: eval.c:1875
+#, c-format
+msgid "attempt to access field %d"
+msgstr "försök att komma åt fält nummer %d"
+
+#: eval.c:1896 eval.c:1903 profile.c:900
+msgid "assignment is not allowed to result of builtin function"
+msgstr "det är inte tillåtet att tilldela resultatet från en inbyggd funktion"
+
+#: eval.c:1951
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "\"IGNORECASE\" är en gawk-utökning"
+
+#: eval.c:1980
+msgid "`BINMODE' is a gawk extension"
+msgstr "\"BINMODE\" är en gawk-utökning"
+
+#: eval.c:2092
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "felaktig \"%sFMT\"-specifikation \"%s\""
+
+#: eval.c:2170
+msgid "turning off `--lint' due to assignment to `LINT'"
+msgstr "slår av \"--lint\" på grund av en tilldelning till \"LINT\""
+
+#: 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:183
+msgid "Operation Not Supported"
+msgstr "Operationen stöds inte"
+
+#: field.c:315
+msgid "NF set to negative value"
+msgstr "NF satt till ett negativt värde"
+
+#: field.c:808
+msgid "split: second argument is not an array"
+msgstr "split: andra argumentet är inte en vektor"
+
+#: field.c:842
+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:894
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "\"FIELDWIDTHS\" är en gawk-utökning"
+
+#: field.c:921
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "fält %d i FIELDWIDTHS måste vara > 0"
+
+#: field.c:994
+msgid "null string for `FS' is a gawk extension"
+msgstr "tom sträng som \"FS\" är en gawk-utökning"
+
+#: 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:434
+#, 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"
+
+#: io.c:305
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "kan inte öppna filen \"%s\" för läsning (%s)"
+
+#: io.c:392
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "stängning av fd %d (\"%s\") misslyckades (%s)"
+
+#: io.c:530
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "ogiltig trädtyp %s i redirect()"
+
+#: io.c:536
+#, c-format
+msgid "expression in `%s' redirection only has numeric value"
+msgstr "uttrycket i \"%s\"-omdirigering har bara numeriskt värde"
+
+#: io.c:542
+#, 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:547
+#, 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:569
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "onödig blandning av \">\" och \">>\" för filen \"%.*s\""
+
+#: io.c:621
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "kan inte öppna röret \"%s\" för utmatning (%s)"
+
+#: io.c:630
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "kan inte öppna röret \"%s\" för inmatning (%s)"
+
+#: io.c:643
+#, 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:647
+#, 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:723
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "kan inte dirigera om från \"%s\" (%s)"
+
+#: io.c:726
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "kan inte dirigera om till \"%s\" (%s)"
+
+#: io.c:765
+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:777
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "stängning av \"%s\" misslyckades (%s)"
+
+#: io.c:784
+msgid "too many pipes or input files open"
+msgstr "för många rör eller indatafiler öppna"
+
+#: io.c:807
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: andra argumentet måste vara \"to\" eller \"from\""
+
+#: io.c:821
+#, 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:825
+msgid "close of redirection that was never opened"
+msgstr "stängning av omdirigering som aldrig öppnades"
+
+#: io.c:862
+#, c-format
+msgid "close: redirection `%s' not opened with `|&', second argument ignored"
+msgstr ""
+"close: omdirigeringen \"%s\" öppnades inte med \"|&\", andra argumentet "
+"ignorerat"
+
+#: io.c:924
+#, 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:927
+#, c-format
+msgid "failure status (%d) on file close of `%s' (%s)"
+msgstr "felstatus (%d) från filstängning av \"%s\" (%s)"
+
+#: io.c:946
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "ingen explicit stängning av uttaget \"%s\" tillhandahållen"
+
+#: io.c:949
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "ingen explicit stängning av koprocessen \"%s\" tillhandahållen"
+
+#: io.c:952
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "ingen explicit stängning av röret \"%s\" tillhandahållen"
+
+#: io.c:955
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "ingen explicit stängning av filen \"%s\" tillhandahållen"
+
+#: io.c:984 io.c:1038
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "fel vid skrivning till standard ut (%s)"
+
+#: io.c:988 io.c:1042
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "fel vid skrivning till standard fel (%s)"
+
+#: io.c:996
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "rörspolning av \"%s\" misslyckades (%s)"
+
+#: io.c:999
+#, c-format
+msgid "co-process flush of pipe to `%s' failed (%s)."
+msgstr "koprocesspolning av röret till \"%s\" misslyckades (%s)"
+
+#: io.c:1002
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "filspolning av \"%s\" misslyckades (%s)"
+
+#: io.c:1161
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "/inet/raw-klient är tyvärr inte klar än"
+
+#: io.c:1163 io.c:1200
+msgid "only root may use `/inet/raw'."
+msgstr "bara root kan använda \"/inet/raw\"."
+
+#: io.c:1198
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "/inet/raw-server inte redo än, ledsen"
+
+#: io.c:1288
+#, 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:1306
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "speciellt filnamn \"%s\" är ofullständigt"
+
+#: io.c:1318
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "lokal port ogiltig i \"%s\""
+
+#: io.c:1330
+msgid "must supply a remote hostname to `/inet'"
+msgstr "måste tillhandahålla ett fjärrdatornamn till \"/inet\""
+
+#: io.c:1345
+msgid "must supply a remote port to `/inet'"
+msgstr "måste tillhandahålla en fjärrport till \"/inet\""
+
+#: io.c:1351
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "fjärrporten ogiltig i \"%s\""
+
+#: io.c:1361
+msgid "TCP/IP communications are not supported"
+msgstr "TCP/IP-kommunikation stöds inte"
+
+#: io.c:1370 io.c:1551
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "filen \"%s\" är en katalog"
+
+#: io.c:1440
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "använd \"PROCINFO[\"%s\"]\" istället för \"%s\""
+
+#: io.c:1472
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "använd \"PROCINFO[...]\" istället för \"dev/user\""
+
+#: io.c:1537 io.c:1711
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "kunde inte öppna \"%s\", läge \"%s\""
+
+#: io.c:1762
+#, c-format
+msgid "close of master pty failed (%s)"
+msgstr "stängning av huvudpty misslyckades (%s)"
+
+#: io.c:1764 io.c:1916 io.c:2068
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "stängning av standard ut i barnet misslyckades (%s)"
+
+#: io.c:1767
+#, c-format
+msgid "moving slave pty to stdout in child failed (dup: %s)"
+msgstr "flyttandet av slavpty till standard ut i barnet misslyckades (dup: %s)"
+
+#: io.c:1769 io.c:1921
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "stängning av standard in i barnet misslyckades (%s)"
+
+#: io.c:1772
+#, c-format
+msgid "moving slave pty to stdin in child failed (dup: %s)"
+msgstr "flyttandet av slavpty till standard in i barnet misslyckades (dup: %s)"
+
+#: io.c:1774 io.c:1793
+#, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "stängning av slavpty misslyckades (%s)"
+
+#: io.c:1867 io.c:1919 io.c:2049 io.c:2071
+#, 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:1871 io.c:1924
+#, 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:1888 io.c:2062
+msgid "restoring stdout in parent process failed\n"
+msgstr "återställande av standard ut i förälderprocessen misslyckades\n"
+
+#: io.c:1893
+msgid "restoring stdin in parent process failed\n"
+msgstr "återställande av standard in i förälderprocessen misslyckades\n"
+
+#: io.c:1927 io.c:2073 io.c:2084
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "stängning av röret misslyckades (%s)"
+
+#: io.c:1972
+msgid "`|&' not supported"
+msgstr "\"|&\" stöds inte"
+
+#: io.c:2039
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "kan inte öppna röret \"%s\" (%s)"
+
+#: io.c:2080
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr "kan inte skapa barnprocess för \"%s\" (fork: %s)"
+
+#: io.c:2423
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "datafilen \"%s\" är tom"
+
+#: io.c:2466 io.c:2474
+msgid "could not allocate more input memory"
+msgstr "kunde inte allokera mer indataminne"
+
+#: io.c:2832 io.c:2895
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "fel vid läsning av indatafilen \"%s\": %s"
+
+#: io.c:3020
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "flerteckensvärdet av \"RS\" är en gawk-utökning"
+
+#: main.c:324
+msgid "`-m[fr]' option irrelevant in gawk"
+msgstr "\"-m[fr]\"-flaggan är irrelevant i gawk"
+
+#: main.c:326
+msgid "-m option usage: `-m[fr] nnn'"
+msgstr "-m-flaggans användning: \"-m[fr] nnn\""
+
+#: main.c:343
+#, c-format
+msgid "%s: option `-W %s' unrecognized, ignored\n"
+msgstr "%s: flaggan \"-W %s\" okänd, ignorerad\n"
+
+#: main.c:380
+msgid "empty argument to `--source' ignored"
+msgstr "tomt argument till \"--source\" ignorerat"
+
+#: main.c:451
+msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
+msgstr "miljövariabeln \"POSIXLY_CORRECT\" satt: slår på \"--posix\""
+
+#: main.c:456
+msgid "`--posix' overrides `--traditional'"
+msgstr "\"--posix\" åsidosätter \"--traditional\""
+
+#: main.c:467
+msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
+msgstr "\"--posix\"/\"--traditional\" åsidosätter \"--non-decimal-data\""
+
+#: main.c:471
+#, c-format
+msgid "running %s setuid root may be a security problem"
+msgstr "att köra %s setuid root kan vara ett säkerhetsproblem"
+
+#: main.c:512
+#, c-format
+msgid "can't set binary mode on stdin (%s)"
+msgstr "kan inte sätta binärläge på standard in (%s)"
+
+#: main.c:515
+#, c-format
+msgid "can't set binary mode on stdout (%s)"
+msgstr "kan inte sätta binärläge på standard ut (%s)"
+
+#: main.c:517
+#, c-format
+msgid "can't set binary mode on stderr (%s)"
+msgstr "kan inte sätta binärläge på standard fel (%s)"
+
+#: main.c:547
+msgid "no program text at all!"
+msgstr "ingen programtext alls!"
+
+#: main.c:620
+#, 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:622
+#, 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:627
+msgid "POSIX options:\t\tGNU long options:\n"
+msgstr "POSIX-flaggor:\t\tGNU långa flaggor:\n"
+
+#: main.c:628
+msgid "\t-f progfile\t\t--file=progfile\n"
+msgstr "\t-f progfil\t\t--file=progfil\n"
+
+#: main.c:629
+msgid "\t-F fs\t\t\t--field-separator=fs\n"
+msgstr "\t-F fs\t\t\t--field-separator=fs\n"
+
+#: main.c:630
+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:631
+msgid "\t-m[fr] val\n"
+msgstr "\t-m[fr] värde\n"
+
+#: main.c:632
+msgid "\t-W compat\t\t--compat\n"
+msgstr "\t-W compat\t\t--compat\n"
+
+#: main.c:633
+msgid "\t-W copyleft\t\t--copyleft\n"
+msgstr "\t-W copyleft\t\t--copyleft\n"
+
+#: main.c:634
+msgid "\t-W copyright\t\t--copyright\n"
+msgstr "\t-W copyright\t\t--copyright\n"
+
+#: main.c:635
+msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
+msgstr "\t-W dump-variables[=fil]\t--dump-variables[=fil]\n"
+
+#: main.c:636
+msgid "\t-W gen-po\t\t--gen-po\n"
+msgstr "\t-W gen-po\t\t--gen-po\n"
+
+#: main.c:637
+msgid "\t-W help\t\t\t--help\n"
+msgstr "\t-W help\t\t\t--help\n"
+
+#: main.c:638
+msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+
+#: main.c:639
+msgid "\t-W lint-old\t\t--lint-old\n"
+msgstr "\t-W lint-old\t\t--lint-old\n"
+
+#: main.c:640
+msgid "\t-W non-decimal-data\t--non-decimal-data\n"
+msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
+
+#: main.c:642
+msgid "\t-W nostalgia\t\t--nostalgia\n"
+msgstr "\t-W nostalgia\t\t--nostalgia\n"
+
+#: main.c:645
+msgid "\t-W parsedebug\t\t--parsedebug\n"
+msgstr "\t-W parsedebug\t\t--parsedebug\n"
+
+#: main.c:647
+msgid "\t-W profile[=file]\t--profile[=file]\n"
+msgstr "\t-W profile[=fil]\t--profile[=fil]\n"
+
+#: main.c:648
+msgid "\t-W posix\t\t--posix\n"
+msgstr "\t-W posix\t\t--posix\n"
+
+#: main.c:649
+msgid "\t-W re-interval\t\t--re-interval\n"
+msgstr "\t-W re-interval\t\t--re-interval\n"
+
+#: main.c:650
+msgid "\t-W source=program-text\t--source=program-text\n"
+msgstr "\t-W source=programtext\t--source=programtext\n"
+
+#: main.c:651
+msgid "\t-W traditional\t\t--traditional\n"
+msgstr "\t-W traditional\t\t--traditional\n"
+
+#: main.c:652
+msgid "\t-W usage\t\t--usage\n"
+msgstr "\t-W usage\t\t--usage\n"
+
+#: main.c:653
+msgid "\t-W version\t\t--version\n"
+msgstr "\t-W version\t\t--version\n"
+
+#: main.c:657
+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"
+"För att rapportera buggar, se noden \"Bugs\" i \"gawk.info\",\n"
+"vilket är sektionen \"Reporting Problems and Bugs\" i den utskrivna\n"
+"versionen.\n"
+"Rapportera synpunkter på översättningen till <sv@li.org>.\n"
+"\n"
+
+#: main.c:661
+msgid ""
+"gawk is a pattern scanning and processing language.\n"
+"By default it reads standard input and writes standard output.\n"
+"\n"
+msgstr ""
+"gawk är ett mönsterskannande och -bearbetande språk.\n"
+"Normalt läser det från standard in och skriver till standard ut.\n"
+"\n"
+
+#: main.c:665
+msgid ""
+"Examples:\n"
+"\tgawk '{ sum += $1 }; END { print sum }' file\n"
+"\tgawk -F: '{ print $1 }' /etc/passwd\n"
+msgstr ""
+"Exempel:\n"
+"\tgawk '{ sum += $1 }; END { print sum }' fil\n"
+"\tgawk -F: '{print $1 }' /etc/passwd\n"
+
+#: main.c:682
+#, 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:690
+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:696
+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:730
+msgid "-Ft does not set FS to tab in POSIX awk"
+msgstr "-Ft sätter inte FS till tab i POSIX-awk"
+
+#: main.c:956
+#, c-format
+msgid ""
+"%s: `%s' argument to `-v' not in `var=value' form\n"
+"\n"
+msgstr "%s: Argumentet \"%s\" till \"-v\" är inte på formatet \"var=värde\"\n"
+
+#: main.c:976
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr "\"%s\" är inte ett giltigt variabelnamn"
+
+#: main.c:979
+#, c-format
+msgid "`%s' is not a variable name, looking for file `%s=%s'"
+msgstr "\"%s\" är inte ett variabelnamn, letar efter filen \"%s=%s\""
+
+#: main.c:1012
+msgid "floating point exception"
+msgstr "flyttalsundantag"
+
+#: main.c:1019
+msgid "fatal error: internal error"
+msgstr "ödesdigert fel: internt fel"
+
+#: main.c:1069
+#, c-format
+msgid "no pre-opened fd %d"
+msgstr "ingen föröppnad fd %d"
+
+#: main.c:1074
+#, 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:1097 main.c:1106
+#, c-format
+msgid "could not find groups: %s"
+msgstr "kunde inte hitta grupper: %s"
+
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "kommandorad:"
+
+#: msg.c:120
+msgid "warning: "
+msgstr "varning: "
+
+#: msg.c:142
+msgid "error: "
+msgstr "fel: "
+
+#: msg.c:178
+msgid "fatal: "
+msgstr "ödesdigert: "
+
+#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115
+msgid "can't convert string to float"
+msgstr "kan inte konvertera en sträng till flyttal"
+
+#: node.c:355
+msgid "backslash at end of string"
+msgstr "omvänt snedstreck i slutet av strängen"
+
+#: node.c:539
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX tillåter inte \"\\x\"-kontrollsekvenser"
+
+#: node.c:545
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "inga hexadecimala siffror i \"\\x\"-kontrollsekvenser"
+
+#: node.c:579
+#, c-format
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr "kontrollsekvensen \"\\%c\" behandlad som bara \"%c\""
+
+#: posix/gawkmisc.c:172
+#, 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)"
+
+#: profile.c:91
+#, c-format
+msgid "could not open `%s' for writing: %s"
+msgstr "kunde inte öppna \"%s\" för skrivning: %s"
+
+#: profile.c:449
+#, fuzzy, c-format
+msgid "internal error: %s with null vname"
+msgstr "internt fel: Node_var med null vname"
+
+#: profile.c:512
+msgid "# treated internally as `delete'"
+msgstr "# behandlad internt som \"delete\""
+
+#: profile.c:1162
+#, c-format
+msgid "\t# gawk profile, created %s\n"
+msgstr "\t# gawkprofil, skapad %s\n"
+
+#: profile.c:1165
+msgid ""
+"\t# BEGIN block(s)\n"
+"\n"
+msgstr ""
+"\t# BEGIN-block\n"
+"\n"
+
+#: profile.c:1175
+msgid ""
+"\t# Rule(s)\n"
+"\n"
+msgstr ""
+"\t# Regel/regler\n"
+"\n"
+
+#: profile.c:1181
+msgid ""
+"\t# END block(s)\n"
+"\n"
+msgstr ""
+"\t# END-block\n"
+"\n"
+
+#: profile.c:1201
+msgid ""
+"\n"
+"\t# Functions, listed alphabetically\n"
+msgstr ""
+"\n"
+"\t# Funktioner, listade alfabetiskt\n"
+
+#: profile.c:1413
+#, c-format
+msgid "unexpected type %s in prec_level"
+msgstr "oväntad typ %s i prec_level"
+
+#: re.c:193
+#, c-format
+msgid "regex match failed, not enough memory to match string \"%.*s%s\""
+msgstr ""
+"regexmatchning misslyckades, inte tillräckligt mycket minne för att matcha "
+"\"%.*s%s\""
+
+#: regcomp.c:136
+msgid "Success"
+msgstr "Lyckades"
+
+#: regcomp.c:139
+msgid "No match"
+msgstr "Misslyckades"
+
+#: regcomp.c:142
+msgid "Invalid regular expression"
+msgstr "Ogiltigt reguljärt uttryck"
+
+#: regcomp.c:145
+msgid "Invalid collation character"
+msgstr "Ogiltigt kollationeringstecken"
+
+#: regcomp.c:148
+msgid "Invalid character class name"
+msgstr "Ogiltigt teckenklassnamn"
+
+#: regcomp.c:151
+msgid "Trailing backslash"
+msgstr "Eftersläpande omvänt snedstreck"
+
+#: regcomp.c:154
+msgid "Invalid back reference"
+msgstr "Ogiltig bakåtrerefens"
+
+#: regcomp.c:157
+msgid "Unmatched [ or [^"
+msgstr "Obalanserad [ eller [^"
+
+#: regcomp.c:160
+msgid "Unmatched ( or \\("
+msgstr "Obalanserad ( eller \\("
+
+#: regcomp.c:163
+msgid "Unmatched \\{"
+msgstr "Obalanserad \\{"
+
+#: regcomp.c:166
+msgid "Invalid content of \\{\\}"
+msgstr "Ogiltigt innehåll i \\{\\}"
+
+#: regcomp.c:169
+msgid "Invalid range end"
+msgstr "Ogiltigt omfångsslut"
+
+#: regcomp.c:172
+msgid "Memory exhausted"
+msgstr "Minnet slut"
+
+#: regcomp.c:175
+msgid "Invalid preceding regular expression"
+msgstr "Ogiltigt föregående reguljärt uttryck"
+
+#: regcomp.c:178
+msgid "Premature end of regular expression"
+msgstr "För tidigt slut på reguljärt uttryck"
+
+#: regcomp.c:181
+msgid "Regular expression too big"
+msgstr "Reguljärt uttryck för stort"
+
+#: regcomp.c:184
+msgid "Unmatched ) or \\)"
+msgstr "Obalanserad ) eller \\)"
+
+#: regcomp.c:621
+msgid "No previous regular expression"
+msgstr "Inget föregående reguljärt uttryck"
+
+#~ msgid "substr: length %g is < 0"
+#~ msgstr "substr: längden %g är < 0"
+
+#~ msgid "delete: illegal use of variable `%s' as array"
+#~ msgstr "delete: otillåten användning av variabeln \"%s\" som vektor"
+
+#, fuzzy
+#~ msgid "%s: gvar_ref to %s\n"
+#~ msgstr "%s: vektorreferens till %s\n"
+
+#~ msgid "asort: first argument is not an array"
+#~ msgstr "asort: första argumentet är inte en vektor"
+
+#~ msgid "asort: second argument is not an array"
+#~ msgstr "asort: andra argumentet är inte en vektor"
+
+#, fuzzy
+#~ msgid ""
+#~ "attempt to use array parameter `%s' that was passed from global scalar `%"
+#~ "s'"
+#~ msgstr "försök att använda skalärparametern \"%s\" som en vektor"
+
+#~ msgid "internal error: Node_var_array with null vname"
+#~ msgstr "internt fel: Node_var_vektor med null vname"
+
+#~ 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"
+
+#~ msgid "invalid syntax in name `%s' for variable assignment"
+#~ msgstr "ogiltig syntax i namnet \"%s\" för variabeltilldelning"
+
+#~ msgid "or used in other expression context"
+#~ msgstr "eller använt i andra uttryckssammanhang"
+
+#~ msgid "attempt to use function `%s' as array"
+#~ msgstr "försök att använda funktionen \"%s\" som vektor"
+
+#~ msgid "`%s' is a function, assignment is not allowed"
+#~ msgstr "\"%s\" är en funktion, tilldelning är inte tillåtet"
+
+#~ msgid "BEGIN blocks must have an action part"
+#~ msgstr "BEGIN-block måste ha en åtgärdsdel"
+
+#~ msgid "`nextfile' used in BEGIN or END action"
+#~ msgstr "\"nextfile\" använd i BEGIN- eller END-åtgärd"
+
+#~ msgid "non-redirected `getline' undefined inside BEGIN or END action"
+#~ msgstr ""
+#~ "icke omdirigerad \"getline\" odefinierade inuti BEGIN- eller END-åtgärd"
+
+#~ msgid "fptr %x not in tokentab\n"
+#~ msgstr "fptr %x är inte i tokentab\n"
+
+#~ msgid "gsub third parameter is not a changeable object"
+#~ msgstr "gsub: tredje argumentet är inte ett ändringsbart objekt"
+
+#~ msgid "Unfinished \\ escape"
+#~ msgstr "Oavslutad \\-kontrollsekvens"
+
+#~ msgid "unfinished repeat count"
+#~ msgstr "oavslutat upprepningsantal"
+
+#~ msgid "malformed repeat count"
+#~ msgstr "felaktigt utformat upprepningsantal"
+
+#~ msgid "Unbalanced ["
+#~ msgstr "Obalanserad ["
+
+#~ msgid "Unbalanced ("
+#~ msgstr "Obalanserad ("
+
+#~ msgid "No regexp syntax bits specified"
+#~ msgstr "Inga syntaxbitar för reguljära uttryck angivna"
+
+#~ msgid "Unbalanced )"
+#~ msgstr "Obalanserad )"
+
+#~ msgid "out of memory"
+#~ msgstr "slut på minne"
+
+#~ msgid "internal error: file `%s', line %d\n"
+#~ msgstr "internt fel: filen \"%s\", rad %d\n"
diff --git a/gnu/dist/gawk/po/tr.gmo b/gnu/dist/gawk/po/tr.gmo
new file mode 100644
index 00000000000..55b508b82f6
--- /dev/null
+++ b/gnu/dist/gawk/po/tr.gmo
Binary files differ
diff --git a/gnu/dist/gawk/po/tr.po b/gnu/dist/gawk/po/tr.po
new file mode 100644
index 00000000000..fd730ec2f99
--- /dev/null
+++ b/gnu/dist/gawk/po/tr.po
@@ -0,0 +1,1836 @@
+# Turkish translations for GNU awk messages
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# Nilgün Belma Bugüner <nilgun@superonline.com>, 2001, 2002, 2003.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gawk 3.1.2g\n"
+"Report-Msgid-Bugs-To: arnold@skeeve.com\n"
+"POT-Creation-Date: 2003-07-07 11:20-0700\n"
+"PO-Revision-Date: 2003-06-25 07:43+0300\n"
+"Last-Translator: Nilgün Belma Bugüner <nilgun@superonline.com>\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 1.0\n"
+
+#: array.c:112
+#, 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"
+
+#: array.c:113
+#, c-format
+msgid "attempt to use scalar `%s' as array"
+msgstr "sayısal `%s' dizi olarak kullanılmaya çalışılıyor"
+
+#: array.c:151
+#, c-format
+msgid "from %s"
+msgstr "%s'den"
+
+#: array.c:506
+#, c-format
+msgid "reference to uninitialized element `%s[\"%s\"]'"
+msgstr "ilklendirilmemiş öğeye ( %s[\"%s\"] ) başvuru yapılıyor"
+
+#: array.c:512
+#, c-format
+msgid "subscript of array `%s' is null string"
+msgstr "dizinin indisi `%s' bir null dizge"
+
+#: array.c:609
+#, c-format
+msgid "delete: index `%s' not in array `%s'"
+msgstr "delete: `%s' indeksi `%s' dizisinde deÄŸil"
+
+#: array.c:769
+#, c-format
+msgid "%s: empty (null)\n"
+msgstr "%s: boÅŸ (null)\n"
+
+#: array.c:774
+#, c-format
+msgid "%s: empty (zero)\n"
+msgstr "%s: boş (sıfır)\n"
+
+#: array.c:778
+#, c-format
+msgid "%s: table_size = %d, array_size = %d\n"
+msgstr "%s: tablo_uzunluÄŸu = %d, dizi_indisi = %d\n"
+
+#: array.c:807
+#, c-format
+msgid "%s: is parameter\n"
+msgstr "%s: parametredir\n"
+
+#: array.c:812
+#, c-format
+msgid "%s: array_ref to %s\n"
+msgstr "%s: %s için dizi başvurusu\n"
+
+#: awkgram.y:208
+#, c-format
+msgid "%s blocks must have an action part"
+msgstr "%s blokları bir eylem bölümü içermeli"
+
+#: awkgram.y:211
+msgid "each rule must have a pattern or an action part"
+msgstr "her kural bir eylem bölümü veya bir kalıp içermeli"
+
+#: awkgram.y:267
+#, c-format
+msgid "`%s' is a built-in function, it cannot be redefined"
+msgstr "`%s' bir yerleÅŸik iÅŸlevdir, yeniden atanamaz"
+
+#: awkgram.y:314
+#, 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:340 awkgram.y:615
+msgid "statement may have no effect"
+msgstr "deyim bir etkiye sahip olmayabilir"
+
+#: awkgram.y:435 awkgram.y:455
+#, c-format
+msgid "`%s' used in %s action"
+msgstr "`%s' %s eyleminde kullanılmış"
+
+#: awkgram.y:448 awkgram.y:451
+msgid "`nextfile' is a gawk extension"
+msgstr "`nextfile' bir gawk uzantısıdır"
+
+#: awkgram.y:465
+msgid "`return' used outside function context"
+msgstr "`return' işlev bağlamının dışında kullanılmış"
+
+#: awkgram.y:504
+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:517 awkgram.y:524
+msgid "`delete array' is a gawk extension"
+msgstr "`delete array' bir gawk uzantısıdır"
+
+#: awkgram.y:532 awkgram.y:539
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "`delete array' uyarlanabilir olmayan bir gawk uzantısıdır"
+
+#: awkgram.y:583
+#, c-format
+msgid "duplicate case values in switch body: %s"
+msgstr "switch içinde yinelenmiş case değerleri var: %s"
+
+#: awkgram.y:593
+msgid "Duplicate `default' detected in switch body"
+msgstr "switch içinde yinelenmiş `default' saptandı"
+
+#: awkgram.y:681
+msgid "multistage two-way pipelines don't work"
+msgstr "çok katlı iki yönlü veriyolları çalışmaz"
+
+#: awkgram.y:772
+msgid "regular expression on right of assignment"
+msgstr "düzenli ifade atamanın sağında"
+
+#: awkgram.y:782
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "düzenli ifade `~' ya da `!~' işlemiminin solunda"
+
+#: awkgram.y:790
+msgid "regular expression on right of comparison"
+msgstr "düzenli ifade karşılaştırmanın sağında"
+
+#: awkgram.y:857
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "END eyleminin içinde yönlendirme yapmayan `getline' tanımsız"
+
+#: awkgram.y:884
+msgid "call of `length' without parentheses is not portable"
+msgstr "parantezsiz `length' çağrısı taşınabilir değil"
+
+#: awkgram.y:887
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "parantezsiz `length' çağrısı POSIX'e uygun değil"
+
+#: awkgram.y:940
+msgid "use of non-array as array"
+msgstr "dizi olmayan değişken dizi olarak kullanılmış"
+
+#: awkgram.y:942
+msgid "invalid subscript expression"
+msgstr "indis ifadesi geçersiz"
+
+#: awkgram.y:1140
+msgid "unexpected newline or end of string"
+msgstr "beklenmeyen satırsonu ya da dizge sonu"
+
+#: awkgram.y:1235
+msgid "empty program text on command line"
+msgstr "komut satırında boş program metni"
+
+#: awkgram.y:1292
+#, 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:1327
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "kaynak dosyası `%s' okunamıyor (%s)"
+
+#: awkgram.y:1335
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "kaynak dosyası `%s' boş"
+
+#: awkgram.y:1537 awkgram.y:1647 awkgram.y:1665 awkgram.y:2015 awkgram.y:2100
+msgid "source file does not end in newline"
+msgstr "kaynak dosyasının sonunda satırsonu eksik"
+
+#: awkgram.y:1601
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr "sonlandırılmamış düzenli ifade dosya sonunda `\\' ile bitiyor"
+
+#: awkgram.y:1621
+msgid "unterminated regexp"
+msgstr "sonlandırılmamış düzenli ifade"
+
+#: awkgram.y:1624
+msgid "unterminated regexp at end of file"
+msgstr "dosya sonunda sonlandırılmamış düzenli ifade"
+
+#: awkgram.y:1691
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr "`\\ #...' satır uzatma kullanımı taşınabilir değil"
+
+#: awkgram.y:1703
+msgid "backslash not last character on line"
+msgstr "tersbölü satırdaki son karakter değil"
+
+#: awkgram.y:1748
+msgid "POSIX does not allow operator `**='"
+msgstr "`**=' iÅŸlemimi POSIX uyumlu deÄŸil"
+
+#: awkgram.y:1750
+msgid "old awk does not support operator `**='"
+msgstr "`**=' iÅŸlemimini eski awk desteklemiyor"
+
+#: awkgram.y:1759
+msgid "POSIX does not allow operator `**'"
+msgstr "`**' iÅŸlemimi POSIX uyumlu deÄŸil"
+
+#: awkgram.y:1761
+msgid "old awk does not support operator `**'"
+msgstr "`**' iÅŸlemimini eski awk desteklemiyor"
+
+#: awkgram.y:1792
+msgid "operator `^=' is not supported in old awk"
+msgstr "`^=' iÅŸlemimini eski awk desteklemiyor"
+
+#: awkgram.y:1800
+msgid "operator `^' is not supported in old awk"
+msgstr "`^' iÅŸlemimini eski awk desteklemiyor"
+
+#: awkgram.y:1884 awkgram.y:1901
+msgid "unterminated string"
+msgstr "sonlandırılmamış dizge"
+
+#: awkgram.y:2061
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "ifade içinde '%c' karakteri geçersiz"
+
+#: awkgram.y:2121
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "`%s' bir gawk uzantısıdır"
+
+#: awkgram.y:2124
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "`%s' bir Bell Laboratuarları uzantısıdır"
+
+#: awkgram.y:2127
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "`%s' POSIX uyumlu deÄŸil"
+
+#: awkgram.y:2131
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "`%s' eski awk tarafından desteklemiyor"
+
+#: awkgram.y:2158
+msgid "`goto' considered harmful!\n"
+msgstr "`goto' zararlı sayılır!\n"
+
+#: awkgram.y:2220
+#, 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:2239 awkgram.y:2242
+msgid "match: third argument is a gawk extension"
+msgstr "match: üçüncü argüman bir gawk uzantısı"
+
+#: awkgram.y:2255
+#, 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:2258
+#, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "üçüncü %s parametresi değiştirilebilir bir nesne değil"
+
+#: awkgram.y:2285 awkgram.y:2288
+msgid "close: second argument is a gawk extension"
+msgstr "close: ikinci argüman bir gawk uzantısı"
+
+#: awkgram.y:2298
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr "dcgettext(_\"...\") kullanımı yanlış: altçizgiyi kaldırın"
+
+#: awkgram.y:2313
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr "dcngettext(_\"...\") kullanımı yanlış: altçizgiyi kaldırın"
+
+#: awkgram.y:2384
+#, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "`%s' işlevi: %d. parametre, `%s', %d. parametrenin tekrarı"
+
+#: awkgram.y:2417
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "`%s' işlevi: parametre, `%s'global değişkeni gölgeliyor"
+
+#: awkgram.y:2529
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "`%s' yazmak için açılamadı (%s)"
+
+#: awkgram.y:2530 profile.c:93
+msgid "sending profile to standard error"
+msgstr "profil standart hataya gönderiliyor"
+
+#: awkgram.y:2562
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: kapatma başarısız (%s)"
+
+#: awkgram.y:2684
+msgid "shadow_funcs() called twice!"
+msgstr "shadow_funcs() iki kere çağrıldı!"
+
+#: awkgram.y:2711
+msgid "there were shadowed variables."
+msgstr "gölgeli değişkenler vardı."
+
+#: awkgram.y:2784
+#, 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:2794
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "işlev ismi `%s' önceden atanmış"
+
+#: awkgram.y:2945 awkgram.y:2951
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "`%s' işlevi çağrıldı ama hiç atanmamış"
+
+#: awkgram.y:2954
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "`%s' işlevi atanmış ama hiç çağrılmadı"
+
+#: awkgram.y:2981
+#, c-format
+msgid "regexp constant for parameter #%d yields boolean value"
+msgstr "%d numaralı argüman bir düzenli ifade sabiti"
+
+#: awkgram.y:2994
+#, 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"
+
+#: awkgram.y:2996
+msgid "or used as a variable or an array"
+msgstr "ya da bir değişken ya da dizi olarak kullanılmış"
+
+#: builtin.c:137
+#, c-format
+msgid "%s to \"%s\" failed (%s)"
+msgstr "%s \"%s\"ya yazılamadı (%s)"
+
+#: builtin.c:138
+msgid "standard output"
+msgstr "standart çıktı"
+
+#: builtin.c:139
+msgid "reason unknown"
+msgstr "sebebi bilinmiyor"
+
+#: builtin.c:152
+msgid "exp: received non-numeric argument"
+msgstr "exp: sayısal olmayan argüman alındı"
+
+#: builtin.c:158
+#, c-format
+msgid "exp: argument %g is out of range"
+msgstr "exp: %g kapsamdışı"
+
+#: builtin.c:216
+#, 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:219
+#, 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:231
+#, 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:325
+msgid "index: received non-string first argument"
+msgstr "index: ilk argüman dizge olmayan türde alındı"
+
+#: builtin.c:327
+msgid "index: received non-string second argument"
+msgstr "index: ikinci argüman dizge olmayan türde alındı"
+
+#: builtin.c:437
+msgid "int: received non-numeric argument"
+msgstr "int: sayısal olmayan argüman alındı"
+
+#: builtin.c:454
+msgid "length: received non-string argument"
+msgstr "length: dizge olmayan argüman alındı"
+
+#: builtin.c:470
+msgid "log: received non-numeric argument"
+msgstr "log: sayısal olmayan argüman alındı"
+
+#: builtin.c:473
+#, c-format
+msgid "log: received negative argument %g"
+msgstr "log: negatif argüman %g alındı"
+
+#: builtin.c:635 builtin.c:638
+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:740
+msgid "`$' is not permitted in awk formats"
+msgstr "`$' awk biçemlerde kullanılmaz"
+
+#: builtin.c:746
+msgid "arg count with `$' must be > 0"
+msgstr "`$' ile birlikte verilen argüman sayısı > 0 olmalıdır"
+
+#: builtin.c:748
+#, c-format
+msgid "arg count %ld greater than total number of supplied arguments"
+msgstr "argüman sayısı %ld sağlanmış toplam argüman sayısından büyük"
+
+#: builtin.c:750
+msgid "`$' not permitted after period in format"
+msgstr "`$' biçem içinde noktadan sonra kullanılmaz"
+
+#: builtin.c:763
+msgid "no `$' supplied for positional field width or precision"
+msgstr "konumsal alan genişliği ya da duyarlığı için `$' kullanılmamış"
+
+#: builtin.c:821
+msgid "`l' is meaningless in awk formats; ignored"
+msgstr "`l' awk biçemlerde anlamsız; yoksayıldı"
+
+#: builtin.c:825
+msgid "`l' is not permitted in POSIX awk formats"
+msgstr "`l' POSIX awk biçemlerde kullanılmaz"
+
+#: builtin.c:836
+msgid "`L' is meaningless in awk formats; ignored"
+msgstr "`L' awk biçemlerde anlamsız; yoksayıldı"
+
+#: builtin.c:840
+msgid "`L' is not permitted in POSIX awk formats"
+msgstr "`L' POSIX awk biçemlerde kullanılmaz"
+
+#: builtin.c:851
+msgid "`h' is meaningless in awk formats; ignored"
+msgstr "`h' awk biçemlerde anlamsız; yoksayıldı"
+
+#: builtin.c:855
+msgid "`h' is not permitted in POSIX awk formats"
+msgstr "`h' POSIX awk biçemlerde kullanılmaz"
+
+#: builtin.c:1055
+#, c-format
+msgid "[s]printf: value %g is out of range for `%%%c' format"
+msgstr "[s]printf: %g değeri `%%%c' biçimi için kapsamdışı"
+
+#: builtin.c:1108
+msgid "not enough arguments to satisfy format string"
+msgstr "biçem dizgesini oluşturacak yeterli argüman yok"
+
+#: builtin.c:1110
+msgid "^ ran out for this one"
+msgstr "bir bunun için ^ tükendi"
+
+#: builtin.c:1115
+msgid "[s]printf: format specifier does not have control letter"
+msgstr "[s]printf: biçem belirteci denetim karakteri içermiyor"
+
+#: builtin.c:1118
+msgid "too many arguments supplied for format string"
+msgstr "biçem dizgesi için çok fazla argüman sağlanmış"
+
+#: builtin.c:1184 builtin.c:1187
+msgid "printf: no arguments"
+msgstr "printf: argüman yok"
+
+#: builtin.c:1211
+msgid "sqrt: received non-numeric argument"
+msgstr "sqrt: sayısal olmayan argüman alındı"
+
+#: builtin.c:1215
+#, c-format
+msgid "sqrt: called with negative argument %g"
+msgstr "sqrt: negatif argüman %g ile çağrıldı"
+
+#: builtin.c:1238
+#, 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:1243
+#, 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:1262
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 1"
+msgstr "substr: uzunluk %g <= 0 dır"
+
+#: builtin.c:1264
+#, fuzzy, c-format
+msgid "substr: length %g is not >= 0"
+msgstr "substr: uzunluk %g <= 0 dır"
+
+#: builtin.c:1271
+#, 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:1276
+#, c-format
+msgid "substr: length %g too big for string indexing, truncating to %g"
+msgstr ""
+"substr: dizge indislemesi için uzunluk olarak %g çok fazla, %g den sonrası "
+"gözardı ediliyor"
+
+#: builtin.c:1288
+msgid "substr: source string is zero length"
+msgstr "substr: kaynak dizge sıfır uzunlukta"
+
+#: builtin.c:1294
+#, c-format
+msgid "substr: start index %g is past end of string"
+msgstr "substr: başlangıç indisi %g dizgenin sonundan sonra"
+
+#: builtin.c:1302
+#, c-format
+msgid ""
+"substr: length %g at start index %g exceeds length of first argument (%lu)"
+msgstr ""
+"substr: uzunluk %g, %g başlangıç indisinde ilk argümanın uzunluğunu (%lu) "
+"aÅŸar"
+
+#: builtin.c:1337
+msgid "strftime: received non-string first argument"
+msgstr "strftime: ilk argüman dizge olmayan türde alındı"
+
+#: builtin.c:1343
+msgid "strftime: received empty format string"
+msgstr "strftime: boş biçem dizgesi alındı"
+
+#: builtin.c:1352
+msgid "strftime: received non-numeric second argument"
+msgstr "strftime: ikinci argüman sayısal olmayan türde alındı"
+
+#: builtin.c:1415
+msgid "mktime: received non-string argument"
+msgstr "mktime: dizge olmayan argüman alındı"
+
+#: builtin.c:1460
+msgid "system: received non-string argument"
+msgstr "system: dizge olmayan argüman alındı"
+
+#: builtin.c:1581 eval.c:1883
+#, c-format
+msgid "reference to uninitialized field `$%d'"
+msgstr "ilklendirilmemiş `$%d' alanına başvuru"
+
+#: builtin.c:1608
+msgid "tolower: received non-string argument"
+msgstr "tolower: dizge olmayan argüman alındı"
+
+#: builtin.c:1657
+msgid "toupper: received non-string argument"
+msgstr "toupper: dizge olmayan argüman alındı"
+
+#: builtin.c:1702
+msgid "atan2: received non-numeric first argument"
+msgstr "atan2: ilk argüman sayısal olmayan türde alındı"
+
+#: builtin.c:1704
+msgid "atan2: received non-numeric second argument"
+msgstr "atan2: ikinci argüman sayısal olmayan türde alındı"
+
+#: builtin.c:1723
+msgid "sin: received non-numeric argument"
+msgstr "sin: sayısal olmayan argüman alındı"
+
+#: builtin.c:1739
+msgid "cos: received non-numeric argument"
+msgstr "cos: sayısal olmayan argüman alındı"
+
+#: builtin.c:1788
+msgid "srand: received non-numeric argument"
+msgstr "srand: sayısal olmayan argüman alındı"
+
+#: builtin.c:1823
+msgid "match: third argument is not an array"
+msgstr "match: üçüncü argüman bir dizi değil"
+
+#: builtin.c:2307
+msgid "gensub: third argument of 0 treated as 1"
+msgstr "gensub: 0 olan 3. argüman 1 kabul edildi"
+
+#: builtin.c:2416 builtin.c:2418
+msgid "lshift: received non-numeric first argument"
+msgstr "lshift: ilk argüman sayısal olmayan türde alındı"
+
+#: builtin.c:2420
+#, 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:2422
+#, 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:2424
+#, 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:2453 builtin.c:2455
+msgid "rshift: received non-numeric first argument"
+msgstr "rshift: ilk argüman sayısal olmayan türde alındı"
+
+#: builtin.c:2457
+#, 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:2459
+#, 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:2461
+#, 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:2490 builtin.c:2492
+msgid "and: received non-numeric first argument"
+msgstr "and: ilk argüman sayısal olmayan türde alındı"
+
+#: builtin.c:2494
+#, 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:2496
+#, 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:2525 builtin.c:2527
+msgid "or: received non-numeric first argument"
+msgstr "or: ilk argüman sayısal olmayan türde alındı"
+
+#: builtin.c:2529
+#, 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:2531
+#, 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:2560 builtin.c:2562
+msgid "xor: received non-numeric first argument"
+msgstr "xor: ilk argüman sayısal olmayan türde alındı"
+
+#: builtin.c:2564
+#, 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:2566
+#, 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:2594
+msgid "compl: received non-numeric argument"
+msgstr "compl: sayısal olmayan argüman alındı"
+
+#: builtin.c:2596
+#, c-format
+msgid "compl(%lf): negative value will give strange results"
+msgstr "compl(%lf): negatif değerler tuhaf sonuçlar verecek"
+
+#: builtin.c:2598
+#, c-format
+msgid "compl(%lf): fractional value will be truncated"
+msgstr "compl(%lf): tamsayı kısım kalacak şekilde kalanı atılacak"
+
+#: builtin.c:2771
+#, c-format
+msgid "dcgettext: `%s' is not a valid locale category"
+msgstr "dcgettext: `%s' geçerli bir yerel kategori değil"
+
+#: eval.c:266
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "%d. düğümtürü bilinmiyor"
+
+#: eval.c:312
+msgid "buffer overflow in genflags2str"
+msgstr "genflags2str içinde tampon taştı"
+
+#: eval.c:647
+#, c-format
+msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
+msgstr ""
+"for loop: `%s' dizisinin boyu döngünün yorumlanması sırasında %ld iken %ld "
+"oldu"
+
+#: eval.c:668
+msgid "`break' outside a loop is not portable"
+msgstr "döngü dışında `break' kullanımı taşınabilir değil"
+
+#: eval.c:672
+msgid "`break' outside a loop is not allowed"
+msgstr "döngü dışında `break' kullanımı yasak"
+
+#: eval.c:689
+msgid "`continue' outside a loop is not portable"
+msgstr "döngü dışında `continue' kullanımı taşınabilir değil"
+
+#: eval.c:693
+msgid "`continue' outside a loop is not allowed"
+msgstr "döngü dışında `continue' kullanımı yasak"
+
+#: eval.c:727
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "`next' bir BEGIN kuralından çağrılamaz"
+
+#: eval.c:729
+msgid "`next' cannot be called from an END rule"
+msgstr "`next' bir END kuralından çağrılamaz"
+
+#: eval.c:738
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "`nextfile' bir BEGIN kuralından çağrılamaz"
+
+#: eval.c:740
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "`nextfile' bir END kuralından çağrılamaz"
+
+#: eval.c:785
+msgid "statement has no effect"
+msgstr "deyim etkisiz"
+
+#: eval.c:828 eval.c:1726
+#, 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:835 eval.c:841
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "başlangıç değeri olmayan `%s' argümanına başvuru"
+
+#: eval.c:848 eval.c:907 eval.c:1732 eval.c:1742 profile.c:807
+#, 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"
+
+#: eval.c:858 eval.c:1752
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "öndeğer ataması yapılmamış `%s' değişkenine başvuru"
+
+#: eval.c:1007
+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:1032
+msgid "assignment used in conditional context"
+msgstr "koşul bağlamında atama yapılmış"
+
+#: eval.c:1122
+msgid "division by zero attempted"
+msgstr "sıfırla bölme hatası"
+
+#: eval.c:1137
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "`%%'de sıfırla bölme hatası"
+
+#: eval.c:1152 profile.c:683
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "tree_eval içinde kuraldışı tür (%s)"
+
+#: eval.c:1328
+msgid "division by zero attempted in `/='"
+msgstr "`/='de sıfırla bölme hatası"
+
+#: eval.c:1346
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "`%%='de sıfırla bölme hatası"
+
+#: eval.c:1586
+#, 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:1633
+#, c-format
+msgid "function `%s' not defined"
+msgstr "`%s' işlevi tanımsız"
+
+#: eval.c:1639
+#, c-format
+msgid "function %s called\n"
+msgstr "%s işlevi çağrıldı\n"
+
+#: eval.c:1698
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# İşlev Çağrı Yığını:\n"
+"\n"
+
+#: eval.c:1701
+msgid "\t# -- main --\n"
+msgstr "\t# -- main --\n"
+
+#: eval.c:1867
+msgid "attempt to field reference from non-numeric value"
+msgstr "sayısal olmayan değerden alan başvurusu"
+
+#: eval.c:1869
+msgid "attempt to reference from null string"
+msgstr "null dizgeden alan baÅŸvurusu"
+
+#: eval.c:1875
+#, c-format
+msgid "attempt to access field %d"
+msgstr "%d. alana erişilmeye çalışılıyor"
+
+#: eval.c:1896 eval.c:1903 profile.c:900
+msgid "assignment is not allowed to result of builtin function"
+msgstr "deÄŸiÅŸken ismine yerleÅŸik iÅŸlevin sonucu atanamaz"
+
+#: eval.c:1951
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "`IGNORECASE' bir gawk uzantısıdır"
+
+#: eval.c:1980
+msgid "`BINMODE' is a gawk extension"
+msgstr "`BINMODE' bir gawk uzantısıdır"
+
+#: eval.c:2092
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "`%sFMT' özelliği `%s' hatalı"
+
+#: eval.c:2170
+msgid "turning off `--lint' due to assignment to `LINT'"
+msgstr "`LINT' atamasından dolayı `--lint' kapatılıyor"
+
+#: 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:183
+msgid "Operation Not Supported"
+msgstr "İşlem Desteklenmiyor"
+
+#: field.c:315
+msgid "NF set to negative value"
+msgstr "NF negatif değere ayarlı"
+
+#: field.c:808
+msgid "split: second argument is not an array"
+msgstr "split: ikinci argüman bir dizi değil"
+
+#: field.c:842
+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:894
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "`FIELDWIDTHS' bir gawk uzantısıdır"
+
+#: field.c:921
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "FIELDWIDTHS içindeki %d. alan > 0 olmalı"
+
+#: field.c:994
+msgid "null string for `FS' is a gawk extension"
+msgstr "`FS' için null dizge bir gawk uzantısıdır"
+
+#: 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:434
+#, 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"
+
+#: io.c:305
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "`%s' okumak için açılamıyor (%s)"
+
+#: io.c:392
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "dosya tanımlayıcı %d (`%s') başarısız (%s)"
+
+#: io.c:530
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "redirect() içindeki ağaç türü %s geçersiz"
+
+#: io.c:536
+#, 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:542
+#, 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:547
+#, 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:569
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "`%.*s' dosyası için `>' ve `>>' karışımı gereksiz"
+
+#: io.c:621
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "`%s' veriyolu çıktı için açılamadı (%s)"
+
+#: io.c:630
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "`%s' veriyolu girdi için açılamadı (%s)"
+
+#: io.c:643
+#, 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:647
+#, 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:723
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "`%s'den yönlendirilemiyor (%s)"
+
+#: io.c:726
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "`%s'e yönlendirilemiyor (%s)"
+
+#: io.c:765
+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:777
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "`%s' kapatılamadı (%s)."
+
+#: io.c:784
+msgid "too many pipes or input files open"
+msgstr "çok fazla veriyolu ya da dosya açık"
+
+#: io.c:807
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: ikinci argüman `to' ya da `from' olmalı"
+
+#: io.c:821
+#, 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:825
+msgid "close of redirection that was never opened"
+msgstr "hiç açılmamış bir yönlendirmenin kapatılması"
+
+#: io.c:862
+#, 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:924
+#, 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:927
+#, 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:946
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "`%s' soketinin açıkça kapatılması istenmedi"
+
+#: io.c:949
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "`%s' alt-işleminin açıkça kapatılması istenmedi"
+
+#: io.c:952
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "`%s' veriyolunun açıkça kapatılması istenmedi"
+
+#: io.c:955
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "`%s' dosyasının açıkça kapatılması istenmedi"
+
+#: io.c:984 io.c:1038
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "standart çıktıya yazarken hata (%s)"
+
+#: io.c:988 io.c:1042
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "standart hataya yazarken hata (%s)"
+
+#: io.c:996
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "`%s'in veriyolu ile veri aktarımı başarısız (%s)."
+
+#: io.c:999
+#, 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:1002
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "`%s'in dosya ile veri aktarımı başarısız (%s)."
+
+#: io.c:1161
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "/inet/raw istemci henüz hazır değil"
+
+#: io.c:1163 io.c:1200
+msgid "only root may use `/inet/raw'."
+msgstr "`/inet/raw' sadece root tarafından kullanılabilir"
+
+#: io.c:1198
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "/inet/raw sunucu henüz hazır değil"
+
+#: io.c:1288
+#, 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:1306
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "özel dosya ismi `%s' tamamlanmamış"
+
+#: io.c:1318
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "`%s' deki yerel port geçersiz"
+
+#: io.c:1330
+msgid "must supply a remote hostname to `/inet'"
+msgstr "`/inet' e bir karşı makina ismi sağlanmalı"
+
+#: io.c:1345
+msgid "must supply a remote port to `/inet'"
+msgstr "`/inet' e bir karşı port sağlanmalı"
+
+#: io.c:1351
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "`%s' de karşı port geçersiz"
+
+#: io.c:1361
+msgid "TCP/IP communications are not supported"
+msgstr "TCP/IP haberleÅŸmesi desteklenmiyor"
+
+#: io.c:1370 io.c:1551
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "`%s' dosya deÄŸil dizin"
+
+#: io.c:1440
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "`PROCINFO[\"%s\"]' kullanın (`%s' yerine)"
+
+#: io.c:1472
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "`/dev/user' yerine `PROCINFO[...]' kullanın"
+
+#: io.c:1537 io.c:1711
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "`%s', `%s' kipinde açılamadı"
+
+#: io.c:1762
+#, c-format
+msgid "close of master pty failed (%s)"
+msgstr "ana pty kapatılamadı (%s)"
+
+#: io.c:1764 io.c:1916 io.c:2068
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "ast süreçte stdÇ kapatılamadı (%s)"
+
+#: io.c:1767
+#, c-format
+msgid "moving slave pty to stdout in child failed (dup: %s)"
+msgstr "ast süreçte yardımcı pty standart çıktıya taşınamadı (dup: %s)"
+
+#: io.c:1769 io.c:1921
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "ast süreçte stdG kapatılamadı (%s)"
+
+#: io.c:1772
+#, c-format
+msgid "moving slave pty to stdin in child failed (dup: %s)"
+msgstr "ast süreçte yardımcı pty standart girdiye taşınamadı (dup: %s)"
+
+#: io.c:1774 io.c:1793
+#, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "yardımcı pty kapatılamadı (%s)"
+
+#: io.c:1867 io.c:1919 io.c:2049 io.c:2071
+#, 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:1871 io.c:1924
+#, 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:1888 io.c:2062
+msgid "restoring stdout in parent process failed\n"
+msgstr "üst süreçte stdÇ eski durumuna getirilemedi\n"
+
+#: io.c:1893
+msgid "restoring stdin in parent process failed\n"
+msgstr "üst süreçte stdG eski durumuna getirilemedi\n"
+
+#: io.c:1927 io.c:2073 io.c:2084
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "veriyolu kapatılamadı (%s)"
+
+#: io.c:1972
+msgid "`|&' not supported"
+msgstr "`|&' desteklenmiyor"
+
+#: io.c:2039
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "`%s' veriyolu açılamıyor (%s)"
+
+#: io.c:2080
+#, 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:2423
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "veri dosyası `%s' boş"
+
+#: io.c:2466 io.c:2474
+msgid "could not allocate more input memory"
+msgstr "daha fazla girdi belleği ayrılamadı"
+
+#: io.c:2832 io.c:2895
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "`%s' girdi dosyası okunurken hata: %s"
+
+#: io.c:3020
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "`RS' çoklu karakter değeri bir gawk uzantısıdır"
+
+#: main.c:324
+msgid "`-m[fr]' option irrelevant in gawk"
+msgstr "`-m[fr]' seçeneği gawk'da böyle kullanılmaz"
+
+#: main.c:326
+msgid "-m option usage: `-m[fr] nnn'"
+msgstr "-m seçeneğinin kullanımı: `-m[fr] nnn'"
+
+#: main.c:343
+#, 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:380
+msgid "empty argument to `--source' ignored"
+msgstr "`--source' seçeneği için boş argüman yoksayıldı"
+
+#: main.c:451
+msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
+msgstr "ortam değişkeni `POSIXLY_CORRECT' var: `--posix' kullanılıyor"
+
+#: main.c:456
+msgid "`--posix' overrides `--traditional'"
+msgstr "`--posix' seçeneği `--traditional' seçeneğini etkisiz kılar"
+
+#: main.c:467
+msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
+msgstr ""
+"`--posix'/`--traditional' seçenekleri `--non-decimal-data' seçeneğini "
+"etkisiz kılar"
+
+#: main.c:471
+#, 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:512
+#, c-format
+msgid "can't set binary mode on stdin (%s)"
+msgstr "standart girdi ikilik kipe ayarlanamaz (%s)"
+
+#: main.c:515
+#, c-format
+msgid "can't set binary mode on stdout (%s)"
+msgstr "standart çıktı ikilik kipe ayarlanamaz (%s)"
+
+#: main.c:517
+#, c-format
+msgid "can't set binary mode on stderr (%s)"
+msgstr "standart hata ikilik kipe ayarlanamaz (%s)"
+
+#: main.c:547
+msgid "no program text at all!"
+msgstr "program metni hiç yok!"
+
+#: main.c:620
+#, 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:622
+#, 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:627
+msgid "POSIX options:\t\tGNU long options:\n"
+msgstr "POSIX seçenekleri: GNU uzun seçenekleri:\n"
+
+#: main.c:628
+msgid "\t-f progfile\t\t--file=progfile\n"
+msgstr " -f progDosyası --file=progDosyası\n"
+
+#: main.c:629
+msgid "\t-F fs\t\t\t--field-separator=fs\n"
+msgstr " -F ayraç --field-separator=ayraç\n"
+
+#: main.c:630
+msgid "\t-v var=val\t\t--assign=var=val\n"
+msgstr " -v var=deÄŸer --assign=var=deÄŸer\n"
+
+#: main.c:631
+msgid "\t-m[fr] val\n"
+msgstr " -m[fr] deÄŸer\n"
+
+#: main.c:632
+msgid "\t-W compat\t\t--compat\n"
+msgstr " -W compat --compat\n"
+
+#: main.c:633
+msgid "\t-W copyleft\t\t--copyleft\n"
+msgstr " -W copyleft --copyleft\n"
+
+#: main.c:634
+msgid "\t-W copyright\t\t--copyright\n"
+msgstr " -W copyright --copyright\n"
+
+#: main.c:635
+msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
+msgstr " -W dump-variables[=dosya] --dump-variables[=dosya]\n"
+
+#: main.c:636
+msgid "\t-W gen-po\t\t--gen-po\n"
+msgstr " -W gen-po --gen-po\n"
+
+#: main.c:637
+msgid "\t-W help\t\t\t--help\n"
+msgstr " -W help --help\n"
+
+#: main.c:638
+msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+msgstr " -W lint[=ölümcül] --lint[=ölümcül]\n"
+
+#: main.c:639
+msgid "\t-W lint-old\t\t--lint-old\n"
+msgstr " -W lint-old --lint-old\n"
+
+#: main.c:640
+msgid "\t-W non-decimal-data\t--non-decimal-data\n"
+msgstr " -W non-decimal-data --non-decimal-data\n"
+
+#: main.c:642
+msgid "\t-W nostalgia\t\t--nostalgia\n"
+msgstr " -W nostalgia --nostalgia\n"
+
+#: main.c:645
+msgid "\t-W parsedebug\t\t--parsedebug\n"
+msgstr " -W parsedebug --parsedebug\n"
+
+#: main.c:647
+msgid "\t-W profile[=file]\t--profile[=file]\n"
+msgstr " -W profile[=dosya] --profile[=dosya]\n"
+
+#: main.c:648
+msgid "\t-W posix\t\t--posix\n"
+msgstr " -W posix --posix\n"
+
+#: main.c:649
+msgid "\t-W re-interval\t\t--re-interval\n"
+msgstr " -W re-interval --re-interval\n"
+
+#: main.c:650
+msgid "\t-W source=program-text\t--source=program-text\n"
+msgstr " -W source=program-metni --source=program-metni\n"
+
+#: main.c:651
+msgid "\t-W traditional\t\t--traditional\n"
+msgstr " -W traditional --traditional\n"
+
+#: main.c:652
+msgid "\t-W usage\t\t--usage\n"
+msgstr " -W usage --usage\n"
+
+#: main.c:653
+msgid "\t-W version\t\t--version\n"
+msgstr " -W version --version\n"
+
+#: main.c:657
+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:661
+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:665
+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:682
+#, 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:690
+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:696
+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:730
+msgid "-Ft does not set FS to tab in POSIX awk"
+msgstr "POSIX awk -Ft ile dosya sistemini belirlemez"
+
+#: main.c:956
+#, c-format
+msgid ""
+"%s: `%s' argument to `-v' not in `var=value' form\n"
+"\n"
+msgstr ""
+"%s: `-v' ile verilen `%s' argümanı `var=değer' biçiminde değil\n"
+"\n"
+
+#: main.c:976
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr "`%s' kurala uygun bir deÄŸiÅŸken ismi deÄŸil"
+
+#: main.c:979
+#, c-format
+msgid "`%s' is not a variable name, looking for file `%s=%s'"
+msgstr "`%2$s=%3$s' için dosyaya bakınca, `%1$s' bir değişken ismi değil"
+
+#: main.c:1012
+msgid "floating point exception"
+msgstr "Gerçel sayı istisnası"
+
+#: main.c:1019
+msgid "fatal error: internal error"
+msgstr "ölümcül iç hata"
+
+#: main.c:1069
+#, c-format
+msgid "no pre-opened fd %d"
+msgstr "ön açılışlı bir %d dosya tanımlayıcısı yok"
+
+#: main.c:1074
+#, 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:1097 main.c:1106
+#, c-format
+msgid "could not find groups: %s"
+msgstr "gruplar bulunamadı: %s"
+
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "komut satırı:"
+
+#: msg.c:120
+msgid "warning: "
+msgstr "uyarı: "
+
+#: msg.c:142
+msgid "error: "
+msgstr "hata: "
+
+#: msg.c:178
+msgid "fatal: "
+msgstr "ölümcül: "
+
+#: node.c:58 node.c:65 node.c:74 node.c:88 node.c:115
+msgid "can't convert string to float"
+msgstr "dizge gerçel sayıya dönüştürülemiyor"
+
+#: node.c:355
+msgid "backslash at end of string"
+msgstr "dizge sonunda tersbölü"
+
+#: node.c:539
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX `\\x' öncelemelerine izin vermez"
+
+#: node.c:545
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "`\\x' önceleme dizgesinde onaltılık rakamlar yok"
+
+#: node.c:579
+#, c-format
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr "`\\%c' önceleme dizgesi `%c' olarak kullanıldı"
+
+#: posix/gawkmisc.c:172
+#, c-format
+msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
+msgstr "%s %s `%s': close-on-exec belirlenemedi: (fcntl: %s)"
+
+#: profile.c:91
+#, c-format
+msgid "could not open `%s' for writing: %s"
+msgstr "`%s' yazmak için açılamadı: %s"
+
+#: profile.c:449
+#, c-format
+msgid "internal error: %s with null vname"
+msgstr "iç hata: null vname'li %s"
+
+#: profile.c:512
+msgid "# treated internally as `delete'"
+msgstr "# dahili olarak `delete' varsayıldı"
+
+#: profile.c:1162
+#, c-format
+msgid "\t# gawk profile, created %s\n"
+msgstr "\t# gawk profili, oluÅŸturuldu: %s\n"
+
+#: profile.c:1165
+msgid ""
+"\t# BEGIN block(s)\n"
+"\n"
+msgstr ""
+"\t# BEGIN blokları\n"
+"\n"
+
+#: profile.c:1175
+msgid ""
+"\t# Rule(s)\n"
+"\n"
+msgstr ""
+"\t# Kurallar\n"
+"\n"
+
+#: profile.c:1181
+msgid ""
+"\t# END block(s)\n"
+"\n"
+msgstr ""
+"\t# END blokları\n"
+"\n"
+
+#: profile.c:1201
+msgid ""
+"\n"
+"\t# Functions, listed alphabetically\n"
+msgstr ""
+"\n"
+"\t# İşlevler, alfabetik sırayla\n"
+
+#: profile.c:1413
+#, c-format
+msgid "unexpected type %s in prec_level"
+msgstr "prec_level'da anlaşılamayan tür %s"
+
+#: re.c:193
+#, 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"
+
+#: regcomp.c:136
+msgid "Success"
+msgstr "Başarılı"
+
+#: regcomp.c:139
+msgid "No match"
+msgstr "EÅŸleÅŸmez"
+
+#: regcomp.c:142
+msgid "Invalid regular expression"
+msgstr "Düzenli ifade geçersiz"
+
+#: regcomp.c:145
+msgid "Invalid collation character"
+msgstr "Karşılaştırma karakteri geçersiz"
+
+#: regcomp.c:148
+msgid "Invalid character class name"
+msgstr "Karakter sınıf ismi geçersiz"
+
+#: regcomp.c:151
+msgid "Trailing backslash"
+msgstr "İzleyen tersbölü"
+
+#: regcomp.c:154
+msgid "Invalid back reference"
+msgstr "Geriye başvuru geçersiz"
+
+#: regcomp.c:157
+msgid "Unmatched [ or [^"
+msgstr "[ ya da [^ eÅŸleÅŸmiyor"
+
+#: regcomp.c:160
+msgid "Unmatched ( or \\("
+msgstr "( ya da \\( eÅŸleÅŸmiyor"
+
+#: regcomp.c:163
+msgid "Unmatched \\{"
+msgstr "\\{ eÅŸleÅŸmiyor"
+
+#: regcomp.c:166
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\} içeriği geçersiz"
+
+#: regcomp.c:169
+msgid "Invalid range end"
+msgstr "Kapsam sonu geçersiz"
+
+#: regcomp.c:172
+msgid "Memory exhausted"
+msgstr "Bellek tükendi"
+
+#: regcomp.c:175
+msgid "Invalid preceding regular expression"
+msgstr "düzenli ifade önceliği geçersiz"
+
+#: regcomp.c:178
+msgid "Premature end of regular expression"
+msgstr "Düzenli ifade sonu eksik kalmış"
+
+#: regcomp.c:181
+msgid "Regular expression too big"
+msgstr "Düzenli ifade çok büyük"
+
+#: regcomp.c:184
+msgid "Unmatched ) or \\)"
+msgstr ") ya da \\) eÅŸleÅŸmiyor"
+
+#: regcomp.c:621
+msgid "No previous regular expression"
+msgstr "Daha önce düzenli ifade yok"
+
+#~ msgid "substr: length %g is < 0"
+#~ msgstr "substr: uzunluk %g < 0"
+
+#~ msgid "delete: illegal use of variable `%s' as array"
+#~ msgstr "delete: `%s' değişkeninin dizi olarak kullanımı kuraldışı"
+
+#~ msgid "asort: first argument is not an array"
+#~ msgstr "asort: ilk argüman bir dizi değil"
+
+#~ msgid "asort: second argument is not an array"
+#~ msgstr "asort: ikinci argüman bir dizi değil"
+
+#~ msgid "internal error: Node_var_array with null vname"
+#~ msgstr "iç hata: null vname'li node_var_array"
+
+#~ msgid "invalid syntax in name `%s' for variable assignment"
+#~ msgstr "değişken ismi `%s' de sözdizimi hatası"
+
+#~ msgid "or used in other expression context"
+#~ msgstr "ya da diğer ifadenin içeriğinde kullanılmış"
+
+#~ msgid "attempt to use function `%s' as array"
+#~ msgstr "`%s' işlevi dizi olarak kullanılmaya çalışılıyor"
+
+#~ msgid "`%s' is a function, assignment is not allowed"
+#~ msgstr "`%s' bir işlevdir, bir değişken ismi olarak kullanılamaz"
+
+#~ msgid "BEGIN blocks must have an action part"
+#~ msgstr "BEGIN blokları bir eylem bölümü içermeli"
+
+#~ msgid "`nextfile' used in BEGIN or END action"
+#~ msgstr "`nextfile' BEGIN ya da END eyleminde kullanılmış"
+
+#~ 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"
+
+#~ msgid "fptr %x not in tokentab\n"
+#~ msgstr "işlev imleyicisi %x işlev isim listesinde bulunamadı\n"
+
+#~ msgid "gsub third parameter is not a changeable object"
+#~ msgstr "üçüncü gsub parametresi değiştirilebilir bir nesne değil"
+
+#~ msgid "Unbalanced ["
+#~ msgstr "Dengesiz ["
+
+#~ msgid "Unfinished \\ escape"
+#~ msgstr "Tamamlanmamış \\ escape"
+
+#~ msgid "unfinished repeat count"
+#~ msgstr "Tamamlanmamış tekrar sayısı"
+
+#~ msgid "malformed repeat count"
+#~ msgstr "Tekrar sayısı hatalı"
+
+#~ msgid "Unbalanced ("
+#~ msgstr "Dengesiz ("
+
+#~ msgid "No regexp syntax bits specified"
+#~ msgstr "Düzenli ifade sözdizimi bitleri belirtilmemiş"
+
+#~ msgid "Unbalanced )"
+#~ msgstr "Karşılıksız )"
+
+#~ msgid "out of memory"
+#~ msgstr "bellek yetersiz"
+
+#~ msgid "internal error: file `%s', line %d\n"
+#~ msgstr "iç hata: dosya `%s', satır %d\n"
+
+#~ 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/gnu/dist/gawk/posix/ChangeLog b/gnu/dist/gawk/posix/ChangeLog
index 575baa1737b..b2bcfb1be9f 100644
--- a/gnu/dist/gawk/posix/ChangeLog
+++ b/gnu/dist/gawk/posix/ChangeLog
@@ -1,3 +1,83 @@
+Mon Jul 7 11:01:43 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.1.3: Release tar file made.
+
+Sun May 25 16:23:43 2003 Corinna Vinschen <vinschen@redhat.com>
+
+ * gawkmisc.c (cygwin_premain0): New function.
+
+Wed Mar 19 14:10:31 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ This time for sure.
+ -- Bullwinkle
+
+ * Release 3.1.2: Release tar file made.
+
+Tue Feb 4 14:28:06 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ All relevant files: Copyright year updated to 2003.
+
+Tue Dec 17 11:05:11 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.c (optimal_bufsize): Stat the file first, so that
+ stb is always valid for higher level code.
+
+Thu Nov 28 10:20:05 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.c (optimal_bufsize): Enhance to use AWKBUFSIZE
+ environment variable for debugging.
+
+Tue Jun 11 22:18:42 2002 Stepan Kasal <kasal@math.cas.cz>
+
+ * gawkmisc.c (DEFBLKSIZE): Add check for st_blksize > 0,
+ fixes weird bug on some versions of HP-UX.
+
+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
+ rejoicing.
+
+Sun Jan 28 15:50:02 2001 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gawkmisc.c (os_restore_mode): New function.
+
+Sun Dec 3 16:53:37 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.c (os_setbinmode): New function.
+
+Tue Nov 14 16:13:08 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.c: Remove all includes. Done by ../gawkmisc.c.
+
+Tue Nov 7 14:09:14 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.c (os_is_setuid): new function.
+
+Mon Aug 7 15:23:00 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.0.6: Release tar file made.
+
+Sun Jun 25 15:08:19 2000 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Release 3.0.5: Release tar file made.
+
+Wed Jun 30 16:14:36 1999 Arnold D. Robbins <arnold@gnu.org>
+
+ * Release 3.0.4: Release tar file made. This time for sure.
+
+Wed Jul 30 19:53:52 1997 Arnold D. Robbins <arnold@gnu.org>
+
+ * Close-on-exec changes:
+ gawkmisc.c: (os_close_on_exec, os_isdir): new functions.
+
Thu May 15 12:49:08 1997 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* Release 3.0.3: Release tar file made.
diff --git a/gnu/dist/gawk/posix/gawkmisc.c b/gnu/dist/gawk/posix/gawkmisc.c
index 68bfb5ddb96..58d2233467b 100644
--- a/gnu/dist/gawk/posix/gawkmisc.c
+++ b/gnu/dist/gawk/posix/gawkmisc.c
@@ -1,6 +1,8 @@
-/* gawkmisc.c --- miscellanious gawk routines that are OS specific.
+/* $NetBSD: gawkmisc.c,v 1.1.1.2 2003/10/06 15:50:50 wiz Exp $ */
+
+/* gawkmisc.c --- miscellaneous gawk routines that are OS specific.
- Copyright (C) 1986, 1988, 1989, 1991 - 96 the Free Software Foundation, Inc.
+ Copyright (C) 1986, 1988, 1989, 1991 - 1998, 2001 - 2003 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
@@ -20,6 +22,11 @@ char quote = '\'';
char *defpath = DEFPATH;
char envsep = ':';
+#ifndef INVALID_HANDLE
+/* FIXME: is this value for INVALID_HANDLE correct? */
+#define INVALID_HANDLE -1
+#endif
+
/* gawk_name --- pull out the "gawk" part from how the OS called us */
char *
@@ -57,14 +64,63 @@ int flag;
/* optimal_bufsize --- determine optimal buffer size */
-int
+/*
+ * Enhance this for debugging purposes, as follows:
+ *
+ * Always stat the file, stat buffer is used by higher-level code.
+ *
+ * if (AWKBUFSIZE == "exact")
+ * return the file size
+ * else if (AWKBUFSIZE == a number)
+ * always return that number
+ * else
+ * if the size is < default_blocksize
+ * return the size
+ * else
+ * return default_blocksize
+ * end if
+ * endif
+ *
+ * Hair comes in an effort to only deal with AWKBUFSIZE
+ * once, the first time this routine is called, instead of
+ * every time. Performance, dontyaknow.
+ */
+
+size_t
optimal_bufsize(fd, stb)
int fd;
struct stat *stb;
{
+ char *val;
+ static size_t env_val = 0;
+ static short first = TRUE;
+ static short exact = FALSE;
+
/* force all members to zero in case OS doesn't use all of them. */
memset(stb, '\0', sizeof(struct stat));
+ /* always stat, in case stb is used by higher level code. */
+ if (fstat(fd, stb) == -1)
+ fatal("can't stat fd %d (%s)", fd, strerror(errno));
+
+ if (first) {
+ first = FALSE;
+
+ if ((val = getenv("AWKBUFSIZE")) != NULL) {
+ if (strcmp(val, "exact") == 0)
+ exact = TRUE;
+ else if (ISDIGIT(*val)) {
+ for (; *val && ISDIGIT(*val); val++)
+ env_val = (env_val * 10) + *val - '0';
+
+ return env_val;
+ }
+ }
+ } else if (! exact && env_val > 0)
+ return env_val;
+ /* else
+ fall through */
+
/*
* System V.n, n < 4, doesn't have the file system block size in the
* stat structure. So we have to make some sort of reasonable
@@ -72,19 +128,17 @@ struct stat *stb;
* meant for in the first place.
*/
#ifdef HAVE_ST_BLKSIZE
-#define DEFBLKSIZE (stb->st_blksize ? stb->st_blksize : BUFSIZ)
+#define DEFBLKSIZE (stb->st_blksize > 0 ? stb->st_blksize : BUFSIZ)
#else
#define DEFBLKSIZE BUFSIZ
#endif
- if (isatty(fd))
- return BUFSIZ;
- if (fstat(fd, stb) == -1)
- fatal("can't stat fd %d (%s)", fd, strerror(errno));
- if (lseek(fd, (off_t)0, 0) == -1) /* not a regular file */
- return DEFBLKSIZE;
- if (stb->st_size > 0 && stb->st_size < DEFBLKSIZE) /* small file */
- return stb->st_size;
+ if (S_ISREG(stb->st_mode) /* regular file */
+ && 0 < stb->st_size /* non-zero size */
+ && (stb->st_size < DEFBLKSIZE /* small file */
+ || exact)) /* or debugging */
+ return stb->st_size; /* use file size */
+
return DEFBLKSIZE;
}
@@ -106,3 +160,81 @@ int c;
return (c == '/');
}
+/* os_close_on_exec --- set close on exec flag, print warning if fails */
+
+void
+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: (fcntl: %s)"),
+ what, dir, name, strerror(errno));
+}
+
+/* os_isdir --- is this an fd on a directory? */
+
+#if ! defined(S_ISDIR) && defined(S_IFDIR)
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#endif
+
+int
+os_isdir(fd)
+int fd;
+{
+ struct stat sbuf;
+
+ return (fstat(fd, &sbuf) == 0 && S_ISDIR(sbuf.st_mode));
+}
+
+/* os_is_setuid --- true if running setuid root */
+
+int
+os_is_setuid()
+{
+ long uid, euid;
+
+ uid = getuid();
+ euid = geteuid();
+
+ return (euid == 0 && euid != uid);
+}
+
+/* os_setbinmode --- set binary mode on file */
+
+int
+os_setbinmode (fd, mode)
+int fd, mode;
+{
+ return 0;
+}
+
+/* os_restore_mode --- restore the original mode of the console device */
+
+void
+os_restore_mode (fd)
+int fd;
+{
+ /* no-op */
+ return;
+}
+
+#ifdef __CYGWIN__
+#include <sys/cygwin.h>
+
+extern int _fmode;
+void
+cygwin_premain0 (int argc, char **argv, struct per_process *myself)
+{
+ static struct __cygwin_perfile pf[] =
+ {
+ {"", O_RDONLY | O_TEXT},
+ /*{"", O_WRONLY | O_BINARY},*/
+ {NULL, 0}
+ };
+ cygwin_internal (CW_PERFILE, pf);
+}
+#endif
diff --git a/gnu/dist/gawk/profile.c b/gnu/dist/gawk/profile.c
new file mode 100644
index 00000000000..3d1e0c8fae2
--- /dev/null
+++ b/gnu/dist/gawk/profile.c
@@ -0,0 +1,1471 @@
+/* $NetBSD: profile.c,v 1.1.1.1 2003/10/06 15:46:56 wiz Exp $ */
+
+/*
+ * profile.c - gawk parse tree pretty-printer with counts
+ */
+
+/*
+ * Copyright (C) 1999-2003 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"
+
+/* where to place redirections for getline, print, printf */
+enum redir_placement {
+ BEFORE = 0,
+ AFTER = 1
+};
+
+#undef tree_eval
+static void tree_eval P((NODE *tree));
+static void parenthesize P((NODETYPE parent_type, NODE *tree));
+static void eval_condition P((NODE *tree));
+static void pp_op_assign P((NODE *tree));
+static void pp_func_call P((NODE *tree));
+static void pp_match_op P((NODE *tree));
+static void pp_lhs P((NODE *ptr));
+static void pp_print_stmt P((const char *command, NODE *tree));
+static void pp_delete P((NODE *tree));
+static void pp_in_array P((NODE *array, NODE *subscript));
+static void pp_getline P((NODE *tree));
+static void pp_builtin P((NODE *tree));
+static void pp_list P((NODE *tree));
+static void pp_string P((const char *str, size_t len, int delim));
+static int is_scalar P((NODETYPE type));
+static int prec_level P((NODETYPE type));
+#ifdef PROFILING
+static RETSIGTYPE dump_and_exit P((int signum)) ATTRIBUTE_NORETURN;
+static RETSIGTYPE just_dump P((int signum));
+#endif
+
+/* pretty printing related functions and variables */
+
+static char **fparms; /* function parameter names */
+static FILE *prof_fp; /* where to send the profile */
+
+static long indent_level = 0;
+
+static int in_BEGIN_or_END = FALSE;
+
+static int in_expr = FALSE;
+
+#define SPACEOVER 0
+
+/* init_profiling --- do needed initializations, see also main.c */
+
+void
+init_profiling(int *flag ATTRIBUTE_UNUSED, const char *def_file ATTRIBUTE_UNUSED)
+{
+#ifdef PROFILING
+ if (*flag == FALSE) {
+ *flag = TRUE;
+ set_prof_file(def_file);
+ }
+#endif
+}
+
+/* set_prof_file --- set the output file for profiling */
+
+void
+set_prof_file(const char *file)
+{
+ assert(file != NULL);
+
+ prof_fp = fopen(file, "w");
+ if (prof_fp == NULL) {
+ warning(_("could not open `%s' for writing: %s"),
+ file, strerror(errno));
+ warning(_("sending profile to standard error"));
+ prof_fp = stderr;
+ }
+}
+
+/* init_profiling_signals --- set up signal handling for pgawk */
+
+void
+init_profiling_signals()
+{
+#ifdef PROFILING
+#ifdef __DJGPP__
+ signal(SIGINT, dump_and_exit);
+ signal(SIGQUIT, just_dump);
+#else /* !__DJGPP__ */
+#ifdef SIGHUP
+ signal(SIGHUP, dump_and_exit);
+#endif
+#ifdef SIGUSR1
+ signal(SIGUSR1, just_dump);
+#endif
+#endif /* !__DJGPP__ */
+#endif /* PROFILING */
+}
+
+/* indent --- print out enough tabs */
+
+static void
+indent(long count)
+{
+ int i;
+
+ if (count == 0)
+ putc('\t', prof_fp);
+ else
+ fprintf(prof_fp, "%6ld ", count);
+
+ assert(indent_level >= 0);
+ for (i = 0; i < indent_level; i++)
+ putc('\t', prof_fp);
+}
+
+/* indent_in --- increase the level, with error checking */
+
+static void
+indent_in(void)
+{
+ assert(indent_level >= 0);
+ indent_level++;
+}
+
+/* indent_out --- decrease the level, with error checking */
+
+static void
+indent_out(void)
+{
+ indent_level--;
+ assert(indent_level >= 0);
+}
+
+/*
+ * pprint:
+ * Tree is a bunch of rules to run. Returns zero if it hit an exit()
+ * statement
+ */
+static void
+pprint(register NODE *volatile tree)
+{
+ register NODE *volatile t = NULL; /* temporary */
+ int volatile traverse = TRUE; /* True => loop thru tree (Node_rule_list) */
+
+ /* avoid false source indications */
+ source = NULL;
+ sourceline = 0;
+
+ if (tree == NULL)
+ return;
+ sourceline = tree->source_line;
+ source = tree->source_file;
+ switch (tree->type) {
+ case Node_rule_node:
+ traverse = FALSE; /* False => one for-loop iteration only */
+ /* FALL THROUGH */
+ case Node_rule_list:
+ for (t = tree; t != NULL; t = t->rnode) {
+ if (traverse)
+ tree = t->lnode;
+ sourceline = tree->source_line;
+ source = tree->source_file;
+
+ if (! in_BEGIN_or_END)
+ indent(tree->exec_count);
+
+ if (tree->lnode) {
+ eval_condition(tree->lnode);
+ if (tree->rnode)
+ fprintf(prof_fp, "\t");
+ }
+
+ if (tree->rnode) {
+ if (! in_BEGIN_or_END) {
+ fprintf(prof_fp, "{");
+ if (tree->lnode != NULL
+ && tree->lnode->exec_count)
+ fprintf(prof_fp, " # %ld",
+ tree->lnode->exec_count);
+ fprintf(prof_fp, "\n");
+ }
+ indent_in();
+ pprint(tree->rnode);
+ indent_out();
+ if (! in_BEGIN_or_END) {
+ indent(SPACEOVER);
+ fprintf(prof_fp, "}\n");
+ }
+ }
+
+ if (! traverse) /* case Node_rule_node */
+ break; /* don't loop */
+
+ if (t->rnode && ! in_BEGIN_or_END)
+ fprintf(prof_fp, "\n");
+ }
+ break;
+
+ case Node_statement_list:
+ for (t = tree; t != NULL; t = t->rnode) {
+ pprint(t->lnode);
+ }
+ break;
+
+ case Node_K_if:
+ indent(tree->exec_count);
+ fprintf(prof_fp, "if (");
+ in_expr++;
+ eval_condition(tree->lnode);
+ in_expr--;
+ fprintf(prof_fp, ") {");
+#ifdef PROFILING
+ if (tree->rnode->exec_count)
+ fprintf(prof_fp, " # %ld", tree->rnode->exec_count);
+#endif
+ fprintf(prof_fp, "\n");
+ indent_in();
+ pprint(tree->rnode->lnode);
+ indent_out();
+ if (tree->rnode->rnode != NULL) {
+ if (tree->exec_count - tree->rnode->exec_count > 0)
+ indent(tree->exec_count - tree->rnode->exec_count);
+ else
+ indent(0);
+ fprintf(prof_fp, "} else {\n");
+ indent_in();
+ pprint(tree->rnode->rnode);
+ indent_out();
+ }
+ indent(SPACEOVER);
+ fprintf(prof_fp, "}\n");
+ break;
+
+ case Node_K_switch:
+ indent(tree->exec_count);
+ fprintf(prof_fp, "switch (");
+ in_expr++;
+ pprint(tree->lnode);
+ in_expr--;
+ fprintf(prof_fp, ") {\n");
+ pprint(tree->rnode);
+ indent(SPACEOVER);
+ fprintf(prof_fp, "}\n");
+ break;
+
+ case Node_switch_body:
+ case Node_case_list:
+ pprint(tree->lnode);
+ pprint(tree->rnode);
+ break;
+
+ case Node_K_case:
+ indent(tree->exec_count);
+ fprintf(prof_fp, "case ");
+ in_expr++;
+ pprint(tree->lnode);
+ in_expr--;
+ fprintf(prof_fp, ":\n");
+ indent_in();
+ pprint(tree->rnode);
+ indent_out();
+ break;
+
+ case Node_K_default:
+ indent(tree->exec_count);
+ fprintf(prof_fp, "default:\n");
+ indent_in();
+ pprint(tree->rnode);
+ indent_out();
+ break;
+
+ case Node_K_while:
+ indent(tree->exec_count);
+ fprintf(prof_fp, "while (");
+ in_expr++;
+ eval_condition(tree->lnode);
+ in_expr--;
+ fprintf(prof_fp, ") {\n");
+ indent_in();
+ pprint(tree->rnode);
+ indent_out();
+ indent(SPACEOVER);
+ fprintf(prof_fp, "}\n");
+ break;
+
+ case Node_K_do:
+ indent(tree->exec_count);
+ fprintf(prof_fp, "do {\n");
+ indent_in();
+ pprint(tree->rnode);
+ indent_out();
+ indent(SPACEOVER);
+ fprintf(prof_fp, "} while (");
+ in_expr++;
+ eval_condition(tree->lnode);
+ in_expr--;
+ fprintf(prof_fp, ")\n");
+ break;
+
+ case Node_K_for:
+ indent(tree->exec_count);
+ fprintf(prof_fp, "for (");
+ in_expr++;
+ pprint(tree->forloop->init);
+ fprintf(prof_fp, "; ");
+ eval_condition(tree->forloop->cond);
+ fprintf(prof_fp, "; ");
+ pprint(tree->forloop->incr);
+ fprintf(prof_fp, ") {\n");
+ in_expr--;
+ indent_in();
+ pprint(tree->lnode);
+ indent_out();
+ indent(SPACEOVER);
+ fprintf(prof_fp, "}\n");
+ break;
+
+ case Node_K_arrayfor:
+#define hakvar forloop->init
+#define arrvar forloop->incr
+ indent(tree->exec_count);
+ fprintf(prof_fp, "for (");
+ in_expr++;
+ pp_lhs(tree->hakvar);
+ in_expr--;
+ fprintf(prof_fp, " in ");
+ t = tree->arrvar;
+ if (t->type == Node_param_list)
+ fprintf(prof_fp, "%s", fparms[t->param_cnt]);
+ else
+ fprintf(prof_fp, "%s", t->vname);
+ fprintf(prof_fp, ") {\n");
+ indent_in();
+ pprint(tree->lnode);
+ indent_out();
+ indent(SPACEOVER);
+ fprintf(prof_fp, "}\n");
+ break;
+#undef hakvar
+#undef arrvar
+
+ case Node_K_break:
+ indent(tree->exec_count);
+ fprintf(prof_fp, "break\n");
+ break;
+
+ case Node_K_continue:
+ indent(tree->exec_count);
+ fprintf(prof_fp, "continue\n");
+ break;
+
+ case Node_K_print:
+ case Node_K_print_rec:
+ pp_print_stmt("print", tree);
+ break;
+
+ case Node_K_printf:
+ pp_print_stmt("printf", tree);
+ break;
+
+ case Node_K_delete:
+ pp_delete(tree);
+ break;
+
+ case Node_K_next:
+ indent(tree->exec_count);
+ fprintf(prof_fp, "next\n");
+ break;
+
+ case Node_K_nextfile:
+ indent(tree->exec_count);
+ fprintf(prof_fp, "nextfile\n");
+ break;
+
+ case Node_K_exit:
+ indent(tree->exec_count);
+ fprintf(prof_fp, "exit");
+ if (tree->lnode != NULL) {
+ fprintf(prof_fp, " ");
+ tree_eval(tree->lnode);
+ }
+ fprintf(prof_fp, "\n");
+ break;
+
+ case Node_K_return:
+ indent(tree->exec_count);
+ fprintf(prof_fp, "return");
+ if (tree->lnode != NULL) {
+ fprintf(prof_fp, " ");
+ tree_eval(tree->lnode);
+ }
+ fprintf(prof_fp, "\n");
+ break;
+
+ default:
+ /*
+ * Appears to be an expression statement.
+ * Throw away the value.
+ */
+ if (in_expr)
+ tree_eval(tree);
+ else {
+ indent(tree->exec_count);
+ tree_eval(tree);
+ fprintf(prof_fp, "\n");
+ }
+ break;
+ }
+}
+
+/* tree_eval --- evaluate a subtree */
+
+static void
+tree_eval(register NODE *tree)
+{
+ if (tree == NULL)
+ return;
+
+ switch (tree->type) {
+ case Node_param_list:
+ fprintf(prof_fp, "%s", fparms[tree->param_cnt]);
+ return;
+
+ case Node_var_new:
+ case Node_var:
+ case Node_var_array:
+ if (tree->vname != NULL)
+ fprintf(prof_fp, "%s", tree->vname);
+ else
+ fatal(_("internal error: %s with null vname"),
+ nodetype2str(tree->type));
+ return;
+
+ case Node_val:
+ if ((tree->flags & NUMBER) != 0)
+ fprintf(prof_fp, "%g", tree->numbr);
+ else {
+ if ((tree->flags & INTLSTR) != 0)
+ fprintf(prof_fp, "_");
+ pp_string(tree->stptr, tree->stlen, '"');
+ }
+ return;
+
+ case Node_and:
+ eval_condition(tree->lnode);
+ fprintf(prof_fp, " && ");
+ eval_condition(tree->rnode);
+ return;
+
+ case Node_or:
+ eval_condition(tree->lnode);
+ fprintf(prof_fp, " || ");
+ eval_condition(tree->rnode);
+ return;
+
+ case Node_not:
+ parenthesize(tree->type, tree->lnode);
+ return;
+
+ /* Builtins */
+ case Node_builtin:
+ pp_builtin(tree);
+ return;
+
+ case Node_in_array:
+ in_expr++;
+ pp_in_array(tree->lnode, tree->rnode);
+ in_expr--;
+ return;
+
+ case Node_func_call:
+ pp_func_call(tree);
+ return;
+
+ case Node_K_getline:
+ pp_getline(tree);
+ return;
+
+ case Node_K_delete_loop:
+ {
+ char *aname;
+ NODE *t;
+
+ t = tree->lnode;
+ if (t->type == Node_param_list)
+ aname = fparms[t->param_cnt];
+ else
+ aname = t->vname;
+
+ fprintf(prof_fp, "for (");
+ pp_lhs(tree->rnode->lnode);
+ fprintf(prof_fp, " in %s) { %s %s'\n", aname,
+ _("# treated internally as `delete'"), aname);
+ indent_in();
+ indent(SPACEOVER);
+ fprintf(prof_fp, "delete %s[", aname);
+ pp_lhs(tree->rnode->lnode);
+ fprintf(prof_fp, "]\n");
+ indent_out();
+ indent(SPACEOVER);
+ fprintf(prof_fp, "}");
+ }
+ return;
+
+ /* unary operations */
+ case Node_NR:
+ fprintf(prof_fp, "NR");
+ return;
+
+ case Node_FNR:
+ fprintf(prof_fp, "FNR");
+ return;
+
+ case Node_NF:
+ fprintf(prof_fp, "NF");
+ return;
+
+ case Node_FIELDWIDTHS:
+ fprintf(prof_fp, "FIELDWIDTHS");
+ return;
+
+ case Node_FS:
+ fprintf(prof_fp, "FS");
+ return;
+
+ case Node_RS:
+ fprintf(prof_fp, "RS");
+ return;
+
+ case Node_IGNORECASE:
+ fprintf(prof_fp, "IGNORECASE");
+ return;
+
+ case Node_OFS:
+ fprintf(prof_fp, "OFS");
+ return;
+
+ case Node_ORS:
+ fprintf(prof_fp, "ORS");
+ return;
+
+ case Node_OFMT:
+ fprintf(prof_fp, "OFMT");
+ return;
+
+ case Node_CONVFMT:
+ fprintf(prof_fp, "CONVFMT");
+ return;
+
+ case Node_BINMODE:
+ fprintf(prof_fp, "BINMODE");
+ return;
+
+ case Node_TEXTDOMAIN:
+ fprintf(prof_fp, "TEXTDOMAIN");
+ return;
+
+ case Node_field_spec:
+ case Node_subscript:
+ pp_lhs(tree);
+ return;
+
+ case Node_unary_minus:
+ fprintf(prof_fp, " -");
+ if (is_scalar(tree->subnode->type))
+ tree_eval(tree->subnode);
+ else {
+ fprintf(prof_fp, "(");
+ tree_eval(tree->subnode);
+ fprintf(prof_fp, ")");
+ }
+ return;
+
+ case Node_cond_exp:
+ eval_condition(tree->lnode);
+ fprintf(prof_fp, " ? ");
+ tree_eval(tree->rnode->lnode);
+ fprintf(prof_fp, " : ");
+ tree_eval(tree->rnode->rnode);
+ return;
+
+ case Node_match:
+ case Node_nomatch:
+ case Node_regex:
+ case Node_dynregex:
+ pp_match_op(tree);
+ return;
+
+ /* assignments */
+ case Node_assign:
+ tree_eval(tree->lnode);
+ fprintf(prof_fp, " = ");
+ tree_eval(tree->rnode);
+ return;
+
+ case Node_concat:
+ fprintf(prof_fp, "(");
+ tree_eval(tree->lnode);
+ fprintf(prof_fp, " ");
+ tree_eval(tree->rnode);
+ fprintf(prof_fp, ")");
+ return;
+
+ /* other assignment types are easier because they are numeric */
+ case Node_preincrement:
+ case Node_predecrement:
+ case Node_postincrement:
+ case Node_postdecrement:
+ case Node_assign_exp:
+ case Node_assign_times:
+ case Node_assign_quotient:
+ case Node_assign_mod:
+ case Node_assign_plus:
+ case Node_assign_minus:
+ pp_op_assign(tree);
+ return;
+
+ default:
+ break; /* handled below */
+ }
+
+ /* handle binary ops */
+ in_expr++;
+ parenthesize(tree->type, tree->lnode);
+
+ switch (tree->type) {
+ case Node_geq:
+ fprintf(prof_fp, " >= ");
+ break;
+ case Node_leq:
+ fprintf(prof_fp, " <= ");
+ break;
+ case Node_greater:
+ fprintf(prof_fp, " > ");
+ break;
+ case Node_less:
+ fprintf(prof_fp, " < ");
+ break;
+ case Node_notequal:
+ fprintf(prof_fp, " != ");
+ break;
+ case Node_equal:
+ fprintf(prof_fp, " == ");
+ break;
+ case Node_exp:
+ fprintf(prof_fp, " ^ ");
+ break;
+ case Node_times:
+ fprintf(prof_fp, " * ");
+ break;
+ case Node_quotient:
+ fprintf(prof_fp, " / ");
+ break;
+ case Node_mod:
+ fprintf(prof_fp, " %% ");
+ break;
+ case Node_plus:
+ fprintf(prof_fp, " + ");
+ break;
+ case Node_minus:
+ fprintf(prof_fp, " - ");
+ break;
+ default:
+ fatal(_("illegal type (%s) in tree_eval"), nodetype2str(tree->type));
+ }
+ parenthesize(tree->type, tree->rnode);
+ in_expr--;
+
+ return;
+}
+
+/* eval_condition --- is TREE true or false */
+
+static void
+eval_condition(register NODE *tree)
+{
+ if (tree == NULL) /* Null trees are the easiest kinds */
+ return;
+
+ if (tree->type == Node_line_range) {
+ /* /.../, /.../ */
+ eval_condition(tree->condpair->lnode);
+ fprintf(prof_fp,", ");
+ eval_condition(tree->condpair->rnode);
+ return;
+ }
+
+ /*
+ * Could just be J.random expression. in which case, null and 0 are
+ * false, anything else is true
+ */
+
+ tree_eval(tree);
+ return;
+}
+
+/* pp_op_assign --- do +=, -=, etc. */
+
+static void
+pp_op_assign(register NODE *tree)
+{
+ const char *op = NULL;
+ enum Order {
+ NA = 0,
+ PRE = 1,
+ POST = 2
+ } order = NA;
+
+ switch(tree->type) {
+ case Node_preincrement:
+ op = "++";
+ order = PRE;
+ break;
+
+ case Node_predecrement:
+ op = "--";
+ order = PRE;
+ break;
+
+ case Node_postincrement:
+ op = "++";
+ order = POST;
+ break;
+
+ case Node_postdecrement:
+ op = "--";
+ order = POST;
+ break;
+
+ default:
+ break; /* handled below */
+ }
+
+ if (order == PRE) {
+ fprintf(prof_fp, "%s", op);
+ pp_lhs(tree->lnode);
+ return;
+ } else if (order == POST) {
+ pp_lhs(tree->lnode);
+ fprintf(prof_fp, "%s", op);
+ return;
+ }
+
+ /* a binary op */
+ pp_lhs(tree->lnode);
+
+ switch(tree->type) {
+ case Node_assign_exp:
+ fprintf(prof_fp, " ^= ");
+ break;
+
+ case Node_assign_times:
+ fprintf(prof_fp, " *= ");
+ break;
+
+ case Node_assign_quotient:
+ fprintf(prof_fp, " /= ");
+ break;
+
+ case Node_assign_mod:
+ fprintf(prof_fp, " %%= ");
+ break;
+
+ case Node_assign_plus:
+ fprintf(prof_fp, " += ");
+ break;
+
+ case Node_assign_minus:
+ fprintf(prof_fp, " -= ");
+ break;
+
+ default:
+ cant_happen();
+ }
+
+ tree_eval(tree->rnode);
+}
+
+/* pp_lhs --- print the lhs */
+
+static void
+pp_lhs(register NODE *ptr)
+{
+ register NODE *n;
+
+ switch (ptr->type) {
+ case Node_var_array:
+ fatal(_("attempt to use array `%s' in a scalar context"),
+ ptr->vname);
+
+ case Node_var_new:
+ case Node_var:
+ fprintf(prof_fp, "%s", ptr->vname);
+ break;
+
+ case Node_FIELDWIDTHS:
+ fprintf(prof_fp, "FIELDWIDTHS");
+ break;
+
+ case Node_RS:
+ fprintf(prof_fp, "RS");
+ break;
+
+ case Node_FS:
+ fprintf(prof_fp, "FS");
+ break;
+
+ case Node_FNR:
+ fprintf(prof_fp, "FNR");
+ break;
+
+ case Node_NR:
+ fprintf(prof_fp, "NR");
+ break;
+
+ case Node_NF:
+ fprintf(prof_fp, "NF");
+ break;
+
+ case Node_IGNORECASE:
+ fprintf(prof_fp, "IGNORECASE");
+ break;
+
+ case Node_BINMODE:
+ fprintf(prof_fp, "BINMODE");
+ break;
+
+ case Node_LINT:
+ fprintf(prof_fp, "LINT");
+ break;
+
+ case Node_OFMT:
+ fprintf(prof_fp, "OFMT");
+ break;
+
+ case Node_CONVFMT:
+ fprintf(prof_fp, "CONVFMT");
+ break;
+
+ case Node_ORS:
+ fprintf(prof_fp, "ORS");
+ break;
+
+ case Node_OFS:
+ 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;
+
+ case Node_field_spec:
+ fprintf(prof_fp, "$");
+ if (is_scalar(ptr->lnode->type))
+ tree_eval(ptr->lnode);
+ else {
+ fprintf(prof_fp, "(");
+ tree_eval(ptr->lnode);
+ fprintf(prof_fp, ")");
+ }
+ break;
+
+ case Node_subscript:
+ n = ptr->lnode;
+ if (n->type == Node_param_list) {
+ fprintf(prof_fp, "%s[", fparms[n->param_cnt]);
+ } else
+ fprintf(prof_fp, "%s[", n->vname);
+ if (ptr->rnode->type == Node_expression_list)
+ pp_list(ptr->rnode);
+ else
+ tree_eval(ptr->rnode);
+ fprintf(prof_fp, "]");
+ break;
+
+ case Node_builtin:
+ fatal(_("assignment is not allowed to result of builtin function"));
+
+ default:
+ cant_happen();
+ }
+}
+
+/* match_op --- do ~ and !~ */
+
+static void
+pp_match_op(register NODE *tree)
+{
+ register NODE *re;
+ const char *op;
+ const char *restr;
+ size_t relen;
+ NODE *text = NULL;
+
+ if (tree->type == Node_dynregex) {
+ tree_eval(tree->re_exp);
+ return;
+ }
+
+ if (tree->type == Node_regex) {
+ re = tree->re_exp;
+ restr = re->stptr;
+ relen = re->stlen;
+ pp_string(restr, relen, '/');
+ return;
+ }
+
+ /* at this point, have either ~ or !~ */
+
+ text = tree->lnode;
+ re = tree->rnode;
+
+ if (tree->type == Node_nomatch)
+ op = "!~";
+ else if (tree->type == Node_match)
+ op = "~";
+ else
+ op = "";
+
+ tree_eval(text);
+ fprintf(prof_fp, " %s ", op);
+ tree_eval(re);
+}
+
+/* pp_redir --- print a redirection */
+
+static void
+pp_redir(register NODE *tree, enum redir_placement dir)
+{
+ const char *op = "[BOGUS]"; /* should never be seen */
+
+ if (tree == NULL)
+ return;
+
+ switch (tree->type) {
+ case Node_redirect_output:
+ op = ">";
+ break;
+ case Node_redirect_append:
+ op = ">>";
+ break;
+ case Node_redirect_pipe:
+ op = "|";
+ break;
+ case Node_redirect_pipein:
+ op = "|";
+ break;
+ case Node_redirect_input:
+ op = "<";
+ break;
+ case Node_redirect_twoway:
+ op = "|&";
+ break;
+ default:
+ cant_happen();
+ }
+
+ if (dir == BEFORE) {
+ if (! is_scalar(tree->subnode->type)) {
+ fprintf(prof_fp, "(");
+ tree_eval(tree->subnode);
+ fprintf(prof_fp, ")");
+ } else
+ tree_eval(tree->subnode);
+ fprintf(prof_fp, " %s ", op);
+ } else {
+ fprintf(prof_fp, " %s ", op);
+ if (! is_scalar(tree->subnode->type)) {
+ fprintf(prof_fp, "(");
+ tree_eval(tree->subnode);
+ fprintf(prof_fp, ")");
+ } else
+ tree_eval(tree->subnode);
+ }
+}
+
+/* pp_list --- dump a list of arguments, without parens */
+
+static void
+pp_list(register NODE *tree)
+{
+ for (; tree != NULL; tree = tree->rnode) {
+ if (tree->type != Node_expression_list) {
+ fprintf(stderr, "pp_list: got %s\n",
+ nodetype2str(tree->type));
+ fflush(stderr);
+ }
+ assert(tree->type == Node_expression_list);
+ tree_eval(tree->lnode);
+ if (tree->rnode != NULL)
+ fprintf(prof_fp, ", ");
+ }
+}
+
+/* pp_print_stmt --- print a "print" or "printf" statement */
+
+static void
+pp_print_stmt(const char *command, register NODE *tree)
+{
+ NODE *redir = tree->rnode;
+
+ indent(tree->exec_count);
+ fprintf(prof_fp, "%s", command);
+ if (redir != NULL) {
+ if (tree->lnode != NULL) {
+ /* parenthesize if have a redirection and a list */
+ fprintf(prof_fp, "(");
+ pp_list(tree->lnode);
+ fprintf(prof_fp, ")");
+ } else
+ fprintf(prof_fp, " $0");
+ pp_redir(redir, AFTER);
+ } else {
+ fprintf(prof_fp, " ");
+ if (tree->lnode != NULL)
+ pp_list(tree->lnode);
+ else
+ fprintf(prof_fp, "$0");
+ }
+ fprintf(prof_fp, "\n");
+}
+
+/* pp_delete --- print a "delete" statement */
+
+static void
+pp_delete(register NODE *tree)
+{
+ NODE *array, *subscript;
+
+ array = tree->lnode;
+ subscript = tree->rnode;
+ indent(array->exec_count);
+ if (array->type == Node_param_list)
+ fprintf(prof_fp, "delete %s", fparms[array->param_cnt]);
+ else
+ fprintf(prof_fp, "delete %s", array->vname);
+ if (subscript != NULL) {
+ fprintf(prof_fp, "[");
+ pp_list(subscript);
+ fprintf(prof_fp, "]");
+ }
+ fprintf(prof_fp, "\n");
+}
+
+/* pp_in_array --- pretty print "foo in array" test */
+
+static void
+pp_in_array(NODE *array, NODE *subscript)
+{
+ if (subscript->type == Node_expression_list) {
+ fprintf(prof_fp, "(");
+ pp_list(subscript);
+ fprintf(prof_fp, ")");
+ } else
+ pprint(subscript);
+
+ if (array->type == Node_param_list)
+ fprintf(prof_fp, " in %s", fparms[array->param_cnt]);
+ else
+ fprintf(prof_fp, " in %s", array->vname);
+}
+
+/* pp_getline --- print a getline statement */
+
+static void
+pp_getline(register NODE *tree)
+{
+ NODE *redir = tree->rnode;
+ int before, after;
+
+ /*
+ * command | getline
+ * or
+ * command |& getline
+ * or
+ * getline < file
+ */
+ if (redir != NULL) {
+ before = (redir->type == Node_redirect_pipein
+ || redir->type == Node_redirect_twoway);
+ after = ! before;
+ } else
+ before = after = FALSE;
+
+ if (before)
+ pp_redir(redir, BEFORE);
+
+ fprintf(prof_fp, "getline");
+ if (tree->lnode != NULL) { /* optional var */
+ fprintf(prof_fp, " ");
+ pp_lhs(tree->lnode);
+ }
+
+ if (after)
+ pp_redir(redir, AFTER);
+}
+
+/* pp_builtin --- print a builtin function */
+
+static void
+pp_builtin(register NODE *tree)
+{
+ const char *func = getfname(tree->builtin);
+
+ fprintf(prof_fp, "%s(", func ? func : "extension_function");
+ if (func)
+ pp_list(tree->subnode);
+ fprintf(prof_fp, ")");
+}
+
+/* pp_func_call --- print a function call */
+
+static void
+pp_func_call(NODE *tree)
+{
+ NODE *name, *arglist;
+
+ name = tree->rnode;
+ arglist = tree->lnode;
+ fprintf(prof_fp, "%s(", name->stptr);
+ pp_list(arglist);
+ fprintf(prof_fp, ")");
+}
+
+/* dump_prog --- dump the program */
+
+/*
+ * XXX: I am not sure it is right to have the strings in the dump
+ * be translated, but I'll leave it alone for now.
+ */
+
+void
+dump_prog(NODE *begin, NODE *prog, NODE *end)
+{
+ time_t now;
+
+ (void) time(& now);
+ /* \n on purpose, with \n in ctime() output */
+ fprintf(prof_fp, _("\t# gawk profile, created %s\n"), ctime(& now));
+
+ if (begin != NULL) {
+ fprintf(prof_fp, _("\t# BEGIN block(s)\n\n"));
+ fprintf(prof_fp, "\tBEGIN {\n");
+ in_BEGIN_or_END = TRUE;
+ pprint(begin);
+ in_BEGIN_or_END = FALSE;
+ fprintf(prof_fp, "\t}\n");
+ if (prog != NULL || end != NULL)
+ fprintf(prof_fp, "\n");
+ }
+ if (prog != NULL) {
+ fprintf(prof_fp, _("\t# Rule(s)\n\n"));
+ pprint(prog);
+ if (end != NULL)
+ fprintf(prof_fp, "\n");
+ }
+ if (end != NULL) {
+ fprintf(prof_fp, _("\t# END block(s)\n\n"));
+ fprintf(prof_fp, "\tEND {\n");
+ in_BEGIN_or_END = TRUE;
+ pprint(end);
+ in_BEGIN_or_END = FALSE;
+ fprintf(prof_fp, "\t}\n");
+ }
+}
+
+/* pp_func --- pretty print a function */
+
+void
+pp_func(const char *name, size_t namelen, NODE *f)
+{
+ int j;
+ char **pnames;
+ static int first = TRUE;
+
+ if (first) {
+ first = FALSE;
+ fprintf(prof_fp, _("\n\t# Functions, listed alphabetically\n"));
+ }
+
+ fprintf(prof_fp, "\n");
+ indent(f->exec_count);
+ fprintf(prof_fp, "function %.*s(", (int) namelen, name);
+ pnames = f->parmlist;
+ fparms = pnames;
+ for (j = 0; j < f->lnode->param_cnt; j++) {
+ fprintf(prof_fp, "%s", pnames[j]);
+ if (j < f->lnode->param_cnt - 1)
+ fprintf(prof_fp, ", ");
+ }
+ fprintf(prof_fp, ")\n\t{\n");
+ indent_in();
+ pprint(f->rnode); /* body */
+ indent_out();
+ fprintf(prof_fp, "\t}\n");
+}
+
+/* pp_string --- pretty print a string or regex constant */
+
+static void
+pp_string(const char *str, size_t len, int delim)
+{
+ pp_string_fp(prof_fp, str, len, delim, FALSE);
+}
+
+/* pp_string_fp --- printy print a string to the fp */
+
+/*
+ * This routine concentrates string pretty printing in one place,
+ * so that it can be called from multiple places within gawk.
+ */
+
+void
+pp_string_fp(FILE *fp, const char *in_str, size_t len, int delim, int breaklines)
+{
+ static char escapes[] = "\b\f\n\r\t\v\\";
+ static char printables[] = "bfnrtv\\";
+ char *cp;
+ int i;
+ int count;
+#define BREAKPOINT 70 /* arbitrary */
+ const unsigned char *str = (const unsigned char *) in_str;
+
+ fprintf(fp, "%c", delim);
+ for (count = 0; len > 0; len--, str++) {
+ if (++count >= BREAKPOINT && breaklines) {
+ fprintf(fp, "%c\n%c", delim, delim);
+ count = 0;
+ }
+ if (*str == delim) {
+ fprintf(fp, "\\%c", delim);
+ count++;
+ } else if (*str == BELL) {
+ fprintf(fp, "\\a");
+ count++;
+ } else if ((cp = strchr(escapes, *str)) != NULL) {
+ i = cp - escapes;
+ putc('\\', fp);
+ count++;
+ putc(printables[i], fp);
+ if (breaklines && *str == '\n' && delim == '"') {
+ fprintf(fp, "\"\n\"");
+ count = 0;
+ }
+ /* NB: Deliberate use of lower-case versions. */
+ } else if (isascii(*str) && isprint(*str)) {
+ putc(*str, fp);
+ } else {
+ char buf[10];
+
+ /* print 'em as they came if for whiny users */
+ if (whiny_users)
+ sprintf(buf, "%c", *str & 0xff);
+ else
+ sprintf(buf, "\\%03o", *str & 0xff);
+ count += strlen(buf) - 1;
+ fprintf(fp, "%s", buf);
+ }
+ }
+ fprintf(fp, "%c", delim);
+}
+
+/* is_scalar --- true or false if we'll get a scalar value */
+
+static int
+is_scalar(NODETYPE type)
+{
+ switch (type) {
+ case Node_var_new:
+ case Node_var:
+ case Node_var_array:
+ case Node_val:
+ case Node_BINMODE:
+ case Node_CONVFMT:
+ case Node_FIELDWIDTHS:
+ case Node_FNR:
+ case Node_FS:
+ case Node_IGNORECASE:
+ case Node_LINT:
+ case Node_NF:
+ case Node_NR:
+ case Node_OFMT:
+ case Node_OFS:
+ case Node_ORS:
+ case Node_RS:
+ case Node_TEXTDOMAIN:
+ case Node_subscript:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+/* prec_level --- return the precedence of an operator, for paren tests */
+
+static int
+prec_level(NODETYPE type)
+{
+ switch (type) {
+ case Node_var_new:
+ case Node_var:
+ case Node_var_array:
+ 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:
+ case Node_CONVFMT:
+ case Node_FIELDWIDTHS:
+ case Node_FNR:
+ case Node_FS:
+ case Node_IGNORECASE:
+ case Node_LINT:
+ case Node_NF:
+ case Node_NR:
+ case Node_OFMT:
+ case Node_OFS:
+ case Node_ORS:
+ case Node_RS:
+ case Node_TEXTDOMAIN:
+ return 15;
+
+ case Node_field_spec:
+ return 14;
+
+ case Node_exp:
+ return 13;
+
+ case Node_preincrement:
+ case Node_predecrement:
+ case Node_postincrement:
+ case Node_postdecrement:
+ return 12;
+
+ case Node_unary_minus:
+ case Node_not:
+ return 11;
+
+ case Node_times:
+ case Node_quotient:
+ case Node_mod:
+ return 10;
+
+ case Node_plus:
+ case Node_minus:
+ return 9;
+
+ case Node_concat:
+ return 8;
+
+ case Node_equal:
+ case Node_notequal:
+ case Node_greater:
+ case Node_leq:
+ case Node_geq:
+ case Node_match:
+ case Node_nomatch:
+ return 7;
+
+ case Node_K_getline:
+ return 6;
+
+ case Node_less:
+ return 5;
+
+ case Node_in_array:
+ return 5;
+
+ case Node_and:
+ return 4;
+
+ case Node_or:
+ return 3;
+
+ case Node_cond_exp:
+ return 2;
+
+ case Node_assign:
+ case Node_assign_times:
+ case Node_assign_quotient:
+ case Node_assign_mod:
+ case Node_assign_plus:
+ case Node_assign_minus:
+ case Node_assign_exp:
+ return 1;
+
+ default:
+ fatal(_("unexpected type %s in prec_level"), nodetype2str(type));
+ return 0; /* keep the compiler happy */
+ }
+}
+
+/* parenthesize --- print a subtree in parentheses if need be */
+
+static void
+parenthesize(NODETYPE parent_type, NODE *tree)
+{
+ NODETYPE child_type;
+
+ if (tree == NULL)
+ return;
+
+ child_type = tree->type;
+
+ in_expr++;
+ /* first the special cases, then the general ones */
+ if (parent_type == Node_not && child_type == Node_in_array) {
+ fprintf(prof_fp, "! (");
+ pp_in_array(tree->lnode, tree->rnode);
+ fprintf(prof_fp, ")");
+ /* other special cases here, as needed */
+ } else if (prec_level(child_type) < prec_level(parent_type)) {
+ fprintf(prof_fp, "(");
+ tree_eval(tree);
+ fprintf(prof_fp, ")");
+ } else
+ tree_eval(tree);
+ in_expr--;
+}
+
+#ifdef PROFILING
+/* just_dump --- dump the profile and function stack and keep going */
+
+static RETSIGTYPE
+just_dump(int signum)
+{
+ extern NODE *begin_block, *expression_value, *end_block;
+
+ dump_prog(begin_block, expression_value, end_block);
+ dump_funcs();
+ dump_fcall_stack(prof_fp);
+ fflush(prof_fp);
+ signal(signum, just_dump); /* for OLD Unix systems ... */
+}
+
+/* dump_and_exit --- dump the profile, the function stack, and exit */
+
+static RETSIGTYPE
+dump_and_exit(int signum)
+{
+ just_dump(signum);
+ exit(1);
+}
+#endif
diff --git a/gnu/dist/gawk/profile_p.c b/gnu/dist/gawk/profile_p.c
new file mode 100644
index 00000000000..8538a9503b9
--- /dev/null
+++ b/gnu/dist/gawk/profile_p.c
@@ -0,0 +1,29 @@
+/* $NetBSD: profile_p.c,v 1.1.1.1 2003/10/06 15:46:56 wiz Exp $ */
+
+/*
+ * profile_p.c - compile profile.c with profiling turned on.
+ */
+
+/*
+ * 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
+ */
+
+#define PROFILING 1
+#include "profile.c"
diff --git a/gnu/dist/gawk/protos.h b/gnu/dist/gawk/protos.h
index 13b1f07729c..7f8aa6a794e 100644
--- a/gnu/dist/gawk/protos.h
+++ b/gnu/dist/gawk/protos.h
@@ -1,9 +1,11 @@
+/* $NetBSD: protos.h,v 1.1.1.2 2003/10/06 15:46:24 wiz Exp $ */
+
/*
* protos.h -- function prototypes for when the headers don't have them.
*/
/*
- * Copyright (C) 1991 - 96 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 +104,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/gnu/dist/gawk/random.c b/gnu/dist/gawk/random.c
index 002b22655ee..3bc310f8056 100644
--- a/gnu/dist/gawk/random.c
+++ b/gnu/dist/gawk/random.c
@@ -1,66 +1,136 @@
+/* $NetBSD: random.c,v 1.1.1.2 2003/10/06 15:46:26 wiz Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/lib/libc/stdlib/random.c,v 1.13 2000/01/27 23:06:49 jasone Exp $
*
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)random.c 5.5 (Berkeley) 7/6/88";
+static const char sccsid[] = "@(#)random.c 8.2 (Berkeley) 5/19/95";
#endif /* LIBC_SCCS and not lint */
+#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>
-#include "random.h" /* GAWK ADDITION */
+
+/* For gawk, don't this, use the decl of random() in random.h */
+#if 0
+#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:
+ *
* An improved random number generation package. In addition to the standard
* rand()/srand() like interface, this package also has a special state info
* interface. The initstate() routine is called with a seed, an array of
- * bytes, and a count of how many bytes are being passed in; this array is then
- * initialized to contain information for random number generation with that
- * much state information. Good sizes for the amount of state information are
- * 32, 64, 128, and 256 bytes. The state can be switched by calling the
- * setstate() routine with the same array as was initiallized with initstate().
- * By default, the package runs with 128 bytes of state information and
- * generates far better random numbers than a linear congruential generator.
- * If the amount of state information is less than 32 bytes, a simple linear
- * congruential R.N.G. is used.
+ * bytes, and a count of how many bytes are being passed in; this array is
+ * then initialized to contain information for random number generation with
+ * that much state information. Good sizes for the amount of state
+ * information are 32, 64, 128, and 256 bytes. The state can be switched by
+ * calling the setstate() routine with the same array as was initiallized
+ * with initstate(). By default, the package runs with 128 bytes of state
+ * information and generates far better random numbers than a linear
+ * congruential generator. If the amount of state information is less than
+ * 32 bytes, a simple linear congruential R.N.G. is used.
+ *
* Internally, the state information is treated as an array of longs; the
* zeroeth element of the array is the type of R.N.G. being used (small
* integer); the remainder of the array is the state information for the
* R.N.G. Thus, 32 bytes of state information will give 7 longs worth of
- * state information, which will allow a degree seven polynomial. (Note: the
- * zeroeth word of state information also has some other information stored
- * in it -- see setstate() for details).
+ * state information, which will allow a degree seven polynomial. (Note:
+ * the zeroeth word of state information also has some other information
+ * stored in it -- see setstate() for details).
+ *
* The random number generation technique is a linear feedback shift register
* approach, employing trinomials (since there are fewer terms to sum up that
* way). In this approach, the least significant bit of all the numbers in
- * the state table will act as a linear feedback shift register, and will have
- * period 2^deg - 1 (where deg is the degree of the polynomial being used,
- * assuming that the polynomial is irreducible and primitive). The higher
- * order bits will have longer periods, since their values are also influenced
- * by pseudo-random carries out of the lower bits. The total period of the
- * generator is approximately deg*(2**deg - 1); thus doubling the amount of
- * state information has a vast influence on the period of the generator.
- * Note: the deg*(2**deg - 1) is an approximation only good for large deg,
- * when the period of the shift register is the dominant factor. With deg
- * equal to seven, the period is actually much longer than the 7*(2**7 - 1)
- * predicted by this formula.
+ * the state table will act as a linear feedback shift register, and will
+ * have period 2^deg - 1 (where deg is the degree of the polynomial being
+ * used, assuming that the polynomial is irreducible and primitive). The
+ * higher order bits will have longer periods, since their values are also
+ * influenced by pseudo-random carries out of the lower bits. The total
+ * period of the generator is approximately deg*(2**deg - 1); thus doubling
+ * the amount of state information has a vast influence on the period of the
+ * generator. Note: the deg*(2**deg - 1) is an approximation only good for
+ * large deg, when the period of the shift register is the dominant factor.
+ * With deg equal to seven, the period is actually much longer than the
+ * 7*(2**7 - 1) predicted by this formula.
+ *
+ * Modified 28 December 1994 by Jacob S. Rosenberg.
+ * The following changes have been made:
+ * All references to the type u_int have been changed to unsigned long.
+ * All references to type int have been changed to type long. Other
+ * cleanups have been made as well. A warning for both initstate and
+ * setstate has been inserted to the effect that on Sparc platforms
+ * the 'arg_state' variable must be forced to begin on word boundaries.
+ * This can be easily done by casting a long integer array to char *.
+ * The overall logic has been left STRICTLY alone. This software was
+ * tested on both a VAX and Sun SpacsStation with exactly the same
+ * results. The new version and the original give IDENTICAL results.
+ * The new version is somewhat faster than the original. As the
+ * documentation says: "By default, the package runs with 128 bytes of
+ * state information and generates far better random numbers than a linear
+ * congruential generator. If the amount of state information is less than
+ * 32 bytes, a simple linear congruential R.N.G. is used." For a buffer of
+ * 128 bytes, this new version runs about 19 percent faster and for a 16
+ * byte buffer it is about 5 percent faster.
*/
-
-
/*
* For each of the currently supported random number generators, we have a
* break value on the amount of state information (you need at least this
@@ -68,312 +138,400 @@ static char sccsid[] = "@(#)random.c 5.5 (Berkeley) 7/6/88";
* for the polynomial (actually a trinomial) that the R.N.G. is based on, and
* the separation between the two lower order coefficients of the trinomial.
*/
-
-#define TYPE_0 0 /* linear congruential */
-#define BREAK_0 8
-#define DEG_0 0
-#define SEP_0 0
-
-#define TYPE_1 1 /* x**7 + x**3 + 1 */
-#define BREAK_1 32
-#define DEG_1 7
-#define SEP_1 3
-
-#define TYPE_2 2 /* x**15 + x + 1 */
-#define BREAK_2 64
-#define DEG_2 15
-#define SEP_2 1
-
-#define TYPE_3 3 /* x**31 + x**3 + 1 */
-#define BREAK_3 128
-#define DEG_3 31
-#define SEP_3 3
-#ifdef _CRAY
-#define DEG_3_P1 32 /* bug - do addition here */
-#define SEP_3_P1 4 /* *_3 + 1 = _3_P1 */
-#endif
-
-#define TYPE_4 4 /* x**63 + x + 1 */
-#define BREAK_4 256
-#define DEG_4 63
-#define SEP_4 1
-
+#define TYPE_0 0 /* linear congruential */
+#define BREAK_0 8
+#define DEG_0 0
+#define SEP_0 0
+
+#define TYPE_1 1 /* x**7 + x**3 + 1 */
+#define BREAK_1 32
+#define DEG_1 7
+#define SEP_1 3
+
+#define TYPE_2 2 /* x**15 + x + 1 */
+#define BREAK_2 64
+#define DEG_2 15
+#define SEP_2 1
+
+#define TYPE_3 3 /* x**31 + x**3 + 1 */
+#define BREAK_3 128
+#define DEG_3 31
+#define SEP_3 3
+
+#define TYPE_4 4 /* x**63 + x + 1 */
+#define BREAK_4 256
+#define DEG_4 63
+#define SEP_4 1
/*
- * Array versions of the above information to make code run faster -- relies
- * on fact that TYPE_i == i.
+ * Array versions of the above information to make code run faster --
+ * relies on fact that TYPE_i == i.
*/
+#define MAX_TYPES 5 /* max number of types above */
-#define MAX_TYPES 5 /* max number of types above */
-
-static int degrees[ MAX_TYPES ] = { DEG_0, DEG_1, DEG_2,
- DEG_3, DEG_4 };
-
-static int seps[ MAX_TYPES ] = { SEP_0, SEP_1, SEP_2,
- SEP_3, SEP_4 };
-
-
+static long degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 };
+static long seps [MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 };
/*
- * Initially, everything is set up as if from :
- * initstate( 1, &randtbl, 128 );
+ * Initially, everything is set up as if from:
+ *
+ * initstate(1, randtbl, 128);
+ *
* Note that this initialization takes advantage of the fact that srandom()
* advances the front and rear pointers 10*rand_deg times, and hence the
* rear pointer which starts at 0 will also end up at zero; thus the zeroeth
* element of the state information, which contains info about the current
* position of the rear pointer is just
- * MAX_TYPES*(rptr - state) + TYPE_3 == TYPE_3.
+ *
+ * MAX_TYPES * (rptr - state) + TYPE_3 == TYPE_3.
*/
-static long randtbl[ DEG_3 + 1 ] = { TYPE_3,
- 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342,
- 0xde3b81e0, 0xdf0a6fb5, 0xf103bc02, 0x48f340fb,
- 0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd,
- 0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86,
- 0xda672e2a, 0x1588ca88, 0xe369735d, 0x904f35f7,
- 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc,
- 0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b,
- 0xf5ad9d0e, 0x8999220b, 0x27fb47b9 };
+static long randtbl[DEG_3 + 1] = {
+ TYPE_3,
+#ifdef USE_WEAK_SEEDING
+/* Historic implementation compatibility */
+/* The random sequences do not vary much with the seed */
+ 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342, 0xde3b81e0, 0xdf0a6fb5,
+ 0xf103bc02, 0x48f340fb, 0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd,
+ 0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86, 0xda672e2a, 0x1588ca88,
+ 0xe369735d, 0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc,
+ 0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, 0xf5ad9d0e, 0x8999220b,
+ 0x27fb47b9,
+#else /* !USE_WEAK_SEEDING */
+ 0x991539b1, 0x16a5bce3, 0x6774a4cd, 0x3e01511e, 0x4e508aaa, 0x61048c05,
+ 0xf5500617, 0x846b7115, 0x6a19892c, 0x896a97af, 0xdb48f936, 0x14898454,
+ 0x37ffd106, 0xb58bff9c, 0x59e17104, 0xcf918a49, 0x09378c83, 0x52c7a471,
+ 0x8d293ea9, 0x1f4fc301, 0xc3db71be, 0x39b44e1c, 0xf8a44ef9, 0x4c8b80b1,
+ 0x19edc328, 0x87bf4bdd, 0xc9b240e5, 0xe9ee4b1b, 0x4382aee7, 0x535b6b41,
+ 0xf3bec5da
+#endif /* !USE_WEAK_SEEDING */
+};
/*
* fptr and rptr are two pointers into the state info, a front and a rear
- * pointer. These two pointers are always rand_sep places aparts, as they cycle
- * cyclically through the state information. (Yes, this does mean we could get
- * away with just one pointer, but the code for random() is more efficient this
- * way). The pointers are left positioned as they would be from the call
- * initstate( 1, randtbl, 128 )
+ * pointer. These two pointers are always rand_sep places aparts, as they
+ * cycle cyclically through the state information. (Yes, this does mean we
+ * could get away with just one pointer, but the code for random() is more
+ * efficient this way). The pointers are left positioned as they would be
+ * from the call
+ *
+ * initstate(1, randtbl, 128);
+ *
* (The position of the rear pointer, rptr, is really 0 (as explained above
* in the initialization of randtbl) because the state table pointer is set
* to point to randtbl[1] (as explained below).
*/
-
-#ifdef _CRAY
-static long *fptr = &randtbl[ SEP_3_P1 ];
-#else
-static long *fptr = &randtbl[ SEP_3 + 1 ];
-#endif
-static long *rptr = &randtbl[ 1 ];
-
-
+static long *fptr = &randtbl[SEP_3 + 1];
+static long *rptr = &randtbl[1];
/*
- * The following things are the pointer to the state information table,
- * the type of the current generator, the degree of the current polynomial
- * being used, and the separation between the two pointers.
- * Note that for efficiency of random(), we remember the first location of
- * the state information, not the zeroeth. Hence it is valid to access
- * state[-1], which is used to store the type of the R.N.G.
- * Also, we remember the last location, since this is more efficient than
- * indexing every time to find the address of the last element to see if
- * the front and rear pointers have wrapped.
+ * The following things are the pointer to the state information table, the
+ * type of the current generator, the degree of the current polynomial being
+ * used, and the separation between the two pointers. Note that for efficiency
+ * of random(), we remember the first location of the state information, not
+ * the zeroeth. Hence it is valid to access state[-1], which is used to
+ * store the type of the R.N.G. Also, we remember the last location, since
+ * this is more efficient than indexing every time to find the address of
+ * the last element to see if the front and rear pointers have wrapped.
*/
+static long *state = &randtbl[1];
+static long rand_type = TYPE_3;
+static long rand_deg = DEG_3;
+static long rand_sep = SEP_3;
+static long *end_ptr = &randtbl[DEG_3 + 1];
-static long *state = &randtbl[ 1 ];
-
-static int rand_type = TYPE_3;
-static int rand_deg = DEG_3;
-static int rand_sep = SEP_3;
-
-#ifdef _CRAY
-static long *end_ptr = &randtbl[ DEG_3_P1 ];
-#else
-static long *end_ptr = &randtbl[ DEG_3 + 1 ];
-#endif
-
+static long good_rand __P((long));
+static long good_rand (x)
+ register long x;
+{
+#ifdef USE_WEAK_SEEDING
+/*
+ * Historic implementation compatibility.
+ * The random sequences do not vary much with the seed,
+ * even with overflowing.
+ */
+ return (1103515245 * x + 12345);
+#else /* !USE_WEAK_SEEDING */
+/*
+ * Compute x = (7^5 * x) mod (2^31 - 1)
+ * wihout overflowing 31 bits:
+ * (2^31 - 1) = 127773 * (7^5) + 2836
+ * From "Random number generators: good ones are hard to find",
+ * Park and Miller, Communications of the ACM, vol. 31, no. 10,
+ * October 1988, p. 1195.
+ */
+ register long hi, lo;
+
+ hi = x / 127773;
+ lo = x % 127773;
+ x = 16807 * lo - 2836 * hi;
+ if (x <= 0)
+ x += 0x7fffffff;
+ return (x);
+#endif /* !USE_WEAK_SEEDING */
+}
/*
* srandom:
+ *
* Initialize the random number generator based on the given seed. If the
* type is the trivial no-state-information type, just remember the seed.
* Otherwise, initializes state[] based on the given "seed" via a linear
* congruential generator. Then, the pointers are set to known locations
* that are exactly rand_sep places apart. Lastly, it cycles the state
* information a given number of times to get rid of any initial dependencies
- * introduced by the L.C.R.N.G.
- * Note that the initialization of randtbl[] for default usage relies on
- * values produced by this routine.
+ * introduced by the L.C.R.N.G. Note that the initialization of randtbl[]
+ * for default usage relies on values produced by this routine.
*/
-
void
-srandom( x )
+srandom(x)
+ unsigned long x;
+{
+ register long i;
+
+ if (rand_type == TYPE_0)
+ state[0] = x;
+ else {
+ state[0] = x;
+ for (i = 1; i < rand_deg; i++)
+ state[i] = good_rand(state[i - 1]);
+ fptr = &state[rand_sep];
+ rptr = &state[0];
+ for (i = 0; i < 10 * rand_deg; i++)
+ (void)random();
+ }
+}
- unsigned x;
+/*
+ * srandomdev:
+ *
+ * Many programs choose the seed value in a totally predictable manner.
+ * This often causes problems. We seed the generator using the much more
+ * secure urandom(4) interface. Note that this particular seeding
+ * procedure can generate states which are impossible to reproduce by
+ * calling srandom() with any value, since the succeeding terms in the
+ * state buffer are no longer derived from the LC algorithm applied to
+ * a fixed seed.
+ */
+#if 0
+void
+srandomdev()
{
- register int i, j;
- long random();
+ int fd, done;
+ size_t len;
+
+ if (rand_type == TYPE_0)
+ len = sizeof state[0];
+ else
+ len = rand_deg * sizeof state[0];
+
+ done = 0;
+#ifdef O_RDONLY
+ fd = open("/dev/urandom", O_RDONLY, 0);
+ if (fd >= 0) {
+ if (read(fd, (void *) state, len) == (ssize_t) len)
+ done = 1;
+ close(fd);
+ }
+#endif /*O_RDONLY*/
- if( rand_type == TYPE_0 ) {
- state[ 0 ] = x;
+ if (!done) {
+ unsigned long junk;
+#if !defined (_MSC_VER) && !defined (__MINGW32__)
+ struct timeval tv;
+
+ gettimeofday(&tv, NULL);
+ srandom(getpid() ^ tv.tv_sec ^ tv.tv_usec ^ junk);
+#else
+ clock_t ret_clock_t = clock();
+ /*
+ * I don't like the idea of reading uninitialized memory
+ * even to generate a random number, but we do it anyway.
+ * SD.
+ */
+ srandom(getpid() ^ ret_clock_t ^ junk);
+#endif
+
+ return;
}
- else {
- j = 1;
- state[ 0 ] = x;
- for( i = 1; i < rand_deg; i++ ) {
- state[i] = 1103515245*state[i - 1] + 12345;
- }
- fptr = &state[ rand_sep ];
- rptr = &state[ 0 ];
- for( i = 0; i < 10*rand_deg; i++ ) random();
+
+ if (rand_type != TYPE_0) {
+ fptr = &state[rand_sep];
+ rptr = &state[0];
}
}
-
-
+#endif
/*
* initstate:
- * Initialize the state information in the given array of n bytes for
- * future random number generation. Based on the number of bytes we
- * are given, and the break values for the different R.N.G.'s, we choose
- * the best (largest) one we can and set things up for it. srandom() is
- * then called to initialize the state information.
+ *
+ * Initialize the state information in the given array of n bytes for future
+ * random number generation. Based on the number of bytes we are given, and
+ * the break values for the different R.N.G.'s, we choose the best (largest)
+ * one we can and set things up for it. srandom() is then called to
+ * initialize the state information.
+ *
* Note that on return from srandom(), we set state[-1] to be the type
* multiplexed with the current value of the rear pointer; this is so
- * successive calls to initstate() won't lose this information and will
- * be able to restart with setstate().
+ * successive calls to initstate() won't lose this information and will be
+ * able to restart with setstate().
+ *
* Note: the first thing we do is save the current state, if any, just like
* setstate() so that it doesn't matter when initstate is called.
+ *
* Returns a pointer to the old state.
+ *
+ * Note: The Sparc platform requires that arg_state begin on a long
+ * word boundary; otherwise a bus error will occur. Even so, lint will
+ * complain about mis-alignment, but you should disregard these messages.
*/
-
-char *
-initstate( seed, arg_state, n )
-
- unsigned seed; /* seed for R. N. G. */
- char *arg_state; /* pointer to state array */
- int n; /* # bytes of state info */
+char *
+initstate(seed, arg_state, n)
+ unsigned long seed; /* seed for R.N.G. */
+ char *arg_state; /* pointer to state array */
+ long n; /* # bytes of state info */
{
- register char *ostate = (char *)( &state[ -1 ] );
-
- if( rand_type == TYPE_0 ) state[ -1 ] = rand_type;
- else state[ -1 ] = MAX_TYPES*(rptr - state) + rand_type;
- if( n < BREAK_1 ) {
- if( n < BREAK_0 ) {
- fprintf( stderr, "initstate: not enough state (%d bytes) with which to do jack; ignored.\n", n );
- return 0;
- }
- rand_type = TYPE_0;
- rand_deg = DEG_0;
- rand_sep = SEP_0;
+ register char *ostate = (char *)(&state[-1]);
+ register long *long_arg_state = (long *) arg_state;
+
+ if (rand_type == TYPE_0)
+ state[-1] = rand_type;
+ else
+ state[-1] = MAX_TYPES * (rptr - state) + rand_type;
+ if (n < BREAK_0) {
+ (void)fprintf(stderr,
+ "random: not enough state (%ld bytes); ignored.\n", n);
+ return(0);
}
- else {
- if( n < BREAK_2 ) {
+ if (n < BREAK_1) {
+ rand_type = TYPE_0;
+ rand_deg = DEG_0;
+ rand_sep = SEP_0;
+ } else if (n < BREAK_2) {
rand_type = TYPE_1;
rand_deg = DEG_1;
rand_sep = SEP_1;
- }
- else {
- if( n < BREAK_3 ) {
- rand_type = TYPE_2;
- rand_deg = DEG_2;
- rand_sep = SEP_2;
- }
- else {
- if( n < BREAK_4 ) {
- rand_type = TYPE_3;
- rand_deg = DEG_3;
- rand_sep = SEP_3;
- }
- else {
- rand_type = TYPE_4;
- rand_deg = DEG_4;
- rand_sep = SEP_4;
- }
- }
- }
+ } else if (n < BREAK_3) {
+ rand_type = TYPE_2;
+ rand_deg = DEG_2;
+ rand_sep = SEP_2;
+ } else if (n < BREAK_4) {
+ rand_type = TYPE_3;
+ rand_deg = DEG_3;
+ rand_sep = SEP_3;
+ } else {
+ rand_type = TYPE_4;
+ rand_deg = DEG_4;
+ rand_sep = SEP_4;
}
- state = &( ( (long *)arg_state )[1] ); /* first location */
- end_ptr = &state[ rand_deg ]; /* must set end_ptr before srandom */
- srandom( seed );
- if( rand_type == TYPE_0 ) state[ -1 ] = rand_type;
- else state[ -1 ] = MAX_TYPES*(rptr - state) + rand_type;
- return( ostate );
+ state = (long *) (long_arg_state + 1); /* first location */
+ end_ptr = &state[rand_deg]; /* must set end_ptr before srandom */
+ srandom(seed);
+ if (rand_type == TYPE_0)
+ long_arg_state[0] = rand_type;
+ else
+ long_arg_state[0] = MAX_TYPES * (rptr - state) + rand_type;
+ return(ostate);
}
-
-
/*
* setstate:
+ *
* Restore the state from the given state array.
+ *
* Note: it is important that we also remember the locations of the pointers
* in the current state information, and restore the locations of the pointers
* from the old state information. This is done by multiplexing the pointer
* location into the zeroeth word of the state information.
+ *
* Note that due to the order in which things are done, it is OK to call
* setstate() with the same state as the current state.
+ *
* Returns a pointer to the old state information.
+ *
+ * Note: The Sparc platform requires that arg_state begin on a long
+ * word boundary; otherwise a bus error will occur. Even so, lint will
+ * complain about mis-alignment, but you should disregard these messages.
*/
-
-char *
-setstate( arg_state )
-
- char *arg_state;
+char *
+setstate(arg_state)
+ char *arg_state; /* pointer to state array */
{
- register long *new_state = (long *)arg_state;
- register int type = new_state[0]%MAX_TYPES;
- register int rear = new_state[0]/MAX_TYPES;
- char *ostate = (char *)( &state[ -1 ] );
-
- if( rand_type == TYPE_0 ) state[ -1 ] = rand_type;
- else state[ -1 ] = MAX_TYPES*(rptr - state) + rand_type;
- switch( type ) {
- case TYPE_0:
- case TYPE_1:
- case TYPE_2:
- case TYPE_3:
- case TYPE_4:
+ register long *new_state = (long *) arg_state;
+ register long type = new_state[0] % MAX_TYPES;
+ register long rear = new_state[0] / MAX_TYPES;
+ char *ostate = (char *)(&state[-1]);
+
+ if (rand_type == TYPE_0)
+ state[-1] = rand_type;
+ else
+ state[-1] = MAX_TYPES * (rptr - state) + rand_type;
+ switch(type) {
+ case TYPE_0:
+ case TYPE_1:
+ case TYPE_2:
+ case TYPE_3:
+ case TYPE_4:
rand_type = type;
- rand_deg = degrees[ type ];
- rand_sep = seps[ type ];
+ rand_deg = degrees[type];
+ rand_sep = seps[type];
break;
-
- default:
- fprintf( stderr, "setstate: state info has been munged; not changed.\n" );
+ default:
+ (void)fprintf(stderr,
+ "random: state info corrupted; not changed.\n");
}
- state = &new_state[ 1 ];
- if( rand_type != TYPE_0 ) {
- rptr = &state[ rear ];
- fptr = &state[ (rear + rand_sep)%rand_deg ];
+ state = (long *) (new_state + 1);
+ if (rand_type != TYPE_0) {
+ rptr = &state[rear];
+ fptr = &state[(rear + rand_sep) % rand_deg];
}
- end_ptr = &state[ rand_deg ]; /* set end_ptr too */
- return( ostate );
+ end_ptr = &state[rand_deg]; /* set end_ptr too */
+ return(ostate);
}
-
-
/*
* random:
+ *
* If we are using the trivial TYPE_0 R.N.G., just do the old linear
- * congruential bit. Otherwise, we do our fancy trinomial stuff, which is the
- * same in all ther other cases due to all the global variables that have been
- * set up. The basic operation is to add the number at the rear pointer into
- * the one at the front pointer. Then both pointers are advanced to the next
- * location cyclically in the table. The value returned is the sum generated,
- * reduced to 31 bits by throwing away the "least random" low bit.
+ * congruential bit. Otherwise, we do our fancy trinomial stuff, which is
+ * the same in all the other cases due to all the global variables that have
+ * been set up. The basic operation is to add the number at the rear pointer
+ * into the one at the front pointer. Then both pointers are advanced to
+ * the next location cyclically in the table. The value returned is the sum
+ * generated, reduced to 31 bits by throwing away the "least random" low bit.
+ *
* Note: the code takes advantage of the fact that both the front and
* rear pointers can't wrap on the same call by not testing the rear
* pointer if the front one has wrapped.
+ *
* Returns a 31-bit random number.
*/
-
long
random()
{
- long i;
+ register long i;
+ register long *f, *r;
+
+ if (rand_type == TYPE_0) {
+ i = state[0];
+ state[0] = i = (good_rand(i)) & 0x7fffffff;
+ } else {
+ /*
+ * Use local variables rather than static variables for speed.
+ */
+ f = fptr; r = rptr;
+ *f += *r;
+ i = (*f >> 1) & 0x7fffffff; /* chucking least random bit */
+ if (++f >= end_ptr) {
+ f = state;
+ ++r;
+ }
+ else if (++r >= end_ptr) {
+ r = state;
+ }
- if( rand_type == TYPE_0 ) {
- i = state[0] = ( state[0]*1103515245 + 12345 )&0x7fffffff;
- }
- else {
- *fptr += *rptr;
- i = (*fptr >> 1)&0x7fffffff; /* chucking least random bit */
- if( ++fptr >= end_ptr ) {
- fptr = state;
- ++rptr;
- }
- else {
- if( ++rptr >= end_ptr ) rptr = state;
- }
+ fptr = f; rptr = r;
}
- return( i );
+ return(i);
}
diff --git a/gnu/dist/gawk/random.h b/gnu/dist/gawk/random.h
index 7fd0ff9bbf6..48b4c6ee045 100644
--- a/gnu/dist/gawk/random.h
+++ b/gnu/dist/gawk/random.h
@@ -1,9 +1,11 @@
+/* $NetBSD: random.h,v 1.1.1.2 2003/10/06 15:46:26 wiz Exp $ */
+
/*
* random.h - redefine name of random lib routines to avoid conflicts
*/
/*
- * Copyright (C) 1996 the Free Software Foundation, Inc.
+ * Copyright (C) 1996, 2001 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -23,7 +25,20 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#define initstate gawk_initstate
#define setstate gawk_setstate
#define random gawk_random
#define srandom gawk_srandom
+
+#ifdef __STDC__
+#undef __P
+#define __P(s) s
+#else
+#define __P(s) ()
+#endif
+
+extern long random __P((void));
diff --git a/gnu/dist/gawk/re.c b/gnu/dist/gawk/re.c
index 995fbb993b4..f5615390ac1 100644
--- a/gnu/dist/gawk/re.c
+++ b/gnu/dist/gawk/re.c
@@ -1,9 +1,11 @@
+/* $NetBSD: re.c,v 1.1.1.2 2003/10/06 15:46:33 wiz Exp $ */
+
/*
* re.c - compile regular expressions.
*/
/*
- * Copyright (C) 1991-1996 the Free Software Foundation, Inc.
+ * Copyright (C) 1991-2003 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -30,19 +32,24 @@ static reg_syntax_t syn;
/* make_regexp --- generate compiled regular expressions */
Regexp *
-make_regexp(s, len, ignorecase, dfa)
-char *s;
-size_t len;
-int ignorecase;
-int dfa;
+make_regexp(const char *s, size_t len, int ignorecase)
{
Regexp *rp;
const char *rerr;
- char *src = s;
+ const char *src = s;
char *temp;
- char *end = s + len;
+ const 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 (gawk_mb_cur_max > 1)
+ memset(&mbs, 0, sizeof(mbstate_t)); /* Initialize. */
+#endif
/* Handle escaped characters first. */
@@ -55,7 +62,26 @@ int dfa;
temp = dest;
while (src < end) {
- if (*src == '\\') {
+#ifdef MBS_SUPPORT
+ if (gawk_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
+
+ if (
+#ifdef MBS_SUPPORT
+ /* We skip multibyte character, since it must not be a special
+ character. */
+ (gawk_mb_cur_max == 1 || ! is_multibyte) &&
+#endif
+ (*src == '\\')) {
c = *++src;
switch (c) {
case 'a':
@@ -82,7 +108,7 @@ int dfa;
* literally in re's, so escape regexp
* metacharacters.
*/
- if (do_traditional && ! do_posix && (isdigit(c) || c == 'x')
+ if (do_traditional && ! do_posix && (ISDIGIT(c) || c == 'x')
&& strchr("()|*+?.^$\\[]", c2) != NULL)
*dest++ = '\\';
*dest++ = (char) c2;
@@ -109,7 +135,11 @@ int dfa;
} /* switch */
} else
*dest++ = *src++; /* not '\\' */
- } /* for */
+#ifdef MBS_SUPPORT
+ if (gawk_mb_cur_max > 1 && is_multibyte)
+ is_multibyte--;
+#endif
+ } /* while */
*dest = '\0' ; /* Only necessary if we print dest ? */
emalloc(rp, Regexp *, sizeof(*rp), "make_regexp");
@@ -123,61 +153,50 @@ int dfa;
rp->pat.translate = NULL;
len = dest - temp;
if ((rerr = re_compile_pattern(temp, len, &(rp->pat))) != NULL)
- fatal("%s: /%s/", rerr, temp);
+ fatal("%s: /%s/", rerr, temp); /* rerr already gettextized inside regex routines */
/* gack. this must be done *after* re_compile_pattern */
rp->pat.newline_anchor = FALSE; /* don't get \n in middle of string */
- if (dfa && ! ignorecase) {
- dfacomp(temp, len, &(rp->dfareg), TRUE);
- rp->dfa = TRUE;
- } else
- rp->dfa = FALSE;
free(temp);
return rp;
}
-/* research --- do a regexp search. use dfa if possible */
+/* research --- do a regexp search */
int
-research(rp, str, start, len, need_start)
-Regexp *rp;
-register char *str;
-int start;
-register size_t len;
-int need_start;
+research(Regexp *rp, register const char *str, int start,
+ register size_t len, int need_start)
{
- char *ret = str;
- int try_backref;
+ const char *ret = str;
- /*
- * Always do dfa search if can; if it fails, then even if
- * need_start is true, we won't bother with the regex search.
- */
- if (rp->dfa) {
- char save;
- int count = 0;
+ if (ret) {
+ /*
+ * Passing NULL as last arg speeds up search for cases
+ * where we don't need the start/end info.
+ */
+ int res = re_search(&(rp->pat), str, start+len,
+ start, len, need_start ? &(rp->regs) : NULL);
/*
- * dfa likes to stick a '\n' right after the matched
- * text. So we just save and restore the character.
+ * 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.
+ *
+ * XXX: The above comment is obsolete; the new regex
+ * doesn't have an re_max_failures variable. But we
+ * keep the code here just in case.
*/
- save = str[start+len];
- ret = dfaexec(&(rp->dfareg), str+start, str+start+len, TRUE,
- &count, &try_backref);
- str[start+len] = save;
- }
- if (ret) {
- if (need_start || rp->dfa == FALSE || try_backref) {
- int result = re_search(&(rp->pat), str, start+len,
- start, len, &(rp->regs));
- /* recover any space from C based alloca */
-#ifdef C_ALLOCA
- (void) alloca(0);
-#endif
- return result;
- } else
- return 1;
+ if (res == -2) {
+ /* the 10 here is arbitrary */
+ fatal(_("regex match failed, not enough memory to match string \"%.*s%s\""),
+ (int) (len > 10 ? 10 : len), str + start,
+ len > 10 ? "..." : "");
+ }
+ return res;
} else
return -1;
}
@@ -185,41 +204,36 @@ int need_start;
/* refree --- free up the dynamic memory used by a compiled regexp */
void
-refree(rp)
-Regexp *rp;
+refree(Regexp *rp)
{
- free(rp->pat.buffer);
- free(rp->pat.fastmap);
+ /*
+ * This isn't malloced, don't let regfree free it.
+ * (This is strictly necessary only for the old
+ * version of regex, but it's a good idea to keep it
+ * here in case regex internals change in the future.)
+ */
+ rp->pat.translate = NULL;
+
+ regfree(& rp->pat);
if (rp->regs.start)
free(rp->regs.start);
if (rp->regs.end)
free(rp->regs.end);
- if (rp->dfa)
- dfafree(&(rp->dfareg));
free(rp);
}
-/* dfaerror --- print an error message for the dfa routines */
-
-void
-dfaerror(s)
-const char *s;
-{
- fatal("%s", s);
-}
-
/* re_update --- recompile a dynamic regexp */
Regexp *
-re_update(t)
-NODE *t;
+re_update(NODE *t)
{
NODE *t1;
-/* # define CASE 1 */
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) {
@@ -233,17 +247,14 @@ NODE *t;
}
if (t->re_reg != NULL)
refree(t->re_reg);
- if (t->re_cnt > 0)
- t->re_cnt++;
- if (t->re_cnt > 10)
- t->re_cnt = 0;
- if (t->re_text == NULL) {
+ if (t->re_text == NULL || (t->re_flags & CASE) != IGNORECASE) {
t1 = force_string(tree_eval(t->re_exp));
+ unref(t->re_text);
t->re_text = dupnode(t1);
free_temp(t1);
}
t->re_reg = make_regexp(t->re_text->stptr, t->re_text->stlen,
- IGNORECASE, t->re_cnt);
+ IGNORECASE);
t->re_flags &= ~CASE;
t->re_flags |= IGNORECASE;
return t->re_reg;
@@ -269,42 +280,78 @@ resetup()
syn |= RE_INTERVALS;
(void) re_set_syntax(syn);
- dfasyntax(syn, FALSE);
}
-/* avoid_dfa --- FIXME: temporary kludge function until we have a new dfa.c */
+/* reisstring --- return TRUE if the RE match is a simple string match */
int
-avoid_dfa(re, str, len)
-NODE *re;
-char *str;
-size_t len;
+reisstring(const char *text, size_t len, Regexp *re, const char *buf)
{
- char *restr;
- int relen;
- int anchor, i;
- char *end;
-
- if ((re->re_flags & CONST) != 0) {
- restr = re->re_exp->stptr;
- relen = re->re_exp->stlen;
- } else {
- restr = re->re_text->stptr;
- relen = re->re_text->stlen;
- }
-
- for (anchor = FALSE, i = 0; i < relen; i++) {
- if (restr[i] == '^' || restr[i] == '$') {
- anchor = TRUE;
- break;
+ static char metas[] = ".*+(){}[]|?^$\\";
+ int i;
+ int res;
+ const char *matched;
+
+ /* simple checking for has meta characters in re */
+ for (i = 0; i < len; i++) {
+ if (strchr(metas, text[i]) != NULL) {
+ return FALSE; /* give up early, can't be string match */
}
}
- if (! anchor)
- return FALSE;
- for (end = str + len; str < end; str++)
- if (*str == '\n')
+ /* make accessable to gdb */
+ matched = &buf[RESTART(re, buf)];
+
+ res = STREQN(text, matched, len);
+
+ return res;
+}
+
+/* remaybelong --- return TRUE if the RE contains * ? | + */
+
+int
+remaybelong(const char *text, size_t len)
+{
+ while (len--) {
+ if (strchr("*+|?", *text++) != NULL) {
return TRUE;
+ }
+ }
return FALSE;
}
+
+/* reflags2str --- make a regex flags value readable */
+
+const char *
+reflags2str(int flagval)
+{
+ static const struct flagtab values[] = {
+ { RE_BACKSLASH_ESCAPE_IN_LISTS, "RE_BACKSLASH_ESCAPE_IN_LISTS" },
+ { RE_BK_PLUS_QM, "RE_BK_PLUS_QM" },
+ { RE_CHAR_CLASSES, "RE_CHAR_CLASSES" },
+ { RE_CONTEXT_INDEP_ANCHORS, "RE_CONTEXT_INDEP_ANCHORS" },
+ { RE_CONTEXT_INDEP_OPS, "RE_CONTEXT_INDEP_OPS" },
+ { RE_CONTEXT_INVALID_OPS, "RE_CONTEXT_INVALID_OPS" },
+ { RE_DOT_NEWLINE, "RE_DOT_NEWLINE" },
+ { RE_DOT_NOT_NULL, "RE_DOT_NOT_NULL" },
+ { RE_HAT_LISTS_NOT_NEWLINE, "RE_HAT_LISTS_NOT_NEWLINE" },
+ { RE_INTERVALS, "RE_INTERVALS" },
+ { RE_LIMITED_OPS, "RE_LIMITED_OPS" },
+ { RE_NEWLINE_ALT, "RE_NEWLINE_ALT" },
+ { RE_NO_BK_BRACES, "RE_NO_BK_BRACES" },
+ { RE_NO_BK_PARENS, "RE_NO_BK_PARENS" },
+ { RE_NO_BK_REFS, "RE_NO_BK_REFS" },
+ { RE_NO_BK_VBAR, "RE_NO_BK_VBAR" },
+ { RE_NO_EMPTY_RANGES, "RE_NO_EMPTY_RANGES" },
+ { RE_UNMATCHED_RIGHT_PAREN_ORD, "RE_UNMATCHED_RIGHT_PAREN_ORD" },
+ { RE_NO_POSIX_BACKTRACKING, "RE_NO_POSIX_BACKTRACKING" },
+ { RE_NO_GNU_OPS, "RE_NO_GNU_OPS" },
+ { RE_DEBUG, "RE_DEBUG" },
+ { RE_INVALID_INTERVAL_ORD, "RE_INVALID_INTERVAL_ORD" },
+ { RE_ICASE, "RE_ICASE" },
+ { 0, NULL },
+ };
+
+ return genflags2str(flagval, values);
+}
diff --git a/gnu/dist/gawk/regcomp.c b/gnu/dist/gawk/regcomp.c
new file mode 100644
index 00000000000..4eb0f375eb9
--- /dev/null
+++ b/gnu/dist/gawk/regcomp.c
@@ -0,0 +1,3561 @@
+/* $NetBSD: regcomp.c,v 1.1.1.1 2003/10/06 15:47:20 wiz Exp $ */
+
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+static reg_errcode_t re_compile_internal _RE_ARGS((regex_t *preg, const char * pattern,
+ int length, reg_syntax_t syntax));
+static void re_compile_fastmap_iter _RE_ARGS((regex_t *bufp,
+ const re_dfastate_t *init_state,
+ char *fastmap));
+static reg_errcode_t init_dfa _RE_ARGS((re_dfa_t *dfa, int pat_len));
+static reg_errcode_t init_word_char _RE_ARGS((re_dfa_t *dfa));
+#ifdef RE_ENABLE_I18N
+static void free_charset _RE_ARGS((re_charset_t *cset));
+#endif /* RE_ENABLE_I18N */
+static void free_workarea_compile _RE_ARGS((regex_t *preg));
+static reg_errcode_t create_initial_state _RE_ARGS((re_dfa_t *dfa));
+static reg_errcode_t analyze _RE_ARGS((re_dfa_t *dfa));
+static reg_errcode_t analyze_tree _RE_ARGS((re_dfa_t *dfa, bin_tree_t *node));
+static void calc_first _RE_ARGS((re_dfa_t *dfa, bin_tree_t *node));
+static void calc_next _RE_ARGS((re_dfa_t *dfa, bin_tree_t *node));
+static void calc_epsdest _RE_ARGS((re_dfa_t *dfa, bin_tree_t *node));
+static reg_errcode_t duplicate_node_closure _RE_ARGS((re_dfa_t *dfa, int top_org_node,
+ int top_clone_node, int root_node,
+ unsigned int constraint));
+static reg_errcode_t duplicate_node _RE_ARGS((int *new_idx, re_dfa_t *dfa, int org_idx,
+ unsigned int constraint));
+static int search_duplicated_node _RE_ARGS((re_dfa_t *dfa, int org_node,
+ unsigned int constraint));
+static reg_errcode_t calc_eclosure _RE_ARGS((re_dfa_t *dfa));
+static reg_errcode_t calc_eclosure_iter _RE_ARGS((re_node_set *new_set, re_dfa_t *dfa,
+ int node, int root));
+static void calc_inveclosure _RE_ARGS((re_dfa_t *dfa));
+static int fetch_number _RE_ARGS((re_string_t *input, re_token_t *token,
+ reg_syntax_t syntax));
+static re_token_t fetch_token _RE_ARGS((re_string_t *input, reg_syntax_t syntax));
+static int peek_token _RE_ARGS((re_token_t *token, re_string_t *input,
+ reg_syntax_t syntax));
+static int peek_token_bracket _RE_ARGS((re_token_t *token, re_string_t *input,
+ reg_syntax_t syntax));
+static bin_tree_t *parse _RE_ARGS((re_string_t *regexp, regex_t *preg,
+ reg_syntax_t syntax, reg_errcode_t *err));
+static bin_tree_t *parse_reg_exp _RE_ARGS((re_string_t *regexp, regex_t *preg,
+ re_token_t *token, reg_syntax_t syntax,
+ int nest, reg_errcode_t *err));
+static bin_tree_t *parse_branch _RE_ARGS((re_string_t *regexp, regex_t *preg,
+ re_token_t *token, reg_syntax_t syntax,
+ int nest, reg_errcode_t *err));
+static bin_tree_t *parse_expression _RE_ARGS((re_string_t *regexp, regex_t *preg,
+ re_token_t *token, reg_syntax_t syntax,
+ int nest, reg_errcode_t *err));
+static bin_tree_t *parse_sub_exp _RE_ARGS((re_string_t *regexp, regex_t *preg,
+ re_token_t *token, reg_syntax_t syntax,
+ int nest, reg_errcode_t *err));
+static bin_tree_t *parse_dup_op _RE_ARGS((bin_tree_t *dup_elem, re_string_t *regexp,
+ re_dfa_t *dfa, re_token_t *token,
+ reg_syntax_t syntax, reg_errcode_t *err));
+static bin_tree_t *parse_bracket_exp _RE_ARGS((re_string_t *regexp, re_dfa_t *dfa,
+ re_token_t *token, reg_syntax_t syntax,
+ reg_errcode_t *err));
+static reg_errcode_t parse_bracket_element _RE_ARGS((bracket_elem_t *elem,
+ re_string_t *regexp,
+ re_token_t *token, int token_len,
+ re_dfa_t *dfa,
+ reg_syntax_t syntax));
+static reg_errcode_t parse_bracket_symbol _RE_ARGS((bracket_elem_t *elem,
+ re_string_t *regexp,
+ re_token_t *token));
+#ifndef _LIBC
+# ifdef RE_ENABLE_I18N
+static reg_errcode_t build_range_exp _RE_ARGS((re_bitset_ptr_t sbcset,
+ re_charset_t *mbcset, int *range_alloc,
+ bracket_elem_t *start_elem,
+ bracket_elem_t *end_elem));
+static reg_errcode_t build_collating_symbol _RE_ARGS((re_bitset_ptr_t sbcset,
+ re_charset_t *mbcset,
+ int *coll_sym_alloc,
+ const unsigned char *name));
+# else /* not RE_ENABLE_I18N */
+static reg_errcode_t build_range_exp _RE_ARGS((re_bitset_ptr_t sbcset,
+ bracket_elem_t *start_elem,
+ bracket_elem_t *end_elem));
+static reg_errcode_t build_collating_symbol _RE_ARGS((re_bitset_ptr_t sbcset,
+ const unsigned char *name));
+# endif /* not RE_ENABLE_I18N */
+#endif /* not _LIBC */
+#ifdef RE_ENABLE_I18N
+static reg_errcode_t build_equiv_class _RE_ARGS((re_bitset_ptr_t sbcset,
+ re_charset_t *mbcset,
+ int *equiv_class_alloc,
+ const unsigned char *name));
+static reg_errcode_t build_charclass _RE_ARGS((RE_TRANSLATE_TYPE trans,
+ re_bitset_ptr_t sbcset,
+ re_charset_t *mbcset,
+ int *char_class_alloc,
+ const unsigned char *class_name,
+ reg_syntax_t syntax));
+#else /* not RE_ENABLE_I18N */
+static reg_errcode_t build_equiv_class _RE_ARGS((re_bitset_ptr_t sbcset,
+ const unsigned char *name));
+static reg_errcode_t build_charclass _RE_ARGS((RE_TRANSLATE_TYPE trans,
+ re_bitset_ptr_t sbcset,
+ const unsigned char *class_name,
+ reg_syntax_t syntax));
+#endif /* not RE_ENABLE_I18N */
+static bin_tree_t *build_word_op _RE_ARGS((re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
+ int not, reg_errcode_t *err));
+static void free_bin_tree _RE_ARGS((bin_tree_t *tree));
+static bin_tree_t *create_tree _RE_ARGS((bin_tree_t *left, bin_tree_t *right,
+ re_token_type_t type, int index));
+static bin_tree_t *duplicate_tree _RE_ARGS((const bin_tree_t *src, re_dfa_t *dfa));
+
+/* This table gives an error message for each of the error codes listed
+ in regex.h. Obviously the order here has to be same as there.
+ POSIX doesn't require that we do anything for REG_NOERROR,
+ but why not be nice? */
+
+const char __re_error_msgid[] attribute_hidden =
+ {
+#define REG_NOERROR_IDX 0
+ gettext_noop ("Success") /* REG_NOERROR */
+ "\0"
+#define REG_NOMATCH_IDX (REG_NOERROR_IDX + sizeof "Success")
+ gettext_noop ("No match") /* REG_NOMATCH */
+ "\0"
+#define REG_BADPAT_IDX (REG_NOMATCH_IDX + sizeof "No match")
+ gettext_noop ("Invalid regular expression") /* REG_BADPAT */
+ "\0"
+#define REG_ECOLLATE_IDX (REG_BADPAT_IDX + sizeof "Invalid regular expression")
+ gettext_noop ("Invalid collation character") /* REG_ECOLLATE */
+ "\0"
+#define REG_ECTYPE_IDX (REG_ECOLLATE_IDX + sizeof "Invalid collation character")
+ gettext_noop ("Invalid character class name") /* REG_ECTYPE */
+ "\0"
+#define REG_EESCAPE_IDX (REG_ECTYPE_IDX + sizeof "Invalid character class name")
+ gettext_noop ("Trailing backslash") /* REG_EESCAPE */
+ "\0"
+#define REG_ESUBREG_IDX (REG_EESCAPE_IDX + sizeof "Trailing backslash")
+ gettext_noop ("Invalid back reference") /* REG_ESUBREG */
+ "\0"
+#define REG_EBRACK_IDX (REG_ESUBREG_IDX + sizeof "Invalid back reference")
+ gettext_noop ("Unmatched [ or [^") /* REG_EBRACK */
+ "\0"
+#define REG_EPAREN_IDX (REG_EBRACK_IDX + sizeof "Unmatched [ or [^")
+ gettext_noop ("Unmatched ( or \\(") /* REG_EPAREN */
+ "\0"
+#define REG_EBRACE_IDX (REG_EPAREN_IDX + sizeof "Unmatched ( or \\(")
+ gettext_noop ("Unmatched \\{") /* REG_EBRACE */
+ "\0"
+#define REG_BADBR_IDX (REG_EBRACE_IDX + sizeof "Unmatched \\{")
+ gettext_noop ("Invalid content of \\{\\}") /* REG_BADBR */
+ "\0"
+#define REG_ERANGE_IDX (REG_BADBR_IDX + sizeof "Invalid content of \\{\\}")
+ gettext_noop ("Invalid range end") /* REG_ERANGE */
+ "\0"
+#define REG_ESPACE_IDX (REG_ERANGE_IDX + sizeof "Invalid range end")
+ gettext_noop ("Memory exhausted") /* REG_ESPACE */
+ "\0"
+#define REG_BADRPT_IDX (REG_ESPACE_IDX + sizeof "Memory exhausted")
+ gettext_noop ("Invalid preceding regular expression") /* REG_BADRPT */
+ "\0"
+#define REG_EEND_IDX (REG_BADRPT_IDX + sizeof "Invalid preceding regular expression")
+ gettext_noop ("Premature end of regular expression") /* REG_EEND */
+ "\0"
+#define REG_ESIZE_IDX (REG_EEND_IDX + sizeof "Premature end of regular expression")
+ gettext_noop ("Regular expression too big") /* REG_ESIZE */
+ "\0"
+#define REG_ERPAREN_IDX (REG_ESIZE_IDX + sizeof "Regular expression too big")
+ gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */
+ };
+
+const size_t __re_error_msgid_idx[] attribute_hidden =
+ {
+ REG_NOERROR_IDX,
+ REG_NOMATCH_IDX,
+ REG_BADPAT_IDX,
+ REG_ECOLLATE_IDX,
+ REG_ECTYPE_IDX,
+ REG_EESCAPE_IDX,
+ REG_ESUBREG_IDX,
+ REG_EBRACK_IDX,
+ REG_EPAREN_IDX,
+ REG_EBRACE_IDX,
+ REG_BADBR_IDX,
+ REG_ERANGE_IDX,
+ REG_ESPACE_IDX,
+ REG_BADRPT_IDX,
+ REG_EEND_IDX,
+ REG_ESIZE_IDX,
+ REG_ERPAREN_IDX
+ };
+
+/* Entry points for GNU code. */
+
+/* re_compile_pattern is the GNU regular expression compiler: it
+ compiles PATTERN (of length LENGTH) and puts the result in BUFP.
+ Returns 0 if the pattern was valid, otherwise an error string.
+
+ Assumes the `allocated' (and perhaps `buffer') and `translate' fields
+ are set in BUFP on entry. */
+
+const char *
+re_compile_pattern (pattern, length, bufp)
+ const char *pattern;
+ size_t length;
+ struct re_pattern_buffer *bufp;
+{
+ reg_errcode_t ret;
+
+ /* And GNU code determines whether or not to get register information
+ by passing null for the REGS argument to re_match, etc., not by
+ setting no_sub. */
+ bufp->no_sub = 0;
+
+ /* Match anchors at newline. */
+ bufp->newline_anchor = 1;
+
+ ret = re_compile_internal (bufp, pattern, length, re_syntax_options);
+
+ if (!ret)
+ return NULL;
+ return gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]);
+}
+#ifdef _LIBC
+weak_alias (__re_compile_pattern, re_compile_pattern)
+#endif
+
+/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can
+ also be assigned to arbitrarily: each pattern buffer stores its own
+ syntax, so it can be changed between regex compilations. */
+/* This has no initializer because initialized variables in Emacs
+ become read-only after dumping. */
+reg_syntax_t re_syntax_options;
+
+
+/* Specify the precise syntax of regexps for compilation. This provides
+ for compatibility for various utilities which historically have
+ different, incompatible syntaxes.
+
+ The argument SYNTAX is a bit mask comprised of the various bits
+ defined in regex.h. We return the old syntax. */
+
+reg_syntax_t
+re_set_syntax (syntax)
+ reg_syntax_t syntax;
+{
+ reg_syntax_t ret = re_syntax_options;
+
+ re_syntax_options = syntax;
+#ifdef RE_ENABLE_I18N
+ re_mb_cur_max = MB_CUR_MAX;
+#endif
+ return ret;
+}
+#ifdef _LIBC
+weak_alias (__re_set_syntax, re_set_syntax)
+#endif
+
+int
+re_compile_fastmap (bufp)
+ struct re_pattern_buffer *bufp;
+{
+ re_dfa_t *dfa = (re_dfa_t *) bufp->buffer;
+ char *fastmap = bufp->fastmap;
+
+ memset (fastmap, '\0', sizeof (char) * SBC_MAX);
+ re_compile_fastmap_iter (bufp, dfa->init_state, fastmap);
+ if (dfa->init_state != dfa->init_state_word)
+ re_compile_fastmap_iter (bufp, dfa->init_state_word, fastmap);
+ if (dfa->init_state != dfa->init_state_nl)
+ re_compile_fastmap_iter (bufp, dfa->init_state_nl, fastmap);
+ if (dfa->init_state != dfa->init_state_begbuf)
+ re_compile_fastmap_iter (bufp, dfa->init_state_begbuf, fastmap);
+ bufp->fastmap_accurate = 1;
+ return 0;
+}
+#ifdef _LIBC
+weak_alias (__re_compile_fastmap, re_compile_fastmap)
+#endif
+
+static inline void
+re_set_fastmap (char *fastmap, int icase, int ch)
+{
+ fastmap[ch] = 1;
+ if (icase)
+ fastmap[tolower (ch)] = 1;
+}
+
+/* Helper function for re_compile_fastmap.
+ Compile fastmap for the initial_state INIT_STATE. */
+
+static void
+re_compile_fastmap_iter (bufp, init_state, fastmap)
+ regex_t *bufp;
+ const re_dfastate_t *init_state;
+ char *fastmap;
+{
+ re_dfa_t *dfa = (re_dfa_t *) bufp->buffer;
+ int node_cnt;
+#ifdef RE_ENABLE_I18N
+ int icase = (re_mb_cur_max == 1 && (bufp->syntax & RE_ICASE));
+#else
+ int icase = (bufp->syntax & RE_ICASE);
+#endif
+ for (node_cnt = 0; node_cnt < init_state->nodes.nelem; ++node_cnt)
+ {
+ int node = init_state->nodes.elems[node_cnt];
+ re_token_type_t type = dfa->nodes[node].type;
+
+ if (type == CHARACTER)
+ re_set_fastmap (fastmap, icase, dfa->nodes[node].opr.c);
+ else if (type == SIMPLE_BRACKET)
+ {
+ int i, j, ch;
+ for (i = 0, ch = 0; i < BITSET_UINTS; ++i)
+ for (j = 0; j < UINT_BITS; ++j, ++ch)
+ if (dfa->nodes[node].opr.sbcset[i] & (1UL << j))
+ re_set_fastmap (fastmap, icase, ch);
+ }
+#ifdef RE_ENABLE_I18N
+ else if (type == COMPLEX_BRACKET)
+ {
+ int i;
+ re_charset_t *cset = dfa->nodes[node].opr.mbcset;
+ if (cset->non_match || cset->ncoll_syms || cset->nequiv_classes
+ || cset->nranges || cset->nchar_classes)
+ {
+# ifdef _LIBC
+ if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0)
+ {
+ /* In this case we want to catch the bytes which are
+ the first byte of any collation elements.
+ e.g. In da_DK, we want to catch 'a' since "aa"
+ is a valid collation element, and don't catch
+ 'b' since 'b' is the only collation element
+ which starts from 'b'. */
+ int j, ch;
+ const int32_t *table = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
+ for (i = 0, ch = 0; i < BITSET_UINTS; ++i)
+ for (j = 0; j < UINT_BITS; ++j, ++ch)
+ if (table[ch] < 0)
+ re_set_fastmap (fastmap, icase, ch);
+ }
+# else
+ if (re_mb_cur_max > 1)
+ for (i = 0; i < SBC_MAX; ++i)
+ if (__btowc (i) == WEOF)
+ re_set_fastmap (fastmap, icase, i);
+# endif /* not _LIBC */
+ }
+ for (i = 0; i < cset->nmbchars; ++i)
+ {
+ char buf[256];
+ mbstate_t state;
+ memset (&state, '\0', sizeof (state));
+ __wcrtomb (buf, cset->mbchars[i], &state);
+ re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
+ }
+ }
+#endif /* RE_ENABLE_I18N */
+ else if (type == END_OF_RE || type == OP_PERIOD)
+ {
+ memset (fastmap, '\1', sizeof (char) * SBC_MAX);
+ if (type == END_OF_RE)
+ bufp->can_be_null = 1;
+ return;
+ }
+ }
+}
+
+/* Entry point for POSIX code. */
+/* regcomp takes a regular expression as a string and compiles it.
+
+ PREG is a regex_t *. We do not expect any fields to be initialized,
+ since POSIX says we shouldn't. Thus, we set
+
+ `buffer' to the compiled pattern;
+ `used' to the length of the compiled pattern;
+ `syntax' to RE_SYNTAX_POSIX_EXTENDED if the
+ REG_EXTENDED bit in CFLAGS is set; otherwise, to
+ RE_SYNTAX_POSIX_BASIC;
+ `newline_anchor' to REG_NEWLINE being set in CFLAGS;
+ `fastmap' to an allocated space for the fastmap;
+ `fastmap_accurate' to zero;
+ `re_nsub' to the number of subexpressions in PATTERN.
+
+ PATTERN is the address of the pattern string.
+
+ CFLAGS is a series of bits which affect compilation.
+
+ If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we
+ use POSIX basic syntax.
+
+ If REG_NEWLINE is set, then . and [^...] don't match newline.
+ Also, regexec will try a match beginning after every newline.
+
+ If REG_ICASE is set, then we considers upper- and lowercase
+ versions of letters to be equivalent when matching.
+
+ If REG_NOSUB is set, then when PREG is passed to regexec, that
+ routine will report only success or failure, and nothing about the
+ registers.
+
+ It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for
+ the return codes and their meanings.) */
+
+int
+regcomp (preg, pattern, cflags)
+ regex_t *__restrict preg;
+ const char *__restrict pattern;
+ int cflags;
+{
+ reg_errcode_t ret;
+ reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED
+ : RE_SYNTAX_POSIX_BASIC);
+
+ preg->buffer = NULL;
+ preg->allocated = 0;
+ preg->used = 0;
+
+ /* Try to allocate space for the fastmap. */
+ preg->fastmap = re_malloc (char, SBC_MAX);
+ if (BE (preg->fastmap == NULL, 0))
+ return REG_ESPACE;
+
+ syntax |= (cflags & REG_ICASE) ? RE_ICASE : 0;
+
+ /* If REG_NEWLINE is set, newlines are treated differently. */
+ if (cflags & REG_NEWLINE)
+ { /* REG_NEWLINE implies neither . nor [^...] match newline. */
+ syntax &= ~RE_DOT_NEWLINE;
+ syntax |= RE_HAT_LISTS_NOT_NEWLINE;
+ /* It also changes the matching behavior. */
+ preg->newline_anchor = 1;
+ }
+ else
+ preg->newline_anchor = 0;
+ preg->no_sub = !!(cflags & REG_NOSUB);
+ preg->translate = NULL;
+
+ ret = re_compile_internal (preg, pattern, strlen (pattern), syntax);
+
+ /* POSIX doesn't distinguish between an unmatched open-group and an
+ unmatched close-group: both are REG_EPAREN. */
+ if (ret == REG_ERPAREN)
+ ret = REG_EPAREN;
+
+ /* We have already checked preg->fastmap != NULL. */
+ if (BE (ret == REG_NOERROR, 1))
+ /* Compute the fastmap now, since regexec cannot modify the pattern
+ buffer. This function nevers fails in this implementation. */
+ (void) re_compile_fastmap (preg);
+ else
+ {
+ /* Some error occurred while compiling the expression. */
+ re_free (preg->fastmap);
+ preg->fastmap = NULL;
+ }
+
+ return (int) ret;
+}
+#ifdef _LIBC
+weak_alias (__regcomp, regcomp)
+#endif
+
+/* Returns a message corresponding to an error code, ERRCODE, returned
+ from either regcomp or regexec. We don't use PREG here. */
+
+size_t
+regerror (errcode, preg, errbuf, errbuf_size)
+ int errcode;
+ const regex_t *preg;
+ char *errbuf;
+ size_t errbuf_size;
+{
+ const char *msg;
+ size_t msg_size;
+
+ if (BE (errcode < 0
+ || errcode >= (int) (sizeof (__re_error_msgid_idx)
+ / sizeof (__re_error_msgid_idx[0])), 0))
+ /* Only error codes returned by the rest of the code should be passed
+ to this routine. If we are given anything else, or if other regex
+ code generates an invalid error code, then the program has a bug.
+ Dump core so we can fix it. */
+ abort ();
+
+ msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]);
+
+ msg_size = strlen (msg) + 1; /* Includes the null. */
+
+ if (BE (errbuf_size != 0, 1))
+ {
+ if (BE (msg_size > errbuf_size, 0))
+ {
+ memcpy (errbuf, msg, errbuf_size - 1);
+ errbuf[errbuf_size - 1] = 0;
+ }
+ else
+ memcpy (errbuf, msg, msg_size);
+ }
+
+ return msg_size;
+}
+#ifdef _LIBC
+weak_alias (__regerror, regerror)
+#endif
+
+
+static void
+free_dfa_content (re_dfa_t *dfa)
+{
+ int i, j;
+
+ re_free (dfa->subexps);
+
+ for (i = 0; i < dfa->nodes_len; ++i)
+ {
+ re_token_t *node = dfa->nodes + i;
+#ifdef RE_ENABLE_I18N
+ if (node->type == COMPLEX_BRACKET && node->duplicated == 0)
+ free_charset (node->opr.mbcset);
+ else
+#endif /* RE_ENABLE_I18N */
+ if (node->type == SIMPLE_BRACKET && node->duplicated == 0)
+ re_free (node->opr.sbcset);
+ }
+ re_free (dfa->nexts);
+ for (i = 0; i < dfa->nodes_len; ++i)
+ {
+ if (dfa->eclosures != NULL)
+ re_node_set_free (dfa->eclosures + i);
+ if (dfa->inveclosures != NULL)
+ re_node_set_free (dfa->inveclosures + i);
+ if (dfa->edests != NULL)
+ re_node_set_free (dfa->edests + i);
+ }
+ re_free (dfa->edests);
+ re_free (dfa->eclosures);
+ re_free (dfa->inveclosures);
+ re_free (dfa->nodes);
+
+ for (i = 0; i <= dfa->state_hash_mask; ++i)
+ {
+ struct re_state_table_entry *entry = dfa->state_table + i;
+ for (j = 0; j < entry->num; ++j)
+ {
+ re_dfastate_t *state = entry->array[j];
+ free_state (state);
+ }
+ re_free (entry->array);
+ }
+ re_free (dfa->state_table);
+
+ if (dfa->word_char != NULL)
+ re_free (dfa->word_char);
+#ifdef DEBUG
+ re_free (dfa->re_str);
+#endif
+
+ re_free (dfa);
+}
+
+
+/* Free dynamically allocated space used by PREG. */
+
+void
+regfree (preg)
+ regex_t *preg;
+{
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ if (BE (dfa != NULL, 1))
+ free_dfa_content (dfa);
+
+ re_free (preg->fastmap);
+}
+#ifdef _LIBC
+weak_alias (__regfree, regfree)
+#endif
+
+/* Entry points compatible with 4.2 BSD regex library. We don't define
+ them unless specifically requested. */
+
+#if defined _REGEX_RE_COMP || defined _LIBC
+
+/* BSD has one and only one pattern buffer. */
+static struct re_pattern_buffer re_comp_buf;
+
+char *
+# ifdef _LIBC
+/* Make these definitions weak in libc, so POSIX programs can redefine
+ these names if they don't use our functions, and still use
+ regcomp/regexec above without link errors. */
+weak_function
+# endif
+re_comp (s)
+ const char *s;
+{
+ reg_errcode_t ret;
+ char *fastmap;
+
+ if (!s)
+ {
+ if (!re_comp_buf.buffer)
+ return gettext ("No previous regular expression");
+ return 0;
+ }
+
+ if (re_comp_buf.buffer)
+ {
+ fastmap = re_comp_buf.fastmap;
+ re_comp_buf.fastmap = NULL;
+ __regfree (&re_comp_buf);
+ memset (&re_comp_buf, '\0', sizeof (re_comp_buf));
+ re_comp_buf.fastmap = fastmap;
+ }
+
+ if (re_comp_buf.fastmap == NULL)
+ {
+ re_comp_buf.fastmap = (char *) malloc (SBC_MAX);
+ if (re_comp_buf.fastmap == NULL)
+ return (char *) gettext (__re_error_msgid
+ + __re_error_msgid_idx[(int) REG_ESPACE]);
+ }
+
+ /* Since `re_exec' always passes NULL for the `regs' argument, we
+ don't need to initialize the pattern buffer fields which affect it. */
+
+ /* Match anchors at newlines. */
+ re_comp_buf.newline_anchor = 1;
+
+ ret = re_compile_internal (&re_comp_buf, s, strlen (s), re_syntax_options);
+
+ if (!ret)
+ return NULL;
+
+ /* Yes, we're discarding `const' here if !HAVE_LIBINTL. */
+ return (char *) gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]);
+}
+
+#ifdef _LIBC
+libc_freeres_fn (free_mem)
+{
+ __regfree (&re_comp_buf);
+}
+#endif
+
+#endif /* _REGEX_RE_COMP */
+
+/* Internal entry point.
+ Compile the regular expression PATTERN, whose length is LENGTH.
+ SYNTAX indicate regular expression's syntax. */
+
+static reg_errcode_t
+re_compile_internal (preg, pattern, length, syntax)
+ regex_t *preg;
+ const char * pattern;
+ int length;
+ reg_syntax_t syntax;
+{
+ reg_errcode_t err = REG_NOERROR;
+ re_dfa_t *dfa;
+ re_string_t regexp;
+
+ /* Initialize the pattern buffer. */
+ preg->fastmap_accurate = 0;
+ preg->syntax = syntax;
+ preg->not_bol = preg->not_eol = 0;
+ preg->used = 0;
+ preg->re_nsub = 0;
+ preg->can_be_null = 0;
+ preg->regs_allocated = REGS_UNALLOCATED;
+
+ /* Initialize the dfa. */
+ dfa = (re_dfa_t *) preg->buffer;
+ if (preg->allocated < sizeof (re_dfa_t))
+ {
+ /* 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. If ->buffer is NULL this
+ is a simple allocation. */
+ dfa = re_realloc (preg->buffer, re_dfa_t, 1);
+ if (dfa == NULL)
+ return REG_ESPACE;
+ preg->allocated = sizeof (re_dfa_t);
+ }
+ preg->buffer = (unsigned char *) dfa;
+ preg->used = sizeof (re_dfa_t);
+
+ err = init_dfa (dfa, length);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ re_free (dfa);
+ preg->buffer = NULL;
+ preg->allocated = 0;
+ return err;
+ }
+#ifdef DEBUG
+ dfa->re_str = re_malloc (char, length + 1);
+ strncpy (dfa->re_str, pattern, length + 1);
+#endif
+
+ err = re_string_construct (&regexp, pattern, length, preg->translate,
+ syntax & RE_ICASE);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ re_free (dfa);
+ preg->buffer = NULL;
+ preg->allocated = 0;
+ return err;
+ }
+
+ /* Parse the regular expression, and build a structure tree. */
+ preg->re_nsub = 0;
+ dfa->str_tree = parse (&regexp, preg, syntax, &err);
+ if (BE (dfa->str_tree == NULL, 0))
+ goto re_compile_internal_free_return;
+
+ /* Analyze the tree and collect information which is necessary to
+ create the dfa. */
+ err = analyze (dfa);
+ if (BE (err != REG_NOERROR, 0))
+ goto re_compile_internal_free_return;
+
+ /* Then create the initial state of the dfa. */
+ err = create_initial_state (dfa);
+
+ /* Release work areas. */
+ free_workarea_compile (preg);
+ re_string_destruct (&regexp);
+
+ if (BE (err != REG_NOERROR, 0))
+ {
+ re_compile_internal_free_return:
+ free_dfa_content (dfa);
+ preg->buffer = NULL;
+ preg->allocated = 0;
+ }
+
+ return err;
+}
+
+/* Initialize DFA. We use the length of the regular expression PAT_LEN
+ as the initial length of some arrays. */
+
+static reg_errcode_t
+init_dfa (dfa, pat_len)
+ re_dfa_t *dfa;
+ int pat_len;
+{
+ int table_size;
+
+ memset (dfa, '\0', sizeof (re_dfa_t));
+
+ dfa->nodes_alloc = pat_len + 1;
+ dfa->nodes = re_malloc (re_token_t, dfa->nodes_alloc);
+
+ dfa->states_alloc = pat_len + 1;
+
+ /* table_size = 2 ^ ceil(log pat_len) */
+ for (table_size = 1; table_size > 0; table_size <<= 1)
+ if (table_size > pat_len)
+ break;
+
+ dfa->state_table = calloc (sizeof (struct re_state_table_entry), table_size);
+ dfa->state_hash_mask = table_size - 1;
+
+ dfa->subexps_alloc = 1;
+ dfa->subexps = re_malloc (re_subexp_t, dfa->subexps_alloc);
+ dfa->word_char = NULL;
+
+ if (BE (dfa->nodes == NULL || dfa->state_table == NULL
+ || dfa->subexps == NULL, 0))
+ {
+ /* We don't bother to free anything which was allocated. Very
+ soon the process will go down anyway. */
+ dfa->subexps = NULL;
+ dfa->state_table = NULL;
+ dfa->nodes = NULL;
+ return REG_ESPACE;
+ }
+ return REG_NOERROR;
+}
+
+/* Initialize WORD_CHAR table, which indicate which character is
+ "word". In this case "word" means that it is the word construction
+ character used by some operators like "\<", "\>", etc. */
+
+static reg_errcode_t
+init_word_char (dfa)
+ re_dfa_t *dfa;
+{
+ int i, j, ch;
+ dfa->word_char = (re_bitset_ptr_t) calloc (sizeof (bitset), 1);
+ if (BE (dfa->word_char == NULL, 0))
+ return REG_ESPACE;
+ for (i = 0, ch = 0; i < BITSET_UINTS; ++i)
+ for (j = 0; j < UINT_BITS; ++j, ++ch)
+ if (isalnum (ch) || ch == '_')
+ dfa->word_char[i] |= 1UL << j;
+ return REG_NOERROR;
+}
+
+/* Free the work area which are only used while compiling. */
+
+static void
+free_workarea_compile (preg)
+ regex_t *preg;
+{
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ free_bin_tree (dfa->str_tree);
+ dfa->str_tree = NULL;
+ re_free (dfa->org_indices);
+ dfa->org_indices = NULL;
+}
+
+/* Create initial states for all contexts. */
+
+static reg_errcode_t
+create_initial_state (dfa)
+ re_dfa_t *dfa;
+{
+ int first, i;
+ reg_errcode_t err;
+ re_node_set init_nodes;
+
+ /* Initial states have the epsilon closure of the node which is
+ the first node of the regular expression. */
+ first = dfa->str_tree->first;
+ dfa->init_node = first;
+ err = re_node_set_init_copy (&init_nodes, dfa->eclosures + first);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+
+ /* The back-references which are in initial states can epsilon transit,
+ since in this case all of the subexpressions can be null.
+ Then we add epsilon closures of the nodes which are the next nodes of
+ the back-references. */
+ if (dfa->nbackref > 0)
+ for (i = 0; i < init_nodes.nelem; ++i)
+ {
+ int node_idx = init_nodes.elems[i];
+ re_token_type_t type = dfa->nodes[node_idx].type;
+
+ int clexp_idx;
+ if (type != OP_BACK_REF)
+ continue;
+ for (clexp_idx = 0; clexp_idx < init_nodes.nelem; ++clexp_idx)
+ {
+ re_token_t *clexp_node;
+ clexp_node = dfa->nodes + init_nodes.elems[clexp_idx];
+ if (clexp_node->type == OP_CLOSE_SUBEXP
+ && clexp_node->opr.idx + 1 == dfa->nodes[node_idx].opr.idx)
+ break;
+ }
+ if (clexp_idx == init_nodes.nelem)
+ continue;
+
+ if (type == OP_BACK_REF)
+ {
+ int dest_idx = dfa->edests[node_idx].elems[0];
+ if (!re_node_set_contains (&init_nodes, dest_idx))
+ {
+ re_node_set_merge (&init_nodes, dfa->eclosures + dest_idx);
+ i = 0;
+ }
+ }
+ }
+
+ /* It must be the first time to invoke acquire_state. */
+ dfa->init_state = re_acquire_state_context (&err, dfa, &init_nodes, 0);
+ /* We don't check ERR here, since the initial state must not be NULL. */
+ if (BE (dfa->init_state == NULL, 0))
+ return err;
+ if (dfa->init_state->has_constraint)
+ {
+ dfa->init_state_word = re_acquire_state_context (&err, dfa, &init_nodes,
+ CONTEXT_WORD);
+ dfa->init_state_nl = re_acquire_state_context (&err, dfa, &init_nodes,
+ CONTEXT_NEWLINE);
+ dfa->init_state_begbuf = re_acquire_state_context (&err, dfa,
+ &init_nodes,
+ CONTEXT_NEWLINE
+ | CONTEXT_BEGBUF);
+ if (BE (dfa->init_state_word == NULL || dfa->init_state_nl == NULL
+ || dfa->init_state_begbuf == NULL, 0))
+ return err;
+ }
+ else
+ dfa->init_state_word = dfa->init_state_nl
+ = dfa->init_state_begbuf = dfa->init_state;
+
+ re_node_set_free (&init_nodes);
+ return REG_NOERROR;
+}
+
+/* Analyze the structure tree, and calculate "first", "next", "edest",
+ "eclosure", and "inveclosure". */
+
+static reg_errcode_t
+analyze (dfa)
+ re_dfa_t *dfa;
+{
+ int i;
+ reg_errcode_t ret;
+
+ /* Allocate arrays. */
+ dfa->nexts = re_malloc (int, dfa->nodes_alloc);
+ dfa->org_indices = re_malloc (int, dfa->nodes_alloc);
+ dfa->edests = re_malloc (re_node_set, dfa->nodes_alloc);
+ dfa->eclosures = re_malloc (re_node_set, dfa->nodes_alloc);
+ dfa->inveclosures = re_malloc (re_node_set, dfa->nodes_alloc);
+ if (BE (dfa->nexts == NULL || dfa->org_indices == NULL || dfa->edests == NULL
+ || dfa->eclosures == NULL || dfa->inveclosures == NULL, 0))
+ return REG_ESPACE;
+ /* Initialize them. */
+ for (i = 0; i < dfa->nodes_len; ++i)
+ {
+ dfa->nexts[i] = -1;
+ re_node_set_init_empty (dfa->edests + i);
+ re_node_set_init_empty (dfa->eclosures + i);
+ re_node_set_init_empty (dfa->inveclosures + i);
+ }
+
+ ret = analyze_tree (dfa, dfa->str_tree);
+ if (BE (ret == REG_NOERROR, 1))
+ {
+ ret = calc_eclosure (dfa);
+ if (ret == REG_NOERROR)
+ calc_inveclosure (dfa);
+ }
+ return ret;
+}
+
+/* Helper functions for analyze.
+ This function calculate "first", "next", and "edest" for the subtree
+ whose root is NODE. */
+
+static reg_errcode_t
+analyze_tree (dfa, node)
+ re_dfa_t *dfa;
+ bin_tree_t *node;
+{
+ reg_errcode_t ret;
+ if (node->first == -1)
+ calc_first (dfa, node);
+ if (node->next == -1)
+ calc_next (dfa, node);
+ if (node->eclosure.nelem == 0)
+ calc_epsdest (dfa, node);
+ /* Calculate "first" etc. for the left child. */
+ if (node->left != NULL)
+ {
+ ret = analyze_tree (dfa, node->left);
+ if (BE (ret != REG_NOERROR, 0))
+ return ret;
+ }
+ /* Calculate "first" etc. for the right child. */
+ if (node->right != NULL)
+ {
+ ret = analyze_tree (dfa, node->right);
+ if (BE (ret != REG_NOERROR, 0))
+ return ret;
+ }
+ return REG_NOERROR;
+}
+
+/* Calculate "first" for the node NODE. */
+static void
+calc_first (dfa, node)
+ re_dfa_t *dfa;
+ bin_tree_t *node;
+{
+ int idx, type;
+ idx = node->node_idx;
+ type = (node->type == 0) ? dfa->nodes[idx].type : node->type;
+
+ switch (type)
+ {
+#ifdef DEBUG
+ case OP_OPEN_BRACKET:
+ case OP_CLOSE_BRACKET:
+ case OP_OPEN_DUP_NUM:
+ case OP_CLOSE_DUP_NUM:
+ case OP_NON_MATCH_LIST:
+ case OP_OPEN_COLL_ELEM:
+ case OP_CLOSE_COLL_ELEM:
+ case OP_OPEN_EQUIV_CLASS:
+ case OP_CLOSE_EQUIV_CLASS:
+ case OP_OPEN_CHAR_CLASS:
+ case OP_CLOSE_CHAR_CLASS:
+ /* These must not be appeared here. */
+ assert (0);
+#endif
+ case END_OF_RE:
+ case CHARACTER:
+ case OP_PERIOD:
+ case OP_DUP_ASTERISK:
+ case OP_DUP_QUESTION:
+#ifdef RE_ENABLE_I18N
+ case COMPLEX_BRACKET:
+#endif /* RE_ENABLE_I18N */
+ case SIMPLE_BRACKET:
+ case OP_BACK_REF:
+ case ANCHOR:
+ case OP_OPEN_SUBEXP:
+ case OP_CLOSE_SUBEXP:
+ node->first = idx;
+ break;
+ case OP_DUP_PLUS:
+#ifdef DEBUG
+ assert (node->left != NULL);
+#endif
+ if (node->left->first == -1)
+ calc_first (dfa, node->left);
+ node->first = node->left->first;
+ break;
+ case OP_ALT:
+ node->first = idx;
+ break;
+ /* else fall through */
+ default:
+#ifdef DEBUG
+ assert (node->left != NULL);
+#endif
+ if (node->left->first == -1)
+ calc_first (dfa, node->left);
+ node->first = node->left->first;
+ break;
+ }
+}
+
+/* Calculate "next" for the node NODE. */
+
+static void
+calc_next (dfa, node)
+ re_dfa_t *dfa;
+ bin_tree_t *node;
+{
+ int idx, type;
+ bin_tree_t *parent = node->parent;
+ if (parent == NULL)
+ {
+ node->next = -1;
+ idx = node->node_idx;
+ if (node->type == 0)
+ dfa->nexts[idx] = node->next;
+ return;
+ }
+
+ idx = parent->node_idx;
+ type = (parent->type == 0) ? dfa->nodes[idx].type : parent->type;
+
+ switch (type)
+ {
+ case OP_DUP_ASTERISK:
+ case OP_DUP_PLUS:
+ node->next = idx;
+ break;
+ case CONCAT:
+ if (parent->left == node)
+ {
+ if (parent->right->first == -1)
+ calc_first (dfa, parent->right);
+ node->next = parent->right->first;
+ break;
+ }
+ /* else fall through */
+ default:
+ if (parent->next == -1)
+ calc_next (dfa, parent);
+ node->next = parent->next;
+ break;
+ }
+ idx = node->node_idx;
+ if (node->type == 0)
+ dfa->nexts[idx] = node->next;
+}
+
+/* Calculate "edest" for the node NODE. */
+
+static void
+calc_epsdest (dfa, node)
+ re_dfa_t *dfa;
+ bin_tree_t *node;
+{
+ int idx;
+ idx = node->node_idx;
+ if (node->type == 0)
+ {
+ if (dfa->nodes[idx].type == OP_DUP_ASTERISK
+ || dfa->nodes[idx].type == OP_DUP_PLUS
+ || dfa->nodes[idx].type == OP_DUP_QUESTION)
+ {
+ if (node->left->first == -1)
+ calc_first (dfa, node->left);
+ if (node->next == -1)
+ calc_next (dfa, node);
+ re_node_set_init_2 (dfa->edests + idx, node->left->first,
+ node->next);
+ }
+ else if (dfa->nodes[idx].type == OP_ALT)
+ {
+ int left, right;
+ if (node->left != NULL)
+ {
+ if (node->left->first == -1)
+ calc_first (dfa, node->left);
+ left = node->left->first;
+ }
+ else
+ {
+ if (node->next == -1)
+ calc_next (dfa, node);
+ left = node->next;
+ }
+ if (node->right != NULL)
+ {
+ if (node->right->first == -1)
+ calc_first (dfa, node->right);
+ right = node->right->first;
+ }
+ else
+ {
+ if (node->next == -1)
+ calc_next (dfa, node);
+ right = node->next;
+ }
+ re_node_set_init_2 (dfa->edests + idx, left, right);
+ }
+ else if (dfa->nodes[idx].type == ANCHOR
+ || dfa->nodes[idx].type == OP_OPEN_SUBEXP
+ || dfa->nodes[idx].type == OP_CLOSE_SUBEXP
+ || dfa->nodes[idx].type == OP_BACK_REF)
+ re_node_set_init_1 (dfa->edests + idx, node->next);
+ }
+}
+
+/* Duplicate the epsilon closure of the node ROOT_NODE.
+ Note that duplicated nodes have constraint INIT_CONSTRAINT in addition
+ to their own constraint. */
+
+static reg_errcode_t
+duplicate_node_closure (dfa, top_org_node, top_clone_node, root_node,
+ init_constraint)
+ re_dfa_t *dfa;
+ int top_org_node, top_clone_node, root_node;
+ unsigned int init_constraint;
+{
+ reg_errcode_t err;
+ int org_node, clone_node, ret;
+ unsigned int constraint = init_constraint;
+ for (org_node = top_org_node, clone_node = top_clone_node;;)
+ {
+ int org_dest, clone_dest;
+ if (dfa->nodes[org_node].type == OP_BACK_REF)
+ {
+ /* If the back reference epsilon-transit, its destination must
+ also have the constraint. Then duplicate the epsilon closure
+ of the destination of the back reference, and store it in
+ edests of the back reference. */
+ org_dest = dfa->nexts[org_node];
+ re_node_set_empty (dfa->edests + clone_node);
+ err = duplicate_node (&clone_dest, dfa, org_dest, constraint);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ dfa->nexts[clone_node] = dfa->nexts[org_node];
+ ret = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (BE (ret < 0, 0))
+ return REG_ESPACE;
+ }
+ else if (dfa->edests[org_node].nelem == 0)
+ {
+ /* In case of the node can't epsilon-transit, don't duplicate the
+ destination and store the original destination as the
+ destination of the node. */
+ dfa->nexts[clone_node] = dfa->nexts[org_node];
+ break;
+ }
+ else if (dfa->edests[org_node].nelem == 1)
+ {
+ /* In case of the node can epsilon-transit, and it has only one
+ destination. */
+ org_dest = dfa->edests[org_node].elems[0];
+ re_node_set_empty (dfa->edests + clone_node);
+ if (dfa->nodes[org_node].type == ANCHOR)
+ {
+ /* In case of the node has another constraint, append it. */
+ if (org_node == root_node && clone_node != org_node)
+ {
+ /* ...but if the node is root_node itself, it means the
+ epsilon closure have a loop, then tie it to the
+ destination of the root_node. */
+ ret = re_node_set_insert (dfa->edests + clone_node,
+ org_dest);
+ if (BE (ret < 0, 0))
+ return REG_ESPACE;
+ break;
+ }
+ constraint |= dfa->nodes[org_node].opr.ctx_type;
+ }
+ err = duplicate_node (&clone_dest, dfa, org_dest, constraint);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ ret = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (BE (ret < 0, 0))
+ return REG_ESPACE;
+ }
+ else /* dfa->edests[org_node].nelem == 2 */
+ {
+ /* In case of the node can epsilon-transit, and it has two
+ destinations. E.g. '|', '*', '+', '?'. */
+ org_dest = dfa->edests[org_node].elems[0];
+ re_node_set_empty (dfa->edests + clone_node);
+ /* Search for a duplicated node which satisfies the constraint. */
+ clone_dest = search_duplicated_node (dfa, org_dest, constraint);
+ if (clone_dest == -1)
+ {
+ /* There are no such a duplicated node, create a new one. */
+ err = duplicate_node (&clone_dest, dfa, org_dest, constraint);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ ret = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (BE (ret < 0, 0))
+ return REG_ESPACE;
+ err = duplicate_node_closure (dfa, org_dest, clone_dest,
+ root_node, constraint);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ else
+ {
+ /* There are a duplicated node which satisfy the constraint,
+ use it to avoid infinite loop. */
+ ret = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (BE (ret < 0, 0))
+ return REG_ESPACE;
+ }
+
+ org_dest = dfa->edests[org_node].elems[1];
+ err = duplicate_node (&clone_dest, dfa, org_dest, constraint);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ ret = re_node_set_insert (dfa->edests + clone_node, clone_dest);
+ if (BE (ret < 0, 0))
+ return REG_ESPACE;
+ }
+ org_node = org_dest;
+ clone_node = clone_dest;
+ }
+ return REG_NOERROR;
+}
+
+/* Search for a node which is duplicated from the node ORG_NODE, and
+ satisfies the constraint CONSTRAINT. */
+
+static int
+search_duplicated_node (dfa, org_node, constraint)
+ re_dfa_t *dfa;
+ int org_node;
+ unsigned int constraint;
+{
+ int idx;
+ for (idx = dfa->nodes_len - 1; dfa->nodes[idx].duplicated && idx > 0; --idx)
+ {
+ if (org_node == dfa->org_indices[idx]
+ && constraint == dfa->nodes[idx].constraint)
+ return idx; /* Found. */
+ }
+ return -1; /* Not found. */
+}
+
+/* Duplicate the node whose index is ORG_IDX and set the constraint CONSTRAINT.
+ The new index will be stored in NEW_IDX and return REG_NOERROR if succeeded,
+ otherwise return the error code. */
+
+static reg_errcode_t
+duplicate_node (new_idx, dfa, org_idx, constraint)
+ re_dfa_t *dfa;
+ int *new_idx, org_idx;
+ unsigned int constraint;
+{
+ re_token_t dup;
+ int dup_idx;
+
+ dup = dfa->nodes[org_idx];
+ dup_idx = re_dfa_add_node (dfa, dup, 1);
+ if (BE (dup_idx == -1, 0))
+ return REG_ESPACE;
+ dfa->nodes[dup_idx].constraint = constraint;
+ if (dfa->nodes[org_idx].type == ANCHOR)
+ dfa->nodes[dup_idx].constraint |= dfa->nodes[org_idx].opr.ctx_type;
+ dfa->nodes[dup_idx].duplicated = 1;
+ re_node_set_init_empty (dfa->edests + dup_idx);
+ re_node_set_init_empty (dfa->eclosures + dup_idx);
+ re_node_set_init_empty (dfa->inveclosures + dup_idx);
+
+ /* Store the index of the original node. */
+ dfa->org_indices[dup_idx] = org_idx;
+ *new_idx = dup_idx;
+ return REG_NOERROR;
+}
+
+static void
+calc_inveclosure (dfa)
+ re_dfa_t *dfa;
+{
+ int src, idx, dest;
+ for (src = 0; src < dfa->nodes_len; ++src)
+ {
+ for (idx = 0; idx < dfa->eclosures[src].nelem; ++idx)
+ {
+ dest = dfa->eclosures[src].elems[idx];
+ re_node_set_insert (dfa->inveclosures + dest, src);
+ }
+ }
+}
+
+/* Calculate "eclosure" for all the node in DFA. */
+
+static reg_errcode_t
+calc_eclosure (dfa)
+ re_dfa_t *dfa;
+{
+ int node_idx, incomplete;
+#ifdef DEBUG
+ assert (dfa->nodes_len > 0);
+#endif
+ incomplete = 0;
+ /* For each nodes, calculate epsilon closure. */
+ for (node_idx = 0; ; ++node_idx)
+ {
+ reg_errcode_t err;
+ re_node_set eclosure_elem;
+ if (node_idx == dfa->nodes_len)
+ {
+ if (!incomplete)
+ break;
+ incomplete = 0;
+ node_idx = 0;
+ }
+
+#ifdef DEBUG
+ assert (dfa->eclosures[node_idx].nelem != -1);
+#endif
+ /* If we have already calculated, skip it. */
+ if (dfa->eclosures[node_idx].nelem != 0)
+ continue;
+ /* Calculate epsilon closure of `node_idx'. */
+ err = calc_eclosure_iter (&eclosure_elem, dfa, node_idx, 1);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+
+ if (dfa->eclosures[node_idx].nelem == 0)
+ {
+ incomplete = 1;
+ re_node_set_free (&eclosure_elem);
+ }
+ }
+ return REG_NOERROR;
+}
+
+/* Calculate epsilon closure of NODE. */
+
+static reg_errcode_t
+calc_eclosure_iter (new_set, dfa, node, root)
+ re_node_set *new_set;
+ re_dfa_t *dfa;
+ int node, root;
+{
+ reg_errcode_t err;
+ unsigned int constraint;
+ int i, incomplete;
+ re_node_set eclosure;
+ incomplete = 0;
+ err = re_node_set_alloc (&eclosure, dfa->edests[node].nelem + 1);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+
+ /* This indicates that we are calculating this node now.
+ We reference this value to avoid infinite loop. */
+ dfa->eclosures[node].nelem = -1;
+
+ constraint = ((dfa->nodes[node].type == ANCHOR)
+ ? dfa->nodes[node].opr.ctx_type : 0);
+ /* If the current node has constraints, duplicate all nodes.
+ Since they must inherit the constraints. */
+ if (constraint && !dfa->nodes[dfa->edests[node].elems[0]].duplicated)
+ {
+ int org_node, cur_node;
+ org_node = cur_node = node;
+ err = duplicate_node_closure (dfa, node, node, node, constraint);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+
+ /* Expand each epsilon destination nodes. */
+ if (IS_EPSILON_NODE(dfa->nodes[node].type))
+ for (i = 0; i < dfa->edests[node].nelem; ++i)
+ {
+ re_node_set eclosure_elem;
+ int edest = dfa->edests[node].elems[i];
+ /* If calculating the epsilon closure of `edest' is in progress,
+ return intermediate result. */
+ if (dfa->eclosures[edest].nelem == -1)
+ {
+ incomplete = 1;
+ continue;
+ }
+ /* If we haven't calculated the epsilon closure of `edest' yet,
+ calculate now. Otherwise use calculated epsilon closure. */
+ if (dfa->eclosures[edest].nelem == 0)
+ {
+ err = calc_eclosure_iter (&eclosure_elem, dfa, edest, 0);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ else
+ eclosure_elem = dfa->eclosures[edest];
+ /* Merge the epsilon closure of `edest'. */
+ re_node_set_merge (&eclosure, &eclosure_elem);
+ /* If the epsilon closure of `edest' is incomplete,
+ the epsilon closure of this node is also incomplete. */
+ if (dfa->eclosures[edest].nelem == 0)
+ {
+ incomplete = 1;
+ re_node_set_free (&eclosure_elem);
+ }
+ }
+
+ /* Epsilon closures include itself. */
+ re_node_set_insert (&eclosure, node);
+ if (incomplete && !root)
+ dfa->eclosures[node].nelem = 0;
+ else
+ dfa->eclosures[node] = eclosure;
+ *new_set = eclosure;
+ return REG_NOERROR;
+}
+
+/* Functions for token which are used in the parser. */
+
+/* Fetch a token from INPUT.
+ We must not use this function inside bracket expressions. */
+
+static re_token_t
+fetch_token (input, syntax)
+ re_string_t *input;
+ reg_syntax_t syntax;
+{
+ re_token_t token;
+ int consumed_byte;
+ consumed_byte = peek_token (&token, input, syntax);
+ re_string_skip_bytes (input, consumed_byte);
+ return token;
+}
+
+/* Peek a token from INPUT, and return the length of the token.
+ We must not use this function inside bracket expressions. */
+
+static int
+peek_token (token, input, syntax)
+ re_token_t *token;
+ re_string_t *input;
+ reg_syntax_t syntax;
+{
+ unsigned char c;
+
+ if (re_string_eoi (input))
+ {
+ token->type = END_OF_RE;
+ return 0;
+ }
+
+ c = re_string_peek_byte (input, 0);
+ token->opr.c = c;
+
+#ifdef RE_ENABLE_I18N
+ token->mb_partial = 0;
+ if (re_mb_cur_max > 1 &&
+ !re_string_first_byte (input, re_string_cur_idx (input)))
+ {
+ token->type = CHARACTER;
+ token->mb_partial = 1;
+ return 1;
+ }
+#endif
+ if (c == '\\')
+ {
+ unsigned char c2;
+ if (re_string_cur_idx (input) + 1 >= re_string_length (input))
+ {
+ token->type = BACK_SLASH;
+ return 1;
+ }
+
+ c2 = re_string_peek_byte_case (input, 1);
+ token->opr.c = c2;
+ token->type = CHARACTER;
+ switch (c2)
+ {
+ case '|':
+ if (!(syntax & RE_LIMITED_OPS) && !(syntax & RE_NO_BK_VBAR))
+ token->type = OP_ALT;
+ break;
+ case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ if (!(syntax & RE_NO_BK_REFS))
+ {
+ token->type = OP_BACK_REF;
+ token->opr.idx = c2 - '0';
+ }
+ break;
+ case '<':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.idx = WORD_FIRST;
+ }
+ break;
+ case '>':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.idx = WORD_LAST;
+ }
+ break;
+ case 'b':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.idx = WORD_DELIM;
+ }
+ break;
+ case 'B':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.idx = INSIDE_WORD;
+ }
+ break;
+ case 'w':
+ if (!(syntax & RE_NO_GNU_OPS))
+ token->type = OP_WORD;
+ break;
+ case 'W':
+ if (!(syntax & RE_NO_GNU_OPS))
+ token->type = OP_NOTWORD;
+ break;
+ case '`':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.idx = BUF_FIRST;
+ }
+ break;
+ case '\'':
+ if (!(syntax & RE_NO_GNU_OPS))
+ {
+ token->type = ANCHOR;
+ token->opr.idx = BUF_LAST;
+ }
+ break;
+ case '(':
+ if (!(syntax & RE_NO_BK_PARENS))
+ token->type = OP_OPEN_SUBEXP;
+ break;
+ case ')':
+ if (!(syntax & RE_NO_BK_PARENS))
+ token->type = OP_CLOSE_SUBEXP;
+ break;
+ case '+':
+ if (!(syntax & RE_LIMITED_OPS) && (syntax & RE_BK_PLUS_QM))
+ token->type = OP_DUP_PLUS;
+ break;
+ case '?':
+ if (!(syntax & RE_LIMITED_OPS) && (syntax & RE_BK_PLUS_QM))
+ token->type = OP_DUP_QUESTION;
+ break;
+ case '{':
+ if ((syntax & RE_INTERVALS) && (!(syntax & RE_NO_BK_BRACES)))
+ token->type = OP_OPEN_DUP_NUM;
+ break;
+ case '}':
+ if ((syntax & RE_INTERVALS) && (!(syntax & RE_NO_BK_BRACES)))
+ token->type = OP_CLOSE_DUP_NUM;
+ break;
+ default:
+ break;
+ }
+ return 2;
+ }
+
+ token->type = CHARACTER;
+ switch (c)
+ {
+ case '\n':
+ if (syntax & RE_NEWLINE_ALT)
+ token->type = OP_ALT;
+ break;
+ case '|':
+ if (!(syntax & RE_LIMITED_OPS) && (syntax & RE_NO_BK_VBAR))
+ token->type = OP_ALT;
+ break;
+ case '*':
+ token->type = OP_DUP_ASTERISK;
+ break;
+ case '+':
+ if (!(syntax & RE_LIMITED_OPS) && !(syntax & RE_BK_PLUS_QM))
+ token->type = OP_DUP_PLUS;
+ break;
+ case '?':
+ if (!(syntax & RE_LIMITED_OPS) && !(syntax & RE_BK_PLUS_QM))
+ token->type = OP_DUP_QUESTION;
+ break;
+ case '{':
+ if ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
+ token->type = OP_OPEN_DUP_NUM;
+ break;
+ case '}':
+ if ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
+ token->type = OP_CLOSE_DUP_NUM;
+ break;
+ case '(':
+ if (syntax & RE_NO_BK_PARENS)
+ token->type = OP_OPEN_SUBEXP;
+ break;
+ case ')':
+ if (syntax & RE_NO_BK_PARENS)
+ token->type = OP_CLOSE_SUBEXP;
+ break;
+ case '[':
+ token->type = OP_OPEN_BRACKET;
+ break;
+ case '.':
+ token->type = OP_PERIOD;
+ break;
+ case '^':
+ if (!(syntax & RE_CONTEXT_INDEP_ANCHORS) &&
+ re_string_cur_idx (input) != 0)
+ {
+ char prev = re_string_peek_byte (input, -1);
+ if (prev != '|' && prev != '(' &&
+ (!(syntax & RE_NEWLINE_ALT) || prev != '\n'))
+ break;
+ }
+ token->type = ANCHOR;
+ token->opr.idx = LINE_FIRST;
+ break;
+ case '$':
+ if (!(syntax & RE_CONTEXT_INDEP_ANCHORS) &&
+ re_string_cur_idx (input) + 1 != re_string_length (input))
+ {
+ re_token_t next;
+ re_string_skip_bytes (input, 1);
+ peek_token (&next, input, syntax);
+ re_string_skip_bytes (input, -1);
+ if (next.type != OP_ALT && next.type != OP_CLOSE_SUBEXP)
+ break;
+ }
+ token->type = ANCHOR;
+ token->opr.idx = LINE_LAST;
+ break;
+ default:
+ break;
+ }
+ return 1;
+}
+
+/* Peek a token from INPUT, and return the length of the token.
+ We must not use this function out of bracket expressions. */
+
+static int
+peek_token_bracket (token, input, syntax)
+ re_token_t *token;
+ re_string_t *input;
+ reg_syntax_t syntax;
+{
+ unsigned char c;
+ if (re_string_eoi (input))
+ {
+ token->type = END_OF_RE;
+ return 0;
+ }
+ c = re_string_peek_byte (input, 0);
+ token->opr.c = c;
+
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max > 1 &&
+ !re_string_first_byte (input, re_string_cur_idx (input)))
+ {
+ token->type = CHARACTER;
+ return 1;
+ }
+#endif /* RE_ENABLE_I18N */
+
+ if (c == '\\' && (syntax & RE_BACKSLASH_ESCAPE_IN_LISTS))
+ {
+ /* In this case, '\' escape a character. */
+ unsigned char c2;
+ re_string_skip_bytes (input, 1);
+ c2 = re_string_peek_byte (input, 0);
+ token->opr.c = c2;
+ token->type = CHARACTER;
+ return 1;
+ }
+ if (c == '[') /* '[' is a special char in a bracket exps. */
+ {
+ unsigned char c2;
+ int token_len;
+ c2 = re_string_peek_byte (input, 1);
+ token->opr.c = c2;
+ token_len = 2;
+ switch (c2)
+ {
+ case '.':
+ token->type = OP_OPEN_COLL_ELEM;
+ break;
+ case '=':
+ token->type = OP_OPEN_EQUIV_CLASS;
+ break;
+ case ':':
+ if (syntax & RE_CHAR_CLASSES)
+ {
+ token->type = OP_OPEN_CHAR_CLASS;
+ break;
+ }
+ /* else fall through. */
+ default:
+ token->type = CHARACTER;
+ token->opr.c = c;
+ token_len = 1;
+ break;
+ }
+ return token_len;
+ }
+ switch (c)
+ {
+ case '-':
+ token->type = OP_CHARSET_RANGE;
+ break;
+ case ']':
+ token->type = OP_CLOSE_BRACKET;
+ break;
+ case '^':
+ token->type = OP_NON_MATCH_LIST;
+ break;
+ default:
+ token->type = CHARACTER;
+ }
+ return 1;
+}
+
+/* Functions for parser. */
+
+/* Entry point of the parser.
+ Parse the regular expression REGEXP and return the structure tree.
+ If an error is occured, ERR is set by error code, and return NULL.
+ This function build the following tree, from regular expression <reg_exp>:
+ CAT
+ / \
+ / \
+ <reg_exp> EOR
+
+ CAT means concatenation.
+ EOR means end of regular expression. */
+
+static bin_tree_t *
+parse (regexp, preg, syntax, err)
+ re_string_t *regexp;
+ regex_t *preg;
+ reg_syntax_t syntax;
+ reg_errcode_t *err;
+{
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ bin_tree_t *tree, *eor, *root;
+ re_token_t current_token;
+ int new_idx;
+ current_token = fetch_token (regexp, syntax);
+ tree = parse_reg_exp (regexp, preg, &current_token, syntax, 0, err);
+ if (BE (*err != REG_NOERROR && tree == NULL, 0))
+ return NULL;
+ new_idx = re_dfa_add_node (dfa, current_token, 0);
+ eor = create_tree (NULL, NULL, 0, new_idx);
+ if (tree != NULL)
+ root = create_tree (tree, eor, CONCAT, 0);
+ else
+ root = eor;
+ if (BE (new_idx == -1 || eor == NULL || root == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ return root;
+}
+
+/* This function build the following tree, from regular expression
+ <branch1>|<branch2>:
+ ALT
+ / \
+ / \
+ <branch1> <branch2>
+
+ ALT means alternative, which represents the operator `|'. */
+
+static bin_tree_t *
+parse_reg_exp (regexp, preg, token, syntax, nest, err)
+ re_string_t *regexp;
+ regex_t *preg;
+ re_token_t *token;
+ reg_syntax_t syntax;
+ int nest;
+ reg_errcode_t *err;
+{
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ bin_tree_t *tree, *branch = NULL;
+ int new_idx;
+ tree = parse_branch (regexp, preg, token, syntax, nest, err);
+ if (BE (*err != REG_NOERROR && tree == NULL, 0))
+ return NULL;
+
+ while (token->type == OP_ALT)
+ {
+ re_token_t alt_token;
+ alt_token = *token;
+ new_idx = re_dfa_add_node (dfa, alt_token, 0);
+ *token = fetch_token (regexp, syntax);
+ if (token->type != OP_ALT && token->type != END_OF_RE
+ && (nest == 0 || token->type != OP_CLOSE_SUBEXP))
+ {
+ branch = parse_branch (regexp, preg, token, syntax, nest, err);
+ if (BE (*err != REG_NOERROR && branch == NULL, 0))
+ {
+ free_bin_tree (tree);
+ return NULL;
+ }
+ }
+ else
+ branch = NULL;
+ tree = create_tree (tree, branch, 0, new_idx);
+ if (BE (new_idx == -1 || tree == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ dfa->has_plural_match = 1;
+ }
+ return tree;
+}
+
+/* This function build the following tree, from regular expression
+ <exp1><exp2>:
+ CAT
+ / \
+ / \
+ <exp1> <exp2>
+
+ CAT means concatenation. */
+
+static bin_tree_t *
+parse_branch (regexp, preg, token, syntax, nest, err)
+ re_string_t *regexp;
+ regex_t *preg;
+ re_token_t *token;
+ reg_syntax_t syntax;
+ int nest;
+ reg_errcode_t *err;
+{
+ bin_tree_t *tree, *exp;
+ tree = parse_expression (regexp, preg, token, syntax, nest, err);
+ if (BE (*err != REG_NOERROR && tree == NULL, 0))
+ return NULL;
+
+ while (token->type != OP_ALT && token->type != END_OF_RE
+ && (nest == 0 || token->type != OP_CLOSE_SUBEXP))
+ {
+ exp = parse_expression (regexp, preg, token, syntax, nest, err);
+ if (BE (*err != REG_NOERROR && exp == NULL, 0))
+ {
+ free_bin_tree (tree);
+ return NULL;
+ }
+ if (tree != NULL && exp != NULL)
+ {
+ tree = create_tree (tree, exp, CONCAT, 0);
+ if (tree == NULL)
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ else if (tree == NULL)
+ tree = exp;
+ /* Otherwise exp == NULL, we don't need to create new tree. */
+ }
+ return tree;
+}
+
+/* This function build the following tree, from regular expression a*:
+ *
+ |
+ a
+*/
+
+static bin_tree_t *
+parse_expression (regexp, preg, token, syntax, nest, err)
+ re_string_t *regexp;
+ regex_t *preg;
+ re_token_t *token;
+ reg_syntax_t syntax;
+ int nest;
+ reg_errcode_t *err;
+{
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ bin_tree_t *tree;
+ int new_idx;
+ switch (token->type)
+ {
+ case CHARACTER:
+ new_idx = re_dfa_add_node (dfa, *token, 0);
+ tree = create_tree (NULL, NULL, 0, new_idx);
+ if (BE (new_idx == -1 || tree == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max > 1)
+ {
+ while (!re_string_eoi (regexp)
+ && !re_string_first_byte (regexp, re_string_cur_idx (regexp)))
+ {
+ bin_tree_t *mbc_remain;
+ *token = fetch_token (regexp, syntax);
+ new_idx = re_dfa_add_node (dfa, *token, 0);
+ mbc_remain = create_tree (NULL, NULL, 0, new_idx);
+ tree = create_tree (tree, mbc_remain, CONCAT, 0);
+ if (BE (new_idx == -1 || mbc_remain == NULL || tree == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ }
+#endif
+ break;
+ case OP_OPEN_SUBEXP:
+ tree = parse_sub_exp (regexp, preg, token, syntax, nest + 1, err);
+ if (BE (*err != REG_NOERROR && tree == NULL, 0))
+ return NULL;
+ break;
+ case OP_OPEN_BRACKET:
+ tree = parse_bracket_exp (regexp, dfa, token, syntax, err);
+ if (BE (*err != REG_NOERROR && tree == NULL, 0))
+ return NULL;
+ break;
+ case OP_BACK_REF:
+ if (BE (preg->re_nsub < token->opr.idx
+ || dfa->subexps[token->opr.idx - 1].end == -1, 0))
+ {
+ *err = REG_ESUBREG;
+ return NULL;
+ }
+ dfa->used_bkref_map |= 1UL << (token->opr.idx - 1);
+ new_idx = re_dfa_add_node (dfa, *token, 0);
+ tree = create_tree (NULL, NULL, 0, new_idx);
+ if (BE (new_idx == -1 || tree == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ ++dfa->nbackref;
+ dfa->has_mb_node = 1;
+ break;
+ case OP_DUP_ASTERISK:
+ case OP_DUP_PLUS:
+ case OP_DUP_QUESTION:
+ case OP_OPEN_DUP_NUM:
+ if (syntax & RE_CONTEXT_INVALID_OPS)
+ {
+ *err = REG_BADRPT;
+ return NULL;
+ }
+ else if (syntax & RE_CONTEXT_INDEP_OPS)
+ {
+ *token = fetch_token (regexp, syntax);
+ return parse_expression (regexp, preg, token, syntax, nest, err);
+ }
+ /* else fall through */
+ case OP_CLOSE_SUBEXP:
+ if ((token->type == OP_CLOSE_SUBEXP) &&
+ !(syntax & RE_UNMATCHED_RIGHT_PAREN_ORD))
+ {
+ *err = REG_ERPAREN;
+ return NULL;
+ }
+ /* else fall through */
+ case OP_CLOSE_DUP_NUM:
+ /* We treat it as a normal character. */
+
+ /* Then we can these characters as normal characters. */
+ token->type = CHARACTER;
+ new_idx = re_dfa_add_node (dfa, *token, 0);
+ tree = create_tree (NULL, NULL, 0, new_idx);
+ if (BE (new_idx == -1 || tree == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ break;
+ case ANCHOR:
+ if (dfa->word_char == NULL)
+ {
+ *err = init_word_char (dfa);
+ if (BE (*err != REG_NOERROR, 0))
+ return NULL;
+ }
+ if (token->opr.ctx_type == WORD_DELIM)
+ {
+ bin_tree_t *tree_first, *tree_last;
+ int idx_first, idx_last;
+ token->opr.ctx_type = WORD_FIRST;
+ idx_first = re_dfa_add_node (dfa, *token, 0);
+ tree_first = create_tree (NULL, NULL, 0, idx_first);
+ token->opr.ctx_type = WORD_LAST;
+ idx_last = re_dfa_add_node (dfa, *token, 0);
+ tree_last = create_tree (NULL, NULL, 0, idx_last);
+ token->type = OP_ALT;
+ new_idx = re_dfa_add_node (dfa, *token, 0);
+ tree = create_tree (tree_first, tree_last, 0, new_idx);
+ if (BE (idx_first == -1 || idx_last == -1 || new_idx == -1
+ || tree_first == NULL || tree_last == NULL
+ || tree == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ else
+ {
+ new_idx = re_dfa_add_node (dfa, *token, 0);
+ tree = create_tree (NULL, NULL, 0, new_idx);
+ if (BE (new_idx == -1 || tree == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ /* We must return here, since ANCHORs can't be followed
+ by repetition operators.
+ eg. RE"^*" is invalid or "<ANCHOR(^)><CHAR(*)>",
+ it must not be "<ANCHOR(^)><REPEAT(*)>". */
+ *token = fetch_token (regexp, syntax);
+ return tree;
+ case OP_PERIOD:
+ new_idx = re_dfa_add_node (dfa, *token, 0);
+ tree = create_tree (NULL, NULL, 0, new_idx);
+ if (BE (new_idx == -1 || tree == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max > 1)
+ dfa->has_mb_node = 1;
+#endif
+ break;
+ case OP_WORD:
+ tree = build_word_op (dfa, regexp->trans, 0, err);
+ if (BE (*err != REG_NOERROR && tree == NULL, 0))
+ return NULL;
+ break;
+ case OP_NOTWORD:
+ tree = build_word_op (dfa, regexp->trans, 1, err);
+ if (BE (*err != REG_NOERROR && tree == NULL, 0))
+ return NULL;
+ break;
+ case OP_ALT:
+ case END_OF_RE:
+ return NULL;
+ case BACK_SLASH:
+ *err = REG_EESCAPE;
+ return NULL;
+ default:
+ /* Must not happen? */
+#ifdef DEBUG
+ assert (0);
+#endif
+ return NULL;
+ }
+ *token = fetch_token (regexp, syntax);
+
+ while (token->type == OP_DUP_ASTERISK || token->type == OP_DUP_PLUS
+ || token->type == OP_DUP_QUESTION || token->type == OP_OPEN_DUP_NUM)
+ {
+ tree = parse_dup_op (tree, regexp, dfa, token, syntax, err);
+ if (BE (*err != REG_NOERROR && tree == NULL, 0))
+ return NULL;
+ dfa->has_plural_match = 1;
+ }
+
+ return tree;
+}
+
+/* This function build the following tree, from regular expression
+ (<reg_exp>):
+ SUBEXP
+ |
+ <reg_exp>
+*/
+
+static bin_tree_t *
+parse_sub_exp (regexp, preg, token, syntax, nest, err)
+ re_string_t *regexp;
+ regex_t *preg;
+ re_token_t *token;
+ reg_syntax_t syntax;
+ int nest;
+ reg_errcode_t *err;
+{
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ bin_tree_t *tree, *left_par, *right_par;
+ size_t cur_nsub;
+ int new_idx;
+ cur_nsub = preg->re_nsub++;
+ if (dfa->subexps_alloc < preg->re_nsub)
+ {
+ re_subexp_t *new_array;
+ dfa->subexps_alloc *= 2;
+ new_array = re_realloc (dfa->subexps, re_subexp_t, dfa->subexps_alloc);
+ if (BE (new_array == NULL, 0))
+ {
+ dfa->subexps_alloc /= 2;
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ dfa->subexps = new_array;
+ }
+ dfa->subexps[cur_nsub].start = dfa->nodes_len;
+ dfa->subexps[cur_nsub].end = -1;
+
+ new_idx = re_dfa_add_node (dfa, *token, 0);
+ left_par = create_tree (NULL, NULL, 0, new_idx);
+ if (BE (new_idx == -1 || left_par == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ dfa->nodes[new_idx].opr.idx = cur_nsub;
+ *token = fetch_token (regexp, syntax);
+
+ /* The subexpression may be a null string. */
+ if (token->type == OP_CLOSE_SUBEXP)
+ tree = NULL;
+ else
+ {
+ tree = parse_reg_exp (regexp, preg, token, syntax, nest, err);
+ if (BE (*err != REG_NOERROR && tree == NULL, 0))
+ return NULL;
+ }
+ if (BE (token->type != OP_CLOSE_SUBEXP, 0))
+ {
+ free_bin_tree (tree);
+ *err = REG_BADPAT;
+ return NULL;
+ }
+ new_idx = re_dfa_add_node (dfa, *token, 0);
+ dfa->subexps[cur_nsub].end = dfa->nodes_len;
+ right_par = create_tree (NULL, NULL, 0, new_idx);
+ tree = ((tree == NULL) ? right_par
+ : create_tree (tree, right_par, CONCAT, 0));
+ tree = create_tree (left_par, tree, CONCAT, 0);
+ if (BE (new_idx == -1 || right_par == NULL || tree == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ dfa->nodes[new_idx].opr.idx = cur_nsub;
+
+ return tree;
+}
+
+/* This function parse repetition operators like "*", "+", "{1,3}" etc. */
+
+static bin_tree_t *
+parse_dup_op (dup_elem, regexp, dfa, token, syntax, err)
+ bin_tree_t *dup_elem;
+ re_string_t *regexp;
+ re_dfa_t *dfa;
+ re_token_t *token;
+ reg_syntax_t syntax;
+ reg_errcode_t *err;
+{
+ re_token_t dup_token;
+ bin_tree_t *tree = dup_elem, *work_tree;
+ int new_idx, start_idx = re_string_cur_idx (regexp);
+ re_token_t start_token;
+ start_token = *token;
+ if (token->type == OP_OPEN_DUP_NUM)
+ {
+ int i;
+ int end = 0;
+ int start = fetch_number (regexp, token, syntax);
+ bin_tree_t *elem;
+ if (start == -1)
+ {
+ if (token->type == CHARACTER && token->opr.c == ',')
+ start = 0; /* We treat "{,m}" as "{0,m}". */
+ else
+ {
+ *err = REG_BADBR; /* <re>{} is invalid. */
+ return NULL;
+ }
+ }
+ if (BE (start != -2, 1))
+ {
+ /* We treat "{n}" as "{n,n}". */
+ end = ((token->type == OP_CLOSE_DUP_NUM) ? start
+ : ((token->type == CHARACTER && token->opr.c == ',')
+ ? fetch_number (regexp, token, syntax) : -2));
+ }
+ if (BE (start == -2 || end == -2, 0))
+ {
+ /* Invalid sequence. */
+ if (token->type == OP_CLOSE_DUP_NUM)
+ goto parse_dup_op_invalid_interval;
+ else
+ goto parse_dup_op_ebrace;
+ }
+ if (BE (start == 0 && end == 0, 0))
+ {
+ /* We treat "<re>{0}" and "<re>{0,0}" as null string. */
+ *token = fetch_token (regexp, syntax);
+ free_bin_tree (dup_elem);
+ return NULL;
+ }
+
+ /* Extract "<re>{n,m}" to "<re><re>...<re><re>{0,<m-n>}". */
+ elem = tree;
+ for (i = 0; i < start; ++i)
+ if (i != 0)
+ {
+ work_tree = duplicate_tree (elem, dfa);
+ tree = create_tree (tree, work_tree, CONCAT, 0);
+ if (BE (work_tree == NULL || tree == NULL, 0))
+ goto parse_dup_op_espace;
+ }
+
+ if (end == -1)
+ {
+ /* We treat "<re>{0,}" as "<re>*". */
+ dup_token.type = OP_DUP_ASTERISK;
+ if (start > 0)
+ {
+ elem = duplicate_tree (elem, dfa);
+ new_idx = re_dfa_add_node (dfa, dup_token, 0);
+ work_tree = create_tree (elem, NULL, 0, new_idx);
+ tree = create_tree (tree, work_tree, CONCAT, 0);
+ if (BE (elem == NULL || new_idx == -1 || work_tree == NULL
+ || tree == NULL, 0))
+ goto parse_dup_op_espace;
+ }
+ else
+ {
+ new_idx = re_dfa_add_node (dfa, dup_token, 0);
+ tree = create_tree (elem, NULL, 0, new_idx);
+ if (BE (new_idx == -1 || tree == NULL, 0))
+ goto parse_dup_op_espace;
+ }
+ }
+ else if (end - start > 0)
+ {
+ /* Then extract "<re>{0,m}" to "<re>?<re>?...<re>?". */
+ dup_token.type = OP_DUP_QUESTION;
+ if (start > 0)
+ {
+ elem = duplicate_tree (elem, dfa);
+ new_idx = re_dfa_add_node (dfa, dup_token, 0);
+ elem = create_tree (elem, NULL, 0, new_idx);
+ tree = create_tree (tree, elem, CONCAT, 0);
+ if (BE (elem == NULL || new_idx == -1 || tree == NULL, 0))
+ goto parse_dup_op_espace;
+ }
+ else
+ {
+ new_idx = re_dfa_add_node (dfa, dup_token, 0);
+ tree = elem = create_tree (elem, NULL, 0, new_idx);
+ if (BE (new_idx == -1 || tree == NULL, 0))
+ goto parse_dup_op_espace;
+ }
+ for (i = 1; i < end - start; ++i)
+ {
+ work_tree = duplicate_tree (elem, dfa);
+ tree = create_tree (tree, work_tree, CONCAT, 0);
+ if (BE (work_tree == NULL || tree == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ }
+ }
+ else
+ {
+ new_idx = re_dfa_add_node (dfa, *token, 0);
+ tree = create_tree (tree, NULL, 0, new_idx);
+ if (BE (new_idx == -1 || tree == NULL, 0))
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+ }
+ *token = fetch_token (regexp, syntax);
+ return tree;
+
+ parse_dup_op_espace:
+ free_bin_tree (tree);
+ *err = REG_ESPACE;
+ return NULL;
+
+ parse_dup_op_ebrace:
+ if (BE (!(syntax & RE_INVALID_INTERVAL_ORD), 0))
+ {
+ *err = REG_EBRACE;
+ return NULL;
+ }
+ goto parse_dup_op_rollback;
+ parse_dup_op_invalid_interval:
+ if (BE (!(syntax & RE_INVALID_INTERVAL_ORD), 0))
+ {
+ *err = REG_BADBR;
+ return NULL;
+ }
+ parse_dup_op_rollback:
+ re_string_set_index (regexp, start_idx);
+ *token = start_token;
+ token->type = CHARACTER;
+ return dup_elem;
+}
+
+/* Size of the names for collating symbol/equivalence_class/character_class.
+ I'm not sure, but maybe enough. */
+#define BRACKET_NAME_BUF_SIZE 32
+
+#ifndef _LIBC
+ /* Local function for parse_bracket_exp only used in case of NOT _LIBC.
+ Build the range expression which starts from START_ELEM, and ends
+ at END_ELEM. The result are written to MBCSET and SBCSET.
+ RANGE_ALLOC is the allocated size of mbcset->range_starts, and
+ mbcset->range_ends, is a pointer argument sinse we may
+ update it. */
+
+static reg_errcode_t
+# ifdef RE_ENABLE_I18N
+build_range_exp (sbcset, mbcset, range_alloc, start_elem, end_elem)
+ re_charset_t *mbcset;
+ int *range_alloc;
+# else /* not RE_ENABLE_I18N */
+build_range_exp (sbcset, start_elem, end_elem)
+# endif /* not RE_ENABLE_I18N */
+ re_bitset_ptr_t sbcset;
+ bracket_elem_t *start_elem, *end_elem;
+{
+ unsigned int start_ch, end_ch;
+ /* Equivalence Classes and Character Classes can't be a range start/end. */
+ if (BE (start_elem->type == EQUIV_CLASS || start_elem->type == CHAR_CLASS
+ || end_elem->type == EQUIV_CLASS || end_elem->type == CHAR_CLASS,
+ 0))
+ return REG_ERANGE;
+
+ /* We can handle no multi character collating elements without libc
+ support. */
+ if (BE ((start_elem->type == COLL_SYM
+ && strlen ((char *) start_elem->opr.name) > 1)
+ || (end_elem->type == COLL_SYM
+ && strlen ((char *) end_elem->opr.name) > 1), 0))
+ return REG_ECOLLATE;
+
+# ifdef RE_ENABLE_I18N
+ {
+ wchar_t wc, start_wc, end_wc;
+ wchar_t cmp_buf[6] = {L'\0', L'\0', L'\0', L'\0', L'\0', L'\0'};
+
+ start_ch = ((start_elem->type == SB_CHAR) ? start_elem->opr.ch
+ : ((start_elem->type == COLL_SYM) ? start_elem->opr.name[0]
+ : 0));
+ end_ch = ((end_elem->type == SB_CHAR) ? end_elem->opr.ch
+ : ((end_elem->type == COLL_SYM) ? end_elem->opr.name[0]
+ : 0));
+ start_wc = ((start_elem->type == SB_CHAR || start_elem->type == COLL_SYM)
+ ? __btowc (start_ch) : start_elem->opr.wch);
+ end_wc = ((end_elem->type == SB_CHAR || end_elem->type == COLL_SYM)
+ ? __btowc (end_ch) : end_elem->opr.wch);
+ cmp_buf[0] = start_wc;
+ cmp_buf[4] = end_wc;
+ if (wcscoll (cmp_buf, cmp_buf + 4) > 0)
+ return REG_ERANGE;
+
+ /* Check the space of the arrays. */
+ if (*range_alloc == mbcset->nranges)
+ {
+ /* There are not enough space, need realloc. */
+ wchar_t *new_array_start, *new_array_end;
+ int new_nranges;
+
+ /* +1 in case of mbcset->nranges is 0. */
+ new_nranges = 2 * mbcset->nranges + 1;
+ /* Use realloc since mbcset->range_starts and mbcset->range_ends
+ are NULL if *range_alloc == 0. */
+ new_array_start = re_realloc (mbcset->range_starts, wchar_t,
+ new_nranges);
+ new_array_end = re_realloc (mbcset->range_ends, wchar_t,
+ new_nranges);
+
+ if (BE (new_array_start == NULL || new_array_end == NULL, 0))
+ return REG_ESPACE;
+
+ mbcset->range_starts = new_array_start;
+ mbcset->range_ends = new_array_end;
+ *range_alloc = new_nranges;
+ }
+
+ mbcset->range_starts[mbcset->nranges] = start_wc;
+ mbcset->range_ends[mbcset->nranges++] = end_wc;
+
+ /* Build the table for single byte characters. */
+ for (wc = 0; wc <= SBC_MAX; ++wc)
+ {
+ cmp_buf[2] = wc;
+ if (wcscoll (cmp_buf, cmp_buf + 2) <= 0
+ && wcscoll (cmp_buf + 2, cmp_buf + 4) <= 0)
+ bitset_set (sbcset, wc);
+ }
+ }
+# else /* not RE_ENABLE_I18N */
+ {
+ unsigned int ch;
+ start_ch = ((start_elem->type == SB_CHAR ) ? start_elem->opr.ch
+ : ((start_elem->type == COLL_SYM) ? start_elem->opr.name[0]
+ : 0));
+ end_ch = ((end_elem->type == SB_CHAR ) ? end_elem->opr.ch
+ : ((end_elem->type == COLL_SYM) ? end_elem->opr.name[0]
+ : 0));
+ if (start_ch > end_ch)
+ return REG_ERANGE;
+ /* Build the table for single byte characters. */
+ for (ch = 0; ch <= SBC_MAX; ++ch)
+ if (start_ch <= ch && ch <= end_ch)
+ bitset_set (sbcset, ch);
+ }
+# endif /* not RE_ENABLE_I18N */
+ return REG_NOERROR;
+}
+#endif /* not _LIBC */
+
+#ifndef _LIBC
+/* Helper function for parse_bracket_exp only used in case of NOT _LIBC..
+ Build the collating element which is represented by NAME.
+ The result are written to MBCSET and SBCSET.
+ COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a
+ pointer argument since we may update it. */
+
+static reg_errcode_t
+# ifdef RE_ENABLE_I18N
+build_collating_symbol (sbcset, mbcset, coll_sym_alloc, name)
+ re_charset_t *mbcset;
+ int *coll_sym_alloc;
+# else /* not RE_ENABLE_I18N */
+build_collating_symbol (sbcset, name)
+# endif /* not RE_ENABLE_I18N */
+ re_bitset_ptr_t sbcset;
+ const unsigned char *name;
+{
+ size_t name_len = strlen ((const char *) name);
+ if (BE (name_len != 1, 0))
+ return REG_ECOLLATE;
+ else
+ {
+ bitset_set (sbcset, name[0]);
+ return REG_NOERROR;
+ }
+}
+#endif /* not _LIBC */
+
+/* This function parse bracket expression like "[abc]", "[a-c]",
+ "[[.a-a.]]" etc. */
+
+static bin_tree_t *
+parse_bracket_exp (regexp, dfa, token, syntax, err)
+ re_string_t *regexp;
+ re_dfa_t *dfa;
+ re_token_t *token;
+ reg_syntax_t syntax;
+ reg_errcode_t *err;
+{
+#ifdef _LIBC
+ const unsigned char *collseqmb;
+ const char *collseqwc;
+ uint32_t nrules;
+ int32_t table_size;
+ const int32_t *symb_table;
+ const unsigned char *extra;
+
+ /* Local function for parse_bracket_exp used in _LIBC environement.
+ Seek the collating symbol entry correspondings to NAME.
+ Return the index of the symbol in the SYMB_TABLE. */
+
+ static inline int32_t
+ seek_collating_symbol_entry (name, name_len)
+ const unsigned char *name;
+ size_t name_len;
+ {
+ int32_t hash = elem_hash ((const char *) name, name_len);
+ int32_t elem = hash % table_size;
+ int32_t second = hash % (table_size - 2);
+ while (symb_table[2 * elem] != 0)
+ {
+ /* First compare the hashing value. */
+ if (symb_table[2 * elem] == hash
+ /* Compare the length of the name. */
+ && name_len == extra[symb_table[2 * elem + 1]]
+ /* Compare the name. */
+ && memcmp (name, &extra[symb_table[2 * elem + 1] + 1],
+ name_len) == 0)
+ {
+ /* Yep, this is the entry. */
+ break;
+ }
+
+ /* Next entry. */
+ elem += second;
+ }
+ return elem;
+ }
+
+ /* Local function for parse_bracket_exp used in _LIBC environement.
+ Look up the collation sequence value of BR_ELEM.
+ Return the value if succeeded, UINT_MAX otherwise. */
+
+ static inline unsigned int
+ lookup_collation_sequence_value (br_elem)
+ bracket_elem_t *br_elem;
+ {
+ if (br_elem->type == SB_CHAR)
+ {
+ /*
+ if (re_mb_cur_max == 1)
+ */
+ if (nrules == 0)
+ return collseqmb[br_elem->opr.ch];
+ else
+ {
+ wint_t wc = __btowc (br_elem->opr.ch);
+ return collseq_table_lookup (collseqwc, wc);
+ }
+ }
+ else if (br_elem->type == MB_CHAR)
+ {
+ return collseq_table_lookup (collseqwc, br_elem->opr.wch);
+ }
+ else if (br_elem->type == COLL_SYM)
+ {
+ size_t sym_name_len = strlen ((char *) br_elem->opr.name);
+ if (nrules != 0)
+ {
+ int32_t elem, idx;
+ elem = seek_collating_symbol_entry (br_elem->opr.name,
+ sym_name_len);
+ if (symb_table[2 * elem] != 0)
+ {
+ /* We found the entry. */
+ idx = symb_table[2 * elem + 1];
+ /* Skip the name of collating element name. */
+ idx += 1 + extra[idx];
+ /* Skip the byte sequence of the collating element. */
+ idx += 1 + extra[idx];
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~3;
+ /* Skip the multibyte collation sequence value. */
+ idx += sizeof (unsigned int);
+ /* Skip the wide char sequence of the collating element. */
+ idx += sizeof (unsigned int) *
+ (1 + *(unsigned int *) (extra + idx));
+ /* Return the collation sequence value. */
+ return *(unsigned int *) (extra + idx);
+ }
+ else if (symb_table[2 * elem] == 0 && sym_name_len == 1)
+ {
+ /* No valid character. Match it as a single byte
+ character. */
+ return collseqmb[br_elem->opr.name[0]];
+ }
+ }
+ else if (sym_name_len == 1)
+ return collseqmb[br_elem->opr.name[0]];
+ }
+ return UINT_MAX;
+ }
+
+ /* Local function for parse_bracket_exp used in _LIBC environement.
+ Build the range expression which starts from START_ELEM, and ends
+ at END_ELEM. The result are written to MBCSET and SBCSET.
+ RANGE_ALLOC is the allocated size of mbcset->range_starts, and
+ mbcset->range_ends, is a pointer argument sinse we may
+ update it. */
+
+ static inline reg_errcode_t
+# ifdef RE_ENABLE_I18N
+ build_range_exp (sbcset, mbcset, range_alloc, start_elem, end_elem)
+ re_charset_t *mbcset;
+ int *range_alloc;
+# else /* not RE_ENABLE_I18N */
+ build_range_exp (sbcset, start_elem, end_elem)
+# endif /* not RE_ENABLE_I18N */
+ re_bitset_ptr_t sbcset;
+ bracket_elem_t *start_elem, *end_elem;
+ {
+ unsigned int ch;
+ uint32_t start_collseq;
+ uint32_t end_collseq;
+
+# ifdef RE_ENABLE_I18N
+ /* Check the space of the arrays. */
+ if (*range_alloc == mbcset->nranges)
+ {
+ /* There are not enough space, need realloc. */
+ uint32_t *new_array_start;
+ uint32_t *new_array_end;
+ int new_nranges;
+
+ /* +1 in case of mbcset->nranges is 0. */
+ new_nranges = 2 * mbcset->nranges + 1;
+ /* Use realloc since mbcset->range_starts and mbcset->range_ends
+ are NULL if *range_alloc == 0. */
+ new_array_start = re_realloc (mbcset->range_starts, uint32_t,
+ new_nranges);
+ new_array_end = re_realloc (mbcset->range_ends, uint32_t,
+ new_nranges);
+
+ if (BE (new_array_start == NULL || new_array_end == NULL, 0))
+ return REG_ESPACE;
+
+ mbcset->range_starts = new_array_start;
+ mbcset->range_ends = new_array_end;
+ *range_alloc = new_nranges;
+ }
+# endif /* RE_ENABLE_I18N */
+
+ /* Equivalence Classes and Character Classes can't be a range
+ start/end. */
+ if (BE (start_elem->type == EQUIV_CLASS || start_elem->type == CHAR_CLASS
+ || end_elem->type == EQUIV_CLASS || end_elem->type == CHAR_CLASS,
+ 0))
+ return REG_ERANGE;
+
+ start_collseq = lookup_collation_sequence_value (start_elem);
+ end_collseq = lookup_collation_sequence_value (end_elem);
+ /* Check start/end collation sequence values. */
+ if (BE (start_collseq == UINT_MAX || end_collseq == UINT_MAX, 0))
+ return REG_ECOLLATE;
+ if (BE ((syntax & RE_NO_EMPTY_RANGES) && start_collseq > end_collseq, 0))
+ return REG_ERANGE;
+
+# ifdef RE_ENABLE_I18N
+ /* Got valid collation sequence values, add them as a new entry. */
+ mbcset->range_starts[mbcset->nranges] = start_collseq;
+ mbcset->range_ends[mbcset->nranges++] = end_collseq;
+# endif /* RE_ENABLE_I18N */
+
+ /* Build the table for single byte characters. */
+ for (ch = 0; ch <= SBC_MAX; ch++)
+ {
+ uint32_t ch_collseq;
+ /*
+ if (re_mb_cur_max == 1)
+ */
+ if (nrules == 0)
+ ch_collseq = collseqmb[ch];
+ else
+ ch_collseq = collseq_table_lookup (collseqwc, __btowc (ch));
+ if (start_collseq <= ch_collseq && ch_collseq <= end_collseq)
+ bitset_set (sbcset, ch);
+ }
+ return REG_NOERROR;
+ }
+
+ /* Local function for parse_bracket_exp used in _LIBC environement.
+ Build the collating element which is represented by NAME.
+ The result are written to MBCSET and SBCSET.
+ COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a
+ pointer argument sinse we may update it. */
+
+ static inline reg_errcode_t
+# ifdef RE_ENABLE_I18N
+ build_collating_symbol (sbcset, mbcset, coll_sym_alloc, name)
+ re_charset_t *mbcset;
+ int *coll_sym_alloc;
+# else /* not RE_ENABLE_I18N */
+ build_collating_symbol (sbcset, name)
+# endif /* not RE_ENABLE_I18N */
+ re_bitset_ptr_t sbcset;
+ const unsigned char *name;
+ {
+ int32_t elem, idx;
+ size_t name_len = strlen ((const char *) name);
+ if (nrules != 0)
+ {
+ elem = seek_collating_symbol_entry (name, name_len);
+ if (symb_table[2 * elem] != 0)
+ {
+ /* We found the entry. */
+ idx = symb_table[2 * elem + 1];
+ /* Skip the name of collating element name. */
+ idx += 1 + extra[idx];
+ }
+ else if (symb_table[2 * elem] == 0 && name_len == 1)
+ {
+ /* No valid character, treat it as a normal
+ character. */
+ bitset_set (sbcset, name[0]);
+ return REG_NOERROR;
+ }
+ else
+ return REG_ECOLLATE;
+
+# ifdef RE_ENABLE_I18N
+ /* Got valid collation sequence, add it as a new entry. */
+ /* Check the space of the arrays. */
+ if (*coll_sym_alloc == mbcset->ncoll_syms)
+ {
+ /* Not enough, realloc it. */
+ /* +1 in case of mbcset->ncoll_syms is 0. */
+ *coll_sym_alloc = 2 * mbcset->ncoll_syms + 1;
+ /* Use realloc since mbcset->coll_syms is NULL
+ if *alloc == 0. */
+ mbcset->coll_syms = re_realloc (mbcset->coll_syms, int32_t,
+ *coll_sym_alloc);
+ if (BE (mbcset->coll_syms == NULL, 0))
+ return REG_ESPACE;
+ }
+ mbcset->coll_syms[mbcset->ncoll_syms++] = idx;
+# endif /* RE_ENABLE_I18N */
+ return REG_NOERROR;
+ }
+ else
+ {
+ if (BE (name_len != 1, 0))
+ return REG_ECOLLATE;
+ else
+ {
+ bitset_set (sbcset, name[0]);
+ return REG_NOERROR;
+ }
+ }
+ }
+#endif
+
+ re_token_t br_token;
+ re_bitset_ptr_t sbcset;
+#ifdef RE_ENABLE_I18N
+ re_charset_t *mbcset;
+ int coll_sym_alloc = 0, range_alloc = 0, mbchar_alloc = 0;
+ int equiv_class_alloc = 0, char_class_alloc = 0;
+#else /* not RE_ENABLE_I18N */
+ int non_match = 0;
+#endif /* not RE_ENABLE_I18N */
+ bin_tree_t *work_tree;
+ int token_len, new_idx;
+#ifdef _LIBC
+ collseqmb = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQMB);
+ nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+ if (nrules)
+ {
+ /*
+ if (re_mb_cur_max > 1)
+ */
+ collseqwc = _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQWC);
+ table_size = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_SYMB_HASH_SIZEMB);
+ symb_table = (const int32_t *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_SYMB_TABLEMB);
+ extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_SYMB_EXTRAMB);
+ }
+#endif
+ sbcset = (re_bitset_ptr_t) calloc (sizeof (unsigned int), BITSET_UINTS);
+#ifdef RE_ENABLE_I18N
+ mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1);
+#endif /* RE_ENABLE_I18N */
+#ifdef RE_ENABLE_I18N
+ if (BE (sbcset == NULL || mbcset == NULL, 0))
+#else
+ if (BE (sbcset == NULL, 0))
+#endif /* RE_ENABLE_I18N */
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+
+ token_len = peek_token_bracket (token, regexp, syntax);
+ if (BE (token->type == END_OF_RE, 0))
+ {
+ *err = REG_BADPAT;
+ goto parse_bracket_exp_free_return;
+ }
+ if (token->type == OP_NON_MATCH_LIST)
+ {
+#ifdef RE_ENABLE_I18N
+ int i;
+ mbcset->non_match = 1;
+#else /* not RE_ENABLE_I18N */
+ non_match = 1;
+#endif /* not RE_ENABLE_I18N */
+ if (syntax & RE_HAT_LISTS_NOT_NEWLINE)
+ bitset_set (sbcset, '\0');
+ re_string_skip_bytes (regexp, token_len); /* Skip a token. */
+ token_len = peek_token_bracket (token, regexp, syntax);
+ if (BE (token->type == END_OF_RE, 0))
+ {
+ *err = REG_BADPAT;
+ goto parse_bracket_exp_free_return;
+ }
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max > 1)
+ for (i = 0; i < SBC_MAX; ++i)
+ if (__btowc (i) == WEOF)
+ bitset_set (sbcset, i);
+#endif /* RE_ENABLE_I18N */
+ }
+
+ /* We treat the first ']' as a normal character. */
+ if (token->type == OP_CLOSE_BRACKET)
+ token->type = CHARACTER;
+
+ while (1)
+ {
+ bracket_elem_t start_elem, end_elem;
+ unsigned char start_name_buf[BRACKET_NAME_BUF_SIZE];
+ unsigned char end_name_buf[BRACKET_NAME_BUF_SIZE];
+ reg_errcode_t ret;
+ int token_len2 = 0, is_range_exp = 0;
+ re_token_t token2;
+
+ start_elem.opr.name = start_name_buf;
+ ret = parse_bracket_element (&start_elem, regexp, token, token_len, dfa,
+ syntax);
+ if (BE (ret != REG_NOERROR, 0))
+ {
+ *err = ret;
+ goto parse_bracket_exp_free_return;
+ }
+
+ token_len = peek_token_bracket (token, regexp, syntax);
+ if (BE (token->type == END_OF_RE, 0))
+ {
+ *err = REG_BADPAT;
+ goto parse_bracket_exp_free_return;
+ }
+ if (token->type == OP_CHARSET_RANGE)
+ {
+ re_string_skip_bytes (regexp, token_len); /* Skip '-'. */
+ token_len2 = peek_token_bracket (&token2, regexp, syntax);
+ if (BE (token->type == END_OF_RE, 0))
+ {
+ *err = REG_BADPAT;
+ goto parse_bracket_exp_free_return;
+ }
+ if (token2.type == OP_CLOSE_BRACKET)
+ {
+ /* We treat the last '-' as a normal character. */
+ re_string_skip_bytes (regexp, -token_len);
+ token->type = CHARACTER;
+ }
+ else
+ is_range_exp = 1;
+ }
+
+ if (is_range_exp == 1)
+ {
+ end_elem.opr.name = end_name_buf;
+ ret = parse_bracket_element (&end_elem, regexp, &token2, token_len2,
+ dfa, syntax);
+ if (BE (ret != REG_NOERROR, 0))
+ {
+ *err = ret;
+ goto parse_bracket_exp_free_return;
+ }
+
+ token_len = peek_token_bracket (token, regexp, syntax);
+ if (BE (token->type == END_OF_RE, 0))
+ {
+ *err = REG_BADPAT;
+ goto parse_bracket_exp_free_return;
+ }
+ *err = build_range_exp (sbcset,
+#ifdef RE_ENABLE_I18N
+ mbcset, &range_alloc,
+#endif /* RE_ENABLE_I18N */
+ &start_elem, &end_elem);
+ if (BE (*err != REG_NOERROR, 0))
+ goto parse_bracket_exp_free_return;
+ }
+ else
+ {
+ switch (start_elem.type)
+ {
+ case SB_CHAR:
+ bitset_set (sbcset, start_elem.opr.ch);
+ break;
+#ifdef RE_ENABLE_I18N
+ case MB_CHAR:
+ /* Check whether the array has enough space. */
+ if (mbchar_alloc == mbcset->nmbchars)
+ {
+ /* Not enough, realloc it. */
+ /* +1 in case of mbcset->nmbchars is 0. */
+ mbchar_alloc = 2 * mbcset->nmbchars + 1;
+ /* Use realloc since array is NULL if *alloc == 0. */
+ mbcset->mbchars = re_realloc (mbcset->mbchars, wchar_t,
+ mbchar_alloc);
+ if (BE (mbcset->mbchars == NULL, 0))
+ goto parse_bracket_exp_espace;
+ }
+ mbcset->mbchars[mbcset->nmbchars++] = start_elem.opr.wch;
+ break;
+#endif /* RE_ENABLE_I18N */
+ case EQUIV_CLASS:
+ *err = build_equiv_class (sbcset,
+#ifdef RE_ENABLE_I18N
+ mbcset, &equiv_class_alloc,
+#endif /* RE_ENABLE_I18N */
+ start_elem.opr.name);
+ if (BE (*err != REG_NOERROR, 0))
+ goto parse_bracket_exp_free_return;
+ break;
+ case COLL_SYM:
+ *err = build_collating_symbol (sbcset,
+#ifdef RE_ENABLE_I18N
+ mbcset, &coll_sym_alloc,
+#endif /* RE_ENABLE_I18N */
+ start_elem.opr.name);
+ if (BE (*err != REG_NOERROR, 0))
+ goto parse_bracket_exp_free_return;
+ break;
+ case CHAR_CLASS:
+ ret = build_charclass (regexp->trans, sbcset,
+#ifdef RE_ENABLE_I18N
+ mbcset, &char_class_alloc,
+#endif /* RE_ENABLE_I18N */
+ start_elem.opr.name, syntax);
+ if (BE (ret != REG_NOERROR, 0))
+ goto parse_bracket_exp_espace;
+ break;
+ default:
+ assert (0);
+ break;
+ }
+ }
+ if (token->type == OP_CLOSE_BRACKET)
+ break;
+ }
+
+ re_string_skip_bytes (regexp, token_len); /* Skip a token. */
+
+ /* If it is non-matching list. */
+#ifdef RE_ENABLE_I18N
+ if (mbcset->non_match)
+#else /* not RE_ENABLE_I18N */
+ if (non_match)
+#endif /* not RE_ENABLE_I18N */
+ bitset_not (sbcset);
+
+ /* Build a tree for simple bracket. */
+ br_token.type = SIMPLE_BRACKET;
+ br_token.opr.sbcset = sbcset;
+ new_idx = re_dfa_add_node (dfa, br_token, 0);
+ work_tree = create_tree (NULL, NULL, 0, new_idx);
+ if (BE (new_idx == -1 || work_tree == NULL, 0))
+ goto parse_bracket_exp_espace;
+
+#ifdef RE_ENABLE_I18N
+ if (mbcset->nmbchars || mbcset->ncoll_syms || mbcset->nequiv_classes
+ || mbcset->nranges || (re_mb_cur_max > 1 && (mbcset->nchar_classes
+ || mbcset->non_match)))
+ {
+ re_token_t alt_token;
+ bin_tree_t *mbc_tree;
+ /* Build a tree for complex bracket. */
+ br_token.type = COMPLEX_BRACKET;
+ br_token.opr.mbcset = mbcset;
+ dfa->has_mb_node = 1;
+ new_idx = re_dfa_add_node (dfa, br_token, 0);
+ mbc_tree = create_tree (NULL, NULL, 0, new_idx);
+ if (BE (new_idx == -1 || mbc_tree == NULL, 0))
+ goto parse_bracket_exp_espace;
+ /* Then join them by ALT node. */
+ dfa->has_plural_match = 1;
+ alt_token.type = OP_ALT;
+ new_idx = re_dfa_add_node (dfa, alt_token, 0);
+ work_tree = create_tree (work_tree, mbc_tree, 0, new_idx);
+ if (BE (new_idx != -1 && mbc_tree != NULL, 1))
+ return work_tree;
+ }
+ else
+ {
+ free_charset (mbcset);
+ return work_tree;
+ }
+#else /* not RE_ENABLE_I18N */
+ return work_tree;
+#endif /* not RE_ENABLE_I18N */
+
+ parse_bracket_exp_espace:
+ *err = REG_ESPACE;
+ parse_bracket_exp_free_return:
+ re_free (sbcset);
+#ifdef RE_ENABLE_I18N
+ free_charset (mbcset);
+#endif /* RE_ENABLE_I18N */
+ return NULL;
+}
+
+/* Parse an element in the bracket expression. */
+
+static reg_errcode_t
+parse_bracket_element (elem, regexp, token, token_len, dfa, syntax)
+ bracket_elem_t *elem;
+ re_string_t *regexp;
+ re_token_t *token;
+ int token_len;
+ re_dfa_t *dfa;
+ reg_syntax_t syntax;
+{
+#ifdef RE_ENABLE_I18N
+ int cur_char_size;
+ cur_char_size = re_string_char_size_at (regexp, re_string_cur_idx (regexp));
+ if (cur_char_size > 1)
+ {
+ elem->type = MB_CHAR;
+ elem->opr.wch = re_string_wchar_at (regexp, re_string_cur_idx (regexp));
+ re_string_skip_bytes (regexp, cur_char_size);
+ return REG_NOERROR;
+ }
+#endif /* RE_ENABLE_I18N */
+ re_string_skip_bytes (regexp, token_len); /* Skip a token. */
+ if (token->type == OP_OPEN_COLL_ELEM || token->type == OP_OPEN_CHAR_CLASS
+ || token->type == OP_OPEN_EQUIV_CLASS)
+ return parse_bracket_symbol (elem, regexp, token);
+ elem->type = SB_CHAR;
+ elem->opr.ch = token->opr.c;
+ return REG_NOERROR;
+}
+
+/* Parse a bracket symbol in the bracket expression. Bracket symbols are
+ such as [:<character_class>:], [.<collating_element>.], and
+ [=<equivalent_class>=]. */
+
+static reg_errcode_t
+parse_bracket_symbol (elem, regexp, token)
+ bracket_elem_t *elem;
+ re_string_t *regexp;
+ re_token_t *token;
+{
+ unsigned char ch, delim = token->opr.c;
+ int i = 0;
+ for (;; ++i)
+ {
+ if (re_string_eoi(regexp) || i >= BRACKET_NAME_BUF_SIZE)
+ return REG_EBRACK;
+ if (token->type == OP_OPEN_CHAR_CLASS)
+ ch = re_string_fetch_byte_case (regexp);
+ else
+ ch = re_string_fetch_byte (regexp);
+ if (ch == delim && re_string_peek_byte (regexp, 0) == ']')
+ break;
+ elem->opr.name[i] = ch;
+ }
+ re_string_skip_bytes (regexp, 1);
+ elem->opr.name[i] = '\0';
+ switch (token->type)
+ {
+ case OP_OPEN_COLL_ELEM:
+ elem->type = COLL_SYM;
+ break;
+ case OP_OPEN_EQUIV_CLASS:
+ elem->type = EQUIV_CLASS;
+ break;
+ case OP_OPEN_CHAR_CLASS:
+ elem->type = CHAR_CLASS;
+ break;
+ default:
+ break;
+ }
+ return REG_NOERROR;
+}
+
+ /* Helper function for parse_bracket_exp.
+ Build the equivalence class which is represented by NAME.
+ The result are written to MBCSET and SBCSET.
+ EQUIV_CLASS_ALLOC is the allocated size of mbcset->equiv_classes,
+ is a pointer argument sinse we may update it. */
+
+static reg_errcode_t
+#ifdef RE_ENABLE_I18N
+build_equiv_class (sbcset, mbcset, equiv_class_alloc, name)
+ re_charset_t *mbcset;
+ int *equiv_class_alloc;
+#else /* not RE_ENABLE_I18N */
+build_equiv_class (sbcset, name)
+#endif /* not RE_ENABLE_I18N */
+ re_bitset_ptr_t sbcset;
+ const unsigned char *name;
+{
+#if defined _LIBC && defined RE_ENABLE_I18N
+ uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+ if (nrules != 0)
+ {
+ const int32_t *table, *indirect;
+ const unsigned char *weights, *extra, *cp;
+ unsigned char char_buf[2];
+ int32_t idx1, idx2;
+ unsigned int ch;
+ size_t len;
+ /* This #include defines a local function! */
+# include <locale/weight.h>
+ /* Calculate the index for equivalence class. */
+ cp = name;
+ table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
+ weights = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_WEIGHTMB);
+ extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_EXTRAMB);
+ indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_INDIRECTMB);
+ idx1 = findidx (&cp);
+ if (BE (idx1 == 0 || cp < name + strlen ((const char *) name), 0))
+ /* This isn't a valid character. */
+ return REG_ECOLLATE;
+
+ /* Build single byte matcing table for this equivalence class. */
+ char_buf[1] = (unsigned char) '\0';
+ len = weights[idx1];
+ for (ch = 0; ch < SBC_MAX; ++ch)
+ {
+ char_buf[0] = ch;
+ cp = char_buf;
+ idx2 = findidx (&cp);
+/*
+ idx2 = table[ch];
+*/
+ if (idx2 == 0)
+ /* This isn't a valid character. */
+ continue;
+ if (len == weights[idx2])
+ {
+ int cnt = 0;
+ while (cnt <= len &&
+ weights[idx1 + 1 + cnt] == weights[idx2 + 1 + cnt])
+ ++cnt;
+
+ if (cnt > len)
+ bitset_set (sbcset, ch);
+ }
+ }
+ /* Check whether the array has enough space. */
+ if (*equiv_class_alloc == mbcset->nequiv_classes)
+ {
+ /* Not enough, realloc it. */
+ /* +1 in case of mbcset->nequiv_classes is 0. */
+ *equiv_class_alloc = 2 * mbcset->nequiv_classes + 1;
+ /* Use realloc since the array is NULL if *alloc == 0. */
+ mbcset->equiv_classes = re_realloc (mbcset->equiv_classes, int32_t,
+ *equiv_class_alloc);
+ if (BE (mbcset->equiv_classes == NULL, 0))
+ return REG_ESPACE;
+ }
+ mbcset->equiv_classes[mbcset->nequiv_classes++] = idx1;
+ }
+ else
+#endif /* _LIBC && RE_ENABLE_I18N */
+ {
+ if (BE (strlen ((const char *) name) != 1, 0))
+ return REG_ECOLLATE;
+ bitset_set (sbcset, *name);
+ }
+ return REG_NOERROR;
+}
+
+ /* Helper function for parse_bracket_exp.
+ Build the character class which is represented by NAME.
+ The result are written to MBCSET and SBCSET.
+ CHAR_CLASS_ALLOC is the allocated size of mbcset->char_classes,
+ is a pointer argument sinse we may update it. */
+
+static reg_errcode_t
+#ifdef RE_ENABLE_I18N
+build_charclass (trans, sbcset, mbcset, char_class_alloc, class_name, syntax)
+ re_charset_t *mbcset;
+ int *char_class_alloc;
+#else /* not RE_ENABLE_I18N */
+build_charclass (trans, sbcset, class_name, syntax)
+#endif /* not RE_ENABLE_I18N */
+ RE_TRANSLATE_TYPE trans;
+ re_bitset_ptr_t sbcset;
+ const unsigned char *class_name;
+ reg_syntax_t syntax;
+{
+ int i;
+ const char *name = (const char *) class_name;
+
+ /* In case of REG_ICASE "upper" and "lower" match the both of
+ upper and lower cases. */
+ if ((syntax & RE_ICASE)
+ && (strcmp (name, "upper") == 0 || strcmp (name, "lower") == 0))
+ name = "alpha";
+
+#ifdef RE_ENABLE_I18N
+ /* Check the space of the arrays. */
+ if (*char_class_alloc == mbcset->nchar_classes)
+ {
+ /* Not enough, realloc it. */
+ /* +1 in case of mbcset->nchar_classes is 0. */
+ *char_class_alloc = 2 * mbcset->nchar_classes + 1;
+ /* Use realloc since array is NULL if *alloc == 0. */
+ mbcset->char_classes = re_realloc (mbcset->char_classes, wctype_t,
+ *char_class_alloc);
+ if (BE (mbcset->char_classes == NULL, 0))
+ return REG_ESPACE;
+ }
+ mbcset->char_classes[mbcset->nchar_classes++] = __wctype (name);
+#endif /* RE_ENABLE_I18N */
+
+#define BUILD_CHARCLASS_LOOP(ctype_func)\
+ for (i = 0; i < SBC_MAX; ++i) \
+ { \
+ if (ctype_func (i)) \
+ { \
+ int ch = trans ? trans[i] : i; \
+ bitset_set (sbcset, ch); \
+ } \
+ }
+
+ if (strcmp (name, "alnum") == 0)
+ BUILD_CHARCLASS_LOOP (isalnum)
+ else if (strcmp (name, "cntrl") == 0)
+ BUILD_CHARCLASS_LOOP (iscntrl)
+ else if (strcmp (name, "lower") == 0)
+ BUILD_CHARCLASS_LOOP (islower)
+ else if (strcmp (name, "space") == 0)
+ BUILD_CHARCLASS_LOOP (isspace)
+ else if (strcmp (name, "alpha") == 0)
+ BUILD_CHARCLASS_LOOP (isalpha)
+ else if (strcmp (name, "digit") == 0)
+ BUILD_CHARCLASS_LOOP (isdigit)
+ else if (strcmp (name, "print") == 0)
+ BUILD_CHARCLASS_LOOP (isprint)
+ else if (strcmp (name, "upper") == 0)
+ BUILD_CHARCLASS_LOOP (isupper)
+ else if (strcmp (name, "blank") == 0)
+ BUILD_CHARCLASS_LOOP (isblank)
+ else if (strcmp (name, "graph") == 0)
+ BUILD_CHARCLASS_LOOP (isgraph)
+ else if (strcmp (name, "punct") == 0)
+ BUILD_CHARCLASS_LOOP (ispunct)
+ else if (strcmp (name, "xdigit") == 0)
+ BUILD_CHARCLASS_LOOP (isxdigit)
+ else
+ return REG_ECTYPE;
+
+ return REG_NOERROR;
+}
+
+static bin_tree_t *
+build_word_op (dfa, trans, not, err)
+ re_dfa_t *dfa;
+ RE_TRANSLATE_TYPE trans;
+ int not;
+ reg_errcode_t *err;
+{
+ re_bitset_ptr_t sbcset;
+#ifdef RE_ENABLE_I18N
+ re_charset_t *mbcset;
+ int alloc = 0;
+#else /* not RE_ENABLE_I18N */
+ int non_match = 0;
+#endif /* not RE_ENABLE_I18N */
+ reg_errcode_t ret;
+ re_token_t br_token;
+ bin_tree_t *tree;
+ int new_idx;
+
+ sbcset = (re_bitset_ptr_t) calloc (sizeof (unsigned int), BITSET_UINTS);
+#ifdef RE_ENABLE_I18N
+ mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1);
+#endif /* RE_ENABLE_I18N */
+
+#ifdef RE_ENABLE_I18N
+ if (BE (sbcset == NULL || mbcset == NULL, 0))
+#else /* not RE_ENABLE_I18N */
+ if (BE (sbcset == NULL, 0))
+#endif /* not RE_ENABLE_I18N */
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+
+ if (not)
+ {
+#ifdef RE_ENABLE_I18N
+ int i;
+ /*
+ if (syntax & RE_HAT_LISTS_NOT_NEWLINE)
+ bitset_set(cset->sbcset, '\0');
+ */
+ mbcset->non_match = 1;
+ if (re_mb_cur_max > 1)
+ for (i = 0; i < SBC_MAX; ++i)
+ if (__btowc (i) == WEOF)
+ bitset_set (sbcset, i);
+#else /* not RE_ENABLE_I18N */
+ non_match = 1;
+#endif /* not RE_ENABLE_I18N */
+ }
+
+ /* We don't care the syntax in this case. */
+ ret = build_charclass (trans, sbcset,
+#ifdef RE_ENABLE_I18N
+ mbcset, &alloc,
+#endif /* RE_ENABLE_I18N */
+ (const unsigned char *) "alpha", 0);
+
+ if (BE (ret != REG_NOERROR, 0))
+ {
+ re_free (sbcset);
+#ifdef RE_ENABLE_I18N
+ free_charset (mbcset);
+#endif /* RE_ENABLE_I18N */
+ *err = ret;
+ return NULL;
+ }
+ /* \w match '_' also. */
+ bitset_set (sbcset, '_');
+
+ /* If it is non-matching list. */
+#ifdef RE_ENABLE_I18N
+ if (mbcset->non_match)
+#else /* not RE_ENABLE_I18N */
+ if (non_match)
+#endif /* not RE_ENABLE_I18N */
+ bitset_not (sbcset);
+
+ /* Build a tree for simple bracket. */
+ br_token.type = SIMPLE_BRACKET;
+ br_token.opr.sbcset = sbcset;
+ new_idx = re_dfa_add_node (dfa, br_token, 0);
+ tree = create_tree (NULL, NULL, 0, new_idx);
+ if (BE (new_idx == -1 || tree == NULL, 0))
+ goto build_word_op_espace;
+
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max > 1)
+ {
+ re_token_t alt_token;
+ bin_tree_t *mbc_tree;
+ /* Build a tree for complex bracket. */
+ br_token.type = COMPLEX_BRACKET;
+ br_token.opr.mbcset = mbcset;
+ dfa->has_mb_node = 1;
+ new_idx = re_dfa_add_node (dfa, br_token, 0);
+ mbc_tree = create_tree (NULL, NULL, 0, new_idx);
+ if (BE (new_idx == -1 || mbc_tree == NULL, 0))
+ goto build_word_op_espace;
+ /* Then join them by ALT node. */
+ alt_token.type = OP_ALT;
+ new_idx = re_dfa_add_node (dfa, alt_token, 0);
+ tree = create_tree (tree, mbc_tree, 0, new_idx);
+ if (BE (new_idx != -1 && mbc_tree != NULL, 1))
+ return tree;
+ }
+ else
+ {
+ free_charset (mbcset);
+ return tree;
+ }
+#else /* not RE_ENABLE_I18N */
+ return tree;
+#endif /* not RE_ENABLE_I18N */
+
+ build_word_op_espace:
+ re_free (sbcset);
+#ifdef RE_ENABLE_I18N
+ free_charset (mbcset);
+#endif /* RE_ENABLE_I18N */
+ *err = REG_ESPACE;
+ return NULL;
+}
+
+/* This is intended for the expressions like "a{1,3}".
+ Fetch a number from `input', and return the number.
+ Return -1, if the number field is empty like "{,1}".
+ Return -2, If an error is occured. */
+
+static int
+fetch_number (input, token, syntax)
+ re_string_t *input;
+ re_token_t *token;
+ reg_syntax_t syntax;
+{
+ int num = -1;
+ unsigned char c;
+ while (1)
+ {
+ *token = fetch_token (input, syntax);
+ c = token->opr.c;
+ if (BE (token->type == END_OF_RE, 0))
+ return -2;
+ if (token->type == OP_CLOSE_DUP_NUM || c == ',')
+ break;
+ num = ((token->type != CHARACTER || c < '0' || '9' < c || num == -2)
+ ? -2 : ((num == -1) ? c - '0' : num * 10 + c - '0'));
+ num = (num > RE_DUP_MAX) ? -2 : num;
+ }
+ return num;
+}
+
+#ifdef RE_ENABLE_I18N
+static void
+free_charset (re_charset_t *cset)
+{
+ re_free (cset->mbchars);
+# ifdef _LIBC
+ re_free (cset->coll_syms);
+ re_free (cset->equiv_classes);
+ re_free (cset->range_starts);
+ re_free (cset->range_ends);
+# endif
+ re_free (cset->char_classes);
+ re_free (cset);
+}
+#endif /* RE_ENABLE_I18N */
+
+/* Functions for binary tree operation. */
+
+/* Create a node of tree.
+ Note: This function automatically free left and right if malloc fails. */
+
+static bin_tree_t *
+create_tree (left, right, type, index)
+ bin_tree_t *left;
+ bin_tree_t *right;
+ re_token_type_t type;
+ int index;
+{
+ bin_tree_t *tree;
+ tree = re_malloc (bin_tree_t, 1);
+ if (BE (tree == NULL, 0))
+ {
+ free_bin_tree (left);
+ free_bin_tree (right);
+ return NULL;
+ }
+ tree->parent = NULL;
+ tree->left = left;
+ tree->right = right;
+ tree->type = type;
+ tree->node_idx = index;
+ tree->first = -1;
+ tree->next = -1;
+ re_node_set_init_empty (&tree->eclosure);
+
+ if (left != NULL)
+ left->parent = tree;
+ if (right != NULL)
+ right->parent = tree;
+ return tree;
+}
+
+/* Free the sub tree pointed by TREE. */
+
+static void
+free_bin_tree (tree)
+ bin_tree_t *tree;
+{
+ if (tree == NULL)
+ return;
+ /*re_node_set_free (&tree->eclosure);*/
+ free_bin_tree (tree->left);
+ free_bin_tree (tree->right);
+ re_free (tree);
+}
+
+/* Duplicate the node SRC, and return new node. */
+
+static bin_tree_t *
+duplicate_tree (src, dfa)
+ const bin_tree_t *src;
+ re_dfa_t *dfa;
+{
+ bin_tree_t *left = NULL, *right = NULL, *new_tree;
+ int new_node_idx;
+ /* Since node indies must be according to Post-order of the tree,
+ we must duplicate the left at first. */
+ if (src->left != NULL)
+ {
+ left = duplicate_tree (src->left, dfa);
+ if (left == NULL)
+ return NULL;
+ }
+
+ /* Secondaly, duplicate the right. */
+ if (src->right != NULL)
+ {
+ right = duplicate_tree (src->right, dfa);
+ if (right == NULL)
+ {
+ free_bin_tree (left);
+ return NULL;
+ }
+ }
+
+ /* At last, duplicate itself. */
+ if (src->type == NON_TYPE)
+ {
+ new_node_idx = re_dfa_add_node (dfa, dfa->nodes[src->node_idx], 0);
+ dfa->nodes[new_node_idx].duplicated = 1;
+ if (BE (new_node_idx == -1, 0))
+ {
+ free_bin_tree (left);
+ free_bin_tree (right);
+ return NULL;
+ }
+ }
+ else
+ new_node_idx = src->type;
+
+ new_tree = create_tree (left, right, src->type, new_node_idx);
+ if (BE (new_tree == NULL, 0))
+ {
+ free_bin_tree (left);
+ free_bin_tree (right);
+ }
+ return new_tree;
+}
diff --git a/gnu/dist/gawk/regex.c b/gnu/dist/gawk/regex.c
index 221c9b5d895..4ebc5568c1b 100644
--- a/gnu/dist/gawk/regex.c
+++ b/gnu/dist/gawk/regex.c
@@ -1,5718 +1,73 @@
-/* Extended regular expression matching and search library,
- version 0.12.
- (Implements POSIX draft P1003.2/D11.2, except for some of the
- internationalization features.)
+/* $NetBSD: regex.c,v 1.1.1.2 2003/10/06 15:46:33 wiz Exp $ */
- Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.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.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful,
+ The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- 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
+ Lesser 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 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. */
-/* AIX requires this to be the first thing in the file. */
-#if defined (_AIX) && !defined (REGEX_MALLOC)
- #pragma alloca
+#ifdef _LIBC
+/* We have to keep the namespace clean. */
+# define regfree(preg) __regfree (preg)
+# define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
+# define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
+# define regerror(errcode, preg, errbuf, errbuf_size) \
+ __regerror(errcode, preg, errbuf, errbuf_size)
+# define re_set_registers(bu, re, nu, st, en) \
+ __re_set_registers (bu, re, nu, st, en)
+# define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
+ __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
+# define re_match(bufp, string, size, pos, regs) \
+ __re_match (bufp, string, size, pos, regs)
+# define re_search(bufp, string, size, startpos, range, regs) \
+ __re_search (bufp, string, size, startpos, range, regs)
+# define re_compile_pattern(pattern, length, bufp) \
+ __re_compile_pattern (pattern, length, bufp)
+# define re_set_syntax(syntax) __re_set_syntax (syntax)
+# define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
+ __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
+# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
#endif
-#undef _GNU_SOURCE
-#define _GNU_SOURCE
-
#ifdef HAVE_CONFIG_H
-#include <config.h>
+#include "config.h"
#endif
-#if defined(STDC_HEADERS) && !defined(emacs)
-#include <stddef.h>
-#else
-/* We need this for `regex.h', and perhaps for the Emacs include files. */
+/* POSIX says that <sys/types.h> must be included (by the caller) before
+ <regex.h>. */
#include <sys/types.h>
-#endif
-
-/* For platform which support the ISO C amendement 1 functionality we
- support user defined character classes. */
-#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
-# include <wctype.h>
-# include <wchar.h>
-#endif
-
-/* This is for other GNU distributions with internationalized messages. */
-#if HAVE_LIBINTL_H || defined (_LIBC)
-# include <libintl.h>
-#else
-# define gettext(msgid) (msgid)
-#endif
-
-#ifndef gettext_noop
-/* This define is so xgettext can find the internationalizable
- strings. */
-#define gettext_noop(String) String
-#endif
-
-/* The `emacs' switch turns on certain matching commands
- that make sense only in Emacs. */
-#ifdef emacs
-
-#include "lisp.h"
-#include "buffer.h"
-#include "syntax.h"
-
-#else /* not emacs */
-
-/* If we are not linking with Emacs proper,
- we can't use the relocating allocator
- even if config.h says that we can. */
-#undef REL_ALLOC
-
-#if defined (STDC_HEADERS) || defined (_LIBC)
-#include <stdlib.h>
-#else
-char *malloc ();
-char *realloc ();
-#endif
-
-/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow.
- If nothing else has been done, use the method below. */
-#ifdef INHIBIT_STRING_HEADER
-#if !(defined (HAVE_BZERO) && defined (HAVE_BCOPY))
-#if !defined (bzero) && !defined (bcopy)
-#undef INHIBIT_STRING_HEADER
-#endif
-#endif
-#endif
-
-/* This is the normal way of making sure we have a bcopy and a bzero.
- This is used in most programs--a few other programs avoid this
- by defining INHIBIT_STRING_HEADER. */
-#ifndef INHIBIT_STRING_HEADER
-#if defined (HAVE_STRING_H) || defined (STDC_HEADERS) || defined (_LIBC)
-#include <string.h>
-#ifndef bcmp
-#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
-#endif
-#ifndef bcopy
-#define bcopy(s, d, n) memcpy ((d), (s), (n))
-#endif
-#ifndef bzero
-#define bzero(s, n) memset ((s), 0, (n))
-#endif
-#else
-#include <strings.h>
-#endif
-#endif
-
-/* Define the syntax stuff for \<, \>, etc. */
-/* This must be nonzero for the wordchar and notwordchar pattern
- commands in re_match_2. */
-#ifndef Sword
-#define Sword 1
+#if defined (_MSC_VER)
+#include <stdio.h> /* for size_t */
#endif
-#ifdef SWITCH_ENUM_BUG
-#define SWITCH_ENUM_CAST(x) ((int)(x))
-#else
-#define SWITCH_ENUM_CAST(x) (x)
-#endif
-
-#ifdef SYNTAX_TABLE
-
-extern char *re_syntax_table;
-
-#else /* not SYNTAX_TABLE */
-
-/* How many characters in the character set. */
-#define CHAR_SET_SIZE 256
-
-static char re_syntax_table[CHAR_SET_SIZE];
-
-static void
-init_syntax_once ()
-{
- register int c;
- static int done = 0;
-
- if (done)
- return;
-
- bzero (re_syntax_table, sizeof re_syntax_table);
-
- for (c = 'a'; c <= 'z'; c++)
- re_syntax_table[c] = Sword;
-
- for (c = 'A'; c <= 'Z'; c++)
- re_syntax_table[c] = Sword;
-
- for (c = '0'; c <= '9'; c++)
- re_syntax_table[c] = Sword;
-
- re_syntax_table['_'] = Sword;
-
- done = 1;
-}
-
-#endif /* not SYNTAX_TABLE */
-
-#define SYNTAX(c) re_syntax_table[c]
-
-#endif /* not emacs */
-
-/* Get the interface, including the syntax bits. */
-#include "regex.h"
-
-/* isalpha etc. are used for the character classes. */
-#include <ctype.h>
-
-/* Jim Meyering writes:
-
- "... Some ctype macros are valid only for character codes that
- isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when
- using /bin/cc or gcc but without giving an ansi option). So, all
- ctype uses should be through macros like ISPRINT... If
- STDC_HEADERS is defined, then autoconf has verified that the ctype
- macros don't need to be guarded with references to isascii. ...
- Defining isascii to 1 should let any compiler worth its salt
- eliminate the && through constant folding." */
-
-#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
-#define ISASCII(c) 1
-#else
-#define ISASCII(c) isascii(c)
-#endif
-
-#ifdef isblank
-#define ISBLANK(c) (ISASCII (c) && isblank (c))
-#else
-#define ISBLANK(c) ((c) == ' ' || (c) == '\t')
-#endif
-#ifdef isgraph
-#define ISGRAPH(c) (ISASCII (c) && isgraph (c))
-#else
-#define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
-#endif
-
-#define ISPRINT(c) (ISASCII (c) && isprint (c))
-#define ISDIGIT(c) (ISASCII (c) && isdigit (c))
-#define ISALNUM(c) (ISASCII (c) && isalnum (c))
-#define ISALPHA(c) (ISASCII (c) && isalpha (c))
-#define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
-#define ISLOWER(c) (ISASCII (c) && islower (c))
-#define ISPUNCT(c) (ISASCII (c) && ispunct (c))
-#define ISSPACE(c) (ISASCII (c) && isspace (c))
-#define ISUPPER(c) (ISASCII (c) && isupper (c))
-#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
-
-#ifndef NULL
-#define NULL (void *)0
-#endif
-
-/* We remove any previous definition of `SIGN_EXTEND_CHAR',
- since ours (we hope) works properly with all combinations of
- machines, compilers, `char' and `unsigned char' argument types.
- (Per Bothner suggested the basic approach.) */
-#undef SIGN_EXTEND_CHAR
-#if __STDC__
-#define SIGN_EXTEND_CHAR(c) ((signed char) (c))
-#else /* not __STDC__ */
-/* As in Harbison and Steele. */
-#define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
-#endif
-
-/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
- use `alloca' instead of `malloc'. This is because using malloc in
- re_search* or re_match* could cause memory leaks when C-g is used in
- Emacs; also, malloc is slower and causes storage fragmentation. On
- the other hand, malloc is more portable, and easier to debug.
-
- Because we sometimes use alloca, some routines have to be macros,
- not functions -- `alloca'-allocated space disappears at the end of the
- function it is called in. */
-
-#ifdef REGEX_MALLOC
-
-#define REGEX_ALLOCATE malloc
-#define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize)
-#define REGEX_FREE free
-
-#else /* not REGEX_MALLOC */
-
-/* Emacs already defines alloca, sometimes. */
-#ifndef alloca
-
-/* Make alloca work the best possible way. */
-#ifdef __GNUC__
-#define alloca __builtin_alloca
-#else /* not __GNUC__ */
-#if HAVE_ALLOCA_H
-#include <alloca.h>
-#else /* not __GNUC__ or HAVE_ALLOCA_H */
-#if 0 /* It is a bad idea to declare alloca. We always cast the result. */
-#ifndef _AIX /* Already did AIX, up at the top. */
-char *alloca ();
-#endif /* not _AIX */
-#endif
-#endif /* not HAVE_ALLOCA_H */
-#endif /* not __GNUC__ */
-
-#endif /* not alloca */
-
-#define REGEX_ALLOCATE alloca
-
-/* Assumes a `char *destination' variable. */
-#define REGEX_REALLOCATE(source, osize, nsize) \
- (destination = (char *) alloca (nsize), \
- bcopy (source, destination, osize), \
- destination)
-
-/* No need to do anything to free, after alloca. */
-#define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */
-
-#endif /* not REGEX_MALLOC */
-
-/* Define how to allocate the failure stack. */
-
-#if defined (REL_ALLOC) && defined (REGEX_MALLOC)
-
-#define REGEX_ALLOCATE_STACK(size) \
- r_alloc (&failure_stack_ptr, (size))
-#define REGEX_REALLOCATE_STACK(source, osize, nsize) \
- r_re_alloc (&failure_stack_ptr, (nsize))
-#define REGEX_FREE_STACK(ptr) \
- r_alloc_free (&failure_stack_ptr)
-
-#else /* not using relocating allocator */
-
-#ifdef REGEX_MALLOC
-
-#define REGEX_ALLOCATE_STACK malloc
-#define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize)
-#define REGEX_FREE_STACK free
-
-#else /* not REGEX_MALLOC */
-
-#define REGEX_ALLOCATE_STACK alloca
-
-#define REGEX_REALLOCATE_STACK(source, osize, nsize) \
- REGEX_REALLOCATE (source, osize, nsize)
-/* No need to explicitly free anything. */
-#define REGEX_FREE_STACK(arg)
-
-#endif /* not REGEX_MALLOC */
-#endif /* not using relocating allocator */
-
-
-/* True if `size1' is non-NULL and PTR is pointing anywhere inside
- `string1' or just past its end. This works if PTR is NULL, which is
- a good thing. */
-#define FIRST_STRING_P(ptr) \
- (size1 && string1 <= (ptr) && (ptr) <= string1 + size1)
-
-/* (Re)Allocate N items of type T using malloc, or fail. */
-#define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t)))
-#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t)))
-#define RETALLOC_IF(addr, n, t) \
- if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t)
-#define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t)))
-
-#define BYTEWIDTH 8 /* In bits. */
-
-#define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
-
-#undef MAX
-#undef MIN
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-
-typedef char boolean;
-#define false 0
-#define true 1
-
-static int re_match_2_internal ();
-
-/* These are the command codes that appear in compiled regular
- expressions. Some opcodes are followed by argument bytes. A
- command code can specify any interpretation whatsoever for its
- arguments. Zero bytes may appear in the compiled regular expression. */
-
-typedef enum
-{
- no_op = 0,
-
- /* Succeed right away--no more backtracking. */
- succeed,
-
- /* Followed by one byte giving n, then by n literal bytes. */
- exactn,
-
- /* Matches any (more or less) character. */
- anychar,
-
- /* Matches any one char belonging to specified set. First
- following byte is number of bitmap bytes. Then come bytes
- for a bitmap saying which chars are in. Bits in each byte
- are ordered low-bit-first. A character is in the set if its
- bit is 1. A character too large to have a bit in the map is
- automatically not in the set. */
- charset,
-
- /* Same parameters as charset, but match any character that is
- not one of those specified. */
- charset_not,
-
- /* Start remembering the text that is matched, for storing in a
- register. Followed by one byte with the register number, in
- the range 0 to one less than the pattern buffer's re_nsub
- field. Then followed by one byte with the number of groups
- inner to this one. (This last has to be part of the
- start_memory only because we need it in the on_failure_jump
- of re_match_2.) */
- start_memory,
-
- /* Stop remembering the text that is matched and store it in a
- memory register. Followed by one byte with the register
- number, in the range 0 to one less than `re_nsub' in the
- pattern buffer, and one byte with the number of inner groups,
- just like `start_memory'. (We need the number of inner
- groups here because we don't have any easy way of finding the
- corresponding start_memory when we're at a stop_memory.) */
- stop_memory,
-
- /* Match a duplicate of something remembered. Followed by one
- byte containing the register number. */
- duplicate,
-
- /* Fail unless at beginning of line. */
- begline,
-
- /* Fail unless at end of line. */
- endline,
-
- /* Succeeds if at beginning of buffer (if emacs) or at beginning
- of string to be matched (if not). */
- begbuf,
-
- /* Analogously, for end of buffer/string. */
- endbuf,
-
- /* Followed by two byte relative address to which to jump. */
- jump,
-
- /* Same as jump, but marks the end of an alternative. */
- jump_past_alt,
-
- /* Followed by two-byte relative address of place to resume at
- in case of failure. */
- on_failure_jump,
-
- /* Like on_failure_jump, but pushes a placeholder instead of the
- current string position when executed. */
- on_failure_keep_string_jump,
-
- /* Throw away latest failure point and then jump to following
- two-byte relative address. */
- pop_failure_jump,
-
- /* Change to pop_failure_jump if know won't have to backtrack to
- match; otherwise change to jump. This is used to jump
- back to the beginning of a repeat. If what follows this jump
- clearly won't match what the repeat does, such that we can be
- sure that there is no use backtracking out of repetitions
- already matched, then we change it to a pop_failure_jump.
- Followed by two-byte address. */
- maybe_pop_jump,
-
- /* Jump to following two-byte address, and push a dummy failure
- point. This failure point will be thrown away if an attempt
- is made to use it for a failure. A `+' construct makes this
- before the first repeat. Also used as an intermediary kind
- of jump when compiling an alternative. */
- dummy_failure_jump,
-
- /* Push a dummy failure point and continue. Used at the end of
- alternatives. */
- push_dummy_failure,
-
- /* Followed by two-byte relative address and two-byte number n.
- After matching N times, jump to the address upon failure. */
- succeed_n,
-
- /* Followed by two-byte relative address, and two-byte number n.
- Jump to the address N times, then fail. */
- jump_n,
-
- /* Set the following two-byte relative address to the
- subsequent two-byte number. The address *includes* the two
- bytes of number. */
- set_number_at,
-
- wordchar, /* Matches any word-constituent character. */
- notwordchar, /* Matches any char that is not a word-constituent. */
-
- wordbeg, /* Succeeds if at word beginning. */
- wordend, /* Succeeds if at word end. */
-
- wordbound, /* Succeeds if at a word boundary. */
- notwordbound /* Succeeds if not at a word boundary. */
-
-#ifdef emacs
- ,before_dot, /* Succeeds if before point. */
- at_dot, /* Succeeds if at point. */
- after_dot, /* Succeeds if after point. */
-
- /* Matches any character whose syntax is specified. Followed by
- a byte which contains a syntax code, e.g., Sword. */
- syntaxspec,
-
- /* Matches any character whose syntax is not that specified. */
- notsyntaxspec
-#endif /* emacs */
-} re_opcode_t;
-
-/* Common operations on the compiled pattern. */
-
-/* Store NUMBER in two contiguous bytes starting at DESTINATION. */
-
-#define STORE_NUMBER(destination, number) \
- do { \
- (destination)[0] = (number) & 0377; \
- (destination)[1] = (number) >> 8; \
- } while (0)
-
-/* Same as STORE_NUMBER, except increment DESTINATION to
- the byte after where the number is stored. Therefore, DESTINATION
- must be an lvalue. */
-
-#define STORE_NUMBER_AND_INCR(destination, number) \
- do { \
- STORE_NUMBER (destination, number); \
- (destination) += 2; \
- } while (0)
-
-/* Put into DESTINATION a number stored in two contiguous bytes starting
- at SOURCE. */
-
-#define EXTRACT_NUMBER(destination, source) \
- do { \
- (destination) = *(source) & 0377; \
- (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \
- } while (0)
-
-#ifdef DEBUG
-static void extract_number _RE_ARGS ((int *dest, unsigned char *source));
-static void
-extract_number (dest, source)
- int *dest;
- unsigned char *source;
-{
- int temp = SIGN_EXTEND_CHAR (*(source + 1));
- *dest = *source & 0377;
- *dest += temp << 8;
-}
-
-#ifndef EXTRACT_MACROS /* To debug the macros. */
-#undef EXTRACT_NUMBER
-#define EXTRACT_NUMBER(dest, src) extract_number (&dest, src)
-#endif /* not EXTRACT_MACROS */
-
-#endif /* DEBUG */
-
-/* Same as EXTRACT_NUMBER, except increment SOURCE to after the number.
- SOURCE must be an lvalue. */
-
-#define EXTRACT_NUMBER_AND_INCR(destination, source) \
- do { \
- EXTRACT_NUMBER (destination, source); \
- (source) += 2; \
- } while (0)
-
-#ifdef DEBUG
-static void extract_number_and_incr _RE_ARGS ((int *destination,
- unsigned char **source));
-static void
-extract_number_and_incr (destination, source)
- int *destination;
- unsigned char **source;
-{
- extract_number (destination, *source);
- *source += 2;
-}
-
-#ifndef EXTRACT_MACROS
-#undef EXTRACT_NUMBER_AND_INCR
-#define EXTRACT_NUMBER_AND_INCR(dest, src) \
- extract_number_and_incr (&dest, &src)
-#endif /* not EXTRACT_MACROS */
-
-#endif /* DEBUG */
-
-/* If DEBUG is defined, Regex prints many voluminous messages about what
- it is doing (if the variable `debug' is nonzero). If linked with the
- main program in `iregex.c', you can enter patterns and strings
- interactively. And if linked with the main program in `main.c' and
- the other test files, you can run the already-written tests. */
-
-#ifdef DEBUG
-
-/* We use standard I/O for debugging. */
-#include <stdio.h>
-
-/* It is useful to test things that ``must'' be true when debugging. */
-#include <assert.h>
+#include <limits.h>
+#include <regex.h>
+#include "regex_internal.h"
-static int debug = 0;
+#include "regex_internal.c"
+#include "regcomp.c"
+#include "regexec.c"
-#define DEBUG_STATEMENT(e) e
-#define DEBUG_PRINT1(x) if (debug) printf (x)
-#define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2)
-#define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3)
-#define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4)
-#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \
- if (debug) print_partial_compiled_pattern (s, e)
-#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \
- if (debug) print_double_string (w, s1, sz1, s2, sz2)
-
-
-/* Print the fastmap in human-readable form. */
-
-void
-print_fastmap (fastmap)
- char *fastmap;
-{
- unsigned was_a_range = 0;
- unsigned i = 0;
-
- while (i < (1 << BYTEWIDTH))
- {
- if (fastmap[i++])
- {
- was_a_range = 0;
- putchar (i - 1);
- while (i < (1 << BYTEWIDTH) && fastmap[i])
- {
- was_a_range = 1;
- i++;
- }
- if (was_a_range)
- {
- printf ("-");
- putchar (i - 1);
- }
- }
- }
- putchar ('\n');
-}
-
-
-/* Print a compiled pattern string in human-readable form, starting at
- the START pointer into it and ending just before the pointer END. */
-
-void
-print_partial_compiled_pattern (start, end)
- unsigned char *start;
- unsigned char *end;
-{
- int mcnt, mcnt2;
- unsigned char *p1;
- unsigned char *p = start;
- unsigned char *pend = end;
-
- if (start == NULL)
- {
- printf ("(null)\n");
- return;
- }
-
- /* Loop over pattern commands. */
- while (p < pend)
- {
- printf ("%d:\t", p - start);
-
- switch ((re_opcode_t) *p++)
- {
- case no_op:
- printf ("/no_op");
- break;
-
- case exactn:
- mcnt = *p++;
- printf ("/exactn/%d", mcnt);
- do
- {
- putchar ('/');
- putchar (*p++);
- }
- while (--mcnt);
- break;
-
- case start_memory:
- mcnt = *p++;
- printf ("/start_memory/%d/%d", mcnt, *p++);
- break;
-
- case stop_memory:
- mcnt = *p++;
- printf ("/stop_memory/%d/%d", mcnt, *p++);
- break;
-
- case duplicate:
- printf ("/duplicate/%d", *p++);
- break;
-
- case anychar:
- printf ("/anychar");
- break;
-
- case charset:
- case charset_not:
- {
- register int c, last = -100;
- register int in_range = 0;
-
- printf ("/charset [%s",
- (re_opcode_t) *(p - 1) == charset_not ? "^" : "");
-
- assert (p + *p < pend);
-
- for (c = 0; c < 256; c++)
- if (c / 8 < *p
- && (p[1 + (c/8)] & (1 << (c % 8))))
- {
- /* Are we starting a range? */
- if (last + 1 == c && ! in_range)
- {
- putchar ('-');
- in_range = 1;
- }
- /* Have we broken a range? */
- else if (last + 1 != c && in_range)
- {
- putchar (last);
- in_range = 0;
- }
-
- if (! in_range)
- putchar (c);
-
- last = c;
- }
-
- if (in_range)
- putchar (last);
-
- putchar (']');
-
- p += 1 + *p;
- }
- break;
-
- case begline:
- printf ("/begline");
- break;
-
- case endline:
- printf ("/endline");
- break;
-
- case on_failure_jump:
- 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);
- printf ("/on_failure_keep_string_jump to %d", p + mcnt - start);
- break;
-
- case dummy_failure_jump:
- extract_number_and_incr (&mcnt, &p);
- printf ("/dummy_failure_jump to %d", p + mcnt - start);
- break;
-
- case push_dummy_failure:
- printf ("/push_dummy_failure");
- break;
-
- case maybe_pop_jump:
- 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);
- printf ("/pop_failure_jump to %d", p + mcnt - start);
- break;
-
- case jump_past_alt:
- extract_number_and_incr (&mcnt, &p);
- printf ("/jump_past_alt to %d", p + mcnt - start);
- break;
-
- case jump:
- extract_number_and_incr (&mcnt, &p);
- printf ("/jump to %d", p + mcnt - start);
- break;
-
- case succeed_n:
- extract_number_and_incr (&mcnt, &p);
- p1 = p + mcnt;
- 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);
- p1 = p + mcnt;
- 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);
- p1 = p + mcnt;
- extract_number_and_incr (&mcnt2, &p);
- printf ("/set_number_at location %d to %d", p1 - start, mcnt2);
- break;
-
- case wordbound:
- printf ("/wordbound");
- break;
-
- case notwordbound:
- printf ("/notwordbound");
- break;
-
- case wordbeg:
- printf ("/wordbeg");
- break;
-
- case wordend:
- printf ("/wordend");
-
-#ifdef emacs
- case before_dot:
- printf ("/before_dot");
- break;
-
- case at_dot:
- printf ("/at_dot");
- break;
-
- case after_dot:
- printf ("/after_dot");
- break;
-
- case syntaxspec:
- printf ("/syntaxspec");
- mcnt = *p++;
- printf ("/%d", mcnt);
- break;
-
- case notsyntaxspec:
- printf ("/notsyntaxspec");
- mcnt = *p++;
- printf ("/%d", mcnt);
- break;
-#endif /* emacs */
-
- case wordchar:
- printf ("/wordchar");
- break;
-
- case notwordchar:
- printf ("/notwordchar");
- break;
-
- case begbuf:
- printf ("/begbuf");
- break;
-
- case endbuf:
- printf ("/endbuf");
- break;
-
- default:
- printf ("?%d", *(p-1));
- }
-
- putchar ('\n');
- }
-
- printf ("%d:\tend of pattern.\n", p - start);
-}
-
-
-void
-print_compiled_pattern (bufp)
- struct re_pattern_buffer *bufp;
-{
- unsigned char *buffer = bufp->buffer;
-
- print_partial_compiled_pattern (buffer, buffer + bufp->used);
- printf ("%ld bytes used/%ld bytes allocated.\n",
- bufp->used, bufp->allocated);
-
- if (bufp->fastmap_accurate && bufp->fastmap)
- {
- printf ("fastmap: ");
- print_fastmap (bufp->fastmap);
- }
-
- printf ("re_nsub: %d\t", bufp->re_nsub);
- printf ("regs_alloc: %d\t", bufp->regs_allocated);
- printf ("can_be_null: %d\t", bufp->can_be_null);
- printf ("newline_anchor: %d\n", bufp->newline_anchor);
- printf ("no_sub: %d\t", bufp->no_sub);
- printf ("not_bol: %d\t", bufp->not_bol);
- printf ("not_eol: %d\t", bufp->not_eol);
- printf ("syntax: %lx\n", bufp->syntax);
- /* Perhaps we should print the translate table? */
-}
-
-
-void
-print_double_string (where, string1, size1, string2, size2)
- const char *where;
- const char *string1;
- const char *string2;
- int size1;
- int size2;
-{
- int this_char;
-
- if (where == NULL)
- printf ("(null)");
- else
- {
- if (FIRST_STRING_P (where))
- {
- for (this_char = where - string1; this_char < size1; this_char++)
- putchar (string1[this_char]);
-
- where = string2;
- }
-
- for (this_char = where - string2; this_char < size2; this_char++)
- putchar (string2[this_char]);
- }
-}
-
-void
-printchar (c)
- int c;
-{
- putc (c, stderr);
-}
-
-#else /* not DEBUG */
-
-#undef assert
-#define assert(e)
-
-#define DEBUG_STATEMENT(e)
-#define DEBUG_PRINT1(x)
-#define DEBUG_PRINT2(x1, x2)
-#define DEBUG_PRINT3(x1, x2, x3)
-#define DEBUG_PRINT4(x1, x2, x3, x4)
-#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
-#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
-
-#endif /* not DEBUG */
-
-/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can
- also be assigned to arbitrarily: each pattern buffer stores its own
- syntax, so it can be changed between regex compilations. */
-/* This has no initializer because initialized variables in Emacs
- become read-only after dumping. */
-reg_syntax_t re_syntax_options;
-
-
-/* Specify the precise syntax of regexps for compilation. This provides
- for compatibility for various utilities which historically have
- different, incompatible syntaxes.
-
- The argument SYNTAX is a bit mask comprised of the various bits
- defined in regex.h. We return the old syntax. */
-
-reg_syntax_t
-re_set_syntax (syntax)
- reg_syntax_t syntax;
-{
- reg_syntax_t ret = re_syntax_options;
-
- re_syntax_options = syntax;
-#ifdef DEBUG
- if (syntax & RE_DEBUG)
- debug = 1;
- else if (debug) /* was on but now is not */
- debug = 0;
-#endif /* DEBUG */
- return ret;
-}
-
-/* This table gives an error message for each of the error codes listed
- in regex.h. Obviously the order here has to be same as there.
- POSIX doesn't require that we do anything for REG_NOERROR,
- but why not be nice? */
-
-static const char *re_error_msgid[] =
- {
- gettext_noop ("Success"), /* REG_NOERROR */
- gettext_noop ("No match"), /* REG_NOMATCH */
- gettext_noop ("Invalid regular expression"), /* REG_BADPAT */
- gettext_noop ("Invalid collation character"), /* REG_ECOLLATE */
- gettext_noop ("Invalid character class name"), /* REG_ECTYPE */
- gettext_noop ("Trailing backslash"), /* REG_EESCAPE */
- gettext_noop ("Invalid back reference"), /* REG_ESUBREG */
- gettext_noop ("Unmatched [ or [^"), /* REG_EBRACK */
- gettext_noop ("Unmatched ( or \\("), /* REG_EPAREN */
- gettext_noop ("Unmatched \\{"), /* REG_EBRACE */
- gettext_noop ("Invalid content of \\{\\}"), /* REG_BADBR */
- gettext_noop ("Invalid range end"), /* REG_ERANGE */
- gettext_noop ("Memory exhausted"), /* REG_ESPACE */
- gettext_noop ("Invalid preceding regular expression"), /* REG_BADRPT */
- gettext_noop ("Premature end of regular expression"), /* REG_EEND */
- gettext_noop ("Regular expression too big"), /* REG_ESIZE */
- gettext_noop ("Unmatched ) or \\)"), /* REG_ERPAREN */
- };
-
-/* Avoiding alloca during matching, to placate r_alloc. */
-
-/* Define MATCH_MAY_ALLOCATE unless we need to make sure that the
- searching and matching functions should not call alloca. On some
- systems, alloca is implemented in terms of malloc, and if we're
- using the relocating allocator routines, then malloc could cause a
- relocation, which might (if the strings being searched are in the
- ralloc heap) shift the data out from underneath the regexp
- routines.
-
- Here's another reason to avoid allocation: Emacs
- processes input from X in a signal handler; processing X input may
- call malloc; if input arrives while a matching routine is calling
- malloc, then we're scrod. But Emacs can't just block input while
- calling matching routines; then we don't notice interrupts when
- they come in. So, Emacs blocks input around all regexp calls
- except the matching calls, which it leaves unprotected, in the
- faith that they will not malloc. */
-
-/* Normally, this is fine. */
-#define MATCH_MAY_ALLOCATE
-
-/* When using GNU C, we are not REALLY using the C alloca, no matter
- what config.h may say. So don't take precautions for it. */
-#ifdef __GNUC__
-#undef C_ALLOCA
-#endif
-
-/* The match routines may not allocate if (1) they would do it with malloc
- and (2) it's not safe for them to use malloc.
- Note that if REL_ALLOC is defined, matching would not use malloc for the
- failure stack, but we would still use it for the register vectors;
- so REL_ALLOC should not affect this. */
-#if (defined (C_ALLOCA) || defined (REGEX_MALLOC)) && defined (emacs)
-#undef MATCH_MAY_ALLOCATE
-#endif
-
-
-/* Failure stack declarations and macros; both re_compile_fastmap and
- re_match_2 use a failure stack. These have to be macros because of
- REGEX_ALLOCATE_STACK. */
-
-
-/* Number of failure points for which to initially allocate space
- when matching. If this number is exceeded, we allocate more
- space, so it is not a hard limit. */
-#ifndef INIT_FAILURE_ALLOC
-#define INIT_FAILURE_ALLOC 5
-#endif
-
-/* Roughly the maximum number of failure points on the stack. Would be
- exactly that if always used MAX_FAILURE_ITEMS items each time we failed.
- This is a variable only so users of regex can assign to it; we never
- change it ourselves. */
-
-#ifdef INT_IS_16BIT
-
-#if defined (MATCH_MAY_ALLOCATE)
-/* 4400 was enough to cause a crash on Alpha OSF/1,
- whose default stack limit is 2mb. */
-long int re_max_failures = 4000;
-#else
-long int re_max_failures = 2000;
-#endif
-
-union fail_stack_elt
-{
- unsigned char *pointer;
- long int integer;
-};
-
-typedef union fail_stack_elt fail_stack_elt_t;
-
-typedef struct
-{
- fail_stack_elt_t *stack;
- unsigned long int size;
- unsigned long int avail; /* Offset of next open position. */
-} fail_stack_type;
-
-#else /* not INT_IS_16BIT */
-
-#if defined (MATCH_MAY_ALLOCATE)
-/* 4400 was enough to cause a crash on Alpha OSF/1,
- whose default stack limit is 2mb. */
-int re_max_failures = 20000;
-#else
+/* Binary backward compatibility. */
+#if _LIBC
+# include <shlib-compat.h>
+# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)
+link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.")
int re_max_failures = 2000;
-#endif
-
-union fail_stack_elt
-{
- unsigned char *pointer;
- int integer;
-};
-
-typedef union fail_stack_elt fail_stack_elt_t;
-
-typedef struct
-{
- fail_stack_elt_t *stack;
- unsigned size;
- unsigned avail; /* Offset of next open position. */
-} fail_stack_type;
-
-#endif /* INT_IS_16BIT */
-
-#define FAIL_STACK_EMPTY() (fail_stack.avail == 0)
-#define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0)
-#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size)
-
-
-/* Define macros to initialize and free the failure stack.
- Do `return -2' if the alloc fails. */
-
-#ifdef MATCH_MAY_ALLOCATE
-#define INIT_FAIL_STACK() \
- do { \
- fail_stack.stack = (fail_stack_elt_t *) \
- REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \
- \
- if (fail_stack.stack == NULL) \
- return -2; \
- \
- fail_stack.size = INIT_FAILURE_ALLOC; \
- fail_stack.avail = 0; \
- } while (0)
-
-#define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack)
-#else
-#define INIT_FAIL_STACK() \
- do { \
- fail_stack.avail = 0; \
- } while (0)
-
-#define RESET_FAIL_STACK()
-#endif
-
-
-/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
-
- Return 1 if succeeds, and 0 if either ran out of memory
- allocating space for it or it was already too large.
-
- REGEX_REALLOCATE_STACK requires `destination' be declared. */
-
-#define DOUBLE_FAIL_STACK(fail_stack) \
- ((fail_stack).size > (unsigned) (re_max_failures * MAX_FAILURE_ITEMS) \
- ? 0 \
- : ((fail_stack).stack = (fail_stack_elt_t *) \
- REGEX_REALLOCATE_STACK ((fail_stack).stack, \
- (fail_stack).size * sizeof (fail_stack_elt_t), \
- ((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \
- \
- (fail_stack).stack == NULL \
- ? 0 \
- : ((fail_stack).size <<= 1, \
- 1)))
-
-
-/* Push pointer POINTER on FAIL_STACK.
- Return 1 if was able to do so and 0 if ran out of memory allocating
- space to do so. */
-#define PUSH_PATTERN_OP(POINTER, FAIL_STACK) \
- ((FAIL_STACK_FULL () \
- && !DOUBLE_FAIL_STACK (FAIL_STACK)) \
- ? 0 \
- : ((FAIL_STACK).stack[(FAIL_STACK).avail++].pointer = POINTER, \
- 1))
-
-/* Push a pointer value onto the failure stack.
- Assumes the variable `fail_stack'. Probably should only
- be called from within `PUSH_FAILURE_POINT'. */
-#define PUSH_FAILURE_POINTER(item) \
- fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (item)
-
-/* This pushes an integer-valued item onto the failure stack.
- Assumes the variable `fail_stack'. Probably should only
- be called from within `PUSH_FAILURE_POINT'. */
-#define PUSH_FAILURE_INT(item) \
- fail_stack.stack[fail_stack.avail++].integer = (item)
-
-/* Push a fail_stack_elt_t value onto the failure stack.
- Assumes the variable `fail_stack'. Probably should only
- be called from within `PUSH_FAILURE_POINT'. */
-#define PUSH_FAILURE_ELT(item) \
- fail_stack.stack[fail_stack.avail++] = (item)
-
-/* These three POP... operations complement the three PUSH... operations.
- All assume that `fail_stack' is nonempty. */
-#define POP_FAILURE_POINTER() fail_stack.stack[--fail_stack.avail].pointer
-#define POP_FAILURE_INT() fail_stack.stack[--fail_stack.avail].integer
-#define POP_FAILURE_ELT() fail_stack.stack[--fail_stack.avail]
-
-/* Used to omit pushing failure point id's when we're not debugging. */
-#ifdef DEBUG
-#define DEBUG_PUSH PUSH_FAILURE_INT
-#define DEBUG_POP(item_addr) (item_addr)->integer = POP_FAILURE_INT ()
-#else
-#define DEBUG_PUSH(item)
-#define DEBUG_POP(item_addr)
-#endif
-
-
-/* Push the information about the state we will need
- if we ever fail back to it.
-
- Requires variables fail_stack, regstart, regend, reg_info, and
- num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be
- declared.
-
- Does `return FAILURE_CODE' if runs out of memory. */
-
-#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \
- do { \
- char *destination; \
- /* Must be int, so when we don't save any registers, the arithmetic \
- of 0 + -1 isn't done as unsigned. */ \
- /* Can't be int, since there is not a shred of a guarantee that int \
- is wide enough to hold a value of something to which pointer can \
- be assigned */ \
- s_reg_t this_reg; \
- \
- DEBUG_STATEMENT (failure_id++); \
- DEBUG_STATEMENT (nfailure_points_pushed++); \
- DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \
- DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\
- DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\
- \
- DEBUG_PRINT2 (" slots needed: %d\n", NUM_FAILURE_ITEMS); \
- DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \
- \
- /* Ensure we have enough space allocated for what we will push. */ \
- while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \
- { \
- if (!DOUBLE_FAIL_STACK (fail_stack)) \
- return failure_code; \
- \
- DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \
- (fail_stack).size); \
- DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\
- } \
- \
- /* Push the info, starting with the registers. */ \
- DEBUG_PRINT1 ("\n"); \
- \
- if (1) \
- for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \
- this_reg++) \
- { \
- DEBUG_PRINT2 (" Pushing reg: %d\n", this_reg); \
- DEBUG_STATEMENT (num_regs_pushed++); \
- \
- DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \
- PUSH_FAILURE_POINTER (regstart[this_reg]); \
- \
- DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \
- PUSH_FAILURE_POINTER (regend[this_reg]); \
- \
- DEBUG_PRINT2 (" info: 0x%x\n ", reg_info[this_reg]); \
- DEBUG_PRINT2 (" match_null=%d", \
- REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \
- DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \
- DEBUG_PRINT2 (" matched_something=%d", \
- MATCHED_SOMETHING (reg_info[this_reg])); \
- DEBUG_PRINT2 (" ever_matched=%d", \
- EVER_MATCHED_SOMETHING (reg_info[this_reg])); \
- DEBUG_PRINT1 ("\n"); \
- PUSH_FAILURE_ELT (reg_info[this_reg].word); \
- } \
- \
- DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg);\
- PUSH_FAILURE_INT (lowest_active_reg); \
- \
- DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\
- PUSH_FAILURE_INT (highest_active_reg); \
- \
- DEBUG_PRINT2 (" Pushing pattern 0x%x:\n", pattern_place); \
- DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \
- PUSH_FAILURE_POINTER (pattern_place); \
- \
- DEBUG_PRINT2 (" Pushing string 0x%x: `", string_place); \
- DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \
- size2); \
- DEBUG_PRINT1 ("'\n"); \
- PUSH_FAILURE_POINTER (string_place); \
- \
- DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \
- DEBUG_PUSH (failure_id); \
- } while (0)
-
-/* This is the number of items that are pushed and popped on the stack
- for each register. */
-#define NUM_REG_ITEMS 3
-
-/* Individual items aside from the registers. */
-#ifdef DEBUG
-#define NUM_NONREG_ITEMS 5 /* Includes failure point id. */
-#else
-#define NUM_NONREG_ITEMS 4
-#endif
-
-/* We push at most this many items on the stack. */
-/* We used to use (num_regs - 1), which is the number of registers
- this regexp will save; but that was changed to 5
- to avoid stack overflow for a regexp with lots of parens. */
-#define MAX_FAILURE_ITEMS (5 * NUM_REG_ITEMS + NUM_NONREG_ITEMS)
-
-/* We actually push this many items. */
-#define NUM_FAILURE_ITEMS \
- (((0 \
- ? 0 : highest_active_reg - lowest_active_reg + 1) \
- * NUM_REG_ITEMS) \
- + NUM_NONREG_ITEMS)
-
-/* How many items can still be added to the stack without overflowing it. */
-#define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail)
-
-
-/* Pops what PUSH_FAIL_STACK pushes.
-
- We restore into the parameters, all of which should be lvalues:
- STR -- the saved data position.
- PAT -- the saved pattern position.
- LOW_REG, HIGH_REG -- the highest and lowest active registers.
- REGSTART, REGEND -- arrays of string positions.
- REG_INFO -- array of information about each subexpression.
-
- Also assumes the variables `fail_stack' and (if debugging), `bufp',
- `pend', `string1', `size1', `string2', and `size2'. */
-
-#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\
-{ \
- DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \
- s_reg_t this_reg; \
- const unsigned char *string_temp; \
- \
- assert (!FAIL_STACK_EMPTY ()); \
- \
- /* Remove failure points and point to how many regs pushed. */ \
- DEBUG_PRINT1 ("POP_FAILURE_POINT:\n"); \
- DEBUG_PRINT2 (" Before pop, next avail: %d\n", fail_stack.avail); \
- DEBUG_PRINT2 (" size: %d\n", fail_stack.size); \
- \
- assert (fail_stack.avail >= NUM_NONREG_ITEMS); \
- \
- DEBUG_POP (&failure_id); \
- DEBUG_PRINT2 (" Popping failure id: %u\n", failure_id); \
- \
- /* If the saved string location is NULL, it came from an \
- on_failure_keep_string_jump opcode, and we want to throw away the \
- saved NULL, thus retaining our current position in the string. */ \
- string_temp = POP_FAILURE_POINTER (); \
- if (string_temp != NULL) \
- str = (const char *) string_temp; \
- \
- DEBUG_PRINT2 (" Popping string 0x%x: `", str); \
- DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \
- DEBUG_PRINT1 ("'\n"); \
- \
- pat = (unsigned char *) POP_FAILURE_POINTER (); \
- DEBUG_PRINT2 (" Popping pattern 0x%x:\n", pat); \
- DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \
- \
- /* Restore register info. */ \
- high_reg = (active_reg_t) POP_FAILURE_INT (); \
- DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \
- \
- low_reg = (active_reg_t) POP_FAILURE_INT (); \
- DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \
- \
- if (1) \
- for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \
- { \
- DEBUG_PRINT2 (" Popping reg: %d\n", this_reg); \
- \
- reg_info[this_reg].word = POP_FAILURE_ELT (); \
- DEBUG_PRINT2 (" info: 0x%x\n", reg_info[this_reg]); \
- \
- regend[this_reg] = (const char *) POP_FAILURE_POINTER (); \
- DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \
- \
- regstart[this_reg] = (const char *) POP_FAILURE_POINTER (); \
- DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \
- } \
- else \
- { \
- for (this_reg = highest_active_reg; this_reg > high_reg; this_reg--) \
- { \
- reg_info[this_reg].word.integer = 0; \
- regend[this_reg] = 0; \
- regstart[this_reg] = 0; \
- } \
- highest_active_reg = high_reg; \
- } \
- \
- set_regs_matched_done = 0; \
- DEBUG_STATEMENT (nfailure_points_popped++); \
-} /* POP_FAILURE_POINT */
-
-
-
-/* Structure for per-register (a.k.a. per-group) information.
- Other register information, such as the
- starting and ending positions (which are addresses), and the list of
- inner groups (which is a bits list) are maintained in separate
- variables.
-
- We are making a (strictly speaking) nonportable assumption here: that
- the compiler will pack our bit fields into something that fits into
- the type of `word', i.e., is something that fits into one item on the
- failure stack. */
-
-
-/* Declarations and macros for re_match_2. */
-
-typedef union
-{
- fail_stack_elt_t word;
- struct
- {
- /* This field is one if this group can match the empty string,
- zero if not. If not yet determined, `MATCH_NULL_UNSET_VALUE'. */
-#define MATCH_NULL_UNSET_VALUE 3
- unsigned match_null_string_p : 2;
- unsigned is_active : 1;
- unsigned matched_something : 1;
- unsigned ever_matched_something : 1;
- } bits;
-} register_info_type;
-
-#define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p)
-#define IS_ACTIVE(R) ((R).bits.is_active)
-#define MATCHED_SOMETHING(R) ((R).bits.matched_something)
-#define EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something)
-
-
-/* Call this when have matched a real character; it sets `matched' flags
- for the subexpressions which we are currently inside. Also records
- that those subexprs have matched. */
-#define SET_REGS_MATCHED() \
- do \
- { \
- if (!set_regs_matched_done) \
- { \
- active_reg_t r; \
- set_regs_matched_done = 1; \
- for (r = lowest_active_reg; r <= highest_active_reg; r++) \
- { \
- MATCHED_SOMETHING (reg_info[r]) \
- = EVER_MATCHED_SOMETHING (reg_info[r]) \
- = 1; \
- } \
- } \
- } \
- while (0)
-
-/* Registers are set to a sentinel when they haven't yet matched. */
-static char reg_unset_dummy;
-#define REG_UNSET_VALUE (&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,
- int arg1, int arg2));
-static void insert_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc,
- int arg, unsigned char *end));
-static void insert_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc,
- int arg1, int arg2, unsigned char *end));
-static boolean at_begline_loc_p _RE_ARGS ((const char *pattern, const char *p,
- reg_syntax_t syntax));
-static boolean at_endline_loc_p _RE_ARGS ((const char *p, const char *pend,
- reg_syntax_t syntax));
-static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
- const char *pend,
- char *translate,
- reg_syntax_t syntax,
- unsigned char *b));
-
-/* Fetch the next character in the uncompiled pattern---translating it
- if necessary. Also cast from a signed character in the constant
- string passed to us by the user to an unsigned char that we can use
- as an array index (in, e.g., `translate'). */
-#ifndef PATFETCH
-#define PATFETCH(c) \
- do {if (p == pend) return REG_EEND; \
- c = (unsigned char) *p++; \
- if (translate) c = (unsigned char) translate[c]; \
- } while (0)
-#endif
-
-/* Fetch the next character in the uncompiled pattern, with no
- translation. */
-#define PATFETCH_RAW(c) \
- do {if (p == pend) return REG_EEND; \
- c = (unsigned char) *p++; \
- } while (0)
-
-/* Go backwards one character in the pattern. */
-#define PATUNFETCH p--
-
-
-/* If `translate' is non-null, return translate[D], else just D. We
- cast the subscript to translate because some data is declared as
- `char *', to avoid warnings when a string constant is passed. But
- when we use a character as a subscript we must make it unsigned. */
-#ifndef TRANSLATE
-#define TRANSLATE(d) \
- (translate ? (char) translate[(unsigned char) (d)] : (d))
-#endif
-
-
-/* Macros for outputting the compiled pattern into `buffer'. */
-
-/* If the buffer isn't allocated when it comes in, use this. */
-#define INIT_BUF_SIZE 32
-
-/* Make sure we have at least N more bytes of space in buffer. */
-#define GET_BUFFER_SPACE(n) \
- while ((unsigned long) (b - bufp->buffer + (n)) > bufp->allocated) \
- EXTEND_BUFFER ()
-
-/* Make sure we have one more byte of buffer space and then add C to it. */
-#define BUF_PUSH(c) \
- do { \
- GET_BUFFER_SPACE (1); \
- *b++ = (unsigned char) (c); \
- } while (0)
-
-
-/* Ensure we have two more bytes of buffer space and then append C1 and C2. */
-#define BUF_PUSH_2(c1, c2) \
- do { \
- GET_BUFFER_SPACE (2); \
- *b++ = (unsigned char) (c1); \
- *b++ = (unsigned char) (c2); \
- } while (0)
-
-
-/* As with BUF_PUSH_2, except for three bytes. */
-#define BUF_PUSH_3(c1, c2, c3) \
- do { \
- GET_BUFFER_SPACE (3); \
- *b++ = (unsigned char) (c1); \
- *b++ = (unsigned char) (c2); \
- *b++ = (unsigned char) (c3); \
- } while (0)
-
-
-/* Store a jump with opcode OP at LOC to location TO. We store a
- relative address offset by the three bytes the jump itself occupies. */
-#define STORE_JUMP(op, loc, to) \
- store_op1 (op, loc, (int) ((to) - (loc) - 3))
-
-/* Likewise, for a two-argument jump. */
-#define STORE_JUMP2(op, loc, to, arg) \
- store_op2 (op, loc, (int) ((to) - (loc) - 3), arg)
-
-/* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */
-#define INSERT_JUMP(op, loc, to) \
- insert_op1 (op, loc, (int) ((to) - (loc) - 3), b)
-
-/* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */
-#define INSERT_JUMP2(op, loc, to, arg) \
- insert_op2 (op, loc, (int) ((to) - (loc) - 3), arg, b)
-
-
-/* This is not an arbitrary limit: the arguments which represent offsets
- into the pattern are two bytes long. So if 2^16 bytes turns out to
- be too small, many things would have to change. */
-/* Any other compiler which, like MSC, has allocation limit below 2^16
- bytes will have to use approach similar to what was done below for
- MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up
- reallocating to 0 bytes. Such thing is not going to work too well.
- You have been warned!! */
-#if defined(_MSC_VER) && !defined(WIN32)
-/* Microsoft C 16-bit versions limit malloc to approx 65512 bytes.
- The REALLOC define eliminates a flurry of conversion warnings,
- but is not required. */
-#define MAX_BUF_SIZE 65500L
-#define REALLOC(p,s) realloc ((p), (size_t) (s))
-#else
-#define MAX_BUF_SIZE (1L << 16)
-#define REALLOC(p,s) realloc ((p), (s))
-#endif
-
-/* Extend the buffer by twice its current size via realloc and
- reset the pointers that pointed into the old block to point to the
- correct places in the new one. If extending the buffer results in it
- being larger than MAX_BUF_SIZE, then flag memory exhausted. */
-#define EXTEND_BUFFER() \
- do { \
- unsigned char *old_buffer = bufp->buffer; \
- if (bufp->allocated == MAX_BUF_SIZE) \
- return REG_ESIZE; \
- bufp->allocated <<= 1; \
- if (bufp->allocated > MAX_BUF_SIZE) \
- bufp->allocated = MAX_BUF_SIZE; \
- bufp->buffer = (unsigned char *) REALLOC (bufp->buffer, bufp->allocated);\
- if (bufp->buffer == NULL) \
- return REG_ESPACE; \
- /* If the buffer moved, move all the pointers into it. */ \
- if (old_buffer != bufp->buffer) \
- { \
- b = (b - old_buffer) + bufp->buffer; \
- begalt = (begalt - old_buffer) + bufp->buffer; \
- if (fixup_alt_jump) \
- fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\
- if (laststart) \
- laststart = (laststart - old_buffer) + bufp->buffer; \
- if (pending_exact) \
- pending_exact = (pending_exact - old_buffer) + bufp->buffer; \
- } \
- } while (0)
-
-
-/* Since we have one byte reserved for the register number argument to
- {start,stop}_memory, the maximum number of groups we can report
- things about is what fits in that byte. */
-#define MAX_REGNUM 255
-
-/* But patterns can have more than `MAX_REGNUM' registers. We just
- ignore the excess. */
-typedef unsigned regnum_t;
-
-
-/* Macros for the compile stack. */
-
-/* Since offsets can go either forwards or backwards, this type needs to
- be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */
-/* int may be not enough when sizeof(int) == 2. */
-typedef long pattern_offset_t;
-
-typedef struct
-{
- pattern_offset_t begalt_offset;
- pattern_offset_t fixup_alt_jump;
- pattern_offset_t inner_group_offset;
- pattern_offset_t laststart_offset;
- regnum_t regnum;
-} compile_stack_elt_t;
-
-
-typedef struct
-{
- compile_stack_elt_t *stack;
- unsigned size;
- unsigned avail; /* Offset of next open position. */
-} compile_stack_type;
-
-
-#define INIT_COMPILE_STACK_SIZE 32
-
-#define COMPILE_STACK_EMPTY (compile_stack.avail == 0)
-#define COMPILE_STACK_FULL (compile_stack.avail == compile_stack.size)
-
-/* The next available element. */
-#define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail])
-
-
-/* Set the bit for character C in a list. */
-#define SET_LIST_BIT(c) \
- (b[((unsigned char) (c)) / BYTEWIDTH] \
- |= 1 << (((unsigned char) c) % BYTEWIDTH))
-
-
-/* Get the next unsigned number in the uncompiled pattern. */
-#define GET_UNSIGNED_NUMBER(num) \
- { if (p != pend) \
- { \
- PATFETCH (c); \
- while (ISDIGIT (c)) \
- { \
- if (num < 0) \
- num = 0; \
- num = num * 10 + c - '0'; \
- if (p == pend) \
- break; \
- PATFETCH (c); \
- } \
- } \
- }
-
-#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
-/* The GNU C library provides support for user-defined character classes
- and the functions from ISO C amendement 1. */
-# ifdef CHARCLASS_NAME_MAX
-# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
-# else
-/* This shouldn't happen but some implementation might still have this
- problem. Use a reasonable default value. */
-# define CHAR_CLASS_MAX_LENGTH 256
# endif
-
-# define IS_CHAR_CLASS(string) wctype (string)
-#else
-# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
-
-# define IS_CHAR_CLASS(string) \
- (STREQ (string, "alpha") || STREQ (string, "upper") \
- || STREQ (string, "lower") || STREQ (string, "digit") \
- || STREQ (string, "alnum") || STREQ (string, "xdigit") \
- || STREQ (string, "space") || STREQ (string, "print") \
- || STREQ (string, "punct") || STREQ (string, "graph") \
- || STREQ (string, "cntrl") || STREQ (string, "blank"))
-#endif
-
-#ifndef MATCH_MAY_ALLOCATE
-
-/* If we cannot allocate large objects within re_match_2_internal,
- we make the fail stack and register vectors global.
- The fail stack, we grow to the maximum size when a regexp
- is compiled.
- The register vectors, we adjust in size each time we
- compile a regexp, according to the number of registers it needs. */
-
-static fail_stack_type fail_stack;
-
-/* Size with which the following vectors are currently allocated.
- That is so we can make them bigger as needed,
- but never make them smaller. */
-static int regs_allocated_size;
-
-static const char ** regstart, ** regend;
-static const char ** old_regstart, ** old_regend;
-static const char **best_regstart, **best_regend;
-static register_info_type *reg_info;
-static const char **reg_dummy;
-static register_info_type *reg_info_dummy;
-
-/* Make the register vectors big enough for NUM_REGS registers,
- but don't make them smaller. */
-
-static
-regex_grow_registers (num_regs)
- int num_regs;
-{
- if (num_regs > regs_allocated_size)
- {
- RETALLOC_IF (regstart, num_regs, const char *);
- RETALLOC_IF (regend, num_regs, const char *);
- RETALLOC_IF (old_regstart, num_regs, const char *);
- RETALLOC_IF (old_regend, num_regs, const char *);
- RETALLOC_IF (best_regstart, num_regs, const char *);
- RETALLOC_IF (best_regend, num_regs, const char *);
- RETALLOC_IF (reg_info, num_regs, register_info_type);
- RETALLOC_IF (reg_dummy, num_regs, const char *);
- RETALLOC_IF (reg_info_dummy, num_regs, register_info_type);
-
- regs_allocated_size = num_regs;
- }
-}
-
-#endif /* not MATCH_MAY_ALLOCATE */
-
-static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type
- compile_stack,
- regnum_t regnum));
-
-/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
- Returns one of error codes defined in `regex.h', or zero for success.
-
- Assumes the `allocated' (and perhaps `buffer') and `translate'
- fields are set in BUFP on entry.
-
- If it succeeds, results are put in BUFP (if it returns an error, the
- contents of BUFP are undefined):
- `buffer' is the compiled pattern;
- `syntax' is set to SYNTAX;
- `used' is set to the length of the compiled pattern;
- `fastmap_accurate' is zero;
- `re_nsub' is the number of subexpressions in PATTERN;
- `not_bol' and `not_eol' are zero;
-
- The `fastmap' and `newline_anchor' fields are neither
- examined nor set. */
-
-/* Return, freeing storage we allocated. */
-#define FREE_STACK_RETURN(value) \
- return (free (compile_stack.stack), value)
-
-static reg_errcode_t
-regex_compile (pattern, size, syntax, bufp)
- const char *pattern;
- size_t size;
- reg_syntax_t syntax;
- struct re_pattern_buffer *bufp;
-{
- /* We fetch characters from PATTERN here. Even though PATTERN is
- `char *' (i.e., signed), we declare these variables as unsigned, so
- they can be reliably used as array indices. */
- register unsigned char c, c1;
-
- /* A random temporary spot in PATTERN. */
- const char *p1;
-
- /* Points to the end of the buffer, where we should append. */
- register unsigned char *b;
-
- /* Keeps track of unclosed groups. */
- compile_stack_type compile_stack;
-
- /* Points to the current (ending) position in the pattern. */
- const char *p = pattern;
- const char *pend = pattern + size;
-
- /* How to translate the characters in the pattern. */
- RE_TRANSLATE_TYPE translate = bufp->translate;
-
- /* Address of the count-byte of the most recently inserted `exactn'
- command. This makes it possible to tell if a new exact-match
- character can be added to that command or if the character requires
- a new `exactn' command. */
- unsigned char *pending_exact = 0;
-
- /* Address of start of the most recently finished expression.
- This tells, e.g., postfix * where to find the start of its
- operand. Reset at the beginning of groups and alternatives. */
- unsigned char *laststart = 0;
-
- /* Address of beginning of regexp, or inside of last group. */
- unsigned char *begalt;
-
- /* Place in the uncompiled pattern (i.e., the {) to
- which to go back if the interval is invalid. */
- const char *beg_interval;
-
- /* Address of the place where a forward jump should go to the end of
- the containing expression. Each alternative of an `or' -- except the
- last -- ends with a forward jump of this sort. */
- unsigned char *fixup_alt_jump = 0;
-
- /* Counts open-groups as they are encountered. Remembered for the
- matching close-group on the compile stack, so the same register
- number is put in the stop_memory as the start_memory. */
- regnum_t regnum = 0;
-
-#ifdef DEBUG
- DEBUG_PRINT1 ("\nCompiling pattern: ");
- if (debug)
- {
- unsigned debug_count;
-
- for (debug_count = 0; debug_count < size; debug_count++)
- putchar (pattern[debug_count]);
- putchar ('\n');
- }
-#endif /* DEBUG */
-
- /* Initialize the compile stack. */
- compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t);
- if (compile_stack.stack == NULL)
- return REG_ESPACE;
-
- compile_stack.size = INIT_COMPILE_STACK_SIZE;
- compile_stack.avail = 0;
-
- /* Initialize the pattern buffer. */
- bufp->syntax = syntax;
- bufp->fastmap_accurate = 0;
- bufp->not_bol = bufp->not_eol = 0;
-
- /* Set `used' to zero, so that if we return an error, the pattern
- printer (for debugging) will think there's no pattern. We reset it
- at the end. */
- bufp->used = 0;
-
- /* Always count groups, whether or not bufp->no_sub is set. */
- bufp->re_nsub = 0;
-
-#if !defined (emacs) && !defined (SYNTAX_TABLE)
- /* Initialize the syntax table. */
- init_syntax_once ();
-#endif
-
- if (bufp->allocated == 0)
- {
- if (bufp->buffer)
- { /* If zero allocated, but buffer is non-null, try to realloc
- enough space. This loses if buffer's address is bogus, but
- that is the user's responsibility. */
- RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char);
- }
- else
- { /* Caller did not allocate a buffer. Do it for them. */
- bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char);
- }
- if (!bufp->buffer) FREE_STACK_RETURN (REG_ESPACE);
-
- bufp->allocated = INIT_BUF_SIZE;
- }
-
- begalt = b = bufp->buffer;
-
- /* Loop through the uncompiled pattern until we're at the end. */
- while (p != pend)
- {
- PATFETCH (c);
-
- switch (c)
- {
- case '^':
- {
- if ( /* If at start of pattern, it's an operator. */
- p == pattern + 1
- /* If context independent, it's an operator. */
- || syntax & RE_CONTEXT_INDEP_ANCHORS
- /* Otherwise, depends on what's come before. */
- || at_begline_loc_p (pattern, p, syntax))
- BUF_PUSH (begline);
- else
- goto normal_char;
- }
- break;
-
-
- case '$':
- {
- if ( /* If at end of pattern, it's an operator. */
- p == pend
- /* If context independent, it's an operator. */
- || syntax & RE_CONTEXT_INDEP_ANCHORS
- /* Otherwise, depends on what's next. */
- || at_endline_loc_p (p, pend, syntax))
- BUF_PUSH (endline);
- else
- goto normal_char;
- }
- break;
-
-
- case '+':
- case '?':
- if ((syntax & RE_BK_PLUS_QM)
- || (syntax & RE_LIMITED_OPS))
- goto normal_char;
- handle_plus:
- case '*':
- /* If there is no previous pattern... */
- if (!laststart)
- {
- if (syntax & RE_CONTEXT_INVALID_OPS)
- FREE_STACK_RETURN (REG_BADRPT);
- else if (!(syntax & RE_CONTEXT_INDEP_OPS))
- goto normal_char;
- }
-
- {
- /* Are we optimizing this jump? */
- boolean keep_string_p = false;
-
- /* 1 means zero (many) matches is allowed. */
- char zero_times_ok = 0, many_times_ok = 0;
-
- /* If there is a sequence of repetition chars, collapse it
- down to just one (the right one). We can't combine
- interval operators with these because of, e.g., `a{2}*',
- which should only match an even number of `a's. */
-
- for (;;)
- {
- zero_times_ok |= c != '+';
- many_times_ok |= c != '?';
-
- if (p == pend)
- break;
-
- PATFETCH (c);
-
- if (c == '*'
- || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?')))
- ;
-
- else if (syntax & RE_BK_PLUS_QM && c == '\\')
- {
- if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
-
- PATFETCH (c1);
- if (!(c1 == '+' || c1 == '?'))
- {
- PATUNFETCH;
- PATUNFETCH;
- break;
- }
-
- c = c1;
- }
- else
- {
- PATUNFETCH;
- break;
- }
-
- /* If we get here, we found another repeat character. */
- }
-
- /* Star, etc. applied to an empty pattern is equivalent
- to an empty pattern. */
- if (!laststart)
- break;
-
- /* Now we know whether or not zero matches is allowed
- and also whether or not two or more matches is allowed. */
- if (many_times_ok)
- { /* More than one repetition is allowed, so put in at the
- end a backward relative jump from `b' to before the next
- jump we're going to put in below (which jumps from
- laststart to after this jump).
-
- But if we are at the `*' in the exact sequence `.*\n',
- insert an unconditional jump backwards to the .,
- instead of the beginning of the loop. This way we only
- push a failure point once, instead of every time
- through the loop. */
- assert (p - 1 > pattern);
-
- /* Allocate the space for the jump. */
- GET_BUFFER_SPACE (3);
-
- /* We know we are not at the first character of the pattern,
- because laststart was nonzero. And we've already
- incremented `p', by the way, to be the character after
- the `*'. Do we have to do something analogous here
- for null bytes, because of RE_DOT_NOT_NULL? */
- if (TRANSLATE (*(p - 2)) == TRANSLATE ('.')
- && zero_times_ok
- && p < pend && TRANSLATE (*p) == TRANSLATE ('\n')
- && !(syntax & RE_DOT_NEWLINE))
- { /* We have .*\n. */
- STORE_JUMP (jump, b, laststart);
- keep_string_p = true;
- }
- else
- /* Anything else. */
- STORE_JUMP (maybe_pop_jump, b, laststart - 3);
-
- /* We've added more stuff to the buffer. */
- b += 3;
- }
-
- /* On failure, jump from laststart to b + 3, which will be the
- end of the buffer after this jump is inserted. */
- GET_BUFFER_SPACE (3);
- INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump
- : on_failure_jump,
- laststart, b + 3);
- pending_exact = 0;
- b += 3;
-
- if (!zero_times_ok)
- {
- /* At least one repetition is required, so insert a
- `dummy_failure_jump' before the initial
- `on_failure_jump' instruction of the loop. This
- effects a skip over that instruction the first time
- we hit that loop. */
- GET_BUFFER_SPACE (3);
- INSERT_JUMP (dummy_failure_jump, laststart, laststart + 6);
- b += 3;
- }
- }
- break;
-
-
- case '.':
- laststart = b;
- BUF_PUSH (anychar);
- break;
-
-
- case '[':
- {
- boolean had_char_class = false;
-
- if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
-
- /* Ensure that we have enough space to push a charset: the
- opcode, the length count, and the bitset; 34 bytes in all. */
- GET_BUFFER_SPACE (34);
-
- laststart = b;
-
- /* We test `*p == '^' twice, instead of using an if
- statement, so we only need one BUF_PUSH. */
- BUF_PUSH (*p == '^' ? charset_not : charset);
- if (*p == '^')
- p++;
-
- /* Remember the first position in the bracket expression. */
- p1 = p;
-
- /* Push the number of bytes in the bitmap. */
- BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
-
- /* Clear the whole map. */
- bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
-
- /* charset_not matches newline according to a syntax bit. */
- if ((re_opcode_t) b[-2] == charset_not
- && (syntax & RE_HAT_LISTS_NOT_NEWLINE))
- SET_LIST_BIT ('\n');
-
- /* Read in characters and ranges, setting map bits. */
- for (;;)
- {
- if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
-
- PATFETCH (c);
-
- /* \ might escape characters inside [...] and [^...]. */
- if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\')
- {
- if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
-
- PATFETCH (c1);
- SET_LIST_BIT (c1);
- continue;
- }
-
- /* Could be the end of the bracket expression. If it's
- not (i.e., when the bracket expression is `[]' so
- far), the ']' character bit gets set way below. */
- if (c == ']' && p != p1 + 1)
- break;
-
- /* Look ahead to see if it's a range when the last thing
- was a character class. */
- if (had_char_class && c == '-' && *p != ']')
- FREE_STACK_RETURN (REG_ERANGE);
-
- /* Look ahead to see if it's a range when the last thing
- was a character: if this is a hyphen not at the
- beginning or the end of a list, then it's the range
- operator. */
- if (c == '-'
- && !(p - 2 >= pattern && p[-2] == '[')
- && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
- && *p != ']')
- {
- reg_errcode_t ret
- = compile_range (&p, pend, translate, syntax, b);
- if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
- }
-
- else if (p[0] == '-' && p[1] != ']')
- { /* This handles ranges made up of characters only. */
- reg_errcode_t ret;
-
- /* Move past the `-'. */
- PATFETCH (c1);
-
- ret = compile_range (&p, pend, translate, syntax, b);
- if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
- }
-
- /* 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 == ':' || c == ']' || p == pend
- || c1 == CHAR_CLASS_MAX_LENGTH)
- break;
- str[c1++] = c;
- }
- str[c1] = '\0';
-
- /* If isn't a word bracketed by `[:' and:`]':
- undo the ending character, the letters, and leave
- the leading `:' and `[' (but set bits for them). */
- if (c == ':' && *p == ']')
- {
-#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
- boolean is_lower = STREQ (str, "lower");
- boolean is_upper = STREQ (str, "upper");
- wctype_t wt;
- int ch;
-
- wt = wctype (str);
- if (wt == 0)
- FREE_STACK_RETURN (REG_ECTYPE);
-
- /* Throw away the ] at the end of the character
- class. */
- PATFETCH (c);
-
- if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
-
- for (ch = 0; ch < 1 << BYTEWIDTH; ++ch)
- {
- if (iswctype (btowc (ch), wt))
- SET_LIST_BIT (ch);
-
- if (translate && (is_upper || is_lower)
- && (ISUPPER (ch) || ISLOWER (ch)))
- SET_LIST_BIT (ch);
- }
-
- had_char_class = true;
-#else
- int ch;
- boolean is_alnum = STREQ (str, "alnum");
- boolean is_alpha = STREQ (str, "alpha");
- boolean is_blank = STREQ (str, "blank");
- boolean is_cntrl = STREQ (str, "cntrl");
- boolean is_digit = STREQ (str, "digit");
- boolean is_graph = STREQ (str, "graph");
- boolean is_lower = STREQ (str, "lower");
- boolean is_print = STREQ (str, "print");
- boolean is_punct = STREQ (str, "punct");
- boolean is_space = STREQ (str, "space");
- boolean is_upper = STREQ (str, "upper");
- boolean is_xdigit = STREQ (str, "xdigit");
-
- if (!IS_CHAR_CLASS (str))
- FREE_STACK_RETURN (REG_ECTYPE);
-
- /* Throw away the ] at the end of the character
- class. */
- PATFETCH (c);
-
- if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
-
- for (ch = 0; ch < 1 << BYTEWIDTH; ch++)
- {
- /* This was split into 3 if's to
- avoid an arbitrary limit in some compiler. */
- if ( (is_alnum && ISALNUM (ch))
- || (is_alpha && ISALPHA (ch))
- || (is_blank && ISBLANK (ch))
- || (is_cntrl && ISCNTRL (ch)))
- SET_LIST_BIT (ch);
- if ( (is_digit && ISDIGIT (ch))
- || (is_graph && ISGRAPH (ch))
- || (is_lower && ISLOWER (ch))
- || (is_print && ISPRINT (ch)))
- SET_LIST_BIT (ch);
- if ( (is_punct && ISPUNCT (ch))
- || (is_space && ISSPACE (ch))
- || (is_upper && ISUPPER (ch))
- || (is_xdigit && ISXDIGIT (ch)))
- SET_LIST_BIT (ch);
- if ( translate && (is_upper || is_lower)
- && (ISUPPER (ch) || ISLOWER (ch)))
- SET_LIST_BIT (ch);
- }
- had_char_class = true;
-#endif /* libc || wctype.h */
- }
- else
- {
- c1++;
- while (c1--)
- PATUNFETCH;
- SET_LIST_BIT ('[');
- SET_LIST_BIT (':');
- had_char_class = false;
- }
- }
- else
- {
- had_char_class = false;
- SET_LIST_BIT (c);
- }
- }
-
- /* Discard any (non)matching list bytes that are all 0 at the
- end of the map. Decrease the map-length byte too. */
- while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
- b[-1]--;
- b += b[-1];
- }
- break;
-
-
- case '(':
- if (syntax & RE_NO_BK_PARENS)
- goto handle_open;
- else
- goto normal_char;
-
-
- case ')':
- if (syntax & RE_NO_BK_PARENS)
- goto handle_close;
- else
- goto normal_char;
-
-
- case '\n':
- if (syntax & RE_NEWLINE_ALT)
- goto handle_alt;
- else
- goto normal_char;
-
-
- case '|':
- if (syntax & RE_NO_BK_VBAR)
- goto handle_alt;
- else
- goto normal_char;
-
-
- case '{':
- if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES)
- goto handle_interval;
- else
- goto normal_char;
-
-
- case '\\':
- if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
-
- /* Do not translate the character after the \, so that we can
- distinguish, e.g., \B from \b, even if we normally would
- translate, e.g., B to b. */
- PATFETCH_RAW (c);
-
- switch (c)
- {
- case '(':
- if (syntax & RE_NO_BK_PARENS)
- goto normal_backslash;
-
- handle_open:
- bufp->re_nsub++;
- regnum++;
-
- if (COMPILE_STACK_FULL)
- {
- RETALLOC (compile_stack.stack, compile_stack.size << 1,
- compile_stack_elt_t);
- if (compile_stack.stack == NULL) return REG_ESPACE;
-
- compile_stack.size <<= 1;
- }
-
- /* These are the values to restore when we hit end of this
- group. They are all relative offsets, so that if the
- whole pattern moves because of realloc, they will still
- be valid. */
- COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
- COMPILE_STACK_TOP.fixup_alt_jump
- = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
- COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
- COMPILE_STACK_TOP.regnum = regnum;
-
- /* We will eventually replace the 0 with the number of
- groups inner to this one. But do not push a
- start_memory for groups beyond the last one we can
- represent in the compiled pattern. */
- if (regnum <= MAX_REGNUM)
- {
- COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
- BUF_PUSH_3 (start_memory, regnum, 0);
- }
-
- compile_stack.avail++;
-
- fixup_alt_jump = 0;
- laststart = 0;
- begalt = b;
- /* If we've reached MAX_REGNUM groups, then this open
- won't actually generate any code, so we'll have to
- clear pending_exact explicitly. */
- pending_exact = 0;
- break;
-
-
- case ')':
- if (syntax & RE_NO_BK_PARENS) goto normal_backslash;
-
- if (COMPILE_STACK_EMPTY)
- if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
- goto normal_backslash;
- else
- FREE_STACK_RETURN (REG_ERPAREN);
-
- handle_close:
- if (fixup_alt_jump)
- { /* Push a dummy failure point at the end of the
- alternative for a possible future
- `pop_failure_jump' to pop. See comments at
- `push_dummy_failure' in `re_match_2'. */
- BUF_PUSH (push_dummy_failure);
-
- /* We allocated space for this jump when we assigned
- to `fixup_alt_jump', in the `handle_alt' case below. */
- STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
- }
-
- /* See similar code for backslashed left paren above. */
- if (COMPILE_STACK_EMPTY)
- if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
- goto normal_char;
- else
- FREE_STACK_RETURN (REG_ERPAREN);
-
- /* Since we just checked for an empty stack above, this
- ``can't happen''. */
- assert (compile_stack.avail != 0);
- {
- /* We don't just want to restore into `regnum', because
- later groups should continue to be numbered higher,
- as in `(ab)c(de)' -- the second group is #2. */
- regnum_t this_group_regnum;
-
- compile_stack.avail--;
- begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
- fixup_alt_jump
- = COMPILE_STACK_TOP.fixup_alt_jump
- ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
- : 0;
- laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
- this_group_regnum = COMPILE_STACK_TOP.regnum;
- /* If we've reached MAX_REGNUM groups, then this open
- won't actually generate any code, so we'll have to
- clear pending_exact explicitly. */
- pending_exact = 0;
-
- /* We're at the end of the group, so now we know how many
- groups were inside this one. */
- if (this_group_regnum <= MAX_REGNUM)
- {
- unsigned char *inner_group_loc
- = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
-
- *inner_group_loc = regnum - this_group_regnum;
- BUF_PUSH_3 (stop_memory, this_group_regnum,
- regnum - this_group_regnum);
- }
- }
- break;
-
-
- case '|': /* `\|'. */
- if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR)
- goto normal_backslash;
- handle_alt:
- if (syntax & RE_LIMITED_OPS)
- goto normal_char;
-
- /* Insert before the previous alternative a jump which
- jumps to this alternative if the former fails. */
- GET_BUFFER_SPACE (3);
- INSERT_JUMP (on_failure_jump, begalt, b + 6);
- pending_exact = 0;
- b += 3;
-
- /* The alternative before this one has a jump after it
- which gets executed if it gets matched. Adjust that
- jump so it will jump to this alternative's analogous
- jump (put in below, which in turn will jump to the next
- (if any) alternative's such jump, etc.). The last such
- jump jumps to the correct final destination. A picture:
- _____ _____
- | | | |
- | v | v
- a | b | c
-
- If we are at `b', then fixup_alt_jump right now points to a
- three-byte space after `a'. We'll put in the jump, set
- fixup_alt_jump to right after `b', and leave behind three
- bytes which we'll fill in when we get to after `c'. */
-
- if (fixup_alt_jump)
- STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
-
- /* Mark and leave space for a jump after this alternative,
- to be filled in later either by next alternative or
- when know we're at the end of a series of alternatives. */
- fixup_alt_jump = b;
- GET_BUFFER_SPACE (3);
- b += 3;
-
- laststart = 0;
- begalt = b;
- break;
-
-
- case '{':
- /* If \{ is a literal. */
- if (!(syntax & RE_INTERVALS)
- /* If we're at `\{' and it's not the open-interval
- operator. */
- || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
- || (p - 2 == pattern && p == pend))
- goto normal_backslash;
-
- handle_interval:
- {
- /* If got here, then the syntax allows intervals. */
-
- /* At least (most) this many matches must be made. */
- int lower_bound = -1, upper_bound = -1;
-
- beg_interval = p - 1;
-
- if (p == pend)
- {
- if (syntax & RE_NO_BK_BRACES)
- goto unfetch_interval;
- else
- FREE_STACK_RETURN (REG_EBRACE);
- }
-
- GET_UNSIGNED_NUMBER (lower_bound);
-
- if (c == ',')
- {
- GET_UNSIGNED_NUMBER (upper_bound);
- if (upper_bound < 0) upper_bound = RE_DUP_MAX;
- }
- else
- /* Interval such as `{1}' => match exactly once. */
- upper_bound = lower_bound;
-
- if (lower_bound < 0 || upper_bound > RE_DUP_MAX
- || lower_bound > upper_bound)
- {
- if (syntax & RE_NO_BK_BRACES)
- goto unfetch_interval;
- else
- FREE_STACK_RETURN (REG_BADBR);
- }
-
- if (!(syntax & RE_NO_BK_BRACES))
- {
- if (c != '\\') FREE_STACK_RETURN (REG_EBRACE);
-
- PATFETCH (c);
- }
-
- if (c != '}')
- {
- if (syntax & RE_NO_BK_BRACES)
- goto unfetch_interval;
- else
- FREE_STACK_RETURN (REG_BADBR);
- }
-
- /* We just parsed a valid interval. */
-
- /* If it's invalid to have no preceding re. */
- if (!laststart)
- {
- if (syntax & RE_CONTEXT_INVALID_OPS)
- FREE_STACK_RETURN (REG_BADRPT);
- else if (syntax & RE_CONTEXT_INDEP_OPS)
- laststart = b;
- else
- goto unfetch_interval;
- }
-
- /* If the upper bound is zero, don't want to succeed at
- all; jump from `laststart' to `b + 3', which will be
- the end of the buffer after we insert the jump. */
- if (upper_bound == 0)
- {
- GET_BUFFER_SPACE (3);
- INSERT_JUMP (jump, laststart, b + 3);
- b += 3;
- }
-
- /* Otherwise, we have a nontrivial interval. When
- we're all done, the pattern will look like:
- set_number_at <jump count> <upper bound>
- set_number_at <succeed_n count> <lower bound>
- succeed_n <after jump addr> <succeed_n count>
- <body of loop>
- jump_n <succeed_n addr> <jump count>
- (The upper bound and `jump_n' are omitted if
- `upper_bound' is 1, though.) */
- else
- { /* If the upper bound is > 1, we need to insert
- more at the end of the loop. */
- unsigned nbytes = 10 + (upper_bound > 1) * 10;
-
- GET_BUFFER_SPACE (nbytes);
-
- /* Initialize lower bound of the `succeed_n', even
- though it will be set during matching by its
- attendant `set_number_at' (inserted next),
- because `re_compile_fastmap' needs to know.
- Jump to the `jump_n' we might insert below. */
- INSERT_JUMP2 (succeed_n, laststart,
- b + 5 + (upper_bound > 1) * 5,
- lower_bound);
- b += 5;
-
- /* Code to initialize the lower bound. Insert
- before the `succeed_n'. The `5' is the last two
- bytes of this `set_number_at', plus 3 bytes of
- the following `succeed_n'. */
- insert_op2 (set_number_at, laststart, 5, lower_bound, b);
- b += 5;
-
- if (upper_bound > 1)
- { /* More than one repetition is allowed, so
- append a backward jump to the `succeed_n'
- that starts this interval.
-
- When we've reached this during matching,
- we'll have matched the interval once, so
- jump back only `upper_bound - 1' times. */
- STORE_JUMP2 (jump_n, b, laststart + 5,
- upper_bound - 1);
- b += 5;
-
- /* The location we want to set is the second
- parameter of the `jump_n'; that is `b-2' as
- an absolute address. `laststart' will be
- the `set_number_at' we're about to insert;
- `laststart+3' the number to set, the source
- for the relative address. But we are
- inserting into the middle of the pattern --
- so everything is getting moved up by 5.
- Conclusion: (b - 2) - (laststart + 3) + 5,
- i.e., b - laststart.
-
- We insert this at the beginning of the loop
- so that if we fail during matching, we'll
- reinitialize the bounds. */
- insert_op2 (set_number_at, laststart, b - laststart,
- upper_bound - 1, b);
- b += 5;
- }
- }
- pending_exact = 0;
- beg_interval = NULL;
- }
- break;
-
- unfetch_interval:
- /* If an invalid interval, match the characters as literals. */
- assert (beg_interval);
- p = beg_interval;
- beg_interval = NULL;
-
- /* normal_char and normal_backslash need `c'. */
- PATFETCH (c);
-
- if (!(syntax & RE_NO_BK_BRACES))
- {
- if (p > pattern && p[-1] == '\\')
- goto normal_backslash;
- }
- goto normal_char;
-
-#ifdef emacs
- /* There is no way to specify the before_dot and after_dot
- operators. rms says this is ok. --karl */
- case '=':
- BUF_PUSH (at_dot);
- break;
-
- case 's':
- laststart = b;
- PATFETCH (c);
- BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]);
- break;
-
- case 'S':
- laststart = b;
- PATFETCH (c);
- BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]);
- break;
-#endif /* emacs */
-
-
- case 'w':
- if (re_syntax_options & RE_NO_GNU_OPS)
- goto normal_char;
- laststart = b;
- BUF_PUSH (wordchar);
- break;
-
-
- case 'W':
- if (re_syntax_options & RE_NO_GNU_OPS)
- goto normal_char;
- laststart = b;
- BUF_PUSH (notwordchar);
- break;
-
-
- case '<':
- if (re_syntax_options & RE_NO_GNU_OPS)
- goto normal_char;
- BUF_PUSH (wordbeg);
- break;
-
- case '>':
- if (re_syntax_options & RE_NO_GNU_OPS)
- goto normal_char;
- BUF_PUSH (wordend);
- break;
-
- case 'b':
- if (re_syntax_options & RE_NO_GNU_OPS)
- goto normal_char;
- BUF_PUSH (wordbound);
- break;
-
- case 'B':
- if (re_syntax_options & RE_NO_GNU_OPS)
- goto normal_char;
- BUF_PUSH (notwordbound);
- break;
-
- case '`':
- if (re_syntax_options & RE_NO_GNU_OPS)
- goto normal_char;
- BUF_PUSH (begbuf);
- break;
-
- case '\'':
- if (re_syntax_options & RE_NO_GNU_OPS)
- goto normal_char;
- BUF_PUSH (endbuf);
- break;
-
- case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9':
- if (syntax & RE_NO_BK_REFS)
- goto normal_char;
-
- c1 = c - '0';
-
- if (c1 > regnum)
- FREE_STACK_RETURN (REG_ESUBREG);
-
- /* Can't back reference to a subexpression if inside of it. */
- if (group_in_compile_stack (compile_stack, (regnum_t) c1))
- goto normal_char;
-
- laststart = b;
- BUF_PUSH_2 (duplicate, c1);
- break;
-
-
- case '+':
- case '?':
- if (syntax & RE_BK_PLUS_QM)
- goto handle_plus;
- else
- goto normal_backslash;
-
- default:
- normal_backslash:
- /* You might think it would be useful for \ to mean
- not to translate; but if we don't translate it
- it will never match anything. */
- c = TRANSLATE (c);
- goto normal_char;
- }
- break;
-
-
- default:
- /* Expects the character in `c'. */
- normal_char:
- /* If no exactn currently being built. */
- if (!pending_exact
-
- /* If last exactn not at current position. */
- || pending_exact + *pending_exact + 1 != b
-
- /* We have only one byte following the exactn for the count. */
- || *pending_exact == (1 << BYTEWIDTH) - 1
-
- /* If followed by a repetition operator. */
- || *p == '*' || *p == '^'
- || ((syntax & RE_BK_PLUS_QM)
- ? *p == '\\' && (p[1] == '+' || p[1] == '?')
- : (*p == '+' || *p == '?'))
- || ((syntax & RE_INTERVALS)
- && ((syntax & RE_NO_BK_BRACES)
- ? *p == '{'
- : (p[0] == '\\' && p[1] == '{'))))
- {
- /* Start building a new exactn. */
-
- laststart = b;
-
- BUF_PUSH_2 (exactn, 0);
- pending_exact = b - 1;
- }
-
- BUF_PUSH (c);
- (*pending_exact)++;
- break;
- } /* switch (c) */
- } /* while p != pend */
-
-
- /* Through the pattern now. */
-
- if (fixup_alt_jump)
- STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
-
- if (!COMPILE_STACK_EMPTY)
- FREE_STACK_RETURN (REG_EPAREN);
-
- /* If we don't want backtracking, force success
- the first time we reach the end of the compiled pattern. */
- if (syntax & RE_NO_POSIX_BACKTRACKING)
- BUF_PUSH (succeed);
-
- free (compile_stack.stack);
-
- /* We have succeeded; set the length of the buffer. */
- bufp->used = b - bufp->buffer;
-
-#ifdef DEBUG
- if (debug)
- {
- DEBUG_PRINT1 ("\nCompiled pattern: \n");
- print_compiled_pattern (bufp);
- }
-#endif /* DEBUG */
-
-#ifndef MATCH_MAY_ALLOCATE
- /* Initialize the failure stack to the largest possible stack. This
- isn't necessary unless we're trying to avoid calling alloca in
- the search and match routines. */
- {
- int num_regs = bufp->re_nsub + 1;
-
- /* Since DOUBLE_FAIL_STACK refuses to double only if the current size
- is strictly greater than re_max_failures, the largest possible stack
- is 2 * re_max_failures failure points. */
- if (fail_stack.size < (2 * re_max_failures * MAX_FAILURE_ITEMS))
- {
- fail_stack.size = (2 * re_max_failures * MAX_FAILURE_ITEMS);
-
-#ifdef emacs
- if (! fail_stack.stack)
- fail_stack.stack
- = (fail_stack_elt_t *) xmalloc (fail_stack.size
- * sizeof (fail_stack_elt_t));
- else
- fail_stack.stack
- = (fail_stack_elt_t *) xrealloc (fail_stack.stack,
- (fail_stack.size
- * sizeof (fail_stack_elt_t)));
-#else /* not emacs */
- if (! fail_stack.stack)
- fail_stack.stack
- = (fail_stack_elt_t *) malloc (fail_stack.size
- * sizeof (fail_stack_elt_t));
- else
- fail_stack.stack
- = (fail_stack_elt_t *) realloc (fail_stack.stack,
- (fail_stack.size
- * sizeof (fail_stack_elt_t)));
-#endif /* not emacs */
- }
-
- regex_grow_registers (num_regs);
- }
-#endif /* not MATCH_MAY_ALLOCATE */
-
- return REG_NOERROR;
-} /* regex_compile */
-
-/* Subroutines for `regex_compile'. */
-
-/* Store OP at LOC followed by two-byte integer parameter ARG. */
-
-static void
-store_op1 (op, loc, arg)
- re_opcode_t op;
- unsigned char *loc;
- int arg;
-{
- *loc = (unsigned char) op;
- STORE_NUMBER (loc + 1, arg);
-}
-
-
-/* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */
-
-static void
-store_op2 (op, loc, arg1, arg2)
- re_opcode_t op;
- unsigned char *loc;
- int arg1, arg2;
-{
- *loc = (unsigned char) op;
- STORE_NUMBER (loc + 1, arg1);
- STORE_NUMBER (loc + 3, arg2);
-}
-
-
-/* Copy the bytes from LOC to END to open up three bytes of space at LOC
- for OP followed by two-byte integer parameter ARG. */
-
-static void
-insert_op1 (op, loc, arg, end)
- re_opcode_t op;
- unsigned char *loc;
- int arg;
- unsigned char *end;
-{
- register unsigned char *pfrom = end;
- register unsigned char *pto = end + 3;
-
- while (pfrom != loc)
- *--pto = *--pfrom;
-
- store_op1 (op, loc, arg);
-}
-
-
-/* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */
-
-static void
-insert_op2 (op, loc, arg1, arg2, end)
- re_opcode_t op;
- unsigned char *loc;
- int arg1, arg2;
- unsigned char *end;
-{
- register unsigned char *pfrom = end;
- register unsigned char *pto = end + 5;
-
- while (pfrom != loc)
- *--pto = *--pfrom;
-
- store_op2 (op, loc, arg1, arg2);
-}
-
-
-/* P points to just after a ^ in PATTERN. Return true if that ^ comes
- after an alternative or a begin-subexpression. We assume there is at
- least one character before the ^. */
-
-static boolean
-at_begline_loc_p (pattern, p, syntax)
- const char *pattern, *p;
- reg_syntax_t syntax;
-{
- const char *prev = p - 2;
- boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
-
- return
- /* After a subexpression? */
- (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
- /* After an alternative? */
- || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash));
-}
-
-
-/* The dual of at_begline_loc_p. This one is for $. We assume there is
- at least one character after the $, i.e., `P < PEND'. */
-
-static boolean
-at_endline_loc_p (p, pend, syntax)
- const char *p, *pend;
- reg_syntax_t syntax;
-{
- const char *next = p;
- boolean next_backslash = *next == '\\';
- const char *next_next = p + 1 < pend ? p + 1 : 0;
-
- return
- /* Before a subexpression? */
- (syntax & RE_NO_BK_PARENS ? *next == ')'
- : next_backslash && next_next && *next_next == ')')
- /* Before an alternative? */
- || (syntax & RE_NO_BK_VBAR ? *next == '|'
- : next_backslash && next_next && *next_next == '|');
-}
-
-
-/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
- false if it's not. */
-
-static boolean
-group_in_compile_stack (compile_stack, regnum)
- compile_stack_type compile_stack;
- regnum_t regnum;
-{
- int this_element;
-
- for (this_element = compile_stack.avail - 1;
- this_element >= 0;
- this_element--)
- if (compile_stack.stack[this_element].regnum == regnum)
- return true;
-
- return false;
-}
-
-
-/* Read the ending character of a range (in a bracket expression) from the
- uncompiled pattern *P_PTR (which ends at PEND). We assume the
- starting character is in `P[-2]'. (`P[-1]' is the character `-'.)
- Then we set the translation of all bits between the starting and
- ending characters (inclusive) in the compiled pattern B.
-
- Return an error code.
-
- We use these short variable names so we can use the same macros as
- `regex_compile' itself. */
-
-static reg_errcode_t
-compile_range (p_ptr, pend, translate, syntax, b)
- const char **p_ptr, *pend;
- RE_TRANSLATE_TYPE translate;
- reg_syntax_t syntax;
- unsigned char *b;
-{
- unsigned this_char;
-
- const char *p = *p_ptr;
- unsigned int range_start, range_end;
-
- if (p == pend)
- return REG_ERANGE;
-
- /* Even though the pattern is a signed `char *', we need to fetch
- with unsigned char *'s; if the high bit of the pattern character
- is set, the range endpoints will be negative if we fetch using a
- signed char *.
-
- We also want to fetch the endpoints without translating them; the
- appropriate translation is done in the bit-setting loop below. */
- /* The SVR4 compiler on the 3B2 had trouble with unsigned const char *. */
- range_start = ((const unsigned char *) p)[-2];
- range_end = ((const unsigned char *) p)[0];
-
- /* Have to increment the pointer into the pattern string, so the
- caller isn't still at the ending character. */
- (*p_ptr)++;
-
- /* If the start is after the end, the range is empty. */
- if (range_start > range_end)
- return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
-
- /* Here we see why `this_char' has to be larger than an `unsigned
- char' -- the range is inclusive, so if `range_end' == 0xff
- (assuming 8-bit characters), we would otherwise go into an infinite
- loop, since all characters <= 0xff. */
- for (this_char = range_start; this_char <= range_end; this_char++)
- {
- SET_LIST_BIT (TRANSLATE (this_char));
- }
-
- return REG_NOERROR;
-}
-
-/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
- BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible
- characters can start a string that matches the pattern. This fastmap
- is used by re_search to skip quickly over impossible starting points.
-
- The caller must supply the address of a (1 << BYTEWIDTH)-byte data
- area as BUFP->fastmap.
-
- We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
- the pattern buffer.
-
- Returns 0 if we succeed, -2 if an internal error. */
-
-int
-re_compile_fastmap (bufp)
- struct re_pattern_buffer *bufp;
-{
- int j, k;
-#ifdef MATCH_MAY_ALLOCATE
- fail_stack_type fail_stack;
-#endif
-#ifndef REGEX_MALLOC
- char *destination;
-#endif
- /* We don't push any register information onto the failure stack. */
- unsigned num_regs = 0;
-
- register char *fastmap = bufp->fastmap;
- unsigned char *pattern = bufp->buffer;
- unsigned char *p = pattern;
- register unsigned char *pend = pattern + bufp->used;
-
-#ifdef REL_ALLOC
- /* This holds the pointer to the failure stack, when
- it is allocated relocatably. */
- fail_stack_elt_t *failure_stack_ptr;
-#endif
-
- /* Assume that each path through the pattern can be null until
- proven otherwise. We set this false at the bottom of switch
- statement, to which we get only if a particular path doesn't
- match the empty string. */
- boolean path_can_be_null = true;
-
- /* We aren't doing a `succeed_n' to begin with. */
- boolean succeed_n_p = false;
-
- assert (fastmap != NULL && p != NULL);
-
- INIT_FAIL_STACK ();
- bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */
- bufp->fastmap_accurate = 1; /* It will be when we're done. */
- bufp->can_be_null = 0;
-
- while (1)
- {
- if (p == pend || *p == succeed)
- {
- /* We have reached the (effective) end of pattern. */
- if (!FAIL_STACK_EMPTY ())
- {
- bufp->can_be_null |= path_can_be_null;
-
- /* Reset for next path. */
- path_can_be_null = true;
-
- p = fail_stack.stack[--fail_stack.avail].pointer;
-
- continue;
- }
- else
- break;
- }
-
- /* We should never be about to go beyond the end of the pattern. */
- assert (p < pend);
-
- switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
- {
-
- /* I guess the idea here is to simply not bother with a fastmap
- if a backreference is used, since it's too hard to figure out
- the fastmap for the corresponding group. Setting
- `can_be_null' stops `re_search_2' from using the fastmap, so
- that is all we do. */
- case duplicate:
- bufp->can_be_null = 1;
- goto done;
-
-
- /* Following are the cases which match a character. These end
- with `break'. */
-
- case exactn:
- fastmap[p[1]] = 1;
- break;
-
-
- case charset:
- for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
- if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
- fastmap[j] = 1;
- break;
-
-
- case charset_not:
- /* Chars beyond end of map must be allowed. */
- for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++)
- fastmap[j] = 1;
-
- for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
- if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))))
- fastmap[j] = 1;
- break;
-
-
- case wordchar:
- for (j = 0; j < (1 << BYTEWIDTH); j++)
- if (SYNTAX (j) == Sword)
- fastmap[j] = 1;
- break;
-
-
- case notwordchar:
- for (j = 0; j < (1 << BYTEWIDTH); j++)
- if (SYNTAX (j) != Sword)
- fastmap[j] = 1;
- break;
-
-
- case anychar:
- {
- int fastmap_newline = fastmap['\n'];
-
- /* `.' matches anything ... */
- for (j = 0; j < (1 << BYTEWIDTH); j++)
- fastmap[j] = 1;
-
- /* ... except perhaps newline. */
- if (!(bufp->syntax & RE_DOT_NEWLINE))
- fastmap['\n'] = fastmap_newline;
-
- /* Return if we have already set `can_be_null'; if we have,
- then the fastmap is irrelevant. Something's wrong here. */
- else if (bufp->can_be_null)
- goto done;
-
- /* Otherwise, have to check alternative paths. */
- break;
- }
-
-#ifdef emacs
- case syntaxspec:
- k = *p++;
- for (j = 0; j < (1 << BYTEWIDTH); j++)
- if (SYNTAX (j) == (enum syntaxcode) k)
- fastmap[j] = 1;
- break;
-
-
- case notsyntaxspec:
- k = *p++;
- for (j = 0; j < (1 << BYTEWIDTH); j++)
- if (SYNTAX (j) != (enum syntaxcode) k)
- fastmap[j] = 1;
- break;
-
-
- /* All cases after this match the empty string. These end with
- `continue'. */
-
-
- case before_dot:
- case at_dot:
- case after_dot:
- continue;
-#endif /* emacs */
-
-
- case no_op:
- case begline:
- case endline:
- case begbuf:
- case endbuf:
- case wordbound:
- case notwordbound:
- case wordbeg:
- case wordend:
- case push_dummy_failure:
- continue;
-
-
- case jump_n:
- case pop_failure_jump:
- case maybe_pop_jump:
- case jump:
- case jump_past_alt:
- case dummy_failure_jump:
- EXTRACT_NUMBER_AND_INCR (j, p);
- p += j;
- if (j > 0)
- continue;
-
- /* Jump backward implies we just went through the body of a
- loop and matched nothing. Opcode jumped to should be
- `on_failure_jump' or `succeed_n'. Just treat it like an
- ordinary jump. For a * loop, it has pushed its failure
- point already; if so, discard that as redundant. */
- if ((re_opcode_t) *p != on_failure_jump
- && (re_opcode_t) *p != succeed_n)
- continue;
-
- p++;
- EXTRACT_NUMBER_AND_INCR (j, p);
- p += j;
-
- /* If what's on the stack is where we are now, pop it. */
- if (!FAIL_STACK_EMPTY ()
- && fail_stack.stack[fail_stack.avail - 1].pointer == p)
- fail_stack.avail--;
-
- continue;
-
-
- case on_failure_jump:
- case on_failure_keep_string_jump:
- handle_on_failure_jump:
- EXTRACT_NUMBER_AND_INCR (j, p);
-
- /* For some patterns, e.g., `(a?)?', `p+j' here points to the
- end of the pattern. We don't want to push such a point,
- since when we restore it above, entering the switch will
- increment `p' past the end of the pattern. We don't need
- to push such a point since we obviously won't find any more
- fastmap entries beyond `pend'. Such a pattern can match
- the null string, though. */
- if (p + j < pend)
- {
- if (!PUSH_PATTERN_OP (p + j, fail_stack))
- {
- RESET_FAIL_STACK ();
- return -2;
- }
- }
- else
- bufp->can_be_null = 1;
-
- if (succeed_n_p)
- {
- EXTRACT_NUMBER_AND_INCR (k, p); /* Skip the n. */
- succeed_n_p = false;
- }
-
- continue;
-
-
- case succeed_n:
- /* Get to the number of times to succeed. */
- p += 2;
-
- /* Increment p past the n for when k != 0. */
- EXTRACT_NUMBER_AND_INCR (k, p);
- if (k == 0)
- {
- p -= 4;
- succeed_n_p = true; /* Spaghetti code alert. */
- goto handle_on_failure_jump;
- }
- continue;
-
-
- case set_number_at:
- p += 4;
- continue;
-
-
- case start_memory:
- case stop_memory:
- p += 2;
- continue;
-
-
- default:
- abort (); /* We have listed all the cases. */
- } /* switch *p++ */
-
- /* Getting here means we have found the possible starting
- characters for one path of the pattern -- and that the empty
- string does not match. We need not follow this path further.
- Instead, look at the next alternative (remembered on the
- stack), or quit if no more. The test at the top of the loop
- does these things. */
- path_can_be_null = false;
- p = pend;
- } /* while p */
-
- /* Set `can_be_null' for the last path (also the first path, if the
- pattern is empty). */
- bufp->can_be_null |= path_can_be_null;
-
- done:
- RESET_FAIL_STACK ();
- return 0;
-} /* re_compile_fastmap */
-
-/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
- ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use
- this memory for recording register information. STARTS and ENDS
- must be allocated using the malloc library routine, and must each
- be at least NUM_REGS * sizeof (regoff_t) bytes long.
-
- If NUM_REGS == 0, then subsequent matches should allocate their own
- register data.
-
- Unless this function is called, the first search or match using
- PATTERN_BUFFER will allocate its own register data, without
- freeing the old data. */
-
-void
-re_set_registers (bufp, regs, num_regs, starts, ends)
- struct re_pattern_buffer *bufp;
- struct re_registers *regs;
- unsigned num_regs;
- regoff_t *starts, *ends;
-{
- if (num_regs)
- {
- bufp->regs_allocated = REGS_REALLOCATE;
- regs->num_regs = num_regs;
- regs->start = starts;
- regs->end = ends;
- }
- else
- {
- bufp->regs_allocated = REGS_UNALLOCATED;
- regs->num_regs = 0;
- regs->start = regs->end = (regoff_t *) 0;
- }
-}
-
-/* Searching routines. */
-
-/* Like re_search_2, below, but only one string is specified, and
- doesn't let you say where to stop matching. */
-
-int
-re_search (bufp, string, size, startpos, range, regs)
- struct re_pattern_buffer *bufp;
- const char *string;
- int size, startpos, range;
- struct re_registers *regs;
-{
- return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
- regs, size);
-}
-
-
-/* Using the compiled pattern in BUFP->buffer, first tries to match the
- virtual concatenation of STRING1 and STRING2, starting first at index
- STARTPOS, then at STARTPOS + 1, and so on.
-
- STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
-
- RANGE is how far to scan while trying to match. RANGE = 0 means try
- only at STARTPOS; in general, the last start tried is STARTPOS +
- RANGE.
-
- In REGS, return the indices of the virtual concatenation of STRING1
- and STRING2 that matched the entire BUFP->buffer and its contained
- subexpressions.
-
- Do not consider matching one past the index STOP in the virtual
- concatenation of STRING1 and STRING2.
-
- We return either the position in the strings at which the match was
- found, -1 if no match, or -2 if error (such as failure
- stack overflow). */
-
-int
-re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
- struct re_pattern_buffer *bufp;
- const char *string1, *string2;
- int size1, size2;
- int startpos;
- int range;
- struct re_registers *regs;
- int stop;
-{
- int val;
- register char *fastmap = bufp->fastmap;
- register RE_TRANSLATE_TYPE translate = bufp->translate;
- int total_size = size1 + size2;
- int endpos = startpos + range;
-
- /* Check for out-of-range STARTPOS. */
- if (startpos < 0 || startpos > total_size)
- return -1;
-
- /* Fix up RANGE if it might eventually take us outside
- the virtual concatenation of STRING1 and STRING2.
- Make sure we won't move STARTPOS below 0 or above TOTAL_SIZE. */
- if (endpos < 0)
- range = 0 - startpos;
- else if (endpos > total_size)
- range = total_size - startpos;
-
- /* If the search isn't to be a backwards one, don't waste time in a
- search for a pattern that must be anchored. */
- if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0)
- {
- if (startpos > 0)
- return -1;
- else
- range = 1;
- }
-
-#ifdef emacs
- /* In a forward search for something that starts with \=.
- don't keep searching past point. */
- if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot && range > 0)
- {
- range = PT - startpos;
- if (range <= 0)
- return -1;
- }
-#endif /* emacs */
-
- /* Update the fastmap now if not correct already. */
- if (fastmap && !bufp->fastmap_accurate)
- if (re_compile_fastmap (bufp) == -2)
- return -2;
-
- /* Loop through the string, looking for a place to start matching. */
- for (;;)
- {
- /* If a fastmap is supplied, skip quickly over characters that
- cannot be the start of a match. If the pattern can match the
- null string, however, we don't need to skip characters; we want
- the first null string. */
- if (fastmap && startpos < total_size && !bufp->can_be_null)
- {
- if (range > 0) /* Searching forwards. */
- {
- register const char *d;
- register int lim = 0;
- int irange = range;
-
- if (startpos < size1 && startpos + range >= size1)
- lim = range - (size1 - startpos);
-
- d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
-
- /* Written out as an if-else to avoid testing `translate'
- inside the loop. */
- if (translate)
- while (range > lim
- && !fastmap[(unsigned char)
- translate[(unsigned char) *d++]])
- range--;
- else
- while (range > lim && !fastmap[(unsigned char) *d++])
- range--;
-
- startpos += irange - range;
- }
- else /* Searching backwards. */
- {
- register char c = (size1 == 0 || startpos >= size1
- ? string2[startpos - size1]
- : string1[startpos]);
-
- if (!fastmap[(unsigned char) TRANSLATE (c)])
- goto advance;
- }
- }
-
- /* If can't match the null string, and that's all we have left, fail. */
- if (range >= 0 && startpos == total_size && fastmap
- && !bufp->can_be_null)
- return -1;
-
- val = re_match_2_internal (bufp, string1, size1, string2, size2,
- startpos, regs, stop);
-#ifndef REGEX_MALLOC
-#ifdef C_ALLOCA
- alloca (0);
-#endif
-#endif
-
- if (val >= 0)
- return startpos;
-
- if (val == -2)
- return -2;
-
- advance:
- if (!range)
- break;
- else if (range > 0)
- {
- range--;
- startpos++;
- }
- else
- {
- range++;
- startpos--;
- }
- }
- return -1;
-} /* re_search_2 */
-
-/* This converts PTR, a pointer into one of the search strings `string1'
- and `string2' into an offset from the beginning of that string. */
-#define POINTER_TO_OFFSET(ptr) \
- (FIRST_STRING_P (ptr) \
- ? ((regoff_t) ((ptr) - string1)) \
- : ((regoff_t) ((ptr) - string2 + size1)))
-
-/* Macros for dealing with the split strings in re_match_2. */
-
-#define MATCHING_IN_FIRST_STRING (dend == end_match_1)
-
-/* Call before fetching a character with *d. This switches over to
- string2 if necessary. */
-#define PREFETCH() \
- while (d == dend) \
- { \
- /* End of string2 => fail. */ \
- if (dend == end_match_2) \
- goto fail; \
- /* End of string1 => advance to string2. */ \
- d = string2; \
- dend = end_match_2; \
- }
-
-
-/* Test if at very beginning or at very end of the virtual concatenation
- of `string1' and `string2'. If only one string, it's `string2'. */
-#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
-#define AT_STRINGS_END(d) ((d) == end2)
-
-
-/* Test if D points to a character which is word-constituent. We have
- two special cases to check for: if past the end of string1, look at
- the first character in string2; and if before the beginning of
- string2, look at the last character in string1. */
-#define WORDCHAR_P(d) \
- (SYNTAX ((d) == end1 ? *string2 \
- : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \
- == Sword)
-
-/* Disabled due to a compiler bug -- see comment at case wordbound */
-#if 0
-/* Test if the character before D and the one at D differ with respect
- to being word-constituent. */
-#define AT_WORD_BOUNDARY(d) \
- (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \
- || WORDCHAR_P (d - 1) != WORDCHAR_P (d))
-#endif
-
-/* Free everything we malloc. */
-#ifdef MATCH_MAY_ALLOCATE
-#define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL
-#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)
-#else
-#define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */
-#endif /* not MATCH_MAY_ALLOCATE */
-
-/* These values must meet several constraints. They must not be valid
- register values; since we have a limit of 255 registers (because
- we use only one byte in the pattern for the register number), we can
- use numbers larger than 255. They must differ by 1, because of
- NUM_FAILURE_ITEMS above. And the value for the lowest register must
- be larger than the value for the highest register, so we do not try
- to actually save any registers when none are active. */
-#define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH)
-#define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1)
-
-/* Matching routines. */
-
-#ifndef emacs /* Emacs never uses this. */
-/* re_match is like re_match_2 except it takes only a single string. */
-
-int
-re_match (bufp, string, size, pos, regs)
- struct re_pattern_buffer *bufp;
- const char *string;
- int size, pos;
- struct re_registers *regs;
-{
- int result = re_match_2_internal (bufp, NULL, 0, string, size,
- pos, regs, size);
-#ifndef REGEX_MALLOC
-#ifdef C_ALLOCA
- alloca (0);
-#endif
-#endif
- return result;
-}
-#endif /* not emacs */
-
-static boolean group_match_null_string_p _RE_ARGS ((unsigned char **p,
- unsigned char *end,
- register_info_type *reg_info));
-static boolean alt_match_null_string_p _RE_ARGS ((unsigned char *p,
- unsigned char *end,
- register_info_type *reg_info));
-static boolean common_op_match_null_string_p _RE_ARGS ((unsigned char **p,
- unsigned char *end,
- register_info_type *reg_info));
-static int bcmp_translate _RE_ARGS ((const char *s1, const char *s2,
- int len, char *translate));
-
-/* re_match_2 matches the compiled pattern in BUFP against the
- the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
- and SIZE2, respectively). We start matching at POS, and stop
- matching at STOP.
-
- If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
- store offsets for the substring each group matched in REGS. See the
- documentation for exactly how many groups we fill.
-
- We return -1 if no match, -2 if an internal error (such as the
- failure stack overflowing). Otherwise, we return the length of the
- matched substring. */
-
-int
-re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
- struct re_pattern_buffer *bufp;
- const char *string1, *string2;
- int size1, size2;
- int pos;
- struct re_registers *regs;
- int stop;
-{
- int result = re_match_2_internal (bufp, string1, size1, string2, size2,
- pos, regs, stop);
-#ifndef REGEX_MALLOC
-#ifdef C_ALLOCA
- alloca (0);
-#endif
-#endif
- return result;
-}
-
-/* This is a separate function so that we can force an alloca cleanup
- afterwards. */
-static int
-re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
- struct re_pattern_buffer *bufp;
- const char *string1, *string2;
- int size1, size2;
- int pos;
- struct re_registers *regs;
- int stop;
-{
- /* General temporaries. */
- int mcnt;
- unsigned char *p1;
-
- /* Just past the end of the corresponding string. */
- const char *end1, *end2;
-
- /* Pointers into string1 and string2, just past the last characters in
- each to consider matching. */
- const char *end_match_1, *end_match_2;
-
- /* Where we are in the data, and the end of the current string. */
- const char *d, *dend;
-
- /* Where we are in the pattern, and the end of the pattern. */
- unsigned char *p = bufp->buffer;
- register unsigned char *pend = p + bufp->used;
-
- /* Mark the opcode just after a start_memory, so we can test for an
- empty subpattern when we get to the stop_memory. */
- unsigned char *just_past_start_mem = 0;
-
- /* We use this to map every character in the string. */
- RE_TRANSLATE_TYPE translate = bufp->translate;
-
- /* Failure point stack. Each place that can handle a failure further
- down the line pushes a failure point on this stack. It consists of
- restart, regend, and reg_info for all registers corresponding to
- the subexpressions we're currently inside, plus the number of such
- registers, and, finally, two char *'s. The first char * is where
- to resume scanning the pattern; the second one is where to resume
- scanning the strings. If the latter is zero, the failure point is
- a ``dummy''; if a failure happens and the failure point is a dummy,
- it gets discarded and the next next one is tried. */
-#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */
- fail_stack_type fail_stack;
-#endif
-#ifdef DEBUG
- static unsigned failure_id = 0;
- unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
-#endif
-
-#ifdef REL_ALLOC
- /* This holds the pointer to the failure stack, when
- it is allocated relocatably. */
- fail_stack_elt_t *failure_stack_ptr;
-#endif
-
- /* We fill all the registers internally, independent of what we
- return, for use in backreferences. The number here includes
- an element for register zero. */
- size_t num_regs = bufp->re_nsub + 1;
-
- /* The currently active registers. */
- active_reg_t lowest_active_reg = NO_LOWEST_ACTIVE_REG;
- active_reg_t highest_active_reg = NO_HIGHEST_ACTIVE_REG;
-
- /* Information on the contents of registers. These are pointers into
- the input strings; they record just what was matched (on this
- attempt) by a subexpression part of the pattern, that is, the
- regnum-th regstart pointer points to where in the pattern we began
- matching and the regnum-th regend points to right after where we
- stopped matching the regnum-th subexpression. (The zeroth register
- keeps track of what the whole pattern matches.) */
-#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */
- const char **regstart, **regend;
-#endif
-
- /* If a group that's operated upon by a repetition operator fails to
- match anything, then the register for its start will need to be
- restored because it will have been set to wherever in the string we
- are when we last see its open-group operator. Similarly for a
- register's end. */
-#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */
- const char **old_regstart, **old_regend;
-#endif
-
- /* The is_active field of reg_info helps us keep track of which (possibly
- nested) subexpressions we are currently in. The matched_something
- field of reg_info[reg_num] helps us tell whether or not we have
- matched any of the pattern so far this time through the reg_num-th
- subexpression. These two fields get reset each time through any
- loop their register is in. */
-#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */
- register_info_type *reg_info;
-#endif
-
- /* The following record the register info as found in the above
- variables when we find a match better than any we've seen before.
- This happens as we backtrack through the failure points, which in
- turn happens only if we have not yet matched the entire string. */
- unsigned best_regs_set = false;
-#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */
- const char **best_regstart, **best_regend;
-#endif
-
- /* Logically, this is `best_regend[0]'. But we don't want to have to
- allocate space for that if we're not allocating space for anything
- else (see below). Also, we never need info about register 0 for
- any of the other register vectors, and it seems rather a kludge to
- treat `best_regend' differently than the rest. So we keep track of
- the end of the best match so far in a separate variable. We
- initialize this to NULL so that when we backtrack the first time
- and need to test it, it's not garbage. */
- const char *match_end = NULL;
-
- /* This helps SET_REGS_MATCHED avoid doing redundant work. */
- int set_regs_matched_done = 0;
-
- /* Used when we pop values we don't care about. */
-#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */
- const char **reg_dummy;
- register_info_type *reg_info_dummy;
-#endif
-
-#ifdef DEBUG
- /* Counts the total number of registers pushed. */
- unsigned num_regs_pushed = 0;
-#endif
-
- DEBUG_PRINT1 ("\n\nEntering re_match_2.\n");
-
- INIT_FAIL_STACK ();
-
-#ifdef MATCH_MAY_ALLOCATE
- /* Do not bother to initialize all the register variables if there are
- no groups in the pattern, as it takes a fair amount of time. If
- there are groups, we include space for register 0 (the whole
- pattern), even though we never use it, since it simplifies the
- array indexing. We should fix this. */
- if (bufp->re_nsub)
- {
- regstart = REGEX_TALLOC (num_regs, const char *);
- regend = REGEX_TALLOC (num_regs, const char *);
- old_regstart = REGEX_TALLOC (num_regs, const char *);
- old_regend = REGEX_TALLOC (num_regs, const char *);
- best_regstart = REGEX_TALLOC (num_regs, const char *);
- best_regend = REGEX_TALLOC (num_regs, const char *);
- reg_info = REGEX_TALLOC (num_regs, register_info_type);
- reg_dummy = REGEX_TALLOC (num_regs, const char *);
- reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type);
-
- if (!(regstart && regend && old_regstart && old_regend && reg_info
- && best_regstart && best_regend && reg_dummy && reg_info_dummy))
- {
- FREE_VARIABLES ();
- return -2;
- }
- }
- else
- {
- /* We must initialize all our variables to NULL, so that
- `FREE_VARIABLES' doesn't try to free them. */
- regstart = regend = old_regstart = old_regend = best_regstart
- = best_regend = reg_dummy = NULL;
- reg_info = reg_info_dummy = (register_info_type *) NULL;
- }
-#endif /* MATCH_MAY_ALLOCATE */
-
- /* The starting position is bogus. */
- if (pos < 0 || pos > size1 + size2)
- {
- FREE_VARIABLES ();
- return -1;
- }
-
- /* Initialize subexpression text positions to -1 to mark ones that no
- start_memory/stop_memory has been seen for. Also initialize the
- register information struct. */
- for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
- {
- regstart[mcnt] = regend[mcnt]
- = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
-
- REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
- IS_ACTIVE (reg_info[mcnt]) = 0;
- MATCHED_SOMETHING (reg_info[mcnt]) = 0;
- EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0;
- }
-
- /* We move `string1' into `string2' if the latter's empty -- but not if
- `string1' is null. */
- if (size2 == 0 && string1 != NULL)
- {
- string2 = string1;
- size2 = size1;
- string1 = 0;
- size1 = 0;
- }
- end1 = string1 + size1;
- end2 = string2 + size2;
-
- /* Compute where to stop matching, within the two strings. */
- if (stop <= size1)
- {
- end_match_1 = string1 + stop;
- end_match_2 = string2;
- }
- else
- {
- end_match_1 = end1;
- end_match_2 = string2 + stop - size1;
- }
-
- /* `p' scans through the pattern as `d' scans through the data.
- `dend' is the end of the input string that `d' points within. `d'
- is advanced into the following input string whenever necessary, but
- this happens before fetching; therefore, at the beginning of the
- loop, `d' can be pointing at the end of a string, but it cannot
- equal `string2'. */
- if (size1 > 0 && pos <= size1)
- {
- d = string1 + pos;
- dend = end_match_1;
- }
- else
- {
- d = string2 + pos - size1;
- dend = end_match_2;
- }
-
- DEBUG_PRINT1 ("The compiled pattern is:\n");
- DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend);
- DEBUG_PRINT1 ("The string to match is: `");
- DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
- DEBUG_PRINT1 ("'\n");
-
- /* This loops over pattern commands. It exits by returning from the
- function if the match is complete, or it drops through if the match
- fails at this starting point in the input data. */
- for (;;)
- {
-#ifdef _LIBC
- DEBUG_PRINT2 ("\n%p: ", p);
-#else
- DEBUG_PRINT2 ("\n0x%x: ", p);
-#endif
-
- if (p == pend)
- { /* End of pattern means we might have succeeded. */
- DEBUG_PRINT1 ("end of pattern ... ");
-
- /* If we haven't matched the entire string, and we want the
- longest match, try backtracking. */
- if (d != end_match_2)
- {
- /* 1 if this match ends in the same string (string1 or string2)
- as the best previous match. */
- boolean same_str_p = (FIRST_STRING_P (match_end)
- == MATCHING_IN_FIRST_STRING);
- /* 1 if this match is the best seen so far. */
- boolean best_match_p;
-
- /* AIX compiler got confused when this was combined
- with the previous declaration. */
- if (same_str_p)
- best_match_p = d > match_end;
- else
- best_match_p = !MATCHING_IN_FIRST_STRING;
-
- DEBUG_PRINT1 ("backtracking.\n");
-
- if (!FAIL_STACK_EMPTY ())
- { /* More failure points to try. */
-
- /* If exceeds best match so far, save it. */
- if (!best_regs_set || best_match_p)
- {
- best_regs_set = true;
- match_end = d;
-
- DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
-
- for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
- {
- best_regstart[mcnt] = regstart[mcnt];
- best_regend[mcnt] = regend[mcnt];
- }
- }
- goto fail;
- }
-
- /* If no failure points, don't restore garbage. And if
- last match is real best match, don't restore second
- best one. */
- else if (best_regs_set && !best_match_p)
- {
- restore_best_regs:
- /* Restore best match. It may happen that `dend ==
- end_match_1' while the restored d is in string2.
- For example, the pattern `x.*y.*z' against the
- strings `x-' and `y-z-', if the two strings are
- not consecutive in memory. */
- DEBUG_PRINT1 ("Restoring best registers.\n");
-
- d = match_end;
- dend = ((d >= string1 && d <= end1)
- ? end_match_1 : end_match_2);
-
- for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
- {
- regstart[mcnt] = best_regstart[mcnt];
- regend[mcnt] = best_regend[mcnt];
- }
- }
- } /* d != end_match_2 */
-
- succeed_label:
- DEBUG_PRINT1 ("Accepting match.\n");
-
- /* If caller wants register contents data back, do it. */
- if (regs && !bufp->no_sub)
- {
- /* Have the register data arrays been allocated? */
- if (bufp->regs_allocated == REGS_UNALLOCATED)
- { /* No. So allocate them with malloc. We need one
- extra element beyond `num_regs' for the `-1' marker
- GNU code uses. */
- regs->num_regs = MAX (RE_NREGS, num_regs + 1);
- regs->start = TALLOC (regs->num_regs, regoff_t);
- regs->end = TALLOC (regs->num_regs, regoff_t);
- if (regs->start == NULL || regs->end == NULL)
- {
- FREE_VARIABLES ();
- return -2;
- }
- bufp->regs_allocated = REGS_REALLOCATE;
- }
- else if (bufp->regs_allocated == REGS_REALLOCATE)
- { /* Yes. If we need more elements than were already
- allocated, reallocate them. If we need fewer, just
- leave it alone. */
- if (regs->num_regs < num_regs + 1)
- {
- regs->num_regs = num_regs + 1;
- RETALLOC (regs->start, regs->num_regs, regoff_t);
- RETALLOC (regs->end, regs->num_regs, regoff_t);
- if (regs->start == NULL || regs->end == NULL)
- {
- FREE_VARIABLES ();
- return -2;
- }
- }
- }
- else
- {
- /* These braces fend off a "empty body in an else-statement"
- warning under GCC when assert expands to nothing. */
- assert (bufp->regs_allocated == REGS_FIXED);
- }
-
- /* Convert the pointer data in `regstart' and `regend' to
- indices. Register zero has to be set differently,
- since we haven't kept track of any info for it. */
- if (regs->num_regs > 0)
- {
- regs->start[0] = pos;
- regs->end[0] = (MATCHING_IN_FIRST_STRING
- ? ((regoff_t) (d - string1))
- : ((regoff_t) (d - string2 + size1)));
- }
-
- /* Go through the first `min (num_regs, regs->num_regs)'
- registers, since that is all we initialized. */
- for (mcnt = 1; (unsigned) mcnt < MIN (num_regs, regs->num_regs);
- mcnt++)
- {
- if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt]))
- regs->start[mcnt] = regs->end[mcnt] = -1;
- else
- {
- regs->start[mcnt]
- = (regoff_t) POINTER_TO_OFFSET (regstart[mcnt]);
- regs->end[mcnt]
- = (regoff_t) POINTER_TO_OFFSET (regend[mcnt]);
- }
- }
-
- /* If the regs structure we return has more elements than
- were in the pattern, set the extra elements to -1. If
- we (re)allocated the registers, this is the case,
- because we always allocate enough to have at least one
- -1 at the end. */
- for (mcnt = num_regs; (unsigned) mcnt < regs->num_regs; mcnt++)
- regs->start[mcnt] = regs->end[mcnt] = -1;
- } /* regs && !bufp->no_sub */
-
- DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n",
- nfailure_points_pushed, nfailure_points_popped,
- nfailure_points_pushed - nfailure_points_popped);
- DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
-
- mcnt = d - pos - (MATCHING_IN_FIRST_STRING
- ? string1
- : string2 - size1);
-
- DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
-
- FREE_VARIABLES ();
- return mcnt;
- }
-
- /* Otherwise match next pattern command. */
- switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
- {
- /* Ignore these. Used to ignore the n of succeed_n's which
- currently have n == 0. */
- case no_op:
- DEBUG_PRINT1 ("EXECUTING no_op.\n");
- break;
-
- case succeed:
- DEBUG_PRINT1 ("EXECUTING succeed.\n");
- goto succeed_label;
-
- /* Match the next n pattern characters exactly. The following
- byte in the pattern defines n, and the n bytes after that
- are the characters to match. */
- case exactn:
- mcnt = *p++;
- DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt);
-
- /* This is written out as an if-else so we don't waste time
- testing `translate' inside the loop. */
- if (translate)
- {
- do
- {
- PREFETCH ();
- if ((unsigned char) translate[(unsigned char) *d++]
- != (unsigned char) *p++)
- goto fail;
- }
- while (--mcnt);
- }
- else
- {
- do
- {
- PREFETCH ();
- if (*d++ != (char) *p++) goto fail;
- }
- while (--mcnt);
- }
- SET_REGS_MATCHED ();
- break;
-
-
- /* Match any character except possibly a newline or a null. */
- case anychar:
- DEBUG_PRINT1 ("EXECUTING anychar.\n");
-
- PREFETCH ();
-
- if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n')
- || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000'))
- goto fail;
-
- SET_REGS_MATCHED ();
- DEBUG_PRINT2 (" Matched `%d'.\n", *d);
- d++;
- break;
-
-
- case charset:
- case charset_not:
- {
- register unsigned char c;
- boolean not = (re_opcode_t) *(p - 1) == charset_not;
-
- DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : "");
-
- PREFETCH ();
- c = TRANSLATE (*d); /* The character to match. */
-
- /* Cast to `unsigned' instead of `unsigned char' in case the
- bit list is a full 32 bytes long. */
- if (c < (unsigned) (*p * BYTEWIDTH)
- && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
- not = !not;
-
- p += 1 + *p;
-
- if (!not) goto fail;
-
- SET_REGS_MATCHED ();
- d++;
- break;
- }
-
-
- /* The beginning of a group is represented by start_memory.
- The arguments are the register number in the next byte, and the
- number of groups inner to this one in the next. The text
- matched within the group is recorded (in the internal
- registers data structure) under the register number. */
- case start_memory:
- DEBUG_PRINT3 ("EXECUTING start_memory %d (%d):\n", *p, p[1]);
-
- /* Find out if this group can match the empty string. */
- p1 = p; /* To send to group_match_null_string_p. */
-
- if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
- REG_MATCH_NULL_STRING_P (reg_info[*p])
- = group_match_null_string_p (&p1, pend, reg_info);
-
- /* Save the position in the string where we were the last time
- we were at this open-group operator in case the group is
- operated upon by a repetition operator, e.g., with `(a*)*b'
- against `ab'; then we want to ignore where we are now in
- the string in case this attempt to match fails. */
- old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
- ? REG_UNSET (regstart[*p]) ? d : regstart[*p]
- : regstart[*p];
- DEBUG_PRINT2 (" old_regstart: %d\n",
- POINTER_TO_OFFSET (old_regstart[*p]));
-
- regstart[*p] = d;
- DEBUG_PRINT2 (" regstart: %d\n", POINTER_TO_OFFSET (regstart[*p]));
-
- IS_ACTIVE (reg_info[*p]) = 1;
- MATCHED_SOMETHING (reg_info[*p]) = 0;
-
- /* Clear this whenever we change the register activity status. */
- set_regs_matched_done = 0;
-
- /* This is the new highest active register. */
- highest_active_reg = *p;
-
- /* If nothing was active before, this is the new lowest active
- register. */
- if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
- lowest_active_reg = *p;
-
- /* Move past the register number and inner group count. */
- p += 2;
- just_past_start_mem = p;
-
- break;
-
-
- /* The stop_memory opcode represents the end of a group. Its
- arguments are the same as start_memory's: the register
- number, and the number of inner groups. */
- case stop_memory:
- DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]);
-
- /* We need to save the string position the last time we were at
- this close-group operator in case the group is operated
- upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
- against `aba'; then we want to ignore where we are now in
- the string in case this attempt to match fails. */
- old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
- ? REG_UNSET (regend[*p]) ? d : regend[*p]
- : regend[*p];
- DEBUG_PRINT2 (" old_regend: %d\n",
- POINTER_TO_OFFSET (old_regend[*p]));
-
- regend[*p] = d;
- DEBUG_PRINT2 (" regend: %d\n", POINTER_TO_OFFSET (regend[*p]));
-
- /* This register isn't active anymore. */
- IS_ACTIVE (reg_info[*p]) = 0;
-
- /* Clear this whenever we change the register activity status. */
- set_regs_matched_done = 0;
-
- /* If this was the only register active, nothing is active
- anymore. */
- if (lowest_active_reg == highest_active_reg)
- {
- lowest_active_reg = NO_LOWEST_ACTIVE_REG;
- highest_active_reg = NO_HIGHEST_ACTIVE_REG;
- }
- else
- { /* We must scan for the new highest active register, since
- it isn't necessarily one less than now: consider
- (a(b)c(d(e)f)g). When group 3 ends, after the f), the
- new highest active register is 1. */
- unsigned char r = *p - 1;
- while (r > 0 && !IS_ACTIVE (reg_info[r]))
- r--;
-
- /* If we end up at register zero, that means that we saved
- the registers as the result of an `on_failure_jump', not
- a `start_memory', and we jumped to past the innermost
- `stop_memory'. For example, in ((.)*) we save
- registers 1 and 2 as a result of the *, but when we pop
- back to the second ), we are at the stop_memory 1.
- Thus, nothing is active. */
- if (r == 0)
- {
- lowest_active_reg = NO_LOWEST_ACTIVE_REG;
- highest_active_reg = NO_HIGHEST_ACTIVE_REG;
- }
- else
- highest_active_reg = r;
- }
-
- /* If just failed to match something this time around with a
- group that's operated on by a repetition operator, try to
- force exit from the ``loop'', and restore the register
- information for this group that we had before trying this
- last match. */
- if ((!MATCHED_SOMETHING (reg_info[*p])
- || just_past_start_mem == p - 1)
- && (p + 2) < pend)
- {
- boolean is_a_jump_n = false;
-
- p1 = p + 2;
- mcnt = 0;
- switch ((re_opcode_t) *p1++)
- {
- case jump_n:
- is_a_jump_n = true;
- case pop_failure_jump:
- case maybe_pop_jump:
- case jump:
- case dummy_failure_jump:
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- if (is_a_jump_n)
- p1 += 2;
- break;
-
- default:
- /* do nothing */ ;
- }
- p1 += mcnt;
-
- /* If the next operation is a jump backwards in the pattern
- to an on_failure_jump right before the start_memory
- corresponding to this stop_memory, exit from the loop
- by forcing a failure after pushing on the stack the
- on_failure_jump's jump in the pattern, and d. */
- if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump
- && (re_opcode_t) p1[3] == start_memory && p1[4] == *p)
- {
- /* If this group ever matched anything, then restore
- what its registers were before trying this last
- failed match, e.g., with `(a*)*b' against `ab' for
- regstart[1], and, e.g., with `((a*)*(b*)*)*'
- against `aba' for regend[3].
-
- Also restore the registers for inner groups for,
- e.g., `((a*)(b*))*' against `aba' (register 3 would
- otherwise get trashed). */
-
- if (EVER_MATCHED_SOMETHING (reg_info[*p]))
- {
- unsigned r;
-
- EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
-
- /* Restore this and inner groups' (if any) registers. */
- for (r = *p; r < (unsigned) *p + (unsigned) *(p + 1);
- r++)
- {
- regstart[r] = old_regstart[r];
-
- /* xx why this test? */
- if (old_regend[r] >= regstart[r])
- regend[r] = old_regend[r];
- }
- }
- p1++;
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- PUSH_FAILURE_POINT (p1 + mcnt, d, -2);
-
- goto fail;
- }
- }
-
- /* Move past the register number and the inner group count. */
- p += 2;
- break;
-
-
- /* \<digit> has been turned into a `duplicate' command which is
- followed by the numeric value of <digit> as the register number. */
- case duplicate:
- {
- register const char *d2, *dend2;
- int regno = *p++; /* Get which register to match against. */
- DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno);
-
- /* Can't back reference a group which we've never matched. */
- if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
- goto fail;
-
- /* Where in input to try to start matching. */
- d2 = regstart[regno];
-
- /* Where to stop matching; if both the place to start and
- the place to stop matching are in the same string, then
- set to the place to stop, otherwise, for now have to use
- the end of the first string. */
-
- dend2 = ((FIRST_STRING_P (regstart[regno])
- == FIRST_STRING_P (regend[regno]))
- ? regend[regno] : end_match_1);
- for (;;)
- {
- /* If necessary, advance to next segment in register
- contents. */
- while (d2 == dend2)
- {
- if (dend2 == end_match_2) break;
- if (dend2 == regend[regno]) break;
-
- /* End of string1 => advance to string2. */
- d2 = string2;
- dend2 = regend[regno];
- }
- /* At end of register contents => success */
- if (d2 == dend2) break;
-
- /* If necessary, advance to next segment in data. */
- PREFETCH ();
-
- /* How many characters left in this segment to match. */
- mcnt = dend - d;
-
- /* Want how many consecutive characters we can match in
- one shot, so, if necessary, adjust the count. */
- if (mcnt > dend2 - d2)
- mcnt = dend2 - d2;
-
- /* Compare that many; failure if mismatch, else move
- past them. */
- if (translate
- ? bcmp_translate (d, d2, mcnt, translate)
- : bcmp (d, d2, mcnt))
- goto fail;
- d += mcnt, d2 += mcnt;
-
- /* Do this because we've match some characters. */
- SET_REGS_MATCHED ();
- }
- }
- break;
-
-
- /* begline matches the empty string at the beginning of the string
- (unless `not_bol' is set in `bufp'), and, if
- `newline_anchor' is set, after newlines. */
- case begline:
- DEBUG_PRINT1 ("EXECUTING begline.\n");
-
- if (AT_STRINGS_BEG (d))
- {
- if (!bufp->not_bol) break;
- }
- else if (d[-1] == '\n' && bufp->newline_anchor)
- {
- break;
- }
- /* In all other cases, we fail. */
- goto fail;
-
-
- /* endline is the dual of begline. */
- case endline:
- DEBUG_PRINT1 ("EXECUTING endline.\n");
-
- if (AT_STRINGS_END (d))
- {
- if (!bufp->not_eol) break;
- }
-
- /* We have to ``prefetch'' the next character. */
- else if ((d == end1 ? *string2 : *d) == '\n'
- && bufp->newline_anchor)
- {
- break;
- }
- goto fail;
-
-
- /* Match at the very beginning of the data. */
- case begbuf:
- DEBUG_PRINT1 ("EXECUTING begbuf.\n");
- if (AT_STRINGS_BEG (d))
- break;
- goto fail;
-
-
- /* Match at the very end of the data. */
- case endbuf:
- DEBUG_PRINT1 ("EXECUTING endbuf.\n");
- if (AT_STRINGS_END (d))
- break;
- goto fail;
-
-
- /* on_failure_keep_string_jump is used to optimize `.*\n'. It
- pushes NULL as the value for the string on the stack. Then
- `pop_failure_point' will keep the current value for the
- string, instead of restoring it. To see why, consider
- matching `foo\nbar' against `.*\n'. The .* matches the foo;
- then the . fails against the \n. But the next thing we want
- to do is match the \n against the \n; if we restored the
- string value, we would be back at the foo.
-
- Because this is used only in specific cases, we don't need to
- check all the things that `on_failure_jump' does, to make
- sure the right things get saved on the stack. Hence we don't
- share its code. The only reason to push anything on the
- stack at all is that otherwise we would have to change
- `anychar's code to do something besides goto fail in this
- case; that seems worse than this. */
- case on_failure_keep_string_jump:
- DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
-
- EXTRACT_NUMBER_AND_INCR (mcnt, p);
-#ifdef _LIBC
- DEBUG_PRINT3 (" %d (to %p):\n", mcnt, p + mcnt);
-#else
- DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
-#endif
-
- PUSH_FAILURE_POINT (p + mcnt, NULL, -2);
- break;
-
-
- /* Uses of on_failure_jump:
-
- Each alternative starts with an on_failure_jump that points
- to the beginning of the next alternative. Each alternative
- except the last ends with a jump that in effect jumps past
- the rest of the alternatives. (They really jump to the
- ending jump of the following alternative, because tensioning
- these jumps is a hassle.)
-
- Repeats start with an on_failure_jump that points past both
- the repetition text and either the following jump or
- pop_failure_jump back to this on_failure_jump. */
- case on_failure_jump:
- on_failure:
- DEBUG_PRINT1 ("EXECUTING on_failure_jump");
-
- EXTRACT_NUMBER_AND_INCR (mcnt, p);
-#ifdef _LIBC
- DEBUG_PRINT3 (" %d (to %p)", mcnt, p + mcnt);
-#else
- DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt);
-#endif
-
- /* If this on_failure_jump comes right before a group (i.e.,
- the original * applied to a group), save the information
- for that group and all inner ones, so that if we fail back
- to this point, the group's information will be correct.
- For example, in \(a*\)*\1, we need the preceding group,
- and in \(zz\(a*\)b*\)\2, we need the inner group. */
-
- /* We can't use `p' to check ahead because we push
- a failure point to `p + mcnt' after we do this. */
- p1 = p;
-
- /* We need to skip no_op's before we look for the
- start_memory in case this on_failure_jump is happening as
- the result of a completed succeed_n, as in \(a\)\{1,3\}b\1
- against aba. */
- while (p1 < pend && (re_opcode_t) *p1 == no_op)
- p1++;
-
- if (p1 < pend && (re_opcode_t) *p1 == start_memory)
- {
- /* We have a new highest active register now. This will
- get reset at the start_memory we are about to get to,
- but we will have saved all the registers relevant to
- this repetition op, as described above. */
- highest_active_reg = *(p1 + 1) + *(p1 + 2);
- if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
- lowest_active_reg = *(p1 + 1);
- }
-
- DEBUG_PRINT1 (":\n");
- PUSH_FAILURE_POINT (p + mcnt, d, -2);
- break;
-
-
- /* A smart repeat ends with `maybe_pop_jump'.
- We change it to either `pop_failure_jump' or `jump'. */
- case maybe_pop_jump:
- EXTRACT_NUMBER_AND_INCR (mcnt, p);
- DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt);
- {
- register unsigned char *p2 = p;
-
- /* Compare the beginning of the repeat with what in the
- pattern follows its end. If we can establish that there
- is nothing that they would both match, i.e., that we
- would have to backtrack because of (as in, e.g., `a*a')
- then we can change to pop_failure_jump, because we'll
- never have to backtrack.
-
- This is not true in the case of alternatives: in
- `(a|ab)*' we do need to backtrack to the `ab' alternative
- (e.g., if the string was `ab'). But instead of trying to
- detect that here, the alternative has put on a dummy
- failure point which is what we will end up popping. */
-
- /* Skip over open/close-group commands.
- If what follows this loop is a ...+ construct,
- look at what begins its body, since we will have to
- match at least one of that. */
- while (1)
- {
- if (p2 + 2 < pend
- && ((re_opcode_t) *p2 == stop_memory
- || (re_opcode_t) *p2 == start_memory))
- p2 += 3;
- else if (p2 + 6 < pend
- && (re_opcode_t) *p2 == dummy_failure_jump)
- p2 += 6;
- else
- break;
- }
-
- p1 = p + mcnt;
- /* p1[0] ... p1[2] are the `on_failure_jump' corresponding
- to the `maybe_finalize_jump' of this case. Examine what
- follows. */
-
- /* If we're at the end of the pattern, we can change. */
- if (p2 == pend)
- {
- /* Consider what happens when matching ":\(.*\)"
- against ":/". I don't really understand this code
- yet. */
- p[-3] = (unsigned char) pop_failure_jump;
- DEBUG_PRINT1
- (" End of pattern: change to `pop_failure_jump'.\n");
- }
-
- else if ((re_opcode_t) *p2 == exactn
- || (bufp->newline_anchor && (re_opcode_t) *p2 == endline))
- {
- register unsigned char c
- = *p2 == (unsigned char) endline ? '\n' : p2[2];
-
- if ((re_opcode_t) p1[3] == exactn && p1[5] != c)
- {
- p[-3] = (unsigned char) pop_failure_jump;
- DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
- c, p1[5]);
- }
-
- else if ((re_opcode_t) p1[3] == charset
- || (re_opcode_t) p1[3] == charset_not)
- {
- int not = (re_opcode_t) p1[3] == charset_not;
-
- if (c < (unsigned char) (p1[4] * BYTEWIDTH)
- && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
- not = !not;
-
- /* `not' is equal to 1 if c would match, which means
- that we can't change to pop_failure_jump. */
- if (!not)
- {
- p[-3] = (unsigned char) pop_failure_jump;
- DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
- }
- }
- }
- else if ((re_opcode_t) *p2 == charset)
- {
-#ifdef DEBUG
- register unsigned char c
- = *p2 == (unsigned char) endline ? '\n' : p2[2];
#endif
-
-#if 0
- if ((re_opcode_t) p1[3] == exactn
- && ! ((int) p2[1] * BYTEWIDTH > (int) p1[5]
- && (p2[2 + p1[5] / BYTEWIDTH]
- & (1 << (p1[5] % BYTEWIDTH)))))
-#else
- if ((re_opcode_t) p1[3] == exactn
- && ! ((int) p2[1] * BYTEWIDTH > (int) p1[4]
- && (p2[2 + p1[4] / BYTEWIDTH]
- & (1 << (p1[4] % BYTEWIDTH)))))
-#endif
- {
- p[-3] = (unsigned char) pop_failure_jump;
- DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
- c, p1[5]);
- }
-
- else if ((re_opcode_t) p1[3] == charset_not)
- {
- int idx;
- /* We win if the charset_not inside the loop
- lists every character listed in the charset after. */
- for (idx = 0; idx < (int) p2[1]; idx++)
- if (! (p2[2 + idx] == 0
- || (idx < (int) p1[4]
- && ((p2[2 + idx] & ~ p1[5 + idx]) == 0))))
- break;
-
- if (idx == p2[1])
- {
- p[-3] = (unsigned char) pop_failure_jump;
- DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
- }
- }
- else if ((re_opcode_t) p1[3] == charset)
- {
- int idx;
- /* We win if the charset inside the loop
- has no overlap with the one after the loop. */
- for (idx = 0;
- idx < (int) p2[1] && idx < (int) p1[4];
- idx++)
- if ((p2[2 + idx] & p1[5 + idx]) != 0)
- break;
-
- if (idx == p2[1] || idx == p1[4])
- {
- p[-3] = (unsigned char) pop_failure_jump;
- DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
- }
- }
- }
- }
- p -= 2; /* Point at relative address again. */
- if ((re_opcode_t) p[-1] != pop_failure_jump)
- {
- p[-1] = (unsigned char) jump;
- DEBUG_PRINT1 (" Match => jump.\n");
- goto unconditional_jump;
- }
- /* Note fall through. */
-
-
- /* The end of a simple repeat has a pop_failure_jump back to
- its matching on_failure_jump, where the latter will push a
- failure point. The pop_failure_jump takes off failure
- points put on by this pop_failure_jump's matching
- on_failure_jump; we got through the pattern to here from the
- matching on_failure_jump, so didn't fail. */
- case pop_failure_jump:
- {
- /* We need to pass separate storage for the lowest and
- highest registers, even though we don't care about the
- actual values. Otherwise, we will restore only one
- register from the stack, since lowest will == highest in
- `pop_failure_point'. */
- active_reg_t dummy_low_reg, dummy_high_reg;
- unsigned char *pdummy;
- const char *sdummy;
-
- DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n");
- POP_FAILURE_POINT (sdummy, pdummy,
- dummy_low_reg, dummy_high_reg,
- reg_dummy, reg_dummy, reg_info_dummy);
- }
- /* Note fall through. */
-
- unconditional_jump:
-#ifdef _LIBC
- DEBUG_PRINT2 ("\n%p: ", p);
-#else
- DEBUG_PRINT2 ("\n0x%x: ", p);
-#endif
- /* Note fall through. */
-
- /* Unconditionally jump (without popping any failure points). */
- case jump:
- EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */
- DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt);
- p += mcnt; /* Do the jump. */
-#ifdef _LIBC
- DEBUG_PRINT2 ("(to %p).\n", p);
-#else
- DEBUG_PRINT2 ("(to 0x%x).\n", p);
-#endif
- break;
-
-
- /* We need this opcode so we can detect where alternatives end
- in `group_match_null_string_p' et al. */
- case jump_past_alt:
- DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n");
- goto unconditional_jump;
-
-
- /* Normally, the on_failure_jump pushes a failure point, which
- then gets popped at pop_failure_jump. We will end up at
- pop_failure_jump, also, and with a pattern of, say, `a+', we
- are skipping over the on_failure_jump, so we have to push
- something meaningless for pop_failure_jump to pop. */
- case dummy_failure_jump:
- DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n");
- /* It doesn't matter what we push for the string here. What
- the code at `fail' tests is the value for the pattern. */
- PUSH_FAILURE_POINT (0, 0, -2);
- goto unconditional_jump;
-
-
- /* At the end of an alternative, we need to push a dummy failure
- point in case we are followed by a `pop_failure_jump', because
- we don't want the failure point for the alternative to be
- popped. For example, matching `(a|ab)*' against `aab'
- requires that we match the `ab' alternative. */
- case push_dummy_failure:
- DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n");
- /* See comments just above at `dummy_failure_jump' about the
- two zeroes. */
- PUSH_FAILURE_POINT (0, 0, -2);
- break;
-
- /* Have to succeed matching what follows at least n times.
- After that, handle like `on_failure_jump'. */
- case succeed_n:
- EXTRACT_NUMBER (mcnt, p + 2);
- DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
-
- assert (mcnt >= 0);
- /* Originally, this is how many times we HAVE to succeed. */
- if (mcnt > 0)
- {
- mcnt--;
- p += 2;
- STORE_NUMBER_AND_INCR (p, mcnt);
-#ifdef _LIBC
- DEBUG_PRINT3 (" Setting %p to %d.\n", p - 2, mcnt);
-#else
- DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p - 2, mcnt);
-#endif
- }
- else if (mcnt == 0)
- {
-#ifdef _LIBC
- DEBUG_PRINT2 (" Setting two bytes from %p to no_op.\n", p+2);
-#else
- DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", p+2);
-#endif
- p[2] = (unsigned char) no_op;
- p[3] = (unsigned char) no_op;
- goto on_failure;
- }
- break;
-
- case jump_n:
- EXTRACT_NUMBER (mcnt, p + 2);
- DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
-
- /* Originally, this is how many times we CAN jump. */
- if (mcnt)
- {
- mcnt--;
- STORE_NUMBER (p + 2, mcnt);
-#ifdef _LIBC
- DEBUG_PRINT3 (" Setting %p to %d.\n", p + 2, mcnt);
-#else
- DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p + 2, mcnt);
-#endif
- goto unconditional_jump;
- }
- /* If don't have to jump any more, skip over the rest of command. */
- else
- p += 4;
- break;
-
- case set_number_at:
- {
- DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
-
- EXTRACT_NUMBER_AND_INCR (mcnt, p);
- p1 = p + mcnt;
- EXTRACT_NUMBER_AND_INCR (mcnt, p);
-#ifdef _LIBC
- DEBUG_PRINT3 (" Setting %p to %d.\n", p1, mcnt);
-#else
- DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p1, mcnt);
-#endif
- STORE_NUMBER (p1, mcnt);
- break;
- }
-
-#if 0
- /* The DEC Alpha C compiler 3.x generates incorrect code for the
- test WORDCHAR_P (d - 1) != WORDCHAR_P (d) in the expansion of
- AT_WORD_BOUNDARY, so this code is disabled. Expanding the
- macro and introducing temporary variables works around the bug. */
-
- case wordbound:
- DEBUG_PRINT1 ("EXECUTING wordbound.\n");
- if (AT_WORD_BOUNDARY (d))
- break;
- goto fail;
-
- case notwordbound:
- DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
- if (AT_WORD_BOUNDARY (d))
- goto fail;
- break;
-#else
- case wordbound:
- {
- boolean prevchar, thischar;
-
- DEBUG_PRINT1 ("EXECUTING wordbound.\n");
- if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d))
- break;
-
- prevchar = WORDCHAR_P (d - 1);
- thischar = WORDCHAR_P (d);
- if (prevchar != thischar)
- break;
- goto fail;
- }
-
- case notwordbound:
- {
- boolean prevchar, thischar;
-
- DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
- if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d))
- goto fail;
-
- prevchar = WORDCHAR_P (d - 1);
- thischar = WORDCHAR_P (d);
- if (prevchar != thischar)
- goto fail;
- break;
- }
-#endif
-
- case wordbeg:
- DEBUG_PRINT1 ("EXECUTING wordbeg.\n");
- if (WORDCHAR_P (d) && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1)))
- break;
- goto fail;
-
- case wordend:
- DEBUG_PRINT1 ("EXECUTING wordend.\n");
- if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1)
- && (!WORDCHAR_P (d) || AT_STRINGS_END (d)))
- break;
- goto fail;
-
-#ifdef emacs
- case before_dot:
- DEBUG_PRINT1 ("EXECUTING before_dot.\n");
- if (PTR_CHAR_POS ((unsigned char *) d) >= point)
- goto fail;
- break;
-
- case at_dot:
- DEBUG_PRINT1 ("EXECUTING at_dot.\n");
- if (PTR_CHAR_POS ((unsigned char *) d) != point)
- goto fail;
- break;
-
- case after_dot:
- DEBUG_PRINT1 ("EXECUTING after_dot.\n");
- if (PTR_CHAR_POS ((unsigned char *) d) <= point)
- goto fail;
- break;
-
- case syntaxspec:
- DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt);
- mcnt = *p++;
- goto matchsyntax;
-
- case wordchar:
- DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n");
- mcnt = (int) Sword;
- matchsyntax:
- PREFETCH ();
- /* Can't use *d++ here; SYNTAX may be an unsafe macro. */
- d++;
- if (SYNTAX (d[-1]) != (enum syntaxcode) mcnt)
- goto fail;
- SET_REGS_MATCHED ();
- break;
-
- case notsyntaxspec:
- DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt);
- mcnt = *p++;
- goto matchnotsyntax;
-
- case notwordchar:
- DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n");
- mcnt = (int) Sword;
- matchnotsyntax:
- PREFETCH ();
- /* Can't use *d++ here; SYNTAX may be an unsafe macro. */
- d++;
- if (SYNTAX (d[-1]) == (enum syntaxcode) mcnt)
- goto fail;
- SET_REGS_MATCHED ();
- break;
-
-#else /* not emacs */
- case wordchar:
- DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n");
- PREFETCH ();
- if (!WORDCHAR_P (d))
- goto fail;
- SET_REGS_MATCHED ();
- d++;
- break;
-
- case notwordchar:
- DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n");
- PREFETCH ();
- if (WORDCHAR_P (d))
- goto fail;
- SET_REGS_MATCHED ();
- d++;
- break;
-#endif /* not emacs */
-
- default:
- abort ();
- }
- continue; /* Successfully executed one pattern command; keep going. */
-
-
- /* We goto here if a matching operation fails. */
- fail:
- if (!FAIL_STACK_EMPTY ())
- { /* A restart point is known. Restore to that state. */
- DEBUG_PRINT1 ("\nFAIL:\n");
- POP_FAILURE_POINT (d, p,
- lowest_active_reg, highest_active_reg,
- regstart, regend, reg_info);
-
- /* If this failure point is a dummy, try the next one. */
- if (!p)
- goto fail;
-
- /* If we failed to the end of the pattern, don't examine *p. */
- assert (p <= pend);
- if (p < pend)
- {
- boolean is_a_jump_n = false;
-
- /* If failed to a backwards jump that's part of a repetition
- loop, need to pop this failure point and use the next one. */
- switch ((re_opcode_t) *p)
- {
- case jump_n:
- is_a_jump_n = true;
- case maybe_pop_jump:
- case pop_failure_jump:
- case jump:
- p1 = p + 1;
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- p1 += mcnt;
-
- if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
- || (!is_a_jump_n
- && (re_opcode_t) *p1 == on_failure_jump))
- goto fail;
- break;
- default:
- /* do nothing */ ;
- }
- }
-
- if (d >= string1 && d <= end1)
- dend = end_match_1;
- }
- else
- break; /* Matching at this starting point really fails. */
- } /* for (;;) */
-
- if (best_regs_set)
- goto restore_best_regs;
-
- FREE_VARIABLES ();
-
- return -1; /* Failure to match. */
-} /* re_match_2 */
-
-/* Subroutine definitions for re_match_2. */
-
-
-/* We are passed P pointing to a register number after a start_memory.
-
- Return true if the pattern up to the corresponding stop_memory can
- match the empty string, and false otherwise.
-
- If we find the matching stop_memory, sets P to point to one past its number.
- Otherwise, sets P to an undefined byte less than or equal to END.
-
- We don't handle duplicates properly (yet). */
-
-static boolean
-group_match_null_string_p (p, end, reg_info)
- unsigned char **p, *end;
- register_info_type *reg_info;
-{
- int mcnt;
- /* Point to after the args to the start_memory. */
- unsigned char *p1 = *p + 2;
-
- while (p1 < end)
- {
- /* Skip over opcodes that can match nothing, and return true or
- false, as appropriate, when we get to one that can't, or to the
- matching stop_memory. */
-
- switch ((re_opcode_t) *p1)
- {
- /* Could be either a loop or a series of alternatives. */
- case on_failure_jump:
- p1++;
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-
- /* If the next operation is not a jump backwards in the
- pattern. */
-
- if (mcnt >= 0)
- {
- /* Go through the on_failure_jumps of the alternatives,
- seeing if any of the alternatives cannot match nothing.
- The last alternative starts with only a jump,
- whereas the rest start with on_failure_jump and end
- with a jump, e.g., here is the pattern for `a|b|c':
-
- /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
- /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
- /exactn/1/c
-
- So, we have to first go through the first (n-1)
- alternatives and then deal with the last one separately. */
-
-
- /* Deal with the first (n-1) alternatives, which start
- with an on_failure_jump (see above) that jumps to right
- past a jump_past_alt. */
-
- while ((re_opcode_t) p1[mcnt-3] == jump_past_alt)
- {
- /* `mcnt' holds how many bytes long the alternative
- is, including the ending `jump_past_alt' and
- its number. */
-
- if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
- reg_info))
- return false;
-
- /* Move to right after this alternative, including the
- jump_past_alt. */
- p1 += mcnt;
-
- /* Break if it's the beginning of an n-th alternative
- that doesn't begin with an on_failure_jump. */
- if ((re_opcode_t) *p1 != on_failure_jump)
- break;
-
- /* Still have to check that it's not an n-th
- alternative that starts with an on_failure_jump. */
- p1++;
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- if ((re_opcode_t) p1[mcnt-3] != jump_past_alt)
- {
- /* Get to the beginning of the n-th alternative. */
- p1 -= 3;
- break;
- }
- }
-
- /* Deal with the last alternative: go back and get number
- of the `jump_past_alt' just before it. `mcnt' contains
- the length of the alternative. */
- EXTRACT_NUMBER (mcnt, p1 - 2);
-
- if (!alt_match_null_string_p (p1, p1 + mcnt, reg_info))
- return false;
-
- p1 += mcnt; /* Get past the n-th alternative. */
- } /* if mcnt > 0 */
- break;
-
-
- case stop_memory:
- assert (p1[1] == **p);
- *p = p1 + 2;
- return true;
-
-
- default:
- if (!common_op_match_null_string_p (&p1, end, reg_info))
- return false;
- }
- } /* while p1 < end */
-
- return false;
-} /* group_match_null_string_p */
-
-
-/* Similar to group_match_null_string_p, but doesn't deal with alternatives:
- It expects P to be the first byte of a single alternative and END one
- byte past the last. The alternative can contain groups. */
-
-static boolean
-alt_match_null_string_p (p, end, reg_info)
- unsigned char *p, *end;
- register_info_type *reg_info;
-{
- int mcnt;
- unsigned char *p1 = p;
-
- while (p1 < end)
- {
- /* Skip over opcodes that can match nothing, and break when we get
- to one that can't. */
-
- switch ((re_opcode_t) *p1)
- {
- /* It's a loop. */
- case on_failure_jump:
- p1++;
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- p1 += mcnt;
- break;
-
- default:
- if (!common_op_match_null_string_p (&p1, end, reg_info))
- return false;
- }
- } /* while p1 < end */
-
- return true;
-} /* alt_match_null_string_p */
-
-
-/* Deals with the ops common to group_match_null_string_p and
- alt_match_null_string_p.
-
- Sets P to one after the op and its arguments, if any. */
-
-static boolean
-common_op_match_null_string_p (p, end, reg_info)
- unsigned char **p, *end;
- register_info_type *reg_info;
-{
- int mcnt;
- boolean ret;
- int reg_no;
- unsigned char *p1 = *p;
-
- switch ((re_opcode_t) *p1++)
- {
- case no_op:
- case begline:
- case endline:
- case begbuf:
- case endbuf:
- case wordbeg:
- case wordend:
- case wordbound:
- case notwordbound:
-#ifdef emacs
- case before_dot:
- case at_dot:
- case after_dot:
-#endif
- break;
-
- case start_memory:
- reg_no = *p1;
- assert (reg_no > 0 && reg_no <= MAX_REGNUM);
- ret = group_match_null_string_p (&p1, end, reg_info);
-
- /* Have to set this here in case we're checking a group which
- contains a group and a back reference to it. */
-
- if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE)
- REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret;
-
- if (!ret)
- return false;
- break;
-
- /* If this is an optimized succeed_n for zero times, make the jump. */
- case jump:
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- if (mcnt >= 0)
- p1 += mcnt;
- else
- return false;
- break;
-
- case succeed_n:
- /* Get to the number of times to succeed. */
- p1 += 2;
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-
- if (mcnt == 0)
- {
- p1 -= 4;
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- p1 += mcnt;
- }
- else
- return false;
- break;
-
- case duplicate:
- if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
- return false;
- break;
-
- case set_number_at:
- p1 += 4;
-
- default:
- /* All other opcodes mean we cannot match the empty string. */
- return false;
- }
-
- *p = p1;
- return true;
-} /* common_op_match_null_string_p */
-
-
-/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
- bytes; nonzero otherwise. */
-
-static int
-bcmp_translate (s1, s2, len, translate)
- const char *s1, *s2;
- register int len;
- RE_TRANSLATE_TYPE translate;
-{
- register const unsigned char *p1 = (const unsigned char *) s1;
- register const unsigned char *p2 = (const unsigned char *) s2;
- while (len)
- {
- if (translate[*p1++] != translate[*p2++]) return 1;
- len--;
- }
- return 0;
-}
-
-/* Entry points for GNU code. */
-
-/* re_compile_pattern is the GNU regular expression compiler: it
- compiles PATTERN (of length SIZE) and puts the result in BUFP.
- Returns 0 if the pattern was valid, otherwise an error string.
-
- Assumes the `allocated' (and perhaps `buffer') and `translate' fields
- are set in BUFP on entry.
-
- We call regex_compile to do the actual compilation. */
-
-const char *
-re_compile_pattern (pattern, length, bufp)
- const char *pattern;
- size_t length;
- struct re_pattern_buffer *bufp;
-{
- reg_errcode_t ret;
-
- /* GNU code is written to assume at least RE_NREGS registers will be set
- (and at least one extra will be -1). */
- bufp->regs_allocated = REGS_UNALLOCATED;
-
- /* And GNU code determines whether or not to get register information
- by passing null for the REGS argument to re_match, etc., not by
- setting no_sub. */
- bufp->no_sub = 0;
-
- /* Match anchors at newline. */
- bufp->newline_anchor = 1;
-
- ret = regex_compile (pattern, length, re_syntax_options, bufp);
-
- if (!ret)
- return NULL;
- return gettext (re_error_msgid[(int) ret]);
-}
-
-/* Entry points compatible with 4.2 BSD regex library. We don't define
- them unless specifically requested. */
-
-#if defined (_REGEX_RE_COMP) || defined (_LIBC)
-
-/* BSD has one and only one pattern buffer. */
-static struct re_pattern_buffer re_comp_buf;
-
-char *
-#ifdef _LIBC
-/* Make these definitions weak in libc, so POSIX programs can redefine
- these names if they don't use our functions, and still use
- regcomp/regexec below without link errors. */
-weak_function
-#endif
-re_comp (s)
- const char *s;
-{
- reg_errcode_t ret;
-
- if (!s)
- {
- if (!re_comp_buf.buffer)
- return gettext ("No previous regular expression");
- return 0;
- }
-
- if (!re_comp_buf.buffer)
- {
- re_comp_buf.buffer = (unsigned char *) malloc (200);
- if (re_comp_buf.buffer == NULL)
- return gettext (re_error_msgid[(int) REG_ESPACE]);
- re_comp_buf.allocated = 200;
-
- re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
- if (re_comp_buf.fastmap == NULL)
- return gettext (re_error_msgid[(int) REG_ESPACE]);
- }
-
- /* Since `re_exec' always passes NULL for the `regs' argument, we
- don't need to initialize the pattern buffer fields which affect it. */
-
- /* Match anchors at newlines. */
- re_comp_buf.newline_anchor = 1;
-
- ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
-
- if (!ret)
- return NULL;
-
- /* Yes, we're discarding `const' here if !HAVE_LIBINTL. */
- return (char *) gettext (re_error_msgid[(int) ret]);
-}
-
-
-int
-#ifdef _LIBC
-weak_function
-#endif
-re_exec (s)
- const char *s;
-{
- const int len = strlen (s);
- return
- 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
-}
-
-#endif /* _REGEX_RE_COMP */
-
-/* POSIX.2 functions. Don't define these for Emacs. */
-
-#ifndef emacs
-
-/* regcomp takes a regular expression as a string and compiles it.
-
- PREG is a regex_t *. We do not expect any fields to be initialized,
- since POSIX says we shouldn't. Thus, we set
-
- `buffer' to the compiled pattern;
- `used' to the length of the compiled pattern;
- `syntax' to RE_SYNTAX_POSIX_EXTENDED if the
- REG_EXTENDED bit in CFLAGS is set; otherwise, to
- RE_SYNTAX_POSIX_BASIC;
- `newline_anchor' to REG_NEWLINE being set in CFLAGS;
- `fastmap' and `fastmap_accurate' to zero;
- `re_nsub' to the number of subexpressions in PATTERN.
-
- PATTERN is the address of the pattern string.
-
- CFLAGS is a series of bits which affect compilation.
-
- If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we
- use POSIX basic syntax.
-
- If REG_NEWLINE is set, then . and [^...] don't match newline.
- Also, regexec will try a match beginning after every newline.
-
- If REG_ICASE is set, then we considers upper- and lowercase
- versions of letters to be equivalent when matching.
-
- If REG_NOSUB is set, then when PREG is passed to regexec, that
- routine will report only success or failure, and nothing about the
- registers.
-
- It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for
- the return codes and their meanings.) */
-
-int
-regcomp (preg, pattern, cflags)
- regex_t *preg;
- const char *pattern;
- int cflags;
-{
- reg_errcode_t ret;
- reg_syntax_t syntax
- = (cflags & REG_EXTENDED) ?
- RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
-
- /* regex_compile will allocate the space for the compiled pattern. */
- preg->buffer = 0;
- preg->allocated = 0;
- preg->used = 0;
-
- /* Don't bother to use a fastmap when searching. This simplifies the
- REG_NEWLINE case: if we used a fastmap, we'd have to put all the
- characters after newlines into the fastmap. This way, we just try
- every character. */
- preg->fastmap = 0;
-
- if (cflags & REG_ICASE)
- {
- unsigned i;
-
- preg->translate
- = (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE
- * sizeof (*(RE_TRANSLATE_TYPE)0));
- if (preg->translate == NULL)
- return (int) REG_ESPACE;
-
- /* Map uppercase characters to corresponding lowercase ones. */
- for (i = 0; i < CHAR_SET_SIZE; i++)
- preg->translate[i] = ISUPPER (i) ? tolower (i) : i;
- }
- else
- preg->translate = NULL;
-
- /* If REG_NEWLINE is set, newlines are treated differently. */
- if (cflags & REG_NEWLINE)
- { /* REG_NEWLINE implies neither . nor [^...] match newline. */
- syntax &= ~RE_DOT_NEWLINE;
- syntax |= RE_HAT_LISTS_NOT_NEWLINE;
- /* It also changes the matching behavior. */
- preg->newline_anchor = 1;
- }
- else
- preg->newline_anchor = 0;
-
- preg->no_sub = !!(cflags & REG_NOSUB);
-
- /* POSIX says a null character in the pattern terminates it, so we
- can use strlen here in compiling the pattern. */
- ret = regex_compile (pattern, strlen (pattern), syntax, preg);
-
- /* POSIX doesn't distinguish between an unmatched open-group and an
- unmatched close-group: both are REG_EPAREN. */
- if (ret == REG_ERPAREN) ret = REG_EPAREN;
-
- return (int) ret;
-}
-
-
-/* regexec searches for a given pattern, specified by PREG, in the
- string STRING.
-
- If NMATCH is zero or REG_NOSUB was set in the cflags argument to
- `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
- least NMATCH elements, and we set them to the offsets of the
- corresponding matched substrings.
-
- EFLAGS specifies `execution flags' which affect matching: if
- REG_NOTBOL is set, then ^ does not match at the beginning of the
- string; if REG_NOTEOL is set, then $ does not match at the end.
-
- We return 0 if we find a match and REG_NOMATCH if not. */
-
-int
-regexec (preg, string, nmatch, pmatch, eflags)
- const regex_t *preg;
- const char *string;
- size_t nmatch;
- regmatch_t pmatch[];
- int eflags;
-{
- int ret;
- struct re_registers regs;
- regex_t private_preg;
- int len = strlen (string);
- boolean want_reg_info = !preg->no_sub && nmatch > 0;
-
- private_preg = *preg;
-
- private_preg.not_bol = !!(eflags & REG_NOTBOL);
- private_preg.not_eol = !!(eflags & REG_NOTEOL);
-
- /* The user has told us exactly how many registers to return
- information about, via `nmatch'. We have to pass that on to the
- matching routines. */
- private_preg.regs_allocated = REGS_FIXED;
-
- if (want_reg_info)
- {
- regs.num_regs = nmatch;
- regs.start = TALLOC (nmatch, regoff_t);
- regs.end = TALLOC (nmatch, regoff_t);
- if (regs.start == NULL || regs.end == NULL)
- return (int) REG_NOMATCH;
- }
-
- /* Perform the searching operation. */
- ret = re_search (&private_preg, string, len,
- /* start: */ 0, /* range: */ len,
- want_reg_info ? &regs : (struct re_registers *) 0);
-
- /* Copy the register information to the POSIX structure. */
- if (want_reg_info)
- {
- if (ret >= 0)
- {
- unsigned r;
-
- for (r = 0; r < nmatch; r++)
- {
- pmatch[r].rm_so = regs.start[r];
- pmatch[r].rm_eo = regs.end[r];
- }
- }
-
- /* If we needed the temporary register info, free the space now. */
- free (regs.start);
- free (regs.end);
- }
-
- /* We want zero return to mean success, unlike `re_search'. */
- return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
-}
-
-
-/* Returns a message corresponding to an error code, ERRCODE, returned
- from either regcomp or regexec. We don't use PREG here. */
-
-size_t
-regerror (errcode, preg, errbuf, errbuf_size)
- int errcode;
- const regex_t *preg;
- char *errbuf;
- size_t errbuf_size;
-{
- const char *msg;
- size_t msg_size;
-
- if (errcode < 0
- || errcode >= (int) (sizeof (re_error_msgid)
- / sizeof (re_error_msgid[0])))
- /* Only error codes returned by the rest of the code should be passed
- to this routine. If we are given anything else, or if other regex
- code generates an invalid error code, then the program has a bug.
- Dump core so we can fix it. */
- abort ();
-
- msg = gettext (re_error_msgid[errcode]);
-
- msg_size = strlen (msg) + 1; /* Includes the null. */
-
- if (errbuf_size != 0)
- {
- if (msg_size > errbuf_size)
- {
- strncpy (errbuf, msg, errbuf_size - 1);
- errbuf[errbuf_size - 1] = 0;
- }
- else
- strcpy (errbuf, msg);
- }
-
- return msg_size;
-}
-
-
-/* Free dynamically allocated space used by PREG. */
-
-void
-regfree (preg)
- regex_t *preg;
-{
- if (preg->buffer != NULL)
- free (preg->buffer);
- preg->buffer = NULL;
-
- preg->allocated = 0;
- preg->used = 0;
-
- if (preg->fastmap != NULL)
- free (preg->fastmap);
- preg->fastmap = NULL;
- preg->fastmap_accurate = 0;
-
- if (preg->translate != NULL)
- free (preg->translate);
- preg->translate = NULL;
-}
-
-#endif /* not emacs */
diff --git a/gnu/dist/gawk/regex.h b/gnu/dist/gawk/regex.h
index 5140052c374..0e868c82a08 100644
--- a/gnu/dist/gawk/regex.h
+++ b/gnu/dist/gawk/regex.h
@@ -1,23 +1,28 @@
+/* $NetBSD: regex.h,v 1.1.1.2 2003/10/06 15:46:35 wiz Exp $ */
+
/* 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 Free Software Foundation, Inc.
+ expression library.
+ Copyright (C) 1985,1989-93,1995-98,2000,2001,2002
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful,
+ The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- 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
+ Lesser 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 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 __REGEXP_LIBRARY_H__
-#define __REGEXP_LIBRARY_H__
+#ifndef _REGEX_H
+#define _REGEX_H 1
/* Allow the use in C++ code. */
#ifdef __cplusplus
@@ -27,10 +32,10 @@ extern "C" {
/* POSIX says that <sys/types.h> must be included (by the caller) before
<regex.h>. */
-#if !defined (_POSIX_C_SOURCE) && !defined (_POSIX_SOURCE) && defined (VMS)
+#if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS
/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
should be there. */
-#include <stddef.h>
+# include <stddef.h>
#endif
/* The following two types have to be signed and unsigned integer type
@@ -156,6 +161,15 @@ typedef unsigned long int reg_syntax_t;
this bit set, and it won't affect anything in the normal case. */
#define RE_DEBUG (RE_NO_GNU_OPS << 1)
+/* If this bit is set, a syntactically invalid interval is treated as
+ a string of ordinary characters. For example, the ERE 'a{1' is
+ treated as 'a\{1'. */
+#define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)
+
+/* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
+
/* This global variable defines the particular regexp syntax to use (for
some interfaces). When a regexp is compiled, the syntax used is
stored in the pattern buffer, so changing this does not affect
@@ -177,7 +191,8 @@ extern reg_syntax_t re_syntax_options;
#define RE_SYNTAX_GNU_AWK \
((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \
- & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS))
+ & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS \
+ | RE_CONTEXT_INVALID_OPS ))
#define RE_SYNTAX_POSIX_AWK \
(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
@@ -195,7 +210,8 @@ extern reg_syntax_t re_syntax_options;
| RE_NO_BK_VBAR)
#define RE_SYNTAX_POSIX_EGREP \
- (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
+ (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES \
+ | RE_INVALID_INTERVAL_ORD)
/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
@@ -217,13 +233,13 @@ extern reg_syntax_t re_syntax_options;
(_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
#define RE_SYNTAX_POSIX_EXTENDED \
- (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
- | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
- | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
- | RE_UNMATCHED_RIGHT_PAREN_ORD)
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
+ | RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD)
-/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
- replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
+/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is
+ removed and RE_NO_BK_REFS is added. */
#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
| RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
@@ -235,7 +251,7 @@ extern reg_syntax_t re_syntax_options;
(erroneously) define this in other header files, but we want our
value, so remove any previous define. */
#ifdef RE_DUP_MAX
-#undef RE_DUP_MAX
+# undef RE_DUP_MAX
#endif
/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */
#define RE_DUP_MAX (0x7fff)
@@ -278,6 +294,10 @@ extern reg_syntax_t re_syntax_options;
`re_error_msg' table in regex.c. */
typedef enum
{
+#ifdef _XOPEN_SOURCE
+ REG_ENOSYS = -1, /* This will never happen for this implementation. */
+#endif
+
REG_NOERROR = 0, /* Success. */
REG_NOMATCH, /* Didn't find a match (for regexec). */
@@ -309,7 +329,7 @@ typedef enum
private to the regex routines. */
#ifndef RE_TRANSLATE_TYPE
-#define RE_TRANSLATE_TYPE char *
+# define RE_TRANSLATE_TYPE char *
#endif
struct re_pattern_buffer
@@ -400,7 +420,7 @@ struct re_registers
`re_match_2' returns information about at least this many registers
the first time a `regs' structure is passed. */
#ifndef RE_NREGS
-#define RE_NREGS 30
+# define RE_NREGS 30
#endif
@@ -423,11 +443,11 @@ typedef struct
#if __STDC__
-#define _RE_ARGS(args) args
+# define _RE_ARGS(args) args
#else /* not __STDC__ */
-#define _RE_ARGS(args) ()
+# define _RE_ARGS(args) ()
#endif /* not __STDC__ */
@@ -497,30 +517,57 @@ extern void re_set_registers
_RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
unsigned num_regs, regoff_t *starts, regoff_t *ends));
-#ifdef _REGEX_RE_COMP
-#ifndef _CRAY
+#if defined _REGEX_RE_COMP || defined _LIBC
+# ifndef _CRAY
/* 4.2 bsd compatibility. */
extern char *re_comp _RE_ARGS ((const char *));
extern int re_exec _RE_ARGS ((const char *));
+# endif
+#endif
+
+/* GCC 2.95 and later have "__restrict"; C99 compilers have
+ "restrict", and "configure" may have defined "restrict". */
+#ifndef __restrict
+# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
+# if defined restrict || 199901L <= __STDC_VERSION__
+# define __restrict restrict
+# else
+# define __restrict
+# endif
+# elif defined __APPLE_CC__
+# define __restrict
+# endif
#endif
+/* gcc 3.1 and up support the [restrict] syntax. */
+#ifndef __restrict_arr
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+# define __restrict_arr __restrict
+# else
+# define __restrict_arr
+# endif
#endif
/* POSIX compatibility. */
-extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
-extern int regexec
- _RE_ARGS ((const regex_t *preg, const char *string, size_t nmatch,
- regmatch_t pmatch[], int eflags));
-extern size_t regerror
- _RE_ARGS ((int errcode, const regex_t *preg, char *errbuf,
- size_t errbuf_size));
-extern void regfree _RE_ARGS ((regex_t *preg));
+extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,
+ const char *__restrict __pattern,
+ int __cflags));
+
+extern int regexec _RE_ARGS ((const regex_t *__restrict __preg,
+ const char *__restrict __string, size_t __nmatch,
+ regmatch_t __pmatch[__restrict_arr],
+ int __eflags));
+
+extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
+ char *__errbuf, size_t __errbuf_size));
+
+extern void regfree _RE_ARGS ((regex_t *__preg));
#ifdef __cplusplus
}
#endif /* C++ */
-#endif /* not __REGEXP_LIBRARY_H__ */
+#endif /* regex.h */
/*
Local variables:
diff --git a/gnu/dist/gawk/regex_internal.c b/gnu/dist/gawk/regex_internal.c
new file mode 100644
index 00000000000..67aaadae6a0
--- /dev/null
+++ b/gnu/dist/gawk/regex_internal.c
@@ -0,0 +1,1268 @@
+/* $NetBSD: regex_internal.c,v 1.1.1.1 2003/10/06 15:47:24 wiz Exp $ */
+
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+static void re_string_construct_common _RE_ARGS((const char *str, int len,
+ re_string_t *pstr,
+ RE_TRANSLATE_TYPE trans, int icase));
+#ifdef RE_ENABLE_I18N
+static int re_string_skip_chars _RE_ARGS((re_string_t *pstr, int new_raw_idx,
+ wint_t *last_wc));
+#endif /* RE_ENABLE_I18N */
+static re_dfastate_t *create_newstate_common _RE_ARGS((re_dfa_t *dfa,
+ const re_node_set *nodes,
+ unsigned int hash));
+static reg_errcode_t register_state _RE_ARGS((re_dfa_t *dfa, re_dfastate_t *newstate,
+ unsigned int hash));
+static re_dfastate_t *create_ci_newstate _RE_ARGS((re_dfa_t *dfa,
+ const re_node_set *nodes,
+ unsigned int hash));
+static re_dfastate_t *create_cd_newstate _RE_ARGS((re_dfa_t *dfa,
+ const re_node_set *nodes,
+ unsigned int context,
+ unsigned int hash));
+static inline unsigned int calc_state_hash _RE_ARGS((const re_node_set *nodes,
+ unsigned int context));
+
+/* Functions for string operation. */
+
+/* This function allocate the buffers. It is necessary to call
+ re_string_reconstruct before using the object. */
+
+static reg_errcode_t
+re_string_allocate (pstr, str, len, init_len, trans, icase)
+ re_string_t *pstr;
+ const char *str;
+ int len, init_len, icase;
+ RE_TRANSLATE_TYPE trans;
+{
+ reg_errcode_t ret;
+ int init_buf_len = (len + 1 < init_len) ? len + 1: init_len;
+ re_string_construct_common (str, len, pstr, trans, icase);
+ pstr->stop = pstr->len;
+
+ ret = re_string_realloc_buffers (pstr, init_buf_len);
+ if (BE (ret != REG_NOERROR, 0))
+ return ret;
+
+ pstr->mbs_case = (MBS_CASE_ALLOCATED (pstr) ? pstr->mbs_case
+ : (unsigned char *) str);
+ pstr->mbs = MBS_ALLOCATED (pstr) ? pstr->mbs : pstr->mbs_case;
+ pstr->valid_len = (MBS_CASE_ALLOCATED (pstr) || MBS_ALLOCATED (pstr)
+#ifdef RE_ENABLE_I18N
+ || re_mb_cur_max > 1
+#endif
+ ) ? pstr->valid_len : len;
+ return REG_NOERROR;
+}
+
+/* This function allocate the buffers, and initialize them. */
+
+static reg_errcode_t
+re_string_construct (pstr, str, len, trans, icase)
+ re_string_t *pstr;
+ const char *str;
+ int len, icase;
+ RE_TRANSLATE_TYPE trans;
+{
+ reg_errcode_t ret;
+ re_string_construct_common (str, len, pstr, trans, icase);
+ pstr->stop = pstr->len;
+ /* Set 0 so that this function can initialize whole buffers. */
+ pstr->valid_len = 0;
+
+ if (len > 0)
+ {
+ ret = re_string_realloc_buffers (pstr, len + 1);
+ if (BE (ret != REG_NOERROR, 0))
+ return ret;
+ }
+ pstr->mbs_case = (MBS_CASE_ALLOCATED (pstr) ? pstr->mbs_case
+ : (unsigned char *) str);
+ pstr->mbs = MBS_ALLOCATED (pstr) ? pstr->mbs : pstr->mbs_case;
+
+ if (icase)
+ {
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max > 1)
+ build_wcs_upper_buffer (pstr);
+ else
+#endif /* RE_ENABLE_I18N */
+ build_upper_buffer (pstr);
+ }
+ else
+ {
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max > 1)
+ build_wcs_buffer (pstr);
+ else
+#endif /* RE_ENABLE_I18N */
+ {
+ if (trans != NULL)
+ re_string_translate_buffer (pstr);
+ else
+ pstr->valid_len = len;
+ }
+ }
+
+ /* Initialized whole buffers, then valid_len == bufs_len. */
+ pstr->valid_len = pstr->bufs_len;
+ return REG_NOERROR;
+}
+
+/* Helper functions for re_string_allocate, and re_string_construct. */
+
+static reg_errcode_t
+re_string_realloc_buffers (pstr, new_buf_len)
+ re_string_t *pstr;
+ int new_buf_len;
+{
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max > 1)
+ {
+ wint_t *new_array = re_realloc (pstr->wcs, wint_t, new_buf_len);
+ if (BE (new_array == NULL, 0))
+ return REG_ESPACE;
+ pstr->wcs = new_array;
+ }
+#endif /* RE_ENABLE_I18N */
+ if (MBS_ALLOCATED (pstr))
+ {
+ unsigned char *new_array = re_realloc (pstr->mbs, unsigned char,
+ new_buf_len);
+ if (BE (new_array == NULL, 0))
+ return REG_ESPACE;
+ pstr->mbs = new_array;
+ }
+ if (MBS_CASE_ALLOCATED (pstr))
+ {
+ unsigned char *new_array = re_realloc (pstr->mbs_case, unsigned char,
+ new_buf_len);
+ if (BE (new_array == NULL, 0))
+ return REG_ESPACE;
+ pstr->mbs_case = new_array;
+ if (!MBS_ALLOCATED (pstr))
+ pstr->mbs = pstr->mbs_case;
+ }
+ pstr->bufs_len = new_buf_len;
+ return REG_NOERROR;
+}
+
+
+static void
+re_string_construct_common (str, len, pstr, trans, icase)
+ const char *str;
+ int len;
+ re_string_t *pstr;
+ RE_TRANSLATE_TYPE trans;
+ int icase;
+{
+ memset (pstr, '\0', sizeof (re_string_t));
+ pstr->raw_mbs = (const unsigned char *) str;
+ pstr->len = len;
+ pstr->trans = trans;
+ pstr->icase = icase ? 1 : 0;
+}
+
+#ifdef RE_ENABLE_I18N
+
+/* Build wide character buffer PSTR->WCS.
+ If the byte sequence of the string are:
+ <mb1>(0), <mb1>(1), <mb2>(0), <mb2>(1), <sb3>
+ Then wide character buffer will be:
+ <wc1> , WEOF , <wc2> , WEOF , <wc3>
+ We use WEOF for padding, they indicate that the position isn't
+ a first byte of a multibyte character.
+
+ Note that this function assumes PSTR->VALID_LEN elements are already
+ built and starts from PSTR->VALID_LEN. */
+
+static void
+build_wcs_buffer (pstr)
+ re_string_t *pstr;
+{
+ mbstate_t prev_st;
+ int byte_idx, end_idx, mbclen, remain_len;
+ /* Build the buffers from pstr->valid_len to either pstr->len or
+ pstr->bufs_len. */
+ end_idx = (pstr->bufs_len > pstr->len)? pstr->len : pstr->bufs_len;
+ for (byte_idx = pstr->valid_len; byte_idx < end_idx;)
+ {
+ wchar_t wc;
+ remain_len = end_idx - byte_idx;
+ prev_st = pstr->cur_state;
+ mbclen = mbrtowc (&wc, ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx
+ + byte_idx), remain_len, &pstr->cur_state);
+ if (BE (mbclen == (size_t) -2, 0))
+ {
+ /* The buffer doesn't have enough space, finish to build. */
+ pstr->cur_state = prev_st;
+ break;
+ }
+ else if (BE (mbclen == (size_t) -1 || mbclen == 0, 0))
+ {
+ /* We treat these cases as a singlebyte character. */
+ mbclen = 1;
+ wc = (wchar_t) pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
+ pstr->cur_state = prev_st;
+ }
+
+ /* Apply the translateion if we need. */
+ if (pstr->trans != NULL && mbclen == 1)
+ {
+ int ch = pstr->trans[pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]];
+ pstr->mbs_case[byte_idx] = ch;
+ }
+ /* Write wide character and padding. */
+ pstr->wcs[byte_idx++] = wc;
+ /* Write paddings. */
+ for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;)
+ pstr->wcs[byte_idx++] = WEOF;
+ }
+ pstr->valid_len = byte_idx;
+}
+
+/* Build wide character buffer PSTR->WCS like build_wcs_buffer,
+ but for REG_ICASE. */
+
+static void
+build_wcs_upper_buffer (pstr)
+ re_string_t *pstr;
+{
+ mbstate_t prev_st;
+ int byte_idx, end_idx, mbclen, remain_len;
+ /* Build the buffers from pstr->valid_len to either pstr->len or
+ pstr->bufs_len. */
+ end_idx = (pstr->bufs_len > pstr->len)? pstr->len : pstr->bufs_len;
+ for (byte_idx = pstr->valid_len; byte_idx < end_idx;)
+ {
+ wchar_t wc;
+ remain_len = end_idx - byte_idx;
+ prev_st = pstr->cur_state;
+ mbclen = mbrtowc (&wc, ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx
+ + byte_idx), remain_len, &pstr->cur_state);
+ if (BE (mbclen == (size_t) -2, 0))
+ {
+ /* The buffer doesn't have enough space, finish to build. */
+ pstr->cur_state = prev_st;
+ break;
+ }
+ else if (mbclen == 1 || mbclen == (size_t) -1 || mbclen == 0)
+ {
+ /* In case of a singlebyte character. */
+ int ch = pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
+ /* Apply the translateion if we need. */
+ if (pstr->trans != NULL && mbclen == 1)
+ {
+ ch = pstr->trans[ch];
+ pstr->mbs_case[byte_idx] = ch;
+ }
+ pstr->wcs[byte_idx] = iswlower (wc) ? toupper (wc) : wc;
+ pstr->mbs[byte_idx++] = islower (ch) ? toupper (ch) : ch;
+ if (BE (mbclen == (size_t) -1, 0))
+ pstr->cur_state = prev_st;
+ }
+ else /* mbclen > 1 */
+ {
+ if (iswlower (wc))
+ wcrtomb ((char *) pstr->mbs + byte_idx, towupper (wc), &prev_st);
+ else
+ memcpy (pstr->mbs + byte_idx,
+ pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx, mbclen);
+ pstr->wcs[byte_idx++] = iswlower (wc) ? toupper (wc) : wc;
+ /* Write paddings. */
+ for (remain_len = byte_idx + mbclen - 1; byte_idx < remain_len ;)
+ pstr->wcs[byte_idx++] = WEOF;
+ }
+ }
+ pstr->valid_len = byte_idx;
+}
+
+/* Skip characters until the index becomes greater than NEW_RAW_IDX.
+ Return the index. */
+
+static int
+re_string_skip_chars (pstr, new_raw_idx, last_wc)
+ re_string_t *pstr;
+ int new_raw_idx;
+ wint_t *last_wc;
+{
+ mbstate_t prev_st;
+ int rawbuf_idx, mbclen;
+ wchar_t wc = 0;
+
+ /* Skip the characters which are not necessary to check. */
+ for (rawbuf_idx = pstr->raw_mbs_idx + pstr->valid_len;
+ rawbuf_idx < new_raw_idx;)
+ {
+ int remain_len;
+ remain_len = pstr->len - rawbuf_idx;
+ prev_st = pstr->cur_state;
+ mbclen = mbrtowc (&wc, (const char *) pstr->raw_mbs + rawbuf_idx,
+ remain_len, &pstr->cur_state);
+ if (BE (mbclen == (size_t) -2 || mbclen == (size_t) -1 || mbclen == 0, 0))
+ {
+ /* We treat these cases as a singlebyte character. */
+ mbclen = 1;
+ pstr->cur_state = prev_st;
+ }
+ /* Then proceed the next character. */
+ rawbuf_idx += mbclen;
+ }
+ *last_wc = (wint_t) wc;
+ return rawbuf_idx;
+}
+#endif /* RE_ENABLE_I18N */
+
+/* Build the buffer PSTR->MBS, and apply the translation if we need.
+ This function is used in case of REG_ICASE. */
+
+static void
+build_upper_buffer (pstr)
+ re_string_t *pstr;
+{
+ int char_idx, end_idx;
+ end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len;
+
+ for (char_idx = pstr->valid_len; char_idx < end_idx; ++char_idx)
+ {
+ int ch = pstr->raw_mbs[pstr->raw_mbs_idx + char_idx];
+ if (pstr->trans != NULL)
+ {
+ ch = pstr->trans[ch];
+ pstr->mbs_case[char_idx] = ch;
+ }
+ if (islower (ch))
+ pstr->mbs[char_idx] = toupper (ch);
+ else
+ pstr->mbs[char_idx] = ch;
+ }
+ pstr->valid_len = char_idx;
+}
+
+/* Apply TRANS to the buffer in PSTR. */
+
+static void
+re_string_translate_buffer (pstr)
+ re_string_t *pstr;
+{
+ int buf_idx, end_idx;
+ end_idx = (pstr->bufs_len > pstr->len) ? pstr->len : pstr->bufs_len;
+
+ for (buf_idx = pstr->valid_len; buf_idx < end_idx; ++buf_idx)
+ {
+ int ch = pstr->raw_mbs[pstr->raw_mbs_idx + buf_idx];
+ pstr->mbs_case[buf_idx] = pstr->trans[ch];
+ }
+
+ pstr->valid_len = buf_idx;
+}
+
+/* This function re-construct the buffers.
+ Concretely, convert to wide character in case of re_mb_cur_max > 1,
+ convert to upper case in case of REG_ICASE, apply translation. */
+
+static reg_errcode_t
+re_string_reconstruct (pstr, idx, eflags, newline)
+ re_string_t *pstr;
+ int idx, eflags, newline;
+{
+ int offset = idx - pstr->raw_mbs_idx;
+ if (offset < 0)
+ {
+ /* Reset buffer. */
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max > 1)
+ memset (&pstr->cur_state, '\0', sizeof (mbstate_t));
+#endif /* RE_ENABLE_I18N */
+ pstr->len += pstr->raw_mbs_idx;
+ pstr->stop += pstr->raw_mbs_idx;
+ pstr->valid_len = pstr->raw_mbs_idx = 0;
+ pstr->tip_context = ((eflags & REG_NOTBOL) ? CONTEXT_BEGBUF
+ : CONTEXT_NEWLINE | CONTEXT_BEGBUF);
+ if (!MBS_CASE_ALLOCATED (pstr))
+ pstr->mbs_case = (unsigned char *) pstr->raw_mbs;
+ if (!MBS_ALLOCATED (pstr) && !MBS_CASE_ALLOCATED (pstr))
+ pstr->mbs = (unsigned char *) pstr->raw_mbs;
+ offset = idx;
+ }
+
+ if (offset != 0)
+ {
+ /* Are the characters which are already checked remain? */
+ if (offset < pstr->valid_len)
+ {
+ /* Yes, move them to the front of the buffer. */
+ pstr->tip_context = re_string_context_at (pstr, offset - 1, eflags,
+ newline);
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max > 1)
+ memmove (pstr->wcs, pstr->wcs + offset,
+ (pstr->valid_len - offset) * sizeof (wint_t));
+#endif /* RE_ENABLE_I18N */
+ if (MBS_ALLOCATED (pstr))
+ memmove (pstr->mbs, pstr->mbs + offset,
+ pstr->valid_len - offset);
+ if (MBS_CASE_ALLOCATED (pstr))
+ memmove (pstr->mbs_case, pstr->mbs_case + offset,
+ pstr->valid_len - offset);
+ pstr->valid_len -= offset;
+#if DEBUG
+ assert (pstr->valid_len > 0);
+#endif
+ }
+ else
+ {
+ /* No, skip all characters until IDX. */
+ pstr->valid_len = 0;
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max > 1)
+ {
+ int wcs_idx;
+ wint_t wc;
+ pstr->valid_len = re_string_skip_chars (pstr, idx, &wc) - idx;
+ for (wcs_idx = 0; wcs_idx < pstr->valid_len; ++wcs_idx)
+ pstr->wcs[wcs_idx] = WEOF;
+ if (pstr->trans && wc <= 0xff)
+ wc = pstr->trans[wc];
+ pstr->tip_context = (IS_WIDE_WORD_CHAR (wc) ? CONTEXT_WORD
+ : ((newline && IS_WIDE_NEWLINE (wc))
+ ? CONTEXT_NEWLINE : 0));
+ }
+ else
+#endif /* RE_ENABLE_I18N */
+ {
+ int c = pstr->raw_mbs[pstr->raw_mbs_idx + offset - 1];
+ if (pstr->trans)
+ c = pstr->trans[c];
+ pstr->tip_context = (IS_WORD_CHAR (c) ? CONTEXT_WORD
+ : ((newline && IS_NEWLINE (c))
+ ? CONTEXT_NEWLINE : 0));
+ }
+ }
+ if (!MBS_CASE_ALLOCATED (pstr))
+ {
+ pstr->mbs_case += offset;
+ /* In case of !MBS_ALLOCATED && !MBS_CASE_ALLOCATED. */
+ if (!MBS_ALLOCATED (pstr))
+ pstr->mbs += offset;
+ }
+ }
+ pstr->raw_mbs_idx = idx;
+ pstr->len -= offset;
+ pstr->stop -= offset;
+
+ /* Then build the buffers. */
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max > 1)
+ {
+ if (pstr->icase)
+ build_wcs_upper_buffer (pstr);
+ else
+ build_wcs_buffer (pstr);
+ }
+ else
+#endif /* RE_ENABLE_I18N */
+ {
+ if (pstr->icase)
+ build_upper_buffer (pstr);
+ else if (pstr->trans != NULL)
+ re_string_translate_buffer (pstr);
+ }
+ pstr->cur_idx = 0;
+
+ return REG_NOERROR;
+}
+
+static void
+re_string_destruct (pstr)
+ re_string_t *pstr;
+{
+#ifdef RE_ENABLE_I18N
+ re_free (pstr->wcs);
+#endif /* RE_ENABLE_I18N */
+ if (MBS_ALLOCATED (pstr))
+ re_free (pstr->mbs);
+ if (MBS_CASE_ALLOCATED (pstr))
+ re_free (pstr->mbs_case);
+}
+
+/* Return the context at IDX in INPUT. */
+
+static unsigned int
+re_string_context_at (input, idx, eflags, newline_anchor)
+ const re_string_t *input;
+ int idx, eflags, newline_anchor;
+{
+ int c;
+ if (idx < 0 || idx == input->len)
+ {
+ if (idx < 0)
+ /* In this case, we use the value stored in input->tip_context,
+ since we can't know the character in input->mbs[-1] here. */
+ return input->tip_context;
+ else /* (idx == input->len) */
+ return ((eflags & REG_NOTEOL) ? CONTEXT_ENDBUF
+ : CONTEXT_NEWLINE | CONTEXT_ENDBUF);
+ }
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max > 1)
+ {
+ wint_t wc;
+ int wc_idx = idx;
+ while(input->wcs[wc_idx] == WEOF)
+ {
+#ifdef DEBUG
+ /* It must not happen. */
+ assert (wc_idx >= 0);
+#endif
+ --wc_idx;
+ if (wc_idx < 0)
+ return input->tip_context;
+ }
+ wc = input->wcs[wc_idx];
+ if (IS_WIDE_WORD_CHAR (wc))
+ return CONTEXT_WORD;
+ return (newline_anchor && IS_WIDE_NEWLINE (wc)) ? CONTEXT_NEWLINE : 0;
+ }
+ else
+#endif
+ {
+ c = re_string_byte_at (input, idx);
+ if (IS_WORD_CHAR (c))
+ return CONTEXT_WORD;
+ return (newline_anchor && IS_NEWLINE (c)) ? CONTEXT_NEWLINE : 0;
+ }
+}
+
+/* Functions for set operation. */
+
+static reg_errcode_t
+re_node_set_alloc (set, size)
+ re_node_set *set;
+ int size;
+{
+ set->alloc = size;
+ set->nelem = 0;
+ set->elems = re_malloc (int, size);
+ if (BE (set->elems == NULL, 0))
+ return REG_ESPACE;
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+re_node_set_init_1 (set, elem)
+ re_node_set *set;
+ int elem;
+{
+ set->alloc = 1;
+ set->nelem = 1;
+ set->elems = re_malloc (int, 1);
+ if (BE (set->elems == NULL, 0))
+ {
+ set->alloc = set->nelem = 0;
+ return REG_ESPACE;
+ }
+ set->elems[0] = elem;
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+re_node_set_init_2 (set, elem1, elem2)
+ re_node_set *set;
+ int elem1, elem2;
+{
+ set->alloc = 2;
+ set->elems = re_malloc (int, 2);
+ if (BE (set->elems == NULL, 0))
+ return REG_ESPACE;
+ if (elem1 == elem2)
+ {
+ set->nelem = 1;
+ set->elems[0] = elem1;
+ }
+ else
+ {
+ set->nelem = 2;
+ if (elem1 < elem2)
+ {
+ set->elems[0] = elem1;
+ set->elems[1] = elem2;
+ }
+ else
+ {
+ set->elems[0] = elem2;
+ set->elems[1] = elem1;
+ }
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+re_node_set_init_copy (dest, src)
+ re_node_set *dest;
+ const re_node_set *src;
+{
+ dest->nelem = src->nelem;
+ if (src->nelem > 0)
+ {
+ dest->alloc = dest->nelem;
+ dest->elems = re_malloc (int, dest->alloc);
+ if (BE (dest->elems == NULL, 0))
+ {
+ dest->alloc = dest->nelem = 0;
+ return REG_ESPACE;
+ }
+ memcpy (dest->elems, src->elems, src->nelem * sizeof (int));
+ }
+ else
+ re_node_set_init_empty (dest);
+ return REG_NOERROR;
+}
+
+/* Calculate the intersection of the sets SRC1 and SRC2. And merge it to
+ DEST. Return value indicate the error code or REG_NOERROR if succeeded.
+ Note: We assume dest->elems is NULL, when dest->alloc is 0. */
+
+static reg_errcode_t
+re_node_set_add_intersect (dest, src1, src2)
+ re_node_set *dest;
+ const re_node_set *src1, *src2;
+{
+ int i1, i2, id;
+ if (src1->nelem > 0 && src2->nelem > 0)
+ {
+ if (src1->nelem + src2->nelem + dest->nelem > dest->alloc)
+ {
+ dest->alloc = src1->nelem + src2->nelem + dest->nelem;
+ dest->elems = re_realloc (dest->elems, int, dest->alloc);
+ if (BE (dest->elems == NULL, 0))
+ return REG_ESPACE;
+ }
+ }
+ else
+ return REG_NOERROR;
+
+ for (i1 = i2 = id = 0 ; i1 < src1->nelem && i2 < src2->nelem ;)
+ {
+ if (src1->elems[i1] > src2->elems[i2])
+ {
+ ++i2;
+ continue;
+ }
+ if (src1->elems[i1] == src2->elems[i2])
+ {
+ while (id < dest->nelem && dest->elems[id] < src2->elems[i2])
+ ++id;
+ if (id < dest->nelem && dest->elems[id] == src2->elems[i2])
+ ++id;
+ else
+ {
+ memmove (dest->elems + id + 1, dest->elems + id,
+ sizeof (int) * (dest->nelem - id));
+ dest->elems[id++] = src2->elems[i2++];
+ ++dest->nelem;
+ }
+ }
+ ++i1;
+ }
+ return REG_NOERROR;
+}
+
+/* Calculate the union set of the sets SRC1 and SRC2. And store it to
+ DEST. Return value indicate the error code or REG_NOERROR if succeeded. */
+
+static reg_errcode_t
+re_node_set_init_union (dest, src1, src2)
+ re_node_set *dest;
+ const re_node_set *src1, *src2;
+{
+ int i1, i2, id;
+ if (src1 != NULL && src1->nelem > 0 && src2 != NULL && src2->nelem > 0)
+ {
+ dest->alloc = src1->nelem + src2->nelem;
+ dest->elems = re_malloc (int, dest->alloc);
+ if (BE (dest->elems == NULL, 0))
+ return REG_ESPACE;
+ }
+ else
+ {
+ if (src1 != NULL && src1->nelem > 0)
+ return re_node_set_init_copy (dest, src1);
+ else if (src2 != NULL && src2->nelem > 0)
+ return re_node_set_init_copy (dest, src2);
+ else
+ re_node_set_init_empty (dest);
+ return REG_NOERROR;
+ }
+ for (i1 = i2 = id = 0 ; i1 < src1->nelem && i2 < src2->nelem ;)
+ {
+ if (src1->elems[i1] > src2->elems[i2])
+ {
+ dest->elems[id++] = src2->elems[i2++];
+ continue;
+ }
+ if (src1->elems[i1] == src2->elems[i2])
+ ++i2;
+ dest->elems[id++] = src1->elems[i1++];
+ }
+ if (i1 < src1->nelem)
+ {
+ memcpy (dest->elems + id, src1->elems + i1,
+ (src1->nelem - i1) * sizeof (int));
+ id += src1->nelem - i1;
+ }
+ else if (i2 < src2->nelem)
+ {
+ memcpy (dest->elems + id, src2->elems + i2,
+ (src2->nelem - i2) * sizeof (int));
+ id += src2->nelem - i2;
+ }
+ dest->nelem = id;
+ return REG_NOERROR;
+}
+
+/* Calculate the union set of the sets DEST and SRC. And store it to
+ DEST. Return value indicate the error code or REG_NOERROR if succeeded. */
+
+static reg_errcode_t
+re_node_set_merge (dest, src)
+ re_node_set *dest;
+ const re_node_set *src;
+{
+ int si, di;
+ if (src == NULL || src->nelem == 0)
+ return REG_NOERROR;
+ if (dest->alloc < src->nelem + dest->nelem)
+ {
+ int *new_buffer;
+ dest->alloc = 2 * (src->nelem + dest->alloc);
+ new_buffer = re_realloc (dest->elems, int, dest->alloc);
+ if (BE (new_buffer == NULL, 0))
+ return REG_ESPACE;
+ dest->elems = new_buffer;
+ }
+
+ for (si = 0, di = 0 ; si < src->nelem && di < dest->nelem ;)
+ {
+ int cp_from, ncp, mid, right, src_elem = src->elems[si];
+ /* Binary search the spot we will add the new element. */
+ right = dest->nelem;
+ while (di < right)
+ {
+ mid = (di + right) / 2;
+ if (dest->elems[mid] < src_elem)
+ di = mid + 1;
+ else
+ right = mid;
+ }
+ if (di >= dest->nelem)
+ break;
+
+ if (dest->elems[di] == src_elem)
+ {
+ /* Skip since, DEST already has the element. */
+ ++di;
+ ++si;
+ continue;
+ }
+
+ /* Skip the src elements which are less than dest->elems[di]. */
+ cp_from = si;
+ while (si < src->nelem && src->elems[si] < dest->elems[di])
+ ++si;
+ /* Copy these src elements. */
+ ncp = si - cp_from;
+ memmove (dest->elems + di + ncp, dest->elems + di,
+ sizeof (int) * (dest->nelem - di));
+ memcpy (dest->elems + di, src->elems + cp_from,
+ sizeof (int) * ncp);
+ /* Update counters. */
+ di += ncp;
+ dest->nelem += ncp;
+ }
+
+ /* Copy remaining src elements. */
+ if (si < src->nelem)
+ {
+ memcpy (dest->elems + di, src->elems + si,
+ sizeof (int) * (src->nelem - si));
+ dest->nelem += src->nelem - si;
+ }
+ return REG_NOERROR;
+}
+
+/* Insert the new element ELEM to the re_node_set* SET.
+ return 0 if SET already has ELEM,
+ return -1 if an error is occured, return 1 otherwise. */
+
+static int
+re_node_set_insert (set, elem)
+ re_node_set *set;
+ int elem;
+{
+ int idx, right, mid;
+ /* In case of the set is empty. */
+ if (set->elems == NULL || set->alloc == 0)
+ {
+ if (BE (re_node_set_init_1 (set, elem) == REG_NOERROR, 1))
+ return 1;
+ else
+ return -1;
+ }
+
+ /* Binary search the spot we will add the new element. */
+ idx = 0;
+ right = set->nelem;
+ while (idx < right)
+ {
+ mid = (idx + right) / 2;
+ if (set->elems[mid] < elem)
+ idx = mid + 1;
+ else
+ right = mid;
+ }
+
+ /* Realloc if we need. */
+ if (set->alloc < set->nelem + 1)
+ {
+ int *new_array;
+ set->alloc = set->alloc * 2;
+ new_array = re_malloc (int, set->alloc);
+ if (BE (new_array == NULL, 0))
+ return -1;
+ /* Copy the elements they are followed by the new element. */
+ if (idx > 0)
+ memcpy (new_array, set->elems, sizeof (int) * (idx));
+ /* Copy the elements which follows the new element. */
+ if (set->nelem - idx > 0)
+ memcpy (new_array + idx + 1, set->elems + idx,
+ sizeof (int) * (set->nelem - idx));
+ re_free (set->elems);
+ set->elems = new_array;
+ }
+ else
+ {
+ /* Move the elements which follows the new element. */
+ if (set->nelem - idx > 0)
+ memmove (set->elems + idx + 1, set->elems + idx,
+ sizeof (int) * (set->nelem - idx));
+ }
+ /* Insert the new element. */
+ set->elems[idx] = elem;
+ ++set->nelem;
+ return 1;
+}
+
+/* Compare two node sets SET1 and SET2.
+ return 1 if SET1 and SET2 are equivalent, retrun 0 otherwise. */
+
+static int
+re_node_set_compare (set1, set2)
+ const re_node_set *set1, *set2;
+{
+ int i;
+ if (set1 == NULL || set2 == NULL || set1->nelem != set2->nelem)
+ return 0;
+ for (i = 0 ; i < set1->nelem ; i++)
+ if (set1->elems[i] != set2->elems[i])
+ return 0;
+ return 1;
+}
+
+/* Return (idx + 1) if SET contains the element ELEM, return 0 otherwise. */
+
+static int
+re_node_set_contains (set, elem)
+ const re_node_set *set;
+ int elem;
+{
+ int idx, right, mid;
+ if (set->nelem <= 0)
+ return 0;
+
+ /* Binary search the element. */
+ idx = 0;
+ right = set->nelem - 1;
+ while (idx < right)
+ {
+ mid = (idx + right) / 2;
+ if (set->elems[mid] < elem)
+ idx = mid + 1;
+ else
+ right = mid;
+ }
+ return set->elems[idx] == elem ? idx + 1 : 0;
+}
+
+static void
+re_node_set_remove_at (set, idx)
+ re_node_set *set;
+ int idx;
+{
+ if (idx < 0 || idx >= set->nelem)
+ return;
+ if (idx < set->nelem - 1)
+ memmove (set->elems + idx, set->elems + idx + 1,
+ sizeof (int) * (set->nelem - idx - 1));
+ --set->nelem;
+}
+
+
+/* Add the token TOKEN to dfa->nodes, and return the index of the token.
+ Or return -1, if an error will be occured. */
+
+static int
+re_dfa_add_node (dfa, token, mode)
+ re_dfa_t *dfa;
+ re_token_t token;
+ int mode;
+{
+ if (dfa->nodes_len >= dfa->nodes_alloc)
+ {
+ re_token_t *new_array;
+ dfa->nodes_alloc *= 2;
+ new_array = re_realloc (dfa->nodes, re_token_t, dfa->nodes_alloc);
+ if (BE (new_array == NULL, 0))
+ return -1;
+ else
+ dfa->nodes = new_array;
+ if (mode)
+ {
+ int *new_nexts, *new_indices;
+ re_node_set *new_edests, *new_eclosures, *new_inveclosures;
+
+ new_nexts = re_realloc (dfa->nexts, int, dfa->nodes_alloc);
+ new_indices = re_realloc (dfa->org_indices, int, dfa->nodes_alloc);
+ new_edests = re_realloc (dfa->edests, re_node_set, dfa->nodes_alloc);
+ new_eclosures = re_realloc (dfa->eclosures, re_node_set,
+ dfa->nodes_alloc);
+ new_inveclosures = re_realloc (dfa->inveclosures, re_node_set,
+ dfa->nodes_alloc);
+ if (BE (new_nexts == NULL || new_indices == NULL
+ || new_edests == NULL || new_eclosures == NULL
+ || new_inveclosures == NULL, 0))
+ return -1;
+ dfa->nexts = new_nexts;
+ dfa->org_indices = new_indices;
+ dfa->edests = new_edests;
+ dfa->eclosures = new_eclosures;
+ dfa->inveclosures = new_inveclosures;
+ }
+ }
+ dfa->nodes[dfa->nodes_len] = token;
+ dfa->nodes[dfa->nodes_len].duplicated = 0;
+ dfa->nodes[dfa->nodes_len].constraint = 0;
+ return dfa->nodes_len++;
+}
+
+static unsigned int inline
+calc_state_hash (nodes, context)
+ const re_node_set *nodes;
+ unsigned int context;
+{
+ unsigned int hash = nodes->nelem + context;
+ int i;
+ for (i = 0 ; i < nodes->nelem ; i++)
+ hash += nodes->elems[i];
+ return hash;
+}
+
+/* Search for the state whose node_set is equivalent to NODES.
+ Return the pointer to the state, if we found it in the DFA.
+ Otherwise create the new one and return it. In case of an error
+ return NULL and set the error code in ERR.
+ Note: - We assume NULL as the invalid state, then it is possible that
+ return value is NULL and ERR is REG_NOERROR.
+ - We never return non-NULL value in case of any errors, it is for
+ optimization. */
+
+static re_dfastate_t*
+re_acquire_state (err, dfa, nodes)
+ reg_errcode_t *err;
+ re_dfa_t *dfa;
+ const re_node_set *nodes;
+{
+ unsigned int hash;
+ re_dfastate_t *new_state;
+ struct re_state_table_entry *spot;
+ int i;
+ if (BE (nodes->nelem == 0, 0))
+ {
+ *err = REG_NOERROR;
+ return NULL;
+ }
+ hash = calc_state_hash (nodes, 0);
+ spot = dfa->state_table + (hash & dfa->state_hash_mask);
+
+ for (i = 0 ; i < spot->num ; i++)
+ {
+ re_dfastate_t *state = spot->array[i];
+ if (hash != state->hash)
+ continue;
+ if (re_node_set_compare (&state->nodes, nodes))
+ return state;
+ }
+
+ /* There are no appropriate state in the dfa, create the new one. */
+ new_state = create_ci_newstate (dfa, nodes, hash);
+ if (BE (new_state != NULL, 1))
+ return new_state;
+ else
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+}
+
+/* Search for the state whose node_set is equivalent to NODES and
+ whose context is equivalent to CONTEXT.
+ Return the pointer to the state, if we found it in the DFA.
+ Otherwise create the new one and return it. In case of an error
+ return NULL and set the error code in ERR.
+ Note: - We assume NULL as the invalid state, then it is possible that
+ return value is NULL and ERR is REG_NOERROR.
+ - We never return non-NULL value in case of any errors, it is for
+ optimization. */
+
+static re_dfastate_t*
+re_acquire_state_context (err, dfa, nodes, context)
+ reg_errcode_t *err;
+ re_dfa_t *dfa;
+ const re_node_set *nodes;
+ unsigned int context;
+{
+ unsigned int hash;
+ re_dfastate_t *new_state;
+ struct re_state_table_entry *spot;
+ int i;
+ if (nodes->nelem == 0)
+ {
+ *err = REG_NOERROR;
+ return NULL;
+ }
+ hash = calc_state_hash (nodes, context);
+ spot = dfa->state_table + (hash & dfa->state_hash_mask);
+
+ for (i = 0 ; i < spot->num ; i++)
+ {
+ re_dfastate_t *state = spot->array[i];
+ if (hash != state->hash)
+ continue;
+ if (re_node_set_compare (state->entrance_nodes, nodes)
+ && state->context == context)
+ return state;
+ }
+ /* There are no appropriate state in `dfa', create the new one. */
+ new_state = create_cd_newstate (dfa, nodes, context, hash);
+ if (BE (new_state != NULL, 1))
+ return new_state;
+ else
+ {
+ *err = REG_ESPACE;
+ return NULL;
+ }
+}
+
+/* Allocate memory for DFA state and initialize common properties.
+ Return the new state if succeeded, otherwise return NULL. */
+
+static re_dfastate_t *
+create_newstate_common (dfa, nodes, hash)
+ re_dfa_t *dfa;
+ const re_node_set *nodes;
+ unsigned int hash;
+{
+ re_dfastate_t *newstate;
+ reg_errcode_t err;
+ newstate = (re_dfastate_t *) calloc (sizeof (re_dfastate_t), 1);
+ if (BE (newstate == NULL, 0))
+ return NULL;
+ err = re_node_set_init_copy (&newstate->nodes, nodes);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ re_free (newstate);
+ return NULL;
+ }
+ newstate->trtable = NULL;
+ newstate->trtable_search = NULL;
+ newstate->hash = hash;
+ return newstate;
+}
+
+/* Store the new state NEWSTATE whose hash value is HASH in appropriate
+ position. Return value indicate the error code if failed. */
+
+static reg_errcode_t
+register_state (dfa, newstate, hash)
+ re_dfa_t *dfa;
+ re_dfastate_t *newstate;
+ unsigned int hash;
+{
+ struct re_state_table_entry *spot;
+ spot = dfa->state_table + (hash & dfa->state_hash_mask);
+
+ if (spot->alloc <= spot->num)
+ {
+ re_dfastate_t **new_array;
+ spot->alloc = 2 * spot->num + 2;
+ new_array = re_realloc (spot->array, re_dfastate_t *, spot->alloc);
+ if (BE (new_array == NULL, 0))
+ return REG_ESPACE;
+ spot->array = new_array;
+ }
+ spot->array[spot->num++] = newstate;
+ return REG_NOERROR;
+}
+
+/* Create the new state which is independ of contexts.
+ Return the new state if succeeded, otherwise return NULL. */
+
+static re_dfastate_t *
+create_ci_newstate (dfa, nodes, hash)
+ re_dfa_t *dfa;
+ const re_node_set *nodes;
+ unsigned int hash;
+{
+ int i;
+ reg_errcode_t err;
+ re_dfastate_t *newstate;
+ newstate = create_newstate_common (dfa, nodes, hash);
+ if (BE (newstate == NULL, 0))
+ return NULL;
+ newstate->entrance_nodes = &newstate->nodes;
+
+ for (i = 0 ; i < nodes->nelem ; i++)
+ {
+ re_token_t *node = dfa->nodes + nodes->elems[i];
+ re_token_type_t type = node->type;
+ if (type == CHARACTER && !node->constraint)
+ continue;
+
+ /* If the state has the halt node, the state is a halt state. */
+ else if (type == END_OF_RE)
+ newstate->halt = 1;
+#ifdef RE_ENABLE_I18N
+ else if (type == COMPLEX_BRACKET
+ || (type == OP_PERIOD && re_mb_cur_max > 1))
+ newstate->accept_mb = 1;
+#endif /* RE_ENABLE_I18N */
+ else if (type == OP_BACK_REF)
+ newstate->has_backref = 1;
+ else if (type == ANCHOR || node->constraint)
+ newstate->has_constraint = 1;
+ }
+ err = register_state (dfa, newstate, hash);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ free_state (newstate);
+ newstate = NULL;
+ }
+ return newstate;
+}
+
+/* Create the new state which is depend on the context CONTEXT.
+ Return the new state if succeeded, otherwise return NULL. */
+
+static re_dfastate_t *
+create_cd_newstate (dfa, nodes, context, hash)
+ re_dfa_t *dfa;
+ const re_node_set *nodes;
+ unsigned int context, hash;
+{
+ int i, nctx_nodes = 0;
+ reg_errcode_t err;
+ re_dfastate_t *newstate;
+
+ newstate = create_newstate_common (dfa, nodes, hash);
+ if (BE (newstate == NULL, 0))
+ return NULL;
+ newstate->context = context;
+ newstate->entrance_nodes = &newstate->nodes;
+
+ for (i = 0 ; i < nodes->nelem ; i++)
+ {
+ unsigned int constraint = 0;
+ re_token_t *node = dfa->nodes + nodes->elems[i];
+ re_token_type_t type = node->type;
+ if (node->constraint)
+ constraint = node->constraint;
+
+ if (type == CHARACTER && !constraint)
+ continue;
+ /* If the state has the halt node, the state is a halt state. */
+ else if (type == END_OF_RE)
+ newstate->halt = 1;
+#ifdef RE_ENABLE_I18N
+ else if (type == COMPLEX_BRACKET
+ || (type == OP_PERIOD && re_mb_cur_max > 1))
+ newstate->accept_mb = 1;
+#endif /* RE_ENABLE_I18N */
+ else if (type == OP_BACK_REF)
+ newstate->has_backref = 1;
+ else if (type == ANCHOR)
+ constraint = node->opr.ctx_type;
+
+ if (constraint)
+ {
+ if (newstate->entrance_nodes == &newstate->nodes)
+ {
+ newstate->entrance_nodes = re_malloc (re_node_set, 1);
+ if (BE (newstate->entrance_nodes == NULL, 0))
+ {
+ free_state (newstate);
+ return NULL;
+ }
+ re_node_set_init_copy (newstate->entrance_nodes, nodes);
+ nctx_nodes = 0;
+ newstate->has_constraint = 1;
+ }
+
+ if (NOT_SATISFY_PREV_CONSTRAINT (constraint,context))
+ {
+ re_node_set_remove_at (&newstate->nodes, i - nctx_nodes);
+ ++nctx_nodes;
+ }
+ }
+ }
+ err = register_state (dfa, newstate, hash);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ free_state (newstate);
+ newstate = NULL;
+ }
+ return newstate;
+}
+
+static void
+free_state (state)
+ re_dfastate_t *state;
+{
+ if (state->entrance_nodes != &state->nodes)
+ {
+ re_node_set_free (state->entrance_nodes);
+ re_free (state->entrance_nodes);
+ }
+ re_node_set_free (&state->nodes);
+ re_free (state->trtable);
+ re_free (state->trtable_search);
+ re_free (state);
+}
diff --git a/gnu/dist/gawk/regex_internal.h b/gnu/dist/gawk/regex_internal.h
new file mode 100644
index 00000000000..ec15ba9011b
--- /dev/null
+++ b/gnu/dist/gawk/regex_internal.h
@@ -0,0 +1,755 @@
+/* $NetBSD: regex_internal.h,v 1.1.1.1 2003/10/06 15:47:33 wiz Exp $ */
+
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _REGEX_INTERNAL_H
+#define _REGEX_INTERNAL_H 1
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <assert.h>
+#include <ctype.h>
+#if 0
+/* Don't include this here. On some systems it sets RE_DUP_MAX to a
+ * lower value than GNU regex allows. Instead, include it in
+ * regex.c, before include of <regex.h>, which correctly
+ * #undefs RE_DUP_MAX and sets it to the right value.
+ */
+#include <limits.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if defined HAVE_LOCALE_H || defined _LIBC
+# include <locale.h>
+#endif
+#if defined HAVE_WCHAR_H || defined _LIBC
+# include <wchar.h>
+#endif /* HAVE_WCHAR_H || _LIBC */
+#if defined HAVE_WCTYPE_H || defined _LIBC
+# include <wctype.h>
+#endif /* HAVE_WCTYPE_H || _LIBC */
+
+/* In case that the system doesn't have isblank(). */
+#if !defined _LIBC && !defined HAVE_ISBLANK && !defined isblank
+# define isblank(ch) ((ch) == ' ' || (ch) == '\t')
+#endif
+
+#ifdef _LIBC
+# ifndef _RE_DEFINE_LOCALE_FUNCTIONS
+# define _RE_DEFINE_LOCALE_FUNCTIONS 1
+# include <locale/localeinfo.h>
+# include <locale/elem-hash.h>
+# include <locale/coll-lookup.h>
+# endif
+#endif
+
+/* This is for other GNU distributions with internationalized messages. */
+#if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
+# include <libintl.h>
+# ifdef _LIBC
+# undef gettext
+# define gettext(msgid) \
+ INTUSE(__dcgettext) (INTUSE(_libc_intl_domainname), msgid, LC_MESSAGES)
+# endif
+#else
+# define gettext(msgid) (msgid)
+#endif
+
+#ifndef gettext_noop
+/* This define is so xgettext can find the internationalizable
+ strings. */
+# define gettext_noop(String) String
+#endif
+
+#if (defined MB_CUR_MAX && HAVE_LOCALE_H && HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_WCRTOMB && HAVE_MBRTOWC && HAVE_WCSCOLL) || _LIBC
+# define RE_ENABLE_I18N
+#endif
+
+#if __GNUC__ >= 3
+# define BE(expr, val) __builtin_expect (expr, val)
+#else
+# define BE(expr, val) (expr)
+# define inline
+#endif
+
+/* Number of bits in a byte. */
+#define BYTE_BITS 8
+/* Number of single byte character. */
+#define SBC_MAX 256
+
+#define COLL_ELEM_LEN_MAX 8
+
+/* The character which represents newline. */
+#define NEWLINE_CHAR '\n'
+#define WIDE_NEWLINE_CHAR L'\n'
+
+/* Rename to standard API for using out of glibc. */
+#ifndef _LIBC
+# define __wctype wctype
+# define __iswctype iswctype
+# define __btowc btowc
+# define __wcrtomb wcrtomb
+# define attribute_hidden
+# define __thread
+#endif /* not _LIBC */
+
+#if _LIBC || __GNUC__ >= 3
+# define BE(expr, val) __builtin_expect (expr, val)
+#else
+# define BE(expr, val) (expr)
+# define inline
+#endif
+
+#ifdef RE_ENABLE_I18N
+__thread int re_mb_cur_max = 1;
+#endif
+
+extern const char __re_error_msgid[] attribute_hidden;
+extern const size_t __re_error_msgid_idx[] attribute_hidden;
+
+/* Number of bits in an unsinged int. */
+#define UINT_BITS (sizeof (unsigned int) * BYTE_BITS)
+/* Number of unsigned int in an bit_set. */
+#define BITSET_UINTS ((SBC_MAX + UINT_BITS - 1) / UINT_BITS)
+typedef unsigned int bitset[BITSET_UINTS];
+typedef unsigned int *re_bitset_ptr_t;
+
+#define bitset_set(set,i) (set[i / UINT_BITS] |= 1UL << i % UINT_BITS)
+#define bitset_clear(set,i) (set[i / UINT_BITS] &= ~(1UL << i % UINT_BITS))
+#define bitset_contain(set,i) (set[i / UINT_BITS] & (1UL << i % UINT_BITS))
+#define bitset_empty(set) memset (set, 0, sizeof (unsigned int) * BITSET_UINTS)
+#define bitset_set_all(set) \
+ memset (set, 255, sizeof (unsigned int) * BITSET_UINTS)
+#define bitset_copy(dest,src) \
+ memcpy (dest, src, sizeof (unsigned int) * BITSET_UINTS)
+static inline void bitset_not _RE_ARGS((bitset set));
+static inline void bitset_merge _RE_ARGS((bitset dest, const bitset src));
+static inline void bitset_not_merge _RE_ARGS((bitset dest, const bitset src));
+
+#define PREV_WORD_CONSTRAINT 0x0001
+#define PREV_NOTWORD_CONSTRAINT 0x0002
+#define NEXT_WORD_CONSTRAINT 0x0004
+#define NEXT_NOTWORD_CONSTRAINT 0x0008
+#define PREV_NEWLINE_CONSTRAINT 0x0010
+#define NEXT_NEWLINE_CONSTRAINT 0x0020
+#define PREV_BEGBUF_CONSTRAINT 0x0040
+#define NEXT_ENDBUF_CONSTRAINT 0x0080
+#define DUMMY_CONSTRAINT 0x0100
+
+typedef enum
+{
+ INSIDE_WORD = PREV_WORD_CONSTRAINT | NEXT_WORD_CONSTRAINT,
+ WORD_FIRST = PREV_NOTWORD_CONSTRAINT | NEXT_WORD_CONSTRAINT,
+ WORD_LAST = PREV_WORD_CONSTRAINT | NEXT_NOTWORD_CONSTRAINT,
+ LINE_FIRST = PREV_NEWLINE_CONSTRAINT,
+ LINE_LAST = NEXT_NEWLINE_CONSTRAINT,
+ BUF_FIRST = PREV_BEGBUF_CONSTRAINT,
+ BUF_LAST = NEXT_ENDBUF_CONSTRAINT,
+ WORD_DELIM = DUMMY_CONSTRAINT
+} re_context_type;
+
+typedef struct
+{
+ int alloc;
+ int nelem;
+ int *elems;
+} re_node_set;
+
+typedef enum
+{
+ NON_TYPE = 0,
+
+ /* Token type, these are used only by token. */
+ OP_OPEN_BRACKET,
+ OP_CLOSE_BRACKET,
+ OP_CHARSET_RANGE,
+ OP_OPEN_DUP_NUM,
+ OP_CLOSE_DUP_NUM,
+ OP_NON_MATCH_LIST,
+ OP_OPEN_COLL_ELEM,
+ OP_CLOSE_COLL_ELEM,
+ OP_OPEN_EQUIV_CLASS,
+ OP_CLOSE_EQUIV_CLASS,
+ OP_OPEN_CHAR_CLASS,
+ OP_CLOSE_CHAR_CLASS,
+ OP_WORD,
+ OP_NOTWORD,
+ BACK_SLASH,
+
+ /* Tree type, these are used only by tree. */
+ CONCAT,
+ ALT,
+ SUBEXP,
+ SIMPLE_BRACKET,
+#ifdef RE_ENABLE_I18N
+ COMPLEX_BRACKET,
+#endif /* RE_ENABLE_I18N */
+
+ /* Node type, These are used by token, node, tree. */
+ OP_OPEN_SUBEXP,
+ OP_CLOSE_SUBEXP,
+ OP_PERIOD,
+ CHARACTER,
+ END_OF_RE,
+ OP_ALT,
+ OP_DUP_ASTERISK,
+ OP_DUP_PLUS,
+ OP_DUP_QUESTION,
+ OP_BACK_REF,
+ ANCHOR,
+
+ /* Dummy marker. */
+ END_OF_RE_TOKEN_T
+} re_token_type_t;
+
+#ifdef RE_ENABLE_I18N
+typedef struct
+{
+ /* Multibyte characters. */
+ wchar_t *mbchars;
+
+ /* Collating symbols. */
+# ifdef _LIBC
+ int32_t *coll_syms;
+# endif
+
+ /* Equivalence classes. */
+# ifdef _LIBC
+ int32_t *equiv_classes;
+# endif
+
+ /* Range expressions. */
+# ifdef _LIBC
+ uint32_t *range_starts;
+ uint32_t *range_ends;
+# else /* not _LIBC */
+ wchar_t *range_starts;
+ wchar_t *range_ends;
+# endif /* not _LIBC */
+
+ /* Character classes. */
+ wctype_t *char_classes;
+
+ /* If this character set is the non-matching list. */
+ unsigned int non_match : 1;
+
+ /* # of multibyte characters. */
+ int nmbchars;
+
+ /* # of collating symbols. */
+ int ncoll_syms;
+
+ /* # of equivalence classes. */
+ int nequiv_classes;
+
+ /* # of range expressions. */
+ int nranges;
+
+ /* # of character classes. */
+ int nchar_classes;
+} re_charset_t;
+#endif /* RE_ENABLE_I18N */
+
+typedef struct
+{
+ union
+ {
+ unsigned char c; /* for CHARACTER */
+ re_bitset_ptr_t sbcset; /* for SIMPLE_BRACKET */
+#ifdef RE_ENABLE_I18N
+ re_charset_t *mbcset; /* for COMPLEX_BRACKET */
+#endif /* RE_ENABLE_I18N */
+ int idx; /* for BACK_REF */
+ re_context_type ctx_type; /* for ANCHOR */
+ } opr;
+#if __GNUC__ >= 2
+ re_token_type_t type : 8;
+#else
+ re_token_type_t type;
+#endif
+ unsigned int constraint : 10; /* context constraint */
+ unsigned int duplicated : 1;
+#ifdef RE_ENABLE_I18N
+ unsigned int mb_partial : 1;
+#endif
+} re_token_t;
+
+#define IS_EPSILON_NODE(type) \
+ ((type) == OP_ALT || (type) == OP_DUP_ASTERISK || (type) == OP_DUP_PLUS \
+ || (type) == OP_DUP_QUESTION || (type) == ANCHOR \
+ || (type) == OP_OPEN_SUBEXP || (type) == OP_CLOSE_SUBEXP)
+
+#define ACCEPT_MB_NODE(type) \
+ ((type) == COMPLEX_BRACKET || (type) == OP_PERIOD)
+
+struct re_string_t
+{
+ /* Indicate the raw buffer which is the original string passed as an
+ argument of regexec(), re_search(), etc.. */
+ const unsigned char *raw_mbs;
+ /* Store the multibyte string. In case of "case insensitive mode" like
+ REG_ICASE, upper cases of the string are stored, otherwise MBS points
+ the same address that RAW_MBS points. */
+ unsigned char *mbs;
+ /* Store the case sensitive multibyte string. In case of
+ "case insensitive mode", the original string are stored,
+ otherwise MBS_CASE points the same address that MBS points. */
+ unsigned char *mbs_case;
+#ifdef RE_ENABLE_I18N
+ /* Store the wide character string which is corresponding to MBS. */
+ wint_t *wcs;
+ mbstate_t cur_state;
+#endif
+ /* Index in RAW_MBS. Each character mbs[i] corresponds to
+ raw_mbs[raw_mbs_idx + i]. */
+ int raw_mbs_idx;
+ /* The length of the valid characters in the buffers. */
+ int valid_len;
+ /* The length of the buffers MBS, MBS_CASE, and WCS. */
+ int bufs_len;
+ /* The index in MBS, which is updated by re_string_fetch_byte. */
+ int cur_idx;
+ /* This is length_of_RAW_MBS - RAW_MBS_IDX. */
+ int len;
+ /* End of the buffer may be shorter than its length in the cases such
+ as re_match_2, re_search_2. Then, we use STOP for end of the buffer
+ instead of LEN. */
+ int stop;
+
+ /* The context of mbs[0]. We store the context independently, since
+ the context of mbs[0] may be different from raw_mbs[0], which is
+ the beginning of the input string. */
+ unsigned int tip_context;
+ /* The translation passed as a part of an argument of re_compile_pattern. */
+ RE_TRANSLATE_TYPE trans;
+ /* 1 if REG_ICASE. */
+ unsigned int icase : 1;
+};
+typedef struct re_string_t re_string_t;
+/* In case of REG_ICASE, we allocate the buffer dynamically for mbs. */
+#define MBS_ALLOCATED(pstr) (pstr->icase)
+/* In case that we need translation, we allocate the buffer dynamically
+ for mbs_case. Note that mbs == mbs_case if not REG_ICASE. */
+#define MBS_CASE_ALLOCATED(pstr) (pstr->trans != NULL)
+
+static reg_errcode_t re_string_allocate _RE_ARGS((re_string_t *pstr, const char *str,
+ int len, int init_len,
+ RE_TRANSLATE_TYPE trans, int icase));
+static reg_errcode_t re_string_construct _RE_ARGS((re_string_t *pstr, const char *str, int len,
+ RE_TRANSLATE_TYPE trans, int icase));
+static reg_errcode_t re_string_reconstruct _RE_ARGS((re_string_t *pstr, int idx,
+ int eflags, int newline));
+static reg_errcode_t re_string_realloc_buffers _RE_ARGS((re_string_t *pstr, int new_buf_len));
+#ifdef RE_ENABLE_I18N
+static void build_wcs_buffer _RE_ARGS((re_string_t *pstr));
+static void build_wcs_upper_buffer _RE_ARGS((re_string_t *pstr));
+#endif /* RE_ENABLE_I18N */
+static void build_upper_buffer _RE_ARGS((re_string_t *pstr));
+static void re_string_translate_buffer _RE_ARGS((re_string_t *pstr));
+static void re_string_destruct _RE_ARGS((re_string_t *pstr));
+#ifdef RE_ENABLE_I18N
+static int re_string_elem_size_at _RE_ARGS((const re_string_t *pstr, int idx));
+static inline int re_string_char_size_at _RE_ARGS((const re_string_t *pstr, int idx));
+static inline wint_t re_string_wchar_at _RE_ARGS((const re_string_t *pstr, int idx));
+#endif /* RE_ENABLE_I18N */
+static unsigned int re_string_context_at _RE_ARGS((const re_string_t *input, int idx,
+ int eflags, int newline_anchor));
+#define re_string_peek_byte(pstr, offset) \
+ ((pstr)->mbs[(pstr)->cur_idx + offset])
+#define re_string_peek_byte_case(pstr, offset) \
+ ((pstr)->mbs_case[(pstr)->cur_idx + offset])
+#define re_string_fetch_byte(pstr) \
+ ((pstr)->mbs[(pstr)->cur_idx++])
+#define re_string_fetch_byte_case(pstr) \
+ ((pstr)->mbs_case[(pstr)->cur_idx++])
+#define re_string_first_byte(pstr, idx) \
+ ((idx) == (pstr)->len || (pstr)->wcs[idx] != WEOF)
+#define re_string_is_single_byte_char(pstr, idx) \
+ ((pstr)->wcs[idx] != WEOF && ((pstr)->len == (idx) \
+ || (pstr)->wcs[(idx) + 1] != WEOF))
+#define re_string_eoi(pstr) ((pstr)->stop <= (pstr)->cur_idx)
+#define re_string_cur_idx(pstr) ((pstr)->cur_idx)
+#define re_string_get_buffer(pstr) ((pstr)->mbs)
+#define re_string_length(pstr) ((pstr)->len)
+#define re_string_byte_at(pstr,idx) ((pstr)->mbs[idx])
+#define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx))
+#define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx))
+
+#define re_malloc(t,n) ((t *) malloc ((n) * sizeof (t)))
+#define re_realloc(p,t,n) ((t *) realloc (p, (n) * sizeof (t)))
+#define re_free(p) free (p)
+
+struct bin_tree_t
+{
+ struct bin_tree_t *parent;
+ struct bin_tree_t *left;
+ struct bin_tree_t *right;
+
+ /* `node_idx' is the index in dfa->nodes, if `type' == 0.
+ Otherwise `type' indicate the type of this node. */
+ re_token_type_t type;
+ int node_idx;
+
+ int first;
+ int next;
+ re_node_set eclosure;
+};
+typedef struct bin_tree_t bin_tree_t;
+
+
+#define CONTEXT_WORD 1
+#define CONTEXT_NEWLINE (CONTEXT_WORD << 1)
+#define CONTEXT_BEGBUF (CONTEXT_NEWLINE << 1)
+#define CONTEXT_ENDBUF (CONTEXT_BEGBUF << 1)
+
+#define IS_WORD_CONTEXT(c) ((c) & CONTEXT_WORD)
+#define IS_NEWLINE_CONTEXT(c) ((c) & CONTEXT_NEWLINE)
+#define IS_BEGBUF_CONTEXT(c) ((c) & CONTEXT_BEGBUF)
+#define IS_ENDBUF_CONTEXT(c) ((c) & CONTEXT_ENDBUF)
+#define IS_ORDINARY_CONTEXT(c) ((c) == 0)
+
+#define IS_WORD_CHAR(ch) (isalnum (ch) || (ch) == '_')
+#define IS_NEWLINE(ch) ((ch) == NEWLINE_CHAR)
+#define IS_WIDE_WORD_CHAR(ch) (iswalnum (ch) || (ch) == L'_')
+#define IS_WIDE_NEWLINE(ch) ((ch) == WIDE_NEWLINE_CHAR)
+
+#define NOT_SATISFY_PREV_CONSTRAINT(constraint,context) \
+ ((((constraint) & PREV_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \
+ || ((constraint & PREV_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \
+ || ((constraint & PREV_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context))\
+ || ((constraint & PREV_BEGBUF_CONSTRAINT) && !IS_BEGBUF_CONTEXT (context)))
+
+#define NOT_SATISFY_NEXT_CONSTRAINT(constraint,context) \
+ ((((constraint) & NEXT_WORD_CONSTRAINT) && !IS_WORD_CONTEXT (context)) \
+ || (((constraint) & NEXT_NOTWORD_CONSTRAINT) && IS_WORD_CONTEXT (context)) \
+ || (((constraint) & NEXT_NEWLINE_CONSTRAINT) && !IS_NEWLINE_CONTEXT (context)) \
+ || (((constraint) & NEXT_ENDBUF_CONSTRAINT) && !IS_ENDBUF_CONTEXT (context)))
+
+struct re_dfastate_t
+{
+ unsigned int hash;
+ re_node_set nodes;
+ re_node_set *entrance_nodes;
+ struct re_dfastate_t **trtable;
+ struct re_dfastate_t **trtable_search;
+ /* If this state is a special state.
+ A state is a special state if the state is the halt state, or
+ a anchor. */
+ unsigned int context : 2;
+ unsigned int halt : 1;
+ /* If this state can accept `multi byte'.
+ Note that we refer to multibyte characters, and multi character
+ collating elements as `multi byte'. */
+ unsigned int accept_mb : 1;
+ /* If this state has backreference node(s). */
+ unsigned int has_backref : 1;
+ unsigned int has_constraint : 1;
+};
+typedef struct re_dfastate_t re_dfastate_t;
+
+typedef struct
+{
+ /* start <= node < end */
+ int start;
+ int end;
+} re_subexp_t;
+
+struct re_state_table_entry
+{
+ int num;
+ int alloc;
+ re_dfastate_t **array;
+};
+
+/* Array type used in re_sub_match_last_t and re_sub_match_top_t. */
+
+typedef struct
+{
+ int next_idx;
+ int alloc;
+ re_dfastate_t **array;
+} state_array_t;
+
+/* Store information about the node NODE whose type is OP_CLOSE_SUBEXP. */
+
+typedef struct
+{
+ int node;
+ int str_idx; /* The position NODE match at. */
+ state_array_t path;
+} re_sub_match_last_t;
+
+/* Store information about the node NODE whose type is OP_OPEN_SUBEXP.
+ And information about the node, whose type is OP_CLOSE_SUBEXP,
+ corresponding to NODE is stored in LASTS. */
+
+typedef struct
+{
+ int str_idx;
+ int node;
+ int next_last_offset;
+ state_array_t *path;
+ int alasts; /* Allocation size of LASTS. */
+ int nlasts; /* The number of LASTS. */
+ re_sub_match_last_t **lasts;
+} re_sub_match_top_t;
+
+struct re_backref_cache_entry
+{
+ int node;
+ int str_idx;
+ int subexp_from;
+ int subexp_to;
+ int flag;
+};
+
+typedef struct
+{
+ /* EFLAGS of the argument of regexec. */
+ int eflags;
+ /* Where the matching ends. */
+ int match_last;
+ int last_node;
+ /* The string object corresponding to the input string. */
+ re_string_t *input;
+ /* The state log used by the matcher. */
+ re_dfastate_t **state_log;
+ int state_log_top;
+ /* Back reference cache. */
+ int nbkref_ents;
+ int abkref_ents;
+ struct re_backref_cache_entry *bkref_ents;
+ int max_mb_elem_len;
+ int nsub_tops;
+ int asub_tops;
+ re_sub_match_top_t **sub_tops;
+} re_match_context_t;
+
+typedef struct
+{
+ int cur_bkref;
+ int cls_subexp_idx;
+
+ re_dfastate_t **sifted_states;
+ re_dfastate_t **limited_states;
+
+ re_node_set limits;
+
+ int last_node;
+ int last_str_idx;
+ int check_subexp;
+} re_sift_context_t;
+
+struct re_fail_stack_ent_t
+{
+ int idx;
+ int node;
+ regmatch_t *regs;
+ re_node_set eps_via_nodes;
+};
+
+struct re_fail_stack_t
+{
+ int num;
+ int alloc;
+ struct re_fail_stack_ent_t *stack;
+};
+
+struct re_dfa_t
+{
+ re_bitset_ptr_t word_char;
+
+ /* number of subexpressions `re_nsub' is in regex_t. */
+ int subexps_alloc;
+ re_subexp_t *subexps;
+
+ re_token_t *nodes;
+ int nodes_alloc;
+ int nodes_len;
+ bin_tree_t *str_tree;
+ int *nexts;
+ int *org_indices;
+ re_node_set *edests;
+ re_node_set *eclosures;
+ re_node_set *inveclosures;
+ struct re_state_table_entry *state_table;
+ unsigned int state_hash_mask;
+ re_dfastate_t *init_state;
+ re_dfastate_t *init_state_word;
+ re_dfastate_t *init_state_nl;
+ re_dfastate_t *init_state_begbuf;
+ int states_alloc;
+ int init_node;
+ int nbackref; /* The number of backreference in this dfa. */
+ /* Bitmap expressing which backreference is used. */
+ unsigned int used_bkref_map;
+#ifdef DEBUG
+ char* re_str;
+#endif
+ unsigned int has_plural_match : 1;
+ /* If this dfa has "multibyte node", which is a backreference or
+ a node which can accept multibyte character or multi character
+ collating element. */
+ unsigned int has_mb_node : 1;
+};
+typedef struct re_dfa_t re_dfa_t;
+
+static reg_errcode_t re_node_set_alloc _RE_ARGS((re_node_set *set, int size));
+static reg_errcode_t re_node_set_init_1 _RE_ARGS((re_node_set *set, int elem));
+static reg_errcode_t re_node_set_init_2 _RE_ARGS((re_node_set *set, int elem1, int elem2));
+#define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set))
+static reg_errcode_t re_node_set_init_copy _RE_ARGS((re_node_set *dest,
+ const re_node_set *src));
+static reg_errcode_t re_node_set_add_intersect _RE_ARGS((re_node_set *dest,
+ const re_node_set *src1,
+ const re_node_set *src2));
+static reg_errcode_t re_node_set_init_union _RE_ARGS((re_node_set *dest,
+ const re_node_set *src1,
+ const re_node_set *src2));
+static reg_errcode_t re_node_set_merge _RE_ARGS((re_node_set *dest, const re_node_set *src));
+static int re_node_set_insert _RE_ARGS((re_node_set *set, int elem));
+static int re_node_set_compare _RE_ARGS((const re_node_set *set1, const re_node_set *set2));
+static int re_node_set_contains _RE_ARGS((const re_node_set *set, int elem));
+static void re_node_set_remove_at _RE_ARGS((re_node_set *set, int idx));
+#define re_node_set_remove(set,id) \
+ (re_node_set_remove_at (set, re_node_set_contains (set, id) - 1))
+#define re_node_set_empty(p) ((p)->nelem = 0)
+#define re_node_set_free(set) re_free ((set)->elems)
+static int re_dfa_add_node _RE_ARGS((re_dfa_t *dfa, re_token_t token, int mode));
+static re_dfastate_t *re_acquire_state _RE_ARGS((reg_errcode_t *err, re_dfa_t *dfa,
+ const re_node_set *nodes));
+static re_dfastate_t *re_acquire_state_context _RE_ARGS((reg_errcode_t *err, re_dfa_t *dfa,
+ const re_node_set *nodes,
+ unsigned int context));
+static void free_state _RE_ARGS((re_dfastate_t *state));
+
+
+typedef enum
+{
+ SB_CHAR,
+ MB_CHAR,
+ EQUIV_CLASS,
+ COLL_SYM,
+ CHAR_CLASS
+} bracket_elem_type;
+
+typedef struct
+{
+ bracket_elem_type type;
+ union
+ {
+ unsigned char ch;
+ unsigned char *name;
+ wchar_t wch;
+ } opr;
+} bracket_elem_t;
+
+
+/* Inline functions for bitset operation. */
+static inline void
+bitset_not (set)
+ bitset set;
+{
+ int bitset_i;
+ for (bitset_i = 0; bitset_i < BITSET_UINTS; ++bitset_i)
+ set[bitset_i] = ~set[bitset_i];
+}
+
+static inline void
+bitset_merge (dest, src)
+ bitset dest;
+ const bitset src;
+{
+ int bitset_i;
+ for (bitset_i = 0; bitset_i < BITSET_UINTS; ++bitset_i)
+ dest[bitset_i] |= src[bitset_i];
+}
+
+static inline void
+bitset_not_merge (dest, src)
+ bitset dest;
+ const bitset src;
+{
+ int i;
+ for (i = 0; i < BITSET_UINTS; ++i)
+ dest[i] |= ~src[i];
+}
+
+#ifdef RE_ENABLE_I18N
+/* Inline functions for re_string. */
+static inline int
+re_string_char_size_at (pstr, idx)
+ const re_string_t *pstr;
+ int idx;
+{
+ int byte_idx;
+ if (re_mb_cur_max == 1)
+ return 1;
+ for (byte_idx = 1; idx + byte_idx < pstr->len; ++byte_idx)
+ if (pstr->wcs[idx + byte_idx] != WEOF)
+ break;
+ return byte_idx;
+}
+
+static inline wint_t
+re_string_wchar_at (pstr, idx)
+ const re_string_t *pstr;
+ int idx;
+{
+ if (re_mb_cur_max == 1)
+ return (wint_t) pstr->mbs[idx];
+ return (wint_t) pstr->wcs[idx];
+}
+
+static int
+re_string_elem_size_at (pstr, idx)
+ const re_string_t *pstr;
+ int idx;
+{
+#ifdef _LIBC
+ const unsigned char *p, *extra;
+ const int32_t *table, *indirect;
+ int32_t tmp;
+# include <locale/weight.h>
+ uint_fast32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+
+ if (nrules != 0)
+ {
+ table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
+ extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
+ indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_INDIRECTMB);
+ p = pstr->mbs + idx;
+ tmp = findidx (&p);
+ return p - pstr->mbs - idx;
+ }
+ else
+#endif /* _LIBC */
+ return 1;
+}
+#endif /* RE_ENABLE_I18N */
+
+#endif /* _REGEX_INTERNAL_H */
diff --git a/gnu/dist/gawk/regexec.c b/gnu/dist/gawk/regexec.c
new file mode 100644
index 00000000000..b4b768583c7
--- /dev/null
+++ b/gnu/dist/gawk/regexec.c
@@ -0,0 +1,3985 @@
+/* $NetBSD: regexec.c,v 1.1.1.1 2003/10/06 15:47:52 wiz Exp $ */
+
+/* Extended regular expression matching and search library.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+static reg_errcode_t match_ctx_init _RE_ARGS((re_match_context_t *cache, int eflags,
+ re_string_t *input, int n));
+static void match_ctx_clean _RE_ARGS((re_match_context_t *mctx));
+static void match_ctx_free _RE_ARGS((re_match_context_t *cache));
+static void match_ctx_free_subtops _RE_ARGS((re_match_context_t *mctx));
+static reg_errcode_t match_ctx_add_entry _RE_ARGS((re_match_context_t *cache, int node,
+ int str_idx, int from, int to));
+static int search_cur_bkref_entry _RE_ARGS((re_match_context_t *mctx, int str_idx));
+static void match_ctx_clear_flag _RE_ARGS((re_match_context_t *mctx));
+static reg_errcode_t match_ctx_add_subtop _RE_ARGS((re_match_context_t *mctx, int node,
+ int str_idx));
+static re_sub_match_last_t * match_ctx_add_sublast _RE_ARGS((re_sub_match_top_t *subtop,
+ int node, int str_idx));
+static void sift_ctx_init _RE_ARGS((re_sift_context_t *sctx, re_dfastate_t **sifted_sts,
+ re_dfastate_t **limited_sts, int last_node,
+ int last_str_idx, int check_subexp));
+static reg_errcode_t re_search_internal _RE_ARGS((const regex_t *preg,
+ const char *string, int length,
+ int start, int range, int stop,
+ size_t nmatch, regmatch_t pmatch[],
+ int eflags));
+static int re_search_2_stub _RE_ARGS((struct re_pattern_buffer *bufp,
+ const char *string1, int length1,
+ const char *string2, int length2,
+ int start, int range, struct re_registers *regs,
+ int stop, int ret_len));
+static int re_search_stub _RE_ARGS((struct re_pattern_buffer *bufp,
+ const char *string, int length, int start,
+ int range, int stop, struct re_registers *regs,
+ int ret_len));
+static unsigned re_copy_regs _RE_ARGS((struct re_registers *regs, regmatch_t *pmatch,
+ int nregs, int regs_allocated));
+static inline re_dfastate_t *acquire_init_state_context _RE_ARGS((reg_errcode_t *err,
+ const regex_t *preg,
+ const re_match_context_t *mctx,
+ int idx));
+static reg_errcode_t prune_impossible_nodes _RE_ARGS((const regex_t *preg,
+ re_match_context_t *mctx));
+static int check_matching _RE_ARGS((const regex_t *preg, re_match_context_t *mctx,
+ int fl_search, int fl_longest_match));
+static int check_halt_node_context _RE_ARGS((const re_dfa_t *dfa, int node,
+ unsigned int context));
+static int check_halt_state_context _RE_ARGS((const regex_t *preg,
+ const re_dfastate_t *state,
+ const re_match_context_t *mctx, int idx));
+static void update_regs _RE_ARGS((re_dfa_t *dfa, regmatch_t *pmatch, int cur_node,
+ int cur_idx, int nmatch));
+static int proceed_next_node _RE_ARGS((const regex_t *preg, int nregs, regmatch_t *regs,
+ const re_match_context_t *mctx,
+ int *pidx, int node, re_node_set *eps_via_nodes,
+ struct re_fail_stack_t *fs));
+static reg_errcode_t push_fail_stack _RE_ARGS((struct re_fail_stack_t *fs,
+ int str_idx, int *dests, int nregs,
+ regmatch_t *regs,
+ re_node_set *eps_via_nodes));
+static int pop_fail_stack _RE_ARGS((struct re_fail_stack_t *fs, int *pidx, int nregs,
+ regmatch_t *regs, re_node_set *eps_via_nodes));
+static reg_errcode_t set_regs _RE_ARGS((const regex_t *preg,
+ const re_match_context_t *mctx,
+ size_t nmatch, regmatch_t *pmatch,
+ int fl_backtrack));
+static reg_errcode_t free_fail_stack_return _RE_ARGS((struct re_fail_stack_t *fs));
+
+#ifdef RE_ENABLE_I18N
+static int sift_states_iter_mb _RE_ARGS((const regex_t *preg,
+ const re_match_context_t *mctx,
+ re_sift_context_t *sctx,
+ int node_idx, int str_idx, int max_str_idx));
+#endif /* RE_ENABLE_I18N */
+static reg_errcode_t sift_states_backward _RE_ARGS((const regex_t *preg,
+ re_match_context_t *mctx,
+ re_sift_context_t *sctx));
+static reg_errcode_t update_cur_sifted_state _RE_ARGS((const regex_t *preg,
+ re_match_context_t *mctx,
+ re_sift_context_t *sctx,
+ int str_idx,
+ re_node_set *dest_nodes));
+static reg_errcode_t add_epsilon_src_nodes _RE_ARGS((re_dfa_t *dfa,
+ re_node_set *dest_nodes,
+ const re_node_set *candidates));
+static reg_errcode_t sub_epsilon_src_nodes _RE_ARGS((re_dfa_t *dfa, int node,
+ re_node_set *dest_nodes,
+ const re_node_set *and_nodes));
+static int check_dst_limits _RE_ARGS((re_dfa_t *dfa, re_node_set *limits,
+ re_match_context_t *mctx, int dst_node,
+ int dst_idx, int src_node, int src_idx));
+static int check_dst_limits_calc_pos _RE_ARGS((re_dfa_t *dfa, re_match_context_t *mctx,
+ int limit, re_node_set *eclosures,
+ int subexp_idx, int node, int str_idx));
+static reg_errcode_t check_subexp_limits _RE_ARGS((re_dfa_t *dfa,
+ re_node_set *dest_nodes,
+ const re_node_set *candidates,
+ re_node_set *limits,
+ struct re_backref_cache_entry *bkref_ents,
+ int str_idx));
+static reg_errcode_t sift_states_bkref _RE_ARGS((const regex_t *preg,
+ re_match_context_t *mctx,
+ re_sift_context_t *sctx,
+ int str_idx, re_node_set *dest_nodes));
+static reg_errcode_t clean_state_log_if_need _RE_ARGS((re_match_context_t *mctx,
+ int next_state_log_idx));
+static reg_errcode_t merge_state_array _RE_ARGS((re_dfa_t *dfa, re_dfastate_t **dst,
+ re_dfastate_t **src, int num));
+static re_dfastate_t *transit_state _RE_ARGS((reg_errcode_t *err, const regex_t *preg,
+ re_match_context_t *mctx,
+ re_dfastate_t *state, int fl_search));
+static reg_errcode_t check_subexp_matching_top _RE_ARGS((re_dfa_t *dfa,
+ re_match_context_t *mctx,
+ re_node_set *cur_nodes,
+ int str_idx));
+static re_dfastate_t *transit_state_sb _RE_ARGS((reg_errcode_t *err, const regex_t *preg,
+ re_dfastate_t *pstate,
+ int fl_search,
+ re_match_context_t *mctx));
+#ifdef RE_ENABLE_I18N
+static reg_errcode_t transit_state_mb _RE_ARGS((const regex_t *preg,
+ re_dfastate_t *pstate,
+ re_match_context_t *mctx));
+#endif /* RE_ENABLE_I18N */
+static reg_errcode_t transit_state_bkref _RE_ARGS((const regex_t *preg,
+ re_node_set *nodes,
+ re_match_context_t *mctx));
+static reg_errcode_t get_subexp _RE_ARGS((const regex_t *preg, re_match_context_t *mctx,
+ int bkref_node, int bkref_str_idx));
+static reg_errcode_t get_subexp_sub _RE_ARGS((const regex_t *preg,
+ re_match_context_t *mctx,
+ re_sub_match_top_t *sub_top,
+ re_sub_match_last_t *sub_last,
+ int bkref_node, int bkref_str));
+static int find_subexp_node _RE_ARGS((re_dfa_t *dfa, re_node_set *nodes,
+ int subexp_idx, int fl_open));
+static reg_errcode_t check_arrival _RE_ARGS((const regex_t *preg,
+ re_match_context_t *mctx,
+ state_array_t *path, int top_node,
+ int top_str, int last_node, int last_str,
+ int fl_open));
+static reg_errcode_t check_arrival_add_next_nodes _RE_ARGS((const regex_t *preg,
+ re_dfa_t *dfa,
+ re_match_context_t *mctx,
+ int str_idx,
+ re_node_set *cur_nodes,
+ re_node_set *next_nodes));
+static reg_errcode_t check_arrival_expand_ecl _RE_ARGS((re_dfa_t *dfa,
+ re_node_set *cur_nodes,
+ int ex_subexp, int fl_open));
+static reg_errcode_t check_arrival_expand_ecl_sub _RE_ARGS((re_dfa_t *dfa,
+ re_node_set *dst_nodes,
+ int target, int ex_subexp,
+ int fl_open));
+static reg_errcode_t expand_bkref_cache _RE_ARGS((const regex_t *preg,
+ re_match_context_t *mctx,
+ re_node_set *cur_nodes, int cur_str,
+ int last_str, int subexp_num,
+ int fl_open));
+static re_dfastate_t **build_trtable _RE_ARGS((const regex_t *dfa,
+ const re_dfastate_t *state,
+ int fl_search));
+#ifdef RE_ENABLE_I18N
+static int check_node_accept_bytes _RE_ARGS((const regex_t *preg, int node_idx,
+ const re_string_t *input, int idx));
+# ifdef _LIBC
+static unsigned int find_collation_sequence_value _RE_ARGS((const unsigned char *mbs,
+ size_t name_len));
+# endif /* _LIBC */
+#endif /* RE_ENABLE_I18N */
+static int group_nodes_into_DFAstates _RE_ARGS((const regex_t *dfa,
+ const re_dfastate_t *state,
+ re_node_set *states_node,
+ bitset *states_ch));
+static int check_node_accept _RE_ARGS((const regex_t *preg, const re_token_t *node,
+ const re_match_context_t *mctx, int idx));
+static reg_errcode_t extend_buffers _RE_ARGS((re_match_context_t *mctx));
+
+/* Entry point for POSIX code. */
+
+/* regexec searches for a given pattern, specified by PREG, in the
+ string STRING.
+
+ If NMATCH is zero or REG_NOSUB was set in the cflags argument to
+ `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
+ least NMATCH elements, and we set them to the offsets of the
+ corresponding matched substrings.
+
+ EFLAGS specifies `execution flags' which affect matching: if
+ REG_NOTBOL is set, then ^ does not match at the beginning of the
+ string; if REG_NOTEOL is set, then $ does not match at the end.
+
+ We return 0 if we find a match and REG_NOMATCH if not. */
+
+int
+regexec (preg, string, nmatch, pmatch, eflags)
+ const regex_t *__restrict preg;
+ const char *__restrict string;
+ size_t nmatch;
+ regmatch_t pmatch[];
+ int eflags;
+{
+ reg_errcode_t err;
+ int length = strlen (string);
+ if (preg->no_sub)
+ err = re_search_internal (preg, string, length, 0, length, length, 0,
+ NULL, eflags);
+ else
+ err = re_search_internal (preg, string, length, 0, length, length, nmatch,
+ pmatch, eflags);
+ return err != REG_NOERROR;
+}
+#ifdef _LIBC
+weak_alias (__regexec, regexec)
+#endif
+
+/* Entry points for GNU code. */
+
+/* re_match, re_search, re_match_2, re_search_2
+
+ The former two functions operate on STRING with length LENGTH,
+ while the later two operate on concatenation of STRING1 and STRING2
+ with lengths LENGTH1 and LENGTH2, respectively.
+
+ re_match() matches the compiled pattern in BUFP against the string,
+ starting at index START.
+
+ re_search() first tries matching at index START, then it tries to match
+ starting from index START + 1, and so on. The last start position tried
+ is START + RANGE. (Thus RANGE = 0 forces re_search to operate the same
+ way as re_match().)
+
+ The parameter STOP of re_{match,search}_2 specifies that no match exceeding
+ the first STOP characters of the concatenation of the strings should be
+ concerned.
+
+ If REGS is not NULL, and BUFP->no_sub is not set, the offsets of the match
+ and all groups is stroed in REGS. (For the "_2" variants, the offsets are
+ computed relative to the concatenation, not relative to the individual
+ strings.)
+
+ On success, re_match* functions return the length of the match, re_search*
+ return the position of the start of the match. Return value -1 means no
+ match was found and -2 indicates an internal error. */
+
+int
+re_match (bufp, string, length, start, regs)
+ struct re_pattern_buffer *bufp;
+ const char *string;
+ int length, start;
+ struct re_registers *regs;
+{
+ return re_search_stub (bufp, string, length, start, 0, length, regs, 1);
+}
+#ifdef _LIBC
+weak_alias (__re_match, re_match)
+#endif
+
+int
+re_search (bufp, string, length, start, range, regs)
+ struct re_pattern_buffer *bufp;
+ const char *string;
+ int length, start, range;
+ struct re_registers *regs;
+{
+ return re_search_stub (bufp, string, length, start, range, length, regs, 0);
+}
+#ifdef _LIBC
+weak_alias (__re_search, re_search)
+#endif
+
+int
+re_match_2 (bufp, string1, length1, string2, length2, start, regs, stop)
+ struct re_pattern_buffer *bufp;
+ const char *string1, *string2;
+ int length1, length2, start, stop;
+ struct re_registers *regs;
+{
+ return re_search_2_stub (bufp, string1, length1, string2, length2,
+ start, 0, regs, stop, 1);
+}
+#ifdef _LIBC
+weak_alias (__re_match_2, re_match_2)
+#endif
+
+int
+re_search_2 (bufp, string1, length1, string2, length2, start, range, regs, stop)
+ struct re_pattern_buffer *bufp;
+ const char *string1, *string2;
+ int length1, length2, start, range, stop;
+ struct re_registers *regs;
+{
+ return re_search_2_stub (bufp, string1, length1, string2, length2,
+ start, range, regs, stop, 0);
+}
+#ifdef _LIBC
+weak_alias (__re_search_2, re_search_2)
+#endif
+
+static int
+re_search_2_stub (bufp, string1, length1, string2, length2, start, range, regs,
+ stop, ret_len)
+ struct re_pattern_buffer *bufp;
+ const char *string1, *string2;
+ int length1, length2, start, range, stop, ret_len;
+ struct re_registers *regs;
+{
+ const char *str;
+ int rval;
+ int len = length1 + length2;
+ int free_str = 0;
+
+ if (BE (length1 < 0 || length2 < 0 || stop < 0, 0))
+ return -2;
+
+ /* Concatenate the strings. */
+ if (length2 > 0)
+ if (length1 > 0)
+ {
+ char *s = re_malloc (char, len);
+
+ if (BE (s == NULL, 0))
+ return -2;
+ memcpy (s, string1, length1);
+ memcpy (s + length1, string2, length2);
+ str = s;
+ free_str = 1;
+ }
+ else
+ str = string2;
+ else
+ str = string1;
+
+ rval = re_search_stub (bufp, str, len, start, range, stop, regs,
+ ret_len);
+ if (free_str)
+ re_free ((char *) str);
+ return rval;
+}
+
+/* The parameters have the same meaning as those of re_search.
+ Additional parameters:
+ If RET_LEN is nonzero the length of the match is returned (re_match style);
+ otherwise the position of the match is returned. */
+
+static int
+re_search_stub (bufp, string, length, start, range, stop, regs, ret_len)
+ struct re_pattern_buffer *bufp;
+ const char *string;
+ int length, start, range, stop, ret_len;
+ struct re_registers *regs;
+{
+ reg_errcode_t result;
+ regmatch_t *pmatch;
+ int nregs, rval;
+ int eflags = 0;
+
+ /* Check for out-of-range. */
+ if (BE (start < 0 || start > length, 0))
+ return -1;
+ if (BE (start + range > length, 0))
+ range = length - start;
+ else if (BE (start + range < 0, 0))
+ range = -start;
+
+ eflags |= (bufp->not_bol) ? REG_NOTBOL : 0;
+ eflags |= (bufp->not_eol) ? REG_NOTEOL : 0;
+
+ /* Compile fastmap if we haven't yet. */
+ if (range > 0 && bufp->fastmap != NULL && !bufp->fastmap_accurate)
+ re_compile_fastmap (bufp);
+
+ if (BE (bufp->no_sub, 0))
+ regs = NULL;
+
+ /* We need at least 1 register. */
+ if (regs == NULL)
+ nregs = 1;
+ else if (BE (bufp->regs_allocated == REGS_FIXED &&
+ regs->num_regs < bufp->re_nsub + 1, 0))
+ {
+ nregs = regs->num_regs;
+ if (BE (nregs < 1, 0))
+ {
+ /* Nothing can be copied to regs. */
+ regs = NULL;
+ nregs = 1;
+ }
+ }
+ else
+ nregs = bufp->re_nsub + 1;
+ pmatch = re_malloc (regmatch_t, nregs);
+ if (BE (pmatch == NULL, 0))
+ return -2;
+
+ result = re_search_internal (bufp, string, length, start, range, stop,
+ nregs, pmatch, eflags);
+
+ rval = 0;
+
+ /* I hope we needn't fill ther regs with -1's when no match was found. */
+ if (result != REG_NOERROR)
+ rval = -1;
+ else if (regs != NULL)
+ {
+ /* If caller wants register contents data back, copy them. */
+ bufp->regs_allocated = re_copy_regs (regs, pmatch, nregs,
+ bufp->regs_allocated);
+ if (BE (bufp->regs_allocated == REGS_UNALLOCATED, 0))
+ rval = -2;
+ }
+
+ if (BE (rval == 0, 1))
+ {
+ if (ret_len)
+ {
+ assert (pmatch[0].rm_so == start);
+ rval = pmatch[0].rm_eo - start;
+ }
+ else
+ rval = pmatch[0].rm_so;
+ }
+ re_free (pmatch);
+ return rval;
+}
+
+static unsigned
+re_copy_regs (regs, pmatch, nregs, regs_allocated)
+ struct re_registers *regs;
+ regmatch_t *pmatch;
+ int nregs, regs_allocated;
+{
+ int rval = REGS_REALLOCATE;
+ int i;
+ int need_regs = nregs + 1;
+ /* We need one extra element beyond `num_regs' for the `-1' marker GNU code
+ uses. */
+
+ /* Have the register data arrays been allocated? */
+ if (regs_allocated == REGS_UNALLOCATED)
+ { /* No. So allocate them with malloc. */
+ regs->start = re_malloc (regoff_t, need_regs);
+ if (BE (regs->start == NULL, 0))
+ return REGS_UNALLOCATED;
+ regs->end = re_malloc (regoff_t, need_regs);
+ if (BE (regs->end == NULL, 0))
+ {
+ re_free (regs->start);
+ return REGS_UNALLOCATED;
+ }
+ regs->num_regs = need_regs;
+ }
+ else if (regs_allocated == REGS_REALLOCATE)
+ { /* Yes. If we need more elements than were already
+ allocated, reallocate them. If we need fewer, just
+ leave it alone. */
+ if (need_regs > regs->num_regs)
+ {
+ regs->start = re_realloc (regs->start, regoff_t, need_regs);
+ if (BE (regs->start == NULL, 0))
+ {
+ if (regs->end != NULL)
+ re_free (regs->end);
+ return REGS_UNALLOCATED;
+ }
+ regs->end = re_realloc (regs->end, regoff_t, need_regs);
+ if (BE (regs->end == NULL, 0))
+ {
+ re_free (regs->start);
+ return REGS_UNALLOCATED;
+ }
+ regs->num_regs = need_regs;
+ }
+ }
+ else
+ {
+ assert (regs_allocated == REGS_FIXED);
+ /* This function may not be called with REGS_FIXED and nregs too big. */
+ assert (regs->num_regs >= nregs);
+ rval = REGS_FIXED;
+ }
+
+ /* Copy the regs. */
+ for (i = 0; i < nregs; ++i)
+ {
+ regs->start[i] = pmatch[i].rm_so;
+ regs->end[i] = pmatch[i].rm_eo;
+ }
+ for ( ; i < regs->num_regs; ++i)
+ regs->start[i] = regs->end[i] = -1;
+
+ return rval;
+}
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use
+ this memory for recording register information. STARTS and ENDS
+ must be allocated using the malloc library routine, and must each
+ be at least NUM_REGS * sizeof (regoff_t) bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ PATTERN_BUFFER will allocate its own register data, without
+ freeing the old data. */
+
+void
+re_set_registers (bufp, regs, num_regs, starts, ends)
+ struct re_pattern_buffer *bufp;
+ struct re_registers *regs;
+ unsigned num_regs;
+ regoff_t *starts, *ends;
+{
+ if (num_regs)
+ {
+ bufp->regs_allocated = REGS_REALLOCATE;
+ regs->num_regs = num_regs;
+ regs->start = starts;
+ regs->end = ends;
+ }
+ else
+ {
+ bufp->regs_allocated = REGS_UNALLOCATED;
+ regs->num_regs = 0;
+ regs->start = regs->end = (regoff_t *) 0;
+ }
+}
+#ifdef _LIBC
+weak_alias (__re_set_registers, re_set_registers)
+#endif
+
+/* Entry points compatible with 4.2 BSD regex library. We don't define
+ them unless specifically requested. */
+
+#if defined _REGEX_RE_COMP || defined _LIBC
+int
+# ifdef _LIBC
+weak_function
+# endif
+re_exec (s)
+ const char *s;
+{
+ return 0 == regexec (&re_comp_buf, s, 0, NULL, 0);
+}
+#endif /* _REGEX_RE_COMP */
+
+static re_node_set empty_set;
+
+/* Internal entry point. */
+
+/* Searches for a compiled pattern PREG in the string STRING, whose
+ length is LENGTH. NMATCH, PMATCH, and EFLAGS have the same
+ mingings with regexec. START, and RANGE have the same meanings
+ with re_search.
+ Return REG_NOERROR if we find a match, and REG_NOMATCH if not,
+ otherwise return the error code.
+ Note: We assume front end functions already check ranges.
+ (START + RANGE >= 0 && START + RANGE <= LENGTH) */
+
+static reg_errcode_t
+re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch,
+ eflags)
+ const regex_t *preg;
+ const char *string;
+ int length, start, range, stop, eflags;
+ size_t nmatch;
+ regmatch_t pmatch[];
+{
+ reg_errcode_t err;
+ re_dfa_t *dfa = (re_dfa_t *)preg->buffer;
+ re_string_t input;
+ int left_lim, right_lim, incr;
+ int fl_longest_match, match_first, match_last = -1;
+ int fast_translate, sb;
+ re_match_context_t mctx;
+ char *fastmap = ((preg->fastmap != NULL && preg->fastmap_accurate
+ && range && !preg->can_be_null) ? preg->fastmap : NULL);
+
+ /* Check if the DFA haven't been compiled. */
+ if (BE (preg->used == 0 || dfa->init_state == NULL
+ || dfa->init_state_word == NULL || dfa->init_state_nl == NULL
+ || dfa->init_state_begbuf == NULL, 0))
+ return REG_NOMATCH;
+
+ re_node_set_init_empty (&empty_set);
+ memset (&mctx, '\0', sizeof (re_match_context_t));
+
+ /* We must check the longest matching, if nmatch > 0. */
+ fl_longest_match = (nmatch != 0 || dfa->nbackref);
+
+ err = re_string_allocate (&input, string, length, dfa->nodes_len + 1,
+ preg->translate, preg->syntax & RE_ICASE);
+ if (BE (err != REG_NOERROR, 0))
+ goto free_return;
+ input.stop = stop;
+
+ err = match_ctx_init (&mctx, eflags, &input, dfa->nbackref * 2);
+ if (BE (err != REG_NOERROR, 0))
+ goto free_return;
+
+ /* We will log all the DFA states through which the dfa pass,
+ if nmatch > 1, or this dfa has "multibyte node", which is a
+ back-reference or a node which can accept multibyte character or
+ multi character collating element. */
+ if (nmatch > 1 || dfa->has_mb_node)
+ {
+ mctx.state_log = re_malloc (re_dfastate_t *, dfa->nodes_len + 1);
+ if (BE (mctx.state_log == NULL, 0))
+ {
+ err = REG_ESPACE;
+ goto free_return;
+ }
+ }
+ else
+ mctx.state_log = NULL;
+
+#ifdef DEBUG
+ /* We assume front-end functions already check them. */
+ assert (start + range >= 0 && start + range <= length);
+#endif
+
+ match_first = start;
+ input.tip_context = ((eflags & REG_NOTBOL) ? CONTEXT_BEGBUF
+ : CONTEXT_NEWLINE | CONTEXT_BEGBUF);
+
+ /* Check incrementally whether of not the input string match. */
+ incr = (range < 0) ? -1 : 1;
+ left_lim = (range < 0) ? start + range : start;
+ right_lim = (range < 0) ? start : start + range;
+#ifdef RE_ENABLE_I18N
+ sb = re_mb_cur_max == 1;
+#else
+ sb = 1;
+#endif
+ fast_translate = sb || !(preg->syntax & RE_ICASE || preg->translate);
+
+ for (;;)
+ {
+ /* At first get the current byte from input string. */
+ if (fastmap)
+ {
+ if (BE (fast_translate, 1))
+ {
+ unsigned RE_TRANSLATE_TYPE t
+ = (unsigned RE_TRANSLATE_TYPE) preg->translate;
+ if (BE (range >= 0, 1))
+ {
+ if (BE (t != NULL, 0))
+ {
+ while (BE (match_first < right_lim, 1)
+ && !fastmap[t[(unsigned char) string[match_first]]])
+ ++match_first;
+ }
+ else
+ {
+ while (BE (match_first < right_lim, 1)
+ && !fastmap[(unsigned char) string[match_first]])
+ ++match_first;
+ }
+ if (BE (match_first == right_lim, 0))
+ {
+ int ch = match_first >= length
+ ? 0 : (unsigned char) string[match_first];
+ if (!fastmap[t ? t[ch] : ch])
+ break;
+ }
+ }
+ else
+ {
+ while (match_first >= left_lim)
+ {
+ int ch = match_first >= length
+ ? 0 : (unsigned char) string[match_first];
+ if (fastmap[t ? t[ch] : ch])
+ break;
+ --match_first;
+ }
+ if (match_first < left_lim)
+ break;
+ }
+ }
+ else
+ {
+ int ch;
+
+ do
+ {
+ /* In this case, we can't determine easily the current byte,
+ since it might be a component byte of a multibyte
+ character. Then we use the constructed buffer
+ instead. */
+ /* If MATCH_FIRST is out of the valid range, reconstruct the
+ buffers. */
+ if (input.raw_mbs_idx + input.valid_len <= match_first
+ || match_first < input.raw_mbs_idx)
+ {
+ err = re_string_reconstruct (&input, match_first, eflags,
+ preg->newline_anchor);
+ if (BE (err != REG_NOERROR, 0))
+ goto free_return;
+ }
+ /* If MATCH_FIRST is out of the buffer, leave it as '\0'.
+ Note that MATCH_FIRST must not be smaller than 0. */
+ ch = ((match_first >= length) ? 0
+ : re_string_byte_at (&input,
+ match_first - input.raw_mbs_idx));
+ if (fastmap[ch])
+ break;
+ match_first += incr;
+ }
+ while (match_first >= left_lim && match_first <= right_lim);
+ if (! fastmap[ch])
+ break;
+ }
+ }
+
+ /* Reconstruct the buffers so that the matcher can assume that
+ the matching starts from the begining of the buffer. */
+ err = re_string_reconstruct (&input, match_first, eflags,
+ preg->newline_anchor);
+ if (BE (err != REG_NOERROR, 0))
+ goto free_return;
+#ifdef RE_ENABLE_I18N
+ /* Eliminate it when it is a component of a multibyte character
+ and isn't the head of a multibyte character. */
+ if (sb || re_string_first_byte (&input, 0))
+#endif
+ {
+ /* It seems to be appropriate one, then use the matcher. */
+ /* We assume that the matching starts from 0. */
+ mctx.state_log_top = mctx.nbkref_ents = mctx.max_mb_elem_len = 0;
+ match_last = check_matching (preg, &mctx, 0, fl_longest_match);
+ if (match_last != -1)
+ {
+ if (BE (match_last == -2, 0))
+ {
+ err = REG_ESPACE;
+ goto free_return;
+ }
+ else
+ {
+ mctx.match_last = match_last;
+ if ((!preg->no_sub && nmatch > 1) || dfa->nbackref)
+ {
+ re_dfastate_t *pstate = mctx.state_log[match_last];
+ mctx.last_node = check_halt_state_context (preg, pstate,
+ &mctx, match_last);
+ }
+ if ((!preg->no_sub && nmatch > 1 && dfa->has_plural_match)
+ || dfa->nbackref)
+ {
+ err = prune_impossible_nodes (preg, &mctx);
+ if (err == REG_NOERROR)
+ break;
+ if (BE (err != REG_NOMATCH, 0))
+ goto free_return;
+ }
+ else
+ break; /* We found a matching. */
+ }
+ }
+ match_ctx_clean (&mctx);
+ }
+ /* Update counter. */
+ match_first += incr;
+ if (match_first < left_lim || right_lim < match_first)
+ break;
+ }
+
+ /* Set pmatch[] if we need. */
+ if (match_last != -1 && nmatch > 0)
+ {
+ int reg_idx;
+
+ /* Initialize registers. */
+ for (reg_idx = 0; reg_idx < nmatch; ++reg_idx)
+ pmatch[reg_idx].rm_so = pmatch[reg_idx].rm_eo = -1;
+
+ /* Set the points where matching start/end. */
+ pmatch[0].rm_so = 0;
+ pmatch[0].rm_eo = mctx.match_last;
+
+ if (!preg->no_sub && nmatch > 1)
+ {
+ err = set_regs (preg, &mctx, nmatch, pmatch,
+ dfa->has_plural_match && dfa->nbackref > 0);
+ if (BE (err != REG_NOERROR, 0))
+ goto free_return;
+ }
+
+ /* At last, add the offset to the each registers, since we slided
+ the buffers so that We can assume that the matching starts from 0. */
+ for (reg_idx = 0; reg_idx < nmatch; ++reg_idx)
+ if (pmatch[reg_idx].rm_so != -1)
+ {
+ pmatch[reg_idx].rm_so += match_first;
+ pmatch[reg_idx].rm_eo += match_first;
+ }
+ }
+ err = (match_last == -1) ? REG_NOMATCH : REG_NOERROR;
+ free_return:
+ re_free (mctx.state_log);
+ if (dfa->nbackref)
+ match_ctx_free (&mctx);
+ re_string_destruct (&input);
+ return err;
+}
+
+static reg_errcode_t
+prune_impossible_nodes (preg, mctx)
+ const regex_t *preg;
+ re_match_context_t *mctx;
+{
+ int halt_node, match_last;
+ reg_errcode_t ret;
+ re_dfa_t *dfa = (re_dfa_t *)preg->buffer;
+ re_dfastate_t **sifted_states;
+ re_dfastate_t **lim_states = NULL;
+ re_sift_context_t sctx;
+#ifdef DEBUG
+ assert (mctx->state_log != NULL);
+#endif
+ match_last = mctx->match_last;
+ halt_node = mctx->last_node;
+ sifted_states = re_malloc (re_dfastate_t *, match_last + 1);
+ if (BE (sifted_states == NULL, 0))
+ {
+ ret = REG_ESPACE;
+ goto free_return;
+ }
+ if (dfa->nbackref)
+ {
+ lim_states = re_malloc (re_dfastate_t *, match_last + 1);
+ if (BE (lim_states == NULL, 0))
+ {
+ ret = REG_ESPACE;
+ goto free_return;
+ }
+ while (1)
+ {
+ memset (lim_states, '\0',
+ sizeof (re_dfastate_t *) * (match_last + 1));
+ match_ctx_clear_flag (mctx);
+ sift_ctx_init (&sctx, sifted_states, lim_states, halt_node,
+ match_last, 0);
+ ret = sift_states_backward (preg, mctx, &sctx);
+ re_node_set_free (&sctx.limits);
+ if (BE (ret != REG_NOERROR, 0))
+ goto free_return;
+ if (sifted_states[0] != NULL || lim_states[0] != NULL)
+ break;
+ do
+ {
+ --match_last;
+ if (match_last < 0)
+ {
+ ret = REG_NOMATCH;
+ goto free_return;
+ }
+ } while (!mctx->state_log[match_last]->halt);
+ halt_node = check_halt_state_context (preg,
+ mctx->state_log[match_last],
+ mctx, match_last);
+ }
+ ret = merge_state_array (dfa, sifted_states, lim_states,
+ match_last + 1);
+ re_free (lim_states);
+ lim_states = NULL;
+ if (BE (ret != REG_NOERROR, 0))
+ goto free_return;
+ }
+ else
+ {
+ sift_ctx_init (&sctx, sifted_states, lim_states, halt_node,
+ match_last, 0);
+ ret = sift_states_backward (preg, mctx, &sctx);
+ re_node_set_free (&sctx.limits);
+ if (BE (ret != REG_NOERROR, 0))
+ goto free_return;
+ }
+ re_free (mctx->state_log);
+ mctx->state_log = sifted_states;
+ sifted_states = NULL;
+ mctx->last_node = halt_node;
+ mctx->match_last = match_last;
+ ret = REG_NOERROR;
+ free_return:
+ re_free (sifted_states);
+ re_free (lim_states);
+ return ret;
+}
+
+/* Acquire an initial state and return it.
+ We must select appropriate initial state depending on the context,
+ since initial states may have constraints like "\<", "^", etc.. */
+
+static inline re_dfastate_t *
+acquire_init_state_context (err, preg, mctx, idx)
+ reg_errcode_t *err;
+ const regex_t *preg;
+ const re_match_context_t *mctx;
+ int idx;
+{
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+
+ *err = REG_NOERROR;
+ if (dfa->init_state->has_constraint)
+ {
+ unsigned int context;
+ context = re_string_context_at (mctx->input, idx - 1, mctx->eflags,
+ preg->newline_anchor);
+ if (IS_WORD_CONTEXT (context))
+ return dfa->init_state_word;
+ else if (IS_ORDINARY_CONTEXT (context))
+ return dfa->init_state;
+ else if (IS_BEGBUF_CONTEXT (context) && IS_NEWLINE_CONTEXT (context))
+ return dfa->init_state_begbuf;
+ else if (IS_NEWLINE_CONTEXT (context))
+ return dfa->init_state_nl;
+ else if (IS_BEGBUF_CONTEXT (context))
+ {
+ /* It is relatively rare case, then calculate on demand. */
+ return re_acquire_state_context (err, dfa,
+ dfa->init_state->entrance_nodes,
+ context);
+ }
+ else
+ /* Must not happen? */
+ return dfa->init_state;
+ }
+ else
+ return dfa->init_state;
+}
+
+/* Check whether the regular expression match input string INPUT or not,
+ and return the index where the matching end, return -1 if not match,
+ or return -2 in case of an error.
+ FL_SEARCH means we must search where the matching starts,
+ FL_LONGEST_MATCH means we want the POSIX longest matching.
+ Note that the matcher assume that the maching starts from the current
+ index of the buffer. */
+
+static int
+check_matching (preg, mctx, fl_search, fl_longest_match)
+ const regex_t *preg;
+ re_match_context_t *mctx;
+ int fl_search, fl_longest_match;
+{
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ reg_errcode_t err;
+ int match = 0;
+ int match_last = -1;
+ int cur_str_idx = re_string_cur_idx (mctx->input);
+ re_dfastate_t *cur_state;
+
+ cur_state = acquire_init_state_context (&err, preg, mctx, cur_str_idx);
+ /* An initial state must not be NULL(invalid state). */
+ if (BE (cur_state == NULL, 0))
+ return -2;
+ if (mctx->state_log != NULL)
+ mctx->state_log[cur_str_idx] = cur_state;
+
+ /* Check OP_OPEN_SUBEXP in the initial state in case that we use them
+ later. E.g. Processing back references. */
+ if (dfa->nbackref)
+ {
+ err = check_subexp_matching_top (dfa, mctx, &cur_state->nodes, 0);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+
+ if (cur_state->has_backref)
+ {
+ err = transit_state_bkref (preg, &cur_state->nodes, mctx);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+
+ /* If the RE accepts NULL string. */
+ if (cur_state->halt)
+ {
+ if (!cur_state->has_constraint
+ || check_halt_state_context (preg, cur_state, mctx, cur_str_idx))
+ {
+ if (!fl_longest_match)
+ return cur_str_idx;
+ else
+ {
+ match_last = cur_str_idx;
+ match = 1;
+ }
+ }
+ }
+
+ while (!re_string_eoi (mctx->input))
+ {
+ cur_state = transit_state (&err, preg, mctx, cur_state,
+ fl_search && !match);
+ if (cur_state == NULL) /* Reached at the invalid state or an error. */
+ {
+ cur_str_idx = re_string_cur_idx (mctx->input);
+ if (BE (err != REG_NOERROR, 0))
+ return -2;
+ if (fl_search && !match)
+ {
+ /* Restart from initial state, since we are searching
+ the point from where matching start. */
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max == 1
+ || re_string_first_byte (mctx->input, cur_str_idx))
+#endif /* RE_ENABLE_I18N */
+ cur_state = acquire_init_state_context (&err, preg, mctx,
+ cur_str_idx);
+ if (BE (cur_state == NULL && err != REG_NOERROR, 0))
+ return -2;
+ if (mctx->state_log != NULL)
+ mctx->state_log[cur_str_idx] = cur_state;
+ }
+ else if (!fl_longest_match && match)
+ break;
+ else /* (fl_longest_match && match) || (!fl_search && !match) */
+ {
+ if (mctx->state_log == NULL)
+ break;
+ else
+ {
+ int max = mctx->state_log_top;
+ for (; cur_str_idx <= max; ++cur_str_idx)
+ if (mctx->state_log[cur_str_idx] != NULL)
+ break;
+ if (cur_str_idx > max)
+ break;
+ }
+ }
+ }
+
+ if (cur_state != NULL && cur_state->halt)
+ {
+ /* Reached at a halt state.
+ Check the halt state can satisfy the current context. */
+ if (!cur_state->has_constraint
+ || check_halt_state_context (preg, cur_state, mctx,
+ re_string_cur_idx (mctx->input)))
+ {
+ /* We found an appropriate halt state. */
+ match_last = re_string_cur_idx (mctx->input);
+ match = 1;
+ if (!fl_longest_match)
+ break;
+ }
+ }
+ }
+ return match_last;
+}
+
+/* Check NODE match the current context. */
+
+static int check_halt_node_context (dfa, node, context)
+ const re_dfa_t *dfa;
+ int node;
+ unsigned int context;
+{
+ re_token_type_t type = dfa->nodes[node].type;
+ unsigned int constraint = dfa->nodes[node].constraint;
+ if (type != END_OF_RE)
+ return 0;
+ if (!constraint)
+ return 1;
+ if (NOT_SATISFY_NEXT_CONSTRAINT (constraint, context))
+ return 0;
+ return 1;
+}
+
+/* Check the halt state STATE match the current context.
+ Return 0 if not match, if the node, STATE has, is a halt node and
+ match the context, return the node. */
+
+static int
+check_halt_state_context (preg, state, mctx, idx)
+ const regex_t *preg;
+ const re_dfastate_t *state;
+ const re_match_context_t *mctx;
+ int idx;
+{
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ int i;
+ unsigned int context;
+#ifdef DEBUG
+ assert (state->halt);
+#endif
+ context = re_string_context_at (mctx->input, idx, mctx->eflags,
+ preg->newline_anchor);
+ for (i = 0; i < state->nodes.nelem; ++i)
+ if (check_halt_node_context (dfa, state->nodes.elems[i], context))
+ return state->nodes.elems[i];
+ return 0;
+}
+
+/* Compute the next node to which "NFA" transit from NODE("NFA" is a NFA
+ corresponding to the DFA).
+ Return the destination node, and update EPS_VIA_NODES, return -1 in case
+ of errors. */
+
+static int
+proceed_next_node (preg, nregs, regs, mctx, pidx, node, eps_via_nodes, fs)
+ const regex_t *preg;
+ regmatch_t *regs;
+ const re_match_context_t *mctx;
+ int nregs, *pidx, node;
+ re_node_set *eps_via_nodes;
+ struct re_fail_stack_t *fs;
+{
+ re_dfa_t *dfa = (re_dfa_t *)preg->buffer;
+ int i, err, dest_node;
+ dest_node = -1;
+ if (IS_EPSILON_NODE (dfa->nodes[node].type))
+ {
+ re_node_set *cur_nodes = &mctx->state_log[*pidx]->nodes;
+ int ndest, dest_nodes[2];
+ err = re_node_set_insert (eps_via_nodes, node);
+ if (BE (err < 0, 0))
+ return -1;
+ /* Pick up valid destinations. */
+ for (ndest = 0, i = 0; i < dfa->edests[node].nelem; ++i)
+ {
+ int candidate = dfa->edests[node].elems[i];
+ if (!re_node_set_contains (cur_nodes, candidate))
+ continue;
+ dest_nodes[0] = (ndest == 0) ? candidate : dest_nodes[0];
+ dest_nodes[1] = (ndest == 1) ? candidate : dest_nodes[1];
+ ++ndest;
+ }
+ if (ndest <= 1)
+ return ndest == 0 ? -1 : (ndest == 1 ? dest_nodes[0] : 0);
+ /* In order to avoid infinite loop like "(a*)*". */
+ if (re_node_set_contains (eps_via_nodes, dest_nodes[0]))
+ return dest_nodes[1];
+ if (fs != NULL)
+ push_fail_stack (fs, *pidx, dest_nodes, nregs, regs, eps_via_nodes);
+ return dest_nodes[0];
+ }
+ else
+ {
+ int naccepted = 0;
+ re_token_type_t type = dfa->nodes[node].type;
+
+#ifdef RE_ENABLE_I18N
+ if (ACCEPT_MB_NODE (type))
+ naccepted = check_node_accept_bytes (preg, node, mctx->input, *pidx);
+ else
+#endif /* RE_ENABLE_I18N */
+ if (type == OP_BACK_REF)
+ {
+ int subexp_idx = dfa->nodes[node].opr.idx;
+ naccepted = regs[subexp_idx].rm_eo - regs[subexp_idx].rm_so;
+ if (fs != NULL)
+ {
+ if (regs[subexp_idx].rm_so == -1 || regs[subexp_idx].rm_eo == -1)
+ return -1;
+ else if (naccepted)
+ {
+ char *buf = (char *) re_string_get_buffer (mctx->input);
+ if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx,
+ naccepted) != 0)
+ return -1;
+ }
+ }
+
+ if (naccepted == 0)
+ {
+ err = re_node_set_insert (eps_via_nodes, node);
+ if (BE (err < 0, 0))
+ return -2;
+ dest_node = dfa->edests[node].elems[0];
+ if (re_node_set_contains (&mctx->state_log[*pidx]->nodes,
+ dest_node))
+ return dest_node;
+ }
+ }
+
+ if (naccepted != 0
+ || check_node_accept (preg, dfa->nodes + node, mctx, *pidx))
+ {
+ dest_node = dfa->nexts[node];
+ *pidx = (naccepted == 0) ? *pidx + 1 : *pidx + naccepted;
+ if (fs && (*pidx > mctx->match_last || mctx->state_log[*pidx] == NULL
+ || !re_node_set_contains (&mctx->state_log[*pidx]->nodes,
+ dest_node)))
+ return -1;
+ re_node_set_empty (eps_via_nodes);
+ return dest_node;
+ }
+ }
+ return -1;
+}
+
+static reg_errcode_t
+push_fail_stack (fs, str_idx, dests, nregs, regs, eps_via_nodes)
+ struct re_fail_stack_t *fs;
+ int str_idx, *dests, nregs;
+ regmatch_t *regs;
+ re_node_set *eps_via_nodes;
+{
+ reg_errcode_t err;
+ int num = fs->num++;
+ if (fs->num == fs->alloc)
+ {
+ struct re_fail_stack_ent_t *new_array;
+ fs->alloc *= 2;
+ new_array = realloc (fs->stack, (sizeof (struct re_fail_stack_ent_t)
+ * fs->alloc));
+ if (new_array == NULL)
+ return REG_ESPACE;
+ fs->stack = new_array;
+ }
+ fs->stack[num].idx = str_idx;
+ fs->stack[num].node = dests[1];
+ fs->stack[num].regs = re_malloc (regmatch_t, nregs);
+ memcpy (fs->stack[num].regs, regs, sizeof (regmatch_t) * nregs);
+ err = re_node_set_init_copy (&fs->stack[num].eps_via_nodes, eps_via_nodes);
+ return err;
+}
+
+static int
+pop_fail_stack (fs, pidx, nregs, regs, eps_via_nodes)
+ struct re_fail_stack_t *fs;
+ int *pidx, nregs;
+ regmatch_t *regs;
+ re_node_set *eps_via_nodes;
+{
+ int num = --fs->num;
+ assert (num >= 0);
+ *pidx = fs->stack[num].idx;
+ memcpy (regs, fs->stack[num].regs, sizeof (regmatch_t) * nregs);
+ re_node_set_free (eps_via_nodes);
+ re_free (fs->stack[num].regs);
+ *eps_via_nodes = fs->stack[num].eps_via_nodes;
+ return fs->stack[num].node;
+}
+
+/* Set the positions where the subexpressions are starts/ends to registers
+ PMATCH.
+ Note: We assume that pmatch[0] is already set, and
+ pmatch[i].rm_so == pmatch[i].rm_eo == -1 (i > 1). */
+
+static reg_errcode_t
+set_regs (preg, mctx, nmatch, pmatch, fl_backtrack)
+ const regex_t *preg;
+ const re_match_context_t *mctx;
+ size_t nmatch;
+ regmatch_t *pmatch;
+ int fl_backtrack;
+{
+ re_dfa_t *dfa = (re_dfa_t *)preg->buffer;
+ int idx, cur_node, real_nmatch;
+ re_node_set eps_via_nodes;
+ struct re_fail_stack_t *fs;
+ struct re_fail_stack_t fs_body;
+ fs_body.num = 0;
+ fs_body.alloc = 2;
+ fs_body.stack = NULL;
+#ifdef DEBUG
+ assert (nmatch > 1);
+ assert (mctx->state_log != NULL);
+#endif
+ if (fl_backtrack)
+ {
+ fs = &fs_body;
+ fs->stack = re_malloc (struct re_fail_stack_ent_t, fs->alloc);
+ }
+ else
+ fs = NULL;
+ cur_node = dfa->init_node;
+ real_nmatch = (nmatch <= preg->re_nsub) ? nmatch : preg->re_nsub + 1;
+ re_node_set_init_empty (&eps_via_nodes);
+ for (idx = pmatch[0].rm_so; idx <= pmatch[0].rm_eo ;)
+ {
+ update_regs (dfa, pmatch, cur_node, idx, real_nmatch);
+ if (idx == pmatch[0].rm_eo && cur_node == mctx->last_node)
+ {
+ int reg_idx;
+ if (fs)
+ {
+ for (reg_idx = 0; reg_idx < nmatch; ++reg_idx)
+ if (pmatch[reg_idx].rm_so > -1 && pmatch[reg_idx].rm_eo == -1)
+ break;
+ if (reg_idx == nmatch)
+ {
+ re_node_set_free (&eps_via_nodes);
+ return free_fail_stack_return (fs);
+ }
+ cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
+ &eps_via_nodes);
+ }
+ else
+ {
+ re_node_set_free (&eps_via_nodes);
+ return REG_NOERROR;
+ }
+ }
+
+ /* Proceed to next node. */
+ cur_node = proceed_next_node (preg, nmatch, pmatch, mctx, &idx, cur_node,
+ &eps_via_nodes, fs);
+
+ if (BE (cur_node < 0, 0))
+ {
+ if (cur_node == -2)
+ return REG_ESPACE;
+ if (fs)
+ cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
+ &eps_via_nodes);
+ else
+ {
+ re_node_set_free (&eps_via_nodes);
+ return REG_NOMATCH;
+ }
+ }
+ }
+ re_node_set_free (&eps_via_nodes);
+ return free_fail_stack_return (fs);
+}
+
+static reg_errcode_t
+free_fail_stack_return (fs)
+ struct re_fail_stack_t *fs;
+{
+ if (fs)
+ {
+ int fs_idx;
+ for (fs_idx = 0; fs_idx < fs->num; ++fs_idx)
+ {
+ re_node_set_free (&fs->stack[fs_idx].eps_via_nodes);
+ re_free (fs->stack[fs_idx].regs);
+ }
+ re_free (fs->stack);
+ }
+ return REG_NOERROR;
+}
+
+static void
+update_regs (dfa, pmatch, cur_node, cur_idx, nmatch)
+ re_dfa_t *dfa;
+ regmatch_t *pmatch;
+ int cur_node, cur_idx, nmatch;
+{
+ int type = dfa->nodes[cur_node].type;
+ int reg_num;
+ if (type != OP_OPEN_SUBEXP && type != OP_CLOSE_SUBEXP)
+ return;
+ reg_num = dfa->nodes[cur_node].opr.idx + 1;
+ if (reg_num >= nmatch)
+ return;
+ if (type == OP_OPEN_SUBEXP)
+ {
+ /* We are at the first node of this sub expression. */
+ pmatch[reg_num].rm_so = cur_idx;
+ pmatch[reg_num].rm_eo = -1;
+ }
+ else if (type == OP_CLOSE_SUBEXP)
+ /* We are at the first node of this sub expression. */
+ pmatch[reg_num].rm_eo = cur_idx;
+}
+
+#define NUMBER_OF_STATE 1
+
+/* This function checks the STATE_LOG from the SCTX->last_str_idx to 0
+ and sift the nodes in each states according to the following rules.
+ Updated state_log will be wrote to STATE_LOG.
+
+ Rules: We throw away the Node `a' in the STATE_LOG[STR_IDX] if...
+ 1. When STR_IDX == MATCH_LAST(the last index in the state_log):
+ If `a' isn't the LAST_NODE and `a' can't epsilon transit to
+ the LAST_NODE, we throw away the node `a'.
+ 2. When 0 <= STR_IDX < MATCH_LAST and `a' accepts
+ string `s' and transit to `b':
+ i. If 'b' isn't in the STATE_LOG[STR_IDX+strlen('s')], we throw
+ away the node `a'.
+ ii. If 'b' is in the STATE_LOG[STR_IDX+strlen('s')] but 'b' is
+ throwed away, we throw away the node `a'.
+ 3. When 0 <= STR_IDX < n and 'a' epsilon transit to 'b':
+ i. If 'b' isn't in the STATE_LOG[STR_IDX], we throw away the
+ node `a'.
+ ii. If 'b' is in the STATE_LOG[STR_IDX] but 'b' is throwed away,
+ we throw away the node `a'. */
+
+#define STATE_NODE_CONTAINS(state,node) \
+ ((state) != NULL && re_node_set_contains (&(state)->nodes, node))
+
+static reg_errcode_t
+sift_states_backward (preg, mctx, sctx)
+ const regex_t *preg;
+ re_match_context_t *mctx;
+ re_sift_context_t *sctx;
+{
+ reg_errcode_t err;
+ re_dfa_t *dfa = (re_dfa_t *)preg->buffer;
+ int null_cnt = 0;
+ int str_idx = sctx->last_str_idx;
+ re_node_set cur_dest;
+ re_node_set *cur_src; /* Points the state_log[str_idx]->nodes */
+
+#ifdef DEBUG
+ assert (mctx->state_log != NULL && mctx->state_log[str_idx] != NULL);
+#endif
+ cur_src = &mctx->state_log[str_idx]->nodes;
+
+ /* Build sifted state_log[str_idx]. It has the nodes which can epsilon
+ transit to the last_node and the last_node itself. */
+ err = re_node_set_init_1 (&cur_dest, sctx->last_node);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ err = update_cur_sifted_state (preg, mctx, sctx, str_idx, &cur_dest);
+ if (BE (err != REG_NOERROR, 0))
+ goto free_return;
+
+ /* Then check each states in the state_log. */
+ while (str_idx > 0)
+ {
+ int i, ret;
+ /* Update counters. */
+ null_cnt = (sctx->sifted_states[str_idx] == NULL) ? null_cnt + 1 : 0;
+ if (null_cnt > mctx->max_mb_elem_len)
+ {
+ memset (sctx->sifted_states, '\0',
+ sizeof (re_dfastate_t *) * str_idx);
+ re_node_set_free (&cur_dest);
+ return REG_NOERROR;
+ }
+ re_node_set_empty (&cur_dest);
+ --str_idx;
+ cur_src = ((mctx->state_log[str_idx] == NULL) ? &empty_set
+ : &mctx->state_log[str_idx]->nodes);
+
+ /* Then build the next sifted state.
+ We build the next sifted state on `cur_dest', and update
+ `sifted_states[str_idx]' with `cur_dest'.
+ Note:
+ `cur_dest' is the sifted state from `state_log[str_idx + 1]'.
+ `cur_src' points the node_set of the old `state_log[str_idx]'. */
+ for (i = 0; i < cur_src->nelem; i++)
+ {
+ int prev_node = cur_src->elems[i];
+ int naccepted = 0;
+ re_token_type_t type = dfa->nodes[prev_node].type;
+
+ if (IS_EPSILON_NODE(type))
+ continue;
+#ifdef RE_ENABLE_I18N
+ /* If the node may accept `multi byte'. */
+ if (ACCEPT_MB_NODE (type))
+ naccepted = sift_states_iter_mb (preg, mctx, sctx, prev_node,
+ str_idx, sctx->last_str_idx);
+
+#endif /* RE_ENABLE_I18N */
+ /* We don't check backreferences here.
+ See update_cur_sifted_state(). */
+
+ if (!naccepted
+ && check_node_accept (preg, dfa->nodes + prev_node, mctx,
+ str_idx)
+ && STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + 1],
+ dfa->nexts[prev_node]))
+ naccepted = 1;
+
+ if (naccepted == 0)
+ continue;
+
+ if (sctx->limits.nelem)
+ {
+ int to_idx = str_idx + naccepted;
+ if (check_dst_limits (dfa, &sctx->limits, mctx,
+ dfa->nexts[prev_node], to_idx,
+ prev_node, str_idx))
+ continue;
+ }
+ ret = re_node_set_insert (&cur_dest, prev_node);
+ if (BE (ret == -1, 0))
+ {
+ err = REG_ESPACE;
+ goto free_return;
+ }
+ }
+
+ /* Add all the nodes which satisfy the following conditions:
+ - It can epsilon transit to a node in CUR_DEST.
+ - It is in CUR_SRC.
+ And update state_log. */
+ err = update_cur_sifted_state (preg, mctx, sctx, str_idx, &cur_dest);
+ if (BE (err != REG_NOERROR, 0))
+ goto free_return;
+ }
+ err = REG_NOERROR;
+ free_return:
+ re_node_set_free (&cur_dest);
+ return err;
+}
+
+/* Helper functions. */
+
+static inline reg_errcode_t
+clean_state_log_if_need (mctx, next_state_log_idx)
+ re_match_context_t *mctx;
+ int next_state_log_idx;
+{
+ int top = mctx->state_log_top;
+
+ if (next_state_log_idx >= mctx->input->bufs_len
+ || (next_state_log_idx >= mctx->input->valid_len
+ && mctx->input->valid_len < mctx->input->len))
+ {
+ reg_errcode_t err;
+ err = extend_buffers (mctx);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+
+ if (top < next_state_log_idx)
+ {
+ memset (mctx->state_log + top + 1, '\0',
+ sizeof (re_dfastate_t *) * (next_state_log_idx - top));
+ mctx->state_log_top = next_state_log_idx;
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+merge_state_array (dfa, dst, src, num)
+ re_dfa_t *dfa;
+ re_dfastate_t **dst;
+ re_dfastate_t **src;
+ int num;
+{
+ int st_idx;
+ reg_errcode_t err;
+ for (st_idx = 0; st_idx < num; ++st_idx)
+ {
+ if (dst[st_idx] == NULL)
+ dst[st_idx] = src[st_idx];
+ else if (src[st_idx] != NULL)
+ {
+ re_node_set merged_set;
+ err = re_node_set_init_union (&merged_set, &dst[st_idx]->nodes,
+ &src[st_idx]->nodes);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ dst[st_idx] = re_acquire_state (&err, dfa, &merged_set);
+ re_node_set_free (&merged_set);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+update_cur_sifted_state (preg, mctx, sctx, str_idx, dest_nodes)
+ const regex_t *preg;
+ re_match_context_t *mctx;
+ re_sift_context_t *sctx;
+ int str_idx;
+ re_node_set *dest_nodes;
+{
+ reg_errcode_t err;
+ re_dfa_t *dfa = (re_dfa_t *)preg->buffer;
+ const re_node_set *candidates;
+ candidates = ((mctx->state_log[str_idx] == NULL) ? &empty_set
+ : &mctx->state_log[str_idx]->nodes);
+
+ /* At first, add the nodes which can epsilon transit to a node in
+ DEST_NODE. */
+ if (dest_nodes->nelem)
+ {
+ err = add_epsilon_src_nodes (dfa, dest_nodes, candidates);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+
+ /* Then, check the limitations in the current sift_context. */
+ if (dest_nodes->nelem && sctx->limits.nelem)
+ {
+ err = check_subexp_limits (dfa, dest_nodes, candidates, &sctx->limits,
+ mctx->bkref_ents, str_idx);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+
+ /* Update state_log. */
+ sctx->sifted_states[str_idx] = re_acquire_state (&err, dfa, dest_nodes);
+ if (BE (sctx->sifted_states[str_idx] == NULL && err != REG_NOERROR, 0))
+ return err;
+
+ if ((mctx->state_log[str_idx] != NULL
+ && mctx->state_log[str_idx]->has_backref))
+ {
+ err = sift_states_bkref (preg, mctx, sctx, str_idx, dest_nodes);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+add_epsilon_src_nodes (dfa, dest_nodes, candidates)
+ re_dfa_t *dfa;
+ re_node_set *dest_nodes;
+ const re_node_set *candidates;
+{
+ reg_errcode_t err;
+ int src_idx;
+ re_node_set src_copy;
+
+ err = re_node_set_init_copy (&src_copy, dest_nodes);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ for (src_idx = 0; src_idx < src_copy.nelem; ++src_idx)
+ {
+ err = re_node_set_add_intersect (dest_nodes, candidates,
+ dfa->inveclosures
+ + src_copy.elems[src_idx]);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&src_copy);
+ return err;
+ }
+ }
+ re_node_set_free (&src_copy);
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+sub_epsilon_src_nodes (dfa, node, dest_nodes, candidates)
+ re_dfa_t *dfa;
+ int node;
+ re_node_set *dest_nodes;
+ const re_node_set *candidates;
+{
+ int ecl_idx;
+ reg_errcode_t err;
+ re_node_set *inv_eclosure = dfa->inveclosures + node;
+ re_node_set except_nodes;
+ re_node_set_init_empty (&except_nodes);
+ for (ecl_idx = 0; ecl_idx < inv_eclosure->nelem; ++ecl_idx)
+ {
+ int cur_node = inv_eclosure->elems[ecl_idx];
+ if (cur_node == node)
+ continue;
+ if (IS_EPSILON_NODE (dfa->nodes[cur_node].type))
+ {
+ int edst1 = dfa->edests[cur_node].elems[0];
+ int edst2 = ((dfa->edests[cur_node].nelem > 1)
+ ? dfa->edests[cur_node].elems[1] : -1);
+ if ((!re_node_set_contains (inv_eclosure, edst1)
+ && re_node_set_contains (dest_nodes, edst1))
+ || (edst2 > 0
+ && !re_node_set_contains (inv_eclosure, edst2)
+ && re_node_set_contains (dest_nodes, edst2)))
+ {
+ err = re_node_set_add_intersect (&except_nodes, candidates,
+ dfa->inveclosures + cur_node);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&except_nodes);
+ return err;
+ }
+ }
+ }
+ }
+ for (ecl_idx = 0; ecl_idx < inv_eclosure->nelem; ++ecl_idx)
+ {
+ int cur_node = inv_eclosure->elems[ecl_idx];
+ if (!re_node_set_contains (&except_nodes, cur_node))
+ {
+ int idx = re_node_set_contains (dest_nodes, cur_node) - 1;
+ re_node_set_remove_at (dest_nodes, idx);
+ }
+ }
+ re_node_set_free (&except_nodes);
+ return REG_NOERROR;
+}
+
+static int
+check_dst_limits (dfa, limits, mctx, dst_node, dst_idx, src_node, src_idx)
+ re_dfa_t *dfa;
+ re_node_set *limits;
+ re_match_context_t *mctx;
+ int dst_node, dst_idx, src_node, src_idx;
+{
+ int lim_idx, src_pos, dst_pos;
+
+ for (lim_idx = 0; lim_idx < limits->nelem; ++lim_idx)
+ {
+ int subexp_idx;
+ struct re_backref_cache_entry *ent;
+ ent = mctx->bkref_ents + limits->elems[lim_idx];
+ subexp_idx = dfa->nodes[ent->node].opr.idx - 1;
+
+ dst_pos = check_dst_limits_calc_pos (dfa, mctx, limits->elems[lim_idx],
+ dfa->eclosures + dst_node,
+ subexp_idx, dst_node, dst_idx);
+ src_pos = check_dst_limits_calc_pos (dfa, mctx, limits->elems[lim_idx],
+ dfa->eclosures + src_node,
+ subexp_idx, src_node, src_idx);
+
+ /* In case of:
+ <src> <dst> ( <subexp> )
+ ( <subexp> ) <src> <dst>
+ ( <subexp1> <src> <subexp2> <dst> <subexp3> ) */
+ if (src_pos == dst_pos)
+ continue; /* This is unrelated limitation. */
+ else
+ return 1;
+ }
+ return 0;
+}
+
+static int
+check_dst_limits_calc_pos (dfa, mctx, limit, eclosures, subexp_idx, node,
+ str_idx)
+ re_dfa_t *dfa;
+ re_match_context_t *mctx;
+ re_node_set *eclosures;
+ int limit, subexp_idx, node, str_idx;
+{
+ struct re_backref_cache_entry *lim = mctx->bkref_ents + limit;
+ int pos = (str_idx < lim->subexp_from ? -1
+ : (lim->subexp_to < str_idx ? 1 : 0));
+ if (pos == 0
+ && (str_idx == lim->subexp_from || str_idx == lim->subexp_to))
+ {
+ int node_idx;
+ for (node_idx = 0; node_idx < eclosures->nelem; ++node_idx)
+ {
+ int node = eclosures->elems[node_idx];
+ re_token_type_t type= dfa->nodes[node].type;
+ if (type == OP_BACK_REF)
+ {
+ int bi = search_cur_bkref_entry (mctx, str_idx);
+ for (; bi < mctx->nbkref_ents; ++bi)
+ {
+ struct re_backref_cache_entry *ent = mctx->bkref_ents + bi;
+ if (ent->str_idx > str_idx)
+ break;
+ if (ent->node == node && ent->subexp_from == ent->subexp_to)
+ {
+ int cpos, dst;
+ dst = dfa->edests[node].elems[0];
+ cpos = check_dst_limits_calc_pos (dfa, mctx, limit,
+ dfa->eclosures + dst,
+ subexp_idx, dst,
+ str_idx);
+ if ((str_idx == lim->subexp_from && cpos == -1)
+ || (str_idx == lim->subexp_to && cpos == 0))
+ return cpos;
+ }
+ }
+ }
+ if (type == OP_OPEN_SUBEXP && subexp_idx == dfa->nodes[node].opr.idx
+ && str_idx == lim->subexp_from)
+ {
+ pos = -1;
+ break;
+ }
+ if (type == OP_CLOSE_SUBEXP && subexp_idx == dfa->nodes[node].opr.idx
+ && str_idx == lim->subexp_to)
+ break;
+ }
+ if (node_idx == eclosures->nelem && str_idx == lim->subexp_to)
+ pos = 1;
+ }
+ return pos;
+}
+
+/* Check the limitations of sub expressions LIMITS, and remove the nodes
+ which are against limitations from DEST_NODES. */
+
+static reg_errcode_t
+check_subexp_limits (dfa, dest_nodes, candidates, limits, bkref_ents, str_idx)
+ re_dfa_t *dfa;
+ re_node_set *dest_nodes;
+ const re_node_set *candidates;
+ re_node_set *limits;
+ struct re_backref_cache_entry *bkref_ents;
+ int str_idx;
+{
+ reg_errcode_t err;
+ int node_idx, lim_idx;
+
+ for (lim_idx = 0; lim_idx < limits->nelem; ++lim_idx)
+ {
+ int subexp_idx;
+ struct re_backref_cache_entry *ent;
+ ent = bkref_ents + limits->elems[lim_idx];
+
+ if (str_idx <= ent->subexp_from || ent->str_idx < str_idx)
+ continue; /* This is unrelated limitation. */
+
+ subexp_idx = dfa->nodes[ent->node].opr.idx - 1;
+ if (ent->subexp_to == str_idx)
+ {
+ int ops_node = -1;
+ int cls_node = -1;
+ for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx)
+ {
+ int node = dest_nodes->elems[node_idx];
+ re_token_type_t type= dfa->nodes[node].type;
+ if (type == OP_OPEN_SUBEXP
+ && subexp_idx == dfa->nodes[node].opr.idx)
+ ops_node = node;
+ else if (type == OP_CLOSE_SUBEXP
+ && subexp_idx == dfa->nodes[node].opr.idx)
+ cls_node = node;
+ }
+
+ /* Check the limitation of the open subexpression. */
+ /* Note that (ent->subexp_to = str_idx != ent->subexp_from). */
+ if (ops_node >= 0)
+ {
+ err = sub_epsilon_src_nodes(dfa, ops_node, dest_nodes,
+ candidates);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ /* Check the limitation of the close subexpression. */
+ for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx)
+ {
+ int node = dest_nodes->elems[node_idx];
+ if (!re_node_set_contains (dfa->inveclosures + node, cls_node)
+ && !re_node_set_contains (dfa->eclosures + node, cls_node))
+ {
+ /* It is against this limitation.
+ Remove it form the current sifted state. */
+ err = sub_epsilon_src_nodes(dfa, node, dest_nodes,
+ candidates);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ --node_idx;
+ }
+ }
+ }
+ else /* (ent->subexp_to != str_idx) */
+ {
+ for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx)
+ {
+ int node = dest_nodes->elems[node_idx];
+ re_token_type_t type= dfa->nodes[node].type;
+ if (type == OP_CLOSE_SUBEXP || type == OP_OPEN_SUBEXP)
+ {
+ if (subexp_idx != dfa->nodes[node].opr.idx)
+ continue;
+ if ((type == OP_CLOSE_SUBEXP && ent->subexp_to != str_idx)
+ || (type == OP_OPEN_SUBEXP))
+ {
+ /* It is against this limitation.
+ Remove it form the current sifted state. */
+ err = sub_epsilon_src_nodes(dfa, node, dest_nodes,
+ candidates);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ }
+ }
+ }
+ }
+ return REG_NOERROR;
+}
+
+static reg_errcode_t
+sift_states_bkref (preg, mctx, sctx, str_idx, dest_nodes)
+ const regex_t *preg;
+ re_match_context_t *mctx;
+ re_sift_context_t *sctx;
+ int str_idx;
+ re_node_set *dest_nodes;
+{
+ reg_errcode_t err;
+ re_dfa_t *dfa = (re_dfa_t *)preg->buffer;
+ int node_idx, node;
+ re_sift_context_t local_sctx;
+ const re_node_set *candidates;
+ candidates = ((mctx->state_log[str_idx] == NULL) ? &empty_set
+ : &mctx->state_log[str_idx]->nodes);
+ local_sctx.sifted_states = NULL; /* Mark that it hasn't been initialized. */
+
+ for (node_idx = 0; node_idx < candidates->nelem; ++node_idx)
+ {
+ int cur_bkref_idx = re_string_cur_idx (mctx->input);
+ re_token_type_t type;
+ node = candidates->elems[node_idx];
+ type = dfa->nodes[node].type;
+ if (node == sctx->cur_bkref && str_idx == cur_bkref_idx)
+ continue;
+ /* Avoid infinite loop for the REs like "()\1+". */
+ if (node == sctx->last_node && str_idx == sctx->last_str_idx)
+ continue;
+ if (type == OP_BACK_REF)
+ {
+ int enabled_idx = search_cur_bkref_entry (mctx, str_idx);
+ for (; enabled_idx < mctx->nbkref_ents; ++enabled_idx)
+ {
+ int disabled_idx, subexp_len, to_idx, dst_node;
+ struct re_backref_cache_entry *entry;
+ entry = mctx->bkref_ents + enabled_idx;
+ if (entry->str_idx > str_idx)
+ break;
+ if (entry->node != node)
+ continue;
+ subexp_len = entry->subexp_to - entry->subexp_from;
+ to_idx = str_idx + subexp_len;
+ dst_node = (subexp_len ? dfa->nexts[node]
+ : dfa->edests[node].elems[0]);
+
+ if (to_idx > sctx->last_str_idx
+ || sctx->sifted_states[to_idx] == NULL
+ || !STATE_NODE_CONTAINS (sctx->sifted_states[to_idx],
+ dst_node)
+ || check_dst_limits (dfa, &sctx->limits, mctx, node,
+ str_idx, dst_node, to_idx))
+ continue;
+ {
+ re_dfastate_t *cur_state;
+ entry->flag = 0;
+ for (disabled_idx = enabled_idx + 1;
+ disabled_idx < mctx->nbkref_ents; ++disabled_idx)
+ {
+ struct re_backref_cache_entry *entry2;
+ entry2 = mctx->bkref_ents + disabled_idx;
+ if (entry2->str_idx > str_idx)
+ break;
+ entry2->flag = (entry2->node == node) ? 1 : entry2->flag;
+ }
+
+ if (local_sctx.sifted_states == NULL)
+ {
+ local_sctx = *sctx;
+ err = re_node_set_init_copy (&local_sctx.limits,
+ &sctx->limits);
+ if (BE (err != REG_NOERROR, 0))
+ goto free_return;
+ }
+ local_sctx.last_node = node;
+ local_sctx.last_str_idx = str_idx;
+ err = re_node_set_insert (&local_sctx.limits, enabled_idx);
+ if (BE (err < 0, 0))
+ {
+ err = REG_ESPACE;
+ goto free_return;
+ }
+ cur_state = local_sctx.sifted_states[str_idx];
+ err = sift_states_backward (preg, mctx, &local_sctx);
+ if (BE (err != REG_NOERROR, 0))
+ goto free_return;
+ if (sctx->limited_states != NULL)
+ {
+ err = merge_state_array (dfa, sctx->limited_states,
+ local_sctx.sifted_states,
+ str_idx + 1);
+ if (BE (err != REG_NOERROR, 0))
+ goto free_return;
+ }
+ local_sctx.sifted_states[str_idx] = cur_state;
+ re_node_set_remove (&local_sctx.limits, enabled_idx);
+ /* We must not use the variable entry here, since
+ mctx->bkref_ents might be realloced. */
+ mctx->bkref_ents[enabled_idx].flag = 1;
+ }
+ }
+ enabled_idx = search_cur_bkref_entry (mctx, str_idx);
+ for (; enabled_idx < mctx->nbkref_ents; ++enabled_idx)
+ {
+ struct re_backref_cache_entry *entry;
+ entry = mctx->bkref_ents + enabled_idx;
+ if (entry->str_idx > str_idx)
+ break;
+ if (entry->node == node)
+ entry->flag = 0;
+ }
+ }
+ }
+ err = REG_NOERROR;
+ free_return:
+ if (local_sctx.sifted_states != NULL)
+ {
+ re_node_set_free (&local_sctx.limits);
+ }
+
+ return err;
+}
+
+
+#ifdef RE_ENABLE_I18N
+static int
+sift_states_iter_mb (preg, mctx, sctx, node_idx, str_idx, max_str_idx)
+ const regex_t *preg;
+ const re_match_context_t *mctx;
+ re_sift_context_t *sctx;
+ int node_idx, str_idx, max_str_idx;
+{
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ int naccepted;
+ /* Check the node can accept `multi byte'. */
+ naccepted = check_node_accept_bytes (preg, node_idx, mctx->input, str_idx);
+ if (naccepted > 0 && str_idx + naccepted <= max_str_idx &&
+ !STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + naccepted],
+ dfa->nexts[node_idx]))
+ /* The node can't accept the `multi byte', or the
+ destination was already throwed away, then the node
+ could't accept the current input `multi byte'. */
+ naccepted = 0;
+ /* Otherwise, it is sure that the node could accept
+ `naccepted' bytes input. */
+ return naccepted;
+}
+#endif /* RE_ENABLE_I18N */
+
+
+/* Functions for state transition. */
+
+/* Return the next state to which the current state STATE will transit by
+ accepting the current input byte, and update STATE_LOG if necessary.
+ If STATE can accept a multibyte char/collating element/back reference
+ update the destination of STATE_LOG. */
+
+static re_dfastate_t *
+transit_state (err, preg, mctx, state, fl_search)
+ reg_errcode_t *err;
+ const regex_t *preg;
+ re_match_context_t *mctx;
+ re_dfastate_t *state;
+ int fl_search;
+{
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ re_dfastate_t **trtable, *next_state;
+ unsigned char ch;
+ int cur_idx;
+
+ if (re_string_cur_idx (mctx->input) + 1 >= mctx->input->bufs_len
+ || (re_string_cur_idx (mctx->input) + 1 >= mctx->input->valid_len
+ && mctx->input->valid_len < mctx->input->len))
+ {
+ *err = extend_buffers (mctx);
+ if (BE (*err != REG_NOERROR, 0))
+ return NULL;
+ }
+
+ *err = REG_NOERROR;
+ if (state == NULL)
+ {
+ next_state = state;
+ re_string_skip_bytes (mctx->input, 1);
+ }
+ else
+ {
+#ifdef RE_ENABLE_I18N
+ /* If the current state can accept multibyte. */
+ if (state->accept_mb)
+ {
+ *err = transit_state_mb (preg, state, mctx);
+ if (BE (*err != REG_NOERROR, 0))
+ return NULL;
+ }
+#endif /* RE_ENABLE_I18N */
+
+ /* Then decide the next state with the single byte. */
+ if (1)
+ {
+ /* Use transition table */
+ ch = re_string_fetch_byte (mctx->input);
+ trtable = fl_search ? state->trtable_search : state->trtable;
+ if (trtable == NULL)
+ {
+ trtable = build_trtable (preg, state, fl_search);
+ if (fl_search)
+ state->trtable_search = trtable;
+ else
+ state->trtable = trtable;
+ }
+ next_state = trtable[ch];
+ }
+ else
+ {
+ /* don't use transition table */
+ next_state = transit_state_sb (err, preg, state, fl_search, mctx);
+ if (BE (next_state == NULL && err != REG_NOERROR, 0))
+ return NULL;
+ }
+ }
+
+ cur_idx = re_string_cur_idx (mctx->input);
+ /* Update the state_log if we need. */
+ if (mctx->state_log != NULL)
+ {
+ if (cur_idx > mctx->state_log_top)
+ {
+ mctx->state_log[cur_idx] = next_state;
+ mctx->state_log_top = cur_idx;
+ }
+ else if (mctx->state_log[cur_idx] == 0)
+ {
+ mctx->state_log[cur_idx] = next_state;
+ }
+ else
+ {
+ re_dfastate_t *pstate;
+ unsigned int context;
+ re_node_set next_nodes, *log_nodes, *table_nodes = NULL;
+ /* If (state_log[cur_idx] != 0), it implies that cur_idx is
+ the destination of a multibyte char/collating element/
+ back reference. Then the next state is the union set of
+ these destinations and the results of the transition table. */
+ pstate = mctx->state_log[cur_idx];
+ log_nodes = pstate->entrance_nodes;
+ if (next_state != NULL)
+ {
+ table_nodes = next_state->entrance_nodes;
+ *err = re_node_set_init_union (&next_nodes, table_nodes,
+ log_nodes);
+ if (BE (*err != REG_NOERROR, 0))
+ return NULL;
+ }
+ else
+ next_nodes = *log_nodes;
+ /* Note: We already add the nodes of the initial state,
+ then we don't need to add them here. */
+
+ context = re_string_context_at (mctx->input,
+ re_string_cur_idx (mctx->input) - 1,
+ mctx->eflags, preg->newline_anchor);
+ next_state = mctx->state_log[cur_idx]
+ = re_acquire_state_context (err, dfa, &next_nodes, context);
+ /* We don't need to check errors here, since the return value of
+ this function is next_state and ERR is already set. */
+
+ if (table_nodes != NULL)
+ re_node_set_free (&next_nodes);
+ }
+ }
+
+ /* Check OP_OPEN_SUBEXP in the current state in case that we use them
+ later. We must check them here, since the back references in the
+ next state might use them. */
+ if (dfa->nbackref && next_state/* && fl_process_bkref */)
+ {
+ *err = check_subexp_matching_top (dfa, mctx, &next_state->nodes,
+ cur_idx);
+ if (BE (*err != REG_NOERROR, 0))
+ return NULL;
+ }
+
+ /* If the next state has back references. */
+ if (next_state != NULL && next_state->has_backref)
+ {
+ *err = transit_state_bkref (preg, &next_state->nodes, mctx);
+ if (BE (*err != REG_NOERROR, 0))
+ return NULL;
+ next_state = mctx->state_log[cur_idx];
+ }
+ return next_state;
+}
+
+/* Helper functions for transit_state. */
+
+/* From the node set CUR_NODES, pick up the nodes whose types are
+ OP_OPEN_SUBEXP and which have corresponding back references in the regular
+ expression. And register them to use them later for evaluating the
+ correspoding back references. */
+
+static reg_errcode_t
+check_subexp_matching_top (dfa, mctx, cur_nodes, str_idx)
+ re_dfa_t *dfa;
+ re_match_context_t *mctx;
+ re_node_set *cur_nodes;
+ int str_idx;
+{
+ int node_idx;
+ reg_errcode_t err;
+
+ /* TODO: This isn't efficient.
+ Because there might be more than one nodes whose types are
+ OP_OPEN_SUBEXP and whose index is SUBEXP_IDX, we must check all
+ nodes.
+ E.g. RE: (a){2} */
+ for (node_idx = 0; node_idx < cur_nodes->nelem; ++node_idx)
+ {
+ int node = cur_nodes->elems[node_idx];
+ if (dfa->nodes[node].type == OP_OPEN_SUBEXP
+ && dfa->used_bkref_map & (1 << dfa->nodes[node].opr.idx))
+ {
+ err = match_ctx_add_subtop (mctx, node, str_idx);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ }
+ return REG_NOERROR;
+}
+
+/* Return the next state to which the current state STATE will transit by
+ accepting the current input byte. */
+
+static re_dfastate_t *
+transit_state_sb (err, preg, state, fl_search, mctx)
+ reg_errcode_t *err;
+ const regex_t *preg;
+ re_dfastate_t *state;
+ int fl_search;
+ re_match_context_t *mctx;
+{
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ re_node_set next_nodes;
+ re_dfastate_t *next_state;
+ int node_cnt, cur_str_idx = re_string_cur_idx (mctx->input);
+ unsigned int context;
+
+ *err = re_node_set_alloc (&next_nodes, state->nodes.nelem + 1);
+ if (BE (*err != REG_NOERROR, 0))
+ return NULL;
+ for (node_cnt = 0; node_cnt < state->nodes.nelem; ++node_cnt)
+ {
+ int cur_node = state->nodes.elems[node_cnt];
+ if (check_node_accept (preg, dfa->nodes + cur_node, mctx, cur_str_idx))
+ {
+ *err = re_node_set_merge (&next_nodes,
+ dfa->eclosures + dfa->nexts[cur_node]);
+ if (BE (*err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&next_nodes);
+ return NULL;
+ }
+ }
+ }
+ if (fl_search)
+ {
+#ifdef RE_ENABLE_I18N
+ int not_initial = 0;
+ if (re_mb_cur_max > 1)
+ for (node_cnt = 0; node_cnt < next_nodes.nelem; ++node_cnt)
+ if (dfa->nodes[next_nodes.elems[node_cnt]].type == CHARACTER)
+ {
+ not_initial = dfa->nodes[next_nodes.elems[node_cnt]].mb_partial;
+ break;
+ }
+ if (!not_initial)
+#endif
+ {
+ *err = re_node_set_merge (&next_nodes,
+ dfa->init_state->entrance_nodes);
+ if (BE (*err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&next_nodes);
+ return NULL;
+ }
+ }
+ }
+ context = re_string_context_at (mctx->input, cur_str_idx, mctx->eflags,
+ preg->newline_anchor);
+ next_state = re_acquire_state_context (err, dfa, &next_nodes, context);
+ /* We don't need to check errors here, since the return value of
+ this function is next_state and ERR is already set. */
+
+ re_node_set_free (&next_nodes);
+ re_string_skip_bytes (mctx->input, 1);
+ return next_state;
+}
+
+#ifdef RE_ENABLE_I18N
+static reg_errcode_t
+transit_state_mb (preg, pstate, mctx)
+ const regex_t *preg;
+ re_dfastate_t *pstate;
+ re_match_context_t *mctx;
+{
+ reg_errcode_t err;
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ int i;
+
+ for (i = 0; i < pstate->nodes.nelem; ++i)
+ {
+ re_node_set dest_nodes, *new_nodes;
+ int cur_node_idx = pstate->nodes.elems[i];
+ int naccepted = 0, dest_idx;
+ unsigned int context;
+ re_dfastate_t *dest_state;
+
+ if (dfa->nodes[cur_node_idx].constraint)
+ {
+ context = re_string_context_at (mctx->input,
+ re_string_cur_idx (mctx->input),
+ mctx->eflags, preg->newline_anchor);
+ if (NOT_SATISFY_NEXT_CONSTRAINT (dfa->nodes[cur_node_idx].constraint,
+ context))
+ continue;
+ }
+
+ /* How many bytes the node can accepts? */
+ if (ACCEPT_MB_NODE (dfa->nodes[cur_node_idx].type))
+ naccepted = check_node_accept_bytes (preg, cur_node_idx, mctx->input,
+ re_string_cur_idx (mctx->input));
+ if (naccepted == 0)
+ continue;
+
+ /* The node can accepts `naccepted' bytes. */
+ dest_idx = re_string_cur_idx (mctx->input) + naccepted;
+ mctx->max_mb_elem_len = ((mctx->max_mb_elem_len < naccepted) ? naccepted
+ : mctx->max_mb_elem_len);
+ err = clean_state_log_if_need (mctx, dest_idx);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+#ifdef DEBUG
+ assert (dfa->nexts[cur_node_idx] != -1);
+#endif
+ /* `cur_node_idx' may point the entity of the OP_CONTEXT_NODE,
+ then we use pstate->nodes.elems[i] instead. */
+ new_nodes = dfa->eclosures + dfa->nexts[pstate->nodes.elems[i]];
+
+ dest_state = mctx->state_log[dest_idx];
+ if (dest_state == NULL)
+ dest_nodes = *new_nodes;
+ else
+ {
+ err = re_node_set_init_union (&dest_nodes,
+ dest_state->entrance_nodes, new_nodes);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ context = re_string_context_at (mctx->input, dest_idx - 1, mctx->eflags,
+ preg->newline_anchor);
+ mctx->state_log[dest_idx]
+ = re_acquire_state_context (&err, dfa, &dest_nodes, context);
+ if (dest_state != NULL)
+ re_node_set_free (&dest_nodes);
+ if (BE (mctx->state_log[dest_idx] == NULL && err != REG_NOERROR, 0))
+ return err;
+ }
+ return REG_NOERROR;
+}
+#endif /* RE_ENABLE_I18N */
+
+static reg_errcode_t
+transit_state_bkref (preg, nodes, mctx)
+ const regex_t *preg;
+ re_node_set *nodes;
+ re_match_context_t *mctx;
+{
+ reg_errcode_t err;
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ int i;
+ int cur_str_idx = re_string_cur_idx (mctx->input);
+
+ for (i = 0; i < nodes->nelem; ++i)
+ {
+ int dest_str_idx, prev_nelem, bkc_idx;
+ int node_idx = nodes->elems[i];
+ unsigned int context;
+ re_token_t *node = dfa->nodes + node_idx;
+ re_node_set *new_dest_nodes;
+
+ /* Check whether `node' is a backreference or not. */
+ if (node->type != OP_BACK_REF)
+ continue;
+
+ if (node->constraint)
+ {
+ context = re_string_context_at (mctx->input, cur_str_idx,
+ mctx->eflags, preg->newline_anchor);
+ if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context))
+ continue;
+ }
+
+ /* `node' is a backreference.
+ Check the substring which the substring matched. */
+ bkc_idx = mctx->nbkref_ents;
+ err = get_subexp (preg, mctx, node_idx, cur_str_idx);
+ if (BE (err != REG_NOERROR, 0))
+ goto free_return;
+
+ /* And add the epsilon closures (which is `new_dest_nodes') of
+ the backreference to appropriate state_log. */
+#ifdef DEBUG
+ assert (dfa->nexts[node_idx] != -1);
+#endif
+ for (; bkc_idx < mctx->nbkref_ents; ++bkc_idx)
+ {
+ int subexp_len;
+ re_dfastate_t *dest_state;
+ struct re_backref_cache_entry *bkref_ent;
+ bkref_ent = mctx->bkref_ents + bkc_idx;
+ if (bkref_ent->node != node_idx || bkref_ent->str_idx != cur_str_idx)
+ continue;
+ subexp_len = bkref_ent->subexp_to - bkref_ent->subexp_from;
+ new_dest_nodes = (subexp_len == 0
+ ? dfa->eclosures + dfa->edests[node_idx].elems[0]
+ : dfa->eclosures + dfa->nexts[node_idx]);
+ dest_str_idx = (cur_str_idx + bkref_ent->subexp_to
+ - bkref_ent->subexp_from);
+ context = re_string_context_at (mctx->input, dest_str_idx - 1,
+ mctx->eflags, preg->newline_anchor);
+ dest_state = mctx->state_log[dest_str_idx];
+ prev_nelem = ((mctx->state_log[cur_str_idx] == NULL) ? 0
+ : mctx->state_log[cur_str_idx]->nodes.nelem);
+ /* Add `new_dest_node' to state_log. */
+ if (dest_state == NULL)
+ {
+ mctx->state_log[dest_str_idx]
+ = re_acquire_state_context (&err, dfa, new_dest_nodes,
+ context);
+ if (BE (mctx->state_log[dest_str_idx] == NULL
+ && err != REG_NOERROR, 0))
+ goto free_return;
+ }
+ else
+ {
+ re_node_set dest_nodes;
+ err = re_node_set_init_union (&dest_nodes,
+ dest_state->entrance_nodes,
+ new_dest_nodes);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&dest_nodes);
+ goto free_return;
+ }
+ mctx->state_log[dest_str_idx]
+ = re_acquire_state_context (&err, dfa, &dest_nodes, context);
+ re_node_set_free (&dest_nodes);
+ if (BE (mctx->state_log[dest_str_idx] == NULL
+ && err != REG_NOERROR, 0))
+ goto free_return;
+ }
+ /* We need to check recursively if the backreference can epsilon
+ transit. */
+ if (subexp_len == 0
+ && mctx->state_log[cur_str_idx]->nodes.nelem > prev_nelem)
+ {
+ err = check_subexp_matching_top (dfa, mctx, new_dest_nodes,
+ cur_str_idx);
+ if (BE (err != REG_NOERROR, 0))
+ goto free_return;
+ err = transit_state_bkref (preg, new_dest_nodes, mctx);
+ if (BE (err != REG_NOERROR, 0))
+ goto free_return;
+ }
+ }
+ }
+ err = REG_NOERROR;
+ free_return:
+ return err;
+}
+
+/* Enumerate all the candidates which the backreference BKREF_NODE can match
+ at BKREF_STR_IDX, and register them by match_ctx_add_entry().
+ Note that we might collect inappropriate candidates here.
+ However, the cost of checking them strictly here is too high, then we
+ delay these checking for prune_impossible_nodes(). */
+
+static reg_errcode_t
+get_subexp (preg, mctx, bkref_node, bkref_str_idx)
+ const regex_t *preg;
+ re_match_context_t *mctx;
+ int bkref_node, bkref_str_idx;
+{
+ int subexp_num, sub_top_idx;
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ char *buf = (char *) re_string_get_buffer (mctx->input);
+ /* Return if we have already checked BKREF_NODE at BKREF_STR_IDX. */
+ int cache_idx = search_cur_bkref_entry (mctx, bkref_str_idx);
+ for (; cache_idx < mctx->nbkref_ents; ++cache_idx)
+ {
+ struct re_backref_cache_entry *entry = mctx->bkref_ents + cache_idx;
+ if (entry->str_idx > bkref_str_idx)
+ break;
+ if (entry->node == bkref_node)
+ return REG_NOERROR; /* We already checked it. */
+ }
+ subexp_num = dfa->nodes[bkref_node].opr.idx - 1;
+
+ /* For each sub expression */
+ for (sub_top_idx = 0; sub_top_idx < mctx->nsub_tops; ++sub_top_idx)
+ {
+ reg_errcode_t err;
+ re_sub_match_top_t *sub_top = mctx->sub_tops[sub_top_idx];
+ re_sub_match_last_t *sub_last;
+ int sub_last_idx, sl_str;
+ char *bkref_str;
+
+ if (dfa->nodes[sub_top->node].opr.idx != subexp_num)
+ continue; /* It isn't related. */
+
+ sl_str = sub_top->str_idx;
+ bkref_str = buf + bkref_str_idx;
+ /* At first, check the last node of sub expressions we already
+ evaluated. */
+ for (sub_last_idx = 0; sub_last_idx < sub_top->nlasts; ++sub_last_idx)
+ {
+ int sl_str_diff;
+ sub_last = sub_top->lasts[sub_last_idx];
+ sl_str_diff = sub_last->str_idx - sl_str;
+ /* The matched string by the sub expression match with the substring
+ at the back reference? */
+ if (sl_str_diff > 0
+ && memcmp (bkref_str, buf + sl_str, sl_str_diff) != 0)
+ break; /* We don't need to search this sub expression any more. */
+ bkref_str += sl_str_diff;
+ sl_str += sl_str_diff;
+ err = get_subexp_sub (preg, mctx, sub_top, sub_last, bkref_node,
+ bkref_str_idx);
+ if (err == REG_NOMATCH)
+ continue;
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ if (sub_last_idx < sub_top->nlasts)
+ continue;
+ if (sub_last_idx > 0)
+ ++sl_str;
+ /* Then, search for the other last nodes of the sub expression. */
+ for (; sl_str <= bkref_str_idx; ++sl_str)
+ {
+ int cls_node, sl_str_off;
+ re_node_set *nodes;
+ sl_str_off = sl_str - sub_top->str_idx;
+ /* The matched string by the sub expression match with the substring
+ at the back reference? */
+ if (sl_str_off > 0
+ && memcmp (bkref_str++, buf + sl_str - 1, 1) != 0)
+ break; /* We don't need to search this sub expression any more. */
+ if (mctx->state_log[sl_str] == NULL)
+ continue;
+ /* Does this state have a ')' of the sub expression? */
+ nodes = &mctx->state_log[sl_str]->nodes;
+ cls_node = find_subexp_node (dfa, nodes, subexp_num, 0);
+ if (cls_node == -1)
+ continue; /* No. */
+ if (sub_top->path == NULL)
+ {
+ sub_top->path = calloc (sizeof (state_array_t),
+ sl_str - sub_top->str_idx + 1);
+ if (sub_top->path == NULL)
+ return REG_ESPACE;
+ }
+ /* Can the OP_OPEN_SUBEXP node arrive the OP_CLOSE_SUBEXP node
+ in the current context? */
+ err = check_arrival (preg, mctx, sub_top->path, sub_top->node,
+ sub_top->str_idx, cls_node, sl_str, 0);
+ if (err == REG_NOMATCH)
+ continue;
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ sub_last = match_ctx_add_sublast (sub_top, cls_node, sl_str);
+ if (BE (sub_last == NULL, 0))
+ return REG_ESPACE;
+ err = get_subexp_sub (preg, mctx, sub_top, sub_last, bkref_node,
+ bkref_str_idx);
+ if (err == REG_NOMATCH)
+ continue;
+ }
+ }
+ return REG_NOERROR;
+}
+
+/* Helper functions for get_subexp(). */
+
+/* Check SUB_LAST can arrive to the back reference BKREF_NODE at BKREF_STR.
+ If it can arrive, register the sub expression expressed with SUB_TOP
+ and SUB_LAST. */
+
+static reg_errcode_t
+get_subexp_sub (preg, mctx, sub_top, sub_last, bkref_node, bkref_str)
+ const regex_t *preg;
+ re_match_context_t *mctx;
+ re_sub_match_top_t *sub_top;
+ re_sub_match_last_t *sub_last;
+ int bkref_node, bkref_str;
+{
+ reg_errcode_t err;
+ int to_idx;
+ /* Can the subexpression arrive the back reference? */
+ err = check_arrival (preg, mctx, &sub_last->path, sub_last->node,
+ sub_last->str_idx, bkref_node, bkref_str, 1);
+ if (err != REG_NOERROR)
+ return err;
+ err = match_ctx_add_entry (mctx, bkref_node, bkref_str, sub_top->str_idx,
+ sub_last->str_idx);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ to_idx = bkref_str + sub_last->str_idx - sub_top->str_idx;
+ clean_state_log_if_need (mctx, to_idx);
+ return REG_NOERROR;
+}
+
+/* Find the first node which is '(' or ')' and whose index is SUBEXP_IDX.
+ Search '(' if FL_OPEN, or search ')' otherwise.
+ TODO: This function isn't efficient...
+ Because there might be more than one nodes whose types are
+ OP_OPEN_SUBEXP and whose index is SUBEXP_IDX, we must check all
+ nodes.
+ E.g. RE: (a){2} */
+
+static int
+find_subexp_node (dfa, nodes, subexp_idx, fl_open)
+ re_dfa_t *dfa;
+ re_node_set *nodes;
+ int subexp_idx, fl_open;
+{
+ int cls_idx;
+ for (cls_idx = 0; cls_idx < nodes->nelem; ++cls_idx)
+ {
+ int cls_node = nodes->elems[cls_idx];
+ re_token_t *node = dfa->nodes + cls_node;
+ if (((fl_open && node->type == OP_OPEN_SUBEXP)
+ || (!fl_open && node->type == OP_CLOSE_SUBEXP))
+ && node->opr.idx == subexp_idx)
+ return cls_node;
+ }
+ return -1;
+}
+
+/* Check whether the node TOP_NODE at TOP_STR can arrive to the node
+ LAST_NODE at LAST_STR. We record the path onto PATH since it will be
+ heavily reused.
+ Return REG_NOERROR if it can arrive, or REG_NOMATCH otherwise. */
+
+static reg_errcode_t
+check_arrival (preg, mctx, path, top_node, top_str, last_node, last_str,
+ fl_open)
+ const regex_t *preg;
+ re_match_context_t *mctx;
+ state_array_t *path;
+ int top_node, top_str, last_node, last_str, fl_open;
+{
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ reg_errcode_t err;
+ int subexp_num, backup_cur_idx, str_idx, null_cnt;
+ re_dfastate_t *cur_state = NULL;
+ re_node_set *cur_nodes, next_nodes;
+ re_dfastate_t **backup_state_log;
+ unsigned int context;
+
+ subexp_num = dfa->nodes[top_node].opr.idx;
+ /* Extend the buffer if we need. */
+ if (path->alloc < last_str + mctx->max_mb_elem_len + 1)
+ {
+ re_dfastate_t **new_array;
+ int old_alloc = path->alloc;
+ path->alloc += last_str + mctx->max_mb_elem_len + 1;
+ new_array = re_realloc (path->array, re_dfastate_t *, path->alloc);
+ if (new_array == NULL)
+ return REG_ESPACE;
+ path->array = new_array;
+ memset (new_array + old_alloc, '\0',
+ sizeof (re_dfastate_t *) * (path->alloc - old_alloc));
+ }
+
+ str_idx = path->next_idx == 0 ? top_str : path->next_idx;
+
+ /* Temporary modify MCTX. */
+ backup_state_log = mctx->state_log;
+ backup_cur_idx = mctx->input->cur_idx;
+ mctx->state_log = path->array;
+ mctx->input->cur_idx = str_idx;
+
+ /* Setup initial node set. */
+ context = re_string_context_at (mctx->input, str_idx - 1, mctx->eflags,
+ preg->newline_anchor);
+ if (str_idx == top_str)
+ {
+ err = re_node_set_init_1 (&next_nodes, top_node);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ err = check_arrival_expand_ecl (dfa, &next_nodes, subexp_num, fl_open);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ else
+ {
+ cur_state = mctx->state_log[str_idx];
+ if (cur_state && cur_state->has_backref)
+ {
+ err = re_node_set_init_copy (&next_nodes, &cur_state->nodes);
+ if (BE ( err != REG_NOERROR, 0))
+ return err;
+ }
+ else
+ re_node_set_init_empty (&next_nodes);
+ }
+ if (str_idx == top_str || (cur_state && cur_state->has_backref))
+ {
+ if (next_nodes.nelem)
+ {
+ err = expand_bkref_cache (preg, mctx, &next_nodes, str_idx, last_str,
+ subexp_num, fl_open);
+ if (BE ( err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ cur_state = re_acquire_state_context (&err, dfa, &next_nodes, context);
+ if (BE (cur_state == NULL && err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ mctx->state_log[str_idx] = cur_state;
+ }
+
+ for (null_cnt = 0; str_idx < last_str && null_cnt <= mctx->max_mb_elem_len;)
+ {
+ re_node_set_empty (&next_nodes);
+ if (mctx->state_log[str_idx + 1])
+ {
+ err = re_node_set_merge (&next_nodes,
+ &mctx->state_log[str_idx + 1]->nodes);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ if (cur_state)
+ {
+ err = check_arrival_add_next_nodes(preg, dfa, mctx, str_idx,
+ &cur_state->nodes, &next_nodes);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ ++str_idx;
+ if (next_nodes.nelem)
+ {
+ err = check_arrival_expand_ecl (dfa, &next_nodes, subexp_num,
+ fl_open);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ err = expand_bkref_cache (preg, mctx, &next_nodes, str_idx, last_str,
+ subexp_num, fl_open);
+ if (BE ( err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ }
+ context = re_string_context_at (mctx->input, str_idx - 1, mctx->eflags,
+ preg->newline_anchor);
+ cur_state = re_acquire_state_context (&err, dfa, &next_nodes, context);
+ if (BE (cur_state == NULL && err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&next_nodes);
+ return err;
+ }
+ mctx->state_log[str_idx] = cur_state;
+ null_cnt = cur_state == NULL ? null_cnt + 1 : 0;
+ }
+ re_node_set_free (&next_nodes);
+ cur_nodes = (mctx->state_log[last_str] == NULL ? NULL
+ : &mctx->state_log[last_str]->nodes);
+ path->next_idx = str_idx;
+
+ /* Fix MCTX. */
+ mctx->state_log = backup_state_log;
+ mctx->input->cur_idx = backup_cur_idx;
+
+ if (cur_nodes == NULL)
+ return REG_NOMATCH;
+ /* Then check the current node set has the node LAST_NODE. */
+ return (re_node_set_contains (cur_nodes, last_node)
+ || re_node_set_contains (cur_nodes, last_node) ? REG_NOERROR
+ : REG_NOMATCH);
+}
+
+/* Helper functions for check_arrival. */
+
+/* Calculate the destination nodes of CUR_NODES at STR_IDX, and append them
+ to NEXT_NODES.
+ TODO: This function is similar to the functions transit_state*(),
+ however this function has many additional works.
+ Can't we unify them? */
+
+static reg_errcode_t
+check_arrival_add_next_nodes (preg, dfa, mctx, str_idx, cur_nodes, next_nodes)
+ const regex_t *preg;
+ re_dfa_t *dfa;
+ re_match_context_t *mctx;
+ int str_idx;
+ re_node_set *cur_nodes, *next_nodes;
+{
+ int cur_idx;
+ reg_errcode_t err;
+ re_node_set union_set;
+ re_node_set_init_empty (&union_set);
+ for (cur_idx = 0; cur_idx < cur_nodes->nelem; ++cur_idx)
+ {
+ int naccepted = 0;
+ int cur_node = cur_nodes->elems[cur_idx];
+ re_token_type_t type = dfa->nodes[cur_node].type;
+ if (IS_EPSILON_NODE(type))
+ continue;
+#ifdef RE_ENABLE_I18N
+ /* If the node may accept `multi byte'. */
+ if (ACCEPT_MB_NODE (type))
+ {
+ naccepted = check_node_accept_bytes (preg, cur_node, mctx->input,
+ str_idx);
+ if (naccepted > 1)
+ {
+ re_dfastate_t *dest_state;
+ int next_node = dfa->nexts[cur_node];
+ int next_idx = str_idx + naccepted;
+ dest_state = mctx->state_log[next_idx];
+ re_node_set_empty (&union_set);
+ if (dest_state)
+ {
+ err = re_node_set_merge (&union_set, &dest_state->nodes);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&union_set);
+ return err;
+ }
+ err = re_node_set_insert (&union_set, next_node);
+ if (BE (err < 0, 0))
+ {
+ re_node_set_free (&union_set);
+ return REG_ESPACE;
+ }
+ }
+ else
+ {
+ err = re_node_set_insert (&union_set, next_node);
+ if (BE (err < 0, 0))
+ {
+ re_node_set_free (&union_set);
+ return REG_ESPACE;
+ }
+ }
+ mctx->state_log[next_idx] = re_acquire_state (&err, dfa,
+ &union_set);
+ if (BE (mctx->state_log[next_idx] == NULL
+ && err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&union_set);
+ return err;
+ }
+ }
+ }
+#endif /* RE_ENABLE_I18N */
+ if (naccepted
+ || check_node_accept (preg, dfa->nodes + cur_node, mctx,
+ str_idx))
+ {
+ err = re_node_set_insert (next_nodes, dfa->nexts[cur_node]);
+ if (BE (err < 0, 0))
+ {
+ re_node_set_free (&union_set);
+ return REG_ESPACE;
+ }
+ }
+ }
+ re_node_set_free (&union_set);
+ return REG_NOERROR;
+}
+
+/* For all the nodes in CUR_NODES, add the epsilon closures of them to
+ CUR_NODES, however exclude the nodes which are:
+ - inside the sub expression whose number is EX_SUBEXP, if FL_OPEN.
+ - out of the sub expression whose number is EX_SUBEXP, if !FL_OPEN.
+*/
+
+static reg_errcode_t
+check_arrival_expand_ecl (dfa, cur_nodes, ex_subexp, fl_open)
+ re_dfa_t *dfa;
+ re_node_set *cur_nodes;
+ int ex_subexp, fl_open;
+{
+ reg_errcode_t err;
+ int idx, outside_node;
+ re_node_set new_nodes;
+#ifdef DEBUG
+ assert (cur_nodes->nelem);
+#endif
+ err = re_node_set_alloc (&new_nodes, cur_nodes->nelem);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ /* Create a new node set NEW_NODES with the nodes which are epsilon
+ closures of the node in CUR_NODES. */
+
+ for (idx = 0; idx < cur_nodes->nelem; ++idx)
+ {
+ int cur_node = cur_nodes->elems[idx];
+ re_node_set *eclosure = dfa->eclosures + cur_node;
+ outside_node = find_subexp_node (dfa, eclosure, ex_subexp, fl_open);
+ if (outside_node == -1)
+ {
+ /* There are no problematic nodes, just merge them. */
+ err = re_node_set_merge (&new_nodes, eclosure);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&new_nodes);
+ return err;
+ }
+ }
+ else
+ {
+ /* There are problematic nodes, re-calculate incrementally. */
+ err = check_arrival_expand_ecl_sub (dfa, &new_nodes, cur_node,
+ ex_subexp, fl_open);
+ if (BE (err != REG_NOERROR, 0))
+ {
+ re_node_set_free (&new_nodes);
+ return err;
+ }
+ }
+ }
+ re_node_set_free (cur_nodes);
+ *cur_nodes = new_nodes;
+ return REG_NOERROR;
+}
+
+/* Helper function for check_arrival_expand_ecl.
+ Check incrementally the epsilon closure of TARGET, and if it isn't
+ problematic append it to DST_NODES. */
+
+static reg_errcode_t
+check_arrival_expand_ecl_sub (dfa, dst_nodes, target, ex_subexp, fl_open)
+ re_dfa_t *dfa;
+ int target, ex_subexp, fl_open;
+ re_node_set *dst_nodes;
+{
+ int cur_node, type;
+ for (cur_node = target; !re_node_set_contains (dst_nodes, cur_node);)
+ {
+ int err;
+ type = dfa->nodes[cur_node].type;
+
+ if (((type == OP_OPEN_SUBEXP && fl_open)
+ || (type == OP_CLOSE_SUBEXP && !fl_open))
+ && dfa->nodes[cur_node].opr.idx == ex_subexp)
+ {
+ if (!fl_open)
+ {
+ err = re_node_set_insert (dst_nodes, cur_node);
+ if (BE (err == -1, 0))
+ return REG_ESPACE;
+ }
+ break;
+ }
+ err = re_node_set_insert (dst_nodes, cur_node);
+ if (BE (err == -1, 0))
+ return REG_ESPACE;
+ if (dfa->edests[cur_node].nelem == 0)
+ break;
+ if (dfa->edests[cur_node].nelem == 2)
+ {
+ err = check_arrival_expand_ecl_sub (dfa, dst_nodes,
+ dfa->edests[cur_node].elems[1],
+ ex_subexp, fl_open);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ cur_node = dfa->edests[cur_node].elems[0];
+ }
+ return REG_NOERROR;
+}
+
+
+/* For all the back references in the current state, calculate the
+ destination of the back references by the appropriate entry
+ in MCTX->BKREF_ENTS. */
+
+static reg_errcode_t
+expand_bkref_cache (preg, mctx, cur_nodes, cur_str, last_str, subexp_num,
+ fl_open)
+ const regex_t *preg;
+ re_match_context_t *mctx;
+ int cur_str, last_str, subexp_num, fl_open;
+ re_node_set *cur_nodes;
+{
+ reg_errcode_t err;
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ int cache_idx, cache_idx_start;
+ /* The current state. */
+
+ cache_idx_start = search_cur_bkref_entry (mctx, cur_str);
+ for (cache_idx = cache_idx_start; cache_idx < mctx->nbkref_ents; ++cache_idx)
+ {
+ int to_idx, next_node;
+ struct re_backref_cache_entry *ent = mctx->bkref_ents + cache_idx;
+ if (ent->str_idx > cur_str)
+ break;
+ /* Is this entry ENT is appropriate? */
+ if (!re_node_set_contains (cur_nodes, ent->node))
+ continue; /* No. */
+
+ to_idx = cur_str + ent->subexp_to - ent->subexp_from;
+ /* Calculate the destination of the back reference, and append it
+ to MCTX->STATE_LOG. */
+ if (to_idx == cur_str)
+ {
+ /* The backreference did epsilon transit, we must re-check all the
+ node in the current state. */
+ re_node_set new_dests;
+ reg_errcode_t err2, err3;
+ next_node = dfa->edests[ent->node].elems[0];
+ if (re_node_set_contains (cur_nodes, next_node))
+ continue;
+ err = re_node_set_init_1 (&new_dests, next_node);
+ err2 = check_arrival_expand_ecl (dfa, &new_dests, subexp_num,
+ fl_open);
+ err3 = re_node_set_merge (cur_nodes, &new_dests);
+ re_node_set_free (&new_dests);
+ if (BE (err != REG_NOERROR || err2 != REG_NOERROR
+ || err3 != REG_NOERROR, 0))
+ {
+ err = (err != REG_NOERROR ? err
+ : (err2 != REG_NOERROR ? err2 : err3));
+ return err;
+ }
+ /* TODO: It is still inefficient... */
+ cache_idx = cache_idx_start - 1;
+ continue;
+ }
+ else
+ {
+ re_node_set union_set;
+ next_node = dfa->nexts[ent->node];
+ if (mctx->state_log[to_idx])
+ {
+ int ret;
+ if (re_node_set_contains (&mctx->state_log[to_idx]->nodes,
+ next_node))
+ continue;
+ err = re_node_set_init_copy (&union_set,
+ &mctx->state_log[to_idx]->nodes);
+ ret = re_node_set_insert (&union_set, next_node);
+ if (BE (err != REG_NOERROR || ret < 0, 0))
+ {
+ re_node_set_free (&union_set);
+ err = err != REG_NOERROR ? err : REG_ESPACE;
+ return err;
+ }
+ }
+ else
+ {
+ err = re_node_set_init_1 (&union_set, next_node);
+ if (BE (err != REG_NOERROR, 0))
+ return err;
+ }
+ mctx->state_log[to_idx] = re_acquire_state (&err, dfa, &union_set);
+ re_node_set_free (&union_set);
+ if (BE (mctx->state_log[to_idx] == NULL
+ && err != REG_NOERROR, 0))
+ return err;
+ }
+ }
+ return REG_NOERROR;
+}
+
+/* Build transition table for the state.
+ Return the new table if succeeded, otherwise return NULL. */
+
+static re_dfastate_t **
+build_trtable (preg, state, fl_search)
+ const regex_t *preg;
+ const re_dfastate_t *state;
+ int fl_search;
+{
+ reg_errcode_t err;
+ re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ int i, j, k, ch;
+ int dests_node_malloced = 0, dest_states_malloced = 0;
+ int ndests; /* Number of the destination states from `state'. */
+ re_dfastate_t **trtable;
+ re_dfastate_t **dest_states = NULL, **dest_states_word, **dest_states_nl;
+ re_node_set follows, *dests_node;
+ bitset *dests_ch;
+ bitset acceptable;
+
+ /* We build DFA states which corresponds to the destination nodes
+ from `state'. `dests_node[i]' represents the nodes which i-th
+ destination state contains, and `dests_ch[i]' represents the
+ characters which i-th destination state accepts. */
+#ifdef _LIBC
+ if (__libc_use_alloca ((sizeof (re_node_set) + sizeof (bitset)) * SBC_MAX))
+ dests_node = (re_node_set *)
+ alloca ((sizeof (re_node_set) + sizeof (bitset)) * SBC_MAX);
+ else
+#endif
+ {
+ dests_node = (re_node_set *)
+ malloc ((sizeof (re_node_set) + sizeof (bitset)) * SBC_MAX);
+ if (BE (dests_node == NULL, 0))
+ return NULL;
+ dests_node_malloced = 1;
+ }
+ dests_ch = (bitset *) (dests_node + SBC_MAX);
+
+ /* Initialize transiton table. */
+ trtable = (re_dfastate_t **) calloc (sizeof (re_dfastate_t *), SBC_MAX);
+ if (BE (trtable == NULL, 0))
+ {
+ if (dests_node_malloced)
+ free (dests_node);
+ return NULL;
+ }
+
+ /* At first, group all nodes belonging to `state' into several
+ destinations. */
+ ndests = group_nodes_into_DFAstates (preg, state, dests_node, dests_ch);
+ if (BE (ndests <= 0, 0))
+ {
+ if (dests_node_malloced)
+ free (dests_node);
+ /* Return NULL in case of an error, trtable otherwise. */
+ if (ndests == 0)
+ return trtable;
+ free (trtable);
+ return NULL;
+ }
+
+ err = re_node_set_alloc (&follows, ndests + 1);
+ if (BE (err != REG_NOERROR, 0))
+ goto out_free;
+
+#ifdef _LIBC
+ if (__libc_use_alloca ((sizeof (re_node_set) + sizeof (bitset)) * SBC_MAX
+ + ndests * 3 * sizeof (re_dfastate_t *)))
+ dest_states = (re_dfastate_t **)
+ alloca (ndests * 3 * sizeof (re_dfastate_t *));
+ else
+#endif
+ {
+ dest_states = (re_dfastate_t **)
+ malloc (ndests * 3 * sizeof (re_dfastate_t *));
+ if (BE (dest_states == NULL, 0))
+ {
+out_free:
+ if (dest_states_malloced)
+ free (dest_states);
+ re_node_set_free (&follows);
+ for (i = 0; i < ndests; ++i)
+ re_node_set_free (dests_node + i);
+ free (trtable);
+ if (dests_node_malloced)
+ free (dests_node);
+ return NULL;
+ }
+ dest_states_malloced = 1;
+ }
+ dest_states_word = dest_states + ndests;
+ dest_states_nl = dest_states_word + ndests;
+ bitset_empty (acceptable);
+
+ /* Then build the states for all destinations. */
+ for (i = 0; i < ndests; ++i)
+ {
+ int next_node;
+ re_node_set_empty (&follows);
+ /* Merge the follows of this destination states. */
+ for (j = 0; j < dests_node[i].nelem; ++j)
+ {
+ next_node = dfa->nexts[dests_node[i].elems[j]];
+ if (next_node != -1)
+ {
+ err = re_node_set_merge (&follows, dfa->eclosures + next_node);
+ if (BE (err != REG_NOERROR, 0))
+ goto out_free;
+ }
+ }
+ /* If search flag is set, merge the initial state. */
+ if (fl_search)
+ {
+#ifdef RE_ENABLE_I18N
+ int not_initial = 0;
+ for (j = 0; j < follows.nelem; ++j)
+ if (dfa->nodes[follows.elems[j]].type == CHARACTER)
+ {
+ not_initial = dfa->nodes[follows.elems[j]].mb_partial;
+ break;
+ }
+ if (!not_initial)
+#endif
+ {
+ err = re_node_set_merge (&follows,
+ dfa->init_state->entrance_nodes);
+ if (BE (err != REG_NOERROR, 0))
+ goto out_free;
+ }
+ }
+ dest_states[i] = re_acquire_state_context (&err, dfa, &follows, 0);
+ if (BE (dest_states[i] == NULL && err != REG_NOERROR, 0))
+ goto out_free;
+ /* If the new state has context constraint,
+ build appropriate states for these contexts. */
+ if (dest_states[i]->has_constraint)
+ {
+ dest_states_word[i] = re_acquire_state_context (&err, dfa, &follows,
+ CONTEXT_WORD);
+ if (BE (dest_states_word[i] == NULL && err != REG_NOERROR, 0))
+ goto out_free;
+ dest_states_nl[i] = re_acquire_state_context (&err, dfa, &follows,
+ CONTEXT_NEWLINE);
+ if (BE (dest_states_nl[i] == NULL && err != REG_NOERROR, 0))
+ goto out_free;
+ }
+ else
+ {
+ dest_states_word[i] = dest_states[i];
+ dest_states_nl[i] = dest_states[i];
+ }
+ bitset_merge (acceptable, dests_ch[i]);
+ }
+
+ /* Update the transition table. */
+ /* For all characters ch...: */
+ for (i = 0, ch = 0; i < BITSET_UINTS; ++i)
+ for (j = 0; j < UINT_BITS; ++j, ++ch)
+ if ((acceptable[i] >> j) & 1)
+ {
+ /* The current state accepts the character ch. */
+ if (IS_WORD_CHAR (ch))
+ {
+ for (k = 0; k < ndests; ++k)
+ if ((dests_ch[k][i] >> j) & 1)
+ {
+ /* k-th destination accepts the word character ch. */
+ trtable[ch] = dest_states_word[k];
+ /* There must be only one destination which accepts
+ character ch. See group_nodes_into_DFAstates. */
+ break;
+ }
+ }
+ else /* not WORD_CHAR */
+ {
+ for (k = 0; k < ndests; ++k)
+ if ((dests_ch[k][i] >> j) & 1)
+ {
+ /* k-th destination accepts the non-word character ch. */
+ trtable[ch] = dest_states[k];
+ /* There must be only one destination which accepts
+ character ch. See group_nodes_into_DFAstates. */
+ break;
+ }
+ }
+ }
+ /* new line */
+ if (bitset_contain (acceptable, NEWLINE_CHAR))
+ {
+ /* The current state accepts newline character. */
+ for (k = 0; k < ndests; ++k)
+ if (bitset_contain (dests_ch[k], NEWLINE_CHAR))
+ {
+ /* k-th destination accepts newline character. */
+ trtable[NEWLINE_CHAR] = dest_states_nl[k];
+ /* There must be only one destination which accepts
+ newline. See group_nodes_into_DFAstates. */
+ break;
+ }
+ }
+
+ if (dest_states_malloced)
+ free (dest_states);
+
+ re_node_set_free (&follows);
+ for (i = 0; i < ndests; ++i)
+ re_node_set_free (dests_node + i);
+
+ if (dests_node_malloced)
+ free (dests_node);
+
+ return trtable;
+}
+
+/* Group all nodes belonging to STATE into several destinations.
+ Then for all destinations, set the nodes belonging to the destination
+ to DESTS_NODE[i] and set the characters accepted by the destination
+ to DEST_CH[i]. This function return the number of destinations. */
+
+static int
+group_nodes_into_DFAstates (preg, state, dests_node, dests_ch)
+ const regex_t *preg;
+ const re_dfastate_t *state;
+ re_node_set *dests_node;
+ bitset *dests_ch;
+{
+ reg_errcode_t err;
+ const re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ int i, j, k;
+ int ndests; /* Number of the destinations from `state'. */
+ bitset accepts; /* Characters a node can accept. */
+ const re_node_set *cur_nodes = &state->nodes;
+ bitset_empty (accepts);
+ ndests = 0;
+
+ /* For all the nodes belonging to `state', */
+ for (i = 0; i < cur_nodes->nelem; ++i)
+ {
+ re_token_t *node = &dfa->nodes[cur_nodes->elems[i]];
+ re_token_type_t type = node->type;
+ unsigned int constraint = node->constraint;
+
+ /* Enumerate all single byte character this node can accept. */
+ if (type == CHARACTER)
+ bitset_set (accepts, node->opr.c);
+ else if (type == SIMPLE_BRACKET)
+ {
+ bitset_merge (accepts, node->opr.sbcset);
+ }
+ else if (type == OP_PERIOD)
+ {
+ bitset_set_all (accepts);
+ if (!(preg->syntax & RE_DOT_NEWLINE))
+ bitset_clear (accepts, '\n');
+ if (preg->syntax & RE_DOT_NOT_NULL)
+ bitset_clear (accepts, '\0');
+ }
+ else
+ continue;
+
+ /* Check the `accepts' and sift the characters which are not
+ match it the context. */
+ if (constraint)
+ {
+ if (constraint & NEXT_WORD_CONSTRAINT)
+ for (j = 0; j < BITSET_UINTS; ++j)
+ accepts[j] &= dfa->word_char[j];
+ if (constraint & NEXT_NOTWORD_CONSTRAINT)
+ for (j = 0; j < BITSET_UINTS; ++j)
+ accepts[j] &= ~dfa->word_char[j];
+ if (constraint & NEXT_NEWLINE_CONSTRAINT)
+ {
+ int accepts_newline = bitset_contain (accepts, NEWLINE_CHAR);
+ bitset_empty (accepts);
+ if (accepts_newline)
+ bitset_set (accepts, NEWLINE_CHAR);
+ else
+ continue;
+ }
+ }
+
+ /* Then divide `accepts' into DFA states, or create a new
+ state. */
+ for (j = 0; j < ndests; ++j)
+ {
+ bitset intersec; /* Intersection sets, see below. */
+ bitset remains;
+ /* Flags, see below. */
+ int has_intersec, not_subset, not_consumed;
+
+ /* Optimization, skip if this state doesn't accept the character. */
+ if (type == CHARACTER && !bitset_contain (dests_ch[j], node->opr.c))
+ continue;
+
+ /* Enumerate the intersection set of this state and `accepts'. */
+ has_intersec = 0;
+ for (k = 0; k < BITSET_UINTS; ++k)
+ has_intersec |= intersec[k] = accepts[k] & dests_ch[j][k];
+ /* And skip if the intersection set is empty. */
+ if (!has_intersec)
+ continue;
+
+ /* Then check if this state is a subset of `accepts'. */
+ not_subset = not_consumed = 0;
+ for (k = 0; k < BITSET_UINTS; ++k)
+ {
+ not_subset |= remains[k] = ~accepts[k] & dests_ch[j][k];
+ not_consumed |= accepts[k] = accepts[k] & ~dests_ch[j][k];
+ }
+
+ /* If this state isn't a subset of `accepts', create a
+ new group state, which has the `remains'. */
+ if (not_subset)
+ {
+ bitset_copy (dests_ch[ndests], remains);
+ bitset_copy (dests_ch[j], intersec);
+ err = re_node_set_init_copy (dests_node + ndests, &dests_node[j]);
+ if (BE (err != REG_NOERROR, 0))
+ goto error_return;
+ ++ndests;
+ }
+
+ /* Put the position in the current group. */
+ err = re_node_set_insert (&dests_node[j], cur_nodes->elems[i]);
+ if (BE (err < 0, 0))
+ goto error_return;
+
+ /* If all characters are consumed, go to next node. */
+ if (!not_consumed)
+ break;
+ }
+ /* Some characters remain, create a new group. */
+ if (j == ndests)
+ {
+ bitset_copy (dests_ch[ndests], accepts);
+ err = re_node_set_init_1 (dests_node + ndests, cur_nodes->elems[i]);
+ if (BE (err != REG_NOERROR, 0))
+ goto error_return;
+ ++ndests;
+ bitset_empty (accepts);
+ }
+ }
+ return ndests;
+ error_return:
+ for (j = 0; j < ndests; ++j)
+ re_node_set_free (dests_node + j);
+ return -1;
+}
+
+#ifdef RE_ENABLE_I18N
+/* Check how many bytes the node `dfa->nodes[node_idx]' accepts.
+ Return the number of the bytes the node accepts.
+ STR_IDX is the current index of the input string.
+
+ This function handles the nodes which can accept one character, or
+ one collating element like '.', '[a-z]', opposite to the other nodes
+ can only accept one byte. */
+
+static int
+check_node_accept_bytes (preg, node_idx, input, str_idx)
+ const regex_t *preg;
+ int node_idx, str_idx;
+ const re_string_t *input;
+{
+ const re_dfa_t *dfa = (re_dfa_t *) preg->buffer;
+ const re_token_t *node = dfa->nodes + node_idx;
+ int elem_len = re_string_elem_size_at (input, str_idx);
+ int char_len = re_string_char_size_at (input, str_idx);
+ int i;
+# ifdef _LIBC
+ int j;
+ uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+# endif /* _LIBC */
+ if (elem_len <= 1 && char_len <= 1)
+ return 0;
+ if (node->type == OP_PERIOD)
+ {
+ /* '.' accepts any one character except the following two cases. */
+ if ((!(preg->syntax & RE_DOT_NEWLINE) &&
+ re_string_byte_at (input, str_idx) == '\n') ||
+ ((preg->syntax & RE_DOT_NOT_NULL) &&
+ re_string_byte_at (input, str_idx) == '\0'))
+ return 0;
+ return char_len;
+ }
+ else if (node->type == COMPLEX_BRACKET)
+ {
+ const re_charset_t *cset = node->opr.mbcset;
+# ifdef _LIBC
+ const unsigned char *pin = re_string_get_buffer (input) + str_idx;
+# endif /* _LIBC */
+ int match_len = 0;
+ wchar_t wc = ((cset->nranges || cset->nchar_classes || cset->nmbchars)
+ ? re_string_wchar_at (input, str_idx) : 0);
+
+ /* match with multibyte character? */
+ for (i = 0; i < cset->nmbchars; ++i)
+ if (wc == cset->mbchars[i])
+ {
+ match_len = char_len;
+ goto check_node_accept_bytes_match;
+ }
+ /* match with character_class? */
+ for (i = 0; i < cset->nchar_classes; ++i)
+ {
+ wctype_t wt = cset->char_classes[i];
+ if (__iswctype (wc, wt))
+ {
+ match_len = char_len;
+ goto check_node_accept_bytes_match;
+ }
+ }
+
+# ifdef _LIBC
+ if (nrules != 0)
+ {
+ unsigned int in_collseq = 0;
+ const int32_t *table, *indirect;
+ const unsigned char *weights, *extra;
+ const char *collseqwc;
+ int32_t idx;
+ /* This #include defines a local function! */
+# include <locale/weight.h>
+
+ /* match with collating_symbol? */
+ if (cset->ncoll_syms)
+ extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB);
+ for (i = 0; i < cset->ncoll_syms; ++i)
+ {
+ const unsigned char *coll_sym = extra + cset->coll_syms[i];
+ /* Compare the length of input collating element and
+ the length of current collating element. */
+ if (*coll_sym != elem_len)
+ continue;
+ /* Compare each bytes. */
+ for (j = 0; j < *coll_sym; j++)
+ if (pin[j] != coll_sym[1 + j])
+ break;
+ if (j == *coll_sym)
+ {
+ /* Match if every bytes is equal. */
+ match_len = j;
+ goto check_node_accept_bytes_match;
+ }
+ }
+
+ if (cset->nranges)
+ {
+ if (elem_len <= char_len)
+ {
+ collseqwc = _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQWC);
+ in_collseq = collseq_table_lookup (collseqwc, wc);
+ }
+ else
+ in_collseq = find_collation_sequence_value (pin, elem_len);
+ }
+ /* match with range expression? */
+ for (i = 0; i < cset->nranges; ++i)
+ if (cset->range_starts[i] <= in_collseq
+ && in_collseq <= cset->range_ends[i])
+ {
+ match_len = elem_len;
+ goto check_node_accept_bytes_match;
+ }
+
+ /* match with equivalence_class? */
+ if (cset->nequiv_classes)
+ {
+ const unsigned char *cp = pin;
+ table = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
+ weights = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB);
+ extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
+ indirect = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
+ idx = findidx (&cp);
+ if (idx > 0)
+ for (i = 0; i < cset->nequiv_classes; ++i)
+ {
+ int32_t equiv_class_idx = cset->equiv_classes[i];
+ size_t weight_len = weights[idx];
+ if (weight_len == weights[equiv_class_idx])
+ {
+ int cnt = 0;
+ while (cnt <= weight_len
+ && (weights[equiv_class_idx + 1 + cnt]
+ == weights[idx + 1 + cnt]))
+ ++cnt;
+ if (cnt > weight_len)
+ {
+ match_len = elem_len;
+ goto check_node_accept_bytes_match;
+ }
+ }
+ }
+ }
+ }
+ else
+# endif /* _LIBC */
+ {
+ /* match with range expression? */
+#if __GNUC__ >= 2
+ wchar_t cmp_buf[] = {L'\0', L'\0', wc, L'\0', L'\0', L'\0'};
+#else
+ wchar_t cmp_buf[] = {L'\0', L'\0', L'\0', L'\0', L'\0', L'\0'};
+ cmp_buf[2] = wc;
+#endif
+ for (i = 0; i < cset->nranges; ++i)
+ {
+ cmp_buf[0] = cset->range_starts[i];
+ cmp_buf[4] = cset->range_ends[i];
+ if (wcscoll (cmp_buf, cmp_buf + 2) <= 0
+ && wcscoll (cmp_buf + 2, cmp_buf + 4) <= 0)
+ {
+ match_len = char_len;
+ goto check_node_accept_bytes_match;
+ }
+ }
+ }
+ check_node_accept_bytes_match:
+ if (!cset->non_match)
+ return match_len;
+ else
+ {
+ if (match_len > 0)
+ return 0;
+ else
+ return (elem_len > char_len) ? elem_len : char_len;
+ }
+ }
+ return 0;
+}
+
+# ifdef _LIBC
+static unsigned int
+find_collation_sequence_value (mbs, mbs_len)
+ const unsigned char *mbs;
+ size_t mbs_len;
+{
+ uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+ if (nrules == 0)
+ {
+ if (mbs_len == 1)
+ {
+ /* No valid character. Match it as a single byte character. */
+ const unsigned char *collseq = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQMB);
+ return collseq[mbs[0]];
+ }
+ return UINT_MAX;
+ }
+ else
+ {
+ int32_t idx;
+ const unsigned char *extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB);
+
+ for (idx = 0; ;)
+ {
+ int mbs_cnt, found = 0;
+ int32_t elem_mbs_len;
+ /* Skip the name of collating element name. */
+ idx = idx + extra[idx] + 1;
+ elem_mbs_len = extra[idx++];
+ if (mbs_len == elem_mbs_len)
+ {
+ for (mbs_cnt = 0; mbs_cnt < elem_mbs_len; ++mbs_cnt)
+ if (extra[idx + mbs_cnt] != mbs[mbs_cnt])
+ break;
+ if (mbs_cnt == elem_mbs_len)
+ /* Found the entry. */
+ found = 1;
+ }
+ /* Skip the byte sequence of the collating element. */
+ idx += elem_mbs_len;
+ /* Adjust for the alignment. */
+ idx = (idx + 3) & ~3;
+ /* Skip the collation sequence value. */
+ idx += sizeof (uint32_t);
+ /* Skip the wide char sequence of the collating element. */
+ idx = idx + sizeof (uint32_t) * (extra[idx] + 1);
+ /* If we found the entry, return the sequence value. */
+ if (found)
+ return *(uint32_t *) (extra + idx);
+ /* Skip the collation sequence value. */
+ idx += sizeof (uint32_t);
+ }
+ }
+}
+# endif /* _LIBC */
+#endif /* RE_ENABLE_I18N */
+
+/* Check whether the node accepts the byte which is IDX-th
+ byte of the INPUT. */
+
+static int
+check_node_accept (preg, node, mctx, idx)
+ const regex_t *preg;
+ const re_token_t *node;
+ const re_match_context_t *mctx;
+ int idx;
+{
+ unsigned char ch;
+ if (node->constraint)
+ {
+ /* The node has constraints. Check whether the current context
+ satisfies the constraints. */
+ unsigned int context = re_string_context_at (mctx->input, idx,
+ mctx->eflags,
+ preg->newline_anchor);
+ if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context))
+ return 0;
+ }
+ ch = re_string_byte_at (mctx->input, idx);
+ if (node->type == CHARACTER)
+ return node->opr.c == ch;
+ else if (node->type == SIMPLE_BRACKET)
+ return bitset_contain (node->opr.sbcset, ch);
+ else if (node->type == OP_PERIOD)
+ return !((ch == '\n' && !(preg->syntax & RE_DOT_NEWLINE))
+ || (ch == '\0' && (preg->syntax & RE_DOT_NOT_NULL)));
+ else
+ return 0;
+}
+
+/* Extend the buffers, if the buffers have run out. */
+
+static reg_errcode_t
+extend_buffers (mctx)
+ re_match_context_t *mctx;
+{
+ reg_errcode_t ret;
+ re_string_t *pstr = mctx->input;
+
+ /* Double the lengthes of the buffers. */
+ ret = re_string_realloc_buffers (pstr, pstr->bufs_len * 2);
+ if (BE (ret != REG_NOERROR, 0))
+ return ret;
+
+ if (mctx->state_log != NULL)
+ {
+ /* And double the length of state_log. */
+ re_dfastate_t **new_array;
+ new_array = re_realloc (mctx->state_log, re_dfastate_t *,
+ pstr->bufs_len * 2);
+ if (BE (new_array == NULL, 0))
+ return REG_ESPACE;
+ mctx->state_log = new_array;
+ }
+
+ /* Then reconstruct the buffers. */
+ if (pstr->icase)
+ {
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max > 1)
+ build_wcs_upper_buffer (pstr);
+ else
+#endif /* RE_ENABLE_I18N */
+ build_upper_buffer (pstr);
+ }
+ else
+ {
+#ifdef RE_ENABLE_I18N
+ if (re_mb_cur_max > 1)
+ build_wcs_buffer (pstr);
+ else
+#endif /* RE_ENABLE_I18N */
+ {
+ if (pstr->trans != NULL)
+ re_string_translate_buffer (pstr);
+ else
+ pstr->valid_len = pstr->bufs_len;
+ }
+ }
+ return REG_NOERROR;
+}
+
+
+/* Functions for matching context. */
+
+/* Initialize MCTX. */
+
+static reg_errcode_t
+match_ctx_init (mctx, eflags, input, n)
+ re_match_context_t *mctx;
+ int eflags, n;
+ re_string_t *input;
+{
+ mctx->eflags = eflags;
+ mctx->input = input;
+ mctx->match_last = -1;
+ if (n > 0)
+ {
+ mctx->bkref_ents = re_malloc (struct re_backref_cache_entry, n);
+ mctx->sub_tops = re_malloc (re_sub_match_top_t *, n);
+ if (BE (mctx->bkref_ents == NULL || mctx->sub_tops == NULL, 0))
+ return REG_ESPACE;
+ }
+ else
+ mctx->bkref_ents = NULL;
+ mctx->nbkref_ents = 0;
+ mctx->abkref_ents = n;
+ mctx->max_mb_elem_len = 1;
+ mctx->nsub_tops = 0;
+ mctx->asub_tops = n;
+ return REG_NOERROR;
+}
+
+/* Clean the entries which depend on the current input in MCTX.
+ This function must be invoked when the matcher changes the start index
+ of the input, or changes the input string. */
+
+static void
+match_ctx_clean (mctx)
+ re_match_context_t *mctx;
+{
+ match_ctx_free_subtops (mctx);
+ mctx->nsub_tops = 0;
+ mctx->nbkref_ents = 0;
+}
+
+/* Free all the memory associated with MCTX. */
+
+static void
+match_ctx_free (mctx)
+ re_match_context_t *mctx;
+{
+ match_ctx_free_subtops (mctx);
+ re_free (mctx->sub_tops);
+ re_free (mctx->bkref_ents);
+}
+
+/* Free all the memory associated with MCTX->SUB_TOPS. */
+
+static void
+match_ctx_free_subtops (mctx)
+ re_match_context_t *mctx;
+{
+ int st_idx;
+ for (st_idx = 0; st_idx < mctx->nsub_tops; ++st_idx)
+ {
+ int sl_idx;
+ re_sub_match_top_t *top = mctx->sub_tops[st_idx];
+ for (sl_idx = 0; sl_idx < top->nlasts; ++sl_idx)
+ {
+ re_sub_match_last_t *last = top->lasts[sl_idx];
+ re_free (last->path.array);
+ re_free (last);
+ }
+ re_free (top->lasts);
+ if (top->path)
+ {
+ re_free (top->path->array);
+ re_free (top->path);
+ }
+ free (top);
+ }
+}
+
+/* Add a new backreference entry to MCTX.
+ Note that we assume that caller never call this function with duplicate
+ entry, and call with STR_IDX which isn't smaller than any existing entry.
+*/
+
+static reg_errcode_t
+match_ctx_add_entry (mctx, node, str_idx, from, to)
+ re_match_context_t *mctx;
+ int node, str_idx, from, to;
+{
+ if (mctx->nbkref_ents >= mctx->abkref_ents)
+ {
+ struct re_backref_cache_entry* new_entry;
+ new_entry = re_realloc (mctx->bkref_ents, struct re_backref_cache_entry,
+ mctx->abkref_ents * 2);
+ if (BE (new_entry == NULL, 0))
+ {
+ re_free (mctx->bkref_ents);
+ return REG_ESPACE;
+ }
+ mctx->bkref_ents = new_entry;
+ memset (mctx->bkref_ents + mctx->nbkref_ents, '\0',
+ sizeof (struct re_backref_cache_entry) * mctx->abkref_ents);
+ mctx->abkref_ents *= 2;
+ }
+ mctx->bkref_ents[mctx->nbkref_ents].node = node;
+ mctx->bkref_ents[mctx->nbkref_ents].str_idx = str_idx;
+ mctx->bkref_ents[mctx->nbkref_ents].subexp_from = from;
+ mctx->bkref_ents[mctx->nbkref_ents].subexp_to = to;
+ mctx->bkref_ents[mctx->nbkref_ents++].flag = 0;
+ if (mctx->max_mb_elem_len < to - from)
+ mctx->max_mb_elem_len = to - from;
+ return REG_NOERROR;
+}
+
+/* Search for the first entry which has the same str_idx.
+ Note that MCTX->BKREF_ENTS is already sorted by MCTX->STR_IDX. */
+
+static int
+search_cur_bkref_entry (mctx, str_idx)
+ re_match_context_t *mctx;
+ int str_idx;
+{
+ int left, right, mid;
+ right = mctx->nbkref_ents;
+ for (left = 0; left < right;)
+ {
+ mid = (left + right) / 2;
+ if (mctx->bkref_ents[mid].str_idx < str_idx)
+ left = mid + 1;
+ else
+ right = mid;
+ }
+ return left;
+}
+
+static void
+match_ctx_clear_flag (mctx)
+ re_match_context_t *mctx;
+{
+ int i;
+ for (i = 0; i < mctx->nbkref_ents; ++i)
+ {
+ mctx->bkref_ents[i].flag = 0;
+ }
+}
+
+/* Register the node NODE, whose type is OP_OPEN_SUBEXP, and which matches
+ at STR_IDX. */
+
+static reg_errcode_t
+match_ctx_add_subtop (mctx, node, str_idx)
+ re_match_context_t *mctx;
+ int node, str_idx;
+{
+#ifdef DEBUG
+ assert (mctx->sub_tops != NULL);
+ assert (mctx->asub_tops > 0);
+#endif
+ if (mctx->nsub_tops == mctx->asub_tops)
+ {
+ re_sub_match_top_t **new_array;
+ mctx->asub_tops *= 2;
+ new_array = re_realloc (mctx->sub_tops, re_sub_match_top_t *,
+ mctx->asub_tops);
+ if (BE (new_array == NULL, 0))
+ return REG_ESPACE;
+ mctx->sub_tops = new_array;
+ }
+ mctx->sub_tops[mctx->nsub_tops] = calloc (1, sizeof (re_sub_match_top_t));
+ if (mctx->sub_tops[mctx->nsub_tops] == NULL)
+ return REG_ESPACE;
+ mctx->sub_tops[mctx->nsub_tops]->node = node;
+ mctx->sub_tops[mctx->nsub_tops++]->str_idx = str_idx;
+ return REG_NOERROR;
+}
+
+/* Register the node NODE, whose type is OP_CLOSE_SUBEXP, and which matches
+ at STR_IDX, whose corresponding OP_OPEN_SUBEXP is SUB_TOP. */
+
+static re_sub_match_last_t *
+match_ctx_add_sublast (subtop, node, str_idx)
+ re_sub_match_top_t *subtop;
+ int node, str_idx;
+{
+ re_sub_match_last_t *new_entry;
+ if (subtop->nlasts == subtop->alasts)
+ {
+ re_sub_match_last_t **new_array;
+ subtop->alasts = 2 * subtop->alasts + 1;
+ new_array = re_realloc (subtop->lasts, re_sub_match_last_t *,
+ subtop->alasts);
+ if (BE (new_array == NULL, 0))
+ return NULL;
+ subtop->lasts = new_array;
+ }
+ new_entry = calloc (1, sizeof (re_sub_match_last_t));
+ if (BE (new_entry == NULL, 0))
+ return NULL;
+ subtop->lasts[subtop->nlasts] = new_entry;
+ new_entry->node = node;
+ new_entry->str_idx = str_idx;
+ ++subtop->nlasts;
+ return new_entry;
+}
+
+static void
+sift_ctx_init (sctx, sifted_sts, limited_sts, last_node, last_str_idx,
+ check_subexp)
+ re_sift_context_t *sctx;
+ re_dfastate_t **sifted_sts, **limited_sts;
+ int last_node, last_str_idx, check_subexp;
+{
+ sctx->sifted_states = sifted_sts;
+ sctx->limited_states = limited_sts;
+ sctx->last_node = last_node;
+ sctx->last_str_idx = last_str_idx;
+ sctx->check_subexp = check_subexp;
+ sctx->cur_bkref = -1;
+ sctx->cls_subexp_idx = -1;
+ re_node_set_init_empty (&sctx->limits);
+}
diff --git a/gnu/dist/gawk/replace.c b/gnu/dist/gawk/replace.c
new file mode 100644
index 00000000000..af6012bc13d
--- /dev/null
+++ b/gnu/dist/gawk/replace.c
@@ -0,0 +1,72 @@
+/* $NetBSD: replace.c,v 1.1.1.1 2003/10/06 15:46:38 wiz Exp $ */
+
+/*
+ * Do all necessary includes here, so that we don't have to worry about
+ * overlapping includes in the files in missing.d.
+ */
+#include "config.h"
+#include "awk.h"
+
+
+#ifdef atarist
+/*
+ * this will work with gcc compiler - for other compilers you may
+ * have to replace path separators in this file into backslashes
+ */
+#include "unsupported/atari/stack.c"
+#include "unsupported/atari/tmpnam.c"
+#endif /* atarist */
+
+#ifndef HAVE_SYSTEM
+#ifdef atarist
+#include "unsupported/atari/system.c"
+#else
+#include "missing_d/system.c"
+#endif
+#endif /* HAVE_SYSTEM */
+
+#ifndef HAVE_MEMCMP
+#include "missing_d/memcmp.c"
+#endif /* HAVE_MEMCMP */
+
+#ifndef HAVE_MEMCPY
+#include "missing_d/memcpy.c"
+#endif /* HAVE_MEMCPY */
+
+#ifndef HAVE_MEMSET
+#include "missing_d/memset.c"
+#endif /* HAVE_MEMSET */
+
+#ifndef HAVE_STRNCASECMP
+#include "missing_d/strncasecmp.c"
+#endif /* HAVE_STRCASE */
+
+#ifndef HAVE_STRERROR
+#include "missing_d/strerror.c"
+#endif /* HAVE_STRERROR */
+
+#ifndef HAVE_STRFTIME
+#include "missing_d/strftime.c"
+#endif /* HAVE_STRFTIME */
+
+#ifndef HAVE_STRCHR
+#include "missing_d/strchr.c"
+#endif /* HAVE_STRCHR */
+
+#if !defined(HAVE_STRTOD) || defined(STRTOD_NOT_C89)
+#include "missing_d/strtod.c"
+#endif /* HAVE_STRTOD */
+
+#ifndef HAVE_TZSET
+#include "missing_d/tzset.c"
+#endif /* HAVE_TZSET */
+
+#ifndef HAVE_MKTIME
+#include "missing_d/mktime.c"
+#endif /* HAVE_MKTIME */
+
+#if defined TANDEM
+#include "strdupc"
+#include "getidc"
+#include "strnchkc"
+#endif /* TANDEM */
diff --git a/gnu/dist/gawk/version.c b/gnu/dist/gawk/version.c
index e84bb7e9401..7b799bc1da4 100644
--- a/gnu/dist/gawk/version.c
+++ b/gnu/dist/gawk/version.c
@@ -1,4 +1,9 @@
-char *version_string = "@(#)GNU Awk 3.0";
+/* $NetBSD: version.c,v 1.1.1.2 2003/10/06 15:46:50 wiz Exp $ */
+
+#if ! defined(__STDC__) || __STDC__ < 1
+#define const
+#endif
+const char *version_string = "@(#)GNU Awk 3.1";
/* 1.02 fixed /= += *= etc to return the new Left Hand Side instead
of the Right Hand Side */
@@ -48,3 +53,6 @@ char *version_string = "@(#)GNU Awk 3.0";
/* 3.0 RS as regexp, RT variable, FS = "", fflush builtin, posix
regexps, IGNORECASE applies to all comparison, autoconf, source
code cleanup. See the NEWS file. */
+
+/* 3.1 PROCINFO array, LINT variable, mktime builtin, BINMODE variable,
+ |&, tcp/ip, i18n stuff. Automake. See NEWS. */
diff --git a/gnu/dist/gawk/version.in b/gnu/dist/gawk/version.in
new file mode 100644
index 00000000000..4c77ba64d78
--- /dev/null
+++ b/gnu/dist/gawk/version.in
@@ -0,0 +1,56 @@
+#if ! defined(__STDC__) || __STDC__ < 1
+#define const
+#endif
+const char *version_string = "@(#)GNU Awk X.Y";
+
+/* 1.02 fixed /= += *= etc to return the new Left Hand Side instead
+ of the Right Hand Side */
+
+/* 1.03 Fixed split() to treat strings of space and tab as FS if
+ the split char is ' '.
+
+ Added -v option to print version number
+
+ Fixed bug that caused rounding when printing large numbers */
+
+/* 2.00beta Incorporated the functionality of the "new" awk as described
+ the book (reference not handy). Extensively tested, but no
+ doubt still buggy. Badly needs tuning and cleanup, in
+ particular in memory management which is currently almost
+ non-existent. */
+
+/* 2.01 JF: Modified to compile under GCC, and fixed a few
+ bugs while I was at it. I hope I didn't add any more.
+ I modified parse.y to reduce the number of reduce/reduce
+ conflicts. There are still a few left. */
+
+/* 2.02 Fixed JF's bugs; improved memory management, still needs
+ lots of work. */
+
+/* 2.10 Major grammar rework and lots of bug fixes from David.
+ Major changes for performance enhancements from David.
+ A number of minor bug fixes and new features from Arnold.
+ Changes for MSDOS from Conrad Kwok and Scott Garfinkle.
+ The gawk.texinfo and info files included! */
+
+/* 2.11 Bug fix release to 2.10. Lots of changes for portability,
+ speed, and configurability. */
+
+/* 2.12 Lots of changes for portability, speed, and configurability.
+ Several bugs fixed. POSIX compliance. Removal of last set
+ of hard-wired limits. Atari and VMS ports added. */
+
+/* 2.13 Public release of 2.12 */
+
+/* 2.14 Mostly bug fixes. */
+
+/* 2.15 Bug fixes plus intermixing of command-line source and files,
+ GNU long options, ARGIND, ERRNO and Plan 9 style /dev/ files.
+ `delete array'. OS/2 port added. */
+
+/* 3.0 RS as regexp, RT variable, FS = "", fflush builtin, posix
+ regexps, IGNORECASE applies to all comparison, autoconf, source
+ code cleanup. See the NEWS file. */
+
+/* 3.1 PROCINFO array, LINT variable, mktime builtin, BINMODE variable,
+ |&, tcp/ip, i18n stuff. Automake. See NEWS. */
diff --git a/gnu/dist/gawk/ylwrap b/gnu/dist/gawk/ylwrap
new file mode 100755
index 00000000000..71e522500a1
--- /dev/null
+++ b/gnu/dist/gawk/ylwrap
@@ -0,0 +1,160 @@
+#! /bin/sh
+# ylwrap - wrapper for lex/yacc invocations.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002 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
+
+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
+
+case $# in
+ 0) $prog "$input" ;;
+ *) $prog "$@" "$input" ;;
+esac
+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
+
+ # 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 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
+
+ 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.
+ #
+ # We want to use the real output file name, not yy.lex.c for
+ # instance.
+ #
+ # We want the include guards to be adjusted too.
+ FROM=`echo "$from" | sed \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+ TARGET=`echo "$2" | sed \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+ sed "/^#/{s,$input_rx,,;s,$from,$2,;s,$FORM,$TO,;}" "$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