summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 13:17:58 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 13:17:58 +0300
commite888f1834b88270590b7e04d64c03c75863e4565 (patch)
treeab679ecbf16dc4f11b90a53f4b1e0084d78c98b0
parentfae4762eba9ff7bb466a600130e9c90eaac6b0bc (diff)
downloadgawk-3.1.2.tar.gz
Move to gawk-3.1.2.gawk-3.1.2
-rw-r--r--ABOUT-NLS342
-rw-r--r--ChangeLog1175
-rw-r--r--FUTURES3
-rw-r--r--INSTALL136
-rw-r--r--Makefile.am37
-rw-r--r--Makefile.in605
-rw-r--r--NEWS116
-rw-r--r--README2
-rw-r--r--README_d/README.aix6
-rw-r--r--README_d/README.hpux43
-rw-r--r--README_d/README.ia648
-rw-r--r--README_d/README.pc3
-rw-r--r--README_d/README.solaris18
-rw-r--r--acconfig.h41
-rw-r--r--acinclude.m414
-rw-r--r--aclocal.m41409
-rw-r--r--ansi2knr.c129
-rw-r--r--array.c355
-rw-r--r--awk.h284
-rw-r--r--awkgram.c4433
-rw-r--r--awkgram.y872
-rw-r--r--awklib/ChangeLog18
-rw-r--r--awklib/Makefile.am10
-rw-r--r--awklib/Makefile.in274
-rw-r--r--awklib/eg/lib/grcat.c16
-rw-r--r--awklib/eg/lib/pwcat.c16
-rw-r--r--awklib/eg/prog/igawk.sh73
-rw-r--r--bisonfix.sed2
-rw-r--r--builtin.c363
-rwxr-xr-xconfig.guess296
-rwxr-xr-xconfig.sub162
-rw-r--r--configh.in548
-rwxr-xr-xconfigure13813
-rw-r--r--configure.in116
-rw-r--r--custom.h16
-rwxr-xr-xdepcomp390
-rw-r--r--dfa.c3640
-rw-r--r--dfa.h433
-rw-r--r--doc/ChangeLog87
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/Makefile.in268
-rw-r--r--doc/ad.block6
-rw-r--r--doc/awkcard.in154
-rw-r--r--doc/gawk.149
-rw-r--r--doc/gawk.info1722
-rw-r--r--doc/gawk.texi1087
-rw-r--r--doc/gawkinet.info375
-rw-r--r--doc/gawkinet.texi302
-rw-r--r--doc/pgawk.11
-rw-r--r--doc/texinfo.tex2230
-rw-r--r--eval.c512
-rw-r--r--ext.c9
-rw-r--r--extension/fork.c1
-rw-r--r--field.c374
-rwxr-xr-xfixvers2
-rw-r--r--gawkmisc.c2
-rw-r--r--gettext.h15
-rwxr-xr-xinstall-sh148
-rw-r--r--intl/ChangeLog8
-rw-r--r--intl/Makefile.in6
-rw-r--r--intl/VERSION2
-rw-r--r--intl/bindtextdom.c8
-rwxr-xr-xintl/config.charset48
-rw-r--r--intl/dcgettext.c4
-rw-r--r--intl/dcigettext.c78
-rw-r--r--intl/dcngettext.c4
-rw-r--r--intl/dgettext.c4
-rw-r--r--intl/dngettext.c4
-rw-r--r--intl/eval-plural.h8
-rw-r--r--intl/gettext.c4
-rw-r--r--intl/gettextP.h87
-rw-r--r--intl/gmo.h58
-rw-r--r--intl/intl-compat.c67
-rw-r--r--intl/l10nflist.c120
-rw-r--r--intl/libgnuintl.h216
-rw-r--r--intl/loadinfo.h43
-rw-r--r--intl/loadmsgcat.c907
-rw-r--r--intl/localcharset.c30
-rw-r--r--intl/localename.c90
-rw-r--r--intl/ngettext.c4
-rw-r--r--intl/os2compat.c4
-rw-r--r--intl/plural-exp.h8
-rw-r--r--intl/textdomain.c6
-rw-r--r--io.c1682
-rw-r--r--m4/ChangeLog17
-rw-r--r--m4/arch.m46
-rw-r--r--m4/gettext.m468
-rw-r--r--m4/iconv.m419
-rw-r--r--m4/intdiv0.m472
-rw-r--r--m4/inttypes-pri.m432
-rw-r--r--m4/inttypes.m427
-rw-r--r--m4/inttypes_h.m428
-rw-r--r--m4/jm-mktime.m4178
-rw-r--r--m4/largefile.m492
-rw-r--r--m4/lcmessage.m418
-rw-r--r--m4/lib-link.m452
-rw-r--r--m4/socket.m44
-rw-r--r--m4/ssize_t.m424
-rw-r--r--m4/stdint_h.m428
-rw-r--r--m4/strtod.m42
-rw-r--r--m4/uintmax_t.m429
-rw-r--r--m4/ulonglong.m423
-rw-r--r--main.c383
-rwxr-xr-xmissing97
-rw-r--r--missing_d/ChangeLog21
-rw-r--r--missing_d/strftime.c306
-rw-r--r--missing_d/strtod.c69
-rwxr-xr-xmkinstalldirs111
-rw-r--r--msg.c22
-rw-r--r--node.c58
-rw-r--r--patchlev.h2
-rw-r--r--pc/ChangeLog27
-rw-r--r--pc/Makefile7
-rw-r--r--pc/Makefile.tst1543
-rw-r--r--pc/config.h9
-rw-r--r--pc/gawkmisc.pc8
-rw-r--r--po/ChangeLog19
-rw-r--r--po/LINGUAS2
-rw-r--r--po/POTFILES.in28
-rw-r--r--po/Rules-quot42
-rw-r--r--po/boldquot.sed10
-rw-r--r--po/da.gmobin0 -> 34128 bytes
-rw-r--r--po/da.po1808
-rw-r--r--po/de.gmobin36731 -> 33735 bytes
-rw-r--r--po/de.po2159
-rw-r--r--po/en@boldquot.header25
-rw-r--r--po/en@quot.header22
-rw-r--r--po/es.gmobin40996 -> 41043 bytes
-rw-r--r--po/es.po2207
-rw-r--r--po/fr.gmobin41261 -> 41302 bytes
-rw-r--r--po/fr.po2186
-rw-r--r--po/gawk.pot1713
-rw-r--r--po/he.gmobin37053 -> 34308 bytes
-rw-r--r--po/he.po2129
-rw-r--r--po/insert-header.sin23
-rw-r--r--po/it.gmobin39661 -> 39796 bytes
-rw-r--r--po/it.po2137
-rw-r--r--po/pt_BR.gmobin0 -> 36674 bytes
-rw-r--r--po/pt_BR.po1732
-rw-r--r--po/quot.sed6
-rw-r--r--po/sv.gmobin37031 -> 39152 bytes
-rw-r--r--po/sv.po2192
-rw-r--r--po/tr.gmobin40615 -> 40613 bytes
-rw-r--r--po/tr.po2142
-rw-r--r--posix/ChangeLog38
-rw-r--r--posix/gawkmisc.c66
-rw-r--r--profile.c111
-rw-r--r--random.c2
-rw-r--r--random.h2
-rw-r--r--re.c184
-rw-r--r--regcomp.c3559
-rw-r--r--regex.c7786
-rw-r--r--regex.h86
-rw-r--r--regex_internal.c1266
-rw-r--r--regex_internal.h753
-rw-r--r--regexec.c3983
-rw-r--r--stamp-h.in1
-rw-r--r--test/ChangeLog224
-rwxr-xr-xtest/Gentests92
-rw-r--r--test/Makefile.am797
-rw-r--r--test/Makefile.in1679
-rw-r--r--test/Maketests718
-rw-r--r--test/arrayparm.ok1
-rw-r--r--test/arrymem1.awk10
-rw-r--r--test/arrymem1.ok1
-rw-r--r--test/asort.awk25
-rw-r--r--test/asort.ok18
-rw-r--r--test/asorti.awk27
-rw-r--r--test/asorti.ok18
-rw-r--r--test/back89.awk1
-rw-r--r--test/childin.awk1
-rw-r--r--test/childin.in1
-rw-r--r--test/defref.ok1
-rw-r--r--test/fieldwdth.awk2
-rw-r--r--test/fieldwdth.in1
-rw-r--r--test/fnamedat.ok1
-rw-r--r--test/fnarray.ok4
-rw-r--r--test/fnaryscl.ok1
-rw-r--r--test/fnasgnm.ok1
-rw-r--r--test/fnmisc.awk13
-rw-r--r--test/fnmisc.ok3
-rw-r--r--test/fsbs.awk2
-rw-r--r--test/fstabplus.in1
-rw-r--r--test/funsmnam.ok1
-rw-r--r--test/getline.awk30
-rw-r--r--test/getline.in3
-rw-r--r--test/getline.ok9
-rw-r--r--test/getline2.awk1
-rw-r--r--test/getline2.ok2
-rw-r--r--test/getline3.awk7
-rw-r--r--test/getline3.ok1
-rw-r--r--test/gsubasgn.ok1
-rw-r--r--test/gsubtest.awk1
-rw-r--r--test/gsubtest.ok1
-rw-r--r--test/gsubtst2.awk241
-rw-r--r--test/gsubtst2.ok25
-rw-r--r--test/gsubtst3.awk290
-rw-r--r--test/gsubtst3.in57
-rw-r--r--test/gsubtst3.ok60
-rw-r--r--test/gsubtst4.awk242
-rw-r--r--test/gsubtst4.ok33
-rw-r--r--test/icasefs.awk43
-rw-r--r--test/icasefs.ok6
-rw-r--r--test/icasers.awk2
-rw-r--r--test/icasers.in1
-rw-r--r--test/icasers.ok2
-rw-r--r--test/ignrcase.awk2
-rw-r--r--test/ignrcase.in1
-rw-r--r--test/inputred.awk1
-rw-r--r--test/inputred.ok1
-rw-r--r--test/longwrds.awk5
-rw-r--r--test/longwrds.in (renamed from test/manpage)0
-rw-r--r--test/manyfiles.ok1
-rw-r--r--test/match1.awk9
-rw-r--r--test/match1.ok6
-rw-r--r--test/negexp.awk1
-rw-r--r--test/nfldstr.awk13
-rw-r--r--test/nfldstr.in1
-rw-r--r--test/nfneg.awk1
-rw-r--r--test/nfneg.ok2
-rw-r--r--test/noeffect.awk3
-rw-r--r--test/noeffect.ok2
-rw-r--r--test/noloop1.awk70
-rw-r--r--test/noloop1.in1
-rw-r--r--test/noloop1.ok0
-rw-r--r--test/noloop2.awk70
-rw-r--r--test/noloop2.in1
-rw-r--r--test/noloop2.ok0
-rw-r--r--test/noparms.ok5
-rw-r--r--test/nulrsend.awk112
-rw-r--r--test/nulrsend.in4
-rw-r--r--test/nulrsend.ok2
-rw-r--r--test/paramdup.ok1
-rw-r--r--test/parseme.ok3
-rw-r--r--test/posix.in1
-rwxr-xr-xtest/poundbang.awk3
-rw-r--r--test/poundbang.ok1
-rw-r--r--test/prec.awk7
-rw-r--r--test/prec.ok1
-rw-r--r--test/printf0.awk5
-rw-r--r--test/printf0.ok1
-rw-r--r--test/prmarscl.ok1
-rw-r--r--test/prmreuse.awk2
-rw-r--r--test/rebuf.awk73
-rw-r--r--test/rebuf.in2350
-rw-r--r--test/rebuf.ok1290
-rw-r--r--test/resplit.awk1
-rw-r--r--test/resplit.in1
-rw-r--r--test/rs.awk2
-rw-r--r--test/rstest1.awk7
-rw-r--r--test/rstest1.ok2
-rw-r--r--test/rstest2.awk6
-rw-r--r--test/rstest2.ok1
-rw-r--r--test/sclforin.ok1
-rw-r--r--test/sclifin.ok1
-rw-r--r--test/space.ok2
-rw-r--r--test/splitarr.awk5
-rw-r--r--test/splitarr.ok1
-rw-r--r--test/strtod.awk6
-rw-r--r--test/strtod.in2
-rw-r--r--test/strtod.ok1
-rw-r--r--test/synerr1.awk4
-rw-r--r--test/synerr1.ok3
-rw-r--r--test/uninit2.awk2
-rw-r--r--test/uninit2.ok4
-rw-r--r--test/uninitialized.awk3
-rw-r--r--test/uninitialized.ok1
-rw-r--r--test/zeroe0.awk40
-rw-r--r--test/zeroe0.ok2
-rw-r--r--unsupported/atari/ChangeLog7
-rw-r--r--unsupported/atari/gawkmisc.atr2
-rw-r--r--unsupported/tandem/ChangeLog7
-rw-r--r--unsupported/tandem/tmisc.c2
-rw-r--r--version.c5
-rw-r--r--version.in5
-rw-r--r--vms/ChangeLog52
-rw-r--r--vms/descrip.mms20
-rw-r--r--vms/gawk.hlp51
-rw-r--r--vms/gawkmisc.vms4
-rw-r--r--vms/vms-conf.h14
-rw-r--r--vms/vms_args.c2
-rw-r--r--vms/vms_cli.c2
-rw-r--r--vms/vms_gawk.c12
-rw-r--r--vms/vms_misc.c4
-rw-r--r--vms/vmstest.com26
-rwxr-xr-xylwrap47
286 files changed, 56636 insertions, 35343 deletions
diff --git a/ABOUT-NLS b/ABOUT-NLS
index 224f72c5..2eb33a9f 100644
--- a/ABOUT-NLS
+++ b/ABOUT-NLS
@@ -171,202 +171,232 @@ Available Packages
==================
Languages are not equally supported in all packages. The following
-matrix shows the current state of internationalization, as of April
+matrix shows the current state of internationalization, as of August
2002. The matrix shows, in regard of each package, for which languages
PO files have been submitted to translation coordination, with a
translation percentage of at least 50%.
- Ready PO files bg ca cs da de el en eo es et fi fr
- +-------------------------------------+
- a2ps | [] [] [] [] |
- bash | [] [] [] [] |
- bfd | [] [] |
- binutils | [] [] |
- bison | [] [] [] [] |
- clisp | [] [] [] [] |
- cpio | [] [] [] [] |
- diffutils | [] [] [] [] [] [] |
- enscript | [] [] |
- error | [] [] |
- fetchmail | [] () [] [] [] () |
- fileutils | [] [] [] [] [] |
- findutils | [] [] [] [] [] |
- flex | [] [] [] [] [] |
- gas | [] [] |
- gawk | [] [] [] |
- gcal | [] [] |
- gcc | [] [] |
- gettext | [] [] [] [] [] |
- gnupg | [] [] [] [] [] [] |
- gprof | [] [] |
- gpsdrive | () () () () () |
- grep | [] [] [] [] [] [] [] |
- gretl | |
- hello | [] [] [] [] [] [] [] [] |
- id-utils | [] [] [] |
- indent | [] [] [] [] [] |
- jpilot | () [] [] [] |
- jwhois | [] [] |
- kbd | [] [] |
- ld | [] [] |
- libc | [] [] [] [] [] [] [] |
- lilypond | [] [] |
- lynx | [] [] [] [] |
- m4 | [] [] [] [] [] |
- make | [] [] [] [] |
- mysecretdiary | [] [] |
- nano | [] () [] [] [] [] |
- nano_1_0 | [] () [] [] [] [] |
- opcodes | [] [] [] |
- parted | [] [] [] [] [] |
- ptx | [] [] [] [] [] |
- python | |
- recode | [] [] [] [] [] [] |
- sed | [] [] [] [] [] [] [] [] |
- sh-utils | [] [] [] [] [] [] [] [] |
- sharutils | [] [] [] [] [] [] |
- sketch | () [] () |
- soundtracker | [] [] [] |
- sp | [] |
- tar | [] [] [] [] [] [] |
- texinfo | [] [] [] [] [] |
- textutils | [] [] [] [] [] |
- util-linux | [] [] [] [] [] [] |
- vorbis-tools | |
- wastesedge | |
- wdiff | [] [] [] [] [] [] |
- wget | [] [] [] [] [] [] [] [] [] |
- +-------------------------------------+
- bg ca cs da de el en eo es et fi fr
- 2 14 11 31 40 10 1 8 41 16 1 50
+ Ready PO files be bg ca cs da de el en eo es et fi fr
+ +----------------------------------------+
+ a2ps | [] [] [] [] |
+ ap-utils | |
+ bash | [] [] [] [] |
+ bfd | [] [] |
+ binutils | [] [] |
+ bison | [] [] [] [] |
+ clisp | |
+ clisp | [] [] [] [] |
+ clisplow | |
+ cpio | [] [] [] [] |
+ darkstat | () |
+ diffutils | [] [] [] [] [] [] |
+ enscript | [] [] |
+ error | [] [] [] |
+ fetchmail | [] () [] [] [] () |
+ fileutils | [] [] [] [] [] |
+ findutils | [] [] [] [] [] [] |
+ flex | [] [] [] [] [] |
+ gas | [] [] |
+ gawk | [] [] [] |
+ gcal | [] [] |
+ gcc | [] [] |
+ gettext | [] [] [] [] [] |
+ gnupg | [] [] [] [] [] [] [] |
+ gprof | [] [] |
+ gpsdrive | () () () () () |
+ grep | [] [] [] [] [] [] [] [] |
+ gretl | [] |
+ gthumb | () () () |
+ hello | [] [] [] [] [] [] [] [] [] |
+ id-utils | [] [] [] |
+ indent | [] [] [] [] [] |
+ jpilot | () [] [] [] |
+ jwhois | [] [] |
+ kbd | [] [] [] |
+ ld | [] [] |
+ libc | [] [] [] [] [] [] [] [] |
+ libiconv | [] [] [] [] |
+ lifelines | () () |
+ lilypond | [] [] |
+ lingoteach | [] [] |
+ lingoteach_lessons| () () |
+ lynx | [] [] [] [] [] |
+ m4 | [] [] [] [] [] |
+ make | [] [] [] [] |
+ man-db | [] () () [] () () |
+ mysecretdiary | [] [] [] |
+ nano | [] () [] [] [] [] |
+ nano_1_0 | [] () [] [] [] [] |
+ opcodes | [] [] [] |
+ parted | [] [] [] [] [] |
+ ptx | [] [] [] [] [] [] [] |
+ python | |
+ recode | [] [] [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] [] [] |
+ sh-utils | [] [] [] [] |
+ sharutils | [] [] [] [] [] [] [] |
+ sketch | () [] () |
+ soundtracker | [] [] [] |
+ sp | [] |
+ tar | [] [] [] [] [] [] |
+ texinfo | [] [] [] [] [] |
+ textutils | [] [] [] [] [] |
+ util-linux | [] [] [] [] [] [] |
+ vorbis-tools | [] |
+ wastesedge | |
+ wdiff | [] [] [] [] [] [] |
+ wget | [] [] [] [] [] [] [] [] [] [] |
+ +----------------------------------------+
+ be bg ca cs da de el en eo es et fi fr
+ 0 2 19 10 30 44 9 1 12 44 17 6 53
gl he hr hu id it ja ko lv nb nl nn
+-------------------------------------+
a2ps | () () [] |
- bash | |
+ ap-utils | |
+ bash | [] |
bfd | [] |
binutils | [] |
- bison | [] [] |
+ bison | [] [] [] [] |
+ clisp | |
clisp | [] |
- cpio | [] [] [] |
- diffutils | [] [] [] [] |
+ clisplow | |
+ cpio | [] [] [] [] |
+ darkstat | |
+ diffutils | [] [] [] [] [] |
enscript | [] [] |
error | [] |
fetchmail | [] |
fileutils | [] [] [] |
- findutils | [] [] [] [] [] [] [] |
+ findutils | [] [] [] [] [] [] [] [] |
flex | [] |
gas | |
gawk | [] |
gcal | |
- gcc | |
+ gcc | [] |
gettext | [] [] |
gnupg | [] [] [] [] |
- gprof | |
- gpsdrive | () () |
- grep | [] [] [] [] [] [] |
+ gprof | [] |
+ gpsdrive | [] () () |
+ grep | [] [] [] [] [] [] [] |
gretl | |
+ gthumb | () () |
hello | [] [] [] [] [] [] [] [] [] [] [] [] |
- id-utils | [] |
- indent | [] [] [] |
+ id-utils | [] [] |
+ indent | [] [] [] [] |
jpilot | () () |
- jwhois | [] |
+ jwhois | [] [] |
kbd | |
ld | |
libc | [] [] [] [] |
- lilypond | [] [] |
- lynx | [] [] [] |
+ libiconv | [] [] [] |
+ lifelines | |
+ lilypond | [] |
+ lingoteach | [] |
+ lingoteach_lessons| |
+ lynx | [] [] [] [] |
m4 | [] [] [] [] |
make | [] [] [] [] [] [] |
- mysecretdiary | |
- nano | [] [] [] () [] [] [] |
- nano_1_0 | [] [] [] () [] [] |
- opcodes | [] |
+ man-db | () () |
+ mysecretdiary | [] |
+ nano | [] [] [] [] |
+ nano_1_0 | [] [] [] [] [] |
+ opcodes | [] [] |
parted | [] [] [] |
- ptx | [] [] [] [] |
+ ptx | [] [] [] [] [] |
python | |
recode | [] [] [] |
- sed | [] [] [] [] [] [] [] |
- sh-utils | [] [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] |
+ sh-utils | [] [] [] |
sharutils | [] [] [] |
sketch | () |
- soundtracker | [] |
+ soundtracker | [] [] |
sp | |
- tar | [] [] [] [] [] |
+ tar | [] [] [] [] [] [] |
texinfo | [] [] [] |
- textutils | [] [] [] |
+ textutils | [] [] [] [] |
util-linux | () [] |
- vorbis-tools | |
+ vorbis-tools | [] |
wastesedge | |
- wdiff | [] [] |
+ wdiff | [] [] [] |
wget | [] [] [] [] [] [] |
+-------------------------------------+
gl he hr hu id it ja ko lv nb nl nn
- 23 9 8 4 12 12 25 9 1 8 20 4
+ 23 9 12 19 16 13 26 9 1 7 19 3
- no pl pt pt_BR ru sk sl sv tr uk zh_TW
- +----------------------------------------+
- a2ps | () () () [] [] [] [] () | 9
- bash | | 4
- bfd | [] [] | 5
- binutils | [] | 4
- bison | [] [] [] | 9
- clisp | | 5
- cpio | [] [] [] [] | 11
- diffutils | [] [] [] [] [] [] | 16
- enscript | [] [] [] | 7
- error | [] [] [] | 6
- fetchmail | () () [] | 6
- fileutils | [] [] [] [] [] | 13
- findutils | [] [] [] [] [] [] [] | 19
- flex | [] [] [] | 9
- gas | [] | 3
- gawk | [] [] | 6
- gcal | [] [] | 4
- gcc | [] | 3
- gettext | [] [] [] [] [] [] | 13
- gnupg | [] [] [] | 13
- gprof | [] [] | 4
- gpsdrive | () | 0
- grep | [] [] [] [] | 17
- gretl | | 0
- hello | [] [] [] [] [] [] [] | 27
- id-utils | [] [] | 6
- indent | [] [] [] [] | 12
- jpilot | () () [] | 4
- jwhois | () () [] [] | 5
- kbd | [] [] | 4
- ld | [] [] | 4
- libc | [] [] [] [] [] [] | 17
- lilypond | [] | 5
- lynx | [] [] [] | 10
- m4 | [] [] [] | 12
- make | [] [] [] [] | 14
- mysecretdiary | [] [] | 4
- nano | () [] [] [] [] | 15
- nano_1_0 | () [] [] [] [] | 14
- opcodes | [] [] | 6
- parted | [] [] [] | 11
- ptx | [] [] [] [] [] [] | 15
- python | | 0
- recode | [] [] [] [] | 13
- sed | [] [] [] [] [] [] | 21
- sh-utils | [] [] [] [] [] [] [] [] [] | 22
- sharutils | [] [] [] [] | 13
- sketch | [] () | 3
- soundtracker | [] | 5
- sp | | 1
- tar | [] [] [] [] [] [] [] | 18
- texinfo | [] [] | 10
- textutils | [] [] [] [] [] | 13
- util-linux | [] [] [] | 10
- vorbis-tools | [] | 1
- wastesedge | | 0
- wdiff | [] [] [] [] | 12
- wget | [] [] [] [] [] [] [] [] | 23
- +----------------------------------------+
- 35 teams no pl pt pt_BR ru sk sl sv tr uk zh_TW
- 58 domains 5 16 2 14 27 11 11 41 36 4 9 536
+ no pl pt pt_BR ru sk sl sv tr uk zh_CN zh_TW
+ +----------------------------------------------+
+ a2ps | () () () [] [] [] [] [] | 10
+ ap-utils | () | 0
+ bash | [] | 6
+ bfd | [] [] | 5
+ binutils | [] [] | 5
+ bison | [] [] [] [] | 12
+ clisp | | 0
+ clisp | | 5
+ clisplow | | 0
+ cpio | [] [] [] [] | 12
+ darkstat | [] [] () () | 2
+ diffutils | [] [] [] [] [] [] | 17
+ enscript | [] [] [] [] | 8
+ error | [] [] [] | 7
+ fetchmail | () () [] | 6
+ fileutils | [] [] [] [] [] [] | 14
+ findutils | [] [] [] [] [] [] [] | 21
+ flex | [] [] [] | 9
+ gas | [] | 3
+ gawk | [] [] | 6
+ gcal | [] [] | 4
+ gcc | [] | 4
+ gettext | [] [] [] [] [] [] | 13
+ gnupg | [] [] [] | 14
+ gprof | [] [] | 5
+ gpsdrive | [] [] | 3
+ grep | [] [] [] [] [] | 20
+ gretl | | 1
+ gthumb | () () [] | 1
+ hello | [] [] [] [] [] [] [] | 28
+ id-utils | [] [] [] [] | 9
+ indent | [] [] [] [] [] | 14
+ jpilot | () () [] [] | 5
+ jwhois | [] () () [] [] | 7
+ kbd | [] [] | 5
+ ld | [] [] | 4
+ libc | [] [] [] [] [] [] | 18
+ libiconv | [] [] [] [] [] | 12
+ lifelines | [] | 1
+ lilypond | [] | 4
+ lingoteach | [] [] | 5
+ lingoteach_lessons| () | 0
+ lynx | [] [] [] [] | 13
+ m4 | [] [] [] [] | 13
+ make | [] [] [] [] [] | 15
+ man-db | | 3
+ mysecretdiary | [] [] [] | 7
+ nano | [] [] [] [] | 13
+ nano_1_0 | [] [] [] [] | 14
+ opcodes | [] [] [] | 8
+ parted | [] [] [] [] | 12
+ ptx | [] [] [] [] [] [] [] | 19
+ python | | 0
+ recode | [] [] [] [] [] [] | 15
+ sed | [] [] [] [] [] [] | 24
+ sh-utils | [] [] | 9
+ sharutils | [] [] [] [] | 14
+ sketch | [] () [] | 4
+ soundtracker | [] | 6
+ sp | | 1
+ tar | [] [] [] [] [] [] [] | 19
+ texinfo | [] [] | 10
+ textutils | [] [] [] [] [] | 14
+ util-linux | [] [] [] | 10
+ vorbis-tools | [] | 3
+ wastesedge | | 0
+ wdiff | [] [] [] [] [] | 14
+ wget | [] [] [] [] [] [] [] [] | 24
+ +----------------------------------------------+
+ 37 teams no pl pt pt_BR ru sk sl sv tr uk zh_CN zh_TW
+ 68 domains 4 15 2 28 28 12 10 49 43 4 1 9 609
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
@@ -379,7 +409,7 @@ distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
distribution.
- If April 2002 seems to be old, you may fetch a more recent copy of
+ If August 2002 seems to be old, you may fetch a more recent copy of
this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
matrix with full percentage details can be found at
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
@@ -396,7 +426,7 @@ library, whereas only free software can use `libintl' as a static
library or use modified versions of `libintl'.
Once the sources are changed appropriately and the setup can handle
-to use of `gettext' the only thing missing are the translations. The
+the use of `gettext' the only thing missing are the translations. The
Free Translation Project is also available for packages which are not
developed inside the GNU project. Therefore the information given above
applies also for every other Free Software Project. Contact
diff --git a/ChangeLog b/ChangeLog
index 14b5c446..31654c35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,1178 @@
+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.
+
+Wed Mar 19 14:08:11 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y: Production `program --> program error'. Add a return so
+ that we don't produce an infinite stream of error messages.
+ Thanks to Michael Mauch <michael.mauch@gmx.de> for pointing this out.
+
+Wed Mar 19 13:45:50 2003 Corinna Vinschen <vinschen@redhat.com>
+
+ * regex.c [RE_ENBABLE_I18N]: remove definition; the one in
+ regex_internal.h is better and makes things work with Cygwin.
+
+Tue Mar 11 11:54:20 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * regex_internal.h: Don't include <limits.h> after <regex.h> was
+ included in regex.c, since it could redefine RE_DUP_MAX to a lower
+ value.
+ (bitset_set, bitset_clear, bitset_contain): Use 1UL instead of 1 in
+ left shift operations.
+ * regex.c: Include <limits.h> before <regex.h>
+ * regcomp.c (re_compile_fastmap_iter, init_word_char, parse_expression):
+ Use 1UL instead of 1 in left shift operations.
+
+Mon Mar 10 15:45:37 2003 Corinna Vinschen <vinschen@redhat.com>
+
+ * configure.in: Update CYGWIN case to add /usr/lib/automode.o.
+
+Thu Mar 6 11:07:36 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ Updated to automake 1.7.3.
+
+ * config.guess, config.sub: Updated from prep.
+ * Makefile.am (AUTOMAKE_OPTIONS): Add dist-bzip2 to get .bz2 files.
+
+Tue Mar 4 10:40:46 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * version.in: Added goop for K&R compilers; forgot that I have to fix
+ this file which then is used to create version.c.
+
+Mon Mar 3 17:00:44 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.in: New option --disable-lint.
+ * awk.h (do_lint, do_lint_old): Conditionally declare based on NO_LINT.
+ * eval.c (set_LINT): Ifdef out body if NO_LINT.
+ * main.c (do_lint, do_lint_old): Conditionally compile properly.
+ (main): Handle --lint argument code.
+
+Fri Feb 28 10:43:07 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * main.c (main): Add LC_TIME to the things that get set with
+ setlocale().
+ * builtin.c (format_tree): Change test of `n0-- <= 0' to ==, avoids
+ VMS diagnostic.
+
+Thu Feb 27 17:48:29 2003 Pat Rankin <rankin@pactechdata.com>
+
+ * regexec.c (proceed_next_node): Cast re_string_get_buffer to char *.
+ (get_subexp): Likewise.
+
+Tue Feb 25 12:33:41 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * regex_internal.h, regex_internal.c, regcomp.c, regexec.c:
+ Make MB_CUR_MAX into thread local variable re_mb_cur_max.
+
+ Unrelated, from Scott Deifik:
+
+ * io.c (grow_iop_buffer): Add checks for overflow of new buffer size.
+
+Mon Feb 24 13:30:59 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (gawk_mb_cur_max): Declared:
+ * main.c (gawk_mb_cur_max): Defined, init to 1.
+ (main): Initialize gawk_mb_cur_max.
+ * awkgram.y, builtin.c, eval.c, field.c, io.c, re.c (mb_cur_max):
+ Replaces all instances of MB_CUR_MAX, which is a function call (!)
+ in glibc. Big speed up, especially for -Fx case, where x is a
+ single character.
+
+ Unrelated:
+
+ * awkgram.y (rule): For non-existent action, use a Node_K_print_rec
+ node.
+
+Sun Feb 23 15:45:20 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ Speed up plain `print' and `print $0':
+
+ * awk.h (Node_K_print_rec): New node type.
+ (do_print_rec): Declare function.
+ * awkgram.y (simple_stmt): Create humongous test for plain `print'
+ or `print $0', and if so, use a Node_K_print_rec for it. Modify
+ test for lint message.
+ * builtin.c (redirect_to_fp): New function for common code to get fp
+ and rp for do_print{,f,_rec} functions.
+ (do_print): Use redirect_to_fp().
+ (do_printf): Use redirect_to_fp().
+ (do_print_rec): New function to just print $0 from field_arr[0]
+ directly; will rebuild the record first if necessary.
+ * eval.c (nodetypes): Add Node_K_print_rec.
+ (interpret): Add Node_K_print_rec case.
+ * profile.c (pprint): Add Node_K_print_rec case.
+ (pp_print_stmt): If null lnode, print "$0" else print the lnode.
+
+ Unrelated:
+
+ * regex_internal.h: Add ENABLE_NLS to the condition for using
+ gettext so that --disable-nls really disables it.
+
+Sat Feb 23 22:46:00 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * io.c (rs1_get_a_record, rsnull_get_a_record, rsre_get_a_record):
+ Modify buffer-filling algorithm to always read one or more multiples
+ of the blocksize (iop->readsize).
+ (grow_iop_buffer): Make sure there's room for the current partially
+ read record and one disk block buffer.
+
+Thu Feb 20 22:02:00 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * re.c (research): Fix typo in cast of precision value to int.
+ * regex.h, regex.c, re_internal.h, re_internal.c, regcomp.c, regexec.c:
+ synced to GLIBC source, maintaining K&R portability changes, and bug
+ fixes, although losing ability to compile each file separately.
+ * Makefile.am (SOURCES): Moved placement of regex source files from here ...
+ (EXTRA_DIST): ... to here.
+
+Tue Feb 18 14:17:33 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * re.c (research): Cast precision value to int.
+ * builtin.c (format_tree): For toofew, cast field width value to int.
+ * io.c (rsre_get_a_record): Initialize restart and reend. Add a variable
+ to make sure they're set before used at end of function.
+ (iopflags2str): Removed decl at top and made not static so that GCC
+ stops complaining that it's defined but not used. Bleah.
+
+Mon Feb 17 11:02:34 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * config.guess, config.sub: Updated from prep.
+
+Sun Feb 16 15:47:15 2003 Scott Deifik <scottd@amgen.com>
+
+ * awk.h (format_tree, make_str_node): Changed decls to match how
+ they are called.
+ * builtin.c (format_tree, sub_common): Same.
+ * node.c (make_str_node): Same.
+
+Wed Feb 5 14:18:01 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h: Removed duplicate decl of set_prof_file(). Removed
+ undef of const for non-ANSI C; config.h should handle it.
+ * msg.c (set_loc): Use srcfile and srcline in regular code to shut up
+ stupid SGI compiler.
+
+Tue Feb 4 14:28:06 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ All relevant files: Copyright year updated to 2003.
+
+Tue Feb 4 13:40:41 2003 Martin C. Brown <mc@whoever.com>
+
+ * intl/libgnuintl.h: Preprocessor fixes for MacOS X.
+ * regex.h: Ditto.
+
+Tue Feb 4 13:39:37 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (builtin_func): New string for use in rationalizing
+ function parsing and installation code.
+
+Sun Feb 2 16:00:55 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ Cache function body code pointer so that only have to find it the
+ first time a function is called. This potential for optimization
+ brought to my attention by Stepan Kasal.
+
+ * awk.h [funcbody]: New macro.
+ * awkgram.y (FUNC_CALL): Set $$->funcbody to NULL.
+ * eval.c (func_call): Changed to take top-level Node_func_call as the
+ single parameter. Do the lookup and caching.
+ (r_tree_eval): Change how func_call() is called in switch.
+ * profile.c (pp_func_call): Similar changes.
+ (tree_eval): Ditto.
+
+Sun Feb 2 15:32:42 2003 Stepan Kasal <kasal@math.cas.cz>
+
+ ADR: More grammar rationalization/repair from Stepan.
+
+ * awkgram.y (common_exp, simp_exp): the rule from getline (without
+ pipe) has been moved from common_exp to simp_exp.
+
+ The redirection of print statements reworked. The idea comes from
+ mawk-1.3.3; much thanks to Michael Brennan!
+
+ * awkgram.y (IO_OUT, IO_IN): new tokens.
+ (APPEND_OP, TWOWAYIO): swallowed by the above ones.
+ (in_print, in_parens): new static variables, to trace whether
+ IO_OUT is expected.
+ (yylex): emit the new tokens, update in_parens on '(' and ')'.
+ (exp): the print command(s) reworked.
+ (oputput_redir): reworked.
+ (print_expression_list): new non-terminal.
+ (rexp, rexpression_list opt_rexpression_list): nuked.
+ (exp, simp_exp): ``cmd|getline'' rule changed to
+ ``cmd IO_IN getline'' and moved from exp to simp_exp.
+
+ Unrelated:
+
+ * awkgram.y (variable): Don't return Node_func, issue a fatal
+ error instead.
+ * eval.c (r_tree_eval, r_get_lhs): Omit special checks for Node_func,
+ nodes of this type cannot get into the program tree.
+ * profile.c (tree_eval, pp_lhs): Likewise.
+
+Thu Jan 30 17:42:05 2003 Stepan Kasal <kasal@math.cas.cz>
+
+ ADR: Applied lots of patches from Stepan.
+
+ * array.c (do_delete_loop): Call after_assign for the loop index.
+ * field.c (do_split): The third argument to split(), sep, has to be
+ evaluated and the result dupnoded before assoc_clear is called,
+ similarily as src. And we needn't to evaluate the third argument
+ if it's CONSTant regex and the first parameter is null string.
+ * awk.h (dupnode): Changed to macro, function renamed to r_dupnode.
+ * node.c (dupnode, r_dupnode): Rename.
+ * awkgram.y (parms_shadow): Return bool value, ...
+ (shadow_funcs): ... which will enable us to end the program if
+ lintfunc is fatal.
+ (program): Cleanup of the rules defining the ``program'' non-terminal.
+ (start, program, rule): no value associated,
+ expression_value is now treated similarily as begin_block and end_block.
+ (pattern, rule): bison actions for non-terminal `pattern' now
+ add a new rule to the appropriate Node_rule_list, action for
+ non-terminal `rule' now only adds the associated code block
+ to the rnode of Node_rule_node.
+ (io_allowed): renamed to !begin_or_end_rule.
+ (append_pattern): New function, adds new Node_rule_node to a rule_list.
+ (mkrangenode): Deleted, this tiny function was called only once.
+ (function_body): non-terminal replaced by `action'.
+ (statements, action, statement): `statements' can now be empty;
+ both callers had to accomodate to this.
+ (statements): Don't call isnoeffect($2->type) if
+ $2 happens to be NULL.
+
+Mon Jan 27 14:12:19 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * io.c (iop_close): Based on report by Stepan Kasal and because of
+ his changes, don't call reset_record() when saving a copy of contents
+ of $0.
+ * awkgram.y: Improved function parsing error messages for case where
+ user uses a builtin name as a function name. Based on error report
+ by Stepan Kasal.
+ * ext.c (make_builtin): Set FUNC flag for new function. Based on error
+ report by Stepan Kasal.
+
+Mon Jan 27 14:06:20 2003 Stepan Kasal <kasal@math.cas.cz>
+
+ * field.c (reset_record): No longer call set_record(), the code is
+ moved to the function body. Do not set MAYBE_NUM.
+ (set_record): Call reset_record() to perform the common tasks.
+ The prototype has changed, change awk.h and all callers.
+
+Mon Jan 27 10:50:03 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (NODE): `proc' renamed to `builtin,' to fix a conflict
+ on some systems. Replaced on all spots where it was used.
+
+Sun Jan 26 11:52:01 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h [NUMSUBPATS]: New macro.
+ * builtin.c (do_match): Use it in loop that fills in subpattern info.
+ * eval.c (r_tree_eval): for Node_assign, don't call free_temp(),
+ as assign_val() contains dupnode(), which would clear the TEMP
+ flag. From Stepan Kasal <kasal@math.cas.cz>.
+ * config.sub: Updated from prep.
+
+Sun Jan 19 22:34:01 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (do_asorti): Add declaration.
+ * awkgram.y (tokentab): Add asorti() function to table.
+ * array.c (ASORT_TYPE): New enumerated type for VALUE or INDEX array
+ sorting.
+ (assoc_sort_inplace): New second arg of type ASORT_TYPE. Additional code
+ to rearrange array so rest of merge-sorting works; basically values are
+ tossed and index moved into value spot.
+ (asort_actual): Renamed from do_asort(). Takes new ASORT_TYPE argument.
+ (do_asort): Calls asort_actual(tree, VALUE).
+ (do_asorti): Calls asort_actual(tree, INDEX).
+
+ * main.c (load_procinfo): Free groupset array when done with it.
+
+Thu Jan 16 18:30:50 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * builtin.c (do_match): Revised to provide start and length
+ indices in array 3rd parameter.
+ * config.guess, config.sub: Updated from prep.
+
+Thu Jan 2 11:09:12 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ Updated to bison 1.875.
+
+Tue Dec 31 17:14:45 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ Updated things to automake 1.7.2 and autoconf 2.57.
+
+Tue Dec 31 16:54:44 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h [IOP_CLOSED]: New flag.
+ * io.c (iop_close): Set IOP_CLOSED flag.
+ (inrec): Check for IOP_CLOSED; if set return EOF.
+ (rs1_get_a_record, rsnull_get_a_record): Check for EOF before
+ refilling buffers.
+ (rsre_get_a_record): Ditto. Also, set RT before updating pointers in IOP.
+ * Makefile.am (efence): New target to compile with Electric Fence.
+
+2002-12-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * awk.h (catchsig): Delete prototype.
+ * main.c (catchsig): Make static and remove excess argument.
+ (main): Delete unnecessary casts.
+ * io.c (rs1_get_a_record, rsnull_get_a_record): Mark parameter
+ with ATTRIBUTE_UNUSED.
+
+Mon Dec 23 11:54:07 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * regex_internal.h, regex_internal.c, regcomp.c, regexec.c, version.c:
+ Fixed to compile, once again, under K&R compilers.
+ * io.c (grow_iop_buffer): Fix calculation of new size to
+ first subtract 2, double, then add 2 back in.
+
+Fri Dec 20 11:48:42 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ get_a_record split into three routines.
+
+ * awk.h (IOBUF): Structure reworked for new code.
+ * io.c (get_a_record): Now a pointer to different functions.
+ (rs1_get_a_record, rsnull_get_a_record, rsre_get_a_record): New functions.
+ (iop_alloc, iop_close): Reworked for new structure.
+ (do_getline, inrec): Modifiend for new EOF condition.
+ (iopflags2str): New routine.
+
+Fri Dec 20 11:05:50 2002 Isamu Hasegawa <isamu@yamato.ibm.com>
+
+ * regex.c, regex_internal.c, regex_internal.h: Changes to allow separate
+ compilation of the reg*c files.
+ * regcomp.c: Fix bug in using translation tables with [[:upper:]] etc.
+ * Makefile.am: Move regex files into sources from EXTRA_DIST. (ADR)
+
+Mon Dec 9 14:20:42 2002 Stepan Kasal <kasal@math.cas.cz>
+
+ * main.c (main): When processing option '-f' don't ignore spaces
+ if optarg points at the beginning of the current argument
+ (like ``gawk -f " " file'').
+
+2002-11-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * awkgram.y (stopme): Mark parameter with ATTRIBUTE_UNUSED.
+ (yyerror): Add ATTRIBUTE_PRINTF_1.
+ * builtin.c (do_systime, do_rand): Likewise.
+ * field.c (set_field, re_parse_field, def_parse_field,
+ posix_def_parse_field, null_parse_field, sc_parse_field,
+ fw_parse_field): Likewise.
+ * io.c (pidopen, useropen): Likewise.
+ * main.c (catchsig): Likewise.
+ * profile.c (init_profiling): Likewise.
+ * awk.h (err): Add ATTRIBUTE_PRINTF.
+ * msg.c (err): Delete redundant prototype. Fix format specifier.
+
+Wed Nov 27 06:04:20 2002 Pat Rankin <rankin@pactechdata.com>
+
+ * ext.c [#if !DYNAMIC] (do_ext): Cast string value for error node.
+
+Sun Nov 24 18:23:29 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ From Paul Eggert, with some edits by me.
+
+ * builtin.c (do_substr): Consistently use floating point
+ values for lint messages, so they should be printed pretty
+ much as the user saw them. Check for overflow before
+ converting floating point to integer. Do the right thing with
+ NaNs.
+
+ Check for index out-of-range before checking for length
+ out-of-range, to avoid some nasty effects if address
+ arithmetic overflows (e.g., indx + length < index).
+
+ Allow zero-length substrings when checking for lint if
+ do_lint == LINT_INVALID.
+
+Sun Nov 24 18:21:06 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (LINT_ALL, LINT_INVALID): New constants.
+ * main.c (main): Allow --lint=invalid which restricts warning to
+ things that aren't valid.
+ * eval.c (set_LINT): Update setting logic.
+
+Wed Nov 20 13:14:58 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (lintfunc): Improve ifdef for attribute to only
+ work for GCC 3.2 and later.
+ * io.c (PIPES_SIMULATED): Don't define if on AIX, which
+ does define TANDEM in one of its header files. Ugh.
+
+Tue Nov 19 15:33:55 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * builtin.c (do_substr): Use %lu in warnings instead of %d.
+
+Mon Nov 18 14:42:53 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * config.guess: Synced from ftp.gnu.org.
+ * config.sub: Ditto.
+
+Sun Nov 17 21:32:49 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ Updated things to automake 1.7.1.
+
+Sun Nov 3 14:33:30 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * eval.c (r_get_lhs): For variables, always clear UNINITIALIZED,
+ since the variable is about to be assigned to. From Stepan Kasal.
+
+Fri Nov 1 11:19:01 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (lintfunc): Can only supply attributes for a function
+ pointer if GCC >= 3. Added ifdefs. Bah, humbug.
+
+2002-10-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * array.c (array_init, concat_exp, assoc_find, do_delete):
+ Const-ify.
+ * awk.h (redirect, set_record, pp_func, pp_string_fp, format_val,
+ parse_escape, make_regexp, research, reisstring, remaybelong):
+ Likewise.
+ * awkgram.y (dumpintlstr, dumpintlstr2, func_use, dup_parms,
+ var_comp, finfo, fcompare, func_use, dumpintlstr, dumpintlstr2):
+ Likewise.
+ * builtin.c (stdfile, do_fflush, do_index, category_table):
+ Likewise.
+ * eval.c (push_forloop, push_args, PUSH_BINDING, RESTORE_BINDING,
+ cmp_nodes, op_assign, loop_info, fcall, fmt_ok, set_LINT,
+ comp_func): Likewise.
+ * ext.c (do_ext): Likewise.
+ * field.c (set_record): Likewise.
+ * io.c (gawk_popen, two_way_open, binmode, redirect, getredirect,
+ fatal): Likewise.
+ * node.c (values, format_val, make_str_node, parse_escape): Likewise.
+ * profile.c (pp_string, pp_match_op, pp_func, pp_string,
+ pp_string_fp): Likewise.
+ * re.c (make_regexp, research, reisstring, remaybelong): Likewise.
+
+2002-10-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * awk.h (__attribute__, ATTRIBUTE_UNUSED, ATTRIBUTE_NORETURN,
+ ATTRIBUTE_PRINTF, ATTRIBUTE_PRINTF_1, __extension__): Define.
+ (emalloc, erealloc): Fix format specifier warnings.
+ (do_nextfile):Mark with ATTRIBUTE_NORETURN.
+ (getredirect): Const-ify.
+ (msg, error, warning, r_fatal, lintfunc): Mark with
+ ATTRIBUTE_PRINTF_1.
+ (r_fatal): Mark with ATTRIBUTE_NORETURN.
+ * builtin.c (format_tree): Fix format specifier warning.
+ * eval.c (interpret): Likewise.
+ * main.c (usage, copyleft, catchsig, nostalgia, version): Mark
+ with ATTRIBUTE_NORETURN.
+ * profile.c (dump_and_exit): Likewise.
+
+2002-10-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * array.c (array_init): Use ISDIGIT, not isdigit.
+ * awk.h (m_tree_eval, force_number, force_string): Use
+ __extension__ in statement expressions.
+ * main.c (lintfunc): Fix !__SDTC__ case.
+ * regex_internal.c (calc_state_hash): Fix inline declaration.
+ * regexec.c (proceed_next_node): Cast assignment to correct type.
+
+2002-10-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * awk.h (exp_node, Func_ptr): Add prototype arguments.
+ * awkgram.y (yystype, token, getfname, nextc, pushback,
+ allow_newline, yylex): Likewise.
+ * io.c (wait_any): Likewise.
+ * profile.c (indent_in, indent_out): Likewise.
+ * random.h (random): Likewise.
+
+2002-10-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * array.c (grow_table): Const-ify.
+ * awk.h (RE_TRANSLATE_TYPE): Define.
+ (flagtab, casetable): Const-ify.
+ (getfname, shadow_funcs, redflags2str): Prototype.
+ (flags2str, genflags2str, nodetype2str, redflags2str, set_loc,
+ msg, error, warning, r_fatal): Const-ify.
+ * awkgram.y (tokentab, snode): Likewise.
+ * builtin.c (format_tree, do_strftime,
+ localecategory_from_argument): Likewise.
+ * eval.c (casetable, nodetypes, nodetype2str, flags2str,
+ genflags2str): Likewise.
+ * io.c (redflags2str, socketopen): Likewise.
+ * main.c (varfile, version_string, lintfunc, optab, copyleft,
+ varinit, init_vars): Likewise.
+ * msg.c (srcfile, msg, warning, error, set_loc, r_fatal):
+ Likewise.
+ * profile.c (pp_op_assign, pp_match_op, pp_redir): Likewise.
+ * random.c (sccsid): Likewise.
+ * version.c, version.in (version_string): Likewise.
+
+Tue Oct 29 10:50:52 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.in: Update version in AC_INIT and AM_INIT_AUTOMAKE
+ * fixvers: Make grep for pattern a little smarter.
+
+Mon Oct 28 16:35:39 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (hash): Now a function pointer.
+ * array.c (gst_hash_string, scramble): New functions.
+ (awk_hash): Renamed from hash.
+ (hash): Now a function pointer.
+ (array_init): Change hash function based on environment for
+ experimentation.
+
+Mon Oct 28 13:21:20 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ Applied lots of patches from Stepan Kasal, tweaked as needed
+ for current code base.
+
+ * node.c (dupnode): When n->stref overfows, flag the node as PERM.
+ Same for n->ahname_ref.
+ (unref): Remove the check for n->stref == LONG_MAX and
+ n->ahname_ref == LONG_MAX.
+ * awk.h (make_string): The third argument to make_str_node changed
+ from FALSE to 0, it's not Boolean.
+ (free_temp): Evaluate the argument only once, so that we
+ can call free_temp(tree_eval(n)) for achieving side effects.
+ (load_environ, load_procinfo): Changed return type to NODE *.
+ * main.c (load_environ): The ENVIRON_node should be created with type
+ Node_var_array and lnode set to NULL. Return pointer to the created node
+ and create an empty hash even on TANDEM.
+ (load_procinfo): Same mods for PROCINFO_node.
+ (init_args): ARGV_node should also have lnode set to NULL.
+ * eval.c (r_tree_eval): case Node_assign moved just above the other
+ assignment cases.
+ (op_assign): ++ and -- cases merged with += and -=, respectively.
+ (push_args): Evaluate all args, even in cases where more args are
+ supplied then required.
+ (interpret): In case Node_K_forarray, flag the variable
+ num_elems also as volatile, so that it survives longjmp() and
+ can be trusted when linting code.
+ (r_get_lhs): Case Node_param_list was unreachable (unless
+ something breaks really badly), remove it;
+ (r_tree_eval): case Node_var_array removed from the last switch,
+ it was caught in the first switch above.
+ * profile.c (tree_eval): Again, case Node_var_array was caught above.
+ * awkgram.y (variable): Code simplified, making use of the above
+ changes.
+ * field.c (sc_parse_field): IGNORECASE only applies to regex based
+ field-splitting, so remove code that pays attention to it.
+ (do_split): Don't use parse_field if RS_is_null.
+ (set_FS): Beware of FS == "\\" even if RS_is_null.
+
+ Code changes to make things work better:
+ * field.c (set_FS): Don't use cmp_nodes() to compare old and new
+ value of FS, that uses IGNORECASE, which is a bad idea. Improve
+ logic for choosing sc_parse_field. Ensure that when RS_is_null
+ but using a single character, that we do pay attention to
+ case when doing regex splitting.
+ * io.c (set_RS): Don't use cmp_nodes() to compare old and new
+ value of RS, that uses IGNORECASE, which is a bad idea.
+
+Mon Oct 28 09:43:14 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * recomp.c (parse_expression): Change return statement into
+ two so it'll compile for SGI cc.
+
+ * awk.h (STR, CUR): Changed to STRCUR and NUMCUR respectively,
+ to avoid conflict with STR on some System V systems. Changed
+ in all source files.
+
+Thu Oct 24 16:14:34 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * array.c (AVG_CHAIN_MAX): Now a variable, to allow easy experimentation.
+ (array_init): Pulls a new value from env var AVG_CHAIN_MAX if it
+ exists and sets the variable.
+ * awk.h: Add declaration for array_init().
+ * main.c (main): Call array_init().
+
+Tue Oct 22 11:23:56 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * bisonfix.sed: Updated for current bison. Death to alloca!
+
+2002-10-21 Isamu Hasegawa <isamu@yamato.ibm.com>
+
+ * builtin.c (tolower, toupper): Add casts to char* to fix some
+ compiler warnings.
+ * eval.c (cmp_nodes): Ditto.
+ * regcomp.c (peek_token_bracket): Skip the byte already read.
+
+Wed Oct 16 15:02:09 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * io.c (set_RS): Make sure to always call set_FS().
+
+2002-10-11 Isamu Hasegawa <isamu@yamato.ibm.com>
+
+ * regcomp.c (re_compile_fastmap_iter): Remove the handling
+ OP_CONTEXT_NODE.
+ (regfree): Likewise.
+ (create_initial_state): Likewise.
+ (analyze): Remove the substitutions which became useless.
+ (calc_first): Likewise.
+ (calc_epsdest): Use edests of OP_BACK_REF in case that it has
+ epsilon destination.
+ (duplicate_node_closure): New function.
+ (duplicate_node): Remove the handling OP_CONTEXT_NODE.
+ (calc_inveclosure): Likewise.
+ (calc_eclosure): Likewise.
+ (calc_eclosure_iter): Invoke duplicate_node_closure instead of
+ direct invocation of duplicate_node.
+ (parse): Don't use comma operator in the return to avoid compiler
+ warning.
+ (parse_reg_exp): Likewise.
+ (parse_branch): Likewise.
+ (parse_expression): Likewise.
+ (parse_sub_exp): Likewise.
+ (parse_dup_op): Likewise.
+ * regex_internal.c (re_dfa_add_node): Remove the substitutions
+ which became useless.
+ (create_ci_newstate): Remove the handling OP_CONTEXT_NODE.
+ (create_cd_newstate): Likewise.
+ * posix/regex_internal.h (re_token_type_t): Remove the obsolete type.
+ (re_token_t): Likewise.
+ (re_dfa_t): Likewise.
+ (re_node_set_remove): New macro.
+ * regexec.c (check_matching): Remove the handling
+ OP_CONTEXT_NODE.
+ (check_halt_node_context): Likewise.
+ (proceed_next_node): Likewise.
+ (pop_fail_stack): Fix the memory leak.
+ (set_regs): Likewise.
+ (free_fail_stack_return): New function.
+ (sift_states_backward): Fix the memory leak. Remove the handling
+ OP_CONTEXT_NODE.
+ (update_cur_sifted_state): Append some if clause to avoid redundant
+ call.
+ (sub_epsilon_src_nodes): Use IS_EPSILON_NODE since it might be a
+ back reference.
+ (check_dst_limits): Remove the handling OP_CONTEXT_NODE.
+ (check_subexp_limits): Likewise.
+ (search_subexp): Likewise.
+ (sift_states_bkref): Likewise.
+ (transit_state_mb): Likewise.
+ (transit_state_bkref_loop): Likewise.
+ (transit_state_bkref_loop): Likewise.
+ (group_nodes_into_DFAstates): Likewise.
+ (check_node_accept): Likewise.
+ (sift_ctx_init): Add initializing.
+
+Tue Oct 15 14:18:53 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * eval.c (set_IGNORECASE): Call set_RS() instead of
+ set_FS_if_not_FIELDWIDTHS(). The former calls the latter
+ for us, and also makes IGNORECASE affect RS like it's supposed to.
+ * field.c (FS_re_yes_case, FS_re_no_case): New variables.
+ (set_FS): Smarten up routine to not recompile FS_regexp if all
+ that's changed is IGNORECASE or if switching back to FS from
+ FIELDWIDTHS. Significant speed-up for cases where IGNORECASE
+ is assigned to for every record.
+ * io.c (RS_re_yes_case, RS_re_no_case): New variables.
+ (set_RS): Similar changes as to set_FS(). In particular,
+ IGNORECASE changing now affects record splitting too.
+ * re.c (refree): Set rp->pat.tranaslate to NULL. It comes
+ from casetable and shouldn't be freed. (Strictly necessary
+ only for old regex, but a good idea anyway).
+ Also, call regfree(& rp->pat) instead of manually free()ing
+ things, since there's dynamically allocated stuff hiding in
+ the buffer. Avoids a memory leak.
+
+Mon Oct 14 12:02:39 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ Major space reduction in array management. Overhead reduced
+ to two NODE's per element from three.
+
+ * awk.h (ahash): Union is gone.
+ (hash.ref): new union member.
+ (ahnext): new definition into hash union.
+ (ahvalue): new definition into hash union.
+ (ahname_str): new member, points into hash union.
+ (ahname_len): new member, points into hash union.
+ (ahname_ref): new member, points into hash union.
+ * array.c: Replaces uses of ahname member with string and
+ length. Set the reference count correctly to 1 on new nodes.
+ * eval.c (interpret): Case for Node_K_arrayfor. dupnode() the
+ array indices, and set loop variable to new value made via
+ make_string().
+ * node.c (unref, dupnode): Node_ahash nodes are now also
+ reference counted, a la strings. Similar code is used to
+ increment/decrement the counts, and/or copy nodes as
+ needed.
+
+ Unrelated:
+ * awk.h (forsub): Removed. Not used.
+
+Sun Oct 13 16:58:27 2002 Stepan Kasal <kasal@math.cas.cz>
+
+ * profile.c (pprint): #undef the temporary defines at the end
+ of the case.
+ * eval.c (interpret): Likewise.
+ (assign_val): we can unref() before doing dupnode().
+ Also, move the check for NF < 0 from here ...
+ * field.c (set_NF): ... to here.
+ * main.c (varinit): no need to call set_NF().
+ * awkgram.y (statements): don't be so generous when concatenating
+ `statements' with a `statement'.
+
+
+2002-10-13 Isamu Hasegawa <isamu@yamato.ibm.com>
+
+ * regcomp.c: Synced with development sources.
+ * regex_internal.c: Synced with development sources.
+ * regex_internal.h: Synced with development sources.
+ * regexec.c: Synced with development sources.
+
+Sun Oct 13 21:35:35 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (NODE): reflags is now unsigned long for:
+ (exec_count): defined to be sub.nodep.reflags. Using `number'
+ broke pgawk.
+ * profile.c (Node_K_delete_loop): print out as a for loop
+ with a comment that it's internally the same as `delete array'.
+ * eval.c (Node_K_delete_loop): Increment the exec_count. Ooops.
+ * configure.in (AM_GNU_GETTEXT_VERSION): New macro call.
+ * custom.h: Updated description of the file at the top.
+
+Thu Oct 10 16:39:51 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (vname, exec_count): Now macros into different
+ parts of the NODE structure that can be safely used for them.
+ Saves 16 bytes per NODE.
+ * eval.c: Changed use of `vname' to `varname' to avoid new
+ macro.
+ * main.c (lintfunc): Made ifdefed decls match awk.h.
+ * eval.c (comp_func): Use memcmp instead of strcmp.
+ * configure.in (AC_CONFIG_HEADER): Physically append custom.h
+ to config.h to avoid subdir compiliation problems.
+
+Sun Oct 6 17:36:15 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ Updated to automake 1.7 and bison 1.50.
+
+ * INSTALL: Replaced with current version from automake 1.7.
+ * config.guess: Replaced with current version from automake 1.7.
+ * config.sub: Replaced with current version from automake 1.7.
+ * depcomp: Replaced with current version from automake 1.7.
+ * doc/texinfo.tex: Replaced with current version from automake 1.7.
+ * install-sh: Replaced with current version from automake 1.7.
+ * missing: Replaced with current version from automake 1.7.
+ * mkinstalldirs: Replaced with current version from automake 1.7.
+ * ylwrap: Replaced with current version from automake 1.7.
+
+ * configure.in (DYNAMIC): Updated AC_DEFINE(DYNAMIC) to
+ three-argument form for autoheader.
+ * acinclude.m4: Removed includes of jm-mktime.m4 and
+ largefile.m4, which are now standard parts of Autoconf.
+
+ * Makefile.in: Regenerated.
+ * aclocal.m4: Regenerated.
+ * awkgram.c: Regenerated.
+ * awklib/Makefile.in: Regenerated.
+ * configure: Regenerated.
+ * doc/Makefile.in: Regenerated.
+ * test/Makefile.in: Regenerated.
+
+Sun Sep 29 16:47:49 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * custom.h (__WIN32__): Added from gnuwin32 project, via
+ Stepan Kasal.
+
+ * awkgram.y: For tawk compatibility, added `delete(array)'.
+ To remain undocumented, since it's WAY non-standard.
+
+Sun Sep 22 22:23:50 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (re_cnt): Removed, not needed since no dfa code.
+ * awkgram.y (regexp, a_regexp): Removed use of re_cnt.
+ * re.c (re_update): Ditto.
+
+Thu Sep 19 10:55:37 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * io.c (binmode): Create function if defined(WIN32) also.
+
+ Updated to gettext 0.11.5, autoconf 2.54 and automake 1.6.3.
+
+ * aclocal.m4: Regenerated.
+ * m4/codeset.m4: Updated.
+ * m4/gettext.m4: Updated.
+ * m4/glibc21.m4: Updated.
+ * m4/iconv.m4: Updated.
+ * m4/lcmessage.m4: Updated.
+ * m4/lib-ld.m4: Updated.
+ * m4/lib-link.m4: Updated.
+ * m4/lib-prefix.m4: Updated.
+ * m4/progtest.m4: Updated.
+ * po/Makefile.in.in: Updated.
+ * po/Rules-quot: Updated.
+ * po/boldquot.sed: Updated.
+ * po/en@boldquot.header: Updated.
+ * po/en@quot.header: Updated.
+ * po/insert-header.sin: Updated.
+ * po/quot.sed: Updated.
+ * po/remove-potcdate.sin: Updated.
+
+Tue Sep 17 23:46:01 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.in: Moved override of INSTALL to just after
+ AC_INIT so that it takes effect. Necessary for Autoconf 2.5x.
+
+Mon Sep 16 16:40:57 2002 Stepan Kasal <kasal@math.cas.cz>
+
+ * awkgram.y (want_assign): Removed.
+ (SLASH_BEFORE_EQUAL, ASSIGN): New terminals; ``/='' is now
+ formed from these two.
+ (a_slash): New non-terminal, representing either '/' or
+ SLASH_BEFORE_EQUAL.
+ (assign_operator): New non-terminal, replaces ASSIGNOP.
+ (REGEXP): yylex now eats the terminating '/' before
+ returning REGEXP token.
+ (exp): The check for C-like comments moved from here
+ (regexp): ... to here.
+ (common_exp): New non-terminal; contains common parts of exp
+ and rexp. (a_relop, relop_or_less): New non-terminals.
+ (rexp): some rules updated to be analogous to exp.
+ (output_redir): Can contain only common_exp, not exp in general.
+
+Mon Sep 16 22:51:51 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * io.c (two_way_open): Move label use_pipes outsidef of ifdef,
+ just in case.
+
+Thu Sep 12 15:11:28 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (getfname): Return NULL if not found, remove
+ fatal error. Could be an extension function.
+ (dump_funcs): Walk symbol table counting functions before
+ mallocing table, since there could be extension functions,
+ func_count could be too small.
+ * profile.c (pp_builtin): Handle NULL return from getfname().
+ Print it as "extension_function()" if so.
+
+Tue Sep 10 17:33:48 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ Minor code simplification.
+
+ * awk.h (in_array): Change return type to NODE*.
+ (assoc_exists): Remove declaration.
+ * array.c (in_array): Change return type to NODE *.
+ Return value is pointer to element value or NULL.
+ (assoc_exists): Removed function.
+ * eval.c (r_tree_eval): Case Node_in_array, change value
+ to test return of in_array() against NULL.
+ * io.c (pty_vs_pipes): Change test to make a tmp_string()
+ of the index and call in_array(). Add free_temp() of
+ subscript and free() of full_index (oops).
+
+2002-09-10 Isamu Hasegawa <isamu@yamato.ibm.com>
+
+ * posix/regcomp.c: Wrap #include wchar.h and wctype.h in #if.
+ (build_range_exp): Add castings to strlen invocations.
+ (build_collating_symbol): Restore the type of characters from "char"
+ to "unsigned char", and supplement castings.
+ (build_collating_symbol): Likewise.
+ (build_equiv_class): Likewise.
+ (build_charclass): Likewise.
+ (seek_collating_symbol_entry): Likewise.
+ (parse_bracket_exp): Likewise.
+ (build_word_op): Supplement a casting.
+ * posix/regex_internal.c: Wrap #include wchar.h and wctype.h in #if.
+ (re_string_allocate): Fix castings.
+ (re_string_construct): Likewise.
+ (re_string_construct_common): Likewise.
+ (re_string_realloc_buffers): Likewise.
+ (build_wcs_buffer): Likewise.
+ (build_wcs_upper_buffer): Likewise.
+ (re_string_skip_chars): Likewise.
+ (re_string_reconstruct): Likewise.
+ * posix/regex_internal.h: Restore the type of characters in
+ re_string_t and bracket_elem_t from "char" to "unsigned char".
+ (re_string_elem_size_at): Fix castings.
+ * posix/regexec.c: Wrap #include wchar.h and wctype.h in #if.
+ (transit_state_bkref_loop): Restore the type of characters from
+ "char" to "unsigned char", and append a cast to "char*" pointer in
+ array subscript.
+ (check_node_accept_bytes): Likewise.
+ (find_collation_sequence_value): Likewise.
+
+Thu Sep 5 13:15:09 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * re.c (remaybelong): New routine.
+ (reisstring): Simplified the code a bit.
+ * awk.h (remaybelong): Declaration added.
+ * io.c (get_a_record): Change fourth grungy special case to
+ use remaybelong() instead of strchr() on last character.
+
+Wed Sep 4 13:20:26 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * io.c (do_input): Recode guts of main loop to be easier
+ to trace with a debugger.
+ (get_a_record): Fourth grungy special case for RE-based
+ record splitting added. See explanatory comments there
+ and test/rebuf.awk.
+
+2002-09-03 Isamu Hasegawa <isamu@yamato.ibm.com>
+
+ * posix/regcomp.c (regcomp): Append "__restrict" modifier to avoid
+ warnings of some compilers.
+ (build_collating_symbol): Change the type of characters from
+ "unsigned char" to "char", and append a cast to "char*" pointer in
+ array subscript.
+ (build_collating_symbol): Likewise.
+ (build_equiv_class): Likewise.
+ (build_charclass): Likewise.
+ (re_compile_pattern): Remove incorrect cast.
+ (re_compile_fastmap_iter): Change the type of characters from
+ "unsigned char" to "char", and append a cast to "char*" pointer
+ in array subscript.
+ (parse_bracket_exp): Likewise.
+ * posix/regex_internal.c (re_string_construct_common): Likewise.
+ (re_string_allocate): Likewise.
+ (re_string_construct): Likewise.
+ (re_string_realloc_buffers): Likewise.
+ (build_wcs_buffer): Likewise.
+ (re_string_reconstruct): Likewise.
+ * posix/regex_internal.h: Change the type of characters in
+ re_string_t and bracket_elem_t from "unsigned char" to "char".
+ * posix/regexec.c (regexec): Append "__restrict" modifier to avoid
+ warnings of some compilers.
+ (transit_state_bkref_loop): Change the type of characters from
+ "unsigned char" to "char", and append a cast to "char*" pointer in
+ array subscript.
+ (check_node_accept_bytes): Likewise.
+ (find_collation_sequence_value): Likewise.
+
+Wed Aug 21 15:40:36 2002 Corinna Vinschen <vinschen@redhat.com>
+
+ * configure.in: Define --without-libintl-prefix and
+ --without-libiconv-prefix for Cygwin by default.
+ * Makefile.am: Call fixvers from $(srcdir).
+ * awk.h: Don't define O_BINARY on Cygwin.
+
+Wed Aug 21 15:31:57 2002 Andreas Buening <andreas.buening@nexgo.de>
+
+ * configure.in (AC_OBJEXT, AC_EXEEXT): Added. Removed OS/2 goo.
+ * Makefile.am (check-local): Add $(EXEEXT) suffixes, remove OS/2 goo.
+ * regcomp.c, regex_internal.c, regexec.c: Conditionalize include of
+ <wchar.h> and <wctype.h> on RE_ENABLE_I18N.
+
+Wed Aug 21 14:43:57 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gettext.h (ENABLE_NLS): Add include of locale.h so that things
+ compile even without optimization. Sheesh.
+ * io.c (two_way_open, pty_vs_pipes): Conditionalize pty code on
+ HAVE_TERMIOS_H.
+
+Thu Aug 8 22:16:10 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * main.c (main): Force LC_NUMERIC locale to "C", esp. for
+ M$ systems. Ugh.
+
+Wed Aug 7 13:42:01 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * io.c (get_a_record): Improve test for newlines at beginning of
+ record but with nothing following it. See test/nulrsend.
+
+Mon Aug 5 10:12:39 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ Add option to use ptys instead of pipes for |&.
+ Basic plumbing originally from Paolo Bonzini <bonzini@gnu.org>.
+
+ * awk.h (RED_PTY): New flag.
+ (assoc_exists): Add declaration.
+ * array.c (in_array): Use FALSE not zero for return value.
+ (assoc_exists): New routine to find and return value for an index
+ in an array.
+ * configure.in: test for termios.h and stropts.h, and grantpt function.
+ * io.c: include termios.h and stropts.h if available.
+ (redflags2str): Add RED_PTY to table.
+ (redirect): Add RED_PTY to flags turned off when searching.
+ (close_redir): close write channel for two-way pipes
+ that use ptys by sending an EOF.
+ (two_way_open): If pty_vs_pipe(), use pty's to open two-way pipes as
+ they are line-buffered by default --> alleviates deadlock problems.
+ If fails, fall back to using pipes.
+ (pty_vs_pipe): New function.
+ * main.c (arg_assign): Clean up English in some of the error messages.
+
+Sun Aug 4 00:37:38 2002 Stepan Kasal <kasal@math.cas.cz>
+
+ * re.c (make_regexp): don't pass the error message returned by
+ re_compile_pattern() to gettext(); it's already gettextized.
+ (make_regexp): minor reformat of code.
+
+Wed Jul 31 23:50:31 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ Removed dfa code from gawk since not really needed with new regex.
+
+ * Makefile.am: Removed dfa.h and dfa.c.
+ * awk.h (struct Regexp): Removed `dfareg' and `dfa' members.
+ (make_regexp): Last parameter in function went away, changed decl.
+ (avoid_dfa): Removed declaration.
+ * awkgram.y: Fixed call to make_regexp().
+ * eval.c (match_op): Simplified: removed call to avoid_dfa() and
+ `kludge_need_start' variable. Instead, pass FALSE as last parameter
+ of research().
+ * field.c (set_FS): Fixed call to make_regexp().
+ * io.c (get_a_record, set_RS): Fixed calls to make_regexp().
+ * re.c (make_regexp): Removed last paramter (`dfa') from function.
+ Simplified the code.
+ (research): Simplified the code, removed calls to dfa stuff.
+ (dfaerror): Removed function.
+ (re_update): Fixed call to make_regexp().
+ (avoid_dfa): Removed function.
+
+Thu Jul 25 21:55:45 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * regcomp.c, regex_internal.c, regex_internal.h, regexec.c: Bug
+ fixes from Isamu Hasegawa <isamu@yamato.ibm.com> and Stepan Kasal
+ <kasal@math.cas.cz> applied.
+
+Sat Jul 6 23:28:37 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (yyerror): Change text of unexpected newline message to
+ include end of string.
+
+Mon Jun 17 17:58:55 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * field.c (do_split): Per Michal Jaegermann, move free_temp(fs)
+ above label `out'.
+
+Tue Jun 11 23:26:09 2002 Paul Eggert <eggert@twinsun.com>
+
+ Update to autoconf 2.53 and automake 1.6.1.
+
+ * acconfig.h: Removed.
+ * m4/isc-posix.m4: Removed.
+ * m4/jm-mktime.m4: Removed.
+ * m4/largefile.m4: Removed.
+ * m4/ssize_t.m4: Removed.
+ * ansi2knr.c: updated.
+ * depcomp: updated.
+ * install-sh: updated.
+ * missing: updated.
+ * mkinstalldirs: updated.
+ * ylwrap: updated.
+
+ * configure.in: Improved quoting.
+ * acinclude.m4: Use `m4_sinclude', not antiquated `sinclude'.
+
+Tue Jun 11 23:08:40 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.in: Add `getgrent' to list of functions checked
+ so that awklib/grcat is compiled correctly.
+
+Tue Jun 11 22:18:42 2002 Stepan Kasal <kasal@math.cas.cz>
+
+ Improve argument parsing and -v assignment.
+
+ * awk.h (struct src): Add additional enum values.
+ (arg_assign): Return type and arg list changes.
+ * io.c (nextfile): Add extra arg in call to `arg_assign'.
+ * main.c (pre_assign): Nuked.
+ (allocfiles): New variable.
+ (srcfiles_add, preassigns_add): New macros.
+ (main): Logic cleaned up.
+ (add_src): New function.
+
+ Use `size_t' for optimal_bufsize function.
+
+ * awkgram.y (yylex): `len' is now size_t.
+ * pc/gawkmisc.pc (optimal_bufsize): Change return type to size_t.
+ * posix/gawkmisc.c (optimal_bufsize): Change return type to size_t.
+ * unsupported/atari/gawkmisc.atr (optimal_bufsize): Change return type
+ to size_t.
+ * unsupported/tandem/tmisc.c (optimal_bufsize): Change return type to size_t.
+ * vms/gawkmisc.vms (optimal_bufsize): Change return type to size_t.
+ * README_d/README.hpux: New file.
+
+Fri May 24 12:23:01 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile.c (init_profiling): Remove default initialization
+ of `prof_fp' to stderr. Per Stepan Kasal <kasal@math.cas.cz>.
+
+Wed May 15 15:39:17 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ Work through builtin operations to make sure that
+ anything that might have side effects gets dealt with.
+
+ * array.c (do_delete): Evaluate subscript first before
+ checking if something is or isn't an array.
+ * builtin.c (sub_common): Evaluate replacement text, and
+ free it if no match of regex in source text.
+
+Wed May 15 15:30:34 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ Switch to new version of regex from IBM Japan.
+
+ * regcomp.c: New file.
+ * regex.c: Replaced with new version.
+ * regex.h: Replaced with new version.
+ * regex_internal.c: New file.
+ * regex_internal.h: New file.
+ * regexec.c: New file.
+ * Makefile.am (EXTRA_SOURCES): New files added.
+
+Tue May 14 17:04:05 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h (<locale.h>): Move check and include into gettext.h.
+ * gettext.h (<locale.h>): Add check and include per patch from
+ Bruno Haible.
+
+ * field.c (do_split): When checking for split of null string,
+ evaluate seperator if it's not FS, since could have side effects.
+ At end, free_temp(fs), not free_temp(sep).
+ Both of these thanks to Stepan Kasal <kasal@math.cas.cz>.
+
+Mon May 13 00:41:31 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * custom.h (ultrix): Add define GETGROUPS_NOT_STANDARD.
+ * main.c (init_groupset): For GETGROUPS_NOT_STANDARD, use old way
+ to set `ngroups'.
+
+2002-05-10 Andreas Schwab <schwab@suse.de>
+
+ * dfa.c (parse_bracket_exp_mb): Fix warning.
+
+Thu May 9 22:28:32 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * builtin.c (sub_common): Fix logic for match of null strings to
+ get correct semantics. See test/gsubtst2.*.
+ * field.c (do_split): Minor code cleanup; the third arg to split()
+ is set to be FS by the grammar, so don't need to check it for NULL.
+ Thanks to Stepan Kasal <kasal@math.cas.cz>.
+ * awk.h (locale.h): Move include before that of "gettext.h" for systems
+ that define functions that gettext.h would use when NLS is disabled.
+ Per bug report from Ayamura Kikuchi <ayamura@ayamura.org>.
+
+Tue May 7 17:31:01 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ Miscellanious patches courtesy of Stepan Kasal <kasal@math.cas.cz>.
+
+ * field.c, main.c: Tidy up some comments.
+ * field.c (set_FIELDWIDTHS): Init fw_alloc to 4 so it isn't
+ immediately realloced.
+ * main.c (load_procinfo): Check value of FS/FIELDWIDTHS for
+ value of PROCINFO["FS"].
+ * awk.h (set_FS_if_not_FIELDWIDTHS): Removed decl.
+ * field.c (set_FS_if_not_FIELDWIDTHS): Removed function.
+ * eval.c (set_IGNORECASE): Use inline code checking `using_fieldwidths()'.
+ * io.c (set_IGNORECASE): Ditto.
+
+Sun May 5 14:28:34 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ Fix a memory leak in array for loops if the body contains a
+ `next' or `nextfile' statement. The changes maintain a stack
+ of active for loops that is pushed and popped for each loop,
+ and popped entirely for `next', `nextfile', etc.
+
+ * eval.c (forloops_active, pop_forloop, pop_all_forloops, push_forloop):
+ new functions.
+ (interpret): Case Node_K_arrayfor, call push and pop functions.
+ Case Node_rule_list: pop loops and pop fcalls after longjmp.
+ Cases Node_K_next, Node_K_nextfile, Node_K_break and
+ Node_K_continue, removed check before longjmp.
+ Case Node_K_exit: add loop check.
+ (loop_stack, nloops, nloops_active): New variables that implement
+ the stack.
+
Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.1: Release tar file made.
diff --git a/FUTURES b/FUTURES
index fabebb58..bbc9033b 100644
--- a/FUTURES
+++ b/FUTURES
@@ -30,6 +30,8 @@ In 3.1
Additional manual features:
DONE: Document NLS support
+ DONE: Use a new or improved dfa and/or regex library.
+
For 3.2
=======
Move the loadable modules interface to libtool.
@@ -58,7 +60,6 @@ For 3.2
For 3.3
=======
- Use a new or improved dfa and/or regex library.
? Have strftime() pay attention to the value of ENVIRON["TZ"]
diff --git a/INSTALL b/INSTALL
index a2c8722c..54caf7c1 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,3 +1,9 @@
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
+Foundation, Inc.
+
+ This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
Basic Installation
==================
@@ -8,20 +14,27 @@ various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, a file
-`config.cache' that saves the results of its tests to speed up
-reconfiguring, and a file `config.log' containing compiler output
-(useful mainly for debugging `configure').
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If at some point `config.cache'
-contains results you don't want to keep, you may remove or edit it.
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
- The file `configure.in' is used to create `configure' by a program
-called `autoconf'. You only need `configure.in' if you want to change
-it or regenerate `configure' using a newer version of `autoconf'.
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
The simplest way to compile this package is:
@@ -55,14 +68,16 @@ Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
-the `configure' script does not know about. You can give `configure'
-initial values for variables by setting them in the environment. Using
-a Bourne-compatible shell, you can do that on the command line like
-this:
- CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
-Or on systems that have the `env' program, you can do it like this:
- env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+ ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
@@ -75,11 +90,11 @@ directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
- If you have to use a `make' that does not supports the `VPATH'
-variable, you have to compile the package for one architecture at a time
-in the source code directory. After you have installed the package for
-one architecture, use `make distclean' before reconfiguring for another
-architecture.
+ If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory. After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
Installation Names
==================
@@ -122,22 +137,32 @@ you can use the `configure' options `--x-includes=DIR' and
Specifying the System Type
==========================
- There may be some features `configure' can not figure out
-automatically, but needs to determine by the type of host the package
-will run on. Usually `configure' can figure that out, but if it prints
-a message saying it can not guess the host type, give it the
-`--host=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name with three fields:
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
CPU-COMPANY-SYSTEM
-See the file `config.sub' for the possible values of each field. If
+where SYSTEM can have one of these forms:
+
+ OS KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
-need to know the host type.
+need to know the machine type.
- If you are building compiler tools for cross-compiling, you can also
+ If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
-produce code for and the `--build=TYPE' option to select the type of
-system on which you are compiling the package.
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
Sharing Defaults
================
@@ -150,32 +175,55 @@ default values for variables like `CC', `cache_file', and `prefix'.
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
-Operation Controls
+Defining Variables
==================
+ Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+will cause the specified gcc to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+`configure' Invocation
+======================
+
`configure' recognizes the following options to control how it
operates.
-`--cache-file=FILE'
- Use and save the results of the tests in FILE instead of
- `./config.cache'. Set FILE to `/dev/null' to disable caching, for
- debugging `configure'.
-
`--help'
+`-h'
Print a summary of the options to `configure', and exit.
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
`--quiet'
`--silent'
`-q'
- Do not print messages saying which checks are being made.
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
-`--version'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
-
-`configure' also accepts some other, not widely useful, options.
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
diff --git a/Makefile.am b/Makefile.am
index 0a0c7019..c1b266d0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
#
# Makefile.am --- automake input file for gawk
#
-# Copyright (C) 2000-2002 the Free Software Foundation, Inc.
+# Copyright (C) 2000-2003 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
@@ -23,8 +23,8 @@
## process this file with automake to produce Makefile.in
-# Automatic de-ANSI-fication if needed
-AUTOMAKE_OPTIONS = ansi2knr
+# Automatic de-ANSI-fication if needed, make .bz2 files also.
+AUTOMAKE_OPTIONS = ansi2knr dist-bzip2
# This undocumented variable insures that aclocal runs
# correctly after changing configure.in
@@ -56,6 +56,10 @@ EXTRA_DIST = \
missing_d \
pc \
posix \
+ regcomp.c \
+ regex_internal.c \
+ regex_internal.h \
+ regexec.c \
unsupported \
vms \
ylwrap
@@ -82,8 +86,6 @@ base_sources = \
awkgram.y \
builtin.c \
custom.h \
- dfa.c \
- dfa.h \
ext.c \
field.c \
gawkmisc.c \
@@ -112,9 +114,6 @@ pgawk_SOURCES = $(base_sources) eval_p.c profile_p.c
# Get extra libs as needed
LDADD = @LIBINTL@ @SOCKET_LIBS@
-# Special stuff for OS/2, remove after switch to autoconf 2.5x
-PATH_SEPARATOR = @PATH_SEPARATOR@
-
# Set autoconf Makefile.in variables correctly
datadir = @datadir@
awkdatadir = @datadir@/awk
@@ -136,23 +135,23 @@ LN= ln
install-exec-hook:
(fullname=gawk-`./gawk --version | sed 1q | awk '{print $$3}'` ; \
cd $(DESTDIR)$(bindir); \
- $(LN) gawk $$fullname ; \
- $(LN) pgawk p$$fullname ; \
- if [ ! -f awk ]; \
- then $(LN_S) gawk awk; \
+ $(LN) gawk $$fullname 2>/dev/null ; \
+ $(LN) pgawk p$$fullname 2>/dev/null ; \
+ if [ ! -f awk$(EXEEXT) ]; \
+ then $(LN_S) gawk$(EXEEXT) awk$(EXEEXT); \
fi; exit 0)
# Undo the above when uninstalling
uninstall-links:
(cd $(DESTDIR)$(bindir); \
- if [ -f awk ] && cmp awk gawk > /dev/null; then rm -f awk; fi ; \
+ if [ -f awk$(EXEEXT) ] && cmp awk$(EXEEXT) gawk$(EXEEXT) > /dev/null; then rm -f awk$(EXEEXT); fi ; \
fullname=gawk-`./gawk --version | sed 1q | ./gawk '{print $$3}'` ; \
rm -f $$fullname p$$fullname; exit 0)
uninstall-recursive: uninstall-links
# force there to be a gawk executable before running tests
-check-local: gawk pgawk
+check-local: gawk$(EXEEXT) pgawk$(EXEEXT)
# A little extra clean up when making distributions.
# FIXME: most of this rule should go away upon switching to libtool.
@@ -166,11 +165,15 @@ awkgram.c: awkgram.y
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
else :; fi
-# these force version and patchlevel to be up to date based
+# These force version and patchlevel to be up to date based
# on what's in configure.in. No-one else but me should have
# to use them. So there.
patchlev.h: configure.in
- ./fixvers -p
+ $(srcdir)/fixvers -p
version.c: configure.in version.in
- ./fixvers -v
+ $(srcdir)/fixvers -v
+
+# This is for my development & testing.
+efence: gawk
+ $(CC) $(LDFLAGS) -o gawk $$(ls *.o | grep -v '_p.o$$') $(LIBS) -lefence
diff --git a/Makefile.in b/Makefile.in
index d1680573..0974733b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,6 +1,7 @@
-# Makefile.in generated automatically by automake 1.5 from Makefile.am.
+# Makefile.in generated by automake 1.7.3 from Makefile.am.
+# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# 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,
@@ -16,7 +17,7 @@
#
# Makefile.am --- automake input file for gawk
#
-# Copyright (C) 2000-2002 the Free Software Foundation, Inc.
+# Copyright (C) 2000-2003 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
@@ -36,100 +37,139 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
#
-# Automatic de-ANSI-fication if needed
-
-SHELL = @SHELL@
-
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
+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@
+transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-host_alias = @host_alias@
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 = -DDEFPATH=$(DEFPATH) -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR="\"$(datadir)/locale\""
DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
EXEEXT = @EXEEXT@
GENCAT = @GENCAT@
GLIBC21 = @GLIBC21@
GMSGFMT = @GMSGFMT@
-HAVE_LIB = @HAVE_LIB@
+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@
-LIB = @LIB@
+LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
LN_S = @LN_S@
-LTLIB = @LTLIB@
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@
-install_sh = @install_sh@
-libexecdir = @libexecdir@/awk
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
# Set autoconf Makefile.in variables correctly
datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@/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@
-# Special stuff for OS/2, remove after switch to autoconf 2.5x
-PATH_SEPARATOR = @PATH_SEPARATOR@
-
-AUTOMAKE_OPTIONS = ansi2knr
+# Automatic de-ANSI-fication if needed, make .bz2 files also.
+AUTOMAKE_OPTIONS = ansi2knr dist-bzip2
# This undocumented variable insures that aclocal runs
# correctly after changing configure.in
@@ -161,6 +201,10 @@ EXTRA_DIST = \
missing_d \
pc \
posix \
+ regcomp.c \
+ regex_internal.c \
+ regex_internal.h \
+ regexec.c \
unsupported \
vms \
ylwrap
@@ -189,8 +233,6 @@ base_sources = \
awkgram.y \
builtin.c \
custom.h \
- dfa.c \
- dfa.h \
ext.c \
field.c \
gawkmisc.c \
@@ -224,8 +266,6 @@ awkdatadir = @datadir@/awk
# stuff for compiling gawk/pgawk
DEFPATH = "\".$(PATH_SEPARATOR)$(awkdatadir)\""
-DEFS = -DDEFPATH=$(DEFPATH) -DHAVE_CONFIG_H -DGAWK -DLOCALEDIR="\"$(datadir)/locale\""
-
INCLUDES = -I$(srcdir)/intl
# We want hard links for install-exec-hook, below
@@ -238,44 +278,38 @@ CONFIG_CLEAN_FILES = intl/Makefile
bin_PROGRAMS = gawk$(EXEEXT) pgawk$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)
-am_gawk_OBJECTS = array$U.$(OBJEXT) awkgram$U.$(OBJEXT) \
- builtin$U.$(OBJEXT) dfa$U.$(OBJEXT) ext$U.$(OBJEXT) \
- field$U.$(OBJEXT) gawkmisc$U.$(OBJEXT) getopt$U.$(OBJEXT) \
- getopt1$U.$(OBJEXT) io$U.$(OBJEXT) main$U.$(OBJEXT) \
- msg$U.$(OBJEXT) node$U.$(OBJEXT) random$U.$(OBJEXT) \
- re$U.$(OBJEXT) regex$U.$(OBJEXT) replace$U.$(OBJEXT) \
- version$U.$(OBJEXT) eval$U.$(OBJEXT) profile$U.$(OBJEXT)
+am__objects_1 = array$U.$(OBJEXT) awkgram$U.$(OBJEXT) \
+ builtin$U.$(OBJEXT) ext$U.$(OBJEXT) field$U.$(OBJEXT) \
+ gawkmisc$U.$(OBJEXT) getopt$U.$(OBJEXT) getopt1$U.$(OBJEXT) \
+ io$U.$(OBJEXT) main$U.$(OBJEXT) msg$U.$(OBJEXT) \
+ node$U.$(OBJEXT) random$U.$(OBJEXT) re$U.$(OBJEXT) \
+ regex$U.$(OBJEXT) replace$U.$(OBJEXT) version$U.$(OBJEXT)
+am_gawk_OBJECTS = $(am__objects_1) eval$U.$(OBJEXT) profile$U.$(OBJEXT)
gawk_OBJECTS = $(am_gawk_OBJECTS)
gawk_LDADD = $(LDADD)
gawk_DEPENDENCIES =
gawk_LDFLAGS =
-am_pgawk_OBJECTS = array$U.$(OBJEXT) awkgram$U.$(OBJEXT) \
- builtin$U.$(OBJEXT) dfa$U.$(OBJEXT) ext$U.$(OBJEXT) \
- field$U.$(OBJEXT) gawkmisc$U.$(OBJEXT) getopt$U.$(OBJEXT) \
- getopt1$U.$(OBJEXT) io$U.$(OBJEXT) main$U.$(OBJEXT) \
- msg$U.$(OBJEXT) node$U.$(OBJEXT) random$U.$(OBJEXT) \
- re$U.$(OBJEXT) regex$U.$(OBJEXT) replace$U.$(OBJEXT) \
- version$U.$(OBJEXT) eval_p$U.$(OBJEXT) profile_p$U.$(OBJEXT)
+am_pgawk_OBJECTS = $(am__objects_1) eval_p$U.$(OBJEXT) \
+ profile_p$U.$(OBJEXT)
pgawk_OBJECTS = $(am_pgawk_OBJECTS)
pgawk_LDADD = $(LDADD)
pgawk_DEPENDENCIES =
pgawk_LDFLAGS =
+
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/depcomp
-@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/array$U.Po $(DEPDIR)/awkgram$U.Po \
-@AMDEP_TRUE@ $(DEPDIR)/builtin$U.Po $(DEPDIR)/dfa$U.Po \
-@AMDEP_TRUE@ $(DEPDIR)/eval$U.Po $(DEPDIR)/eval_p$U.Po \
-@AMDEP_TRUE@ $(DEPDIR)/ext$U.Po $(DEPDIR)/field$U.Po \
-@AMDEP_TRUE@ $(DEPDIR)/gawkmisc$U.Po $(DEPDIR)/getopt$U.Po \
-@AMDEP_TRUE@ $(DEPDIR)/getopt1$U.Po $(DEPDIR)/io$U.Po \
-@AMDEP_TRUE@ $(DEPDIR)/main$U.Po $(DEPDIR)/msg$U.Po \
-@AMDEP_TRUE@ $(DEPDIR)/node$U.Po $(DEPDIR)/profile$U.Po \
-@AMDEP_TRUE@ $(DEPDIR)/profile_p$U.Po $(DEPDIR)/random$U.Po \
-@AMDEP_TRUE@ $(DEPDIR)/re$U.Po $(DEPDIR)/regex$U.Po \
-@AMDEP_TRUE@ $(DEPDIR)/replace$U.Po $(DEPDIR)/version$U.Po
+am__depfiles_maybe = depfiles
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/array$U.Po ./$(DEPDIR)/awkgram$U.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/builtin$U.Po ./$(DEPDIR)/eval$U.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/eval_p$U.Po ./$(DEPDIR)/ext$U.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/field$U.Po ./$(DEPDIR)/gawkmisc$U.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/getopt$U.Po ./$(DEPDIR)/getopt1$U.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/io$U.Po ./$(DEPDIR)/main$U.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/msg$U.Po ./$(DEPDIR)/node$U.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/profile$U.Po ./$(DEPDIR)/profile_p$U.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/random$U.Po ./$(DEPDIR)/re$U.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/regex$U.Po ./$(DEPDIR)/replace$U.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/version$U.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
@@ -284,15 +318,16 @@ YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
YLWRAP = $(top_srcdir)/ylwrap
DIST_SOURCES = $(gawk_SOURCES) $(pgawk_SOURCES)
-RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
- uninstall-info-recursive all-recursive install-data-recursive \
- install-exec-recursive installdirs-recursive install-recursive \
- uninstall-recursive check-recursive installcheck-recursive
-DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \
- INSTALL Makefile.am Makefile.in NEWS acconfig.h acinclude.m4 \
- aclocal.m4 ansi2knr.1 ansi2knr.c awkgram.c config.guess \
- config.sub configh.in configure configure.in depcomp install-sh \
- missing mkinstalldirs ylwrap
+RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
+ ps-recursive install-info-recursive uninstall-info-recursive \
+ all-recursive install-data-recursive install-exec-recursive \
+ installdirs-recursive install-recursive uninstall-recursive \
+ check-recursive installcheck-recursive
+DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL \
+ Makefile.am Makefile.in NEWS acinclude.m4 aclocal.m4 ansi2knr.1 \
+ ansi2knr.c awkgram.c config.guess config.rpath config.sub \
+ configh.in configure configure.in depcomp install-sh missing \
+ mkinstalldirs ylwrap
DIST_SUBDIRS = $(SUBDIRS)
SOURCES = $(gawk_SOURCES) $(pgawk_SOURCES)
@@ -301,48 +336,42 @@ all: config.h
.SUFFIXES:
.SUFFIXES: .c .o .obj .y
+
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) && \
- CONFIG_HEADERS= CONFIG_LINKS= \
- CONFIG_FILES=$@ $(SHELL) ./config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): configure.in acinclude.m4 m4/arch.m4 m4/codeset.m4 m4/gettext.m4 m4/glibc21.m4 m4/iconv.m4 m4/isc-posix.m4 m4/jm-mktime.m4 m4/largefile.m4 m4/lcmessage.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/progtest.m4 m4/socket.m4 m4/ssize_t.m4 m4/strtod.m4
+$(ACLOCAL_M4): configure.in acinclude.m4 m4/arch.m4 m4/codeset.m4 m4/gettext.m4 m4/glibc21.m4 m4/iconv.m4 m4/intdiv0.m4 m4/inttypes-pri.m4 m4/inttypes.m4 m4/inttypes_h.m4 m4/isc-posix.m4 m4/lcmessage.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/progtest.m4 m4/socket.m4 m4/stdint_h.m4 m4/strtod.m4 m4/uintmax_t.m4 m4/ulonglong.m4
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-config.h: stamp-h
- @if test ! -f $@; then \
- rm -f stamp-h; \
- $(MAKE) stamp-h; \
- else :; fi
-stamp-h: $(srcdir)/configh.in $(top_builddir)/config.status
- @rm -f stamp-h stamp-hT
- @echo timestamp > stamp-hT 2> /dev/null
- cd $(top_builddir) \
- && CONFIG_FILES= CONFIG_HEADERS=config.h:configh.in \
- $(SHELL) ./config.status
- @mv stamp-hT stamp-h
-$(srcdir)/configh.in: $(srcdir)/./stamp-h.in
+
+config.h: stamp-h1
@if test ! -f $@; then \
- rm -f $(srcdir)/./stamp-h.in; \
- $(MAKE) $(srcdir)/./stamp-h.in; \
+ rm -f stamp-h1; \
+ $(MAKE) stamp-h1; \
else :; fi
-$(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/acconfig.h
- @rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT
- @echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null
+
+stamp-h1: $(srcdir)/configh.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+
+$(srcdir)/configh.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOHEADER)
- @mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in
+ touch $(srcdir)/configh.in
distclean-hdr:
- -rm -f config.h
+ -rm -f config.h stamp-h1
intl/Makefile: $(top_builddir)/config.status $(top_srcdir)/intl/Makefile.in
- cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@@ -350,16 +379,16 @@ install-binPROGRAMS: $(bin_PROGRAMS)
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
; then \
- f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \
- $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
+ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
rm -f $(DESTDIR)$(bindir)/$$f; \
done
@@ -388,99 +417,105 @@ clean-krextra:
-rm -f ansi2knr
mostlyclean-kr:
- -rm -f *_.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/array$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/awkgram$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/builtin$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/dfa$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/eval$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/eval_p$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/ext$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/field$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/gawkmisc$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt1$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/io$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/main$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/msg$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/node$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/profile$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/profile_p$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/random$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/re$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/regex$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/replace$U.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/version$U.Po@am__quote@
+ -test "$U" = "" || rm -f *_.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/awkgram$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/builtin$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eval$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eval_p$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/field$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gawkmisc$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/profile$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/profile_p$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/re$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/replace$U.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version$U.Po@am__quote@
distclean-depend:
- -rm -rf $(DEPDIR)
+ -rm -rf ./$(DEPDIR)
.c.o:
-@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$<
+@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 "$(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:
-@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(COMPILE) -c `cygpath -w $<`
-CCDEPMODE = @CCDEPMODE@
+@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 "$(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`
array_.c: array.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/array.c; then echo $(srcdir)/array.c; else echo array.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > array_.c || rm -f array_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/array.c; then echo $(srcdir)/array.c; else echo array.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
awkgram_.c: awkgram.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/awkgram.c; then echo $(srcdir)/awkgram.c; else echo awkgram.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > awkgram_.c || rm -f awkgram_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/awkgram.c; then echo $(srcdir)/awkgram.c; else echo awkgram.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
builtin_.c: builtin.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/builtin.c; then echo $(srcdir)/builtin.c; else echo builtin.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > builtin_.c || rm -f builtin_.c
-dfa_.c: dfa.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/dfa.c; then echo $(srcdir)/dfa.c; else echo dfa.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > dfa_.c || rm -f dfa_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/builtin.c; then echo $(srcdir)/builtin.c; else echo builtin.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
eval_.c: eval.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/eval.c; then echo $(srcdir)/eval.c; else echo eval.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > eval_.c || rm -f eval_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/eval.c; then echo $(srcdir)/eval.c; else echo eval.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
eval_p_.c: eval_p.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/eval_p.c; then echo $(srcdir)/eval_p.c; else echo eval_p.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > eval_p_.c || rm -f eval_p_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/eval_p.c; then echo $(srcdir)/eval_p.c; else echo eval_p.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
ext_.c: ext.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ext.c; then echo $(srcdir)/ext.c; else echo ext.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ext_.c || rm -f ext_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ext.c; then echo $(srcdir)/ext.c; else echo ext.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
field_.c: field.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/field.c; then echo $(srcdir)/field.c; else echo field.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > field_.c || rm -f field_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/field.c; then echo $(srcdir)/field.c; else echo field.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
gawkmisc_.c: gawkmisc.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/gawkmisc.c; then echo $(srcdir)/gawkmisc.c; else echo gawkmisc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > gawkmisc_.c || rm -f gawkmisc_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/gawkmisc.c; then echo $(srcdir)/gawkmisc.c; else echo gawkmisc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
getopt_.c: getopt.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt_.c || rm -f getopt_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
getopt1_.c: getopt1.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt1_.c || rm -f getopt1_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
io_.c: io.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/io.c; then echo $(srcdir)/io.c; else echo io.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > io_.c || rm -f io_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/io.c; then echo $(srcdir)/io.c; else echo io.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
main_.c: main.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/main.c; then echo $(srcdir)/main.c; else echo main.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > main_.c || rm -f main_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/main.c; then echo $(srcdir)/main.c; else echo main.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
msg_.c: msg.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/msg.c; then echo $(srcdir)/msg.c; else echo msg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > msg_.c || rm -f msg_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/msg.c; then echo $(srcdir)/msg.c; else echo msg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
node_.c: node.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/node.c; then echo $(srcdir)/node.c; else echo node.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > node_.c || rm -f node_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/node.c; then echo $(srcdir)/node.c; else echo node.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
profile_.c: profile.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/profile.c; then echo $(srcdir)/profile.c; else echo profile.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > profile_.c || rm -f profile_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/profile.c; then echo $(srcdir)/profile.c; else echo profile.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
profile_p_.c: profile_p.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/profile_p.c; then echo $(srcdir)/profile_p.c; else echo profile_p.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > profile_p_.c || rm -f profile_p_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/profile_p.c; then echo $(srcdir)/profile_p.c; else echo profile_p.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
random_.c: random.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/random.c; then echo $(srcdir)/random.c; else echo random.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > random_.c || rm -f random_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/random.c; then echo $(srcdir)/random.c; else echo random.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
re_.c: re.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/re.c; then echo $(srcdir)/re.c; else echo re.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > re_.c || rm -f re_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/re.c; then echo $(srcdir)/re.c; else echo re.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
regex_.c: regex.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > regex_.c || rm -f regex_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
replace_.c: replace.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/replace.c; then echo $(srcdir)/replace.c; else echo replace.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > replace_.c || rm -f replace_.c
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/replace.c; then echo $(srcdir)/replace.c; else echo replace.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
version_.c: version.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/version.c; then echo $(srcdir)/version.c; else echo version.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > version_.c || rm -f version_.c
-array_.$(OBJEXT) awkgram_.$(OBJEXT) builtin_.$(OBJEXT) dfa_.$(OBJEXT) \
-eval_.$(OBJEXT) eval_p_.$(OBJEXT) ext_.$(OBJEXT) field_.$(OBJEXT) \
-gawkmisc_.$(OBJEXT) getopt_.$(OBJEXT) getopt1_.$(OBJEXT) io_.$(OBJEXT) \
-main_.$(OBJEXT) msg_.$(OBJEXT) node_.$(OBJEXT) profile_.$(OBJEXT) \
-profile_p_.$(OBJEXT) random_.$(OBJEXT) re_.$(OBJEXT) regex_.$(OBJEXT) \
-replace_.$(OBJEXT) version_.$(OBJEXT) : $(ANSI2KNR)
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/version.c; then echo $(srcdir)/version.c; else echo version.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
+array_.$(OBJEXT) awkgram_.$(OBJEXT) builtin_.$(OBJEXT) eval_.$(OBJEXT) \
+eval_p_.$(OBJEXT) ext_.$(OBJEXT) field_.$(OBJEXT) gawkmisc_.$(OBJEXT) \
+getopt_.$(OBJEXT) getopt1_.$(OBJEXT) io_.$(OBJEXT) main_.$(OBJEXT) \
+msg_.$(OBJEXT) node_.$(OBJEXT) profile_.$(OBJEXT) profile_p_.$(OBJEXT) \
+random_.$(OBJEXT) re_.$(OBJEXT) regex_.$(OBJEXT) replace_.$(OBJEXT) \
+version_.$(OBJEXT) : $(ANSI2KNR)
.y.c:
- $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h -- $(YACCCOMPILE)
+ $(SHELL) $(YLWRAP) `test -f '$<' || echo '$(srcdir)/'`$< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
@@ -490,7 +525,7 @@ uninstall-info-am:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @set fnord $(MAKEFLAGS); amf=$$2; \
+ @set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -510,7 +545,7 @@ $(RECURSIVE_TARGETS):
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
- @set fnord $(MAKEFLAGS); amf=$$2; \
+ @set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
@@ -537,17 +572,27 @@ tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(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 $(LISP)
+ mkid -fID $$unique
TAGS: tags-recursive $(HEADERS) $(SOURCES) configh.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@@ -558,51 +603,83 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) configh.in $(TAGS_DEPENDENCIES) \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
- list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ list='$(SOURCES) $(HEADERS) configh.in $(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)configh.in$$unique$(LISP)$$tags" \
- || etags $(ETAGS_ARGS) $$tags configh.in $$unique $(LISP)
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
+
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) configh.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) configh.in $(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=`CDPATH=: && cd $(top_builddir) && pwd` \
+ here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
-
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = .
-# Avoid unsightly `./'.
distdir = $(PACKAGE)-$(VERSION)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+
GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
distdir: $(DISTFILES)
- -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+ $(am__remove_distdir)
mkdir $(distdir)
$(mkinstalldirs) $(distdir)/intl $(distdir)/po
- @for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ @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 \
- $(mkinstalldirs) "$(distdir)/$$dir"; \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
fi; \
if test -d $$d/$$file; then \
- cp -pR $$d/$$file $(distdir) \
- || exit 1; \
+ 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
- for subdir in $(SUBDIRS); do \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
@@ -616,49 +693,83 @@ distdir: $(DISTFILES)
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="${top_distdir}" distdir="$(distdir)" \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
-dist: distdir
+dist-gzip: distdir
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist dist-all: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+ $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
- -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+ $(am__remove_distdir)
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
chmod -R a-w $(distdir); chmod a+w $(distdir)
- mkdir $(distdir)/=build
- mkdir $(distdir)/=inst
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
chmod a-w $(distdir)
- dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \
- && cd $(distdir)/=build \
- && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
--with-included-gettext \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
- && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \
- || (echo "Error: files left after uninstall" 1>&2; \
- exit 1) ) \
- && $(MAKE) $(AM_MAKEFLAGS) dist \
- && $(MAKE) $(AM_MAKEFLAGS) distclean \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
&& rm -f $(distdir).tar.gz \
- && (test `find . -type f -print | wc -l` -eq 0 \
- || (echo "Error: files left after distclean" 1>&2; \
- exit 1) )
- -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
@echo "$(distdir).tar.gz is ready for distribution" | \
sed 'h;s/./=/g;p;x;p;x'
+distuninstallcheck:
+ cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-local
check: check-recursive
@@ -678,6 +789,7 @@ install-am: all-am
installcheck: installcheck-recursive
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:
@@ -685,20 +797,18 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
+ -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."
+ -rm -f awkgram.c
clean: clean-recursive
clean-am: clean-binPROGRAMS clean-generic clean-krextra mostlyclean-am
-dist-all: distdir
- $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
distclean: distclean-recursive
- -rm -f config.status config.cache config.log
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-hdr distclean-tags
@@ -723,33 +833,44 @@ install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf autom4te.cache
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
uninstall-info: uninstall-info-recursive
-.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am check-local \
- clean clean-binPROGRAMS clean-generic clean-krextra \
- clean-recursive dist dist-all distcheck distclean \
- distclean-compile distclean-depend distclean-generic \
- distclean-hdr distclean-recursive distclean-tags distdir dvi \
- dvi-am dvi-recursive info info-am info-recursive install \
- install-am install-binPROGRAMS install-data install-data-am \
- install-data-recursive install-exec install-exec-am \
- install-exec-recursive install-info install-info-am \
- install-info-recursive install-man install-recursive \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am installdirs-recursive maintainer-clean \
- maintainer-clean-generic maintainer-clean-recursive mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-kr \
- mostlyclean-recursive tags tags-recursive uninstall \
- uninstall-am uninstall-binPROGRAMS uninstall-info-am \
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ check-local clean clean-binPROGRAMS clean-generic clean-krextra \
+ clean-recursive ctags ctags-recursive dist dist-all dist-bzip2 \
+ dist-gzip distcheck distclean distclean-compile \
+ distclean-depend distclean-generic distclean-hdr \
+ distclean-recursive distclean-tags distcleancheck distdir \
+ distuninstallcheck dvi dvi-am dvi-recursive info info-am \
+ info-recursive install install-am install-binPROGRAMS \
+ install-data install-data-am install-data-recursive \
+ install-exec install-exec-am install-exec-recursive \
+ install-info install-info-am install-info-recursive install-man \
+ install-recursive install-strip installcheck installcheck-am \
+ installdirs installdirs-am installdirs-recursive \
+ maintainer-clean maintainer-clean-generic \
+ maintainer-clean-recursive mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-kr mostlyclean-recursive pdf \
+ pdf-am pdf-recursive ps ps-am ps-recursive tags tags-recursive \
+ uninstall uninstall-am uninstall-binPROGRAMS uninstall-info-am \
uninstall-info-recursive uninstall-recursive
@@ -759,23 +880,23 @@ uninstall-info: uninstall-info-recursive
install-exec-hook:
(fullname=gawk-`./gawk --version | sed 1q | awk '{print $$3}'` ; \
cd $(DESTDIR)$(bindir); \
- $(LN) gawk $$fullname ; \
- $(LN) pgawk p$$fullname ; \
- if [ ! -f awk ]; \
- then $(LN_S) gawk awk; \
+ $(LN) gawk $$fullname 2>/dev/null ; \
+ $(LN) pgawk p$$fullname 2>/dev/null ; \
+ if [ ! -f awk$(EXEEXT) ]; \
+ then $(LN_S) gawk$(EXEEXT) awk$(EXEEXT); \
fi; exit 0)
# Undo the above when uninstalling
uninstall-links:
(cd $(DESTDIR)$(bindir); \
- if [ -f awk ] && cmp awk gawk > /dev/null; then rm -f awk; fi ; \
+ if [ -f awk$(EXEEXT) ] && cmp awk$(EXEEXT) gawk$(EXEEXT) > /dev/null; then rm -f awk$(EXEEXT); fi ; \
fullname=gawk-`./gawk --version | sed 1q | ./gawk '{print $$3}'` ; \
rm -f $$fullname p$$fullname; exit 0)
uninstall-recursive: uninstall-links
# force there to be a gawk executable before running tests
-check-local: gawk pgawk
+check-local: gawk$(EXEEXT) pgawk$(EXEEXT)
# A little extra clean up when making distributions.
# FIXME: most of this rule should go away upon switching to libtool.
@@ -789,14 +910,18 @@ awkgram.c: awkgram.y
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
else :; fi
-# these force version and patchlevel to be up to date based
+# These force version and patchlevel to be up to date based
# on what's in configure.in. No-one else but me should have
# to use them. So there.
patchlev.h: configure.in
- ./fixvers -p
+ $(srcdir)/fixvers -p
version.c: configure.in version.in
- ./fixvers -v
+ $(srcdir)/fixvers -v
+
+# This is for my development & testing.
+efence: gawk
+ $(CC) $(LDFLAGS) -o gawk $$(ls *.o | grep -v '_p.o$$') $(LIBS) -lefence
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/NEWS b/NEWS
index 0a9e8c45..946e2da8 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,119 @@
+Changes from 3.1.1 to 3.1.2
+---------------------------
+
+1. Loops of the form:
+
+ for (iggy in foo)
+ next
+
+ no longer leak memory.
+
+2. gawk -v FIELDWIDTHS="..." now sets PROCINFO["FS"] correctly.
+
+3. All builtin operations and functions should now fully evaluate their
+ arguments so that side effects take place correctly.
+
+4. Fixed a logic bug in gsub/gensub for matches to null strings that occurred
+ later in the string after a nonnull match.
+
+5. getgroups code now works on Ultrix again.
+
+6. Completely new version of the full GNU regex engine now in place.
+
+7. Argument parsing and variable assignment has been cleaned up.
+
+8. An I/O bug on HP-UX has been documented and worked around. See
+ README_d/README.hpux.
+
+9. awklib/grcat should now compile correctly.
+
+10. Updated to automake 1.7.3, autoconf 2.57 and gettext 0.11.5 ; thanks to
+ Paul Eggert for the initial automake and autoconf work.
+
+11. As a result of #6, removed the use of the dfa code from GNU grep.
+
+12. It is now possible to use ptys for |& two-way pipes instead of
+ pipes. The basic plumbing for this was provided by Paolo Bonzini.
+ To make this happen:
+
+ command = "unix command etc"
+ PROCINFO[command, "pty"] = 1
+
+ print ... |& command
+ command |& getline stuff
+
+ In other words, set the element in PROCINFO *before* opening the
+ two-way pipe, and then gawk will use ptys instead of pipes.
+
+ On systems without ptys or where all the ptys are in use, gawk
+ will fall back to using plain pipes.
+
+13. Fixed a regex matching across buffer boundaries bug, with a
+ heuristic. See io.c:rsre_get_a_record().
+
+14. Profiling no longer dumps core if there are extension functions in place.
+
+15. Grammar and scanner cleaned up, courtesy of Stepen Kasal, to hopefully
+ once and for all fix the `/=' operator vs. `/=.../' regex ambiguity.
+ Lots of other grammar simplifications applied, as well.
+
+16. BINMODE should work now on more Windows ports.
+
+17. Updated to bison 1.875. Includes fix to bisonfix.sed script.
+
+18. The NODE structure is now 20% (8 bytes) smaller (on x86, anyway), which
+ should help conserve memory.
+
+19. Builds not in the source directory should work again.
+
+20. Arrays now use 2 NODE's per element instead of three. Combined with
+ #18, (on the x86) this reduces the overhead from 120 bytes per element
+ to just 64 bytes: almost a 50% improvement.
+
+21. Programs that make heavy use of changing IGNORECASE should now be
+ much faster, particularly if using a regular expression for FS or RS.
+ IGNORECASE now correctly affects RS regex record splitting, as well.
+
+22. IGNORECASE no longer affects single-character field splitting (FS = "c"),
+ or single-character record splitting (RS = "c").
+
+ This cleans up some weird behavior, and makes gawk better match the
+ documentation, which says it only affects regex-based field splitting
+ and record splitting.
+
+ The documentation on this was improved, too.
+
+23. The framework in test/ has been simplified, making it much easier to
+ add new tests while keeping the size of Makefile.am reasonable. Thanks
+ for this to Stepan Kasal.
+
+24. --lint=invalid causes lint warnings only about stuff that's actually
+ invalid. This needs additional work.
+
+25. More translations.
+
+26. The get_a_record() routine has been revamped (currently by splitting it
+ into three variants). This should improve long-term maintainability.
+
+27. match() now adds more entries to 3rd array arg:
+ match("the big dog", /([a-z]+) ([a-z]+) ([a-z]+)/, data)
+ fills in variables:
+ data[1, "start"], data[1, "length"], and so on.
+
+28. New asorti() function with same interface as asort(), but sorts indices
+ instead of values.
+
+29. Documentation updated to FDL 1.2.
+
+30. New `configure' option --disable-lint at compile time disables lint
+ checking. With GCC dead-code-elimination, cuts almost 200K off the
+ executable size on GNU/Linux x86. Presumably speeds up runtime.
+
+ Using this will cause some of the tests in the test suite to fail.
+ This option may be removed at a later date.
+
+31. Various minor cleanups, see the ChangeLog for details.
+
Changes from 3.1.0 to 3.1.1
---------------------------
diff --git a/README b/README
index 3781fb9e..60add414 100644
--- a/README
+++ b/README
@@ -100,4 +100,4 @@ Tandem:
VMS:
Pat Rankin
- rankin@eql.caltech.edu
+ rankin@pactechdata.com
diff --git a/README_d/README.aix b/README_d/README.aix
new file mode 100644
index 00000000..283d3873
--- /dev/null
+++ b/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/README_d/README.hpux b/README_d/README.hpux
new file mode 100644
index 00000000..59f87539
--- /dev/null
+++ b/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/README_d/README.ia64 b/README_d/README.ia64
index 439f9f3c..844d6a6a 100644
--- a/README_d/README.ia64
+++ b/README_d/README.ia64
@@ -1,3 +1,11 @@
+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.
diff --git a/README_d/README.pc b/README_d/README.pc
index 066b1ae8..5218508b 100644
--- a/README_d/README.pc
+++ b/README_d/README.pc
@@ -6,7 +6,8 @@ support for long filenames under Win95), Eberhard Mattes (EMX; OS/2,
DOS, and Win32 with rsxnt), and Jan-Jaap van der Heijden and Mumit Khan
(Mingw32; Win32). Microsoft Visual C/C++ can be used to build a Win32
version for Windows 9x/NT, and MSC can be used to build 16-bit versions
-for DOS and OS/2.
+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
diff --git a/README_d/README.solaris b/README_d/README.solaris
index 205f7634..499ea4d8 100644
--- a/README_d/README.solaris
+++ b/README_d/README.solaris
@@ -118,3 +118,21 @@ The Ohio State University http://www.math.ohio-state.edu/~nevai/
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/acconfig.h b/acconfig.h
deleted file mode 100644
index dce2b0c6..00000000
--- a/acconfig.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * acconfig.h -- configuration definitions for gawk.
- */
-
-/*
- * Copyright (C) 1995-2001 the Free Software Foundation, Inc.
- *
- * This file is part of GAWK, the GNU implementation of the
- * AWK Programming Language.
- *
- * GAWK is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GAWK is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
-
-@TOP@
-
-#undef REGEX_MALLOC /* use malloc instead of alloca in regex.c */
-#undef SPRINTF_RET /* return type of sprintf */
-#undef HAVE_MKTIME /* we have the mktime function */
-#undef HAVE_SOCKETS /* we have sockets on this system */
-#undef HAVE_PORTALS /* we have portals on /p on this system */
-#undef DYNAMIC /* allow dynamic addition of builtins */
-#undef STRTOD_NOT_C89 /* strtod doesn't have C89 semantics */
-#undef ssize_t /* signed version of size_t */
-#undef USE_INCLUDED_STRFTIME /* force use of our version of strftime */
-#undef TIME_T_IN_SYS_TYPES_H /* some systems define this type here */
-
-@BOTTOM@
-
-#include <custom.h> /* overrides for stuff autoconf can't deal with */
diff --git a/acinclude.m4 b/acinclude.m4
index a8ac0c96..281e3609 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,8 +1,6 @@
-sinclude(arch.m4)dnl
-sinclude(gettext.m4)dnl
-sinclude(jm-mktime.m4)dnl
-sinclude(largefile.m4)dnl
-sinclude(lcmessage.m4)dnl
-sinclude(progtest.m4)dnl
-sinclude(socket.m4)dnl
-sinclude(strtod.m4)dnl
+m4_sinclude(arch.m4)dnl
+m4_sinclude(gettext.m4)dnl
+m4_sinclude(lcmessage.m4)dnl
+m4_sinclude(progtest.m4)dnl
+m4_sinclude(socket.m4)dnl
+m4_sinclude(strtod.m4)dnl
diff --git a/aclocal.m4 b/aclocal.m4
index 3cb24057..0b62d990 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# aclocal.m4 generated automatically by aclocal 1.5
+# generated automatically by aclocal 1.7.3 -*- Autoconf -*-
-# Copyright 1996, 1997, 1998, 1999, 2000, 2001
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -11,20 +11,37 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-sinclude(arch.m4)dnl
-sinclude(gettext.m4)dnl
-sinclude(jm-mktime.m4)dnl
-sinclude(largefile.m4)dnl
-sinclude(lcmessage.m4)dnl
-sinclude(progtest.m4)dnl
-sinclude(socket.m4)dnl
-sinclude(strtod.m4)dnl
+m4_sinclude(arch.m4)dnl
+m4_sinclude(gettext.m4)dnl
+m4_sinclude(lcmessage.m4)dnl
+m4_sinclude(progtest.m4)dnl
+m4_sinclude(socket.m4)dnl
+m4_sinclude(strtod.m4)dnl
-# Do all the work for Automake. This macro actually does too much --
-# some checks are only needed if your package does certain things.
-# But this isn't really a big deal.
+# Do all the work for Automake. -*- Autoconf -*-
-# serial 5
+# This macro actually does too much some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 9
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
@@ -33,62 +50,62 @@ sinclude(strtod.m4)dnl
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-# We require 2.13 because we rely on SHELL being computed by configure.
-AC_PREREQ([2.13])
-
-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
-# -----------------------------------------------------------
-# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
-# The purpose of this macro is to provide the user with a means to
-# check macros which are provided without letting her know how the
-# information is coded.
-# If this macro is not defined by Autoconf, define it here.
-ifdef([AC_PROVIDE_IFELSE],
- [],
- [define([AC_PROVIDE_IFELSE],
- [ifdef([AC_PROVIDE_$1],
- [$2], [$3])])])
-
+AC_PREREQ([2.54])
-# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
-# ----------------------------------------------
+# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
+# the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_REQUIRE([AC_PROG_INSTALL])dnl
+[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
# test to see if srcdir already configured
-if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
# Define the identity of the package.
-PACKAGE=$1
-AC_SUBST(PACKAGE)dnl
-VERSION=$2
-AC_SUBST(VERSION)dnl
-ifelse([$3],,
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
-
-# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
-# the ones we care about.
-ifdef([m4_pattern_allow],
- [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
-
-# Autoconf 2.50 always computes EXEEXT. However we need to be
-# compatible with 2.13, for now. So we always define EXEEXT, but we
-# don't compute it.
-AC_SUBST(EXEEXT)
-# Similar for OBJEXT -- only we only use OBJEXT if the user actually
-# requests that it be used. This is a bit dumb.
-: ${OBJEXT=o}
-AC_SUBST(OBJEXT)
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal)
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_MISSING_PROG(AMTAR, tar)
@@ -98,22 +115,135 @@ AM_PROG_INSTALL_STRIP
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_PROVIDE_IFELSE([AC_PROG_][CC],
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_][CC],
- defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_][CXX],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_][CXX],
- defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
])
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $1 | $1:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+ [AM_AUTOMAKE_VERSION([1.7.3])])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# 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.
+
+# serial 2
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
#
# Check to make sure that the build environment is sane.
#
+# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# 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.
+
# serial 3
# AM_SANITY_CHECK
@@ -157,8 +287,27 @@ Check your system clock])
fi
AC_MSG_RESULT(yes)])
+# -*- Autoconf -*-
-# serial 2
+
+# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
@@ -180,13 +329,29 @@ if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
- am_backtick='`'
- AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
+ AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# AM_AUX_DIR_EXPAND
+# Copyright 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
@@ -225,19 +390,59 @@ fi
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
+# Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])
+
AC_DEFUN([AM_AUX_DIR_EXPAND], [
# expand $ac_aux_dir to an absolute path
-am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
+am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
+
+# Copyright 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
install_sh=${install_sh-"$am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
+# AM_PROG_INSTALL_STRIP
+
+# Copyright 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
@@ -247,11 +452,68 @@ AC_SUBST(install_sh)])
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# serial 4 -*- Autoconf -*-
+# -*- Autoconf -*-
+# Copyright (C) 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 1
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# serial 5 -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
@@ -263,9 +525,9 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
# _AM_DEPENDENCIES(NAME)
-# ---------------------
+# ----------------------
# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX" or "OBJC".
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
@@ -280,7 +542,7 @@ AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
@@ -328,11 +590,17 @@ AC_CACHE_CHECK([dependency style of $depcc],
if depmode=$depmode \
source=conftest.c object=conftest.o \
depfile=conftest.Po tmpdepfile=conftest.TPo \
- $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
+ $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
- am_cv_$1_dependencies_compiler_type=$depmode
- break
+ # 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_$1_dependencies_compiler_type=$depmode
+ break
+ fi
fi
done
@@ -342,8 +610,10 @@ else
am_cv_$1_dependencies_compiler_type=none
fi
])
-$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
-AC_SUBST([$1DEPMODE])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
@@ -352,16 +622,8 @@ AC_SUBST([$1DEPMODE])
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
-[rm -f .deps 2>/dev/null
-mkdir .deps 2>/dev/null
-if test -d .deps; then
- DEPDIR=.deps
-else
- # MS-DOS does not allow filenames that begin with a dot.
- DEPDIR=_deps
-fi
-rmdir .deps 2>/dev/null
-AC_SUBST(DEPDIR)
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
@@ -376,30 +638,48 @@ if test "x$enable_dependency_tracking" != xno; then
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-pushdef([subst], defn([AC_SUBST]))
-subst(AMDEPBACKSLASH)
-popdef([subst])
+AC_SUBST([AMDEPBACKSLASH])
])
-# Generate code to set up dependency tracking.
-# This macro should only be invoked once -- use via AC_REQUIRE.
-# Usage:
-# AM_OUTPUT_DEPENDENCY_COMMANDS
+# Generate code to set up dependency tracking. -*- Autoconf -*-
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
-AC_OUTPUT_COMMANDS([
-test x"$AMDEP_TRUE" != x"" ||
-for mf in $CONFIG_FILES; do
- case "$mf" in
- Makefile) dirpart=.;;
- */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
- *) continue;;
- esac
- grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# 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.
+
+#serial 2
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ 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"`
@@ -423,14 +703,48 @@ for mf in $CONFIG_FILES; do
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
- fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
- $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
-], [AMDEP_TRUE="$AMDEP_TRUE"
-ac_aux_dir="$ac_aux_dir"])])
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU 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.
+
+# serial 2
# AM_MAKE_INCLUDE()
# -----------------
@@ -443,7 +757,7 @@ doit:
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
-am__include='#'
+am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
@@ -453,7 +767,7 @@ echo "include confinc" > confmf
# In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
am__include=include
am__quote=
_am_result=GNU
@@ -463,7 +777,7 @@ 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__quote="\""
_am_result=BSD
fi
fi
@@ -473,23 +787,35 @@ AC_MSG_RESULT($_am_result)
rm -f confinc confmf
])
-# serial 3
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# 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.
+
+# serial 5
+
+AC_PREREQ(2.52)
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
-#
-# FIXME: Once using 2.50, use this:
-# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_DEFUN([AM_CONDITIONAL],
-[ifelse([$1], [TRUE],
- [errprint(__file__:__line__: [$0: invalid condition: $1
-])dnl
-m4exit(1)])dnl
-ifelse([$1], [FALSE],
- [errprint(__file__:__line__: [$0: invalid condition: $1
-])dnl
-m4exit(1)])dnl
+[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])
AC_SUBST([$1_FALSE])
if $2; then
@@ -498,74 +824,12 @@ if $2; then
else
$1_TRUE='#'
$1_FALSE=
-fi])
-
-# Like AC_CONFIG_HEADER, but automatically create stamp file.
-
-# serial 3
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. We must strip everything past the first ":",
-# and everything past the last "/".
-
-AC_PREREQ([2.12])
-
-AC_DEFUN([AM_CONFIG_HEADER],
-[ifdef([AC_FOREACH],dnl
- [dnl init our file count if it isn't already
- m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
- dnl prepare to store our destination file list for use in config.status
- AC_FOREACH([_AM_File], [$1],
- [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
- m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
- dnl and add it to the list of files AC keeps track of, along
- dnl with our hook
- AC_CONFIG_HEADERS(_AM_File,
-dnl COMMANDS, [, INIT-CMDS]
-[# update the timestamp
-echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
-][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
- m4_popdef([_AM_Dest])])],dnl
-[AC_CONFIG_HEADER([$1])
- AC_OUTPUT_COMMANDS(
- ifelse(patsubst([$1], [[^ ]], []),
- [],
- [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
- patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
-[am_indx=1
-for am_file in $1; do
- case " \$CONFIG_HEADERS " in
- *" \$am_file "*)
- am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
- if test -n "\$am_dir"; then
- am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
- for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
- am_tmpdir=\$am_tmpdir\$am_subdir/
- if test ! -d \$am_tmpdir; then
- mkdir \$am_tmpdir
- fi
- done
- fi
- echo timestamp > "\$am_dir"stamp-h\$am_indx
- ;;
- esac
- am_indx=\`expr \$am_indx + 1\`
-done])
-])]) # AM_CONFIG_HEADER
-
-# _AM_DIRNAME(PATH)
-# -----------------
-# Like AS_DIRNAME, only do it during macro expansion
-AC_DEFUN([_AM_DIRNAME],
- [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
- m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
- m4_if(m4_regexp([$1], [^/.*]), -1,
- [.],
- m4_patsubst([$1], [^\(/\).*], [\1])),
- m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
- m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
-]) # _AM_DIRNAME
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.])
+fi])])
# isc-posix.m4 serial 2 (gettext-0.11.2)
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
@@ -594,103 +858,10 @@ AC_DEFUN([AC_ISC_POSIX],
]
)
-#serial 19
-
-dnl By default, many hosts won't let programs access large files;
-dnl one must use special compiler options to get large-file access to work.
-dnl For more details about this brain damage please see:
-dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
-
-dnl Written by Paul Eggert <eggert@twinsun.com>.
-
-dnl Internal subroutine of AC_SYS_LARGEFILE.
-dnl AC_SYS_LARGEFILE_TEST_INCLUDES
-AC_DEFUN(AC_SYS_LARGEFILE_TEST_INCLUDES,
- [[#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply "#define LARGE_OFF_T 9223372036854775807",
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
- ]])
-
-dnl Internal subroutine of AC_SYS_LARGEFILE.
-dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLUDES, FUNCTION-BODY)
-AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
- [AC_CACHE_CHECK([for $1 value needed for large files], $3,
- [$3=no
- AC_TRY_COMPILE([$5],
- [$6],
- ,
- [AC_TRY_COMPILE([#define $1 $2]
-[$5]
- ,
- [$6],
- [$3=$2])])])
- if test "[$]$3" != no; then
- AC_DEFINE_UNQUOTED([$1], [$]$3, [$4])
- fi])
-
-AC_DEFUN(AC_SYS_LARGEFILE,
- [AC_REQUIRE([AC_PROG_CC])
- AC_ARG_ENABLE(largefile,
- [ --disable-largefile omit support for large files])
- if test "$enable_largefile" != no; then
-
- AC_CACHE_CHECK([for special C compiler options needed for large files],
- ac_cv_sys_largefile_CC,
- [ac_cv_sys_largefile_CC=no
- if test "$GCC" != yes; then
- # IRIX 6.2 and later do not support large files by default,
- # so use the C compiler's -n32 option if that helps.
- AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , ,
- [ac_save_CC="$CC"
- CC="$CC -n32"
- AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, ,
- ac_cv_sys_largefile_CC=' -n32')
- CC="$ac_save_CC"])
- fi])
- if test "$ac_cv_sys_largefile_CC" != no; then
- CC="$CC$ac_cv_sys_largefile_CC"
- fi
-
- AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
- ac_cv_sys_file_offset_bits,
- [Number of bits in a file offset, on hosts where this is settable.],
- AC_SYS_LARGEFILE_TEST_INCLUDES)
- AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
- ac_cv_sys_large_files,
- [Define for large files, on AIX-style hosts.],
- AC_SYS_LARGEFILE_TEST_INCLUDES)
- fi
- ])
-
-AC_DEFUN(AC_FUNC_FSEEKO,
- [AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
- ac_cv_sys_largefile_source,
- [Define to make fseeko visible on some hosts (e.g. glibc 2.2).],
- [#include <stdio.h>], [return !fseeko;])
- # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
- # in glibc 2.1.3, but that breaks too many other things.
- # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
-
- AC_CACHE_CHECK([for fseeko], ac_cv_func_fseeko,
- [ac_cv_func_fseeko=no
- AC_TRY_LINK([#include <stdio.h>],
- [return fseeko && fseeko (stdin, 0, 0);],
- [ac_cv_func_fseeko=yes])])
- if test $ac_cv_func_fseeko != no; then
- AC_DEFINE(HAVE_FSEEKO, 1,
- [Define if fseeko (and presumably ftello) exists and is declared.])
- fi])
-
dnl
dnl arch.m4 --- autoconf input file for gawk
dnl
-dnl Copyright (C) 1995, 1996, 1998, 1999, 2000 the Free Software Foundation, Inc.
+dnl Copyright (C) 1995, 1996, 1998, 1999, 2000, 2003 the Free Software Foundation, Inc.
dnl
dnl This file is part of GAWK, the GNU implementation of the
dnl AWK Progamming Language.
@@ -714,9 +885,9 @@ dnl Check for AIX and add _XOPEN_SOURCE_EXTENDED
AC_DEFUN(GAWK_AC_AIX_TWEAK, [
AC_MSG_CHECKING([for AIX compilation hacks])
AC_CACHE_VAL(gawk_cv_aix_hack, [
-if test -d /lpp/bos
+if test -d /lpp
then
- CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
+ CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED=1 -DGAWK_AIX=1"
gawk_cv_aix_hack=yes
else
gawk_cv_aix_hack=no
@@ -748,7 +919,24 @@ AC_MSG_RESULT([${gawk_cv_linux_alpha_hack}])
])dnl
-# serial 1
+# Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# 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.
+
+# serial 2
# @defmac AC_PROG_CC_STDC
# @maindex PROG_CC_STDC
@@ -836,8 +1024,27 @@ case "x$am_cv_prog_cc_stdc" in
esac
])
+AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
-# serial 1
+
+# Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# 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.
+
+# serial 2
AC_DEFUN([AM_C_PROTOTYPES],
[AC_REQUIRE([AM_PROG_CC_STDC])
@@ -858,7 +1065,9 @@ AC_SUBST(U)dnl
AC_SUBST(ANSI2KNR)dnl
])
-# gettext.m4 serial 14 (gettext-0.11.2)
+AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
+
+# gettext.m4 serial 17 (gettext-0.11.5)
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
@@ -893,7 +1102,9 @@ dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
dnl $(top_builddir)/intl/libintl.a will be created.
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
dnl implementations (in libc or libintl) without the ngettext() function
-dnl will be ignored.
+dnl will be ignored. If NEEDSYMBOL is specified and is
+dnl 'need-formatstring-macros', then GNU gettext implementations that don't
+dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
dnl INTLDIR is used to find the intl libraries. If empty,
dnl the value `$(top_builddir)/intl/' is used.
dnl
@@ -920,9 +1131,9 @@ AC_DEFUN([AM_GNU_GETTEXT],
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
])])])])])
- ifelse([$2], [], , [ifelse([$2], [need-ngettext], ,
+ ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
-])])])
+])])])])
define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
@@ -935,6 +1146,21 @@ AC_DEFUN([AM_GNU_GETTEXT],
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
+ dnl Ideally we would do this search only after the
+ dnl if test "$USE_NLS" = "yes"; then
+ dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+ dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
+ dnl the configure script would need to contain the same shell code
+ dnl again, outside any 'if'. There are two solutions:
+ dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
+ dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
+ dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
+ dnl documented, we avoid it.
+ ifelse(gt_included_intl, yes, , [
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+ ])
+
AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE(nls,
@@ -970,13 +1196,20 @@ AC_DEFUN([AM_GNU_GETTEXT],
dnl to fall back to GNU NLS library.
dnl Add a version number to the cache macros.
- define([gt_api_version], ifelse([$2], [need-ngettext], 2, 1))
+ define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
[AC_TRY_LINK([#include <libintl.h>
-extern int _nl_msg_cat_cntr;
+]ifelse([$2], [need-formatstring-macros],
+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+], [])[extern int _nl_msg_cat_cntr;
extern int *_nl_domain_bindings;],
[bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
@@ -1001,7 +1234,14 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
LIBS="$LIBS $LIBINTL"
dnl Now see whether libintl exists and does not depend on libiconv.
AC_TRY_LINK([#include <libintl.h>
-extern int _nl_msg_cat_cntr;
+]ifelse([$2], [need-formatstring-macros],
+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+], [])[extern int _nl_msg_cat_cntr;
extern
#ifdef __cplusplus
"C"
@@ -1015,7 +1255,14 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
LIBS="$LIBS $LIBICONV"
AC_TRY_LINK([#include <libintl.h>
-extern int _nl_msg_cat_cntr;
+]ifelse([$2], [need-formatstring-macros],
+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+], [])[extern int _nl_msg_cat_cntr;
extern
#ifdef __cplusplus
"C"
@@ -1310,7 +1557,7 @@ AC_DEFUN([AM_PO_SUBDIRS],
;;
esac
done],
- [# Capture the value of obsolete $ALL_LINGUAS because we need it to compute
+ [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
# POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
# from automake.
eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
@@ -1339,6 +1586,10 @@ AC_DEFUN([AM_INTL_SUBDIR],
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_REQUIRE([jm_GLIBC21])dnl
+ AC_REQUIRE([gt_INTDIV0])dnl
+ AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
+ AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
+ AC_REQUIRE([gt_INTTYPES_PRI])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
stdlib.h string.h unistd.h sys/param.h])
@@ -1348,7 +1599,9 @@ strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
AM_ICONV
AM_LANGINFO_CODESET
- AM_LC_MESSAGES
+ if test $ac_cv_header_locale_h = yes; then
+ AM_LC_MESSAGES
+ fi
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
dnl because plural.y uses bison specific features. It requires at least
@@ -1398,6 +1651,10 @@ AC_DEFUN([AM_MKINSTALLDIRS],
AC_SUBST(MKINSTALLDIRS)
])
+
+dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
+
# lib-prefix.m4 serial 1 (gettext-0.11)
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
@@ -1547,7 +1804,7 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
prefix="$acl_save_prefix"
])
-# lib-link.m4 serial 2 (gettext-0.11.2)
+# lib-link.m4 serial 3 (gettext-0.11.3)
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
@@ -1665,6 +1922,10 @@ AC_DEFUN([AC_LIB_RPATH],
hardcode_minus_L="$acl_cv_hardcode_minus_L"
sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
+ dnl Determine whether the user wants rpath handling at all.
+ AC_ARG_ENABLE(rpath,
+ [ --disable-rpath do not hardcode runtime library paths],
+ :, enable_rpath=yes)
])
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
@@ -1794,7 +2055,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dnl Linking with a shared library. We attempt to hardcode its
dnl directory into the executable's runpath, unless it's the
dnl standard /usr/lib.
- if test "X$found_dir" = "X/usr/lib"; then
+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
dnl No hardcoding is needed.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
@@ -1985,29 +2246,31 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
;;
-R*)
dir=`echo "X$dep" | sed -e 's/^X-R//'`
- dnl Potentially add DIR to rpathdirs.
- dnl The rpathdirs will be appended to $LIBNAME at the end.
- haveit=
- for x in $rpathdirs; do
- if test "X$x" = "X$dir"; then
- haveit=yes
- break
+ if test "$enable_rpath" != no; then
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
fi
- done
- if test -z "$haveit"; then
- rpathdirs="$rpathdirs $dir"
- fi
- dnl Potentially add DIR to ltrpathdirs.
- dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
- haveit=
- for x in $ltrpathdirs; do
- if test "X$x" = "X$dir"; then
- haveit=yes
- break
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
fi
- done
- if test -z "$haveit"; then
- ltrpathdirs="$ltrpathdirs $dir"
fi
;;
-l*)
@@ -2194,7 +2457,7 @@ test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_LIB_PROG_LD_GNU
])
-# iconv.m4 serial AM3 (gettext-0.11)
+# iconv.m4 serial AM4 (gettext-0.11.3)
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
@@ -2204,11 +2467,8 @@ dnl the same distribution terms as the rest of that program.
dnl From Bruno Haible.
-AC_DEFUN([AM_ICONV_LINK],
+AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
[
- dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
- dnl those with the standalone portable GNU libiconv installed).
-
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
@@ -2216,6 +2476,16 @@ AC_DEFUN([AM_ICONV_LINK],
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
dnl accordingly.
AC_LIB_LINKFLAGS_BODY([iconv])
+])
+
+AC_DEFUN([AM_ICONV_LINK],
+[
+ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+ dnl those with the standalone portable GNU libiconv installed).
+
+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+ dnl accordingly.
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
dnl because if the user has installed libiconv and not disabled its use
@@ -2265,7 +2535,7 @@ AC_DEFUN([AM_ICONV_LINK],
AC_DEFUN([AM_ICONV],
[
- AC_REQUIRE([AM_ICONV_LINK])
+ AM_ICONV_LINK
if test "$am_cv_func_iconv" = yes; then
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL(am_cv_proto_iconv, [
@@ -2384,6 +2654,252 @@ AC_DEFUN([jm_GLIBC21],
]
)
+# intdiv0.m4 serial 1 (gettext-0.11.3)
+dnl Copyright (C) 2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gt_INTDIV0],
+[
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+
+ AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
+ gt_cv_int_divbyzero_sigfpe,
+ [
+ AC_TRY_RUN([
+#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);
+}
+], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
+ [
+ # Guess based on the CPU.
+ case "$host_cpu" in
+ alpha* | i[34567]86 | m68k | s390*)
+ gt_cv_int_divbyzero_sigfpe="guessing yes";;
+ *)
+ gt_cv_int_divbyzero_sigfpe="guessing no";;
+ esac
+ ])
+ ])
+ case "$gt_cv_int_divbyzero_sigfpe" in
+ *yes) value=1;;
+ *) value=0;;
+ esac
+ AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
+ [Define if integer division by zero raises signal SIGFPE.])
+])
+
+# uintmax_t.m4 serial 6 (gettext-0.11)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+AC_PREREQ(2.13)
+
+# Define uintmax_t to `unsigned long' or `unsigned long long'
+# if <inttypes.h> does not exist.
+
+AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
+[
+ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([jm_AC_HEADER_STDINT_H])
+ if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
+ AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
+ test $ac_cv_type_unsigned_long_long = yes \
+ && ac_type='unsigned long long' \
+ || ac_type='unsigned long'
+ AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
+ [Define to unsigned long or unsigned long long
+ if <inttypes.h> and <stdint.h> don't define.])
+ fi
+])
+
+# inttypes_h.m4 serial 4 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
+[
+ AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
+ [AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <inttypes.h>],
+ [uintmax_t i = (uintmax_t) -1;],
+ jm_ac_cv_header_inttypes_h=yes,
+ jm_ac_cv_header_inttypes_h=no)])
+ if test $jm_ac_cv_header_inttypes_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
+[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
+ fi
+])
+
+# stdint_h.m4 serial 2 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([jm_AC_HEADER_STDINT_H],
+[
+ AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
+ [AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <stdint.h>],
+ [uintmax_t i = (uintmax_t) -1;],
+ jm_ac_cv_header_stdint_h=yes,
+ jm_ac_cv_header_stdint_h=no)])
+ if test $jm_ac_cv_header_stdint_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
+[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
+ fi
+])
+
+# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
+dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
+[
+ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
+ [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
+ [unsigned long long ullmax = (unsigned long long) -1;
+ return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
+ ac_cv_type_unsigned_long_long=yes,
+ ac_cv_type_unsigned_long_long=no)])
+ if test $ac_cv_type_unsigned_long_long = yes; then
+ AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
+ [Define if you have the unsigned long long type.])
+ fi
+])
+
+# inttypes.m4 serial 1 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
+# <sys/types.h>.
+
+AC_DEFUN([gt_HEADER_INTTYPES_H],
+[
+ AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
+ [
+ AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <inttypes.h>],
+ [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
+ ])
+ if test $gt_cv_header_inttypes_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
+ [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
+ fi
+])
+
+# inttypes-pri.m4 serial 1 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
+# macros to non-string values. This is the case on AIX 4.3.3.
+
+AC_DEFUN([gt_INTTYPES_PRI],
+[
+ AC_REQUIRE([gt_HEADER_INTTYPES_H])
+ if test $gt_cv_header_inttypes_h = yes; then
+ AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
+ gt_cv_inttypes_pri_broken,
+ [
+ AC_TRY_COMPILE([#include <inttypes.h>
+#ifdef PRId32
+char *p = PRId32;
+#endif
+], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
+ ])
+ fi
+ if test "$gt_cv_inttypes_pri_broken" = yes; then
+ AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
+ [Define if <inttypes.h> exists and defines unusable PRI* macros.])
+ fi
+])
+
# codeset.m4 serial AM1 (gettext-0.10.40)
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
@@ -2408,7 +2924,7 @@ AC_DEFUN([AM_LANGINFO_CODESET],
fi
])
-# lcmessage.m4 serial 2 (gettext-0.10.40)
+# lcmessage.m4 serial 3 (gettext-0.11.3)
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
@@ -2431,40 +2947,15 @@ dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
# Check whether LC_MESSAGES is available in <locale.h>.
AC_DEFUN([AM_LC_MESSAGES],
- [if test $ac_cv_header_locale_h = yes; then
- AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
- [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+[
+ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
- if test $am_cv_val_LC_MESSAGES = yes; then
- AC_DEFINE(HAVE_LC_MESSAGES, 1,
- [Define if your <locale.h> file defines LC_MESSAGES.])
- fi
- fi])
-
-#serial 1
-
-dnl AC_PREREQ(2.14a)
-
-dnl This is a specialization of AC_CHECK_TYPE applied to `ssize_t' with
-dnl the difference that it also includes unistd.h on systems that have it.
-dnl On Fujitsu UXP/V systems ssize_t is defined in unistd.h.
-AC_DEFUN(GAWK_AC_TYPE_SSIZE_T,
- [
- AC_CHECK_HEADERS(unistd.h)
- AC_CHECK_TYPE(ssize_t, int,
- [
-#include <sys/types.h>
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
- ]
- )
- ]
-)
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES, 1,
+ [Define if your <locale.h> file defines LC_MESSAGES.])
+ fi
+])
dnl
dnl strtod.m4 --- autoconf input file for gawk
@@ -2522,192 +3013,14 @@ main ()
gawk_ac_cv_func_strtod_c89=yes, gawk_ac_cv_func_strtod_c89=no,
gawk_ac_cv_func_strtod_c89=no)])
if test $gawk_ac_cv_func_strtod_c89 = no; then
- AC_DEFINE(STRTOD_NOT_C89)
+ AC_DEFINE(STRTOD_NOT_C89, 1, [strtod doesn't have C89 semantics])
fi
])# GAWK_FUNC_STRTOD_C89
-#serial 7
-
-dnl From Jim Meyering.
-dnl A wrapper around AC_FUNC_MKTIME.
-
-AC_DEFUN(jm_FUNC_MKTIME,
-[AC_REQUIRE([AC_FUNC_MKTIME])dnl
-
- dnl mktime.c uses localtime_r if it exists. Check for it.
- AC_CHECK_FUNCS(localtime_r)
-
- if test $ac_cv_func_working_mktime = no; then
- AC_DEFINE_UNQUOTED(mktime, rpl_mktime,
- [Define to rpl_mktime if the replacement function should be used.])
- fi
-])
-
-# AC_FUNC_MKTIME
-# --------------
-# Stolen from CVS Autoconf. Should be removed once you use Autoconf 2.15.
-AC_DEFUN(AC_FUNC_MKTIME,
-[AC_REQUIRE([AC_HEADER_TIME])dnl
-AC_CHECK_HEADERS(sys/time.h unistd.h)
-AC_CHECK_FUNCS(alarm)
-AC_CACHE_CHECK([for working mktime], ac_cv_func_working_mktime,
-[AC_TRY_RUN(
-[/* Test program from Paul Eggert (eggert@twinsun.com)
- and Tony Leneis (tony@plaza.ds.adp.com). */
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#if !HAVE_ALARM
-# define alarm(X) /* empty */
-#endif
-
-/* Work around redefinition to rpl_putenv by other config tests. */
-#undef putenv
-
-static time_t time_t_max;
-
-/* Values we'll use to set the TZ environment variable. */
-static const char *const tz_strings[] = {
- (const char *) 0, "TZ=GMT0", "TZ=JST-9",
- "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
-};
-#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
-
-/* Fail if mktime fails to convert a date in the spring-forward gap.
- Based on a problem report from Andreas Jaeger. */
-static void
-spring_forward_gap ()
-{
- /* glibc (up to about 1998-10-07) failed this test) */
- struct tm tm;
-
- /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
- instead of "TZ=America/Vancouver" in order to detect the bug even
- on systems that don't support the Olson extension, or don't have the
- full zoneinfo tables installed. */
- putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
-
- tm.tm_year = 98;
- tm.tm_mon = 3;
- tm.tm_mday = 5;
- tm.tm_hour = 2;
- tm.tm_min = 0;
- tm.tm_sec = 0;
- tm.tm_isdst = -1;
- if (mktime (&tm) == (time_t)-1)
- exit (1);
-}
-
-static void
-mktime_test (now)
- time_t now;
-{
- struct tm *lt;
- if ((lt = localtime (&now)) && mktime (lt) != now)
- exit (1);
- now = time_t_max - now;
- if ((lt = localtime (&now)) && mktime (lt) != now)
- exit (1);
-}
-
-static void
-irix_6_4_bug ()
-{
- /* Based on code from Ariel Faigon. */
- struct tm tm;
- tm.tm_year = 96;
- tm.tm_mon = 3;
- tm.tm_mday = 0;
- tm.tm_hour = 0;
- tm.tm_min = 0;
- tm.tm_sec = 0;
- tm.tm_isdst = -1;
- mktime (&tm);
- if (tm.tm_mon != 2 || tm.tm_mday != 31)
- exit (1);
-}
-
-static void
-bigtime_test (j)
- int j;
-{
- struct tm tm;
- time_t now;
- tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
- now = mktime (&tm);
- if (now != (time_t) -1)
- {
- struct tm *lt = localtime (&now);
- if (! (lt
- && lt->tm_year == tm.tm_year
- && lt->tm_mon == tm.tm_mon
- && lt->tm_mday == tm.tm_mday
- && lt->tm_hour == tm.tm_hour
- && lt->tm_min == tm.tm_min
- && lt->tm_sec == tm.tm_sec
- && lt->tm_yday == tm.tm_yday
- && lt->tm_wday == tm.tm_wday
- && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
- == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
- exit (1);
- }
-}
-
-int
-main ()
-{
- time_t t, delta;
- int i, j;
-
- /* This test makes some buggy mktime implementations loop.
- Give up after 60 seconds; a mktime slower than that
- isn't worth using anyway. */
- alarm (60);
-
- for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
- continue;
- time_t_max--;
- delta = time_t_max / 997; /* a suitable prime number */
- for (i = 0; i < N_STRINGS; i++)
- {
- if (tz_strings[i])
- putenv (tz_strings[i]);
-
- for (t = 0; t <= time_t_max - delta; t += delta)
- mktime_test (t);
- mktime_test ((time_t) 60 * 60);
- mktime_test ((time_t) 60 * 60 * 24);
-
- for (j = 1; 0 < j; j *= 2)
- bigtime_test (j);
- bigtime_test (j - 1);
- }
- irix_6_4_bug ();
- spring_forward_gap ();
- exit (0);
-}],
-ac_cv_func_working_mktime=yes, ac_cv_func_working_mktime=no,
-ac_cv_func_working_mktime=no)])
-if test $ac_cv_func_working_mktime = no; then
- LIBOBJS="$LIBOBJS mktime.${ac_objext}"
-fi
-])# AC_FUNC_MKTIME
dnl
dnl socket.m4 --- autoconf input file for gawk
dnl
-dnl Copyright (C) 1995, 96, 98, 99, 2000 the Free Software Foundation, Inc.
+dnl Copyright (C) 1995, 1996, 1998, 1999, 2000, 2003 the Free Software Foundation, Inc.
dnl
dnl This file is part of GAWK, the GNU implementation of the
dnl AWK Progamming Language.
@@ -2785,7 +3098,7 @@ then
esac
AC_MSG_RESULT([${gawk_lib_loc}])
- AC_DEFINE(HAVE_SOCKETS)
+ AC_DEFINE(HAVE_SOCKETS, 1, [we have sockets on this system])
fi
AC_SUBST(SOCKET_LIBS)dnl
])dnl
diff --git a/ansi2knr.c b/ansi2knr.c
index ed5ba195..1b32b068 100644
--- a/ansi2knr.c
+++ b/ansi2knr.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 1989, 1997, 1998, 1999 Aladdin Enterprises. All rights reserved. */
+/* Copyright (C) 1989, 2000 Aladdin Enterprises. All rights reserved. */
-/*$Id: ansi2knr.c $*/
+/*$Id: ansi2knr.c,v 1.3 2000/04/13 03:41:48 lpd Exp $*/
/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
/*
@@ -37,21 +37,21 @@ program under the GPL.
* There are no error messages.
*
* ansi2knr recognizes function definitions by seeing a non-keyword
- * identifier at the left margin, followed by a left parenthesis,
- * with a right parenthesis as the last character on the line,
- * and with a left brace as the first token on the following line
- * (ignoring possible intervening comments), except that a line
+ * identifier at the left margin, followed by a left parenthesis, with a
+ * right parenthesis as the last character on the line, and with a left
+ * brace as the first token on the following line (ignoring possible
+ * intervening comments and/or preprocessor directives), except that a line
* consisting of only
* identifier1(identifier2)
* will not be considered a function definition unless identifier2 is
* the word "void", and a line consisting of
* identifier1(identifier2, <<arbitrary>>)
* will not be considered a function definition.
- * ansi2knr will recognize a multi-line header provided
- * that no intervening line ends with a left or right brace or a semicolon.
- * These algorithms ignore whitespace and comments, except that
- * the function name must be the first thing on the line.
- * The following constructs will confuse it:
+ * ansi2knr will recognize a multi-line header provided that no intervening
+ * line ends with a left or right brace or a semicolon. These algorithms
+ * ignore whitespace, comments, and preprocessor directives, except that
+ * the function name must be the first thing on the line. The following
+ * constructs will confuse it:
* - Any other construct that starts at the left margin and
* follows the above syntax (such as a macro or function call).
* - Some macros that tinker with the syntax of function headers.
@@ -61,6 +61,27 @@ program under the GPL.
* The original and principal author of ansi2knr is L. Peter Deutsch
* <ghost@aladdin.com>. Other authors are noted in the change history
* that follows (in reverse chronological order):
+
+ lpd 2000-04-12 backs out Eggert's changes because of bugs:
+ - concatlits didn't declare the type of its bufend argument;
+ - concatlits didn't't recognize when it was inside a comment;
+ - scanstring could scan backward past the beginning of the string; when
+ - the check for \ + newline in scanstring was unnecessary.
+
+ 2000-03-05 Paul Eggert <eggert@twinsun.com>
+
+ Add support for concatenated string literals.
+ * ansi2knr.c (concatlits): New decl.
+ (main): Invoke concatlits to concatenate string literals.
+ (scanstring): Handle backslash-newline correctly. Work with
+ character constants. Fix bug when scanning backwards through
+ backslash-quote. Check for unterminated strings.
+ (convert1): Parse character constants, too.
+ (appendline, concatlits): New functions.
+ * ansi2knr.1: Document this.
+
+ lpd 1999-08-17 added code to allow preprocessor directives
+ wherever comments are allowed
lpd 1999-04-12 added minor fixes from Pavel Roskin
<pavel_roskin@geocities.com> for clean compilation with
gcc -W -Wall
@@ -196,6 +217,8 @@ program under the GPL.
#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_')
/* Forward references */
+char *ppdirforward();
+char *ppdirbackward();
char *skipspace();
char *scanstring();
int writeblanks();
@@ -298,7 +321,7 @@ f: if ( line >= buf + (bufsize - 1) ) /* overflow check */
goto wl;
if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL )
goto wl;
- switch ( *skipspace(more, 1) )
+ switch ( *skipspace(ppdirforward(more), 1) )
{
case '{':
/* Definitely a function header. */
@@ -349,32 +372,70 @@ wl: fputs(buf, out);
return 0;
}
-/* Skip over whitespace and comments, in either direction. */
+/*
+ * Skip forward or backward over one or more preprocessor directives.
+ */
+char *
+ppdirforward(p)
+ char *p;
+{
+ for (; *p == '#'; ++p) {
+ for (; *p != '\r' && *p != '\n'; ++p)
+ if (*p == 0)
+ return p;
+ if (*p == '\r' && p[1] == '\n')
+ ++p;
+ }
+ return p;
+}
+char *
+ppdirbackward(p, limit)
+ char *p;
+ char *limit;
+{
+ char *np = p;
+
+ for (;; p = --np) {
+ if (*np == '\n' && np[-1] == '\r')
+ --np;
+ for (; np > limit && np[-1] != '\r' && np[-1] != '\n'; --np)
+ if (np[-1] == 0)
+ return np;
+ if (*np != '#')
+ return p;
+ }
+}
+
+/*
+ * Skip over whitespace, comments, and preprocessor directives,
+ * in either direction.
+ */
char *
skipspace(p, dir)
- register char *p;
- register int dir; /* 1 for forward, -1 for backward */
-{ for ( ; ; )
- { while ( is_space(*p) )
- p += dir;
- if ( !(*p == '/' && p[dir] == '*') )
- break;
- p += dir; p += dir;
- while ( !(*p == '*' && p[dir] == '/') )
- { if ( *p == 0 )
- return p; /* multi-line comment?? */
- p += dir;
- }
- p += dir; p += dir;
- }
- return p;
+ char *p;
+ int dir; /* 1 for forward, -1 for backward */
+{
+ for ( ; ; ) {
+ while ( is_space(*p) )
+ p += dir;
+ if ( !(*p == '/' && p[dir] == '*') )
+ break;
+ p += dir; p += dir;
+ while ( !(*p == '*' && p[dir] == '/') ) {
+ if ( *p == 0 )
+ return p; /* multi-line comment?? */
+ p += dir;
+ }
+ p += dir; p += dir;
+ }
+ return p;
}
/* Scan over a quoted string, in either direction. */
char *
scanstring(p, dir)
- register char *p;
- register int dir;
+ char *p;
+ int dir;
{
for (p += dir; ; p += dir)
if (*p == '"' && p[-dir] != '\\')
@@ -412,14 +473,14 @@ writeblanks(start, end)
int
test1(buf)
char *buf;
-{ register char *p = buf;
+{ char *p = buf;
char *bend;
char *endfn;
int contin;
if ( !isidfirstchar(*p) )
return 0; /* no name at left margin */
- bend = skipspace(buf + strlen(buf) - 1, -1);
+ bend = skipspace(ppdirbackward(buf + strlen(buf) - 1, buf), -1);
switch ( *bend )
{
case ';': contin = 0 /*2*/; break;
@@ -498,7 +559,7 @@ convert1(buf, out, header, convert_varargs)
int header; /* Boolean */
int convert_varargs; /* Boolean */
{ char *endfn;
- register char *p;
+ char *p;
/*
* The breaks table contains pointers to the beginning and end
* of each argument.
diff --git a/array.c b/array.c
index 1186b929..ac60239c 100644
--- a/array.c
+++ b/array.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2002 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.
@@ -33,15 +33,43 @@
* The decision is made to grow the array if the average chain length is
* ``too big''. This is defined as the total number of entries in the table
* divided by the size of the array being greater than some constant.
+ *
+ * 11/2002: We make the constant a variable, so that it can be tweaked
+ * via environment variable.
*/
-#define AVG_CHAIN_MAX 10 /* don't want to linear search more than this */
+static int AVG_CHAIN_MAX = 2; /* 11/2002: Modern machines are bigger, cut this down from 10. */
#include "awk.h"
static NODE *assoc_find P((NODE *symbol, NODE *subs, int hash1));
static void grow_table P((NODE *symbol));
+static unsigned long gst_hash_string P((const char *str, size_t len, unsigned long hsize));
+static unsigned long scramble P((unsigned long x));
+static unsigned long awk_hash P((const char *s, size_t len, unsigned long hsize));
+
+unsigned long (*hash)P((const char *s, size_t len, unsigned long hsize)) = awk_hash;
+
+/* array_init --- possibly temporary function for experimentation purposes */
+
+void
+array_init()
+{
+ const char *val;
+ int newval;
+
+ if ((val = getenv("AVG_CHAIN_MAX")) != NULL && ISDIGIT(*val)) {
+ for (newval = 0; *val && ISDIGIT(*val); val++)
+ newval = (newval * 10) + *val - '0';
+
+ AVG_CHAIN_MAX = newval;
+ }
+
+ if ((val = getenv("AWK_HASH")) != NULL && strcmp(val, "gst") == 0)
+ hash = gst_hash_string;
+}
+
/* concat_exp --- concatenate expression list into a single string */
NODE *
@@ -53,7 +81,7 @@ concat_exp(register NODE *tree)
size_t len;
int offset;
size_t subseplen;
- char *subsep;
+ const char *subsep;
if (tree->type != Node_expression_list)
return force_string(tree_eval(tree));
@@ -101,9 +129,8 @@ assoc_clear(NODE *symbol)
for (i = 0; i < symbol->array_size; i++) {
for (bucket = symbol->var_array[i]; bucket != NULL; bucket = next) {
next = bucket->ahnext;
- unref(bucket->ahname);
unref(bucket->ahvalue);
- freenode(bucket);
+ unref(bucket); /* unref() will free the ahname_str */
}
symbol->var_array[i] = NULL;
}
@@ -115,8 +142,8 @@ assoc_clear(NODE *symbol)
/* hash --- calculate the hash function of the string in subs */
-unsigned int
-hash(register const char *s, register size_t len, unsigned long hsize)
+static unsigned long
+awk_hash(register const char *s, register size_t len, unsigned long hsize)
{
register unsigned long h = 0;
@@ -206,7 +233,9 @@ static NODE * /* NULL if not found */
assoc_find(NODE *symbol, register NODE *subs, int hash1)
{
register NODE *bucket;
- NODE *s1, *s2;
+ const char *s1_str;
+ size_t s1_len;
+ NODE *s2;
for (bucket = symbol->var_array[hash1]; bucket != NULL;
bucket = bucket->ahnext) {
@@ -214,26 +243,28 @@ assoc_find(NODE *symbol, register NODE *subs, int hash1)
* This used to use cmp_nodes() here. That's wrong.
* Array indexes are strings; compare as such, always!
*/
- s1 = bucket->ahname;
- s1 = force_string(s1);
+ s1_str = bucket->ahname_str;
+ s1_len = bucket->ahname_len;
s2 = subs;
- if (s1->stlen == s2->stlen) {
- if (s1->stlen == 0 /* "" is a valid index */
- || STREQN(s1->stptr, s2->stptr, s1->stlen))
+ if (s1_len == s2->stlen) {
+ if (s1_len == 0 /* "" is a valid index */
+ || STREQN(s1_str, s2->stptr, s1_len))
return bucket;
}
}
return NULL;
}
-/* in_array --- test whether the array element symbol[subs] exists or not */
+/* in_array --- test whether the array element symbol[subs] exists or not,
+ * return pointer to value if it does.
+ */
-int
+NODE *
in_array(NODE *symbol, NODE *subs)
{
register int hash1;
- int ret;
+ NODE *ret;
if (symbol->type == Node_param_list)
symbol = stack_ptr[symbol->param_cnt];
@@ -247,12 +278,15 @@ in_array(NODE *symbol, NODE *subs)
subs = concat_exp(subs); /* concat_exp returns a string node */
if (symbol->var_array == NULL) {
free_temp(subs);
- return 0;
+ return NULL;
}
hash1 = hash(subs->stptr, subs->stlen, (unsigned long) symbol->array_size);
- ret = (assoc_find(symbol, subs, hash1) != NULL);
+ ret = assoc_find(symbol, subs, hash1);
free_temp(subs);
- return ret;
+ if (ret)
+ return ret->ahvalue;
+ else
+ return NULL;
}
/*
@@ -331,18 +365,15 @@ assoc_lookup(NODE *symbol, NODE *subs, int reference)
* One day: Use an atom table to track array indices,
* and avoid the extra memory overhead.
*/
- if (subs->flags & TEMP)
- bucket->ahname = dupnode(subs);
- else
- bucket->ahname = copynode(subs);
+ bucket->flags |= MALLOC;
+ bucket->ahname_ref = 1;
+ emalloc(bucket->ahname_str, char *, subs->stlen + 2, "assoc_lookup");
+ bucket->ahname_len = subs->stlen;
- free_temp(subs);
+ memcpy(bucket->ahname_str, subs->stptr, subs->stlen);
+ bucket->ahname_str[bucket->ahname_len] = '\0';
- /* array subscripts are strings */
- bucket->ahname->flags &= ~(NUMBER|NUM);
- bucket->ahname->flags |= (STRING|STR);
- /* ensure that this string value never changes */
- bucket->ahname->stfmt = -1;
+ free_temp(subs);
bucket->ahvalue = Nnull_string;
bucket->ahnext = symbol->var_array[hash1];
@@ -352,6 +383,11 @@ assoc_lookup(NODE *symbol, NODE *subs, int reference)
/* do_delete --- perform `delete array[s]' */
+/*
+ * `symbol' is array
+ * `tree' is subscript
+ */
+
void
do_delete(NODE *symbol, NODE *tree)
{
@@ -359,16 +395,39 @@ do_delete(NODE *symbol, NODE *tree)
register NODE *bucket, *last;
NODE *subs;
+ /*
+ * Evaluate subscript first, always, in case there are
+ * side effects.
+ */
+ if (tree != NULL)
+ subs = concat_exp(tree); /* concat_exp returns string node */
+ else
+ subs = NULL;
+
if (symbol->type == Node_param_list) {
symbol = stack_ptr[symbol->param_cnt];
- if (symbol->type == Node_var)
+ if (symbol->type == Node_var) {
+ if (subs != NULL) {
+ if (do_lint)
+ lintwarn(_("delete: index `%s' not in array `%s'"),
+ subs->stptr, symbol->vname);
+ free_temp(subs);
+ }
return;
+ }
}
if (symbol->type == Node_array_ref)
symbol = symbol->orig_array;
if (symbol->type == Node_var_array) {
- if (symbol->var_array == NULL)
+ if (symbol->var_array == NULL) {
+ if (subs != NULL) {
+ if (do_lint)
+ lintwarn(_("delete: index `%s' not in array `%s'"),
+ subs->stptr, symbol->vname);
+ free_temp(subs);
+ }
return;
+ }
} else
fatal(_("delete: illegal use of variable `%s' as array"),
symbol->vname);
@@ -378,7 +437,6 @@ do_delete(NODE *symbol, NODE *tree)
return;
}
- subs = concat_exp(tree); /* concat_exp returns string node */
hash1 = hash(subs->stptr, subs->stlen, (unsigned long) symbol->array_size);
last = NULL;
@@ -388,15 +446,17 @@ do_delete(NODE *symbol, NODE *tree)
* This used to use cmp_nodes() here. That's wrong.
* Array indexes are strings; compare as such, always!
*/
- NODE *s1, *s2;
+ const char *s1_str;
+ size_t s1_len;
+ NODE *s2;
- s1 = bucket->ahname;
- s1 = force_string(s1);
+ s1_str = bucket->ahname_str;
+ s1_len = bucket->ahname_len;
s2 = subs;
- if (s1->stlen == s2->stlen) {
- if (s1->stlen == 0 /* "" is a valid index */
- || STREQN(s1->stptr, s2->stptr, s1->stlen))
+ if (s1_len == s2->stlen) {
+ if (s1_len == 0 /* "" is a valid index */
+ || STREQN(s1_str, s2->stptr, s1_len))
break;
}
}
@@ -413,9 +473,8 @@ do_delete(NODE *symbol, NODE *tree)
last->ahnext = bucket->ahnext;
else
symbol->var_array[hash1] = bucket->ahnext;
- unref(bucket->ahname);
unref(bucket->ahvalue);
- freenode(bucket);
+ unref(bucket); /* unref() will free the ahname_str */
symbol->table_size--;
if (symbol->table_size <= 0) {
memset(symbol->var_array, '\0',
@@ -461,7 +520,10 @@ do_delete_loop(NODE *symbol, NODE *tree)
if (symbol->var_array[i] != NULL) {
lhs = get_lhs(tree->lnode, & after_assign, FALSE);
unref(*lhs);
- *lhs = dupnode(symbol->var_array[i]->ahname);
+ *lhs = make_string(symbol->var_array[i]->ahname_str,
+ symbol->var_array[i]->ahname_len);
+ if (after_assign)
+ (*after_assign)();
break;
}
}
@@ -488,7 +550,7 @@ grow_table(NODE *symbol)
* very large (> 8K), we just double more or less, instead of
* just jumping from 8K to 64K.
*/
- static long sizes[] = { 13, 127, 1021, 8191, 16381, 32749, 65497,
+ static const long sizes[] = { 13, 127, 1021, 8191, 16381, 32749, 65497,
#if ! defined(MSDOS) && ! defined(OS2) && ! defined(atarist)
131101, 262147, 524309, 1048583, 2097169,
4194319, 8388617, 16777259, 33554467,
@@ -529,8 +591,8 @@ grow_table(NODE *symbol)
for (chain = old[i]; chain != NULL; chain = next) {
next = chain->ahnext;
- hash1 = hash(chain->ahname->stptr,
- chain->ahname->stlen, newsize);
+ hash1 = hash(chain->ahname_str,
+ chain->ahname_len, newsize);
/* remove from old list, add to new */
chain->ahnext = new[hash1];
@@ -553,7 +615,7 @@ done:
static void
pr_node(NODE *n)
{
- if ((n->flags & (NUM|NUMBER)) != 0)
+ if ((n->flags & (NUMCUR|NUMBER)) != 0)
printf("%g", n->numbr);
else
printf("%.*s", (int) n->stlen, n->stptr);
@@ -583,14 +645,11 @@ assoc_dump(NODE *symbol)
for (i = 0; i < symbol->array_size; i++) {
for (bucket = symbol->var_array[i]; bucket != NULL;
bucket = bucket->ahnext) {
- printf("%s: I: [(%p, %ld, %s) len %d <%.*s>] V: [",
+ printf("%s: I: [len %d <%.*s>] V: [",
symbol->vname,
- bucket->ahname,
- bucket->ahname->stref,
- flags2str(bucket->ahname->flags),
- (int) bucket->ahname->stlen,
- (int) bucket->ahname->stlen,
- bucket->ahname->stptr);
+ (int) bucket->ahname_len,
+ (int) bucket->ahname_len,
+ bucket->ahname_str);
pr_node(bucket->ahvalue);
printf("]\n");
}
@@ -663,12 +722,19 @@ dup_table(NODE *symbol, NODE *newsymb)
/* get a node for the linked list */
getnode(bucket);
bucket->type = Node_ahash;
+ bucket->flags |= MALLOC;
+ bucket->ahname_ref = 1;
/*
* copy the corresponding name and
* value from the original input list
*/
- bucket->ahname = dupnode(chain->ahname);
+ emalloc(bucket->ahname_str, char *, chain->ahname_len + 2, "dup_table");
+ bucket->ahname_len = chain->ahname_len;
+
+ memcpy(bucket->ahname_str, chain->ahname_str, chain->ahname_len);
+ bucket->ahname_str[bucket->ahname_len] = '\0';
+
bucket->ahvalue = dupnode(chain->ahvalue);
/*
@@ -694,9 +760,14 @@ merge(NODE *left, NODE *right)
{
NODE *ans, *cur;
+ /*
+ * The use of cmp_nodes() here means that IGNORECASE influences the
+ * comparison. This is OK, but it may be surprising. This comment
+ * serves to remind us that we know about this and that it's OK.
+ */
if (cmp_nodes(left->ahvalue, right->ahvalue) <= 0) {
ans = cur = left;
- left = left->ahnext;
+ left = left->ahnext;
} else {
ans = cur = right;
right = right->ahnext;
@@ -758,19 +829,24 @@ static void
assoc_from_list(NODE *symbol, NODE *list)
{
NODE *next;
- int i = 0;
+ unsigned long i = 0;
register int hash1;
+ char buf[100];
for (; list != NULL; list = next) {
next = list->ahnext;
/* make an int out of i++ */
i++;
- list->ahname = make_number((AWKNUM) i);
- (void) force_string(list->ahname);
+ sprintf(buf, "%lu", i);
+ assert(list->ahname_str == NULL);
+ assert(list->ahname_ref == 1);
+ emalloc(list->ahname_str, char *, strlen(buf) + 2, "assoc_from_list");
+ list->ahname_len = strlen(buf);
+ strcpy(list->ahname_str, buf);
/* find the bucket where it belongs */
- hash1 = hash(list->ahname->stptr, list->ahname->stlen,
+ hash1 = hash(list->ahname_str, list->ahname_len,
symbol->array_size);
/* link the node into the chain at that bucket */
@@ -784,8 +860,10 @@ assoc_from_list(NODE *symbol, NODE *list)
* the sorted values back into symbol[], indexed by integers starting with 1.
*/
+typedef enum asort_how { VALUE, INDEX } ASORT_TYPE;
+
static NODE *
-assoc_sort_inplace(NODE *symbol)
+assoc_sort_inplace(NODE *symbol, ASORT_TYPE how)
{
int i, num;
NODE *bucket, *next, *list;
@@ -796,17 +874,70 @@ assoc_sort_inplace(NODE *symbol)
return tmp_number((AWKNUM) 0);
/* build a linked list out of all the entries in the table */
- list = NULL;
- num = 0;
- for (i = 0; i < symbol->array_size; i++) {
- for (bucket = symbol->var_array[i]; bucket != NULL; bucket = next) {
- next = bucket->ahnext;
- unref(bucket->ahname);
- bucket->ahnext = list;
- list = bucket;
- num++;
+ if (how == VALUE) {
+ list = NULL;
+ num = 0;
+ for (i = 0; i < symbol->array_size; i++) {
+ for (bucket = symbol->var_array[i]; bucket != NULL; bucket = next) {
+ next = bucket->ahnext;
+ if (bucket->ahname_ref == 1) {
+ free(bucket->ahname_str);
+ bucket->ahname_str = NULL;
+ bucket->ahname_len = 0;
+ } else {
+ NODE *r;
+
+ getnode(r);
+ *r = *bucket;
+ unref(bucket);
+ bucket = r;
+ bucket->flags |= MALLOC;
+ bucket->ahname_ref = 1;
+ bucket->ahname_str = NULL;
+ bucket->ahname_len = 0;
+ }
+ bucket->ahnext = list;
+ list = bucket;
+ num++;
+ }
+ symbol->var_array[i] = NULL;
+ }
+ } else { /* how == INDEX */
+ list = NULL;
+ num = 0;
+ for (i = 0; i < symbol->array_size; i++) {
+ for (bucket = symbol->var_array[i]; bucket != NULL; bucket = next) {
+ next = bucket->ahnext;
+
+ /* toss old value */
+ unref(bucket->ahvalue);
+
+ /* move index into value */
+ if (bucket->ahname_ref == 1) {
+ bucket->ahvalue = make_str_node(bucket->ahname_str,
+ bucket->ahname_len, ALREADY_MALLOCED);
+ bucket->ahname_str = NULL;
+ bucket->ahname_len = 0;
+ } else {
+ NODE *r;
+
+ bucket->ahvalue = make_string(bucket->ahname_str, bucket->ahname_len);
+ getnode(r);
+ *r = *bucket;
+ unref(bucket);
+ bucket = r;
+ bucket->flags |= MALLOC;
+ bucket->ahname_ref = 1;
+ bucket->ahname_str = NULL;
+ bucket->ahname_len = 0;
+ }
+
+ bucket->ahnext = list;
+ list = bucket;
+ num++;
+ }
+ symbol->var_array[i] = NULL;
}
- symbol->var_array[i] = NULL;
}
/*
@@ -826,10 +957,10 @@ assoc_sort_inplace(NODE *symbol)
return tmp_number((AWKNUM) num);
}
-/* do_asort --- do the actual work to sort the input array */
+/* asort_actual --- do the actual work to sort the input array */
-NODE *
-do_asort(NODE *tree)
+static NODE *
+asort_actual(NODE *tree, ASORT_TYPE how)
{
NODE *src, *dest;
@@ -856,5 +987,83 @@ do_asort(NODE *tree)
dup_table(src, dest);
}
- return dest != NULL ? assoc_sort_inplace(dest) : assoc_sort_inplace(src);
+ return dest != NULL ? assoc_sort_inplace(dest, how) : assoc_sort_inplace(src, how);
+}
+
+/* do_asort --- sort array by value */
+
+NODE *
+do_asort(NODE *tree)
+{
+ return asort_actual(tree, VALUE);
+}
+
+/* do_asorti --- sort array by index */
+
+NODE *
+do_asorti(NODE *tree)
+{
+ return asort_actual(tree, INDEX);
+}
+
+/*
+From bonzini@gnu.org Mon Oct 28 16:05:26 2002
+Date: Mon, 28 Oct 2002 13:33:03 +0100
+From: Paolo Bonzini <bonzini@gnu.org>
+To: arnold@skeeve.com
+Subject: Hash function
+Message-ID: <20021028123303.GA6832@biancaneve>
+
+Here is the hash function I'm using in GNU Smalltalk. The scrambling is
+needed if you use powers of two as the table sizes. If you use primes it
+is not needed.
+
+To use double-hashing with power-of-two size, you should use the
+_gst_hash_string(str, len) as the primary hash and
+scramble(_gst_hash_string (str, len)) | 1 as the secondary hash.
+
+Paolo
+
+*/
+/*
+ * ADR: Slightly modified to work w/in the context of gawk.
+ */
+
+static unsigned long
+gst_hash_string(const char *str, size_t len, unsigned long hsize)
+{
+ unsigned long hashVal = 1497032417; /* arbitrary value */
+ unsigned long ret;
+
+ while (len--) {
+ hashVal += *str++;
+ hashVal += (hashVal << 10);
+ hashVal ^= (hashVal >> 6);
+ }
+
+ ret = scramble(hashVal);
+ if (ret >= hsize)
+ ret %= hsize;
+
+ return ret;
+}
+
+static unsigned long
+scramble(unsigned long x)
+{
+ if (sizeof(long) == 4) {
+ int y = ~x;
+
+ x += (y << 10) | (y >> 22);
+ x += (x << 6) | (x >> 26);
+ x -= (x << 16) | (x >> 16);
+ } else {
+ x ^= (~x) >> 31;
+ x += (x << 21) | (x >> 11);
+ x += (x << 5) | (x >> 27);
+ x += (x << 27) | (x >> 5);
+ x += (x << 31);
+ }
+
+ return x;
}
diff --git a/awk.h b/awk.h
index d3c19c9e..32c9f0cc 100644
--- a/awk.h
+++ b/awk.h
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2002 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.
@@ -59,9 +59,6 @@
#endif /* LOCALEDIR */
#endif
-#ifdef HAVE_LOCALE_H
-#include <locale.h>
-#endif /* HAVE_LOCALE_H */
#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
#include <stdarg.h>
#else
@@ -130,7 +127,6 @@ extern int errno;
#define P(s) ()
#define MALLOC_ARG_T unsigned
#define volatile
-#define const
#endif /* not __STDC__ */
#ifndef VMS
@@ -176,7 +172,7 @@ extern int errno;
#include <unixlib.h>
#endif /* atarist || VMS */
-#if ! defined(MSDOS) && ! defined(OS2) && ! defined(WIN32) && ! defined(__EMX__) && ! defined(O_BINARY) /*duh*/
+#if ! defined(MSDOS) && ! defined(OS2) && ! defined(WIN32) && ! defined(__EMX__) && ! defined(__CYGWIN__) && ! defined(O_BINARY) /*duh*/
#define O_BINARY 0
#endif
@@ -206,7 +202,6 @@ lose
/* use this as lintwarn("...")
this is a hack but it gives us the right semantics */
#define lintwarn (*(set_loc(__FILE__, __LINE__),lintfunc))
-extern void set_prof_file P((const char *filename));
#ifdef VMS
#include "vms/redirect.h"
@@ -216,20 +211,19 @@ extern void set_prof_file P((const char *filename));
#include "unsupported/atari/redirect.h"
#endif
+#define RE_TRANSLATE_TYPE const char *
#define GNU_REGEX
#ifdef GNU_REGEX
#include "regex.h"
-#include "dfa.h"
typedef struct Regexp {
struct re_pattern_buffer pat;
struct re_registers regs;
- struct dfa dfareg;
- int dfa;
} Regexp;
#define RESTART(rp,s) (rp)->regs.start[0]
#define REEND(rp,s) (rp)->regs.end[0]
#define SUBPATSTART(rp,s,n) (rp)->regs.start[n]
#define SUBPATEND(rp,s,n) (rp)->regs.end[n]
+#define NUMSUBPATS(rp,s) (rp)->regs.num_regs
#endif /* GNU_REGEX */
/* Stuff for losing systems. */
@@ -238,6 +232,30 @@ extern double gawk_strtod();
#define strtod gawk_strtod
#endif
+#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+# define __attribute__(x)
+#endif
+
+#ifndef ATTRIBUTE_UNUSED
+#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+#endif /* ATTRIBUTE_UNUSED */
+
+#ifndef ATTRIBUTE_NORETURN
+#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+#endif /* ATTRIBUTE_NORETURN */
+
+#ifndef ATTRIBUTE_PRINTF
+#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
+#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
+#endif /* ATTRIBUTE_PRINTF */
+
+/* We use __extension__ in some places to suppress -pedantic warnings
+ about GCC extensions. This feature didn't work properly before
+ gcc 2.8. */
+#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
+#define __extension__
+#endif
+
/* ------------------ Constants, Structures, Typedefs ------------------ */
#ifndef AWKNUM
@@ -250,6 +268,9 @@ extern double gawk_strtod();
#define FALSE 0
#endif
+#define LINT_INVALID 1 /* only warn about invalid */
+#define LINT_ALL 2 /* warn about all things */
+
/* Figure out what '\a' really is. */
#ifdef __STDC__
#define BELL '\a' /* sure makes life easy, don't it? */
@@ -330,6 +351,7 @@ typedef enum nodevals {
Node_K_break, /* no subs */
Node_K_continue, /* no subs */
Node_K_print, /* lnode is exp_list, rnode is redirect */
+ Node_K_print_rec, /* lnode is NULL, rnode is redirect */
Node_K_printf, /* lnode is exp_list, rnode is redirect */
Node_K_next, /* no subs */
Node_K_exit, /* subnode is return value, or NULL */
@@ -354,7 +376,7 @@ typedef enum nodevals {
Node_var_array, /* array is ptr to elements, asize num of eles */
Node_val, /* node is a value - type in flags */
- /* Builtins subnode is explist to work on, proc is func to call */
+ /* Builtins subnode is explist to work on, builtin is func to call */
Node_builtin,
/*
@@ -379,6 +401,7 @@ typedef enum nodevals {
Node_hashnode, /* an identifier in the symbol table */
Node_ahash, /* an array element */
Node_array_ref, /* array passed by ref as parameter */
+
Node_BINMODE, /* variables recognized in the grammar */
Node_CONVFMT,
Node_FIELDWIDTHS,
@@ -410,7 +433,7 @@ typedef struct exp_node {
} l;
union {
struct exp_node *rptr;
- struct exp_node *(*pptr)();
+ struct exp_node *(*pptr) P((struct exp_node *));
Regexp *preg;
struct for_loop_header *hd;
struct exp_node **av;
@@ -423,7 +446,7 @@ typedef struct exp_node {
} x;
char *name;
short number;
- unsigned char reflags;
+ unsigned long reflags;
# define CASE 1
# define CONST 2
# define FS_DFLT 4
@@ -442,19 +465,18 @@ typedef struct exp_node {
char *name;
size_t length;
struct exp_node *value;
+ long ref;
} hash;
#define hnext sub.hash.next
#define hname sub.hash.name
#define hlength sub.hash.length
#define hvalue sub.hash.value
- struct {
- struct exp_node *next;
- struct exp_node *name;
- struct exp_node *value;
- } ahash;
-#define ahnext sub.ahash.next
-#define ahname sub.ahash.name
-#define ahvalue sub.ahash.value
+
+#define ahnext sub.hash.next
+#define ahname_str sub.hash.name
+#define ahname_len sub.hash.length
+#define ahvalue sub.hash.value
+#define ahname_ref sub.hash.ref
} sub;
NODETYPE type;
unsigned short flags;
@@ -462,8 +484,8 @@ typedef struct exp_node {
# define TEMP 2 /* should be free'd */
# define PERM 4 /* can't be free'd */
# define STRING 8 /* assigned as string */
-# define STR 16 /* string value is current */
-# define NUM 32 /* numeric value is current */
+# define STRCUR 16 /* string value is current */
+# define NUMCUR 32 /* numeric value is current */
# define NUMBER 64 /* assigned as number */
# define MAYBE_NUM 128 /* user input: if NUMERIC then
* a NUMBER */
@@ -474,12 +496,11 @@ typedef struct exp_node {
# define FIELD 2048 /* this is a field */
# define INTLSTR 4096 /* use localized version */
# define UNINITIALIZED 8192 /* value used before set */
- char *vname;
-#ifndef NO_PROFILING
- long exec_count;
-#endif
} NODE;
+#define vname sub.nodep.name
+#define exec_count sub.nodep.reflags
+
#define lnode sub.nodep.l.lptr
#define nextp sub.nodep.l.lptr
#define rnode sub.nodep.r.rptr
@@ -490,16 +511,15 @@ typedef struct exp_node {
#define parmlist sub.nodep.x.param_list
#define subnode lnode
-#define proc sub.nodep.r.pptr
+#define builtin sub.nodep.r.pptr
#define callresult sub.nodep.x.extra
+#define funcbody sub.nodep.x.extra
#define re_reg sub.nodep.r.preg
#define re_flags sub.nodep.reflags
#define re_text lnode
#define re_exp sub.nodep.x.extra
-#define re_cnt sub.nodep.number
-#define forsub lnode
#define forloop rnode->sub.nodep.r.hd
#define stptr sub.val.sp
@@ -528,24 +548,31 @@ typedef struct for_loop_header {
NODE *incr;
} FOR_LOOP_HEADER;
-/* for faster input, bypass stdio */
typedef struct iobuf {
- const char *name;
- int fd;
- char *buf;
- char *off;
- char *end;
- size_t size; /* this will be determined by an fstat() call */
- int cnt;
- long secsiz;
+ const char *name; /* filename */
+ int fd; /* file descriptor */
+ struct stat sbuf; /* stat buf */
+ char *buf; /* start data buffer */
+ char *off; /* start of current record in buffer */
+ char *dataend; /* first byte in buffer to hold new data,
+ NULL if not read yet */
+ char *end; /* end of buffer */
+ size_t readsize; /* set from fstat call */
+ size_t size; /* buffer size */
+ ssize_t count; /* amount read last time */
+ size_t total; /* total num chars read */
+ size_t scanoff; /* where we were in the buffer when we had
+ to regrow/refill */
int flag;
# define IOP_IS_TTY 1
# define IOP_IS_INTERNAL 2
# define IOP_NO_FREE 4
# define IOP_NOFREE_OBJ 8
+# define IOP_AT_EOF 16
+# define IOP_CLOSED 32
} IOBUF;
-typedef void (*Func_ptr)();
+typedef void (*Func_ptr) P((void));
/* structure used to dynamically maintain a linked-list of open files/pipes */
struct redirect {
@@ -559,8 +586,9 @@ struct redirect {
# define RED_USED 64 /* closed temporarily to reuse fd */
# define RED_EOF 128
# define RED_TWOWAY 256
-# define RED_SOCKET 512
-# define RED_TCP 1024
+# define RED_PTY 512
+# define RED_SOCKET 1024
+# define RED_TCP 2048
char *value;
FILE *fp;
FILE *ifp; /* input fp, needed for PIPES_SIMULATED */
@@ -569,19 +597,23 @@ struct redirect {
int status;
struct redirect *prev;
struct redirect *next;
- char *mode;
+ const char *mode;
};
-/* structure for our source, either a command line string or a source file */
+/*
+ * structure for our source, either a command line string or a source file.
+ * the same structure is used to remember variable pre-assignments.
+ */
struct src {
- enum srctype { CMDLINE = 1, SOURCEFILE } stype;
+ enum srctype { CMDLINE = 1, SOURCEFILE,
+ PRE_ASSIGN, PRE_ASSIGN_FS } stype;
char *val;
};
/* for debugging purposes */
struct flagtab {
int val;
- char *name;
+ const char *name;
};
/* longjmp return codes, must be nonzero */
@@ -640,8 +672,6 @@ extern NODE *nextfree;
extern int field0_valid;
extern int do_traditional;
extern int do_posix;
-extern int do_lint;
-extern int do_lint_old;
extern int do_intervals;
extern int do_intl;
extern int do_non_decimal_data;
@@ -650,6 +680,16 @@ extern int do_tidy_mem;
extern int in_begin_rule;
extern int in_end_rule;
extern int whiny_users;
+#ifdef NO_LINT
+#define do_lint 0
+#define do_lint_old 0
+#else
+extern int do_lint;
+extern int do_lint_old;
+#endif
+#ifdef MBS_SUPPORT
+extern int gawk_mb_cur_max;
+#endif
#if defined (HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0
extern GETGROUPS_T *groupset;
@@ -662,7 +702,7 @@ extern char quote;
extern char *defpath;
extern char envsep;
-extern char casetable[]; /* for case-independent regexp matching */
+extern const char casetable[]; /* for case-independent regexp matching */
/* ------------------------- Pseudo-functions ------------------------- */
@@ -685,6 +725,27 @@ extern char casetable[]; /* for case-independent regexp matching */
#endif /* not PROFILING */
#endif /* not MPROF */
+#ifndef GAWKDEBUG
+#define DUPNODE_MACRO 1
+/*
+ * Speed up the path leading to r_dupnode, as well as duplicating TEMP nodes,
+ * on expense of slowing down the access to PERM nodes (by two instructions).
+ * This is right since PERM nodes are realtively rare.
+ *
+ * The code also sets MALLOC flag for PERM nodes, which should not matter.
+ */
+#define DUPNODE_COMMON (_t->flags & (TEMP|PERM)) != 0 ? \
+ (_t->flags &= ~TEMP, _t->flags |= MALLOC, _t) : \
+ r_dupnode(_t)
+#if __GNUC__ >= 2
+#define dupnode(n) ({NODE * _t = (n); DUPNODE_COMMON;})
+#else
+#define dupnode(n) (_t = (n), DUPNODE_COMMON)
+#endif
+#else /* GAWKDEBUG */
+#define dupnode(n) r_dupnode(n)
+#endif /* GAWKDEBUG */
+
#ifdef MEMDEBUG
#undef freenode
#define get_lhs(p, a, r) r_get_lhs((p), (a), (r))
@@ -695,7 +756,7 @@ extern char casetable[]; /* for case-independent regexp matching */
(&(p)->var_value): \
r_get_lhs((p), (a), (r)))
#if __GNUC__ >= 2
-#define m_tree_eval(t, iscond) \
+#define m_tree_eval(t, iscond) __extension__ \
({NODE * _t = (t); \
if (_t == NULL) \
_t = Nnull_string; \
@@ -731,11 +792,13 @@ extern char casetable[]; /* for case-independent regexp matching */
#endif /* not MEMDEBUG */
#define tree_eval(t) m_tree_eval(t, FALSE)
-#define make_number(x) mk_number((x), (unsigned int)(MALLOC|NUM|NUMBER))
-#define tmp_number(x) mk_number((x), (unsigned int)(MALLOC|TEMP|NUM|NUMBER))
+#define make_number(x) mk_number((x), (unsigned int)(MALLOC|NUMCUR|NUMBER))
+#define tmp_number(x) mk_number((x), (unsigned int)(MALLOC|TEMP|NUMCUR|NUMBER))
+
+#define free_temp(n) do { NODE *_n = (n); if (_n->flags&TEMP) unref(_n);} \
+ while (FALSE)
-#define free_temp(n) do { if ((n)->flags&TEMP) { unref(n); }} while (FALSE)
-#define make_string(s, l) make_str_node((s), (size_t) (l), FALSE)
+#define make_string(s, l) make_str_node((s), (size_t) (l), 0)
#define SCAN 1
#define ALREADY_MALLOCED 2
@@ -744,20 +807,20 @@ extern char casetable[]; /* for case-independent regexp matching */
#ifdef HAVE_STRINGIZE
#define emalloc(var,ty,x,str) (void)((var=(ty)malloc((MALLOC_ARG_T)(x))) ||\
- (fatal(_("%s: %s: can't allocate %d bytes of memory (%s)"),\
- (str), #var, x, strerror(errno)),0))
+ (fatal(_("%s: %s: can't allocate %ld bytes of memory (%s)"),\
+ (str), #var, (long) (x), strerror(errno)),0))
#define erealloc(var,ty,x,str) (void)((var=(ty)realloc((char *)var,\
(MALLOC_ARG_T)(x))) ||\
- (fatal(_("%s: %s: can't allocate %d bytes of memory (%s)"),\
- (str), #var, x, strerror(errno)),0))
+ (fatal(_("%s: %s: can't allocate %ld bytes of memory (%s)"),\
+ (str), #var, (long) (x), strerror(errno)),0))
#else /* HAVE_STRINGIZE */
#define emalloc(var,ty,x,str) (void)((var=(ty)malloc((MALLOC_ARG_T)(x))) ||\
- (fatal(_("%s: %s: can't allocate %d bytes of memory (%s)"),\
- (str), "var", x, strerror(errno)),0))
+ (fatal(_("%s: %s: can't allocate %ld bytes of memory (%s)"),\
+ (str), "var", (long) (x), strerror(errno)),0))
#define erealloc(var,ty,x,str) (void)((var=(ty)realloc((char *)var,\
(MALLOC_ARG_T)(x))) ||\
- (fatal(_("%s: %s: can't allocate %d bytes of memory (%s)"),\
- (str), "var", x, strerror(errno)),0))
+ (fatal(_("%s: %s: can't allocate %ld bytes of memory (%s)"),\
+ (str), "var", (long) (x), strerror(errno)),0))
#endif /* HAVE_STRINGIZE */
#ifdef GAWKDEBUG
@@ -768,26 +831,26 @@ extern char casetable[]; /* for case-independent regexp matching */
extern AWKNUM force_number();
#endif
#if __GNUC__ >= 2
-#define force_number(n) ({NODE *_tn = (n);\
- (_tn->flags & NUM) ?_tn->numbr : r_force_number(_tn);})
-#define force_string(s) ({NODE *_ts = (s);\
+#define force_number(n) __extension__ ({NODE *_tn = (n);\
+ (_tn->flags & NUMCUR) ?_tn->numbr : r_force_number(_tn);})
+#define force_string(s) __extension__ ({NODE *_ts = (s);\
((_ts->flags & INTLSTR) ? \
r_force_string(_ts) : \
- ((_ts->flags & STR) && \
+ ((_ts->flags & STRCUR) && \
(_ts->stfmt == -1 || _ts->stfmt == CONVFMTidx)) ?\
_ts : r_force_string(_ts));})
#else
#ifdef MSDOS
extern double _msc51bug;
#define force_number(n) (_msc51bug=(_t = (n),\
- (_t->flags & NUM) ? _t->numbr : r_force_number(_t)))
+ (_t->flags & NUMCUR) ? _t->numbr : r_force_number(_t)))
#else /* not MSDOS */
#define force_number(n) (_t = (n),\
- (_t->flags & NUM) ? _t->numbr : r_force_number(_t))
+ (_t->flags & NUMCUR) ? _t->numbr : r_force_number(_t))
#endif /* not MSDOS */
#define force_string(s) (_t = (s),(_t->flags & INTLSTR) ? \
r_force_string(_t) :\
- ((_t->flags & STR) && \
+ ((_t->flags & STRCUR) && \
(_t->stfmt == -1 || \
_t->stfmt == CONVFMTidx))? \
_t : r_force_string(_t))
@@ -804,16 +867,18 @@ extern double _msc51bug;
/* ------------- Function prototypes or defs (as appropriate) ------------- */
/* array.c */
+extern void array_init P((void));
extern NODE *concat_exp P((NODE *tree));
extern void assoc_clear P((NODE *symbol));
-extern unsigned int hash P((const char *s, size_t len, unsigned long hsize));
-extern int in_array P((NODE *symbol, NODE *subs));
+extern NODE *in_array P((NODE *symbol, NODE *subs));
extern NODE **assoc_lookup P((NODE *symbol, NODE *subs, int reference));
extern void do_delete P((NODE *symbol, NODE *tree));
extern void do_delete_loop P((NODE *symbol, NODE *tree));
extern NODE *assoc_dump P((NODE *symbol));
extern NODE *do_adump P((NODE *tree));
extern NODE *do_asort P((NODE *tree));
+extern NODE *do_asorti P((NODE *tree));
+extern unsigned long (*hash)P((const char *s, size_t len, unsigned long hsize));
/* awkgram.c */
extern char *tokexpand P((void));
extern NODE *node P((NODE *left, NODETYPE op, NODE *right));
@@ -824,9 +889,9 @@ extern int yyparse P((void));
extern void dump_funcs P((void));
extern void dump_vars P((const char *fname));
extern void release_all_vars P((void));
-extern const char *getfname P((NODE *(*)()));
+extern const char *getfname P((NODE *(*)(NODE *)));
extern NODE *stopme P((NODE *tree));
-extern void shadow_funcs();
+extern void shadow_funcs P((void));
/* builtin.c */
extern double double_to_int P((double d));
extern NODE *do_exp P((NODE *tree));
@@ -845,6 +910,7 @@ extern NODE *do_strftime P((NODE *tree));
extern NODE *do_systime P((NODE *tree));
extern NODE *do_system P((NODE *tree));
extern void do_print P((NODE *tree));
+extern void do_print_rec P((NODE *tree));
extern NODE *do_tolower P((NODE *tree));
extern NODE *do_toupper P((NODE *tree));
extern NODE *do_atan2 P((NODE *tree));
@@ -856,7 +922,7 @@ extern NODE *do_match P((NODE *tree));
extern NODE *do_gsub P((NODE *tree));
extern NODE *do_sub P((NODE *tree));
extern NODE *do_gensub P((NODE *tree));
-extern NODE *format_tree P((const char *, int, NODE *, int));
+extern NODE *format_tree P((const char *, size_t, NODE *, long));
extern NODE *do_lshift P((NODE *tree));
extern NODE *do_rshift P((NODE *tree));
extern NODE *do_and P((NODE *tree));
@@ -886,9 +952,10 @@ extern void set_BINMODE P((void));
extern void set_LINT P((void));
extern void set_TEXTDOMAIN P((void));
extern void update_ERRNO P((void));
-extern char *flags2str P((int));
-extern char *genflags2str P((int flagval, struct flagtab *tab));
-extern char *nodetype2str P((NODETYPE type));
+extern const char *redflags2str P((int));
+extern const char *flags2str P((int));
+extern const char *genflags2str P((int flagval, const struct flagtab *tab));
+extern const char *nodetype2str P((NODETYPE type));
extern NODE *assign_val P((NODE **lhs_p, NODE *rhs));
#ifdef PROFILING
extern void dump_fcall_stack P((FILE *fp));
@@ -902,13 +969,12 @@ void set_value P((NODE *));
#endif
/* field.c */
extern void init_fields P((void));
-extern void set_record P((char *buf, int cnt, int freeold));
+extern void set_record P((const char *buf, int cnt));
extern void reset_record P((void));
extern void set_NF P((void));
extern NODE **get_field P((long num, Func_ptr *assign));
extern NODE *do_split P((NODE *tree));
extern void set_FS P((void));
-extern void set_FS_if_not_FIELDWIDTHS P((void));
extern void set_RS P((void));
extern void set_FIELDWIDTHS P((void));
extern int using_fieldwidths P((void));
@@ -922,7 +988,7 @@ extern int os_isdir P((int fd));
extern int os_is_setuid P((void));
extern int os_setbinmode P((int fd, int mode));
extern void os_restore_mode P((int fd));
-extern int optimal_bufsize P((int fd, struct stat *sbuf));
+extern size_t optimal_bufsize P((int fd, struct stat *sbuf));
extern int ispath P((const char *file));
extern int isdirpunct P((int c));
/* io.c */
@@ -936,31 +1002,34 @@ extern int close_io P((void));
extern int devopen P((const char *name, const char *mode));
extern int pathopen P((const char *file));
extern NODE *do_getline P((NODE *tree));
-extern void do_nextfile P((void));
-extern struct redirect *getredirect P((char *str, int len));
+extern void do_nextfile P((void)) ATTRIBUTE_NORETURN;
+extern struct redirect *getredirect P((const char *str, int len));
/* main.c */
extern int main P((int argc, char **argv));
-extern void load_environ P((void));
-extern void load_procinfo P((void));
-extern char *arg_assign P((char *arg));
-extern RETSIGTYPE catchsig P((int sig, int code));
+extern NODE *load_environ P((void));
+extern NODE *load_procinfo P((void));
+extern int arg_assign P((char *arg, int initing));
/* msg.c */
-extern void err P((const char *s, const char *emsg, va_list argp));
+extern void err P((const char *s, const char *emsg, va_list argp)) ATTRIBUTE_PRINTF(2, 0);
#if _MSC_VER == 510
extern void msg P((va_list va_alist, ...));
extern void error P((va_list va_alist, ...));
extern void warning P((va_list va_alist, ...));
-extern void set_loc P((char *file, int line));
+extern void set_loc P((const char *file, int line));
extern void r_fatal P((va_list va_alist, ...));
extern void (*lintfunc) P((va_list va_alist, ...));
#else
#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
-extern void msg (char *mesg, ...);
-extern void error (char *mesg, ...);
-extern void warning (char *mesg, ...);
-extern void set_loc (char *file, int line);
-extern void r_fatal (char *mesg, ...);
-extern void (*lintfunc) (char *mesg, ...);
+extern void msg (const char *mesg, ...) ATTRIBUTE_PRINTF_1;
+extern void error (const char *mesg, ...) ATTRIBUTE_PRINTF_1;
+extern void warning (const char *mesg, ...) ATTRIBUTE_PRINTF_1;
+extern void set_loc (const char *file, int line);
+extern void r_fatal (const char *mesg, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+extern void (*lintfunc) (const char *mesg, ...) ATTRIBUTE_PRINTF_1;
+#else
+extern void (*lintfunc) (const char *mesg, ...);
+#endif
#else
extern void msg ();
extern void error ();
@@ -975,35 +1044,35 @@ extern void init_profiling P((int *flag, const char *def_file));
extern void init_profiling_signals P((void));
extern void set_prof_file P((const char *filename));
extern void dump_prog P((NODE *begin, NODE *prog, NODE *end));
-extern void pp_func P((char *name, size_t namelen, NODE *f));
-extern void pp_string_fp P((FILE *fp, char *str, size_t namelen,
+extern void pp_func P((const char *name, size_t namelen, NODE *f));
+extern void pp_string_fp P((FILE *fp, const char *str, size_t namelen,
int delim, int breaklines));
/* node.c */
extern AWKNUM r_force_number P((NODE *n));
-extern NODE *format_val P((char *format, int index, NODE *s));
+extern NODE *format_val P((const char *format, int index, NODE *s));
extern NODE *r_force_string P((NODE *s));
-extern NODE *dupnode P((NODE *n));
+extern NODE *r_dupnode P((NODE *n));
extern NODE *copynode P((NODE *n));
extern NODE *mk_number P((AWKNUM x, unsigned int flags));
-extern NODE *make_str_node P((char *s, size_t len, int scan ));
+extern NODE *make_str_node P((char *s, unsigned long len, int scan ));
extern NODE *tmp_string P((char *s, size_t len ));
extern NODE *more_nodes P((void));
#ifdef MEMDEBUG
extern void freenode P((NODE *it));
#endif
extern void unref P((NODE *tmp));
-extern int parse_escape P((char **string_ptr));
+extern int parse_escape P((const char **string_ptr));
/* re.c */
-extern Regexp *make_regexp P((char *s, size_t len, int ignorecase, int dfa));
-extern int research P((Regexp *rp, char *str, int start,
+extern Regexp *make_regexp P((const char *s, size_t len, int ignorecase));
+extern int research P((Regexp *rp, const char *str, int start,
size_t len, int need_start));
extern void refree P((Regexp *rp));
extern void reg_error P((const char *s));
extern Regexp *re_update P((NODE *t));
extern void resyntax P((int syntax));
extern void resetup P((void));
-extern int avoid_dfa P((NODE *re, char *str, size_t len)); /* temporary */
-extern int reisstring P((char *text, size_t len, Regexp *re, char *buf));
+extern int reisstring P((const char *text, size_t len, Regexp *re, const char *buf));
+extern int remaybelong P((const char *text, size_t len));
/* strncasecmp.c */
#ifndef BROKEN_STRNCASECMP
@@ -1025,6 +1094,13 @@ extern char *tempnam P((const char *path, const char *base));
#define INVALID_HANDLE (-1)
#endif /* atarist */
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((((unsigned) (stat_val)) >> 8) & 0xFF)
+#endif
+
#ifndef STATIC
#define STATIC static
#endif
diff --git a/awkgram.c b/awkgram.c
index 4a7d4af5..d11b4a54 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -1,49 +1,147 @@
+/* A Bison parser, made by GNU Bison 1.875. */
-/* A Bison parser, made from awkgram.y
- by GNU Bison version 1.28 */
-
-#define YYBISON 1 /* Identify Bison output. */
-
-#define FUNC_CALL 257
-#define NAME 258
-#define REGEXP 259
-#define ERROR 260
-#define YNUMBER 261
-#define YSTRING 262
-#define RELOP 263
-#define APPEND_OP 264
-#define ASSIGNOP 265
-#define MATCHOP 266
-#define NEWLINE 267
-#define CONCAT_OP 268
-#define LEX_BEGIN 269
-#define LEX_END 270
-#define LEX_IF 271
-#define LEX_ELSE 272
-#define LEX_RETURN 273
-#define LEX_DELETE 274
-#define LEX_WHILE 275
-#define LEX_DO 276
-#define LEX_FOR 277
-#define LEX_BREAK 278
-#define LEX_CONTINUE 279
-#define LEX_PRINT 280
-#define LEX_PRINTF 281
-#define LEX_NEXT 282
-#define LEX_EXIT 283
-#define LEX_FUNCTION 284
-#define LEX_GETLINE 285
-#define LEX_NEXTFILE 286
-#define LEX_IN 287
-#define LEX_AND 288
-#define LEX_OR 289
-#define INCREMENT 290
-#define DECREMENT 291
-#define LEX_BUILTIN 292
-#define LEX_LENGTH 293
-#define TWOWAYIO 294
-#define UNARY 295
+/* Skeleton parser for Yacc-like parsing with Bison,
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+/* Written by Richard Stallman by simplifying the original so called
+ ``semantic'' parser. */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+ infringing on user name space. This should be done even for local
+ variables, as they might otherwise be expanded by user macros.
+ There are some unavoidable exceptions within include files to
+ define necessary library symbols; they are noted "INFRINGES ON
+ USER NAME SPACE" below. */
+
+/* Identify Bison output. */
+#define YYBISON 1
+
+/* Skeleton name. */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers. */
+#define YYPURE 0
+
+/* Using locations. */
+#define YYLSP_NEEDED 0
+
+
+
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ FUNC_CALL = 258,
+ NAME = 259,
+ REGEXP = 260,
+ ERROR = 261,
+ YNUMBER = 262,
+ YSTRING = 263,
+ RELOP = 264,
+ IO_OUT = 265,
+ IO_IN = 266,
+ ASSIGNOP = 267,
+ ASSIGN = 268,
+ MATCHOP = 269,
+ CONCAT_OP = 270,
+ LEX_BEGIN = 271,
+ LEX_END = 272,
+ LEX_IF = 273,
+ LEX_ELSE = 274,
+ LEX_RETURN = 275,
+ LEX_DELETE = 276,
+ LEX_WHILE = 277,
+ LEX_DO = 278,
+ LEX_FOR = 279,
+ LEX_BREAK = 280,
+ LEX_CONTINUE = 281,
+ LEX_PRINT = 282,
+ LEX_PRINTF = 283,
+ LEX_NEXT = 284,
+ LEX_EXIT = 285,
+ LEX_FUNCTION = 286,
+ LEX_GETLINE = 287,
+ LEX_NEXTFILE = 288,
+ LEX_IN = 289,
+ LEX_AND = 290,
+ LEX_OR = 291,
+ INCREMENT = 292,
+ DECREMENT = 293,
+ LEX_BUILTIN = 294,
+ LEX_LENGTH = 295,
+ NEWLINE = 296,
+ SLASH_BEFORE_EQUAL = 297,
+ UNARY = 298
+ };
+#endif
+#define FUNC_CALL 258
+#define NAME 259
+#define REGEXP 260
+#define ERROR 261
+#define YNUMBER 262
+#define YSTRING 263
+#define RELOP 264
+#define IO_OUT 265
+#define IO_IN 266
+#define ASSIGNOP 267
+#define ASSIGN 268
+#define MATCHOP 269
+#define CONCAT_OP 270
+#define LEX_BEGIN 271
+#define LEX_END 272
+#define LEX_IF 273
+#define LEX_ELSE 274
+#define LEX_RETURN 275
+#define LEX_DELETE 276
+#define LEX_WHILE 277
+#define LEX_DO 278
+#define LEX_FOR 279
+#define LEX_BREAK 280
+#define LEX_CONTINUE 281
+#define LEX_PRINT 282
+#define LEX_PRINTF 283
+#define LEX_NEXT 284
+#define LEX_EXIT 285
+#define LEX_FUNCTION 286
+#define LEX_GETLINE 287
+#define LEX_NEXTFILE 288
+#define LEX_IN 289
+#define LEX_AND 290
+#define LEX_OR 291
+#define INCREMENT 292
+#define DECREMENT 293
+#define LEX_BUILTIN 294
+#define LEX_LENGTH 295
+#define NEWLINE 296
+#define SLASH_BEFORE_EQUAL 297
+#define UNARY 298
+
+
+
+
+/* Copy the first part of user declarations. */
#line 26 "awkgram.y"
#ifdef GAWKDEBUG
@@ -56,7 +154,7 @@
#define DONT_FREE FALSE
#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
-static void yyerror(const char *m, ...) ;
+static void yyerror(const char *m, ...) ATTRIBUTE_PRINTF_1;
#else
static void yyerror(); /* va_alist */
#endif
@@ -64,9 +162,9 @@ 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 *mkrangenode P((NODE *cpair));
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));
@@ -74,22 +172,23 @@ 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 void parms_shadow P((const char *fname, NODE *func));
+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((char *str, size_t len));
-static void dumpintlstr2 P((char *str1, size_t len1, char *str2, size_t len2));
+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));
enum defref { FUNC_DEFINE, FUNC_USE };
-static void func_use P((char *name, enum defref how));
+static void func_use P((const char *name, enum defref how));
static void check_funcs P((void));
-static int want_assign; /* lexical scanning kludge */
static int want_regexp; /* lexical scanning kludge */
-static int can_return; /* lexical scanning kludge */
-static int io_allowed = TRUE; /* 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 */
@@ -115,993 +214,1101 @@ extern int errcount;
extern NODE *begin_block;
extern NODE *end_block;
-#line 97 "awkgram.y"
-typedef union {
+/*
+ * 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";
+
+
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 109 "awkgram.y"
+typedef union YYSTYPE {
long lval;
AWKNUM fval;
NODE *nodeval;
NODETYPE nodetypeval;
char *sval;
- NODE *(*ptrval)();
+ NODE *(*ptrval) P((void));
} YYSTYPE;
-#include <stdio.h>
-
-#ifndef __cplusplus
-#ifndef __STDC__
-#define const
-#endif
+/* Line 191 of yacc.c. */
+#line 253 "y.tab.c"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
#endif
-#define YYFINAL 318
-#define YYFLAG -32768
-#define YYNTBASE 63
-
-#define YYTRANSLATE(x) ((unsigned)(x) <= 295 ? yytranslate[x] : 110)
-
-static const char yytranslate[] = { 0,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 52, 2, 2, 55, 51, 2, 2, 56,
- 57, 49, 47, 42, 48, 2, 50, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 41, 62, 43,
- 2, 44, 40, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 58, 2, 59, 54, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 60, 45, 61, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
- 37, 38, 39, 46, 53
-};
+/* Copy the second part of user declarations. */
-#if YYDEBUG != 0
-static const short yyprhs[] = { 0,
- 0, 4, 6, 9, 11, 14, 15, 16, 20, 21,
- 25, 28, 31, 34, 36, 39, 42, 44, 46, 48,
- 50, 52, 53, 61, 67, 72, 74, 78, 79, 84,
- 90, 95, 97, 100, 102, 105, 107, 110, 113, 116,
- 120, 122, 129, 138, 147, 160, 172, 175, 178, 181,
- 184, 188, 189, 194, 197, 203, 207, 213, 216, 218,
- 219, 221, 223, 225, 232, 242, 244, 247, 248, 250,
- 251, 254, 255, 258, 261, 264, 267, 268, 270, 272,
- 276, 278, 281, 285, 286, 288, 289, 291, 293, 297,
- 299, 302, 306, 310, 311, 313, 315, 319, 321, 324,
- 328, 332, 333, 338, 344, 349, 354, 358, 362, 366,
- 370, 372, 375, 379, 383, 387, 391, 397, 399, 402,
- 403, 408, 412, 416, 420, 422, 425, 429, 433, 437,
- 443, 445, 448, 450, 454, 458, 462, 466, 470, 474,
- 477, 480, 483, 487, 492, 497, 499, 504, 506, 509,
- 512, 514, 516, 519, 522, 523, 525, 527, 532, 535,
- 538, 541, 543, 544, 546, 548
-};
-static const short yyrhs[] = { 86,
- 64, 86, 0, 65, 0, 64, 65, 0, 1, 0,
- 64, 1, 0, 0, 0, 15, 66, 76, 0, 0,
- 16, 67, 76, 0, 15, 78, 0, 16, 78, 0,
- 73, 76, 0, 76, 0, 73, 78, 0, 70, 72,
- 0, 4, 0, 3, 0, 69, 0, 38, 0, 39,
- 0, 0, 30, 71, 68, 56, 89, 106, 86, 0,
- 104, 77, 105, 107, 86, 0, 104, 105, 107, 86,
- 0, 96, 0, 96, 42, 96, 0, 0, 50, 75,
- 5, 50, 0, 104, 77, 105, 107, 86, 0, 104,
- 105, 107, 86, 0, 79, 0, 77, 79, 0, 1,
- 0, 77, 1, 0, 85, 0, 108, 86, 0, 108,
- 86, 0, 104, 105, 0, 104, 77, 105, 0, 84,
- 0, 21, 56, 96, 106, 86, 79, 0, 22, 86,
- 79, 21, 56, 96, 106, 86, 0, 23, 56, 4,
- 33, 4, 106, 86, 79, 0, 23, 56, 82, 108,
- 86, 96, 108, 86, 82, 106, 86, 79, 0, 23,
- 56, 82, 108, 86, 108, 86, 82, 106, 86, 79,
- 0, 24, 78, 0, 25, 78, 0, 28, 78, 0,
- 32, 78, 0, 29, 91, 78, 0, 0, 19, 80,
- 91, 78, 0, 81, 78, 0, 83, 56, 95, 106,
- 88, 0, 83, 92, 88, 0, 20, 4, 58, 95,
- 59, 0, 20, 4, 0, 96, 0, 0, 81, 0,
- 26, 0, 27, 0, 17, 56, 96, 106, 86, 79,
- 0, 17, 56, 96, 106, 86, 79, 18, 86, 79,
- 0, 13, 0, 85, 13, 0, 0, 85, 0, 0,
- 43, 100, 0, 0, 44, 96, 0, 10, 96, 0,
- 45, 96, 0, 46, 96, 0, 0, 90, 0, 4,
- 0, 90, 109, 4, 0, 1, 0, 90, 1, 0,
- 90, 109, 1, 0, 0, 96, 0, 0, 93, 0,
- 98, 0, 93, 109, 98, 0, 1, 0, 93, 1,
- 0, 93, 1, 98, 0, 93, 109, 1, 0, 0,
- 95, 0, 96, 0, 95, 109, 96, 0, 1, 0,
- 95, 1, 0, 95, 1, 96, 0, 95, 109, 1,
- 0, 0, 103, 11, 97, 96, 0, 56, 95, 106,
- 33, 4, 0, 96, 45, 31, 102, 0, 96, 46,
- 31, 102, 0, 31, 102, 87, 0, 96, 34, 96,
- 0, 96, 35, 96, 0, 96, 12, 96, 0, 74,
- 0, 52, 74, 0, 96, 33, 4, 0, 96, 9,
- 96, 0, 96, 43, 96, 0, 96, 44, 96, 0,
- 96, 40, 96, 41, 96, 0, 100, 0, 96, 100,
- 0, 0, 103, 11, 99, 98, 0, 98, 34, 98,
- 0, 98, 35, 98, 0, 31, 102, 87, 0, 74,
- 0, 52, 74, 0, 98, 12, 98, 0, 98, 33,
- 4, 0, 98, 9, 98, 0, 98, 40, 98, 41,
- 98, 0, 100, 0, 98, 100, 0, 101, 0, 100,
- 54, 100, 0, 100, 49, 100, 0, 100, 50, 100,
- 0, 100, 51, 100, 0, 100, 47, 100, 0, 100,
- 48, 100, 0, 103, 36, 0, 103, 37, 0, 52,
- 100, 0, 56, 96, 106, 0, 38, 56, 94, 106,
- 0, 39, 56, 94, 106, 0, 39, 0, 3, 56,
- 94, 106, 0, 103, 0, 36, 103, 0, 37, 103,
- 0, 7, 0, 8, 0, 48, 100, 0, 47, 100,
- 0, 0, 103, 0, 4, 0, 4, 58, 95, 59,
- 0, 55, 101, 0, 60, 86, 0, 61, 86, 0,
- 57, 0, 0, 108, 0, 62, 0, 42, 86, 0
-};
+/* Line 214 of yacc.c. */
+#line 265 "y.tab.c"
-#endif
+#if ! defined (yyoverflow) || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols. */
+
+#undef YYSTACK_USE_ALLOCA /* Gawk: nuke alloca once and for all */
+
+# if YYSTACK_USE_ALLOCA
+# define YYSTACK_ALLOC alloca
+# else
+# ifndef YYSTACK_USE_ALLOCA
+# if defined (alloca) || defined (_ALLOCA_H)
+# define YYSTACK_ALLOC alloca
+# else
+# ifdef __GNUC__
+# define YYSTACK_ALLOC __builtin_alloca
+# endif
+# endif
+# endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+ /* Pacify GCC's `empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# else
+# if defined (__STDC__) || defined (__cplusplus)
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
+# define YYSTACK_ALLOC malloc
+# define YYSTACK_FREE free
+# endif
+#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+
+
+#if (! defined (yyoverflow) \
+ && (! defined (__cplusplus) \
+ || (YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member. */
+union yyalloc
+{
+ short yyss;
+ YYSTYPE yyvs;
+ };
+
+/* The size of the maximum gap between one aligned stack and the next. */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+ N elements. */
+# define YYSTACK_BYTES(N) \
+ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
+ + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if 1 < __GNUC__
+# define YYCOPY(To, From, Count) \
+ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+# else
+# define YYCOPY(To, From, Count) \
+ do \
+ { \
+ register YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (To)[yyi] = (From)[yyi]; \
+ } \
+ while (0)
+# endif
+# endif
+
+/* Relocate STACK from its old location to the new one. The
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
+ elements in the stack, and YYPTR gives the new location of the
+ stack. Advance YYPTR to a properly aligned location for the next
+ stack. */
+# define YYSTACK_RELOCATE(Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack, Stack, yysize); \
+ Stack = &yyptr->Stack; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (0)
-#if YYDEBUG != 0
-static const short yyrline[] = { 0,
- 159, 167, 175, 191, 192, 193, 197, 199, 213, 215,
- 230, 236, 242, 244, 246, 259, 268, 270, 272, 282,
- 283, 287, 291, 306, 311, 320, 322, 331, 333, 351,
- 353, 358, 364, 372, 374, 379, 380, 384, 386, 388,
- 390, 392, 394, 396, 436, 440, 445, 448, 451, 459,
- 478, 480, 485, 487, 499, 505, 527, 529, 543, 548,
- 550, 555, 557, 562, 567, 574, 576, 580, 581, 585,
- 587, 592, 594, 596, 598, 600, 610, 612, 617, 619,
- 621, 623, 625, 631, 633, 638, 640, 645, 647, 653,
- 655, 657, 659, 664, 666, 671, 673, 679, 681, 683,
- 685, 690, 693, 698, 700, 705, 710, 716, 718, 720,
- 726, 736, 744, 746, 752, 754, 756, 758, 760, 765,
- 768, 769, 771, 773, 779, 781, 783, 785, 787, 789,
- 791, 793, 798, 800, 802, 804, 806, 808, 810, 812,
- 814, 819, 821, 823, 826, 828, 836, 843, 844, 846,
- 848, 850, 853, 861, 872, 874, 879, 881, 891, 896,
- 900, 904, 908, 909, 913, 916
-};
#endif
+#if defined (__STDC__) || defined (__cplusplus)
+ typedef signed char yysigned_char;
+#else
+ typedef short yysigned_char;
+#endif
-#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
-
-static const char * const yytname[] = { "$","error","$undefined.","FUNC_CALL",
-"NAME","REGEXP","ERROR","YNUMBER","YSTRING","RELOP","APPEND_OP","ASSIGNOP","MATCHOP",
-"NEWLINE","CONCAT_OP","LEX_BEGIN","LEX_END","LEX_IF","LEX_ELSE","LEX_RETURN",
-"LEX_DELETE","LEX_WHILE","LEX_DO","LEX_FOR","LEX_BREAK","LEX_CONTINUE","LEX_PRINT",
-"LEX_PRINTF","LEX_NEXT","LEX_EXIT","LEX_FUNCTION","LEX_GETLINE","LEX_NEXTFILE",
-"LEX_IN","LEX_AND","LEX_OR","INCREMENT","DECREMENT","LEX_BUILTIN","LEX_LENGTH",
-"'?'","':'","','","'<'","'>'","'|'","TWOWAYIO","'+'","'-'","'*'","'/'","'%'",
-"'!'","UNARY","'^'","'$'","'('","')'","'['","']'","'{'","'}'","';'","start",
-"program","rule","@1","@2","func_name","lex_builtin","function_prologue","@3",
-"function_body","pattern","regexp","@4","action","statements","statement_term",
-"statement","@5","simple_stmt","opt_simple_stmt","print","if_statement","nls",
-"opt_nls","input_redir","output_redir","opt_param_list","param_list","opt_exp",
-"opt_rexpression_list","rexpression_list","opt_expression_list","expression_list",
-"exp","@6","rexp","@7","simp_exp","non_post_simp_exp","opt_variable","variable",
-"l_brace","r_brace","r_paren","opt_semi","semi","comma", NULL
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL 5
+/* YYLAST -- Last index in YYTABLE. */
+#define YYLAST 878
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS 64
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS 48
+/* YYNRULES -- Number of rules. */
+#define YYNRULES 142
+/* YYNRULES -- Number of states. */
+#define YYNSTATES 264
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+#define YYUNDEFTOK 2
+#define YYMAXUTOK 298
+
+#define YYTRANSLATE(YYX) \
+ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
+static const unsigned char yytranslate[] =
+{
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 53, 2, 2, 56, 52, 2, 2,
+ 57, 58, 50, 48, 45, 49, 2, 51, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 44, 63,
+ 46, 2, 47, 43, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 59, 2, 60, 55, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 61, 2, 62, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42, 54
};
-#endif
-static const short yyr1[] = { 0,
- 63, 64, 64, 64, 64, 64, 66, 65, 67, 65,
- 65, 65, 65, 65, 65, 65, 68, 68, 68, 69,
- 69, 71, 70, 72, 72, 73, 73, 75, 74, 76,
- 76, 77, 77, 77, 77, 78, 78, 79, 79, 79,
- 79, 79, 79, 79, 79, 79, 79, 79, 79, 79,
- 79, 80, 79, 79, 81, 81, 81, 81, 81, 82,
- 82, 83, 83, 84, 84, 85, 85, 86, 86, 87,
- 87, 88, 88, 88, 88, 88, 89, 89, 90, 90,
- 90, 90, 90, 91, 91, 92, 92, 93, 93, 93,
- 93, 93, 93, 94, 94, 95, 95, 95, 95, 95,
- 95, 97, 96, 96, 96, 96, 96, 96, 96, 96,
- 96, 96, 96, 96, 96, 96, 96, 96, 96, 99,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 100, 100, 100, 100, 100, 100, 100, 100,
- 100, 101, 101, 101, 101, 101, 101, 101, 101, 101,
- 101, 101, 101, 101, 102, 102, 103, 103, 103, 104,
- 105, 106, 107, 107, 108, 109
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+ YYRHS. */
+static const unsigned short yyprhs[] =
+{
+ 0, 0, 3, 7, 8, 11, 14, 17, 20, 23,
+ 24, 26, 30, 32, 34, 40, 42, 44, 46, 48,
+ 50, 51, 59, 60, 64, 66, 68, 69, 72, 75,
+ 77, 80, 83, 87, 89, 96, 105, 114, 127, 139,
+ 142, 145, 148, 151, 155, 156, 161, 164, 165, 170,
+ 176, 179, 184, 186, 187, 189, 191, 193, 195, 201,
+ 202, 203, 207, 214, 224, 226, 229, 230, 232, 233,
+ 236, 237, 239, 241, 245, 247, 250, 254, 255, 257,
+ 258, 260, 262, 266, 268, 271, 275, 279, 283, 287,
+ 291, 295, 299, 303, 309, 311, 313, 315, 318, 320,
+ 322, 324, 326, 328, 331, 337, 339, 342, 344, 348,
+ 352, 356, 360, 364, 368, 372, 377, 380, 383, 386,
+ 390, 395, 400, 402, 407, 409, 412, 415, 417, 419,
+ 422, 425, 426, 428, 430, 435, 438, 441, 444, 446,
+ 447, 449, 451
};
-static const short yyr2[] = { 0,
- 3, 1, 2, 1, 2, 0, 0, 3, 0, 3,
- 2, 2, 2, 1, 2, 2, 1, 1, 1, 1,
- 1, 0, 7, 5, 4, 1, 3, 0, 4, 5,
- 4, 1, 2, 1, 2, 1, 2, 2, 2, 3,
- 1, 6, 8, 8, 12, 11, 2, 2, 2, 2,
- 3, 0, 4, 2, 5, 3, 5, 2, 1, 0,
- 1, 1, 1, 6, 9, 1, 2, 0, 1, 0,
- 2, 0, 2, 2, 2, 2, 0, 1, 1, 3,
- 1, 2, 3, 0, 1, 0, 1, 1, 3, 1,
- 2, 3, 3, 0, 1, 1, 3, 1, 2, 3,
- 3, 0, 4, 5, 4, 4, 3, 3, 3, 3,
- 1, 2, 3, 3, 3, 3, 5, 1, 2, 0,
- 4, 3, 3, 3, 1, 2, 3, 3, 3, 5,
- 1, 2, 1, 3, 3, 3, 3, 3, 3, 2,
- 2, 2, 3, 4, 4, 1, 4, 1, 2, 2,
- 1, 1, 2, 2, 0, 1, 1, 4, 2, 2,
- 2, 1, 0, 1, 1, 2
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yysigned_char yyrhs[] =
+{
+ 65, 0, -1, 90, 66, 90, -1, -1, 66, 67,
+ -1, 66, 1, -1, 68, 69, -1, 68, 78, -1,
+ 72, 69, -1, -1, 97, -1, 97, 45, 97, -1,
+ 16, -1, 17, -1, 106, 77, 107, 109, 90, -1,
+ 4, -1, 3, -1, 71, -1, 39, -1, 40, -1,
+ -1, 31, 73, 70, 57, 92, 108, 90, -1, -1,
+ 76, 75, 5, -1, 51, -1, 42, -1, -1, 77,
+ 79, -1, 77, 1, -1, 89, -1, 110, 90, -1,
+ 110, 90, -1, 106, 77, 107, -1, 88, -1, 22,
+ 57, 97, 108, 90, 79, -1, 23, 90, 79, 22,
+ 57, 97, 108, 90, -1, 24, 57, 4, 34, 4,
+ 108, 90, 79, -1, 24, 57, 83, 110, 90, 97,
+ 110, 90, 83, 108, 90, 79, -1, 24, 57, 83,
+ 110, 90, 110, 90, 83, 108, 90, 79, -1, 25,
+ 78, -1, 26, 78, -1, 29, 78, -1, 33, 78,
+ -1, 30, 94, 78, -1, -1, 20, 80, 94, 78,
+ -1, 81, 78, -1, -1, 84, 82, 85, 86, -1,
+ 21, 4, 59, 96, 60, -1, 21, 4, -1, 21,
+ 57, 4, 58, -1, 97, -1, -1, 81, -1, 27,
+ -1, 28, -1, 95, -1, 57, 97, 111, 96, 108,
+ -1, -1, -1, 10, 87, 101, -1, 18, 57, 97,
+ 108, 90, 79, -1, 18, 57, 97, 108, 90, 79,
+ 19, 90, 79, -1, 41, -1, 89, 41, -1, -1,
+ 89, -1, -1, 46, 102, -1, -1, 93, -1, 4,
+ -1, 93, 111, 4, -1, 1, -1, 93, 1, -1,
+ 93, 111, 1, -1, -1, 97, -1, -1, 96, -1,
+ 97, -1, 96, 111, 97, -1, 1, -1, 96, 1,
+ -1, 96, 1, 97, -1, 96, 111, 1, -1, 105,
+ 98, 97, -1, 97, 35, 97, -1, 97, 36, 97,
+ -1, 97, 14, 97, -1, 97, 34, 4, -1, 97,
+ 100, 97, -1, 97, 43, 97, 44, 97, -1, 101,
+ -1, 13, -1, 12, -1, 42, 13, -1, 9, -1,
+ 46, -1, 99, -1, 47, -1, 74, -1, 53, 74,
+ -1, 57, 96, 108, 34, 4, -1, 102, -1, 101,
+ 102, -1, 103, -1, 102, 55, 102, -1, 102, 50,
+ 102, -1, 102, 51, 102, -1, 102, 52, 102, -1,
+ 102, 48, 102, -1, 102, 49, 102, -1, 32, 104,
+ 91, -1, 102, 11, 32, 104, -1, 105, 37, -1,
+ 105, 38, -1, 53, 102, -1, 57, 97, 108, -1,
+ 39, 57, 95, 108, -1, 40, 57, 95, 108, -1,
+ 40, -1, 3, 57, 95, 108, -1, 105, -1, 37,
+ 105, -1, 38, 105, -1, 7, -1, 8, -1, 49,
+ 102, -1, 48, 102, -1, -1, 105, -1, 4, -1,
+ 4, 59, 96, 60, -1, 56, 103, -1, 61, 90,
+ -1, 62, 90, -1, 58, -1, -1, 110, -1, 63,
+ -1, 45, 90, -1
};
-static const short yydefact[] = { 68,
- 66, 69, 0, 67, 4, 0, 157, 151, 152, 7,
- 9, 22, 155, 0, 0, 0, 146, 0, 0, 28,
- 0, 0, 0, 68, 0, 2, 0, 0, 111, 14,
- 26, 118, 133, 148, 0, 0, 0, 165, 0, 11,
- 36, 68, 0, 12, 0, 70, 156, 149, 150, 0,
- 0, 0, 0, 154, 148, 153, 0, 112, 142, 159,
- 148, 98, 0, 96, 160, 5, 3, 1, 16, 0,
- 13, 15, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 119, 0, 0, 0, 0, 0, 0,
- 102, 140, 141, 34, 0, 52, 0, 0, 68, 0,
- 0, 0, 62, 63, 0, 84, 0, 68, 0, 32,
- 0, 0, 41, 59, 0, 163, 68, 0, 0, 96,
- 0, 8, 37, 10, 18, 17, 20, 21, 0, 19,
- 0, 107, 0, 0, 0, 0, 99, 68, 162, 0,
- 0, 143, 0, 163, 114, 110, 113, 108, 109, 0,
- 27, 115, 116, 155, 155, 138, 139, 135, 136, 137,
- 134, 0, 0, 84, 58, 0, 0, 60, 47, 48,
- 49, 0, 85, 50, 161, 35, 33, 163, 54, 90,
- 155, 0, 0, 125, 72, 0, 88, 131, 148, 0,
- 39, 68, 164, 38, 147, 158, 0, 71, 144, 145,
- 29, 100, 166, 0, 101, 97, 163, 68, 0, 105,
- 106, 103, 0, 0, 0, 0, 0, 157, 61, 0,
- 51, 68, 70, 126, 0, 0, 0, 0, 0, 56,
- 91, 0, 0, 0, 0, 0, 0, 0, 132, 120,
- 40, 31, 81, 79, 0, 0, 104, 68, 25, 117,
- 68, 53, 0, 68, 0, 0, 68, 30, 124, 72,
- 74, 73, 75, 76, 92, 93, 89, 129, 127, 128,
- 122, 123, 0, 0, 68, 82, 0, 24, 0, 57,
- 0, 0, 0, 0, 55, 0, 121, 23, 83, 80,
- 64, 42, 0, 68, 0, 68, 130, 68, 68, 0,
- 68, 60, 0, 43, 44, 60, 0, 65, 0, 68,
- 68, 0, 0, 46, 45, 0, 0, 0
+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+static const unsigned short yyrline[] =
+{
+ 0, 170, 170, 176, 178, 183, 196, 200, 215, 226,
+ 229, 233, 243, 248, 256, 261, 263, 265, 276, 277,
+ 282, 281, 305, 304, 327, 328, 333, 334, 352, 357,
+ 358, 362, 364, 366, 368, 370, 372, 412, 416, 421,
+ 424, 427, 436, 456, 459, 458, 465, 477, 477, 508,
+ 510, 524, 539, 545, 546, 551, 552, 560, 561, 567,
+ 572, 572, 583, 588, 595, 596, 599, 601, 606, 607,
+ 613, 614, 619, 621, 623, 625, 627, 634, 635, 641,
+ 642, 647, 649, 655, 657, 659, 661, 666, 672, 674,
+ 676, 682, 684, 690, 692, 697, 699, 701, 706, 708,
+ 712, 713, 718, 720, 728, 730, 732, 737, 739, 741,
+ 743, 745, 747, 749, 751, 757, 762, 764, 769, 771,
+ 773, 776, 778, 786, 794, 795, 797, 799, 801, 804,
+ 812, 824, 825, 830, 832, 842, 847, 851, 855, 858,
+ 860, 864, 867
};
+#endif
-static const short yydefgoto[] = { 316,
- 25, 26, 39, 43, 129, 130, 27, 45, 69, 28,
- 29, 57, 30, 109, 40, 110, 164, 111, 220, 112,
- 113, 2, 3, 132, 230, 245, 246, 172, 185, 186,
- 118, 119, 114, 162, 187, 274, 32, 33, 46, 34,
- 115, 116, 142, 192, 117, 141
+#if YYDEBUG || YYERROR_VERBOSE
+/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+ "$end", "error", "$undefined", "FUNC_CALL", "NAME", "REGEXP", "ERROR",
+ "YNUMBER", "YSTRING", "RELOP", "IO_OUT", "IO_IN", "ASSIGNOP", "ASSIGN",
+ "MATCHOP", "CONCAT_OP", "LEX_BEGIN", "LEX_END", "LEX_IF", "LEX_ELSE",
+ "LEX_RETURN", "LEX_DELETE", "LEX_WHILE", "LEX_DO", "LEX_FOR",
+ "LEX_BREAK", "LEX_CONTINUE", "LEX_PRINT", "LEX_PRINTF", "LEX_NEXT",
+ "LEX_EXIT", "LEX_FUNCTION", "LEX_GETLINE", "LEX_NEXTFILE", "LEX_IN",
+ "LEX_AND", "LEX_OR", "INCREMENT", "DECREMENT", "LEX_BUILTIN",
+ "LEX_LENGTH", "NEWLINE", "SLASH_BEFORE_EQUAL", "'?'", "':'", "','",
+ "'<'", "'>'", "'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "UNARY", "'^'",
+ "'$'", "'('", "')'", "'['", "']'", "'{'", "'}'", "';'", "$accept",
+ "start", "program", "rule", "pattern", "action", "func_name",
+ "lex_builtin", "function_prologue", "@1", "regexp", "@2", "a_slash",
+ "statements", "statement_term", "statement", "@3", "simple_stmt", "@4",
+ "opt_simple_stmt", "print", "print_expression_list", "output_redir",
+ "@5", "if_statement", "nls", "opt_nls", "input_redir", "opt_param_list",
+ "param_list", "opt_exp", "opt_expression_list", "expression_list",
+ "exp", "assign_operator", "relop_or_less", "a_relop", "common_exp",
+ "simp_exp", "non_post_simp_exp", "opt_variable", "variable", "l_brace",
+ "r_brace", "r_paren", "opt_semi", "semi", "comma", 0
};
+#endif
-static const short yypact[] = { 4,
--32768, 26, 848,-32768,-32768, -13, -17,-32768,-32768, 12,
- 12,-32768, 15, 15, 15, -11, 11, 1772, 1772,-32768,
- 1735, 1772, 1065, 4, 906,-32768, 56, -3,-32768,-32768,
- 1229, 198,-32768, 17, 676, 1043, 1065,-32768, 56,-32768,
- 26, 4, 56,-32768, 82, 35,-32768,-32768,-32768, 1043,
- 1043, 1772, 1677, 53, 51, 53, 106,-32768, 53,-32768,
--32768,-32768, 19, 1174,-32768,-32768,-32768,-32768,-32768, 676,
--32768,-32768, 1677, 1677, 120, 1677, 1677, 1677, 1677, 1677,
- 1677, 94, 99, 198, 1772, 1772, 1772, 1772, 1772, 1772,
--32768,-32768,-32768,-32768, 75,-32768, 129, 79, 4, 83,
- 12, 12,-32768,-32768, 12, 1677, 12, 4, 726,-32768,
- 12, 788,-32768, 1329, 676, 78, 4, 89, 37, 1329,
- 13,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 97,-32768,
- 1772,-32768, 89, 89, 1174, 100, 1677, 4,-32768, 124,
- 1115,-32768, 726, 78, 1814, 1789,-32768, 1429, 1379, 1279,
- 1329, 1814, 1814, 15, 15, -14, -14, 53, 53, 53,
- 53, 1677, 1677, 1677, 102, 1677, 956, 1544,-32768,-32768,
--32768, 12, 1329,-32768,-32768,-32768,-32768, 78,-32768,-32768,
- 15, 1735, 1065,-32768, 73, 20, 1521, 198, 118, 726,
--32768, 4,-32768,-32768,-32768,-32768, 43, 198,-32768,-32768,
--32768, 1329,-32768, 157,-32768, 1329, 78, 4, 1677,-32768,
--32768, 1329, 1174, 12, 1065, 1174, 142, -7,-32768, 78,
--32768, 4, 35,-32768, 19, 1677, 1677, 1677, 1677,-32768,
- 1714, 1137, 1714, 1714, 160, 1714, 1714, 1714, 198,-32768,
--32768,-32768,-32768,-32768, 89, 47,-32768, 4,-32768, 1329,
- 4,-32768, 14, 4, 109, 165, 4,-32768,-32768, 73,
- 1329, 1329, 1329, 1329, 1521,-32768, 1521, 1006, 1187,-32768,
- 1655, 1618, 1479, 1714, 4,-32768, 59,-32768, 956,-32768,
- 956, 1677, 89, 524,-32768, 1714, 1521,-32768,-32768,-32768,
- 153,-32768, 1174, 4, 993, 4, 1521, 4, 4, 956,
- 4, 1581, 956,-32768,-32768, 1581, 89,-32768, 89, 4,
- 4, 956, 956,-32768,-32768, 175, 176,-32768
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+ token YYLEX-NUM. */
+static const unsigned short yytoknum[] =
+{
+ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
+ 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
+ 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
+ 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
+ 295, 296, 297, 63, 58, 44, 60, 62, 43, 45,
+ 42, 47, 37, 33, 298, 94, 36, 40, 41, 91,
+ 93, 123, 125, 59
};
+# endif
-static const short yypgoto[] = {-32768,
--32768, 152,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
- -15,-32768, 70, -57, 21, -75,-32768, -165, -275,-32768,
--32768, 1, -24, -45, -81,-32768,-32768, 16,-32768,-32768,
- 40, -21, 309,-32768, -89,-32768, 395, 166, -131, 168,
- 131, -63, 18, -136, -6, -177
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const unsigned char yyr1[] =
+{
+ 0, 64, 65, 66, 66, 66, 67, 67, 67, 68,
+ 68, 68, 68, 68, 69, 70, 70, 70, 71, 71,
+ 73, 72, 75, 74, 76, 76, 77, 77, 77, 78,
+ 78, 79, 79, 79, 79, 79, 79, 79, 79, 79,
+ 79, 79, 79, 79, 80, 79, 79, 82, 81, 81,
+ 81, 81, 81, 83, 83, 84, 84, 85, 85, 86,
+ 87, 86, 88, 88, 89, 89, 90, 90, 91, 91,
+ 92, 92, 93, 93, 93, 93, 93, 94, 94, 95,
+ 95, 96, 96, 96, 96, 96, 96, 97, 97, 97,
+ 97, 97, 97, 97, 97, 98, 98, 98, 99, 99,
+ 100, 100, 101, 101, 101, 101, 101, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 103, 103,
+ 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
+ 103, 104, 104, 105, 105, 105, 106, 107, 108, 109,
+ 109, 110, 111
};
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+static const unsigned char yyr2[] =
+{
+ 0, 2, 3, 0, 2, 2, 2, 2, 2, 0,
+ 1, 3, 1, 1, 5, 1, 1, 1, 1, 1,
+ 0, 7, 0, 3, 1, 1, 0, 2, 2, 1,
+ 2, 2, 3, 1, 6, 8, 8, 12, 11, 2,
+ 2, 2, 2, 3, 0, 4, 2, 0, 4, 5,
+ 2, 4, 1, 0, 1, 1, 1, 1, 5, 0,
+ 0, 3, 6, 9, 1, 2, 0, 1, 0, 2,
+ 0, 1, 1, 3, 1, 2, 3, 0, 1, 0,
+ 1, 1, 3, 1, 2, 3, 3, 3, 3, 3,
+ 3, 3, 3, 5, 1, 1, 1, 2, 1, 1,
+ 1, 1, 1, 2, 5, 1, 2, 1, 3, 3,
+ 3, 3, 3, 3, 3, 4, 2, 2, 2, 3,
+ 4, 4, 1, 4, 1, 2, 2, 1, 1, 2,
+ 2, 0, 1, 1, 4, 2, 2, 2, 1, 0,
+ 1, 1, 2
+};
-#define YYLAST 1870
-
-
-static const short yytable[] = { 65,
- 68, 63, 219, 42, 42, 58, 144, 208, 232, 1,
- 41, 41, 143, 137, 137, 121, 1, 123, 7, 137,
- 231, 42, 210, 211, 1, 256, 307, 91, 41, -87,
- 309, 44, -87, 177, 87, 88, 89, 137, 4, 90,
- 37, 222, 36, 243, 50, 178, 244, 276, 72, 223,
- 37, 191, 92, 93, 138, 138, 24, 190, 38, 289,
- 138, 138, 290, -87, -87, -87, 51, 177, 277, 22,
- 248, 196, 280, 38, 167, 139, -87, 131, 138, 207,
- 140, -87, 226, 175, 125, 126, 92, 93, 138, 133,
- 134, 217, 194, -95, 42, 42, 184, 71, 42, -77,
- 42, 41, 41, -78, 42, 41, 90, 41, 122, 193,
- 136, 41, 124, 203, 177, 24, 227, 228, 229, 127,
- 128, 169, 170, 147, 154, 171, 241, 174, 240, 155,
- 163, 179, 165, 35, 166, 195, 219, 193, 168, 38,
- 219, 265, 267, 268, 269, 139, 271, 272, 273, 201,
- 199, 200, 197, 92, 93, 35, 204, 70, 35, 215,
- 247, 225, 255, 270, 282, 42, 224, 242, 283, 35,
- 298, 193, 41, 35, 317, 318, 67, 259, 285, 214,
- 47, 48, 49, 249, 287, 55, 55, 60, 55, 61,
- 0, 0, 221, 253, 0, 0, 297, 258, 55, 0,
- 193, 0, 0, 291, 0, 292, 0, 42, 0, 0,
- 0, 0, 0, 257, 41, 184, 184, 184, 184, 55,
- 184, 184, 184, 278, 305, 0, 279, 308, 0, 281,
- 251, 55, 284, 254, 252, 0, 314, 315, 0, 0,
- 0, 0, 260, 0, 85, 86, 87, 88, 89, 0,
- 288, 90, 55, 55, 55, 55, 55, 55, 184, 0,
- 0, 0, 275, 0, 0, 0, 0, 0, 0, 300,
- 184, 302, 0, 303, 304, 0, 306, 296, 0, 189,
- 0, 55, 0, 0, 0, 312, 313, 55, 301, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 55, 0,
- 294, 0, 55, 0, 0, 0, 0, 0, 0, 0,
- 299, 31, 55, 55, 0, 55, 55, 55, 55, 55,
- 55, 47, 47, 0, 310, 0, 311, 0, 0, 0,
- 0, 64, 0, 31, 0, 0, 0, 0, 0, 0,
- 55, 0, 0, 0, 120, 120, 0, 0, 47, 55,
- 0, 0, 0, 0, 55, 0, 0, 0, 120, 120,
- 0, 135, 0, 0, 0, 0, 0, 0, 0, 55,
- 0, 0, 0, 55, 0, 0, 0, 0, 0, 55,
- 55, 145, 146, 55, 148, 149, 150, 151, 152, 153,
- 0, 0, 0, 0, 0, 0, 0, 0, 189, 189,
- 189, 189, 0, 189, 189, 189, 0, 0, 0, 0,
- 0, 0, 54, 56, 173, 59, 0, 55, 0, 0,
- 0, 0, 0, 0, 0, 84, 0, 0, 55, 55,
- 55, 55, 55, 0, 55, 55, 55, 0, 55, 55,
- 55, 189, 0, 0, 0, 202, 59, 0, 0, 206,
- 0, 0, 0, 189, 55, 0, 0, 0, 84, 0,
- 55, 0, 55, 0, 55, 0, 0, 0, 0, 0,
- 212, 213, 173, 0, 216, 0, 0, 0, 0, 156,
- 157, 158, 159, 160, 161, 0, 0, 0, 0, 0,
- 0, 64, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 188, 0, 84, 0,
- 0, 0, 0, 0, 84, 0, 0, 250, 0, 0,
- 0, 0, 0, 120, 0, 198, 6, 7, 0, 84,
- 8, 9, 0, 0, 261, 262, 263, 264, 0, 84,
- 84, 0, 84, 84, 84, 84, 84, 84, 0, 0,
- 0, 0, 0, 0, 13, 0, 0, 0, 0, 14,
- 15, 16, 17, 0, 0, 0, 0, 84, 0, 0,
- 18, 19, 0, 20, 0, 21, 59, 0, 22, 23,
- 0, 239, 0, 0, 0, 38, 0, 0, 0, 0,
- 293, 0, 295, 0, 0, 0, 84, 0, 0, 0,
- 84, 0, 0, 0, 0, 0, 84, 84, 0, 0,
- 84, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 188, 188, 188, 188, 0,
- 188, 188, 188, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 84, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 84, 84, 84, 84, 239,
- 0, 239, 239, 239, 0, 239, 239, 239, 188, 0,
- 0, 0, 0, 0, 0, 0, 94, 0, 6, 7,
- 188, 239, 8, 9, 0, 0, 0, 84, 0, 84,
- 0, 239, 95, 0, 96, 97, 98, 99, 100, 101,
- 102, 103, 104, 105, 106, 0, 13, 107, 0, 0,
- 0, 14, 15, 16, 17, 0, 0, 0, 0, 0,
- 0, 0, 18, 19, 0, 20, 176, 21, 6, 7,
- 22, 23, 8, 9, 0, 24, 108, 38, 0, 0,
- 0, 0, 95, 0, 96, 97, 98, 99, 100, 101,
- 102, 103, 104, 105, 106, 0, 13, 107, 0, 0,
- 0, 14, 15, 16, 17, 0, 0, 0, 0, 0,
- 0, 0, 18, 19, 0, 20, 0, 21, 0, 0,
- 22, 23, 0, 0, 0, 24, 108, 38, 180, 0,
- 6, 7, 0, 0, 8, 9, 0, -86, 0, 0,
- -86, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 181, 0,
- 0, 0, 0, 14, 15, 16, 17, 0, 0, 0,
- 0, -86, -86, -86, 18, 19, 0, 20, 0, 182,
- 0, 0, 22, 183, -86, 0, 0, -6, 5, -86,
- 6, 7, 0, 0, 8, 9, 0, 0, 0, 0,
- -6, 0, 10, 11, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 12, 13, 0,
- 0, 0, 0, 14, 15, 16, 17, 0, 0, 0,
- 0, 0, 0, 0, 18, 19, 0, 20, 0, 21,
- 0, 0, 22, 23, 0, -68, 66, 24, 6, 7,
- 0, 0, 8, 9, 0, 0, 0, 0, 1, 0,
- 10, 11, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 12, 13, 0, 0, 0,
- 0, 14, 15, 16, 17, 0, 0, 0, 0, 0,
- 0, 0, 18, 19, 0, 20, 0, 21, 6, 7,
- 22, 23, 8, 9, 0, 24, 0, 0, 0, 0,
- 0, 0, 95, 0, 96, 97, 98, 99, 100, 101,
- 102, 103, 104, 105, 106, 0, 13, 107, 0, 0,
- 0, 14, 15, 16, 17, 6, 7, 0, 0, 8,
- 9, 73, 18, 19, 74, 20, 0, 21, 0, 7,
- 22, 23, 8, 9,-32768, 24, 0, 38, 0, 0,
- 0, 0, 0, 0, 0, 75, 76, 77, 14, 15,
- 16, 17, 78, 0, 0, 80, 81, 82, 83, 18,
- 19, 14, 15, 62, 52, 6, 7, 22, 53, 8,
- 9, 0, 18, 19, 38, 0, 0, 52, 0, 0,
- 22, 53, 0, 0, 0, 62, 0, 6, 7, 0,
- 0, 8, 9, 13, 0, 0, 0, 0, 14, 15,
- 16, 17, 0, 0, 0, 0, 0, 0, 0, 18,
- 19, 0, 20, 0, 21, 13, 0, 22, 23, -94,
- 14, 15, 16, 17, 0, 0, 0, 0, 0, 0,
- 0, 18, 19, 0, 20, 205, 21, 6, 7, 22,
- 23, 8, 9, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 266, 0, 6,
- 7, 0, 0, 8, 9, 13, 0, 0, 0, 0,
- 14, 15, 16, 17, 0, 0, 0, 0, 0, 0,
- 0, 18, 19, 0, 20, 0, 21, 181, 0, 22,
- 23, 0, 14, 15, 16, 17, 6, 7, 0, 0,
- 8, 9, 73, 18, 19, 74, 20, 0, 182, 0,
- 7, 22, 53, 8, 9, 233, 0, 0,-32768, 0,
- 0, 0, 0, 0, 0, 0, 75, 76, 77, 14,
- 15, 16, 17, 78, 0, 0, 80, 81, 82, 83,
- 18, 19, 14, 15, 0, 52, 0, 0, 22, 53,
- 139, 6, 7, 18, 19, 8, 9, 73, 52, 0,
- 74, 22, 53, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 75, 76, 77, 14, 15, 16, 17, 78, 0,
- 79, 80, 81, 82, 83, 18, 19, 0, 0, 0,
- 52, 6, 7, 22, 53, 8, 9, 73, 0, 0,
- 74, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 75, 76, 77, 14, 15, 16, 17, 78, 209,
- 0, 80, 81, 82, 83, 18, 19, 0, 0, 0,
- 52, 6, 7, 22, 53, 8, 9, 73, 0, 0,
- 74, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 75, 76, 77, 14, 15, 16, 17, 78, 0,
- 0, 80, 81, 82, 83, 18, 19, 0, 0, 0,
- 52, 6, 7, 22, 53, 8, 9, 73, 0, 0,
- 74, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 75, 76, 0, 14, 15, 16, 17, 0, 0,
- 0, 80, 81, 82, 83, 18, 19, 0, 0, 0,
- 52, 6, 7, 22, 53, 8, 9, 73, 0, 0,
- 74, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 75, 0, 0, 14, 15, 16, 17, 0, 0,
- 0, 80, 81, 82, 83, 18, 19, 0, 0, 0,
- 52, 6, 7, 22, 53, 8, 9, 233, 0, 0,
- 234, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 235, 236, 237, 14, 15, 16, 17, 238, 286,
- 0, 0, 0, 6, 7, 18, 19, 8, 9, 233,
- 52, 0, 234, 22, 53, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 6, 218, 0, 0,
- 8, 9, 0, 235, 236, 237, 14, 15, 16, 17,
- 238, 0, 0, 97, 0, 0, 0, 18, 19, 103,
- 104, 0, 52, 0, 13, 22, 53, 0, 0, 14,
- 15, 16, 17, 6, 7, 0, 0, 8, 9, 0,
- 18, 19, 0, 20, 0, 21, 0, 0, 22, 23,
- 97, 0, 0, 0, 0, 0, 103, 104, 0, 0,
- 0, 13, 0, 0, 0, 0, 14, 15, 16, 17,
- 6, 7, 0, 0, 8, 9, 233, 18, 19, 234,
- 20, 0, 21, 0, 0, 22, 23, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 235, 236, 0, 14, 15, 16, 17, 6, 7, 0,
- 0, 8, 9, 233, 18, 19, 234, 0, 0, 52,
- 0, 0, 22, 53, 0, 0, 0, 0, 0, 6,
- 7, 0, 0, 8, 9, 0, 0, 235, 0, 0,
- 14, 15, 16, 17, 0, 0, 0, 0, 0, 0,
- 0, 18, 19, 0, 0, 0, 52, 13, 0, 22,
- 53, 0, 14, 15, 16, 17, 6, 7, 0, 0,
- 8, 9, 0, 18, 19, 0, 20, 0, 21, 0,
- 0, 22, 23, 0, 0, 0, 0, 6, 7, 0,
- 0, 8, 9, 0, 181, 0, 0, 0, 0, 14,
- 15, 16, 17, 0, 0, 0, 0, 0, 0, 0,
- 18, 19, 0, 20, 0, 182, 0, 0, 22, 53,
- 14, 15, 16, 17, 6, 7, 0, 0, 8, 9,
- 0, 18, 19, 0, 20, 0, 52, 0, 0, 22,
- 53, 0, 7, 0, 0, 8, 9, 73, 0, 0,
--32768, 0, 0, 0, 0, 0, 0, 14, 15, 16,
- 17, 0, 0, 0, 0, 0, 0, 7, 18, 19,
- 8, 9,-32768, 52, 14, 15, 22, 53, 0, 0,
- 0, 80, 81, 82, 83, 18, 19, 0, 0, 0,
- 52, 0, 0, 22, 53, 0, 0, 0, 0, 14,
- 15, 0, 0, 0, 0, 0,-32768,-32768,-32768,-32768,
- 18, 19, 0, 0, 0, 52, 0, 0, 22, 53
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
+ means the default is an error. */
+static const unsigned char yydefact[] =
+{
+ 66, 64, 0, 67, 3, 1, 65, 0, 5, 0,
+ 133, 127, 128, 12, 13, 20, 131, 0, 0, 0,
+ 122, 25, 0, 0, 24, 0, 0, 0, 4, 0,
+ 0, 102, 22, 2, 10, 94, 105, 107, 124, 0,
+ 0, 0, 68, 132, 125, 126, 0, 0, 0, 0,
+ 130, 124, 129, 103, 118, 135, 124, 83, 0, 81,
+ 66, 141, 6, 7, 29, 26, 66, 8, 0, 98,
+ 0, 0, 0, 0, 0, 0, 99, 101, 100, 0,
+ 106, 0, 0, 0, 0, 0, 0, 0, 96, 95,
+ 116, 117, 0, 0, 0, 0, 81, 0, 16, 15,
+ 18, 19, 0, 17, 0, 114, 0, 0, 0, 84,
+ 66, 138, 0, 0, 119, 136, 0, 30, 23, 90,
+ 91, 88, 89, 0, 11, 92, 131, 112, 113, 109,
+ 110, 111, 108, 97, 87, 123, 134, 0, 69, 120,
+ 121, 85, 142, 0, 86, 82, 28, 0, 44, 0,
+ 0, 66, 0, 0, 0, 55, 56, 0, 77, 0,
+ 66, 27, 0, 47, 33, 52, 26, 139, 66, 0,
+ 115, 74, 72, 0, 0, 104, 0, 77, 50, 0,
+ 0, 0, 53, 39, 40, 41, 0, 78, 42, 137,
+ 46, 0, 0, 66, 140, 31, 93, 66, 75, 0,
+ 0, 0, 0, 0, 0, 0, 133, 54, 0, 43,
+ 0, 59, 57, 32, 14, 21, 76, 73, 66, 45,
+ 0, 51, 66, 0, 0, 66, 81, 60, 48, 0,
+ 49, 0, 0, 0, 0, 0, 0, 62, 34, 0,
+ 66, 0, 66, 0, 61, 66, 66, 0, 66, 53,
+ 58, 0, 35, 36, 53, 0, 63, 0, 66, 66,
+ 0, 0, 38, 37
};
-static const short yycheck[] = { 24,
- 25, 23, 168, 10, 11, 21, 70, 144, 186, 13,
- 10, 11, 70, 1, 1, 37, 13, 42, 4, 1,
- 1, 28, 154, 155, 13, 33, 302, 11, 28, 10,
- 306, 11, 13, 109, 49, 50, 51, 1, 13, 54,
- 58, 178, 56, 1, 56, 109, 4, 1, 28, 181,
- 58, 115, 36, 37, 42, 42, 60, 115, 62, 1,
- 42, 42, 4, 44, 45, 46, 56, 143, 246, 55,
- 207, 59, 59, 62, 99, 57, 57, 43, 42, 143,
- 63, 62, 10, 108, 3, 4, 36, 37, 42, 50,
- 51, 167, 117, 57, 101, 102, 112, 28, 105, 57,
- 107, 101, 102, 57, 111, 105, 54, 107, 39, 116,
- 5, 111, 43, 138, 190, 60, 44, 45, 46, 38,
- 39, 101, 102, 4, 31, 105, 190, 107, 11, 31,
- 56, 111, 4, 3, 56, 118, 302, 144, 56, 62,
- 306, 231, 232, 233, 234, 57, 236, 237, 238, 50,
- 133, 134, 56, 36, 37, 25, 33, 27, 28, 58,
- 4, 183, 21, 4, 56, 172, 182, 192, 4, 39,
- 18, 178, 172, 43, 0, 0, 25, 223, 260, 164,
- 13, 14, 15, 208, 274, 18, 19, 22, 21, 22,
- -1, -1, 172, 215, -1, -1, 286, 222, 31, -1,
- 207, -1, -1, 279, -1, 281, -1, 214, -1, -1,
- -1, -1, -1, 220, 214, 231, 232, 233, 234, 52,
- 236, 237, 238, 248, 300, -1, 251, 303, -1, 254,
- 213, 64, 257, 216, 214, -1, 312, 313, -1, -1,
- -1, -1, 225, -1, 47, 48, 49, 50, 51, -1,
- 275, 54, 85, 86, 87, 88, 89, 90, 274, -1,
- -1, -1, 245, -1, -1, -1, -1, -1, -1, 294,
- 286, 296, -1, 298, 299, -1, 301, 284, -1, 112,
- -1, 114, -1, -1, -1, 310, 311, 120, 295, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 131, -1,
- 283, -1, 135, -1, -1, -1, -1, -1, -1, -1,
- 293, 3, 145, 146, -1, 148, 149, 150, 151, 152,
- 153, 154, 155, -1, 307, -1, 309, -1, -1, -1,
- -1, 23, -1, 25, -1, -1, -1, -1, -1, -1,
- 173, -1, -1, -1, 36, 37, -1, -1, 181, 182,
- -1, -1, -1, -1, 187, -1, -1, -1, 50, 51,
- -1, 53, -1, -1, -1, -1, -1, -1, -1, 202,
- -1, -1, -1, 206, -1, -1, -1, -1, -1, 212,
- 213, 73, 74, 216, 76, 77, 78, 79, 80, 81,
- -1, -1, -1, -1, -1, -1, -1, -1, 231, 232,
- 233, 234, -1, 236, 237, 238, -1, -1, -1, -1,
- -1, -1, 18, 19, 106, 21, -1, 250, -1, -1,
- -1, -1, -1, -1, -1, 31, -1, -1, 261, 262,
- 263, 264, 265, -1, 267, 268, 269, -1, 271, 272,
- 273, 274, -1, -1, -1, 137, 52, -1, -1, 141,
- -1, -1, -1, 286, 287, -1, -1, -1, 64, -1,
- 293, -1, 295, -1, 297, -1, -1, -1, -1, -1,
- 162, 163, 164, -1, 166, -1, -1, -1, -1, 85,
- 86, 87, 88, 89, 90, -1, -1, -1, -1, -1,
- -1, 183, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 112, -1, 114, -1,
- -1, -1, -1, -1, 120, -1, -1, 209, -1, -1,
- -1, -1, -1, 215, -1, 131, 3, 4, -1, 135,
- 7, 8, -1, -1, 226, 227, 228, 229, -1, 145,
- 146, -1, 148, 149, 150, 151, 152, 153, -1, -1,
- -1, -1, -1, -1, 31, -1, -1, -1, -1, 36,
- 37, 38, 39, -1, -1, -1, -1, 173, -1, -1,
- 47, 48, -1, 50, -1, 52, 182, -1, 55, 56,
- -1, 187, -1, -1, -1, 62, -1, -1, -1, -1,
- 282, -1, 284, -1, -1, -1, 202, -1, -1, -1,
- 206, -1, -1, -1, -1, -1, 212, 213, -1, -1,
- 216, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 231, 232, 233, 234, -1,
- 236, 237, 238, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 250, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 261, 262, 263, 264, 265,
- -1, 267, 268, 269, -1, 271, 272, 273, 274, -1,
- -1, -1, -1, -1, -1, -1, 1, -1, 3, 4,
- 286, 287, 7, 8, -1, -1, -1, 293, -1, 295,
- -1, 297, 17, -1, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, -1, 31, 32, -1, -1,
- -1, 36, 37, 38, 39, -1, -1, -1, -1, -1,
- -1, -1, 47, 48, -1, 50, 1, 52, 3, 4,
- 55, 56, 7, 8, -1, 60, 61, 62, -1, -1,
- -1, -1, 17, -1, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, -1, 31, 32, -1, -1,
- -1, 36, 37, 38, 39, -1, -1, -1, -1, -1,
- -1, -1, 47, 48, -1, 50, -1, 52, -1, -1,
- 55, 56, -1, -1, -1, 60, 61, 62, 1, -1,
- 3, 4, -1, -1, 7, 8, -1, 10, -1, -1,
- 13, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 31, -1,
- -1, -1, -1, 36, 37, 38, 39, -1, -1, -1,
- -1, 44, 45, 46, 47, 48, -1, 50, -1, 52,
- -1, -1, 55, 56, 57, -1, -1, 0, 1, 62,
- 3, 4, -1, -1, 7, 8, -1, -1, -1, -1,
- 13, -1, 15, 16, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 30, 31, -1,
- -1, -1, -1, 36, 37, 38, 39, -1, -1, -1,
- -1, -1, -1, -1, 47, 48, -1, 50, -1, 52,
- -1, -1, 55, 56, -1, 0, 1, 60, 3, 4,
- -1, -1, 7, 8, -1, -1, -1, -1, 13, -1,
- 15, 16, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 30, 31, -1, -1, -1,
- -1, 36, 37, 38, 39, -1, -1, -1, -1, -1,
- -1, -1, 47, 48, -1, 50, -1, 52, 3, 4,
- 55, 56, 7, 8, -1, 60, -1, -1, -1, -1,
- -1, -1, 17, -1, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, -1, 31, 32, -1, -1,
- -1, 36, 37, 38, 39, 3, 4, -1, -1, 7,
- 8, 9, 47, 48, 12, 50, -1, 52, -1, 4,
- 55, 56, 7, 8, 9, 60, -1, 62, -1, -1,
- -1, -1, -1, -1, -1, 33, 34, 35, 36, 37,
- 38, 39, 40, -1, -1, 43, 44, 45, 46, 47,
- 48, 36, 37, 1, 52, 3, 4, 55, 56, 7,
- 8, -1, 47, 48, 62, -1, -1, 52, -1, -1,
- 55, 56, -1, -1, -1, 1, -1, 3, 4, -1,
- -1, 7, 8, 31, -1, -1, -1, -1, 36, 37,
- 38, 39, -1, -1, -1, -1, -1, -1, -1, 47,
- 48, -1, 50, -1, 52, 31, -1, 55, 56, 57,
- 36, 37, 38, 39, -1, -1, -1, -1, -1, -1,
- -1, 47, 48, -1, 50, 1, 52, 3, 4, 55,
- 56, 7, 8, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 1, -1, 3,
- 4, -1, -1, 7, 8, 31, -1, -1, -1, -1,
- 36, 37, 38, 39, -1, -1, -1, -1, -1, -1,
- -1, 47, 48, -1, 50, -1, 52, 31, -1, 55,
- 56, -1, 36, 37, 38, 39, 3, 4, -1, -1,
- 7, 8, 9, 47, 48, 12, 50, -1, 52, -1,
- 4, 55, 56, 7, 8, 9, -1, -1, 12, -1,
- -1, -1, -1, -1, -1, -1, 33, 34, 35, 36,
- 37, 38, 39, 40, -1, -1, 43, 44, 45, 46,
- 47, 48, 36, 37, -1, 52, -1, -1, 55, 56,
- 57, 3, 4, 47, 48, 7, 8, 9, 52, -1,
- 12, 55, 56, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 33, 34, 35, 36, 37, 38, 39, 40, -1,
- 42, 43, 44, 45, 46, 47, 48, -1, -1, -1,
- 52, 3, 4, 55, 56, 7, 8, 9, -1, -1,
- 12, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- -1, 43, 44, 45, 46, 47, 48, -1, -1, -1,
- 52, 3, 4, 55, 56, 7, 8, 9, -1, -1,
- 12, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 33, 34, 35, 36, 37, 38, 39, 40, -1,
- -1, 43, 44, 45, 46, 47, 48, -1, -1, -1,
- 52, 3, 4, 55, 56, 7, 8, 9, -1, -1,
- 12, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 33, 34, -1, 36, 37, 38, 39, -1, -1,
- -1, 43, 44, 45, 46, 47, 48, -1, -1, -1,
- 52, 3, 4, 55, 56, 7, 8, 9, -1, -1,
- 12, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 33, -1, -1, 36, 37, 38, 39, -1, -1,
- -1, 43, 44, 45, 46, 47, 48, -1, -1, -1,
- 52, 3, 4, 55, 56, 7, 8, 9, -1, -1,
- 12, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- -1, -1, -1, 3, 4, 47, 48, 7, 8, 9,
- 52, -1, 12, 55, 56, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 3, 4, -1, -1,
- 7, 8, -1, 33, 34, 35, 36, 37, 38, 39,
- 40, -1, -1, 20, -1, -1, -1, 47, 48, 26,
- 27, -1, 52, -1, 31, 55, 56, -1, -1, 36,
- 37, 38, 39, 3, 4, -1, -1, 7, 8, -1,
- 47, 48, -1, 50, -1, 52, -1, -1, 55, 56,
- 20, -1, -1, -1, -1, -1, 26, 27, -1, -1,
- -1, 31, -1, -1, -1, -1, 36, 37, 38, 39,
- 3, 4, -1, -1, 7, 8, 9, 47, 48, 12,
- 50, -1, 52, -1, -1, 55, 56, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 33, 34, -1, 36, 37, 38, 39, 3, 4, -1,
- -1, 7, 8, 9, 47, 48, 12, -1, -1, 52,
- -1, -1, 55, 56, -1, -1, -1, -1, -1, 3,
- 4, -1, -1, 7, 8, -1, -1, 33, -1, -1,
- 36, 37, 38, 39, -1, -1, -1, -1, -1, -1,
- -1, 47, 48, -1, -1, -1, 52, 31, -1, 55,
- 56, -1, 36, 37, 38, 39, 3, 4, -1, -1,
- 7, 8, -1, 47, 48, -1, 50, -1, 52, -1,
- -1, 55, 56, -1, -1, -1, -1, 3, 4, -1,
- -1, 7, 8, -1, 31, -1, -1, -1, -1, 36,
- 37, 38, 39, -1, -1, -1, -1, -1, -1, -1,
- 47, 48, -1, 50, -1, 52, -1, -1, 55, 56,
- 36, 37, 38, 39, 3, 4, -1, -1, 7, 8,
- -1, 47, 48, -1, 50, -1, 52, -1, -1, 55,
- 56, -1, 4, -1, -1, 7, 8, 9, -1, -1,
- 12, -1, -1, -1, -1, -1, -1, 36, 37, 38,
- 39, -1, -1, -1, -1, -1, -1, 4, 47, 48,
- 7, 8, 9, 52, 36, 37, 55, 56, -1, -1,
- -1, 43, 44, 45, 46, 47, 48, -1, -1, -1,
- 52, -1, -1, 55, 56, -1, -1, -1, -1, 36,
- 37, -1, -1, -1, -1, -1, 43, 44, 45, 46,
- 47, 48, -1, -1, -1, 52, -1, -1, 55, 56
+/* YYDEFGOTO[NTERM-NUM]. */
+static const short yydefgoto[] =
+{
+ -1, 2, 7, 28, 29, 62, 102, 103, 30, 41,
+ 31, 68, 32, 116, 63, 161, 177, 162, 191, 208,
+ 163, 211, 228, 236, 164, 3, 4, 105, 173, 174,
+ 186, 94, 95, 165, 93, 78, 79, 35, 36, 37,
+ 42, 38, 166, 167, 114, 193, 168, 113
};
-/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/lib/bison.simple"
-/* This file comes from bison-1.28. */
-/* Skeleton output parser for bison,
- Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+#define YYPACT_NINF -238
+static const short yypact[] =
+{
+ -26, -238, 1, -19, -238, -238, -238, 262, -238, -33,
+ -32, -238, -238, -238, -238, -238, 0, 0, 0, -23,
+ -13, -238, 783, 783, -238, 710, 821, 564, -238, -31,
+ -24, -238, -238, -238, 737, 783, 145, -238, 369, 506,
+ 564, 144, -15, -238, -238, -238, 506, 506, 783, 761,
+ -14, 55, -14, -238, -14, -238, -238, -238, 7, 613,
+ -26, -238, -238, -238, -19, -238, -26, -238, 41, -238,
+ 761, 47, 761, 761, 761, 761, -238, -238, -238, 761,
+ 145, 53, 783, 783, 783, 783, 783, 783, -238, -238,
+ -238, -238, 75, 761, 36, 37, 465, 19, -238, -238,
+ -238, -238, 33, -238, 783, -238, 36, 36, 613, 761,
+ -26, -238, 65, 586, -238, -238, 313, -238, -238, 82,
+ -238, 155, 358, 664, 465, 225, 0, 116, 116, -14,
+ -14, -14, -14, -238, 465, -238, -238, 25, 237, -238,
+ -238, 465, -238, 100, -238, 465, -238, 49, -238, 17,
+ 50, -26, 51, -30, -30, -238, -238, -30, 761, -30,
+ -26, -238, -30, -238, -238, 465, -238, 68, -26, 761,
+ -238, -238, -238, 36, 39, -238, 761, 761, 54, 129,
+ 761, 433, 637, -238, -238, -238, -30, 465, -238, -238,
+ -238, 376, 313, -26, -238, -238, 465, -26, -238, 15,
+ 613, -30, 564, 76, 613, 117, -20, -238, 68, -238,
+ 564, 135, -238, -238, -238, -238, -238, -238, -26, -238,
+ 27, -238, -26, 92, 146, -26, 354, -238, -238, 433,
+ -238, 433, 761, 36, 484, 564, 761, 133, -238, 613,
+ -26, 210, -26, 7, 783, -26, -26, 433, -26, 688,
+ -238, 433, -238, -238, 688, 36, -238, 36, -26, -26,
+ 433, 433, -238, -238
+};
- 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.
+/* YYPGOTO[NTERM-NUM]. */
+static const short yypgoto[] =
+{
+ -238, -238, -238, -238, -238, 125, -238, -238, -238, -238,
+ 132, -238, -238, -3, 63, -69, -238, -173, -238, -237,
+ -238, -238, -238, -238, -238, -16, -7, -238, -238, -238,
+ -2, -40, -22, -4, -238, -238, -238, -57, 38, 173,
+ 77, 32, 72, 13, 4, -238, -27, -149
+};
- 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.
+/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule which
+ number is the opposite. If zero, do what YYDEFACT says.
+ If YYTABLE_NINF, syntax error. */
+#define YYTABLE_NINF -81
+static const short yytable[] =
+{
+ 33, 5, 66, 34, 10, 58, 106, 107, 109, 207,
+ 1, 1, 255, 64, 224, 1, 216, 257, 97, 217,
+ 109, 178, 6, 59, 39, 199, 171, 40, 109, 172,
+ 60, 104, 61, 61, 46, 96, 96, 60, 109, 40,
+ 198, 87, 96, 96, 47, 108, 118, -80, 43, 44,
+ 45, 120, 110, 115, 51, 51, 26, 51, 56, 117,
+ 50, 52, 112, 54, 110, 111, 119, 51, 121, 122,
+ 123, 124, 110, 80, 179, 125, 207, 235, -80, 136,
+ 51, 207, 110, -70, 110, 126, 54, 230, 133, 134,
+ 137, 69, 90, 91, 111, -80, -81, -71, 135, 143,
+ -80, 65, 65, 142, 175, 141, 176, 180, 182, 145,
+ 139, 140, 205, 202, 51, 51, 51, 51, 51, 51,
+ 127, 128, 129, 130, 131, 132, 66, 66, 76, 77,
+ 66, 61, 66, 203, 221, 66, 51, 64, 64, 223,
+ 194, 64, 138, 64, 181, 227, 64, 98, 99, 232,
+ 233, 212, 245, 189, 187, 67, 81, 53, 43, 66,
+ 237, 195, 238, 192, 69, 196, 84, 85, 86, 70,
+ 64, 87, 200, 187, 66, 201, 204, 197, 253, 244,
+ 220, 225, 256, 100, 101, 64, 214, 96, 58, 71,
+ 215, 262, 263, 82, 83, 84, 85, 86, 96, 55,
+ 87, 76, 77, 170, 218, 213, 226, 242, 222, 0,
+ 0, 229, 0, 243, 248, 231, 183, 184, 234, 69,
+ 185, 0, 188, 0, 70, 190, 0, 0, 239, 0,
+ 241, 96, 0, 247, -81, 249, 0, 240, 251, 252,
+ 0, 254, 0, 246, 71, 72, 73, 250, -81, 209,
+ 0, 260, 261, 74, 0, 0, 76, 77, 0, 258,
+ 0, 259, -66, 8, 219, 9, 10, 0, 51, 11,
+ 12, -81, -81, 61, 0, 0, 51, 0, 13, 14,
+ 0, 0, 80, 0, 0, 82, 83, 84, 85, 86,
+ 0, 0, 87, 15, 16, 0, 0, 0, 0, 17,
+ 18, 19, 20, 1, 21, 0, 0, 0, 0, 0,
+ 22, 23, 0, 24, 146, 25, 9, 10, 26, 27,
+ 11, 12, 0, -9, 0, -9, 0, 0, 0, 0,
+ 0, 147, 0, 148, 149, 150, 151, 152, 153, 154,
+ 155, 156, 157, 158, 0, 16, 159, 0, 0, 0,
+ 17, 18, 19, 20, 0, 21, 0, 0, 0, 0,
+ 0, 22, 23, 69, 24, 0, 25, 69, 70, 26,
+ 27, 0, 70, 0, 60, 160, 61, 57, 0, 9,
+ 10, 88, 89, 11, 12, 0, -79, 0, 71, 72,
+ 73, 0, 71, 72, 0, 0, 0, 74, 0, 110,
+ 76, 77, 0, 0, 76, 77, 90, 91, 16, 0,
+ 0, 92, 111, 17, 18, 19, 20, -79, 21, 0,
+ 0, 0, 0, 0, 22, 23, 0, 24, 0, 25,
+ 0, 0, 26, 210, -79, 0, 9, 10, 0, -79,
+ 11, 12, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 147, 0, 148, 149, 150, 151, 152, 153, 154,
+ 155, 156, 157, 158, 0, 16, 159, 0, 0, 0,
+ 17, 18, 19, 20, 69, 21, 0, 0, 0, 70,
+ 0, 22, 23, 0, 24, 0, 25, 9, 10, 26,
+ 27, 11, 12, 0, 60, 0, 61, 0, 0, 71,
+ 72, 73, 0, 0, 0, 0, 0, 57, 74, 9,
+ 10, 76, 77, 11, 12, 0, 16, 0, 0, 0,
+ 0, 17, 18, 19, 20, 0, 21, 0, 0, 0,
+ 0, 0, 22, 23, 0, 24, 0, 25, 16, 0,
+ 26, 27, 0, 17, 18, 19, 20, 61, 21, 0,
+ 0, 0, 0, 0, 22, 23, 0, 24, 0, 25,
+ 0, 0, 26, 27, -79, 57, 0, 9, 10, 0,
+ 0, 11, 12, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 144, 0, 9,
+ 10, 0, 0, 11, 12, 0, 16, 0, 0, 0,
+ 0, 17, 18, 19, 20, 0, 21, 0, 0, 0,
+ 0, 0, 22, 23, 0, 24, 0, 25, 16, 0,
+ 26, 27, 69, 17, 18, 19, 20, 70, 21, 0,
+ 0, 0, 0, 0, 22, 23, 0, 24, 0, 25,
+ 9, 206, 26, 27, 11, 12, 0, 71, 72, 73,
+ 0, 0, 0, 0, 0, 0, 74, 0, 149, 76,
+ 77, 0, 0, 0, 155, 156, 0, 0, 0, 16,
+ 0, 111, 0, 69, 17, 18, 19, 20, 70, 21,
+ 0, 0, 0, 0, 0, 22, 23, 0, 24, 0,
+ 25, 9, 10, 26, 27, 11, 12, 0, 71, 72,
+ 73, 0, 0, 0, 0, 0, 0, 74, 169, 149,
+ 76, 77, 0, 9, 10, 155, 156, 11, 12, 0,
+ 16, 0, 0, 0, 0, 17, 18, 19, 20, 0,
+ 21, 0, 0, 0, 0, 0, 22, 23, 0, 24,
+ 0, 25, 16, 0, 26, 27, 69, 17, 18, 19,
+ 20, 70, 21, 0, 0, 0, 0, 0, 22, 23,
+ 0, 24, 0, 48, 9, 10, 26, 49, 11, 12,
+ 0, 71, 72, 73, 0, 0, 0, 0, 0, 0,
+ 74, 0, 75, 76, 77, 0, 9, 10, 0, 0,
+ 11, 12, 0, 16, 0, 0, 0, 0, 17, 18,
+ 19, 20, 0, 21, 0, 0, 0, 0, 0, 22,
+ 23, 0, 24, 0, 25, 16, 0, 26, 27, 0,
+ 17, 18, 19, 20, 9, 10, 0, 0, 11, 12,
+ 0, 22, 23, 0, 0, 0, 48, 0, 0, 26,
+ 49, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 17, 18,
+ 19, 20, 0, 0, 0, 0, 0, 0, 0, 22,
+ 23, 0, 0, 0, 48, 0, 0, 26, 49
+};
- 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. */
+static const short yycheck[] =
+{
+ 7, 0, 29, 7, 4, 27, 46, 47, 1, 182,
+ 41, 41, 249, 29, 34, 41, 1, 254, 40, 4,
+ 1, 4, 41, 27, 57, 174, 1, 59, 1, 4,
+ 61, 46, 63, 63, 57, 39, 40, 61, 1, 59,
+ 1, 55, 46, 47, 57, 49, 5, 10, 16, 17,
+ 18, 4, 45, 60, 22, 23, 56, 25, 26, 66,
+ 22, 23, 58, 25, 45, 58, 70, 35, 72, 73,
+ 74, 75, 45, 35, 57, 79, 249, 226, 41, 60,
+ 48, 254, 45, 58, 45, 32, 48, 60, 13, 93,
+ 57, 9, 37, 38, 58, 58, 14, 58, 94, 34,
+ 63, 29, 30, 110, 4, 109, 57, 57, 57, 113,
+ 106, 107, 181, 59, 82, 83, 84, 85, 86, 87,
+ 82, 83, 84, 85, 86, 87, 153, 154, 46, 47,
+ 157, 63, 159, 4, 58, 162, 104, 153, 154, 22,
+ 167, 157, 104, 159, 151, 10, 162, 3, 4, 57,
+ 4, 191, 19, 160, 158, 30, 11, 25, 126, 186,
+ 229, 168, 231, 166, 9, 169, 50, 51, 52, 14,
+ 186, 55, 176, 177, 201, 177, 180, 173, 247, 236,
+ 202, 208, 251, 39, 40, 201, 193, 191, 210, 34,
+ 197, 260, 261, 48, 49, 50, 51, 52, 202, 26,
+ 55, 46, 47, 126, 200, 192, 210, 234, 204, -1,
+ -1, 218, -1, 235, 241, 222, 153, 154, 225, 9,
+ 157, -1, 159, -1, 14, 162, -1, -1, 232, -1,
+ 234, 235, -1, 240, 9, 242, -1, 233, 245, 246,
+ -1, 248, -1, 239, 34, 35, 36, 243, 11, 186,
+ -1, 258, 259, 43, -1, -1, 46, 47, -1, 255,
+ -1, 257, 0, 1, 201, 3, 4, -1, 236, 7,
+ 8, 46, 47, 63, -1, -1, 244, -1, 16, 17,
+ -1, -1, 244, -1, -1, 48, 49, 50, 51, 52,
+ -1, -1, 55, 31, 32, -1, -1, -1, -1, 37,
+ 38, 39, 40, 41, 42, -1, -1, -1, -1, -1,
+ 48, 49, -1, 51, 1, 53, 3, 4, 56, 57,
+ 7, 8, -1, 61, -1, 63, -1, -1, -1, -1,
+ -1, 18, -1, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, -1, 32, 33, -1, -1, -1,
+ 37, 38, 39, 40, -1, 42, -1, -1, -1, -1,
+ -1, 48, 49, 9, 51, -1, 53, 9, 14, 56,
+ 57, -1, 14, -1, 61, 62, 63, 1, -1, 3,
+ 4, 12, 13, 7, 8, -1, 10, -1, 34, 35,
+ 36, -1, 34, 35, -1, -1, -1, 43, -1, 45,
+ 46, 47, -1, -1, 46, 47, 37, 38, 32, -1,
+ -1, 42, 58, 37, 38, 39, 40, 41, 42, -1,
+ -1, -1, -1, -1, 48, 49, -1, 51, -1, 53,
+ -1, -1, 56, 57, 58, -1, 3, 4, -1, 63,
+ 7, 8, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 18, -1, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, -1, 32, 33, -1, -1, -1,
+ 37, 38, 39, 40, 9, 42, -1, -1, -1, 14,
+ -1, 48, 49, -1, 51, -1, 53, 3, 4, 56,
+ 57, 7, 8, -1, 61, -1, 63, -1, -1, 34,
+ 35, 36, -1, -1, -1, -1, -1, 1, 43, 3,
+ 4, 46, 47, 7, 8, -1, 32, -1, -1, -1,
+ -1, 37, 38, 39, 40, -1, 42, -1, -1, -1,
+ -1, -1, 48, 49, -1, 51, -1, 53, 32, -1,
+ 56, 57, -1, 37, 38, 39, 40, 63, 42, -1,
+ -1, -1, -1, -1, 48, 49, -1, 51, -1, 53,
+ -1, -1, 56, 57, 58, 1, -1, 3, 4, -1,
+ -1, 7, 8, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 1, -1, 3,
+ 4, -1, -1, 7, 8, -1, 32, -1, -1, -1,
+ -1, 37, 38, 39, 40, -1, 42, -1, -1, -1,
+ -1, -1, 48, 49, -1, 51, -1, 53, 32, -1,
+ 56, 57, 9, 37, 38, 39, 40, 14, 42, -1,
+ -1, -1, -1, -1, 48, 49, -1, 51, -1, 53,
+ 3, 4, 56, 57, 7, 8, -1, 34, 35, 36,
+ -1, -1, -1, -1, -1, -1, 43, -1, 21, 46,
+ 47, -1, -1, -1, 27, 28, -1, -1, -1, 32,
+ -1, 58, -1, 9, 37, 38, 39, 40, 14, 42,
+ -1, -1, -1, -1, -1, 48, 49, -1, 51, -1,
+ 53, 3, 4, 56, 57, 7, 8, -1, 34, 35,
+ 36, -1, -1, -1, -1, -1, -1, 43, 44, 21,
+ 46, 47, -1, 3, 4, 27, 28, 7, 8, -1,
+ 32, -1, -1, -1, -1, 37, 38, 39, 40, -1,
+ 42, -1, -1, -1, -1, -1, 48, 49, -1, 51,
+ -1, 53, 32, -1, 56, 57, 9, 37, 38, 39,
+ 40, 14, 42, -1, -1, -1, -1, -1, 48, 49,
+ -1, 51, -1, 53, 3, 4, 56, 57, 7, 8,
+ -1, 34, 35, 36, -1, -1, -1, -1, -1, -1,
+ 43, -1, 45, 46, 47, -1, 3, 4, -1, -1,
+ 7, 8, -1, 32, -1, -1, -1, -1, 37, 38,
+ 39, 40, -1, 42, -1, -1, -1, -1, -1, 48,
+ 49, -1, 51, -1, 53, 32, -1, 56, 57, -1,
+ 37, 38, 39, 40, 3, 4, -1, -1, 7, 8,
+ -1, 48, 49, -1, -1, -1, 53, -1, -1, 56,
+ 57, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 37, 38,
+ 39, 40, -1, -1, -1, -1, -1, -1, -1, 48,
+ 49, -1, -1, -1, 53, -1, -1, 56, 57
+};
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
+static const unsigned char yystos[] =
+{
+ 0, 41, 65, 89, 90, 0, 41, 66, 1, 3,
+ 4, 7, 8, 16, 17, 31, 32, 37, 38, 39,
+ 40, 42, 48, 49, 51, 53, 56, 57, 67, 68,
+ 72, 74, 76, 90, 97, 101, 102, 103, 105, 57,
+ 59, 73, 104, 105, 105, 105, 57, 57, 53, 57,
+ 102, 105, 102, 74, 102, 103, 105, 1, 96, 97,
+ 61, 63, 69, 78, 89, 106, 110, 69, 75, 9,
+ 14, 34, 35, 36, 43, 45, 46, 47, 99, 100,
+ 102, 11, 48, 49, 50, 51, 52, 55, 12, 13,
+ 37, 38, 42, 98, 95, 96, 97, 96, 3, 4,
+ 39, 40, 70, 71, 46, 91, 95, 95, 97, 1,
+ 45, 58, 108, 111, 108, 90, 77, 90, 5, 97,
+ 4, 97, 97, 97, 97, 97, 32, 102, 102, 102,
+ 102, 102, 102, 13, 97, 108, 60, 57, 102, 108,
+ 108, 97, 90, 34, 1, 97, 1, 18, 20, 21,
+ 22, 23, 24, 25, 26, 27, 28, 29, 30, 33,
+ 62, 79, 81, 84, 88, 97, 106, 107, 110, 44,
+ 104, 1, 4, 92, 93, 4, 57, 80, 4, 57,
+ 57, 90, 57, 78, 78, 78, 94, 97, 78, 90,
+ 78, 82, 77, 109, 110, 90, 97, 108, 1, 111,
+ 97, 94, 59, 4, 97, 79, 4, 81, 83, 78,
+ 57, 85, 95, 107, 90, 90, 1, 4, 108, 78,
+ 96, 58, 108, 22, 34, 110, 97, 10, 86, 90,
+ 60, 90, 57, 4, 90, 111, 87, 79, 79, 97,
+ 108, 97, 110, 96, 101, 19, 108, 90, 110, 90,
+ 108, 90, 90, 79, 90, 83, 79, 83, 108, 108,
+ 90, 90, 79, 79
+};
-/* This is the parser code that is written into each bison parser
- when the %semantic_parser declaration is not specified in the grammar.
- It was written by Richard Stallman by simplifying the hairy parser
- used when %semantic_parser is specified. */
-
-#ifndef YYSTACK_USE_ALLOCA
-#ifdef alloca
-#define YYSTACK_USE_ALLOCA
-#else /* alloca not defined */
-#ifdef __GNUC__
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#else /* not GNU C. */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
-#define YYSTACK_USE_ALLOCA
-#include <alloca.h>
-#else /* not sparc */
-/* We think this test detects Watcom and Microsoft C. */
-/* This used to test MSDOS, but that is a bad idea
- since that symbol is in the user namespace. */
-#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
-#if 0 /* No need for malloc.h, which pollutes the namespace;
- instead, just don't use alloca. */
-#include <malloc.h>
+#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
+# define YYSIZE_T __SIZE_TYPE__
#endif
-#else /* not MSDOS, or __TURBOC__ */
-#if defined(_AIX)
-/* I don't know what this was needed for, but it pollutes the namespace.
- So I turned it off. rms, 2 May 1997. */
-/* #include <malloc.h> */
- #pragma alloca
-#define YYSTACK_USE_ALLOCA
-#else /* not MSDOS, or __TURBOC__, or _AIX */
-#if 0
-#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
- and on HPUX 10. Eventually we can turn this on. */
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#endif /* __hpux */
+#if ! defined (YYSIZE_T) && defined (size_t)
+# define YYSIZE_T size_t
#endif
-#endif /* not _AIX */
-#endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc */
-#endif /* not GNU C */
-#endif /* alloca not defined */
-#endif /* YYSTACK_USE_ALLOCA not defined */
-
-#undef YYSTACK_USE_ALLOCA /* Gawk: nuke alloca once and for all */
-
-#ifdef YYSTACK_USE_ALLOCA
-#define YYSTACK_ALLOC alloca
-#else
-#define YYSTACK_ALLOC malloc
+#if ! defined (YYSIZE_T)
+# if defined (__STDC__) || defined (__cplusplus)
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
+#endif
+#if ! defined (YYSIZE_T)
+# define YYSIZE_T unsigned int
#endif
-
-/* Note: there must be only one dollar sign in this file.
- It is replaced by the list of actions, each action
- as one case of the switch. */
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY -2
+#define YYEMPTY (-2)
#define YYEOF 0
+
#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
+#define YYABORT goto yyabortlab
#define YYERROR goto yyerrlab1
-/* Like YYERROR except do call yyerror.
- This remains here temporarily to ease the
- transition to the new meaning of YYERROR, for GCC.
+
+/* Like YYERROR except do call yyerror. This remains here temporarily
+ to ease the transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
+
#define YYFAIL goto yyerrlab
+
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(token, value) \
+
+#define YYBACKUP(Token, Value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
- { yychar = (token), yylval = (value); \
- yychar1 = YYTRANSLATE (yychar); \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ yytoken = YYTRANSLATE (yychar); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
- { yyerror ("syntax error: cannot back up"); YYERROR; } \
+ { \
+ yyerror ("syntax error: cannot back up");\
+ YYERROR; \
+ } \
while (0)
#define YYTERROR 1
#define YYERRCODE 256
-#ifndef YYPURE
-#define YYLEX yylex()
-#endif
+/* YYLLOC_DEFAULT -- Compute the default location (before the actions
+ are run). */
-#ifdef YYPURE
-#ifdef YYLSP_NEEDED
-#ifdef YYLEX_PARAM
-#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
-#else
-#define YYLEX yylex(&yylval, &yylloc)
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ Current.first_line = Rhs[1].first_line; \
+ Current.first_column = Rhs[1].first_column; \
+ Current.last_line = Rhs[N].last_line; \
+ Current.last_column = Rhs[N].last_column;
#endif
-#else /* not YYLSP_NEEDED */
+
+/* YYLEX -- calling `yylex' with the right arguments. */
+
#ifdef YYLEX_PARAM
-#define YYLEX yylex(&yylval, YYLEX_PARAM)
+# define YYLEX yylex (YYLEX_PARAM)
#else
-#define YYLEX yylex(&yylval)
-#endif
-#endif /* not YYLSP_NEEDED */
+# define YYLEX yylex ()
#endif
-/* If nonreentrant, generate the variables here */
-
-#ifndef YYPURE
+/* Enable debugging if requested. */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+# define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (0)
+
+# define YYDSYMPRINT(Args) \
+do { \
+ if (yydebug) \
+ yysymprint Args; \
+} while (0)
+
+# define YYDSYMPRINTF(Title, Token, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yysymprint (stderr, \
+ Token, Value); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (0)
-int yychar; /* the lookahead symbol */
-YYSTYPE yylval; /* the semantic value of the */
- /* lookahead symbol */
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (cinluded). |
+`------------------------------------------------------------------*/
-#ifdef YYLSP_NEEDED
-YYLTYPE yylloc; /* location data for the lookahead */
- /* symbol */
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_stack_print (short *bottom, short *top)
+#else
+static void
+yy_stack_print (bottom, top)
+ short *bottom;
+ short *top;
#endif
+{
+ YYFPRINTF (stderr, "Stack now");
+ for (/* Nothing. */; bottom <= top; ++bottom)
+ YYFPRINTF (stderr, " %d", *bottom);
+ YYFPRINTF (stderr, "\n");
+}
-int yynerrs; /* number of parse errors so far */
-#endif /* not YYPURE */
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
+} while (0)
-#if YYDEBUG != 0
-int yydebug; /* nonzero means print parse trace */
-/* Since this is uninitialized, it does not stop multiple parsers
- from coexisting. */
-#endif
-/* YYINITDEPTH indicates the initial size of the parser's stacks */
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced. |
+`------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_reduce_print (int yyrule)
+#else
+static void
+yy_reduce_print (yyrule)
+ int yyrule;
+#endif
+{
+ int yyi;
+ unsigned int yylineno = yyrline[yyrule];
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
+ yyrule - 1, yylineno);
+ /* Print the symbols being reduced, and their result. */
+ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
+ YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
+ YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+}
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
+ yy_reduce_print (Rule); \
+} while (0)
+
+/* Nonzero means print parse trace. It is left uninitialized so that
+ multiple parsers can coexist. */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YYDSYMPRINT(Args)
+# define YYDSYMPRINTF(Title, Token, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks. */
#ifndef YYINITDEPTH
-#define YYINITDEPTH 200
+# define YYINITDEPTH 200
#endif
-/* YYMAXDEPTH is the maximum size the stacks can grow to
- (effective only if the built-in stack extension method is used). */
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+ if the built-in stack extension method is used).
+
+ Do not make this value too large; the results are undefined if
+ SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+ evaluated with infinite-precision integer arithmetic. */
#if YYMAXDEPTH == 0
-#undef YYMAXDEPTH
+# undef YYMAXDEPTH
#endif
#ifndef YYMAXDEPTH
-#define YYMAXDEPTH 10000
+# define YYMAXDEPTH 10000
#endif
+
-/* Define __yy_memcpy. Note that the size argument
- should be passed with type unsigned int, because that is what the non-GCC
- definitions require. With GCC, __builtin_memcpy takes an arg
- of type size_t, but it can handle unsigned int. */
-
-#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
-#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
-#else /* not GNU C or C++ */
-#ifndef __cplusplus
-
-/* This is the most reliable way to avoid incompatibilities
- in available built-in functions on various systems. */
-static void
-__yy_memcpy (to, from, count)
- char *to;
- char *from;
- unsigned int count;
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+# if defined (__GLIBC__) && defined (_STRING_H)
+# define yystrlen strlen
+# else
+/* Return the length of YYSTR. */
+static YYSIZE_T
+# if defined (__STDC__) || defined (__cplusplus)
+yystrlen (const char *yystr)
+# else
+yystrlen (yystr)
+ const char *yystr;
+# endif
{
- register char *f = from;
- register char *t = to;
- register int i = count;
+ register const char *yys = yystr;
+
+ while (*yys++ != '\0')
+ continue;
- while (i-- > 0)
- *t++ = *f++;
+ return yys - yystr - 1;
}
+# endif
+# endif
+
+# ifndef yystpcpy
+# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+# define yystpcpy stpcpy
+# else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+ YYDEST. */
+static char *
+# if defined (__STDC__) || defined (__cplusplus)
+yystpcpy (char *yydest, const char *yysrc)
+# else
+yystpcpy (yydest, yysrc)
+ char *yydest;
+ const char *yysrc;
+# endif
+{
+ register char *yyd = yydest;
+ register const char *yys = yysrc;
+
+ while ((*yyd++ = *yys++) != '\0')
+ continue;
+
+ return yyd - 1;
+}
+# endif
+# endif
-#else /* __cplusplus */
+#endif /* !YYERROR_VERBOSE */
-/* This is the most reliable way to avoid incompatibilities
- in available built-in functions on various systems. */
+
+
+#if YYDEBUG
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
+#else
static void
-__yy_memcpy (char *to, char *from, unsigned int count)
+yysymprint (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE *yyvaluep;
+#endif
{
- register char *t = to;
- register char *f = from;
- register int i = count;
+ /* Pacify ``unused variable'' warnings. */
+ (void) yyvaluep;
+
+ if (yytype < YYNTOKENS)
+ {
+ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+# ifdef YYPRINT
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# endif
+ }
+ else
+ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
- while (i-- > 0)
- *t++ = *f++;
+ switch (yytype)
+ {
+ default:
+ break;
+ }
+ YYFPRINTF (yyoutput, ")");
}
+#endif /* ! YYDEBUG */
+/*-----------------------------------------------.
+| Release the memory associated to this symbol. |
+`-----------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yydestruct (int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yytype, yyvaluep)
+ int yytype;
+ YYSTYPE *yyvaluep;
#endif
-#endif
+{
+ /* Pacify ``unused variable'' warnings. */
+ (void) yyvaluep;
+
+ switch (yytype)
+ {
+
+ default:
+ break;
+ }
+}
-#line 217 "/usr/lib/bison.simple"
-/* The user can define YYPARSE_PARAM as the name of an argument to be passed
- into yyparse. The argument should have type void *.
- It should actually point to an object.
- Grammar actions can access the variable by casting it
- to the proper pointer type. */
+/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
-#ifdef __cplusplus
-#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL
-#else /* not __cplusplus */
-#define YYPARSE_PARAM_ARG YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
-#endif /* not __cplusplus */
-#else /* not YYPARSE_PARAM */
-#define YYPARSE_PARAM_ARG
-#define YYPARSE_PARAM_DECL
-#endif /* not YYPARSE_PARAM */
-
-/* Prevent warning if -Wstrict-prototypes. */
-#ifdef __GNUC__
-#ifdef YYPARSE_PARAM
-int yyparse (void *);
-#else
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM);
+# else
+int yyparse ();
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
int yyparse (void);
+#else
+int yyparse ();
#endif
-#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+/* The lookahead symbol. */
+int yychar;
+
+/* The semantic value of the lookahead symbol. */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far. */
+int yynerrs;
+
+
+
+/*----------.
+| yyparse. |
+`----------*/
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM)
+# else
+int yyparse (YYPARSE_PARAM)
+ void *YYPARSE_PARAM;
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int
+yyparse (void)
+#else
int
-yyparse(YYPARSE_PARAM_ARG)
- YYPARSE_PARAM_DECL
+yyparse ()
+
+#endif
+#endif
{
+
register int yystate;
register int yyn;
+ int yyresult;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+ /* Lookahead token as an internal (translated) token number. */
+ int yytoken = 0;
+
+ /* Three stacks and their tools:
+ `yyss': related to states,
+ `yyvs': related to semantic values,
+ `yyls': related to locations.
+
+ Refer to the stacks thru separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+
+ /* The state stack. */
+ short yyssa[YYINITDEPTH];
+ short *yyss = yyssa;
register short *yyssp;
- register YYSTYPE *yyvsp;
- int yyerrstatus; /* number of tokens to shift before error messages enabled */
- int yychar1 = 0; /* lookahead token as an internal (translated) token number */
- short yyssa[YYINITDEPTH]; /* the state stack */
- YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs = yyvsa;
+ register YYSTYPE *yyvsp;
- short *yyss = yyssa; /* refer to the stacks thru separate pointers */
- YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
-#ifdef YYLSP_NEEDED
- YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
- YYLTYPE *yyls = yylsa;
- YYLTYPE *yylsp;
-#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
-#else
#define YYPOPSTACK (yyvsp--, yyssp--)
-#endif
- int yystacksize = YYINITDEPTH;
- int yyfree_stacks = 0;
+ YYSIZE_T yystacksize = YYINITDEPTH;
-#ifdef YYPURE
- int yychar;
- YYSTYPE yylval;
- int yynerrs;
-#ifdef YYLSP_NEEDED
- YYLTYPE yylloc;
-#endif
-#endif
+ /* The variables used to return semantic value and location from the
+ action routines. */
+ YYSTYPE yyval;
- YYSTYPE yyval; /* the variable used to return */
- /* semantic values from the action */
- /* routines */
+ /* When reducing, the number of symbols on the RHS of the reduced
+ rule. */
int yylen;
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Starting parse\n");
-#endif
+ YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
@@ -1113,110 +1320,96 @@ yyparse(YYPARSE_PARAM_ARG)
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
- yyssp = yyss - 1;
+ yyssp = yyss;
yyvsp = yyvs;
-#ifdef YYLSP_NEEDED
- yylsp = yyls;
-#endif
-/* Push a new state, which is found in yystate . */
-/* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks. */
-yynewstate:
+ goto yysetstate;
- *++yyssp = yystate;
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate. |
+`------------------------------------------------------------*/
+ yynewstate:
+ /* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks.
+ */
+ yyssp++;
- if (yyssp >= yyss + yystacksize - 1)
- {
- /* Give user a chance to reallocate the stack */
- /* Use copies of these so that the &'s don't force the real ones into memory. */
- YYSTYPE *yyvs1 = yyvs;
- short *yyss1 = yyss;
-#ifdef YYLSP_NEEDED
- YYLTYPE *yyls1 = yyls;
-#endif
+ yysetstate:
+ *yyssp = yystate;
+ if (yyss + yystacksize - 1 <= yyssp)
+ {
/* Get the current used size of the three stacks, in elements. */
- int size = yyssp - yyss + 1;
+ YYSIZE_T yysize = yyssp - yyss + 1;
#ifdef yyoverflow
- /* Each stack pointer address is followed by the size of
- the data in use in that stack, in bytes. */
-#ifdef YYLSP_NEEDED
- /* This used to be a conditional around just the two extra args,
- but that might be undefined if yyoverflow is a macro. */
- yyoverflow("parser stack overflow",
- &yyss1, size * sizeof (*yyssp),
- &yyvs1, size * sizeof (*yyvsp),
- &yyls1, size * sizeof (*yylsp),
- &yystacksize);
-#else
- yyoverflow("parser stack overflow",
- &yyss1, size * sizeof (*yyssp),
- &yyvs1, size * sizeof (*yyvsp),
- &yystacksize);
-#endif
-
- yyss = yyss1; yyvs = yyvs1;
-#ifdef YYLSP_NEEDED
- yyls = yyls1;
-#endif
+ {
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. This used to be a
+ conditional around just the two extra args, but that might
+ be undefined if yyoverflow is a macro. */
+ yyoverflow ("parser stack overflow",
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+
+ &yystacksize);
+
+ yyss = yyss1;
+ yyvs = yyvs1;
+ }
#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+ goto yyoverflowlab;
+# else
/* Extend the stack our own way. */
- if (yystacksize >= YYMAXDEPTH)
- {
- yyerror("parser stack overflow");
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
-#ifdef YYLSP_NEEDED
- free (yyls);
-#endif
- }
- return 2;
- }
+ if (YYMAXDEPTH <= yystacksize)
+ goto yyoverflowlab;
yystacksize *= 2;
- if (yystacksize > YYMAXDEPTH)
+ if (YYMAXDEPTH < yystacksize)
yystacksize = YYMAXDEPTH;
-#ifndef YYSTACK_USE_ALLOCA
- yyfree_stacks = 1;
-#endif
- yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
- __yy_memcpy ((char *)yyss, (char *)yyss1,
- size * (unsigned int) sizeof (*yyssp));
- yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
- __yy_memcpy ((char *)yyvs, (char *)yyvs1,
- size * (unsigned int) sizeof (*yyvsp));
-#ifdef YYLSP_NEEDED
- yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
- __yy_memcpy ((char *)yyls, (char *)yyls1,
- size * (unsigned int) sizeof (*yylsp));
-#endif
+
+ {
+ short *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyoverflowlab;
+ YYSTACK_RELOCATE (yyss);
+ YYSTACK_RELOCATE (yyvs);
+
+# undef YYSTACK_RELOCATE
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
+ }
+# endif
#endif /* no yyoverflow */
- yyssp = yyss + size - 1;
- yyvsp = yyvs + size - 1;
-#ifdef YYLSP_NEEDED
- yylsp = yyls + size - 1;
-#endif
+ yyssp = yyss + yysize - 1;
+ yyvsp = yyvs + yysize - 1;
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Stack size increased to %d\n", yystacksize);
-#endif
- if (yyssp >= yyss + yystacksize - 1)
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+ (unsigned long int) yystacksize));
+
+ if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Entering state %d\n", yystate);
-#endif
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
goto yybackup;
- yybackup:
+
+/*-----------.
+| yybackup. |
+`-----------*/
+yybackup:
/* Do appropriate processing given the current state. */
/* Read a lookahead token if we need one and don't already have one. */
@@ -1225,294 +1418,238 @@ yynewstate:
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
- if (yyn == YYFLAG)
+ if (yyn == YYPACT_NINF)
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
- /* yychar is either YYEMPTY or YYEOF
- or a valid token in external form. */
-
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
if (yychar == YYEMPTY)
{
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Reading a token: ");
-#endif
+ YYDPRINTF ((stderr, "Reading a token: "));
yychar = YYLEX;
}
- /* Convert token to internal form (in yychar1) for indexing tables with */
-
- if (yychar <= 0) /* This means end of input. */
+ if (yychar <= YYEOF)
{
- yychar1 = 0;
- yychar = YYEOF; /* Don't call YYLEX any more */
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Now at end of input.\n");
-#endif
+ yychar = yytoken = YYEOF;
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
}
else
{
- yychar1 = YYTRANSLATE(yychar);
-
-#if YYDEBUG != 0
- if (yydebug)
- {
- fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
- /* Give the individual parser a way to print the precise meaning
- of a token, for further debugging info. */
-#ifdef YYPRINT
- YYPRINT (stderr, yychar, yylval);
-#endif
- fprintf (stderr, ")\n");
- }
-#endif
+ yytoken = YYTRANSLATE (yychar);
+ YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
}
- yyn += yychar1;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
+ /* If the proper action on seeing token YYTOKEN is to reduce or to
+ detect an error, take that action. */
+ yyn += yytoken;
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
goto yydefault;
-
yyn = yytable[yyn];
-
- /* yyn is what to do for this token type in this state.
- Negative => reduce, -yyn is rule number.
- Positive => shift, yyn is new state.
- New state is final state => don't bother to shift,
- just return success.
- 0, or most negative number => error. */
-
- if (yyn < 0)
+ if (yyn <= 0)
{
- if (yyn == YYFLAG)
+ if (yyn == 0 || yyn == YYTABLE_NINF)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
- else if (yyn == 0)
- goto yyerrlab;
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the lookahead token. */
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
-#endif
+ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
- *++yylsp = yylloc;
-#endif
- /* count tokens shifted since error; after three, turn off error status. */
- if (yyerrstatus) yyerrstatus--;
+
+ /* Count tokens shifted since error; after three, turn off error
+ status. */
+ if (yyerrstatus)
+ yyerrstatus--;
yystate = yyn;
goto yynewstate;
-/* Do the default action for the current state. */
-yydefault:
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state. |
+`-----------------------------------------------------------*/
+yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
+ goto yyreduce;
+
-/* Do a reduction. yyn is the number of a rule to reduce with. */
+/*-----------------------------.
+| yyreduce -- Do a reduction. |
+`-----------------------------*/
yyreduce:
+ /* yyn is the number of a rule to reduce with. */
yylen = yyr2[yyn];
- if (yylen > 0)
- yyval = yyvsp[1-yylen]; /* implement default value of the action */
-#if YYDEBUG != 0
- if (yydebug)
- {
- int i;
+ /* If YYLEN is nonzero, implement the default value of the action:
+ `$$ = $1'.
- fprintf (stderr, "Reducing via rule %d (line %d), ",
- yyn, yyrline[yyn]);
+ Otherwise, the following line sets YYVAL to garbage.
+ This behavior is undocumented and Bison
+ users should not rely upon it. Assigning to YYVAL
+ unconditionally makes the parser a bit smaller, and it avoids a
+ GCC warning that YYVAL may be used uninitialized. */
+ yyval = yyvsp[1-yylen];
- /* Print the symbols being reduced, and their result. */
- for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
- fprintf (stderr, "%s ", yytname[yyrhs[i]]);
- fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
- }
-#endif
+ YY_REDUCE_PRINT (yyn);
+ switch (yyn)
+ {
+ case 2:
+#line 171 "awkgram.y"
+ {
+ check_funcs();
+ }
+ break;
- switch (yyn) {
+ case 4:
+#line 179 "awkgram.y"
+ {
+ begin_or_end_rule = parsing_end_rule = FALSE;
+ yyerrok;
+ }
+ break;
-case 1:
-#line 160 "awkgram.y"
-{
- expression_value = yyvsp[-1].nodeval;
- check_funcs();
- ;
- break;}
-case 2:
-#line 168 "awkgram.y"
-{
- if (yyvsp[0].nodeval != NULL)
- yyval.nodeval = yyvsp[0].nodeval;
- else
- yyval.nodeval = NULL;
- yyerrok;
- ;
- break;}
-case 3:
-#line 177 "awkgram.y"
-{
- if (yyvsp[0].nodeval == NULL)
- yyval.nodeval = yyvsp[-1].nodeval;
- else if (yyvsp[-1].nodeval == NULL)
- yyval.nodeval = yyvsp[0].nodeval;
- else {
- if (yyvsp[-1].nodeval->type != Node_rule_list)
- yyvsp[-1].nodeval = node(yyvsp[-1].nodeval, Node_rule_list,
- (NODE*) NULL);
- yyval.nodeval = append_right(yyvsp[-1].nodeval,
- node(yyvsp[0].nodeval, Node_rule_list, (NODE *) NULL));
- }
- yyerrok;
- ;
- break;}
-case 4:
-#line 191 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 5:
-#line 192 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 6:
-#line 193 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 7:
+ case 5:
+#line 184 "awkgram.y"
+ {
+ begin_or_end_rule = parsing_end_rule = FALSE;
+ yyerrok;
+ /*
+ * If errors, give up, don't produce an infinite
+ * stream of syntax error message.
+ */
+ return;
+ }
+ break;
+
+ case 6:
#line 197 "awkgram.y"
-{ io_allowed = FALSE; ;
- break;}
-case 8:
-#line 199 "awkgram.y"
-{
- if (begin_block != NULL) {
- if (begin_block->type != Node_rule_list)
- begin_block = node(begin_block, Node_rule_list,
- (NODE *) NULL);
- (void) append_right(begin_block, node(
- node((NODE *) NULL, Node_rule_node, yyvsp[0].nodeval),
- Node_rule_list, (NODE *) NULL) );
- } else
- begin_block = node((NODE *) NULL, Node_rule_node, yyvsp[0].nodeval);
- yyval.nodeval = NULL;
- io_allowed = TRUE;
- yyerrok;
- ;
- break;}
-case 9:
-#line 213 "awkgram.y"
-{ io_allowed = FALSE; parsing_end_rule = TRUE; ;
- break;}
-case 10:
-#line 215 "awkgram.y"
-{
- if (end_block != NULL) {
- if (end_block->type != Node_rule_list)
- end_block = node(end_block, Node_rule_list,
- (NODE *) NULL);
- (void) append_right (end_block, node(
- node((NODE *) NULL, Node_rule_node, yyvsp[0].nodeval),
- Node_rule_list, (NODE *) NULL));
- } else
- end_block = node((NODE *) NULL, Node_rule_node, yyvsp[0].nodeval);
- yyval.nodeval = NULL;
- io_allowed = TRUE;
- parsing_end_rule = FALSE;
- yyerrok;
- ;
- break;}
-case 11:
-#line 231 "awkgram.y"
-{
- warning(_("BEGIN blocks must have an action part"));
- errcount++;
- yyerrok;
- ;
- break;}
-case 12:
-#line 237 "awkgram.y"
-{
- warning(_("END blocks must have an action part"));
- errcount++;
- yyerrok;
- ;
- break;}
-case 13:
-#line 243 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_rule_node, yyvsp[0].nodeval); yyerrok; ;
- break;}
-case 14:
-#line 245 "awkgram.y"
-{ yyval.nodeval = node((NODE *) NULL, Node_rule_node, yyvsp[0].nodeval); yyerrok; ;
- break;}
-case 15:
-#line 247 "awkgram.y"
-{
- yyval.nodeval = node(yyvsp[-1].nodeval,
- Node_rule_node,
- node(node(node(make_number(0.0),
- Node_field_spec,
- (NODE *) NULL),
- Node_expression_list,
- (NODE *) NULL),
- Node_K_print,
- (NODE *) NULL));
- yyerrok;
- ;
- break;}
-case 16:
-#line 260 "awkgram.y"
-{
+ {
+ yyvsp[-1].nodeval->rnode = yyvsp[0].nodeval;
+ }
+ break;
+
+ case 7:
+#line 201 "awkgram.y"
+ {
+ if (yyvsp[-1].nodeval->lnode != NULL) {
+ /* pattern rule with non-empty pattern */
+ yyvsp[-1].nodeval->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++;
+ }
+ }
+ break;
+
+ case 8:
+#line 216 "awkgram.y"
+ {
+ can_return = FALSE;
+ if (yyvsp[-1].nodeval)
func_install(yyvsp[-1].nodeval, yyvsp[0].nodeval);
- yyval.nodeval = NULL;
- yyerrok;
- ;
- break;}
-case 17:
-#line 269 "awkgram.y"
-{ yyval.sval = yyvsp[0].sval; ;
- break;}
-case 18:
-#line 271 "awkgram.y"
-{ yyval.sval = yyvsp[0].sval; ;
- break;}
-case 19:
-#line 273 "awkgram.y"
-{
+ yyerrok;
+ }
+ break;
+
+ case 9:
+#line 226 "awkgram.y"
+ {
+ yyval.nodeval = append_pattern(&expression_value, (NODE *) NULL);
+ }
+ break;
+
+ case 10:
+#line 230 "awkgram.y"
+ {
+ yyval.nodeval = append_pattern(&expression_value, yyvsp[0].nodeval);
+ }
+ break;
+
+ case 11:
+#line 234 "awkgram.y"
+ {
+ NODE *r;
+
+ getnode(r);
+ r->type = Node_line_range;
+ r->condpair = node(yyvsp[-2].nodeval, Node_cond_pair, yyvsp[0].nodeval);
+ r->triggered = FALSE;
+ yyval.nodeval = append_pattern(&expression_value, r);
+ }
+ break;
+
+ case 12:
+#line 244 "awkgram.y"
+ {
+ begin_or_end_rule = TRUE;
+ yyval.nodeval = append_pattern(&begin_block, (NODE *) NULL);
+ }
+ break;
+
+ case 13:
+#line 249 "awkgram.y"
+ {
+ begin_or_end_rule = parsing_end_rule = TRUE;
+ yyval.nodeval = append_pattern(&end_block, (NODE *) NULL);
+ }
+ break;
+
+ case 14:
+#line 257 "awkgram.y"
+ { yyval.nodeval = yyvsp[-3].nodeval; }
+ break;
+
+ case 15:
+#line 262 "awkgram.y"
+ { yyval.sval = yyvsp[0].sval; }
+ break;
+
+ case 16:
+#line 264 "awkgram.y"
+ { yyval.sval = yyvsp[0].sval; }
+ break;
+
+ case 17:
+#line 266 "awkgram.y"
+ {
yyerror(_("`%s' is a built-in function, it cannot be redefined"),
tokstart);
errcount++;
+ yyval.sval = builtin_func;
/* yyerrok; */
- ;
- break;}
-case 22:
-#line 288 "awkgram.y"
-{
+ }
+ break;
+
+ case 20:
+#line 282 "awkgram.y"
+ {
param_counter = 0;
- ;
- break;}
-case 23:
-#line 292 "awkgram.y"
-{
+ }
+ break;
+
+ case 21:
+#line 286 "awkgram.y"
+ {
NODE *t;
t = make_param(yyvsp[-4].sval);
@@ -1522,112 +1659,94 @@ case 23:
/* check for duplicate parameter names */
if (dup_parms(yyval.nodeval))
errcount++;
- ;
- break;}
-case 24:
+ }
+ break;
+
+ case 22:
+#line 305 "awkgram.y"
+ { ++want_regexp; }
+ break;
+
+ case 23:
#line 307 "awkgram.y"
-{
- yyval.nodeval = yyvsp[-3].nodeval;
- can_return = FALSE;
- ;
- break;}
-case 25:
-#line 312 "awkgram.y"
-{
- yyval.nodeval = node((NODE *) NULL, Node_K_return, (NODE *) NULL);
- can_return = FALSE;
- ;
- break;}
-case 26:
-#line 321 "awkgram.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
- break;}
-case 27:
-#line 323 "awkgram.y"
-{ yyval.nodeval = mkrangenode(node(yyvsp[-2].nodeval, Node_cond_pair, yyvsp[0].nodeval)); ;
- break;}
-case 28:
-#line 332 "awkgram.y"
-{ ++want_regexp; ;
- break;}
-case 29:
-#line 334 "awkgram.y"
-{
+ {
NODE *n;
- size_t len;
+ size_t len = strlen(yyvsp[0].sval);
+ if (do_lint && (yyvsp[0].sval)[0] == '*') {
+ /* possible C comment */
+ if ((yyvsp[0].sval)[len-1] == '*')
+ lintwarn(_("regexp constant `/%s/' looks like a C comment, but is not"), tokstart);
+ }
getnode(n);
n->type = Node_regex;
- len = strlen(yyvsp[-1].sval);
- n->re_exp = make_string(yyvsp[-1].sval, len);
- n->re_reg = make_regexp(yyvsp[-1].sval, len, FALSE, TRUE);
+ n->re_exp = make_string(yyvsp[0].sval, len);
+ n->re_reg = make_regexp(yyvsp[0].sval, len, FALSE);
n->re_text = NULL;
n->re_flags = CONST;
- n->re_cnt = 1;
yyval.nodeval = n;
- ;
- break;}
-case 30:
-#line 352 "awkgram.y"
-{ yyval.nodeval = yyvsp[-3].nodeval; ;
- break;}
-case 31:
-#line 354 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 32:
-#line 359 "awkgram.y"
-{
- yyval.nodeval = yyvsp[0].nodeval;
- if (do_lint && isnoeffect(yyval.nodeval->type))
+ }
+ break;
+
+ case 26:
+#line 333 "awkgram.y"
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 27:
+#line 335 "awkgram.y"
+ {
+ if (yyvsp[0].nodeval == NULL)
+ yyval.nodeval = yyvsp[-1].nodeval;
+ else {
+ if (do_lint && isnoeffect(yyvsp[0].nodeval->type))
lintwarn(_("statement may have no effect"));
- ;
- break;}
-case 33:
+ if (yyvsp[-1].nodeval == NULL)
+ yyval.nodeval = yyvsp[0].nodeval;
+ else
+ yyval.nodeval = append_right(
+ (yyvsp[-1].nodeval->type == Node_statement_list ? yyvsp[-1].nodeval
+ : node(yyvsp[-1].nodeval, Node_statement_list, (NODE *) NULL)),
+ (yyvsp[0].nodeval->type == Node_statement_list ? yyvsp[0].nodeval
+ : node(yyvsp[0].nodeval, Node_statement_list, (NODE *) NULL)));
+ }
+ yyerrok;
+ }
+ break;
+
+ case 28:
+#line 353 "awkgram.y"
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 31:
+#line 363 "awkgram.y"
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 32:
#line 365 "awkgram.y"
-{
- if (yyvsp[-1].nodeval == NULL || yyvsp[-1].nodeval->type != Node_statement_list)
- yyvsp[-1].nodeval = node(yyvsp[-1].nodeval, Node_statement_list, (NODE *) NULL);
- yyval.nodeval = append_right(yyvsp[-1].nodeval,
- node(yyvsp[0].nodeval, Node_statement_list, (NODE *) NULL));
- yyerrok;
- ;
- break;}
-case 34:
+ { yyval.nodeval = yyvsp[-1].nodeval; }
+ break;
+
+ case 33:
+#line 367 "awkgram.y"
+ { yyval.nodeval = yyvsp[0].nodeval; }
+ break;
+
+ case 34:
+#line 369 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-3].nodeval, Node_K_while, yyvsp[0].nodeval); }
+ break;
+
+ case 35:
+#line 371 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-2].nodeval, Node_K_do, yyvsp[-5].nodeval); }
+ break;
+
+ case 36:
#line 373 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 35:
-#line 375 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 38:
-#line 385 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 39:
-#line 387 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 40:
-#line 389 "awkgram.y"
-{ yyval.nodeval = yyvsp[-1].nodeval; ;
- break;}
-case 41:
-#line 391 "awkgram.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
- break;}
-case 42:
-#line 393 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-3].nodeval, Node_K_while, yyvsp[0].nodeval); ;
- break;}
-case 43:
-#line 395 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_K_do, yyvsp[-5].nodeval); ;
- break;}
-case 44:
-#line 397 "awkgram.y"
-{
+ {
/*
* Efficiency hack. Recognize the special case of
*
@@ -1665,44 +1784,49 @@ case 44:
make_for_loop(variable(yyvsp[-5].sval, CAN_FREE, Node_var),
(NODE *) NULL, variable(yyvsp[-3].sval, CAN_FREE, Node_var_array)));
}
- ;
- break;}
-case 45:
-#line 437 "awkgram.y"
-{
+ }
+ break;
+
+ case 37:
+#line 413 "awkgram.y"
+ {
yyval.nodeval = node(yyvsp[0].nodeval, Node_K_for, (NODE *) make_for_loop(yyvsp[-9].nodeval, yyvsp[-6].nodeval, yyvsp[-3].nodeval));
- ;
- break;}
-case 46:
-#line 441 "awkgram.y"
-{
+ }
+ break;
+
+ case 38:
+#line 417 "awkgram.y"
+ {
yyval.nodeval = node(yyvsp[0].nodeval, Node_K_for,
(NODE *) make_for_loop(yyvsp[-8].nodeval, (NODE *) NULL, yyvsp[-3].nodeval));
- ;
- break;}
-case 47:
-#line 447 "awkgram.y"
-{ yyval.nodeval = node((NODE *) NULL, Node_K_break, (NODE *) NULL); ;
- break;}
-case 48:
-#line 450 "awkgram.y"
-{ yyval.nodeval = node((NODE *) NULL, Node_K_continue, (NODE *) NULL); ;
- break;}
-case 49:
-#line 452 "awkgram.y"
-{ NODETYPE type;
-
- if (! io_allowed)
- yyerror(_("`next' used in BEGIN or END action"));
+ }
+ break;
+
+ case 39:
+#line 423 "awkgram.y"
+ { yyval.nodeval = node((NODE *) NULL, Node_K_break, (NODE *) NULL); }
+ break;
+
+ case 40:
+#line 426 "awkgram.y"
+ { yyval.nodeval = node((NODE *) NULL, Node_K_continue, (NODE *) NULL); }
+ break;
+
+ case 41:
+#line 428 "awkgram.y"
+ { NODETYPE type;
+
+ if (begin_or_end_rule)
+ yyerror(_("`%s' used in %s action"), "next",
+ (parsing_end_rule ? "END" : "BEGIN"));
type = Node_K_next;
yyval.nodeval = node((NODE *) NULL, type, (NODE *) NULL);
- ;
- break;}
-case 50:
-#line 460 "awkgram.y"
-{
- if (do_lint)
- lintwarn(_("`nextfile' is a gawk extension"));
+ }
+ break;
+
+ case 42:
+#line 437 "awkgram.y"
+ {
if (do_traditional) {
/*
* can't use yyerror, since may have overshot
@@ -1711,68 +1835,83 @@ case 50:
errcount++;
error(_("`nextfile' is a gawk extension"));
}
- if (! io_allowed) {
+ if (do_lint)
+ lintwarn(_("`nextfile' is a gawk extension"));
+ if (begin_or_end_rule) {
/* same thing */
errcount++;
- error(_("`nextfile' used in BEGIN or END action"));
+ error(_("`%s' used in %s action"), "nextfile",
+ (parsing_end_rule ? "END" : "BEGIN"));
}
yyval.nodeval = node((NODE *) NULL, Node_K_nextfile, (NODE *) NULL);
- ;
- break;}
-case 51:
-#line 479 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_exit, (NODE *) NULL); ;
- break;}
-case 52:
-#line 481 "awkgram.y"
-{
+ }
+ break;
+
+ case 43:
+#line 457 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_exit, (NODE *) NULL); }
+ break;
+
+ case 44:
+#line 459 "awkgram.y"
+ {
if (! can_return)
yyerror(_("`return' used outside function context"));
- ;
- break;}
-case 53:
-#line 486 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_return, (NODE *) NULL); ;
- break;}
-case 55:
-#line 500 "awkgram.y"
-{
- yyval.nodeval = node(yyvsp[-2].nodeval, yyvsp[-4].nodetypeval, yyvsp[0].nodeval);
- if (yyval.nodeval->type == Node_K_printf)
- count_args(yyval.nodeval);
- ;
- break;}
-case 56:
-#line 506 "awkgram.y"
-{
- if (yyvsp[-2].nodetypeval == Node_K_print && yyvsp[-1].nodeval == NULL) {
- static int warned = FALSE;
+ }
+ break;
- yyvsp[-1].nodeval = node(node(make_number(0.0),
- Node_field_spec,
- (NODE *) NULL),
- Node_expression_list,
- (NODE *) NULL);
+ case 45:
+#line 464 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_return, (NODE *) NULL); }
+ break;
- if (do_lint && ! io_allowed && ! warned) {
- warned = TRUE;
- lintwarn(
+ case 47:
+#line 477 "awkgram.y"
+ { in_print = TRUE; in_parens = 0; }
+ break;
+
+ case 48:
+#line 478 "awkgram.y"
+ {
+ /*
+ * 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 (yyvsp[-3].nodetypeval == Node_K_print &&
+ (yyvsp[-1].nodeval == NULL
+ || (yyvsp[-1].nodeval->type == Node_expression_list
+ && yyvsp[-1].nodeval->rnode == NULL
+ && yyvsp[-1].nodeval->lnode->type == Node_field_spec
+ && yyvsp[-1].nodeval->lnode->lnode->type == Node_val
+ && yyvsp[-1].nodeval->lnode->lnode->numbr == 0.0))
+ ) {
+ static int warned = FALSE;
+
+ yyval.nodeval = node(NULL, Node_K_print_rec, yyvsp[0].nodeval);
+
+ if (do_lint && yyvsp[-1].nodeval == NULL && begin_or_end_rule && ! warned) {
+ warned = TRUE;
+ lintwarn(
_("plain `print' in BEGIN or END rule should probably be `print \"\"'"));
- }
}
-
- yyval.nodeval = node(yyvsp[-1].nodeval, yyvsp[-2].nodetypeval, yyvsp[0].nodeval);
+ } else {
+ yyval.nodeval = node(yyvsp[-1].nodeval, yyvsp[-3].nodetypeval, yyvsp[0].nodeval);
if (yyval.nodeval->type == Node_K_printf)
count_args(yyval.nodeval);
- ;
- break;}
-case 57:
-#line 528 "awkgram.y"
-{ yyval.nodeval = node(variable(yyvsp[-3].sval, CAN_FREE, Node_var_array), Node_K_delete, yyvsp[-1].nodeval); ;
- break;}
-case 58:
-#line 530 "awkgram.y"
-{
+ }
+ }
+ break;
+
+ case 49:
+#line 509 "awkgram.y"
+ { yyval.nodeval = node(variable(yyvsp[-3].sval, CAN_FREE, Node_var_array), Node_K_delete, yyvsp[-1].nodeval); }
+ break;
+
+ case 50:
+#line 511 "awkgram.y"
+ {
if (do_lint)
lintwarn(_("`delete array' is a gawk extension"));
if (do_traditional) {
@@ -1784,467 +1923,457 @@ case 58:
error(_("`delete array' is a gawk extension"));
}
yyval.nodeval = node(variable(yyvsp[0].sval, CAN_FREE, Node_var_array), Node_K_delete, (NODE *) NULL);
- ;
- break;}
-case 59:
-#line 544 "awkgram.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
- break;}
-case 60:
-#line 549 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 61:
-#line 551 "awkgram.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
- break;}
-case 62:
-#line 556 "awkgram.y"
-{ yyval.nodetypeval = yyvsp[0].nodetypeval; ;
- break;}
-case 63:
-#line 558 "awkgram.y"
-{ yyval.nodetypeval = yyvsp[0].nodetypeval; ;
- break;}
-case 64:
-#line 563 "awkgram.y"
-{
+ }
+ break;
+
+ case 51:
+#line 525 "awkgram.y"
+ {
+ /* 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"));
+ }
+ yyval.nodeval = node(variable(yyvsp[-1].sval, CAN_FREE, Node_var_array), Node_K_delete, (NODE *) NULL);
+ }
+ break;
+
+ case 52:
+#line 540 "awkgram.y"
+ { yyval.nodeval = yyvsp[0].nodeval; }
+ break;
+
+ case 53:
+#line 545 "awkgram.y"
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 54:
+#line 547 "awkgram.y"
+ { yyval.nodeval = yyvsp[0].nodeval; }
+ break;
+
+ case 58:
+#line 562 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-3].nodeval, Node_expression_list, yyvsp[-1].nodeval); }
+ break;
+
+ case 59:
+#line 567 "awkgram.y"
+ {
+ in_print = FALSE;
+ in_parens = 0;
+ yyval.nodeval = NULL;
+ }
+ break;
+
+ case 60:
+#line 572 "awkgram.y"
+ { in_print = FALSE; in_parens = 0; }
+ break;
+
+ case 61:
+#line 573 "awkgram.y"
+ {
+ yyval.nodeval = node(yyvsp[0].nodeval, yyvsp[-2].nodetypeval, (NODE *) NULL);
+ if (yyvsp[-2].nodetypeval == Node_redirect_twoway
+ && yyvsp[0].nodeval->type == Node_K_getline
+ && yyvsp[0].nodeval->rnode->type == Node_redirect_twoway)
+ yyerror(_("multistage two-way pipelines don't work"));
+ }
+ break;
+
+ case 62:
+#line 584 "awkgram.y"
+ {
yyval.nodeval = node(yyvsp[-3].nodeval, Node_K_if,
node(yyvsp[0].nodeval, Node_if_branches, (NODE *) NULL));
- ;
- break;}
-case 65:
-#line 569 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-6].nodeval, Node_K_if,
- node(yyvsp[-3].nodeval, Node_if_branches, yyvsp[0].nodeval)); ;
- break;}
-case 66:
-#line 575 "awkgram.y"
-{ want_assign = FALSE; ;
- break;}
-case 70:
-#line 586 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 71:
-#line 588 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_input, (NODE *) NULL); ;
- break;}
-case 72:
-#line 593 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 73:
-#line 595 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_output, (NODE *) NULL); ;
- break;}
-case 74:
-#line 597 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_append, (NODE *) NULL); ;
- break;}
-case 75:
-#line 599 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_pipe, (NODE *) NULL); ;
- break;}
-case 76:
-#line 601 "awkgram.y"
-{
- if (yyvsp[0].nodeval->type == Node_K_getline
- && yyvsp[0].nodeval->rnode->type == Node_redirect_twoway)
- yyerror(_("multistage two-way pipelines don't work"));
- yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_twoway, (NODE *) NULL);
- ;
- break;}
-case 77:
-#line 611 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 78:
+ }
+ break;
+
+ case 63:
+#line 590 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-6].nodeval, Node_K_if,
+ node(yyvsp[-3].nodeval, Node_if_branches, yyvsp[0].nodeval)); }
+ break;
+
+ case 68:
+#line 606 "awkgram.y"
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 69:
+#line 608 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[0].nodeval, Node_redirect_input, (NODE *) NULL); }
+ break;
+
+ case 70:
#line 613 "awkgram.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
- break;}
-case 79:
-#line 618 "awkgram.y"
-{ yyval.nodeval = make_param(yyvsp[0].sval); ;
- break;}
-case 80:
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 71:
+#line 615 "awkgram.y"
+ { yyval.nodeval = yyvsp[0].nodeval; }
+ break;
+
+ case 72:
#line 620 "awkgram.y"
-{ yyval.nodeval = append_right(yyvsp[-2].nodeval, make_param(yyvsp[0].sval)); yyerrok; ;
- break;}
-case 81:
+ { yyval.nodeval = make_param(yyvsp[0].sval); }
+ break;
+
+ case 73:
#line 622 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 82:
+ { yyval.nodeval = append_right(yyvsp[-2].nodeval, make_param(yyvsp[0].sval)); yyerrok; }
+ break;
+
+ case 74:
#line 624 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 83:
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 75:
#line 626 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 84:
-#line 632 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 85:
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 76:
+#line 628 "awkgram.y"
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 77:
#line 634 "awkgram.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
- break;}
-case 86:
-#line 639 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 87:
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 78:
+#line 636 "awkgram.y"
+ { yyval.nodeval = yyvsp[0].nodeval; }
+ break;
+
+ case 79:
#line 641 "awkgram.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
- break;}
-case 88:
-#line 646 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL); ;
- break;}
-case 89:
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 80:
+#line 643 "awkgram.y"
+ { yyval.nodeval = yyvsp[0].nodeval; }
+ break;
+
+ case 81:
#line 648 "awkgram.y"
-{
- yyval.nodeval = append_right(yyvsp[-2].nodeval,
- node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL));
- yyerrok;
- ;
- break;}
-case 90:
-#line 654 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 91:
+ { yyval.nodeval = node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL); }
+ break;
+
+ case 82:
+#line 650 "awkgram.y"
+ {
+ yyval.nodeval = append_right(yyvsp[-2].nodeval,
+ node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL));
+ yyerrok;
+ }
+ break;
+
+ case 83:
#line 656 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 92:
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 84:
#line 658 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 93:
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 85:
#line 660 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 94:
-#line 665 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 95:
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 86:
+#line 662 "awkgram.y"
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 87:
#line 667 "awkgram.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
- break;}
-case 96:
-#line 672 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL); ;
- break;}
-case 97:
-#line 674 "awkgram.y"
-{
- yyval.nodeval = append_right(yyvsp[-2].nodeval,
- node(yyvsp[0].nodeval, Node_expression_list, (NODE *) NULL));
- yyerrok;
- ;
- break;}
-case 98:
-#line 680 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 99:
-#line 682 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 100:
-#line 684 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 101:
-#line 686 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 102:
-#line 691 "awkgram.y"
-{ want_assign = FALSE; ;
- break;}
-case 103:
-#line 693 "awkgram.y"
-{
+ {
if (do_lint && yyvsp[0].nodeval->type == Node_regex)
lintwarn(_("regular expression on right of assignment"));
- yyval.nodeval = node(yyvsp[-3].nodeval, yyvsp[-2].nodetypeval, yyvsp[0].nodeval);
- ;
- break;}
-case 104:
-#line 699 "awkgram.y"
-{ yyval.nodeval = node(variable(yyvsp[0].sval, CAN_FREE, Node_var_array), Node_in_array, yyvsp[-3].nodeval); ;
- break;}
-case 105:
-#line 701 "awkgram.y"
-{
- yyval.nodeval = node(yyvsp[0].nodeval, Node_K_getline,
- node(yyvsp[-3].nodeval, Node_redirect_pipein, (NODE *) NULL));
- ;
- break;}
-case 106:
-#line 706 "awkgram.y"
-{
- yyval.nodeval = node(yyvsp[0].nodeval, Node_K_getline,
- node(yyvsp[-3].nodeval, Node_redirect_twoway, (NODE *) NULL));
- ;
- break;}
-case 107:
-#line 711 "awkgram.y"
-{
- if (do_lint && ! io_allowed && parsing_end_rule && yyvsp[0].nodeval == NULL)
- lintwarn(_("non-redirected `getline' undefined inside END action"));
- yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_getline, yyvsp[0].nodeval);
- ;
- break;}
-case 108:
-#line 717 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_and, yyvsp[0].nodeval); ;
- break;}
-case 109:
-#line 719 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_or, yyvsp[0].nodeval); ;
- break;}
-case 110:
-#line 721 "awkgram.y"
-{
+ yyval.nodeval = node(yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, yyvsp[0].nodeval);
+ }
+ break;
+
+ case 88:
+#line 673 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-2].nodeval, Node_and, yyvsp[0].nodeval); }
+ break;
+
+ case 89:
+#line 675 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-2].nodeval, Node_or, yyvsp[0].nodeval); }
+ break;
+
+ case 90:
+#line 677 "awkgram.y"
+ {
if (yyvsp[-2].nodeval->type == Node_regex)
warning(_("regular expression on left of `~' or `!~' operator"));
yyval.nodeval = node(yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, mk_rexp(yyvsp[0].nodeval));
- ;
- break;}
-case 111:
-#line 727 "awkgram.y"
-{
- yyval.nodeval = yyvsp[0].nodeval;
- if (do_lint && tokstart[0] == '*') {
- /* possible C comment */
- int n = strlen(tokstart) - 1;
- if (tokstart[n] == '*')
- lintwarn(_("regexp constant `/%s/' looks like a C comment, but is not"), tokstart);
- }
- ;
- break;}
-case 112:
-#line 737 "awkgram.y"
-{
+ }
+ break;
+
+ case 91:
+#line 683 "awkgram.y"
+ { yyval.nodeval = node(variable(yyvsp[0].sval, CAN_FREE, Node_var_array), Node_in_array, yyvsp[-2].nodeval); }
+ break;
+
+ case 92:
+#line 685 "awkgram.y"
+ {
+ if (do_lint && yyvsp[0].nodeval->type == Node_regex)
+ lintwarn(_("regular expression on right of comparison"));
+ yyval.nodeval = node(yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, yyvsp[0].nodeval);
+ }
+ break;
+
+ case 93:
+#line 691 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-4].nodeval, Node_cond_exp, node(yyvsp[-2].nodeval, Node_if_branches, yyvsp[0].nodeval));}
+ break;
+
+ case 94:
+#line 693 "awkgram.y"
+ { yyval.nodeval = yyvsp[0].nodeval; }
+ break;
+
+ case 95:
+#line 698 "awkgram.y"
+ { yyval.nodetypeval = yyvsp[0].nodetypeval; }
+ break;
+
+ case 96:
+#line 700 "awkgram.y"
+ { yyval.nodetypeval = yyvsp[0].nodetypeval; }
+ break;
+
+ case 97:
+#line 702 "awkgram.y"
+ { yyval.nodetypeval = Node_assign_quotient; }
+ break;
+
+ case 98:
+#line 707 "awkgram.y"
+ { yyval.nodetypeval = yyvsp[0].nodetypeval; }
+ break;
+
+ case 99:
+#line 709 "awkgram.y"
+ { yyval.nodetypeval = Node_less; }
+ break;
+
+ case 101:
+#line 714 "awkgram.y"
+ { yyval.nodetypeval = Node_greater; }
+ break;
+
+ case 102:
+#line 719 "awkgram.y"
+ { yyval.nodeval = yyvsp[0].nodeval; }
+ break;
+
+ case 103:
+#line 721 "awkgram.y"
+ {
yyval.nodeval = node(node(make_number(0.0),
Node_field_spec,
(NODE *) NULL),
Node_nomatch,
yyvsp[0].nodeval);
- ;
- break;}
-case 113:
-#line 745 "awkgram.y"
-{ yyval.nodeval = node(variable(yyvsp[0].sval, CAN_FREE, Node_var_array), Node_in_array, yyvsp[-2].nodeval); ;
- break;}
-case 114:
-#line 747 "awkgram.y"
-{
- if (do_lint && yyvsp[0].nodeval->type == Node_regex)
- lintwarn(_("regular expression on right of comparison"));
- yyval.nodeval = node(yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, yyvsp[0].nodeval);
- ;
- break;}
-case 115:
-#line 753 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_less, yyvsp[0].nodeval); ;
- break;}
-case 116:
-#line 755 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_greater, yyvsp[0].nodeval); ;
- break;}
-case 117:
-#line 757 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-4].nodeval, Node_cond_exp, node(yyvsp[-2].nodeval, Node_if_branches, yyvsp[0].nodeval));;
- break;}
-case 118:
-#line 759 "awkgram.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
- break;}
-case 119:
-#line 761 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_concat, yyvsp[0].nodeval); ;
- break;}
-case 120:
-#line 766 "awkgram.y"
-{ want_assign = FALSE; ;
- break;}
-case 121:
-#line 768 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-3].nodeval, yyvsp[-2].nodetypeval, yyvsp[0].nodeval); ;
- break;}
-case 122:
+ }
+ break;
+
+ case 104:
+#line 729 "awkgram.y"
+ { yyval.nodeval = node(variable(yyvsp[0].sval, CAN_FREE, Node_var_array), Node_in_array, yyvsp[-3].nodeval); }
+ break;
+
+ case 105:
+#line 731 "awkgram.y"
+ { yyval.nodeval = yyvsp[0].nodeval; }
+ break;
+
+ case 106:
+#line 733 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-1].nodeval, Node_concat, yyvsp[0].nodeval); }
+ break;
+
+ case 108:
+#line 740 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-2].nodeval, Node_exp, yyvsp[0].nodeval); }
+ break;
+
+ case 109:
+#line 742 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-2].nodeval, Node_times, yyvsp[0].nodeval); }
+ break;
+
+ case 110:
+#line 744 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-2].nodeval, Node_quotient, yyvsp[0].nodeval); }
+ break;
+
+ case 111:
+#line 746 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-2].nodeval, Node_mod, yyvsp[0].nodeval); }
+ break;
+
+ case 112:
+#line 748 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-2].nodeval, Node_plus, yyvsp[0].nodeval); }
+ break;
+
+ case 113:
+#line 750 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-2].nodeval, Node_minus, yyvsp[0].nodeval); }
+ break;
+
+ case 114:
+#line 752 "awkgram.y"
+ {
+ if (do_lint && parsing_end_rule && yyvsp[0].nodeval == NULL)
+ lintwarn(_("non-redirected `getline' undefined inside END action"));
+ yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_getline, yyvsp[0].nodeval);
+ }
+ break;
+
+ case 115:
+#line 758 "awkgram.y"
+ {
+ yyval.nodeval = node(yyvsp[0].nodeval, Node_K_getline,
+ node(yyvsp[-3].nodeval, yyvsp[-2].nodetypeval, (NODE *) NULL));
+ }
+ break;
+
+ case 116:
+#line 763 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-1].nodeval, Node_postincrement, (NODE *) NULL); }
+ break;
+
+ case 117:
+#line 765 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[-1].nodeval, Node_postdecrement, (NODE *) NULL); }
+ break;
+
+ case 118:
#line 770 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_and, yyvsp[0].nodeval); ;
- break;}
-case 123:
+ { yyval.nodeval = node(yyvsp[0].nodeval, Node_not, (NODE *) NULL); }
+ break;
+
+ case 119:
#line 772 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_or, yyvsp[0].nodeval); ;
- break;}
-case 124:
-#line 774 "awkgram.y"
-{
- if (do_lint && ! io_allowed && yyvsp[0].nodeval == NULL)
- lintwarn(_("non-redirected `getline' undefined inside BEGIN or END action"));
- yyval.nodeval = node(yyvsp[-1].nodeval, Node_K_getline, yyvsp[0].nodeval);
- ;
- break;}
-case 125:
-#line 780 "awkgram.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
- break;}
-case 126:
-#line 782 "awkgram.y"
-{ yyval.nodeval = node((NODE *) NULL, Node_nomatch, yyvsp[0].nodeval); ;
- break;}
-case 127:
-#line 784 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, mk_rexp(yyvsp[0].nodeval)); ;
- break;}
-case 128:
-#line 786 "awkgram.y"
-{ yyval.nodeval = node(variable(yyvsp[0].sval, CAN_FREE, Node_var_array), Node_in_array, yyvsp[-2].nodeval); ;
- break;}
-case 129:
-#line 788 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-2].nodeval, yyvsp[-1].nodetypeval, yyvsp[0].nodeval); ;
- break;}
-case 130:
-#line 790 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-4].nodeval, Node_cond_exp, node(yyvsp[-2].nodeval, Node_if_branches, yyvsp[0].nodeval));;
- break;}
-case 131:
-#line 792 "awkgram.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
- break;}
-case 132:
-#line 794 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_concat, yyvsp[0].nodeval); ;
- break;}
-case 134:
-#line 801 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_exp, yyvsp[0].nodeval); ;
- break;}
-case 135:
-#line 803 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_times, yyvsp[0].nodeval); ;
- break;}
-case 136:
-#line 805 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_quotient, yyvsp[0].nodeval); ;
- break;}
-case 137:
-#line 807 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_mod, yyvsp[0].nodeval); ;
- break;}
-case 138:
-#line 809 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_plus, yyvsp[0].nodeval); ;
- break;}
-case 139:
-#line 811 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-2].nodeval, Node_minus, yyvsp[0].nodeval); ;
- break;}
-case 140:
-#line 813 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_postincrement, (NODE *) NULL); ;
- break;}
-case 141:
-#line 815 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[-1].nodeval, Node_postdecrement, (NODE *) NULL); ;
- break;}
-case 142:
-#line 820 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[0].nodeval, Node_not, (NODE *) NULL); ;
- break;}
-case 143:
-#line 822 "awkgram.y"
-{ yyval.nodeval = yyvsp[-1].nodeval; ;
- break;}
-case 144:
-#line 825 "awkgram.y"
-{ yyval.nodeval = snode(yyvsp[-1].nodeval, Node_builtin, (int) yyvsp[-3].lval); ;
- break;}
-case 145:
-#line 827 "awkgram.y"
-{ yyval.nodeval = snode(yyvsp[-1].nodeval, Node_builtin, (int) yyvsp[-3].lval); ;
- break;}
-case 146:
-#line 829 "awkgram.y"
-{
+ { yyval.nodeval = yyvsp[-1].nodeval; }
+ break;
+
+ case 120:
+#line 775 "awkgram.y"
+ { yyval.nodeval = snode(yyvsp[-1].nodeval, Node_builtin, (int) yyvsp[-3].lval); }
+ break;
+
+ case 121:
+#line 777 "awkgram.y"
+ { yyval.nodeval = snode(yyvsp[-1].nodeval, Node_builtin, (int) yyvsp[-3].lval); }
+ break;
+
+ case 122:
+#line 779 "awkgram.y"
+ {
if (do_lint)
lintwarn(_("call of `length' without parentheses is not portable"));
yyval.nodeval = snode((NODE *) NULL, Node_builtin, (int) yyvsp[0].lval);
if (do_posix)
warning(_("call of `length' without parentheses is deprecated by POSIX"));
- ;
- break;}
-case 147:
-#line 837 "awkgram.y"
-{
+ }
+ break;
+
+ case 123:
+#line 787 "awkgram.y"
+ {
yyval.nodeval = node(yyvsp[-1].nodeval, Node_func_call, make_string(yyvsp[-3].sval, strlen(yyvsp[-3].sval)));
+ yyval.nodeval->funcbody = NULL;
func_use(yyvsp[-3].sval, FUNC_USE);
param_sanity(yyvsp[-1].nodeval);
free(yyvsp[-3].sval);
- ;
- break;}
-case 149:
-#line 845 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[0].nodeval, Node_preincrement, (NODE *) NULL); ;
- break;}
-case 150:
-#line 847 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[0].nodeval, Node_predecrement, (NODE *) NULL); ;
- break;}
-case 151:
-#line 849 "awkgram.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
- break;}
-case 152:
-#line 851 "awkgram.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
- break;}
-case 153:
-#line 854 "awkgram.y"
-{
- if (yyvsp[0].nodeval->type == Node_val && (yyvsp[0].nodeval->flags & (STR|STRING)) == 0) {
+ }
+ break;
+
+ case 125:
+#line 796 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[0].nodeval, Node_preincrement, (NODE *) NULL); }
+ break;
+
+ case 126:
+#line 798 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[0].nodeval, Node_predecrement, (NODE *) NULL); }
+ break;
+
+ case 127:
+#line 800 "awkgram.y"
+ { yyval.nodeval = yyvsp[0].nodeval; }
+ break;
+
+ case 128:
+#line 802 "awkgram.y"
+ { yyval.nodeval = yyvsp[0].nodeval; }
+ break;
+
+ case 129:
+#line 805 "awkgram.y"
+ {
+ if (yyvsp[0].nodeval->type == Node_val && (yyvsp[0].nodeval->flags & (STRCUR|STRING)) == 0) {
yyvsp[0].nodeval->numbr = -(force_number(yyvsp[0].nodeval));
yyval.nodeval = yyvsp[0].nodeval;
} else
yyval.nodeval = node(yyvsp[0].nodeval, Node_unary_minus, (NODE *) NULL);
- ;
- break;}
-case 154:
-#line 862 "awkgram.y"
-{
+ }
+ break;
+
+ case 130:
+#line 813 "awkgram.y"
+ {
/*
* was: $$ = $2
* POSIX semantics: force a conversion to numeric type
*/
yyval.nodeval = node (make_number(0.0), Node_plus, yyvsp[0].nodeval);
- ;
- break;}
-case 155:
-#line 873 "awkgram.y"
-{ yyval.nodeval = NULL; ;
- break;}
-case 156:
-#line 875 "awkgram.y"
-{ yyval.nodeval = yyvsp[0].nodeval; ;
- break;}
-case 157:
-#line 880 "awkgram.y"
-{ yyval.nodeval = variable(yyvsp[0].sval, CAN_FREE, Node_var); ;
- break;}
-case 158:
-#line 882 "awkgram.y"
-{
+ }
+ break;
+
+ case 131:
+#line 824 "awkgram.y"
+ { yyval.nodeval = NULL; }
+ break;
+
+ case 132:
+#line 826 "awkgram.y"
+ { yyval.nodeval = yyvsp[0].nodeval; }
+ break;
+
+ case 133:
+#line 831 "awkgram.y"
+ { yyval.nodeval = variable(yyvsp[0].sval, CAN_FREE, Node_var); }
+ break;
+
+ case 134:
+#line 833 "awkgram.y"
+ {
if (yyvsp[-1].nodeval == NULL) {
fatal(_("invalid subscript expression"));
} else if (yyvsp[-1].nodeval->rnode == NULL) {
@@ -2252,251 +2381,248 @@ case 158:
freenode(yyvsp[-1].nodeval);
} else
yyval.nodeval = node(variable(yyvsp[-3].sval, CAN_FREE, Node_var_array), Node_subscript, yyvsp[-1].nodeval);
- ;
- break;}
-case 159:
-#line 892 "awkgram.y"
-{ yyval.nodeval = node(yyvsp[0].nodeval, Node_field_spec, (NODE *) NULL); ;
- break;}
-case 161:
-#line 900 "awkgram.y"
-{ yyerrok; ;
- break;}
-case 162:
-#line 904 "awkgram.y"
-{ yyerrok; ;
- break;}
-case 165:
-#line 913 "awkgram.y"
-{ yyerrok; want_assign = FALSE; ;
- break;}
-case 166:
-#line 916 "awkgram.y"
-{ yyerrok; ;
- break;}
-}
- /* the action file gets copied in in place of this dollarsign */
-#line 543 "/usr/lib/bison.simple"
+ }
+ break;
+
+ case 135:
+#line 843 "awkgram.y"
+ { yyval.nodeval = node(yyvsp[0].nodeval, Node_field_spec, (NODE *) NULL); }
+ break;
+
+ case 137:
+#line 851 "awkgram.y"
+ { yyerrok; }
+ break;
+
+ case 138:
+#line 855 "awkgram.y"
+ { yyerrok; }
+ break;
+
+ case 141:
+#line 864 "awkgram.y"
+ { yyerrok; }
+ break;
+
+ case 142:
+#line 867 "awkgram.y"
+ { yyerrok; }
+ break;
+
+
+ }
+
+/* Line 991 of yacc.c. */
+#line 2414 "y.tab.c"
yyvsp -= yylen;
yyssp -= yylen;
-#ifdef YYLSP_NEEDED
- yylsp -= yylen;
-#endif
-#if YYDEBUG != 0
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- fprintf (stderr, "state stack now");
- while (ssp1 != yyssp)
- fprintf (stderr, " %d", *++ssp1);
- fprintf (stderr, "\n");
- }
-#endif
+
+ YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval;
-#ifdef YYLSP_NEEDED
- yylsp++;
- if (yylen == 0)
- {
- yylsp->first_line = yylloc.first_line;
- yylsp->first_column = yylloc.first_column;
- yylsp->last_line = (yylsp-1)->last_line;
- yylsp->last_column = (yylsp-1)->last_column;
- yylsp->text = 0;
- }
- else
- {
- yylsp->last_line = (yylsp+yylen-1)->last_line;
- yylsp->last_column = (yylsp+yylen-1)->last_column;
- }
-#endif
- /* Now "shift" the result of the reduction.
- Determine what state that goes to,
- based on the state we popped back to
- and the rule number reduced by. */
+ /* Now `shift' the result of the reduction. Determine what state
+ that goes to, based on the state we popped back to and the rule
+ number reduced by. */
yyn = yyr1[yyn];
- yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
- if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
- yystate = yydefgoto[yyn - YYNTBASE];
+ yystate = yydefgoto[yyn - YYNTOKENS];
goto yynewstate;
-yyerrlab: /* here on detecting error */
- if (! yyerrstatus)
- /* If not already recovering from an error, report this error. */
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+ /* If not already recovering from an error, report this error. */
+ if (!yyerrstatus)
{
++yynerrs;
-
-#ifdef YYERROR_VERBOSE
+#if YYERROR_VERBOSE
yyn = yypact[yystate];
- if (yyn > YYFLAG && yyn < YYLAST)
+ if (YYPACT_NINF < yyn && yyn < YYLAST)
{
- int size = 0;
- char *msg;
- int x, count;
-
- count = 0;
- /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
- for (x = (yyn < 0 ? -yyn : 0);
- x < (sizeof(yytname) / sizeof(char *)); x++)
- if (yycheck[x + yyn] == x)
- size += strlen(yytname[x]) + 15, count++;
- msg = (char *) malloc(size + 15);
- if (msg != 0)
+ YYSIZE_T yysize = 0;
+ int yytype = YYTRANSLATE (yychar);
+ char *yymsg;
+ int yyx, yycount;
+
+ yycount = 0;
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ for (yyx = yyn < 0 ? -yyn : 0;
+ yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ yysize += yystrlen (yytname[yyx]) + 15, yycount++;
+ yysize += yystrlen ("syntax error, unexpected ") + 1;
+ yysize += yystrlen (yytname[yytype]);
+ yymsg = (char *) YYSTACK_ALLOC (yysize);
+ if (yymsg != 0)
{
- strcpy(msg, "parse error");
+ char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
+ yyp = yystpcpy (yyp, yytname[yytype]);
- if (count < 5)
+ if (yycount < 5)
{
- count = 0;
- for (x = (yyn < 0 ? -yyn : 0);
- x < (sizeof(yytname) / sizeof(char *)); x++)
- if (yycheck[x + yyn] == x)
+ yycount = 0;
+ for (yyx = yyn < 0 ? -yyn : 0;
+ yyx < (int) (sizeof (yytname) / sizeof (char *));
+ yyx++)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
- strcat(msg, count == 0 ? ", expecting `" : " or `");
- strcat(msg, yytname[x]);
- strcat(msg, "'");
- count++;
+ const char *yyq = ! yycount ? ", expecting " : " or ";
+ yyp = yystpcpy (yyp, yyq);
+ yyp = yystpcpy (yyp, yytname[yyx]);
+ yycount++;
}
}
- yyerror(msg);
- free(msg);
+ yyerror (yymsg);
+ YYSTACK_FREE (yymsg);
}
else
- yyerror ("parse error; also virtual memory exceeded");
+ yyerror ("syntax error; also virtual memory exhausted");
}
else
#endif /* YYERROR_VERBOSE */
- yyerror("parse error");
+ yyerror ("syntax error");
}
- goto yyerrlab1;
-yyerrlab1: /* here on error raised explicitly by an action */
+
if (yyerrstatus == 3)
{
- /* if just tried and failed to reuse lookahead token after an error, discard it. */
+ /* If just tried and failed to reuse lookahead token after an
+ error, discard it. */
- /* return failure if at end of input */
+ /* Return failure if at end of input. */
if (yychar == YYEOF)
- YYABORT;
-
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
-#endif
+ {
+ /* Pop the error token. */
+ YYPOPSTACK;
+ /* Pop the rest of the stack. */
+ while (yyss < yyssp)
+ {
+ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+ yydestruct (yystos[*yyssp], yyvsp);
+ YYPOPSTACK;
+ }
+ YYABORT;
+ }
+ YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
+ yydestruct (yytoken, &yylval);
yychar = YYEMPTY;
- }
- /* Else will try to reuse lookahead token
- after shifting the error token. */
+ }
- yyerrstatus = 3; /* Each real token shifted decrements this */
+ /* Else will try to reuse lookahead token after shifting the error
+ token. */
+ goto yyerrlab2;
- goto yyerrhandle;
-yyerrdefault: /* current state does not do anything special for the error token. */
+/*----------------------------------------------------.
+| yyerrlab1 -- error raised explicitly by an action. |
+`----------------------------------------------------*/
+yyerrlab1:
-#if 0
- /* This is wrong; only states that explicitly want error tokens
- should shift them. */
- yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
- if (yyn) goto yydefault;
+ /* Suppress GCC warning that yyerrlab1 is unused when no action
+ invokes YYERROR. */
+#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
+ __attribute__ ((__unused__))
#endif
-yyerrpop: /* pop the current state because it cannot handle the error token */
- if (yyssp == yyss) YYABORT;
- yyvsp--;
- yystate = *--yyssp;
-#ifdef YYLSP_NEEDED
- yylsp--;
-#endif
+ goto yyerrlab2;
-#if YYDEBUG != 0
- if (yydebug)
- {
- short *ssp1 = yyss - 1;
- fprintf (stderr, "Error: state stack now");
- while (ssp1 != yyssp)
- fprintf (stderr, " %d", *++ssp1);
- fprintf (stderr, "\n");
- }
-#endif
-yyerrhandle:
+/*---------------------------------------------------------------.
+| yyerrlab2 -- pop states until the error token can be shifted. |
+`---------------------------------------------------------------*/
+yyerrlab2:
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
- yyn = yypact[yystate];
- if (yyn == YYFLAG)
- goto yyerrdefault;
+ for (;;)
+ {
+ yyn = yypact[yystate];
+ if (yyn != YYPACT_NINF)
+ {
+ yyn += YYTERROR;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ {
+ yyn = yytable[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
- yyn += YYTERROR;
- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
- goto yyerrdefault;
+ /* Pop the current state because it cannot handle the error token. */
+ if (yyssp == yyss)
+ YYABORT;
- yyn = yytable[yyn];
- if (yyn < 0)
- {
- if (yyn == YYFLAG)
- goto yyerrpop;
- yyn = -yyn;
- goto yyreduce;
+ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+ yydestruct (yystos[yystate], yyvsp);
+ yyvsp--;
+ yystate = *--yyssp;
+
+ YY_STACK_PRINT (yyss, yyssp);
}
- else if (yyn == 0)
- goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
-#if YYDEBUG != 0
- if (yydebug)
- fprintf(stderr, "Shifting error token, ");
-#endif
+ YYDPRINTF ((stderr, "Shifting error token, "));
*++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
- *++yylsp = yylloc;
-#endif
+
yystate = yyn;
goto yynewstate;
- yyacceptlab:
- /* YYACCEPT comes here. */
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
-#ifdef YYLSP_NEEDED
- free (yyls);
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here. |
+`-------------------------------------*/
+yyacceptlab:
+ yyresult = 0;
+ goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here. |
+`-----------------------------------*/
+yyabortlab:
+ yyresult = 1;
+ goto yyreturn;
+
+#ifndef yyoverflow
+/*----------------------------------------------.
+| yyoverflowlab -- parser overflow comes here. |
+`----------------------------------------------*/
+yyoverflowlab:
+ yyerror ("parser stack overflow");
+ yyresult = 2;
+ /* Fall through. */
#endif
- }
- return 0;
- yyabortlab:
- /* YYABORT comes here. */
- if (yyfree_stacks)
- {
- free (yyss);
- free (yyvs);
-#ifdef YYLSP_NEEDED
- free (yyls);
+yyreturn:
+#ifndef yyoverflow
+ if (yyss != yyssa)
+ YYSTACK_FREE (yyss);
#endif
- }
- return 1;
+ return yyresult;
}
-#line 919 "awkgram.y"
+
+
+#line 870 "awkgram.y"
struct token {
@@ -2511,13 +2637,13 @@ struct token {
# define NOT_POSIX 0x0200 /* feature not in POSIX */
# define GAWKX 0x0400 /* gawk extension */
# define RESX 0x0800 /* Bell Labs Research extension */
- NODE *(*ptr)(); /* function that implements this keyword */
+ 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 struct token tokentab[] = {
+static const struct token tokentab[] = {
{"BEGIN", Node_illegal, LEX_BEGIN, 0, 0},
{"END", Node_illegal, LEX_END, 0, 0},
#ifdef ARRAYDEBUG
@@ -2525,6 +2651,7 @@ static struct token tokentab[] = {
#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},
@@ -2601,7 +2728,7 @@ static int cur_ring_idx;
/* getfname --- return name of a builtin function (for pretty printing) */
const char *
-getfname(register NODE *(*fptr)())
+getfname(register NODE *(*fptr)(NODE *))
{
register int i, j;
@@ -2611,8 +2738,7 @@ getfname(register NODE *(*fptr)())
if (tokentab[i].ptr == fptr)
return tokentab[i].operator;
- fatal(_("fptr %x not in tokentab\n"), fptr);
- return NULL; /* to stop warnings */
+ return NULL;
}
/* yyerror --- print a syntax error message, show where */
@@ -2638,6 +2764,7 @@ static void
char *buf;
int count;
static char end_of_file_line[] = "(END OF FILE)";
+ char save;
errcount++;
/* Find the current line in the input file */
@@ -2646,7 +2773,7 @@ static void
cp = lexeme;
if (*cp == '\n') {
cp--;
- mesg = _("unexpected newline");
+ mesg = _("unexpected newline or end of string");
}
for (; cp != lexptr_begin && *cp != '\n'; --cp)
continue;
@@ -2662,8 +2789,19 @@ static void
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)
@@ -2705,7 +2843,7 @@ get_src_buf()
static int fd;
int n;
register char *scan;
- static int len = 0;
+ static size_t len = 0;
static int did_newline = FALSE;
int newfile;
struct stat sbuf;
@@ -2875,9 +3013,9 @@ tokexpand()
#ifdef MBS_SUPPORT
static int
-nextc()
+nextc(void)
{
- if (MB_CUR_MAX > 1) {
+ 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;
@@ -2943,7 +3081,7 @@ nextc()
#if GAWKDEBUG
int
-nextc()
+nextc(void)
{
int c;
@@ -2970,9 +3108,9 @@ nextc()
#ifdef MBS_SUPPORT
static void
-pushback()
+pushback(void)
{
- if (MB_CUR_MAX > 1) {
+ 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);
@@ -2989,7 +3127,7 @@ pushback()
/* allow_newline --- allow newline after &&, ||, ? and : */
static void
-allow_newline()
+allow_newline(void)
{
int c;
@@ -3015,7 +3153,7 @@ allow_newline()
/* yylex --- Read the input and turn it into tokens. */
static int
-yylex()
+yylex(void)
{
register int c;
int seen_e = FALSE; /* These are for numbers */
@@ -3076,7 +3214,7 @@ yylex()
for (;;) {
c = nextc();
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX == 1 || nextc_is_1stbyte)
+ if (gawk_mb_cur_max == 1 || nextc_is_1stbyte)
#endif
switch (c) {
case '[':
@@ -3111,7 +3249,6 @@ yylex()
if (in_brack > 0)
break;
- pushback();
tokadd('\0');
yylval.sval = tokstart;
return lasttok = REGEXP;
@@ -3136,7 +3273,7 @@ retry:
yylval.nodetypeval = Node_illegal;
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX == 1 || nextc_is_1stbyte)
+ if (gawk_mb_cur_max == 1 || nextc_is_1stbyte)
#endif
switch (c) {
case EOF:
@@ -3204,23 +3341,27 @@ retry:
}
break;
- case '$':
- want_assign = TRUE;
- return lasttok = '$';
-
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 ',':
- want_assign = FALSE;
- /* fall through */
case '[':
case ']':
return lasttok = c;
@@ -3262,13 +3403,11 @@ retry:
return lasttok = '*';
case '/':
- if (want_assign) {
- if (nextc() == '=') {
- yylval.nodetypeval = Node_assign_quotient;
- return lasttok = ASSIGNOP;
- }
+ if (nextc() == '=') {
pushback();
+ return lasttok = SLASH_BEFORE_EQUAL;
}
+ pushback();
return lasttok = '/';
case '%':
@@ -3316,7 +3455,6 @@ retry:
}
if (c == '~') {
yylval.nodetypeval = Node_nomatch;
- want_assign = FALSE;
return lasttok = MATCHOP;
}
pushback();
@@ -3338,7 +3476,7 @@ retry:
}
yylval.nodetypeval = Node_assign;
pushback();
- return lasttok = ASSIGNOP;
+ return lasttok = ASSIGN;
case '>':
if ((c = nextc()) == '=') {
@@ -3346,15 +3484,18 @@ retry:
return lasttok = RELOP;
} else if (c == '>') {
yylval.nodetypeval = Node_redirect_append;
- return lasttok = APPEND_OP;
+ return lasttok = IO_OUT;
}
- yylval.nodetypeval = Node_greater;
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;
- want_assign = FALSE;
return lasttok = MATCHOP;
case '}':
@@ -3380,7 +3521,7 @@ retry:
exit(1);
}
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX == 1 || nextc_is_1stbyte)
+ if (gawk_mb_cur_max == 1 || nextc_is_1stbyte)
#endif
if (c == '\\') {
c = nextc();
@@ -3528,7 +3669,6 @@ retry:
if ((c = nextc()) == '&') {
yylval.nodetypeval = Node_and;
allow_newline();
- want_assign = FALSE;
return lasttok = LEX_AND;
}
pushback();
@@ -3538,15 +3678,19 @@ retry:
if ((c = nextc()) == '|') {
yylval.nodetypeval = Node_or;
allow_newline();
- want_assign = FALSE;
return lasttok = LEX_OR;
} else if (! do_traditional && c == '&') {
yylval.nodetypeval = Node_redirect_twoway;
- want_assign = FALSE;
- return lasttok = TWOWAYIO;
+ return lasttok = (in_print && in_parens == 0 ? IO_OUT : IO_IN);
}
pushback();
- return lasttok = '|';
+ 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)) {
@@ -3643,7 +3787,6 @@ retry:
else {
static short goto_warned = FALSE;
- want_assign = TRUE;
#define SMART_ALECK 1
if (SMART_ALECK && do_lint
&& ! goto_warned && strcasecmp(tokkey, "goto") == 0) {
@@ -3688,7 +3831,7 @@ node(NODE *left, NODETYPE op, NODE *right)
return r;
}
-/* snode --- allocate a node with defined subnode and proc for builtin
+/* snode --- allocate a node with defined subnode and builtin for builtin
functions. Checks for arg. count and supplies defaults where
possible. */
@@ -3715,14 +3858,14 @@ snode(NODE *subn, NODETYPE op, int idx)
fatal(_("%d is invalid as number of arguments for %s"),
nexp, tokentab[idx].operator);
- r->proc = tokentab[idx].ptr;
+ r->builtin = tokentab[idx].ptr;
/* special case processing for a few builtins */
- if (nexp == 0 && r->proc == do_length) {
+ 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->proc == do_match) {
+ } else if (r->builtin == do_match) {
static short warned = FALSE;
if (subn->rnode->lnode->type != Node_regex)
@@ -3736,7 +3879,7 @@ snode(NODE *subn, NODETYPE op, int idx)
if (do_traditional)
fatal(_("match: third argument is a gawk extension"));
}
- } else if (r->proc == do_sub || r->proc == do_gsub) {
+ } 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)
@@ -3746,19 +3889,14 @@ snode(NODE *subn, NODETYPE op, int idx)
Node_expression_list,
(NODE *) NULL));
else if (subn->rnode->rnode->lnode->type == Node_val) {
- if (do_lint) {
- char *f;
-
- f = (r->proc == do_sub) ? "sub" : "gsub";
- lintwarn(_("%s: string literal as last arg of substitute has no effect"), f);
- }
+ 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)) {
- if (r->proc == do_sub)
- yyerror(_("sub third parameter is not a changeable object"));
- else
- yyerror(_("gsub third parameter is not a changeable object"));
+ yyerror(_("%s third parameter is not a changeable object"),
+ (r->builtin == do_sub) ? "sub" : "gsub");
}
- } else if (r->proc == do_gensub) {
+ } else if (r->builtin == do_gensub) {
if (subn->lnode->type != Node_regex)
subn->lnode = mk_rexp(subn->lnode);
if (nexp == 3)
@@ -3767,7 +3905,7 @@ snode(NODE *subn, NODETYPE op, int idx)
(NODE *) NULL),
Node_expression_list,
(NODE *) NULL));
- } else if (r->proc == do_split) {
+ } else if (r->builtin == do_split) {
if (nexp == 2)
append_right(subn,
node(FS_node, Node_expression_list, (NODE *) NULL));
@@ -3776,7 +3914,7 @@ snode(NODE *subn, NODETYPE op, int idx)
subn->rnode->rnode->lnode = mk_rexp(n);
if (nexp == 2)
subn->rnode->rnode->lnode->re_flags |= FS_DFLT;
- } else if (r->proc == do_close) {
+ } else if (r->builtin == do_close) {
static short warned = FALSE;
if ( nexp == 2) {
@@ -3788,9 +3926,9 @@ snode(NODE *subn, NODETYPE op, int idx)
fatal(_("close: second argument is a gawk extension"));
}
} else if (do_intl /* --gen-po */
- && r->proc == do_dcgettext /* dcgettext(...) */
+ && r->builtin == do_dcgettext /* dcgettext(...) */
&& subn->lnode->type == Node_val /* 1st arg is constant */
- && (subn->lnode->flags & STR) != 0) { /* it's a string constant */
+ && (subn->lnode->flags & STRCUR) != 0) { /* it's a string constant */
/* ala xgettext, dcgettext("some string" ...) dumps the string */
NODE *str = subn->lnode;
@@ -3800,11 +3938,11 @@ snode(NODE *subn, NODETYPE op, int idx)
else
dumpintlstr(str->stptr, str->stlen);
} else if (do_intl /* --gen-po */
- && r->proc == do_dcngettext /* dcngettext(...) */
+ && r->builtin == do_dcngettext /* dcngettext(...) */
&& subn->lnode->type == Node_val /* 1st arg is constant */
- && (subn->lnode->flags & STR) != 0 /* it's a string 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 & STR) != 0) { /* it's a string constant */
+ && (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;
@@ -3816,33 +3954,13 @@ snode(NODE *subn, NODETYPE op, int idx)
}
r->subnode = subn;
- if (r->proc == do_sprintf) {
+ if (r->builtin == do_sprintf) {
count_args(r);
r->lnode->printf_count = r->printf_count; /* hack */
}
return r;
}
-/*
- * mkrangenode:
- * This allocates a Node_line_range node with defined condpair and
- * zeroes the trigger word to avoid the temptation of assuming that calling
- * 'node( foo, Node_line_range, 0)' will properly initialize 'triggered'.
- * Otherwise like node().
- */
-
-static NODE *
-mkrangenode(NODE *cpair)
-{
- register NODE *r;
-
- getnode(r);
- r->type = Node_line_range;
- r->condpair = cpair;
- r->triggered = FALSE;
- return r;
-}
-
/* make_for_loop --- build a for loop */
static NODE *
@@ -3867,7 +3985,7 @@ static int
dup_parms(NODE *func)
{
register NODE *np;
- char *fname, **names;
+ const char *fname, **names;
int count, i, j, dups;
NODE *params;
@@ -3884,7 +4002,7 @@ dup_parms(NODE *func)
if (params == NULL) /* error earlier */
return TRUE;
- emalloc(names, char **, count * sizeof(char *), "dup_parms");
+ emalloc(names, const char **, count * sizeof(char *), "dup_parms");
i = 0;
for (np = params; np != NULL; np = np->rnode) {
@@ -3913,18 +4031,19 @@ dup_parms(NODE *func)
/* parms_shadow --- check if parameters shadow globals */
-static void
+static int
parms_shadow(const char *fname, NODE *func)
{
int count, i;
+ int ret = FALSE;
if (fname == NULL || func == NULL) /* error earlier */
- return;
+ return FALSE;
count = func->lnode->param_cnt;
if (count == 0) /* no args, no problem */
- return;
+ return FALSE;
/*
* Use warning() and not lintwarn() so that can warn
@@ -3935,8 +4054,11 @@ parms_shadow(const char *fname, NODE *func)
warning(
_("function `%s': parameter `%s' shadows global variable"),
fname, func->parmlist[i]);
+ ret = TRUE;
}
}
+
+ return ret;
}
/*
@@ -3988,12 +4110,12 @@ lookup(const char *name)
static int
var_comp(const void *v1, const void *v2)
{
- NODE **npp1, **npp2;
- NODE *n1, *n2;
+ const NODE *const *npp1, *const *npp2;
+ const NODE *n1, *n2;
int minlen;
- npp1 = (NODE **) v1;
- npp2 = (NODE **) v2;
+ npp1 = (const NODE *const *) v1;
+ npp2 = (const NODE *const *) v2;
n1 = *npp1;
n2 = *npp2;
@@ -4016,11 +4138,11 @@ valinfo(NODE *n, FILE *fp)
fprintf(fp, ")\n");
} else if (n->flags & NUMBER)
fprintf(fp, "number (%.17g)\n", n->numbr);
- else if (n->flags & STR) {
+ 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 & NUM)
+ } else if (n->flags & NUMCUR)
fprintf(fp, "number value (%.17g)\n", n->numbr);
else
fprintf(fp, "?? flags %s\n", flags2str(n->flags));
@@ -4108,7 +4230,7 @@ release_all_vars()
/* finfo --- for use in comparison and sorting of function names */
struct finfo {
- char *name;
+ const char *name;
size_t nlen;
NODE *func;
};
@@ -4118,11 +4240,11 @@ struct finfo {
static int
fcompare(const void *p1, const void *p2)
{
- struct finfo *f1, *f2;
+ const struct finfo *f1, *f2;
int minlen;
- f1 = (struct finfo *) p1;
- f2 = (struct finfo *) p2;
+ f1 = (const struct finfo *) p1;
+ f2 = (const struct finfo *) p2;
if (f1->nlen > f2->nlen)
minlen = f2->nlen;
@@ -4144,9 +4266,23 @@ dump_funcs()
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 *, func_count * sizeof(struct finfo), "dump_funcs");
+ 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) {
@@ -4158,10 +4294,9 @@ dump_funcs()
}
}
- assert(j == func_count);
/* Shazzam! */
- qsort(tab, func_count, sizeof(struct finfo), fcompare);
+ qsort(tab, j, sizeof(struct finfo), fcompare);
for (i = 0; i < j; i++)
pp_func(tab[i].name, tab[i].nlen, tab[i].func);
@@ -4178,6 +4313,7 @@ shadow_funcs()
NODE *p;
struct finfo *tab;
static int calls = 0;
+ int shadow = FALSE;
if (func_count == 0)
return;
@@ -4204,9 +4340,13 @@ shadow_funcs()
qsort(tab, func_count, sizeof(struct finfo), fcompare);
for (i = 0; i < j; i++)
- parms_shadow(tab[i].name, tab[i].func);
+ 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."));
}
/*
@@ -4237,6 +4377,27 @@ append_right(NODE *list, NODE *new)
}
/*
+ * 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
@@ -4269,12 +4430,14 @@ func_install(NODE *params, NODE *def)
r = lookup(params->param);
if (r != NULL) {
fatal(_("function name `%s' previously defined"), params->param);
- } else {
- thisfunc = node(params, Node_func, def);
- (void) install(params->param, thisfunc);
- }
+ } else if (params->param == builtin_func) /* not a valid function name */
+ goto remove_params;
- /* figure out amount of space to allocate */
+ /* 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;
@@ -4295,13 +4458,14 @@ func_install(NODE *params, NODE *def)
thisfunc->parmlist = NULL;
}
- /* remove params from symbol table */
- pop_params(params->rnode);
-
/* 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 */
@@ -4369,7 +4533,7 @@ static struct fdesc {
/* func_use --- track uses and definitions of functions */
static void
-func_use(char *name, enum defref how)
+func_use(const char *name, enum defref how)
{
struct fdesc *fp;
int len;
@@ -4462,20 +4626,26 @@ NODE *
variable(char *name, int can_free, NODETYPE type)
{
register NODE *r;
- static int env_loaded = FALSE;
- static int procinfo_loaded = FALSE;
- if (! env_loaded && STREQ(name, "ENVIRON")) {
- load_environ();
- env_loaded = TRUE;
- }
- if (! do_traditional && ! procinfo_loaded && STREQ(name, "PROCINFO")) {
- load_procinfo();
- procinfo_loaded = TRUE;
+ 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.
+ */
+ return install(name, node(Nnull_string, type, (NODE *) NULL));
+ }
}
- if ((r = lookup(name)) == NULL)
- r = install(name, node(Nnull_string, type, (NODE *) NULL));
- else if (can_free)
+ if (can_free)
free(name);
return r;
}
@@ -4496,7 +4666,6 @@ mk_rexp(NODE *exp)
n->re_text = NULL;
n->re_reg = NULL;
n->re_flags = 0;
- n->re_cnt = 1;
return n;
}
@@ -4591,7 +4760,7 @@ isassignable(register NODE *n)
/* stopme --- for debugging */
NODE *
-stopme(NODE *tree)
+stopme(NODE *tree ATTRIBUTE_UNUSED)
{
return 0;
}
@@ -4599,7 +4768,7 @@ stopme(NODE *tree)
/* dumpintlstr --- write out an initial .po file entry for the string */
static void
-dumpintlstr(char *str, size_t len)
+dumpintlstr(const char *str, size_t len)
{
char *cp;
@@ -4622,7 +4791,7 @@ dumpintlstr(char *str, size_t len)
/* dumpintlstr2 --- write out an initial .po file entry for the string and its plural */
static void
-dumpintlstr2(char *str1, size_t len1, char *str2, size_t len2)
+dumpintlstr2(const char *str1, size_t len1, const char *str2, size_t len2)
{
char *cp;
@@ -4654,7 +4823,7 @@ count_args(NODE *tree)
NODE *save_tree;
assert(tree->type == Node_K_printf
- || (tree->type == Node_builtin && tree->proc == do_sprintf));
+ || (tree->type == Node_builtin && tree->builtin == do_sprintf));
save_tree = tree;
tree = tree->lnode; /* printf format string */
@@ -4664,3 +4833,5 @@ count_args(NODE *tree)
save_tree->printf_count = count;
}
+
+
diff --git a/awkgram.y b/awkgram.y
index 63de4e90..ee380411 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -1,9 +1,9 @@
/*
- * awk.y --- yacc/bison parser
+ * awkgram.y --- yacc/bison parser
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2002 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.
@@ -34,7 +34,7 @@
#define DONT_FREE FALSE
#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
-static void yyerror(const char *m, ...) ;
+static void yyerror(const char *m, ...) ATTRIBUTE_PRINTF_1;
#else
static void yyerror(); /* va_alist */
#endif
@@ -42,9 +42,9 @@ 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 *mkrangenode P((NODE *cpair));
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));
@@ -52,22 +52,23 @@ 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 void parms_shadow P((const char *fname, NODE *func));
+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((char *str, size_t len));
-static void dumpintlstr2 P((char *str1, size_t len1, char *str2, size_t len2));
+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));
enum defref { FUNC_DEFINE, FUNC_USE };
-static void func_use P((char *name, enum defref how));
+static void func_use P((const char *name, enum defref how));
static void check_funcs P((void));
-static int want_assign; /* lexical scanning kludge */
static int want_regexp; /* lexical scanning kludge */
-static int can_return; /* lexical scanning kludge */
-static int io_allowed = TRUE; /* 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 */
@@ -92,6 +93,17 @@ 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 {
@@ -100,29 +112,27 @@ extern NODE *end_block;
NODE *nodeval;
NODETYPE nodetypeval;
char *sval;
- NODE *(*ptrval)();
+ NODE *(*ptrval) P((void));
}
-%type <nodeval> function_prologue function_body
-%type <nodeval> rexp exp start program rule simp_exp
-%type <nodeval> non_post_simp_exp
-%type <nodeval> pattern
-%type <nodeval> action variable param_list
-%type <nodeval> rexpression_list opt_rexpression_list
-%type <nodeval> expression_list opt_expression_list
-%type <nodeval> statements statement if_statement opt_param_list
-%type <nodeval> simple_stmt opt_simple_stmt
+%type <nodeval> 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 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 APPEND_OP
-%token <nodetypeval> ASSIGNOP MATCHOP NEWLINE CONCAT_OP
+%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_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE
%token <nodetypeval> LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION
@@ -130,11 +140,12 @@ extern NODE *end_block;
%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
+%right ASSIGNOP ASSIGN SLASH_BEFORE_EQUAL
%right '?' ':'
%left LEX_OR
%left LEX_AND
@@ -143,7 +154,7 @@ extern NODE *end_block;
%left FUNC_CALL LEX_BUILTIN LEX_LENGTH
%nonassoc ','
%nonassoc MATCHOP
-%nonassoc RELOP '<' '>' '|' APPEND_OP TWOWAYIO
+%nonassoc RELOP '<' '>' IO_IN IO_OUT
%left CONCAT_OP
%left YSTRING YNUMBER
%left '+' '-'
@@ -158,110 +169,92 @@ extern NODE *end_block;
start
: opt_nls program opt_nls
{
- expression_value = $2;
check_funcs();
}
;
program
- : rule
- {
- if ($1 != NULL)
- $$ = $1;
- else
- $$ = NULL;
- yyerrok;
- }
+ : /* empty */
| program rule
- /* add the rule to the tail of list */
- {
- if ($2 == NULL)
- $$ = $1;
- else if ($1 == NULL)
- $$ = $2;
- else {
- if ($1->type != Node_rule_list)
- $1 = node($1, Node_rule_list,
- (NODE*) NULL);
- $$ = append_right($1,
- node($2, Node_rule_list, (NODE *) NULL));
- }
- yyerrok;
- }
- | error { $$ = NULL; }
- | program error { $$ = NULL; }
- | /* empty */ { $$ = NULL; }
+ {
+ begin_or_end_rule = parsing_end_rule = FALSE;
+ yyerrok;
+ }
+ | program error
+ {
+ begin_or_end_rule = parsing_end_rule = FALSE;
+ yyerrok;
+ /*
+ * If errors, give up, don't produce an infinite
+ * stream of syntax error message.
+ */
+ return;
+ }
;
rule
- : LEX_BEGIN { io_allowed = FALSE; }
- action
+ : pattern action
{
- if (begin_block != NULL) {
- if (begin_block->type != Node_rule_list)
- begin_block = node(begin_block, Node_rule_list,
- (NODE *) NULL);
- (void) append_right(begin_block, node(
- node((NODE *) NULL, Node_rule_node, $3),
- Node_rule_list, (NODE *) NULL) );
- } else
- begin_block = node((NODE *) NULL, Node_rule_node, $3);
- $$ = NULL;
- io_allowed = TRUE;
- yyerrok;
+ $1->rnode = $2;
}
- | LEX_END { io_allowed = FALSE; parsing_end_rule = TRUE; }
- action
+ | pattern statement_term
{
- if (end_block != NULL) {
- if (end_block->type != Node_rule_list)
- end_block = node(end_block, Node_rule_list,
- (NODE *) NULL);
- (void) append_right (end_block, node(
- node((NODE *) NULL, Node_rule_node, $3),
- Node_rule_list, (NODE *) NULL));
- } else
- end_block = node((NODE *) NULL, Node_rule_node, $3);
- $$ = NULL;
- io_allowed = TRUE;
- parsing_end_rule = FALSE;
- yyerrok;
+ 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++;
+ }
}
- | LEX_BEGIN statement_term
+ | function_prologue action
{
- warning(_("BEGIN blocks must have an action part"));
- errcount++;
+ can_return = FALSE;
+ if ($1)
+ func_install($1, $2);
yyerrok;
}
- | LEX_END statement_term
+ ;
+
+pattern
+ : /* empty */
{
- warning(_("END blocks must have an action part"));
- errcount++;
- yyerrok;
+ $$ = append_pattern(&expression_value, (NODE *) NULL);
}
- | pattern action
- { $$ = node($1, Node_rule_node, $2); yyerrok; }
- | action
- { $$ = node((NODE *) NULL, Node_rule_node, $1); yyerrok; }
- | pattern statement_term
- {
- $$ = node($1,
- Node_rule_node,
- node(node(node(make_number(0.0),
- Node_field_spec,
- (NODE *) NULL),
- Node_expression_list,
- (NODE *) NULL),
- Node_K_print,
- (NODE *) NULL));
- yyerrok;
- }
- | function_prologue function_body
- {
- func_install($1, $2);
- $$ = NULL;
- yyerrok;
- }
+ | 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
@@ -274,6 +267,7 @@ func_name
yyerror(_("`%s' is a built-in function, it cannot be redefined"),
tokstart);
errcount++;
+ $$ = builtin_func;
/* yyerrok; */
}
;
@@ -302,77 +296,61 @@ function_prologue
}
;
-function_body
- : l_brace statements r_brace opt_semi opt_nls
- {
- $$ = $2;
- can_return = FALSE;
- }
- | l_brace r_brace opt_semi opt_nls
- {
- $$ = node((NODE *) NULL, Node_K_return, (NODE *) NULL);
- can_return = FALSE;
- }
- ;
-
-
-pattern
- : exp
- { $$ = $1; }
- | exp ',' exp
- { $$ = mkrangenode(node($1, Node_cond_pair, $3)); }
- ;
-
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 '/'
+ REGEXP /* The terminating '/' is consumed by yylex(). */
{
NODE *n;
- size_t len;
+ 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;
- len = strlen($3);
n->re_exp = make_string($3, len);
- n->re_reg = make_regexp($3, len, FALSE, TRUE);
+ n->re_reg = make_regexp($3, len, FALSE);
n->re_text = NULL;
n->re_flags = CONST;
- n->re_cnt = 1;
$$ = n;
}
;
-action
- : l_brace statements r_brace opt_semi opt_nls
- { $$ = $2; }
- | l_brace r_brace opt_semi opt_nls
- { $$ = NULL; }
+a_slash
+ : '/'
+ | SLASH_BEFORE_EQUAL
;
statements
- : statement
- {
+ : /* empty */
+ { $$ = NULL; }
+ | statements statement
+ {
+ if ($2 == NULL)
$$ = $1;
- if (do_lint && isnoeffect($$->type))
+ 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)));
}
- | statements statement
- {
- if ($1 == NULL || $1->type != Node_statement_list)
- $1 = node($1, Node_statement_list, (NODE *) NULL);
- $$ = append_right($1,
- node($2, Node_statement_list, (NODE *) NULL));
- yyerrok;
- }
- | error
- { $$ = NULL; }
+ yyerrok;
+ }
| statements error
- { $$ = NULL; }
+ { $$ = NULL; }
;
statement_term
@@ -383,8 +361,6 @@ statement_term
statement
: semi opt_nls
{ $$ = NULL; }
- | l_brace r_brace
- { $$ = NULL; }
| l_brace statements r_brace
{ $$ = $2; }
| if_statement
@@ -451,15 +427,14 @@ statement
| LEX_NEXT statement_term
{ NODETYPE type;
- if (! io_allowed)
- yyerror(_("`next' used in BEGIN or END action"));
+ 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_lint)
- lintwarn(_("`nextfile' is a gawk extension"));
if (do_traditional) {
/*
* can't use yyerror, since may have overshot
@@ -468,10 +443,13 @@ statement
errcount++;
error(_("`nextfile' is a gawk extension"));
}
- if (! io_allowed) {
+ if (do_lint)
+ lintwarn(_("`nextfile' is a gawk extension"));
+ if (begin_or_end_rule) {
/* same thing */
errcount++;
- error(_("`nextfile' used in BEGIN or END action"));
+ error(_("`%s' used in %s action"), "nextfile",
+ (parsing_end_rule ? "END" : "BEGIN"));
}
$$ = node((NODE *) NULL, Node_K_nextfile, (NODE *) NULL);
}
@@ -496,34 +474,37 @@ statement
* We don't bother to document it though. So there.
*/
simple_stmt
- : print '(' expression_list r_paren output_redir
- {
- $$ = node($3, $1, $5);
- if ($$->type == Node_K_printf)
- count_args($$);
- }
- | print opt_rexpression_list output_redir
- {
- if ($1 == Node_K_print && $2 == NULL) {
- static int warned = FALSE;
+ : 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;
- $2 = node(node(make_number(0.0),
- Node_field_spec,
- (NODE *) NULL),
- Node_expression_list,
- (NODE *) NULL);
+ $$ = node(NULL, Node_K_print_rec, $4);
- if (do_lint && ! io_allowed && ! warned) {
- warned = TRUE;
- lintwarn(
+ if (do_lint && $3 == NULL && begin_or_end_rule && ! warned) {
+ warned = TRUE;
+ lintwarn(
_("plain `print' in BEGIN or END rule should probably be `print \"\"'"));
- }
}
-
- $$ = node($2, $1, $3);
+ } 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
@@ -540,6 +521,21 @@ simple_stmt
}
$$ = 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; }
;
@@ -553,9 +549,34 @@ opt_simple_stmt
print
: LEX_PRINT
- { $$ = $1; }
| LEX_PRINTF
- { $$ = $1; }
+ ;
+
+ /*
+ * 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
@@ -572,7 +593,6 @@ if_statement
nls
: NEWLINE
- { want_assign = FALSE; }
| nls NEWLINE
;
@@ -588,24 +608,6 @@ input_redir
{ $$ = node($2, Node_redirect_input, (NODE *) NULL); }
;
-output_redir
- : /* empty */
- { $$ = NULL; }
- | '>' exp
- { $$ = node($2, Node_redirect_output, (NODE *) NULL); }
- | APPEND_OP exp
- { $$ = node($2, Node_redirect_append, (NODE *) NULL); }
- | '|' exp
- { $$ = node($2, Node_redirect_pipe, (NODE *) NULL); }
- | TWOWAYIO exp
- {
- if ($2->type == Node_K_getline
- && $2->rnode->type == Node_redirect_twoway)
- yyerror(_("multistage two-way pipelines don't work"));
- $$ = node($2, Node_redirect_twoway, (NODE *) NULL);
- }
- ;
-
opt_param_list
: /* empty */
{ $$ = NULL; }
@@ -634,32 +636,6 @@ opt_exp
{ $$ = $1; }
;
-opt_rexpression_list
- : /* empty */
- { $$ = NULL; }
- | rexpression_list
- { $$ = $1; }
- ;
-
-rexpression_list
- : rexp
- { $$ = node($1, Node_expression_list, (NODE *) NULL); }
- | rexpression_list comma rexp
- {
- $$ = append_right($1,
- node($3, Node_expression_list, (NODE *) NULL));
- yyerrok;
- }
- | error
- { $$ = NULL; }
- | rexpression_list error
- { $$ = NULL; }
- | rexpression_list error rexp
- { $$ = NULL; }
- | rexpression_list comma error
- { $$ = NULL; }
- ;
-
opt_expression_list
: /* empty */
{ $$ = NULL; }
@@ -687,31 +663,11 @@ expression_list
;
/* Expressions, not including the comma operator. */
-exp : variable ASSIGNOP
- { want_assign = FALSE; }
- exp
+exp : variable assign_operator exp %prec ASSIGNOP
{
- if (do_lint && $4->type == Node_regex)
+ if (do_lint && $3->type == Node_regex)
lintwarn(_("regular expression on right of assignment"));
- $$ = node($1, $2, $4);
- }
- | '(' expression_list r_paren LEX_IN NAME
- { $$ = node(variable($5, CAN_FREE, Node_var_array), Node_in_array, $2); }
- | exp '|' LEX_GETLINE opt_variable
- {
- $$ = node($4, Node_K_getline,
- node($1, Node_redirect_pipein, (NODE *) NULL));
- }
- | exp TWOWAYIO LEX_GETLINE opt_variable
- {
- $$ = node($4, Node_K_getline,
- node($1, Node_redirect_twoway, (NODE *) NULL));
- }
- | LEX_GETLINE opt_variable input_redir
- {
- if (do_lint && ! io_allowed && parsing_end_rule && $3 == NULL)
- lintwarn(_("non-redirected `getline' undefined inside END action"));
- $$ = node($2, Node_K_getline, $3);
+ $$ = node($1, $2, $3);
}
| exp LEX_AND exp
{ $$ = node($1, Node_and, $3); }
@@ -723,74 +679,57 @@ exp : variable ASSIGNOP
warning(_("regular expression on left of `~' or `!~' operator"));
$$ = node($1, $2, mk_rexp($3));
}
- | regexp
- {
- $$ = $1;
- if (do_lint && tokstart[0] == '*') {
- /* possible C comment */
- int n = strlen(tokstart) - 1;
- if (tokstart[n] == '*')
- lintwarn(_("regexp constant `/%s/' looks like a C comment, but is not"), tokstart);
- }
- }
- | '!' regexp %prec UNARY
- {
- $$ = node(node(make_number(0.0),
- Node_field_spec,
- (NODE *) NULL),
- Node_nomatch,
- $2);
- }
| exp LEX_IN NAME
{ $$ = node(variable($3, CAN_FREE, Node_var_array), Node_in_array, $1); }
- | exp RELOP exp
+ | 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
- { $$ = node($1, Node_less, $3); }
- | exp '>' exp
- { $$ = node($1, Node_greater, $3); }
| exp '?' exp ':' exp
{ $$ = node($1, Node_cond_exp, node($3, Node_if_branches, $5));}
- | simp_exp
+ | common_exp
{ $$ = $1; }
- | exp simp_exp %prec CONCAT_OP
- { $$ = node($1, Node_concat, $2); }
;
-rexp
- : variable ASSIGNOP
- { want_assign = FALSE; }
- rexp
- { $$ = node($1, $2, $4); }
- | rexp LEX_AND rexp
- { $$ = node($1, Node_and, $3); }
- | rexp LEX_OR rexp
- { $$ = node($1, Node_or, $3); }
- | LEX_GETLINE opt_variable input_redir
+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
{
- if (do_lint && ! io_allowed && $3 == NULL)
- lintwarn(_("non-redirected `getline' undefined inside BEGIN or END action"));
- $$ = node($2, Node_K_getline, $3);
+ $$ = node(node(make_number(0.0),
+ Node_field_spec,
+ (NODE *) NULL),
+ Node_nomatch,
+ $2);
}
- | regexp
- { $$ = $1; }
- | '!' regexp %prec UNARY
- { $$ = node((NODE *) NULL, Node_nomatch, $2); }
- | rexp MATCHOP rexp
- { $$ = node($1, $2, mk_rexp($3)); }
- | rexp LEX_IN NAME
- { $$ = node(variable($3, CAN_FREE, Node_var_array), Node_in_array, $1); }
- | rexp RELOP rexp
- { $$ = node($1, $2, $3); }
- | rexp '?' rexp ':' rexp
- { $$ = node($1, Node_cond_exp, node($3, Node_if_branches, $5));}
+ | '(' expression_list r_paren LEX_IN NAME
+ { $$ = node(variable($5, CAN_FREE, Node_var_array), Node_in_array, $2); }
| simp_exp
{ $$ = $1; }
- | rexp simp_exp %prec CONCAT_OP
+ | common_exp simp_exp %prec CONCAT_OP
{ $$ = node($1, Node_concat, $2); }
;
@@ -809,6 +748,17 @@ 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
@@ -836,6 +786,7 @@ non_post_simp_exp
| 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);
@@ -852,7 +803,7 @@ non_post_simp_exp
| '-' simp_exp %prec UNARY
{
- if ($2->type == Node_val && ($2->flags & (STR|STRING)) == 0) {
+ if ($2->type == Node_val && ($2->flags & (STRCUR|STRING)) == 0) {
$2->numbr = -(force_number($2));
$$ = $2;
} else
@@ -910,7 +861,7 @@ opt_semi
;
semi
- : ';' { yyerrok; want_assign = FALSE; }
+ : ';' { yyerrok; }
;
comma : ',' opt_nls { yyerrok; }
@@ -930,13 +881,13 @@ struct token {
# define NOT_POSIX 0x0200 /* feature not in POSIX */
# define GAWKX 0x0400 /* gawk extension */
# define RESX 0x0800 /* Bell Labs Research extension */
- NODE *(*ptr)(); /* function that implements this keyword */
+ 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 struct token tokentab[] = {
+static const struct token tokentab[] = {
{"BEGIN", Node_illegal, LEX_BEGIN, 0, 0},
{"END", Node_illegal, LEX_END, 0, 0},
#ifdef ARRAYDEBUG
@@ -944,6 +895,7 @@ static struct token tokentab[] = {
#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},
@@ -1020,7 +972,7 @@ static int cur_ring_idx;
/* getfname --- return name of a builtin function (for pretty printing) */
const char *
-getfname(register NODE *(*fptr)())
+getfname(register NODE *(*fptr)(NODE *))
{
register int i, j;
@@ -1030,8 +982,7 @@ getfname(register NODE *(*fptr)())
if (tokentab[i].ptr == fptr)
return tokentab[i].operator;
- fatal(_("fptr %x not in tokentab\n"), fptr);
- return NULL; /* to stop warnings */
+ return NULL;
}
/* yyerror --- print a syntax error message, show where */
@@ -1057,6 +1008,7 @@ static void
char *buf;
int count;
static char end_of_file_line[] = "(END OF FILE)";
+ char save;
errcount++;
/* Find the current line in the input file */
@@ -1065,7 +1017,7 @@ static void
cp = lexeme;
if (*cp == '\n') {
cp--;
- mesg = _("unexpected newline");
+ mesg = _("unexpected newline or end of string");
}
for (; cp != lexptr_begin && *cp != '\n'; --cp)
continue;
@@ -1081,8 +1033,19 @@ static void
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)
@@ -1124,7 +1087,7 @@ get_src_buf()
static int fd;
int n;
register char *scan;
- static int len = 0;
+ static size_t len = 0;
static int did_newline = FALSE;
int newfile;
struct stat sbuf;
@@ -1294,9 +1257,9 @@ tokexpand()
#ifdef MBS_SUPPORT
static int
-nextc()
+nextc(void)
{
- if (MB_CUR_MAX > 1) {
+ 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;
@@ -1362,7 +1325,7 @@ nextc()
#if GAWKDEBUG
int
-nextc()
+nextc(void)
{
int c;
@@ -1389,9 +1352,9 @@ nextc()
#ifdef MBS_SUPPORT
static void
-pushback()
+pushback(void)
{
- if (MB_CUR_MAX > 1) {
+ 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);
@@ -1408,7 +1371,7 @@ pushback()
/* allow_newline --- allow newline after &&, ||, ? and : */
static void
-allow_newline()
+allow_newline(void)
{
int c;
@@ -1434,7 +1397,7 @@ allow_newline()
/* yylex --- Read the input and turn it into tokens. */
static int
-yylex()
+yylex(void)
{
register int c;
int seen_e = FALSE; /* These are for numbers */
@@ -1495,7 +1458,7 @@ yylex()
for (;;) {
c = nextc();
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX == 1 || nextc_is_1stbyte)
+ if (gawk_mb_cur_max == 1 || nextc_is_1stbyte)
#endif
switch (c) {
case '[':
@@ -1530,7 +1493,6 @@ yylex()
if (in_brack > 0)
break;
- pushback();
tokadd('\0');
yylval.sval = tokstart;
return lasttok = REGEXP;
@@ -1555,7 +1517,7 @@ retry:
yylval.nodetypeval = Node_illegal;
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX == 1 || nextc_is_1stbyte)
+ if (gawk_mb_cur_max == 1 || nextc_is_1stbyte)
#endif
switch (c) {
case EOF:
@@ -1623,23 +1585,27 @@ retry:
}
break;
- case '$':
- want_assign = TRUE;
- return lasttok = '$';
-
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 ',':
- want_assign = FALSE;
- /* fall through */
case '[':
case ']':
return lasttok = c;
@@ -1681,13 +1647,11 @@ retry:
return lasttok = '*';
case '/':
- if (want_assign) {
- if (nextc() == '=') {
- yylval.nodetypeval = Node_assign_quotient;
- return lasttok = ASSIGNOP;
- }
+ if (nextc() == '=') {
pushback();
+ return lasttok = SLASH_BEFORE_EQUAL;
}
+ pushback();
return lasttok = '/';
case '%':
@@ -1735,7 +1699,6 @@ retry:
}
if (c == '~') {
yylval.nodetypeval = Node_nomatch;
- want_assign = FALSE;
return lasttok = MATCHOP;
}
pushback();
@@ -1757,7 +1720,7 @@ retry:
}
yylval.nodetypeval = Node_assign;
pushback();
- return lasttok = ASSIGNOP;
+ return lasttok = ASSIGN;
case '>':
if ((c = nextc()) == '=') {
@@ -1765,15 +1728,18 @@ retry:
return lasttok = RELOP;
} else if (c == '>') {
yylval.nodetypeval = Node_redirect_append;
- return lasttok = APPEND_OP;
+ return lasttok = IO_OUT;
}
- yylval.nodetypeval = Node_greater;
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;
- want_assign = FALSE;
return lasttok = MATCHOP;
case '}':
@@ -1799,7 +1765,7 @@ retry:
exit(1);
}
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX == 1 || nextc_is_1stbyte)
+ if (gawk_mb_cur_max == 1 || nextc_is_1stbyte)
#endif
if (c == '\\') {
c = nextc();
@@ -1947,7 +1913,6 @@ retry:
if ((c = nextc()) == '&') {
yylval.nodetypeval = Node_and;
allow_newline();
- want_assign = FALSE;
return lasttok = LEX_AND;
}
pushback();
@@ -1957,15 +1922,19 @@ retry:
if ((c = nextc()) == '|') {
yylval.nodetypeval = Node_or;
allow_newline();
- want_assign = FALSE;
return lasttok = LEX_OR;
} else if (! do_traditional && c == '&') {
yylval.nodetypeval = Node_redirect_twoway;
- want_assign = FALSE;
- return lasttok = TWOWAYIO;
+ return lasttok = (in_print && in_parens == 0 ? IO_OUT : IO_IN);
}
pushback();
- return lasttok = '|';
+ 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)) {
@@ -2062,7 +2031,6 @@ retry:
else {
static short goto_warned = FALSE;
- want_assign = TRUE;
#define SMART_ALECK 1
if (SMART_ALECK && do_lint
&& ! goto_warned && strcasecmp(tokkey, "goto") == 0) {
@@ -2107,7 +2075,7 @@ node(NODE *left, NODETYPE op, NODE *right)
return r;
}
-/* snode --- allocate a node with defined subnode and proc for builtin
+/* snode --- allocate a node with defined subnode and builtin for builtin
functions. Checks for arg. count and supplies defaults where
possible. */
@@ -2134,14 +2102,14 @@ snode(NODE *subn, NODETYPE op, int idx)
fatal(_("%d is invalid as number of arguments for %s"),
nexp, tokentab[idx].operator);
- r->proc = tokentab[idx].ptr;
+ r->builtin = tokentab[idx].ptr;
/* special case processing for a few builtins */
- if (nexp == 0 && r->proc == do_length) {
+ 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->proc == do_match) {
+ } else if (r->builtin == do_match) {
static short warned = FALSE;
if (subn->rnode->lnode->type != Node_regex)
@@ -2155,7 +2123,7 @@ snode(NODE *subn, NODETYPE op, int idx)
if (do_traditional)
fatal(_("match: third argument is a gawk extension"));
}
- } else if (r->proc == do_sub || r->proc == do_gsub) {
+ } 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)
@@ -2165,19 +2133,14 @@ snode(NODE *subn, NODETYPE op, int idx)
Node_expression_list,
(NODE *) NULL));
else if (subn->rnode->rnode->lnode->type == Node_val) {
- if (do_lint) {
- char *f;
-
- f = (r->proc == do_sub) ? "sub" : "gsub";
- lintwarn(_("%s: string literal as last arg of substitute has no effect"), f);
- }
+ 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)) {
- if (r->proc == do_sub)
- yyerror(_("sub third parameter is not a changeable object"));
- else
- yyerror(_("gsub third parameter is not a changeable object"));
+ yyerror(_("%s third parameter is not a changeable object"),
+ (r->builtin == do_sub) ? "sub" : "gsub");
}
- } else if (r->proc == do_gensub) {
+ } else if (r->builtin == do_gensub) {
if (subn->lnode->type != Node_regex)
subn->lnode = mk_rexp(subn->lnode);
if (nexp == 3)
@@ -2186,7 +2149,7 @@ snode(NODE *subn, NODETYPE op, int idx)
(NODE *) NULL),
Node_expression_list,
(NODE *) NULL));
- } else if (r->proc == do_split) {
+ } else if (r->builtin == do_split) {
if (nexp == 2)
append_right(subn,
node(FS_node, Node_expression_list, (NODE *) NULL));
@@ -2195,7 +2158,7 @@ snode(NODE *subn, NODETYPE op, int idx)
subn->rnode->rnode->lnode = mk_rexp(n);
if (nexp == 2)
subn->rnode->rnode->lnode->re_flags |= FS_DFLT;
- } else if (r->proc == do_close) {
+ } else if (r->builtin == do_close) {
static short warned = FALSE;
if ( nexp == 2) {
@@ -2207,9 +2170,9 @@ snode(NODE *subn, NODETYPE op, int idx)
fatal(_("close: second argument is a gawk extension"));
}
} else if (do_intl /* --gen-po */
- && r->proc == do_dcgettext /* dcgettext(...) */
+ && r->builtin == do_dcgettext /* dcgettext(...) */
&& subn->lnode->type == Node_val /* 1st arg is constant */
- && (subn->lnode->flags & STR) != 0) { /* it's a string constant */
+ && (subn->lnode->flags & STRCUR) != 0) { /* it's a string constant */
/* ala xgettext, dcgettext("some string" ...) dumps the string */
NODE *str = subn->lnode;
@@ -2219,11 +2182,11 @@ snode(NODE *subn, NODETYPE op, int idx)
else
dumpintlstr(str->stptr, str->stlen);
} else if (do_intl /* --gen-po */
- && r->proc == do_dcngettext /* dcngettext(...) */
+ && r->builtin == do_dcngettext /* dcngettext(...) */
&& subn->lnode->type == Node_val /* 1st arg is constant */
- && (subn->lnode->flags & STR) != 0 /* it's a string 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 & STR) != 0) { /* it's a string constant */
+ && (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;
@@ -2235,33 +2198,13 @@ snode(NODE *subn, NODETYPE op, int idx)
}
r->subnode = subn;
- if (r->proc == do_sprintf) {
+ if (r->builtin == do_sprintf) {
count_args(r);
r->lnode->printf_count = r->printf_count; /* hack */
}
return r;
}
-/*
- * mkrangenode:
- * This allocates a Node_line_range node with defined condpair and
- * zeroes the trigger word to avoid the temptation of assuming that calling
- * 'node( foo, Node_line_range, 0)' will properly initialize 'triggered'.
- * Otherwise like node().
- */
-
-static NODE *
-mkrangenode(NODE *cpair)
-{
- register NODE *r;
-
- getnode(r);
- r->type = Node_line_range;
- r->condpair = cpair;
- r->triggered = FALSE;
- return r;
-}
-
/* make_for_loop --- build a for loop */
static NODE *
@@ -2286,7 +2229,7 @@ static int
dup_parms(NODE *func)
{
register NODE *np;
- char *fname, **names;
+ const char *fname, **names;
int count, i, j, dups;
NODE *params;
@@ -2303,7 +2246,7 @@ dup_parms(NODE *func)
if (params == NULL) /* error earlier */
return TRUE;
- emalloc(names, char **, count * sizeof(char *), "dup_parms");
+ emalloc(names, const char **, count * sizeof(char *), "dup_parms");
i = 0;
for (np = params; np != NULL; np = np->rnode) {
@@ -2332,18 +2275,19 @@ dup_parms(NODE *func)
/* parms_shadow --- check if parameters shadow globals */
-static void
+static int
parms_shadow(const char *fname, NODE *func)
{
int count, i;
+ int ret = FALSE;
if (fname == NULL || func == NULL) /* error earlier */
- return;
+ return FALSE;
count = func->lnode->param_cnt;
if (count == 0) /* no args, no problem */
- return;
+ return FALSE;
/*
* Use warning() and not lintwarn() so that can warn
@@ -2354,8 +2298,11 @@ parms_shadow(const char *fname, NODE *func)
warning(
_("function `%s': parameter `%s' shadows global variable"),
fname, func->parmlist[i]);
+ ret = TRUE;
}
}
+
+ return ret;
}
/*
@@ -2407,12 +2354,12 @@ lookup(const char *name)
static int
var_comp(const void *v1, const void *v2)
{
- NODE **npp1, **npp2;
- NODE *n1, *n2;
+ const NODE *const *npp1, *const *npp2;
+ const NODE *n1, *n2;
int minlen;
- npp1 = (NODE **) v1;
- npp2 = (NODE **) v2;
+ npp1 = (const NODE *const *) v1;
+ npp2 = (const NODE *const *) v2;
n1 = *npp1;
n2 = *npp2;
@@ -2435,11 +2382,11 @@ valinfo(NODE *n, FILE *fp)
fprintf(fp, ")\n");
} else if (n->flags & NUMBER)
fprintf(fp, "number (%.17g)\n", n->numbr);
- else if (n->flags & STR) {
+ 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 & NUM)
+ } else if (n->flags & NUMCUR)
fprintf(fp, "number value (%.17g)\n", n->numbr);
else
fprintf(fp, "?? flags %s\n", flags2str(n->flags));
@@ -2527,7 +2474,7 @@ release_all_vars()
/* finfo --- for use in comparison and sorting of function names */
struct finfo {
- char *name;
+ const char *name;
size_t nlen;
NODE *func;
};
@@ -2537,11 +2484,11 @@ struct finfo {
static int
fcompare(const void *p1, const void *p2)
{
- struct finfo *f1, *f2;
+ const struct finfo *f1, *f2;
int minlen;
- f1 = (struct finfo *) p1;
- f2 = (struct finfo *) p2;
+ f1 = (const struct finfo *) p1;
+ f2 = (const struct finfo *) p2;
if (f1->nlen > f2->nlen)
minlen = f2->nlen;
@@ -2563,9 +2510,23 @@ dump_funcs()
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 *, func_count * sizeof(struct finfo), "dump_funcs");
+ 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) {
@@ -2577,10 +2538,9 @@ dump_funcs()
}
}
- assert(j == func_count);
/* Shazzam! */
- qsort(tab, func_count, sizeof(struct finfo), fcompare);
+ qsort(tab, j, sizeof(struct finfo), fcompare);
for (i = 0; i < j; i++)
pp_func(tab[i].name, tab[i].nlen, tab[i].func);
@@ -2597,6 +2557,7 @@ shadow_funcs()
NODE *p;
struct finfo *tab;
static int calls = 0;
+ int shadow = FALSE;
if (func_count == 0)
return;
@@ -2623,9 +2584,13 @@ shadow_funcs()
qsort(tab, func_count, sizeof(struct finfo), fcompare);
for (i = 0; i < j; i++)
- parms_shadow(tab[i].name, tab[i].func);
+ 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."));
}
/*
@@ -2656,6 +2621,27 @@ append_right(NODE *list, NODE *new)
}
/*
+ * 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
@@ -2688,12 +2674,14 @@ func_install(NODE *params, NODE *def)
r = lookup(params->param);
if (r != NULL) {
fatal(_("function name `%s' previously defined"), params->param);
- } else {
- thisfunc = node(params, Node_func, def);
- (void) install(params->param, thisfunc);
- }
+ } 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 */
+ /* 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;
@@ -2714,13 +2702,14 @@ func_install(NODE *params, NODE *def)
thisfunc->parmlist = NULL;
}
- /* remove params from symbol table */
- pop_params(params->rnode);
-
/* 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 */
@@ -2788,7 +2777,7 @@ static struct fdesc {
/* func_use --- track uses and definitions of functions */
static void
-func_use(char *name, enum defref how)
+func_use(const char *name, enum defref how)
{
struct fdesc *fp;
int len;
@@ -2881,20 +2870,26 @@ NODE *
variable(char *name, int can_free, NODETYPE type)
{
register NODE *r;
- static int env_loaded = FALSE;
- static int procinfo_loaded = FALSE;
- if (! env_loaded && STREQ(name, "ENVIRON")) {
- load_environ();
- env_loaded = TRUE;
- }
- if (! do_traditional && ! procinfo_loaded && STREQ(name, "PROCINFO")) {
- load_procinfo();
- procinfo_loaded = TRUE;
+ 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.
+ */
+ return install(name, node(Nnull_string, type, (NODE *) NULL));
+ }
}
- if ((r = lookup(name)) == NULL)
- r = install(name, node(Nnull_string, type, (NODE *) NULL));
- else if (can_free)
+ if (can_free)
free(name);
return r;
}
@@ -2915,7 +2910,6 @@ mk_rexp(NODE *exp)
n->re_text = NULL;
n->re_reg = NULL;
n->re_flags = 0;
- n->re_cnt = 1;
return n;
}
@@ -3010,7 +3004,7 @@ isassignable(register NODE *n)
/* stopme --- for debugging */
NODE *
-stopme(NODE *tree)
+stopme(NODE *tree ATTRIBUTE_UNUSED)
{
return 0;
}
@@ -3018,7 +3012,7 @@ stopme(NODE *tree)
/* dumpintlstr --- write out an initial .po file entry for the string */
static void
-dumpintlstr(char *str, size_t len)
+dumpintlstr(const char *str, size_t len)
{
char *cp;
@@ -3041,7 +3035,7 @@ dumpintlstr(char *str, size_t len)
/* dumpintlstr2 --- write out an initial .po file entry for the string and its plural */
static void
-dumpintlstr2(char *str1, size_t len1, char *str2, size_t len2)
+dumpintlstr2(const char *str1, size_t len1, const char *str2, size_t len2)
{
char *cp;
@@ -3073,7 +3067,7 @@ count_args(NODE *tree)
NODE *save_tree;
assert(tree->type == Node_K_printf
- || (tree->type == Node_builtin && tree->proc == do_sprintf));
+ || (tree->type == Node_builtin && tree->builtin == do_sprintf));
save_tree = tree;
tree = tree->lnode; /* printf format string */
diff --git a/awklib/ChangeLog b/awklib/ChangeLog
index 9e2cdd34..c0983b60 100644
--- a/awklib/ChangeLog
+++ b/awklib/ChangeLog
@@ -1,3 +1,21 @@
+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.
diff --git a/awklib/Makefile.am b/awklib/Makefile.am
index d0f25284..4662ffc9 100644
--- a/awklib/Makefile.am
+++ b/awklib/Makefile.am
@@ -1,7 +1,7 @@
#
# awklib/Makefile.am --- automake input file for gawk
#
-# Copyright (C) 1995-2002 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.
@@ -25,6 +25,10 @@
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
@@ -58,10 +62,10 @@ stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi
@echo 'against a file, so this file is a place holder. gack.' >> stamp-eg
pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c
- $(CC) $(CFLAGS) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@
+ $(COMPILE) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@
grcat$(EXEEXT): $(srcdir)/eg/lib/grcat.c
- $(CC) $(CFLAGS) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@
+ $(COMPILE) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@
igawk: $(srcdir)/eg/prog/igawk.sh
cp $(srcdir)/eg/prog/igawk.sh $@ ; chmod 755 $@
diff --git a/awklib/Makefile.in b/awklib/Makefile.in
index a6dcfb1e..e4fed88a 100644
--- a/awklib/Makefile.in
+++ b/awklib/Makefile.in
@@ -1,6 +1,7 @@
-# Makefile.in generated automatically by automake 1.5 from Makefile.am.
+# Makefile.in generated by automake 1.7.3 from Makefile.am.
+# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# 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,
@@ -16,7 +17,7 @@
#
# awklib/Makefile.am --- automake input file for gawk
#
-# Copyright (C) 1995-2002 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.
@@ -36,96 +37,141 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
#
-SHELL = @SHELL@
-
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
+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@
+transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-host_alias = @host_alias@
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@
-HAVE_LIB = @HAVE_LIB@
+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@
-LIB = @LIB@
+LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
LN_S = @LN_S@
-LTLIB = @LTLIB@
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@
-install_sh = @install_sh@
-libexecdir = @libexecdir@/awk
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
datadir = @datadir@/awk
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@/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
+# 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
@@ -151,13 +197,10 @@ pwcat_LDFLAGS =
SCRIPTS = $(bin_SCRIPTS)
-DEFS = @DEFS@
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/depcomp
-@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/grcat.Po $(DEPDIR)/pwcat.Po
+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)
@@ -174,9 +217,8 @@ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu awklib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) && \
- CONFIG_HEADERS= CONFIG_LINKS= \
- CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
install-libexecPROGRAMS: $(libexec_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(libexecdir)
@@ -184,40 +226,39 @@ install-libexecPROGRAMS: $(libexec_PROGRAMS)
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
; then \
- f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$f"; \
- $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$f; \
+ 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/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ 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 \
- f="`echo $$p|sed '$(transform)'`"; \
- if test -f $$p; then \
- echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/$$f"; \
- $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/$$f; \
- elif test -f $(srcdir)/$$p; then \
- echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/$$f"; \
- $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/$$f; \
+ 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 '$(transform)'`"; \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
rm -f $(DESTDIR)$(bindir)/$$f; \
done
@@ -228,73 +269,114 @@ mostlyclean-compile:
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@
+@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)
+ -rm -rf ./$(DEPDIR)
.c.o:
-@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$<
+@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 "$(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:
-@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(COMPILE) -c `cygpath -w $<`
-CCDEPMODE = @CCDEPMODE@
+@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 "$(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) $(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 $(LISP)
+ mkid -fID $$unique
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(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; }'`; \
- test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
+ 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=`CDPATH=: && cd $(top_builddir) && pwd` \
+ here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
-
+ -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)
- @for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ @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 \
- $(mkinstalldirs) "$(distdir)/$$dir"; \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
fi; \
if test -d $$d/$$file; then \
- cp -pR $$d/$$file $(distdir) \
- || exit 1; \
+ 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 \
@@ -319,6 +401,7 @@ install-am: all-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:
@@ -326,7 +409,7 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -368,19 +451,28 @@ 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: GTAGS all all-am check check-am clean clean-generic \
- clean-libexecPROGRAMS clean-local distclean distclean-compile \
- distclean-depend distclean-generic distclean-tags distdir dvi \
- dvi-am info info-am install install-am install-binSCRIPTS \
- install-data install-data-am install-exec install-exec-am \
- install-info install-info-am install-libexecPROGRAMS \
- install-man install-strip installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-compile mostlyclean-generic tags \
- uninstall uninstall-am uninstall-binSCRIPTS uninstall-info-am \
+.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
@@ -408,10 +500,10 @@ stamp-eg: $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi
@echo 'against a file, so this file is a place holder. gack.' >> stamp-eg
pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c
- $(CC) $(CFLAGS) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@
+ $(COMPILE) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@
grcat$(EXEEXT): $(srcdir)/eg/lib/grcat.c
- $(CC) $(CFLAGS) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@
+ $(COMPILE) $(srcdir)/eg/lib/grcat.c $(LDFLAGS) -o $@
igawk: $(srcdir)/eg/prog/igawk.sh
cp $(srcdir)/eg/prog/igawk.sh $@ ; chmod 755 $@
diff --git a/awklib/eg/lib/grcat.c b/awklib/eg/lib/grcat.c
index 802aa639..c022dc7e 100644
--- a/awklib/eg/lib/grcat.c
+++ b/awklib/eg/lib/grcat.c
@@ -12,9 +12,13 @@
#if HAVE_CONFIG_H
#include <config.h>
#endif
+
+#if defined (STDC_HEADERS)
+#include <stdlib.h>
+#endif
-#ifndef HAVE_GETPGRENT
-int main() { exit(0); }
+#ifndef HAVE_GETGRENT
+int main() { return 0; }
#else
#include <stdio.h>
#include <grp.h>
@@ -28,8 +32,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)
@@ -38,6 +42,6 @@ char **argv;
putchar('\n');
}
endgrent();
- exit(0);
+ return 0;
}
-#endif /* HAVE_GETPGRENT */
+#endif /* HAVE_GETGRENT */
diff --git a/awklib/eg/lib/pwcat.c b/awklib/eg/lib/pwcat.c
index b9a71340..d6ad0b64 100644
--- a/awklib/eg/lib/pwcat.c
+++ b/awklib/eg/lib/pwcat.c
@@ -8,9 +8,17 @@
* 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;
@@ -19,10 +27,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/awklib/eg/prog/igawk.sh b/awklib/eg/prog/igawk.sh
index 7144ce50..9fce9a50 100644
--- a/awklib/eg/prog/igawk.sh
+++ b/awklib/eg/prog/igawk.sh
@@ -8,49 +8,56 @@ 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 ;;
@@ -61,21 +68,14 @@ do
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)
{
@@ -124,7 +124,10 @@ BEGIN {
}
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/bisonfix.sed b/bisonfix.sed
index 28ef8130..c18103be 100644
--- a/bisonfix.sed
+++ b/bisonfix.sed
@@ -1,3 +1,3 @@
-/\/\* YYSTACK_USE_ALLOCA not defined \*\//a\
+/\/\* 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/builtin.c b/builtin.c
index f9cb44c9..e660c0e2 100644
--- a/builtin.c
+++ b/builtin.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2002 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.
@@ -34,6 +34,10 @@
#include <math.h>
#include "random.h"
+#ifndef SIZE_MAX /* C99 constant, can't rely on it everywhere */
+#define SIZE_MAX ((size_t) -1)
+#endif
+
/* can declare these, since we always use the random shipped with gawk */
extern char *initstate P((unsigned long seed, char *state, long n));
extern char *setstate P((char *state));
@@ -43,7 +47,7 @@ extern void srandom P((unsigned long seed));
extern NODE **fields_arr;
extern int output_is_tty;
-static NODE *sub_common P((NODE *tree, int how_many, int backdigs));
+static NODE *sub_common P((NODE *tree, long how_many, int backdigs));
#ifdef _CRAY
/* Work around a problem in conversion of doubles to exact integers. */
@@ -118,7 +122,7 @@ do_exp(NODE *tree)
double d, res;
tmp = tree_eval(tree->lnode);
- if (do_lint && (tmp->flags & (NUM|NUMBER)) == 0)
+ if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("exp: received non-numeric argument"));
d = force_number(tmp);
free_temp(tmp);
@@ -138,7 +142,7 @@ do_exp(NODE *tree)
*/
static FILE *
-stdfile(char *name, size_t len)
+stdfile(const char *name, size_t len)
{
if (len == 11) {
if (STREQN(name, "/dev/stderr", 11))
@@ -159,7 +163,7 @@ do_fflush(NODE *tree)
NODE *tmp;
FILE *fp;
int status = 0;
- char *file;
+ const char *file;
/* fflush() --- flush stdout */
if (tree == NULL) {
@@ -275,13 +279,13 @@ NODE *
do_index(NODE *tree)
{
NODE *s1, *s2;
- register char *p1, *p2;
+ register const char *p1, *p2;
register size_t l1, l2;
long ret;
#ifdef MBS_SUPPORT
size_t mbclen = 0;
mbstate_t mbs1, mbs2;
- if (MB_CUR_MAX > 1) {
+ if (gawk_mb_cur_max > 1) {
memset(&mbs1, 0, sizeof(mbstate_t));
memset(&mbs2, 0, sizeof(mbstate_t));
}
@@ -291,9 +295,9 @@ do_index(NODE *tree)
s1 = tree_eval(tree->lnode);
s2 = tree_eval(tree->rnode->lnode);
if (do_lint) {
- if ((s1->flags & (STRING|STR)) == 0)
+ if ((s1->flags & (STRING|STRCUR)) == 0)
lintwarn(_("index: received non-string first argument"));
- if ((s2->flags & (STRING|STR)) == 0)
+ if ((s2->flags & (STRING|STRCUR)) == 0)
lintwarn(_("index: received non-string second argument"));
}
force_string(s1);
@@ -320,7 +324,7 @@ do_index(NODE *tree)
if (l2 > l1)
break;
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1) {
+ if (gawk_mb_cur_max > 1) {
if (strncasecmpmbs(p1, mbs1, p2, mbs2, l2) == 0) {
ret = 1 + s1->stlen - l1;
break;
@@ -357,7 +361,7 @@ do_index(NODE *tree)
break;
}
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1) {
+ if (gawk_mb_cur_max > 1) {
mbclen = mbrlen(p1, l1, &mbs1);
if ((mbclen == 1) || (mbclen == (size_t) -1) ||
(mbclen == (size_t) -2) || (mbclen == 0)) {
@@ -403,7 +407,7 @@ do_int(NODE *tree)
double d;
tmp = tree_eval(tree->lnode);
- if (do_lint && (tmp->flags & (NUM|NUMBER)) == 0)
+ if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("int: received non-numeric argument"));
d = force_number(tmp);
d = double_to_int(d);
@@ -420,7 +424,7 @@ do_length(NODE *tree)
size_t len;
tmp = tree_eval(tree->lnode);
- if (do_lint && (tmp->flags & (STRING|STR)) == 0)
+ if (do_lint && (tmp->flags & (STRING|STRCUR)) == 0)
lintwarn(_("length: received non-string argument"));
len = force_string(tmp)->stlen;
free_temp(tmp);
@@ -436,7 +440,7 @@ do_log(NODE *tree)
double d, arg;
tmp = tree_eval(tree->lnode);
- if (do_lint && (tmp->flags & (NUM|NUMBER)) == 0)
+ if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("log: received non-numeric argument"));
arg = (double) force_number(tmp);
if (arg < 0.0)
@@ -459,9 +463,9 @@ do_log(NODE *tree)
NODE *
format_tree(
const char *fmt_string,
- int n0,
+ size_t n0,
register NODE *carg,
- int num_args)
+ long num_args)
{
/* copy 'l' bytes from 's' to 'obufout' checking for space in the process */
/* difference of pointers should be of ptrdiff_t type, but let us be kind */
@@ -513,7 +517,7 @@ format_tree(
int toofew = FALSE;
char *obuf, *obufout;
size_t osiz, ofre;
- char *chbuf;
+ const char *chbuf;
const char *s0, *s1;
int cs1;
NODE *arg;
@@ -530,15 +534,15 @@ format_tree(
char cpbuf[30]; /* if we have numbers bigger than 30 */
char *cend = &cpbuf[30];/* chars, we lose, but seems unlikely */
char *cp;
- char *fill;
+ const char *fill;
double tmpval;
char signchar = FALSE;
size_t len;
int zero_flag = FALSE;
- static char sp[] = " ";
- static char zero_string[] = "0";
- static char lchbuf[] = "0123456789abcdef";
- static char Uchbuf[] = "0123456789ABCDEF";
+ static const char sp[] = " ";
+ static const char zero_string[] = "0";
+ static const char lchbuf[] = "0123456789abcdef";
+ static const char Uchbuf[] = "0123456789ABCDEF";
#define INITIAL_OUT_SIZE 512
emalloc(obuf, char *, INITIAL_OUT_SIZE, "format_tree");
@@ -643,7 +647,7 @@ format_tree(
s1++;
retry:
- if (n0-- <= 0) /* ran out early! */
+ if (n0-- == 0) /* ran out early! */
break;
switch (cs1 = *s1++) {
@@ -654,6 +658,13 @@ check_pos:
goto retry;
case '%':
need_format = FALSE;
+ /*
+ * 29 Oct. 2002:
+ * The C99 standard pages 274 and 279 seem to imply that
+ * since there's no arg converted, the field width doesn't
+ * apply. The code already was that way, but this
+ * comment documents it, at least in the code.
+ */
bchunk_one("%");
s0 = s1;
break;
@@ -708,7 +719,7 @@ check_pos:
if (argnum <= 0)
fatal(_("arg count with `$' must be > 0"));
if (argnum >= num_args)
- fatal(_("arg count %d greater than total number of supplied arguments"), argnum);
+ fatal(_("arg count %ld greater than total number of supplied arguments"), argnum);
} else
fatal(_("`$' not permitted after period in format"));
goto retry;
@@ -1065,7 +1076,7 @@ check_pos:
if (toofew)
fatal("%s\n\t`%s'\n\t%*s%s",
_("not enough arguments to satisfy format string"),
- fmt_string, s1 - fmt_string - 1, "",
+ fmt_string, (int) (s1 - fmt_string - 1), "",
_("^ ran out for this one"));
}
if (do_lint) {
@@ -1106,6 +1117,29 @@ do_sprintf(NODE *tree)
return r;
}
+/*
+ * redirect_to_fp --- return fp for redirection, NULL on failure
+ * or stdout if no redirection, used by all print routines
+ */
+
+static inline FILE *
+redirect_to_fp(NODE *tree, struct redirect **rpp)
+{
+ int errflg; /* not used, sigh */
+ struct redirect *rp;
+
+ if (tree == NULL)
+ return stdout;
+
+ rp = redirect(tree, &errflg);
+ if (rp != NULL) {
+ *rpp = rp;
+ return rp->fp;
+ }
+
+ return NULL;
+}
+
/* do_printf --- perform printf, including redirection */
void
@@ -1123,18 +1157,9 @@ do_printf(NODE *tree)
fatal(_("printf: no arguments"));
}
- if (tree->rnode != NULL) {
- int errflg; /* not used, sigh */
-
- rp = redirect(tree->rnode, &errflg);
- if (rp != NULL) {
- fp = rp->fp;
- if (fp == NULL)
- return;
- } else
- return;
- } else
- fp = stdout;
+ fp = redirect_to_fp(tree->rnode, & rp);
+ if (fp == NULL)
+ return;
tree->lnode->printf_count = tree->printf_count;
tree = do_sprintf(tree->lnode);
efwrite(tree->stptr, sizeof(char), tree->stlen, fp, "printf", rp, TRUE);
@@ -1152,7 +1177,7 @@ do_sqrt(NODE *tree)
double arg;
tmp = tree_eval(tree->lnode);
- if (do_lint && (tmp->flags & (NUM|NUMBER)) == 0)
+ if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("sqrt: received non-numeric argument"));
arg = (double) force_number(tmp);
free_temp(tmp);
@@ -1187,48 +1212,66 @@ do_substr(NODE *tree)
lintwarn(_("substr: non-integer start index %g will be truncated"),
d_index);
- indx = d_index - 1; /* awk indices are from 1, C's are from 0 */
+ /* awk indices are from 1, C's are from 0 */
+ if (d_index <= SIZE_MAX)
+ indx = d_index - 1;
+ else
+ indx = SIZE_MAX;
if (tree->rnode->rnode == NULL) { /* third arg. missing */
/* use remainder of string */
length = t1->stlen - indx;
+ d_length = length; /* set here in case used in diagnostics, below */
} else {
t3 = tree_eval(tree->rnode->rnode->lnode);
d_length = force_number(t3);
free_temp(t3);
if (d_length <= 0.0) {
- if (do_lint)
+ if (do_lint == LINT_ALL)
lintwarn(_("substr: length %g is <= 0"), d_length);
+ else if (do_lint == LINT_INVALID && d_length < 0)
+ lintwarn(_("substr: length %g is < 0"), d_length);
free_temp(t1);
return Nnull_string;
}
- if (do_lint && double_to_int(d_length) != d_length)
- lintwarn(
- _("substr: non-integer length %g will be truncated"),
- d_length);
- length = d_length;
+ if (do_lint) {
+ if (double_to_int(d_length) != d_length)
+ lintwarn(
+ _("substr: non-integer length %g will be truncated"),
+ d_length);
+
+ if (d_length > SIZE_MAX)
+ lintwarn(
+ _("substr: length %g too big for string indexing, truncating to %g"),
+ d_length, (double) SIZE_MAX);
+ }
+ if (d_length <= SIZE_MAX)
+ length = d_length;
+ else
+ length = SIZE_MAX;
}
if (t1->stlen == 0) {
- if (do_lint)
+ /* substr("", 1, 0) produces a warning only if LINT_ALL */
+ if (do_lint && (do_lint == LINT_ALL || ((indx | length) != 0)))
lintwarn(_("substr: source string is zero length"));
free_temp(t1);
return Nnull_string;
}
- if ((indx + length) > t1->stlen) {
- if (do_lint)
- lintwarn(
- _("substr: length %d at start index %d exceeds length of first argument (%d)"),
- length, indx+1, t1->stlen);
- length = t1->stlen - indx;
- }
if (indx >= t1->stlen) {
if (do_lint)
- lintwarn(_("substr: start index %d is past end of string"),
- indx+1);
+ lintwarn(_("substr: start index %g is past end of string"),
+ d_index);
free_temp(t1);
return Nnull_string;
}
+ if (length > t1->stlen - indx) {
+ if (do_lint)
+ lintwarn(
+ _("substr: length %g at start index %g exceeds length of first argument (%lu)"),
+ d_length, d_index, (unsigned long int) t1->stlen);
+ length = t1->stlen - indx;
+ }
r = tmp_string(t1->stptr + indx, length);
free_temp(t1);
return r;
@@ -1246,8 +1289,8 @@ do_strftime(NODE *tree)
size_t buflen, bufsize;
char buf[BUFSIZ];
/* FIXME: One day make %d be %e, after C 99 is common. */
- static char def_format[] = "%a %b %d %H:%M:%S %Z %Y";
- char *format;
+ static const char def_format[] = "%a %b %d %H:%M:%S %Z %Y";
+ const char *format;
int formatlen;
/* set defaults first */
@@ -1259,7 +1302,7 @@ do_strftime(NODE *tree)
if (tree != NULL) { /* have args */
if (tree->lnode != NULL) {
NODE *tmp = tree_eval(tree->lnode);
- if (do_lint && (tmp->flags & (STRING|STR)) == 0)
+ if (do_lint && (tmp->flags & (STRING|STRCUR)) == 0)
lintwarn(_("strftime: received non-string first argument"));
t1 = force_string(tmp);
format = t1->stptr;
@@ -1274,7 +1317,7 @@ do_strftime(NODE *tree)
if (tree->rnode != NULL) {
t2 = tree_eval(tree->rnode->lnode);
- if (do_lint && (t2->flags & (NUM|NUMBER)) == 0)
+ if (do_lint && (t2->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("strftime: received non-numeric second argument"));
fclock = (time_t) force_number(t2);
free_temp(t2);
@@ -1315,7 +1358,7 @@ do_strftime(NODE *tree)
/* do_systime --- get the time of day */
NODE *
-do_systime(NODE *tree)
+do_systime(NODE *tree ATTRIBUTE_UNUSED)
{
time_t lclock;
@@ -1337,7 +1380,7 @@ do_mktime(NODE *tree)
char save;
t1 = tree_eval(tree->lnode);
- if (do_lint && (t1->flags & (STRING|STR)) == 0)
+ if (do_lint && (t1->flags & (STRING|STRCUR)) == 0)
lintwarn(_("mktime: received non-string argument"));
t1 = force_string(t1);
@@ -1382,7 +1425,7 @@ do_system(NODE *tree)
(void) flush_io(); /* so output is synchronous with gawk's */
tmp = tree_eval(tree->lnode);
- if (do_lint && (tmp->flags & (STRING|STR)) == 0)
+ if (do_lint && (tmp->flags & (STRING|STRCUR)) == 0)
lintwarn(_("system: received non-string argument"));
cmd = force_string(tmp)->stptr;
@@ -1408,7 +1451,8 @@ do_system(NODE *tree)
os_restore_mode(fileno(stdin));
ret = system(cmd);
- ret = (ret >> 8) & 0xff;
+ if (ret != -1)
+ ret = WEXITSTATUS(ret);
if ((BINMODE & 1) != 0)
os_setbinmode(fileno(stdin), O_BINARY);
@@ -1432,18 +1476,9 @@ do_print(register NODE *tree)
NODE *save;
NODE *tval;
- if (tree->rnode) {
- int errflg; /* not used, sigh */
-
- rp = redirect(tree->rnode, &errflg);
- if (rp != NULL) {
- fp = rp->fp;
- if (fp == NULL)
- return;
- } else
- return;
- } else
- fp = stdout;
+ fp = redirect_to_fp(tree->rnode, & rp);
+ if (fp == NULL)
+ return;
/*
* General idea is to evaluate all the expressions first and
@@ -1493,6 +1528,32 @@ do_print(register NODE *tree)
free(t);
}
+/* do_print_rec --- special case printing of $0, for speed */
+
+void
+do_print_rec(register NODE *tree)
+{
+ struct redirect *rp = NULL;
+ register FILE *fp;
+ register NODE *f0;
+
+ fp = redirect_to_fp(tree->rnode, & rp);
+ if (fp == NULL)
+ return;
+
+ if (! field0_valid)
+ (void) get_field(0L, NULL); /* rebuild record */
+
+ f0 = fields_arr[0];
+ efwrite(f0->stptr, sizeof(char), f0->stlen, fp, "print", rp, FALSE);
+
+ if (ORSlen > 0)
+ efwrite(ORS, sizeof(char), (size_t) ORSlen, fp, "print", rp, TRUE);
+
+ if (rp != NULL && (rp->flag & RED_TWOWAY) != 0)
+ fflush(rp->fp);
+}
+
/* do_tolower --- lower case a string */
NODE *
@@ -1503,37 +1564,37 @@ do_tolower(NODE *tree)
#ifdef MBS_SUPPORT
size_t mbclen = 0;
mbstate_t mbs, prev_mbs;
- if (MB_CUR_MAX > 1)
+ if (gawk_mb_cur_max > 1)
memset(&mbs, 0, sizeof(mbstate_t));
#endif
t1 = tree_eval(tree->lnode);
- if (do_lint && (t1->flags & (STRING|STR)) == 0)
+ if (do_lint && (t1->flags & (STRING|STRCUR)) == 0)
lintwarn(_("tolower: received non-string argument"));
t1 = force_string(t1);
t2 = tmp_string(t1->stptr, t1->stlen);
for (cp = (unsigned char *)t2->stptr,
cp2 = (unsigned char *)(t2->stptr + t2->stlen); cp < cp2; cp++)
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1) {
+ if (gawk_mb_cur_max > 1) {
wchar_t wc;
prev_mbs = mbs;
- mbclen = (size_t) mbrtowc(&wc, cp, cp2 - cp, &mbs);
+ mbclen = (size_t) mbrtowc(&wc, (char *) cp, cp2 - cp,
+ &mbs);
if ((mbclen != 1) && (mbclen != (size_t) -1) &&
(mbclen != (size_t) -2) && (mbclen != 0)) {
/* a multibyte character. */
- if (iswupper(wc))
- {
+ if (iswupper(wc)) {
wc = towlower(wc);
- wcrtomb(cp, wc, &prev_mbs);
+ wcrtomb((char *) cp, wc, &prev_mbs);
}
/* Adjust the pointer. */
cp += mbclen - 1;
- } else {
+ } else {
/* Otherwise we treat it as a singlebyte character. */
if (ISUPPER(*cp))
*cp = tolower(*cp);
- }
+ }
} else
#endif
if (ISUPPER(*cp))
@@ -1552,37 +1613,37 @@ do_toupper(NODE *tree)
#ifdef MBS_SUPPORT
size_t mbclen = 0;
mbstate_t mbs, prev_mbs;
- if (MB_CUR_MAX > 1)
+ if (gawk_mb_cur_max > 1)
memset(&mbs, 0, sizeof(mbstate_t));
#endif
t1 = tree_eval(tree->lnode);
- if (do_lint && (t1->flags & (STRING|STR)) == 0)
+ if (do_lint && (t1->flags & (STRING|STRCUR)) == 0)
lintwarn(_("toupper: received non-string argument"));
t1 = force_string(t1);
t2 = tmp_string(t1->stptr, t1->stlen);
for (cp = (unsigned char *)t2->stptr,
cp2 = (unsigned char *)(t2->stptr + t2->stlen); cp < cp2; cp++)
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1) {
+ if (gawk_mb_cur_max > 1) {
wchar_t wc;
prev_mbs = mbs;
- mbclen = (size_t) mbrtowc(&wc, cp, cp2 - cp, &mbs);
+ mbclen = (size_t) mbrtowc(&wc, (char *) cp, cp2 - cp,
+ &mbs);
if ((mbclen != 1) && (mbclen != (size_t) -1) &&
(mbclen != (size_t) -2) && (mbclen != 0)) {
/* a multibyte character. */
- if (iswlower(wc))
- {
+ if (iswlower(wc)) {
wc = towupper(wc);
- wcrtomb(cp, wc, &prev_mbs);
+ wcrtomb((char *) cp, wc, &prev_mbs);
}
/* Adjust the pointer. */
cp += mbclen - 1;
- } else {
+ } else {
/* Otherwise we treat it as a singlebyte character. */
if (ISLOWER(*cp))
*cp = toupper(*cp);
- }
+ }
} else
#endif
if (ISLOWER(*cp))
@@ -1602,9 +1663,9 @@ do_atan2(NODE *tree)
t1 = tree_eval(tree->lnode);
t2 = tree_eval(tree->rnode->lnode);
if (do_lint) {
- if ((t1->flags & (NUM|NUMBER)) == 0)
+ if ((t1->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("atan2: received non-numeric first argument"));
- if ((t2->flags & (NUM|NUMBER)) == 0)
+ if ((t2->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("atan2: received non-numeric second argument"));
}
d1 = force_number(t1);
@@ -1623,7 +1684,7 @@ do_sin(NODE *tree)
double d;
tmp = tree_eval(tree->lnode);
- if (do_lint && (tmp->flags & (NUM|NUMBER)) == 0)
+ if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("sin: received non-numeric argument"));
d = sin((double) force_number(tmp));
free_temp(tmp);
@@ -1639,7 +1700,7 @@ do_cos(NODE *tree)
double d;
tmp = tree_eval(tree->lnode);
- if (do_lint && (tmp->flags & (NUM|NUMBER)) == 0)
+ if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("cos: received non-numeric argument"));
d = cos((double) force_number(tmp));
free_temp(tmp);
@@ -1653,7 +1714,7 @@ static char state[512];
/* ARGSUSED */
NODE *
-do_rand(NODE *tree)
+do_rand(NODE *tree ATTRIBUTE_UNUSED)
{
if (firstrand) {
(void) initstate((unsigned) 1, state, sizeof state);
@@ -1683,7 +1744,7 @@ do_srand(NODE *tree)
srandom((unsigned int) (save_seed = (long) time((time_t *) 0)));
else {
tmp = tree_eval(tree->lnode);
- if (do_lint && (tmp->flags & (NUM|NUMBER)) == 0)
+ if (do_lint && (tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("srand: received non-numeric argument"));
srandom((unsigned int) (save_seed = (long) force_number(tmp)));
free_temp(tmp);
@@ -1693,7 +1754,7 @@ do_srand(NODE *tree)
/* do_match --- match a regexp, set RSTART and RLENGTH,
* optional third arg is array filled with text of
- * subpatterns enclosed in parens.
+ * subpatterns enclosed in parens and start and len info.
*/
NODE *
@@ -1705,6 +1766,11 @@ do_match(NODE *tree)
Regexp *rp;
regoff_t s;
char *start;
+ char *buf = NULL;
+ char buff[100];
+ size_t amt, oldamt = 0, ilen, slen;
+ char *subsepstr;
+ size_t subseplen;
t1 = force_string(tree_eval(tree->lnode));
tree = tree->rnode;
@@ -1730,14 +1796,50 @@ do_match(NODE *tree)
/* Build the array only if the caller wants the optional subpatterns */
if (dest != NULL) {
- for (ii = 0; (s = SUBPATSTART(rp, t1->stptr, ii)) != -1; ii++) {
+ subsepstr = SUBSEP_node->var_value->stptr;
+ subseplen = SUBSEP_node->var_value->stlen;
+
+ for (ii = 0; ii < NUMSUBPATS(rp, t1->stptr)
+ && (s = SUBPATSTART(rp, t1->stptr, ii)) != -1; ii++) {
start = t1->stptr + s;
len = SUBPATEND(rp, t1->stptr, ii) - s;
it = make_string(start, len);
- it->flags |= MAYBE_NUM;
+ /*
+ * assoc_lookup() does free_temp() on 2nd arg.
+ */
*assoc_lookup(dest, tmp_number((AWKNUM) (ii)), FALSE) = it;
+
+ sprintf(buff, "%d", ii);
+ ilen = strlen(buff);
+ amt = ilen + subseplen + strlen("length") + 2;
+
+ if (oldamt == 0) {
+ emalloc(buf, char *, amt, "do_match");
+ } else if (amt > oldamt) {
+ erealloc(buf, char *, amt, "do_match");
+ }
+ oldamt = amt;
+ memcpy(buf, buff, ilen);
+ memcpy(buf + ilen, subsepstr, subseplen);
+ memcpy(buf + ilen + subseplen, "start", 6);
+
+ slen = ilen + subseplen + 5;
+
+ it = make_number((AWKNUM) s + 1);
+ *assoc_lookup(dest, tmp_string(buf, slen), FALSE) = it;
+
+ memcpy(buf, buff, ilen);
+ memcpy(buf + ilen, subsepstr, subseplen);
+ memcpy(buf + ilen + subseplen, "length", 7);
+
+ slen = ilen + subseplen + 6;
+
+ it = make_number((AWKNUM) len);
+ *assoc_lookup(dest, tmp_string(buf, slen), FALSE) = it;
}
+
+ free(buf);
}
} else { /* match failed */
rstart = 0;
@@ -1817,7 +1919,7 @@ do_match(NODE *tree)
*/
static NODE *
-sub_common(NODE *tree, int how_many, int backdigs)
+sub_common(NODE *tree, long how_many, int backdigs)
{
register char *scan;
register char *bp, *cp;
@@ -1849,13 +1951,14 @@ sub_common(NODE *tree, int how_many, int backdigs)
char *mb_indices;
#endif
- tmp = tree->lnode;
+ tmp = tree->lnode; /* regexp */
rp = re_update(tmp);
- tree = tree->rnode;
+ tree = tree->rnode; /* replacement text */
s = tree->lnode;
+ s = force_string(tree_eval(s));
- tree = tree->rnode;
+ tree = tree->rnode; /* original string */
tmp = tree->lnode;
t = force_string(tree_eval(tmp));
@@ -1863,6 +1966,7 @@ sub_common(NODE *tree, int how_many, int backdigs)
if (research(rp, t->stptr, 0, t->stlen, TRUE) == -1 ||
RESTART(rp, t->stptr) > t->stlen) {
free_temp(t);
+ free_temp(s);
return tmp_number((AWKNUM) 0.0);
}
@@ -1883,7 +1987,6 @@ sub_common(NODE *tree, int how_many, int backdigs)
textlen = t->stlen;
buflen = textlen + 2;
- s = force_string(tree_eval(s));
repl = s->stptr;
replend = repl + s->stlen;
repllen = replend - repl;
@@ -1900,7 +2003,7 @@ sub_common(NODE *tree, int how_many, int backdigs)
* sub(/foo/, "", mystring)
* for example.
*/
- if (MB_CUR_MAX > 1 && repllen > 0) {
+ if (gawk_mb_cur_max > 1 && repllen > 0) {
emalloc(mb_indices, char *, repllen * sizeof(char), "sub_common");
index_multibyte_buffer(repl, mb_indices, repllen);
} else
@@ -1908,7 +2011,7 @@ sub_common(NODE *tree, int how_many, int backdigs)
#endif
for (scan = repl; scan < replend; scan++) {
#ifdef MBS_SUPPORT
- if ((MB_CUR_MAX == 1 || (repllen > 0 && mb_indices[scan - repl] == 1))
+ if ((gawk_mb_cur_max == 1 || (repllen > 0 && mb_indices[scan - repl] == 1))
&& (*scan == '&')) {
#else
if (*scan == '&') {
@@ -1969,9 +2072,13 @@ sub_common(NODE *tree, int how_many, int backdigs)
/*
* If the current match matched the null string,
* and the last match didn't and did a replacement,
- * then skip this one.
+ * and the match of the null string is at the front of
+ * the text (meaning right after end of the previous
+ * replacement), then skip this one.
*/
- if (lastmatchnonzero && matchstart == matchend) {
+ if (matchstart == matchend
+ && lastmatchnonzero
+ && matchstart == text) {
lastmatchnonzero = FALSE;
matches--;
goto empty;
@@ -1983,7 +2090,7 @@ sub_common(NODE *tree, int how_many, int backdigs)
*/
for (scan = repl; scan < replend; scan++)
#ifdef MBS_SUPPORT
- if ((MB_CUR_MAX == 1
+ if ((gawk_mb_cur_max == 1
|| (repllen > 0 && mb_indices[scan - repl] == 1))
&& (*scan == '&'))
#else
@@ -1992,7 +2099,7 @@ sub_common(NODE *tree, int how_many, int backdigs)
for (cp = matchstart; cp < matchend; cp++)
*bp++ = *cp;
#ifdef MBS_SUPPORT
- else if ((MB_CUR_MAX == 1
+ else if ((gawk_mb_cur_max == 1
|| (repllen > 0 && mb_indices[scan - repl] == 1))
&& (*scan == '\\')) {
#else
@@ -2081,7 +2188,7 @@ sub_common(NODE *tree, int how_many, int backdigs)
}
if (after_assign != NULL)
(*after_assign)();
- t->flags &= ~(NUM|NUMBER);
+ t->flags &= ~(NUMCUR|NUMBER);
}
#ifdef MBS_SUPPORT
if (mb_indices != NULL)
@@ -2142,7 +2249,7 @@ do_gensub(NODE *tree)
n3.lnode = target;
n2.rnode = & n3;
- if ((t->flags & (STR|STRING)) != 0) {
+ if ((t->flags & (STRCUR|STRING)) != 0) {
if (t->stlen > 0 && (t->stptr[0] == 'g' || t->stptr[0] == 'G'))
how_many = -1;
else
@@ -2264,9 +2371,9 @@ do_lshift(NODE *tree)
shift = force_number(s2);
if (do_lint) {
- if ((s1->flags & (NUM|NUMBER)) == 0)
+ if ((s1->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("lshift: received non-numeric first argument"));
- if ((s2->flags & (NUM|NUMBER)) == 0)
+ if ((s2->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("lshift: received non-numeric first argument"));
if (val < 0 || shift < 0)
lintwarn(_("lshift(%lf, %lf): negative values will give strange results"), val, shift);
@@ -2301,9 +2408,9 @@ do_rshift(NODE *tree)
shift = force_number(s2);
if (do_lint) {
- if ((s1->flags & (NUM|NUMBER)) == 0)
+ if ((s1->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("rshift: received non-numeric first argument"));
- if ((s2->flags & (NUM|NUMBER)) == 0)
+ if ((s2->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("rshift: received non-numeric first argument"));
if (val < 0 || shift < 0)
lintwarn(_("rshift(%lf, %lf): negative values will give strange results"), val, shift);
@@ -2338,9 +2445,9 @@ do_and(NODE *tree)
right = force_number(s2);
if (do_lint) {
- if ((s1->flags & (NUM|NUMBER)) == 0)
+ if ((s1->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("and: received non-numeric first argument"));
- if ((s2->flags & (NUM|NUMBER)) == 0)
+ if ((s2->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("and: received non-numeric first argument"));
if (left < 0 || right < 0)
lintwarn(_("and(%lf, %lf): negative values will give strange results"), left, right);
@@ -2373,9 +2480,9 @@ do_or(NODE *tree)
right = force_number(s2);
if (do_lint) {
- if ((s1->flags & (NUM|NUMBER)) == 0)
+ if ((s1->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("or: received non-numeric first argument"));
- if ((s2->flags & (NUM|NUMBER)) == 0)
+ if ((s2->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("or: received non-numeric first argument"));
if (left < 0 || right < 0)
lintwarn(_("or(%lf, %lf): negative values will give strange results"), left, right);
@@ -2408,9 +2515,9 @@ do_xor(NODE *tree)
right = force_number(s2);
if (do_lint) {
- if ((s1->flags & (NUM|NUMBER)) == 0)
+ if ((s1->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("xor: received non-numeric first argument"));
- if ((s2->flags & (NUM|NUMBER)) == 0)
+ if ((s2->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("xor: received non-numeric first argument"));
if (left < 0 || right < 0)
lintwarn(_("xor(%lf, %lf): negative values will give strange results"), left, right);
@@ -2442,7 +2549,7 @@ do_compl(NODE *tree)
free_temp(tmp);
if (do_lint) {
- if ((tmp->flags & (NUM|NUMBER)) == 0)
+ if ((tmp->flags & (NUMCUR|NUMBER)) == 0)
lintwarn(_("compl: received non-numeric argument"));
if (d < 0)
lintwarn(_("compl(%lf): negative value will give strange results"), d);
@@ -2561,9 +2668,9 @@ done:
static int
localecategory_from_argument(NODE *tree)
{
- static struct category_table {
+ static const struct category_table {
int val;
- char *name;
+ const char *name;
} cat_tab[] = {
#ifdef LC_ALL
{ LC_ALL, "LC_ALL" },
diff --git a/config.guess b/config.guess
index ed2e03b7..4fc21ecc 100755
--- a/config.guess
+++ b/config.guess
@@ -1,9 +1,9 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002 Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-timestamp='2002-03-20'
+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
@@ -88,30 +88,41 @@ if test $# != 0; then
exit 1
fi
+trap 'exit 1' 1 2 15
-dummy=dummy-$$
-trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+# CC_FOR_BUILD -- compiler used by this script. 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.
-# CC_FOR_BUILD -- compiler used by this script.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
-set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int dummy(){}" > $dummy.c ;
+# 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
- ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
- if test $? = 0 ; then
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
- rm -f $dummy.c $dummy.o $dummy.rel ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac'
+esac ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
@@ -142,6 +153,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
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 ;;
@@ -167,7 +179,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
;;
esac
# The OS release
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ # 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.
@@ -212,67 +235,54 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*: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.
- cat <<EOF >$dummy.s
- .data
-\$Lformat:
- .byte 37,100,45,37,120,10,0 # "%d-%x\n"
-
- .text
- .globl main
- .align 4
- .ent main
-main:
- .frame \$30,16,\$26,0
- ldgp \$29,0(\$27)
- .prologue 1
- .long 0x47e03d80 # implver \$0
- lda \$2,-1
- .long 0x47e20c21 # amask \$2,\$1
- lda \$16,\$Lformat
- mov \$0,\$17
- not \$1,\$18
- jsr \$26,printf
- ldgp \$29,0(\$26)
- mov 0,\$16
- jsr \$26,exit
- .end main
-EOF
- eval $set_cc_for_build
- $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
- if test "$?" = 0 ; then
- case `./$dummy` in
- 0-0)
- UNAME_MACHINE="alpha"
- ;;
- 1-0)
- UNAME_MACHINE="alphaev5"
- ;;
- 1-1)
- UNAME_MACHINE="alphaev56"
- ;;
- 1-101)
- UNAME_MACHINE="alphapca56"
- ;;
- 2-303)
- UNAME_MACHINE="alphaev6"
- ;;
- 2-307)
- UNAME_MACHINE="alphaev67"
- ;;
- 2-1307)
- UNAME_MACHINE="alphaev68"
- ;;
- esac
- fi
- rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
Alpha\ *:Windows_NT*:*)
@@ -313,6 +323,10 @@ EOF
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 ;;
@@ -419,15 +433,20 @@ EOF
exit (-1);
}
EOF
- $CC_FOR_BUILD $dummy.c -o $dummy \
- && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && rm -f $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ $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 ;;
@@ -500,8 +519,7 @@ EOF
exit(0);
}
EOF
- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ $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
@@ -599,11 +617,21 @@ EOF
exit (0);
}
EOF
- (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
- if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
- rm -f $dummy.c $dummy
+ (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:*:*)
@@ -637,8 +665,7 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ $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:*:* )
@@ -696,15 +723,15 @@ EOF
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
- CRAY*T3D:*:*:*)
- echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
+ *: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/\///'`
@@ -721,7 +748,18 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ # 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
@@ -733,13 +771,16 @@ EOF
echo ${UNAME_MACHINE}-pc-pw32
exit 0 ;;
x86:Interix*:3*)
- echo i386-pc-interix3
+ 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 i386-pc-interix
+ echo i586-pc-interix
exit 0 ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
@@ -782,8 +823,26 @@ EOF
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- rm -f $dummy.c
- test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
+ 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
@@ -845,7 +904,7 @@ EOF
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0 ;;
+ exit 0 ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0 ;;
@@ -878,7 +937,6 @@ EOF
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- rm -f $dummy.c
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
;;
@@ -896,6 +954,23 @@ EOF
# 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
@@ -917,22 +992,19 @@ EOF
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+ UNAME_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|egrep '^Machine.*Pent ?II' >/dev/null) \
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
- (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
+ (/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 ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
@@ -956,9 +1028,15 @@ EOF
# "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 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.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`
@@ -975,9 +1053,6 @@ EOF
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
@@ -1049,6 +1124,9 @@ EOF
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 ;;
@@ -1056,7 +1134,11 @@ EOF
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
- echo `uname -p`-apple-darwin${UNAME_RELEASE}
+ 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`
@@ -1069,7 +1151,7 @@ EOF
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
- NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
+ NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
@@ -1092,11 +1174,6 @@ EOF
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit 0 ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit 0 ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit 0 ;;
@@ -1115,12 +1192,6 @@ EOF
*:ITS:*:*)
echo pdp10-unknown-its
exit 0 ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit 0 ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1241,8 +1312,7 @@ main ()
}
EOF
-$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
-rm -f $dummy.c $dummy
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
# Apollos put the system type in the environment.
diff --git a/config.sub b/config.sub
index 299f3f4c..5f94062a 100755
--- a/config.sub
+++ b/config.sub
@@ -1,9 +1,9 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002 Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-timestamp='2002-04-26'
+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
@@ -118,7 +118,7 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
+ nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -229,24 +229,36 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
- | c4x | clipper \
- | d10v | d30v | dsp16xx \
- | fr30 \
+ | 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 | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
- | mips64vr4100 | mips64vr4100el | mips64vr4300 \
- | mips64vr4300el | mips64vr5000 | mips64vr5000el \
- | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
- | mipsisa32 | mipsisa64 \
+ | 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[34] | sh[34]eb | shbe | shle | sh64 \
+ | 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 \
@@ -281,34 +293,49 @@ case $basic_machine in
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armv*-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* \
| bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c54x-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | cydra-* \
- | d10v-* | d30v-* \
+ | d10v-* | d30v-* | dlx-* \
| elxsi-* \
- | f30[01]-* | f700-* | fr30-* | fx80-* \
+ | 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-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
- | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
- | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
+ | 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[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \
+ | 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-* | tic54x-* | tic80-* | tron-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
@@ -695,6 +722,10 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
+ nv1)
+ basic_machine=nv1-cray
+ os=-unicosmp
+ ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -728,13 +759,13 @@ case $basic_machine in
pbb)
basic_machine=m68k-tti
;;
- pc532 | pc532-*)
+ pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
- pentiumpro | p6 | 6x86 | athlon)
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
pentiumii | pentium2)
@@ -755,22 +786,22 @@ case $basic_machine in
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/^[^-]*-//'`
;;
@@ -801,6 +832,12 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
sequent)
basic_machine=i386-sequent
;;
@@ -866,7 +903,7 @@ case $basic_machine in
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
- sv1)
+ sv1)
basic_machine=sv1-cray
os=-unicos
;;
@@ -874,10 +911,6 @@ case $basic_machine in
basic_machine=i386-sequent
os=-dynix
;;
- t3d)
- basic_machine=alpha-cray
- os=-unicos
- ;;
t3e)
basic_machine=alphaev5-cray
os=-unicos
@@ -886,10 +919,22 @@ case $basic_machine in
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
;;
@@ -924,8 +969,8 @@ case $basic_machine in
os=-vms
;;
vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
+ basic_machine=f301-fujitsu
+ ;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
@@ -946,11 +991,7 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
- windows32)
- basic_machine=i386-pc
- os=-windows32-msvcrt
- ;;
- xps | xps100)
+ xps | xps100)
basic_machine=xps100-honeywell
;;
ymp)
@@ -996,7 +1037,7 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
- sh3 | sh4 | sh3eb | sh4eb)
+ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sh64)
@@ -1005,7 +1046,7 @@ case $basic_machine in
sparc | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
- cydra)
+ cydra)
basic_machine=cydra-cydrome
;;
orion)
@@ -1020,10 +1061,6 @@ case $basic_machine in
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
- c4x*)
- basic_machine=c4x-none
- os=-coff
- ;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
@@ -1086,11 +1123,12 @@ case $os in
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+ | -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* )
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -microbsd*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1102,8 +1140,10 @@ case $os in
;;
esac
;;
+ -nto-qnx*)
+ ;;
-nto*)
- os=-nto-qnx
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
@@ -1155,7 +1195,7 @@ case $os in
os=-rtmk-nova
;;
-ns2 )
- os=-nextstep2
+ os=-nextstep2
;;
-nsk*)
os=-nsk
@@ -1194,8 +1234,14 @@ case $os in
-xenix)
os=-xenix
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
;;
-none)
;;
@@ -1232,7 +1278,7 @@ case $basic_machine in
pdp10-*)
os=-tops20
;;
- pdp11-*)
+ pdp11-*)
os=-none
;;
*-dec | vax-*)
@@ -1325,19 +1371,19 @@ case $basic_machine in
*-next)
os=-nextstep3
;;
- *-gould)
+ *-gould)
os=-sysv
;;
- *-highlevel)
+ *-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
- *-sgi)
+ *-sgi)
os=-irix
;;
- *-siemens)
+ *-siemens)
os=-sysv4
;;
*-masscomp)
diff --git a/configh.in b/configh.in
index 24fbe31f..ae4df7ee 100644
--- a/configh.in
+++ b/configh.in
@@ -1,375 +1,437 @@
-/* configh.in. Generated automatically from configure.in by autoheader. */
-/*
- * acconfig.h -- configuration definitions for gawk.
- */
-
-/*
- * Copyright (C) 1995-2001 the Free Software Foundation, Inc.
- *
- * This file is part of GAWK, the GNU implementation of the
- * AWK Programming Language.
- *
- * GAWK is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GAWK is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
-
-
-/* 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.in by autoheader. */
-/* Define 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
-/* Define if type char is unsigned and you are not using gcc. */
-#ifndef __CHAR_UNSIGNED__
-#undef __CHAR_UNSIGNED__
-#endif
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
-/* Define to empty if the keyword does not work. */
-#undef const
+/* dynamic loading is possible */
+#undef DYNAMIC
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-#undef CRAY_STACKSEG_END
+/* Define to 1 if 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'. */
+/* 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. */
-#undef HAVE_DOPRNT
-
-/* Define if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define if your struct stat has st_blksize. */
-#undef HAVE_ST_BLKSIZE
-
-/* Define if you have the ANSI # stringizing operator in cpp. */
-#undef HAVE_STRINGIZE
-
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define if your struct tm has tm_zone. */
-#undef HAVE_TM_ZONE
-
-/* Define if you don't have tm_zone but do have the external array
- tzname. */
-#undef HAVE_TZNAME
-
-/* Define if you have the vprintf function. */
-#undef HAVE_VPRINTF
+/* Define to 1 if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
-/* Define as __inline if that's what the C compiler calls it. */
-#undef inline
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+#undef HAVE_DCGETTEXT
-/* Define if on MINIX. */
-#undef _MINIX
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+#undef HAVE_DOPRNT
-/* Define to `long' if <sys/types.h> doesn't define. */
-#undef off_t
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef pid_t
+/* Define to 1 if you have the `feof_unlocked' function. */
+#undef HAVE_FEOF_UNLOCKED
-/* 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 `fgets_unlocked' function. */
+#undef HAVE_FGETS_UNLOCKED
-/* Define if you need to in order for stat and other things to work. */
-#undef _POSIX_SOURCE
+/* Define to 1 if you have the `fmod' function. */
+#undef HAVE_FMOD
-/* Define as the return type of signal handlers (int or void). */
-#undef RETSIGTYPE
+/* Define to 1 if you have the `getcwd' function. */
+#undef HAVE_GETCWD
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
+/* Define to 1 if you have the `getc_unlocked' function. */
+#undef HAVE_GETC_UNLOCKED
-/* 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 `getegid' function. */
+#undef HAVE_GETEGID
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
+/* Define to 1 if you have the `geteuid' function. */
+#undef HAVE_GETEUID
-/* 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 `getgid' function. */
+#undef HAVE_GETGID
-/* Define if your <sys/time.h> declares struct tm. */
-#undef TM_IN_SYS_TIME
+/* Define to 1 if you have the `getgrent' function. */
+#undef HAVE_GETGRENT
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef uid_t
+/* Define to 1 if you have the `getgroups' function. */
+#undef HAVE_GETGROUPS
-#undef REGEX_MALLOC /* use malloc instead of alloca in regex.c */
-#undef SPRINTF_RET /* return type of sprintf */
-#undef HAVE_MKTIME /* we have the mktime function */
-#undef HAVE_SOCKETS /* we have sockets on this system */
-#undef HAVE_PORTALS /* we have portals on /p on this system */
-#undef DYNAMIC /* allow dynamic addition of builtins */
-#undef STRTOD_NOT_C89 /* strtod doesn't have C89 semantics */
-#undef ssize_t /* signed version of size_t */
-#undef USE_INCLUDED_STRFTIME /* force use of our version of strftime */
-#undef TIME_T_IN_SYS_TYPES_H /* some systems define this type here */
-
-/* Define if you have the __argz_count function. */
-#undef HAVE___ARGZ_COUNT
+/* Define to 1 if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
-/* Define if you have the __argz_next function. */
-#undef HAVE___ARGZ_NEXT
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#undef HAVE_GETTEXT
-/* Define if you have the __argz_stringify function. */
-#undef HAVE___ARGZ_STRINGIFY
+/* Define to 1 if you have the `getuid' function. */
+#undef HAVE_GETUID
-/* Define if you have the alarm function. */
-#undef HAVE_ALARM
+/* Define to 1 if you have the `grantpt' function. */
+#undef HAVE_GRANTPT
-/* Define if you have the feof_unlocked function. */
-#undef HAVE_FEOF_UNLOCKED
+/* Define if you have the iconv() function. */
+#undef HAVE_ICONV
-/* Define if you have the fgets_unlocked function. */
-#undef HAVE_FGETS_UNLOCKED
+/* Define if <inttypes.h> exists and doesn't clash with <sys/types.h>. */
+#undef HAVE_INTTYPES_H
-/* Define if you have the fmod function. */
-#undef HAVE_FMOD
+/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and
+ declares uintmax_t. */
+#undef HAVE_INTTYPES_H_WITH_UINTMAX
-/* Define if you have the getc_unlocked function. */
-#undef HAVE_GETC_UNLOCKED
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
-/* Define if you have the getcwd function. */
-#undef HAVE_GETCWD
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
-/* Define if you have the getegid function. */
-#undef HAVE_GETEGID
+/* Define to 1 if you have the `dl' library (-ldl). */
+#undef HAVE_LIBDL
-/* Define if you have the geteuid function. */
-#undef HAVE_GETEUID
+/* Define to 1 if you have the <libintl.h> header file. */
+#undef HAVE_LIBINTL_H
-/* Define if you have the getgid function. */
-#undef HAVE_GETGID
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
-/* Define if you have the getgroups function. */
-#undef HAVE_GETGROUPS
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
-/* Define if you have the getpagesize function. */
-#undef HAVE_GETPAGESIZE
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
-/* Define if you have the getuid function. */
-#undef HAVE_GETUID
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
-/* Define if you have the mbrlen function. */
+/* Define to 1 if you have the `mbrlen' function. */
#undef HAVE_MBRLEN
-/* Define if you have the mbrtowc function. */
+/* Define to 1 if you have the `mbrtowc' function. */
#undef HAVE_MBRTOWC
-/* Define if you have the memcmp function. */
+/* 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 mempcpy 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 if you have the memset function. */
+/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
-/* Define if you have the munmap 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 if you have the putenv function. */
+/* 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 if you have the setenv function. */
+/* Define to 1 if you have the `setenv' function. */
#undef HAVE_SETENV
-/* Define if you have the setlocale function. */
+/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
-/* Define if you have the stpcpy function. */
+/* Define to 1 if you have the <signum.h> header file. */
+#undef HAVE_SIGNUM_H
+
+/* 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 if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares
+ uintmax_t. */
+#undef HAVE_STDINT_H_WITH_UINTMAX
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `stpcpy' function. */
#undef HAVE_STPCPY
-/* Define if you have the strcasecmp function. */
+/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
-/* Define if you have the strchr function. */
+/* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR
-/* Define if you have the strdup function. */
+/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
-/* Define if you have the strerror function. */
+/* 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 strtoul function. */
+/* Define to 1 if you have the `strtoul' function. */
#undef HAVE_STRTOUL
-/* Define if you have the system function. */
+/* 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 tsearch function. */
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
+ `HAVE_STRUCT_TM_TM_ZONE' instead. */
+#undef HAVE_TM_ZONE
+
+/* Define to 1 if you have the `tsearch' function. */
#undef HAVE_TSEARCH
-/* Define if you have the tzset function. */
+/* 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 if you have the <argz.h> header file. */
-#undef HAVE_ARGZ_H
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
-/* Define if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
+/* Define if you have the unsigned long long type. */
+#undef HAVE_UNSIGNED_LONG_LONG
-/* Define if you have the <libintl.h> header file. */
-#undef HAVE_LIBINTL_H
+/* Define to 1 if you have the `vprintf' function. */
+#undef HAVE_VPRINTF
-/* Define if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
+/* Define to 1 if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
-/* Define if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
+/* Define to 1 if you have the <wctype.h> header file. */
+#undef HAVE_WCTYPE_H
-/* Define if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
+/* Define to 1 if you have the `__argz_count' function. */
+#undef HAVE___ARGZ_COUNT
-/* Define if you have the <mcheck.h> header file. */
-#undef HAVE_MCHECK_H
+/* Define to 1 if you have the `__argz_next' function. */
+#undef HAVE___ARGZ_NEXT
-/* Define if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
+/* Define to 1 if you have the `__argz_stringify' function. */
+#undef HAVE___ARGZ_STRINGIFY
-/* Define if you have the <netdb.h> header file. */
-#undef HAVE_NETDB_H
+/* Define as const if the declaration of iconv() needs const. */
+#undef ICONV_CONST
-/* Define if you have the <netinet/in.h> header file. */
-#undef HAVE_NETINET_IN_H
+/* Define if integer division by zero raises signal SIGFPE. */
+#undef INTDIV0_RAISES_SIGFPE
-/* Define if you have the <nl_types.h> header file. */
-#undef HAVE_NL_TYPES_H
+/* disable lint checks */
+#undef NO_LINT
-/* Define if you have the <signum.h> header file. */
-#undef HAVE_SIGNUM_H
+/* Name of package */
+#undef PACKAGE
-/* Define if you have the <stdarg.h> header file. */
-#undef HAVE_STDARG_H
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
-/* Define if you have the <stddef.h> header file. */
-#undef HAVE_STDDEF_H
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
-/* Define if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
-/* Define if you have the <string.h> header file. */
-#undef HAVE_STRING_H
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
-/* Define if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
-/* Define if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
+/* Define if <inttypes.h> exists and defines unusable PRI* macros. */
+#undef PRI_MACROS_BROKEN
-/* Define if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
+/* Define if compiler has function prototypes */
+#undef PROTOTYPES
-/* Define if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
+/* use malloc instead of alloca in regex.c */
+#undef REGEX_MALLOC
-/* Define if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
-/* Define if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
+/* return type of sprintf */
+#undef SPRINTF_RET
-/* Define if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
+/* 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 you have the <wchar.h> header file. */
-#undef HAVE_WCHAR_H
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
-/* Define if you have the <wctype.h> header file. */
-#undef HAVE_WCTYPE_H
+/* strtod doesn't have C89 semantics */
+#undef STRTOD_NOT_C89
-/* Define if you have the m library (-lm). */
-#undef HAVE_LIBM
+/* some systems define this type here */
+#undef TIME_T_IN_SYS_TYPES_H
-/* Name of package */
-#undef PACKAGE
+/* 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 if compiler has function prototypes */
-#undef PROTOTYPES
+/* Define to 1 if on MINIX. */
+#undef _MINIX
-/* Define if you have the iconv() function. */
-#undef HAVE_ICONV
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#undef _POSIX_1_SOURCE
-/* Define as const if the declaration of iconv() needs const. */
-#undef ICONV_CONST
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
-/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
-#undef HAVE_LANGINFO_CODESET
+/* Define to 1 if type `char' is unsigned and you are not using gcc. */
+#ifndef __CHAR_UNSIGNED__
+# undef __CHAR_UNSIGNED__
+#endif
-/* Define if your <locale.h> file defines LC_MESSAGES. */
-#undef HAVE_LC_MESSAGES
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
-/* Define to 1 if translation of program messages to the user's native language
- is requested. */
-#undef ENABLE_NLS
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
-/* Define if the GNU gettext() function is already present or preinstalled. */
-#undef HAVE_GETTEXT
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+ if it is not supported. */
+#undef inline
-/* Define if the GNU dcgettext() function is already present or preinstalled. */
-#undef HAVE_DCGETTEXT
+/* 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 unsigned long or unsigned long long if <inttypes.h> and
+ <stdint.h> don't define. */
+#undef uintmax_t
diff --git a/configure b/configure
index d0122909..a6fe6487 100755
--- a/configure
+++ b/configure
@@ -1,47 +1,325 @@
#! /bin/sh
-
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Generated by GNU Autoconf 2.57 for GNU Awk 3.1.2.
+#
+# 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"
-# Defaults:
-ac_help=
+# 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
+
+
+# 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
- --disable-dependency-tracking Speeds up one-time builds
- --enable-dependency-tracking Do not reject slow dependency extractors"
-ac_help="$ac_help
- --enable-portals Enable /p as path prefix for portals"
-ac_help="$ac_help
- --with-whiny-user-strftime Force use of included version of strftime for deficient systems"
-ac_help="$ac_help
- --disable-largefile omit support for large files"
-ac_help="$ac_help
- --with-gnu-ld assume the C compiler uses GNU ld [default=no]"
-ac_help="$ac_help
- --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
- --without-libiconv-prefix don't search for libiconv in includedir and libdir"
-ac_help="$ac_help
- --disable-nls do not use Native Language Support"
-ac_help="$ac_help
- --with-included-gettext use the GNU gettext library included here"
-ac_help="$ac_help
- --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib
- --without-libintl-prefix don't search for libintl in includedir and libdir"
+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.2'
+PACKAGE_STRING='GNU Awk 3.1.2'
+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 MSGFMT GMSGFMT XGETTEXT MSGMERGE build build_cpu build_vendor build_os host host_cpu host_vendor host_os ALLOCA GLIBC21 LIBICONV LTLIBICONV INTLBISON USE_NLS BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT INTLOBJS DATADIRNAME INSTOBJEXT GENCAT 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
@@ -50,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'
@@ -67,17 +350,9 @@ oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
ac_prev=
for ac_option
do
-
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval "$ac_prev=\$ac_option"
@@ -85,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- \
@@ -146,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 \
@@ -243,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 \
@@ -269,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 \
@@ -305,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)
@@ -315,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 \
@@ -326,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.13"
- 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.
@@ -388,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; }
-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
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 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=..
@@ -490,13 +727,458 @@ 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.2 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.2:";;
+ 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
+ --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-rpath do not hardcode runtime library paths
+ --disable-nls do not use Native Language Support
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-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.2
+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.2, 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
@@ -507,138 +1189,132 @@ 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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-# Check whether --with-gnu-ld or --without-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
- withval="$with_gnu_ld"
- test "$withval" = no || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:557: checking for ld used by GCC" >&5
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | [A-Za-z]:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the path of ld
- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:587: checking for GNU ld" >&5
-else
- echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:590: checking for non-GNU ld" >&5
-fi
-if eval "test \"`echo '$''{'acl_cv_path_LD'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -z "$LD"; then
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- acl_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some GNU ld's only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
- test "$with_gnu_ld" != no && break
- else
- test "$with_gnu_ld" != yes && break
- fi
- fi
- done
- IFS="$ac_save_ifs"
-else
- acl_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-LD="$acl_cv_path_LD"
-if test -n "$LD"; then
- echo "$ac_t""$LD" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
-echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:625: checking if the linker ($LD) is GNU ld" >&5
-if eval "test \"`echo '$''{'acl_cv_prog_gnu_ld'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # I'd rather use --version here, but apparently some GNU ld's only accept -v.
-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
- acl_cv_prog_gnu_ld=yes
-else
- acl_cv_prog_gnu_ld=no
-fi
-fi
-echo "$ac_t""$acl_cv_prog_gnu_ld" 1>&6
-with_gnu_ld=$acl_cv_prog_gnu_ld
+
+
+
+
+
+
+# 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
@@ -649,18 +1325,20 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
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 "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+ { { 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=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
+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
@@ -669,65 +1347,78 @@ am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
# 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:678: 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=":"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
+ 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_PROGRAM}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:731: checking whether build environment is sane" >&5
+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
@@ -750,8 +1441,11 @@ if (
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
- { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
-alias in your environment" 1>&2; exit 1; }
+ { { 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
@@ -760,28 +1454,30 @@ then
# Ok.
:
else
- { echo "configure: error: newly created file is older than distributed files!
-Check your system clock" 1>&2; exit 1; }
-fi
-echo "$ac_t""yes" 1>&6
-if test "$program_transform_name" = s,x,x,; then
- program_transform_name=
-else
- # Double any \ or $. echo might interpret backslashes.
- cat <<\EOF_SED > conftestsed
-s,\\,\\\\,g; s,\$,$$,g
-EOF_SED
- program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
- rm -f conftestsed
+ { { 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"
+ 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"
+ 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
-# sed with no file args requires a program.
-test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+# 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
@@ -789,144 +1485,129 @@ if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
- am_backtick='`'
- echo "configure: warning: ${am_backtick}missing' script is too old or missing" 1>&2
+ { 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.
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:802: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_AWK="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
+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"
+AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- echo "$ac_t""$AWK" 1>&6
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-test -n "$AWK" && break
+ test -n "$AWK" && break
done
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:832: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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
-# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then
- enableval="$enable_dependency_tracking"
- :
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
-fi
-
-
-if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-
-rm -f .deps 2>/dev/null
-mkdir .deps 2>/dev/null
-if test -d .deps; then
- DEPDIR=.deps
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
else
- # MS-DOS does not allow filenames that begin with a dot.
- DEPDIR=_deps
+ am__leading_dot=_
fi
-rmdir .deps 2>/dev/null
-
+rmdir .tst 2>/dev/null
-# test to see if srcdir already configured
-if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
+ # test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
- { echo "configure: error: source directory already configured; run \"make distclean\" there first" 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
fi
-# Define the identity of the package.
-PACKAGE=gawk
-VERSION=3.1.1
-cat >> confdefs.h <<EOF
-#define PACKAGE "$PACKAGE"
-EOF
+# 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
-cat >> confdefs.h <<EOF
-#define VERSION "$VERSION"
-EOF
+# Define the identity of the package.
+ PACKAGE=gawk
+ VERSION=3.1.2
-# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
-# the ones we care about.
-# Autoconf 2.50 always computes EXEEXT. However we need to be
-# compatible with 2.13, for now. So we always define EXEEXT, but we
-# don't compute it.
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
-# Similar for OBJEXT -- only we only use OBJEXT if the user actually
-# requests that it be used. This is a bit dumb.
-: ${OBJEXT=o}
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
# Some tools Automake needs.
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"}
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake"}
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
@@ -939,302 +1620,841 @@ 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
+
+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"
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_PORTALS 1
-EOF
+_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 <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define USE_INCLUDED_STRFTIME 1
-EOF
+_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;
+
+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:980: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_YACC="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
+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:1011: checking whether ln -s works" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
else
- ac_cv_prog_LN_S=ln
+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:1034: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="gcc"
- break
- fi
- done
- IFS="$ac_save_ifs"
+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:1064: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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=":"
ac_prog_rejected=no
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- break
- fi
- done
- IFS="$ac_save_ifs"
+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
- if test -z "$CC"; then
- case "`uname -s`" in
- *win32* | *WIN32*)
- # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1115: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="cl"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-CC="$ac_cv_prog_CC"
+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
- ;;
- esac
+
+ 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
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+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
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1147: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+ test -n "$ac_ct_CC" && break
+done
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-cat > conftest.$ac_ext << EOF
-
-#line 1158 "configure"
-#include "confdefs.h"
-
-main(){return(0);}
-EOF
-if { (eval echo configure:1163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- ac_cv_prog_cc_works=yes
- # If we can't run a trivial program, we are probably using a cross compiler.
- if (./conftest; exit) 2>/dev/null; then
- ac_cv_prog_cc_cross=no
+ 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
- ac_cv_prog_cc_cross=yes
+ 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
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_prog_cc_works=no
fi
-rm -fr conftest*
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+echo "$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. */
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
-fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1189: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
-cross_compiling=$ac_cv_prog_cc_cross
+int
+main ()
+{
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1194: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
+ ;
+ 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
- ac_cv_prog_gcc=no
+ 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. */
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
-else
- GCC=
-fi
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+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. */
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1222: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_prog_cc_g=yes
else
- 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
+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"
+ CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
@@ -1248,6 +2468,226 @@ 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}
@@ -1256,9 +2696,9 @@ doit:
@echo done
END
# If we don't find an include directive, just comment out the code.
-echo $ac_n "checking for style of include used by $am_make""... $ac_c" 1>&6
-echo "configure:1261: checking for style of include used by $am_make" >&5
-am__include='#'
+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.
@@ -1268,7 +2708,7 @@ echo "include confinc" > confmf
# In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
am__include=include
am__quote=
_am_result=GNU
@@ -1278,22 +2718,44 @@ 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__quote="\""
_am_result=BSD
fi
fi
-echo "$ac_t""$_am_result" 1>&6
+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 $ac_n "checking dependency style of $depcc""... $ac_c" 1>&6
-echo "configure:1295: checking dependency style of $depcc" >&5
-if eval "test \"`echo '$''{'am_cv_CC_dependencies_compiler_type'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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
@@ -1337,11 +2799,17 @@ else
if depmode=$depmode \
source=conftest.c object=conftest.o \
depfile=conftest.Po tmpdepfile=conftest.TPo \
- $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
+ $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
- am_cv_CC_dependencies_compiler_type=$depmode
- break
+ # 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
@@ -1352,132 +2820,341 @@ else
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
-echo "$ac_t""$am_cv_CC_dependencies_compiler_type" 1>&6
-CCDEPMODE="depmode=$am_cv_CC_dependencies_compiler_type"
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1362: checking how to run the C preprocessor" >&5
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+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
+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
-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"
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # 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 1377 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
+ # 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 1394 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1400: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+ 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="${CC-cc} -nologo -E"
- cat > conftest.$ac_ext <<EOF
-#line 1411 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1417: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
+ 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
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
+ 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*
+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
-rm -f conftest*
- ac_cv_prog_CPP="$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
+ 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
- CPP="$ac_cv_prog_CPP"
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
else
- ac_cv_prog_CPP="$CPP"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
fi
-echo "$ac_t""$CPP" 1>&6
+rm -f conftest.err conftest.$ac_ext
-# Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1444: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-RANLIB="$ac_cv_prog_RANLIB"
+RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&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_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
-# This is a hack. Different versions of install on different systems
-# are just too different. Chuck it and use install-sh.
-#
-# If the user supplies $INSTALL, figure they know what they're doing.
-if test "x$INSTALL" = "x"
-then
- INSTALL="$srcdir/install-sh -c"
- export INSTALL
+ 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
# incompatible versions:
@@ -1485,96 +3162,111 @@ fi
# 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:1494: 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=":"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
+ 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_PROGRAM}'
+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:1548: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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
# This is mainly for my use during testing and development.
# Yes, it's a bit of a hack.
-echo $ac_n "checking for special development options""... $ac_c" 1>&6
-echo "configure:1578: checking for special development options" >&5
+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
@@ -1584,369 +3276,820 @@ then
then
CFLAGS="$CFLAGS -Wall"
fi
- echo "$ac_t""yes" 1>&6
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
else
- echo "$ac_t""no" 1>&6
+ 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:1596: checking for AIX" >&5
-cat > conftest.$ac_ext <<EOF
-#line 1598 "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 strerror in -lcposix""... $ac_c" 1>&6
-echo "configure:1621: checking for strerror in -lcposix" >&5
-ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5
+echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6
+if test "${ac_cv_lib_cposix_strerror+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-lcposix $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1629 "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. */
+
/* 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; }
-EOF
-if { (eval echo configure:1640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ 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
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_cposix_strerror=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5
+echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6
+if test $ac_cv_lib_cposix_strerror = yes; then
+ LIBS="$LIBS -lcposix"
+fi
+
+
+
+echo "$as_me:$LINENO: checking for 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*
-LIBS="$ac_save_LIBS"
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- LIBS="$LIBS -lcposix"
+
+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
-ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:1664: checking for minix/config.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 1669 "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>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+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
+
+# 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>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+_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
-rm -f conftest*
+echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+if test $ac_cv_header_minix_config_h = yes; then
MINIX=yes
else
- echo "$ac_t""no" 1>&6
-MINIX=
+ MINIX=
fi
+
if test "$MINIX" = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define _POSIX_SOURCE 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define _POSIX_1_SOURCE 2
-EOF
+_ACEOF
+
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define _MINIX 1
-EOF
+_ACEOF
fi
-
- # Check whether --enable-largefile or --disable-largefile was given.
+# 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
+fi;
+if test "$enable_largefile" != no; then
- echo $ac_n "checking for special C compiler options needed for large files""... $ac_c" 1>&6
-echo "configure:1721: checking for special C compiler options needed for large files" >&5
-if eval "test \"`echo '$''{'ac_cv_sys_largefile_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ 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
ac_cv_sys_largefile_CC=no
- if test "$GCC" != yes; then
- # IRIX 6.2 and later do not support large files by default,
- # so use the C compiler's -n32 option if that helps.
- cat > conftest.$ac_ext <<EOF
-#line 1730 "configure"
-#include "confdefs.h"
+ 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>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply "#define LARGE_OFF_T 9223372036854775807",
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:1746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- :
+ /* 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_save_CC="$CC"
- CC="$CC -n32"
- cat > conftest.$ac_ext <<EOF
-#line 1755 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply "#define LARGE_OFF_T 9223372036854775807",
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:1771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_sys_largefile_CC=' -n32'
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
- CC="$ac_save_CC"
-fi
-rm -f conftest*
- fi
+ 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 "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+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_sys_largefile_CC" 1>&6
- if test "$ac_cv_sys_largefile_CC" != no; then
- CC="$CC$ac_cv_sys_largefile_CC"
- fi
-
- echo $ac_n "checking for _FILE_OFFSET_BITS value needed for large files""... $ac_c" 1>&6
-echo "configure:1791: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-if eval "test \"`echo '$''{'ac_cv_sys_file_offset_bits'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ 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 <<EOF
-#line 1797 "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>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply "#define LARGE_OFF_T 9223372036854775807",
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:1813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- :
+ /* 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- cat > conftest.$ac_ext <<EOF
-#line 1820 "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
+ 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 9223372036854775807",
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:1838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_sys_file_offset_bits=64
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-fi
-rm -f conftest*
+ /* 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
-echo "$ac_t""$ac_cv_sys_file_offset_bits" 1>&6
- if test "$ac_cv_sys_file_offset_bits" != no; then
- cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
-EOF
+_ACEOF
- fi
- echo $ac_n "checking for _LARGE_FILES value needed for large files""... $ac_c" 1>&6
-echo "configure:1858: checking for _LARGE_FILES value needed for large files" >&5
-if eval "test \"`echo '$''{'ac_cv_sys_large_files'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+fi
+rm -f conftest*
+ 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
+ while :; do
ac_cv_sys_large_files=no
- cat > conftest.$ac_ext <<EOF
-#line 1864 "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>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply "#define LARGE_OFF_T 9223372036854775807",
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:1880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- :
+ /* 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- cat > conftest.$ac_ext <<EOF
-#line 1887 "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
+ 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 9223372036854775807",
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-
-
-int main() {
-
-; return 0; }
-EOF
-if { (eval echo configure:1905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_sys_large_files=1
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ /* 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
-rm -f conftest*
+echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
+echo "${ECHO_T}$ac_cv_sys_large_files" >&6
+if test "$ac_cv_sys_large_files" != no; then
+
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+
fi
rm -f conftest*
fi
-echo "$ac_t""$ac_cv_sys_large_files" 1>&6
- if test "$ac_cv_sys_large_files" != no; then
- cat >> confdefs.h <<EOF
-#define _LARGE_FILES $ac_cv_sys_large_files
-EOF
-
- fi
- fi
-
-echo $ac_n "checking for AIX compilation hacks""... $ac_c" 1>&6
-echo "configure:1928: checking for AIX compilation hacks" >&5
-if eval "test \"`echo '$''{'gawk_cv_aix_hack'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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/bos
+
+if test -d /lpp
then
- CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
+ CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED=1 -DGAWK_AIX=1"
gawk_cv_aix_hack=yes
else
gawk_cv_aix_hack=no
fi
fi
-echo "$ac_t""${gawk_cv_aix_hack}" 1>&6
+echo "$as_me:$LINENO: result: ${gawk_cv_aix_hack}" >&5
+echo "${ECHO_T}${gawk_cv_aix_hack}" >&6
-echo $ac_n "checking for Linux/Alpha compilation hacks""... $ac_c" 1>&6
-echo "configure:1946: checking for Linux/Alpha compilation hacks" >&5
-if eval "test \"`echo '$''{'gawk_cv_linux_alpha_hack'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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
-
+
if test "Linux" = "`uname`" && test "alpha" = "`uname -m`"
then
# this isn't necessarily always true,
@@ -1963,7 +4106,8 @@ else
fi
fi
-echo "$ac_t""${gawk_cv_linux_alpha_hack}" 1>&6
+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
@@ -1974,10 +4118,10 @@ fi
-echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:1979: checking for ${CC-cc} option to accept ANSI C" >&5
-if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for ${CC-cc} option to accept ANSI C" >&5
+echo $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6
+if test "${am_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
am_cv_prog_cc_stdc=no
ac_save_CC="$CC"
@@ -1991,9 +4135,13 @@ ac_save_CC="$CC"
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 <<EOF
-#line 1996 "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 <stdarg.h>
#include <stdio.h>
#include <sys/types.h>
@@ -2023,29 +4171,46 @@ int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, i
int argc;
char **argv;
-int main() {
+int
+main ()
+{
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
-; return 0; }
-EOF
-if { (eval echo configure:2033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
done
CC="$ac_save_CC"
fi
if test -z "$am_cv_prog_cc_stdc"; then
- echo "$ac_t""none needed" 1>&6
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6
else
- echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
+ 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) ;;
@@ -2054,60 +4219,85 @@ esac
-echo $ac_n "checking for function prototypes""... $ac_c" 1>&6
-echo "configure:2059: checking for function prototypes" >&5
+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 "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
#define PROTOTYPES 1
-EOF
+_ACEOF
U= ANSI2KNR=
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
U=_ ANSI2KNR=./ansi2knr
fi
# Ensure some checks needed by ansi2knr itself.
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2073: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2078 "configure"
-#include "confdefs.h"
+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>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
+
+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 2103 "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*
@@ -2116,16 +4306,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 2121 "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*
@@ -2134,127 +4328,227 @@ 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 2142 "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:2153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./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
-for ac_hdr in string.h
+
+for ac_header in string.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2180: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2185 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
+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
- echo "$ac_t""no" 1>&6
+ 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
-done
-
+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
- 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"
+done
- echo $ac_n "checking for shared library run path origin""... $ac_c" 1>&6
-echo "configure:2236: checking for shared library run path origin" >&5
-if eval "test \"`echo '$''{'acl_cv_rpath'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
- ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
- . ./conftest.sh
- rm -f ./conftest.sh
- acl_cv_rpath=done
-
-fi
-echo "$ac_t""$acl_cv_rpath" 1>&6
- wl="$acl_cv_wl"
- libext="$acl_cv_libext"
- shlibext="$acl_cv_shlibext"
- hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
- hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
- hardcode_direct="$acl_cv_hardcode_direct"
- hardcode_minus_L="$acl_cv_hardcode_minus_L"
- sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
- sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
+case `(uname) 2> /dev/null` in
+*CYGWIN*)
+ with_libiconv_prefix=no
+ with_libintl_prefix=no
+ LIBS="$LIBS /usr/lib/automode.o"
+ ;;
+*)
+ ;;
+esac
MKINSTALLDIRS=
@@ -2264,260 +4558,582 @@ echo "$ac_t""$acl_cv_rpath" 1>&6
if test -z "$MKINSTALLDIRS"; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
-
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+
+
+
+ # Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_MSGFMT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case "$MSGFMT" in
+ /*)
+ ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
+ (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+ ac_cv_path_MSGFMT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
+ ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test "$MSGFMT" != ":"; then
+ echo "$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_n "checking host system type""... $ac_c" 1>&6
-echo "configure:2277: checking host system type" >&5
+ # 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
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
- NONE)
- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
- fi ;;
- *) host_alias=$nonopt ;;
- esac ;;
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+ ;;
esac
+fi
+GMSGFMT=$ac_cv_path_GMSGFMT
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
-
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2298: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2303 "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;
-}
+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
-; return 0; }
-EOF
-if { (eval echo configure:2352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_c_const=yes
+
+ # 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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_c_const=no
+ case "$XGETTEXT" in
+ /*)
+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
+ (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+ ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+ ;;
+esac
fi
-rm -f conftest*
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test "$XGETTEXT" != ":"; then
+ echo "$as_me:$LINENO: result: $XGETTEXT" >&5
+echo "${ECHO_T}$XGETTEXT" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ rm -f messages.po
+
+ # Extract the first word of "msgmerge", so it can be a program name with args.
+set dummy msgmerge; ac_word=$2
+echo "$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.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then
+ ac_cv_path_MSGMERGE="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":"
+ ;;
+esac
fi
+MSGMERGE="$ac_cv_path_MSGMERGE"
+if test "$MSGMERGE" != ":"; then
+ echo "$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 "$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= /dev/null >/dev/null 2>&1 &&
+ (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+ : ;
+ else
+ echo "$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
+ 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. */
-echo "$ac_t""$ac_cv_c_const" 1>&6
+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.$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 <<\EOF
-#define const
-EOF
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
fi
-echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2373: checking for inline" >&5
-if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 <<EOF
-#line 2380 "configure"
-#include "confdefs.h"
-
-int main() {
-} $ac_kw foo() {
-; return 0; }
-EOF
-if { (eval echo configure:2387: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf 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. */
+#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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-
-echo "$ac_t""$ac_cv_c_inline" 1>&6
-case "$ac_cv_c_inline" in
+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 <<\EOF
-#define inline
-EOF
+ no)
+cat >>confdefs.h <<\_ACEOF
+#define inline
+_ACEOF
;;
- *) cat >> confdefs.h <<EOF
+ *) cat >>confdefs.h <<_ACEOF
#define inline $ac_cv_c_inline
-EOF
+_ACEOF
;;
esac
-echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2413: checking for off_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2418 "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 "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
+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
- rm -rf conftest*
- ac_cv_type_off_t=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_off_t=no
fi
-echo "$ac_t""$ac_cv_type_off_t" 1>&6
-if test $ac_cv_type_off_t = no; then
- cat >> confdefs.h <<\EOF
+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
-EOF
+_ACEOF
fi
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2446: checking for size_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 <<EOF
-#line 2451 "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 "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf 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 ()
+{
+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
- rm -rf conftest*
- ac_cv_type_size_t=no
-fi
-rm -f conftest*
+ 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 "$ac_t""$ac_cv_type_size_t" 1>&6
-if test $ac_cv_type_size_t = no; then
- cat >> confdefs.h <<\EOF
+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
-EOF
+_ACEOF
fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
-echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2481: checking for working alloca.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2486 "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:2493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- ac_cv_header_alloca_h=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_alloca_h=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
-if test $ac_cv_header_alloca_h = yes; then
- cat >> confdefs.h <<\EOF
+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.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
+echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
+if test $ac_cv_working_alloca_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_ALLOCA_H 1
-EOF
+_ACEOF
fi
-echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2514: checking for alloca" >&5
-if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 2519 "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
@@ -2539,137 +5155,190 @@ char *alloca ();
# endif
#endif
-int main() {
-char *p = (char *) alloca(1);
-; return 0; }
-EOF
-if { (eval echo configure:2547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+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.${ac_objext}
- 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:2579: checking whether alloca needs Cray hooks" >&5
-if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 2584 "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:2609: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2614 "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:2637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<EOF
+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 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:2664: checking stack direction for C alloca" >&5
-if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 2672 "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;
@@ -2682,138 +5351,291 @@ 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:2691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./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_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
+
+
+for ac_header in stdlib.h unistd.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2716: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2721 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+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
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
fi
+
done
+
for ac_func in getpagesize
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2755: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2760 "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:2783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-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:2808: checking for working mmap" >&5
-if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 <<EOF
-#line 2816 "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. */
+$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:
@@ -2827,47 +5649,34 @@ else
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
+ 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
- propogated back to all the places they're supposed to be.
+ 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 <sys/types.h>
+
#include <fcntl.h>
#include <sys/mman.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
+#if !STDC_HEADERS && !HAVE_STDLIB_H
+char *malloc ();
#endif
/* This mess was copied from the GNU getpagesize.h. */
-#ifndef HAVE_GETPAGESIZE
-
+#if !HAVE_GETPAGESIZE
/* Assume that all systems that can run configure have sys/param.h. */
-# ifndef 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 */
-# ifdef HAVE_SYS_PARAM_H
+# if HAVE_SYS_PARAM_H
# include <sys/param.h>
# ifdef EXEC_PAGESIZE
# define getpagesize() EXEC_PAGESIZE
@@ -2894,108 +5703,110 @@ else
#endif /* no HAVE_GETPAGESIZE */
-#ifdef __cplusplus
-extern "C" { void *malloc(unsigned); }
-#else
-char *malloc();
-#endif
-
int
-main()
+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);
-}
+ char *data, *data2, *data3;
+ int i, pagesize;
+ int fd;
-EOF
-if { (eval echo configure:2969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_mmap_fixed_mapped=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_func_mmap_fixed_mapped=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
-
-echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
+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 <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_MMAP 1
-EOF
+_ACEOF
fi
+rm -f conftest.mmap
- echo $ac_n "checking whether we are using the GNU C Library 2.1 or newer""... $ac_c" 1>&6
-echo "configure:2993: checking whether we are using the GNU C Library 2.1 or newer" >&5
-if eval "test \"`echo '$''{'ac_cv_gnu_library_2_1'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ 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 <<EOF
-#line 2998 "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 <features.h>
#ifdef __GNU_LIBRARY__
@@ -3003,64 +5814,606 @@ else
Lucky GNU user
#endif
#endif
-
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "Lucky GNU user" >/dev/null 2>&1; then
- rm -rf conftest*
+ $EGREP "Lucky GNU user" >/dev/null 2>&1; then
ac_cv_gnu_library_2_1=yes
else
- rm -rf conftest*
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
-echo "$ac_t""$ac_cv_gnu_library_2_1" 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 inttypes.h" >&5
+echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6
+if test "${jm_ac_cv_header_inttypes_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* 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 ()
+{
+uintmax_t i = (uintmax_t) -1;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ jm_ac_cv_header_inttypes_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+jm_ac_cv_header_inttypes_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $jm_ac_cv_header_inttypes_h" >&5
+echo "${ECHO_T}$jm_ac_cv_header_inttypes_h" >&6
+ if test $jm_ac_cv_header_inttypes_h = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INTTYPES_H_WITH_UINTMAX 1
+_ACEOF
+
+ fi
+
+
+ echo "$as_me:$LINENO: checking for stdint.h" >&5
+echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6
+if test "${jm_ac_cv_header_stdint_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 <stdint.h>
+int
+main ()
+{
+uintmax_t i = (uintmax_t) -1;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ jm_ac_cv_header_stdint_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+jm_ac_cv_header_stdint_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $jm_ac_cv_header_stdint_h" >&5
+echo "${ECHO_T}$jm_ac_cv_header_stdint_h" >&6
+ if test $jm_ac_cv_header_stdint_h = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STDINT_H_WITH_UINTMAX 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
+
+
+
+
+ if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
+
+ test $ac_cv_type_unsigned_long_long = yes \
+ && ac_type='unsigned long long' \
+ || ac_type='unsigned long'
+
+cat >>confdefs.h <<_ACEOF
+#define uintmax_t $ac_type
+_ACEOF
+
+ fi
+
+
+ echo "$as_me:$LINENO: checking for 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;
+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"
+ sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
+ sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
+ # Check whether --enable-rpath or --disable-rpath was given.
+if test "${enable_rpath+set}" = set; then
+ enableval="$enable_rpath"
+ :
+else
+ enable_rpath=yes
+fi;
+
+
+
+
+
+
+
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.
+
+# 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"
@@ -3070,8 +6423,7 @@ if test "${with_libiconv_prefix+set}" = set; then
fi
fi
-fi
-
+fi;
LIBICONV=
LTLIBICONV=
INCICONV=
@@ -3127,7 +6479,7 @@ 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"
@@ -3164,7 +6516,7 @@ fi
if test "X$found_dir" != "X"; then
LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name"
if test "X$found_so" != "X"; then
- if test "X$found_dir" = "X/usr/lib"; then
+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
else
haveit=
@@ -3195,7 +6547,7 @@ fi
else
haveit=
for x in $LDFLAGS $LIBICONV; do
-
+
acl_save_prefix="$prefix"
prefix="$acl_final_prefix"
acl_save_exec_prefix="$exec_prefix"
@@ -3246,7 +6598,7 @@ 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"
@@ -3291,7 +6643,7 @@ 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"
@@ -3312,7 +6664,7 @@ fi
fi
haveit=
for x in $LDFLAGS $LTLIBICONV; do
-
+
acl_save_prefix="$prefix"
prefix="$acl_final_prefix"
acl_save_exec_prefix="$exec_prefix"
@@ -3336,25 +6688,27 @@ fi
;;
-R*)
dir=`echo "X$dep" | sed -e 's/^X-R//'`
- haveit=
- for x in $rpathdirs; do
- if test "X$x" = "X$dir"; then
- haveit=yes
- break
+ 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
- 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
+ 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
- done
- if test -z "$haveit"; then
- ltrpathdirs="$ltrpathdirs $dir"
fi
;;
-l*)
@@ -3406,12 +6760,278 @@ fi
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
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
+geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
+strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* 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
+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
+
+
+
+
+
+
+
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"
@@ -3431,364 +7051,134 @@ fi
done
- echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:3436: checking for iconv" >&5
-if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ 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 <<EOF
-#line 3444 "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 <iconv.h>
-int main() {
+int
+main ()
+{
iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);
-; return 0; }
-EOF
-if { (eval echo configure:3454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+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 <<EOF
-#line 3466 "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 <iconv.h>
-int main() {
+int
+main ()
+{
iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);
-; return 0; }
-EOF
-if { (eval echo configure:3476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS="$am_save_LIBS"
fi
-
-fi
-echo "$ac_t""$am_cv_func_iconv" 1>&6
+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 <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_ICONV 1
-EOF
+_ACEOF
fi
if test "$am_cv_lib_iconv" = yes; then
- echo $ac_n "checking how to link with libiconv""... $ac_c" 1>&6
-echo "configure:3499: checking how to link with libiconv" >&5
- echo "$ac_t""$LIBICONV" 1>&6
+ 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
-
-
-
-
-
-
- # Extract the first word of "msgfmt", so it can be a program name with args.
-set dummy msgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3515: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$MSGFMT" in
- /*)
- ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
- (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
- ac_cv_path_MSGFMT="$ac_dir/$ac_word"
- break
- fi
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
- ;;
-esac
-fi
-MSGFMT="$ac_cv_path_MSGFMT"
-if test "$MSGFMT" != ":"; then
- echo "$ac_t""$MSGFMT" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- # Extract the first word of "gmsgfmt", so it can be a program name with args.
-set dummy gmsgfmt; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3550: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$GMSGFMT" in
- /*)
- ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
- ;;
- ?:/*)
- ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
- ;;
-esac
-fi
-GMSGFMT="$ac_cv_path_GMSGFMT"
-if test -n "$GMSGFMT"; then
- echo "$ac_t""$GMSGFMT" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
- # Extract the first word of "xgettext", so it can be a program name with args.
-set dummy xgettext; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3587: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$XGETTEXT" in
- /*)
- ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
- (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
- ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
- break
- fi
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
- ;;
-esac
-fi
-XGETTEXT="$ac_cv_path_XGETTEXT"
-if test "$XGETTEXT" != ":"; then
- echo "$ac_t""$XGETTEXT" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- rm -f messages.po
-
- # Extract the first word of "msgmerge", so it can be a program name with args.
-set dummy msgmerge; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3624: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_MSGMERGE'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$MSGMERGE" in
- /*)
- ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then
- ac_cv_path_MSGMERGE="$ac_dir/$ac_word"
- break
- fi
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":"
- ;;
-esac
-fi
-MSGMERGE="$ac_cv_path_MSGMERGE"
-if test "$MSGMERGE" != ":"; then
- echo "$ac_t""$MSGMERGE" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
- if test "$GMSGFMT" != ":"; then
- if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
- (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
- : ;
- else
- GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
- echo "$ac_t""found $GMSGFMT program is not GNU msgfmt; ignore it" 1>&6
- GMSGFMT=":"
- fi
- fi
-
- if test "$XGETTEXT" != ":"; then
- if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
- (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
- : ;
- else
- echo "$ac_t""found xgettext program is not GNU xgettext; ignore it" 1>&6
- XGETTEXT=":"
- fi
- rm -f messages.po
- fi
-
-
-
-
-
- for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
-stdlib.h string.h unistd.h sys/param.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3687: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 3692 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 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
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3728: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 3733 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:3756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-
if test "$am_cv_func_iconv" = yes; then
- echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:3785: checking for iconv declaration" >&5
- if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ 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 <<EOF
-#line 3791 "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 <iconv.h>
@@ -3802,141 +7192,204 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si
size_t iconv();
#endif
-int main() {
+int
+main ()
+{
-; return 0; }
-EOF
-if { (eval echo configure:3810: \"$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
am_cv_proto_iconv_arg1=""
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- am_cv_proto_iconv_arg1="const"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+am_cv_proto_iconv_arg1="const"
fi
-rm -f conftest*
+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 "$ac_t""${ac_t:-
- }$am_cv_proto_iconv" 1>&6
- cat >> confdefs.h <<EOF
+ 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
-EOF
+_ACEOF
fi
-
- echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6
-echo "configure:3834: checking for nl_langinfo and CODESET" >&5
-if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+ 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 <<EOF
-#line 3839 "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 <langinfo.h>
-int main() {
+int
+main ()
+{
char* cs = nl_langinfo(CODESET);
-; return 0; }
-EOF
-if { (eval echo configure:3846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- am_cv_langinfo_codeset=no
-fi
-rm -f conftest*
-
+ 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
-echo "$ac_t""$am_cv_langinfo_codeset" 1>&6
+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 <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_LANGINFO_CODESET 1
-EOF
+_ACEOF
fi
if test $ac_cv_header_locale_h = yes; then
- echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3869: checking for LC_MESSAGES" >&5
-if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 3874 "configure"
-#include "confdefs.h"
+
+ 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() {
+int
+main ()
+{
return LC_MESSAGES
-; return 0; }
-EOF
-if { (eval echo configure:3881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- am_cv_val_LC_MESSAGES=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+am_cv_val_LC_MESSAGES=no
fi
-rm -f conftest*
+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
-echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
- if test $am_cv_val_LC_MESSAGES = yes; then
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define HAVE_LC_MESSAGES 1
-EOF
+_ACEOF
+
+ fi
- fi
fi
for ac_prog in bison
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:3907: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_INTLBISON'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_INTLBISON="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
+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"
+INTLBISON=$ac_cv_prog_INTLBISON
if test -n "$INTLBISON"; then
- echo "$ac_t""$INTLBISON" 1>&6
+ echo "$as_me:$LINENO: result: $INTLBISON" >&5
+echo "${ECHO_T}$INTLBISON" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-test -n "$INTLBISON" && break
+ test -n "$INTLBISON" && break
done
if test -z "$INTLBISON"; then
ac_verc_fail=yes
else
- echo $ac_n "checking version of bison""... $ac_c" 1>&6
-echo "configure:3940: checking version of bison" >&5
+ 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;;
@@ -3944,132 +7397,155 @@ echo "configure:3940: checking version of bison" >&5
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
esac
- echo "$ac_t""$ac_prog_version" 1>&6
+ 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 $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3967: checking whether NLS is requested" >&5
+
+
+
+
+
+
+
+
+
+
+ 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
+fi;
+ echo "$as_me:$LINENO: result: $USE_NLS" >&5
+echo "${ECHO_T}$USE_NLS" >&6
+
- echo "$ac_t""$USE_NLS" 1>&6
-
-
BUILD_INCLUDED_LIBINTL=no
USE_INCLUDED_LIBINTL=no
-
+
LIBINTL=
LTLIBINTL=
POSUB=
if test "$USE_NLS" = "yes"; then
gt_use_preinstalled_gnugettext=no
-
- echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3991: checking whether included gettext is requested" >&5
- # Check whether --with-included-gettext or --without-included-gettext was given.
+
+ 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 "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
+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 $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6
-echo "configure:4011: checking for GNU gettext in libc" >&5
-if eval "test \"`echo '$''{'gt_cv_func_gnugettext2_libc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 4016 "configure"
-#include "confdefs.h"
+
+
+
+
+
+
+ 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() {
+int
+main ()
+{
bindtextdomain ("", "");
return (int) gettext ("") + (int) ngettext ("", "", 0) + _nl_msg_cat_cntr + *_nl_domain_bindings
-; return 0; }
-EOF
-if { (eval echo configure:4026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- gt_cv_func_gnugettext2_libc=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gt_cv_func_gnugettext2_libc=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-
-echo "$ac_t""$gt_cv_func_gnugettext2_libc" 1>&6
+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.
+
+# 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"
@@ -4079,8 +7555,7 @@ if test "${with_libintl_prefix+set}" = set; then
fi
fi
-fi
-
+fi;
LIBINTL=
LTLIBINTL=
INCINTL=
@@ -4136,7 +7611,7 @@ 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"
@@ -4173,7 +7648,7 @@ fi
if test "X$found_dir" != "X"; then
LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name"
if test "X$found_so" != "X"; then
- if test "X$found_dir" = "X/usr/lib"; then
+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
else
haveit=
@@ -4204,7 +7679,7 @@ fi
else
haveit=
for x in $LDFLAGS $LIBINTL; do
-
+
acl_save_prefix="$prefix"
prefix="$acl_final_prefix"
acl_save_exec_prefix="$exec_prefix"
@@ -4255,7 +7730,7 @@ 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"
@@ -4300,7 +7775,7 @@ 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"
@@ -4321,7 +7796,7 @@ fi
fi
haveit=
for x in $LDFLAGS $LTLIBINTL; do
-
+
acl_save_prefix="$prefix"
prefix="$acl_final_prefix"
acl_save_exec_prefix="$exec_prefix"
@@ -4345,25 +7820,27 @@ fi
;;
-R*)
dir=`echo "X$dep" | sed -e 's/^X-R//'`
- haveit=
- for x in $rpathdirs; do
- if test "X$x" = "X$dir"; then
- haveit=yes
- break
+ 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
- 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
+ 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
- done
- if test -z "$haveit"; then
- ltrpathdirs="$ltrpathdirs $dir"
fi
;;
-l*)
@@ -4414,18 +7891,22 @@ fi
done
fi
- echo $ac_n "checking for GNU gettext in libintl""... $ac_c" 1>&6
-echo "configure:4419: checking for GNU gettext in libintl" >&5
-if eval "test \"`echo '$''{'gt_cv_func_gnugettext2_libintl'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ 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 <<EOF
-#line 4428 "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 <libintl.h>
extern int _nl_msg_cat_cntr;
extern
@@ -4433,26 +7914,44 @@ extern
"C"
#endif
const char *_nl_expand_alias ();
-int main() {
+int
+main ()
+{
bindtextdomain ("", "");
return (int) gettext ("") + (int) ngettext ("", "", 0) + _nl_msg_cat_cntr + *_nl_expand_alias (0)
-; return 0; }
-EOF
-if { (eval echo configure:4442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- gt_cv_func_gnugettext2_libintl=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gt_cv_func_gnugettext2_libintl=no
fi
-rm -f conftest*
+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 <<EOF
-#line 4455 "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 <libintl.h>
extern int _nl_msg_cat_cntr;
extern
@@ -4460,28 +7959,43 @@ extern
"C"
#endif
const char *_nl_expand_alias ();
-int main() {
+int
+main ()
+{
bindtextdomain ("", "");
return (int) gettext ("") + (int) ngettext ("", "", 0) + _nl_msg_cat_cntr + *_nl_expand_alias (0)
-; return 0; }
-EOF
-if { (eval echo configure:4469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
CPPFLAGS="$gt_save_CPPFLAGS"
LIBS="$gt_save_LIBS"
fi
-
-echo "$ac_t""$gt_cv_func_gnugettext2_libintl" 1>&6
+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" \
@@ -4494,7 +8008,7 @@ echo "$ac_t""$gt_cv_func_gnugettext2_libintl" 1>&6
INCINTL=
fi
-
+
if test "$gt_use_preinstalled_gnugettext" != "yes"; then
nls_cv_use_gnu_gettext=yes
fi
@@ -4513,13 +8027,14 @@ echo "$ac_t""$gt_cv_func_gnugettext2_libintl" 1>&6
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
CATOBJEXT=.gmo
fi
-
+
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define ENABLE_NLS 1
-EOF
+_ACEOF
else
USE_NLS=no
@@ -4530,14 +8045,15 @@ EOF
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
if test "$gt_cv_func_gnugettext2_libintl" = "yes"; then
- echo $ac_n "checking how to link with libintl""... $ac_c" 1>&6
-echo "configure:4535: checking how to link with libintl" >&5
- echo "$ac_t""$LIBINTL" 1>&6
-
+ 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"
@@ -4558,93 +8074,118 @@ echo "configure:4535: checking how to link with libintl" >&5
fi
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_GETTEXT 1
-EOF
+_ACEOF
+
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define HAVE_DCGETTEXT 1
-EOF
+_ACEOF
fi
POSUB=po
fi
-
+
if test "$PACKAGE" = gettext; then
BUILD_INCLUDED_LIBINTL=yes
fi
-
-
-
-
+
+
+
+
nls_cv_header_intl=
nls_cv_header_libgt=
DATADIRNAME=share
-
+
INSTOBJEXT=.mo
-
+
GENCAT=gencat
-
+
INTL_LIBTOOL_SUFFIX_PREFIX=
-
-
+
+
INTLLIBS="$LIBINTL"
-
-
-
-
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:4610: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+
+
+
+
+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 4615 "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:4623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
+
+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 4640 "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*
@@ -4653,16 +8194,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 4658 "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*
@@ -4671,295 +8216,717 @@ 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 4679 "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:4690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./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
-echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:4714: checking for sys/wait.h that is POSIX.1 compatible" >&5
-if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 <<EOF
-#line 4719 "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/wait.h>
#ifndef WEXITSTATUS
-#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
#ifndef WIFEXITED
-#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
#endif
-int main() {
-int s;
-wait (&s);
-s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
-; return 0; }
-EOF
-if { (eval echo configure:4735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+
+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 "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
+
+ac_cv_header_sys_wait_h=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-
-echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
+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 <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_SYS_WAIT_H 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:4756: checking whether time.h and sys/time.h may both be included" >&5
-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 4761 "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:4770: \"$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
-for ac_hdr in fcntl.h limits.h locale.h libintl.h mcheck.h \
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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 \
- wchar.h wctype.h
+ termios.h stropts.h wchar.h wctype.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4797: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 4802 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+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
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
+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_hdr in memory.h
+
+for ac_header in memory.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4840: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 4845 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+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
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
+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_hdr in strings.h
+
+for ac_header in strings.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4881: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 4886 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4891: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+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
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
+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 $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:4920: checking for pid_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 <<EOF
-#line 4925 "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 "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf 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 ()
+{
+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
- rm -rf conftest*
- ac_cv_type_pid_t=no
-fi
-rm -f conftest*
+ 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 "$ac_t""$ac_cv_type_pid_t" 1>&6
-if test $ac_cv_type_pid_t = no; then
- cat >> confdefs.h <<\EOF
+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
-EOF
+_ACEOF
fi
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:4953: checking return type of signal handlers" >&5
-if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 <<EOF
-#line 4958 "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 <signal.h>
#ifdef signal
-#undef signal
+# undef signal
#endif
#ifdef __cplusplus
extern "C" void (*signal (int, void (*)(int)))(int);
@@ -4967,113 +8934,162 @@ extern "C" void (*signal (int, void (*)(int)))(int);
void (*signal ()) ();
#endif
-int main() {
+int
+main ()
+{
int i;
-; return 0; }
-EOF
-if { (eval echo configure:4975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ 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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_type_signal=int
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_signal=int
fi
-rm -f conftest*
+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
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
#define RETSIGTYPE $ac_cv_type_signal
-EOF
-
-
-echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:4994: checking for size_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 4999 "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 "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
+_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
- rm -rf conftest*
- ac_cv_type_size_t=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_size_t=no
fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&6
-if test $ac_cv_type_size_t = no; then
- cat >> confdefs.h <<\EOF
+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
-EOF
+_ACEOF
fi
-echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:5027: checking for uid_t in sys/types.h" >&5
-if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 <<EOF
-#line 5032 "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>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "uid_t" >/dev/null 2>&1; then
- rm -rf conftest*
+ $EGREP "uid_t" >/dev/null 2>&1; then
ac_cv_type_uid_t=yes
else
- rm -rf conftest*
ac_cv_type_uid_t=no
fi
rm -f conftest*
fi
-
-echo "$ac_t""$ac_cv_type_uid_t" 1>&6
+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
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define uid_t int
-EOF
+_ACEOF
+
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define gid_t int
-EOF
+_ACEOF
fi
-echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:5061: checking type of array argument to getgroups" >&5
-if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 <<EOF
-#line 5069 "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. */
/* 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()
+
+int
+main ()
{
gid_t gidset[NGID];
int i, n;
@@ -5088,381 +9104,595 @@ main()
happens when gid_t is short but getgroups modifies an array of ints. */
exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
}
-
-EOF
-if { (eval echo configure:5094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ac_cv_type_getgroups=gid_t
+_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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_type_getgroups=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_type_getgroups=int
fi
-rm -fr conftest*
+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 <<EOF
-#line 5108 "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 <unistd.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
- rm -rf conftest*
+ $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then
ac_cv_type_getgroups=gid_t
else
- rm -rf conftest*
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
-echo "$ac_t""$ac_cv_type_getgroups" 1>&6
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
#define GETGROUPS_T $ac_cv_type_getgroups
-EOF
-
-
+_ACEOF
+
+
+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
- for ac_hdr in unistd.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5136: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 5141 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ac_cv_type_ssize_t=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
- echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:5173: checking for ssize_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 5178 "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 "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_ssize_t=yes
+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
- rm -rf conftest*
- ac_cv_type_ssize_t=no
-fi
-rm -f conftest*
-fi
-echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
-if test $ac_cv_type_ssize_t = no; then
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<_ACEOF
#define ssize_t int
-EOF
+_ACEOF
fi
-
-
-cat > conftest.$ac_ext <<EOF
-#line 5208 "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 <stdio.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "int.*sprintf" >/dev/null 2>&1; then
- rm -rf conftest*
- cat >> confdefs.h <<\EOF
+ $EGREP "int.*sprintf" >/dev/null 2>&1; then
+
+cat >>confdefs.h <<\_ACEOF
#define SPRINTF_RET int
-EOF
+_ACEOF
else
- rm -rf conftest*
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define SPRINTF_RET char *
-EOF
+_ACEOF
fi
rm -f conftest*
-cat > conftest.$ac_ext <<EOF
-#line 5229 "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>
-int main() {
+int
+main ()
+{
time_t foo;
foo = 0;
-; return 0; }
-EOF
-if { (eval echo configure:5239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- cat >> confdefs.h <<\EOF
+ ;
+ 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
-EOF
+_ACEOF
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
+
-cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define REGEX_MALLOC 1
-EOF
+_ACEOF
-echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:5256: checking for vprintf" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 5261 "configure"
-#include "confdefs.h"
+
+for ac_func in vprintf
+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 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
-; return 0; }
-EOF
-if { (eval echo configure:5284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_vprintf=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_vprintf=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_VPRINTF 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-if test "$ac_cv_func_vprintf" != yes; then
-echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:5308: checking for _doprnt" >&5
-if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 5313 "configure"
-#include "confdefs.h"
+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
+
+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
+ 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 _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();
-
-int main() {
-
+ 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
-_doprnt();
+char (*f) () = _doprnt;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:5336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func__doprnt=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func__doprnt=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
+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
-EOF
+_ACEOF
-else
- echo "$ac_t""no" 1>&6
fi
fi
+done
+
+
-for ac_hdr in stdlib.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:5365: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 5370 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5375: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+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
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
+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 strtod
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5404: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 5409 "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:5432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-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 strtod with C89 semantics""... $ac_c" 1>&6
-echo "configure:5457: checking for strtod with C89 semantics" >&5
-if eval "test \"`echo '$''{'gawk_ac_cv_func_strtod_c89'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 <<EOF
-#line 5465 "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 Arnold Robbins (arnold@skeeve.com) */
#if HAVE_STDLIB_H
#include <stdlib.h>
@@ -5486,137 +9716,283 @@ main ()
exit (1);
#endif
}
-EOF
-if { (eval echo configure:5491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- gawk_ac_cv_func_strtod_c89=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 )
+gawk_ac_cv_func_strtod_c89=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
-
-echo "$ac_t""$gawk_ac_cv_func_strtod_c89" 1>&6
+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
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define STRTOD_NOT_C89 1
-EOF
+_ACEOF
fi
-for ac_hdr in sys/time.h unistd.h
+
+
+for ac_header in sys/time.h unistd.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5517: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 5522 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5527: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+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
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
+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
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5556: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 5561 "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:5584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-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 mktime""... $ac_c" 1>&6
-echo "configure:5609: checking for working mktime" >&5
-if eval "test \"`echo '$''{'ac_cv_func_working_mktime'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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_working_mktime=no
else
- cat > conftest.$ac_ext <<EOF
-#line 5617 "configure"
-#include "confdefs.h"
-/* Test program from Paul Eggert (eggert@twinsun.com)
- and Tony Leneis (tony@plaza.ds.adp.com). */
+ 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>
@@ -5653,7 +10029,7 @@ static const char *const tz_strings[] = {
static void
spring_forward_gap ()
{
- /* glibc (up to about 1998-10-07) failed this test) */
+ /* 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"
@@ -5761,316 +10137,487 @@ main ()
spring_forward_gap ();
exit (0);
}
-EOF
-if { (eval echo configure:5766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_working_mktime=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_func_working_mktime=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
-
-echo "$ac_t""$ac_cv_func_working_mktime" 1>&6
+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}"
+ LIBOBJS="$LIBOBJS mktime.$ac_objext"
fi
case "$ac_cv_func_working_mktime" in
-yes) cat >> confdefs.h <<\EOF
+yes)
+cat >>confdefs.h <<\_ACEOF
#define HAVE_MKTIME 1
-EOF
+_ACEOF
;;
esac
-echo $ac_n "checking for fmod in -lm""... $ac_c" 1>&6
-echo "configure:5794: checking for fmod in -lm" >&5
-ac_lib_var=`echo m'_'fmod | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+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_save_LIBS="$LIBS"
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-lm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5802 "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. */
+
/* 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 fmod();
-
-int main() {
-fmod()
-; return 0; }
-EOF
-if { (eval echo configure:5813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
+ 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"
-else
- echo "$ac_t""no" 1>&6
fi
-for ac_func in getgroups memset memcpy memcmp fmod setlocale strchr strerror \
- strftime strncasecmp strtod system tzset mbrlen mbrtowc
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in getgrent getgroups memset memcpy memcmp fmod setlocale strchr \
+ strerror strftime strncasecmp strtod system tzset mbrlen mbrtowc \
+ grantpt
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5844: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 5849 "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:5872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+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
-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
-ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
-echo "configure:5899: checking for dlfcn.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 5904 "configure"
-#include "confdefs.h"
+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>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5909: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:5926: checking for dlopen in -ldl" >&5
-ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+_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_save_LIBS="$LIBS"
-LIBS="-ldl $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5934 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dlopen();
-
-int main() {
-dlopen()
-; return 0; }
-EOF
-if { (eval echo configure:5945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ 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
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5
+echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
+if test $ac_cv_header_dlfcn_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
#define DYNAMIC 1
-EOF
+_ACEOF
- LIBS="$LIBS -ldl"
- if test "$GCC" = yes
+ 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
- # Add others here as appropriate,
- # one day use GNU libtool.
- if uname | egrep -i linux > /dev/null
- then
- LDFLAGS="$LDFLAGS -rdynamic"
- fi
+ 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
- echo "$ac_t""no" 1>&6
-fi
+ 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. */
+/* 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 "$ac_t""no" 1>&6
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=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_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
+
+
fi
+
case `(uname) 2> /dev/null` in
*VMS*|*BeOS*|*OS/2*|*MS-DOS*)
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define GETPGRP_VOID 1
-EOF
+_ACEOF
;;
-*) echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:5992: checking whether getpgrp takes no argument" >&5
-if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$cross_compiling" = yes; then
- { echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; }
-else
- cat > conftest.$ac_ext <<EOF
-#line 6000 "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>
-
-int pid;
-int pg1, pg2, pg3, pg4;
-int ng, np, s, child;
-
-main()
+*) 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 ()
{
- 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);
- }
+getpgrp (0);
+ ;
+ return 0;
}
-
-EOF
-if { (eval echo configure:6055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ac_cv_func_getpgrp_void=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
+_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
-fi
-rm -fr conftest*
-fi
-
+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
-echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
+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
@@ -6102,93 +10649,136 @@ else
# needs -lnsl.
# The nsl library prevents programs from opening the X display
# on Irix 5.2, according to dickey@clark.net.
- echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:6107: checking for gethostbyname" >&5
-if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 6112 "configure"
-#include "confdefs.h"
+ 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
+ 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. */
-#include <assert.h>
+ 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();
-
-int main() {
-
+ 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
-gethostbyname();
+char (*f) () = gethostbyname;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:6135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_gethostbyname=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_gethostbyname=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-fi
+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 "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_gethostbyname=no
+fi
+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 $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:6156: checking for gethostbyname in -lnsl" >&5
-ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ 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_save_LIBS="$LIBS"
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-lnsl $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6164 "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. */
+
/* 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; }
-EOF
-if { (eval echo configure:6175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+ 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"
-else
- echo "$ac_t""no" 1>&6
fi
fi
@@ -6200,94 +10790,137 @@ fi
# gethostby* variants that don't use the nameserver (or something).
# -lsocket must be given before -lnsl if both are needed.
# We assume that if connect needs -lnsl, so does gethostbyname.
- echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:6205: checking for connect" >&5
-if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 6210 "configure"
-#include "confdefs.h"
+ 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. */
-#include <assert.h>
+ 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();
-
-int main() {
-
+ 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
-connect();
+char (*f) () = connect;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:6233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_connect=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_connect=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-fi
+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 $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:6254: checking for connect in -lsocket" >&5
-ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ 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_save_LIBS="$LIBS"
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket $SOCKET_LIBS $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6262 "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. */
+
/* 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; }
-EOF
-if { (eval echo configure:6273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+ 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
-else
- echo "$ac_t""no" 1>&6
fi
else
@@ -6297,870 +10930,1901 @@ fi
if test "${gawk_have_sockets}" = "yes"
then
- echo $ac_n "checking where to find the socket library calls""... $ac_c" 1>&6
-echo "configure:6302: checking where to find the socket library calls" >&5
+ 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 "$ac_t""${gawk_lib_loc}" 1>&6
+ echo "$as_me:$LINENO: result: ${gawk_lib_loc}" >&5
+echo "${ECHO_T}${gawk_lib_loc}" >&6
+
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define HAVE_SOCKETS 1
-EOF
+_ACEOF
fi
-echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:6317: checking for st_blksize in struct stat" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+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 6322 "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:6330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_struct_st_blksize=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_struct_st_blksize=no
+ 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:6351: checking whether time.h and sys/time.h may both be included" >&5
-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+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 6356 "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:6365: \"$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:6386: checking whether struct tm is in sys/time.h or time.h" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 6391 "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:6399: \"$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:6420: checking for tm_zone in struct tm" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 6425 "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:6433: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_struct_tm_zone=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_struct_tm_zone=no
+
+
+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
+
+if test "$ac_cv_member_struct_tm_tm_zone" = yes; then
-echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
-if test "$ac_cv_struct_tm_zone" = yes; then
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define HAVE_TM_ZONE 1
-EOF
+_ACEOF
else
- echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:6453: checking for tzname" >&5
-if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ 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 6458 "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:6468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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:6491: checking whether char is unsigned" >&5
-if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$GCC" = yes; then
- # GCC predefines this symbol on systems where it applies.
-cat > conftest.$ac_ext <<EOF
-#line 6498 "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 6520 "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:6530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ac_cv_c_char_unsigned=yes
-else
- 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:6554: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 6559 "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;
-}
+_ACEOF
+
+fi
-; return 0; }
-EOF
-if { (eval echo configure:6608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+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
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
fi
-echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:6629: checking for inline" >&5
-if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+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 <<EOF
-#line 6636 "configure"
-#include "confdefs.h"
-
-int main() {
-} $ac_kw foo() {
-; return 0; }
-EOF
-if { (eval echo configure:6643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf 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. */
+#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 "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-
-echo "$ac_t""$ac_cv_c_inline" 1>&6
-case "$ac_cv_c_inline" in
+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 <<\EOF
-#define inline
-EOF
+ no)
+cat >>confdefs.h <<\_ACEOF
+#define inline
+_ACEOF
;;
- *) cat >> confdefs.h <<EOF
+ *) cat >>confdefs.h <<_ACEOF
#define inline $ac_cv_c_inline
-EOF
+_ACEOF
;;
esac
-
-
-echo $ac_n "checking for preprocessor stringizing operator""... $ac_c" 1>&6
-echo "configure:6671: checking for preprocessor stringizing operator" >&5
-if eval "test \"`echo '$''{'ac_cv_c_stringize'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 6676 "configure"
-#include "confdefs.h"
-
+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*
+ $EGREP "#teststring" >/dev/null 2>&1; then
ac_cv_c_stringize=no
else
- rm -rf conftest*
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 "${ac_cv_c_stringize}" = yes
-then
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define HAVE_STRINGIZE 1
-EOF
-
-fi
-echo "$ac_t""${ac_cv_c_stringize}" 1>&6
-
+_ACEOF
-PATH_SEPARATOR=':'
-if test `uname` = 'OS/2'; then
- PATH_SEPARATOR=';'
fi
-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 | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
+{
+ (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.
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
+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
+
+
+# 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.13"
- 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"
-
-trap 'rm -fr `echo "Makefile \
- awklib/Makefile \
- doc/Makefile \
- intl/Makefile \
- po/Makefile.in \
- test/Makefile config.h:configh.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# 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%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@PACKAGE@%$PACKAGE%g
-s%@VERSION@%$VERSION%g
-s%@EXEEXT@%$EXEEXT%g
-s%@OBJEXT@%$OBJEXT%g
-s%@ACLOCAL@%$ACLOCAL%g
-s%@AUTOCONF@%$AUTOCONF%g
-s%@AUTOMAKE@%$AUTOMAKE%g
-s%@AUTOHEADER@%$AUTOHEADER%g
-s%@MAKEINFO@%$MAKEINFO%g
-s%@AMTAR@%$AMTAR%g
-s%@install_sh@%$install_sh%g
-s%@INSTALL_STRIP_PROGRAM@%$INSTALL_STRIP_PROGRAM%g
-s%@AWK@%$AWK%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@AMDEP_TRUE@%$AMDEP_TRUE%g
-s%@AMDEP_FALSE@%$AMDEP_FALSE%g
-s%@AMDEPBACKSLASH@%$AMDEPBACKSLASH%g
-s%@DEPDIR@%$DEPDIR%g
-s%@YACC@%$YACC%g
-s%@LN_S@%$LN_S%g
-s%@CC@%$CC%g
-s%@am__include@%$am__include%g
-s%@am__quote@%$am__quote%g
-s%@CCDEPMODE@%$CCDEPMODE%g
-s%@CPP@%$CPP%g
-s%@RANLIB@%$RANLIB%g
-s%@U@%$U%g
-s%@ANSI2KNR@%$ANSI2KNR%g
-s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
-s%@MSGFMT@%$MSGFMT%g
-s%@GMSGFMT@%$GMSGFMT%g
-s%@XGETTEXT@%$XGETTEXT%g
-s%@MSGMERGE@%$MSGMERGE%g
-s%@host@%$host%g
-s%@host_alias@%$host_alias%g
-s%@host_cpu@%$host_cpu%g
-s%@host_vendor@%$host_vendor%g
-s%@host_os@%$host_os%g
-s%@ALLOCA@%$ALLOCA%g
-s%@GLIBC21@%$GLIBC21%g
-s%@LIBICONV@%$LIBICONV%g
-s%@LTLIBICONV@%$LTLIBICONV%g
-s%@INTLBISON@%$INTLBISON%g
-s%@USE_NLS@%$USE_NLS%g
-s%@BUILD_INCLUDED_LIBINTL@%$BUILD_INCLUDED_LIBINTL%g
-s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
-s%@CATOBJEXT@%$CATOBJEXT%g
-s%@INTLOBJS@%$INTLOBJS%g
-s%@DATADIRNAME@%$DATADIRNAME%g
-s%@INSTOBJEXT@%$INSTOBJEXT%g
-s%@GENCAT@%$GENCAT%g
-s%@INTL_LIBTOOL_SUFFIX_PREFIX@%$INTL_LIBTOOL_SUFFIX_PREFIX%g
-s%@INTLLIBS@%$INTLLIBS%g
-s%@LIBINTL@%$LIBINTL%g
-s%@LTLIBINTL@%$LTLIBINTL%g
-s%@POSUB@%$POSUB%g
-s%@SOCKET_LIBS@%$SOCKET_LIBS%g
-s%@PATH_SEPARATOR@%$PATH_SEPARATOR%g
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
-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
+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
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ PATH_SEPARATOR=:
fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
- else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ 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:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $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
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
-fi
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile \
- awklib/Makefile \
- doc/Makefile \
- intl/Makefile \
- po/Makefile.in \
- test/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" ;;
+;;
esac
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+ # 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
+}
+
- # 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'`
+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
- ac_dir_suffix= ac_dots=
+ 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
- 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" ;;
+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.2, 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.2
+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_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ 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
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_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
+
+_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 '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
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+ 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,@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,@USE_NLS@,$USE_NLS,;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,@INTLOBJS@,$INTLOBJS,;t t
+s,@DATADIRNAME@,$DATADIRNAME,;t t
+s,@INSTOBJEXT@,$INSTOBJEXT,;t t
+s,@GENCAT@,$GENCAT,;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"
+
+_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
- 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= ;;
+ # 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
+
+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
+ 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.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
+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
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- fi
- rm -f $ac_file
- mv conftest.h $ac_file
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
fi
-fi; done
-
-EOF
-cat >> $CONFIG_STATUS <<EOF
-am_indx=1
-for am_file in config.h:configh.in; do
- case " \$CONFIG_HEADERS " in
- *" \$am_file "*)
- am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
- if test -n "\$am_dir"; then
- am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
- for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
- am_tmpdir=\$am_tmpdir\$am_subdir/
- if test ! -d \$am_tmpdir; then
- mkdir \$am_tmpdir
- fi
- done
+ 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
+ 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
- echo timestamp > "\$am_dir"stamp-h\$am_indx
- ;;
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
+ fi
+# 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
- am_indx=\`expr \$am_indx + 1\`
done
-AMDEP_TRUE="$AMDEP_TRUE"
-ac_aux_dir="$ac_aux_dir"
-# Capture the value of obsolete $ALL_LINGUAS because we need it to compute
- # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
- # from automake.
- eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
- # Capture the value of LINGUAS because we need it to compute CATALOGS.
- LINGUAS="${LINGUAS-%UNSET%}"
-
-
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
-
-test x"$AMDEP_TRUE" != x"" ||
-for mf in $CONFIG_FILES; do
- case "$mf" in
- Makefile) dirpart=.;;
- */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
- *) continue;;
+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
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ 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'.
@@ -7185,14 +12849,49 @@ for mf in $CONFIG_FILES; do
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
- fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
- $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
+ 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
@@ -7287,11 +12986,37 @@ done
fi
;;
esac
- done
+ done ;;
+ esac
+done
+_ACEOF
-exit 0
-EOF
+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/configure.in b/configure.in
index 3f9ffb2a..3a020bcc 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,7 @@
dnl
dnl configure.in --- autoconf input file for gawk
dnl
-dnl Copyright (C) 1995-2002 the Free Software Foundation, Inc.
+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.
@@ -23,36 +23,53 @@ dnl
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(awk.h)
-AC_PREREQ(2.13)
-AM_INIT_AUTOMAKE(gawk, 3.1.1)
-AM_CONFIG_HEADER(config.h:configh.in)
+dnl *** IMPORTANT ***: Fix version in both AC_INIT and AM_INIT_AUTOMAKE
+AC_INIT([GNU Awk], 3.1.2, 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.2)
dnl Additional argument stuff
-AC_ARG_ENABLE(portals, [ --enable-portals Enable /p as path prefix for portals], AC_DEFINE(HAVE_PORTALS))
+AC_ARG_ENABLE(portals, [ --enable-portals Enable /p as path prefix for portals], AC_DEFINE(HAVE_PORTALS, 1, [we have portals on /p on this system]))
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)
+ 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
)
dnl checks for programs
+AC_PROG_EGREP
AC_PROG_YACC
AC_PROG_LN_S
AC_PROG_CC
AC_PROG_CPP
AC_PROG_RANLIB
-# This is a hack. Different versions of install on different systems
-# are just too different. Chuck it and use install-sh.
-#
-# If the user supplies $INSTALL, figure they know what they're doing.
-if test "x$INSTALL" = "x"
-then
- INSTALL="$srcdir/install-sh -c"
- export INSTALL
-fi
+AC_OBJEXT
+AC_EXEEXT
AC_PROG_INSTALL
@@ -95,8 +112,21 @@ 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
+ LIBS="$LIBS /usr/lib/automode.o"
+ ;;
+*)
+ ;;
+esac
+
dnl initialize GNU gettext
AM_GNU_GETTEXT([no-libtool], [need-ngettext])
+AM_GNU_GETTEXT_VERSION(0.11.5)
dnl checks for header files
AC_HEADER_STDC
@@ -105,7 +135,7 @@ AC_HEADER_TIME
AC_CHECK_HEADERS(fcntl.h limits.h locale.h libintl.h mcheck.h \
netdb.h netinet/in.h signum.h stdarg.h string.h \
sys/param.h sys/socket.h sys/time.h unistd.h \
- wchar.h wctype.h)
+ termios.h stropts.h wchar.h wctype.h)
if test "$ac_cv_header_string_h" = yes
then
@@ -119,55 +149,59 @@ AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_SIZE_T
AC_TYPE_GETGROUPS
-GAWK_AC_TYPE_SSIZE_T
+AC_CHECK_TYPE(ssize_t, int)
AC_EGREP_HEADER([int.*sprintf], stdio.h,
- AC_DEFINE(SPRINTF_RET, int),
+ 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))
+ AC_DEFINE(TIME_T_IN_SYS_TYPES_H, 1,
+ [some systems define this type here]))
dnl checks for functions
-AC_DEFINE(REGEX_MALLOC)
+AC_DEFINE(REGEX_MALLOC, 1, [use malloc instead of alloca in regex.c])
AC_FUNC_VPRINTF
-dnl one day use [ AC_CHECK_TYPE(ssize_t, int) ]
GAWK_AC_FUNC_STRTOD_C89
AC_FUNC_MKTIME
case "$ac_cv_func_working_mktime" in
-yes) AC_DEFINE(HAVE_MKTIME)
+yes) AC_DEFINE(HAVE_MKTIME, 1, [we have the mktime function])
;;
esac
AC_CHECK_LIB(m, fmod)
-AC_CHECK_FUNCS(getgroups memset memcpy memcmp fmod setlocale strchr strerror \
- strftime strncasecmp strtod system tzset mbrlen mbrtowc)
+AC_CHECK_FUNCS(getgrent getgroups memset memcpy memcmp fmod setlocale strchr \
+ strerror strftime strncasecmp strtod system tzset mbrlen mbrtowc \
+ grantpt)
dnl check for dynamic linking
dnl This is known to be very primitive
AC_CHECK_HEADER(dlfcn.h,
- AC_CHECK_LIB(dl, dlopen,
- AC_DEFINE(DYNAMIC)
- LIBS="$LIBS -ldl"
- if test "$GCC" = yes
+ [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
- # Add others here as appropriate,
- # one day use GNU libtool.
- if uname | egrep -i linux > /dev/null
- then
- LDFLAGS="$LDFLAGS -rdynamic"
- fi
+ 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)
+ AC_DEFINE(GETPGRP_VOID, 1,
+ [Define to 1 if the getpgrp function requires zero arguments.])
;;
*) AC_FUNC_GETPGRP
;;
@@ -188,14 +222,6 @@ AC_C_CONST
AC_C_INLINE
AC_C_STRINGIZE
-dnl the following code is for OS/2 only and can be removed if autoconf 2.5x is used
-dnl instead of autoconf 2.13
-PATH_SEPARATOR=':'
-if test `uname` = 'OS/2'; then
- PATH_SEPARATOR=';'
-fi
-AC_SUBST(PATH_SEPARATOR)
-
AC_OUTPUT(Makefile \
awklib/Makefile \
doc/Makefile \
diff --git a/custom.h b/custom.h
index 5df5cfe1..ee3f9f07 100644
--- a/custom.h
+++ b/custom.h
@@ -2,12 +2,12 @@
* 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.org.
+ * the information, to arnold@skeeve.com.
*/
/*
@@ -37,7 +37,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"
@@ -80,9 +80,15 @@
#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 */
diff --git a/depcomp b/depcomp
index 0a92302e..51606f8c 100755
--- a/depcomp
+++ b/depcomp
@@ -18,6 +18,11 @@
# 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
@@ -26,7 +31,16 @@ if test -z "$depmode" || test -z "$source" || test -z "$object"; then
fi
# `libtool' can also be set to `yes' or `no'.
-depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
+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"
@@ -48,6 +62,20 @@ if test "$depmode" = dashXmstdout; then
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:
@@ -61,9 +89,10 @@ gcc)
if test -z "$gccflag"; then
gccflag=-MD,
fi
- if "$@" -Wp,"$gccflag$tmpdepfile"; then :
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
else
- stat=$?
rm -f "$tmpdepfile"
exit $stat
fi
@@ -97,20 +126,6 @@ hp)
exit 1
;;
-dashmd)
- # The Java front end to gcc doesn't run cpp, so we can't use the -Wp
- # trick. Instead we must use -M and then rename the resulting .d
- # file. This is also the case for older versions of gcc, which
- # don't implement -Wp.
- if "$@" -MD; then :
- else
- stat=$?
- rm -f FIXME
- exit $stat
- fi
- FIXME: rewrite the file
- ;;
-
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
@@ -120,7 +135,6 @@ sgi)
stat=$?
if test $stat -eq 0; then :
else
- stat=$?
rm -f "$tmpdepfile"
exit $stat
fi
@@ -129,19 +143,24 @@ sgi)
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
+ # 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).
+ # 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 's/^[^\.]*\.o://' | 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" | \
-## 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"
+' < "$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
@@ -151,40 +170,156 @@ sgi)
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,
- # because we must use -o when running libtool.
- test -z "$dashmflag" && dashmflag=-M
- ( IFS=" "
- case " $* " in
- *" --mode=compile "*) # this is libtool, let us make it quiet
- for arg
- do # cycle over the arguments
- case "$arg" in
- "--mode=compile")
- # insert --quiet before "--mode=compile"
- set fnord "$@" --quiet
- shift # fnord
- ;;
- esac
- set fnord "$@" "$arg"
- shift # fnord
- shift # "$arg"
- done
+ # 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
- "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
- ) &
- proc=$!
- "$@"
- stat=$?
- wait "$proc"
- if test "$stat" != 0; then exit $stat; fi
+ 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 ' ' '
@@ -202,36 +337,40 @@ dashXmstdout)
;;
makedepend)
- # X makedepend
- (
- shift
- cleared=no
- for arg in "$@"; do
- case $cleared in no)
- set ""; shift
- cleared=yes
- esac
- case "$arg" in
- -D*|-I*)
- set fnord "$@" "$arg"; shift;;
- -*)
- ;;
- *)
- set fnord "$@" "$arg"; shift;;
- esac
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
done
- obj_suffix="`echo $object | sed 's/^.*\././'`"
- touch "$tmpdepfile"
- ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
- ) &
- proc=$!
- "$@"
- stat=$?
- wait "$proc"
- if test "$stat" != 0; then exit $stat; fi
+ 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"
- tail +3 "$tmpdepfile" | tr ' ' '
+ 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.
@@ -241,35 +380,39 @@ makedepend)
cpp)
# Important note: in order to support this mode, a compiler *must*
- # always write the proprocessed file to stdout, regardless of -o,
- # because we must use -o when running libtool.
- ( IFS=" "
- case " $* " in
- *" --mode=compile "*)
- for arg
- do # cycle over the arguments
- case $arg in
- "--mode=compile")
- # insert --quiet before "--mode=compile"
- set fnord "$@" --quiet
- shift # fnord
- ;;
- esac
- set fnord "$@" "$arg"
- shift # fnord
- shift # "$arg"
- done
+ # 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
- "$@" -E |
+ done
+
+ "$@" -E |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
- ) &
- proc=$!
- "$@"
- stat=$?
- wait "$proc"
- if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
@@ -281,32 +424,25 @@ msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
- ( IFS=" "
- case " $* " in
- *" --mode=compile "*)
- for arg
- do # cycle over the arguments
- case $arg in
- "--mode=compile")
- # insert --quiet before "--mode=compile"
- set fnord "$@" --quiet
- shift # fnord
- ;;
- esac
+ "$@" || exit $?
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
set fnord "$@" "$arg"
- shift # fnord
- shift # "$arg"
- done
- ;;
+ shift
+ shift
+ ;;
esac
- "$@" -E |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
- ) &
- proc=$!
- "$@"
- stat=$?
- wait "$proc"
- if test "$stat" != 0; then exit $stat; fi
+ 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"
diff --git a/dfa.c b/dfa.c
deleted file mode 100644
index 77a6fb83..00000000
--- a/dfa.c
+++ /dev/null
@@ -1,3640 +0,0 @@
-/* dfa.c - deterministic extended regexp routines for GNU
- Copyright 1988, 1998, 2000, 2002 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */
-
-/* Written June, 1988 by Mike Haertel
- Modified July, 1988 by Arthur David Olson to assist BMG speedups */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <assert.h>
-#include <ctype.h>
-#include <stdio.h>
-
-#ifndef VMS
-#include <sys/types.h>
-#else
-#include <stddef.h>
-#endif
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#else
-extern char *calloc(), *malloc(), *realloc();
-extern void free();
-#endif
-
-#if defined(HAVE_STRING_H) || defined(STDC_HEADERS)
-#include <string.h>
-#undef index
-#define index strchr
-#else
-#include <strings.h>
-#endif
-
-#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC
-/* We can handle multibyte string. */
-# define MBS_SUPPORT
-#endif
-
-#ifdef MBS_SUPPORT
-# include <wchar.h>
-# include <wctype.h>
-#endif
-
-#ifndef DEBUG /* use the same approach as regex.c */
-#undef assert
-#define assert(e)
-#endif /* DEBUG */
-
-#ifndef isgraph
-#define isgraph(C) (isprint(C) && !isspace(C))
-#endif
-
-#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
-#define ISALPHA(C) isalpha(C)
-#define ISUPPER(C) isupper(C)
-#define ISLOWER(C) islower(C)
-#define ISDIGIT(C) isdigit(C)
-#define ISXDIGIT(C) isxdigit(C)
-#define ISSPACE(C) isspace(C)
-#define ISPUNCT(C) ispunct(C)
-#define ISALNUM(C) isalnum(C)
-#define ISPRINT(C) isprint(C)
-#define ISGRAPH(C) isgraph(C)
-#define ISCNTRL(C) iscntrl(C)
-#else
-#define ISALPHA(C) (isascii(C) && isalpha(C))
-#define ISUPPER(C) (isascii(C) && isupper(C))
-#define ISLOWER(C) (isascii(C) && islower(C))
-#define ISDIGIT(C) (isascii(C) && isdigit(C))
-#define ISXDIGIT(C) (isascii(C) && isxdigit(C))
-#define ISSPACE(C) (isascii(C) && isspace(C))
-#define ISPUNCT(C) (isascii(C) && ispunct(C))
-#define ISALNUM(C) (isascii(C) && isalnum(C))
-#define ISPRINT(C) (isascii(C) && isprint(C))
-#define ISGRAPH(C) (isascii(C) && isgraph(C))
-#define ISCNTRL(C) (isascii(C) && iscntrl(C))
-#endif
-
-/* ISASCIIDIGIT differs from ISDIGIT, as follows:
- - Its arg may be any int or unsigned int; it need not be an unsigned char.
- - It's guaranteed to evaluate its argument exactly once.
- - It's typically faster.
- Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
- only '0' through '9' are digits. Prefer ISASCIIDIGIT to ISDIGIT unless
- it's important to use the locale's definition of `digit' even when the
- host does not conform to Posix. */
-#define ISASCIIDIGIT(c) ((unsigned) (c) - '0' <= 9)
-
-/* Don't use gettext if ENABLE_NLS is not defined */
-/* If we (don't) have I18N. */
-/* glibc defines _ */
-#ifdef ENABLE_NLS
-# ifndef _
-# ifdef HAVE_LIBINTL_H
-# include <libintl.h>
-# ifndef _
-# define _(Str) gettext (Str)
-# endif
-# else
-# define _(Str) (Str)
-# endif
-# endif
-#else
-# define _(Str) (Str)
-#endif
-
-#include "regex.h"
-#include "dfa.h"
-
-/* HPUX, define those as macros in sys/param.h */
-#ifdef setbit
-# undef setbit
-#endif
-#ifdef clrbit
-# undef clrbit
-#endif
-
-static void dfamust PARAMS ((struct dfa *dfa));
-
-static ptr_t xcalloc PARAMS ((size_t n, size_t s));
-static ptr_t xmalloc PARAMS ((size_t n));
-static ptr_t xrealloc PARAMS ((ptr_t p, size_t n));
-#ifdef DEBUG
-static void prtok PARAMS ((token t));
-#endif
-static int tstbit PARAMS ((int b, charclass c));
-static void setbit PARAMS ((int b, charclass c));
-static void clrbit PARAMS ((int b, charclass c));
-static void copyset PARAMS ((charclass src, charclass dst));
-static void zeroset PARAMS ((charclass s));
-static void notset PARAMS ((charclass s));
-static int equal PARAMS ((charclass s1, charclass s2));
-static int charclass_index PARAMS ((charclass s));
-static int looking_at PARAMS ((const char *s));
-static token lex PARAMS ((void));
-static void addtok PARAMS ((token t));
-static void atom PARAMS ((void));
-static int nsubtoks PARAMS ((int tindex));
-static void copytoks PARAMS ((int tindex, int ntokens));
-static void closure PARAMS ((void));
-static void branch PARAMS ((void));
-static void regexp PARAMS ((int toplevel));
-static void copy PARAMS ((position_set *src, position_set *dst));
-static void insert PARAMS ((position p, position_set *s));
-static void merge PARAMS ((position_set *s1, position_set *s2, position_set *m));
-static void delete PARAMS ((position p, position_set *s));
-static int state_index PARAMS ((struct dfa *d, position_set *s,
- int newline, int letter));
-static void build_state PARAMS ((int s, struct dfa *d));
-static void build_state_zero PARAMS ((struct dfa *d));
-static char *icatalloc PARAMS ((char *old, char *new));
-static char *icpyalloc PARAMS ((char *string));
-static char *istrstr PARAMS ((char *lookin, char *lookfor));
-static void ifree PARAMS ((char *cp));
-static void freelist PARAMS ((char **cpp));
-static char **enlist PARAMS ((char **cpp, char *new, size_t len));
-static char **comsubs PARAMS ((char *left, char *right));
-static char **addlists PARAMS ((char **old, char **new));
-static char **inboth PARAMS ((char **left, char **right));
-
-static ptr_t
-xcalloc (size_t n, size_t s)
-{
- ptr_t r = calloc(n, s);
-
- if (!r)
- dfaerror(_("Memory exhausted"));
- return r;
-}
-
-static ptr_t
-xmalloc (size_t n)
-{
- ptr_t r = malloc(n);
-
- assert(n != 0);
- if (!r)
- dfaerror(_("Memory exhausted"));
- return r;
-}
-
-static ptr_t
-xrealloc (ptr_t p, size_t n)
-{
- ptr_t r = realloc(p, n);
-
- assert(n != 0);
- if (!r)
- dfaerror(_("Memory exhausted"));
- return r;
-}
-
-#define CALLOC(p, t, n) ((p) = (t *) xcalloc((size_t)(n), sizeof (t)))
-#define MALLOC(p, t, n) ((p) = (t *) xmalloc((n) * sizeof (t)))
-#define REALLOC(p, t, n) ((p) = (t *) xrealloc((ptr_t) (p), (n) * sizeof (t)))
-
-/* Reallocate an array of type t if nalloc is too small for index. */
-#define REALLOC_IF_NECESSARY(p, t, nalloc, index) \
- if ((index) >= (nalloc)) \
- { \
- while ((index) >= (nalloc)) \
- (nalloc) *= 2; \
- REALLOC(p, t, nalloc); \
- }
-
-#ifdef DEBUG
-
-static void
-prtok (token t)
-{
- char *s;
-
- if (t < 0)
- fprintf(stderr, "END");
- else if (t < NOTCHAR)
- fprintf(stderr, "%c", t);
- else
- {
- switch (t)
- {
- case EMPTY: s = "EMPTY"; break;
- case BACKREF: s = "BACKREF"; break;
- case BEGLINE: s = "BEGLINE"; break;
- case ENDLINE: s = "ENDLINE"; break;
- case BEGWORD: s = "BEGWORD"; break;
- case ENDWORD: s = "ENDWORD"; break;
- case LIMWORD: s = "LIMWORD"; break;
- case NOTLIMWORD: s = "NOTLIMWORD"; break;
- case QMARK: s = "QMARK"; break;
- case STAR: s = "STAR"; break;
- case PLUS: s = "PLUS"; break;
- case CAT: s = "CAT"; break;
- case OR: s = "OR"; break;
- case ORTOP: s = "ORTOP"; break;
- case LPAREN: s = "LPAREN"; break;
- case RPAREN: s = "RPAREN"; break;
-#ifdef MBS_SUPPORT
- case ANYCHAR: s = "ANYCHAR"; break;
- case MBCSET: s = "MBCSET"; break;
-#endif /* MBS_SUPPORT */
- default: s = "CSET"; break;
- }
- fprintf(stderr, "%s", s);
- }
-}
-#endif /* DEBUG */
-
-/* Stuff pertaining to charclasses. */
-
-static int
-tstbit (int b, charclass c)
-{
- return c[b / INTBITS] & 1 << b % INTBITS;
-}
-
-static void
-setbit (int b, charclass c)
-{
- c[b / INTBITS] |= 1 << b % INTBITS;
-}
-
-static void
-clrbit (int b, charclass c)
-{
- c[b / INTBITS] &= ~(1 << b % INTBITS);
-}
-
-static void
-copyset (charclass src, charclass dst)
-{
- int i;
-
- for (i = 0; i < CHARCLASS_INTS; ++i)
- dst[i] = src[i];
-}
-
-static void
-zeroset (charclass s)
-{
- int i;
-
- for (i = 0; i < CHARCLASS_INTS; ++i)
- s[i] = 0;
-}
-
-static void
-notset (charclass s)
-{
- int i;
-
- for (i = 0; i < CHARCLASS_INTS; ++i)
- s[i] = ~s[i];
-}
-
-static int
-equal (charclass s1, charclass s2)
-{
- int i;
-
- for (i = 0; i < CHARCLASS_INTS; ++i)
- if (s1[i] != s2[i])
- return 0;
- return 1;
-}
-
-/* A pointer to the current dfa is kept here during parsing. */
-static struct dfa *dfa;
-
-/* Find the index of charclass s in dfa->charclasses, or allocate a new charclass. */
-static int
-charclass_index (charclass s)
-{
- int i;
-
- for (i = 0; i < dfa->cindex; ++i)
- if (equal(s, dfa->charclasses[i]))
- return i;
- REALLOC_IF_NECESSARY(dfa->charclasses, charclass, dfa->calloc, dfa->cindex);
- ++dfa->cindex;
- copyset(s, dfa->charclasses[i]);
- return i;
-}
-
-/* Syntax bits controlling the behavior of the lexical analyzer. */
-static reg_syntax_t syntax_bits, syntax_bits_set;
-
-/* Flag for case-folding letters into sets. */
-static int case_fold;
-
-/* End-of-line byte in data. */
-static unsigned char eolbyte;
-
-/* Entry point to set syntax options. */
-void
-dfasyntax (reg_syntax_t bits, int fold, int eol)
-{
- syntax_bits_set = 1;
- syntax_bits = bits;
- case_fold = fold;
- eolbyte = eol;
-}
-
-/* Lexical analyzer. All the dross that deals with the obnoxious
- GNU Regex syntax bits is located here. The poor, suffering
- reader is referred to the GNU Regex documentation for the
- meaning of the @#%!@#%^!@ syntax bits. */
-
-static char *lexptr; /* Pointer to next input character. */
-static int lexleft; /* Number of characters remaining. */
-static token lasttok; /* Previous token returned; initially END. */
-static int laststart; /* True if we're separated from beginning or (, |
- only by zero-width characters. */
-static int parens; /* Count of outstanding left parens. */
-static int minrep, maxrep; /* Repeat counts for {m,n}. */
-
-#ifdef MBS_SUPPORT
-/* These variables are used only if (MB_CUR_MAX > 1). */
-static mbstate_t mbs; /* Mbstate for mbrlen(). */
-static int cur_mb_len; /* Byte length of the current scanning
- multibyte character. */
-static int cur_mb_index; /* Byte index of the current scanning multibyte
- character.
-
- singlebyte character : cur_mb_index = 0
- multibyte character
- 1st byte : cur_mb_index = 1
- 2nd byte : cur_mb_index = 2
- ...
- nth byte : cur_mb_index = n */
-static unsigned char *mblen_buf;/* Correspond to the input buffer in dfaexec().
- Each element store the amount of remain
- byte of corresponding multibyte character
- in the input string. A element's value
- is 0 if corresponding character is a
- singlebyte chracter.
- e.g. input : 'a', <mb(0)>, <mb(1)>, <mb(2)>
- mblen_buf : 0, 3, 2, 1
- */
-
-static wchar_t *inputwcs; /* Wide character representation of input
- string in dfaexec().
- The length of this array is same as
- the length of input string(char array).
- inputstring[i] is a single-byte char,
- or 1st byte of a multibyte char.
- And inputwcs[i] is the codepoint. */
-static unsigned char const *buf_begin;/* refference to begin in dfaexec(). */
-static unsigned char const *buf_end; /* refference to end in dfaexec(). */
-#endif /* MBS_SUPPORT */
-
-#ifdef MBS_SUPPORT
-/* This function update cur_mb_len, and cur_mb_index.
- p points current lexptr, len is the remaining buffer length. */
-static void
-update_mb_len_index (unsigned char const *p, int len)
-{
- /* If last character is a part of a multibyte character,
- we update cur_mb_index. */
- if (cur_mb_index)
- cur_mb_index = (cur_mb_index >= cur_mb_len)? 0
- : cur_mb_index + 1;
-
- /* If last character is a single byte character, or the
- last portion of a multibyte character, we check whether
- next character is a multibyte character or not. */
- if (! cur_mb_index)
- {
- cur_mb_len = mbrlen(p, len, &mbs);
- if (cur_mb_len > 1)
- /* It is a multibyte character.
- cur_mb_len was already set by mbrlen(). */
- cur_mb_index = 1;
- else if (cur_mb_len < 1)
- /* Invalid sequence. We treat it as a singlebyte character.
- cur_mb_index is aleady 0. */
- cur_mb_len = 1;
- /* Otherwise, cur_mb_len == 1, it is a singlebyte character.
- cur_mb_index is aleady 0. */
- }
-}
-#endif /* MBS_SUPPORT */
-
-#ifdef MBS_SUPPORT
-/* Note that characters become unsigned here. */
-# define FETCH(c, eoferr) \
- { \
- if (! lexleft) \
- { \
- if (eoferr != 0) \
- dfaerror (eoferr); \
- else \
- return lasttok = END; \
- } \
- if (MB_CUR_MAX > 1) \
- update_mb_len_index(lexptr, lexleft); \
- (c) = (unsigned char) *lexptr++; \
- --lexleft; \
- }
-
-/* This function fetch a wide character, and update cur_mb_len,
- used only if the current locale is a multibyte environment. */
-static wint_t
-fetch_wc (char const *eoferr)
-{
- wchar_t wc;
- if (! lexleft)
- {
- if (eoferr != 0)
- dfaerror (eoferr);
- else
- return WEOF;
- }
-
- cur_mb_len = mbrtowc(&wc, lexptr, lexleft, &mbs);
- if (cur_mb_len <= 0)
- {
- cur_mb_len = 1;
- wc = *lexptr;
- }
- lexptr += cur_mb_len;
- lexleft -= cur_mb_len;
- return wc;
-}
-#else
-/* Note that characters become unsigned here. */
-# define FETCH(c, eoferr) \
- { \
- if (! lexleft) \
- { \
- if (eoferr != 0) \
- dfaerror (eoferr); \
- else \
- return lasttok = END; \
- } \
- (c) = (unsigned char) *lexptr++; \
- --lexleft; \
- }
-#endif /* MBS_SUPPORT */
-
-#ifdef MBS_SUPPORT
-/* Multibyte character handling sub-routin for lex.
- This function parse a bracket expression and build a struct
- mb_char_classes. */
-static void
-parse_bracket_exp_mb ()
-{
- wint_t wc, wc1, wc2;
-
- /* Work area to build a mb_char_classes. */
- struct mb_char_classes *work_mbc;
- int chars_al, range_sts_al, range_ends_al, ch_classes_al,
- equivs_al, coll_elems_al;
-
- REALLOC_IF_NECESSARY(dfa->mbcsets, struct mb_char_classes,
- dfa->mbcsets_alloc, dfa->nmbcsets + 1);
- /* dfa->multibyteb_prop[] hold the index of dfa->mbcsets.
- We will update dfa->multibyte_prop[] in addtok(), because we can't
- decide the index in dfa->tokens[]. */
-
- /* Initialize work are */
- work_mbc = &(dfa->mbcsets[dfa->nmbcsets++]);
-
- chars_al = 1;
- range_sts_al = range_ends_al = 0;
- ch_classes_al = equivs_al = coll_elems_al = 0;
- MALLOC(work_mbc->chars, wchar_t, chars_al);
-
- work_mbc->nchars = work_mbc->nranges = work_mbc->nch_classes = 0;
- work_mbc->nequivs = work_mbc->ncoll_elems = 0;
- work_mbc->chars = work_mbc->ch_classes = NULL;
- work_mbc->range_sts = work_mbc->range_ends = NULL;
- work_mbc->equivs = work_mbc->coll_elems = NULL;
-
- wc = fetch_wc(_("Unbalanced ["));
- if (wc == L'^')
- {
- wc = fetch_wc(_("Unbalanced ["));
- work_mbc->invert = 1;
- }
- else
- work_mbc->invert = 0;
- do
- {
- wc1 = WEOF; /* mark wc1 is not initialized". */
-
- /* Note that if we're looking at some other [:...:] construct,
- we just treat it as a bunch of ordinary characters. We can do
- this because we assume regex has checked for syntax errors before
- dfa is ever called. */
- if (wc == L'[' && (syntax_bits & RE_CHAR_CLASSES))
- {
-#define BRACKET_BUFFER_SIZE 128
- char str[BRACKET_BUFFER_SIZE];
- wc1 = wc;
- wc = fetch_wc(_("Unbalanced ["));
-
- /* If pattern contains `[[:', `[[.', or `[[='. */
- if (cur_mb_len == 1 && (wc == L':' || wc == L'.' || wc == L'='))
- {
- unsigned char c;
- unsigned char delim = (unsigned char)wc;
- int len = 0;
- for (;;)
- {
- if (! lexleft)
- dfaerror (_("Unbalanced ["));
- c = (unsigned char) *lexptr++;
- --lexleft;
-
- if ((c == delim && *lexptr == ']') || lexleft == 0)
- break;
- if (len < BRACKET_BUFFER_SIZE)
- str[len++] = c;
- else
- /* This is in any case an invalid class name. */
- str[0] = '\0';
- }
- str[len] = '\0';
-
- if (lexleft == 0)
- {
- REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al,
- work_mbc->nchars + 2);
- work_mbc->chars[work_mbc->nchars++] = L'[';
- work_mbc->chars[work_mbc->nchars++] = delim;
- break;
- }
-
- if (--lexleft, *lexptr++ != ']')
- dfaerror (_("Unbalanced ["));
- if (delim == ':')
- /* build character class. */
- {
- wctype_t wt;
- /* Query the character class as wctype_t. */
- wt = wctype (str);
-
- if (ch_classes_al == 0)
- MALLOC(work_mbc->ch_classes, wctype_t, ++ch_classes_al);
- REALLOC_IF_NECESSARY(work_mbc->ch_classes, wctype_t,
- ch_classes_al,
- work_mbc->nch_classes + 1);
- work_mbc->ch_classes[work_mbc->nch_classes++] = wt;
-
- }
- else if (delim == '=' || delim == '.')
- {
- char *elem;
- MALLOC(elem, char, len + 1);
- strncpy(elem, str, len + 1);
-
- if (delim == '=')
- /* build equivalent class. */
- {
- if (equivs_al == 0)
- MALLOC(work_mbc->equivs, char*, ++equivs_al);
- REALLOC_IF_NECESSARY(work_mbc->equivs, char*,
- equivs_al,
- work_mbc->nequivs + 1);
- work_mbc->equivs[work_mbc->nequivs++] = elem;
- }
-
- if (delim == '.')
- /* build collating element. */
- {
- if (coll_elems_al == 0)
- MALLOC(work_mbc->coll_elems, char*, ++coll_elems_al);
- REALLOC_IF_NECESSARY(work_mbc->coll_elems, char*,
- coll_elems_al,
- work_mbc->ncoll_elems + 1);
- work_mbc->coll_elems[work_mbc->ncoll_elems++] = elem;
- }
- }
- wc = WEOF;
- }
- else
- /* We treat '[' as a normal character here. */
- {
- wc2 = wc1; wc1 = wc; wc = wc2; /* swap */
- }
- }
- else
- {
- if (wc == L'\\' && (syntax_bits & RE_BACKSLASH_ESCAPE_IN_LISTS))
- wc = fetch_wc(("Unbalanced ["));
- }
-
- if (wc1 == WEOF)
- wc1 = fetch_wc(_("Unbalanced ["));
-
- if (wc1 == L'-')
- /* build range characters. */
- {
- wc2 = fetch_wc(_("Unbalanced ["));
- if (wc2 == L']')
- {
- /* In the case [x-], the - is an ordinary hyphen,
- which is left in c1, the lookahead character. */
- lexptr -= cur_mb_len;
- lexleft += cur_mb_len;
- wc2 = wc;
- }
- else
- {
- if (wc2 == L'\\'
- && (syntax_bits & RE_BACKSLASH_ESCAPE_IN_LISTS))
- wc2 = fetch_wc(_("Unbalanced ["));
- wc1 = fetch_wc(_("Unbalanced ["));
- }
-
- if (range_sts_al == 0)
- {
- MALLOC(work_mbc->range_sts, wchar_t, ++range_sts_al);
- MALLOC(work_mbc->range_ends, wchar_t, ++range_ends_al);
- }
- REALLOC_IF_NECESSARY(work_mbc->range_sts, wchar_t,
- range_sts_al, work_mbc->nranges + 1);
- work_mbc->range_sts[work_mbc->nranges] = (wchar_t)wc;
- REALLOC_IF_NECESSARY(work_mbc->range_ends, wchar_t,
- range_ends_al, work_mbc->nranges + 1);
- work_mbc->range_ends[work_mbc->nranges++] = (wchar_t)wc2;
- }
- else if (wc != WEOF)
- /* build normal characters. */
- {
- REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al,
- work_mbc->nchars + 1);
- work_mbc->chars[work_mbc->nchars++] = (wchar_t)wc;
- }
- }
- while ((wc = wc1) != L']');
-}
-#endif /* MBS_SUPPORT */
-
-#ifdef __STDC__
-#define FUNC(F, P) static int F(int c) { return P(c); }
-#else
-#define FUNC(F, P) static int F(c) int c; { return P(c); }
-#endif
-
-FUNC(is_alpha, ISALPHA)
-FUNC(is_upper, ISUPPER)
-FUNC(is_lower, ISLOWER)
-FUNC(is_digit, ISDIGIT)
-FUNC(is_xdigit, ISXDIGIT)
-FUNC(is_space, ISSPACE)
-FUNC(is_punct, ISPUNCT)
-FUNC(is_alnum, ISALNUM)
-FUNC(is_print, ISPRINT)
-FUNC(is_graph, ISGRAPH)
-FUNC(is_cntrl, ISCNTRL)
-
-static int
-is_blank (int c)
-{
- return (c == ' ' || c == '\t');
-}
-
-/* The following list maps the names of the Posix named character classes
- to predicate functions that determine whether a given character is in
- the class. The leading [ has already been eaten by the lexical analyzer. */
-static struct {
- const char *name;
- int (*pred) PARAMS ((int));
-} prednames[] = {
- { ":alpha:]", is_alpha },
- { ":upper:]", is_upper },
- { ":lower:]", is_lower },
- { ":digit:]", is_digit },
- { ":xdigit:]", is_xdigit },
- { ":space:]", is_space },
- { ":punct:]", is_punct },
- { ":alnum:]", is_alnum },
- { ":print:]", is_print },
- { ":graph:]", is_graph },
- { ":cntrl:]", is_cntrl },
- { ":blank:]", is_blank },
- { 0 }
-};
-
-/* Return non-zero if C is a `word-constituent' byte; zero otherwise. */
-#define IS_WORD_CONSTITUENT(C) (ISALNUM(C) || (C) == '_')
-
-static int
-looking_at (char const *s)
-{
- size_t len;
-
- len = strlen(s);
- if (lexleft < len)
- return 0;
- return strncmp(s, lexptr, len) == 0;
-}
-
-static token
-lex (void)
-{
- token c, c1, c2;
- int backslash = 0, invert;
- charclass ccl;
- int i;
- char lo[2];
- char hi[2];
-
- /* Basic plan: We fetch a character. If it's a backslash,
- we set the backslash flag and go through the loop again.
- On the plus side, this avoids having a duplicate of the
- main switch inside the backslash case. On the minus side,
- it means that just about every case begins with
- "if (backslash) ...". */
- for (i = 0; i < 2; ++i)
- {
- FETCH(c, 0);
-#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1 && cur_mb_index)
- /* If this is a part of a multi-byte character, we must treat
- this byte data as a normal character.
- e.g. In case of SJIS encoding, some character contains '\',
- but they must not be backslash. */
- goto normal_char;
-#endif /* MBS_SUPPORT */
- switch (c)
- {
- case '\\':
- if (backslash)
- goto normal_char;
- if (lexleft == 0)
- dfaerror(_("Unfinished \\ escape"));
- backslash = 1;
- break;
-
- case '^':
- if (backslash)
- goto normal_char;
- if (syntax_bits & RE_CONTEXT_INDEP_ANCHORS
- || lasttok == END
- || lasttok == LPAREN
- || lasttok == OR)
- return lasttok = BEGLINE;
- goto normal_char;
-
- case '$':
- if (backslash)
- goto normal_char;
- if (syntax_bits & RE_CONTEXT_INDEP_ANCHORS
- || lexleft == 0
- || (syntax_bits & RE_NO_BK_PARENS
- ? lexleft > 0 && *lexptr == ')'
- : lexleft > 1 && lexptr[0] == '\\' && lexptr[1] == ')')
- || (syntax_bits & RE_NO_BK_VBAR
- ? lexleft > 0 && *lexptr == '|'
- : lexleft > 1 && lexptr[0] == '\\' && lexptr[1] == '|')
- || ((syntax_bits & RE_NEWLINE_ALT)
- && lexleft > 0 && *lexptr == '\n'))
- return lasttok = ENDLINE;
- goto normal_char;
-
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (backslash && !(syntax_bits & RE_NO_BK_REFS))
- {
- laststart = 0;
- return lasttok = BACKREF;
- }
- goto normal_char;
-
- case '`':
- if (backslash && !(syntax_bits & RE_NO_GNU_OPS))
- return lasttok = BEGLINE; /* FIXME: should be beginning of string */
- goto normal_char;
-
- case '\'':
- if (backslash && !(syntax_bits & RE_NO_GNU_OPS))
- return lasttok = ENDLINE; /* FIXME: should be end of string */
- goto normal_char;
-
- case '<':
- if (backslash && !(syntax_bits & RE_NO_GNU_OPS))
- return lasttok = BEGWORD;
- goto normal_char;
-
- case '>':
- if (backslash && !(syntax_bits & RE_NO_GNU_OPS))
- return lasttok = ENDWORD;
- goto normal_char;
-
- case 'b':
- if (backslash && !(syntax_bits & RE_NO_GNU_OPS))
- return lasttok = LIMWORD;
- goto normal_char;
-
- case 'B':
- if (backslash && !(syntax_bits & RE_NO_GNU_OPS))
- return lasttok = NOTLIMWORD;
- goto normal_char;
-
- case '?':
- if (syntax_bits & RE_LIMITED_OPS)
- goto normal_char;
- if (backslash != ((syntax_bits & RE_BK_PLUS_QM) != 0))
- goto normal_char;
- if (!(syntax_bits & RE_CONTEXT_INDEP_OPS) && laststart)
- goto normal_char;
- return lasttok = QMARK;
-
- case '*':
- if (backslash)
- goto normal_char;
- if (!(syntax_bits & RE_CONTEXT_INDEP_OPS) && laststart)
- goto normal_char;
- return lasttok = STAR;
-
- case '+':
- if (syntax_bits & RE_LIMITED_OPS)
- goto normal_char;
- if (backslash != ((syntax_bits & RE_BK_PLUS_QM) != 0))
- goto normal_char;
- if (!(syntax_bits & RE_CONTEXT_INDEP_OPS) && laststart)
- goto normal_char;
- return lasttok = PLUS;
-
- case '{':
- if (!(syntax_bits & RE_INTERVALS))
- goto normal_char;
- if (backslash != ((syntax_bits & RE_NO_BK_BRACES) == 0))
- goto normal_char;
- if (!(syntax_bits & RE_CONTEXT_INDEP_OPS) && laststart)
- goto normal_char;
-
- if (syntax_bits & RE_NO_BK_BRACES)
- {
- /* Scan ahead for a valid interval; if it's not valid,
- treat it as a literal '{'. */
- int lo = -1, hi = -1;
- char const *p = lexptr;
- char const *lim = p + lexleft;
- for (; p != lim && ISASCIIDIGIT (*p); p++)
- lo = (lo < 0 ? 0 : lo * 10) + *p - '0';
- if (p != lim && *p == ',')
- while (++p != lim && ISASCIIDIGIT (*p))
- hi = (hi < 0 ? 0 : hi * 10) + *p - '0';
- else
- hi = lo;
- if (p == lim || *p != '}'
- || lo < 0 || RE_DUP_MAX < hi || (0 <= hi && hi < lo))
- goto normal_char;
- }
-
- minrep = 0;
- /* Cases:
- {M} - exact count
- {M,} - minimum count, maximum is infinity
- {M,N} - M through N */
- FETCH(c, _("unfinished repeat count"));
- if (ISASCIIDIGIT (c))
- {
- minrep = c - '0';
- for (;;)
- {
- FETCH(c, _("unfinished repeat count"));
- if (! ISASCIIDIGIT (c))
- break;
- minrep = 10 * minrep + c - '0';
- }
- }
- else
- dfaerror(_("malformed repeat count"));
- if (c == ',')
- {
- FETCH (c, _("unfinished repeat count"));
- if (! ISASCIIDIGIT (c))
- maxrep = -1;
- else
- {
- maxrep = c - '0';
- for (;;)
- {
- FETCH (c, _("unfinished repeat count"));
- if (! ISASCIIDIGIT (c))
- break;
- maxrep = 10 * maxrep + c - '0';
- }
- if (0 <= maxrep && maxrep < minrep)
- dfaerror (_("malformed repeat count"));
- }
- }
- else
- maxrep = minrep;
- if (!(syntax_bits & RE_NO_BK_BRACES))
- {
- if (c != '\\')
- dfaerror(_("malformed repeat count"));
- FETCH(c, _("unfinished repeat count"));
- }
- if (c != '}')
- dfaerror(_("malformed repeat count"));
- laststart = 0;
- return lasttok = REPMN;
-
- case '|':
- if (syntax_bits & RE_LIMITED_OPS)
- goto normal_char;
- if (backslash != ((syntax_bits & RE_NO_BK_VBAR) == 0))
- goto normal_char;
- laststart = 1;
- return lasttok = OR;
-
- case '\n':
- if (syntax_bits & RE_LIMITED_OPS
- || backslash
- || !(syntax_bits & RE_NEWLINE_ALT))
- goto normal_char;
- laststart = 1;
- return lasttok = OR;
-
- case '(':
- if (backslash != ((syntax_bits & RE_NO_BK_PARENS) == 0))
- goto normal_char;
- ++parens;
- laststart = 1;
- return lasttok = LPAREN;
-
- case ')':
- if (backslash != ((syntax_bits & RE_NO_BK_PARENS) == 0))
- goto normal_char;
- if (parens == 0 && syntax_bits & RE_UNMATCHED_RIGHT_PAREN_ORD)
- goto normal_char;
- --parens;
- laststart = 0;
- return lasttok = RPAREN;
-
- case '.':
- if (backslash)
- goto normal_char;
-#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
- {
- /* In multibyte environment period must match with a single
- character not a byte. So we use ANYCHAR. */
- laststart = 0;
- return lasttok = ANYCHAR;
- }
-#endif /* MBS_SUPPORT */
- zeroset(ccl);
- notset(ccl);
- if (!(syntax_bits & RE_DOT_NEWLINE))
- clrbit(eolbyte, ccl);
- if (syntax_bits & RE_DOT_NOT_NULL)
- clrbit('\0', ccl);
- laststart = 0;
- return lasttok = CSET + charclass_index(ccl);
-
- case 'w':
- case 'W':
- if (!backslash || (syntax_bits & RE_NO_GNU_OPS))
- goto normal_char;
- zeroset(ccl);
- for (c2 = 0; c2 < NOTCHAR; ++c2)
- if (IS_WORD_CONSTITUENT(c2))
- setbit(c2, ccl);
- if (c == 'W')
- notset(ccl);
- laststart = 0;
- return lasttok = CSET + charclass_index(ccl);
-
- case '[':
- if (backslash)
- goto normal_char;
-#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
- {
- /* In multibyte environment a bracket expression may contain
- multibyte characters, which must be treated as characters
- (not bytes). So we parse it by parse_bracket_exp_mb(). */
- laststart = 0;
- parse_bracket_exp_mb();
- return lasttok = MBCSET;
- }
-#endif
- zeroset(ccl);
- FETCH(c, _("Unbalanced ["));
- if (c == '^')
- {
- FETCH(c, _("Unbalanced ["));
- invert = 1;
- }
- else
- invert = 0;
- do
- {
- /* Nobody ever said this had to be fast. :-)
- Note that if we're looking at some other [:...:]
- construct, we just treat it as a bunch of ordinary
- characters. We can do this because we assume
- regex has checked for syntax errors before
- dfa is ever called. */
- if (c == '[' && (syntax_bits & RE_CHAR_CLASSES))
- for (c1 = 0; prednames[c1].name; ++c1)
- if (looking_at(prednames[c1].name))
- {
- int (*pred)() = prednames[c1].pred;
- if (case_fold
- && (pred == is_upper || pred == is_lower))
- pred = is_alpha;
-
- for (c2 = 0; c2 < NOTCHAR; ++c2)
- if ((*pred)(c2))
- setbit(c2, ccl);
- lexptr += strlen(prednames[c1].name);
- lexleft -= strlen(prednames[c1].name);
- FETCH(c1, _("Unbalanced ["));
- goto skip;
- }
- if (c == '\\' && (syntax_bits & RE_BACKSLASH_ESCAPE_IN_LISTS))
- FETCH(c, _("Unbalanced ["));
- FETCH(c1, _("Unbalanced ["));
- if (c1 == '-')
- {
- FETCH(c2, _("Unbalanced ["));
- if (c2 == ']')
- {
- /* In the case [x-], the - is an ordinary hyphen,
- which is left in c1, the lookahead character. */
- --lexptr;
- ++lexleft;
- c2 = c;
- }
- else
- {
- if (c2 == '\\'
- && (syntax_bits & RE_BACKSLASH_ESCAPE_IN_LISTS))
- FETCH(c2, _("Unbalanced ["));
- FETCH(c1, _("Unbalanced ["));
- }
- }
- else
- c2 = c;
-
- lo[0] = c; lo[1] = '\0';
- hi[0] = c2; hi[1] = '\0';
- for (c = 0; c < NOTCHAR; c++)
- {
- char ch[2];
- ch[0] = c; ch[1] = '\0';
- if (strcoll (lo, ch) <= 0 && strcoll (ch, hi) <= 0)
- {
- setbit (c, ccl);
- if (case_fold)
- {
- if (ISUPPER (c))
- setbit (tolower (c), ccl);
- else if (ISLOWER (c))
- setbit (toupper (c), ccl);
- }
- }
- }
-
- skip:
- ;
- }
- while ((c = c1) != ']');
- if (invert)
- {
- notset(ccl);
- if (syntax_bits & RE_HAT_LISTS_NOT_NEWLINE)
- clrbit(eolbyte, ccl);
- }
- laststart = 0;
- return lasttok = CSET + charclass_index(ccl);
-
- default:
- normal_char:
- laststart = 0;
- if (case_fold && ISALPHA(c))
- {
- zeroset(ccl);
- setbit(c, ccl);
- if (isupper(c))
- setbit(tolower(c), ccl);
- else
- setbit(toupper(c), ccl);
- return lasttok = CSET + charclass_index(ccl);
- }
- return c;
- }
- }
-
- /* The above loop should consume at most a backslash
- and some other character. */
- abort();
- return END; /* keeps pedantic compilers happy. */
-}
-
-/* Recursive descent parser for regular expressions. */
-
-static token tok; /* Lookahead token. */
-static int depth; /* Current depth of a hypothetical stack
- holding deferred productions. This is
- used to determine the depth that will be
- required of the real stack later on in
- dfaanalyze(). */
-
-/* Add the given token to the parse tree, maintaining the depth count and
- updating the maximum depth if necessary. */
-static void
-addtok (token t)
-{
-#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
- {
- REALLOC_IF_NECESSARY(dfa->multibyte_prop, int, dfa->nmultibyte_prop,
- dfa->tindex);
- /* Set dfa->multibyte_prop. See struct dfa in dfa.h. */
- if (t == MBCSET)
- dfa->multibyte_prop[dfa->tindex] = ((dfa->nmbcsets - 1) << 2) + 3;
- else if (t < NOTCHAR)
- dfa->multibyte_prop[dfa->tindex]
- = (cur_mb_len == 1)? 3 /* single-byte char */
- : (((cur_mb_index == 1)? 1 : 0) /* 1st-byte of multibyte char */
- + ((cur_mb_index == cur_mb_len)? 2 : 0)); /* last-byte */
- else
- /* It may be unnecessary, but it is safer to treat other symbols
- as single byte characters. */
- dfa->multibyte_prop[dfa->tindex] = 3;
- }
-#endif
-
- REALLOC_IF_NECESSARY(dfa->tokens, token, dfa->talloc, dfa->tindex);
- dfa->tokens[dfa->tindex++] = t;
-
- switch (t)
- {
- case QMARK:
- case STAR:
- case PLUS:
- break;
-
- case CAT:
- case OR:
- case ORTOP:
- --depth;
- break;
-
- default:
- ++dfa->nleaves;
- case EMPTY:
- ++depth;
- break;
- }
- if (depth > dfa->depth)
- dfa->depth = depth;
-}
-
-/* The grammar understood by the parser is as follows.
-
- regexp:
- regexp OR branch
- branch
-
- branch:
- branch closure
- closure
-
- closure:
- closure QMARK
- closure STAR
- closure PLUS
- atom
-
- atom:
- <multibyte character>
- <normal character>
- ANYCHAR
- MBCSET
- CSET
- BACKREF
- BEGLINE
- ENDLINE
- BEGWORD
- ENDWORD
- LIMWORD
- NOTLIMWORD
- <empty>
-
- The parser builds a parse tree in postfix form in an array of tokens. */
-
-static void
-atom (void)
-{
- if ((tok >= 0 && tok < NOTCHAR) || tok >= CSET || tok == BACKREF
- || tok == BEGLINE || tok == ENDLINE || tok == BEGWORD
-#ifdef MBS_SUPPORT
- || tok == ANYCHAR || tok == MBCSET /* MB_CUR_MAX > 1 */
-#endif /* MBS_SUPPORT */
- || tok == ENDWORD || tok == LIMWORD || tok == NOTLIMWORD)
- {
- addtok(tok);
- tok = lex();
-#ifdef MBS_SUPPORT
- /* We treat a multibyte character as a single atom, so that DFA
- can treat a multibyte character as a single expression.
-
- e.g. We construct following tree from "<mb1><mb2>".
- <mb1(1st-byte)><mb1(2nd-byte)><CAT><mb1(3rd-byte)><CAT>
- <mb2(1st-byte)><mb2(2nd-byte)><CAT><mb2(3rd-byte)><CAT><CAT>
- */
- if (MB_CUR_MAX > 1)
- {
- while (cur_mb_index > 1 && tok >= 0 && tok < NOTCHAR)
- {
- addtok(tok);
- addtok(CAT);
- tok = lex();
- }
- }
-#endif /* MBS_SUPPORT */
- }
- else if (tok == LPAREN)
- {
- tok = lex();
- regexp(0);
- if (tok != RPAREN)
- dfaerror(_("Unbalanced ("));
- tok = lex();
- }
- else
- addtok(EMPTY);
-}
-
-/* Return the number of tokens in the given subexpression. */
-static int
-nsubtoks (int tindex)
-{
- int ntoks1;
-
- switch (dfa->tokens[tindex - 1])
- {
- default:
- return 1;
- case QMARK:
- case STAR:
- case PLUS:
- return 1 + nsubtoks(tindex - 1);
- case CAT:
- case OR:
- case ORTOP:
- ntoks1 = nsubtoks(tindex - 1);
- return 1 + ntoks1 + nsubtoks(tindex - 1 - ntoks1);
- }
-}
-
-/* Copy the given subexpression to the top of the tree. */
-static void
-copytoks (int tindex, int ntokens)
-{
- int i;
-
- for (i = 0; i < ntokens; ++i)
- addtok(dfa->tokens[tindex + i]);
-}
-
-static void
-closure (void)
-{
- int tindex, ntokens, i;
-
- atom();
- while (tok == QMARK || tok == STAR || tok == PLUS || tok == REPMN)
- if (tok == REPMN)
- {
- ntokens = nsubtoks(dfa->tindex);
- tindex = dfa->tindex - ntokens;
- if (maxrep < 0)
- addtok(PLUS);
- if (minrep == 0)
- addtok(QMARK);
- for (i = 1; i < minrep; ++i)
- {
- copytoks(tindex, ntokens);
- addtok(CAT);
- }
- for (; i < maxrep; ++i)
- {
- copytoks(tindex, ntokens);
- addtok(QMARK);
- addtok(CAT);
- }
- tok = lex();
- }
- else
- {
- addtok(tok);
- tok = lex();
- }
-}
-
-static void
-branch (void)
-{
- closure();
- while (tok != RPAREN && tok != OR && tok >= 0)
- {
- closure();
- addtok(CAT);
- }
-}
-
-static void
-regexp (int toplevel)
-{
- branch();
- while (tok == OR)
- {
- tok = lex();
- branch();
- if (toplevel)
- addtok(ORTOP);
- else
- addtok(OR);
- }
-}
-
-/* Main entry point for the parser. S is a string to be parsed, len is the
- length of the string, so s can include NUL characters. D is a pointer to
- the struct dfa to parse into. */
-void
-dfaparse (char *s, size_t len, struct dfa *d)
-{
- dfa = d;
- lexptr = s;
- lexleft = len;
- lasttok = END;
- laststart = 1;
- parens = 0;
-#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
- {
- cur_mb_index = 0;
- cur_mb_len = 0;
- memset(&mbs, 0, sizeof(mbstate_t));
- }
-#endif /* MBS_SUPPORT */
-
- if (! syntax_bits_set)
- dfaerror(_("No regexp syntax bits specified"));
-
- tok = lex();
- depth = d->depth;
-
- regexp(1);
-
- if (tok != END)
- dfaerror(_("Unbalanced )"));
-
- addtok(END - d->nregexps);
- addtok(CAT);
-
- if (d->nregexps)
- addtok(ORTOP);
-
- ++d->nregexps;
-}
-
-/* Some primitives for operating on sets of positions. */
-
-/* Copy one set to another; the destination must be large enough. */
-static void
-copy (position_set *src, position_set *dst)
-{
- int i;
-
- for (i = 0; i < src->nelem; ++i)
- dst->elems[i] = src->elems[i];
- dst->nelem = src->nelem;
-}
-
-/* Insert a position in a set. Position sets are maintained in sorted
- order according to index. If position already exists in the set with
- the same index then their constraints are logically or'd together.
- S->elems must point to an array large enough to hold the resulting set. */
-static void
-insert (position p, position_set *s)
-{
- int i;
- position t1, t2;
-
- for (i = 0; i < s->nelem && p.index < s->elems[i].index; ++i)
- continue;
- if (i < s->nelem && p.index == s->elems[i].index)
- s->elems[i].constraint |= p.constraint;
- else
- {
- t1 = p;
- ++s->nelem;
- while (i < s->nelem)
- {
- t2 = s->elems[i];
- s->elems[i++] = t1;
- t1 = t2;
- }
- }
-}
-
-/* Merge two sets of positions into a third. The result is exactly as if
- the positions of both sets were inserted into an initially empty set. */
-static void
-merge (position_set *s1, position_set *s2, position_set *m)
-{
- int i = 0, j = 0;
-
- m->nelem = 0;
- while (i < s1->nelem && j < s2->nelem)
- if (s1->elems[i].index > s2->elems[j].index)
- m->elems[m->nelem++] = s1->elems[i++];
- else if (s1->elems[i].index < s2->elems[j].index)
- m->elems[m->nelem++] = s2->elems[j++];
- else
- {
- m->elems[m->nelem] = s1->elems[i++];
- m->elems[m->nelem++].constraint |= s2->elems[j++].constraint;
- }
- while (i < s1->nelem)
- m->elems[m->nelem++] = s1->elems[i++];
- while (j < s2->nelem)
- m->elems[m->nelem++] = s2->elems[j++];
-}
-
-/* Delete a position from a set. */
-static void
-delete (position p, position_set *s)
-{
- int i;
-
- for (i = 0; i < s->nelem; ++i)
- if (p.index == s->elems[i].index)
- break;
- if (i < s->nelem)
- for (--s->nelem; i < s->nelem; ++i)
- s->elems[i] = s->elems[i + 1];
-}
-
-/* Find the index of the state corresponding to the given position set with
- the given preceding context, or create a new state if there is no such
- state. Newline and letter tell whether we got here on a newline or
- letter, respectively. */
-static int
-state_index (struct dfa *d, position_set *s, int newline, int letter)
-{
- int hash = 0;
- int constraint;
- int i, j;
-
- newline = newline ? 1 : 0;
- letter = letter ? 1 : 0;
-
- for (i = 0; i < s->nelem; ++i)
- hash ^= s->elems[i].index + s->elems[i].constraint;
-
- /* Try to find a state that exactly matches the proposed one. */
- for (i = 0; i < d->sindex; ++i)
- {
- if (hash != d->states[i].hash || s->nelem != d->states[i].elems.nelem
- || newline != d->states[i].newline || letter != d->states[i].letter)
- continue;
- for (j = 0; j < s->nelem; ++j)
- if (s->elems[j].constraint
- != d->states[i].elems.elems[j].constraint
- || s->elems[j].index != d->states[i].elems.elems[j].index)
- break;
- if (j == s->nelem)
- return i;
- }
-
- /* We'll have to create a new state. */
- REALLOC_IF_NECESSARY(d->states, dfa_state, d->salloc, d->sindex);
- d->states[i].hash = hash;
- MALLOC(d->states[i].elems.elems, position, s->nelem);
- copy(s, &d->states[i].elems);
- d->states[i].newline = newline;
- d->states[i].letter = letter;
- d->states[i].backref = 0;
- d->states[i].constraint = 0;
- d->states[i].first_end = 0;
-#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
- d->states[i].mbps.nelem = 0;
-#endif
- for (j = 0; j < s->nelem; ++j)
- if (d->tokens[s->elems[j].index] < 0)
- {
- constraint = s->elems[j].constraint;
- if (SUCCEEDS_IN_CONTEXT(constraint, newline, 0, letter, 0)
- || SUCCEEDS_IN_CONTEXT(constraint, newline, 0, letter, 1)
- || SUCCEEDS_IN_CONTEXT(constraint, newline, 1, letter, 0)
- || SUCCEEDS_IN_CONTEXT(constraint, newline, 1, letter, 1))
- d->states[i].constraint |= constraint;
- if (! d->states[i].first_end)
- d->states[i].first_end = d->tokens[s->elems[j].index];
- }
- else if (d->tokens[s->elems[j].index] == BACKREF)
- {
- d->states[i].constraint = NO_CONSTRAINT;
- d->states[i].backref = 1;
- }
-
- ++d->sindex;
-
- return i;
-}
-
-/* Find the epsilon closure of a set of positions. If any position of the set
- contains a symbol that matches the empty string in some context, replace
- that position with the elements of its follow labeled with an appropriate
- constraint. Repeat exhaustively until no funny positions are left.
- S->elems must be large enough to hold the result. */
-static void
-epsclosure (position_set *s, struct dfa *d)
-{
- int i, j;
- int *visited;
- position p, old;
-
- MALLOC(visited, int, d->tindex);
- for (i = 0; i < d->tindex; ++i)
- visited[i] = 0;
-
- for (i = 0; i < s->nelem; ++i)
- if (d->tokens[s->elems[i].index] >= NOTCHAR
- && d->tokens[s->elems[i].index] != BACKREF
-#ifdef MBS_SUPPORT
- && d->tokens[s->elems[i].index] != ANYCHAR
- && d->tokens[s->elems[i].index] != MBCSET
-#endif
- && d->tokens[s->elems[i].index] < CSET)
- {
- old = s->elems[i];
- p.constraint = old.constraint;
- delete(s->elems[i], s);
- if (visited[old.index])
- {
- --i;
- continue;
- }
- visited[old.index] = 1;
- switch (d->tokens[old.index])
- {
- case BEGLINE:
- p.constraint &= BEGLINE_CONSTRAINT;
- break;
- case ENDLINE:
- p.constraint &= ENDLINE_CONSTRAINT;
- break;
- case BEGWORD:
- p.constraint &= BEGWORD_CONSTRAINT;
- break;
- case ENDWORD:
- p.constraint &= ENDWORD_CONSTRAINT;
- break;
- case LIMWORD:
- p.constraint &= LIMWORD_CONSTRAINT;
- break;
- case NOTLIMWORD:
- p.constraint &= NOTLIMWORD_CONSTRAINT;
- break;
- default:
- break;
- }
- for (j = 0; j < d->follows[old.index].nelem; ++j)
- {
- p.index = d->follows[old.index].elems[j].index;
- insert(p, s);
- }
- /* Force rescan to start at the beginning. */
- i = -1;
- }
-
- free(visited);
-}
-
-/* Perform bottom-up analysis on the parse tree, computing various functions.
- Note that at this point, we're pretending constructs like \< are real
- characters rather than constraints on what can follow them.
-
- Nullable: A node is nullable if it is at the root of a regexp that can
- match the empty string.
- * EMPTY leaves are nullable.
- * No other leaf is nullable.
- * A QMARK or STAR node is nullable.
- * A PLUS node is nullable if its argument is nullable.
- * A CAT node is nullable if both its arguments are nullable.
- * An OR node is nullable if either argument is nullable.
-
- Firstpos: The firstpos of a node is the set of positions (nonempty leaves)
- that could correspond to the first character of a string matching the
- regexp rooted at the given node.
- * EMPTY leaves have empty firstpos.
- * The firstpos of a nonempty leaf is that leaf itself.
- * The firstpos of a QMARK, STAR, or PLUS node is the firstpos of its
- argument.
- * The firstpos of a CAT node is the firstpos of the left argument, union
- the firstpos of the right if the left argument is nullable.
- * The firstpos of an OR node is the union of firstpos of each argument.
-
- Lastpos: The lastpos of a node is the set of positions that could
- correspond to the last character of a string matching the regexp at
- the given node.
- * EMPTY leaves have empty lastpos.
- * The lastpos of a nonempty leaf is that leaf itself.
- * The lastpos of a QMARK, STAR, or PLUS node is the lastpos of its
- argument.
- * The lastpos of a CAT node is the lastpos of its right argument, union
- the lastpos of the left if the right argument is nullable.
- * The lastpos of an OR node is the union of the lastpos of each argument.
-
- Follow: The follow of a position is the set of positions that could
- correspond to the character following a character matching the node in
- a string matching the regexp. At this point we consider special symbols
- that match the empty string in some context to be just normal characters.
- Later, if we find that a special symbol is in a follow set, we will
- replace it with the elements of its follow, labeled with an appropriate
- constraint.
- * Every node in the firstpos of the argument of a STAR or PLUS node is in
- the follow of every node in the lastpos.
- * Every node in the firstpos of the second argument of a CAT node is in
- the follow of every node in the lastpos of the first argument.
-
- Because of the postfix representation of the parse tree, the depth-first
- analysis is conveniently done by a linear scan with the aid of a stack.
- Sets are stored as arrays of the elements, obeying a stack-like allocation
- scheme; the number of elements in each set deeper in the stack can be
- used to determine the address of a particular set's array. */
-void
-dfaanalyze (struct dfa *d, int searchflag)
-{
- int *nullable; /* Nullable stack. */
- int *nfirstpos; /* Element count stack for firstpos sets. */
- position *firstpos; /* Array where firstpos elements are stored. */
- int *nlastpos; /* Element count stack for lastpos sets. */
- position *lastpos; /* Array where lastpos elements are stored. */
- int *nalloc; /* Sizes of arrays allocated to follow sets. */
- position_set tmp; /* Temporary set for merging sets. */
- position_set merged; /* Result of merging sets. */
- int wants_newline; /* True if some position wants newline info. */
- int *o_nullable;
- int *o_nfirst, *o_nlast;
- position *o_firstpos, *o_lastpos;
- int i, j;
- position *pos;
-
-#ifdef DEBUG
- fprintf(stderr, "dfaanalyze:\n");
- for (i = 0; i < d->tindex; ++i)
- {
- fprintf(stderr, " %d:", i);
- prtok(d->tokens[i]);
- }
- putc('\n', stderr);
-#endif
-
- d->searchflag = searchflag;
-
- MALLOC(nullable, int, d->depth);
- o_nullable = nullable;
- MALLOC(nfirstpos, int, d->depth);
- o_nfirst = nfirstpos;
- MALLOC(firstpos, position, d->nleaves);
- o_firstpos = firstpos, firstpos += d->nleaves;
- MALLOC(nlastpos, int, d->depth);
- o_nlast = nlastpos;
- MALLOC(lastpos, position, d->nleaves);
- o_lastpos = lastpos, lastpos += d->nleaves;
- MALLOC(nalloc, int, d->tindex);
- for (i = 0; i < d->tindex; ++i)
- nalloc[i] = 0;
- MALLOC(merged.elems, position, d->nleaves);
-
- CALLOC(d->follows, position_set, d->tindex);
-
- for (i = 0; i < d->tindex; ++i)
-#ifdef DEBUG
- { /* Nonsyntactic #ifdef goo... */
-#endif
- switch (d->tokens[i])
- {
- case EMPTY:
- /* The empty set is nullable. */
- *nullable++ = 1;
-
- /* The firstpos and lastpos of the empty leaf are both empty. */
- *nfirstpos++ = *nlastpos++ = 0;
- break;
-
- case STAR:
- case PLUS:
- /* Every element in the firstpos of the argument is in the follow
- of every element in the lastpos. */
- tmp.nelem = nfirstpos[-1];
- tmp.elems = firstpos;
- pos = lastpos;
- for (j = 0; j < nlastpos[-1]; ++j)
- {
- merge(&tmp, &d->follows[pos[j].index], &merged);
- REALLOC_IF_NECESSARY(d->follows[pos[j].index].elems, position,
- nalloc[pos[j].index], merged.nelem - 1);
- copy(&merged, &d->follows[pos[j].index]);
- }
-
- case QMARK:
- /* A QMARK or STAR node is automatically nullable. */
- if (d->tokens[i] != PLUS)
- nullable[-1] = 1;
- break;
-
- case CAT:
- /* Every element in the firstpos of the second argument is in the
- follow of every element in the lastpos of the first argument. */
- tmp.nelem = nfirstpos[-1];
- tmp.elems = firstpos;
- pos = lastpos + nlastpos[-1];
- for (j = 0; j < nlastpos[-2]; ++j)
- {
- merge(&tmp, &d->follows[pos[j].index], &merged);
- REALLOC_IF_NECESSARY(d->follows[pos[j].index].elems, position,
- nalloc[pos[j].index], merged.nelem - 1);
- copy(&merged, &d->follows[pos[j].index]);
- }
-
- /* The firstpos of a CAT node is the firstpos of the first argument,
- union that of the second argument if the first is nullable. */
- if (nullable[-2])
- nfirstpos[-2] += nfirstpos[-1];
- else
- firstpos += nfirstpos[-1];
- --nfirstpos;
-
- /* The lastpos of a CAT node is the lastpos of the second argument,
- union that of the first argument if the second is nullable. */
- if (nullable[-1])
- nlastpos[-2] += nlastpos[-1];
- else
- {
- pos = lastpos + nlastpos[-2];
- for (j = nlastpos[-1] - 1; j >= 0; --j)
- pos[j] = lastpos[j];
- lastpos += nlastpos[-2];
- nlastpos[-2] = nlastpos[-1];
- }
- --nlastpos;
-
- /* A CAT node is nullable if both arguments are nullable. */
- nullable[-2] = nullable[-1] && nullable[-2];
- --nullable;
- break;
-
- case OR:
- case ORTOP:
- /* The firstpos is the union of the firstpos of each argument. */
- nfirstpos[-2] += nfirstpos[-1];
- --nfirstpos;
-
- /* The lastpos is the union of the lastpos of each argument. */
- nlastpos[-2] += nlastpos[-1];
- --nlastpos;
-
- /* An OR node is nullable if either argument is nullable. */
- nullable[-2] = nullable[-1] || nullable[-2];
- --nullable;
- break;
-
- default:
- /* Anything else is a nonempty position. (Note that special
- constructs like \< are treated as nonempty strings here;
- an "epsilon closure" effectively makes them nullable later.
- Backreferences have to get a real position so we can detect
- transitions on them later. But they are nullable. */
- *nullable++ = d->tokens[i] == BACKREF;
-
- /* This position is in its own firstpos and lastpos. */
- *nfirstpos++ = *nlastpos++ = 1;
- --firstpos, --lastpos;
- firstpos->index = lastpos->index = i;
- firstpos->constraint = lastpos->constraint = NO_CONSTRAINT;
-
- /* Allocate the follow set for this position. */
- nalloc[i] = 1;
- MALLOC(d->follows[i].elems, position, nalloc[i]);
- break;
- }
-#ifdef DEBUG
- /* ... balance the above nonsyntactic #ifdef goo... */
- fprintf(stderr, "node %d:", i);
- prtok(d->tokens[i]);
- putc('\n', stderr);
- fprintf(stderr, nullable[-1] ? " nullable: yes\n" : " nullable: no\n");
- fprintf(stderr, " firstpos:");
- for (j = nfirstpos[-1] - 1; j >= 0; --j)
- {
- fprintf(stderr, " %d:", firstpos[j].index);
- prtok(d->tokens[firstpos[j].index]);
- }
- fprintf(stderr, "\n lastpos:");
- for (j = nlastpos[-1] - 1; j >= 0; --j)
- {
- fprintf(stderr, " %d:", lastpos[j].index);
- prtok(d->tokens[lastpos[j].index]);
- }
- putc('\n', stderr);
- }
-#endif
-
- /* For each follow set that is the follow set of a real position, replace
- it with its epsilon closure. */
- for (i = 0; i < d->tindex; ++i)
- if (d->tokens[i] < NOTCHAR || d->tokens[i] == BACKREF
-#ifdef MBS_SUPPORT
- || d->tokens[i] == ANYCHAR
- || d->tokens[i] == MBCSET
-#endif
- || d->tokens[i] >= CSET)
- {
-#ifdef DEBUG
- fprintf(stderr, "follows(%d:", i);
- prtok(d->tokens[i]);
- fprintf(stderr, "):");
- for (j = d->follows[i].nelem - 1; j >= 0; --j)
- {
- fprintf(stderr, " %d:", d->follows[i].elems[j].index);
- prtok(d->tokens[d->follows[i].elems[j].index]);
- }
- putc('\n', stderr);
-#endif
- copy(&d->follows[i], &merged);
- epsclosure(&merged, d);
- if (d->follows[i].nelem < merged.nelem)
- REALLOC(d->follows[i].elems, position, merged.nelem);
- copy(&merged, &d->follows[i]);
- }
-
- /* Get the epsilon closure of the firstpos of the regexp. The result will
- be the set of positions of state 0. */
- merged.nelem = 0;
- for (i = 0; i < nfirstpos[-1]; ++i)
- insert(firstpos[i], &merged);
- epsclosure(&merged, d);
-
- /* Check if any of the positions of state 0 will want newline context. */
- wants_newline = 0;
- for (i = 0; i < merged.nelem; ++i)
- if (PREV_NEWLINE_DEPENDENT(merged.elems[i].constraint))
- wants_newline = 1;
-
- /* Build the initial state. */
- d->salloc = 1;
- d->sindex = 0;
- MALLOC(d->states, dfa_state, d->salloc);
- state_index(d, &merged, wants_newline, 0);
-
- free(o_nullable);
- free(o_nfirst);
- free(o_firstpos);
- free(o_nlast);
- free(o_lastpos);
- free(nalloc);
- free(merged.elems);
-}
-
-/* Find, for each character, the transition out of state s of d, and store
- it in the appropriate slot of trans.
-
- We divide the positions of s into groups (positions can appear in more
- than one group). Each group is labeled with a set of characters that
- every position in the group matches (taking into account, if necessary,
- preceding context information of s). For each group, find the union
- of the its elements' follows. This set is the set of positions of the
- new state. For each character in the group's label, set the transition
- on this character to be to a state corresponding to the set's positions,
- and its associated backward context information, if necessary.
-
- If we are building a searching matcher, we include the positions of state
- 0 in every state.
-
- The collection of groups is constructed by building an equivalence-class
- partition of the positions of s.
-
- For each position, find the set of characters C that it matches. Eliminate
- any characters from C that fail on grounds of backward context.
-
- Search through the groups, looking for a group whose label L has nonempty
- intersection with C. If L - C is nonempty, create a new group labeled
- L - C and having the same positions as the current group, and set L to
- the intersection of L and C. Insert the position in this group, set
- C = C - L, and resume scanning.
-
- If after comparing with every group there are characters remaining in C,
- create a new group labeled with the characters of C and insert this
- position in that group. */
-void
-dfastate (int s, struct dfa *d, int trans[])
-{
- position_set grps[NOTCHAR]; /* As many as will ever be needed. */
- charclass labels[NOTCHAR]; /* Labels corresponding to the groups. */
- int ngrps = 0; /* Number of groups actually used. */
- position pos; /* Current position being considered. */
- charclass matches; /* Set of matching characters. */
- int matchesf; /* True if matches is nonempty. */
- charclass intersect; /* Intersection with some label set. */
- int intersectf; /* True if intersect is nonempty. */
- charclass leftovers; /* Stuff in the label that didn't match. */
- int leftoversf; /* True if leftovers is nonempty. */
- static charclass letters; /* Set of characters considered letters. */
- static charclass newline; /* Set of characters that aren't newline. */
- position_set follows; /* Union of the follows of some group. */
- position_set tmp; /* Temporary space for merging sets. */
- int state; /* New state. */
- int wants_newline; /* New state wants to know newline context. */
- int state_newline; /* New state on a newline transition. */
- int wants_letter; /* New state wants to know letter context. */
- int state_letter; /* New state on a letter transition. */
- static int initialized; /* Flag for static initialization. */
-#ifdef MBS_SUPPORT
- int next_isnt_1st_byte = 0; /* Flag if we can't add state0. */
-#endif
- int i, j, k;
-
- /* Initialize the set of letters, if necessary. */
- if (! initialized)
- {
- initialized = 1;
- for (i = 0; i < NOTCHAR; ++i)
- if (IS_WORD_CONSTITUENT(i))
- setbit(i, letters);
- setbit(eolbyte, newline);
- }
-
- zeroset(matches);
-
- for (i = 0; i < d->states[s].elems.nelem; ++i)
- {
- pos = d->states[s].elems.elems[i];
- if (d->tokens[pos.index] >= 0 && d->tokens[pos.index] < NOTCHAR)
- setbit(d->tokens[pos.index], matches);
- else if (d->tokens[pos.index] >= CSET)
- copyset(d->charclasses[d->tokens[pos.index] - CSET], matches);
-#ifdef MBS_SUPPORT
- else if (d->tokens[pos.index] == ANYCHAR
- || d->tokens[pos.index] == MBCSET)
- /* MB_CUR_MAX > 1 */
- {
- /* ANYCHAR and MBCSET must match with a single character, so we
- must put it to d->states[s].mbps, which contains the positions
- which can match with a single character not a byte. */
- if (d->states[s].mbps.nelem == 0)
- {
- MALLOC(d->states[s].mbps.elems, position,
- d->states[s].elems.nelem);
- }
- insert(pos, &(d->states[s].mbps));
- continue;
- }
-#endif /* MBS_SUPPORT */
- else
- continue;
-
- /* Some characters may need to be eliminated from matches because
- they fail in the current context. */
- if (pos.constraint != 0xFF)
- {
- if (! MATCHES_NEWLINE_CONTEXT(pos.constraint,
- d->states[s].newline, 1))
- clrbit(eolbyte, matches);
- if (! MATCHES_NEWLINE_CONTEXT(pos.constraint,
- d->states[s].newline, 0))
- for (j = 0; j < CHARCLASS_INTS; ++j)
- matches[j] &= newline[j];
- if (! MATCHES_LETTER_CONTEXT(pos.constraint,
- d->states[s].letter, 1))
- for (j = 0; j < CHARCLASS_INTS; ++j)
- matches[j] &= ~letters[j];
- if (! MATCHES_LETTER_CONTEXT(pos.constraint,
- d->states[s].letter, 0))
- for (j = 0; j < CHARCLASS_INTS; ++j)
- matches[j] &= letters[j];
-
- /* If there are no characters left, there's no point in going on. */
- for (j = 0; j < CHARCLASS_INTS && !matches[j]; ++j)
- continue;
- if (j == CHARCLASS_INTS)
- continue;
- }
-
- for (j = 0; j < ngrps; ++j)
- {
- /* If matches contains a single character only, and the current
- group's label doesn't contain that character, go on to the
- next group. */
- if (d->tokens[pos.index] >= 0 && d->tokens[pos.index] < NOTCHAR
- && !tstbit(d->tokens[pos.index], labels[j]))
- continue;
-
- /* Check if this group's label has a nonempty intersection with
- matches. */
- intersectf = 0;
- for (k = 0; k < CHARCLASS_INTS; ++k)
- (intersect[k] = matches[k] & labels[j][k]) ? (intersectf = 1) : 0;
- if (! intersectf)
- continue;
-
- /* It does; now find the set differences both ways. */
- leftoversf = matchesf = 0;
- for (k = 0; k < CHARCLASS_INTS; ++k)
- {
- /* Even an optimizing compiler can't know this for sure. */
- int match = matches[k], label = labels[j][k];
-
- (leftovers[k] = ~match & label) ? (leftoversf = 1) : 0;
- (matches[k] = match & ~label) ? (matchesf = 1) : 0;
- }
-
- /* If there were leftovers, create a new group labeled with them. */
- if (leftoversf)
- {
- copyset(leftovers, labels[ngrps]);
- copyset(intersect, labels[j]);
- MALLOC(grps[ngrps].elems, position, d->nleaves);
- copy(&grps[j], &grps[ngrps]);
- ++ngrps;
- }
-
- /* Put the position in the current group. Note that there is no
- reason to call insert() here. */
- grps[j].elems[grps[j].nelem++] = pos;
-
- /* If every character matching the current position has been
- accounted for, we're done. */
- if (! matchesf)
- break;
- }
-
- /* If we've passed the last group, and there are still characters
- unaccounted for, then we'll have to create a new group. */
- if (j == ngrps)
- {
- copyset(matches, labels[ngrps]);
- zeroset(matches);
- MALLOC(grps[ngrps].elems, position, d->nleaves);
- grps[ngrps].nelem = 1;
- grps[ngrps].elems[0] = pos;
- ++ngrps;
- }
- }
-
- MALLOC(follows.elems, position, d->nleaves);
- MALLOC(tmp.elems, position, d->nleaves);
-
- /* If we are a searching matcher, the default transition is to a state
- containing the positions of state 0, otherwise the default transition
- is to fail miserably. */
- if (d->searchflag)
- {
- wants_newline = 0;
- wants_letter = 0;
- for (i = 0; i < d->states[0].elems.nelem; ++i)
- {
- if (PREV_NEWLINE_DEPENDENT(d->states[0].elems.elems[i].constraint))
- wants_newline = 1;
- if (PREV_LETTER_DEPENDENT(d->states[0].elems.elems[i].constraint))
- wants_letter = 1;
- }
- copy(&d->states[0].elems, &follows);
- state = state_index(d, &follows, 0, 0);
- if (wants_newline)
- state_newline = state_index(d, &follows, 1, 0);
- else
- state_newline = state;
- if (wants_letter)
- state_letter = state_index(d, &follows, 0, 1);
- else
- state_letter = state;
- for (i = 0; i < NOTCHAR; ++i)
- trans[i] = (IS_WORD_CONSTITUENT(i)) ? state_letter : state;
- trans[eolbyte] = state_newline;
- }
- else
- for (i = 0; i < NOTCHAR; ++i)
- trans[i] = -1;
-
- for (i = 0; i < ngrps; ++i)
- {
- follows.nelem = 0;
-
- /* Find the union of the follows of the positions of the group.
- This is a hideously inefficient loop. Fix it someday. */
- for (j = 0; j < grps[i].nelem; ++j)
- for (k = 0; k < d->follows[grps[i].elems[j].index].nelem; ++k)
- insert(d->follows[grps[i].elems[j].index].elems[k], &follows);
-
-#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
- {
- /* If a token in follows.elems is not 1st byte of a multibyte
- character, or the states of follows must accept the bytes
- which are not 1st byte of the multibyte character.
- Then, if a state of follows encounter a byte, it must not be
- a 1st byte of a multibyte character nor singlebyte character.
- We cansel to add state[0].follows to next state, because
- state[0] must accept 1st-byte
-
- For example, we assume <sb a> is a certain singlebyte
- character, <mb A> is a certain multibyte character, and the
- codepoint of <sb a> equals the 2nd byte of the codepoint of
- <mb A>.
- When state[0] accepts <sb a>, state[i] transit to state[i+1]
- by accepting accepts 1st byte of <mb A>, and state[i+1]
- accepts 2nd byte of <mb A>, if state[i+1] encounter the
- codepoint of <sb a>, it must not be <sb a> but 2nd byte of
- <mb A>, so we can not add state[0]. */
-
- next_isnt_1st_byte = 0;
- for (j = 0; j < follows.nelem; ++j)
- {
- if (!(d->multibyte_prop[follows.elems[j].index] & 1))
- {
- next_isnt_1st_byte = 1;
- break;
- }
- }
- }
-#endif
-
- /* If we are building a searching matcher, throw in the positions
- of state 0 as well. */
-#ifdef MBS_SUPPORT
- if (d->searchflag && (MB_CUR_MAX == 1 || !next_isnt_1st_byte))
-#else
- if (d->searchflag)
-#endif
- for (j = 0; j < d->states[0].elems.nelem; ++j)
- insert(d->states[0].elems.elems[j], &follows);
-
- /* Find out if the new state will want any context information. */
- wants_newline = 0;
- if (tstbit(eolbyte, labels[i]))
- for (j = 0; j < follows.nelem; ++j)
- if (PREV_NEWLINE_DEPENDENT(follows.elems[j].constraint))
- wants_newline = 1;
-
- wants_letter = 0;
- for (j = 0; j < CHARCLASS_INTS; ++j)
- if (labels[i][j] & letters[j])
- break;
- if (j < CHARCLASS_INTS)
- for (j = 0; j < follows.nelem; ++j)
- if (PREV_LETTER_DEPENDENT(follows.elems[j].constraint))
- wants_letter = 1;
-
- /* Find the state(s) corresponding to the union of the follows. */
- state = state_index(d, &follows, 0, 0);
- if (wants_newline)
- state_newline = state_index(d, &follows, 1, 0);
- else
- state_newline = state;
- if (wants_letter)
- state_letter = state_index(d, &follows, 0, 1);
- else
- state_letter = state;
-
- /* Set the transitions for each character in the current label. */
- for (j = 0; j < CHARCLASS_INTS; ++j)
- for (k = 0; k < INTBITS; ++k)
- if (labels[i][j] & 1 << k)
- {
- int c = j * INTBITS + k;
-
- if (c == eolbyte)
- trans[c] = state_newline;
- else if (IS_WORD_CONSTITUENT(c))
- trans[c] = state_letter;
- else if (c < NOTCHAR)
- trans[c] = state;
- }
- }
-
- for (i = 0; i < ngrps; ++i)
- free(grps[i].elems);
- free(follows.elems);
- free(tmp.elems);
-}
-
-/* Some routines for manipulating a compiled dfa's transition tables.
- Each state may or may not have a transition table; if it does, and it
- is a non-accepting state, then d->trans[state] points to its table.
- If it is an accepting state then d->fails[state] points to its table.
- If it has no table at all, then d->trans[state] is NULL.
- TODO: Improve this comment, get rid of the unnecessary redundancy. */
-
-static void
-build_state (int s, struct dfa *d)
-{
- int *trans; /* The new transition table. */
- int i;
-
- /* Set an upper limit on the number of transition tables that will ever
- exist at once. 1024 is arbitrary. The idea is that the frequently
- used transition tables will be quickly rebuilt, whereas the ones that
- were only needed once or twice will be cleared away. */
- if (d->trcount >= 1024)
- {
- for (i = 0; i < d->tralloc; ++i)
- if (d->trans[i])
- {
- free((ptr_t) d->trans[i]);
- d->trans[i] = NULL;
- }
- else if (d->fails[i])
- {
- free((ptr_t) d->fails[i]);
- d->fails[i] = NULL;
- }
- d->trcount = 0;
- }
-
- ++d->trcount;
-
- /* Set up the success bits for this state. */
- d->success[s] = 0;
- if (ACCEPTS_IN_CONTEXT(d->states[s].newline, 1, d->states[s].letter, 0,
- s, *d))
- d->success[s] |= 4;
- if (ACCEPTS_IN_CONTEXT(d->states[s].newline, 0, d->states[s].letter, 1,
- s, *d))
- d->success[s] |= 2;
- if (ACCEPTS_IN_CONTEXT(d->states[s].newline, 0, d->states[s].letter, 0,
- s, *d))
- d->success[s] |= 1;
-
- MALLOC(trans, int, NOTCHAR);
- dfastate(s, d, trans);
-
- /* Now go through the new transition table, and make sure that the trans
- and fail arrays are allocated large enough to hold a pointer for the
- largest state mentioned in the table. */
- for (i = 0; i < NOTCHAR; ++i)
- if (trans[i] >= d->tralloc)
- {
- int oldalloc = d->tralloc;
-
- while (trans[i] >= d->tralloc)
- d->tralloc *= 2;
- REALLOC(d->realtrans, int *, d->tralloc + 1);
- d->trans = d->realtrans + 1;
- REALLOC(d->fails, int *, d->tralloc);
- REALLOC(d->success, int, d->tralloc);
- REALLOC(d->newlines, int, d->tralloc);
- while (oldalloc < d->tralloc)
- {
- d->trans[oldalloc] = NULL;
- d->fails[oldalloc++] = NULL;
- }
- }
-
- /* Keep the newline transition in a special place so we can use it as
- a sentinel. */
- d->newlines[s] = trans[eolbyte];
- trans[eolbyte] = -1;
-
- if (ACCEPTING(s, *d))
- d->fails[s] = trans;
- else
- d->trans[s] = trans;
-}
-
-static void
-build_state_zero (struct dfa *d)
-{
- d->tralloc = 1;
- d->trcount = 0;
- CALLOC(d->realtrans, int *, d->tralloc + 1);
- d->trans = d->realtrans + 1;
- CALLOC(d->fails, int *, d->tralloc);
- MALLOC(d->success, int, d->tralloc);
- MALLOC(d->newlines, int, d->tralloc);
- build_state(0, d);
-}
-
-#ifdef MBS_SUPPORT
-/* Multibyte character handling sub-routins for dfaexec. */
-
-/* Initial state may encounter the byte which is not a singlebyte character
- nor 1st byte of a multibyte character. But it is incorrect for initial
- state to accept such a byte.
- For example, in sjis encoding the regular expression like "\\" accepts
- the codepoint 0x5c, but should not accept the 2nd byte of the codepoint
- 0x815c. Then Initial state must skip the bytes which are not a singlebyte
- character nor 1st byte of a multibyte character. */
-#define SKIP_REMAINS_MB_IF_INITIAL_STATE(s, p) \
- if (s == 0) \
- { \
- while (inputwcs[p - buf_begin] == 0 \
- && mblen_buf[p - buf_begin] > 0 \
- && (unsigned char const *)p < buf_end) \
- ++p; \
- if ((char*)p >= end) \
- { \
- free(mblen_buf); \
- free(inputwcs); \
- return NULL; \
- } \
- }
-
-static void
-realloc_trans_if_necessary(struct dfa *d, int new_state)
-{
- /* Make sure that the trans and fail arrays are allocated large enough
- to hold a pointer for the new state. */
- if (new_state >= d->tralloc)
- {
- int oldalloc = d->tralloc;
-
- while (new_state >= d->tralloc)
- d->tralloc *= 2;
- REALLOC(d->realtrans, int *, d->tralloc + 1);
- d->trans = d->realtrans + 1;
- REALLOC(d->fails, int *, d->tralloc);
- REALLOC(d->success, int, d->tralloc);
- REALLOC(d->newlines, int, d->tralloc);
- while (oldalloc < d->tralloc)
- {
- d->trans[oldalloc] = NULL;
- d->fails[oldalloc++] = NULL;
- }
- }
-}
-
-/* Return values of transit_state_singlebyte(), and
- transit_state_consume_1char. */
-typedef enum
-{
- TRANSIT_STATE_IN_PROGRESS, /* State transition has not finished. */
- TRANSIT_STATE_DONE, /* State transition has finished. */
- TRANSIT_STATE_END_BUFFER /* Reach the end of the buffer. */
-} status_transit_state;
-
-/* Consume a single byte and transit state from 's' to '*next_state'.
- This function is almost same as the state transition routin in dfaexec().
- But state transition is done just once, otherwise matching succeed or
- reach the end of the buffer. */
-static status_transit_state
-transit_state_singlebyte (struct dfa *d, int s, unsigned char const *p,
- int *next_state)
-{
- int *t;
- int works = s;
-
- status_transit_state rval = TRANSIT_STATE_IN_PROGRESS;
-
- while (rval == TRANSIT_STATE_IN_PROGRESS)
- {
- if ((t = d->trans[works]) != NULL)
- {
- works = t[*p];
- rval = TRANSIT_STATE_DONE;
- if (works < 0)
- works = 0;
- }
- else
- {
- if (works >= 0 && d->fails[works])
- {
- works = d->fails[works][*p];
- rval = TRANSIT_STATE_DONE;
- }
-
- else if (works >= 0)
- {
- build_state(works, d);
- }
- else
- {
- works = 0;
- }
- }
- }
- *next_state = works;
- return rval;
-}
-
-/* Check whether period can match or not in the current context. If it can,
- return the amount of the bytes with which period can match, otherwise
- return 0.
- `pos' is the position of the period. `index' is the index from the
- buf_begin, and it is the current position in the buffer. */
-static int
-match_anychar (struct dfa *d, int s, position pos, int index)
-{
- int newline = 0;
- int letter = 0;
- wchar_t wc;
- int mbclen;
-
- wc = inputwcs[index];
- mbclen = (mblen_buf[index] == 0)? 1 : mblen_buf[index];
-
- /* Check context. */
- if (wc == (wchar_t)eolbyte)
- {
- if (!(syntax_bits & RE_DOT_NEWLINE))
- return 0;
- newline = 1;
- }
- else if (wc == (wchar_t)'\0')
- {
- if (syntax_bits & RE_DOT_NOT_NULL)
- return 0;
- newline = 1;
- }
-
- if (iswalnum(wc) || wc == L'_')
- letter = 1;
-
- if (!SUCCEEDS_IN_CONTEXT(pos.constraint, d->states[s].newline,
- newline, d->states[s].letter, letter))
- return 0;
-
- return mbclen;
-}
-
-/* Check whether bracket expression can match or not in the current context.
- If it can, return the amount of the bytes with which expression can match,
- otherwise return 0.
- `pos' is the position of the bracket expression. `index' is the index
- from the buf_begin, and it is the current position in the buffer. */
-int
-match_mb_charset (struct dfa *d, int s, position pos, int index)
-{
- int i;
- int match; /* Flag which represent that matching succeed. */
- int match_len; /* Length of the character (or collating element)
- with which this operator match. */
- int op_len; /* Length of the operator. */
- char buffer[128];
- wchar_t wcbuf[6];
-
- /* Pointer to the structure to which we are currently reffering. */
- struct mb_char_classes *work_mbc;
-
- int newline = 0;
- int letter = 0;
- wchar_t wc; /* Current reffering character. */
-
- wc = inputwcs[index];
-
- /* Check context. */
- if (wc == (wchar_t)eolbyte)
- {
- if (!(syntax_bits & RE_DOT_NEWLINE))
- return 0;
- newline = 1;
- }
- else if (wc == (wchar_t)'\0')
- {
- if (syntax_bits & RE_DOT_NOT_NULL)
- return 0;
- newline = 1;
- }
- if (iswalnum(wc) || wc == L'_')
- letter = 1;
- if (!SUCCEEDS_IN_CONTEXT(pos.constraint, d->states[s].newline,
- newline, d->states[s].letter, letter))
- return 0;
-
- /* Assign the current reffering operator to work_mbc. */
- work_mbc = &(d->mbcsets[(d->multibyte_prop[pos.index]) >> 2]);
- match = !work_mbc->invert;
- match_len = (mblen_buf[index] == 0)? 1 : mblen_buf[index];
-
- /* match with a character class? */
- for (i = 0; i<work_mbc->nch_classes; i++)
- {
- if (iswctype((wint_t)wc, work_mbc->ch_classes[i]))
- goto charset_matched;
- }
-
- strncpy(buffer, buf_begin + index, match_len);
- buffer[match_len] = '\0';
-
- /* match with an equivalent class? */
- for (i = 0; i<work_mbc->nequivs; i++)
- {
- op_len = strlen(work_mbc->equivs[i]);
- strncpy(buffer, buf_begin + index, op_len);
- buffer[op_len] = '\0';
- if (strcoll(work_mbc->equivs[i], buffer) == 0)
- {
- match_len = op_len;
- goto charset_matched;
- }
- }
-
- /* match with a collating element? */
- for (i = 0; i<work_mbc->ncoll_elems; i++)
- {
- op_len = strlen(work_mbc->coll_elems[i]);
- strncpy(buffer, buf_begin + index, op_len);
- buffer[op_len] = '\0';
-
- if (strcoll(work_mbc->coll_elems[i], buffer) == 0)
- {
- match_len = op_len;
- goto charset_matched;
- }
- }
-
- wcbuf[0] = wc;
- wcbuf[1] = wcbuf[3] = wcbuf[5] = '\0';
-
- /* match with a range? */
- for (i = 0; i<work_mbc->nranges; i++)
- {
- wcbuf[2] = work_mbc->range_sts[i];
- wcbuf[4] = work_mbc->range_ends[i];
-
- if (wcscoll(wcbuf, wcbuf+2) >= 0 &&
- wcscoll(wcbuf+4, wcbuf) >= 0)
- goto charset_matched;
- }
-
- /* match with a character? */
- for (i = 0; i<work_mbc->nchars; i++)
- {
- if (wc == work_mbc->chars[i])
- goto charset_matched;
- }
-
- match = !match;
-
- charset_matched:
- return match ? match_len : 0;
-}
-
-/* Check each of `d->states[s].mbps.elem' can match or not. Then return the
- array which corresponds to `d->states[s].mbps.elem' and each element of
- the array contains the amount of the bytes with which the element can
- match.
- `index' is the index from the buf_begin, and it is the current position
- in the buffer.
- Caller MUST free the array which this function return. */
-static int*
-check_matching_with_multibyte_ops (struct dfa *d, int s, int index)
-{
- int i;
- int* rarray;
-
- MALLOC(rarray, int, d->states[s].mbps.nelem);
- for (i = 0; i < d->states[s].mbps.nelem; ++i)
- {
- position pos = d->states[s].mbps.elems[i];
- switch(d->tokens[pos.index])
- {
- case ANYCHAR:
- rarray[i] = match_anychar(d, s, pos, index);
- break;
- case MBCSET:
- rarray[i] = match_mb_charset(d, s, pos, index);
- break;
- default:
- break; /* can not happen. */
- }
- }
- return rarray;
-}
-
-/* Consume a single character and enumerate all of the positions which can
- be next position from the state `s'.
- `match_lens' is the input. It can be NULL, but it can also be the output
- of check_matching_with_multibyte_ops() for optimization.
- `mbclen' and `pps' are the output. `mbclen' is the length of the
- character consumed, and `pps' is the set this function enumerate. */
-static status_transit_state
-transit_state_consume_1char (struct dfa *d, int s, unsigned char const **pp,
- int *match_lens, int *mbclen, position_set *pps)
-{
- int i, j;
- int s1, s2;
- int* work_mbls;
- status_transit_state rs = TRANSIT_STATE_DONE;
-
- /* Calculate the length of the (single/multi byte) character
- to which p points. */
- *mbclen = (mblen_buf[*pp - buf_begin] == 0)? 1
- : mblen_buf[*pp - buf_begin];
-
- /* Calculate the state which can be reached from the state `s' by
- consuming `*mbclen' single bytes from the buffer. */
- s1 = s;
- for (i = 0; i < *mbclen; i++)
- {
- s2 = s1;
- rs = transit_state_singlebyte(d, s2, (*pp)++, &s1);
- }
- /* Copy the positions contained by `s1' to the set `pps'. */
- copy(&(d->states[s1].elems), pps);
-
- /* Check (inputed)match_lens, and initialize if it is NULL. */
- if (match_lens == NULL && d->states[s].mbps.nelem != 0)
- work_mbls = check_matching_with_multibyte_ops(d, s, *pp - buf_begin);
- else
- work_mbls = match_lens;
-
- /* Add all of the positions which can be reached from `s' by consuming
- a single character. */
- for (i = 0; i < d->states[s].mbps.nelem ; i++)
- {
- if (work_mbls[i] == *mbclen)
- for (j = 0; j < d->follows[d->states[s].mbps.elems[i].index].nelem;
- j++)
- insert(d->follows[d->states[s].mbps.elems[i].index].elems[j],
- pps);
- }
-
- if (match_lens == NULL && work_mbls != NULL)
- free(work_mbls);
- return rs;
-}
-
-/* Transit state from s, then return new state and update the pointer of the
- buffer. This function is for some operator which can match with a multi-
- byte character or a collating element(which may be multi characters). */
-static int
-transit_state (struct dfa *d, int s, unsigned char const **pp)
-{
- int s1;
- int mbclen; /* The length of current input multibyte character. */
- int maxlen = 0;
- int i, j;
- int *match_lens = NULL;
- int nelem = d->states[s].mbps.nelem; /* Just a alias. */
- position_set follows;
- unsigned char const *p1 = *pp;
- status_transit_state rs;
- wchar_t wc;
-
- if (nelem > 0)
- /* This state has (a) multibyte operator(s).
- We check whether each of them can match or not. */
- {
- /* Note: caller must free the return value of this function. */
- match_lens = check_matching_with_multibyte_ops(d, s, *pp - buf_begin);
-
- for (i = 0; i < nelem; i++)
- /* Search the operator which match the longest string,
- in this state. */
- {
- if (match_lens[i] > maxlen)
- maxlen = match_lens[i];
- }
- }
-
- if (nelem == 0 || maxlen == 0)
- /* This state has no multibyte operator which can match.
- We need to check only one singlebyte character. */
- {
- status_transit_state rs;
- rs = transit_state_singlebyte(d, s, *pp, &s1);
-
- /* We must update the pointer if state transition succeeded. */
- if (rs == TRANSIT_STATE_DONE)
- ++*pp;
-
- if (match_lens != NULL)
- free(match_lens);
- return s1;
- }
-
- /* This state has some operators which can match a multibyte character. */
- follows.nelem = 0;
- MALLOC(follows.elems, position, d->nleaves);
-
- /* `maxlen' may be longer than the length of a character, because it may
- not be a character but a (multi character) collating element.
- We enumerate all of the positions which `s' can reach by consuming
- `maxlen' bytes. */
- rs = transit_state_consume_1char(d, s, pp, match_lens, &mbclen, &follows);
-
- wc = inputwcs[*pp - mbclen - buf_begin];
- s1 = state_index(d, &follows, wc == L'\n', iswalnum(wc));
- realloc_trans_if_necessary(d, s1);
-
- while (*pp - p1 < maxlen)
- {
- follows.nelem = 0;
- rs = transit_state_consume_1char(d, s1, pp, NULL, &mbclen, &follows);
-
- for (i = 0; i < nelem ; i++)
- {
- if (match_lens[i] == *pp - p1)
- for (j = 0;
- j < d->follows[d->states[s1].mbps.elems[i].index].nelem; j++)
- insert(d->follows[d->states[s1].mbps.elems[i].index].elems[j],
- &follows);
- }
-
- wc = inputwcs[*pp - mbclen - buf_begin];
- s1 = state_index(d, &follows, wc == L'\n', iswalnum(wc));
- realloc_trans_if_necessary(d, s1);
- }
- free(match_lens);
- free(follows.elems);
- return s1;
-}
-
-#endif
-
-/* Search through a buffer looking for a match to the given struct dfa.
- Find the first occurrence of a string matching the regexp in the buffer,
- and the shortest possible version thereof. Return a pointer to the first
- character after the match, or NULL if none is found. Begin points to
- the beginning of the buffer, and end points to the first character after
- its end. We store a newline in *end to act as a sentinel, so end had
- better point somewhere valid. Newline is a flag indicating whether to
- allow newlines to be in the matching string. If count is non-
- NULL it points to a place we're supposed to increment every time we
- see a newline. Finally, if backref is non-NULL it points to a place
- where we're supposed to store a 1 if backreferencing happened and the
- match needs to be verified by a backtracking matcher. Otherwise
- we store a 0 in *backref. */
-char *
-dfaexec (struct dfa *d, char *begin, char *end,
- int newline, int *count, int *backref)
-{
- register int s, s1, tmp; /* Current state. */
- register unsigned char *p; /* Current input character. */
- register int **trans, *t; /* Copy of d->trans so it can be optimized
- into a register. */
- register unsigned char eol = eolbyte; /* Likewise for eolbyte. */
- static int sbit[NOTCHAR]; /* Table for anding with d->success. */
- static int sbit_init;
-
- if (! sbit_init)
- {
- int i;
-
- sbit_init = 1;
- for (i = 0; i < NOTCHAR; ++i)
- sbit[i] = (IS_WORD_CONSTITUENT(i)) ? 2 : 1;
- sbit[eol] = 4;
- }
-
- if (! d->tralloc)
- build_state_zero(d);
-
- s = s1 = 0;
- p = (unsigned char *) begin;
- trans = d->trans;
- *end = eol;
-
-#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
- {
- int remain_bytes, i;
- buf_begin = begin;
- buf_end = end;
-
- /* initialize mblen_buf, and inputwcs. */
- MALLOC(mblen_buf, unsigned char, end - begin + 2);
- MALLOC(inputwcs, wchar_t, end - begin + 2);
- memset(&mbs, 0, sizeof(mbstate_t));
- remain_bytes = 0;
- for (i = 0; i < end - begin + 1; i++)
- {
- if (remain_bytes == 0)
- {
- remain_bytes
- = mbrtowc(inputwcs + i, begin + i, end - begin - i + 1, &mbs);
- if (remain_bytes <= 1)
- {
- remain_bytes = 0;
- inputwcs[i] = (wchar_t)begin[i];
- mblen_buf[i] = 0;
- }
- else
- {
- mblen_buf[i] = remain_bytes;
- remain_bytes--;
- }
- }
- else
- {
- mblen_buf[i] = remain_bytes;
- inputwcs[i] = 0;
- remain_bytes--;
- }
- }
- mblen_buf[i] = 0;
- inputwcs[i] = 0; /* sentinel */
- }
-#endif /* MBS_SUPPORT */
-
- for (;;)
- {
-#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
- while ((t = trans[s]))
- {
- if ((char *) p > end)
- break;
- s1 = s;
- if (d->states[s].mbps.nelem != 0)
- {
- /* Can match with a multibyte character( and multi character
- collating element). */
- unsigned char const *nextp;
-
- SKIP_REMAINS_MB_IF_INITIAL_STATE(s, p);
-
- nextp = p;
- s = transit_state(d, s, &nextp);
- p = (unsigned char *)nextp;
-
- /* Trans table might be updated. */
- trans = d->trans;
- }
- else
- {
- SKIP_REMAINS_MB_IF_INITIAL_STATE(s, p);
- s = t[*p++];
- }
- }
- else
-#endif /* MBS_SUPPORT */
- while ((t = trans[s]) != 0) { /* hand-optimized loop */
- s1 = t[*p++];
- if ((t = trans[s1]) == 0) {
- tmp = s ; s = s1 ; s1 = tmp ; /* swap */
- break;
- }
- s = t[*p++];
- }
-
- if (s >= 0 && p <= (unsigned char *) end && d->fails[s])
- {
- if (d->success[s] & sbit[*p])
- {
- if (backref)
- *backref = (d->states[s].backref != 0);
-#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
- {
- free(mblen_buf);
- free(inputwcs);
- }
-#endif /* MBS_SUPPORT */
- return (char *) p;
- }
-
- s1 = s;
-#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
- {
- unsigned char const *nextp;
- nextp = p;
- s = transit_state(d, s, &nextp);
- p = (unsigned char *)nextp;
-
- /* Trans table might be updated. */
- trans = d->trans;
- }
- else
-#endif /* MBS_SUPPORT */
- s = d->fails[s][*p++];
- continue;
- }
-
- /* If the previous character was a newline, count it. */
- if (count && (char *) p <= end && p[-1] == eol)
- ++*count;
-
- /* Check if we've run off the end of the buffer. */
- if ((char *) p > end)
- {
-#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
- {
- free(mblen_buf);
- free(inputwcs);
- }
-#endif /* MBS_SUPPORT */
- return NULL;
- }
-
- if (s >= 0)
- {
- build_state(s, d);
- trans = d->trans;
- continue;
- }
-
- if (p[-1] == eol && newline)
- {
- s = d->newlines[s1];
- continue;
- }
-
- s = 0;
- }
-}
-
-/* Initialize the components of a dfa that the other routines don't
- initialize for themselves. */
-void
-dfainit (struct dfa *d)
-{
- d->calloc = 1;
- MALLOC(d->charclasses, charclass, d->calloc);
- d->cindex = 0;
-
- d->talloc = 1;
- MALLOC(d->tokens, token, d->talloc);
- d->tindex = d->depth = d->nleaves = d->nregexps = 0;
-#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
- {
- d->nmultibyte_prop = 1;
- MALLOC(d->multibyte_prop, int, d->nmultibyte_prop);
- d->nmbcsets = 0;
- d->mbcsets_alloc = 1;
- MALLOC(d->mbcsets, struct mb_char_classes, d->mbcsets_alloc);
- }
-#endif
-
- d->searchflag = 0;
- d->tralloc = 0;
-
- d->musts = 0;
- d->realtrans = 0;
- d->fails = 0;
- d->newlines = 0;
- d->success = 0;
-
-}
-
-/* Parse and analyze a single string of the given length. */
-void
-dfacomp (char *s, size_t len, struct dfa *d, int searchflag)
-{
- if (case_fold) /* dummy folding in service of dfamust() */
- {
- char *lcopy;
- int i;
-
- lcopy = malloc(len);
- if (!lcopy)
- dfaerror(_("out of memory"));
-
- /* This is a kludge. */
- case_fold = 0;
- for (i = 0; i < len; ++i)
- if (ISUPPER ((unsigned char) s[i]))
- lcopy[i] = tolower ((unsigned char) s[i]);
- else
- lcopy[i] = s[i];
-
- dfainit(d);
- dfaparse(lcopy, len, d);
- free(lcopy);
- dfamust(d);
- d->cindex = d->tindex = d->depth = d->nleaves = d->nregexps = 0;
- case_fold = 1;
- dfaparse(s, len, d);
- dfaanalyze(d, searchflag);
- }
- else
- {
- dfainit(d);
- dfaparse(s, len, d);
- dfamust(d);
- dfaanalyze(d, searchflag);
- }
-}
-
-/* Free the storage held by the components of a dfa. */
-void
-dfafree (struct dfa *d)
-{
- int i;
- struct dfamust *dm, *ndm;
-
- free((ptr_t) d->charclasses);
- free((ptr_t) d->tokens);
-#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1)
- {
- free((ptr_t) d->multibyte_prop);
- for (i = 0; i < d->nmbcsets; ++i)
- {
- int j;
- struct mb_char_classes *p = &(d->mbcsets[i]);
- if (p->chars != NULL)
- free(p->chars);
- if (p->ch_classes != NULL)
- free(p->ch_classes);
- if (p->range_sts != NULL)
- free(p->range_sts);
- if (p->range_ends != NULL)
- free(p->range_ends);
-
- for (j = 0; j < p->nequivs; ++j)
- free(p->equivs[j]);
- if (p->equivs != NULL)
- free(p->equivs);
-
- for (j = 0; j < p->ncoll_elems; ++j)
- free(p->coll_elems[j]);
- if (p->coll_elems != NULL)
- free(p->coll_elems);
- }
- free((ptr_t) d->mbcsets);
- }
-#endif /* MBS_SUPPORT */
-
- for (i = 0; i < d->sindex; ++i)
- free((ptr_t) d->states[i].elems.elems);
- free((ptr_t) d->states);
- for (i = 0; i < d->tindex; ++i)
- if (d->follows[i].elems)
- free((ptr_t) d->follows[i].elems);
- free((ptr_t) d->follows);
- for (i = 0; i < d->tralloc; ++i)
- if (d->trans[i])
- free((ptr_t) d->trans[i]);
- else if (d->fails[i])
- free((ptr_t) d->fails[i]);
- if (d->realtrans) free((ptr_t) d->realtrans);
- if (d->fails) free((ptr_t) d->fails);
- if (d->newlines) free((ptr_t) d->newlines);
- if (d->success) free((ptr_t) d->success);
- for (dm = d->musts; dm; dm = ndm)
- {
- ndm = dm->next;
- free(dm->must);
- free((ptr_t) dm);
- }
-}
-
-/* Having found the postfix representation of the regular expression,
- try to find a long sequence of characters that must appear in any line
- containing the r.e.
- Finding a "longest" sequence is beyond the scope here;
- we take an easy way out and hope for the best.
- (Take "(ab|a)b"--please.)
-
- We do a bottom-up calculation of sequences of characters that must appear
- in matches of r.e.'s represented by trees rooted at the nodes of the postfix
- representation:
- sequences that must appear at the left of the match ("left")
- sequences that must appear at the right of the match ("right")
- lists of sequences that must appear somewhere in the match ("in")
- sequences that must constitute the match ("is")
-
- When we get to the root of the tree, we use one of the longest of its
- calculated "in" sequences as our answer. The sequence we find is returned in
- d->must (where "d" is the single argument passed to "dfamust");
- the length of the sequence is returned in d->mustn.
-
- The sequences calculated for the various types of node (in pseudo ANSI c)
- are shown below. "p" is the operand of unary operators (and the left-hand
- operand of binary operators); "q" is the right-hand operand of binary
- operators.
-
- "ZERO" means "a zero-length sequence" below.
-
- Type left right is in
- ---- ---- ----- -- --
- char c # c # c # c # c
-
- ANYCHAR ZERO ZERO ZERO ZERO
-
- MBCSET ZERO ZERO ZERO ZERO
-
- CSET ZERO ZERO ZERO ZERO
-
- STAR ZERO ZERO ZERO ZERO
-
- QMARK ZERO ZERO ZERO ZERO
-
- PLUS p->left p->right ZERO p->in
-
- CAT (p->is==ZERO)? (q->is==ZERO)? (p->is!=ZERO && p->in plus
- p->left : q->right : q->is!=ZERO) ? q->in plus
- p->is##q->left p->right##q->is p->is##q->is : p->right##q->left
- ZERO
-
- OR longest common longest common (do p->is and substrings common to
- leading trailing q->is have same p->in and q->in
- (sub)sequence (sub)sequence length and
- of p->left of p->right content) ?
- and q->left and q->right p->is : NULL
-
- If there's anything else we recognize in the tree, all four sequences get set
- to zero-length sequences. If there's something we don't recognize in the tree,
- we just return a zero-length sequence.
-
- Break ties in favor of infrequent letters (choosing 'zzz' in preference to
- 'aaa')?
-
- And. . .is it here or someplace that we might ponder "optimizations" such as
- egrep 'psi|epsilon' -> egrep 'psi'
- egrep 'pepsi|epsilon' -> egrep 'epsi'
- (Yes, we now find "epsi" as a "string
- that must occur", but we might also
- simplify the *entire* r.e. being sought)
- grep '[c]' -> grep 'c'
- grep '(ab|a)b' -> grep 'ab'
- grep 'ab*' -> grep 'a'
- grep 'a*b' -> grep 'b'
-
- There are several issues:
-
- Is optimization easy (enough)?
-
- Does optimization actually accomplish anything,
- or is the automaton you get from "psi|epsilon" (for example)
- the same as the one you get from "psi" (for example)?
-
- Are optimizable r.e.'s likely to be used in real-life situations
- (something like 'ab*' is probably unlikely; something like is
- 'psi|epsilon' is likelier)? */
-
-static char *
-icatalloc (char *old, char *new)
-{
- char *result;
- size_t oldsize, newsize;
-
- newsize = (new == NULL) ? 0 : strlen(new);
- if (old == NULL)
- oldsize = 0;
- else if (newsize == 0)
- return old;
- else oldsize = strlen(old);
- if (old == NULL)
- result = (char *) malloc(newsize + 1);
- else
- result = (char *) realloc((void *) old, oldsize + newsize + 1);
- if (result != NULL && new != NULL)
- (void) strcpy(result + oldsize, new);
- return result;
-}
-
-static char *
-icpyalloc (char *string)
-{
- return icatalloc((char *) NULL, string);
-}
-
-static char *
-istrstr (char *lookin, char *lookfor)
-{
- char *cp;
- size_t len;
-
- len = strlen(lookfor);
- for (cp = lookin; *cp != '\0'; ++cp)
- if (strncmp(cp, lookfor, len) == 0)
- return cp;
- return NULL;
-}
-
-static void
-ifree (char *cp)
-{
- if (cp != NULL)
- free(cp);
-}
-
-static void
-freelist (char **cpp)
-{
- int i;
-
- if (cpp == NULL)
- return;
- for (i = 0; cpp[i] != NULL; ++i)
- {
- free(cpp[i]);
- cpp[i] = NULL;
- }
-}
-
-static char **
-enlist (char **cpp, char *new, size_t len)
-{
- int i, j;
-
- if (cpp == NULL)
- return NULL;
- if ((new = icpyalloc(new)) == NULL)
- {
- freelist(cpp);
- return NULL;
- }
- new[len] = '\0';
- /* Is there already something in the list that's new (or longer)? */
- for (i = 0; cpp[i] != NULL; ++i)
- if (istrstr(cpp[i], new) != NULL)
- {
- free(new);
- return cpp;
- }
- /* Eliminate any obsoleted strings. */
- j = 0;
- while (cpp[j] != NULL)
- if (istrstr(new, cpp[j]) == NULL)
- ++j;
- else
- {
- free(cpp[j]);
- if (--i == j)
- break;
- cpp[j] = cpp[i];
- cpp[i] = NULL;
- }
- /* Add the new string. */
- cpp = (char **) realloc((char *) cpp, (i + 2) * sizeof *cpp);
- if (cpp == NULL)
- return NULL;
- cpp[i] = new;
- cpp[i + 1] = NULL;
- return cpp;
-}
-
-/* Given pointers to two strings, return a pointer to an allocated
- list of their distinct common substrings. Return NULL if something
- seems wild. */
-static char **
-comsubs (char *left, char *right)
-{
- char **cpp;
- char *lcp;
- char *rcp;
- size_t i, len;
-
- if (left == NULL || right == NULL)
- return NULL;
- cpp = (char **) malloc(sizeof *cpp);
- if (cpp == NULL)
- return NULL;
- cpp[0] = NULL;
- for (lcp = left; *lcp != '\0'; ++lcp)
- {
- len = 0;
- rcp = index(right, *lcp);
- while (rcp != NULL)
- {
- for (i = 1; lcp[i] != '\0' && lcp[i] == rcp[i]; ++i)
- continue;
- if (i > len)
- len = i;
- rcp = index(rcp + 1, *lcp);
- }
- if (len == 0)
- continue;
- if ((cpp = enlist(cpp, lcp, len)) == NULL)
- break;
- }
- return cpp;
-}
-
-static char **
-addlists (char **old, char **new)
-{
- int i;
-
- if (old == NULL || new == NULL)
- return NULL;
- for (i = 0; new[i] != NULL; ++i)
- {
- old = enlist(old, new[i], strlen(new[i]));
- if (old == NULL)
- break;
- }
- return old;
-}
-
-/* Given two lists of substrings, return a new list giving substrings
- common to both. */
-static char **
-inboth (char **left, char **right)
-{
- char **both;
- char **temp;
- int lnum, rnum;
-
- if (left == NULL || right == NULL)
- return NULL;
- both = (char **) malloc(sizeof *both);
- if (both == NULL)
- return NULL;
- both[0] = NULL;
- for (lnum = 0; left[lnum] != NULL; ++lnum)
- {
- for (rnum = 0; right[rnum] != NULL; ++rnum)
- {
- temp = comsubs(left[lnum], right[rnum]);
- if (temp == NULL)
- {
- freelist(both);
- return NULL;
- }
- both = addlists(both, temp);
- freelist(temp);
- free(temp);
- if (both == NULL)
- return NULL;
- }
- }
- return both;
-}
-
-typedef struct
-{
- char **in;
- char *left;
- char *right;
- char *is;
-} must;
-
-static void
-resetmust (must *mp)
-{
- mp->left[0] = mp->right[0] = mp->is[0] = '\0';
- freelist(mp->in);
-}
-
-static void
-dfamust (struct dfa *dfa)
-{
- must *musts;
- must *mp;
- char *result;
- int ri;
- int i;
- int exact;
- token t;
- static must must0;
- struct dfamust *dm;
- static char empty_string[] = "";
-
- result = empty_string;
- exact = 0;
- musts = (must *) malloc((dfa->tindex + 1) * sizeof *musts);
- if (musts == NULL)
- return;
- mp = musts;
- for (i = 0; i <= dfa->tindex; ++i)
- mp[i] = must0;
- for (i = 0; i <= dfa->tindex; ++i)
- {
- mp[i].in = (char **) malloc(sizeof *mp[i].in);
- mp[i].left = malloc(2);
- mp[i].right = malloc(2);
- mp[i].is = malloc(2);
- if (mp[i].in == NULL || mp[i].left == NULL ||
- mp[i].right == NULL || mp[i].is == NULL)
- goto done;
- mp[i].left[0] = mp[i].right[0] = mp[i].is[0] = '\0';
- mp[i].in[0] = NULL;
- }
-#ifdef DEBUG
- fprintf(stderr, "dfamust:\n");
- for (i = 0; i < dfa->tindex; ++i)
- {
- fprintf(stderr, " %d:", i);
- prtok(dfa->tokens[i]);
- }
- putc('\n', stderr);
-#endif
- for (ri = 0; ri < dfa->tindex; ++ri)
- {
- switch (t = dfa->tokens[ri])
- {
- case LPAREN:
- case RPAREN:
- goto done; /* "cannot happen" */
- case EMPTY:
- case BEGLINE:
- case ENDLINE:
- case BEGWORD:
- case ENDWORD:
- case LIMWORD:
- case NOTLIMWORD:
- case BACKREF:
- resetmust(mp);
- break;
- case STAR:
- case QMARK:
- if (mp <= musts)
- goto done; /* "cannot happen" */
- --mp;
- resetmust(mp);
- break;
- case OR:
- case ORTOP:
- if (mp < &musts[2])
- goto done; /* "cannot happen" */
- {
- char **new;
- must *lmp;
- must *rmp;
- int j, ln, rn, n;
-
- rmp = --mp;
- lmp = --mp;
- /* Guaranteed to be. Unlikely, but. . . */
- if (strcmp(lmp->is, rmp->is) != 0)
- lmp->is[0] = '\0';
- /* Left side--easy */
- i = 0;
- while (lmp->left[i] != '\0' && lmp->left[i] == rmp->left[i])
- ++i;
- lmp->left[i] = '\0';
- /* Right side */
- ln = strlen(lmp->right);
- rn = strlen(rmp->right);
- n = ln;
- if (n > rn)
- n = rn;
- for (i = 0; i < n; ++i)
- if (lmp->right[ln - i - 1] != rmp->right[rn - i - 1])
- break;
- for (j = 0; j < i; ++j)
- lmp->right[j] = lmp->right[(ln - i) + j];
- lmp->right[j] = '\0';
- new = inboth(lmp->in, rmp->in);
- if (new == NULL)
- goto done;
- freelist(lmp->in);
- free((char *) lmp->in);
- lmp->in = new;
- }
- break;
- case PLUS:
- if (mp <= musts)
- goto done; /* "cannot happen" */
- --mp;
- mp->is[0] = '\0';
- break;
- case END:
- if (mp != &musts[1])
- goto done; /* "cannot happen" */
- for (i = 0; musts[0].in[i] != NULL; ++i)
- if (strlen(musts[0].in[i]) > strlen(result))
- result = musts[0].in[i];
- if (strcmp(result, musts[0].is) == 0)
- exact = 1;
- goto done;
- case CAT:
- if (mp < &musts[2])
- goto done; /* "cannot happen" */
- {
- must *lmp;
- must *rmp;
-
- rmp = --mp;
- lmp = --mp;
- /* In. Everything in left, plus everything in
- right, plus catenation of
- left's right and right's left. */
- lmp->in = addlists(lmp->in, rmp->in);
- if (lmp->in == NULL)
- goto done;
- if (lmp->right[0] != '\0' &&
- rmp->left[0] != '\0')
- {
- char *tp;
-
- tp = icpyalloc(lmp->right);
- if (tp == NULL)
- goto done;
- tp = icatalloc(tp, rmp->left);
- if (tp == NULL)
- goto done;
- lmp->in = enlist(lmp->in, tp,
- strlen(tp));
- free(tp);
- if (lmp->in == NULL)
- goto done;
- }
- /* Left-hand */
- if (lmp->is[0] != '\0')
- {
- lmp->left = icatalloc(lmp->left,
- rmp->left);
- if (lmp->left == NULL)
- goto done;
- }
- /* Right-hand */
- if (rmp->is[0] == '\0')
- lmp->right[0] = '\0';
- lmp->right = icatalloc(lmp->right, rmp->right);
- if (lmp->right == NULL)
- goto done;
- /* Guaranteed to be */
- if (lmp->is[0] != '\0' && rmp->is[0] != '\0')
- {
- lmp->is = icatalloc(lmp->is, rmp->is);
- if (lmp->is == NULL)
- goto done;
- }
- else
- lmp->is[0] = '\0';
- }
- break;
- default:
- if (t < END)
- {
- /* "cannot happen" */
- goto done;
- }
- else if (t == '\0')
- {
- /* not on *my* shift */
- goto done;
- }
- else if (t >= CSET
-#ifdef MBS_SUPPORT
- || t == ANYCHAR
- || t == MBCSET
-#endif /* MBS_SUPPORT */
- )
- {
- /* easy enough */
- resetmust(mp);
- }
- else
- {
- /* plain character */
- resetmust(mp);
- mp->is[0] = mp->left[0] = mp->right[0] = t;
- mp->is[1] = mp->left[1] = mp->right[1] = '\0';
- mp->in = enlist(mp->in, mp->is, (size_t)1);
- if (mp->in == NULL)
- goto done;
- }
- break;
- }
-#ifdef DEBUG
- fprintf(stderr, " node: %d:", ri);
- prtok(dfa->tokens[ri]);
- fprintf(stderr, "\n in:");
- for (i = 0; mp->in[i]; ++i)
- fprintf(stderr, " \"%s\"", mp->in[i]);
- fprintf(stderr, "\n is: \"%s\"\n", mp->is);
- fprintf(stderr, " left: \"%s\"\n", mp->left);
- fprintf(stderr, " right: \"%s\"\n", mp->right);
-#endif
- ++mp;
- }
- done:
- if (strlen(result))
- {
- dm = (struct dfamust *) malloc(sizeof (struct dfamust));
- dm->exact = exact;
- dm->must = malloc(strlen(result) + 1);
- strcpy(dm->must, result);
- dm->next = dfa->musts;
- dfa->musts = dm;
- }
- mp = musts;
- for (i = 0; i <= dfa->tindex; ++i)
- {
- freelist(mp[i].in);
- ifree((char *) mp[i].in);
- ifree(mp[i].left);
- ifree(mp[i].right);
- ifree(mp[i].is);
- }
- free((char *) mp);
-}
diff --git a/dfa.h b/dfa.h
deleted file mode 100644
index 154684bb..00000000
--- a/dfa.h
+++ /dev/null
@@ -1,433 +0,0 @@
-/* dfa.h - declarations for GNU deterministic regexp compiler
- Copyright (C) 1988, 1998, 2002 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */
-
-/* Written June, 1988 by Mike Haertel */
-
-/* FIXME:
- 2. We should not export so much of the DFA internals.
- In addition to clobbering modularity, we eat up valuable
- name space. */
-
-# undef PARAMS
-#if __STDC__
-# ifndef _PTR_T
-# define _PTR_T
- typedef void * ptr_t;
-# endif
-# define PARAMS(x) x
-#else
-# ifndef _PTR_T
-# define _PTR_T
- typedef char * ptr_t;
-# endif
-# define PARAMS(x) ()
-#endif
-
-/* Number of bits in an unsigned char. */
-#ifndef CHARBITS
-#define CHARBITS 8
-#endif
-
-/* First integer value that is greater than any character code. */
-#define NOTCHAR (1 << CHARBITS)
-
-/* INTBITS need not be exact, just a lower bound. */
-#ifndef INTBITS
-#define INTBITS (CHARBITS * sizeof (int))
-#endif
-
-/* Number of ints required to hold a bit for every character. */
-#define CHARCLASS_INTS ((NOTCHAR + INTBITS - 1) / INTBITS)
-
-/* Sets of unsigned characters are stored as bit vectors in arrays of ints. */
-typedef int charclass[CHARCLASS_INTS];
-
-/* The regexp is parsed into an array of tokens in postfix form. Some tokens
- are operators and others are terminal symbols. Most (but not all) of these
- codes are returned by the lexical analyzer. */
-
-typedef enum
-{
- END = -1, /* END is a terminal symbol that matches the
- end of input; any value of END or less in
- the parse tree is such a symbol. Accepting
- states of the DFA are those that would have
- a transition on END. */
-
- /* Ordinary character values are terminal symbols that match themselves. */
-
- EMPTY = NOTCHAR, /* EMPTY is a terminal symbol that matches
- the empty string. */
-
- BACKREF, /* BACKREF is generated by \<digit>; it
- it not completely handled. If the scanner
- detects a transition on backref, it returns
- a kind of "semi-success" indicating that
- the match will have to be verified with
- a backtracking matcher. */
-
- BEGLINE, /* BEGLINE is a terminal symbol that matches
- the empty string if it is at the beginning
- of a line. */
-
- ENDLINE, /* ENDLINE is a terminal symbol that matches
- the empty string if it is at the end of
- a line. */
-
- BEGWORD, /* BEGWORD is a terminal symbol that matches
- the empty string if it is at the beginning
- of a word. */
-
- ENDWORD, /* ENDWORD is a terminal symbol that matches
- the empty string if it is at the end of
- a word. */
-
- LIMWORD, /* LIMWORD is a terminal symbol that matches
- the empty string if it is at the beginning
- or the end of a word. */
-
- NOTLIMWORD, /* NOTLIMWORD is a terminal symbol that
- matches the empty string if it is not at
- the beginning or end of a word. */
-
- QMARK, /* QMARK is an operator of one argument that
- matches zero or one occurences of its
- argument. */
-
- STAR, /* STAR is an operator of one argument that
- matches the Kleene closure (zero or more
- occurrences) of its argument. */
-
- PLUS, /* PLUS is an operator of one argument that
- matches the positive closure (one or more
- occurrences) of its argument. */
-
- REPMN, /* REPMN is a lexical token corresponding
- to the {m,n} construct. REPMN never
- appears in the compiled token vector. */
-
- CAT, /* CAT is an operator of two arguments that
- matches the concatenation of its
- arguments. CAT is never returned by the
- lexical analyzer. */
-
- OR, /* OR is an operator of two arguments that
- matches either of its arguments. */
-
- ORTOP, /* OR at the toplevel in the parse tree.
- This is used for a boyer-moore heuristic. */
-
- LPAREN, /* LPAREN never appears in the parse tree,
- it is only a lexeme. */
-
- RPAREN, /* RPAREN never appears in the parse tree. */
-
-#ifdef MBS_SUPPORT
- ANYCHAR, /* ANYCHAR is a terminal symbol that matches
- any multibyte(or singlebyte) characters.
- It is used only if MB_CUR_MAX > 1. */
-
- MBCSET, /* MBCSET is similar to CSET, but for
- multibyte characters. */
-#endif /* MBS_SUPPORT */
-
- CSET /* CSET and (and any value greater) is a
- terminal symbol that matches any of a
- class of characters. */
-} token;
-
-/* Sets are stored in an array in the compiled dfa; the index of the
- array corresponding to a given set token is given by SET_INDEX(t). */
-#define SET_INDEX(t) ((t) - CSET)
-
-/* Sometimes characters can only be matched depending on the surrounding
- context. Such context decisions depend on what the previous character
- was, and the value of the current (lookahead) character. Context
- dependent constraints are encoded as 8 bit integers. Each bit that
- is set indicates that the constraint succeeds in the corresponding
- context.
-
- bit 7 - previous and current are newlines
- bit 6 - previous was newline, current isn't
- bit 5 - previous wasn't newline, current is
- bit 4 - neither previous nor current is a newline
- bit 3 - previous and current are word-constituents
- bit 2 - previous was word-constituent, current isn't
- bit 1 - previous wasn't word-constituent, current is
- bit 0 - neither previous nor current is word-constituent
-
- Word-constituent characters are those that satisfy isalnum().
-
- The macro SUCCEEDS_IN_CONTEXT determines whether a a given constraint
- succeeds in a particular context. Prevn is true if the previous character
- was a newline, currn is true if the lookahead character is a newline.
- Prevl and currl similarly depend upon whether the previous and current
- characters are word-constituent letters. */
-#define MATCHES_NEWLINE_CONTEXT(constraint, prevn, currn) \
- ((constraint) & 1 << (((prevn) ? 2 : 0) + ((currn) ? 1 : 0) + 4))
-#define MATCHES_LETTER_CONTEXT(constraint, prevl, currl) \
- ((constraint) & 1 << (((prevl) ? 2 : 0) + ((currl) ? 1 : 0)))
-#define SUCCEEDS_IN_CONTEXT(constraint, prevn, currn, prevl, currl) \
- (MATCHES_NEWLINE_CONTEXT(constraint, prevn, currn) \
- && MATCHES_LETTER_CONTEXT(constraint, prevl, currl))
-
-/* The following macros give information about what a constraint depends on. */
-#define PREV_NEWLINE_DEPENDENT(constraint) \
- (((constraint) & 0xc0) >> 2 != ((constraint) & 0x30))
-#define PREV_LETTER_DEPENDENT(constraint) \
- (((constraint) & 0x0c) >> 2 != ((constraint) & 0x03))
-
-/* Tokens that match the empty string subject to some constraint actually
- work by applying that constraint to determine what may follow them,
- taking into account what has gone before. The following values are
- the constraints corresponding to the special tokens previously defined. */
-#define NO_CONSTRAINT 0xff
-#define BEGLINE_CONSTRAINT 0xcf
-#define ENDLINE_CONSTRAINT 0xaf
-#define BEGWORD_CONSTRAINT 0xf2
-#define ENDWORD_CONSTRAINT 0xf4
-#define LIMWORD_CONSTRAINT 0xf6
-#define NOTLIMWORD_CONSTRAINT 0xf9
-
-/* States of the recognizer correspond to sets of positions in the parse
- tree, together with the constraints under which they may be matched.
- So a position is encoded as an index into the parse tree together with
- a constraint. */
-typedef struct
-{
- unsigned index; /* Index into the parse array. */
- unsigned constraint; /* Constraint for matching this position. */
-} position;
-
-/* Sets of positions are stored as arrays. */
-typedef struct
-{
- position *elems; /* Elements of this position set. */
- int nelem; /* Number of elements in this set. */
-} position_set;
-
-/* A state of the dfa consists of a set of positions, some flags,
- and the token value of the lowest-numbered position of the state that
- contains an END token. */
-typedef struct
-{
- int hash; /* Hash of the positions of this state. */
- position_set elems; /* Positions this state could match. */
- char newline; /* True if previous state matched newline. */
- char letter; /* True if previous state matched a letter. */
- char backref; /* True if this state matches a \<digit>. */
- unsigned char constraint; /* Constraint for this state to accept. */
- int first_end; /* Token value of the first END in elems. */
-#ifdef MBS_SUPPORT
- position_set mbps; /* Positions which can match multibyte
- characters. e.g. period.
- These staff are used only if
- MB_CUR_MAX > 1. */
-#endif
-} dfa_state;
-
-/* Element of a list of strings, at least one of which is known to
- appear in any R.E. matching the DFA. */
-struct dfamust
-{
- int exact;
- char *must;
- struct dfamust *next;
-};
-
-#ifdef MBS_SUPPORT
-/* A bracket operator.
- e.g. [a-c], [[:alpha:]], etc. */
-struct mb_char_classes
-{
- int invert;
- wchar_t *chars; /* Normal characters. */
- int nchars;
- wctype_t *ch_classes; /* Character classes. */
- int nch_classes;
- wchar_t *range_sts; /* Range characters (start of the range). */
- wchar_t *range_ends; /* Range characters (end of the range). */
- int nranges;
- char **equivs; /* Equivalent classes. */
- int nequivs;
- char **coll_elems;
- int ncoll_elems; /* Collating elements. */
-};
-#endif
-
-/* A compiled regular expression. */
-struct dfa
-{
- /* Stuff built by the scanner. */
- charclass *charclasses; /* Array of character sets for CSET tokens. */
- int cindex; /* Index for adding new charclasses. */
- int calloc; /* Number of charclasses currently allocated. */
-
- /* Stuff built by the parser. */
- token *tokens; /* Postfix parse array. */
- int tindex; /* Index for adding new tokens. */
- int talloc; /* Number of tokens currently allocated. */
- int depth; /* Depth required of an evaluation stack
- used for depth-first traversal of the
- parse tree. */
- int nleaves; /* Number of leaves on the parse tree. */
- int nregexps; /* Count of parallel regexps being built
- with dfaparse(). */
-#ifdef MBS_SUPPORT
- /* These stuff are used only if MB_CUR_MAX > 1 or multibyte environments. */
- int nmultibyte_prop;
- int *multibyte_prop;
- /* The value of multibyte_prop[i] is defined by following rule.
- if tokens[i] < NOTCHAR
- bit 1 : tokens[i] is a singlebyte character, or the last-byte of
- a multibyte character.
- bit 0 : tokens[i] is a singlebyte character, or the 1st-byte of
- a multibyte character.
- if tokens[i] = MBCSET
- ("the index of mbcsets correspnd to this operator" << 2) + 3
-
- e.g.
- tokens
- = 'single_byte_a', 'multi_byte_A', single_byte_b'
- = 'sb_a', 'mb_A(1st byte)', 'mb_A(2nd byte)', 'mb_A(3rd byte)', 'sb_b'
- multibyte_prop
- = 3 , 1 , 0 , 2 , 3
- */
-
- /* Array of the bracket expressoin in the DFA. */
- struct mb_char_classes *mbcsets;
- int nmbcsets;
- int mbcsets_alloc;
-#endif
-
- /* Stuff owned by the state builder. */
- dfa_state *states; /* States of the dfa. */
- int sindex; /* Index for adding new states. */
- int salloc; /* Number of states currently allocated. */
-
- /* Stuff built by the structure analyzer. */
- position_set *follows; /* Array of follow sets, indexed by position
- index. The follow of a position is the set
- of positions containing characters that
- could conceivably follow a character
- matching the given position in a string
- matching the regexp. Allocated to the
- maximum possible position index. */
- int searchflag; /* True if we are supposed to build a searching
- as opposed to an exact matcher. A searching
- matcher finds the first and shortest string
- matching a regexp anywhere in the buffer,
- whereas an exact matcher finds the longest
- string matching, but anchored to the
- beginning of the buffer. */
-
- /* Stuff owned by the executor. */
- int tralloc; /* Number of transition tables that have
- slots so far. */
- int trcount; /* Number of transition tables that have
- actually been built. */
- int **trans; /* Transition tables for states that can
- never accept. If the transitions for a
- state have not yet been computed, or the
- state could possibly accept, its entry in
- this table is NULL. */
- int **realtrans; /* Trans always points to realtrans + 1; this
- is so trans[-1] can contain NULL. */
- int **fails; /* Transition tables after failing to accept
- on a state that potentially could do so. */
- int *success; /* Table of acceptance conditions used in
- dfaexec and computed in build_state. */
- int *newlines; /* Transitions on newlines. The entry for a
- newline in any transition table is always
- -1 so we can count lines without wasting
- too many cycles. The transition for a
- newline is stored separately and handled
- as a special case. Newline is also used
- as a sentinel at the end of the buffer. */
- struct dfamust *musts; /* List of strings, at least one of which
- is known to appear in any r.e. matching
- the dfa. */
-};
-
-/* Some macros for user access to dfa internals. */
-
-/* ACCEPTING returns true if s could possibly be an accepting state of r. */
-#define ACCEPTING(s, r) ((r).states[s].constraint)
-
-/* ACCEPTS_IN_CONTEXT returns true if the given state accepts in the
- specified context. */
-#define ACCEPTS_IN_CONTEXT(prevn, currn, prevl, currl, state, dfa) \
- SUCCEEDS_IN_CONTEXT((dfa).states[state].constraint, \
- prevn, currn, prevl, currl)
-
-/* FIRST_MATCHING_REGEXP returns the index number of the first of parallel
- regexps that a given state could accept. Parallel regexps are numbered
- starting at 1. */
-#define FIRST_MATCHING_REGEXP(state, dfa) (-(dfa).states[state].first_end)
-
-/* Entry points. */
-
-/* dfasyntax() takes three arguments; the first sets the syntax bits described
- earlier in this file, the second sets the case-folding flag, and the
- third specifies the line terminator. */
-extern void dfasyntax PARAMS ((reg_syntax_t, int, int));
-
-/* Compile the given string of the given length into the given struct dfa.
- Final argument is a flag specifying whether to build a searching or an
- exact matcher. */
-extern void dfacomp PARAMS ((char *, size_t, struct dfa *, int));
-
-/* Execute the given struct dfa on the buffer of characters. The
- first char * points to the beginning, and the second points to the
- first character after the end of the buffer, which must be a writable
- place so a sentinel end-of-buffer marker can be stored there. The
- second-to-last argument is a flag telling whether to allow newlines to
- be part of a string matching the regexp. The next-to-last argument,
- if non-NULL, points to a place to increment every time we see a
- newline. The final argument, if non-NULL, points to a flag that will
- be set if further examination by a backtracking matcher is needed in
- order to verify backreferencing; otherwise the flag will be cleared.
- Returns NULL if no match is found, or a pointer to the first
- character after the first & shortest matching string in the buffer. */
-extern char *dfaexec PARAMS ((struct dfa *, char *, char *, int, int *, int *));
-
-/* Free the storage held by the components of a struct dfa. */
-extern void dfafree PARAMS ((struct dfa *));
-
-/* Entry points for people who know what they're doing. */
-
-/* Initialize the components of a struct dfa. */
-extern void dfainit PARAMS ((struct dfa *));
-
-/* Incrementally parse a string of given length into a struct dfa. */
-extern void dfaparse PARAMS ((char *, size_t, struct dfa *));
-
-/* Analyze a parsed regexp; second argument tells whether to build a searching
- or an exact matcher. */
-extern void dfaanalyze PARAMS ((struct dfa *, int));
-
-/* Compute, for each possible character, the transitions out of a given
- state, storing them in an array of integers. */
-extern void dfastate PARAMS ((int, struct dfa *, int []));
-
-/* Error handling. */
-
-/* dfaerror() is called by the regexp routines whenever an error occurs. It
- takes a single argument, a NUL-terminated string describing the error.
- The default dfaerror() prints the error message to stderr and exits.
- The user can provide a different dfafree() if so desired. */
-extern void dfaerror PARAMS ((const char *));
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 6223634f..ef9a8860 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,90 @@
+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.
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 93092a15..c1665e6b 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -25,7 +25,7 @@
info_TEXINFOS = gawk.texi gawkinet.texi
-man_MANS = gawk.1 igawk.1
+man_MANS = gawk.1 igawk.1 pgawk.1
EXTRA_DIST = ChangeLog README.card ad.block setter.outline \
awkcard.in awkforai.txt texinfo.tex cardfonts \
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 8c38c91c..91b1a887 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,6 +1,7 @@
-# Makefile.in generated automatically by automake 1.5 from Makefile.am.
+# Makefile.in generated by automake 1.7.3 from Makefile.am.
+# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# 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,
@@ -36,96 +37,138 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
#
-SHELL = @SHELL@
-
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
+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@
+transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-host_alias = @host_alias@
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@
-HAVE_LIB = @HAVE_LIB@
+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@
-LIB = @LIB@
+LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
LN_S = @LN_S@
-LTLIB = @LTLIB@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+
+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@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+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
+man_MANS = gawk.1 igawk.1 pgawk.1
EXTRA_DIST = ChangeLog README.card ad.block setter.outline \
awkcard.in awkforai.txt texinfo.tex cardfonts \
@@ -134,8 +177,6 @@ EXTRA_DIST = ChangeLog README.card ad.block setter.outline \
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/"
@@ -152,8 +193,11 @@ 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
@@ -162,85 +206,87 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in texinfo.tex
all: all-am
.SUFFIXES:
-.SUFFIXES: .dvi .info .ps .texi
+.SUFFIXES: .dvi .info .pdf .ps .texi
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu doc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) && \
- CONFIG_HEADERS= CONFIG_LINKS= \
- CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
-
-gawk.info: gawk.texi
-gawk.dvi: gawk.texi
-
-gawkinet.info: gawkinet.texi
-gawkinet.dvi: gawkinet.texi
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
.texi.info:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
- `echo $< | sed 's,.*/,,'`
+ @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)/'`$<
.texi.dvi:
- TEXINPUTS=$(srcdir):$$TEXINPUTS \
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
- $(TEXI2DVI) $<
+ $(TEXI2DVI) `test -f '$<' || echo '$(srcdir)/'`$<
-.texi:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
- `echo $< | sed 's,.*/,,'`
+.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 $@
+ $(DVIPS) -o $@ $<
uninstall-info-am:
$(PRE_UNINSTALL)
@if (install-info --version && \
- install-info --version | fgrep -i -v debian) >/dev/null 2>&1; then \
+ install-info --version | grep -i -v debian) >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
- echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file"; \
- install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file; \
+ 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 $$file $$file-[0-9] $$file-[0-9][0-9])"; \
- rm -f $$file $$file-[0-9] $$file-[0-9][0-9]; \
+ 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 \
- d=$(srcdir); \
- for file in `CDPATH=: && cd $$d && eval echo $$base*`; do \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ 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.dvi gawk.fn gawk.ky gawk.log gawk.pg \
- gawk.ps gawk.toc gawk.tp gawk.vr gawkinet.aux gawkinet.cp \
- gawkinet.cps gawkinet.dvi gawkinet.fn gawkinet.ky \
- gawkinet.log gawkinet.pg gawkinet.ps gawkinet.toc gawkinet.tp \
- gawkinet.vr
+ -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:
- cd $(srcdir) && \
- for i in $(INFO_DEPS); do \
- rm -f $$i; \
- if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
- rm -f $$i-[0-9]*; \
- fi; \
+ @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
@@ -258,6 +304,10 @@ install-man1: $(man1_MANS) $(man_MANS)
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; \
@@ -275,6 +325,10 @@ uninstall-man1:
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
+ esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
@@ -284,6 +338,8 @@ uninstall-man1:
tags: TAGS
TAGS:
+ctags: CTAGS
+CTAGS:
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -291,15 +347,26 @@ top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ @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 \
- $(mkinstalldirs) "$(distdir)/$$dir"; \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
fi; \
if test -d $$d/$$file; then \
- cp -pR $$d/$$file $(distdir) \
- || exit 1; \
+ 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 \
@@ -307,7 +374,7 @@ distdir: $(DISTFILES)
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="${top_distdir}" distdir="$(distdir)" \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-info
check-am: all-am
check: check-am
@@ -327,6 +394,7 @@ install-am: all-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:
@@ -334,7 +402,7 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -366,21 +434,25 @@ install-info-am: $(INFO_DEPS)
$(mkinstalldirs) $(DESTDIR)$(infodir)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
- d=$(srcdir); \
- for ifile in `CDPATH=: && cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
- if test -f $$d/$$ifile; then \
- echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
- $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
+ 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 | fgrep -i -v debian) >/dev/null 2>&1; then \
+ install-info --version | grep -i -v debian) >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
- echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
- install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
+ 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
@@ -396,6 +468,14 @@ 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
uninstall-man: uninstall-man1
@@ -407,8 +487,8 @@ uninstall-man: uninstall-man1
install-man1 install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-aminfo \
maintainer-clean-generic mostlyclean mostlyclean-aminfo \
- mostlyclean-generic uninstall uninstall-am uninstall-info-am \
- uninstall-man uninstall-man1
+ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am uninstall-man uninstall-man1
# Uncomment the following definition of AWKCARD if your troff can produce
diff --git a/doc/ad.block b/doc/ad.block
index ee99a5a9..f50062e5 100644
--- a/doc/ad.block
+++ b/doc/ad.block
@@ -1,7 +1,7 @@
.\" AWK Reference Card --- Arnold Robbins, arnold@gnu.org
.\" This file is the Ad block (included in cover)
.\"
-.\" Copyright (C) 1996, 1998, 2000, 2001 Free Software Foundation, Inc.
+.\" Copyright (C) 1996, 1998, 2000, 2001, 2003 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of
.\" this reference card provided the copyright notice and this permission
@@ -40,8 +40,8 @@ URL: http://www.gnu.org
.ce 5
.ft HB
\*(CGSource Distributions on CD-ROM
-Deluxe Distributions
-Emacs, Gawk, Make and GDB Manuals
+.\" Deluxe Distributions
+Emacs, Make and GDB Manuals
Emacs and GDB References\*(CX
.EB "\f(HBOTHER FSF PRODUCTS:\*(FR"
.ps
diff --git a/doc/awkcard.in b/doc/awkcard.in
index be6a7caa..9694cc55 100644
--- a/doc/awkcard.in
+++ b/doc/awkcard.in
@@ -1,6 +1,6 @@
.\" AWK Reference Card --- Arnold Robbins, arnold@gnu.org
.\"
-.\" Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+.\" Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of
.\" this reference card provided the copyright notice and this permission
@@ -24,6 +24,7 @@
.\" Strings to save typing
.ds AK \*(FCawk\*(FR
.ds GK \*(FCgawk\*(FR
+.ds PK \*(FCpgawk\*(FR
.ds NK Bell Labs \*(FCawk\*(FR
.ds MK \*(FCmawk\*(FR
.\"
@@ -63,7 +64,7 @@ Escape Sequences 8
Expressions 11
Fields 6
FTP/HTTP Information 18
-Historical Features (\*(GK) 16
+Historical Features (\*(GK) 10
Input Control 12
Internationalization (\*(GK) 18
Lines And Statements 5
@@ -75,6 +76,7 @@ POSIX Character Classes (\*(GK) 6
Printf Formats 13
Records 6
Regular Expressions 5
+Signals (\*(PK) 4
Special Filenames 14
String Functions 15
Time Functions (\*(GK) 16
@@ -97,7 +99,7 @@ Brian Kernighan and Michael Brennan who reviewed it.
\*(CD
.SL
.nf
-\*(FRCopyright \(co 1996, 1997, 1998, 1999, 2000, 2001, 2002
+\*(FRCopyright \(co 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
.nf
.BT
@@ -286,12 +288,16 @@ T}
.T&
ls
l lw(2.2i).
-\*(FC\-\^\-lint\*(FR[\*(FC=fatal\*(FR]
+\*(FC\-\^\-lint\*(FR[\*(FC=\*(FIvalue\*(FR]
%T{
warn about constructs that are dubious
or non-portable to other \*(AKs.
With an optional argument of \*(FCfatal\*(FR,
lint warnings become fatal errors.
+With an optional argument of
+\*(FCinvalid\*(FR,
+only warnings about things that are
+actually invalid are issued. (This is not fully implemented yet.)
T}
.T&
l lw(2.2i).
@@ -323,9 +329,9 @@ l lw(2.2i).
%T{
send profiling data to \*(FIprof_file\*(FR
(default: \*(FCawkprof.out\*(FR).
-With \*(FIgawk\*(FR,
+With \*(GK,
the profile is just a ``pretty printed'' version of the program.
-With \*(FIpgawk\*(FR,
+With \*(PK,
the profile contains execution counts in the left margin
of each statement in the program.
T}
@@ -357,13 +363,7 @@ In normal operation, as long as program text has been supplied, unknown
options are passed on to the AWK program in
\*(FCARGV\*(FR
for processing. This is most useful for running AWK
-programs via the \*(FC#!\*(FR executable interpreter mechanism.
-.sp .5
-\*(FIpgawk\fP accepts two signals.
-\*(FCSIGUSR1\fP causes it to dump a profile and function call stack to the
-profile file. It then continues to run.
-\*(FCSIGHUP\fP
-causes it to dump the profile and function call stack and then exit.\*(CB
+programs via the \*(FC#!\*(FR executable interpreter mechanism.\*(CB
.EB "\s+2\f(HBCOMMAND LINE ARGUMENTS (\*(GK\f(HB)\*(FR\s0"
.BT
@@ -411,7 +411,16 @@ The options may be abbreviated using just the first letter, e.g.,
\*(FC\-Wv\*(FR
and so on.\*(CB
.EB "\s+2\f(HBCOMMAND LINE ARGUMENTS (\*(MK\f(HB)\*(FR\s0"
-
+.sp .7
+.\" --- Signals (pgawk)
+.ES
+.fi
+\*(CD\*(PK accepts two signals.
+\*(FCSIGUSR1\fP dumps a profile and function call stack to the
+profile file. It then continues to run.
+\*(FCSIGHUP\fP is similar, but exits.\*(CB
+.EB "\s+2\f(HBSIGNALS (\*(PK\f(HB)\*(FR\s0"
+.sp .7
.\" --- Awk Program Execution
.ES
.fi
@@ -857,7 +866,13 @@ T}
\*(CB\*(FCIGNORECASE\fP T{
if non-zero, all regular expression and string
operations ignore case.
-Array subscripting and \*(FCasort()\*(FR are \*(FInot\*(FR affected.
+Array subscripting
+is \*(FInot\*(FR affected.
+However, the
+\*(FCasort()\*(FR
+and
+\*(FCasorti()\*(FR
+function are affected.
T}
\*(CB\*(FCLINT\fP T{
provides dynamic control of the \*(FC\-\^\-lint\fP
@@ -873,12 +888,7 @@ T}
number of fields in the current input record.
T}
\*(FCNR\fP T{
-total number of input records seen so far.
-T}
-\*(FCOFMT\fP T{
-output format for numbers, \*(FC"%.6g"\*(FR, by default.
-\*(CROld versions of \*(AK used this for number
-to string conversion.\*(CX
+total number of input records seen so far.\*(CX
T}
.TE
.EB "\s+2\f(HBVARIABLES\*(FR\s0"
@@ -890,7 +900,12 @@ T}
.TS
expand;
l lw(2i).
-\*(CD\*(FCOFS\fP T{
+\*(CD\*(FCOFMT\fP T{
+output format for numbers, \*(FC"%.6g"\*(FR, by default.
+\*(CROld versions of \*(AK used this for number
+to string conversion.\*(CD
+T}
+\*(FCOFS\fP T{
output field separator, a space by default.
T}
\*(FCORS\fP T{
@@ -980,9 +995,27 @@ Uninitialized variables have the numeric value 0 and the string value
.BT
+.\" --- Historical Features
+.ES
+.fi
+\*(CD1. It is possible to call the \*(FClength()\fP
+built-in function not only with no argument, but even without parentheses.
+This feature is marked as ``deprecated'' in the POSIX standard, and \*(GK
+issues a warning about its use if \*(FC\-\^\-lint\fP
+is specified on the command line.
+.sp .5
+2. The \*(FCcontinue\fP
+and \*(FCbreak\fP statements may be used outside the body of a
+\*(FCwhile\*(FR, \*(FCfor\*(FR, or \*(FCdo\fP loop.
+Historical AWK implementations have treated such usage as
+equivalent to the \*(FCnext\fP statement.
+\*(GK supports this usage if \*(FC\-\^\-traditional\fP
+is specified.\*(CB
+.EB "\s+2\f(HBHISTORICAL FEATURES (\*(GK\f(HB)\*(FR\s0"
+
.ES
\*(CX
-.sp 61
+.sp 47
.EB "\s+2\f(HBNOTES\*(FR\s0"
.BT
@@ -1479,6 +1512,12 @@ and returns the number of elements.
If destination \*(FId\*(FR is supplied, \*(FIs\*(FR is copied to \*(FId\*(FR,
\*(FId\*(FR is sorted, and \*(FIs\*(FR is unchanged.\*(CD
.ti -.2i
+\*(CB\*(FCasorti(\*(FIs\*(FC \*(FR[\*(FC, \*(FId\*(FR]\*(FC)\*(FR
+.br
+like \*(FCasort()\*(FR, but sorting is done on the indices, not
+the values. The original values are thrown array, so provide a
+second array to preserve the first.\*(CD
+.ti -.2i
\*(CB\*(FCgensub(\*(FIr\*(FC, \*(FIs\*(FC, \*(FIh \*(FR[\*(FC, \*(FIt\*(FR]\*(FC)\*(FR
.br
search the target string
@@ -1527,7 +1566,13 @@ and \*(FCRLENGTH\*(FR.
\*(CBIf \*(FIa\*(FR is supplied, the text matching all of \*(FIr\*(FR
is placed in \*(FIa\*(FC[0]\*(FR. If there were parenthesized
subexpressions, the matching texts are placed
-in \*(FIa\*(FC[1]\*(FR, \*(FIa\*(FC[2]\*(FR, and so on.\*(CD
+in \*(FIa\*(FC[1]\*(FR, \*(FIa\*(FC[2]\*(FR, and so on.
+Subscripts
+\*(FCa[\*(FIn\^\*(FC, "start"]\*(FR,
+and
+\*(FCa[\*(FIn\^\*(FC, "length"]\*(FR
+provide the starting index in the string and length
+respectively, of each matching substring.\*(CD
.ti -.2i
\*(FCsplit(\*(FIs\*(FC, \*(FIa \*(FR[\*(FC, \*(FIr\*(FR]\*(FC)\*(FR
.br
@@ -1556,9 +1601,18 @@ or \*(FC0X\*(FR, \*(FCstrtonum()\*(FR assumes that
\*(FCsub(\*(FIr\*(FC, \*(FIs \*(FR[\*(FC, \*(FIt\*(FR]\*(FC)\*(FR
.br
just like
-\*(FCgsub()\*(FR, but only the first matching substring is replaced.
+\*(FCgsub()\*(FR, but only the first matching substring is replaced.\*(CX
+.in -.2i
+.EB "\s+2\f(HBSTRING FUNCTIONS\*(FR\s0"
+
+.BT
+
+.\" --- Builtin String Functions
+.ES
+.fi
+.in +.2i
.ti -.2i
-\*(FCsubstr(\*(FIs\*(FC, \*(FIi \*(FR[\*(FC, \*(FIn\*(FR]\*(FC)\*(FR
+\*(CD\*(FCsubstr(\*(FIs\*(FC, \*(FIi \*(FR[\*(FC, \*(FIn\*(FR]\*(FC)\*(FR
.br
returns the at most
\*(FIn\*(FR-character substring of \*(FIs\fP starting at \*(FIi\*(FR.
@@ -1569,18 +1623,9 @@ If \*(FIn\fP is omitted, the rest of \*(FIs\fP is used.
returns a copy of the string \*(FIstr\*(FR,
with all the upper-case characters in \*(FIstr\fP translated to their
corresponding lower-case counterparts. Non-alphabetic characters are
-left unchanged.\*(CX
-.in -.2i
-.EB "\s+2\f(HBSTRING FUNCTIONS\*(FR\s0"
-
-.BT
-
-.\" --- Builtin String Functions
-.ES
-.fi
-.in +.2i
+left unchanged.
.ti -.2i
-\*(CD\*(FCtoupper(\*(FIstr\*(FC)\*(FR
+\*(FCtoupper(\*(FIstr\*(FC)\*(FR
.br
returns a copy of the string \*(FIstr\*(FR,
with all the lower-case characters in \*(FIstr\fP translated to their
@@ -1684,24 +1729,6 @@ then \*(GK
behaves exactly as if the \*(FC\-\^\-posix\fP option had been given.\*(CB
.EB "\s+2\f(HBENVIRONMENT VARIABLES (\*(GK\f(HB)\*(FR\s0"
-.\" --- Historical Features
-.ES
-.fi
-\*(CD1. It is possible to call the \*(FClength()\fP
-built-in function not only with no argument, but even without parentheses.
-This feature is marked as ``deprecated'' in the POSIX standard, and \*(GK
-issues a warning about its use if \*(FC\-\^\-lint\fP
-is specified on the command line.
-.sp .5
-2. The \*(FCcontinue\fP
-and \*(FCbreak\fP statements may be used outside the body of a
-\*(FCwhile\*(FR, \*(FCfor\*(FR, or \*(FCdo\fP loop.
-Historical AWK implementations have treated such usage as
-equivalent to the \*(FCnext\fP statement.
-\*(GK supports this usage if \*(FC\-\^\-traditional\fP
-is specified.\*(CB
-.EB "\s+2\f(HBHISTORICAL FEATURES (\*(GK\f(HB)\*(FR\s0"
-
.BT
.\" --- User-defined Functions
@@ -1833,15 +1860,16 @@ one of the known locale categories.
You must also supply a text domain. Use \*(FCTEXTDOMAIN\*(FR
to use the current domain.
.ti -.2i
-\*(FCdcngettext(\*(FIstring1 \*(FR, \*(FIstring2 \*(FR, \*(FInumber \*(FR[\*(FC, \*(FIdomain \*(FR[\*(FC, \*(FIcategory\*(FR]]\*(FC)\*(FR
+\*(FCdcngettext(\*(FIstring1\*(FC, \*(FIstring2\*(FC, \*(FInumber\*(FR [\*(FC, \*(FIdom \*(FR[\*(FC, \*(FIcat\*(FR]]\*(FC)\*(FR
.br
returns the plural form used for \*(FInumber\*(FR of the translation of
\*(FIstring1\*(FR and \*(FIstring2\*(FR in text domain
-\*(FIdomain\*(FR for locale category \*(FIcategory\*(FR.
-The default value for \*(FIdomain\*(FR is the current value of \*(FCTEXTDOMAIN\*(FR.
-The default value for \*(FIcategory\*(FR is \*(FC"LC_MESSAGES"\*(FR.
+\*(FIdom\*(FR for locale category \*(FIcat\*(FR.
+The default value for \*(FIdom\*(FR is the current value of \*(FCTEXTDOMAIN\*(FR.
+\*(FC"LC_MESSAGES"\*(FR
+is the default value for \*(FIcat\*(FR.
.sp .5
-If you supply a value for \*(FIcategory\*(FR, it must be a string equal to
+If you supply a value for \*(FIcat\*(FR, it must be a string equal to
one of the known locale categories.
You must also supply a text domain. Use \*(FCTEXTDOMAIN\*(FR
to use the current domain.\*(CB
@@ -1853,7 +1881,7 @@ to use the current domain.\*(CB
.ES
.nf
\*(CDHost: \*(FCftp.gnu.org\*(FR
-File: \*(FC/gnu/gawk/gawk-3.1.1.tar.gz\fP
+File: \*(FC/gnu/gawk/gawk-3.1.2.tar.gz\fP
.in +.2i
.fi
GNU \*(AK (\*(GK). There may be a later version.
@@ -1864,7 +1892,7 @@ GNU \*(AK (\*(GK). There may be a later version.
.in +.2i
.fi
\*(NK. This version requires an ANSI C compiler;
-GCC (the GNU C compiler) works well.
+GCC (the GNU Compiler Collection) works well.
.in -.2i
.nf
.sp .5
@@ -1880,7 +1908,7 @@ Michael Brennan's \*(MK. There may be a newer version.\*(CX
.\" --- Copying Permissions
.ES
.fi
-\*(CDCopyright \(co 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+\*(CDCopyright \(co 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
.sp .5
Permission is granted to make and distribute verbatim copies of this
reference card provided the copyright notice and this permission notice
diff --git a/doc/gawk.1 b/doc/gawk.1
index 5f73a68e..40dd3030 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -14,7 +14,7 @@
. if \w'\(rq' .ds rq "\(rq
. \}
.\}
-.TH GAWK 1 "Apr 16 2002" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "February 3 2003" "Free Software Foundation" "Utility Commands"
.SH NAME
gawk \- pattern scanning and processing language
.SH SYNOPSIS
@@ -265,10 +265,10 @@ the standard output.
these options cause an immediate, successful exit.)
.TP
.PD 0
-.BR "\-W lint" [ =fatal ]
+.BR "\-W lint" [ =\fIvalue\fR ]
.TP
.PD
-.BR \-\^\-lint [ =fatal ]
+.BR \-\^\-lint [ =\fIvalue\fR ]
Provide warnings about constructs that are
dubious or non-portable to other \*(AK implementations.
With an optional argument of
@@ -276,6 +276,10 @@ With an optional argument of
lint warnings become fatal errors.
This may be drastic, but its use will certainly encourage the
development of cleaner \*(AK programs.
+With an optional argument of
+.BR invalid ,
+only warnings about things that are
+actually invalid are issued. (This is not fully implemented yet.)
.TP
.PD 0
.B "\-W lint\-old"
@@ -812,9 +816,12 @@ operations.
.B NOTE:
Array subscripting is
.I not
-affected, nor is the
+affected.
+However, the
.B asort()
-function.
+and
+.B asorti()
+functions are affected.
.sp .5
Thus, if
.B IGNORECASE
@@ -2236,6 +2243,20 @@ is sorted, leaving the indexes of the
source array
.I s
unchanged.
+.TP "\w'\fBsprintf(\^\fIfmt\fB\^, \fIexpr-list\^\fB)\fR'u+1n"
+\fBasorti(\fIs \fR[\fB, \fId\fR]\fB)\fR
+Returns the number of elements in the source
+array
+.IR s .
+The behavior is the same as that of
+.BR asort() ,
+except that the array
+.I indices
+are used for sorting, not the array values.
+When done, the array is indexed numerically, and
+the values are those of the original indices.
+The original values are lost; thus provide
+a second array if you wish to preserve the original.
.TP
\fBgensub(\fIr\fB, \fIs\fB, \fIh \fR[\fB, \fIt\fR]\fB)\fR
Search the target string
@@ -2367,6 +2388,12 @@ of
.I s
matched by the entire regular expression
.IR r .
+Subscripts
+\fBa[\fIn\^\fB, "start"]\fR,
+and
+\fBa[\fIn\^\fB, "length"]\fR
+provide the starting index in the string and length
+respectively, of each matching substring.
.TP
\fBsplit(\fIs\fB, \fIa \fR[\fB, \fIr\fR]\fB)\fR
Splits the string
@@ -2459,7 +2486,7 @@ formatting them.
.PP
.TP "\w'\fBsystime()\fR'u+1n"
\fBmktime(\fIdatespec\fB)\fR
-Rurns
+Turns
.I datespec
into a time stamp of the same form as returned by
.BR systime() .
@@ -2782,6 +2809,12 @@ Concatenate and line number (a variation on a theme):
.ft B
{ print NR, $0 }
.ft R
+Run an external command for particular lines of data:
+
+.ft B
+ tail -f access_log |
+ awk '/myhome.html/ { system("nmap " $1 ">> logdir/myhome.html") }'
+.ft R
.fi
.SH INTERNATIONALIZATION
.PP
@@ -3117,9 +3150,11 @@ to abandon processing of the current input file.
The
.BR and() ,
.BR asort() ,
+.BR asorti() ,
.BR bindtextdomain() ,
.BR compl() ,
.BR dcgettext() ,
+.BR dcngettext() ,
.BR gensub() ,
.BR lshift() ,
.BR mktime() ,
@@ -3321,7 +3356,7 @@ provided valuable assistance during testing and debugging.
We thank him.
.SH COPYING PERMISSIONS
Copyright \(co 1989, 1991, 1992, 1993, 1994, 1995, 1996,
-1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+1997, 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
.PP
Permission is granted to make and distribute verbatim copies of
this manual page provided the copyright notice and this permission
diff --git a/doc/gawk.info b/doc/gawk.info
index 316b56c5..3c290463 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -1,24 +1,24 @@
-This is gawk.info, produced by makeinfo version 4.2 from gawk.texi.
+This is gawk.info, produced by makeinfo version 4.5 from gawk.texi.
-INFO-DIR-SECTION GNU Packages
+INFO-DIR-SECTION Text creation and manipulation
START-INFO-DIR-ENTRY
-* Gawk: (gawk). A text scanning and processing language.
+* Gawk: (gawk). A text scanning and processing language.
END-INFO-DIR-ENTRY
INFO-DIR-SECTION Individual utilities
START-INFO-DIR-ENTRY
-* awk: (gawk)Invoking gawk. Text scanning and processing.
+* awk: (gawk)Invoking gawk. Text scanning and processing.
END-INFO-DIR-ENTRY
Copyright (C) 1989, 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000,
-2001, 2002 Free Software Foundation, Inc.
+2001, 2002, 2003 Free Software Foundation, Inc.
This is Edition 3 of `GAWK: Effective AWK Programming: A User's
-Guide for GNU Awk', for the 3.1.1 (or later) version of the GNU
+Guide for GNU Awk', for the 3.1.2 (or later) version of the GNU
implementation of AWK.
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "GNU General Public License", the Front-Cover
texts being (a) (see below), and with the Back-Cover Texts being (b)
@@ -41,15 +41,15 @@ General Introduction
particular records in a file and perform operations upon them.
Copyright (C) 1989, 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000,
-2001, 2002 Free Software Foundation, Inc.
+2001, 2002, 2003 Free Software Foundation, Inc.
This is Edition 3 of `GAWK: Effective AWK Programming: A User's
-Guide for GNU Awk', for the 3.1.1 (or later) version of the GNU
+Guide for GNU Awk', for the 3.1.2 (or later) version of the GNU
implementation of AWK.
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "GNU General Public License", the Front-Cover
texts being (a) (see below), and with the Back-Cover Texts being (b)
@@ -149,6 +149,7 @@ texts being (a) (see below), and with the Back-Cover Texts being (b)
* Case-sensitivity:: How to do case-insensitive matching.
* Leftmost Longest:: How much text matches.
* Computed Regexps:: Using Dynamic Regexps.
+* Locales:: How the locale affects things.
* Records:: Controlling how data is split into records.
* Fields:: An introduction to fields.
* Nonconstant Fields:: Nonconstant Field Numbers.
@@ -1258,7 +1259,11 @@ if you had typed `awk -f advice':
$ advice
-| Don't Panic!
-Self-contained `awk' scripts are useful when you want to write a
+(We assume you have the current directory in your shell's search path
+variable (typically `$PATH'). If not, you may need to type `./advice'
+at the shell.)
+
+ Self-contained `awk' scripts are useful when you want to write a
program that users can invoke without their having to know that the
program is written in `awk'.
@@ -1734,7 +1739,7 @@ variables are automatically initialized to zero.)
After the last line of output from `ls' has been processed, the
`END' rule executes and prints the value of `sum'. In this example,
-the value of `sum' is 140963.
+the value of `sum' is 80600.
These more advanced `awk' techniques are covered in later sections
(*note Actions: Action Overview.). Before you can move on to more
@@ -1956,6 +1961,7 @@ you specify more complicated classes of strings.
* Case-sensitivity:: How to do case-insensitive matching.
* Leftmost Longest:: How much text matches.
* Computed Regexps:: Using Dynamic Regexps.
+* Locales:: How the locale affects things.

File: gawk.info, Node: Regexp Usage, Next: Escape Sequences, Prev: Regexp, Up: Regexp
@@ -2248,7 +2254,8 @@ sequences and that are not listed in the table stand for themselves:
arithmetic. They can be used to concatenate regular expressions
containing the alternation operator, `|'. For example,
`@(samp|code)\{[^}]+\}' matches both `@code{foo}' and `@samp{bar}'.
- (These are Texinfo formatting control sequences.)
+ (These are Texinfo formatting control sequences. The `+' is
+ explained further on in this list.)
`*'
This symbol means that the preceding regular expression should be
@@ -2513,7 +2520,9 @@ No options
`--re-interval'
Allow interval expressions in regexps, even if `--traditional' has
- been provided.
+ been provided. (`--posix' automatically enables interval
+ expressions, so `--re-interval' is redundant when `--posix' is is
+ used.)

File: gawk.info, Node: Case-sensitivity, Next: Leftmost Longest, Prev: GNU Regexp Operators, Up: Regexp
@@ -2624,7 +2633,7 @@ Records: Records., and also *note Specifying How Fields Are Separated:
Field Separators.).

-File: gawk.info, Node: Computed Regexps, Prev: Leftmost Longest, Up: Regexp
+File: gawk.info, Node: Computed Regexps, Next: Locales, Prev: Leftmost Longest, Up: Regexp
Using Dynamic Regexps
=====================
@@ -2703,6 +2712,40 @@ to be used inside a character list for a dynamic regexp:
often in practice, but it's worth noting for future reference.

+File: gawk.info, Node: Locales, Prev: Computed Regexps, Up: Regexp
+
+Where You Are Makes A Difference
+================================
+
+ Modern systems support the notion of "locales": a way to tell the
+system about the local character set and language. The current locale
+setting can affect the way regexp matching works, often in surprising
+ways. In particular, many locales do case-insensitive matching, even
+when you may have specified characters of only one particular case.
+
+ The following example uses the `sub' function, which does text
+replacement (*note String-Manipulation Functions: String Functions.).
+Here, the intent is to remove trailing uppercase characters:
+
+ $ echo something1234abc | gawk '{ sub("[A-Z]*$", ""); print }'
+ -| something1234
+
+This output is unexpected, since the `abc' at the end of
+`something1234abc' should not normally match `[A-Z]*'. This result is
+due to the locale setting (and thus you may not see it on your system).
+There are two fixes. The first is to use the POSIX character class
+`[[:upper:]]', instead of `[A-Z]'. The second is to change the locale
+setting in the environment, before running `gawk', by using the shell
+statements:
+
+ LANG=C LC_ALL=C
+ export LANG LC_ALL
+
+ The setting `C' forces `gawk' to behave in the traditional Unix
+manner, where case distinctions do matter. You may wish to put these
+statements into your shell startup file, e.g., `$HOME/.profile'.
+
+
File: gawk.info, Node: Reading Files, Next: Printing, Prev: Regexp, Up: Top
Reading Input Files
@@ -2889,6 +2932,14 @@ value of `RT' is a newline, and the `print' statement supplies its own
terminating newline. *Note A Simple Stream Editor: Simple Sed, for a
more useful example of `RS' as a regexp and `RT'.
+ If you set `RS' to a regular expression that allows optional
+trailing text, such as `RS = "abc(XYZ)?"' it is possible, due to
+implementation constraints, that `gawk' may match the leading part of
+the regular expression, but not the trailing part, particularly if the
+input text that could match the trailing part is fairly long. `gawk'
+attempts to avoid this problem, but currently, there's no guarantee
+that this will never happen.
+
The use of `RS' as a regular expression and the `RT' variable are
`gawk' extensions; they are not available in compatibility mode (*note
Command-Line Options: Options.). In compatibility mode, only the first
@@ -3058,9 +3109,9 @@ input file.) Consider the following example and its output:
$ awk '{ nboxes = $3 ; $3 = $3 - 10
> print nboxes, $3 }' inventory-shipped
- -| 13 3
- -| 15 5
- -| 15 5
+ -| 25 15
+ -| 32 22
+ -| 24 14
...
The program first saves the original value of field three in the
@@ -3071,7 +3122,7 @@ Ops.) Then it prints the original and new values for field three.
(Someone in the warehouse made a consistent mistake while inventorying
the red boxes.)
- For this to work, the text in field `$2' must make sense as a
+ For this to work, the text in field `$3' must make sense as a
number; the string of characters must be converted to a number for the
computer to do arithmetic on it. The number resulting from the
subtraction is converted back to a string of characters that then
@@ -3112,11 +3163,11 @@ the appropriate number of field separators between it and the previously
existing fields.
This recomputation affects and is affected by `NF' (the number of
-fields; *note Examining Fields: Fields.). It is also affected by a
-feature that has not been discussed yet: the "output field separator",
-`OFS', used to separate the fields (*note Output Separators::). For
-example, the value of `NF' is set to the number of the highest field
-you create.
+fields; *note Examining Fields: Fields.). For example, the value of
+`NF' is set to the number of the highest field you create. The exact
+format of `$0' is also affected by a feature that has not been
+discussed yet: the "output field separator", `OFS', used to separate
+the fields (*note Output Separators::).
Note, however, that merely _referencing_ an out-of-range field does
_not_ change the value of either `$0' or `NF'. Referencing an
@@ -3166,6 +3217,22 @@ value of `NF' and recomputes `$0'. (d.c.) Here is an example:
*Caution:* Some versions of `awk' don't rebuild `$0' when `NF' is
decremented. Caveat emptor.
+ Finally, there are times when it is convenient to force `awk' to
+rebuild the entire record, using the current value of the fields and
+`OFS'. To do this, use the seemingly innocuous assignment:
+
+ $1 = $1 # force record to be reconstituted
+ print $0 # or whatever else with $0
+
+This forces `awk' rebuild the record. It does help to add a comment,
+as we've shown here.
+
+ There is a flip side to the relationship between `$0' and the
+fields. Any assignment to `$0' causes the record to be reparsed into
+fields using the _current_ value of `FS'. This also applies to any
+built-in function that updates `$0', such as `sub' and `gsub' (*note
+String-Manipulation Functions: String Functions.).
+

File: gawk.info, Node: Field Separators, Next: Constant Size, Prev: Changing Fields, Up: Reading Files
@@ -3426,6 +3493,15 @@ File: gawk.info, Node: Field Splitting Summary, Prev: Command Line Field Separ
Field-Splitting Summary
-----------------------
+ It is important to remember that when you assign a string constant
+as the value of `FS', it undergoes normal `awk' string processing. For
+example, with Unix `awk' and `gawk', the assignment `FS = "\.."'
+assigns the character string `".."' to `FS' (the backslash is
+stripped). This creates a regexp meaning "fields are separated by
+occurrences of any two characters." If instead you want fields to be
+separated by a literal period followed by any single character, use `FS
+= "\\.."'.
+
The following table summarizes how fields are split, based on the
value of `FS' (`==' means "is equal to"):
@@ -3476,6 +3552,24 @@ like:
root:nSijPlPhZZwgE:0:0:Root:/:
+Advanced Notes: `FS' and `IGNORECASE'
+-------------------------------------
+
+ The `IGNORECASE' variable (*note Built-in Variables That Control
+`awk': User-modified.) affects field splitting _only_ when the value
+of `FS' is a regexp. It has no effect when `FS' is a single character,
+even if that character is a letter. Thus, in the following code:
+
+ FS = "c"
+ IGNORECASE = 1
+ $0 = "aCa"
+ print $1
+
+The output is `aCa'. If you really want to split fields on an
+alphabetic character while ignoring case, use a regexp that will do it
+for you. E.g., `FS = "[c]"'. In this case, `IGNORECASE' will take
+effect.
+
---------- Footnotes ----------
(1) The `sed' utility is a "stream editor." Its behavior is also
@@ -3632,8 +3726,9 @@ second case, this special processing is not done. (d.c.)
separate the fields in the record. One way to do this is to divide each
of the lines into fields in the normal manner. This happens by default
as the result of a special feature. When `RS' is set to the empty
-string, the newline character _always_ acts as a field separator. This
-is in addition to whatever field separations result from `FS'.
+string, _and_ `FS' is a set to a single character, the newline
+character _always_ acts as a field separator. This is in addition to
+whatever field separations result from `FS'.(1)
The original motivation for this special exception was probably to
provide useful behavior in the default case (i.e., `FS' is equal to
@@ -3641,14 +3736,18 @@ provide useful behavior in the default case (i.e., `FS' is equal to
newline character to separate fields, because there is no way to
prevent it. However, you can work around this by using the `split'
function to break up the record manually (*note String Manipulation
-Functions: String Functions.).
+Functions: String Functions.). If you have a single character field
+separator, you can work around the special feature in a different way,
+by making `FS' into a regexp for that single character. For example,
+if the field separator is a percent character, instead of `FS = "%"',
+use `FS = "[%]"'.
Another way to separate fields is to put each field on a separate
line: to do this, just set the variable `FS' to the string `"\n"'.
-(This simple regular expression matches a single newline.) A practical
-example of a data file organized this way might be a mailing list,
-where each entry is separated by blank lines. Consider a mailing list
-in a file named `addresses', which looks like this:
+(This single character seperator matches a single newline.) A
+practical example of a data file organized this way might be a mailing
+list, where each entry is separated by blank lines. Consider a mailing
+list in a file named `addresses', which looks like this:
Jane Doe
123 Main Street
@@ -3716,6 +3815,12 @@ equal to.")
In all cases, `gawk' sets `RT' to the input text that matched the
value specified by `RS'.
+ ---------- Footnotes ----------
+
+ (1) When `FS' is the null string (`""') or a regexp, this special
+feature of `RS' does not apply. It does apply to the default field
+separator of a single space: `FS = " "'.
+

File: gawk.info, Node: Getline, Prev: Multiple Line, Up: Reading Files
@@ -4097,6 +4202,13 @@ bear in mind:
BEGIN/END, also *note Built-in Variables That Convey Information:
Auto-set..)
+ * Using `FILENAME' with `getline' (`getline < FILENAME') is likely
+ to be a source for confusion. `awk' opens a separate input stream
+ from the current input file. However, by not using a variable,
+ `$0' and `NR' are still updated. If you're doing this, it's
+ probably by accident, and you should reconsider what it is you're
+ trying to accomplish.
+

File: gawk.info, Node: Getline Summary, Prev: Getline Notes, Up: Getline
@@ -5158,6 +5270,11 @@ not closed and released until `close' is called or `awk' exits.
`close' will silently do nothing if given an argument that does not
represent a file, pipe or coprocess that was opened with a redirection.
+ Note also that `close(FILENAME)' has no "magic" effects on the
+implicit loop that reads through the files named on the command line.
+It is, more likely, a close of a file that was never opened, so `awk'
+silently does nothing.
+
When using the `|&' operator to communicate with a coprocess, it is
occasionally useful to be able to close one end of the two-way pipe
without closing the other. This is done by supplying a second argument
@@ -5187,10 +5304,10 @@ cases, `gawk' sets the built-in variable `ERRNO' to a string describing
the problem.
In `gawk', when closing a pipe or coprocess, the return value is the
-exit status of the command. Otherwise, it is the return value from the
-system's `close' or `fclose' C functions when closing input or output
-files, respectively. This value is zero if the close succeeds, or -1 if
-it fails.
+exit status of the command.(2) Otherwise, it is the return value from
+the system's `close' or `fclose' C functions when closing input or
+output files, respectively. This value is zero if the close succeeds,
+or -1 if it fails.
The return value for closing a pipeline is particularly useful. It
allows you to get the output from a command as well as its exit status.
@@ -5215,6 +5332,10 @@ return value from `close' is that of the library's `pclose' function.
is called a "zombie," and cleaning up after it is referred to as
"reaping."
+ (2) This is a full 16-bit value as returned by the `wait' system
+call. See the system manual pages for information on how to decode this
+value.
+

File: gawk.info, Node: Expressions, Next: Patterns and Actions, Prev: Printing, Up: Top
@@ -6808,7 +6929,7 @@ program attempts to combine a range pattern with another, simpler test:
interprets this as `/1/, (/2/ || /Yes/)'. This cannot be changed or
worked around; range patterns do not combine with other patterns:
- $ echo yes | gawk '(/1/,/2/) || /Yes/'
+ $ echo Yes | gawk '(/1/,/2/) || /Yes/'
error--> gawk: cmd. line:1: (/1/,/2/) || /Yes/
error--> gawk: cmd. line:1: ^ parse error
error--> gawk: cmd. line:2: (/1/,/2/) || /Yes/
@@ -7677,8 +7798,10 @@ specific to `gawk' are marked with a pound sign (`#').
`gsub', `index', `match', `split', and `sub' functions, record
termination with `RS', and field splitting with `FS', all ignore
case when doing their particular regexp operations. However, the
- value of `IGNORECASE' does _not_ affect array subscripting. *Note
- Case Sensitivity in Matching: Case-sensitivity.
+ value of `IGNORECASE' does _not_ affect array subscripting and it
+ does not affect field splitting when using a single-character
+ field separator. *Note Case Sensitivity in Matching:
+ Case-sensitivity.
If `gawk' is in compatibility mode (*note Command-Line Options:
Options.), then `IGNORECASE' has no special meaning. Thus, string
@@ -7688,7 +7811,9 @@ specific to `gawk' are marked with a pound sign (`#').
When this variable is true (nonzero or non-null), `gawk' behaves
as if the `--lint' command-line option is in effect. (*note
Command-Line Options: Options.). With a value of `"fatal"', lint
- warnings become fatal errors. Any other true value prints
+ warnings become fatal errors. With a value of `"invalid"', only
+ warnings about things that are actually invalid are issued. (This
+ is not fully implemented yet.) Any other true value prints
nonfatal warnings. Assigning a false value to `LINT' turns off
the lint warnings.
@@ -7766,7 +7891,7 @@ Built-in Variables That Convey Information
The following is an alphabetical list of variables that `awk' sets
automatically on certain occasions in order to provide information to
your program. The variables that are specific to `gawk' are marked
-with an asterisk (`*').
+with a pound sign (`#').
`ARGC, ARGV'
The command-line arguments available to `awk' programs are stored
@@ -7862,6 +7987,12 @@ with an asterisk (`*').
each time a new record is read, when a new field is created or
when `$0' changes (*note Examining Fields: Fields.).
+ Unlike most of the variables described in this node, assigning a
+ value to `NF' has the potential to affect `awk''s internal
+ workings. In particular, assignments to `NF' can be used to
+ create or remove fields from the current record: *Note Changing
+ the Contents of a Field: Changing Fields.
+
`NR'
The number of input records `awk' has processed since the
beginning of the program's execution (*note How Input Is Split
@@ -8676,9 +8807,9 @@ Sorting Array Values and Indices with `gawk'
loop is essentially arbitrary. In most `awk' implementations, sorting
an array requires writing a `sort' function. While this can be
educational for exploring different sorting algorithms, usually that's
-not the point of the program. `gawk' provides the built-in `asort'
-function (*note String Manipulation Functions: String Functions.) that
-sorts an array. For example:
+not the point of the program. `gawk' provides the built-in `asort' and
+`asorti' functions (*note String Manipulation Functions: String
+Functions.) for sorting arrays. For example:
POPULATE THE ARRAY data
n = asort(data)
@@ -8706,9 +8837,23 @@ and then sorts `dest', destroying its indices. However, the `source'
array is not affected.
Often, what's needed is to sort on the values of the _indices_
-instead of the values of the elements. To do this, use a helper array
-to hold the sorted index values, and then access the original array's
-elements. It works in the following way:
+instead of the values of the elements. To do that, starting with
+`gawk' 3.1.2, use the `asorti' function. The interface is identical to
+that of `asort', except that the index values are used for sorting, and
+become the values of the result array:
+
+ { source[$0] = some_func($0) }
+
+ END {
+ n = asorti(source, dest)
+ for (i = 1; i <= n; i++)
+ DO SOMETHING WITH dest[i]
+ }
+
+ If your version of `gawk' is 3.1.0 or 3.1.1, you don't have
+`asorti'. Instead, use a helper array to hold the sorted index values,
+and then access the original array's elements. It works in the
+following way:
POPULATE THE ARRAY data
# copy indices
@@ -8733,8 +8878,10 @@ is only one copy of the original array elements' data, even though both
arrays use the values. Similarly, when copying the indices from `data'
to `ind', there is only one copy of the actual index strings.
- As with array subscripts, the value of `IGNORECASE' does not affect
-array sorting.
+ We said previously that comparisons are done using `gawk''s "usual
+comparison rules." Because `IGNORECASE' affects string comparisons,
+the value of `IGNORECASE' also affects sorting for both `asort' and
+`asorti'. Caveat Emptor.

File: gawk.info, Node: Functions, Next: Internationalization, Prev: Arrays, Up: Top
@@ -8830,8 +8977,8 @@ Numeric Functions
-----------------
The following list describes all of the built-in functions that work
-with numbers. Optional parameters are enclosed in square brackets ([
-]):
+with numbers. Optional parameters are enclosed in square
+brackets ([ ]):
`int(X)'
This returns the nearest integer to X, located between X and zero
@@ -8943,9 +9090,9 @@ String-Manipulation Functions
-----------------------------
The functions in this minor node look at or change the text of one
-or more strings. Optional parameters are enclosed in square brackets
-([ ]). Those functions that are specific to `gawk' are marked with a
-pound sign (`#'):
+or more strings. Optional parameters are enclosed in square
+brackets ([ ]). Those functions that are specific to `gawk' are marked
+with a pound sign (`#'):
* Menu:
@@ -8956,12 +9103,13 @@ pound sign (`#'):
`asort(SOURCE [, DEST]) #'
`asort' is a `gawk'-specific extension, returning the number of
elements in the array SOURCE. The contents of SOURCE are sorted
- using `gawk''s normal rules for comparing values, and the indices
- of the sorted values of SOURCE are replaced with sequential
- integers starting with one. If the optional array DEST is
- specified, then SOURCE is duplicated into DEST. DEST is then
- sorted, leaving the indices of SOURCE unchanged. For example, if
- the contents of `a' are as follows:
+ using `gawk''s normal rules for comparing values (in particular,
+ `IGNORECASE' affects the sorting) and the indices of the sorted
+ values of SOURCE are replaced with sequential integers starting
+ with one. If the optional array DEST is specified, then SOURCE is
+ duplicated into DEST. DEST is then sorted, leaving the indices of
+ SOURCE unchanged. For example, if the contents of `a' are as
+ follows:
a["last"] = "de"
a["first"] = "sac"
@@ -8982,6 +9130,20 @@ pound sign (`#'):
`gawk' extension; it is not available in compatibility mode (*note
Command-Line Options: Options.).
+`asorti(SOURCE [, DEST]) #'
+ `asorti' is a `gawk'-specific extension, returning the number of
+ elements in the array SOURCE. It works similarly to `asort',
+ however, the _indices_ are sorted, instead of the values. As
+ array indices are always strings, the comparison performed is
+ always a string comparison. (Here too, `IGNORECASE' affects the
+ sorting.)
+
+ The `asorti' function is described in more detail in *Note Sorting
+ Array Values and Indices with `gawk': Array Sorting. It was added
+ in `gawk' 3.1.2. `asorti' is a `gawk' extension; it is not
+ available in compatibility mode (*note Command-Line Options:
+ Options.).
+
`index(IN, FIND)'
This searches the string IN for the first occurrence of the string
FIND, and returns the position in characters where that occurrence
@@ -9017,6 +9179,12 @@ pound sign (`#'):
(one, if it starts at the beginning of STRING). If no match is
found, it returns zero.
+ The REGEXP argument may be either a regexp constant (`/.../') or a
+ string constant ("..."). In the latter case, the string is
+ treated as a regexp to be matched. *Note Using Dynamic Regexps:
+ Computed Regexps, for a discussion of the difference between the
+ two forms, and the implications for writing your program correctly.
+
The order of the first two arguments is backwards from most other
string functions that work with regular expressions, such as `sub'
and `gsub'. It might help to remember that for `match', the order
@@ -9069,6 +9237,20 @@ pound sign (`#'):
> print arr[1], arr[2] }'
-| foooo barrrrr
+ In addition, beginning with `gawk' 3.1.2, multidimensional
+ subscripts are available providing the start index and length of
+ each matched subexpression:
+
+ $ echo foooobazbarrrrr |
+ > gawk '{ match($0, /(fo+).+(bar*)/, arr)
+ > print arr[1], arr[2]
+ > print arr[1, "start"], arr[1, "length"]
+ > print arr[2, "start"], arr[2, "length"]
+ > }'
+ -| foooo barrrrr
+ -| 1 5
+ -| 9 7
+
The ARRAY argument to `match' is a `gawk' extension. In
compatibility mode (*note Command-Line Options: Options.), using a
third argument is a fatal error.
@@ -9104,14 +9286,27 @@ pound sign (`#'):
character in the string is split into its own array element.
(This is a `gawk'-specific extension.)
+ Note, however, that `RS' has no effect on the way `split' works.
+ Even though `RS = ""' causes newline to also be an input field
+ separator, this does not affect how `split' splits strings.
+
Modern implementations of `awk', including `gawk', allow the third
argument to be a regexp constant (`/abc/') as well as a string.
- (d.c.) The POSIX standard allows this as well.
+ (d.c.) The POSIX standard allows this as well. *Note Using
+ Dynamic Regexps: Computed Regexps, for a discussion of the
+ difference between using a string constant or a regexp constant,
+ and the implications for writing your program correctly.
Before splitting the string, `split' deletes any previously
- existing elements in the array ARRAY. If STRING does not match
- FIELDSEP at all, ARRAY has one element only. The value of that
- element is the original STRING.
+ existing elements in the array ARRAY.
+
+ If STRING is null, the array has no elements. (So this is a
+ portable way to delete an entire array with one statement. *Note
+ The `delete' Statement: Delete.)
+
+ If STRING does not match FIELDSEP at all (but is not null), ARRAY
+ has one element only. The value of that element is the original
+ STRING.
`sprintf(FORMAT, EXPRESSION1, ...)'
This returns (without printing) the string that `printf' would
@@ -9146,11 +9341,17 @@ pound sign (`#'):
entire string is changed by replacing the matched text with
REPLACEMENT. The modified string becomes the new value of TARGET.
+ The REGEXP argument may be either a regexp constant (`/.../') or a
+ string constant ("..."). In the latter case, the string is
+ treated as a regexp to be matched. *Note Using Dynamic Regexps:
+ Computed Regexps, for a discussion of the difference between the
+ two forms, and the implications for writing your program correctly.
+
This function is peculiar because TARGET is not simply used to
compute a value, and not just any expression will do--it must be a
variable, field, or array element so that `sub' can store a
modified value there. If this argument is omitted, then the
- default is to use and alter `$0'. For example:
+ default is to use and alter `$0'.(2) For example:
str = "water, water, everywhere"
sub(/at/, "ith", str)
@@ -9280,7 +9481,7 @@ pound sign (`#'):
`substr(STRING, START [, LENGTH])'
This returns a LENGTH-character-long substring of STRING, starting
at character number START. The first character of a string is
- character number one.(2) For example, `substr("washington", 5, 3)'
+ character number one.(3) For example, `substr("washington", 5, 3)'
returns `"ing"'.
If LENGTH is not present, this function returns the whole suffix of
@@ -9289,10 +9490,12 @@ pound sign (`#'):
also returned if LENGTH is greater than the number of characters
remaining in the string, counting from character START.
- If START is less than one or greater than the number of characters
- in the string, `substr' returns the null string. Similarly, if
- LENGTH is present but less than or equal to zero, the null string
- is returned.
+ If START is less than one, `substr' treats it as if it was one.
+ (POSIX doesn't specify what to do in this case: Unix `awk' acts
+ this way, and therefore `gawk' does too.) If START is greater
+ than the number of characters in the string, `substr' returns the
+ null string. Similarly, if LENGTH is present but less than or
+ equal to zero, the null string is returned.
The string returned by `substr' _cannot_ be assigned. Thus, it is
a mistake to attempt to change a portion of a string, as shown in
@@ -9335,7 +9538,12 @@ pound sign (`#'):
recommended. *Note Allowing Nondecimal Input Data: Nondecimal Data,
for more information.
- (2) This is different from C and C++, in which the first character
+ (2) Note that this means that the record will first be regenerated
+using the value of `OFS' if any fields have been changed, and that the
+fields will be updated after the substituion, even if the operation is
+a "no-op" such as `sub(/^/, "")'.
+
+ (3) This is different from C and C++, in which the first character
is number zero.

@@ -10868,7 +11076,7 @@ translations for `guide'.
---------- Footnotes ----------
- (1) Starting with `gettext' version 0.11.1, the `xgettext' utility
+ (1) Starting with `gettext' version 0.11.5, the `xgettext' utility
that comes with GNU `gettext' can handle `.awk' files.

@@ -11112,8 +11320,8 @@ File: gawk.info, Node: Gawk I18N, Prev: I18N Example, Up: Internationalizatio
As of version 3.1, `gawk' itself has been internationalized using
the GNU `gettext' package. (GNU `gettext' is described in complete
detail in *Note Top::.) As of this writing, the latest version of GNU
-`gettext' is version 0.11.1
-(ftp://ftp.gnu.org/gnu/gettext/gettext-0.11.1.tar.gz).
+`gettext' is version 0.11.5
+(ftp://ftp.gnu.org/gnu/gettext/gettext-0.11.5.tar.gz).
If a translation of `gawk''s messages exists, then `gawk' produces
usage messages, warnings, and fatal errors in the local language.
@@ -11225,7 +11433,7 @@ processing and then read the result. This can always be done with
temporary files:
# write the data for processing
- tempfile = ("/tmp/mydata." PROCINFO["pid"])
+ tempfile = ("mydata." PROCINFO["pid"])
while (NOT DONE WITH DATA)
print DATA | ("subprogram > " tempfile)
close("subprogram > " tempfile)
@@ -11236,7 +11444,10 @@ temporary files:
close(tempfile)
system("rm " tempfile)
-This works, but not elegantly.
+This works, but not elegantly. Among other things, it requires that
+the program be run in a directory that cannot be shared among users;
+for example, `/tmp' will not do, as another user might happen to be
+using a temporary file with the same name.
Starting with version 3.1 of `gawk', it is possible to open a
_two-way_ pipe to another process. The second process is termed a
@@ -11265,8 +11476,6 @@ or pipeline of programs, that can be started by the shell.
standard error goes. It is not possible to read the child's
standard error separately.
- </itemizedlist>
-
* I/O buffering may be a problem. `gawk' automatically flushes all
output down the pipe to the child process. However, if the
coprocess does not flush its output, `gawk' may hang when doing a
@@ -11314,6 +11523,22 @@ terminates the coprocess and exits.
As a side note, the assignment `LC_ALL=C' in the `sort' command
ensures traditional Unix (ASCII) sorting from `sort'.
+ Beginning with `gawk' 3.1.2, you may use Pseudo-ttys (ptys) for
+two-way communication instead of pipes, if your system supports them.
+This is done on a per-command basis, by setting a special element in
+the `PROCINFO' array (*note Built-in Variables That Convey Information:
+Auto-set.), like so:
+
+ command = "sort -nr" # command, saved in variable for convenience
+ PROCINFO[command, "pty"] = 1 # update PROCINFO
+ print ... |& command # start two-way pipe
+ ...
+
+Using ptys avoids the buffer deadlock issues described earlier, at some
+loss in performance. If your system does not have ptys, or if all the
+system's ptys are in use, `gawk' automatically falls back to using
+regular pipes.
+
---------- Footnotes ----------
(1) This is very different from the same operator in the C shell,
@@ -11810,6 +12035,9 @@ The following list describes `gawk'-specific options:
executes. With an optional argument of `fatal', lint warnings
become fatal errors. This may be drastic, but its use will
certainly encourage the development of cleaner `awk' programs.
+ With an optional argument of `invalid', only warnings about things
+ that are actually invalid are issued. (This is not fully
+ implemented yet.)
`-W lint-old'
`--lint-old'
@@ -13330,12 +13558,12 @@ that "cats" the password database:
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;
}
If you don't understand C, don't worry about it. The output from
@@ -13541,8 +13769,8 @@ have a small C program that generates the group database as its output.
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)
@@ -13551,7 +13779,7 @@ have a small C program that generates the group database as its output.
putchar('\n');
}
endgrent();
- exit(0);
+ return 0;
}
Each line in the group database represents one group. The fields are
@@ -15853,36 +16081,41 @@ should accept all of `gawk''s command-line arguments, including the
ability to have multiple source files specified via `-f', and the
ability to mix command-line and library source files.
- The program is written using the POSIX Shell (`sh') command language.
-It works as follows:
+ The program is written using the POSIX Shell (`sh') command
+language.(1) It works as follows:
1. Loop through the arguments, saving anything that doesn't represent
`awk' source code for later, when the expanded program is run.
2. For any arguments that do represent `awk' text, put the arguments
- into a temporary file that will be expanded. There are two cases:
+ into a shell variable that will be expanded. There are two cases:
a. Literal text, provided with `--source' or `--source='. This
- text is just echoed directly. The `echo' program
- automatically supplies a trailing newline.
+ text is just appended directly.
b. Source file names, provided with `-f'. We use a neat trick
- and echo `@include FILENAME' into the temporary file. Since
- the file-inclusion program works the way `gawk' does, this
- gets the text of the file included into the program at the
- correct point.
+ and append `@include FILENAME' to the shell variable's
+ contents. Since the file-inclusion program works the way
+ `gawk' does, this gets the text of the file included into the
+ program at the correct point.
- 3. Run an `awk' program (naturally) over the temporary file to expand
- `@include' statements. The expanded program is placed in a second
- temporary file.
+ 3. Run an `awk' program (naturally) over the shell variable's
+ contents to expand `@include' statements. The expanded program is
+ placed in a second shell variable.
4. Run the expanded program with `gawk' and any other original
command-line arguments that the user supplied (such as the data
file names).
+ This program uses shell variables extensively; for storing command
+line arguments, the text of the `awk' program that will expand the
+user's program, for the user's original program, and for the expanded
+program. Doing so removes some potential problems that might arise
+were we to use temporary files instead, at the cost of making the
+script somewhat more complicated.
+
The initial part of the program turns on shell tracing if the first
-argument is `debug'. Otherwise, a shell `trap' statement arranges to
-clean up any temporary files on program exit or upon an interrupt.
+argument is `debug'.
The next part loops through all the command-line arguments. There
are several cases of interest:
@@ -15902,12 +16135,16 @@ are several cases of interest:
These are saved and passed on to `gawk'.
`-f, --file, --file=, -Wfile='
- The file name is saved to the temporary file `/tmp/ig.s.$$' with an
- `@include' statement. The `sed' utility is used to remove the
- leading option part of the argument (e.g., `--file=').
+ The file name is appended to the shell variable `program' with an
+ `@include' statement. The `expr' utility is used to remove the
+ leading option part of the argument (e.g., `--file='). (Typical
+ `sh' usage would be to use the `echo' and `sed' utilities to do
+ this work. Unfortunately, some versions of `echo' evaluate escape
+ sequences in their arguments, possibly mangling the program text.
+ Using `expr' avoids this problem.)
`--source, --source=, -Wsource='
- The source text is echoed into `/tmp/ig.s.$$'.
+ The source text is appended to `program'.
`--version, -Wversion'
`igawk' prints its version number, runs `gawk --version' to get
@@ -15917,14 +16154,11 @@ are several cases of interest:
arguments are supplied, then the first nonoption argument should be the
`awk' program. If there are no command-line arguments left, `igawk'
prints an error message and exits. Otherwise, the first argument is
-echoed into `/tmp/ig.s.$$'. In any case, after the arguments have been
-processed, `/tmp/ig.s.$$' contains the complete text of the original
-`awk' program.
+appended to `program'. In any case, after the arguments have been
+processed, `program' contains the complete text of the original `awk'
+program.
- The `$$' in `sh' represents the current process ID number. It is
-often used in shell programs to generate unique temporary file names.
-This allows multiple users to run `igawk' without worrying that the
-temporary file names will clash. The program is as follows:
+ The program is as follows:
#! /bin/sh
# igawk --- like gawk but do @include processing
@@ -15932,49 +16166,56 @@ temporary file names will clash. The program is as follows:
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 ;;
@@ -15985,29 +16226,25 @@ temporary file names will clash. The program is as follows:
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
-
- The `awk' program to process `@include' directives reads through the
-program, one line at a time, using `getline' (*note Explicit Input with
-`getline': Getline.). The input file names and `@include' statements
-are managed using a stack. As each `@include' is encountered, the
-current file name is "pushed" onto the stack and the file named in the
-`@include' directive becomes the current file name. As each file is
-finished, the stack is "popped," and the previous input file becomes
-the current input file again. The process is started by making the
-original file the first one on the stack.
+ # At this point, `program' has the program.
+
+ The `awk' program to process `@include' directives is stored in the
+shell variable `expand_prog'. Doing this keeps the shell script
+readable. The `awk' program reads through the user's program, one line
+at a time, using `getline' (*note Explicit Input with `getline':
+Getline.). The input file names and `@include' statements are managed
+using a stack. As each `@include' is encountered, the current file
+name is "pushed" onto the stack and the file named in the `@include'
+directive becomes the current file name. As each file is finished, the
+stack is "popped," and the previous input file becomes the current
+input file again. The process is started by making the original file
+the first one on the stack.
The `pathto' function does the work of finding the full path to a
file. It simulates `gawk''s behavior when searching the `AWKPATH'
@@ -16016,11 +16253,10 @@ Variable.). If a file name has a `/' in it, no path search is done.
Otherwise, the file name is concatenated with the name of each
directory in the path, and an attempt is made to open the generated
file name. The only way to test if a file can be read in `awk' is to go
-ahead and try to read it with `getline'; this is what `pathto' does.(1)
+ahead and try to read it with `getline'; this is what `pathto' does.(2)
If the file can be read, it is closed and the file name is returned:
- gawk -- '
- # process @include directives
+ expand_prog='
function pathto(file, i, t, junk)
{
@@ -16051,12 +16287,12 @@ represents the current directory:
pathlist[i] = "."
}
- The stack is initialized with `ARGV[1]', which will be
-`/tmp/ig.s.$$'. The main loop comes next. Input lines are read in
-succession. Lines that do not start with `@include' are printed
-verbatim. If the line does start with `@include', the file name is in
-`$2'. `pathto' is called to generate the full path. If it cannot,
-then we print an error message and continue.
+ The stack is initialized with `ARGV[1]', which will be `/dev/stdin'.
+The main loop comes next. Input lines are read in succession. Lines
+that do not start with `@include' are printed verbatim. If the line
+does start with `@include', the file name is in `$2'. `pathto' is
+called to generate the full path. If it cannot, then we print an error
+message and continue.
The next thing to check is if the file is included already. The
`processed' array is indexed by the full file name of each included
@@ -16093,19 +16329,48 @@ zero, the program is done:
}
close(input[stackptr])
}
- }' /tmp/ig.s.$$ > /tmp/ig.e.$$
+ }' # close quote ends `expand_prog' variable
+
+ processed_program=`gawk -- "$expand_prog" /dev/stdin <<EOF
+ $program
+ EOF
+ `
+
+ The shell construct `COMMAND << MARKER' is called a "here document".
+Everything in the shell script up to the MARKER is fed to COMMAND as
+input. The shell processes the contents of the here document for
+variable and command substitution (and possibly other things as well,
+depending upon the shell).
+
+ The shell construct ``...`' is called "command substitution". The
+output of the command between the two backquotes (grave accents) is
+substituted into the command line. It is saved as a single string,
+even if the results contain whitespace.
+
+ The expanded program is saved in the variable `processed_program'.
+It's done in these steps:
+
+ 1. Run `gawk' with the `@include'-processing program (the value of
+ the `expand_prog' shell variable) on standard input.
+
+ 2. Standard input is the contents of the user's program, from the
+ shell variable `program'. Its contents are fed to `gawk' via a
+ here document.
+
+ 3. The results of this processing are saved in the shell variable
+ `processed_program' by using command substitution.
The last step is to call `gawk' with the expanded program, along
with the original options and command-line arguments that the user
-supplied. `gawk''s exit status is passed back on to `igawk''s calling
-program:
+supplied.
- eval gawk -f /tmp/ig.e.$$ $opts -- "$@"
-
- exit $?
+ eval gawk $opts -- '"$processed_program"' '"$@"'
- This version of `igawk' represents my third attempt at this program.
-There are three key simplifications that make the program work better:
+ The `eval' command is a shell construct that reruns the shell's
+parsing process. This keeps things properly quoted.
+
+ This version of `igawk' represents my fourth attempt at this program.
+There are four key simplifications that make the program work better:
* Using `@include' even for the files named with `-f' makes building
the initial collected `awk' program much simpler; all the
@@ -16119,6 +16384,12 @@ There are three key simplifications that make the program work better:
place. It is not necessary to call out to a separate loop for
processing nested `@include' statements.
+ * Instead of saving the expanded program in a temporary file,
+ putting it in a shell variable avoids some potential security
+ problems. This has the disadvantage that the script relies upon
+ more features of the `sh' language, making it harder to follow for
+ those who aren't familiar with `sh'.
+
Also, this program illustrates that it is often worthwhile to combine
`sh' and `awk' programming together. You can usually accomplish quite
a lot, without having to resort to low-level programming in C or C++,
@@ -16152,7 +16423,11 @@ for the desired library functions.
---------- Footnotes ----------
- (1) On some very old versions of `awk', the test `getline junk < t'
+ (1) Fully explaining the `sh' language is beyond the scope of this
+book. We provide some minimal explanations, but see a good shell
+programming book if you wish to understand things in more depth.
+
+ (2) On some very old versions of `awk', the test `getline junk < t'
can loop forever if the file exists but is empty. Caveat emptor.

@@ -16547,10 +16822,10 @@ options (*note Command-Line Options: Options.).
* Positional specifiers in `printf' formats for making translations
easier (*note Rearranging `printf' Arguments: Printf Ordering.).
- * The `asort' function for sorting arrays (*note Sorting Array
- Values and Indices with `gawk': Array Sorting.).
+ * The `asort' and `asorti' functions for sorting arrays (*note
+ Sorting Array Values and Indices with `gawk': Array Sorting.).
- * The `bindtextdomain' and `dcgettext' functions for
+ * The `bindtextdomain', `dcgettext' and `dcngettext' functions for
internationalization (*note Internationalizing `awk' Programs:
Programmer i18n.).
@@ -16603,6 +16878,10 @@ options (*note Command-Line Options: Options.).
* The source code now uses new-style function definitions, with
`ansi2knr' to convert the code on systems with old compilers.
+ * The `--disable-lint' configuration option to disable lint checking
+ at compile time (*note Additional Configuration Options:
+ Additional Configuration Options.).
+

File: gawk.info, Node: Contributors, Prev: POSIX/GNU, Up: Language History
@@ -16774,20 +17053,20 @@ Extracting the Distribution
`gawk' is distributed as a `tar' file compressed with the GNU Zip
program, `gzip'.
- Once you have the distribution (for example, `gawk-3.1.1.tar.gz'),
+ Once you have the distribution (for example, `gawk-3.1.2.tar.gz'),
use `gzip' to expand the file and then use `tar' to extract it. You
can use the following pipeline to produce the `gawk' distribution:
# Under System V, add 'o' to the tar options
- gzip -d -c gawk-3.1.1.tar.gz | tar -xvpf -
+ gzip -d -c gawk-3.1.2.tar.gz | tar -xvpf -
-This creates a directory named `gawk-3.1.1' in the current directory.
+This creates a directory named `gawk-3.1.2' in the current directory.
The distribution file name is of the form `gawk-V.R.P.tar.gz'. The
V represents the major version of `gawk', the R represents the current
release of version V, and the P represents a "patch level", meaning
that minor bugs have been fixed in the release. The current patch
-level is 1, but when retrieving distributions, you should get the
+level is 2, but when retrieving distributions, you should get the
version with the highest version, release, and patch level. (Note,
however, that patch levels greater than or equal to 80 denote "beta" or
nonproduction software; you might not want to retrieve such a version
@@ -16981,7 +17260,7 @@ Compiling `gawk' for Unix
-------------------------
After you have extracted the `gawk' distribution, `cd' to
-`gawk-3.1.1'. Like most GNU software, `gawk' is configured
+`gawk-3.1.2'. Like most GNU software, `gawk' is configured
automatically for your Unix system by running the `configure' program.
This program is a Bourne shell script that is generated automatically
using GNU `autoconf'. (The `autoconf' software is described fully
@@ -17038,6 +17317,22 @@ command line when compiling `gawk' from scratch, including:
(or later) of the GNU C library. All known modern GNU/Linux
systems use Glibc 2. Use this option on any other system.
+`--disable-lint'
+ This option disables all lint checking within `gawk'. The
+ `--lint' and `--lint-old' options (*note Command-Line Options:
+ Options.) are accepted, but silently do nothing. Similarly,
+ setting the `LINT' variable (*note Built-in Variables That Control
+ `awk': User-modified.) has no effect on the running `awk' program.
+
+ When used with GCC's automatic dead-code-elimination, this option
+ cuts almost 200K bytes off the size of the `gawk' executable on
+ GNU/Linux x86 systems. Results on other systems and with other
+ compilers are likely to vary. Using this option may bring you
+ some slight performance improvement.
+
+ Using this option will cause some of the tests in the test suite
+ to fail. This option may be removed at a later date.
+
`--disable-nls'
Disable all message-translation facilities. This is usually not
desirable, but it may bring you some slight performance
@@ -17247,15 +17542,19 @@ Compiling `gawk' for PC Operating Systems
development tools from DJ Delorie (DJGPP; MS-DOS only) or Eberhard
Mattes (EMX; MS-DOS, Win32 and OS/2). Microsoft Visual C/C++ can be
used to build a Win32 version, and Microsoft C/C++ can be used to build
-16-bit versions for MS-DOS and OS/2. The file `README_d/README.pc' in
-the `gawk' distribution contains additional notes, and `pc/Makefile'
-contains important information on compilation options.
-
- To build `gawk' for MS-DOS, Win32, and OS/2 (16 bit; for 32 bit (EMX)
-see below), copy the files in the `pc' directory (_except_ for
-`ChangeLog') to the directory with the rest of the `gawk' sources. The
-`Makefile' contains a configuration section with comments and may need
-to be edited in order to work with your `make' utility.
+16-bit versions for MS-DOS and OS/2. (As of `gawk' 3.1.2, the MSC
+version doesn't work. However, the maintainer is working on fixing it.)
+The file `README_d/README.pc' in the `gawk' distribution contains
+additional notes, and `pc/Makefile' contains important information on
+compilation options.
+
+ To build `gawk' for MS-DOS, Win32, and OS/2 (16 bit only; for 32 bit
+(EMX) you can use the `configure' script and skip the following
+paragraphs; for details see below), copy the files in the `pc'
+directory (_except_ for `ChangeLog') to the directory with the rest of
+the `gawk' sources. The `Makefile' contains a configuration section
+with comments and may need to be edited in order to work with your
+`make' utility.
The `Makefile' contains a number of targets for building various
MS-DOS, Win32, and OS/2 versions. A list of targets is printed if the
@@ -17273,63 +17572,73 @@ the file `pc/Makefile.tst' over the file `test/Makefile' as a
replacement. Details can be found in `README_d/README.pc' and in the
file `pc/Makefile.tst'.
- To build `gawk' for OS/2 (32 bit, EMX), there are three
-possibilities:
-
- 1. Using the `configure' script included in the official `gawk'
- distribution. `configure' need not be recreated but a number of
- restrictions exist when using this choice:
-
- * An external `gettext' library cannot be used. I.e. the
- `configure' option `--without-included-gettext' does not
- work. Unfortunately, the internal `gettext' library is
- seriuosly broken for OS/2. Therefore you have to use
- `--disable-nls'.
-
- * Executables must be linked statically (`a.out' format only).
- `make install' does not work.
-
- These restrictions are due to restrictions in Autoconf 2.13
- and cannot be avoided. They will vanish as soon as `gawk'
- moves on to Autoconf 2.5x. Now enter the following commands
- at your `sh' prompt:
-
- $ CC="gcc"; export CC
- $ CFLAGS="-O2"; export CFLAGS
- $ AWK="awk"; export AWK
- $ LD="ld"; export LD
- $ LDFLAGS="-Zexe"; export LDFLAGS
- $ RANLIB="ranlib"; export RANLIB
- $ ac_cv_header_sys_socket_h="yes"
- $ export ac_cv_header_sys_socket_h
- $ ./configure --prefix=c:/usr --disable-nls
- $ make
-
- 2. Using a special version of Autoconf 2.13 for OS/2 to recreate
- `configure'. Not tested. In principle this should work but the
- same restrictions apply as in 1, but the environment variables
- `CC', `AWK', `LDFLAGS' and `RANLIB' are not necessary.
-
- 3. Using Autoconf 2.5x to recreate `configure' (2.52f or higher
- recommended). Some patches must be applied to `Makefile.am' and
- `test/Makefile.am' and `po/Makefile.in.in'. Currently not
- supported.
-
- *Note:* Even if the compiled `gawk.exe' executable contains a DOS
-header (`a.out' format), it does _not_ work under DOS. To compile an
-executable that runs under DOS, `CPPFLAGS' must be set to
-`"-DPIPES_SIMULATED"'. But then some nonstandard extensions of `gawk'
-(e.g., `|&') do not work!
+ The 32 bit EMX version of `gawk' works "out of the box" under OS/2.
+In principle, it is possible to compile `gawk' the following way:
+
+ $ ./configure
+ $ make
+
+ This is not recommended, though. To get an OMF executable you should
+use the following commands at your `sh' prompt:
+
+ $ CPPFLAGS="-D__ST_MT_ERRNO__"
+ $ export CPPFLAGS
+ $ CFLAGS="-O2 -Zomf -Zmt"
+ $ export CFLAGS
+ $ LDFLAGS="-s -Zcrtdll -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x8000"
+ $ export LDFLAGS
+ $ RANLIB="echo"
+ $ export RANLIB
+ $ ./configure --prefix=c:/usr --without-included-gettext
+ $ make AR=emxomfar
+
+ These are just suggestions. You may use any other set of
+(self-consistent) environment variables and compiler flags.
+
+ To get an FHS-compliant file hierarchy it is recommended to use the
+additional `configure' options `--infodir=c:/usr/share/info',
+`--mandir=c:/usr/share/man' and `--libexecdir=c:/usr/lib'.
+
+ The internal `gettext' library tends to be problematic. It is
+therefore recommended to use either an external one
+(`--without-included-gettext') or to disable NLS entirely
+(`--disable-nls').
+
+ If you use GCC 2.95 or newer it is recommended to use also:
+
+ $ LIBS="-lgcc"
+ $ export LIBS
+
+ You can also get an `a.out' executable if you prefer:
+
+ $ CPPFLAGS="-D__ST_MT_ERRNO__"
+ $ export CPPFLAGS
+ $ CFLAGS="-O2 -Zmt"
+ $ export CFLAGS
+ $ LDFLAGS="-s -Zstack 0x8000"
+ $ LIBS="-lgcc"
+ $ unset RANLIB
+ $ ./configure --prefix=c:/usr --without-included-gettext
+ $ make
+
+ *Note:* Even if the compiled `gawk.exe' (`a.out') executable
+contains a DOS header, it does _not_ work under DOS. To compile an
+executable that runs under DOS, `"-DPIPES_SIMULATED"' must be added to
+`CPPFLAGS'. But then some nonstandard extensions of `gawk' (e.g.,
+`|&') do not work!
After compilation the internal tests can be performed. Enter `make
check CMP="diff -a"' at your command prompt. All tests but the `pid'
-test are expected to work properly. The `pid' test might or might not
-work, no idea why.
+test are expected to work properly. The `pid' test fails because child
+processes are not started by `fork()'.
+
+ `make install' works as expected.
*Note:* Most OS/2 ports of GNU `make' are not able to handle the
Makefiles of this package. If you encounter any problems with `make'
-try GNU `make' 3.79.1. You should find the latest version on
-`ftp://ftp.unixos2.org'.
+try GNU Make 3.79.1 or later versions. You should find the latest
+version on `http://www.unixos2.org/sw/pub/binary/make/' or on
+`ftp://hobbes.nmsu.edu/pub/os2/'.

File: gawk.info, Node: PC Using, Next: Cygwin, Prev: PC Compiling, Up: PC Installation
@@ -17443,8 +17752,8 @@ simulation of Unix, using the GNU tools, such as `bash', the GNU
Compiler Collection (GCC), GNU Make, and other GNU tools. Compilation
and installation for Cygwin is the same as for a Unix system:
- tar -xvpzf gawk-3.1.1.tar.gz
- cd gawk-3.1.1
+ tar -xvpzf gawk-3.1.2.tar.gz
+ cd gawk-3.1.2
./configure
make
@@ -17864,7 +18173,7 @@ MS-Windows Juan Grigera, <juan@biophnet.unlp.edu.ar>.
OS/2 The Unix for OS/2 team,
<gawk-maintainer@unixos2.org>.
Tandem Stephen Davies, <scldad@sdc.com.au>.
-VMS Pat Rankin, <rankin@eql.caltech.edu>.
+VMS Pat Rankin, <rankin@pactechdata.com>.
If your bug is also reproducible under Unix, please send a copy of
your report to the <bug-gawk@gnu.org> email list as well.
@@ -17959,7 +18268,17 @@ Unix `awk'
under the LGPL.
To get `awka', go to `http://awka.sourceforge.net'. You can reach
- Andrew Sumner at <andrew_sumner@bigfoot.com>.
+ Andrew Sumner at <andrew@zbcom.net>.
+
+`pawk'
+ Nelson H.F. Beebe at the University of Utah has modified the Bell
+ Labs `awk' to provide timing and profiling information. It is
+ different from `pgawk' (*note Profiling Your `awk' Programs:
+ Profiling.), in that it uses CPU-based profiling, not line-count
+ profiling. You may find it at either
+ `ftp://ftp.math.utah.edu/pub/pawk/pawk-20020210.tar.gz' or
+ `http://www.math.utah.edu/pub/pawk/pawk-20020210.tar.gz'.
+
---------- Footnotes ----------
@@ -18056,8 +18375,10 @@ make it possible for me to include your changes:
haven't read it, please do so, preferably _before_ starting to
modify `gawk'. (The `GNU Coding Standards' are available from the
GNU Project's `ftp' site, at
- `ftp://ftp.gnu.org/gnu/GNUInfo/standards.text'. Texinfo, Info,
- and DVI versions are also available.)
+ `ftp://ftp.gnu.org/gnu/GNUinfo/standards.text'. An HTML version,
+ suitable for reading with a WWW browser, is available at
+ `http://www.gnu.org/prep/standards_toc.html'. Texinfo, Info, and
+ DVI versions are also available.)
4. Use the `gawk' coding style. The C code for `gawk' follows the
instructions in the `GNU Coding Standards', with minor exceptions.
@@ -18878,11 +19199,6 @@ Integrating the DBUG library
Following is a list of probable improvements that will make `gawk'
perform better:
-An improved version of `dfa'
- The `dfa' pattern matcher from GNU `grep' has some problems.
- Either a new version or a fixed one will deal with some important
- regexp matching issues.
-
Compilation of `awk' programs
`gawk' uses a Bison (YACC-like) parser to convert the script given
it into a syntax tree; the syntax tree is then executed by a
@@ -19213,7 +19529,7 @@ noted and can affect comparisons.
---------- Footnotes ----------
- (1) `http://www.validgh.com/goldberg/paper.ps'.
+ (1) `http://www.validlab.com/goldberg/paper.ps'.
(2) Pathological cases can require up to 752 digits (!), but we
doubt that you need to worry about this.
@@ -20193,24 +20509,22 @@ File: gawk.info, Node: GNU Free Documentation License, Next: Index, Prev: Cop
GNU Free Documentation License
******************************
- Version 1.1, March 2000
-
- Copyright (C) 2000 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Version 1.2, November 2002
+ Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
-
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
- written document "free" in the sense of freedom: to assure everyone
- the effective freedom to copy and redistribute it, with or without
- modifying it, either commercially or noncommercially. Secondarily,
- this License preserves for the author and publisher a way to get
- credit for their work, while not being considered responsible for
- modifications made by others.
+ functional and useful document "free" in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+ author and publisher a way to get credit for their work, while not
+ being considered responsible for modifications made by others.
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense.
@@ -20226,60 +20540,71 @@ GNU Free Documentation License
We recommend this License principally for works whose purpose is
instruction or reference.
-
1. APPLICABILITY AND DEFINITIONS
- This License applies to any manual or other work that contains a
- notice placed by the copyright holder saying it can be distributed
- under the terms of this License. The "Document", below, refers to
- any such manual or work. Any member of the public is a licensee,
- and is addressed as "you".
+ This License applies to any manual or other work, in any medium,
+ that contains a notice placed by the copyright holder saying it
+ can be distributed under the terms of this License. Such a notice
+ grants a world-wide, royalty-free license, unlimited in duration,
+ to use that work under the conditions stated herein. The
+ "Document", below, refers to any such manual or work. Any member
+ of the public is a licensee, and is addressed as "you". You
+ accept the license if you copy, modify or distribute the work in a
+ way requiring permission under copyright law.
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
- A "Secondary Section" is a named appendix or a front-matter
- section of the Document that deals exclusively with the
- relationship of the publishers or authors of the Document to the
- Document's overall subject (or to related matters) and contains
- nothing that could fall directly within that overall subject.
- (For example, if the Document is in part a textbook of
- mathematics, a Secondary Section may not explain any mathematics.)
- The relationship could be a matter of historical connection with
- the subject or with related matters, or of legal, commercial,
- philosophical, ethical or political position regarding them.
+ A "Secondary Section" is a named appendix or a front-matter section
+ of the Document that deals exclusively with the relationship of the
+ publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could
+ fall directly within that overall subject. (Thus, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.
The "Invariant Sections" are certain Secondary Sections whose
titles are designated, as being those of Invariant Sections, in
the notice that says that the Document is released under this
- License.
+ License. If a section does not fit the above definition of
+ Secondary then it is not allowed to be designated as Invariant.
+ The Document may contain zero Invariant Sections. If the Document
+ does not identify any Invariant Sections then there are none.
The "Cover Texts" are certain short passages of text that are
listed, as Front-Cover Texts or Back-Cover Texts, in the notice
- that says that the Document is released under this License.
+ that says that the Document is released under this License. A
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
- general public, whose contents can be viewed and edited directly
- and straightforwardly with generic text editors or (for images
+ general public, that is suitable for revising the document
+ straightforwardly with generic text editors or (for images
composed of pixels) generic paint programs or (for drawings) some
widely available drawing editor, and that is suitable for input to
text formatters or for automatic translation to a variety of
formats suitable for input to text formatters. A copy made in an
- otherwise Transparent file format whose markup has been designed
- to thwart or discourage subsequent modification by readers is not
- Transparent. A copy that is not "Transparent" is called "Opaque".
+ otherwise Transparent file format whose markup, or absence of
+ markup, has been arranged to thwart or discourage subsequent
+ modification by readers is not Transparent. An image format is
+ not Transparent if used for any substantial amount of text. A
+ copy that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format,
SGML or XML using a publicly available DTD, and
- standard-conforming simple HTML designed for human modification.
- Opaque formats include PostScript, PDF, proprietary formats that
- can be read and edited only by proprietary word processors, SGML
- or XML for which the DTD and/or processing tools are not generally
- available, and the machine-generated HTML produced by some word
- processors for output purposes only.
+ standard-conforming simple HTML, PostScript or PDF designed for
+ human modification. Examples of transparent image formats include
+ PNG, XCF and JPG. Opaque formats include proprietary formats that
+ can be read and edited only by proprietary word processors, SGML or
+ XML for which the DTD and/or processing tools are not generally
+ available, and the machine-generated HTML, PostScript or PDF
+ produced by some word processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the
@@ -20288,6 +20613,22 @@ GNU Free Documentation License
Page" means the text near the most prominent appearance of the
work's title, preceding the beginning of the body of the text.
+ A section "Entitled XYZ" means a named subunit of the Document
+ whose title either is precisely XYZ or contains XYZ in parentheses
+ following text that translates XYZ in another language. (Here XYZ
+ stands for a specific section name mentioned below, such as
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
+ To "Preserve the Title" of such a section when you modify the
+ Document means that it remains a section "Entitled XYZ" according
+ to this definition.
+
+ The Document may include Warranty Disclaimers next to the notice
+ which states that this License applies to the Document. These
+ Warranty Disclaimers are considered to be included by reference in
+ this License, but only as regards disclaiming warranties: any other
+ implication that these Warranty Disclaimers may have is void and
+ has no effect on the meaning of this License.
+
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
@@ -20306,10 +20647,11 @@ GNU Free Documentation License
3. COPYING IN QUANTITY
- If you publish printed copies of the Document numbering more than
- 100, and the Document's license notice requires Cover Texts, you
- must enclose the copies in covers that carry, clearly and legibly,
- all these Cover Texts: Front-Cover Texts on the front cover, and
+ If you publish printed copies (or copies in media that commonly
+ have printed covers) of the Document, numbering more than 100, and
+ the Document's license notice requires Cover Texts, you must
+ enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and
Back-Cover Texts on the back cover. Both covers must also clearly
and legibly identify you as the publisher of these copies. The
front cover must present the full title with all words of the
@@ -20327,11 +20669,10 @@ GNU Free Documentation License
If you publish or distribute Opaque copies of the Document
numbering more than 100, you must either include a
machine-readable Transparent copy along with each Opaque copy, or
- state in or with each Opaque copy a publicly-accessible
- computer-network location containing a complete Transparent copy
- of the Document, free of added material, which the general
- network-using public has access to download anonymously at no
- charge using public-standard network protocols. If you use the
+ state in or with each Opaque copy a computer-network location from
+ which the general network-using public has access to download
+ using public-standard network protocols a complete Transparent
+ copy of the Document, free of added material. If you use the
latter option, you must take reasonably prudent steps, when you
begin distribution of Opaque copies in quantity, to ensure that
this Transparent copy will remain thus accessible at the stated
@@ -20365,7 +20706,8 @@ GNU Free Documentation License
entities responsible for authorship of the modifications in
the Modified Version, together with at least five of the
principal authors of the Document (all of its principal
- authors, if it has less than five).
+ authors, if it has fewer than five), unless they release you
+ from this requirement.
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
@@ -20386,10 +20728,10 @@ GNU Free Documentation License
H. Include an unaltered copy of this License.
- I. Preserve the section entitled "History", and its title, and
- add to it an item stating at least the title, year, new
+ I. Preserve the section Entitled "History", Preserve its Title,
+ and add to it an item stating at least the title, year, new
authors, and publisher of the Modified Version as given on
- the Title Page. If there is no section entitled "History" in
+ the Title Page. If there is no section Entitled "History" in
the Document, create one stating the title, year, authors,
and publisher of the Document as given on its Title Page,
then add an item describing the Modified Version as stated in
@@ -20404,9 +20746,9 @@ GNU Free Documentation License
Document itself, or if the original publisher of the version
it refers to gives permission.
- K. In any section entitled "Acknowledgements" or "Dedications",
- preserve the section's title, and preserve in the section all
- the substance and tone of each of the contributor
+ K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the
+ section all the substance and tone of each of the contributor
acknowledgements and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
@@ -20414,11 +20756,14 @@ GNU Free Documentation License
or the equivalent are not considered part of the section
titles.
- M. Delete any section entitled "Endorsements". Such a section
+ M. Delete any section Entitled "Endorsements". Such a section
may not be included in the Modified Version.
- N. Do not retitle any existing section as "Endorsements" or to
- conflict in title with any Invariant Section.
+ N. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no
@@ -20428,11 +20773,11 @@ GNU Free Documentation License
Version's license notice. These titles must be distinct from any
other section titles.
- You may add a section entitled "Endorsements", provided it contains
+ You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
- parties-for example, statements of peer review or that the text has
- been approved by an organization as the authoritative definition
- of a standard.
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
You may add a passage of up to five words as a Front-Cover Text,
and a passage of up to 25 words as a Back-Cover Text, to the end
@@ -20456,7 +20801,8 @@ GNU Free Documentation License
modified versions, provided that you include in the combination
all of the Invariant Sections of all of the original documents,
unmodified, and list them all as Invariant Sections of your
- combined work in its license notice.
+ combined work in its license notice, and that you preserve all
+ their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
@@ -20468,11 +20814,11 @@ GNU Free Documentation License
the list of Invariant Sections in the license notice of the
combined work.
- In the combination, you must combine any sections entitled
+ In the combination, you must combine any sections Entitled
"History" in the various original documents, forming one section
- entitled "History"; likewise combine any sections entitled
- "Acknowledgements", and any sections entitled "Dedications". You
- must delete all sections entitled "Endorsements."
+ Entitled "History"; likewise combine any sections Entitled
+ "Acknowledgements", and any sections Entitled "Dedications". You
+ must delete all sections Entitled "Endorsements."
6. COLLECTIONS OF DOCUMENTS
@@ -20493,20 +20839,20 @@ GNU Free Documentation License
A compilation of the Document or its derivatives with other
separate and independent documents or works, in or on a volume of
- a storage or distribution medium, does not as a whole count as a
- Modified Version of the Document, provided no compilation
- copyright is claimed for the compilation. Such a compilation is
- called an "aggregate", and this License does not apply to the
- other self-contained works thus compiled with the Document, on
- account of their being thus compiled, if they are not themselves
- derivative works of the Document.
+ a storage or distribution medium, is called an "aggregate" if the
+ copyright resulting from the compilation is not used to limit the
+ legal rights of the compilation's users beyond what the individual
+ works permit. When the Document is included an aggregate, this
+ License does not apply to the other works in the aggregate which
+ are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
- copies of the Document, then if the Document is less than one
- quarter of the entire aggregate, the Document's Cover Texts may be
- placed on covers that surround only the Document within the
- aggregate. Otherwise they must appear on covers around the whole
- aggregate.
+ copies of the Document, then if the Document is less than one half
+ of the entire aggregate, the Document's Cover Texts may be placed
+ on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic
+ form. Otherwise they must appear on printed covers that bracket
+ the whole aggregate.
8. TRANSLATION
@@ -20516,10 +20862,18 @@ GNU Free Documentation License
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
- translation of this License provided that you also include the
- original English version of this License. In case of a
- disagreement between the translation and the original English
- version of this License, the original English version will prevail.
+ translation of this License, and all the license notices in the
+ Document, and any Warrany Disclaimers, provided that you also
+ include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of
+ this License or a notice or disclaimer, the original version will
+ prevail.
+
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to
+ Preserve its Title (section 1) will typically require changing the
+ actual title.
9. TERMINATION
@@ -20549,7 +20903,6 @@ GNU Free Documentation License
you may choose any version ever published (not as a draft) by the
Free Software Foundation.
-
ADDENDUM: How to use this License for your documents
====================================================
@@ -20557,19 +20910,24 @@ ADDENDUM: How to use this License for your documents
the License in the document and put the following copyright and license
notices just after the title page:
-
Copyright (C) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.1
+ under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
- with the Invariant Sections being LIST THEIR TITLES, with the
- Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
-If you have no Invariant Sections, write "with no Invariant
-Sections" instead of saying which ones are invariant. If you have no
-Front-Cover Texts, write "no Front-Cover Texts" instead of "Front-Cover
-Texts being LIST"; likewise for Back-Cover Texts.
+
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover
+Texts, replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+
+ If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
@@ -20652,6 +21010,7 @@ Index
* --compat option: Options.
* --copyleft option: Options.
* --copyright option: Options.
+* --disable-lint configuration option: Additional Configuration Options.
* --disable-nls configuration option: Additional Configuration Options.
* --dump-variables option <1>: Library Names.
* --dump-variables option: Options.
@@ -20868,6 +21227,7 @@ Index
* asort function (gawk) <1>: String Functions.
* asort function (gawk): Array Sorting.
* asort function (gawk), arrays, sorting: Array Sorting.
+* asorti function (gawk): String Functions.
* assert function (C library): Assert Function.
* assert user-defined function: Assert Function.
* assertions: Assert Function.
@@ -20982,6 +21342,7 @@ Index
* backslash (\), regexp constants: Computed Regexps.
* BBS-list file: Sample Data Files.
* Beebe, Nelson: Acknowledgments.
+* Beebe, Nelson H.F.: Other Versions.
* BEGIN pattern <1>: BEGIN/END.
* BEGIN pattern <2>: Field Separators.
* BEGIN pattern: Records.
@@ -21133,6 +21494,7 @@ Index
* compound statements, control statements and: Statements.
* concatenating: Concatenation.
* conditional expressions: Conditional Exp.
+* configuration option, --disable-lint: Additional Configuration Options.
* configuration option, --disable-nls: Additional Configuration Options.
* configuration option, --enable-portals: Additional Configuration Options.
* configuration option, --with-included-gettext <1>: Additional Configuration Options.
@@ -22027,6 +22389,7 @@ Index
* patterns, ranges in: Ranges.
* patterns, regexp constants as: Expression Patterns.
* patterns, types of: Pattern Overview.
+* pawk profiling Bell Labs awk: Other Versions.
* PC operating systems, gawk on: PC Using.
* PC operating systems, gawk on, installing: PC Installation.
* percent sign (%), % operator: Precedence.
@@ -22308,8 +22671,7 @@ Index
* searching, files for regular expressions: Egrep Program.
* searching, for words: Dupword Program.
* sed utility <1>: Glossary.
-* sed utility <2>: Igawk Program.
-* sed utility <3>: Simple Sed.
+* sed utility <2>: Simple Sed.
* sed utility: Field Splitting Summary.
* semicolon (;): Statements/Lines.
* semicolon (;), AWKPATH variable and: PC Using.
@@ -22393,8 +22755,7 @@ Index
* statements, multiple: Statements/Lines.
* stlen internal variable: Internals.
* stptr internal variable: Internals.
-* stream editors <1>: Igawk Program.
-* stream editors <2>: Simple Sed.
+* stream editors <1>: Simple Sed.
* stream editors: Field Splitting Summary.
* strftime function (gawk): Time Functions.
* string constants: Scalar Constants.
@@ -22622,339 +22983,344 @@ Index

Tag Table:
-Node: Top353
-Node: Foreword26454
-Node: Preface30778
-Ref: Preface-Footnote-133660
-Node: History33892
-Node: Names36151
-Ref: Names-Footnote-137660
-Node: This Manual37732
-Ref: This Manual-Footnote-142925
-Node: Conventions43025
-Node: Manual History44902
-Ref: Manual History-Footnote-148588
-Ref: Manual History-Footnote-248629
-Node: How To Contribute48703
-Node: Acknowledgments49301
-Node: Getting Started53106
-Node: Running gawk55499
-Node: One-shot56704
-Node: Read Terminal57961
-Ref: Read Terminal-Footnote-159610
-Node: Long59781
-Node: Executable Scripts61182
-Ref: Executable Scripts-Footnote-162918
-Ref: Executable Scripts-Footnote-263069
-Node: Comments63520
-Node: Quoting65912
-Node: Sample Data Files69890
-Node: Very Simple72968
-Node: Two Rules77588
-Node: More Complex79787
-Ref: More Complex-Footnote-182710
-Ref: More Complex-Footnote-283186
-Node: Statements/Lines83269
-Ref: Statements/Lines-Footnote-187628
-Node: Other Features87937
-Node: When88802
-Node: Regexp90791
-Node: Regexp Usage92181
-Node: Escape Sequences94272
-Node: Regexp Operators100184
-Ref: Regexp Operators-Footnote-1107325
-Ref: Regexp Operators-Footnote-2107472
-Node: Character Lists107570
-Node: GNU Regexp Operators112039
-Node: Case-sensitivity115534
-Ref: Case-sensitivity-Footnote-1118659
-Node: Leftmost Longest118894
-Node: Computed Regexps120208
-Node: Reading Files123599
-Node: Records125385
-Ref: Records-Footnote-1133263
-Node: Fields133300
-Ref: Fields-Footnote-1136355
-Node: Nonconstant Fields136441
-Node: Changing Fields138693
-Node: Field Separators143403
-Node: Regexp Field Splitting146947
-Node: Single Character Fields149448
-Node: Command Line Field Separator150511
-Node: Field Splitting Summary153962
-Ref: Field Splitting Summary-Footnote-1156065
-Node: Constant Size156166
-Node: Multiple Line160740
-Node: Getline166171
-Node: Plain Getline168234
-Node: Getline/Variable170284
-Node: Getline/File171416
-Node: Getline/Variable/File172841
-Node: Getline/Pipe174464
-Node: Getline/Variable/Pipe176671
-Node: Getline/Coprocess177887
-Node: Getline/Variable/Coprocess179161
-Node: Getline Notes179909
-Node: Getline Summary181258
-Node: Printing181965
-Node: Print183679
-Node: Print Examples185060
-Node: Output Separators187957
-Node: OFMT189773
-Node: Printf191175
-Node: Basic Printf192089
-Node: Control Letters193673
-Node: Format Modifiers196260
-Node: Printf Examples201312
-Node: Redirection204082
-Node: Special Files210806
-Node: Special FD211435
-Node: Special Process214474
-Node: Special Network216760
-Node: Special Caveats217675
-Ref: Special Caveats-Footnote-1218885
-Node: Close Files And Pipes219268
-Ref: Close Files And Pipes-Footnote-1226450
-Node: Expressions226598
-Node: Constants228786
-Node: Scalar Constants229482
-Ref: Scalar Constants-Footnote-1230346
-Node: Nondecimal-numbers230528
-Node: Regexp Constants233704
-Node: Using Constant Regexps234168
-Node: Variables237328
-Node: Using Variables237979
-Node: Assignment Options239520
-Node: Conversion241460
-Ref: Conversion-Footnote-1244691
-Node: Arithmetic Ops244800
-Node: Concatenation247297
-Node: Assignment Ops249992
-Node: Increment Ops256308
-Node: Truth Values259796
-Node: Typing and Comparison260841
-Ref: Typing and Comparison-Footnote-1267395
-Node: Boolean Ops267540
-Node: Conditional Exp271648
-Node: Function Calls273444
-Node: Precedence276417
-Node: Patterns and Actions279861
-Node: Pattern Overview280914
-Node: Regexp Patterns282527
-Node: Expression Patterns283086
-Node: Ranges286692
-Node: BEGIN/END289793
-Node: Using BEGIN/END290533
-Ref: Using BEGIN/END-Footnote-1293318
-Node: I/O And BEGIN/END293432
-Node: Empty295771
-Node: Using Shell Variables296070
-Node: Action Overview298430
-Node: Statements300996
-Node: If Statement302702
-Node: While Statement304211
-Node: Do Statement306234
-Node: For Statement307374
-Node: Break Statement310562
-Node: Continue Statement312666
-Node: Next Statement314605
-Node: Nextfile Statement316994
-Node: Exit Statement319748
-Node: Built-in Variables321857
-Node: User-modified322947
-Ref: User-modified-Footnote-1330533
-Node: Auto-set330595
-Ref: Auto-set-Footnote-1338618
-Node: ARGC and ARGV338823
-Node: Arrays342685
-Node: Array Intro344615
-Node: Reference to Elements348885
-Node: Assigning Elements350770
-Node: Array Example351232
-Node: Scanning an Array352955
-Node: Delete355279
-Ref: Delete-Footnote-1357729
-Node: Numeric Array Subscripts357786
-Node: Uninitialized Subscripts360065
-Node: Multi-dimensional361687
-Node: Multi-scanning364734
-Node: Array Sorting366406
-Node: Functions369220
-Node: Built-in369954
-Node: Calling Built-in370937
-Node: Numeric Functions372912
-Ref: Numeric Functions-Footnote-1376652
-Ref: Numeric Functions-Footnote-2376978
-Node: String Functions377247
-Ref: String Functions-Footnote-1393843
-Ref: String Functions-Footnote-2394002
-Node: Gory Details394089
-Ref: Gory Details-Footnote-1400676
-Ref: Gory Details-Footnote-2400727
-Node: I/O Functions400934
-Ref: I/O Functions-Footnote-1407611
-Node: Time Functions407702
-Ref: Time Functions-Footnote-1418476
-Ref: Time Functions-Footnote-2418544
-Ref: Time Functions-Footnote-3418702
-Ref: Time Functions-Footnote-4418813
-Ref: Time Functions-Footnote-5418938
-Ref: Time Functions-Footnote-6419197
-Node: Bitwise Functions419459
-Ref: Bitwise Functions-Footnote-1424157
-Node: I18N Functions424341
-Node: User-defined426085
-Node: Definition Syntax426861
-Node: Function Example431253
-Node: Function Caveats433894
-Node: Return Statement437794
-Node: Dynamic Typing440452
-Node: Internationalization441190
-Node: I18N and L10N442608
-Node: Explaining gettext443317
-Ref: Explaining gettext-Footnote-1448253
-Ref: Explaining gettext-Footnote-2448492
-Node: Programmer i18n448661
-Node: Translator i18n453007
-Node: String Extraction453792
-Ref: String Extraction-Footnote-1454794
-Node: Printf Ordering454920
-Ref: Printf Ordering-Footnote-1457711
-Node: I18N Portability457775
-Ref: I18N Portability-Footnote-1460213
-Node: I18N Example460276
-Ref: I18N Example-Footnote-1462913
-Node: Gawk I18N462985
-Node: Advanced Features463807
-Node: Nondecimal Data465239
-Node: Two-way I/O466846
-Ref: Two-way I/O-Footnote-1471508
-Node: TCP/IP Networking471585
-Node: Portal Files474048
-Node: Profiling474711
-Node: Invoking Gawk482337
-Node: Command Line483514
-Node: Options484314
-Ref: Options-Footnote-1496204
-Node: Other Arguments496229
-Node: AWKPATH Variable498981
-Ref: AWKPATH Variable-Footnote-1501764
-Node: Obsolete502024
-Node: Undocumented503105
-Node: Known Bugs503357
-Node: Library Functions503976
-Ref: Library Functions-Footnote-1507160
-Node: Library Names507331
-Ref: Library Names-Footnote-1510940
-Ref: Library Names-Footnote-2511159
-Node: General Functions511245
-Node: Nextfile Function512181
-Node: Assert Function516646
-Node: Round Function519977
-Node: Cliff Random Function521536
-Ref: Cliff Random Function-Footnote-1522519
-Node: Ordinal Functions522590
-Ref: Ordinal Functions-Footnote-1525664
-Node: Join Function525880
-Ref: Join Function-Footnote-1527684
-Node: Gettimeofday Function527884
-Node: Data File Management531662
-Node: Filetrans Function532223
-Node: Rewind Function535774
-Node: File Checking537398
-Node: Ignoring Assigns538444
-Node: Getopt Function540028
-Ref: Getopt Function-Footnote-1551177
-Node: Passwd Functions551378
-Ref: Passwd Functions-Footnote-1560100
-Node: Group Functions560188
-Node: Sample Programs568287
-Node: Running Examples569017
-Node: Clones569788
-Node: Cut Program570913
-Node: Egrep Program580778
-Ref: Egrep Program-Footnote-1588643
-Node: Id Program588753
-Node: Split Program592438
-Node: Tee Program595947
-Node: Uniq Program598618
-Node: Wc Program606128
-Ref: Wc Program-Footnote-1610442
-Node: Miscellaneous Programs610664
-Node: Dupword Program611653
-Node: Alarm Program613704
-Node: Translate Program618328
-Ref: Translate Program-Footnote-1622644
-Ref: Translate Program-Footnote-2622881
-Node: Labels Program623015
-Ref: Labels Program-Footnote-1626372
-Node: Word Sorting626456
-Node: History Sorting630759
-Node: Extract Program632628
-Node: Simple Sed640210
-Node: Igawk Program643407
-Ref: Igawk Program-Footnote-1656434
-Node: Language History656572
-Node: V7/SVR3.1657939
-Node: SVR4660534
-Node: POSIX662181
-Node: BTL663969
-Node: POSIX/GNU665786
-Node: Contributors674410
-Node: Installation677662
-Node: Gawk Distribution678641
-Node: Getting679141
-Node: Extracting680387
-Node: Distribution contents681766
-Node: Unix Installation687363
-Node: Quick Installation687949
-Node: Additional Configuration Options689696
-Node: Configuration Philosophy690791
-Node: Non-Unix Installation693174
-Node: Amiga Installation693756
-Node: BeOS Installation694901
-Node: PC Installation696073
-Node: PC Binary Installation697206
-Node: PC Compiling699060
-Node: PC Using703514
-Node: Cygwin708232
-Ref: Cygwin-Footnote-1709245
-Node: VMS Installation709277
-Node: VMS Compilation709796
-Node: VMS Installation Details711385
-Node: VMS Running713002
-Node: VMS POSIX714586
-Node: Unsupported715850
-Node: Atari Installation716248
-Node: Atari Compiling717569
-Node: Atari Using719498
-Node: Tandem Installation722362
-Node: Bugs724168
-Node: Other Versions727453
-Ref: Other Versions-Footnote-1731039
-Node: Notes731081
-Node: Compatibility Mode731754
-Node: Additions732596
-Node: Adding Code733368
-Node: New Ports739410
-Node: Dynamic Extensions743513
-Node: Internals744529
-Node: Sample Library750865
-Node: Internal File Description751515
-Node: Internal File Ops755267
-Ref: Internal File Ops-Footnote-1760683
-Node: Using Internal File Ops760831
-Node: Future Extensions762852
-Node: Basic Concepts767195
-Node: Basic High Level767933
-Ref: Basic High Level-Footnote-1772094
-Node: Basic Data Typing772288
-Node: Floating Point Issues776778
-Ref: Floating Point Issues-Footnote-1780701
-Ref: Floating Point Issues-Footnote-2780753
-Node: Glossary780862
-Node: Copying805171
-Node: GNU Free Documentation License824368
-Node: Index844250
+Node: Top1322
+Node: Foreword26566
+Node: Preface30890
+Ref: Preface-Footnote-133772
+Node: History34004
+Node: Names36263
+Ref: Names-Footnote-137772
+Node: This Manual37844
+Ref: This Manual-Footnote-143037
+Node: Conventions43137
+Node: Manual History45014
+Ref: Manual History-Footnote-148700
+Ref: Manual History-Footnote-248741
+Node: How To Contribute48815
+Node: Acknowledgments49413
+Node: Getting Started53218
+Node: Running gawk55611
+Node: One-shot56816
+Node: Read Terminal58073
+Ref: Read Terminal-Footnote-159722
+Node: Long59893
+Node: Executable Scripts61294
+Ref: Executable Scripts-Footnote-163190
+Ref: Executable Scripts-Footnote-263341
+Node: Comments63792
+Node: Quoting66184
+Node: Sample Data Files70162
+Node: Very Simple73240
+Node: Two Rules77860
+Node: More Complex80059
+Ref: More Complex-Footnote-182981
+Ref: More Complex-Footnote-283457
+Node: Statements/Lines83540
+Ref: Statements/Lines-Footnote-187899
+Node: Other Features88208
+Node: When89073
+Node: Regexp91062
+Node: Regexp Usage92515
+Node: Escape Sequences94606
+Node: Regexp Operators100518
+Ref: Regexp Operators-Footnote-1107710
+Ref: Regexp Operators-Footnote-2107857
+Node: Character Lists107955
+Node: GNU Regexp Operators112424
+Node: Case-sensitivity116045
+Ref: Case-sensitivity-Footnote-1119170
+Node: Leftmost Longest119405
+Node: Computed Regexps120719
+Node: Locales124126
+Node: Reading Files125575
+Node: Records127361
+Ref: Records-Footnote-1135677
+Node: Fields135714
+Ref: Fields-Footnote-1138769
+Node: Nonconstant Fields138855
+Node: Changing Fields141107
+Node: Field Separators146549
+Node: Regexp Field Splitting150093
+Node: Single Character Fields152594
+Node: Command Line Field Separator153657
+Node: Field Splitting Summary157108
+Ref: Field Splitting Summary-Footnote-1160331
+Node: Constant Size160432
+Node: Multiple Line165006
+Ref: Multiple Line-Footnote-1170787
+Node: Getline170966
+Node: Plain Getline173029
+Node: Getline/Variable175079
+Node: Getline/File176211
+Node: Getline/Variable/File177636
+Node: Getline/Pipe179259
+Node: Getline/Variable/Pipe181466
+Node: Getline/Coprocess182682
+Node: Getline/Variable/Coprocess183956
+Node: Getline Notes184704
+Node: Getline Summary186429
+Node: Printing187136
+Node: Print188850
+Node: Print Examples190231
+Node: Output Separators193128
+Node: OFMT194944
+Node: Printf196346
+Node: Basic Printf197260
+Node: Control Letters198844
+Node: Format Modifiers201431
+Node: Printf Examples206483
+Node: Redirection209253
+Node: Special Files215977
+Node: Special FD216606
+Node: Special Process219645
+Node: Special Network221931
+Node: Special Caveats222846
+Ref: Special Caveats-Footnote-1224056
+Node: Close Files And Pipes224439
+Ref: Close Files And Pipes-Footnote-1231853
+Ref: Close Files And Pipes-Footnote-2232001
+Node: Expressions232149
+Node: Constants234337
+Node: Scalar Constants235033
+Ref: Scalar Constants-Footnote-1235897
+Node: Nondecimal-numbers236079
+Node: Regexp Constants239255
+Node: Using Constant Regexps239719
+Node: Variables242879
+Node: Using Variables243530
+Node: Assignment Options245071
+Node: Conversion247011
+Ref: Conversion-Footnote-1250242
+Node: Arithmetic Ops250351
+Node: Concatenation252848
+Node: Assignment Ops255543
+Node: Increment Ops261859
+Node: Truth Values265347
+Node: Typing and Comparison266392
+Ref: Typing and Comparison-Footnote-1272946
+Node: Boolean Ops273091
+Node: Conditional Exp277199
+Node: Function Calls278995
+Node: Precedence281968
+Node: Patterns and Actions285412
+Node: Pattern Overview286465
+Node: Regexp Patterns288078
+Node: Expression Patterns288637
+Node: Ranges292243
+Node: BEGIN/END295344
+Node: Using BEGIN/END296084
+Ref: Using BEGIN/END-Footnote-1298869
+Node: I/O And BEGIN/END298983
+Node: Empty301322
+Node: Using Shell Variables301621
+Node: Action Overview303981
+Node: Statements306547
+Node: If Statement308253
+Node: While Statement309762
+Node: Do Statement311785
+Node: For Statement312925
+Node: Break Statement316113
+Node: Continue Statement318217
+Node: Next Statement320156
+Node: Nextfile Statement322545
+Node: Exit Statement325299
+Node: Built-in Variables327408
+Node: User-modified328498
+Ref: User-modified-Footnote-1336321
+Node: Auto-set336383
+Ref: Auto-set-Footnote-1344724
+Node: ARGC and ARGV344929
+Node: Arrays348791
+Node: Array Intro350721
+Node: Reference to Elements354991
+Node: Assigning Elements356876
+Node: Array Example357338
+Node: Scanning an Array359061
+Node: Delete361385
+Ref: Delete-Footnote-1363835
+Node: Numeric Array Subscripts363892
+Node: Uninitialized Subscripts366171
+Node: Multi-dimensional367793
+Node: Multi-scanning370840
+Node: Array Sorting372512
+Node: Functions375934
+Node: Built-in376668
+Node: Calling Built-in377651
+Node: Numeric Functions379626
+Ref: Numeric Functions-Footnote-1383366
+Ref: Numeric Functions-Footnote-2383692
+Node: String Functions383961
+Ref: String Functions-Footnote-1403266
+Ref: String Functions-Footnote-2403425
+Ref: String Functions-Footnote-3403672
+Node: Gory Details403759
+Ref: Gory Details-Footnote-1410346
+Ref: Gory Details-Footnote-2410397
+Node: I/O Functions410604
+Ref: I/O Functions-Footnote-1417281
+Node: Time Functions417372
+Ref: Time Functions-Footnote-1428146
+Ref: Time Functions-Footnote-2428214
+Ref: Time Functions-Footnote-3428372
+Ref: Time Functions-Footnote-4428483
+Ref: Time Functions-Footnote-5428608
+Ref: Time Functions-Footnote-6428867
+Node: Bitwise Functions429129
+Ref: Bitwise Functions-Footnote-1433827
+Node: I18N Functions434011
+Node: User-defined435755
+Node: Definition Syntax436531
+Node: Function Example440923
+Node: Function Caveats443564
+Node: Return Statement447464
+Node: Dynamic Typing450122
+Node: Internationalization450860
+Node: I18N and L10N452278
+Node: Explaining gettext452987
+Ref: Explaining gettext-Footnote-1457923
+Ref: Explaining gettext-Footnote-2458162
+Node: Programmer i18n458331
+Node: Translator i18n462677
+Node: String Extraction463462
+Ref: String Extraction-Footnote-1464464
+Node: Printf Ordering464590
+Ref: Printf Ordering-Footnote-1467381
+Node: I18N Portability467445
+Ref: I18N Portability-Footnote-1469883
+Node: I18N Example469946
+Ref: I18N Example-Footnote-1472583
+Node: Gawk I18N472655
+Node: Advanced Features473477
+Node: Nondecimal Data474909
+Node: Two-way I/O476516
+Ref: Two-way I/O-Footnote-1482093
+Node: TCP/IP Networking482170
+Node: Portal Files484633
+Node: Profiling485296
+Node: Invoking Gawk492922
+Node: Command Line494099
+Node: Options494899
+Ref: Options-Footnote-1506946
+Node: Other Arguments506971
+Node: AWKPATH Variable509723
+Ref: AWKPATH Variable-Footnote-1512506
+Node: Obsolete512766
+Node: Undocumented513847
+Node: Known Bugs514099
+Node: Library Functions514718
+Ref: Library Functions-Footnote-1517902
+Node: Library Names518073
+Ref: Library Names-Footnote-1521682
+Ref: Library Names-Footnote-2521901
+Node: General Functions521987
+Node: Nextfile Function522923
+Node: Assert Function527388
+Node: Round Function530719
+Node: Cliff Random Function532278
+Ref: Cliff Random Function-Footnote-1533261
+Node: Ordinal Functions533332
+Ref: Ordinal Functions-Footnote-1536406
+Node: Join Function536622
+Ref: Join Function-Footnote-1538426
+Node: Gettimeofday Function538626
+Node: Data File Management542404
+Node: Filetrans Function542965
+Node: Rewind Function546516
+Node: File Checking548140
+Node: Ignoring Assigns549186
+Node: Getopt Function550770
+Ref: Getopt Function-Footnote-1561919
+Node: Passwd Functions562120
+Ref: Passwd Functions-Footnote-1570859
+Node: Group Functions570947
+Node: Sample Programs579048
+Node: Running Examples579778
+Node: Clones580549
+Node: Cut Program581674
+Node: Egrep Program591539
+Ref: Egrep Program-Footnote-1599404
+Node: Id Program599514
+Node: Split Program603199
+Node: Tee Program606708
+Node: Uniq Program609379
+Node: Wc Program616889
+Ref: Wc Program-Footnote-1621203
+Node: Miscellaneous Programs621425
+Node: Dupword Program622414
+Node: Alarm Program624465
+Node: Translate Program629089
+Ref: Translate Program-Footnote-1633405
+Ref: Translate Program-Footnote-2633642
+Node: Labels Program633776
+Ref: Labels Program-Footnote-1637133
+Node: Word Sorting637217
+Node: History Sorting641520
+Node: Extract Program643389
+Node: Simple Sed650971
+Node: Igawk Program654168
+Ref: Igawk Program-Footnote-1669060
+Ref: Igawk Program-Footnote-2669261
+Node: Language History669399
+Node: V7/SVR3.1670766
+Node: SVR4673361
+Node: POSIX675008
+Node: BTL676796
+Node: POSIX/GNU678613
+Node: Contributors687441
+Node: Installation690693
+Node: Gawk Distribution691672
+Node: Getting692172
+Node: Extracting693418
+Node: Distribution contents694797
+Node: Unix Installation700394
+Node: Quick Installation700980
+Node: Additional Configuration Options702727
+Node: Configuration Philosophy704634
+Node: Non-Unix Installation707017
+Node: Amiga Installation707599
+Node: BeOS Installation708744
+Node: PC Installation709916
+Node: PC Binary Installation711049
+Node: PC Compiling712903
+Node: PC Using717416
+Node: Cygwin722134
+Ref: Cygwin-Footnote-1723147
+Node: VMS Installation723179
+Node: VMS Compilation723698
+Node: VMS Installation Details725287
+Node: VMS Running726904
+Node: VMS POSIX728488
+Node: Unsupported729752
+Node: Atari Installation730150
+Node: Atari Compiling731471
+Node: Atari Using733400
+Node: Tandem Installation736264
+Node: Bugs738070
+Node: Other Versions741355
+Ref: Other Versions-Footnote-1745386
+Node: Notes745428
+Node: Compatibility Mode746101
+Node: Additions746943
+Node: Adding Code747715
+Node: New Ports753888
+Node: Dynamic Extensions757991
+Node: Internals759007
+Node: Sample Library765343
+Node: Internal File Description765993
+Node: Internal File Ops769745
+Ref: Internal File Ops-Footnote-1775161
+Node: Using Internal File Ops775309
+Node: Future Extensions777330
+Node: Basic Concepts781477
+Node: Basic High Level782215
+Ref: Basic High Level-Footnote-1786376
+Node: Basic Data Typing786570
+Node: Floating Point Issues791060
+Ref: Floating Point Issues-Footnote-1794983
+Ref: Floating Point Issues-Footnote-2795036
+Node: Glossary795145
+Node: Copying819454
+Node: GNU Free Documentation License838651
+Node: Index861054

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index e5f50413..108b3320 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -4,13 +4,13 @@
@settitle The GNU Awk User's Guide
@c %**end of header (This is for running Texinfo on a region.)
-@dircategory GNU Packages
+@dircategory Text creation and manipulation
@direntry
-* Gawk: (gawk). A text scanning and processing language.
+* Gawk: (gawk). A text scanning and processing language.
@end direntry
@dircategory Individual utilities
@direntry
-* awk: (gawk)Invoking gawk. Text scanning and processing.
+* awk: (gawk)Invoking gawk. Text scanning and processing.
@end direntry
@c @set xref-automatic-section-title
@@ -20,9 +20,9 @@
@c applies to and all the info about who's publishing this edition
@c These apply across the board.
-@set UPDATE-MONTH April, 2002
+@set UPDATE-MONTH February, 2003
@set VERSION 3.1
-@set PATCHLEVEL 1
+@set PATCHLEVEL 2
@set FSF
@@ -54,6 +54,14 @@
@set SUBSECTION subsection
@set DARKCORNER (d.c.)
@end ifhtml
+@ifxml
+@set DOCUMENT book
+@set CHAPTER chapter
+@set APPENDIX appendix
+@set SECTION section
+@set SUBSECTION subsection
+@set DARKCORNER (d.c.)
+@end ifxml
@c some special symbols
@iftex
@@ -87,6 +95,10 @@ Some comments on the layout for TeX.
@syncodeindex fn cp
@syncodeindex vr cp
@end iftex
+@ifxml
+@syncodeindex fn cp
+@syncodeindex vr cp
+@end ifxml
@c If "finalout" is commented out, the printed output will show
@c black boxes that mark lines that are too long. Thus, it is
@@ -98,7 +110,7 @@ Some comments on the layout for TeX.
@end iftex
@copying
-Copyright @copyright{} 1989, 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+Copyright @copyright{} 1989, 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
@sp 2
This is Edition @value{EDITION} of @cite{@value{TITLE}: @value{SUBTITLE}},
@@ -106,7 +118,7 @@ for the @value{VERSION}.@value{PATCHLEVEL} (or later) version of the GNU
implementation of AWK.
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``GNU General Public License'', the Front-Cover
texts being (a) (see below), and with the Back-Cover Texts being (b)
@@ -219,6 +231,7 @@ Cover art by Etienne Suvasa.
@end iftex
@ifnottex
+@ifnotxml
@node Top, Foreword, (dir), (dir)
@top General Introduction
@c Preface node should come right after the Top
@@ -230,6 +243,7 @@ particular records in a file and perform operations upon them.
@insertcopying
+@end ifnotxml
@end ifnottex
@menu
@@ -319,6 +333,7 @@ particular records in a file and perform operations upon them.
* Case-sensitivity:: How to do case-insensitive matching.
* Leftmost Longest:: How much text matches.
* Computed Regexps:: Using Dynamic Regexps.
+* Locales:: How the locale affects things.
* Records:: Controlling how data is split into records.
* Fields:: An introduction to fields.
* Nonconstant Fields:: Nonconstant Field Numbers.
@@ -1099,13 +1114,13 @@ This @value{DOCUMENT} is written using Texinfo, the GNU documentation
formatting language.
A single Texinfo source file is used to produce both the printed and online
versions of the documentation.
-@iftex
+@ifnotinfo
Because of this, the typographical conventions
are slightly different than in other books you may have read.
-@end iftex
-@ifnottex
+@end ifnotinfo
+@ifinfo
This @value{SECTION} briefly documents the typographical conventions used in Texinfo.
-@end ifnottex
+@end ifinfo
Examples you would type at the command-line are preceded by the common
shell primary and secondary prompts, @samp{$} and @samp{>}.
@@ -1121,7 +1136,7 @@ $ echo hello on stderr 1>&2
@error{} hello on stderr
@end example
-@iftex
+@ifnotinfo
In the text, command names appear in @code{this font}, while code segments
appear in the same font and quoted, @samp{like this}. Some things are
emphasized @emph{like this}, and if a point needs to be made
@@ -1129,7 +1144,7 @@ strongly, it is done @strong{like this}. The first occurrence of
a new term is usually its @dfn{definition} and appears in the same
font as the previous occurrence of ``definition'' in this sentence.
@value{FN}s are indicated like this: @file{/path/to/ourfile}.
-@end iftex
+@end ifnotinfo
Characters that you type at the keyboard look @kbd{like this}. In particular,
there are special characters called ``control characters.'' These are
@@ -1844,6 +1859,10 @@ $ advice
@end example
@noindent
+(We assume you have the current directory in your shell's search
+path variable (typically @code{$PATH}). If not, you may need
+to type @samp{./advice} at the shell.)
+
Self-contained @command{awk} scripts are useful when you want to write a
program that users can invoke without their having to know that the program is
written in @command{awk}.
@@ -2453,7 +2472,7 @@ are automatically initialized to zero.)
After the last line of output from @command{ls} has been processed, the
@code{END} rule executes and prints the value of @code{sum}.
-In this example, the value of @code{sum} is 140963.
+In this example, the value of @code{sum} is 80600.
These more advanced @command{awk} techniques are covered in later sections
(@pxref{Action Overview, ,Actions}). Before you can move on to more
@@ -2699,6 +2718,7 @@ regular expressions work, we will present more complicated instances.
* Case-sensitivity:: How to do case-insensitive matching.
* Leftmost Longest:: How much text matches.
* Computed Regexps:: Using Dynamic Regexps.
+* Locales:: How the locale affects things.
@end menu
@node Regexp Usage, Escape Sequences, Regexp, Regexp
@@ -3124,7 +3144,8 @@ arithmetic. They can be used to concatenate regular expressions
containing the alternation operator, @samp{|}. For example,
@samp{@@(samp|code)\@{[^@}]+\@}} matches both @samp{@@code@{foo@}} and
@samp{@@samp@{bar@}}.
-(These are Texinfo formatting control sequences.)
+(These are Texinfo formatting control sequences. The @samp{+} is
+explained further on in this list.)
@cindex @code{*} (asterisk), @code{*} operator, as regexp operator
@cindex asterisk (@code{*}), @code{*} operator, as regexp operator
@@ -3556,7 +3577,9 @@ treated literally, even if they represent regexp metacharacters.
@item @code{--re-interval}
Allow interval expressions in regexps, even if @option{--traditional}
-has been provided.
+has been provided. (@option{--posix} automatically enables
+interval expressions, so @option{--re-interval} is redundant
+when @option{--posix} is is used.)
@end table
@c ENDOFRANGE gregexp
@c ENDOFRANGE regexpg
@@ -3698,7 +3721,7 @@ Understanding this principle is also important for regexp-based record
and field splitting (@pxref{Records, ,How Input Is Split into Records},
and also @pxref{Field Separators, ,Specifying How Fields Are Separated}).
-@node Computed Regexps, , Leftmost Longest, Regexp
+@node Computed Regexps, Locales, Leftmost Longest, Regexp
@section Using Dynamic Regexps
@c STARTOFRANGE dregexp
@@ -3814,6 +3837,46 @@ occur often in practice, but it's worth noting for future reference.
@c ENDOFRANGE regexpd
@c ENDOFRANGE regexp
+@node Locales, , Computed Regexps, Regexp
+@section Where You Are Makes A Difference
+
+Modern systems support the notion of @dfn{locales}: a way to tell
+the system about the local character set and language. The current
+locale setting can affect the way regexp matching works, often
+in surprising ways. In particular, many locales do case-insensitive
+matching, even when you may have specified characters of only
+one particular case.
+
+The following example uses the @code{sub} function, which
+does text replacement
+(@pxref{String Functions, , String-Manipulation Functions}).
+Here, the intent is to remove trailing uppercase characters:
+
+@example
+$ echo something1234abc | gawk '@{ sub("[A-Z]*$", ""); print @}'
+@print{} something1234
+@end example
+
+@noindent
+This output is unexpected, since the @samp{abc} at the end of @samp{something1234abc}
+should not normally match @samp{[A-Z]*}. This result is due to the
+locale setting (and thus you may not see it on your system).
+There are two fixes. The first is to use the POSIX character
+class @samp{[[:upper:]]}, instead of @samp{[A-Z]}.
+The second is to change the locale setting in the environment,
+before running @command{gawk},
+by using the shell statements:
+
+@example
+LANG=C LC_ALL=C
+export LANG LC_ALL
+@end example
+
+The setting @samp{C} forces @command{gawk} to behave in the traditional
+Unix manner, where case distinctions do matter.
+You may wish to put these statements into your shell startup file,
+e.g., @file{$HOME/.profile}.
+
@node Reading Files, Printing, Regexp, Top
@chapter Reading Input Files
@@ -4057,6 +4120,14 @@ supplies its own terminating newline.
@xref{Simple Sed, ,A Simple Stream Editor}, for a more useful example
of @code{RS} as a regexp and @code{RT}.
+If you set @code{RS} to a regular expression that allows optional
+trailing text, such as @samp{RS = "abc(XYZ)?"} it is possible, due
+to implementation constraints, that @command{gawk} may match the leading
+part of the regular expression, but not the trailing part, particularly
+if the input text that could match the trailing part is fairly long.
+@command{gawk} attempts to avoid this problem, but currently, there's
+no guarantee that this will never happen.
+
@cindex differences in @command{awk} and @command{gawk}, @code{RS}/@code{RT} variables
The use of @code{RS} as a regular expression and the @code{RT}
variable are @command{gawk} extensions; they are not available in
@@ -4258,6 +4329,7 @@ evaluating @code{NF} and using its value as a field number.
@node Changing Fields, Field Separators, Nonconstant Fields, Reading Files
@section Changing the Contents of a Field
+@c STARTOFRANGE ficon
@cindex fields, changing contents of
The contents of a field, as seen by @command{awk}, can be changed within an
@command{awk} program; this changes what @command{awk} perceives as the
@@ -4268,9 +4340,9 @@ Consider the following example and its output:
@example
$ awk '@{ nboxes = $3 ; $3 = $3 - 10
> print nboxes, $3 @}' inventory-shipped
-@print{} 13 3
-@print{} 15 5
-@print{} 15 5
+@print{} 25 15
+@print{} 32 22
+@print{} 24 14
@dots{}
@end example
@@ -4284,7 +4356,7 @@ Then it prints the original and new values for field three.
(Someone in the warehouse made a consistent mistake while inventorying
the red boxes.)
-For this to work, the text in field @code{$2} must make sense
+For this to work, the text in field @code{$3} must make sense
as a number; the string of characters must be converted to a number
for the computer to do arithmetic on it. The number resulting
from the subtraction is converted back to a string of characters that
@@ -4337,11 +4409,11 @@ existing fields.
@cindex field separators, See Also @code{OFS}
This recomputation affects and is affected by
@code{NF} (the number of fields; @pxref{Fields, ,Examining Fields}).
-It is also affected by a feature that has not been discussed yet:
-the @dfn{output field separator}, @code{OFS},
-used to separate the fields (@pxref{Output Separators}).
For example, the value of @code{NF} is set to the number of the highest
field you create.
+The exact format of @code{$0} is also affected by a feature that has not been discussed yet:
+the @dfn{output field separator}, @code{OFS},
+used to separate the fields (@pxref{Output Separators}).
Note, however, that merely @emph{referencing} an out-of-range field
does @emph{not} change the value of either @code{$0} or @code{NF}.
@@ -4410,6 +4482,27 @@ $ echo a b c d e f | awk '@{ print "NF =", NF;
@cindex portability, @code{NF} variable, decrementing
@strong{Caution:} Some versions of @command{awk} don't
rebuild @code{$0} when @code{NF} is decremented. Caveat emptor.
+
+Finally, there are times when it is convenient to force
+@command{awk} to rebuild the entire record, using the current
+value of the fields and @code{OFS}. To do this, use the
+seemingly innocuous assignment:
+
+@example
+$1 = $1 # force record to be reconstituted
+print $0 # or whatever else with $0
+@end example
+
+@noindent
+This forces @command{awk} rebuild the record. It does help
+to add a comment, as we've shown here.
+
+There is a flip side to the relationship between @code{$0} and
+the fields. Any assignment to @code{$0} causes the record to be
+reparsed into fields using the @emph{current} value of @code{FS}.
+This also applies to any built-in function that updates @code{$0},
+such as @code{sub} and @code{gsub}
+(@pxref{String Functions, ,String-Manipulation Functions}).
@c ENDOFRANGE ficon
@node Field Separators, Constant Size, Changing Fields, Reading Files
@@ -4759,10 +4852,17 @@ awk -F: '$2 == ""' /etc/passwd
@node Field Splitting Summary, , Command Line Field Separator, Field Separators
@subsection Field-Splitting Summary
-The following
-table
-summarizes how fields are split, based on the
-value of @code{FS} (@samp{==} means ``is equal to''):
+It is important to remember that when you assign a string constant
+as the value of @code{FS}, it undergoes normal @command{awk} string
+processing. For example, with Unix @command{awk} and @command{gawk},
+the assignment @samp{FS = "\.."} assigns the character string @code{".."}
+to @code{FS} (the backslash is stripped). This creates a regexp meaning
+``fields are separated by occurrences of any two characters.''
+If instead you want fields to be separated by a literal period followed
+by any single character, use @samp{FS = "\\.."}.
+
+The following table summarizes how fields are split, based on the value
+of @code{FS} (@samp{==} means ``is equal to''):
@table @code
@item FS == " "
@@ -4830,6 +4930,29 @@ prints something like:
@example
root:nSijPlPhZZwgE:0:0:Root:/:
@end example
+
+@c fakenode --- for prepinfo
+@subheading Advanced Notes: @code{FS} and @code{IGNORECASE}
+
+The @code{IGNORECASE} variable
+(@pxref{User-modified, ,Built-in Variables That Control @command{awk}})
+affects field splitting @emph{only} when the value of @code{FS} is a regexp.
+It has no effect when @code{FS} is a single character, even if
+that character is a letter. Thus, in the following code:
+
+@example
+FS = "c"
+IGNORECASE = 1
+$0 = "aCa"
+print $1
+@end example
+
+@noindent
+The output is @samp{aCa}. If you really want to split fields on an
+alphabetic character while ignoring case, use a regexp that will
+do it for you. E.g., @samp{FS = "[c]"}. In this case, @code{IGNORECASE}
+will take effect.
+
@c ENDOFRANGE fisepr
@c ENDOFRANGE fisepg
@@ -5029,8 +5152,13 @@ Now that the input is separated into records, the second step is to
separate the fields in the record. One way to do this is to divide each
of the lines into fields in the normal manner. This happens by default
as the result of a special feature. When @code{RS} is set to the empty
-string, the newline character @emph{always} acts as a field separator.
-This is in addition to whatever field separations result from @code{FS}.
+string, @emph{and} @code{FS} is a set to a single character,
+the newline character @emph{always} acts as a field separator.
+This is in addition to whatever field separations result from
+@code{FS}.@footnote{When @code{FS} is the null string (@code{""})
+or a regexp, this special feature of @code{RS} does not apply.
+It does apply to the default field separator of a single space:
+@samp{FS = " "}.}
The original motivation for this special exception was probably to provide
useful behavior in the default case (i.e., @code{FS} is equal
@@ -5039,11 +5167,16 @@ want the newline character to separate fields, because there is no way to
prevent it. However, you can work around this by using the @code{split}
function to break up the record manually
(@pxref{String Functions, ,String Manipulation Functions}).
+If you have a single character field separator, you can work around
+the special feature in a different way, by making @code{FS} into a
+regexp for that single character. For example, if the field
+separator is a percent character, instead of
+@samp{FS = "%"}, use @samp{FS = "[%]"}.
Another way to separate fields is to
put each field on a separate line: to do this, just set the
-variable @code{FS} to the string @code{"\n"}. (This simple regular
-expression matches a single newline.)
+variable @code{FS} to the string @code{"\n"}. (This single
+character seperator matches a single newline.)
A practical example of a @value{DF} organized this way might be a mailing
list, where each entry is separated by blank lines. Consider a mailing
list in a file named @file{addresses}, which looks like this:
@@ -5600,6 +5733,16 @@ have not yet started to process the command-line @value{DF}s.
@value{DARKCORNER}
(@xref{BEGIN/END, , The @code{BEGIN} and @code{END} Special Patterns},
also @pxref{Auto-set, ,Built-in Variables That Convey Information}.)
+
+@item
+Using @code{FILENAME} with @code{getline}
+(@samp{getline < FILENAME})
+is likely to be a source for
+confusion. @command{awk} opens a separate input stream from the
+current input file. However, by not using a variable, @code{$0}
+and @code{NR} are still updated. If you're doing this, it's
+probably by accident, and you should reconsider what it is you're
+trying to accomplish.
@end itemize
@node Getline Summary, , Getline Notes, Getline
@@ -6978,6 +7121,12 @@ is not closed and released until @code{close} is called or
does not represent a file, pipe or coprocess that was opened with
a redirection.
+Note also that @samp{close(FILENAME)} has no
+``magic'' effects on the implicit loop that reads through the
+files named on the command line. It is, more likely, a close
+of a file that was never opened, so @command{awk} silently
+does nothing.
+
@c comma is part of tertiary
@cindex @code{|} (vertical bar), @code{|&} operator (I/O), pipes, closing
When using the @samp{|&} operator to communicate with a coprocess,
@@ -7024,7 +7173,10 @@ In these cases, @command{gawk} sets the built-in variable
In @command{gawk},
when closing a pipe or coprocess,
-the return value is the exit status of the command.
+the return value is the exit status of the command.@footnote{
+This is a full 16-bit value as returned by the @code{wait}
+system call. See the system manual pages for information on
+how to decode this value.}
Otherwise, it is the return value from the system's @code{close} or
@code{fclose} C functions when closing input or output
files, respectively.
@@ -7034,6 +7186,8 @@ it fails.
The return value for closing a pipeline is particularly useful.
It allows you to get the output from a command as well as its
exit status.
+@c 8/21/2002, FIXME: Maybe the code and this doc should be adjusted to
+@c create values indicating death-by-signal? Sigh.
@cindex pipes, closing
@c comma does NOT start tertiary
@@ -8916,8 +9070,6 @@ whereas @samp{$} has higher precedence.
This table presents @command{awk}'s operators, in order of highest
to lowest precedence:
-@page
-
@c use @code in the items, looks better in TeX w/o all the quotes
@table @code
@item (@dots{})
@@ -9340,7 +9492,7 @@ This cannot be changed or worked around; range patterns do not combine
with other patterns:
@example
-$ echo yes | gawk '(/1/,/2/) || /Yes/'
+$ echo Yes | gawk '(/1/,/2/) || /Yes/'
@error{} gawk: cmd. line:1: (/1/,/2/) || /Yes/
@error{} gawk: cmd. line:1: ^ parse error
@error{} gawk: cmd. line:2: (/1/,/2/) || /Yes/
@@ -10325,7 +10477,7 @@ describing their areas of activity.
The following is an alphabetical list of variables that you can change to
control how @command{awk} does certain things. The variables that are
-specific to @command{gawk} are marked with a pound sign (@samp{#}).
+specific to @command{gawk} are marked with a pound sign@w{ (@samp{#}).}
@table @code
@cindex @code{BINMODE} variable
@@ -10430,7 +10582,9 @@ matching with @samp{~} and @samp{!~}, as well as the @code{gensub},
@code{gsub}, @code{index}, @code{match}, @code{split}, and @code{sub}
functions, record termination with @code{RS}, and field splitting with
@code{FS}, all ignore case when doing their particular regexp operations.
-However, the value of @code{IGNORECASE} does @emph{not} affect array subscripting.
+However, the value of @code{IGNORECASE} does @emph{not} affect array subscripting
+and it does not affect field splitting when using a single-character
+field separator.
@xref{Case-sensitivity, ,Case Sensitivity in Matching}.
@cindex @command{gawk}, @code{IGNORECASE} variable in
@@ -10447,6 +10601,8 @@ When this variable is true (nonzero or non-null), @command{gawk}
behaves as if the @option{--lint} command-line option is in effect.
(@pxref{Options, ,Command-Line Options}).
With a value of @code{"fatal"}, lint warnings become fatal errors.
+With a value of @code{"invalid"}, only warnings about things that are
+actually invalid are issued. (This is not fully implemented yet.)
Any other true value prints nonfatal warnings.
Assigning a false value to @code{LINT} turns off the lint warnings.
@@ -10551,7 +10707,7 @@ it is not special.
The following is an alphabetical list of variables that @command{awk}
sets automatically on certain occasions in order to provide
information to your program. The variables that are specific to
-@command{gawk} are marked with an asterisk (@samp{*}).
+@command{gawk} are marked with a pound sign@w{ (@samp{#}).}
@table @code
@cindex @code{ARGC}/@code{ARGV} variables
@@ -10682,6 +10838,18 @@ The number of fields in the current input record.
@code{NF} is set each time a new record is read, when a new field is
created or when @code{$0} changes (@pxref{Fields, ,Examining Fields}).
+Unlike most of the variables described in this
+@ifnotinfo
+section,
+@end ifnotinfo
+@ifinfo
+node,
+@end ifinfo
+assigning a value to @code{NF} has the potential to affect
+@command{awk}'s internal workings. In particular, assignments
+to @code{NF} can be used to create or remove fields from the
+current record: @xref{Changing Fields, ,Changing the Contents of a Field}.
+
@cindex @code{NR} variable
@item NR
The number of input records @command{awk} has processed since
@@ -11031,6 +11199,14 @@ conceptually, if the element values are 8, @code{"foo"},
0 1 2 3 @r{Index}
@end example
@end ifinfo
+@ifxml
+@example
++---------+---------+--------+---------+
+| 8 | "foo" | "" | 30 | @r{Value}
++---------+---------+--------+---------+
+ 0 1 2 3 @r{Index}
+@end example
+@end ifxml
@noindent
Only the values are stored; the indices are implicit from the order of
@@ -11712,9 +11888,10 @@ In most @command{awk} implementations, sorting an array requires
writing a @code{sort} function.
While this can be educational for exploring different sorting algorithms,
usually that's not the point of the program.
-@command{gawk} provides the built-in @code{asort} function
+@command{gawk} provides the built-in @code{asort}
+and @code{asorti} functions
(@pxref{String Functions, ,String Manipulation Functions})
-that sorts an array. For example:
+for sorting arrays. For example:
@example
@var{populate the array} data
@@ -11749,7 +11926,24 @@ In this case, @command{gawk} copies the @code{source} array into the
However, the @code{source} array is not affected.
Often, what's needed is to sort on the values of the @emph{indices}
-instead of the values of the elements. To do this, use a helper array
+instead of the values of the elements.
+To do that, starting with @command{gawk} 3.1.2, use the
+@code{asorti} function. The interface is identical to that of
+@code{asort}, except that the index values are used for sorting, and
+become the values of the result array:
+
+@example
+@{ source[$0] = some_func($0) @}
+
+END @{
+ n = asorti(source, dest)
+ for (i = 1; i <= n; i++)
+ @var{do something with} dest[i]
+@}
+@end example
+
+If your version of @command{gawk} is 3.1.0 or 3.1.1, you don't
+have @code{asorti}. Instead, use a helper array
to hold the sorted index values, and then access the original array's
elements. It works in the following way:
@@ -11779,10 +11973,14 @@ both arrays use the values. Similarly, when copying the indices from
@code{data} to @code{ind}, there is only one copy of the actual index
strings.
+@c Document It And Call It A Feature. Sigh.
@cindex arrays, sorting, @code{IGNORECASE} variable and
@cindex @code{IGNORECASE} variable, array sorting and
-As with array subscripts, the value of @code{IGNORECASE}
-does not affect array sorting.
+We said previously that comparisons are done using @command{gawk}'s
+``usual comparison rules.'' Because @code{IGNORECASE} affects
+string comparisons, the value of @code{IGNORECASE} also
+affects sorting for both @code{asort} and @code{asorti}.
+Caveat Emptor.
@c ENDOFRANGE arrs
@node Functions, Internationalization, Arrays, Top
@@ -11894,7 +12092,7 @@ two arguments 11 and 10.
The following list describes all of
the built-in functions that work with numbers.
-Optional parameters are enclosed in square brackets ([ ]):
+Optional parameters are enclosed in square brackets@w{ ([ ]):}
@table @code
@item int(@var{x})
@@ -12021,9 +12219,9 @@ sequences of random numbers.
The functions in this @value{SECTION} look at or change the text of one or more
strings.
-Optional parameters are enclosed in square brackets ([ ]).
+Optional parameters are enclosed in square brackets@w{ ([ ]).}
Those functions that are
-specific to @command{gawk} are marked with a pound sign (@samp{#}):
+specific to @command{gawk} are marked with a pound sign@w{ (@samp{#}):}
@menu
* Gory Details:: More than you want to know about @samp{\} and
@@ -12037,7 +12235,9 @@ specific to @command{gawk} are marked with a pound sign (@samp{#}):
@cindex @code{asort} function (@command{gawk})
@code{asort} is a @command{gawk}-specific extension, returning the number of
elements in the array @var{source}. The contents of @var{source} are
-sorted using @command{gawk}'s normal rules for comparing values, and the indices
+sorted using @command{gawk}'s normal rules for comparing values
+(in particular, @code{IGNORECASE} affects the sorting)
+and the indices
of the sorted values of @var{source} are replaced with sequential
integers starting with one. If the optional array @var{dest} is specified,
then @var{source} is duplicated into @var{dest}. @var{dest} is then
@@ -12071,6 +12271,21 @@ The @code{asort} function is described in more detail in
@code{asort} is a @command{gawk} extension; it is not available
in compatibility mode (@pxref{Options, ,Command-Line Options}).
+@item asorti(@var{source} @r{[}, @var{dest}@r{]}) #
+@cindex @code{asorti} function (@command{gawk})
+@code{asorti} is a @command{gawk}-specific extension, returning the number of
+elements in the array @var{source}.
+It works similarly to @code{asort}, however, the @emph{indices}
+are sorted, instead of the values. As array indices are always strings,
+the comparison performed is always a string comparison. (Here too,
+@code{IGNORECASE} affects the sorting.)
+
+The @code{asorti} function is described in more detail in
+@ref{Array Sorting, ,Sorting Array Values and Indices with @command{gawk}}.
+It was added in @command{gawk} 3.1.2.
+@code{asorti} is a @command{gawk} extension; it is not available
+in compatibility mode (@pxref{Options, ,Command-Line Options}).
+
@item index(@var{in}, @var{find})
@cindex @code{index} function
@cindex searching
@@ -12118,6 +12333,13 @@ longest, leftmost substring matched by the regular expression,
at which that substring begins (one, if it starts at the beginning of
@var{string}). If no match is found, it returns zero.
+The @var{regexp} argument may be either a regexp constant
+(@samp{/@dots{}/}) or a string constant (@var{"@dots{}"}).
+In the latter case, the string is treated as a regexp to be matched.
+@ref{Computed Regexps, ,Using Dynamic Regexps}, for a
+discussion of the difference between the two forms, and the
+implications for writing your program correctly.
+
The order of the first two arguments is backwards from most other string
functions that work with regular expressions, such as
@code{sub} and @code{gsub}. It might help to remember that
@@ -12191,6 +12413,23 @@ $ echo foooobazbarrrrr |
@print{} foooo barrrrr
@end example
+In addition,
+beginning with @command{gawk} 3.1.2,
+multidimensional subscripts are available providing
+the start index and length of each matched subexpression:
+
+@example
+$ echo foooobazbarrrrr |
+> gawk '@{ match($0, /(fo+).+(bar*)/, arr)
+> print arr[1], arr[2]
+> print arr[1, "start"], arr[1, "length"]
+> print arr[2, "start"], arr[2, "length"]
+> @}'
+@print{} foooo barrrrr
+@print{} 1 5
+@print{} 9 7
+@end example
+
@cindex troubleshooting, @code{match} function
The @var{array} argument to @code{match} is a
@command{gawk} extension. In compatibility mode
@@ -12237,17 +12476,30 @@ Also as with input field-splitting, if @var{fieldsep} is the null string, each
individual character in the string is split into its own array element.
(This is a @command{gawk}-specific extension.)
+Note, however, that @code{RS} has no effect on the way @code{split}
+works. Even though @samp{RS = ""} causes newline to also be an input
+field separator, this does not affect how @code{split} splits strings.
+
@cindex dark corner, @code{split} function
Modern implementations of @command{awk}, including @command{gawk}, allow
the third argument to be a regexp constant (@code{/abc/}) as well as a
string.
@value{DARKCORNER}
The POSIX standard allows this as well.
+@ref{Computed Regexps, ,Using Dynamic Regexps}, for a
+discussion of the difference between using a string constant or a regexp constant,
+and the implications for writing your program correctly.
Before splitting the string, @code{split} deletes any previously existing
elements in the array @var{array}.
-If @var{string} does not match @var{fieldsep} at all, @var{array} has
-one element only. The value of that element is the original @var{string}.
+
+If @var{string} is null, the array has no elements. (So this is a portable
+way to delete an entire array with one statement.
+@xref{Delete, ,The @code{delete} Statement}.)
+
+If @var{string} does not match @var{fieldsep} at all (but is not null),
+@var{array} has one element only. The value of that element is the original
+@var{string}.
@item sprintf(@var{format}, @var{expression1}, @dots{})
@cindex @code{sprintf} function
@@ -12297,11 +12549,22 @@ Then the entire string is
changed by replacing the matched text with @var{replacement}.
The modified string becomes the new value of @var{target}.
+The @var{regexp} argument may be either a regexp constant
+(@samp{/@dots{}/}) or a string constant (@var{"@dots{}"}).
+In the latter case, the string is treated as a regexp to be matched.
+@ref{Computed Regexps, ,Using Dynamic Regexps}, for a
+discussion of the difference between the two forms, and the
+implications for writing your program correctly.
+
This function is peculiar because @var{target} is not simply
used to compute a value, and not just any expression will do---it
must be a variable, field, or array element so that @code{sub} can
store a modified value there. If this argument is omitted, then the
-default is to use and alter @code{$0}.
+default is to use and alter @code{$0}.@footnote{Note that this means
+that the record will first be regenerated using the value of @code{OFS} if
+any fields have been changed, and that the fields will be updated
+after the substituion, even if the operation is a ``no-op'' such
+as @samp{sub(/^/, "")}.}
For example:
@example
@@ -12477,7 +12740,11 @@ suffix is also returned
if @var{length} is greater than the number of characters remaining
in the string, counting from character @var{start}.
-If @var{start} is less than one or greater than the number of characters
+If @var{start} is less than one, @code{substr} treats it as
+if it was one. (POSIX doesn't specify what to do in this case:
+Unix @command{awk} acts this way, and therefore @command{gawk}
+does too.)
+If @var{start} is greater than the number of characters
in the string, @code{substr} returns the null string.
Similarly, if @var{length} is present but less than or equal to zero,
the null string is returned.
@@ -13846,7 +14113,6 @@ this program, using our function to format the results, prints:
21.2
@end example
-@page
This function deletes all the elements in an array:
@example
@@ -14612,7 +14878,7 @@ to standard output in the format of a GNU @code{gettext} Portable Object
file. Also included in the output are any constant strings that
appear as the first argument to @code{dcgettext} or as the first and
second argument to @code{dcngettext}.@footnote{Starting with @code{gettext}
-version 0.11.1, the @command{xgettext} utility that comes with GNU
+version 0.11.5, the @command{xgettext} utility that comes with GNU
@code{gettext} can handle @file{.awk} files.}
@xref{I18N Example, ,A Simple Internationalization Example},
for the full list of steps to go through to create and test
@@ -14941,7 +15207,7 @@ complete detail in
@cite{GNU gettext tools}.)
@end ifnotinfo
As of this writing, the latest version of GNU @code{gettext} is
-@uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.11.1.tar.gz, @value{PVERSION} 0.11.1}.
+@uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.11.5.tar.gz, @value{PVERSION} 0.11.5}.
If a translation of @command{gawk}'s messages exists,
then @command{gawk} produces usage messages, warnings,
@@ -15100,7 +15366,7 @@ done with temporary files:
@example
# write the data for processing
-tempfile = ("/tmp/mydata." PROCINFO["pid"])
+tempfile = ("mydata." PROCINFO["pid"])
while (@var{not done with data})
print @var{data} | ("subprogram > " tempfile)
close("subprogram > " tempfile)
@@ -15113,7 +15379,10 @@ system("rm " tempfile)
@end example
@noindent
-This works, but not elegantly.
+This works, but not elegantly. Among other things, it requires that
+the program be run in a directory that cannot be shared among users;
+for example, @file{/tmp} will not do, as another user might happen
+to be using a temporary file with the same name.
@cindex coprocesses
@cindex input/output, two-way
@@ -15157,7 +15426,6 @@ standard error separately.
@cindex deadlocks
@cindex buffering, input/output
@cindex @code{getline} command, deadlock and
-</itemizedlist>
@item
I/O buffering may be a problem. @command{gawk} automatically
flushes all output down the pipe to the child process.
@@ -15215,6 +15483,26 @@ has been read, @command{gawk} terminates the coprocess and exits.
As a side note, the assignment @samp{LC_ALL=C} in the @command{sort}
command ensures traditional Unix (ASCII) sorting from @command{sort}.
+Beginning with @command{gawk} 3.1.2, you may use Pseudo-ttys (ptys) for
+two-way communication instead of pipes, if your system supports them.
+This is done on a per-command basis, by setting a special element
+in the @code{PROCINFO} array
+(@pxref{Auto-set, ,Built-in Variables That Convey Information}),
+like so:
+
+@example
+command = "sort -nr" # command, saved in variable for convenience
+PROCINFO[command, "pty"] = 1 # update PROCINFO
+print @dots{} |& command # start two-way pipe
+@dots{}
+@end example
+
+@noindent
+Using ptys avoids the buffer deadlock issues described earlier, at some
+loss in performance. If your system does not have ptys, or if all the
+system's ptys are in use, @command{gawk} automatically falls back to
+using regular pipes.
+
@node TCP/IP Networking, Portal Files, Two-way I/O, Advanced Features
@section Using @command{gawk} for Network Programming
@cindex advanced features, @command{gawk}, network programming
@@ -15894,6 +16182,8 @@ With an optional argument of @samp{fatal},
lint warnings become fatal errors.
This may be drastic, but its use will certainly encourage the
development of cleaner @command{awk} programs.
+With an optional argument of @samp{invalid}, only warnings about things that are
+actually invalid are issued. (This is not fully implemented yet.)
@item -W lint-old
@itemx --lint-old
@@ -17444,12 +17734,12 @@ This code relies on the @code{ARGIND} variable
which is specific to @command{gawk}.
If you are not using
@command{gawk}, you can use ideas presented in
-@iftex
+@ifnotinfo
the previous @value{SECTION}
-@end iftex
-@ifnottex
+@end ifnotinfo
+@ifinfo
@ref{Filetrans Function, ,Noting @value{DDF} Boundaries},
-@end ifnottex
+@end ifinfo
to either update @code{ARGIND} on your own
or modify this code as appropriate.
@@ -17990,12 +18280,26 @@ Following is @command{pwcat}, a C program that ``cats'' the password database:
* Public Domain
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
@c endfile
@end ignore
@c file eg/lib/pwcat.c
#include <stdio.h>
#include <pwd.h>
+@c endfile
+@ignore
+@c file eg/lib/pwcat.c
+#if defined (STDC_HEADERS)
+#include <stdlib.h>
+#endif
+
+@c endfile
+@end ignore
+@c file eg/lib/pwcat.c
int
main(argc, argv)
int argc;
@@ -18004,12 +18308,12 @@ 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;
@}
@c endfile
@end example
@@ -18028,9 +18332,12 @@ The user's encrypted password. This may not be available on some systems.
@item User-ID
The user's numeric user ID number.
+(On some systems it's a C @code{long}, and not an @code{int}. Thus
+we cast it to @code{long} for all cases.)
@item Group-ID
The user's numeric group ID number.
+(Similar comments about @code{long} vs.@: @code{int} apply here.)
@item Full name
The user's full name, and perhaps other information associated with the
@@ -18328,9 +18635,13 @@ is as follows:
#if HAVE_CONFIG_H
#include <config.h>
#endif
+
+#if defined (STDC_HEADERS)
+#include <stdlib.h>
+#endif
-#ifndef HAVE_GETPGRENT
-int main() { exit(0); }
+#ifndef HAVE_GETGRENT
+int main() { return 0; }
#else
@c endfile
@end ignore
@@ -18347,8 +18658,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]);
@group
@@ -18359,13 +18670,13 @@ char **argv;
putchar('\n');
@}
endgrent();
- exit(0);
+ return 0;
@}
@c endfile
@end example
@ignore
@c file eg/lib/grcat.c
-#endif /* HAVE_GETPGRENT */
+#endif /* HAVE_GETGRENT */
@c endfile
@end ignore
@@ -18383,6 +18694,8 @@ usually empty or set to @samp{*}.
@item Group ID Number
The numeric group ID number. This number is unique within the file.
+(On some systems it's a C @code{long}, and not an @code{int}. Thus
+we cast it to @code{long} for all cases.)
@item Group Member List
A comma-separated list of usernames. These users are members of the group.
@@ -21378,8 +21691,11 @@ means it should accept all of @command{gawk}'s command-line arguments,
including the ability to have multiple source files specified via
@option{-f}, and the ability to mix command-line and library source files.
-The program is written using the POSIX Shell (@command{sh}) command language.
-It works as follows:
+The program is written using the POSIX Shell (@command{sh}) command
+language.@footnote{Fully explaining the @command{sh} language is beyond
+the scope of this book. We provide some minimal explanations, but see
+a good shell programming book if you wish to understand things in more
+depth.} It works as follows:
@enumerate
@item
@@ -21388,38 +21704,38 @@ Loop through the arguments, saving anything that doesn't represent
@item
For any arguments that do represent @command{awk} text, put the arguments into
-a temporary file that will be expanded. There are two cases:
+a shell variable that will be expanded. There are two cases:
@enumerate a
@item
Literal text, provided with @option{--source} or @option{--source=}. This
-text is just echoed directly. The @command{echo} program automatically
-supplies a trailing newline.
+text is just appended directly.
@item
-Source @value{FN}s, provided with @option{-f}. We use a neat trick and echo
-@samp{@@include @var{filename}} into the temporary file. Since the file-inclusion
+Source @value{FN}s, provided with @option{-f}. We use a neat trick and append
+@samp{@@include @var{filename}} to the shell variable's contents. Since the file-inclusion
program works the way @command{gawk} does, this gets the text
of the file included into the program at the correct point.
@end enumerate
@item
-Run an @command{awk} program (naturally) over the temporary file to expand
+Run an @command{awk} program (naturally) over the shell variable's contents to expand
@samp{@@include} statements. The expanded program is placed in a second
-temporary file.
+shell variable.
@item
Run the expanded program with @command{gawk} and any other original command-line
arguments that the user supplied (such as the data @value{FN}s).
@end enumerate
-The initial part of the program turns on shell tracing if the first
-argument is @samp{debug}. Otherwise, a shell @code{trap} statement
-arranges to clean up any temporary files on program exit or upon an
-interrupt.
+This program uses shell variables extensively; for storing command line arguments,
+the text of the @command{awk} program that will expand the user's program, for the
+user's original program, and for the expanded program. Doing so removes some
+potential problems that might arise were we to use temporary files instead,
+at the cost of making the script somewhat more complicated.
-@c 2e: For the temp file handling, go with Darrel's ig=${TMP:-/tmp}/igs.$$
-@c 2e: or something as similar as possible.
+The initial part of the program turns on shell tracing if the first
+argument is @samp{debug}.
The next part loops through all the command-line arguments.
There are several cases of interest:
@@ -21440,13 +21756,17 @@ programming trick. Don't worry about it if you are not familiar with
These are saved and passed on to @command{gawk}.
@item -f@r{,} --file@r{,} --file=@r{,} -Wfile=
-The @value{FN} is saved to the temporary file @file{/tmp/ig.s.$$} with an
+The @value{FN} is appended to the shell variable @code{program} with an
@samp{@@include} statement.
-The @command{sed} utility is used to remove the leading option part of the
+The @command{expr} utility is used to remove the leading option part of the
argument (e.g., @samp{--file=}).
+(Typical @command{sh} usage would be to use the @command{echo} and @command{sed}
+utilities to do this work. Unfortunately, some versions of @command{echo} evaluate
+escape sequences in their arguments, possibly mangling the program text.
+Using @command{expr} avoids this problem.)
@item --source@r{,} --source=@r{,} -Wsource=
-The source text is echoed into @file{/tmp/ig.s.$$}.
+The source text is appended to @code{program}.
@item --version@r{,} -Wversion
@command{igawk} prints its version number, runs @samp{gawk --version}
@@ -21457,17 +21777,11 @@ If none of the @option{-f}, @option{--file}, @option{-Wfile}, @option{--source},
or @option{-Wsource} arguments are supplied, then the first nonoption argument
should be the @command{awk} program. If there are no command-line
arguments left, @command{igawk} prints an error message and exits.
-Otherwise, the first argument is echoed into @file{/tmp/ig.s.$$}.
+Otherwise, the first argument is appended to @code{program}.
In any case, after the arguments have been processed,
-@file{/tmp/ig.s.$$} contains the complete text of the original @command{awk}
+@code{program} contains the complete text of the original @command{awk}
program.
-@cindex @command{sed} utility
-@cindex stream editors
-The @samp{$$} in @command{sh} represents the current process ID number.
-It is often used in shell programs to generate unique temporary @value{FN}s.
-This allows multiple users to run @command{igawk} without worrying
-that the temporary @value{FN}s will clash.
The program is as follows:
@cindex @code{igawk.sh} program
@@ -21489,49 +21803,56 @@ 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 ;;
@@ -21542,26 +21863,20 @@ do
shift
done
-if [ ! -s /tmp/ig.s.$$ ]
+if [ -z "$program" ]
then
-@group
- if [ -z "$1" ]
- then
- echo igawk: no program! 1>&2
- exit 1
-@end group
- else
- echo "$1" > /tmp/ig.s.$$
- shift
- fi
+ program=$@{1?'missing program'@}
+ shift
fi
-# at this point, /tmp/ig.s.$$ has the program
+# At this point, `program' has the program.
@c endfile
@end example
The @command{awk} program to process @samp{@@include} directives
-reads through the program, one line at a time, using @code{getline}
+is stored in the shell variable @code{expand_prog}. Doing this keeps
+the shell script readable. The @command{awk} program
+reads through the user's program, one line at a time, using @code{getline}
(@pxref{Getline, ,Explicit Input with @code{getline}}). The input
@value{FN}s and @samp{@@include} statements are managed using a stack.
As each @samp{@@include} is encountered, the current @value{FN} is
@@ -21595,8 +21910,7 @@ slower.
@example
@c file eg/prog/igawk.sh
-gawk -- '
-# process @@include directives
+expand_prog='
function pathto(file, i, t, junk)
@{
@@ -21635,7 +21949,7 @@ BEGIN @{
@c endfile
@end example
-The stack is initialized with @code{ARGV[1]}, which will be @file{/tmp/ig.s.$$}.
+The stack is initialized with @code{ARGV[1]}, which will be @file{/dev/stdin}.
The main loop comes next. Input lines are read in succession. Lines that
do not start with @samp{@@include} are printed verbatim.
If the line does start with @samp{@@include}, the @value{FN} is in @code{$2}.
@@ -21681,14 +21995,44 @@ the program is done:
@}
close(input[stackptr])
@}
-@}' /tmp/ig.s.$$ > /tmp/ig.e.$$
+@}' # close quote ends `expand_prog' variable
+
+processed_program=`gawk -- "$expand_prog" /dev/stdin <<EOF
+$program
+EOF
+`
@c endfile
@end example
+The shell construct @samp{@var{command} << @var{marker}} is called a @dfn{here document}.
+Everything in the shell script up to the @var{marker} is fed to @var{command} as input.
+The shell processes the contents of the here document for variable and command substitution
+(and possibly other things as well, depending upon the shell).
+
+The shell construct @samp{`@dots{}`} is called @dfn{command substitution}.
+The output of the command between the two backquotes (grave accents) is substituted
+into the command line. It is saved as a single string, even if the results
+contain whitespace.
+
+The expanded program is saved in the variable @code{processed_program}.
+It's done in these steps:
+
+@enumerate
+@item
+Run @command{gawk} with the @samp{@@include}-processing program (the
+value of the @code{expand_prog} shell variable) on standard input.
+
+@item
+Standard input is the contents of the user's program, from the shell variable @code{program}.
+Its contents are fed to @command{gawk} via a here document.
+
+@item
+The results of this processing are saved in the shell variable @code{processed_program} by using command substitution.
+@end enumerate
+
The last step is to call @command{gawk} with the expanded program,
along with the original
-options and command-line arguments that the user supplied. @command{gawk}'s
-exit status is passed back on to @command{igawk}'s calling program:
+options and command-line arguments that the user supplied.
@c this causes more problems than it solves, so leave it out.
@ignore
@@ -21707,14 +22051,15 @@ end of file indication.
@example
@c file eg/prog/igawk.sh
-eval gawk -f /tmp/ig.e.$$ $opts -- "$@@"
-
-exit $?
+eval gawk $opts -- '"$processed_program"' '"$@@"'
@c endfile
@end example
-This version of @command{igawk} represents my third attempt at this program.
-There are three key simplifications that make the program work better:
+The @command{eval} command is a shell construct that reruns the shell's parsing
+process. This keeps things properly quoted.
+
+This version of @command{igawk} represents my fourth attempt at this program.
+There are four key simplifications that make the program work better:
@itemize @bullet
@item
@@ -21734,6 +22079,13 @@ considerably.
Using a @code{getline} loop in the @code{BEGIN} rule does it all in one
place. It is not necessary to call out to a separate loop for processing
nested @samp{@@include} statements.
+
+@item
+Instead of saving the expanded program in a temporary file, putting it in a shell variable
+avoids some potential security problems.
+This has the disadvantage that the script relies upon more features
+of the @command{sh} language, making it harder to follow for those who
+aren't familiar with @command{sh}.
@end itemize
Also, this program illustrates that it is often worthwhile to combine
@@ -22365,11 +22717,11 @@ making translations easier
(@pxref{Printf Ordering, , Rearranging @code{printf} Arguments}).
@item
-The @code{asort} function for sorting arrays
+The @code{asort} and @code{asorti} functions for sorting arrays
(@pxref{Array Sorting, ,Sorting Array Values and Indices with @command{gawk}}).
@item
-The @code{bindtextdomain} and @code{dcgettext} functions
+The @code{bindtextdomain}, @code{dcgettext} and @code{dcngettext} functions
for internationalization
(@pxref{Programmer i18n, ,Internationalizing @command{awk} Programs}).
@@ -22449,6 +22801,11 @@ The Atari port became officially unsupported
The source code now uses new-style function definitions, with
@command{ansi2knr} to convert the code on systems with old compilers.
+@item
+The @option{--disable-lint} configuration option to disable lint checking
+at compile time
+(@pxref{Additional Configuration Options, , Additional Configuration Options}).
+
@end itemize
@c XXX ADD MORE STUFF HERE
@@ -23026,6 +23383,26 @@ This option should be used on systems that do @emph{not} use @value{PVERSION} 2
of the GNU C library.
All known modern GNU/Linux systems use Glibc 2. Use this option on any other system.
+@cindex @code{--disable-lint} configuration option
+@cindex configuration option, @code{--disable-lint}
+@item --disable-lint
+This option disables all lint checking within @code{gawk}. The
+@option{--lint} and @option{--lint-old} options
+(@pxref{Options, , Command-Line Options})
+are accepted, but silently do nothing.
+Similarly, setting the @code{LINT} variable
+(@pxref{User-modified, , Built-in Variables That Control @command{awk}})
+has no effect on the running @command{awk} program.
+
+When used with GCC's automatic dead-code-elimination, this option
+cuts almost 200K bytes off the size of the @command{gawk}
+executable on GNU/Linux x86 systems. Results on other systems and
+with other compilers are likely to vary.
+Using this option may bring you some slight performance improvement.
+
+Using this option will cause some of the tests in the test suite
+to fail. This option may be removed at a later date.
+
@cindex @code{--disable-nls} configuration option
@cindex configuration option, @code{--disable-nls}
@item --disable-nls
@@ -23249,16 +23626,21 @@ or more detailed installation instructions.
development tools from DJ Delorie (DJGPP; MS-DOS only) or Eberhard
Mattes (EMX; MS-DOS, Win32 and OS/2). Microsoft Visual C/C++ can be used
to build a Win32 version, and Microsoft C/C++ can be
-used to build 16-bit versions for MS-DOS and OS/2. The file
+used to build 16-bit versions for MS-DOS and OS/2.
+@c FIXME:
+(As of @command{gawk} 3.1.2, the MSC version doesn't work. However,
+the maintainer is working on fixing it.)
+The file
@file{README_d/README.pc} in the @command{gawk} distribution contains
additional notes, and @file{pc/Makefile} contains important information on
compilation options.
-To build @command{gawk} for MS-DOS, Win32, and OS/2 (16 bit; for 32 bit (EMX)
-see below), copy the files in the @file{pc} directory (@emph{except} for
-@file{ChangeLog}) to the directory with the rest of the @command{gawk} sources.
-The @file{Makefile} contains a configuration section with comments and may need
-to be edited in order to work with your @command{make} utility.
+To build @command{gawk} for MS-DOS, Win32, and OS/2 (16 bit only; for 32 bit
+(EMX) you can use the @command{configure} script and skip the following paragraphs;
+for details see below), copy the files in the @file{pc} directory (@emph{except}
+for @file{ChangeLog}) to the directory with the rest of the @command{gawk}
+sources. The @file{Makefile} contains a configuration section with comments and
+may need to be edited in order to work with your @command{make} utility.
The @file{Makefile} contains a number of targets for building various MS-DOS,
Win32, and OS/2 versions. A list of targets is printed if the @command{make}
@@ -23276,69 +23658,79 @@ companion utilities or appropriate GNU utilities. However, some editing of
replacement. Details can be found in @file{README_d/README.pc}
and in the file @file{pc/Makefile.tst}.
-To build @command{gawk} for OS/2 (32 bit, EMX), there are three possibilities:
+The 32 bit EMX version of @command{gawk} works ``out of the box'' under OS/2.
+In principle, it is possible to compile @command{gawk} the following way:
-@enumerate 1
-@item
-Using the @command{configure} script included in the official @command{gawk} distribution.
-@command{configure} need not be recreated but a number of restrictions exist
-when using this choice:
+@example
+$ ./configure
+$ make
+@end example
-@itemize @bullet
-@item
-An external @code{gettext} library cannot be used. I.e. the @command{configure} option
-@option{--without-included-gettext} does not work. Unfortunately,
-the internal @code{gettext} library is seriuosly broken for OS/2.
-Therefore you have to use @option{--disable-nls}.
+This is not recommended, though. To get an OMF executable you should
+use the following commands at your @command{sh} prompt:
-@item
-Executables must be linked statically (@code{a.out} format only).
-@samp{make install} does not work.
+@example
+$ CPPFLAGS="-D__ST_MT_ERRNO__"
+$ export CPPFLAGS
+$ CFLAGS="-O2 -Zomf -Zmt"
+$ export CFLAGS
+$ LDFLAGS="-s -Zcrtdll -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x8000"
+$ export LDFLAGS
+$ RANLIB="echo"
+$ export RANLIB
+$ ./configure --prefix=c:/usr --without-included-gettext
+$ make AR=emxomfar
+@end example
+
+These are just suggestions. You may use any other set of (self-consistent)
+environment variables and compiler flags.
+
+To get an FHS-compliant file hierarchy it is recommended to use the additional
+@command{configure} options @option{--infodir=c:/usr/share/info}, @option{--mandir=c:/usr/share/man}
+and @option{--libexecdir=c:/usr/lib}.
+
+The internal @code{gettext} library tends to be problematic. It is therefore recommended
+to use either an external one (@option{--without-included-gettext}) or to disable
+NLS entirely (@option{--disable-nls}).
-These restrictions are due to restrictions in Autoconf 2.13 and cannot be
-avoided. They will vanish as soon as @command{gawk} moves on to Autoconf 2.5x.
-Now enter the following commands at your @command{sh} prompt:
+If you use GCC 2.95 or newer it is recommended to use also:
@example
-$ CC="gcc"; export CC
-$ CFLAGS="-O2"; export CFLAGS
-$ AWK="awk"; export AWK
-$ LD="ld"; export LD
-$ LDFLAGS="-Zexe"; export LDFLAGS
-$ RANLIB="ranlib"; export RANLIB
-$ ac_cv_header_sys_socket_h="yes"
-$ export ac_cv_header_sys_socket_h
-$ ./configure --prefix=c:/usr --disable-nls
-$ make
+$ LIBS="-lgcc"
+$ export LIBS
@end example
-@end itemize
-@item
-Using a special version of Autoconf 2.13 for OS/2 to recreate @command{configure}.
-Not tested. In principle this should work but the same restrictions
-apply as in 1, but the environment variables @env{CC}, @env{AWK},
-@env{LDFLAGS} and @env{RANLIB} are not necessary.
+You can also get an @code{a.out} executable if you prefer:
-@item
-Using Autoconf 2.5x to recreate @command{configure} (2.52f or higher recommended).
-Some patches must be applied to @file{Makefile.am} and @file{test/Makefile.am}
-and @file{po/Makefile.in.in}. Currently not supported.
-@end enumerate
-
-@strong{Note:} Even if the compiled @command{gawk.exe} executable contains a DOS header
-(@code{a.out} format), it does @emph{not} work under DOS. To compile an executable
-that runs under DOS, @env{CPPFLAGS} must be set to @code{"-DPIPES_SIMULATED"}.
+@example
+$ CPPFLAGS="-D__ST_MT_ERRNO__"
+$ export CPPFLAGS
+$ CFLAGS="-O2 -Zmt"
+$ export CFLAGS
+$ LDFLAGS="-s -Zstack 0x8000"
+$ LIBS="-lgcc"
+$ unset RANLIB
+$ ./configure --prefix=c:/usr --without-included-gettext
+$ make
+@end example
+
+@strong{Note:} Even if the compiled @command{gawk.exe} (@code{a.out}) executable
+contains a DOS header, it does @emph{not} work under DOS. To compile an executable
+that runs under DOS, @code{"-DPIPES_SIMULATED"} must be added to @env{CPPFLAGS}.
But then some nonstandard extensions of @command{gawk} (e.g., @samp{|&}) do not work!
After compilation the internal tests can be performed. Enter
@samp{make check CMP="diff -a"} at your command prompt. All tests
but the @code{pid} test are expected to work properly. The @code{pid}
-test might or might not work, no idea why.
+test fails because child processes are not started by @code{fork()}.
+
+@samp{make install} works as expected.
@strong{Note:} Most OS/2 ports of GNU @command{make} are not able to handle
the Makefiles of this package. If you encounter any problems with @command{make}
-try GNU @command{make} 3.79.1. You should find the latest version on
-@uref{ftp://ftp.unixos2.org}.
+try GNU Make 3.79.1 or later versions. You should find the latest
+version on @uref{http://www.unixos2.org/sw/pub/binary/make/} or on
+@uref{ftp://hobbes.nmsu.edu/pub/os2/}.
@node PC Using, Cygwin, PC Compiling, PC Installation
@@ -23508,6 +23900,7 @@ for any other environment for MS-DOS or MS-Windows.
@appendixsubsec How to Compile and Install @command{gawk} on VMS
@c based on material from Pat Rankin <rankin@eql.caltech.edu>
+@c now rankin@pactechdata.com
@cindex installation, vms
This @value{SUBSECTION} describes how to compile and install @command{gawk} under VMS.
@@ -23955,7 +24348,7 @@ Stephen Davies, @email{scldad@@sdc.com.au}.
@cindex Rankin, Pat
@item VMS
-Pat Rankin, @email{rankin@@eql.caltech.edu}.
+Pat Rankin, @email{rankin@@pactechdata.com}.
@end table
@end ignore
@@ -23980,7 +24373,7 @@ Darrel Hankerson, @email{hankedr@@mail.auburn.edu}.
@item Tandem @tab Stephen Davies, @email{scldad@@sdc.com.au}.
@cindex Rankin, Pat
-@item VMS @tab Pat Rankin, @email{rankin@@eql.caltech.edu}.
+@item VMS @tab Pat Rankin, @email{rankin@@pactechdata.com}.
@end multitable
If your bug is also reproducible under Unix, please send a copy of your
@@ -24117,12 +24510,22 @@ It also has a number of extensions.
The @command{awk} translator is released under the GPL, and the library
is under the LGPL.
-@ignore
-To get @command{awka}, go to its home page at
-Go to @uref{http://awka.sourceforge.net}.
-@end ignore
To get @command{awka}, go to @uref{http://awka.sourceforge.net}.
-You can reach Andrew Sumner at @email{andrew_sumner@@bigfoot.com}.
+You can reach Andrew Sumner at @email{andrew@@zbcom.net}.
+
+@cindex Beebe, Nelson H.F.
+@cindex @command{pawk} profiling Bell Labs @command{awk}
+@item @command{pawk}
+Nelson H.F.@: Beebe at the University of Utah has modified
+the Bell Labs @command{awk} to provide timing and profiling information.
+It is different from @command{pgawk}
+(@pxref{Profiling, ,Profiling Your @command{awk} Programs}),
+in that it uses CPU-based profiling, not line-count
+profiling. You may find it at either
+@uref{ftp://ftp.math.utah.edu/pub/pawk/pawk-20020210.tar.gz}
+or
+@uref{http://www.math.utah.edu/pub/pawk/pawk-20020210.tar.gz}.
+
@end table
@c ENDOFRANGE gligawk
@c ENDOFRANGE ingawk
@@ -24234,7 +24637,10 @@ read it, please do so, preferably @emph{before} starting to modify @command{gawk
the GNU Project's
@command{ftp}
site, at
-@uref{ftp://ftp.gnu.org/gnu/GNUInfo/standards.text}.
+@uref{ftp://ftp.gnu.org/gnu/GNUinfo/standards.text}.
+An HTML version, suitable for reading with a WWW browser, is
+available at
+@uref{http://www.gnu.org/prep/standards_toc.html}.
Texinfo, Info, and DVI versions are also available.)
@cindex @command{gawk}, coding style in
@@ -25275,11 +25681,6 @@ Following is a list of probable improvements that will make @command{gawk}
perform better:
@table @asis
-@item An improved version of @code{dfa}
-The @code{dfa} pattern matcher from GNU @command{grep} has some
-problems. Either a new version or a fixed one will deal with some
-important regexp matching issues.
-
@c NEXT ED: remove this item. awka and mawk do these respectively
@item Compilation of @command{awk} programs
@command{gawk} uses a Bison (YACC-like)
@@ -25712,7 +26113,7 @@ There is a very nice paper on floating-point arithmetic by
David Goldberg, ``What Every
Computer Scientist Should Know About Floating-point Arithmetic,''
@cite{ACM Computing Surveys} @strong{23}, 1 (1991-03),
-5-48.@footnote{@uref{http://www.validgh.com/goldberg/paper.ps}.}
+5-48.@footnote{@uref{http://www.validlab.com/goldberg/paper.ps}.}
This is worth reading if you are interested in the details,
but it does require a background in computer science.
@@ -25899,12 +26300,12 @@ Another name for an @command{awk} program.
@item Bash
The GNU version of the standard shell
-@iftex
+@ifnotinfo
(the @b{B}ourne-@b{A}gain @b{SH}ell).
-@end iftex
-@ifnottex
+@end ifnotinfo
+@ifinfo
(the Bourne-Again SHell).
-@end ifnottex
+@end ifinfo
See also ``Bourne Shell.''
@item BBS
@@ -26915,32 +27316,33 @@ consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
-@node GNU Free Documentation License, Index, Copying, Top
+@node GNU Free Documentation License
@unnumbered GNU Free Documentation License
-@center Version 1.1, March 2000
+
@cindex FDL (Free Documentation License)
@cindex Free Documentation License (FDL)
@cindex GNU Free Documentation License
+@center Version 1.2, November 2002
@display
-Copyright (C) 2000 Free Software Foundation, Inc.
-59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
-@sp 1
+
@enumerate 0
@item
PREAMBLE
The purpose of this License is to make a manual, textbook, or other
-written document ``free'' in the sense of freedom: to assure everyone
-the effective freedom to copy and redistribute it, with or without
-modifying it, either commercially or noncommercially. Secondarily,
-this License preserves for the author and publisher a way to get
-credit for their work, while not being considered responsible for
-modifications made by others.
+functional and useful document @dfn{free} in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense. It
@@ -26955,60 +27357,72 @@ it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
-@sp 1
@item
APPLICABILITY AND DEFINITIONS
-This License applies to any manual or other work that contains a
-notice placed by the copyright holder saying it can be distributed
-under the terms of this License. The ``Document'', below, refers to any
-such manual or work. Any member of the public is a licensee, and is
-addressed as ``you''.
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The ``Document'', below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as ``you''. You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
-A ``Secondary Section'' is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall subject
-(or to related matters) and contains nothing that could fall directly
-within that overall subject. (For example, if the Document is in part a
-textbook of mathematics, a Secondary Section may not explain any
-mathematics.) The relationship could be a matter of historical
+A ``Secondary Section'' is a named appendix or a front-matter section
+of the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject. (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License.
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License.
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
-general public, whose contents can be viewed and edited directly and
+general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
-format whose markup has been designed to thwart or discourage
-subsequent modification by readers is not Transparent. A copy that is
-not ``Transparent'' is called ``Opaque''.
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
-or XML using a publicly available DTD, and standard-conforming simple
-HTML designed for human modification. Opaque formats include
-PostScript, PDF, proprietary formats that can be read and edited only
-by proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML produced by some word processors for output
-purposes only.
+@sc{ascii} without markup, Texinfo input format, La@TeX{} input
+format, @acronym{SGML} or @acronym{XML} using a publicly available
+@acronym{DTD}, and standard-conforming simple @acronym{HTML},
+PostScript or @acronym{PDF} designed for human modification. Examples
+of transparent image formats include @acronym{PNG}, @acronym{XCF} and
+@acronym{JPG}. Opaque formats include proprietary formats that can be
+read and edited only by proprietary word processors, @acronym{SGML} or
+@acronym{XML} for which the @acronym{DTD} and/or processing tools are
+not generally available, and the machine-generated @acronym{HTML},
+PostScript or @acronym{PDF} produced by some word processors for
+output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
@@ -27016,7 +27430,22 @@ this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
-@sp 1
+
+A section ``Entitled XYZ'' means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as ``Acknowledgements'',
+``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
+of such a section when you modify the Document means that it remains a
+section ``Entitled XYZ'' according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
@item
VERBATIM COPYING
@@ -27032,13 +27461,14 @@ number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
-@sp 1
+
@item
COPYING IN QUANTITY
-If you publish printed copies of the Document numbering more than 100,
-and the Document's license notice requires Cover Texts, you must enclose
-the copies in covers that carry, clearly and legibly, all these Cover
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
@@ -27056,21 +27486,20 @@ pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
-a publicly-accessible computer-network location containing a complete
-Transparent copy of the Document, free of added material, which the
-general network-using public has access to download anonymously at no
-charge using public-standard network protocols. If you use the latter
-option, you must take reasonably prudent steps, when you begin
-distribution of Opaque copies in quantity, to ensure that this
-Transparent copy will remain thus accessible at the stated location
-until at least one year after the last time you distribute an Opaque
-copy (directly or through your agents or retailers) of that edition to
-the public.
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
-@sp 1
+
@item
MODIFICATIONS
@@ -27093,7 +27522,8 @@ if the original publisher of that version gives permission.
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
-Document (all of its principal authors, if it has less than five).
+Document (all of its principal authors, if it has fewer than five),
+unless they release you from this requirement.
@item
State on the Title page the name of the publisher of the
@@ -27119,10 +27549,10 @@ and required Cover Texts given in the Document's license notice.
Include an unaltered copy of this License.
@item
-Preserve the section entitled ``History'', and its title, and add to
-it an item stating at least the title, year, new authors, and
+Preserve the section Entitled ``History'', Preserve its Title, and add
+to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
-there is no section entitled ``History'' in the Document, create one
+there is no section Entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
@@ -27137,10 +27567,10 @@ least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
@item
-In any section entitled ``Acknowledgements'' or ``Dedications'',
-preserve the section's title, and preserve in the section all the
-substance and tone of each of the contributor acknowledgements
-and/or dedications given therein.
+For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
+the Title of the section, and preserve in the section all the
+substance and tone of each of the contributor acknowledgements and/or
+dedications given therein.
@item
Preserve all the Invariant Sections of the Document,
@@ -27148,12 +27578,15 @@ unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
@item
-Delete any section entitled ``Endorsements''. Such a section
+Delete any section Entitled ``Endorsements''. Such a section
may not be included in the Modified Version.
@item
-Do not retitle any existing section as ``Endorsements''
-or to conflict in title with any Invariant Section.
+Do not retitle any existing section to be Entitled ``Endorsements'' or
+to conflict in title with any Invariant Section.
+
+@item
+Preserve any Warranty Disclaimers.
@end enumerate
If the Modified Version includes new front-matter sections or
@@ -27163,9 +27596,9 @@ of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
-You may add a section entitled ``Endorsements'', provided it contains
+You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
+parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
@@ -27182,7 +27615,7 @@ permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
-@sp 1
+
@item
COMBINING DOCUMENTS
@@ -27191,7 +27624,7 @@ License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
-license notice.
+license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
@@ -27202,12 +27635,12 @@ author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
-In the combination, you must combine any sections entitled ``History''
-in the various original documents, forming one section entitled
-``History''; likewise combine any sections entitled ``Acknowledgements'',
-and any sections entitled ``Dedications''. You must delete all sections
-entitled ``Endorsements.''
-@sp 1
+In the combination, you must combine any sections Entitled ``History''
+in the various original documents, forming one section Entitled
+``History''; likewise combine any sections Entitled ``Acknowledgements'',
+and any sections Entitled ``Dedications''. You must delete all
+sections Entitled ``Endorsements.''
+
@item
COLLECTIONS OF DOCUMENTS
@@ -27221,25 +27654,27 @@ You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
-@sp 1
+
@item
AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
-distribution medium, does not as a whole count as a Modified Version
-of the Document, provided no compilation copyright is claimed for the
-compilation. Such a compilation is called an ``aggregate'', and this
-License does not apply to the other self-contained works thus compiled
-with the Document, on account of their being thus compiled, if they
-are not themselves derivative works of the Document.
+distribution medium, is called an ``aggregate'' if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one quarter
-of the entire aggregate, the Document's Cover Texts may be placed on
-covers that surround only the Document within the aggregate.
-Otherwise they must appear on covers around the whole aggregate.
-@sp 1
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
@item
TRANSLATION
@@ -27249,11 +27684,18 @@ Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
-translation of this License provided that you also include the
-original English version of this License. In case of a disagreement
-between the translation and the original English version of this
-License, the original English version will prevail.
-@sp 1
+translation of this License, and all the license notices in the
+Document, and any Warrany Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers. In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled ``Acknowledgements'',
+``Dedications'', or ``History'', the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
@item
TERMINATION
@@ -27264,7 +27706,7 @@ automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
-@sp 1
+
@item
FUTURE REVISIONS OF THIS LICENSE
@@ -27282,7 +27724,6 @@ of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
-
@end enumerate
@c fakenode --- for prepinfo
@@ -27294,27 +27735,41 @@ license notices just after the title page:
@smallexample
@group
-
Copyright (C) @var{year} @var{your name}.
Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.1
+ under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
- with the Invariant Sections being @var{list their titles}, with the
- Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end group
@end smallexample
-If you have no Invariant Sections, write ``with no Invariant Sections''
-instead of saying which ones are invariant. If you have no
-Front-Cover Texts, write ``no Front-Cover Texts'' instead of
-``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the ``with...Texts.'' line with this:
+
+@smallexample
+@group
+ with the Invariant Sections being @var{list their titles}, with
+ the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
+ being @var{list}.
+@end group
+@end smallexample
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
+@c Local Variables:
+@c ispell-local-pdict: "ispell-dict"
+@c End:
+
+
@node Index, , GNU Free Documentation License, Top
@unnumbered Index
@printindex cp
diff --git a/doc/gawkinet.info b/doc/gawkinet.info
index 3c1f9722..5a010dbb 100644
--- a/doc/gawkinet.info
+++ b/doc/gawkinet.info
@@ -1,9 +1,9 @@
-This is gawkinet.info, produced by makeinfo version 4.2 from
+This is gawkinet.info, produced by makeinfo version 4.5 from
gawkinet.texi.
-INFO-DIR-SECTION GNU Packages
+INFO-DIR-SECTION Text creation and manipulation
START-INFO-DIR-ENTRY
-* Gawkinet: (gawkinet). TCP/IP Internetworking With `gawk'.
+* Gawkinet: (gawkinet). TCP/IP Internetworking With `gawk'.
END-INFO-DIR-ENTRY
This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the
@@ -14,7 +14,7 @@ This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "GNU General Public License", the Front-Cover
texts being (a) (see below), and with the Back-Cover Texts being (b)
@@ -37,7 +37,7 @@ This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "GNU General Public License", the Front-Cover
texts being (a) (see below), and with the Back-Cover Texts being (b)
@@ -67,7 +67,7 @@ This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "GNU General Public License", the Front-Cover
texts being (a) (see below), and with the Back-Cover Texts being (b)
@@ -259,7 +259,7 @@ of the postal system are thus:
The price the user pays for the lower overhead of datagram
communications is exactly the lower reliability; it is often necessary
for user-level protocols that use datagram communications to add their
-own reliabilty features on top of the basic communications.
+own reliability features on top of the basic communications.

File: gawkinet.info, Node: The TCP/IP Protocols, Next: Making Connections, Prev: Datagram Communications, Up: Introduction
@@ -267,7 +267,7 @@ File: gawkinet.info, Node: The TCP/IP Protocols, Next: Making Connections, Pr
The Internet Protocols
======================
- The Internet Protocol Suite (usually referred as just TCP/IP)(1)
+ The Internet Protocol Suite (usually referred to as just TCP/IP)(1)
consists of a number of different protocols at different levels or
"layers." For our purposes, three protocols provide the fundamental
communications mechanisms. All other defined protocols are referred to
@@ -312,7 +312,7 @@ TCP
All other user-level protocols use either TCP or UDP to do their
basic communications. Examples are SMTP (Simple Mail Transfer
-Protocol), FTP (File Transfer Protocol) and HTTP (HyperText Transfer
+Protocol), FTP (File Transfer Protocol), and HTTP (HyperText Transfer
Protocol).

@@ -323,7 +323,7 @@ TCP and UDP Ports
In the postal system, the address on an envelope indicates a physical
location, such as a residence or office building. But there may be
-more than one person at the location; thus you have to further quantify
+more than one person at a location; thus you have to further quantify
the recipient by putting a person or company name on the envelope.
In the phone system, one phone number may represent an entire
@@ -334,16 +334,16 @@ say, "May I please speak to ..." before talking to the person directly.
IP networking provides the concept of addressing. An IP address
represents a particular computer, but no more. In order to reach the
mail service on a system, or the FTP or WWW service on a system, you
-have to have some way to further specify which service you want. In
-the Internet Protocol suite, this is done with "port numbers", which
+must have some way to further specify which service you want. In the
+Internet Protocol suite, this is done with "port numbers", which
represent the services, much like an extension number used with a phone
number.
Port numbers are 16-bit integers. Unix and Unix-like systems
reserve ports below 1024 for "well known" services, such as SMTP, FTP,
-and HTTP. Numbers above 1024 may be used by any application, although
-there is no promise made that a particular port number is always
-available.
+and HTTP. Numbers 1024 and above may be used by any application,
+although there is no promise made that a particular port number is
+always available.

File: gawkinet.info, Node: Making Connections, Prev: The TCP/IP Protocols, Up: Introduction
@@ -364,7 +364,7 @@ server or email server. It is the "host" (system) which is _connected
to_ in a transaction. For this to work though, the server must be
expecting connections. Much as there has to be someone at the office
building to answer the phone(1), the server process (usually) has to be
-started first and waiting for a connection.
+started first and be waiting for a connection.
The "client" is the system requesting the service. It is the system
_initiating the connection_ in a transaction. (Just as when you pick
@@ -381,7 +381,7 @@ pay this price in order to enjoy the benefits of a simple communication
paradigm in `gawk'.)
Furthermore, once the connection is established, communications are
-"synchronous". I.e., each end waits on the other to finish
+"synchronous".(2) I.e., each end waits on the other to finish
transmitting, before replying. This is much like two people in a phone
conversation. While both could talk simultaneously, doing so usually
doesn't work too well.
@@ -401,6 +401,10 @@ RAW X
(1) In the days before voice mail systems!
+ (2) For the technically savvy, data reads block--if there's no
+incoming data, the program is made to wait until there is, instead of
+receiving a "there's no data" error return.
+

File: gawkinet.info, Node: Using Networking, Next: Some Applications and Techniques, Prev: Introduction, Up: Top
@@ -875,7 +879,8 @@ browser to Microsoft Windows 95 at the last minute. They even
back-ported their TCP/IP implementation to Microsoft Windows for
Workgroups 3.11, but it was a rather rudimentary and half-hearted
implementation. Nevertheless, the equivalent of `/etc/services' resides
-under `c:\windows\services' on Microsoft Windows.
+under `C:\WINNT\system32\drivers\etc\services' on Microsoft Windows
+2000.

File: gawkinet.info, Node: Interacting, Next: Setting Up, Prev: Troubleshooting, Up: Using Networking
@@ -3712,29 +3717,29 @@ Book Review of `Introduction to Computational Biology'
`Developing Bioinformatics Computer Skills'
`http://www.oreilly.com/catalog/bioskills/'
+

File: gawkinet.info, Node: GNU Free Documentation License, Next: Index, Prev: Links, Up: Top
GNU Free Documentation License
******************************
- Version 1.1, March 2000
- Copyright (C) 2000 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Version 1.2, November 2002
+ Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
-
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
- written document "free" in the sense of freedom: to assure everyone
- the effective freedom to copy and redistribute it, with or without
- modifying it, either commercially or noncommercially. Secondarily,
- this License preserves for the author and publisher a way to get
- credit for their work, while not being considered responsible for
- modifications made by others.
+ functional and useful document "free" in the sense of freedom: to
+ assure everyone the effective freedom to copy and redistribute it,
+ with or without modifying it, either commercially or
+ noncommercially. Secondarily, this License preserves for the
+ author and publisher a way to get credit for their work, while not
+ being considered responsible for modifications made by others.
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense.
@@ -3750,60 +3755,71 @@ GNU Free Documentation License
We recommend this License principally for works whose purpose is
instruction or reference.
-
1. APPLICABILITY AND DEFINITIONS
- This License applies to any manual or other work that contains a
- notice placed by the copyright holder saying it can be distributed
- under the terms of this License. The "Document", below, refers to
- any such manual or work. Any member of the public is a licensee,
- and is addressed as "you".
+ This License applies to any manual or other work, in any medium,
+ that contains a notice placed by the copyright holder saying it
+ can be distributed under the terms of this License. Such a notice
+ grants a world-wide, royalty-free license, unlimited in duration,
+ to use that work under the conditions stated herein. The
+ "Document", below, refers to any such manual or work. Any member
+ of the public is a licensee, and is addressed as "you". You
+ accept the license if you copy, modify or distribute the work in a
+ way requiring permission under copyright law.
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
- A "Secondary Section" is a named appendix or a front-matter
- section of the Document that deals exclusively with the
- relationship of the publishers or authors of the Document to the
- Document's overall subject (or to related matters) and contains
- nothing that could fall directly within that overall subject.
- (For example, if the Document is in part a textbook of
- mathematics, a Secondary Section may not explain any mathematics.)
- The relationship could be a matter of historical connection with
- the subject or with related matters, or of legal, commercial,
- philosophical, ethical or political position regarding them.
+ A "Secondary Section" is a named appendix or a front-matter section
+ of the Document that deals exclusively with the relationship of the
+ publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could
+ fall directly within that overall subject. (Thus, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.
The "Invariant Sections" are certain Secondary Sections whose
titles are designated, as being those of Invariant Sections, in
the notice that says that the Document is released under this
- License.
+ License. If a section does not fit the above definition of
+ Secondary then it is not allowed to be designated as Invariant.
+ The Document may contain zero Invariant Sections. If the Document
+ does not identify any Invariant Sections then there are none.
The "Cover Texts" are certain short passages of text that are
listed, as Front-Cover Texts or Back-Cover Texts, in the notice
- that says that the Document is released under this License.
+ that says that the Document is released under this License. A
+ Front-Cover Text may be at most 5 words, and a Back-Cover Text may
+ be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
- general public, whose contents can be viewed and edited directly
- and straightforwardly with generic text editors or (for images
+ general public, that is suitable for revising the document
+ straightforwardly with generic text editors or (for images
composed of pixels) generic paint programs or (for drawings) some
widely available drawing editor, and that is suitable for input to
text formatters or for automatic translation to a variety of
formats suitable for input to text formatters. A copy made in an
- otherwise Transparent file format whose markup has been designed
- to thwart or discourage subsequent modification by readers is not
- Transparent. A copy that is not "Transparent" is called "Opaque".
+ otherwise Transparent file format whose markup, or absence of
+ markup, has been arranged to thwart or discourage subsequent
+ modification by readers is not Transparent. An image format is
+ not Transparent if used for any substantial amount of text. A
+ copy that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format,
SGML or XML using a publicly available DTD, and
- standard-conforming simple HTML designed for human modification.
- Opaque formats include PostScript, PDF, proprietary formats that
- can be read and edited only by proprietary word processors, SGML
- or XML for which the DTD and/or processing tools are not generally
- available, and the machine-generated HTML produced by some word
- processors for output purposes only.
+ standard-conforming simple HTML, PostScript or PDF designed for
+ human modification. Examples of transparent image formats include
+ PNG, XCF and JPG. Opaque formats include proprietary formats that
+ can be read and edited only by proprietary word processors, SGML or
+ XML for which the DTD and/or processing tools are not generally
+ available, and the machine-generated HTML, PostScript or PDF
+ produced by some word processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the
@@ -3812,6 +3828,22 @@ GNU Free Documentation License
Page" means the text near the most prominent appearance of the
work's title, preceding the beginning of the body of the text.
+ A section "Entitled XYZ" means a named subunit of the Document
+ whose title either is precisely XYZ or contains XYZ in parentheses
+ following text that translates XYZ in another language. (Here XYZ
+ stands for a specific section name mentioned below, such as
+ "Acknowledgements", "Dedications", "Endorsements", or "History".)
+ To "Preserve the Title" of such a section when you modify the
+ Document means that it remains a section "Entitled XYZ" according
+ to this definition.
+
+ The Document may include Warranty Disclaimers next to the notice
+ which states that this License applies to the Document. These
+ Warranty Disclaimers are considered to be included by reference in
+ this License, but only as regards disclaiming warranties: any other
+ implication that these Warranty Disclaimers may have is void and
+ has no effect on the meaning of this License.
+
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
@@ -3830,10 +3862,11 @@ GNU Free Documentation License
3. COPYING IN QUANTITY
- If you publish printed copies of the Document numbering more than
- 100, and the Document's license notice requires Cover Texts, you
- must enclose the copies in covers that carry, clearly and legibly,
- all these Cover Texts: Front-Cover Texts on the front cover, and
+ If you publish printed copies (or copies in media that commonly
+ have printed covers) of the Document, numbering more than 100, and
+ the Document's license notice requires Cover Texts, you must
+ enclose the copies in covers that carry, clearly and legibly, all
+ these Cover Texts: Front-Cover Texts on the front cover, and
Back-Cover Texts on the back cover. Both covers must also clearly
and legibly identify you as the publisher of these copies. The
front cover must present the full title with all words of the
@@ -3851,11 +3884,10 @@ GNU Free Documentation License
If you publish or distribute Opaque copies of the Document
numbering more than 100, you must either include a
machine-readable Transparent copy along with each Opaque copy, or
- state in or with each Opaque copy a publicly-accessible
- computer-network location containing a complete Transparent copy
- of the Document, free of added material, which the general
- network-using public has access to download anonymously at no
- charge using public-standard network protocols. If you use the
+ state in or with each Opaque copy a computer-network location from
+ which the general network-using public has access to download
+ using public-standard network protocols a complete Transparent
+ copy of the Document, free of added material. If you use the
latter option, you must take reasonably prudent steps, when you
begin distribution of Opaque copies in quantity, to ensure that
this Transparent copy will remain thus accessible at the stated
@@ -3889,7 +3921,8 @@ GNU Free Documentation License
entities responsible for authorship of the modifications in
the Modified Version, together with at least five of the
principal authors of the Document (all of its principal
- authors, if it has less than five).
+ authors, if it has fewer than five), unless they release you
+ from this requirement.
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
@@ -3910,10 +3943,10 @@ GNU Free Documentation License
H. Include an unaltered copy of this License.
- I. Preserve the section entitled "History", and its title, and
- add to it an item stating at least the title, year, new
+ I. Preserve the section Entitled "History", Preserve its Title,
+ and add to it an item stating at least the title, year, new
authors, and publisher of the Modified Version as given on
- the Title Page. If there is no section entitled "History" in
+ the Title Page. If there is no section Entitled "History" in
the Document, create one stating the title, year, authors,
and publisher of the Document as given on its Title Page,
then add an item describing the Modified Version as stated in
@@ -3928,9 +3961,9 @@ GNU Free Documentation License
Document itself, or if the original publisher of the version
it refers to gives permission.
- K. In any section entitled "Acknowledgements" or "Dedications",
- preserve the section's title, and preserve in the section all
- the substance and tone of each of the contributor
+ K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the
+ section all the substance and tone of each of the contributor
acknowledgements and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
@@ -3938,11 +3971,14 @@ GNU Free Documentation License
or the equivalent are not considered part of the section
titles.
- M. Delete any section entitled "Endorsements". Such a section
+ M. Delete any section Entitled "Endorsements". Such a section
may not be included in the Modified Version.
- N. Do not retitle any existing section as "Endorsements" or to
- conflict in title with any Invariant Section.
+ N. Do not retitle any existing section to be Entitled
+ "Endorsements" or to conflict in title with any Invariant
+ Section.
+
+ O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no
@@ -3952,11 +3988,11 @@ GNU Free Documentation License
Version's license notice. These titles must be distinct from any
other section titles.
- You may add a section entitled "Endorsements", provided it contains
+ You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
- parties-for example, statements of peer review or that the text has
- been approved by an organization as the authoritative definition
- of a standard.
+ parties--for example, statements of peer review or that the text
+ has been approved by an organization as the authoritative
+ definition of a standard.
You may add a passage of up to five words as a Front-Cover Text,
and a passage of up to 25 words as a Back-Cover Text, to the end
@@ -3980,7 +4016,8 @@ GNU Free Documentation License
modified versions, provided that you include in the combination
all of the Invariant Sections of all of the original documents,
unmodified, and list them all as Invariant Sections of your
- combined work in its license notice.
+ combined work in its license notice, and that you preserve all
+ their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
@@ -3992,11 +4029,11 @@ GNU Free Documentation License
the list of Invariant Sections in the license notice of the
combined work.
- In the combination, you must combine any sections entitled
+ In the combination, you must combine any sections Entitled
"History" in the various original documents, forming one section
- entitled "History"; likewise combine any sections entitled
- "Acknowledgements", and any sections entitled "Dedications". You
- must delete all sections entitled "Endorsements."
+ Entitled "History"; likewise combine any sections Entitled
+ "Acknowledgements", and any sections Entitled "Dedications". You
+ must delete all sections Entitled "Endorsements."
6. COLLECTIONS OF DOCUMENTS
@@ -4017,20 +4054,20 @@ GNU Free Documentation License
A compilation of the Document or its derivatives with other
separate and independent documents or works, in or on a volume of
- a storage or distribution medium, does not as a whole count as a
- Modified Version of the Document, provided no compilation
- copyright is claimed for the compilation. Such a compilation is
- called an "aggregate", and this License does not apply to the
- other self-contained works thus compiled with the Document, on
- account of their being thus compiled, if they are not themselves
- derivative works of the Document.
+ a storage or distribution medium, is called an "aggregate" if the
+ copyright resulting from the compilation is not used to limit the
+ legal rights of the compilation's users beyond what the individual
+ works permit. When the Document is included an aggregate, this
+ License does not apply to the other works in the aggregate which
+ are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
- copies of the Document, then if the Document is less than one
- quarter of the entire aggregate, the Document's Cover Texts may be
- placed on covers that surround only the Document within the
- aggregate. Otherwise they must appear on covers around the whole
- aggregate.
+ copies of the Document, then if the Document is less than one half
+ of the entire aggregate, the Document's Cover Texts may be placed
+ on covers that bracket the Document within the aggregate, or the
+ electronic equivalent of covers if the Document is in electronic
+ form. Otherwise they must appear on printed covers that bracket
+ the whole aggregate.
8. TRANSLATION
@@ -4040,10 +4077,18 @@ GNU Free Documentation License
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
- translation of this License provided that you also include the
- original English version of this License. In case of a
- disagreement between the translation and the original English
- version of this License, the original English version will prevail.
+ translation of this License, and all the license notices in the
+ Document, and any Warrany Disclaimers, provided that you also
+ include the original English version of this License and the
+ original versions of those notices and disclaimers. In case of a
+ disagreement between the translation and the original version of
+ this License or a notice or disclaimer, the original version will
+ prevail.
+
+ If a section in the Document is Entitled "Acknowledgements",
+ "Dedications", or "History", the requirement (section 4) to
+ Preserve its Title (section 1) will typically require changing the
+ actual title.
9. TERMINATION
@@ -4073,7 +4118,6 @@ GNU Free Documentation License
you may choose any version ever published (not as a draft) by the
Free Software Foundation.
-
ADDENDUM: How to use this License for your documents
====================================================
@@ -4081,19 +4125,24 @@ ADDENDUM: How to use this License for your documents
the License in the document and put the following copyright and license
notices just after the title page:
-
Copyright (C) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.1
+ under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
- with the Invariant Sections being LIST THEIR TITLES, with the
- Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
-If you have no Invariant Sections, write "with no Invariant
-Sections" instead of saying which ones are invariant. If you have no
-Front-Cover Texts, write "no Front-Cover Texts" instead of "Front-Cover
-Texts being LIST"; likewise for Back-Cover Texts.
+
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover
+Texts, replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with
+ the Front-Cover Texts being LIST, and with the Back-Cover Texts
+ being LIST.
+
+ If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
@@ -4137,12 +4186,14 @@ Index
* ELIZA program: Simple Server.
* email: Email.
* FASTA/Pearson format: PROTBASE.
+* FDL (Free Documentation License): GNU Free Documentation License.
* filenames, for network access: Gawk Special Files.
* files, /inet/ (gawk): Gawk Special Files.
* files, /inet/raw (gawk): File /inet/raw.
* files, /inet/tcp (gawk): File /inet/tcp.
* files, /inet/udp (gawk): File /inet/udp.
* finger utility: Setting Up.
+* Free Documentation License (FDL): GNU Free Documentation License.
* FTP (File Transfer Protocol): Basic Protocols.
* gawk, networking: Using Networking.
* gawk, networking, connections <1>: TCP Connecting.
@@ -4156,6 +4207,7 @@ Index
* GETURL program: GETURL.
* GIF image format <1>: STATIST.
* GIF image format: Web page.
+* GNU Free Documentation License: GNU Free Documentation License.
* GNU/Linux <1>: REMCONF.
* GNU/Linux <2>: Interacting.
* GNU/Linux: Troubleshooting.
@@ -4279,56 +4331,57 @@ Index

Tag Table:
-Node: Top1132
-Node: Preface5684
-Node: Introduction7062
-Node: Stream Communications8086
-Node: Datagram Communications9254
-Node: The TCP/IP Protocols10879
-Ref: The TCP/IP Protocols-Footnote-111555
-Node: Basic Protocols11712
-Node: Ports13019
-Node: Making Connections14416
-Ref: Making Connections-Footnote-116987
-Node: Using Networking17034
-Node: Gawk Special Files19387
-Node: Special File Fields21386
-Node: Comparing Protocols26692
-Node: File /inet/tcp27272
-Node: File /inet/udp28285
-Node: File /inet/raw29393
-Ref: File /inet/raw-Footnote-132413
-Node: TCP Connecting32493
-Node: Troubleshooting34826
-Ref: Troubleshooting-Footnote-137877
-Node: Interacting38396
-Node: Setting Up41121
-Node: Email44610
-Node: Web page46931
-Ref: Web page-Footnote-149731
-Node: Primitive Service49928
-Node: Interacting Service52657
-Ref: Interacting Service-Footnote-161781
-Node: CGI Lib61813
-Node: Simple Server68795
-Ref: Simple Server-Footnote-176528
-Node: Caveats76629
-Node: Challenges77766
-Node: Some Applications and Techniques86425
-Node: PANIC88881
-Node: GETURL90594
-Node: REMCONF93212
-Node: URLCHK98683
-Node: WEBGRAB102513
-Node: STATIST106958
-Ref: STATIST-Footnote-1118659
-Node: MAZE119104
-Node: MOBAGWHO125284
-Ref: MOBAGWHO-Footnote-1139220
-Node: STOXPRED139275
-Node: PROTBASE153550
-Node: Links166641
-Node: GNU Free Documentation License170073
-Node: Index189956
+Node: Top2014
+Node: Preface5707
+Node: Introduction7085
+Node: Stream Communications8109
+Node: Datagram Communications9277
+Node: The TCP/IP Protocols10903
+Ref: The TCP/IP Protocols-Footnote-111582
+Node: Basic Protocols11739
+Node: Ports13047
+Node: Making Connections14443
+Ref: Making Connections-Footnote-117019
+Ref: Making Connections-Footnote-217066
+Node: Using Networking17247
+Node: Gawk Special Files19600
+Node: Special File Fields21599
+Node: Comparing Protocols26905
+Node: File /inet/tcp27485
+Node: File /inet/udp28498
+Node: File /inet/raw29606
+Ref: File /inet/raw-Footnote-132626
+Node: TCP Connecting32706
+Node: Troubleshooting35039
+Ref: Troubleshooting-Footnote-138090
+Node: Interacting38633
+Node: Setting Up41358
+Node: Email44847
+Node: Web page47168
+Ref: Web page-Footnote-149968
+Node: Primitive Service50165
+Node: Interacting Service52894
+Ref: Interacting Service-Footnote-162018
+Node: CGI Lib62050
+Node: Simple Server69032
+Ref: Simple Server-Footnote-176765
+Node: Caveats76866
+Node: Challenges78003
+Node: Some Applications and Techniques86662
+Node: PANIC89118
+Node: GETURL90831
+Node: REMCONF93449
+Node: URLCHK98920
+Node: WEBGRAB102750
+Node: STATIST107195
+Ref: STATIST-Footnote-1118896
+Node: MAZE119341
+Node: MOBAGWHO125521
+Ref: MOBAGWHO-Footnote-1139457
+Node: STOXPRED139512
+Node: PROTBASE153787
+Node: Links166878
+Node: GNU Free Documentation License170311
+Node: Index192716

End Tag Table
diff --git a/doc/gawkinet.texi b/doc/gawkinet.texi
index d51ce794..0573c8f5 100644
--- a/doc/gawkinet.texi
+++ b/doc/gawkinet.texi
@@ -5,13 +5,10 @@
@c %**end of header (This is for running Texinfo on a region.)
@c FIXME: web vs. Web
-@c inside ifinfo for older versions of texinfo.tex
-@ifinfo
-@dircategory GNU Packages
+@dircategory Text creation and manipulation
@direntry
-* Gawkinet: (gawkinet). TCP/IP Internetworking With @command{gawk}.
+* Gawkinet: (gawkinet). TCP/IP Internetworking With `gawk'.
@end direntry
-@end ifinfo
@iftex
@set DOCUMENT book
@@ -78,7 +75,7 @@ implementation of AWK.
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
@sp 2
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``GNU General Public License'', the Front-Cover
texts being (a) (see below), and with the Back-Cover Texts being (b)
@@ -142,7 +139,7 @@ ISBN 1-882114-93-0 @*
@oddheading @| @| @strong{@thischapter}@ @ @ @thispage
@end iftex
-@ifinfo
+@ifnottex
@node Top, Preface, (dir), (dir)
@top General Introduction
@comment node-name, next, previous, up
@@ -151,7 +148,7 @@ This file documents the networking features in GNU Awk (@command{gawk})
version 3.1 and later.
@insertcopying
-@end ifinfo
+@end ifnottex
@menu
* Preface:: About this document.
@@ -350,13 +347,13 @@ It is not necessary to set up the call first.
The price the user pays for the lower overhead of datagram communications
is exactly the lower reliability; it is often necessary for user-level
-protocols that use datagram communications to add their own reliabilty
+protocols that use datagram communications to add their own reliability
features on top of the basic communications.
@node The TCP/IP Protocols, Making Connections, Datagram Communications, Introduction
@section The Internet Protocols
-The Internet Protocol Suite (usually referred as just TCP/IP)@footnote{
+The Internet Protocol Suite (usually referred to as just TCP/IP)@footnote{
It should be noted that although the Internet seems to have conquered the
world, there are other networking protocol suites in existence and in use.}
consists of a number of different protocols at different levels or ``layers.''
@@ -395,7 +392,7 @@ when using @command{gawk} for network programming.
All other user-level protocols use either TCP or UDP to do their basic
communications. Examples are SMTP (Simple Mail Transfer Protocol),
-FTP (File Transfer Protocol) and HTTP (HyperText Transfer Protocol).
+FTP (File Transfer Protocol), and HTTP (HyperText Transfer Protocol).
@cindex SMTP (Simple Mail Transfer Protocol)
@cindex FTP (File Transfer Protocol)
@cindex HTTP (Hypertext Transfer Protocol)
@@ -405,7 +402,7 @@ FTP (File Transfer Protocol) and HTTP (HyperText Transfer Protocol).
In the postal system, the address on an envelope indicates a physical
location, such as a residence or office building. But there may be
-more than one person at the location; thus you have to further quantify
+more than one person at a location; thus you have to further quantify
the recipient by putting a person or company name on the envelope.
In the phone system, one phone number may represent an entire company,
@@ -415,14 +412,14 @@ say, ``May I please speak to ...'' before talking to the person directly.
IP networking provides the concept of addressing. An IP address represents
a particular computer, but no more. In order to reach the mail service
-on a system, or the FTP or WWW service on a system, you have to have some
+on a system, or the FTP or WWW service on a system, you must have some
way to further specify which service you want. In the Internet Protocol suite,
this is done with @dfn{port numbers}, which represent the services, much
like an extension number used with a phone number.
Port numbers are 16-bit integers. Unix and Unix-like systems reserve ports
below 1024 for ``well known'' services, such as SMTP, FTP, and HTTP.
-Numbers above 1024 may be used by any application, although there is no
+Numbers 1024 and above may be used by any application, although there is no
promise made that a particular port number is always available.
@node Making Connections, , The TCP/IP Protocols, Introduction
@@ -445,7 +442,7 @@ is @emph{connected to} in a transaction.
For this to work though, the server must be expecting connections.
Much as there has to be someone at the office building to answer
the phone@footnote{In the days before voice mail systems!}, the
-server process (usually) has to be started first and waiting
+server process (usually) has to be started first and be waiting
for a connection.
@cindex clients
@@ -464,11 +461,13 @@ enjoy the benefits of a simple communication paradigm in @command{gawk}.)
@cindex blocking
@cindex synchronous communications
-Furthermore, once the connection is established, communications
-are @dfn{synchronous}. I.e., each end waits on the other to finish
-transmitting, before replying. This is much like two people in a phone
-conversation. While both could talk simultaneously, doing so usually
-doesn't work too well.
+Furthermore, once the connection is established, communications are
+@dfn{synchronous}.@footnote{For the technically savvy, data reads
+block---if there's no incoming data, the program is made to wait until
+there is, instead of receiving a ``there's no data'' error return.} I.e.,
+each end waits on the other to finish transmitting, before replying. This
+is much like two people in a phone conversation. While both could talk
+simultaneously, doing so usually doesn't work too well.
In the case of TCP, the synchronicity is enforced by the protocol when
sending data. Data writes @dfn{block} until the data have been received on the
@@ -1076,7 +1075,7 @@ their own browser to Microsoft Windows 95 at the last minute. They even back-por
their TCP/IP implementation to Microsoft Windows for Workgroups 3.11, but it was
a rather rudimentary and half-hearted implementation. Nevertheless,
the equivalent of @file{/etc/services} resides under
-@file{c:\windows\services} on Microsoft Windows.}
+@file{C:\WINNT\system32\drivers\etc\services} on Microsoft Windows 2000.}
The first column of the file gives the name of the service, and
the second column gives a unique number and the protocol that one can use to connect to
this service.
@@ -4721,29 +4720,33 @@ They are presented in the order in which they appear.
@end table
-@node GNU Free Documentation License, Index, Links, Top
+@node GNU Free Documentation License
@unnumbered GNU Free Documentation License
-@center Version 1.1, March 2000
+
+@cindex FDL (Free Documentation License)
+@cindex Free Documentation License (FDL)
+@cindex GNU Free Documentation License
+@center Version 1.2, November 2002
@display
-Copyright (C) 2000 Free Software Foundation, Inc.
-59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
-@sp 1
+
@enumerate 0
@item
PREAMBLE
The purpose of this License is to make a manual, textbook, or other
-written document ``free'' in the sense of freedom: to assure everyone
-the effective freedom to copy and redistribute it, with or without
-modifying it, either commercially or noncommercially. Secondarily,
-this License preserves for the author and publisher a way to get
-credit for their work, while not being considered responsible for
-modifications made by others.
+functional and useful document @dfn{free} in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense. It
@@ -4758,60 +4761,72 @@ it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
-@sp 1
@item
APPLICABILITY AND DEFINITIONS
-This License applies to any manual or other work that contains a
-notice placed by the copyright holder saying it can be distributed
-under the terms of this License. The ``Document'', below, refers to any
-such manual or work. Any member of the public is a licensee, and is
-addressed as ``you''.
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The ``Document'', below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as ``you''. You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
-A ``Secondary Section'' is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall subject
-(or to related matters) and contains nothing that could fall directly
-within that overall subject. (For example, if the Document is in part a
-textbook of mathematics, a Secondary Section may not explain any
-mathematics.) The relationship could be a matter of historical
+A ``Secondary Section'' is a named appendix or a front-matter section
+of the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject. (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License.
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License.
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
-general public, whose contents can be viewed and edited directly and
+general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
-format whose markup has been designed to thwart or discourage
-subsequent modification by readers is not Transparent. A copy that is
-not ``Transparent'' is called ``Opaque''.
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
-or XML using a publicly available DTD, and standard-conforming simple
-HTML designed for human modification. Opaque formats include
-PostScript, PDF, proprietary formats that can be read and edited only
-by proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML produced by some word processors for output
-purposes only.
+@sc{ascii} without markup, Texinfo input format, La@TeX{} input
+format, @acronym{SGML} or @acronym{XML} using a publicly available
+@acronym{DTD}, and standard-conforming simple @acronym{HTML},
+PostScript or @acronym{PDF} designed for human modification. Examples
+of transparent image formats include @acronym{PNG}, @acronym{XCF} and
+@acronym{JPG}. Opaque formats include proprietary formats that can be
+read and edited only by proprietary word processors, @acronym{SGML} or
+@acronym{XML} for which the @acronym{DTD} and/or processing tools are
+not generally available, and the machine-generated @acronym{HTML},
+PostScript or @acronym{PDF} produced by some word processors for
+output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
@@ -4819,7 +4834,22 @@ this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
-@sp 1
+
+A section ``Entitled XYZ'' means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as ``Acknowledgements'',
+``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
+of such a section when you modify the Document means that it remains a
+section ``Entitled XYZ'' according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
@item
VERBATIM COPYING
@@ -4835,13 +4865,14 @@ number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
-@sp 1
+
@item
COPYING IN QUANTITY
-If you publish printed copies of the Document numbering more than 100,
-and the Document's license notice requires Cover Texts, you must enclose
-the copies in covers that carry, clearly and legibly, all these Cover
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
@@ -4859,21 +4890,20 @@ pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
-a publicly-accessible computer-network location containing a complete
-Transparent copy of the Document, free of added material, which the
-general network-using public has access to download anonymously at no
-charge using public-standard network protocols. If you use the latter
-option, you must take reasonably prudent steps, when you begin
-distribution of Opaque copies in quantity, to ensure that this
-Transparent copy will remain thus accessible at the stated location
-until at least one year after the last time you distribute an Opaque
-copy (directly or through your agents or retailers) of that edition to
-the public.
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
-@sp 1
+
@item
MODIFICATIONS
@@ -4896,7 +4926,8 @@ if the original publisher of that version gives permission.
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
-Document (all of its principal authors, if it has less than five).
+Document (all of its principal authors, if it has fewer than five),
+unless they release you from this requirement.
@item
State on the Title page the name of the publisher of the
@@ -4922,10 +4953,10 @@ and required Cover Texts given in the Document's license notice.
Include an unaltered copy of this License.
@item
-Preserve the section entitled ``History'', and its title, and add to
-it an item stating at least the title, year, new authors, and
+Preserve the section Entitled ``History'', Preserve its Title, and add
+to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
-there is no section entitled ``History'' in the Document, create one
+there is no section Entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
@@ -4940,10 +4971,10 @@ least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
@item
-In any section entitled ``Acknowledgements'' or ``Dedications'',
-preserve the section's title, and preserve in the section all the
-substance and tone of each of the contributor acknowledgements
-and/or dedications given therein.
+For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
+the Title of the section, and preserve in the section all the
+substance and tone of each of the contributor acknowledgements and/or
+dedications given therein.
@item
Preserve all the Invariant Sections of the Document,
@@ -4951,12 +4982,15 @@ unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
@item
-Delete any section entitled ``Endorsements''. Such a section
+Delete any section Entitled ``Endorsements''. Such a section
may not be included in the Modified Version.
@item
-Do not retitle any existing section as ``Endorsements''
-or to conflict in title with any Invariant Section.
+Do not retitle any existing section to be Entitled ``Endorsements'' or
+to conflict in title with any Invariant Section.
+
+@item
+Preserve any Warranty Disclaimers.
@end enumerate
If the Modified Version includes new front-matter sections or
@@ -4966,9 +5000,9 @@ of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
-You may add a section entitled ``Endorsements'', provided it contains
+You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
+parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
@@ -4985,7 +5019,7 @@ permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
-@sp 1
+
@item
COMBINING DOCUMENTS
@@ -4994,7 +5028,7 @@ License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
-license notice.
+license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
@@ -5005,12 +5039,12 @@ author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
-In the combination, you must combine any sections entitled ``History''
-in the various original documents, forming one section entitled
-``History''; likewise combine any sections entitled ``Acknowledgements'',
-and any sections entitled ``Dedications''. You must delete all sections
-entitled ``Endorsements.''
-@sp 1
+In the combination, you must combine any sections Entitled ``History''
+in the various original documents, forming one section Entitled
+``History''; likewise combine any sections Entitled ``Acknowledgements'',
+and any sections Entitled ``Dedications''. You must delete all
+sections Entitled ``Endorsements.''
+
@item
COLLECTIONS OF DOCUMENTS
@@ -5024,25 +5058,27 @@ You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
-@sp 1
+
@item
AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
-distribution medium, does not as a whole count as a Modified Version
-of the Document, provided no compilation copyright is claimed for the
-compilation. Such a compilation is called an ``aggregate'', and this
-License does not apply to the other self-contained works thus compiled
-with the Document, on account of their being thus compiled, if they
-are not themselves derivative works of the Document.
+distribution medium, is called an ``aggregate'' if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one quarter
-of the entire aggregate, the Document's Cover Texts may be placed on
-covers that surround only the Document within the aggregate.
-Otherwise they must appear on covers around the whole aggregate.
-@sp 1
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
@item
TRANSLATION
@@ -5052,11 +5088,18 @@ Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
-translation of this License provided that you also include the
-original English version of this License. In case of a disagreement
-between the translation and the original English version of this
-License, the original English version will prevail.
-@sp 1
+translation of this License, and all the license notices in the
+Document, and any Warrany Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers. In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled ``Acknowledgements'',
+``Dedications'', or ``History'', the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
@item
TERMINATION
@@ -5067,7 +5110,7 @@ automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
-@sp 1
+
@item
FUTURE REVISIONS OF THIS LICENSE
@@ -5085,7 +5128,6 @@ of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
-
@end enumerate
@c fakenode --- for prepinfo
@@ -5097,27 +5139,41 @@ license notices just after the title page:
@smallexample
@group
-
Copyright (C) @var{year} @var{your name}.
Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.1
+ under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
- with the Invariant Sections being @var{list their titles}, with the
- Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end group
@end smallexample
-If you have no Invariant Sections, write ``with no Invariant Sections''
-instead of saying which ones are invariant. If you have no
-Front-Cover Texts, write ``no Front-Cover Texts'' instead of
-``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the ``with...Texts.'' line with this:
+
+@smallexample
+@group
+ with the Invariant Sections being @var{list their titles}, with
+ the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
+ being @var{list}.
+@end group
+@end smallexample
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
+@c Local Variables:
+@c ispell-local-pdict: "ispell-dict"
+@c End:
+
+
@node Index, , GNU Free Documentation License, Top
@comment node-name, next, previous, up
diff --git a/doc/pgawk.1 b/doc/pgawk.1
new file mode 100644
index 00000000..d2b3f4f0
--- /dev/null
+++ b/doc/pgawk.1
@@ -0,0 +1 @@
+.so gawk.1
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index df62a127..555a0770 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -3,10 +3,10 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2002-03-26.08}
+\def\texinfoversion{2003-02-03.16}
%
-% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
-% 2000, 01, 02 Free Software Foundation, Inc.
+% 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
@@ -29,19 +29,17 @@
%
% Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from:
-% ftp://ftp.gnu.org/gnu/texinfo.tex
+% ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex
% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
-% ftp://texinfo.org/texinfo/texinfo.tex
% ftp://tug.org/tex/texinfo.tex
% (and all CTAN mirrors, see http://www.ctan.org),
% and /home/gd/gnu/doc/texinfo.tex on the GNU machines.
%
+% The 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.
%
-% Texinfo has a small home page at http://texinfo.org/ and also
-% http://www.gnu.org/software/texinfo.
-%
% Send bug reports to bug-texinfo@gnu.org. Please include including a
% complete document in each bug report with which we can reproduce the
% problem. Patches are, of course, greatly appreciated.
@@ -57,9 +55,10 @@
% The extra TeX runs get the cross-reference information correct.
% Sometimes one run after texindex suffices, and sometimes you need more
% than two; texi2dvi does it as many times as necessary.
-%
-% It is possible to adapt texinfo.tex for other languages. You can get
-% the existing language-specific files from the full Texinfo distribution.
+%
+% 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.
\message{Loading texinfo [version \texinfoversion]:}
@@ -69,6 +68,13 @@
\everyjob{\message{[Texinfo version \texinfoversion]}%
\catcode`+=\active \catcode`\_=\active}
+\message{Basics,}
+\chardef\other=12
+
+% We never want plain's outer \+ definition in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
+
% Save some parts of plain tex whose names we will redefine.
\let\ptexb=\b
\let\ptexbullet=\bullet
@@ -79,19 +85,16 @@
\let\ptexend=\end
\let\ptexequiv=\equiv
\let\ptexexclam=\!
+\let\ptexgtr=>
+\let\ptexhat=^
\let\ptexi=\i
\let\ptexlbrace=\{
+\let\ptexless=<
+\let\ptexplus=+
\let\ptexrbrace=\}
\let\ptexstar=\*
\let\ptext=\t
-% We never want plain's outer \+ definition in Texinfo.
-% For @tex, we can use \tabalign.
-\let\+ = \relax
-
-\message{Basics,}
-\chardef\other=12
-
% If this character appears in an error message or help string, it
% starts a new line in the output.
\newlinechar = `^^J
@@ -138,40 +141,64 @@
\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{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}%
-\ifx\eTeXversion\undefined
-\def\loggingall{\tracingcommands2 \tracingstats2
- \tracingpages1 \tracingoutput1 \tracinglostchars1
- \tracingmacros2 \tracingparagraphs1 \tracingrestores1
- \showboxbreadth\maxdimen\showboxdepth\maxdimen
-}%
-\else
-\def\loggingall{\tracingcommands3 \tracingstats2
- \tracingpages1 \tracingoutput1 \tracinglostchars1
- \tracingmacros2 \tracingparagraphs1 \tracingrestores1
- \tracingscantokens1 \tracingassigns1 \tracingifs1
- \tracinggroups1 \tracingnesting2
- \showboxbreadth\maxdimen\showboxdepth\maxdimen
+\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
}%
-\fi
% add check for \lastpenalty to plain's definitions. If the last thing
% we did was a \nobreak, we don't want to insert more space.
@@ -276,7 +303,7 @@
\egroup % \vbox from first cropmarks clause
\fi
}% end of \shipout\vbox
- }% end of group with \turnoffactive
+ }% end of group with \normalturnoffactive
\advancepageno
\ifnum\outputpenalty>-20000 \else\dosupereject\fi
}
@@ -436,17 +463,6 @@
}
-% 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 @
@@ -466,16 +482,19 @@
\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}}
@@ -484,7 +503,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{!`}
@@ -539,6 +558,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
@@ -552,10 +581,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
@@ -753,30 +794,36 @@ where each line of input produces a line of output.}
% @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
@@ -841,11 +888,6 @@ where each line of input produces a line of output.}
% to set catcodes according to plain TeX first, to allow for subscripts,
% superscripts, special math chars, etc.
%
-% @math does not do math typesetting in section titles, index
-% entries, and other such contexts where the catcodes are set before
-% @math gets a chance to work. This could perhaps be fixed, but for now
-% at least we can have real math in the main text, where it's needed most.
-%
\let\implicitmath = $%$ font-lock fix
%
% One complication: _ usually means subscripts, but it could also mean
@@ -853,9 +895,9 @@ where each line of input produces a line of output.}
% _ within @math be active (mathcode "8000), and distinguish by seeing
% if the current family is \slfam, which is what @var uses.
%
-{\catcode95 = \active % 95 = _
+{\catcode\underChar = \active
\gdef\mathunderscore{%
- \catcode95=\active
+ \catcode\underChar=\active
\def_{\ifnum\fam=\slfam \_\else\sb\fi}%
}}
%
@@ -871,9 +913,27 @@ where each line of input produces a line of output.}
\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}
@@ -965,7 +1025,7 @@ where each line of input produces a line of output.}
\ifx\empty\imagewidth\else width \imagewidth \fi
\ifx\empty\imageheight\else height \imageheight \fi
\ifnum\pdftexversion<13
- #1.pdf%
+ #1.pdf%
\else
{#1.pdf}%
\fi
@@ -987,40 +1047,39 @@ where each line of input produces a line of output.}
\openin 1 \jobname.toc
\ifeof 1\else\begingroup
\closein 1
- \indexnofonts
- \def\tt{}
- \let\_ = \normalunderscore
% Thanh's hack / proper braces in bookmarks
\edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
\edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
%
\def\chapentry ##1##2##3{}
- \let\appendixentry = \chapentry
- \def\unnumbchapentry ##1##2{}
\def\secentry ##1##2##3##4{\advancenumber{chap##2}}
- \def\unnumbsecentry ##1##2##3{\advancenumber{chap##2}}
\def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
- \def\unnumbsubsecentry ##1##2##3##4{\advancenumber{sec##2.##3}}
\def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
- \def\unnumbsubsubsecentry ##1##2##3##4##5{\advancenumber{subsec##2.##3.##4}}
+ \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}}
- \let\appendixentry = \chapentry
- \def\unnumbchapentry ##1##2{%
- \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
\def\secentry ##1##2##3##4{%
\pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
- \def\unnumbsecentry ##1##2##3{%
- \pdfoutline goto name{\pdfmkpgn{##3}}{##1}}
\def\subsecentry ##1##2##3##4##5{%
\pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
- \def\unnumbsubsecentry ##1##2##3##4{%
- \pdfoutline goto name{\pdfmkpgn{##4}}{##1}}
\def\subsubsecentry ##1##2##3##4##5##6{%
\pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
- \def\unnumbsubsubsecentry ##1##2##3##4##5{%
- \pdfoutline goto name{\pdfmkpgn{##5}}{##1}}
+ \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
}}
@@ -1170,7 +1229,7 @@ where each line of input produces a line of output.}
\newcount\mainmagstep
\ifx\bigger\relax
% not really supported.
- \let\mainmagstep=\magstep1
+ \mainmagstep=\magstep1
\setfont\textrm\rmshape{12}{1000}
\setfont\texttt\ttshape{12}{1000}
\else
@@ -1178,9 +1237,10 @@ where each line of input produces a line of output.}
\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}
@@ -1231,6 +1291,7 @@ where each line of input produces a line of output.}
\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}
@@ -1328,7 +1389,25 @@ where each line of input produces a line of output.}
\let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
\let\tenttsl=\smallerttsl
\resetmathfonts \setleading{9.5pt}}
-\let\smallexamplefonts = \smallerfonts
+
+% 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.
%
@@ -1345,6 +1424,7 @@ 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
@@ -1352,8 +1432,8 @@ where each line of input produces a line of output.}
% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
% unless the following character is such as not to need one.
\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
-\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
-\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
+\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=\smartslanted
@@ -1371,6 +1451,17 @@ 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
@@ -1470,15 +1561,17 @@ where each line of input produces a line of output.}
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
\else\ifx\arg\wordcode
\gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @kbdinputstyle `\arg'}%
\fi\fi\fi
}
\def\worddistinct{distinct}
\def\wordexample{example}
\def\wordcode{code}
-% Default is kbdinputdistinct. (Too much of a hassle to call the macro,
-% the catcodes are wrong for parsearg to work.)
-\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
+% Default is `distinct.'
+\kbdinputstyle distinct
\def\xkey{\key}
\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
@@ -1592,7 +1685,8 @@ where each line of input produces a line of output.}
\let\subtitlerm=\tenrm
\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
@@ -1873,10 +1967,18 @@ where each line of input produces a line of output.}
% \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
@@ -1982,11 +2084,6 @@ where each line of input produces a line of output.}
\def\itemcontents{#1}%
\let\item=\itemizeitem}
-% Set sfcode to normal for the chars that usually have another value.
-% These are `.?!:;,'
-\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
- \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
-
% \splitoff TOKENS\endmark defines \first to be the first token in
% TOKENS, and \rest to be the remainder.
%
@@ -2208,8 +2305,8 @@ where each line of input produces a line of output.}
\let\go\pickupwholefraction
\else
\global\advance\colcount by 1
- \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator;
- % typically that is always in the input, anyway.
+ \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
@@ -2224,18 +2321,18 @@ where each line of input produces a line of output.}
\go
}
-% This used to have \hskip1sp. But then the space in a template line is
-% not enough. That is bad. So let's go back to just & until we
-% encounter the problem it was intended to solve again.
-% --karl, nathan@acm.org, 20apr99.
-\def\tab{&}
-
% @multitable ... @end multitable definitions:
%
\def\multitable{\parsearg\dotable}
\def\dotable#1{\bgroup
\vskip\parskip
- \let\item\crcr
+ \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
@@ -2243,7 +2340,11 @@ where each line of input produces a line of output.}
\parindent=\multitableparindent
\overfullrule=0pt
\global\colcount=0
- \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
+ \def\Emultitable{%
+ \global\setpercentfalse
+ \crcrwithfootnotes\crcr
+ \egroup\egroup
+ }%
%
% To parse everything between @multitable and @item:
\setuptable#1 \endsetuptable
@@ -2332,6 +2433,25 @@ 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.
@@ -2367,65 +2487,117 @@ width0pt\relax} \fi
% 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 = \relax
- \let\deffn = \relax
- \let\deffnx = \relax
+ \let\defcv = \empty
+ \let\defcvx = \empty
+ \let\Edefcv = \empty
+ \let\deffn = \empty
+ \let\deffnx = \empty
+ \let\Edeffn = \empty
\let\defindex = \relax
- \let\defivar = \relax
- \let\defmac = \relax
- \let\defmethod = \relax
- \let\defop = \relax
- \let\defopt = \relax
- \let\defspec = \relax
- \let\deftp = \relax
- \let\deftypefn = \relax
- \let\deftypefun = \relax
- \let\deftypeivar = \relax
- \let\deftypeop = \relax
- \let\deftypevar = \relax
- \let\deftypevr = \relax
- \let\defun = \relax
- \let\defvar = \relax
- \let\defvr = \relax
- \let\ref = \relax
- \let\xref = \relax
- \let\printindex = \relax
- \let\pxref = \relax
- \let\settitle = \relax
- \let\setchapternewpage = \relax
- \let\setchapterstyle = \relax
- \let\everyheading = \relax
+ \let\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\oddheading = \relax
\let\everyfooting = \relax
- \let\evenfooting = \relax
- \let\oddfooting = \relax
+ \let\everyheading = \relax
\let\headings = \relax
\let\include = \relax
+ \let\item = \relax
\let\lowersections = \relax
- \let\down = \relax
+ \let\oddfooting = \relax
+ \let\oddheading = \relax
+ \let\printindex = \relax
+ \let\pxref = \relax
\let\raisesections = \relax
- \let\up = \relax
+ \let\ref = \relax
\let\set = \relax
- \let\clear = \relax
- \let\item = \relax
+ \let\setchapternewpage = \relax
+ \let\setchapterstyle = \relax
+ \let\settitle = \relax
+ \let\up = \relax
+ \let\verbatiminclude = \relax
+ \let\xref = \relax
}
-% Ignore @ignore, @ifhtml, @ifinfo, @ifplaintext, @ifnottex, @html, @menu,
-% @direntry, and @documentdescription.
+% Ignore @ignore, @ifhtml, @ifinfo, and the like.
%
-\def\ignore{\doignore{ignore}}
+\def\direntry{\doignore{direntry}}
+\def\documentdescriptionword{documentdescription}
+\def\documentdescription{\doignore{documentdescription}}
+\def\html{\doignore{html}}
\def\ifhtml{\doignore{ifhtml}}
\def\ifinfo{\doignore{ifinfo}}
-\def\ifplaintext{\doignore{ifplaintext}}
\def\ifnottex{\doignore{ifnottex}}
-\def\html{\doignore{html}}
+\def\ifplaintext{\doignore{ifplaintext}}
+\def\ifxml{\doignore{ifxml}}
+\def\ignore{\doignore{ignore}}
\def\menu{\doignore{menu}}
-\def\direntry{\doignore{direntry}}
-\def\documentdescription{\doignore{documentdescription}}
-\def\documentdescriptionword{documentdescription}
+\def\xml{\doignore{xml}}
% @dircategory CATEGORY -- specify a category of the dir file
% which this file should belong to. Ignore this in TeX.
@@ -2443,7 +2615,7 @@ width0pt\relax} \fi
\long\def\doignoretext##1@end #1{\enddoignore}%
%
% Make sure that spaces turn into tokens that match what \doignoretext wants.
- \catcode32 = 10
+ \catcode\spaceChar = 10
%
% Ignore braces, too, so mismatched braces don't cause trouble.
\catcode`\{ = 9
@@ -2485,7 +2657,7 @@ width0pt\relax} \fi
\immediate\write16{If you are running another version of TeX, relax.}
\immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
\immediate\write16{ Then upgrade your TeX installation if you can.}
- \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)}
+ \immediate\write16{ (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.}
@@ -2507,8 +2679,8 @@ width0pt\relax} \fi
% 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.
+ % 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.
@@ -2529,8 +2701,8 @@ width0pt\relax} \fi
%
% 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
+ % 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.
%
@@ -2559,7 +2731,7 @@ width0pt\relax} \fi
% Do minimal line-breaking.
\pretolerance = 10000
%
- % Do not execute instructions in @tex
+ % 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.
@@ -2604,7 +2776,7 @@ width0pt\relax} \fi
% we're called from @code, as @code{@value{foo-bar_}}. So \let any
% such active characters to their normal equivalents.
\gdef\value{\begingroup
- \catcode`\-=12 \catcode`\_=12
+ \catcode`\-=\other \catcode`\_=\other
\indexbreaks \let_\normalunderscore
\valuexxx}
}
@@ -2613,15 +2785,17 @@ width0pt\relax} \fi
% We have this subroutine so that we can handle at least some @value's
% properly in indexes (we \let\value to this in \indexdummies). Ones
% whose names contain - or _ still won't work, but we can't do anything
-% about that. The command has to be fully expandable, since the result
-% winds up in the index file. This means that if the variable's value
-% contains other Texinfo commands, it's almost certain it will fail
-% (although perhaps we could fix that with sufficient work to do a
-% one-level expansion on the result, instead of complete).
+% 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
@@ -2630,13 +2804,14 @@ width0pt\relax} \fi
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
% with @set.
%
-\def\ifset{\parsearg\ifsetxxx}
-\def\ifsetxxx #1{%
+\def\ifset{\parsearg\doifset}
+\def\doifset#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifsetfail
+ \let\next=\ifsetfail
\else
- \expandafter\ifsetsucceed
+ \let\next=\ifsetsucceed
\fi
+ \next
}
\def\ifsetsucceed{\conditionalsucceed{ifset}}
\def\ifsetfail{\nestedignore{ifset}}
@@ -2645,13 +2820,14 @@ width0pt\relax} \fi
% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
% defined with @set, or has been undefined with @clear.
%
-\def\ifclear{\parsearg\ifclearxxx}
-\def\ifclearxxx #1{%
+\def\ifclear{\parsearg\doifclear}
+\def\doifclear#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifclearsucceed
+ \let\next=\ifclearsucceed
\else
- \expandafter\ifclearfail
+ \let\next=\ifclearfail
\fi
+ \next
}
\def\ifclearsucceed{\conditionalsucceed{ifclear}}
\def\ifclearfail{\nestedignore{ifclear}}
@@ -2670,28 +2846,13 @@ width0pt\relax} \fi
\defineunmatchedend{ifnotinfo}
\defineunmatchedend{ifnotplaintext}
-% We can't just want to start a group at @iftex (etc.) and end it at
-% @end iftex, since then @set commands inside the conditional have no
-% effect (they'd get reverted at the end of the group). So we must
-% define \Eiftex to redefine itself to be its previous value. (We can't
-% just define it to fail again with an ``unmatched end'' error, since
-% the @ifset might be nested.)
-%
-\def\conditionalsucceed#1{%
- \edef\temp{%
- % Remember the current value of \E#1.
- \let\nece{prevE#1} = \nece{E#1}%
- %
- % At the `@end #1', redefine \E#1 to be its previous value.
- \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
- }%
- \temp
-}
-
-% We need to expand lots of \csname's, but we don't want to expand the
-% control sequences after we've constructed them.
+% 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\nece#1{\expandafter\noexpand\csname#1\endcsname}
+\def\conditionalsucceed#1{\begingroup
+ \expandafter\def\csname E#1\endcsname{\endgroup}%
+}
% @defininfoenclose.
\let\definfoenclose=\comment
@@ -2784,104 +2945,166 @@ width0pt\relax} \fi
\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
-% Take care of texinfo commands likely to appear in an index entry.
-% (Must be a way to avoid doing expansion at all, and thus not have to
-% laboriously list every single command here.)
+% 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{%
-\def\ { }%
-\def\@{@}% change to @@ when we switch to @ as escape char in aux files.
-% Need these in case \tex is in effect and \{ is a \delimiter again.
-% But can't use \lbracecmd and \rbracecmd because texindex assumes
-% braces and backslashes are used only as delimiters.
-\let\{ = \mylbrace
-\let\} = \myrbrace
-\def\_{{\realbackslash _}}%
-\normalturnoffactive
-%
-% Take care of the plain tex accent commands.
-\def\,##1{\realbackslash ,{##1}}%
-\def\"{\realbackslash "}%
-\def\`{\realbackslash `}%
-\def\'{\realbackslash '}%
-\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}%
-\def\dotless##1{\realbackslash dotless {##1}}%
-% Take care of the plain tex special European modified letters.
-\def\AA{\realbackslash AA}%
-\def\AE{\realbackslash AE}%
-\def\L{\realbackslash L}%
-\def\OE{\realbackslash OE}%
-\def\O{\realbackslash O}%
-\def\aa{\realbackslash aa}%
-\def\ae{\realbackslash ae}%
-\def\l{\realbackslash l}%
-\def\oe{\realbackslash oe}%
-\def\o{\realbackslash o}%
-\def\ss{\realbackslash ss}%
-%
-% Although these internals commands shouldn't show up, sometimes they do.
-\def\bf{\realbackslash bf }%
-\def\gtr{\realbackslash gtr}%
-\def\hat{\realbackslash hat}%
-\def\less{\realbackslash less}%
-%\def\rm{\realbackslash rm }%
-\def\sf{\realbackslash sf}%
-\def\sl{\realbackslash sl }%
-\def\tclose##1{\realbackslash tclose {##1}}%
-\def\tt{\realbackslash tt}%
-%
-\def\b##1{\realbackslash b {##1}}%
-\def\i##1{\realbackslash i {##1}}%
-\def\sc##1{\realbackslash sc {##1}}%
-\def\t##1{\realbackslash t {##1}}%
-\def\r##1{\realbackslash r {##1}}%
-%
-\def\TeX{\realbackslash TeX}%
-\def\acronym##1{\realbackslash acronym {##1}}%
-\def\cite##1{\realbackslash cite {##1}}%
-\def\code##1{\realbackslash code {##1}}%
-\def\command##1{\realbackslash command {##1}}%
-\def\dfn##1{\realbackslash dfn {##1}}%
-\def\dots{\realbackslash dots }%
-\def\emph##1{\realbackslash emph {##1}}%
-\def\env##1{\realbackslash env {##1}}%
-\def\file##1{\realbackslash file {##1}}%
-\def\kbd##1{\realbackslash kbd {##1}}%
-\def\key##1{\realbackslash key {##1}}%
-\def\math##1{\realbackslash math {##1}}%
-\def\option##1{\realbackslash option {##1}}%
-\def\samp##1{\realbackslash samp {##1}}%
-\def\strong##1{\realbackslash strong {##1}}%
-\def\uref##1{\realbackslash uref {##1}}%
-\def\url##1{\realbackslash url {##1}}%
-\def\var##1{\realbackslash var {##1}}%
-\def\w{\realbackslash w }%
-%
-% These math commands don't seem likely to be used in index entries.
-\def\copyright{\realbackslash copyright}%
-\def\equiv{\realbackslash equiv}%
-\def\error{\realbackslash error}%
-\def\expansion{\realbackslash expansion}%
-\def\point{\realbackslash point}%
-\def\print{\realbackslash print}%
-\def\result{\realbackslash result}%
-%
-% Handle some cases of @value -- where the variable name does not
-% contain - or _, and the value does not contain any
-% (non-fully-expandable) commands.
-\let\value = \expandablevalue
-%
-\unsepspaces
-% Turn off macro expansion
-\turnoffmacros
+ \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
@@ -2890,83 +3113,86 @@ width0pt\relax} \fi
{\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{%
-\def\@{@}%
-% how to handle braces?
-\def\_{\normalunderscore}%
-%
-\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\AA{AA}%
-\def\AE{AE}%
-\def\L{L}%
-\def\OE{OE}%
-\def\O{O}%
-\def\aa{aa}%
-\def\ae{ae}%
-\def\l{l}%
-\def\oe{oe}%
-\def\o{o}%
-\def\ss{ss}%
-%
-% Don't no-op \tt, since it isn't a user-level command
-% and is used in the definitions of the active chars like <, >, |, etc.
-% Likewise with the other plain tex font commands.
-%\let\tt=\indexdummyfont
-%
-\let\b=\indexdummyfont
-\let\i=\indexdummyfont
-\let\r=\indexdummyfont
-\let\sc=\indexdummyfont
-\let\t=\indexdummyfont
-%
-\let\TeX=\indexdummytex
-\let\acronym=\indexdummyfont
-\let\cite=\indexdummyfont
-\let\code=\indexdummyfont
-\let\command=\indexdummyfont
-\let\dfn=\indexdummyfont
-\let\dots=\indexdummydots
-\let\emph=\indexdummyfont
-\let\env=\indexdummyfont
-\let\file=\indexdummyfont
-\let\kbd=\indexdummyfont
-\let\key=\indexdummyfont
-\let\math=\indexdummyfont
-\let\option=\indexdummyfont
-\let\samp=\indexdummyfont
-\let\strong=\indexdummyfont
-\let\uref=\indexdummyfont
-\let\url=\indexdummyfont
-\let\var=\indexdummyfont
-\let\w=\indexdummyfont
-}
-
-% To define \realbackslash, we must make \ not be an escape.
-% 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)?
@@ -2998,28 +3224,24 @@ width0pt\relax} \fi
\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
% so it will be output as is; and it will print as backslash.
%
- \def\thirdarg{#3}%
- %
- % If third arg is present, precede it with space in sort key.
- \ifx\thirdarg\emptymacro
- \let\subentry = \empty
- \else
- \def\subentry{ #3}%
- \fi
- %
- % First process the index entry with all font commands turned
- % off to get the string to sort by.
- {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
- %
- % Now the real index entry with the fonts.
+ % The main index entry text.
\toks0 = {#2}%
%
- % If the third (subentry) arg is present, add it to the index
- % line to write.
+ % If third arg is present, precede it with space in sort key.
+ \def\thirdarg{#3}%
\ifx\thirdarg\emptymacro \else
- \toks0 = \expandafter{\the\toks0{#3}}%
+ % 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
@@ -3050,12 +3272,11 @@ width0pt\relax} \fi
\iflinks
\ifvmode
\skip0 = \lastskip
- \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
+ \ifdim\lastskip = 0pt \else \nobreak\vskip-\skip0 \fi
\fi
%
\temp % do the write
%
- %
\ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
\fi
}%
@@ -3531,42 +3752,41 @@ width0pt\relax} \fi
\outer\def\chapter{\parsearg\chapteryyy}
\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
\def\chapterzzz #1{%
-\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
-\chapmacro {#1}{\the\chapno}%
-\gdef\thissection{#1}%
-\gdef\thischaptername{#1}%
-% We don't substitute the actual chapter name into \thischapter
-% because we don't want its macros evaluated now.
-\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
- {\the\chapno}}}%
-\temp
-\donoderef
-\global\let\section = \numberedsec
-\global\let\subsection = \numberedsubsec
-\global\let\subsubsection = \numberedsubsubsec
-}
+ \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{%
-\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \appendixno by 1
-\message{\putwordAppendix\space \appendixletter}%
-\chapmacro {#1}{\putwordAppendix{} \appendixletter}%
-\gdef\thissection{#1}%
-\gdef\thischaptername{#1}%
-\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash appendixentry{\the\toks0}%
- {\appendixletter}}}%
-\temp
-\appendixnoderef
-\global\let\section = \appendixsec
-\global\let\subsection = \appendixsubsec
-\global\let\subsubsection = \appendixsubsubsec
+ \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.
@@ -3579,150 +3799,121 @@ width0pt\relax} \fi
\outer\def\unnumbered{\parsearg\unnumberedyyy}
\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
\def\unnumberedzzz #1{%
-\secno=0 \subsecno=0 \subsubsecno=0
-%
-% This used to be simply \message{#1}, but TeX fully expands the
-% argument to \message. Therefore, if #1 contained @-commands, TeX
-% expanded them. For example, in `@unnumbered The @cite{Book}', TeX
-% expanded @cite (which turns out to cause errors because \cite is meant
-% to be executed, not expanded).
-%
-% Anyway, we don't want the fully-expanded definition of @cite to appear
-% as a result of the \message, we just want `@cite' itself. We use
-% \the<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}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}%
-\temp
-\unnumbnoderef
-\global\let\section = \unnumberedsec
-\global\let\subsection = \unnumberedsubsec
-\global\let\subsubsection = \unnumberedsubsubsec
+ \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{%
-\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
-\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
- {\the\chapno}{\the\secno}}}%
-\temp
-\donoderef
-\nobreak
+ \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{%
-\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
-\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
- {\appendixletter}{\the\secno}}}%
-\temp
-\appendixnoderef
-\nobreak
+ \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{%
-\plainsecheading {#1}\gdef\thissection{#1}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry%
- {\the\toks0}{\the\chapno}}}%
-\temp
-\unnumbnoderef
-\nobreak
+ \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{%
-\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
-\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
- {\the\chapno}{\the\secno}{\the\subsecno}}}%
-\temp
-\donoderef
-\nobreak
+ \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{%
-\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
-\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
- {\appendixletter}{\the\secno}{\the\subsecno}}}%
-\temp
-\appendixnoderef
-\nobreak
+ \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{%
-\plainsubsecheading {#1}\gdef\thissection{#1}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
- {\the\toks0}{\the\chapno}{\the\secno}}}%
-\temp
-\unnumbnoderef
-\nobreak
+ \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{%
-\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
-\subsubsecheading {#1}
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
-\temp
-\donoderef
-\nobreak
+ \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{%
-\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
-\subsubsecheading {#1}
- {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
- {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
-\temp
-\appendixnoderef
-\nobreak
+ \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{%
-\plainsubsubsecheading {#1}\gdef\thissection{#1}%
-\toks0 = {#1}%
-\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
- {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}}}%
-\temp
-\unnumbnoderef
-\nobreak
+ \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.
@@ -3763,16 +3954,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}
@@ -3918,7 +4109,16 @@ 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
}
@@ -3930,16 +4130,22 @@ width0pt\relax} \fi
% Called from @chapter, etc. We supply {\folio} at the end of the
% argument, which will end up as the last argument to the \...entry macro.
%
-% We open the .toc file here instead of at @setfilename or any other
-% fixed time so that @contents can be put in the document anywhere.
+% 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{%
+\def\writetocentry#1#2#3{%
\iftocfileopened\else
\immediate\openout\tocfile = \jobname.toc
\global\tocfileopenedtrue
\fi
- \iflinks \write\tocfile{#1{\folio}}\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
@@ -3978,7 +4184,7 @@ width0pt\relax} \fi
\advance\hsize by -\contentsrightmargin % Don't use the full line length.
%
% Roman numerals for page numbers.
- \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
+ \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
}
@@ -3995,7 +4201,7 @@ width0pt\relax} \fi
\pdfmakeoutlines
\endgroup
\lastnegativepageno = \pageno
- \pageno = \savepageno
+ \global\pageno = \savepageno
}
% And just the chapters.
@@ -4007,16 +4213,17 @@ width0pt\relax} \fi
\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##3{}
\def\subsecentry ##1##2##3##4##5{}
- \def\unnumbsubsecentry ##1##2##3##4{}
\def\subsubsecentry ##1##2##3##4##5##6{}
- \def\unnumbsubsubsecentry ##1##2##3##4##5{}
+ \let\unnumbsecentry = \secentry
+ \let\unnumbsubsecentry = \subsecentry
+ \let\unnumbsubsubsecentry = \subsubsecentry
\openin 1 \jobname.toc
\ifeof 1 \else
\closein 1
@@ -4026,7 +4233,7 @@ width0pt\relax} \fi
\contentsalignmacro % in case @setchapternewpage odd is in effect
\endgroup
\lastnegativepageno = \pageno
- \pageno = \savepageno
+ \global\pageno = \savepageno
}
\let\shortcontents = \summarycontents
@@ -4049,7 +4256,8 @@ width0pt\relax} \fi
}
% Appendices, in the main contents.
-\def\appendixentry#1#2#3{\dochapentry{\putwordAppendix{} #2\labelspace#1}{#3}}
+\def\appendixentry#1#2#3{%
+ \dochapentry{\appendixbox{\putwordAppendix{} #2}\labelspace#1}{#3}}
%
% Appendices, in the short toc.
\let\shortappendixentry = \shortchapentry
@@ -4073,21 +4281,21 @@ width0pt\relax} \fi
}
% Unnumbered chapters.
-\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
-\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}}
+\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#3{\dosecentry{#1}{#3}}
+\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#3#4{\dosubsecentry{#1}{#4}}
+\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#3#4#5{\dosubsubsecentry{#1}{#5}}
+\def\unnumbsubsubsecentry#1#2#3#4#5#6{\dosubsubsecentry{#1}{#6}}
% This parameter controls the indentation of the various levels.
\newdimen\tocindent \tocindent = 3pc
@@ -4189,14 +4397,14 @@ width0pt\relax} \fi
\def\tex{\begingroup
\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
- \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
+ \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
\catcode `\%=14
- \catcode 43=12 % plus
- \catcode`\"=12
- \catcode`\==12
- \catcode`\|=12
- \catcode`\<=12
- \catcode`\>=12
+ \catcode `\+=\other
+ \catcode `\"=\other
+ \catcode `\==\other
+ \catcode `\|=\other
+ \catcode `\<=\other
+ \catcode `\>=\other
\escapechar=`\\
%
\let\b=\ptexb
@@ -4250,15 +4458,18 @@ 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{{%
- \ifnum\lastpenalty < 10000
+ % =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
- \penalty-50
+ % 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
@@ -4290,7 +4501,8 @@ 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*.
@@ -4337,7 +4549,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
@@ -4376,27 +4587,16 @@ width0pt\relax} \fi
% @example: Same as @lisp.
\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
-% @small... is usually equivalent to the non-small (@smallbook
-% redefines). We must call \example (or whatever) last in the
-% definition, since it reads the return following the @example (or
-% whatever) command.
-%
-% This actually allows (for example) @end display inside an
-% @smalldisplay. Too bad, but makeinfo will catch the error anyway.
-%
-\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
-\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
-\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
-\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
-
-% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
+% @smallexample and @smalllisp: use smaller fonts.
% Originally contributed by Pavel@xerox.
-\def\smalllispx{\begingroup
+\def\smalllisp{\begingroup
\def\Esmalllisp{\nonfillfinish\endgroup}%
\def\Esmallexample{\nonfillfinish\endgroup}%
\smallexamplefonts
\lisp
}
+\let\smallexample = \smalllisp
+
% @display: same as @lisp except keep current font.
%
@@ -4406,9 +4606,9 @@ width0pt\relax} \fi
\gobble
}
%
-% @smalldisplay (when @smallbook): @display plus smaller fonts.
+% @smalldisplay: @display plus smaller fonts.
%
-\def\smalldisplayx{\begingroup
+\def\smalldisplay{\begingroup
\def\Esmalldisplay{\nonfillfinish\endgroup}%
\smallexamplefonts \rm
\display
@@ -4423,9 +4623,9 @@ width0pt\relax} \fi
\gobble
}
%
-% @smallformat (when @smallbook): @format plus smaller fonts.
+% @smallformat: @format plus smaller fonts.
%
-\def\smallformatx{\begingroup
+\def\smallformat{\begingroup
\def\Esmallformat{\nonfillfinish\endgroup}%
\smallexamplefonts \rm
\format
@@ -4452,7 +4652,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...
@@ -4475,10 +4674,14 @@ width0pt\relax} \fi
%
% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
%
-% [Knuth] p. 344; only we need to do '@' too
+% [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\^\do\^^K\do\_\do\^^A\do\%\do\~}
+ \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{%
@@ -4565,7 +4768,7 @@ width0pt\relax} \fi
%
% 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 '}'
+% we need not redefine '\', '{' and '}'.
%
% Inspired by LaTeX's verbatim command set [latex.ltx]
%% Include LaTeX hack for completeness -- never know
@@ -4575,9 +4778,14 @@ width0pt\relax} \fi
%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[
%% #1|endgroup|def|Everbatim[]|end[verbatim]]
%% |endgroup
+%
\begingroup
\catcode`\ =\active
- \gdef\doverbatim#1@end verbatim{#1\end{verbatim}}
+ \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{%
@@ -4593,14 +4801,14 @@ width0pt\relax} \fi
% Allow normal characters that we make active in the argument (a file name).
\def\verbatiminclude{%
\begingroup
- \catcode`\\=12
- \catcode`~=12
- \catcode`^=12
- \catcode`_=12
- \catcode`|=12
- \catcode`<=12
- \catcode`>=12
- \catcode`+=12
+ \catcode`\\=\other
+ \catcode`~=\other
+ \catcode`^=\other
+ \catcode`_=\other
+ \catcode`|=\other
+ \catcode`<=\other
+ \catcode`>=\other
+ \catcode`+=\other
\parsearg\doverbatiminclude
}
\def\setupverbatiminclude{%
@@ -4614,44 +4822,102 @@ width0pt\relax} \fi
% Restore active chars for included file.
\endgroup
\begingroup
- \def\thisfile{#1}%
- \expandafter\expandafter\setupverbatiminclude\input\thisfile
- \endgroup\nonfillfinish\endgroup
+ \let\value=\expandablevalue
+ \def\thisfile{#1}%
+ \expandafter\expandafter\setupverbatiminclude\input\thisfile
+ \endgroup
+ \nonfillfinish
+ \endgroup
}
% @copying ... @end copying.
-% Save the text away for @insertcopying later.
+% 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.
%
-\newbox\copyingbox
-%
\def\copying{\begingroup
- \parindent = 0pt % looks wrong on title page
- \def\Ecopying{\egroup\endgroup}%
- \global\setbox\copyingbox = \vbox\bgroup
+ % 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
}
-% @insertcopying.
-%
-\def\insertcopying{\unvcopy\copyingbox}
+% 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,}
% @defun etc.
% Allow user to change definition object font (\df) internally
-\def\setdeffont #1 {\csname DEF#1\endcsname}
+\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 = )
@@ -4698,88 +4964,124 @@ width0pt\relax} \fi
% Active &'s sneak into the index arguments, so make sure it's defined.
{
- \catcode`& = 13
+ \catcode`& = \active
\global\let& = \ampnr
}
-% First, defname, which formats the header line itself.
-% #1 should be the function name.
-% #2 should be the type of definition, such as "Function".
-
-\def\defname #1#2{%
-% Get the values of \leftskip and \rightskip as they were
-% outside the @def...
-\dimen2=\leftskip
-\advance\dimen2 by -\defbodyindent
-\noindent
-\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
-\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
-\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
-\parshape 2 0in \dimen0 \defargsindent \dimen1
-% Now output arg 2 ("Function" or some such)
-% ending at \deftypemargin from the right margin,
-% but stuck inside a box of width 0 so it does not interfere with linebreaking
-{% Adjust \hsize to exclude the ambient margins,
-% so that \rightline will obey them.
-\advance \hsize by -\dimen2
-\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}%
-% Make all lines underfull and no complaints:
-\tolerance=10000 \hbadness=10000
-\advance\leftskip by -\defbodyindent
-\exdentamount=\defbodyindent
-{\df #1}\enskip % Generate function name
-}
-
-% Actually process the body of a definition
-% #1 should be the terminating control sequence, such as \Edefun.
-% #2 should be the "another name" control sequence, such as \defunx.
-% #3 should be the control sequence that actually processes the header,
-% such as \defunheader.
-
-\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
-\parindent=0in
-\advance\leftskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup %
-\catcode 61=\active % 61 is `='
-\obeylines\activeparens\spacesplit#3}
+% \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.
+}
+% 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 for consecutive fns (which we define).
-% #3 is the control sequence to call to resume processing.
+% #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
+ % 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}%
+ %
+ \parindent=0in
+ \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 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
+\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 is the \E... control sequence to end the definition (which we define).
-% #2 is the \...x control sequence for consecutive fns (which we define).
-% #3 is the control sequence to call to resume processing.
+% #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 {\begingroup\inENV
- \medbreak
- \def#1{\endgraf\endgroup\medbreak}%
- \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
- \parindent=0in
- \advance\leftskip by \defbodyindent
- \exdentamount=\defbodyindent
- \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
+\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
@@ -4788,64 +5090,48 @@ width0pt\relax} \fi
% input at hand. Thus also need a control sequence (passed as #5) for
% the \E... definition to assign the category name to.
%
-\def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV
- \medbreak
- \def#1{\endgraf\endgroup\medbreak}%
- \def#2##1 ##2 ##3 {%
- \def#4{##1}%
- \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}%
- \parindent=0in
- \advance\leftskip by \defbodyindent
- \exdentamount=\defbodyindent
- \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}}
-
-\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 ##2 {\def#4{##1}%
-\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
+\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{\begingroup\inENV% Environment for definitionbody
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2{\begingroup\obeylines\spacesplit#3}%
-\parindent=0in
-\advance\leftskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup %
-\catcode 61=\active %
-\obeylines\spacesplit#3}
-
-% This is used for \def{tp,vr}parsebody. It could probably be used for
-% some of the others, too, with some judicious conditionals.
%
-\def\parsebodycommon#1#2#3{%
- \begingroup\inENV %
- \medbreak %
- % Define the end token that this defining construct specifies
- % so that it will exit this group.
- \def#1{\endgraf\endgroup\medbreak}%
- \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
- \parindent=0in
- \advance\leftskip by \defbodyindent
- \exdentamount=\defbodyindent
+\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}}%
}
@@ -4860,6 +5146,8 @@ 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
}
@@ -4876,38 +5164,37 @@ width0pt\relax} \fi
#1{\removeemptybraces#2\relax}{#3}%
}%
-\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 ##2 {\def#4{##1}%
-\begingroup\obeylines\spacesplit{#3{##2}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\spacesplit{#3{#5}}}
-
-% Split up #2 at the first space token.
+% 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.
+}
+% 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.
@@ -4916,9 +5203,7 @@ width0pt\relax} \fi
#1%
{\tensl\hyphenchar\font=45}%
\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
-\interlinepenalty=10000
-\advance\rightskip by 0pt plus 1fil
-\endgraf\nobreak\vskip -\parskip\nobreak
+ \defargscommonending
}
\def\deftypefunargs #1{%
@@ -4927,9 +5212,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\nobreak\vskip -\parskip\nobreak
+ \defargscommonending
}
% Do complete processing of one @defun or @defunx line already parsed.
@@ -4940,7 +5223,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
@@ -4950,7 +5233,7 @@ width0pt\relax} \fi
\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
\begingroup\defname {#1}{\putwordDeffunc}%
\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @deftypefun int foobar (int @var{foo}, float @var{bar})
@@ -4964,7 +5247,7 @@ width0pt\relax} \fi
\doind {fn}{\code{#2}}% Make entry in function index
\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}%
\deftypefunargs {#3}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
@@ -4985,7 +5268,7 @@ width0pt\relax} \fi
% at least some C++ text from working
\defname {\defheaderxcond#2\relax$.$#3}{#1}%
\deftypefunargs {#4}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @defmac == @deffn Macro
@@ -4995,7 +5278,7 @@ width0pt\relax} \fi
\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
\begingroup\defname {#1}{\putwordDefmac}%
\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @defspec == @deffn Special Form
@@ -5005,7 +5288,7 @@ width0pt\relax} \fi
\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
\begingroup\defname {#1}{\putwordDefspec}%
\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
+\catcode\equalChar=\other % Turn off change made in \defparsebody
}
% @defop CATEGORY CLASS OPERATION ARG...
@@ -5014,9 +5297,11 @@ width0pt\relax} \fi
\defopparsebody\Edefop\defopx\defopheader\defoptype}
%
\def\defopheader#1#2#3{%
-\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
-\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}%
-\defunargs {#3}\endgroup %
+ \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% function index entry
+ \begingroup
+ \defname{#2}{\defoptype\ \putwordon\ #1}%
+ \defunargs{#3}%
+ \endgroup
}
% @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
@@ -5083,9 +5368,11 @@ width0pt\relax} \fi
\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
\def\defcvarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index
-\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}%
-\defvarargs {#3}\endgroup %
+ \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% variable index entry
+ \begingroup
+ \defname{#2}{\defcvtype\ \putwordof\ #1}%
+ \defvarargs{#3}%
+ \endgroup
}
% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
@@ -5093,7 +5380,7 @@ width0pt\relax} \fi
\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
%
\def\defivarheader#1#2#3{%
- \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index
+ \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% entry in var index
\begingroup
\defname{#2}{\putwordInstanceVariableof\ #1}%
\defvarargs{#3}%
@@ -5105,8 +5392,8 @@ width0pt\relax} \fi
% This is actually simple: just print them in roman.
% This must expand the args and terminate the paragraph they make up
\def\defvarargs #1{\normalparens #1%
-\interlinepenalty=10000
-\endgraf\nobreak\vskip -\parskip\nobreak}
+ \defargscommonending
+}
% @defvr Counter foo-count
@@ -5142,8 +5429,7 @@ width0pt\relax} \fi
\def\deftypevarheader #1#2{%
\dovarind#2 \relax% Make entry in variables index
\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
-\interlinepenalty=10000
-\endgraf\nobreak\vskip -\parskip\nobreak
+ \defargscommonending
\endgroup}
\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
@@ -5153,8 +5439,7 @@ width0pt\relax} \fi
\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
-\interlinepenalty=10000
-\endgraf\nobreak\vskip -\parskip\nobreak
+ \defargscommonending
\endgroup}
% Now define @deftp
@@ -5203,7 +5488,7 @@ width0pt\relax} \fi
\def\scanmacro#1{%
\begingroup \newlinechar`\^^M
% Undo catcode changes of \startcontents and \doprintindex
- \catcode`\@=0 \catcode`\\=12 \escapechar=`\@
+ \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
@@ -5217,7 +5502,7 @@ width0pt\relax} \fi
\def\scanmacro#1{%
\begingroup \newlinechar`\^^M
% Undo catcode changes of \startcontents and \doprintindex
-\catcode`\@=0 \catcode`\\=12 \escapechar=`\@
+\catcode`\@=0 \catcode`\\=\other \escapechar=`\@
\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
\fi
@@ -5247,7 +5532,7 @@ width0pt\relax} \fi
}
% Trim a single trailing ^^M off a string.
-{\catcode`\^^M=12\catcode`\Q=3%
+{\catcode`\^^M=\other \catcode`\Q=3%
\gdef\eatcr #1{\eatcra #1Q^^MQ}%
\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
\gdef\eatcrb#1Q#2Q{#1}%
@@ -5262,29 +5547,29 @@ width0pt\relax} \fi
% body, and then making it the \newlinechar in \scanmacro.
\def\macrobodyctxt{%
- \catcode`\~=12
- \catcode`\^=12
- \catcode`\_=12
- \catcode`\|=12
- \catcode`\<=12
- \catcode`\>=12
- \catcode`\+=12
- \catcode`\{=12
- \catcode`\}=12
- \catcode`\@=12
- \catcode`\^^M=12
+ \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`\~=12
- \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
+ \catcode`\\=\other}
% \mbodybackslash is the definition of \ in @macro bodies.
% It maps \foo\ => \csname macarg.foo\endcsname => #N
@@ -5325,32 +5610,33 @@ width0pt\relax} \fi
\else \expandafter\parsemacbody
\fi}
-\def\unmacro{\parsearg\unmacroxxx}
-\def\unmacroxxx#1{%
+\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
+ % Remove the macro name from \macrolist:
\begingroup
- \edef\tempa{\expandafter\noexpand\csname#1\endcsname}%
- \def\do##1{%
- \def\tempb{##1}%
- \ifx\tempa\tempb
- % remove this
- \else
- \toks0 = \expandafter{\newmacrolist\do}%
- \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}%
- \fi}%
- \def\newmacrolist{}%
- % Execute macro list to define \newmacrolist
- \macrolist
- \global\let\macrolist\newmacrolist
+ \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.
@@ -5533,15 +5819,23 @@ width0pt\relax} \fi
\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
-% \setref{NAME}{SNT} defines a cross-reference point NAME, namely
-% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have
-% to set \indexdummies so commands such as @code in a section title
-% aren't expanded. It would be nicer not to expand the titles in the
-% first place, but there's so many layers that that is hard to do.
+% \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{{%
- \indexdummies
+ \atdummies
\pdfmkdest{#1}%
+ %
+ \turnoffactive
\dosetq{#1-title}{Ytitle}%
\dosetq{#1-pg}{Ypagenumber}%
\dosetq{#1-snt}{#2}%
@@ -5593,7 +5887,7 @@ width0pt\relax} \fi
\ifpdf
\leavevmode
\getfilename{#4}%
- {\normalturnoffactive
+ {\turnoffactive \otherbackslash
\ifnum\filenamelength>0
\startlink attr{/Border [0 0 0]}%
goto file{\the\filename.pdf} name{#1}%
@@ -5613,7 +5907,7 @@ width0pt\relax} \fi
% into the usual \leavevmode...\vrule stuff for purposes of
% printing. So we \turnoffactive for the \refx-snt, back on for the
% printing, back off for the \refx-pg.
- {\normalturnoffactive
+ {\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}{}}%
@@ -5622,73 +5916,74 @@ width0pt\relax} \fi
% [mynode],
[\printednodename],\space
% page 3
- \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+ \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}%
\fi
\endlink
\endgroup}
-% \dosetq is the interface for calls from other macros
-
-% Use \normalturnoffactive so that punctuation chars such as underscore
-% and backslash work in node names. (\turnoffactive doesn't do \.)
+% \dosetq is called from \setref to do the actual \write (\iflinks).
+%
\def\dosetq#1#2{%
{\let\folio=0%
- \normalturnoffactive
\edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
- \iflinks
- \next
- \fi
+ \iflinks \next \fi
}%
}
-% \internalsetq {foo}{page} expands into
-% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
-% When the aux file is read, ' is the escape character
-
-\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
-
-% Things to be expanded by \internalsetq
+% \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.
\angleleft un\-de\-fined\angleright
\iflinks
@@ -5703,19 +5998,14 @@ width0pt\relax} \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{\begingroup
- % Reenable \ as an escape while reading the second argument.
- \catcode`\\ = 0
- \afterassignment\endgroup
- \expandafter\gdef\csname X#1\endcsname
-}
+\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
@@ -5746,9 +6036,7 @@ width0pt\relax} \fi
\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 ^
@@ -5761,6 +6049,9 @@ width0pt\relax} \fi
% \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
@@ -5772,7 +6063,9 @@ width0pt\relax} \fi
\catcode`\$=\other
\catcode`\#=\other
\catcode`\&=\other
+ \catcode`\%=\other
\catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+ %
% Make the characters 128-255 be printing characters
{%
\count 1=128
@@ -5782,17 +6075,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
@@ -5837,7 +6131,7 @@ width0pt\relax} \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
@@ -5847,10 +6141,17 @@ width0pt\relax} \fi
% \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
@@ -5880,12 +6181,6 @@ 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\par\egroup}
-
}%end \catcode `\@=11
% @| inserts a changebar to the left of the current line. It should
@@ -5932,8 +6227,8 @@ width0pt\relax} \fi
\openin 1 = epsf.tex
\ifeof 1 \else
\closein 1
- % Do not bother showing banner with post-v2.7 epsf.tex (available in
- % doc/epsf.tex until it shows up on ctan).
+ % 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
@@ -6058,11 +6353,13 @@ should work if nowhere else does.}
}
% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
-% 4) hoffset; 5) binding offset; 6) topskip. We also call
-% \setleading{\textleading}, so the caller should define \textleading.
-% The caller should also set \parskip.
+% 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{%
+\def\internalpagesizes#1#2#3#4#5#6#7#8{%
\voffset = #3\relax
\topskip = #6\relax
\splittopskip = \topskip
@@ -6081,28 +6378,27 @@ should work if nowhere else does.}
\normaloffset = #4\relax
\bindingoffset = #5\relax
%
+ \ifpdf
+ \pdfpageheight #7\relax
+ \pdfpagewidth #8\relax
+ \fi
+ %
\setleading{\textleading}
%
\parindent = \defaultparindent
\setemergencystretch
}
-% Use `small' versions.
-%
-\def\smallenvironments{%
- \let\smalldisplay = \smalldisplayx
- \let\smallexample = \smalllispx
- \let\smallformat = \smallformatx
- \let\smalllisp = \smalllispx
-}
-
% @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}%
+ \internalpagesizes{46\baselineskip}{6in}%
+ {\voffset}{.25in}%
+ {\bindingoffset}{36pt}%
+ {11in}{8.5in}%
}}
% Use @smallbook to reset parameters for 7x9.5 (or so) format.
@@ -6110,26 +6406,42 @@ should work if nowhere else does.}
\parskip = 2pt plus 1pt
\textleading = 12pt
%
- \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
+ \internalpagesizes{7.5in}{5in}%
+ {\voffset}{.25in}%
+ {\bindingoffset}{16pt}%
+ {9.25in}{7in}%
%
\lispnarrowing = 0.3in
\tolerance = 700
\hfuzz = 1pt
\contentsrightmargin = 0pt
- \deftypemargin = 0pt
\defbodyindent = .5cm
- \smallenvironments
}}
% Use @afourpaper to print on European A4 paper.
\def\afourpaper{{\globaldefs = 1
\parskip = 3pt plus 2pt minus 1pt
- \textleading = 12pt
+ \textleading = 13.2pt
%
- \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}%
+ % 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.
@@ -6139,37 +6451,40 @@ should work if nowhere else does.}
\parskip = 2pt plus 1pt minus 0.1pt
\textleading = 12.5pt
%
- \internalpagesizes{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}%
+ \internalpagesizes{160mm}{120mm}%
+ {\voffset}{\hoffset}%
+ {\bindingoffset}{8pt}%
+ {210mm}{148mm}%
%
\lispnarrowing = 0.2in
\tolerance = 800
\hfuzz = 1.2pt
- \contentsrightmargin = 0mm
- \deftypemargin = 0pt
+ \contentsrightmargin = 0pt
\defbodyindent = 2mm
\tableindent = 12mm
- %
- \smallenvironments
}}
-% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
-% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
+% A specific text layout, 24x15cm overall, intended for A4 paper.
\def\afourlatex{{\globaldefs = 1
- \textleading = 13.6pt
- %
\afourpaper
- \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
+ \internalpagesizes{237mm}{150mm}%
+ {\voffset}{4.6mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
%
- % Must explicitly reset to 0 because we call \afourpaper, apparently,
- % although this does not entirely make sense.
+ % Must explicitly reset to 0 because we call \afourpaper.
\globaldefs = 0
}}
-% Use @afourwide to print on European A4 paper in wide format.
-\def\afourwide{%
+% Use @afourwide to print on A4 paper in landscape format.
+\def\afourwide{{\globaldefs = 1
\afourpaper
- \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
-}
+ \internalpagesizes{241mm}{165mm}%
+ {\voffset}{-2.95mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
+ \globaldefs = 0
+}}
% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
% Perhaps we should allow setting the margins, \topskip, \parskip,
@@ -6184,7 +6499,16 @@ should work if nowhere else does.}
\parskip = 3pt plus 2pt minus 1pt
\setleading{\textleading}%
%
- \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
+ \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.
@@ -6248,7 +6572,7 @@ should work if nowhere else does.}
\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\char124}}
@@ -6262,8 +6586,6 @@ should work if nowhere else does.}
\def+{{\tt \char 43}}
\catcode`\$=\active
\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
-%\catcode 27=\active
-%\def^^[{$\diamondsuit$}
% Set up an active definition for =, but don't enable it most of the time.
{\catcode`\==\active
@@ -6280,44 +6602,46 @@ should work if nowhere else does.}
\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}}
-% \catcode 17=0 % Define control-q
\catcode`\\=\active
% Used sometimes to turn off (effectively) the active characters
% even after parsing them.
-@def@turnoffactive{@let"=@normaldoublequote
-@let\=@realbackslash
-@let~=@normaltilde
-@let^=@normalcaret
-@let_=@normalunderscore
-@let|=@normalverticalbar
-@let<=@normalless
-@let>=@normalgreater
-@let+=@normalplus
-@let$=@normaldollar}%$ font-lock fix
-
-@def@normalturnoffactive{@let"=@normaldoublequote
-@let\=@normalbackslash
-@let~=@normaltilde
-@let^=@normalcaret
-@let_=@normalunderscore
-@let|=@normalverticalbar
-@let<=@normalless
-@let>=@normalgreater
-@let+=@normalplus
-@let$=@normaldollar}%$ font-lock fix
+@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.
diff --git a/eval.c b/eval.c
index 479cb920..751b0c37 100644
--- a/eval.c
+++ b/eval.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2002 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.
@@ -31,15 +31,17 @@ extern double fmod P((double x, double y));
static int eval_condition P((NODE *tree));
static NODE *op_assign P((NODE *tree));
-static NODE *func_call P((NODE *name, NODE *arg_list));
+static NODE *func_call P((NODE *tree));
static NODE *match_op P((NODE *tree));
+static int forloops_active P((void));
+static void pop_forloop P((void));
+static void pop_all_forloops P((void));
+static void push_forloop P((const char *varname, NODE **elems, size_t nelems));
static void push_args P((int count, NODE *arglist, NODE **oldstack,
- char *func_name, char **varnames));
+ const char *func_name, char **varnames));
static void pop_fcall_stack P((void));
static void pop_fcall P((void));
static int in_function P((void));
-char *nodetype2str P((NODETYPE type));
-char *flags2str P((int flagval));
static int comp_func P((const void *p1, const void *p2));
#if __GNUC__ < 2
@@ -66,8 +68,8 @@ int CONVFMTidx;
* the val variable allows return/continue/break-out-of-context to be
* caught and diagnosed
*/
-#define PUSH_BINDING(stack, x, val) (memcpy((char *)(stack), (char *)(x), sizeof(jmp_buf)), val++)
-#define RESTORE_BINDING(stack, x, val) (memcpy((char *)(x), (char *)(stack), sizeof(jmp_buf)), val--)
+#define PUSH_BINDING(stack, x, val) (memcpy((char *)(stack), (const char *)(x), sizeof(jmp_buf)), val++)
+#define RESTORE_BINDING(stack, x, val) (memcpy((char *)(x), (const char *)(stack), sizeof(jmp_buf)), val--)
static jmp_buf loop_tag; /* always the current binding */
static int loop_tag_valid = FALSE; /* nonzero when loop_tag valid */
@@ -92,7 +94,7 @@ extern int exiting, exit_val;
* just in this file.
*/
#if 'a' == 97 /* it's ascii */
-char casetable[] = {
+const char casetable[] = {
'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
'\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
'\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
@@ -150,7 +152,7 @@ char casetable[] = {
* This table maps node types to strings for debugging.
* KEEP IN SYNC WITH awk.h!!!!
*/
-static char *nodetypes[] = {
+static const char *const nodetypes[] = {
"Node_illegal",
"Node_times",
"Node_quotient",
@@ -198,6 +200,7 @@ static char *nodetypes[] = {
"Node_K_break",
"Node_K_continue",
"Node_K_print",
+ "Node_K_print_rec",
"Node_K_printf",
"Node_K_next",
"Node_K_exit",
@@ -248,7 +251,7 @@ static char *nodetypes[] = {
/* nodetype2str --- convert a node type into a printable value */
-char *
+const char *
nodetype2str(NODETYPE type)
{
static char buf[40];
@@ -262,16 +265,16 @@ nodetype2str(NODETYPE type)
/* flags2str --- make a flags value readable */
-char *
+const char *
flags2str(int flagval)
{
- static struct flagtab values[] = {
+ static const struct flagtab values[] = {
{ MALLOC, "MALLOC" },
{ TEMP, "TEMP" },
{ PERM, "PERM" },
{ STRING, "STRING" },
- { STR, "STR" },
- { NUM, "NUM" },
+ { STRCUR, "STRCUR" },
+ { NUMCUR, "NUMCUR" },
{ NUMBER, "NUMBER" },
{ MAYBE_NUM, "MAYBE_NUM" },
{ ARRAYMAXED, "ARRAYMAXED" },
@@ -288,8 +291,8 @@ flags2str(int flagval)
/* genflags2str --- general routine to convert a flag value to a string */
-char *
-genflags2str(int flagval, struct flagtab *tab)
+const char *
+genflags2str(int flagval, const struct flagtab *tab)
{
static char buffer[BUFSIZ];
char *sp;
@@ -369,8 +372,16 @@ interpret(register NODE *volatile tree)
}
break;
case TAG_CONTINUE: /* NEXT statement */
+ if (forloops_active())
+ pop_all_forloops();
+ if (in_function())
+ pop_fcall_stack();
return 1;
- case TAG_BREAK:
+ case TAG_BREAK: /* EXIT statement */
+ if (forloops_active())
+ pop_all_forloops();
+ if (in_function())
+ pop_fcall_stack();
return 0;
default:
cant_happen();
@@ -466,8 +477,8 @@ interpret(register NODE *volatile tree)
Func_ptr after_assign = NULL;
NODE **list = 0;
NODE *volatile array;
- volatile size_t i;
- size_t j, num_elems;
+ volatile size_t i, num_elems;
+ size_t j;
volatile int retval = 0;
int sort_indices = whiny_users;
@@ -500,7 +511,8 @@ interpret(register NODE *volatile tree)
continue;
for (; t != NULL; t = t->ahnext) {
- list[j++] = dupnode(t->ahname);
+ list[j++] = dupnode(t);
+ assert(list[j-1] == t);
}
}
@@ -509,6 +521,7 @@ interpret(register NODE *volatile tree)
qsort(list, num_elems, sizeof(NODE *), comp_func); /* shazzam! */
/* now we can run the loop */
+ push_forloop(array->vname, list, num_elems);
PUSH_BINDING(loop_tag_stack, loop_tag, loop_tag_valid);
lhs = get_lhs(tree->hakvar, &after_assign, FALSE);
@@ -516,7 +529,7 @@ interpret(register NODE *volatile tree)
for (i = 0; i < num_elems; i++) {
INCREMENT(stable_tree->exec_count);
unref(*((NODE **) lhs));
- *lhs = dupnode(list[i]);
+ *lhs = make_string(list[i]->ahname_str, list[i]->ahname_len);
if (after_assign)
(*after_assign)();
switch (setjmp(loop_tag)) {
@@ -536,20 +549,18 @@ interpret(register NODE *volatile tree)
done:
RESTORE_BINDING(loop_tag_stack, loop_tag, loop_tag_valid);
+ pop_forloop();
if (do_lint && num_elems != array->table_size)
- lintwarn(_("for loop: array `%s' changed size from %d to %d during loop execution"),
- array->vname, num_elems, array->table_size);
+ lintwarn(_("for loop: array `%s' changed size from %ld to %ld during loop execution"),
+ array->vname, (long) num_elems, (long) array->table_size);
- for (i = 0; i < num_elems; i++)
- unref(list[i]);
-
- free(list);
-
if (retval == 1)
return 1;
break;
}
+#undef hakvar
+#undef arrvar
case Node_K_break:
INCREMENT(tree->exec_count);
@@ -567,8 +578,6 @@ interpret(register NODE *volatile tree)
}
if (! do_traditional || do_posix)
fatal(_("`break' outside a loop is not allowed"));
- if (in_function())
- pop_fcall_stack();
longjmp(rule_tag, TAG_CONTINUE);
} else
longjmp(loop_tag, TAG_BREAK);
@@ -590,8 +599,6 @@ interpret(register NODE *volatile tree)
}
if (! do_traditional || do_posix)
fatal(_("`continue' outside a loop is not allowed"));
- if (in_function())
- pop_fcall_stack();
longjmp(rule_tag, TAG_CONTINUE);
} else
longjmp(loop_tag, TAG_CONTINUE);
@@ -602,6 +609,11 @@ interpret(register NODE *volatile tree)
do_print(tree);
break;
+ case Node_K_print_rec:
+ INCREMENT(tree->exec_count);
+ do_print_rec(tree);
+ break;
+
case Node_K_printf:
INCREMENT(tree->exec_count);
do_printf(tree);
@@ -613,6 +625,7 @@ interpret(register NODE *volatile tree)
break;
case Node_K_delete_loop:
+ INCREMENT(tree->exec_count);
do_delete_loop(tree->lnode, tree->rnode);
break;
@@ -623,10 +636,7 @@ interpret(register NODE *volatile tree)
else if (in_end_rule)
fatal(_("`next' cannot be called from an END rule"));
- /* could add a lint check here */
- if (in_function())
- pop_fcall_stack();
-
+ /* could add a lint check here for in a loop or function */
longjmp(rule_tag, TAG_CONTINUE);
break;
@@ -637,7 +647,14 @@ interpret(register NODE *volatile tree)
else if (in_end_rule)
fatal(_("`nextfile' cannot be called from an END rule"));
- /* could add a lint check here */
+ /* could add a lint check here for in a loop or function */
+ /*
+ * Have to do this cleanup here, since we don't longjump
+ * back to the main awk rule loop (rule_tag).
+ */
+ if (forloops_active())
+ pop_all_forloops();
+
if (in_function())
pop_fcall_stack();
@@ -679,7 +696,8 @@ interpret(register NODE *volatile tree)
lintwarn(_("statement has no effect"));
INCREMENT(tree->exec_count);
t = tree_eval(tree);
- free_temp(t);
+ if (t) /* stopme() returns NULL */
+ free_temp(t);
break;
}
return 1;
@@ -757,16 +775,16 @@ r_tree_eval(register NODE *tree, int iscond)
/* Builtins */
case Node_builtin:
- return (*tree->proc)(tree->subnode);
+ return (*tree->builtin)(tree->subnode);
case Node_K_getline:
return (do_getline(tree));
case Node_in_array:
- return tmp_number((AWKNUM) in_array(tree->lnode, tree->rnode));
+ return tmp_number((AWKNUM) (in_array(tree->lnode, tree->rnode) != NULL));
case Node_func_call:
- return func_call(tree->rnode, tree->lnode);
+ return func_call(tree);
/* unary operations */
case Node_NR:
@@ -809,28 +827,6 @@ r_tree_eval(register NODE *tree, int iscond)
case Node_dynregex:
return match_op(tree);
- case Node_func:
- fatal(_("function `%s' called with space between name and `(',\n%s"),
- tree->lnode->param,
- _("or used in other expression context"));
-
- /* assignments */
- case Node_assign:
- {
- Func_ptr after_assign = NULL;
-
- if (do_lint && iscond)
- lintwarn(_("assignment used in conditional context"));
- r = tree_eval(tree->rnode);
- lhs = get_lhs(tree->lnode, &after_assign, FALSE);
- assign_val(lhs, r);
- free_temp(r);
- tree->lnode->flags |= SCALAR;
- if (after_assign)
- (*after_assign)();
- return *lhs;
- }
-
case Node_concat:
{
NODE **treelist;
@@ -930,6 +926,23 @@ r_tree_eval(register NODE *tree, int iscond)
}
return r;
+ /* assignments */
+ case Node_assign:
+ {
+ Func_ptr after_assign = NULL;
+
+ if (do_lint && iscond)
+ lintwarn(_("assignment used in conditional context"));
+ r = tree_eval(tree->rnode);
+ lhs = get_lhs(tree->lnode, &after_assign, FALSE);
+
+ assign_val(lhs, r);
+ tree->lnode->flags |= SCALAR;
+ if (after_assign)
+ (*after_assign)();
+ return *lhs;
+ }
+
/* other assignment types are easier because they are numeric */
case Node_preincrement:
case Node_predecrement:
@@ -1039,10 +1052,6 @@ r_tree_eval(register NODE *tree, int iscond)
case Node_minus:
return tmp_number(x1 - x2);
- case Node_var_array:
- fatal(_("attempt to use array `%s' in a scalar context"),
- tree->vname);
-
default:
fatal(_("illegal type (%s) in tree_eval"), nodetype2str(tree->type));
}
@@ -1135,14 +1144,15 @@ cmp_nodes(register NODE *t1, register NODE *t2)
return ldiff;
l = (ldiff <= 0 ? len1 : len2);
if (IGNORECASE) {
- register unsigned char *cp1 = (unsigned char *) t1->stptr;
- register unsigned char *cp2 = (unsigned char *) t2->stptr;
+ const unsigned char *cp1 = (const unsigned char *) t1->stptr;
+ const unsigned char *cp2 = (const unsigned char *) t2->stptr;
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1) {
+ if (gawk_mb_cur_max > 1) {
mbstate_t mbs;
memset(&mbs, 0, sizeof(mbstate_t));
- ret = strncasecmpmbs(cp1, mbs, cp2, mbs, l);
+ ret = strncasecmpmbs((const char *) cp1, mbs,
+ (const char *) cp2, mbs, l);
} else
#endif
for (ret = 0; l-- > 0 && ret == 0; cp1++, cp2++)
@@ -1163,54 +1173,40 @@ op_assign(register NODE *tree)
long ltemp;
NODE *tmp;
Func_ptr after_assign = NULL;
+ int post = FALSE;
/*
- * For ++ and --, get the lhs when doing the op and then
- * return. For += etc, do the rhs first, since it can
- * rearrange things, and *then* get the lhs.
+ * For += etc, do the rhs first, since it can rearrange things,
+ * and *then* get the lhs.
*/
+ if (tree->rnode != NULL) {
+ tmp = tree_eval(tree->rnode);
+ rval = force_number(tmp);
+ free_temp(tmp);
+ } else
+ rval = (AWKNUM) 1.0;
+
+ lhs = get_lhs(tree->lnode, &after_assign, TRUE);
+ lval = force_number(*lhs);
+ unref(*lhs);
switch(tree->type) {
+ case Node_postincrement:
+ post = TRUE;
+ /* fall through */
case Node_preincrement:
- case Node_predecrement:
- lhs = get_lhs(tree->lnode, &after_assign, TRUE);
- lval = force_number(*lhs);
- unref(*lhs);
- *lhs = make_number(lval +
- (tree->type == Node_preincrement ? 1.0 : -1.0));
- tree->lnode->flags |= SCALAR;
- if (after_assign)
- (*after_assign)();
- return *lhs;
+ case Node_assign_plus:
+ *lhs = make_number(lval + rval);
+ break;
- case Node_postincrement:
case Node_postdecrement:
- lhs = get_lhs(tree->lnode, &after_assign, TRUE);
- lval = force_number(*lhs);
- unref(*lhs);
- *lhs = make_number(lval +
- (tree->type == Node_postincrement ? 1.0 : -1.0));
- tree->lnode->flags |= SCALAR;
- if (after_assign)
- (*after_assign)();
- return tmp_number(lval);
- default:
- break; /* handled below */
- }
-
- /*
- * It's a += kind of thing. Do the rhs, then the lhs.
- */
-
- tmp = tree_eval(tree->rnode);
- rval = force_number(tmp);
- free_temp(tmp);
-
- lhs = get_lhs(tree->lnode, &after_assign, FALSE);
- lval = force_number(*lhs);
+ post = TRUE;
+ /* fall through */
+ case Node_predecrement:
+ case Node_assign_minus:
+ *lhs = make_number(lval - rval);
+ break;
- unref(*lhs);
- switch(tree->type) {
case Node_assign_exp:
if ((ltemp = rval) == rval) { /* integer exponent */
if (ltemp == 0)
@@ -1261,28 +1257,118 @@ op_assign(register NODE *tree)
#endif /* ! HAVE_FMOD */
break;
- case Node_assign_plus:
- *lhs = make_number(lval + rval);
- break;
-
- case Node_assign_minus:
- *lhs = make_number(lval - rval);
- break;
default:
cant_happen();
}
+
tree->lnode->flags |= SCALAR;
if (after_assign)
(*after_assign)();
- return *lhs;
+
+ /* for postincrement or postdecrement, return the old value */
+ return (post ? tmp_number(lval) : *lhs);
+}
+
+/*
+ * Avoiding memory leaks is difficult. In paticular, any of `next',
+ * `nextfile', `break' or `continue' (when not in a loop), can longjmp
+ * out to the outermost level. This leaks memory if it happens in a
+ * called function. It also leaks memory if it happens in a
+ * `for (iggy in foo)' loop, since such loops malloc an array of the
+ * current array indices to loop over, which provides stability.
+ *
+ * The following code takes care of these problems. First comes the
+ * array-loop management code. This can be a stack of arrays being looped
+ * on at any one time. This stack serves for both mainline code and
+ * function body code. As each loop starts and finishes, it pushes its
+ * info onto this stack and off of it; whether the loop is in a function
+ * body or not isn't relevant.
+ *
+ * Since the list of indices is created using dupnode(), when popping
+ * this stack it should be safe to unref() things, and then memory
+ * will get finally released when the function call stack is popped.
+ * This means that the loop_stack should be popped first upon a `next'.
+ */
+
+static struct loop_info {
+ const char *varname; /* variable name, for debugging */
+ NODE **elems; /* list of indices */
+ size_t nelems; /* how many there are */
+} *loop_stack = NULL;
+size_t nloops = 0; /* how many slots there are in the stack */
+size_t nloops_active = 0; /* how many loops are actively stacked */
+
+
+/* forloops_active --- return true if there are loops that need popping */
+
+static int
+forloops_active()
+{
+ return nloops > 0;
+}
+
+/* pop_forloop --- pop one for loop off the stack */
+
+static void
+pop_forloop()
+{
+ int i, curloop;
+ struct loop_info *loop;
+
+ assert(nloops_active > 0);
+
+ curloop = --nloops_active; /* 0-based indexing */
+ loop = & loop_stack[curloop];
+
+ for (i = 0; i < loop->nelems; i++)
+ unref(loop->elems[i]);
+
+ free(loop->elems);
+
+ loop->elems = NULL;
+ loop->varname = NULL;
+ loop->nelems = 0;
+}
+
+/* pop_forloops --- pop the for loops stack all the way */
+
+static void
+pop_all_forloops()
+{
+ while (nloops_active > 0)
+ pop_forloop(); /* decrements nloops_active for us */
+}
+
+/* push_forloop --- add a single for loop to the stack */
+
+static void
+push_forloop(const char *varname, NODE **elems, size_t nelems)
+{
+#define NLOOPS 4 /* seems like a good guess */
+ if (loop_stack == NULL) {
+ /* allocate stack, set vars */
+ nloops = NLOOPS;
+ emalloc(loop_stack, struct loop_info *, nloops * sizeof(struct loop_info),
+ "push_forloop");
+ } else if (nloops_active == nloops) {
+ /* grow stack, set vars */
+ nloops *= 2;
+ erealloc(loop_stack, struct loop_info *, nloops * sizeof(struct loop_info),
+ "push_forloop");
+ }
+
+ loop_stack[nloops_active].varname = varname;
+ loop_stack[nloops_active].elems = elems;
+ loop_stack[nloops_active].nelems = nelems;
+ nloops_active++;
}
static struct fcall {
- char *fname;
- unsigned long count;
- NODE *arglist;
- NODE **prevstack;
- NODE **stack;
+ const char *fname; /* function name */
+ unsigned long count; /* how many args */
+ NODE *arglist; /* list thereof */
+ NODE **prevstack; /* function stack frame of previous function */
+ NODE **stack; /* function stack frame of current function */
} *fcall_list = NULL;
static long fcall_list_size = 0;
@@ -1386,7 +1472,7 @@ static void
push_args(int count,
NODE *arglist,
NODE **oldstack,
- char *func_name,
+ const char *func_name,
char **varnames)
{
struct fcall *f;
@@ -1421,7 +1507,7 @@ push_args(int count,
/* for each calling arg. add NODE * on stack */
for (argp = arglist, i = 0; count > 0 && argp != NULL; argp = argp->rnode) {
- static char from[] = N_("%s (from %s)");
+ static const char from[] = N_("%s (from %s)");
arg = argp->lnode;
getnode(r);
r->type = Node_var;
@@ -1467,10 +1553,34 @@ push_args(int count,
i++;
count--;
}
- if (argp != NULL) /* left over calling args. */
+
+ /*
+ * We have to reassign f. Why, you may ask? It is possible that
+ * other functions were called during the course of tree_eval()-ing
+ * the arguments to this function. As a result of that, fcall_list
+ * may have been realloc()'ed, with the result that f is now
+ * pointing into free()'d space. This was a nasty one to track down.
+ */
+ f = & fcall_list[curfcall];
+
+ if (argp != NULL) {
+ /* Left over calling args. */
warning(
_("function `%s' called with more arguments than declared"),
func_name);
+ /* Evaluate them, they may have side effects: */
+ do {
+ arg = argp->lnode;
+ if (arg->type == Node_param_list)
+ arg = f->prevstack[arg->param_cnt];
+ if (arg->type != Node_var_array &&
+ arg->type != Node_array_ref)
+ free_temp(tree_eval(arg));
+
+ /* reassign f, tree_eval could have moved it */
+ f = & fcall_list[curfcall];
+ } while ((argp = argp->rnode) != NULL);
+ }
/* add remaining params. on stack with null value */
while (count-- > 0) {
@@ -1485,15 +1595,6 @@ push_args(int count,
*sp++ = r;
}
- /*
- * We have to reassign f. Why, you may ask? It is possible that
- * other functions were called during the course of tree_eval()-ing
- * the arguments to this function. As a result of that, fcall_list
- * may have been realloc()'ed, with the result that f is now
- * pointing into free()'d space. This was a nasty one to track down.
- */
- f = & fcall_list[curfcall];
-
stack_ptr = f->stack;
}
@@ -1502,10 +1603,10 @@ push_args(int count,
NODE **stack_ptr;
static NODE *
-func_call(NODE *name, /* name is a Node_val giving function name */
- NODE *arg_list) /* Node_expression_list of calling args. */
+func_call(NODE *tree)
{
register NODE *r;
+ NODE *name, *arg_list;
NODE *f;
jmp_buf volatile func_tag_stack;
jmp_buf volatile loop_tag_stack;
@@ -1513,10 +1614,22 @@ func_call(NODE *name, /* name is a Node_val giving function name */
NODE *save_ret_node;
extern NODE *ret_node;
+ /* tree->rnode is a Node_val giving function name */
+ /* tree->lnode is Node_expression_list of calling args. */
+ name = tree->rnode;
+ arg_list = tree->lnode;
+
/* retrieve function definition node */
- f = lookup(name->stptr);
- if (f == NULL || f->type != Node_func)
- fatal(_("function `%s' not defined"), name->stptr);
+ if (tree->funcbody != NULL)
+ f = tree->funcbody;
+ else {
+ f = lookup(name->stptr);
+ if (f == NULL || f->type != Node_func)
+ fatal(_("function `%s' not defined"), name->stptr);
+
+ tree->funcbody = f; /* save for next call */
+ }
+
#ifdef FUNC_TRACE
fprintf(stderr, _("function %s called\n"), name->stptr);
#endif
@@ -1616,12 +1729,12 @@ r_get_lhs(register NODE *ptr, Func_ptr *assign, int reference)
ptr->vname);
case Node_var:
- if (! reference)
- ptr->flags &= ~UNINITIALIZED;
- else if (do_lint && (ptr->flags & UNINITIALIZED) != 0)
+ if (do_lint && reference && (ptr->flags & UNINITIALIZED) != 0)
lintwarn(_("reference to uninitialized variable `%s'"),
ptr->vname);
+ /* clear the flag, since it's about to be assigned to */
+ ptr->flags &= ~UNINITIALIZED;
aptr = &(ptr->var_value);
#ifdef GAWKDEBUG
if (ptr->var_value->stref <= 0)
@@ -1727,28 +1840,6 @@ r_get_lhs(register NODE *ptr, Func_ptr *assign, int reference)
*assign = set_TEXTDOMAIN;
break;
- case Node_param_list:
- {
- NODE *n = stack_ptr[ptr->param_cnt];
-
- /*
- * This test should always be true, due to the code
- * above, before the switch, that handles parameters.
- */
- if (n->type != Node_var_array)
- aptr = &n->var_value;
- else
- fatal(_("attempt to use array `%s' in a scalar context"),
- n->vname);
-
- if (! reference)
- n->flags &= ~UNINITIALIZED;
- else if (do_lint && (n->flags & UNINITIALIZED) != 0)
- lintwarn(_("reference to uninitialized argument `%s'"),
- n->vname);
- }
- break;
-
case Node_field_spec:
{
int field_num;
@@ -1786,17 +1877,9 @@ r_get_lhs(register NODE *ptr, Func_ptr *assign, int reference)
n = n->orig_array;
assert(n->type == Node_var_array || n->type == Node_var);
}
- if (n->type == Node_func) {
- fatal(_("attempt to use function `%s' as array"),
- n->lnode->param);
- }
aptr = assoc_lookup(n, concat_exp(ptr->rnode), reference);
break;
- case Node_func:
- fatal(_("`%s' is a function, assignment is not allowed"),
- ptr->lnode->param);
-
case Node_builtin:
#if 1
/* in gawk for a while */
@@ -1806,9 +1889,9 @@ r_get_lhs(register NODE *ptr, Func_ptr *assign, int reference)
* This is how Christos at Deshaw did it.
* Does this buy us anything?
*/
- if (ptr->proc == NULL)
+ if (ptr->builtin == NULL)
fatal(_("assignment is not allowed to result of builtin function"));
- ptr->callresult = (*ptr->proc)(ptr->subnode);
+ ptr->callresult = (*ptr->builtin)(ptr->subnode);
aptr = &ptr->callresult;
break;
#endif
@@ -1830,7 +1913,6 @@ match_op(register NODE *tree)
register Regexp *rp;
int i;
int match = TRUE;
- int kludge_need_start = FALSE; /* FIXME: --- see below */
if (tree->type == Node_nomatch)
match = FALSE;
@@ -1841,22 +1923,7 @@ match_op(register NODE *tree)
tree = tree->rnode;
}
rp = re_update(tree);
- /*
- * FIXME:
- *
- * Any place where research() is called with a last parameter of
- * FALSE, we need to use the avoid_dfa test. This is the only place
- * at the moment.
- *
- * A new or improved dfa that distinguishes beginning/end of
- * string from beginning/end of line will allow us to get rid of
- * this temporary hack.
- *
- * The avoid_dfa() function is in re.c; it is not very smart.
- */
- if (avoid_dfa(tree, t1->stptr, t1->stlen))
- kludge_need_start = TRUE;
- i = research(rp, t1->stptr, 0, t1->stlen, kludge_need_start);
+ i = research(rp, t1->stptr, 0, t1->stlen, FALSE);
i = (i == -1) ^ (match == TRUE);
free_temp(t1);
return tmp_number((AWKNUM) i);
@@ -1875,16 +1942,17 @@ set_IGNORECASE()
}
if (do_traditional)
IGNORECASE = FALSE;
- else if ((IGNORECASE_node->var_value->flags & (STRING|STR)) != 0) {
+ else if ((IGNORECASE_node->var_value->flags & (STRING|STRCUR)) != 0) {
if ((IGNORECASE_node->var_value->flags & MAYBE_NUM) == 0)
IGNORECASE = (force_string(IGNORECASE_node->var_value)->stlen > 0);
else
IGNORECASE = (force_number(IGNORECASE_node->var_value) != 0.0);
- } else if ((IGNORECASE_node->var_value->flags & (NUM|NUMBER)) != 0)
+ } else if ((IGNORECASE_node->var_value->flags & (NUMCUR|NUMBER)) != 0)
IGNORECASE = (force_number(IGNORECASE_node->var_value) != 0.0);
else
IGNORECASE = FALSE; /* shouldn't happen */
- set_FS_if_not_FIELDWIDTHS();
+
+ set_RS(); /* set_RS() calls set_FS() if need be, for us */
}
/* set_BINMODE --- set translation mode (OS/2, DOS, others) */
@@ -1970,7 +2038,7 @@ static int
fmt_ok(NODE *n)
{
NODE *tmp = force_string(n);
- char *p = tmp->stptr;
+ const char *p = tmp->stptr;
if (*p++ != '%')
return 0;
@@ -2047,27 +2115,39 @@ set_CONVFMT()
void
set_LINT()
{
+#ifndef NO_LINT
int old_lint = do_lint;
- if ((LINT_node->var_value->flags & (STRING|STR)) != 0) {
+ if ((LINT_node->var_value->flags & (STRING|STRCUR)) != 0) {
if ((LINT_node->var_value->flags & MAYBE_NUM) == 0) {
- char *lintval;
+ const char *lintval;
size_t lintlen;
do_lint = (force_string(LINT_node->var_value)->stlen > 0);
lintval = LINT_node->var_value->stptr;
lintlen = LINT_node->var_value->stlen;
if (do_lint) {
+ do_lint = LINT_ALL;
if (lintlen == 5 && strncmp(lintval, "fatal", 5) == 0)
lintfunc = r_fatal;
+ else if (lintlen == 7 && strncmp(lintval, "invalid", 7) == 0)
+ do_lint = LINT_INVALID;
else
lintfunc = warning;
} else
lintfunc = warning;
- } else
- do_lint = (force_number(LINT_node->var_value) != 0.0);
- } else if ((LINT_node->var_value->flags & (NUM|NUMBER)) != 0) {
- do_lint = (force_number(LINT_node->var_value) != 0.0);
+ } else {
+ if (force_number(LINT_node->var_value) != 0.0)
+ do_lint = LINT_ALL;
+ else
+ do_lint = FALSE;
+ lintfunc = warning;
+ }
+ } else if ((LINT_node->var_value->flags & (NUMCUR|NUMBER)) != 0) {
+ if (force_number(LINT_node->var_value) != 0.0)
+ do_lint = LINT_ALL;
+ else
+ do_lint = FALSE;
lintfunc = warning;
} else
do_lint = FALSE; /* shouldn't happen */
@@ -2076,8 +2156,9 @@ set_LINT()
lintfunc = warning;
/* explicitly use warning() here, in case lintfunc == r_fatal */
- if (old_lint != do_lint && old_lint)
+ if (old_lint != do_lint && old_lint && do_lint == FALSE)
warning(_("turning off `--lint' due to assignment to `LINT'"));
+#endif /* ! NO_LINT */
}
/* set_TEXTDOMAIN --- update TEXTDOMAIN variable when TEXTDOMAIN assigned to */
@@ -2104,16 +2185,13 @@ set_TEXTDOMAIN()
NODE *
assign_val(NODE **lhs_p, NODE *rhs)
{
- NODE *save;
-
if (rhs != *lhs_p) {
- save = *lhs_p;
+ /*
+ * Since we know that the nodes are different,
+ * we can do the unref() before the dupnode().
+ */
+ unref(*lhs_p);
*lhs_p = dupnode(rhs);
- unref(save);
-
- /* this check really doesn't belong here, but I don't have a better place */
- if (lhs_p == & NF_node->var_value && NF_node->var_value->numbr < 0)
- fatal(_("NF set to negative value"));
}
return *lhs_p;
}
@@ -2137,11 +2215,11 @@ static int
comp_func(const void *p1, const void *p2)
{
size_t len1, len2;
- char *str1, *str2;
- NODE *t1, *t2;
+ const char *str1, *str2;
+ const NODE *t1, *t2;
- t1 = *((NODE **) p1);
- t2 = *((NODE **) p2);
+ t1 = *((const NODE *const *) p1);
+ t2 = *((const NODE *const *) p2);
/*
t1 = force_string(t1);
@@ -2155,7 +2233,7 @@ comp_func(const void *p1, const void *p2)
/* Array indexes are strings, compare as such, always! */
if (len1 == len2 || len1 < len2)
- return strncmp(str1, str2, len1);
+ return memcmp(str1, str2, len1);
else
- return strncmp(str1, str2, len2);
+ return memcmp(str1, str2, len2);
}
diff --git a/ext.c b/ext.c
index 1ed7e2d4..ca3d592a 100644
--- a/ext.c
+++ b/ext.c
@@ -7,7 +7,7 @@
*/
/*
- * Copyright (C) 1995 - 2001 the Free Software Foundation, Inc.
+ * Copyright (C) 1995 - 2001, 2003 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -114,6 +114,7 @@ make_builtin(char *name, NODE *(*func) P((NODE *)), int count)
getnode(p);
p->type = Node_param_list;
+ p->flags |= FUNC;
p->rnode = NULL;
p->param = name;
p->param_cnt = count;
@@ -125,7 +126,7 @@ make_builtin(char *name, NODE *(*func) P((NODE *)), int count)
getnode(b);
b->type = Node_builtin;
- b->proc = func;
+ b->builtin = func;
b->subnode = p;
b->source_line = __LINE__;
b->source_file = __FILE__;
@@ -177,10 +178,10 @@ set_value(NODE *tree)
NODE *
do_ext(NODE *tree)
{
- char *emsg = _("Operation Not Supported");
+ const char *emsg = _("Operation Not Supported");
unref(ERRNO_node->var_value);
- ERRNO_node->var_value = make_string(emsg, strlen(emsg));
+ ERRNO_node->var_value = make_string((char *) emsg, strlen(emsg));
return tmp_number((AWKNUM) -1);
}
#endif
diff --git a/extension/fork.c b/extension/fork.c
index 038a1689..6f020318 100644
--- a/extension/fork.c
+++ b/extension/fork.c
@@ -24,7 +24,6 @@
*/
#include "awk.h"
-#include <sys/wait.h>
/* do_fork --- provide dynamically loaded fork() builtin for gawk */
diff --git a/field.c b/field.c
index a95ec53b..999f21ac 100644
--- a/field.c
+++ b/field.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2002 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.
@@ -60,6 +60,8 @@ 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;
@@ -84,7 +86,7 @@ init_fields()
getnode(Null_field);
*Null_field = *Nnull_string;
Null_field->flags |= (SCALAR|FIELD);
- Null_field->flags &= ~(NUM|NUMBER|MAYBE_NUM|PERM);
+ Null_field->flags &= ~(NUMCUR|NUMBER|MAYBE_NUM|PERM);
field0_valid = TRUE;
}
@@ -112,7 +114,7 @@ static void
set_field(long num,
char *str,
long len,
- NODE *dummy) /* not used -- just to make interface same as set_element */
+ NODE *dummy ATTRIBUTE_UNUSED) /* just to make interface same as set_element */
{
register NODE *n;
@@ -121,7 +123,7 @@ set_field(long num,
n = fields_arr[num];
n->stptr = str;
n->stlen = len;
- n->flags = (STR|STRING|MAYBE_NUM|SCALAR|FIELD);
+ n->flags = (STRCUR|STRING|MAYBE_NUM|SCALAR|FIELD);
}
/* rebuild_record --- Someone assigned a value to $(something).
@@ -193,8 +195,8 @@ rebuild_record()
if ((fields_arr[i]->flags & FIELD) == 0) {
*n = *Null_field;
n->stlen = fields_arr[i]->stlen;
- if ((fields_arr[i]->flags & (NUM|NUMBER)) != 0) {
- n->flags |= (fields_arr[i]->flags & (NUM|NUMBER));
+ if ((fields_arr[i]->flags & (NUMCUR|NUMBER)) != 0) {
+ n->flags |= (fields_arr[i]->flags & (NUMCUR|NUMBER));
n->numbr = fields_arr[i]->numbr;
}
} else {
@@ -226,17 +228,62 @@ rebuild_record()
* but better correct than fast.
*/
void
-set_record(char *buf, /* ignored if ! freeold */
- int cnt, /* ignored if ! freeold */
- int freeold)
+set_record(const char *buf, int cnt)
{
- register int i;
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|SCALAR|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]);
@@ -247,61 +294,15 @@ set_record(char *buf, /* ignored if ! 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) {
- /* 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|STR|MAYBE_NUM|SCALAR|FIELD);
- fields_arr[0] = n;
- }
- fields_arr[0]->flags |= MAYBE_NUM;
field0_valid = TRUE;
-
-#undef INITIAL_SIZE
-#undef MAX_SIZE
-}
-
-/* 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);
}
/* set_NF --- handle what happens to $0 and fields when NF is changed */
@@ -316,6 +317,9 @@ set_NF()
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) {
@@ -348,7 +352,7 @@ static long
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,
+ NODE *fs ATTRIBUTE_UNUSED,
Regexp *rp,
Setfunc set, /* routine to set the value of the parsed field */
NODE *n)
@@ -360,7 +364,7 @@ re_parse_field(long up_to, /* parse only up to this field number */
#ifdef MBS_SUPPORT
size_t mbclen = 0;
mbstate_t mbs;
- if (MB_CUR_MAX > 1)
+ if (gawk_mb_cur_max > 1)
memset(&mbs, 0, sizeof(mbstate_t));
#endif
@@ -378,7 +382,7 @@ re_parse_field(long up_to, /* parse only up to this field number */
&& nf < up_to) {
if (REEND(rp, scan) == RESTART(rp, scan)) { /* null match */
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1) {
+ 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)) {
@@ -424,7 +428,7 @@ 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,
+ Regexp *rp ATTRIBUTE_UNUSED,
Setfunc set, /* routine to set the value of the parsed field */
NODE *n)
{
@@ -491,7 +495,7 @@ 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,
+ Regexp *rp ATTRIBUTE_UNUSED,
Setfunc set, /* routine to set the value of the parsed field */
NODE *n)
{
@@ -554,8 +558,8 @@ static long
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,
- Regexp *rp,
+ NODE *fs ATTRIBUTE_UNUSED,
+ Regexp *rp ATTRIBUTE_UNUSED,
Setfunc set, /* routine to set the value of the parsed field */
NODE *n)
{
@@ -569,7 +573,7 @@ null_parse_field(long up_to, /* parse only up to this field number */
return nf;
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1) {
+ if (gawk_mb_cur_max > 1) {
mbstate_t mbs;
memset(&mbs, 0, sizeof(mbstate_t));
for (; nf < up_to && scan < end;) {
@@ -603,7 +607,7 @@ 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,
+ Regexp *rp ATTRIBUTE_UNUSED,
Setfunc set, /* routine to set the value of the parsed field */
NODE *n)
{
@@ -612,12 +616,11 @@ sc_parse_field(long up_to, /* parse only up to this field number */
register long nf = parse_high_water;
register char *field;
register char *end = scan + len;
- int onecase;
char sav;
#ifdef MBS_SUPPORT
size_t mbclen = 0;
mbstate_t mbs;
- if (MB_CUR_MAX > 1)
+ if (gawk_mb_cur_max > 1)
memset(&mbs, 0, sizeof(mbstate_t));
#endif
@@ -631,10 +634,6 @@ sc_parse_field(long up_to, /* parse only up to this field number */
else
fschar = fs->stptr[0];
- onecase = (IGNORECASE && ISALPHA(fschar));
- if (onecase)
- fschar = casetable[(unsigned char) fschar];
-
/* before doing anything save the char at *end */
sav = *end;
/* because it will be destroyed now: */
@@ -642,35 +641,21 @@ sc_parse_field(long up_to, /* parse only up to this field number */
for (; nf < up_to;) {
field = scan;
- if (onecase) {
- while (casetable[(unsigned char) *scan] != fschar)
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1) {
- mbclen = mbrlen(scan, end-scan, &mbs);
- if ((mbclen == 1) || (mbclen == (size_t) -1)
- || (mbclen == (size_t) -2) || (mbclen == 0)) {
- /* We treat it as a singlebyte character. */
- mbclen = 1;
- }
- scan += mbclen;
- } else
-#endif
- scan++;
- } else {
- while (*scan != fschar)
-#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1) {
- mbclen = mbrlen(scan, end-scan, &mbs);
- if ((mbclen == 1) || (mbclen == (size_t) -1)
- || (mbclen == (size_t) -2) || (mbclen == 0)) {
- /* We treat it as a singlebyte character. */
- mbclen = 1;
- }
- scan += mbclen;
- } else
+ 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
- scan++;
- }
+ while (*scan != fschar)
+ scan++;
(*set)(++nf, field, (long)(scan - field), n);
if (scan == end)
break;
@@ -691,15 +676,15 @@ sc_parse_field(long up_to, /* parse only up to this field number */
/*
* 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(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,
+ NODE *fs ATTRIBUTE_UNUSED,
+ Regexp *rp ATTRIBUTE_UNUSED,
Setfunc set, /* routine to set the value of the parsed field */
NODE *n)
{
@@ -816,30 +801,15 @@ set_element(long num, char *s, long len, NODE *n)
NODE *
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;
-
- (void) force_string(src);
if (arr->type == Node_param_list)
arr = stack_ptr[arr->param_cnt];
@@ -848,25 +818,33 @@ do_split(NODE *tree)
if (arr->type != Node_var && arr->type != Node_var_array)
fatal(_("split: second argument is not an array"));
arr->type = Node_var_array;
- assoc_clear(arr);
+
+ sep = tree->rnode->rnode->lnode; /* 3rd arg */
if (src->stlen == 0) {
/*
* Skip the work if first arg is the null string.
- * Check after clearing the array, to preserve
- * correct semantics.
*/
- tmp = tmp_number((AWKNUM) 0);
- goto out;
+ 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 you can safely turn off the array.
+ */
+ assoc_clear(arr);
+ return tmp_number((AWKNUM) 0);
}
- if ((sep->re_flags & FS_DFLT) != 0 && ! using_FIELDWIDTHS()) {
+ 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;
@@ -875,8 +853,8 @@ do_split(NODE *tree)
warned = TRUE;
lintwarn(_("split: null string for third arg is a gawk extension"));
}
- } else if (tmp->stlen == 1 && (sep->re_flags & CONST) == 0) {
- if (tmp->stptr[0] == ' ') {
+ } else if (fs->stlen == 1 && (sep->re_flags & CONST) == 0) {
+ if (fs->stptr[0] == ' ') {
if (do_posix)
parseit = posix_def_parse_field;
else
@@ -887,15 +865,27 @@ do_split(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));
-out:
- 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;
}
@@ -907,7 +897,7 @@ 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();
@@ -948,13 +938,6 @@ set_FIELDWIDTHS()
update_PROCINFO("FS", "FIELDWIDTHS");
}
-void
-set_FS_if_not_FIELDWIDTHS()
-{
- if (parse_field != fw_parse_field)
- set_FS();
-}
-
/* set_FS --- handle things when FS is assigned to */
void
@@ -964,6 +947,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
@@ -972,21 +956,46 @@ 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)) {
- unref(save_fs);
- save_fs = dupnode(FS_node->var_value);
- unref(save_rs);
- save_rs = dupnode(RS_node->var_value);
- resave_fs = TRUE;
- if (FS_regexp) {
- refree(FS_regexp);
- FS_regexp = NULL;
+ /* 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;
+ 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) {
static short warned = FALSE;
@@ -996,14 +1005,18 @@ set_FS()
warned = TRUE;
lintwarn(_("null string for `FS' is a gawk extension"));
}
- } else if (fs->stlen > 1)
+ } 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]);
}
@@ -1012,25 +1025,44 @@ 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 (! ISALPHA(fs->stptr[0]) || ! 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");
}
diff --git a/fixvers b/fixvers
index 0faab9bb..ff1c2c4e 100755
--- a/fixvers
+++ b/fixvers
@@ -22,7 +22,7 @@
# 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.in`
+line=`grep '^AM_INIT_AUTOMAKE' configure.in`
case $1 in
-v)
diff --git a/gawkmisc.c b/gawkmisc.c
index 18a6807c..24a7d875 100644
--- a/gawkmisc.c
+++ b/gawkmisc.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2002 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.
diff --git a/gettext.h b/gettext.h
index 1ad714f4..f7f28f71 100644
--- a/gettext.h
+++ b/gettext.h
@@ -22,11 +22,26 @@
/* 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.
diff --git a/install-sh b/install-sh
index ab74c882..36f96f3e 100755
--- a/install-sh
+++ b/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/intl/ChangeLog b/intl/ChangeLog
index 78b57574..65ec50f7 100644
--- a/intl/ChangeLog
+++ b/intl/ChangeLog
@@ -1,8 +1,4 @@
-Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
+2002-08-06 GNU <bug-gnu-gettext@gnu.org>
- * Release 3.1.1: Release tar file made.
-
-2002-04-24 GNU <bug-gnu-gettext@gnu.org>
-
- * Version 0.11.2 released.
+ * Version 0.11.5 released.
diff --git a/intl/Makefile.in b/intl/Makefile.in
index 5b1cf2f2..0486dc93 100644
--- a/intl/Makefile.in
+++ b/intl/Makefile.in
@@ -84,9 +84,9 @@ COPYING.LIB-2 gettext.h libgettext.h plural-eval.c
# according to the libtool documentation, section "Library interface versions".
# Maintainers of other packages that include the intl directory must *not*
# change these values.
-LTV_CURRENT=2
-LTV_REVISION=1
-LTV_AGE=0
+LTV_CURRENT=4
+LTV_REVISION=0
+LTV_AGE=2
.SUFFIXES:
.SUFFIXES: .c .y .o .lo .sin .sed
diff --git a/intl/VERSION b/intl/VERSION
index 657e73b6..acc8052f 100644
--- a/intl/VERSION
+++ b/intl/VERSION
@@ -1 +1 @@
-GNU gettext library from gettext-0.11.2
+GNU gettext library from gettext-0.11.5
diff --git a/intl/bindtextdom.c b/intl/bindtextdom.c
index a3c233d7..d582ce11 100644
--- a/intl/bindtextdom.c
+++ b/intl/bindtextdom.c
@@ -45,8 +45,8 @@
names than the internal variables in GNU libc, otherwise programs
using libintl.a cannot be linked statically. */
#if !defined _LIBC
-# define _nl_default_dirname _nl_default_dirname__
-# define _nl_domain_bindings _nl_domain_bindings__
+# define _nl_default_dirname libintl_nl_default_dirname
+# define _nl_domain_bindings libintl_nl_domain_bindings
#endif
/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */
@@ -77,8 +77,8 @@ __libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
# define strdup(str) __strdup (str)
# endif
#else
-# define BINDTEXTDOMAIN bindtextdomain__
-# define BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset__
+# define BINDTEXTDOMAIN libintl_bindtextdomain
+# define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset
#endif
/* Prototypes for local functions. */
diff --git a/intl/config.charset b/intl/config.charset
index 0a1a68db..4f98b5b0 100755
--- a/intl/config.charset
+++ b/intl/config.charset
@@ -34,7 +34,7 @@
# ASCII, ANSI_X3.4-1968 glibc solaris freebsd
# ISO-8859-1 glibc aix hpux irix osf solaris freebsd yes
# ISO-8859-2 glibc aix hpux irix osf solaris freebsd yes
-# ISO-8859-3 glibc yes
+# ISO-8859-3 glibc solaris yes
# ISO-8859-4 osf solaris freebsd yes
# ISO-8859-5 glibc aix hpux irix osf solaris freebsd yes
# ISO-8859-6 glibc aix hpux solaris yes
@@ -42,9 +42,11 @@
# ISO-8859-8 glibc aix hpux osf solaris yes
# ISO-8859-9 glibc aix hpux irix osf solaris yes
# ISO-8859-13 glibc
+# ISO-8859-14 glibc
# ISO-8859-15 glibc aix osf solaris freebsd
# KOI8-R glibc solaris freebsd yes
# KOI8-U glibc freebsd yes
+# KOI8-T glibc
# CP437 dos
# CP775 dos
# CP850 aix osf dos
@@ -58,35 +60,38 @@
# CP865 dos
# CP866 freebsd dos
# CP869 dos
-# CP874 win32 dos
+# CP874 woe32 dos
# CP922 aix
-# CP932 aix win32 dos
+# CP932 aix woe32 dos
# CP943 aix
-# CP949 osf win32 dos
-# CP950 win32 dos
+# CP949 osf woe32 dos
+# CP950 woe32 dos
# CP1046 aix
# CP1124 aix
+# CP1125 dos
# CP1129 aix
-# CP1250 win32
-# CP1251 glibc win32
-# CP1252 aix win32
-# CP1253 win32
-# CP1254 win32
-# CP1255 win32
-# CP1256 win32
-# CP1257 win32
+# CP1250 woe32
+# CP1251 glibc woe32
+# CP1252 aix woe32
+# CP1253 woe32
+# CP1254 woe32
+# CP1255 glibc woe32
+# CP1256 woe32
+# CP1257 woe32
# GB2312 glibc aix hpux irix solaris freebsd yes
# EUC-JP glibc aix hpux irix osf solaris freebsd yes
# EUC-KR glibc aix hpux irix osf solaris freebsd yes
# EUC-TW glibc aix hpux irix osf solaris
# BIG5 glibc aix hpux osf solaris freebsd yes
-# BIG5-HKSCS glibc
-# GBK aix osf win32 dos
-# GB18030 glibc
+# BIG5-HKSCS glibc solaris
+# GBK glibc aix osf solaris woe32 dos
+# GB18030 glibc solaris
# SHIFT_JIS hpux osf solaris freebsd yes
-# JOHAB glibc win32
+# JOHAB glibc solaris woe32
# TIS-620 glibc aix hpux osf solaris
# VISCII glibc yes
+# TCVN5712-1 glibc
+# GEORGIAN-PS glibc
# HP-ROMAN8 hpux
# HP-ARABIC8 hpux
# HP-GREEK8 hpux
@@ -217,6 +222,7 @@ case "$os" in
echo "646 ASCII"
echo "ISO8859-1 ISO-8859-1"
echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-3 ISO-8859-3"
echo "ISO8859-4 ISO-8859-4"
echo "ISO8859-5 ISO-8859-5"
echo "ISO8859-6 ISO-8859-6"
@@ -226,9 +232,13 @@ case "$os" in
echo "ISO8859-15 ISO-8859-15"
echo "koi8-r KOI8-R"
echo "BIG5 BIG5"
+ echo "Big5-HKSCS BIG5-HKSCS"
echo "gb2312 GB2312"
+ echo "GBK GBK"
+ echo "GB18030 GB18030"
echo "cns11643 EUC-TW"
echo "5601 EUC-KR"
+ echo "ko_KR.johap92 JOHAB"
echo "eucJP EUC-JP"
echo "PCK SHIFT_JIS"
echo "TIS620.2533 TIS-620"
@@ -300,7 +310,7 @@ case "$os" in
echo "# country is not the one your DOS machine actually uses, just"
echo "# correct it in this file, and send a mail to"
echo "# Juan Manuel Guerrero <st001906@hrz1.hrz.tu-darmstadt.de>"
- echo "# and Bruno Haible <haible@clisp.cons.org>."
+ echo "# and Bruno Haible <bruno@clisp.org>."
echo "#"
echo "C ASCII"
# ISO-8859-1 languages
@@ -412,6 +422,8 @@ case "$os" in
echo "mk_MK CP866" # not CP855 ??
echo "ru CP866"
echo "ru_RU CP866"
+ echo "uk CP1125"
+ echo "uk_UA CP1125"
# ISO-8859-6 languages
echo "ar CP864"
echo "ar_AE CP864"
diff --git a/intl/dcgettext.c b/intl/dcgettext.c
index 70ee3baf..ca6a1c82 100644
--- a/intl/dcgettext.c
+++ b/intl/dcgettext.c
@@ -37,8 +37,8 @@
# define DCGETTEXT __dcgettext
# define DCIGETTEXT __dcigettext
#else
-# define DCGETTEXT dcgettext__
-# define DCIGETTEXT dcigettext__
+# define DCGETTEXT libintl_dcgettext
+# define DCIGETTEXT libintl_dcigettext
#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index afbb181f..f2f01524 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -64,6 +64,20 @@ extern int errno;
#include <locale.h>
+#ifdef _LIBC
+ /* Guess whether integer division by zero raises signal SIGFPE.
+ Set to 1 only if you know for sure. In case of doubt, set to 0. */
+# if defined __alpha__ || defined __arm__ || defined __i386__ \
+ || defined __m68k__ || defined __s390__
+# define INTDIV0_RAISES_SIGFPE 1
+# else
+# define INTDIV0_RAISES_SIGFPE 0
+# endif
+#endif
+#if !INTDIV0_RAISES_SIGFPE
+# include <signal.h>
+#endif
+
#if defined HAVE_SYS_PARAM_H || defined _LIBC
# include <sys/param.h>
#endif
@@ -102,10 +116,10 @@ extern int errno;
names than the internal variables in GNU libc, otherwise programs
using libintl.a cannot be linked statically. */
#if !defined _LIBC
-# define _nl_default_default_domain _nl_default_default_domain__
-# define _nl_current_default_domain _nl_current_default_domain__
-# define _nl_default_dirname _nl_default_dirname__
-# define _nl_domain_bindings _nl_domain_bindings__
+# define _nl_default_default_domain libintl_nl_default_default_domain
+# define _nl_current_default_domain libintl_nl_current_default_domain
+# define _nl_default_dirname libintl_nl_default_dirname
+# define _nl_domain_bindings libintl_nl_domain_bindings
#endif
/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */
@@ -292,6 +306,7 @@ static const char *guess_category_value PARAMS ((int category,
some additional code emulating it. */
#ifdef HAVE_ALLOCA
/* Nothing has to be done. */
+# define freea(p) /* nothing */
# define ADD_BLOCK(list, address) /* nothing */
# define FREE_BLOCKS(list) /* nothing */
#else
@@ -316,11 +331,13 @@ struct block_list
while (list != NULL) { \
struct block_list *old = list; \
list = list->next; \
+ free (old->address); \
free (old); \
} \
} while (0)
# undef alloca
# define alloca(size) (malloc (size))
+# define freea(p) free (p)
#endif /* have alloca */
@@ -344,7 +361,7 @@ typedef unsigned char transmem_block_t;
#ifdef _LIBC
# define DCIGETTEXT __dcigettext
#else
-# define DCIGETTEXT dcigettext__
+# define DCIGETTEXT libintl_dcigettext
#endif
/* Lock variable to protect the global data in the gettext implementation. */
@@ -446,6 +463,7 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
search->category = category;
foundp = (struct known_translation_t **) tfind (search, &root, transcmp);
+ freea (search);
if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr)
{
/* Now deal with plural. */
@@ -679,6 +697,7 @@ _nl_find_msg (domain_file, domainbinding, msgid, lengthp)
size_t *lengthp;
{
struct loaded_domain *domain;
+ nls_uint32 nstrings;
size_t act;
char *result;
size_t resultlen;
@@ -691,8 +710,10 @@ _nl_find_msg (domain_file, domainbinding, msgid, lengthp)
domain = (struct loaded_domain *) domain_file->data;
+ nstrings = domain->nstrings;
+
/* Locate the MSGID and its translation. */
- if (domain->hash_size > 2 && domain->hash_tab != NULL)
+ if (domain->hash_tab != NULL)
{
/* Use the hashing table. */
nls_uint32 len = strlen (msgid);
@@ -702,22 +723,30 @@ _nl_find_msg (domain_file, domainbinding, msgid, lengthp)
while (1)
{
- nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]);
+ nls_uint32 nstr =
+ W (domain->must_swap_hash_tab, domain->hash_tab[idx]);
if (nstr == 0)
/* Hash table entry is empty. */
return NULL;
- /* Compare msgid with the original string at index nstr-1.
+ nstr--;
+
+ /* Compare msgid with the original string at index nstr.
We compare the lengths with >=, not ==, because plural entries
are represented by strings with an embedded NUL. */
- if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) >= len
- && (strcmp (msgid,
- domain->data + W (domain->must_swap,
- domain->orig_tab[nstr - 1].offset))
- == 0))
+ if (nstr < nstrings
+ ? W (domain->must_swap, domain->orig_tab[nstr].length) >= len
+ && (strcmp (msgid,
+ domain->data + W (domain->must_swap,
+ domain->orig_tab[nstr].offset))
+ == 0)
+ : domain->orig_sysdep_tab[nstr - nstrings].length > len
+ && (strcmp (msgid,
+ domain->orig_sysdep_tab[nstr - nstrings].pointer)
+ == 0))
{
- act = nstr - 1;
+ act = nstr;
goto found;
}
@@ -735,7 +764,7 @@ _nl_find_msg (domain_file, domainbinding, msgid, lengthp)
size_t top, bottom;
bottom = 0;
- top = domain->nstrings;
+ top = nstrings;
while (bottom < top)
{
int cmp_val;
@@ -758,9 +787,17 @@ _nl_find_msg (domain_file, domainbinding, msgid, lengthp)
found:
/* The translation was found at index ACT. If we have to convert the
string to use a different character set, this is the time. */
- result = ((char *) domain->data
- + W (domain->must_swap, domain->trans_tab[act].offset));
- resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1;
+ if (act < nstrings)
+ {
+ result = (char *)
+ (domain->data + W (domain->must_swap, domain->trans_tab[act].offset));
+ resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1;
+ }
+ else
+ {
+ result = (char *) domain->trans_sysdep_tab[act - nstrings].pointer;
+ resultlen = domain->trans_sysdep_tab[act - nstrings].length;
+ }
#if defined _LIBC || HAVE_ICONV
if (domain->codeset_cntr
@@ -793,8 +830,9 @@ _nl_find_msg (domain_file, domainbinding, msgid, lengthp)
NULs. */
if (domain->conv_tab == NULL
- && ((domain->conv_tab = (char **) calloc (domain->nstrings,
- sizeof (char *)))
+ && ((domain->conv_tab =
+ (char **) calloc (nstrings + domain->n_sysdep_strings,
+ sizeof (char *)))
== NULL))
/* Mark that we didn't succeed allocating a table. */
domain->conv_tab = (char **) -1;
diff --git a/intl/dcngettext.c b/intl/dcngettext.c
index d31ff9bf..17d9ce3e 100644
--- a/intl/dcngettext.c
+++ b/intl/dcngettext.c
@@ -37,8 +37,8 @@
# define DCNGETTEXT __dcngettext
# define DCIGETTEXT __dcigettext
#else
-# define DCNGETTEXT dcngettext__
-# define DCIGETTEXT dcigettext__
+# define DCNGETTEXT libintl_dcngettext
+# define DCIGETTEXT libintl_dcigettext
#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
diff --git a/intl/dgettext.c b/intl/dgettext.c
index 17b0442c..cf5b4037 100644
--- a/intl/dgettext.c
+++ b/intl/dgettext.c
@@ -39,8 +39,8 @@
# define DGETTEXT __dgettext
# define DCGETTEXT INTUSE(__dcgettext)
#else
-# define DGETTEXT dgettext__
-# define DCGETTEXT dcgettext__
+# define DGETTEXT libintl_dgettext
+# define DCGETTEXT libintl_dcgettext
#endif
/* Look up MSGID in the DOMAINNAME message catalog of the current
diff --git a/intl/dngettext.c b/intl/dngettext.c
index 2b9ff886..0afbd2e1 100644
--- a/intl/dngettext.c
+++ b/intl/dngettext.c
@@ -39,8 +39,8 @@
# define DNGETTEXT __dngettext
# define DCNGETTEXT INTUSE(__dcngettext)
#else
-# define DNGETTEXT dngettext__
-# define DCNGETTEXT dcngettext__
+# define DNGETTEXT libintl_dngettext
+# define DCNGETTEXT libintl_dcngettext
#endif
/* Look up MSGID in the DOMAINNAME message catalog of the current
diff --git a/intl/eval-plural.h b/intl/eval-plural.h
index 44f49342..19c7ca6a 100644
--- a/intl/eval-plural.h
+++ b/intl/eval-plural.h
@@ -68,8 +68,16 @@ plural_eval (pexp, n)
case mult:
return leftarg * rightarg;
case divide:
+#if !INTDIV0_RAISES_SIGFPE
+ if (rightarg == 0)
+ raise (SIGFPE);
+#endif
return leftarg / rightarg;
case module:
+#if !INTDIV0_RAISES_SIGFPE
+ if (rightarg == 0)
+ raise (SIGFPE);
+#endif
return leftarg % rightarg;
case plus:
return leftarg + rightarg;
diff --git a/intl/gettext.c b/intl/gettext.c
index e52d8aef..43d689f5 100644
--- a/intl/gettext.c
+++ b/intl/gettext.c
@@ -44,8 +44,8 @@
# define GETTEXT __gettext
# define DCGETTEXT INTUSE(__dcgettext)
#else
-# define GETTEXT gettext__
-# define DCGETTEXT dcgettext__
+# define GETTEXT libintl_gettext
+# define DCGETTEXT libintl_dcgettext
#endif
/* Look up MSGID in the current default message catalog for the current
diff --git a/intl/gettextP.h b/intl/gettextP.h
index 4e3a5b25..f085c59b 100644
--- a/intl/gettextP.h
+++ b/intl/gettextP.h
@@ -76,18 +76,50 @@ SWAP (i)
#endif
+/* In-memory representation of system dependent string. */
+struct sysdep_string_desc
+{
+ /* Length of addressed string, including the trailing NUL. */
+ size_t length;
+ /* Pointer to addressed string. */
+ const char *pointer;
+};
+
/* The representation of an opened message catalog. */
struct loaded_domain
{
+ /* Pointer to memory containing the .mo file. */
const char *data;
+ /* 1 if the memory is mmap()ed, 0 if the memory is malloc()ed. */
int use_mmap;
+ /* Size of mmap()ed memory. */
size_t mmap_size;
+ /* 1 if the .mo file uses a different endianness than this machine. */
int must_swap;
+ /* Pointer to additional malloc()ed memory. */
+ void *malloced;
+
+ /* Number of static strings pairs. */
nls_uint32 nstrings;
- struct string_desc *orig_tab;
- struct string_desc *trans_tab;
+ /* Pointer to descriptors of original strings in the file. */
+ const struct string_desc *orig_tab;
+ /* Pointer to descriptors of translated strings in the file. */
+ const struct string_desc *trans_tab;
+
+ /* Number of system dependent strings pairs. */
+ nls_uint32 n_sysdep_strings;
+ /* Pointer to descriptors of original sysdep strings. */
+ const struct sysdep_string_desc *orig_sysdep_tab;
+ /* Pointer to descriptors of translated sysdep strings. */
+ const struct sysdep_string_desc *trans_sysdep_tab;
+
+ /* Size of hash table. */
nls_uint32 hash_size;
- nls_uint32 *hash_tab;
+ /* Pointer to hash table. */
+ const nls_uint32 *hash_tab;
+ /* 1 if the hash table uses a different endianness than this machine. */
+ int must_swap_hash_tab;
+
int codeset_cntr;
#ifdef _LIBC
__gconv_t conv;
@@ -176,28 +208,33 @@ extern char *__bindtextdomain PARAMS ((const char *__domainname,
extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname,
const char *__codeset));
#else
-extern char *gettext__ PARAMS ((const char *__msgid));
-extern char *dgettext__ PARAMS ((const char *__domainname,
- const char *__msgid));
-extern char *dcgettext__ PARAMS ((const char *__domainname,
- const char *__msgid, int __category));
-extern char *ngettext__ PARAMS ((const char *__msgid1, const char *__msgid2,
- unsigned long int __n));
-extern char *dngettext__ PARAMS ((const char *__domainname,
- const char *__msgid1, const char *__msgid2,
- unsigned long int __n));
-extern char *dcngettext__ PARAMS ((const char *__domainname,
- const char *__msgid1, const char *__msgid2,
- unsigned long int __n, int __category));
-extern char *dcigettext__ PARAMS ((const char *__domainname,
- const char *__msgid1, const char *__msgid2,
- int __plural, unsigned long int __n,
- int __category));
-extern char *textdomain__ PARAMS ((const char *__domainname));
-extern char *bindtextdomain__ PARAMS ((const char *__domainname,
- const char *__dirname));
-extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname,
- const char *__codeset));
+extern char *libintl_gettext PARAMS ((const char *__msgid));
+extern char *libintl_dgettext PARAMS ((const char *__domainname,
+ const char *__msgid));
+extern char *libintl_dcgettext PARAMS ((const char *__domainname,
+ const char *__msgid, int __category));
+extern char *libintl_ngettext PARAMS ((const char *__msgid1,
+ const char *__msgid2,
+ unsigned long int __n));
+extern char *libintl_dngettext PARAMS ((const char *__domainname,
+ const char *__msgid1,
+ const char *__msgid2,
+ unsigned long int __n));
+extern char *libintl_dcngettext PARAMS ((const char *__domainname,
+ const char *__msgid1,
+ const char *__msgid2,
+ unsigned long int __n,
+ int __category));
+extern char *libintl_dcigettext PARAMS ((const char *__domainname,
+ const char *__msgid1,
+ const char *__msgid2,
+ int __plural, unsigned long int __n,
+ int __category));
+extern char *libintl_textdomain PARAMS ((const char *__domainname));
+extern char *libintl_bindtextdomain PARAMS ((const char *__domainname,
+ const char *__dirname));
+extern char *libintl_bind_textdomain_codeset PARAMS ((const char *__domainname,
+ const char *__codeset));
#endif
/* @@ begin of epilog @@ */
diff --git a/intl/gmo.h b/intl/gmo.h
index f05ae470..d1fe4d6b 100644
--- a/intl/gmo.h
+++ b/intl/gmo.h
@@ -1,5 +1,5 @@
/* Description of GNU message catalog format: general file layout.
- Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1997, 2000-2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
@@ -75,26 +75,74 @@ struct mo_file_header
nls_uint32 magic;
/* The revision number of the file format. */
nls_uint32 revision;
+
+ /* The following are only used in .mo files with major revision 0. */
+
/* The number of strings pairs. */
nls_uint32 nstrings;
/* Offset of table with start offsets of original strings. */
nls_uint32 orig_tab_offset;
- /* Offset of table with start offsets of translation strings. */
+ /* Offset of table with start offsets of translated strings. */
nls_uint32 trans_tab_offset;
- /* Size of hashing table. */
+ /* Size of hash table. */
nls_uint32 hash_tab_size;
- /* Offset of first hashing entry. */
+ /* Offset of first hash table entry. */
nls_uint32 hash_tab_offset;
+
+ /* The following are only used in .mo files with minor revision >= 1. */
+
+ /* The number of system dependent segments. */
+ nls_uint32 n_sysdep_segments;
+ /* Offset of table describing system dependent segments. */
+ nls_uint32 sysdep_segments_offset;
+ /* The number of system dependent strings pairs. */
+ nls_uint32 n_sysdep_strings;
+ /* Offset of table with start offsets of original sysdep strings. */
+ nls_uint32 orig_sysdep_tab_offset;
+ /* Offset of table with start offsets of translated sysdep strings. */
+ nls_uint32 trans_sysdep_tab_offset;
};
+/* Descriptor for static string contained in the binary .mo file. */
struct string_desc
{
- /* Length of addressed string. */
+ /* Length of addressed string, not including the trailing NUL. */
nls_uint32 length;
/* Offset of string in file. */
nls_uint32 offset;
};
+/* The following are only used in .mo files with minor revision >= 1. */
+
+/* Descriptor for system dependent string segment. */
+struct sysdep_segment
+{
+ /* Length of addressed string, including the trailing NUL. */
+ nls_uint32 length;
+ /* Offset of string in file. */
+ nls_uint32 offset;
+};
+
+/* Descriptor for system dependent string. */
+struct sysdep_string
+{
+ /* Offset of static string segments in file. */
+ nls_uint32 offset;
+ /* Alternating sequence of static and system dependent segments.
+ The last segment is a static segment, including the trailing NUL. */
+ struct segment_pair
+ {
+ /* Size of static segment. */
+ nls_uint32 segsize;
+ /* Reference to system dependent string segment, or ~0 at the end. */
+ nls_uint32 sysdepref;
+ } segments[1];
+};
+
+/* Marker for the end of the segments[] array. This has the value 0xFFFFFFFF,
+ regardless whether 'int' is 16 bit, 32 bit, or 64 bit. */
+#define SEGMENTS_END ((nls_uint32) ~0)
+
/* @@ begin of epilog @@ */
#endif /* gettext.h */
diff --git a/intl/intl-compat.c b/intl/intl-compat.c
index 0a06ce94..da890159 100644
--- a/intl/intl-compat.c
+++ b/intl/intl-compat.c
@@ -1,6 +1,6 @@
/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
Library.
- Copyright (C) 1995, 2000, 2001 Software Foundation, Inc.
+ Copyright (C) 1995, 2000-2002 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
@@ -21,52 +21,17 @@
# include <config.h>
#endif
+#define _INTL_REDIRECT_MACROS
#include "libgnuintl.h"
#include "gettextP.h"
/* @@ end of prolog @@ */
-/* This file redirects the gettext functions (without prefix or suffix) to
- those defined in the included GNU gettext library (with "__" suffix).
- It is compiled into libintl when the included GNU gettext library is
- configured --with-included-gettext.
-
- This redirection works also in the case that the system C library or
- the system libintl library contain gettext/textdomain/... functions.
- If it didn't, we would need to add preprocessor level redirections to
- libgnuintl.h of the following form:
-
-# define gettext gettext__
-# define dgettext dgettext__
-# define dcgettext dcgettext__
-# define ngettext ngettext__
-# define dngettext dngettext__
-# define dcngettext dcngettext__
-# define textdomain textdomain__
-# define bindtextdomain bindtextdomain__
-# define bind_textdomain_codeset bind_textdomain_codeset__
-
- How does this redirection work? There are two cases.
- A. When libintl.a is linked into an executable, it works because
- functions defined in the executable always override functions in
- the shared libraries.
- B. When libintl.so is used, it works because
- 1. those systems defining gettext/textdomain/... in the C library
- (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer) are
- ELF systems and define these symbols as weak, thus explicitly
- letting other shared libraries override it.
- 2. those systems defining gettext/textdomain/... in a standalone
- libintl.so library (namely, Solaris 2.3 and newer) have this
- shared library in /usr/lib, and the linker will search /usr/lib
- *after* the directory where the GNU gettext library is installed.
-
- A third case, namely when libintl.a is linked into a shared library
- whose name is not libintl.so, is not supported. In this case, on
- Solaris, when -lintl precedes the linker option for the shared library
- containing GNU gettext, the system's gettext would indeed override
- the GNU gettext. Anyone doing this kind of stuff must be clever enough
- to 1. compile libintl.a with -fPIC, 2. remove -lintl from his linker
- command line. */
+/* This file redirects the gettext functions (without prefix) to those
+ defined in the included GNU libintl library (with "libintl_" prefix).
+ It is compiled into libintl in order to make the AM_GNU_GETTEXT test
+ of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which
+ has the redirections primarily in the <libintl.h> include file. */
#undef gettext
@@ -84,7 +49,7 @@ char *
gettext (msgid)
const char *msgid;
{
- return gettext__ (msgid);
+ return libintl_gettext (msgid);
}
@@ -93,7 +58,7 @@ dgettext (domainname, msgid)
const char *domainname;
const char *msgid;
{
- return dgettext__ (domainname, msgid);
+ return libintl_dgettext (domainname, msgid);
}
@@ -103,7 +68,7 @@ dcgettext (domainname, msgid, category)
const char *msgid;
int category;
{
- return dcgettext__ (domainname, msgid, category);
+ return libintl_dcgettext (domainname, msgid, category);
}
@@ -113,7 +78,7 @@ ngettext (msgid1, msgid2, n)
const char *msgid2;
unsigned long int n;
{
- return ngettext__ (msgid1, msgid2, n);
+ return libintl_ngettext (msgid1, msgid2, n);
}
@@ -124,7 +89,7 @@ dngettext (domainname, msgid1, msgid2, n)
const char *msgid2;
unsigned long int n;
{
- return dngettext__ (domainname, msgid1, msgid2, n);
+ return libintl_dngettext (domainname, msgid1, msgid2, n);
}
@@ -136,7 +101,7 @@ dcngettext (domainname, msgid1, msgid2, n, category)
unsigned long int n;
int category;
{
- return dcngettext__ (domainname, msgid1, msgid2, n, category);
+ return libintl_dcngettext (domainname, msgid1, msgid2, n, category);
}
@@ -144,7 +109,7 @@ char *
textdomain (domainname)
const char *domainname;
{
- return textdomain__ (domainname);
+ return libintl_textdomain (domainname);
}
@@ -153,7 +118,7 @@ bindtextdomain (domainname, dirname)
const char *domainname;
const char *dirname;
{
- return bindtextdomain__ (domainname, dirname);
+ return libintl_bindtextdomain (domainname, dirname);
}
@@ -162,5 +127,5 @@ bind_textdomain_codeset (domainname, codeset)
const char *domainname;
const char *codeset;
{
- return bind_textdomain_codeset__ (domainname, codeset);
+ return libintl_bind_textdomain_codeset (domainname, codeset);
}
diff --git a/intl/l10nflist.c b/intl/l10nflist.c
index d861912d..ec8713f8 100644
--- a/intl/l10nflist.c
+++ b/intl/l10nflist.c
@@ -62,6 +62,24 @@ static char *stpcpy PARAMS ((char *dest, const char *src));
# endif
#endif
+/* Pathname support.
+ ISSLASH(C) tests whether C is a directory separator character.
+ IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not,
+ it may be concatenated to a directory pathname.
+ */
+#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
+ /* Win32, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+# define HAS_DEVICE(P) \
+ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
+ && (P)[1] == ':')
+# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
+#else
+ /* Unix */
+# define ISSLASH(C) ((C) == '/')
+# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
+#endif
+
/* Define function which are usually not available. */
#if !defined _LIBC && !defined HAVE___ARGZ_COUNT
@@ -185,12 +203,18 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
int do_allocate;
{
char *abs_filename;
- struct loaded_l10nfile *last = NULL;
+ struct loaded_l10nfile **lastp;
struct loaded_l10nfile *retval;
char *cp;
+ size_t dirlist_count;
size_t entries;
int cnt;
+ /* If LANGUAGE contains an absolute directory specification, we ignore
+ DIRLIST. */
+ if (IS_ABSOLUTE_PATH (language))
+ dirlist_len = 0;
+
/* Allocate room for the full file name. */
abs_filename = (char *) malloc (dirlist_len
+ strlen (language)
@@ -208,7 +232,7 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
+ (((mask & CEN_SPONSOR) != 0
|| (mask & CEN_REVISION) != 0)
? (1 + ((mask & CEN_SPONSOR) != 0
- ? strlen (sponsor) + 1 : 0)
+ ? strlen (sponsor) : 0)
+ ((mask & CEN_REVISION) != 0
? strlen (revision) + 1 : 0)) : 0)
+ 1 + strlen (filename) + 1);
@@ -216,14 +240,16 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
if (abs_filename == NULL)
return NULL;
- retval = NULL;
- last = NULL;
-
/* Construct file name. */
- memcpy (abs_filename, dirlist, dirlist_len);
- __argz_stringify (abs_filename, dirlist_len, PATH_SEPARATOR);
- cp = abs_filename + (dirlist_len - 1);
- *cp++ = '/';
+ cp = abs_filename;
+ if (dirlist_len > 0)
+ {
+ memcpy (cp, dirlist, dirlist_len);
+ __argz_stringify (cp, dirlist_len, PATH_SEPARATOR);
+ cp += dirlist_len;
+ cp[-1] = '/';
+ }
+
cp = stpcpy (cp, language);
if ((mask & TERRITORY) != 0)
@@ -270,7 +296,7 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
/* Look in list of already loaded domains whether it is already
available. */
- last = NULL;
+ lastp = l10nfile_list;
for (retval = *l10nfile_list; retval != NULL; retval = retval->next)
if (retval->filename != NULL)
{
@@ -285,7 +311,7 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
break;
}
- last = retval;
+ lastp = &retval->next;
}
if (retval != NULL || do_allocate == 0)
@@ -294,48 +320,66 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
return retval;
}
- retval = (struct loaded_l10nfile *)
- malloc (sizeof (*retval) + (__argz_count (dirlist, dirlist_len)
- * (1 << pop (mask))
- * sizeof (struct loaded_l10nfile *)));
+ dirlist_count = (dirlist_len > 0 ? __argz_count (dirlist, dirlist_len) : 1);
+
+ /* Allocate a new loaded_l10nfile. */
+ retval =
+ (struct loaded_l10nfile *)
+ malloc (sizeof (*retval)
+ + (((dirlist_count << pop (mask)) + (dirlist_count > 1 ? 1 : 0))
+ * sizeof (struct loaded_l10nfile *)));
if (retval == NULL)
return NULL;
retval->filename = abs_filename;
- retval->decided = (__argz_count (dirlist, dirlist_len) != 1
+
+ /* We set retval->data to NULL here; it is filled in later.
+ Setting retval->decided to 1 here means that retval does not
+ correspond to a real file (dirlist_count > 1) or is not worth
+ looking up (if an unnormalized codeset was specified). */
+ retval->decided = (dirlist_count > 1
|| ((mask & XPG_CODESET) != 0
&& (mask & XPG_NORM_CODESET) != 0));
retval->data = NULL;
- if (last == NULL)
- {
- retval->next = *l10nfile_list;
- *l10nfile_list = retval;
- }
- else
- {
- retval->next = last->next;
- last->next = retval;
- }
+ retval->next = *lastp;
+ *lastp = retval;
entries = 0;
- /* If the DIRLIST is a real list the RETVAL entry corresponds not to
- a real file. So we have to use the DIRLIST separation mechanism
- of the inner loop. */
- cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask;
- for (; cnt >= 0; --cnt)
+ /* Recurse to fill the inheritance list of RETVAL.
+ If the DIRLIST is a real list (i.e. DIRLIST_COUNT > 1), the RETVAL
+ entry does not correspond to a real file; retval->filename contains
+ colons. In this case we loop across all elements of DIRLIST and
+ across all bit patterns dominated by MASK.
+ If the DIRLIST is a single directory or entirely redundant (i.e.
+ DIRLIST_COUNT == 1), we loop across all bit patterns dominated by
+ MASK, excluding MASK itself.
+ In either case, we loop down from MASK to 0. This has the effect
+ that the extra bits in the locale name are dropped in this order:
+ first the modifier, then the territory, then the codeset, then the
+ normalized_codeset. */
+ for (cnt = dirlist_count > 1 ? mask : mask - 1; cnt >= 0; --cnt)
if ((cnt & ~mask) == 0
&& ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
&& ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
{
- /* Iterate over all elements of the DIRLIST. */
- char *dir = NULL;
-
- while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
- != NULL)
+ if (dirlist_count > 1)
+ {
+ /* Iterate over all elements of the DIRLIST. */
+ char *dir = NULL;
+
+ while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
+ != NULL)
+ retval->successor[entries++]
+ = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1,
+ cnt, language, territory, codeset,
+ normalized_codeset, modifier, special,
+ sponsor, revision, filename, 1);
+ }
+ else
retval->successor[entries++]
- = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt,
- language, territory, codeset,
+ = _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len,
+ cnt, language, territory, codeset,
normalized_codeset, modifier, special,
sponsor, revision, filename, 1);
}
diff --git a/intl/libgnuintl.h b/intl/libgnuintl.h
index 1387e70c..60bc5519 100644
--- a/intl/libgnuintl.h
+++ b/intl/libgnuintl.h
@@ -36,11 +36,15 @@
implementation of gettext. */
#define __USE_GNU_GETTEXT 1
+/* Provide information about the supported file formats. Returns the
+ maximum minor revision number supported for a given major revision. */
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
+ ((major) == 0 ? 1 : -1)
+
/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
precedence over _conio_gettext. */
#ifdef __DJGPP__
# undef gettext
-# define gettext gettext
#endif
/* Use _INTL_PARAMS, not PARAMS, in order to avoid clashes with identifiers
@@ -57,78 +61,232 @@
extern "C" {
#endif
+
+/* We redirect the functions to those prefixed with "libintl_". This is
+ necessary, because some systems define gettext/textdomain/... in the C
+ library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
+ If we used the unprefixed names, there would be cases where the
+ definition in the C library would override the one in the libintl.so
+ shared library. Recall that on ELF systems, the symbols are looked
+ up in the following order:
+ 1. in the executable,
+ 2. in the shared libraries specified on the link command line, in order,
+ 3. in the dependencies of the shared libraries specified on the link
+ command line,
+ 4. in the dlopen()ed shared libraries, in the order in which they were
+ dlopen()ed.
+ The definition in the C library would override the one in libintl.so if
+ either
+ * -lc is given on the link command line and -lintl isn't, or
+ * -lc is given on the link command line before -lintl, or
+ * libintl.so is a dependency of a dlopen()ed shared library but not
+ linked to the executable at link time.
+ Since Solaris gettext() behaves differently than GNU gettext(), this
+ would be unacceptable.
+
+ The redirection happens by default through macros in C, so that &gettext
+ is independent of the compilation unit, but through inline functions in
+ C++, in order not to interfere with the name mangling of class fields or
+ class methods called 'gettext'. */
+
+/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
+ If he doesn't, we choose the method. A third possible method is
+ _INTL_REDIRECT_ASM, supported only by GCC. */
+#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
+# if __GNUC__ >= 2 && (defined __STDC__ || defined __cplusplus) && !(defined __APPLE_CC__)
+# define _INTL_REDIRECT_ASM
+# else
+# ifdef __cplusplus
+# define _INTL_REDIRECT_INLINE
+# else
+# define _INTL_REDIRECT_MACROS
+# endif
+# endif
+#endif
+/* Auxiliary macros. */
+#ifdef _INTL_REDIRECT_ASM
+# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname))
+# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring
+# define _INTL_STRINGIFY(prefix) #prefix
+#else
+# define _INTL_ASM(cname)
+#endif
+
/* Look up MSGID in the current default message catalog for the current
LC_MESSAGES locale. If not found, returns MSGID itself (the default
text). */
-extern char *gettext _INTL_PARAMS ((const char *__msgid));
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_gettext (const char *__msgid);
+static inline char *gettext (const char *__msgid)
+{
+ return libintl_gettext (__msgid);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define gettext libintl_gettext
+#endif
+extern char *gettext _INTL_PARAMS ((const char *__msgid))
+ _INTL_ASM (libintl_gettext);
+#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current
LC_MESSAGES locale. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_dgettext (const char *__domainname, const char *__msgid);
+static inline char *dgettext (const char *__domainname, const char *__msgid)
+{
+ return libintl_dgettext (__domainname, __msgid);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dgettext libintl_dgettext
+#endif
extern char *dgettext _INTL_PARAMS ((const char *__domainname,
- const char *__msgid));
+ const char *__msgid))
+ _INTL_ASM (libintl_dgettext);
+#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
locale. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_dcgettext (const char *__domainname, const char *__msgid,
+ int __category);
+static inline char *dcgettext (const char *__domainname, const char *__msgid,
+ int __category)
+{
+ return libintl_dcgettext (__domainname, __msgid, __category);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dcgettext libintl_dcgettext
+#endif
extern char *dcgettext _INTL_PARAMS ((const char *__domainname,
const char *__msgid,
- int __category));
+ int __category))
+ _INTL_ASM (libintl_dcgettext);
+#endif
/* Similar to `gettext' but select the plural form corresponding to the
number N. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
+ unsigned long int __n);
+static inline char *ngettext (const char *__msgid1, const char *__msgid2,
+ unsigned long int __n)
+{
+ return libintl_ngettext (__msgid1, __msgid2, __n);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define ngettext libintl_ngettext
+#endif
extern char *ngettext _INTL_PARAMS ((const char *__msgid1,
const char *__msgid2,
- unsigned long int __n));
+ unsigned long int __n))
+ _INTL_ASM (libintl_ngettext);
+#endif
/* Similar to `dgettext' but select the plural form corresponding to the
number N. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,
+ const char *__msgid2, unsigned long int __n);
+static inline char *dngettext (const char *__domainname, const char *__msgid1,
+ const char *__msgid2, unsigned long int __n)
+{
+ return libintl_dngettext (__domainname, __msgid1, __msgid2, __n);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dngettext libintl_dngettext
+#endif
extern char *dngettext _INTL_PARAMS ((const char *__domainname,
const char *__msgid1,
const char *__msgid2,
- unsigned long int __n));
+ unsigned long int __n))
+ _INTL_ASM (libintl_dngettext);
+#endif
/* Similar to `dcgettext' but select the plural form corresponding to the
number N. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_dcngettext (const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n, int __category);
+static inline char *dcngettext (const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n, int __category)
+{
+ return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define dcngettext libintl_dcngettext
+#endif
extern char *dcngettext _INTL_PARAMS ((const char *__domainname,
const char *__msgid1,
const char *__msgid2,
unsigned long int __n,
- int __category));
+ int __category))
+ _INTL_ASM (libintl_dcngettext);
+#endif
/* Set the current default message catalog to DOMAINNAME.
If DOMAINNAME is null, return the current default.
If DOMAINNAME is "", reset to the default of "messages". */
-extern char *textdomain _INTL_PARAMS ((const char *__domainname));
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_textdomain (const char *__domainname);
+static inline char *textdomain (const char *__domainname)
+{
+ return libintl_textdomain (__domainname);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define textdomain libintl_textdomain
+#endif
+extern char *textdomain _INTL_PARAMS ((const char *__domainname))
+ _INTL_ASM (libintl_textdomain);
+#endif
/* Specify that the DOMAINNAME message catalog will be found
in DIRNAME rather than in the system locale data base. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_bindtextdomain (const char *__domainname,
+ const char *__dirname);
+static inline char *bindtextdomain (const char *__domainname,
+ const char *__dirname)
+{
+ return libintl_bindtextdomain (__domainname, __dirname);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define bindtextdomain libintl_bindtextdomain
+#endif
extern char *bindtextdomain _INTL_PARAMS ((const char *__domainname,
- const char *__dirname));
+ const char *__dirname))
+ _INTL_ASM (libintl_bindtextdomain);
+#endif
/* Specify the character encoding in which the messages from the
DOMAINNAME message catalog will be returned. */
+#ifdef _INTL_REDIRECT_INLINE
+extern char *libintl_bind_textdomain_codeset (const char *__domainname,
+ const char *__codeset);
+static inline char *bind_textdomain_codeset (const char *__domainname,
+ const char *__codeset)
+{
+ return libintl_bind_textdomain_codeset (__domainname, __codeset);
+}
+#else
+#ifdef _INTL_REDIRECT_MACROS
+# define bind_textdomain_codeset libintl_bind_textdomain_codeset
+#endif
extern char *bind_textdomain_codeset _INTL_PARAMS ((const char *__domainname,
- const char *__codeset));
-
-
-/* Optimized version of the functions above. */
-#if defined __OPTIMIZED
-/* These are macros, but could also be inline functions. */
-
-# define gettext(msgid) \
- dgettext (NULL, msgid)
-
-# define dgettext(domainname, msgid) \
- dcgettext (domainname, msgid, LC_MESSAGES)
-
-# define ngettext(msgid1, msgid2, n) \
- dngettext (NULL, msgid1, msgid2, n)
-
-# define dngettext(domainname, msgid1, msgid2, n) \
- dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES)
-
-#endif /* Optimizing. */
+ const char *__codeset))
+ _INTL_ASM (libintl_bind_textdomain_codeset);
+#endif
#ifdef __cplusplus
diff --git a/intl/loadinfo.h b/intl/loadinfo.h
index d180962f..1d3ba616 100644
--- a/intl/loadinfo.h
+++ b/intl/loadinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1999, 2000-2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -92,6 +92,20 @@ struct loaded_l10nfile
extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
size_t name_len));
+/* Lookup a locale dependent file.
+ *L10NFILE_LIST denotes a pool of lookup results of locale dependent
+ files of the same kind, sorted in decreasing order of ->filename.
+ DIRLIST and DIRLIST_LEN are an argz list of directories in which to
+ look, containing at least one directory (i.e. DIRLIST_LEN > 0).
+ MASK, LANGUAGE, TERRITORY, CODESET, NORMALIZED_CODESET, MODIFIER,
+ SPECIAL, SPONSOR, REVISION are the pieces of the locale name, as
+ produced by _nl_explode_name(). FILENAME is the filename suffix.
+ The return value is the lookup result, either found in *L10NFILE_LIST,
+ or - if DO_ALLOCATE is nonzero - freshly allocated, or possibly NULL.
+ If the return value is non-NULL, it is added to *L10NFILE_LIST, and
+ its ->next field denotes the chaining inside *L10NFILE_LIST, and
+ furthermore its ->successor[] field contains a list of other lookup
+ results from which this lookup result inherits. */
extern struct loaded_l10nfile *
_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
const char *dirlist, size_t dirlist_len, int mask,
@@ -102,11 +116,29 @@ _nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
const char *sponsor, const char *revision,
const char *filename, int do_allocate));
-
+/* Lookup the real locale name for a locale alias NAME, or NULL if
+ NAME is not a locale alias (but possibly a real locale name).
+ The return value is statically allocated and must not be freed. */
extern const char *_nl_expand_alias PARAMS ((const char *name));
-/* normalized_codeset is dynamically allocated and has to be freed by
- the caller. */
+/* Split a locale name NAME into its pieces: language, modifier,
+ territory, codeset, special, sponsor, revision.
+ NAME gets destructively modified: NUL bytes are inserted here and
+ there. *LANGUAGE gets assigned NAME. Each of *MODIFIER, *TERRITORY,
+ *CODESET, *SPECIAL, *SPONSOR, *REVISION gets assigned either a
+ pointer into the old NAME string, or NULL. *NORMALIZED_CODESET
+ gets assigned the expanded *CODESET, if it is different from *CODESET;
+ this one is dynamically allocated and has to be freed by the caller.
+ The return value is a bitmask, where each bit corresponds to one
+ filled-in value:
+ XPG_MODIFIER, CEN_AUDIENCE for *MODIFIER,
+ TERRITORY for *TERRITORY,
+ XPG_CODESET for *CODESET,
+ XPG_NORM_CODESET for *NORMALIZED_CODESET,
+ CEN_SPECIAL for *SPECIAL,
+ CEN_SPONSOR for *SPONSOR,
+ CEN_REVISION for *REVISION.
+ */
extern int _nl_explode_name PARAMS ((char *name, const char **language,
const char **modifier,
const char **territory,
@@ -116,6 +148,9 @@ extern int _nl_explode_name PARAMS ((char *name, const char **language,
const char **sponsor,
const char **revision));
+/* Split a locale name NAME into a leading language part and all the
+ rest. Return a pointer to the first character after the language,
+ i.e. to the first byte of the rest. */
extern char *_nl_find_language PARAMS ((const char *name));
#endif /* loadinfo.h */
diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c
index 76130ed2..516f5211 100644
--- a/intl/loadmsgcat.c
+++ b/intl/loadmsgcat.c
@@ -1,5 +1,5 @@
/* Load needed message catalogs.
- Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
@@ -71,14 +71,380 @@ char *alloca ();
# undef HAVE_MMAP
#endif
+#if defined HAVE_STDINT_H_WITH_UINTMAX || defined _LIBC
+# include <stdint.h>
+#endif
+#if defined HAVE_INTTYPES_H || defined _LIBC
+# include <inttypes.h>
+#endif
+
#include "gmo.h"
#include "gettextP.h"
+#include "hash-string.h"
#include "plural-exp.h"
#ifdef _LIBC
# include "../locale/localeinfo.h"
#endif
+/* Provide fallback values for macros that ought to be defined in <inttypes.h>.
+ Note that our fallback values need not be literal strings, because we don't
+ use them with preprocessor string concatenation. */
+#if !defined PRId8 || PRI_MACROS_BROKEN
+# undef PRId8
+# define PRId8 "d"
+#endif
+#if !defined PRIi8 || PRI_MACROS_BROKEN
+# undef PRIi8
+# define PRIi8 "i"
+#endif
+#if !defined PRIo8 || PRI_MACROS_BROKEN
+# undef PRIo8
+# define PRIo8 "o"
+#endif
+#if !defined PRIu8 || PRI_MACROS_BROKEN
+# undef PRIu8
+# define PRIu8 "u"
+#endif
+#if !defined PRIx8 || PRI_MACROS_BROKEN
+# undef PRIx8
+# define PRIx8 "x"
+#endif
+#if !defined PRIX8 || PRI_MACROS_BROKEN
+# undef PRIX8
+# define PRIX8 "X"
+#endif
+#if !defined PRId16 || PRI_MACROS_BROKEN
+# undef PRId16
+# define PRId16 "d"
+#endif
+#if !defined PRIi16 || PRI_MACROS_BROKEN
+# undef PRIi16
+# define PRIi16 "i"
+#endif
+#if !defined PRIo16 || PRI_MACROS_BROKEN
+# undef PRIo16
+# define PRIo16 "o"
+#endif
+#if !defined PRIu16 || PRI_MACROS_BROKEN
+# undef PRIu16
+# define PRIu16 "u"
+#endif
+#if !defined PRIx16 || PRI_MACROS_BROKEN
+# undef PRIx16
+# define PRIx16 "x"
+#endif
+#if !defined PRIX16 || PRI_MACROS_BROKEN
+# undef PRIX16
+# define PRIX16 "X"
+#endif
+#if !defined PRId32 || PRI_MACROS_BROKEN
+# undef PRId32
+# define PRId32 "d"
+#endif
+#if !defined PRIi32 || PRI_MACROS_BROKEN
+# undef PRIi32
+# define PRIi32 "i"
+#endif
+#if !defined PRIo32 || PRI_MACROS_BROKEN
+# undef PRIo32
+# define PRIo32 "o"
+#endif
+#if !defined PRIu32 || PRI_MACROS_BROKEN
+# undef PRIu32
+# define PRIu32 "u"
+#endif
+#if !defined PRIx32 || PRI_MACROS_BROKEN
+# undef PRIx32
+# define PRIx32 "x"
+#endif
+#if !defined PRIX32 || PRI_MACROS_BROKEN
+# undef PRIX32
+# define PRIX32 "X"
+#endif
+#if !defined PRId64 || PRI_MACROS_BROKEN
+# undef PRId64
+# define PRId64 (sizeof (long) == 8 ? "ld" : "lld")
+#endif
+#if !defined PRIi64 || PRI_MACROS_BROKEN
+# undef PRIi64
+# define PRIi64 (sizeof (long) == 8 ? "li" : "lli")
+#endif
+#if !defined PRIo64 || PRI_MACROS_BROKEN
+# undef PRIo64
+# define PRIo64 (sizeof (long) == 8 ? "lo" : "llo")
+#endif
+#if !defined PRIu64 || PRI_MACROS_BROKEN
+# undef PRIu64
+# define PRIu64 (sizeof (long) == 8 ? "lu" : "llu")
+#endif
+#if !defined PRIx64 || PRI_MACROS_BROKEN
+# undef PRIx64
+# define PRIx64 (sizeof (long) == 8 ? "lx" : "llx")
+#endif
+#if !defined PRIX64 || PRI_MACROS_BROKEN
+# undef PRIX64
+# define PRIX64 (sizeof (long) == 8 ? "lX" : "llX")
+#endif
+#if !defined PRIdLEAST8 || PRI_MACROS_BROKEN
+# undef PRIdLEAST8
+# define PRIdLEAST8 "d"
+#endif
+#if !defined PRIiLEAST8 || PRI_MACROS_BROKEN
+# undef PRIiLEAST8
+# define PRIiLEAST8 "i"
+#endif
+#if !defined PRIoLEAST8 || PRI_MACROS_BROKEN
+# undef PRIoLEAST8
+# define PRIoLEAST8 "o"
+#endif
+#if !defined PRIuLEAST8 || PRI_MACROS_BROKEN
+# undef PRIuLEAST8
+# define PRIuLEAST8 "u"
+#endif
+#if !defined PRIxLEAST8 || PRI_MACROS_BROKEN
+# undef PRIxLEAST8
+# define PRIxLEAST8 "x"
+#endif
+#if !defined PRIXLEAST8 || PRI_MACROS_BROKEN
+# undef PRIXLEAST8
+# define PRIXLEAST8 "X"
+#endif
+#if !defined PRIdLEAST16 || PRI_MACROS_BROKEN
+# undef PRIdLEAST16
+# define PRIdLEAST16 "d"
+#endif
+#if !defined PRIiLEAST16 || PRI_MACROS_BROKEN
+# undef PRIiLEAST16
+# define PRIiLEAST16 "i"
+#endif
+#if !defined PRIoLEAST16 || PRI_MACROS_BROKEN
+# undef PRIoLEAST16
+# define PRIoLEAST16 "o"
+#endif
+#if !defined PRIuLEAST16 || PRI_MACROS_BROKEN
+# undef PRIuLEAST16
+# define PRIuLEAST16 "u"
+#endif
+#if !defined PRIxLEAST16 || PRI_MACROS_BROKEN
+# undef PRIxLEAST16
+# define PRIxLEAST16 "x"
+#endif
+#if !defined PRIXLEAST16 || PRI_MACROS_BROKEN
+# undef PRIXLEAST16
+# define PRIXLEAST16 "X"
+#endif
+#if !defined PRIdLEAST32 || PRI_MACROS_BROKEN
+# undef PRIdLEAST32
+# define PRIdLEAST32 "d"
+#endif
+#if !defined PRIiLEAST32 || PRI_MACROS_BROKEN
+# undef PRIiLEAST32
+# define PRIiLEAST32 "i"
+#endif
+#if !defined PRIoLEAST32 || PRI_MACROS_BROKEN
+# undef PRIoLEAST32
+# define PRIoLEAST32 "o"
+#endif
+#if !defined PRIuLEAST32 || PRI_MACROS_BROKEN
+# undef PRIuLEAST32
+# define PRIuLEAST32 "u"
+#endif
+#if !defined PRIxLEAST32 || PRI_MACROS_BROKEN
+# undef PRIxLEAST32
+# define PRIxLEAST32 "x"
+#endif
+#if !defined PRIXLEAST32 || PRI_MACROS_BROKEN
+# undef PRIXLEAST32
+# define PRIXLEAST32 "X"
+#endif
+#if !defined PRIdLEAST64 || PRI_MACROS_BROKEN
+# undef PRIdLEAST64
+# define PRIdLEAST64 PRId64
+#endif
+#if !defined PRIiLEAST64 || PRI_MACROS_BROKEN
+# undef PRIiLEAST64
+# define PRIiLEAST64 PRIi64
+#endif
+#if !defined PRIoLEAST64 || PRI_MACROS_BROKEN
+# undef PRIoLEAST64
+# define PRIoLEAST64 PRIo64
+#endif
+#if !defined PRIuLEAST64 || PRI_MACROS_BROKEN
+# undef PRIuLEAST64
+# define PRIuLEAST64 PRIu64
+#endif
+#if !defined PRIxLEAST64 || PRI_MACROS_BROKEN
+# undef PRIxLEAST64
+# define PRIxLEAST64 PRIx64
+#endif
+#if !defined PRIXLEAST64 || PRI_MACROS_BROKEN
+# undef PRIXLEAST64
+# define PRIXLEAST64 PRIX64
+#endif
+#if !defined PRIdFAST8 || PRI_MACROS_BROKEN
+# undef PRIdFAST8
+# define PRIdFAST8 "d"
+#endif
+#if !defined PRIiFAST8 || PRI_MACROS_BROKEN
+# undef PRIiFAST8
+# define PRIiFAST8 "i"
+#endif
+#if !defined PRIoFAST8 || PRI_MACROS_BROKEN
+# undef PRIoFAST8
+# define PRIoFAST8 "o"
+#endif
+#if !defined PRIuFAST8 || PRI_MACROS_BROKEN
+# undef PRIuFAST8
+# define PRIuFAST8 "u"
+#endif
+#if !defined PRIxFAST8 || PRI_MACROS_BROKEN
+# undef PRIxFAST8
+# define PRIxFAST8 "x"
+#endif
+#if !defined PRIXFAST8 || PRI_MACROS_BROKEN
+# undef PRIXFAST8
+# define PRIXFAST8 "X"
+#endif
+#if !defined PRIdFAST16 || PRI_MACROS_BROKEN
+# undef PRIdFAST16
+# define PRIdFAST16 "d"
+#endif
+#if !defined PRIiFAST16 || PRI_MACROS_BROKEN
+# undef PRIiFAST16
+# define PRIiFAST16 "i"
+#endif
+#if !defined PRIoFAST16 || PRI_MACROS_BROKEN
+# undef PRIoFAST16
+# define PRIoFAST16 "o"
+#endif
+#if !defined PRIuFAST16 || PRI_MACROS_BROKEN
+# undef PRIuFAST16
+# define PRIuFAST16 "u"
+#endif
+#if !defined PRIxFAST16 || PRI_MACROS_BROKEN
+# undef PRIxFAST16
+# define PRIxFAST16 "x"
+#endif
+#if !defined PRIXFAST16 || PRI_MACROS_BROKEN
+# undef PRIXFAST16
+# define PRIXFAST16 "X"
+#endif
+#if !defined PRIdFAST32 || PRI_MACROS_BROKEN
+# undef PRIdFAST32
+# define PRIdFAST32 "d"
+#endif
+#if !defined PRIiFAST32 || PRI_MACROS_BROKEN
+# undef PRIiFAST32
+# define PRIiFAST32 "i"
+#endif
+#if !defined PRIoFAST32 || PRI_MACROS_BROKEN
+# undef PRIoFAST32
+# define PRIoFAST32 "o"
+#endif
+#if !defined PRIuFAST32 || PRI_MACROS_BROKEN
+# undef PRIuFAST32
+# define PRIuFAST32 "u"
+#endif
+#if !defined PRIxFAST32 || PRI_MACROS_BROKEN
+# undef PRIxFAST32
+# define PRIxFAST32 "x"
+#endif
+#if !defined PRIXFAST32 || PRI_MACROS_BROKEN
+# undef PRIXFAST32
+# define PRIXFAST32 "X"
+#endif
+#if !defined PRIdFAST64 || PRI_MACROS_BROKEN
+# undef PRIdFAST64
+# define PRIdFAST64 PRId64
+#endif
+#if !defined PRIiFAST64 || PRI_MACROS_BROKEN
+# undef PRIiFAST64
+# define PRIiFAST64 PRIi64
+#endif
+#if !defined PRIoFAST64 || PRI_MACROS_BROKEN
+# undef PRIoFAST64
+# define PRIoFAST64 PRIo64
+#endif
+#if !defined PRIuFAST64 || PRI_MACROS_BROKEN
+# undef PRIuFAST64
+# define PRIuFAST64 PRIu64
+#endif
+#if !defined PRIxFAST64 || PRI_MACROS_BROKEN
+# undef PRIxFAST64
+# define PRIxFAST64 PRIx64
+#endif
+#if !defined PRIXFAST64 || PRI_MACROS_BROKEN
+# undef PRIXFAST64
+# define PRIXFAST64 PRIX64
+#endif
+#if !defined PRIdMAX || PRI_MACROS_BROKEN
+# undef PRIdMAX
+# define PRIdMAX (sizeof (uintmax_t) == sizeof (long) ? "ld" : "lld")
+#endif
+#if !defined PRIiMAX || PRI_MACROS_BROKEN
+# undef PRIiMAX
+# define PRIiMAX (sizeof (uintmax_t) == sizeof (long) ? "li" : "lli")
+#endif
+#if !defined PRIoMAX || PRI_MACROS_BROKEN
+# undef PRIoMAX
+# define PRIoMAX (sizeof (uintmax_t) == sizeof (long) ? "lo" : "llo")
+#endif
+#if !defined PRIuMAX || PRI_MACROS_BROKEN
+# undef PRIuMAX
+# define PRIuMAX (sizeof (uintmax_t) == sizeof (long) ? "lu" : "llu")
+#endif
+#if !defined PRIxMAX || PRI_MACROS_BROKEN
+# undef PRIxMAX
+# define PRIxMAX (sizeof (uintmax_t) == sizeof (long) ? "lx" : "llx")
+#endif
+#if !defined PRIXMAX || PRI_MACROS_BROKEN
+# undef PRIXMAX
+# define PRIXMAX (sizeof (uintmax_t) == sizeof (long) ? "lX" : "llX")
+#endif
+#if !defined PRIdPTR || PRI_MACROS_BROKEN
+# undef PRIdPTR
+# define PRIdPTR \
+ (sizeof (void *) == sizeof (long) ? "ld" : \
+ sizeof (void *) == sizeof (int) ? "d" : \
+ "lld")
+#endif
+#if !defined PRIiPTR || PRI_MACROS_BROKEN
+# undef PRIiPTR
+# define PRIiPTR \
+ (sizeof (void *) == sizeof (long) ? "li" : \
+ sizeof (void *) == sizeof (int) ? "i" : \
+ "lli")
+#endif
+#if !defined PRIoPTR || PRI_MACROS_BROKEN
+# undef PRIoPTR
+# define PRIoPTR \
+ (sizeof (void *) == sizeof (long) ? "lo" : \
+ sizeof (void *) == sizeof (int) ? "o" : \
+ "llo")
+#endif
+#if !defined PRIuPTR || PRI_MACROS_BROKEN
+# undef PRIuPTR
+# define PRIuPTR \
+ (sizeof (void *) == sizeof (long) ? "lu" : \
+ sizeof (void *) == sizeof (int) ? "u" : \
+ "llu")
+#endif
+#if !defined PRIxPTR || PRI_MACROS_BROKEN
+# undef PRIxPTR
+# define PRIxPTR \
+ (sizeof (void *) == sizeof (long) ? "lx" : \
+ sizeof (void *) == sizeof (int) ? "x" : \
+ "llx")
+#endif
+#if !defined PRIXPTR || PRI_MACROS_BROKEN
+# undef PRIXPTR
+# define PRIXPTR \
+ (sizeof (void *) == sizeof (long) ? "lX" : \
+ sizeof (void *) == sizeof (int) ? "X" : \
+ "llX")
+#endif
+
/* @@ end of prolog @@ */
#ifdef _LIBC
@@ -118,12 +484,274 @@ char *alloca ();
# define O_BINARY 0
#endif
+
+/* Prototypes for local functions. Needed to ensure compiler checking of
+ function argument counts despite of K&R C function definition syntax. */
+static const char *get_sysdep_segment_value PARAMS ((const char *name));
+
+
/* We need a sign, whether a new catalog was loaded, which can be associated
with all translations. This is important if the translations are
cached by one of GCC's features. */
int _nl_msg_cat_cntr;
+/* Expand a system dependent string segment. Return NULL if unsupported. */
+static const char *
+get_sysdep_segment_value (name)
+ const char *name;
+{
+ /* Test for an ISO C 99 section 7.8.1 format string directive.
+ Syntax:
+ P R I { d | i | o | u | x | X }
+ { { | LEAST | FAST } { 8 | 16 | 32 | 64 } | MAX | PTR } */
+ /* We don't use a table of 14 times 6 'const char *' strings here, because
+ data relocations cost startup time. */
+ if (name[0] == 'P' && name[1] == 'R' && name[2] == 'I')
+ {
+ if (name[3] == 'd' || name[3] == 'i' || name[3] == 'o' || name[3] == 'u'
+ || name[3] == 'x' || name[3] == 'X')
+ {
+ if (name[4] == '8' && name[5] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRId8;
+ if (name[3] == 'i')
+ return PRIi8;
+ if (name[3] == 'o')
+ return PRIo8;
+ if (name[3] == 'u')
+ return PRIu8;
+ if (name[3] == 'x')
+ return PRIx8;
+ if (name[3] == 'X')
+ return PRIX8;
+ abort ();
+ }
+ if (name[4] == '1' && name[5] == '6' && name[6] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRId16;
+ if (name[3] == 'i')
+ return PRIi16;
+ if (name[3] == 'o')
+ return PRIo16;
+ if (name[3] == 'u')
+ return PRIu16;
+ if (name[3] == 'x')
+ return PRIx16;
+ if (name[3] == 'X')
+ return PRIX16;
+ abort ();
+ }
+ if (name[4] == '3' && name[5] == '2' && name[6] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRId32;
+ if (name[3] == 'i')
+ return PRIi32;
+ if (name[3] == 'o')
+ return PRIo32;
+ if (name[3] == 'u')
+ return PRIu32;
+ if (name[3] == 'x')
+ return PRIx32;
+ if (name[3] == 'X')
+ return PRIX32;
+ abort ();
+ }
+ if (name[4] == '6' && name[5] == '4' && name[6] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRId64;
+ if (name[3] == 'i')
+ return PRIi64;
+ if (name[3] == 'o')
+ return PRIo64;
+ if (name[3] == 'u')
+ return PRIu64;
+ if (name[3] == 'x')
+ return PRIx64;
+ if (name[3] == 'X')
+ return PRIX64;
+ abort ();
+ }
+ if (name[4] == 'L' && name[5] == 'E' && name[6] == 'A'
+ && name[7] == 'S' && name[8] == 'T')
+ {
+ if (name[9] == '8' && name[10] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdLEAST8;
+ if (name[3] == 'i')
+ return PRIiLEAST8;
+ if (name[3] == 'o')
+ return PRIoLEAST8;
+ if (name[3] == 'u')
+ return PRIuLEAST8;
+ if (name[3] == 'x')
+ return PRIxLEAST8;
+ if (name[3] == 'X')
+ return PRIXLEAST8;
+ abort ();
+ }
+ if (name[9] == '1' && name[10] == '6' && name[11] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdLEAST16;
+ if (name[3] == 'i')
+ return PRIiLEAST16;
+ if (name[3] == 'o')
+ return PRIoLEAST16;
+ if (name[3] == 'u')
+ return PRIuLEAST16;
+ if (name[3] == 'x')
+ return PRIxLEAST16;
+ if (name[3] == 'X')
+ return PRIXLEAST16;
+ abort ();
+ }
+ if (name[9] == '3' && name[10] == '2' && name[11] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdLEAST32;
+ if (name[3] == 'i')
+ return PRIiLEAST32;
+ if (name[3] == 'o')
+ return PRIoLEAST32;
+ if (name[3] == 'u')
+ return PRIuLEAST32;
+ if (name[3] == 'x')
+ return PRIxLEAST32;
+ if (name[3] == 'X')
+ return PRIXLEAST32;
+ abort ();
+ }
+ if (name[9] == '6' && name[10] == '4' && name[11] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdLEAST64;
+ if (name[3] == 'i')
+ return PRIiLEAST64;
+ if (name[3] == 'o')
+ return PRIoLEAST64;
+ if (name[3] == 'u')
+ return PRIuLEAST64;
+ if (name[3] == 'x')
+ return PRIxLEAST64;
+ if (name[3] == 'X')
+ return PRIXLEAST64;
+ abort ();
+ }
+ }
+ if (name[4] == 'F' && name[5] == 'A' && name[6] == 'S'
+ && name[7] == 'T')
+ {
+ if (name[8] == '8' && name[9] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdFAST8;
+ if (name[3] == 'i')
+ return PRIiFAST8;
+ if (name[3] == 'o')
+ return PRIoFAST8;
+ if (name[3] == 'u')
+ return PRIuFAST8;
+ if (name[3] == 'x')
+ return PRIxFAST8;
+ if (name[3] == 'X')
+ return PRIXFAST8;
+ abort ();
+ }
+ if (name[8] == '1' && name[9] == '6' && name[10] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdFAST16;
+ if (name[3] == 'i')
+ return PRIiFAST16;
+ if (name[3] == 'o')
+ return PRIoFAST16;
+ if (name[3] == 'u')
+ return PRIuFAST16;
+ if (name[3] == 'x')
+ return PRIxFAST16;
+ if (name[3] == 'X')
+ return PRIXFAST16;
+ abort ();
+ }
+ if (name[8] == '3' && name[9] == '2' && name[10] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdFAST32;
+ if (name[3] == 'i')
+ return PRIiFAST32;
+ if (name[3] == 'o')
+ return PRIoFAST32;
+ if (name[3] == 'u')
+ return PRIuFAST32;
+ if (name[3] == 'x')
+ return PRIxFAST32;
+ if (name[3] == 'X')
+ return PRIXFAST32;
+ abort ();
+ }
+ if (name[8] == '6' && name[9] == '4' && name[10] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdFAST64;
+ if (name[3] == 'i')
+ return PRIiFAST64;
+ if (name[3] == 'o')
+ return PRIoFAST64;
+ if (name[3] == 'u')
+ return PRIuFAST64;
+ if (name[3] == 'x')
+ return PRIxFAST64;
+ if (name[3] == 'X')
+ return PRIXFAST64;
+ abort ();
+ }
+ }
+ if (name[4] == 'M' && name[5] == 'A' && name[6] == 'X'
+ && name[7] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdMAX;
+ if (name[3] == 'i')
+ return PRIiMAX;
+ if (name[3] == 'o')
+ return PRIoMAX;
+ if (name[3] == 'u')
+ return PRIuMAX;
+ if (name[3] == 'x')
+ return PRIxMAX;
+ if (name[3] == 'X')
+ return PRIXMAX;
+ abort ();
+ }
+ if (name[4] == 'P' && name[5] == 'T' && name[6] == 'R'
+ && name[7] == '\0')
+ {
+ if (name[3] == 'd')
+ return PRIdPTR;
+ if (name[3] == 'i')
+ return PRIiPTR;
+ if (name[3] == 'o')
+ return PRIoPTR;
+ if (name[3] == 'u')
+ return PRIuPTR;
+ if (name[3] == 'x')
+ return PRIxPTR;
+ if (name[3] == 'X')
+ return PRIXPTR;
+ abort ();
+ }
+ }
+ }
+ /* Other system dependent strings are not valid. */
+ return NULL;
+}
+
/* Initialize the codeset dependent parts of an opened message catalog.
Return the header entry. */
const char *
@@ -216,19 +844,23 @@ _nl_init_domain_conv (domain_file, domain, domainbinding)
we want to use transliteration. */
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \
|| _LIBICONV_VERSION >= 0x0105
- len = strlen (outcharset);
- {
- char *tmp = (char *) alloca (len + 10 + 1);
- memcpy (tmp, outcharset, len);
- memcpy (tmp + len, "//TRANSLIT", 10 + 1);
- outcharset = tmp;
- }
-# endif
- domain->conv = iconv_open (outcharset, charset);
-# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \
- || _LIBICONV_VERSION >= 0x0105
- freea (outcharset);
+ if (strchr (outcharset, '/') == NULL)
+ {
+ char *tmp;
+
+ len = strlen (outcharset);
+ tmp = (char *) alloca (len + 10 + 1);
+ memcpy (tmp, outcharset, len);
+ memcpy (tmp + len, "//TRANSLIT", 10 + 1);
+ outcharset = tmp;
+
+ domain->conv = iconv_open (outcharset, charset);
+
+ freea (outcharset);
+ }
+ else
# endif
+ domain->conv = iconv_open (outcharset, charset);
# endif
# endif
@@ -278,6 +910,7 @@ _nl_load_domain (domain_file, domainbinding)
struct mo_file_header *data = (struct mo_file_header *) -1;
int use_mmap = 0;
struct loaded_domain *domain;
+ int revision;
const char *nullentry;
domain_file->decided = 1;
@@ -385,22 +1018,257 @@ _nl_load_domain (domain_file, domainbinding)
domain->use_mmap = use_mmap;
domain->mmap_size = size;
domain->must_swap = data->magic != _MAGIC;
+ domain->malloced = NULL;
/* Fill in the information about the available tables. */
- switch (W (domain->must_swap, data->revision))
+ revision = W (domain->must_swap, data->revision);
+ /* We support only the major revision 0. */
+ switch (revision >> 16)
{
case 0:
domain->nstrings = W (domain->must_swap, data->nstrings);
- domain->orig_tab = (struct string_desc *)
+ domain->orig_tab = (const struct string_desc *)
((char *) data + W (domain->must_swap, data->orig_tab_offset));
- domain->trans_tab = (struct string_desc *)
+ domain->trans_tab = (const struct string_desc *)
((char *) data + W (domain->must_swap, data->trans_tab_offset));
domain->hash_size = W (domain->must_swap, data->hash_tab_size);
- domain->hash_tab = (nls_uint32 *)
- ((char *) data + W (domain->must_swap, data->hash_tab_offset));
+ domain->hash_tab =
+ (domain->hash_size > 2
+ ? (const nls_uint32 *)
+ ((char *) data + W (domain->must_swap, data->hash_tab_offset))
+ : NULL);
+ domain->must_swap_hash_tab = domain->must_swap;
+
+ /* Now dispatch on the minor revision. */
+ switch (revision & 0xffff)
+ {
+ case 0:
+ domain->n_sysdep_strings = 0;
+ domain->orig_sysdep_tab = NULL;
+ domain->trans_sysdep_tab = NULL;
+ break;
+ case 1:
+ default:
+ {
+ nls_uint32 n_sysdep_strings;
+
+ if (domain->hash_tab == NULL)
+ /* This is invalid. These minor revisions need a hash table. */
+ goto invalid;
+
+ n_sysdep_strings =
+ W (domain->must_swap, data->n_sysdep_strings);
+ if (n_sysdep_strings > 0)
+ {
+ nls_uint32 n_sysdep_segments;
+ const struct sysdep_segment *sysdep_segments;
+ const char **sysdep_segment_values;
+ const nls_uint32 *orig_sysdep_tab;
+ const nls_uint32 *trans_sysdep_tab;
+ size_t memneed;
+ char *mem;
+ struct sysdep_string_desc *inmem_orig_sysdep_tab;
+ struct sysdep_string_desc *inmem_trans_sysdep_tab;
+ nls_uint32 *inmem_hash_tab;
+ unsigned int i;
+
+ /* Get the values of the system dependent segments. */
+ n_sysdep_segments =
+ W (domain->must_swap, data->n_sysdep_segments);
+ sysdep_segments = (const struct sysdep_segment *)
+ ((char *) data
+ + W (domain->must_swap, data->sysdep_segments_offset));
+ sysdep_segment_values =
+ alloca (n_sysdep_segments * sizeof (const char *));
+ for (i = 0; i < n_sysdep_segments; i++)
+ {
+ const char *name =
+ (char *) data
+ + W (domain->must_swap, sysdep_segments[i].offset);
+ nls_uint32 namelen =
+ W (domain->must_swap, sysdep_segments[i].length);
+
+ if (!(namelen > 0 && name[namelen - 1] == '\0'))
+ {
+ freea (sysdep_segment_values);
+ goto invalid;
+ }
+
+ sysdep_segment_values[i] = get_sysdep_segment_value (name);
+ }
+
+ orig_sysdep_tab = (const nls_uint32 *)
+ ((char *) data
+ + W (domain->must_swap, data->orig_sysdep_tab_offset));
+ trans_sysdep_tab = (const nls_uint32 *)
+ ((char *) data
+ + W (domain->must_swap, data->trans_sysdep_tab_offset));
+
+ /* Compute the amount of additional memory needed for the
+ system dependent strings and the augmented hash table. */
+ memneed = 2 * n_sysdep_strings
+ * sizeof (struct sysdep_string_desc)
+ + domain->hash_size * sizeof (nls_uint32);
+ for (i = 0; i < 2 * n_sysdep_strings; i++)
+ {
+ const struct sysdep_string *sysdep_string =
+ (const struct sysdep_string *)
+ ((char *) data
+ + W (domain->must_swap,
+ i < n_sysdep_strings
+ ? orig_sysdep_tab[i]
+ : trans_sysdep_tab[i - n_sysdep_strings]));
+ size_t need = 0;
+ const struct segment_pair *p = sysdep_string->segments;
+
+ if (W (domain->must_swap, p->sysdepref) != SEGMENTS_END)
+ for (p = sysdep_string->segments;; p++)
+ {
+ nls_uint32 sysdepref;
+
+ need += W (domain->must_swap, p->segsize);
+
+ sysdepref = W (domain->must_swap, p->sysdepref);
+ if (sysdepref == SEGMENTS_END)
+ break;
+
+ if (sysdepref >= n_sysdep_segments)
+ {
+ /* Invalid. */
+ freea (sysdep_segment_values);
+ goto invalid;
+ }
+
+ need += strlen (sysdep_segment_values[sysdepref]);
+ }
+
+ memneed += need;
+ }
+
+ /* Allocate additional memory. */
+ mem = (char *) malloc (memneed);
+ if (mem == NULL)
+ goto invalid;
+
+ domain->malloced = mem;
+ inmem_orig_sysdep_tab = (struct sysdep_string_desc *) mem;
+ mem += n_sysdep_strings * sizeof (struct sysdep_string_desc);
+ inmem_trans_sysdep_tab = (struct sysdep_string_desc *) mem;
+ mem += n_sysdep_strings * sizeof (struct sysdep_string_desc);
+ inmem_hash_tab = (nls_uint32 *) mem;
+ mem += domain->hash_size * sizeof (nls_uint32);
+
+ /* Compute the system dependent strings. */
+ for (i = 0; i < 2 * n_sysdep_strings; i++)
+ {
+ const struct sysdep_string *sysdep_string =
+ (const struct sysdep_string *)
+ ((char *) data
+ + W (domain->must_swap,
+ i < n_sysdep_strings
+ ? orig_sysdep_tab[i]
+ : trans_sysdep_tab[i - n_sysdep_strings]));
+ const char *static_segments =
+ (char *) data
+ + W (domain->must_swap, sysdep_string->offset);
+ const struct segment_pair *p = sysdep_string->segments;
+
+ /* Concatenate the segments, and fill
+ inmem_orig_sysdep_tab[i] (for i < n_sysdep_strings) and
+ inmem_trans_sysdep_tab[i-n_sysdep_strings] (for
+ i >= n_sysdep_strings). */
+
+ if (W (domain->must_swap, p->sysdepref) == SEGMENTS_END)
+ {
+ /* Only one static segment. */
+ inmem_orig_sysdep_tab[i].length =
+ W (domain->must_swap, p->segsize);
+ inmem_orig_sysdep_tab[i].pointer = static_segments;
+ }
+ else
+ {
+ inmem_orig_sysdep_tab[i].pointer = mem;
+
+ for (p = sysdep_string->segments;; p++)
+ {
+ nls_uint32 segsize =
+ W (domain->must_swap, p->segsize);
+ nls_uint32 sysdepref =
+ W (domain->must_swap, p->sysdepref);
+ size_t n;
+
+ if (segsize > 0)
+ {
+ memcpy (mem, static_segments, segsize);
+ mem += segsize;
+ static_segments += segsize;
+ }
+
+ if (sysdepref == SEGMENTS_END)
+ break;
+
+ n = strlen (sysdep_segment_values[sysdepref]);
+ memcpy (mem, sysdep_segment_values[sysdepref], n);
+ mem += n;
+ }
+
+ inmem_orig_sysdep_tab[i].length =
+ mem - inmem_orig_sysdep_tab[i].pointer;
+ }
+ }
+
+ /* Compute the augmented hash table. */
+ for (i = 0; i < domain->hash_size; i++)
+ inmem_hash_tab[i] =
+ W (domain->must_swap_hash_tab, domain->hash_tab[i]);
+ for (i = 0; i < n_sysdep_strings; i++)
+ {
+ const char *msgid = inmem_orig_sysdep_tab[i].pointer;
+ nls_uint32 hash_val = hash_string (msgid);
+ nls_uint32 idx = hash_val % domain->hash_size;
+ nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2));
+
+ for (;;)
+ {
+ if (inmem_hash_tab[idx] == 0)
+ {
+ /* Hash table entry is empty. Use it. */
+ inmem_hash_tab[idx] = 1 + domain->nstrings + i;
+ break;
+ }
+
+ if (idx >= domain->hash_size - incr)
+ idx -= domain->hash_size - incr;
+ else
+ idx += incr;
+ }
+ }
+
+ freea (sysdep_segment_values);
+
+ domain->n_sysdep_strings = n_sysdep_strings;
+ domain->orig_sysdep_tab = inmem_orig_sysdep_tab;
+ domain->trans_sysdep_tab = inmem_trans_sysdep_tab;
+
+ domain->hash_tab = inmem_hash_tab;
+ domain->must_swap_hash_tab = 0;
+ }
+ else
+ {
+ domain->n_sysdep_strings = 0;
+ domain->orig_sysdep_tab = NULL;
+ domain->trans_sysdep_tab = NULL;
+ }
+ }
+ break;
+ }
break;
default:
/* This is an invalid revision. */
+ invalid:
+ /* This is an invalid .mo file. */
+ if (domain->malloced)
+ free (domain->malloced);
#ifdef HAVE_MMAP
if (use_mmap)
munmap ((caddr_t) data, size);
@@ -433,6 +1301,9 @@ _nl_unload_domain (domain)
_nl_free_domain_conv (domain);
+ if (domain->malloced)
+ free (domain->malloced);
+
# ifdef _POSIX_MAPPED_FILES
if (domain->use_mmap)
munmap ((caddr_t) domain->data, domain->mmap_size);
diff --git a/intl/localcharset.c b/intl/localcharset.c
index bc5587bf..2b1564e2 100644
--- a/intl/localcharset.c
+++ b/intl/localcharset.c
@@ -17,7 +17,7 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
-/* Written by Bruno Haible <haible@clisp.cons.org>. */
+/* Written by Bruno Haible <bruno@clisp.org>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -82,6 +82,11 @@
# define getc getc_unlocked
#endif
+#ifdef __cplusplus
+/* When compiling with "gcc -x c++", produce a function with C linkage. */
+extern "C" const char * locale_charset (void);
+#endif
+
/* The following static variable is declared 'volatile' to avoid a
possible multithread problem in the function get_charset_aliases. If we
are running in a threaded environment, and if two threads initialize
@@ -201,7 +206,20 @@ get_charset_aliases ()
# if defined WIN32
cp = "CP936" "\0" "GBK" "\0"
- "CP1361" "\0" "JOHAB" "\0";
+ "CP1361" "\0" "JOHAB" "\0"
+ "CP20127" "\0" "ASCII" "\0"
+ "CP20866" "\0" "KOI8-R" "\0"
+ "CP21866" "\0" "KOI8-RU" "\0"
+ "CP28591" "\0" "ISO-8859-1" "\0"
+ "CP28592" "\0" "ISO-8859-2" "\0"
+ "CP28593" "\0" "ISO-8859-3" "\0"
+ "CP28594" "\0" "ISO-8859-4" "\0"
+ "CP28595" "\0" "ISO-8859-5" "\0"
+ "CP28596" "\0" "ISO-8859-6" "\0"
+ "CP28597" "\0" "ISO-8859-7" "\0"
+ "CP28598" "\0" "ISO-8859-8" "\0"
+ "CP28599" "\0" "ISO-8859-9" "\0"
+ "CP28605" "\0" "ISO-8859-15" "\0";
# endif
#endif
@@ -267,7 +285,7 @@ locale_charset ()
static char buf[2 + 10 + 1];
- /* Win32 has a function returning the locale's codepage as a number. */
+ /* Woe32 has a function returning the locale's codepage as a number. */
sprintf (buf, "CP%u", GetACP ());
codeset = buf;
@@ -341,5 +359,11 @@ locale_charset ()
break;
}
+ /* Don't return an empty string. GNU libc and GNU libiconv interpret
+ the empty string as denoting "the locale's character encoding",
+ thus GNU libiconv would call this function a second time. */
+ if (codeset[0] == '\0')
+ codeset = "ASCII";
+
return codeset;
}
diff --git a/intl/localename.c b/intl/localename.c
index a7241981..faacecd5 100644
--- a/intl/localename.c
+++ b/intl/localename.c
@@ -65,6 +65,9 @@
# ifndef LANG_CATALAN
# define LANG_CATALAN 0x03
# endif
+# ifndef LANG_DIVEHI
+# define LANG_DIVEHI 0x65
+# endif
# ifndef LANG_ESTONIAN
# define LANG_ESTONIAN 0x25
# endif
@@ -74,6 +77,9 @@
# ifndef LANG_FARSI
# define LANG_FARSI 0x29
# endif
+# ifndef LANG_GALICIAN
+# define LANG_GALICIAN 0x56
+# endif
# ifndef LANG_GEORGIAN
# define LANG_GEORGIAN 0x37
# endif
@@ -101,6 +107,9 @@
# ifndef LANG_KONKANI
# define LANG_KONKANI 0x57
# endif
+# ifndef LANG_KYRGYZ
+# define LANG_KYRGYZ 0x40
+# endif
# ifndef LANG_LATVIAN
# define LANG_LATVIAN 0x26
# endif
@@ -122,6 +131,9 @@
# ifndef LANG_MARATHI
# define LANG_MARATHI 0x4e
# endif
+# ifndef LANG_MONGOLIAN
+# define LANG_MONGOLIAN 0x50
+# endif
# ifndef LANG_NEPALI
# define LANG_NEPALI 0x61
# endif
@@ -143,9 +155,15 @@
# ifndef LANG_SLOVAK
# define LANG_SLOVAK 0x1b
# endif
+# ifndef LANG_SORBIAN
+# define LANG_SORBIAN 0x2e
+# endif
# ifndef LANG_SWAHILI
# define LANG_SWAHILI 0x41
# endif
+# ifndef LANG_SYRIAC
+# define LANG_SYRIAC 0x5a
+# endif
# ifndef LANG_TAMIL
# define LANG_TAMIL 0x49
# endif
@@ -428,10 +446,15 @@ _nl_locale_name (category, categoryname)
/* Split into language and territory part. */
primary = PRIMARYLANGID (langid);
sub = SUBLANGID (langid);
+
+ /* Dispatch on language.
+ See also http://www.unicode.org/unicode/onlinedat/languages.html .
+ For details about languages, see http://www.ethnologue.com/ . */
switch (primary)
{
case LANG_AFRIKAANS: return "af_ZA";
case LANG_ALBANIAN: return "sq_AL";
+ case 0x5e: /* AMHARIC */ return "am_ET";
case LANG_ARABIC:
switch (sub)
{
@@ -468,7 +491,10 @@ _nl_locale_name (category, categoryname)
case LANG_BELARUSIAN: return "be_BY";
case LANG_BENGALI: return "bn_IN";
case LANG_BULGARIAN: return "bg_BG";
+ case 0x55: /* BURMESE */ return "my_MM";
+ case 0x53: /* CAMBODIAN */ return "km_KH";
case LANG_CATALAN: return "ca_ES";
+ case 0x5c: /* CHEROKEE */ return "chr_US";
case LANG_CHINESE:
switch (sub)
{
@@ -489,20 +515,22 @@ _nl_locale_name (category, categoryname)
*/
switch (sub)
{
- /* FIXME: How to distinguish Croatian and Latin Serbian locales? */
+ case SUBLANG_DEFAULT: return "hr_HR";
case SUBLANG_SERBIAN_LATIN: return "sr_YU";
case SUBLANG_SERBIAN_CYRILLIC: return "sr_YU@cyrillic";
- default: return "hr_HR";
}
+ return "hr";
case LANG_CZECH: return "cs_CZ";
case LANG_DANISH: return "da_DK";
+ case LANG_DIVEHI: return "div_MV";
case LANG_DUTCH:
switch (sub)
{
case SUBLANG_DUTCH: return "nl_NL";
- case SUBLANG_DUTCH_BELGIAN: return "nl_BE";
+ case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE";
}
return "nl";
+ case 0x66: /* EDO */ return "bin_NG";
case LANG_ENGLISH:
switch (sub)
{
@@ -533,13 +561,23 @@ _nl_locale_name (category, categoryname)
switch (sub)
{
case SUBLANG_FRENCH: return "fr_FR";
- case SUBLANG_FRENCH_BELGIAN: return "fr_BE";
+ case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE";
case SUBLANG_FRENCH_CANADIAN: return "fr_CA";
case SUBLANG_FRENCH_SWISS: return "fr_CH";
case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU";
case SUBLANG_FRENCH_MONACO: return "fr_MC";
}
return "fr";
+ case 0x62: /* FRISIAN */ return "fy_NL";
+ case 0x67: /* FULFULDE */ return "ful_NG";
+ case 0x3c: /* GAELIC */
+ switch (sub)
+ {
+ case 0x01: /* SCOTTISH */ return "gd_GB";
+ case 0x02: /* IRISH */ return "ga_IE";
+ }
+ return "C";
+ case LANG_GALICIAN: return "gl_ES";
case LANG_GEORGIAN: return "ka_GE";
case LANG_GERMAN:
switch (sub)
@@ -552,12 +590,21 @@ _nl_locale_name (category, categoryname)
}
return "de";
case LANG_GREEK: return "el_GR";
+ case 0x74: /* GUARANI */ return "gn_PY";
case LANG_GUJARATI: return "gu_IN";
+ case 0x68: /* HAUSA */ return "ha_NG";
+ case 0x75: /* HAWAIIAN */
+ /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers)
+ or Hawaii Creole English ("cpe_US", 600000 speakers)? */
+ return "cpe_US";
case LANG_HEBREW: return "he_IL";
case LANG_HINDI: return "hi_IN";
case LANG_HUNGARIAN: return "hu_HU";
+ case 0x69: /* IBIBIO */ return "nic_NG";
case LANG_ICELANDIC: return "is_IS";
+ case 0x70: /* IGBO */ return "ibo_NG";
case LANG_INDONESIAN: return "id_ID";
+ case 0x5d: /* INUKTITUT */ return "iu_CA";
case LANG_ITALIAN:
switch (sub)
{
@@ -567,6 +614,7 @@ _nl_locale_name (category, categoryname)
return "it";
case LANG_JAPANESE: return "ja_JP";
case LANG_KANNADA: return "kn_IN";
+ case 0x71: /* KANURI */ return "kau_NG";
case LANG_KASHMIRI:
switch (sub)
{
@@ -579,6 +627,9 @@ _nl_locale_name (category, categoryname)
/* FIXME: Adjust this when such locales appear on Unix. */
return "kok_IN";
case LANG_KOREAN: return "ko_KR";
+ case LANG_KYRGYZ: return "ky_KG";
+ case 0x54: /* LAO */ return "lo_LA";
+ case 0x76: /* LATIN */ return "la_VA";
case LANG_LATVIAN: return "lv_LV";
case LANG_LITHUANIAN: return "lt_LT";
case LANG_MACEDONIAN: return "mk_MK";
@@ -590,10 +641,13 @@ _nl_locale_name (category, categoryname)
}
return "ms";
case LANG_MALAYALAM: return "ml_IN";
+ case 0x3a: /* MALTESE */ return "mt_MT";
case LANG_MANIPURI:
/* FIXME: Adjust this when such locales appear on Unix. */
return "mni_IN";
case LANG_MARATHI: return "mr_IN";
+ case LANG_MONGOLIAN:
+ return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN". */
case LANG_NEPALI:
switch (sub)
{
@@ -609,6 +663,10 @@ _nl_locale_name (category, categoryname)
}
return "no";
case LANG_ORIYA: return "or_IN";
+ case 0x72: /* OROMO */ return "om_ET";
+ case 0x79: /* PAPIAMENTU */ return "pap_AN";
+ case 0x63: /* PASHTO */
+ return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF". */
case LANG_POLISH: return "pl_PL";
case LANG_PORTUGUESE:
switch (sub)
@@ -620,13 +678,17 @@ _nl_locale_name (category, categoryname)
}
return "pt";
case LANG_PUNJABI: return "pa_IN";
+ case 0x17: /* RHAETO-ROMANCE */ return "rm_CH";
case LANG_ROMANIAN: return "ro_RO";
case LANG_RUSSIAN:
return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA". */
+ case 0x3b: /* SAMI */ return "se_NO";
case LANG_SANSKRIT: return "sa_IN";
case LANG_SINDHI: return "sd";
+ case 0x5b: /* SINHALESE */ return "si_LK";
case LANG_SLOVAK: return "sk_SK";
case LANG_SLOVENIAN: return "sl_SI";
+ case 0x77: /* SOMALI */ return "so_SO";
case LANG_SORBIAN:
/* FIXME: Adjust this when such locales appear on Unix. */
return "wen_DE";
@@ -656,7 +718,8 @@ _nl_locale_name (category, categoryname)
case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR";
}
return "es";
- case LANG_SWAHILI: return "sw";
+ case 0x30: /* SUTU */ return "bnt_TZ";
+ case LANG_SWAHILI: return "sw_KE";
case LANG_SWEDISH:
switch (sub)
{
@@ -664,12 +727,20 @@ _nl_locale_name (category, categoryname)
case SUBLANG_SWEDISH_FINLAND: return "sv_FI";
}
return "sv";
+ case LANG_SYRIAC: return "syr_TR"; /* An extinct language. */
+ case 0x64: /* TAGALOG */ return "tl_PH";
+ case 0x28: /* TAJIK */ return "tg_TJ";
+ case 0x5f: /* TAMAZIGHT */ return "ber_MA";
case LANG_TAMIL:
return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */
- case LANG_TATAR: return "tt";
+ case LANG_TATAR: return "tt_RU";
case LANG_TELUGU: return "te_IN";
case LANG_THAI: return "th_TH";
+ case 0x51: /* TIBETAN */ return "bo_CN";
+ case 0x73: /* TIGRINYA */ return "ti_ET";
+ case 0x31: /* TSONGA */ return "ts_ZA";
case LANG_TURKISH: return "tr_TR";
+ case 0x42: /* TURKMEN */ return "tk_TM";
case LANG_UKRAINIAN: return "uk_UA";
case LANG_URDU:
switch (sub)
@@ -686,7 +757,14 @@ _nl_locale_name (category, categoryname)
case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic";
}
return "uz";
+ case 0x33: /* VENDA */ return "ven_ZA";
case LANG_VIETNAMESE: return "vi_VN";
+ case 0x52: /* WELSH */ return "cy_GB";
+ case 0x34: /* XHOSA */ return "xh_ZA";
+ case 0x78: /* YI */ return "sit_CN";
+ case 0x3d: /* YIDDISH */ return "yi_IL";
+ case 0x6a: /* YORUBA */ return "yo_NG";
+ case 0x35: /* ZULU */ return "zu_ZA";
default: return "C";
}
diff --git a/intl/ngettext.c b/intl/ngettext.c
index b42ff6a1..69fe1f74 100644
--- a/intl/ngettext.c
+++ b/intl/ngettext.c
@@ -46,8 +46,8 @@
# define NGETTEXT __ngettext
# define DCNGETTEXT INTUSE(__dcngettext)
#else
-# define NGETTEXT ngettext__
-# define DCNGETTEXT dcngettext__
+# define NGETTEXT libintl_ngettext
+# define DCNGETTEXT libintl_dcngettext
#endif
/* Look up MSGID in the current default message catalog for the current
diff --git a/intl/os2compat.c b/intl/os2compat.c
index 3ca82666..c8dc33e7 100644
--- a/intl/os2compat.c
+++ b/intl/os2compat.c
@@ -39,7 +39,7 @@ _nl_getenv (const char *name)
}
/* A fixed size buffer. */
-char _nl_default_dirname__[MAXPATHLEN+1];
+char libintl_nl_default_dirname[MAXPATHLEN+1];
char *_nlos2_libdir = NULL;
char *_nlos2_localealiaspath = NULL;
@@ -94,5 +94,5 @@ nlos2_initialize ()
}
if (strlen (_nlos2_localedir) <= MAXPATHLEN)
- strcpy (_nl_default_dirname__, _nlos2_localedir);
+ strcpy (libintl_nl_default_dirname, _nlos2_localedir);
}
diff --git a/intl/plural-exp.h b/intl/plural-exp.h
index 93cdaef5..9e5d1658 100644
--- a/intl/plural-exp.h
+++ b/intl/plural-exp.h
@@ -98,10 +98,10 @@ struct parse_args
# define GERMANIC_PLURAL __gettext_germanic_plural
# define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural
#elif defined (IN_LIBINTL)
-# define FREE_EXPRESSION gettext_free_exp__
-# define PLURAL_PARSE gettextparse__
-# define GERMANIC_PLURAL gettext_germanic_plural__
-# define EXTRACT_PLURAL_EXPRESSION gettext_extract_plural__
+# define FREE_EXPRESSION libintl_gettext_free_exp
+# define PLURAL_PARSE libintl_gettextparse
+# define GERMANIC_PLURAL libintl_gettext_germanic_plural
+# define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural
#else
# define FREE_EXPRESSION free_plural_expression
# define PLURAL_PARSE parse_plural_expression
diff --git a/intl/textdomain.c b/intl/textdomain.c
index 8fb4ea08..f259c696 100644
--- a/intl/textdomain.c
+++ b/intl/textdomain.c
@@ -44,8 +44,8 @@
names than the internal variables in GNU libc, otherwise programs
using libintl.a cannot be linked statically. */
#if !defined _LIBC
-# define _nl_default_default_domain _nl_default_default_domain__
-# define _nl_current_default_domain _nl_current_default_domain__
+# define _nl_default_default_domain libintl_nl_default_default_domain
+# define _nl_current_default_domain libintl_nl_current_default_domain
#endif
/* @@ end of prolog @@ */
@@ -67,7 +67,7 @@ extern const char *_nl_current_default_domain attribute_hidden;
# define strdup(str) __strdup (str)
# endif
#else
-# define TEXTDOMAIN textdomain__
+# define TEXTDOMAIN libintl_textdomain
#endif
/* Lock variable to protect the global data in the gettext implementation. */
diff --git a/io.c b/io.c
index bfd0b9bd..298873cb 100644
--- a/io.c
+++ b/io.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1976, 1988, 1989, 1991-2002 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.
@@ -30,10 +30,6 @@
#include <sys/param.h>
#endif /* HAVE_SYS_PARAM_H */
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif /* HAVE_SYS_WAIT_H */
-
#ifndef O_RDONLY
#include <fcntl.h>
#endif
@@ -41,6 +37,13 @@
#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
#endif
+#ifdef HAVE_TERMIOS_H
+#include <termios.h>
+#endif
+#ifdef HAVE_STROPTS_H
+#include <stropts.h>
+#endif
+
#ifdef HAVE_SOCKETS
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
@@ -88,6 +91,12 @@ enum inet_prot { INET_NONE, INET_TCP, INET_UDP, INET_RAW };
#include <stddef.h>
#endif
+#if defined(GAWK_AIX)
+#undef TANDEM /* AIX defines this in one of its header files */
+#undef MSDOS /* For good measure, */
+#undef WIN32 /* yes, I'm paranoid */
+#endif
+
#if defined(MSDOS) || defined(WIN32) || defined(TANDEM)
#define PIPES_SIMULATED
#endif
@@ -103,18 +112,24 @@ static int close_redir P((struct redirect *rp, int exitwarn, two_way_close_type
#ifndef PIPES_SIMULATED
static int wait_any P((int interesting));
#endif
-static IOBUF *gawk_popen P((char *cmd, struct redirect *rp));
+static IOBUF *gawk_popen P((const char *cmd, struct redirect *rp));
static IOBUF *iop_open P((const char *file, const char *how, IOBUF *buf));
static IOBUF *iop_alloc P((int fd, const char *name, IOBUF *buf));
static int gawk_pclose P((struct redirect *rp));
static int do_pathopen P((const char *file));
-static int get_a_record P((char **out, IOBUF *iop, int rs, Regexp *RSre, int *errcode));
static int str2mode P((const char *mode));
static void spec_setup P((IOBUF *iop, int len, int allocate));
static int specfdopen P((IOBUF *iop, const char *name, const char *mode));
static int pidopen P((IOBUF *iop, const char *name, const char *mode));
static int useropen P((IOBUF *iop, const char *name, const char *mode));
-static int two_way_open P((char *str, struct redirect *rp));
+static int two_way_open P((const char *str, struct redirect *rp));
+static int pty_vs_pipe P((const char *command));
+
+static int rs1_get_a_record P((char **out, IOBUF *iop, int rs, Regexp *RSre, int *errcode));
+static int rsnull_get_a_record P((char **out, IOBUF *iop, int rs, Regexp *RSre, int *errcode));
+static int rsre_get_a_record P((char **out, IOBUF *iop, int rs, Regexp *RSre, int *errcode));
+
+static int (*get_a_record)P((char **out, IOBUF *iop, int rs, Regexp *RSre, int *errcode)) = rs1_get_a_record;
#if defined(HAVE_POPEN_H)
#include "popen.h"
@@ -122,6 +137,8 @@ static int two_way_open P((char *str, struct redirect *rp));
static struct redirect *red_head = NULL;
static NODE *RS;
+static Regexp *RS_re_yes_case;
+static Regexp *RS_re_no_case;
static Regexp *RS_regexp;
int RS_is_null;
@@ -135,9 +152,9 @@ extern NODE **fields_arr;
static jmp_buf filebuf; /* for do_nextfile() */
-#if defined(MSDOS) || defined(OS2) || defined(__EMX__)
+#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__EMX__)
static const char *
-binmode(char *mode)
+binmode(const char *mode)
{
switch (mode[0]) {
case 'r':
@@ -193,7 +210,7 @@ nextfile(int skipping)
return NULL;
}
if (curfile != NULL) {
- if (curfile->cnt == EOF) {
+ if ((curfile->flag & IOP_AT_EOF) != 0 && curfile->off >= curfile->dataend) {
(void) iop_close(curfile);
curfile = NULL;
} else
@@ -208,7 +225,7 @@ nextfile(int skipping)
unref(ARGIND_node->var_value);
ARGIND_node->var_value = make_number((AWKNUM) i);
}
- if (! arg_assign(arg->stptr)) {
+ if (! arg_assign(arg->stptr, FALSE)) {
files++;
fname = arg->stptr;
curfile = iop_open(fname, binmode("r"), &mybuf);
@@ -268,15 +285,20 @@ inrec(IOBUF *iop)
register int cnt;
int retval = 0;
- if ((cnt = iop->cnt) != EOF)
+ if ((iop->flag & IOP_AT_EOF) != 0 && iop->off >= iop->dataend)
+ cnt = EOF;
+ else if ((iop->flag & IOP_CLOSED) != 0)
+ cnt = EOF;
+ else
cnt = get_a_record(&begin, iop, RS->stptr[0], RS_regexp, NULL);
+
if (cnt == EOF) {
cnt = 0;
retval = 1;
} else {
NR += 1;
FNR += 1;
- set_record(begin, cnt, TRUE);
+ set_record(begin, cnt);
}
return retval;
@@ -293,6 +315,9 @@ iop_close(IOBUF *iop)
return 0;
errno = 0;
+ iop->flag &= ~IOP_AT_EOF;
+ iop->flag |= IOP_CLOSED; /* there may be dangling pointers */
+ iop->dataend = NULL;
#ifdef _CRAY
/* Work around bug in UNICOS popen */
if (iop->fd < 3)
@@ -303,8 +328,7 @@ iop_close(IOBUF *iop)
if ((iop->flag & IOP_IS_INTERNAL) != 0) {
iop->off = iop->buf;
iop->end = iop->buf + strlen(iop->buf);
- iop->cnt = 0;
- iop->secsiz = 0;
+ iop->count = 0;
return 0;
}
@@ -327,16 +351,25 @@ iop_close(IOBUF *iop)
*/
if (iop->buf) {
if ((fields_arr[0]->stptr >= iop->buf)
- && (fields_arr[0]->stptr < (iop->buf + iop->secsiz + iop->size))) {
+ && (fields_arr[0]->stptr < (iop->buf + iop->size))) {
NODE *t;
t = make_string(fields_arr[0]->stptr,
fields_arr[0]->stlen);
unref(fields_arr[0]);
fields_arr[0] = t;
- reset_record();
+ /*
+ * 1/27/2003: This used to be here:
+ *
+ * reset_record();
+ *
+ * Don't do that; reset_record() throws away all fields,
+ * saves FS etc. We just need to make sure memory isn't
+ * corrupted and that references to $0 and fields work.
+ */
}
free(iop->buf);
+ iop->buf = NULL;
}
if ((iop->flag & IOP_NOFREE_OBJ) == 0)
free((char *) iop);
@@ -351,13 +384,29 @@ do_input()
{
IOBUF *iop;
extern int exiting;
+ int rval1, rval2, rval3;
(void) setjmp(filebuf); /* for `nextfile' */
while ((iop = nextfile(FALSE)) != NULL) {
+ /*
+ * This was:
if (inrec(iop) == 0)
while (interpret(expression_value) && inrec(iop) == 0)
continue;
+ * Now expand it out for ease of debugging.
+ */
+ rval1 = inrec(iop);
+ if (rval1 == 0) {
+ for (;;) {
+ rval2 = rval3 = -1; /* for debugging */
+ rval2 = interpret(expression_value);
+ if (rval2 != 0)
+ rval3 = inrec(iop);
+ if (rval2 == 0 || rval3 != 0)
+ break;
+ }
+ }
if (exiting)
break;
}
@@ -365,10 +414,10 @@ do_input()
/* redflags2str --- turn redirection flags into a string, for debugging */
-char *
+const char *
redflags2str(int flags)
{
- static struct flagtab redtab[] = {
+ static const struct flagtab redtab[] = {
{ RED_FILE, "RED_FILE" },
{ RED_PIPE, "RED_PIPE" },
{ RED_READ, "RED_READ" },
@@ -377,6 +426,7 @@ redflags2str(int flags)
{ RED_NOBUF, "RED_NOBUF" },
{ RED_EOF, "RED_EOF" },
{ RED_TWOWAY, "RED_TWOWAY" },
+ { RED_PTY, "RED_PTY" },
{ RED_SOCKET, "RED_SOCKET" },
{ RED_TCP, "RED_TCP" },
{ 0, NULL }
@@ -434,7 +484,7 @@ redirect(NODE *tree, int *errflg)
break;
}
tmp = tree_eval(tree->subnode);
- if (do_lint && (tmp->flags & STR) == 0)
+ if (do_lint && (tmp->flags & STRCUR) == 0)
lintwarn(_("expression in `%s' redirection only has numeric value"),
what);
tmp = force_string(tmp);
@@ -459,12 +509,12 @@ redirect(NODE *tree, int *errflg)
for (rp = red_head; rp != NULL; rp = rp->next) {
if (strlen(rp->value) == tmp->stlen
&& STREQN(rp->value, str, tmp->stlen)
- && ((rp->flag & ~(RED_NOBUF|RED_EOF)) == tflag
+ && ((rp->flag & ~(RED_NOBUF|RED_EOF|RED_PTY)) == tflag
|| (outflag != 0
&& (rp->flag & (RED_FILE|RED_WRITE)) == outflag))) {
- int rpflag = (rp->flag & ~(RED_NOBUF|RED_EOF));
- int newflag = (tflag & ~(RED_NOBUF|RED_EOF));
+ int rpflag = (rp->flag & ~(RED_NOBUF|RED_EOF|RED_PTY));
+ int newflag = (tflag & ~(RED_NOBUF|RED_EOF|RED_PTY));
if (do_lint && rpflag != newflag)
lintwarn(
@@ -538,7 +588,7 @@ redirect(NODE *tree, int *errflg)
break;
case Node_redirect_twoway:
direction = "to/from";
- if (!two_way_open(str, rp)) {
+ if (! two_way_open(str, rp)) {
#ifdef HAVE_SOCKETS
/* multiple messages make life easier for translators */
if (STREQN(str, "/inet/", 6))
@@ -572,8 +622,8 @@ redirect(NODE *tree, int *errflg)
rp->fp = fdopen(fd, binmode("a"));
else
#endif
- rp->fp = fdopen(fd, (char *) mode);
- rp->mode = (char *) mode;
+ rp->fp = fdopen(fd, (const char *) mode);
+ rp->mode = (const char *) mode;
/* don't leak file descriptors */
if (rp->fp == NULL)
close(fd);
@@ -641,7 +691,7 @@ redirect(NODE *tree, int *errflg)
/* getredirect --- find the struct redirect for this file or pipe */
struct redirect *
-getredirect(char *str, int len)
+getredirect(const char *str, int len)
{
struct redirect *rp;
@@ -762,6 +812,11 @@ close_redir(register struct redirect *rp, int exitwarn, two_way_close_type how)
if ((rp->flag & RED_TCP) != 0)
(void) shutdown(fileno(rp->fp), SHUT_WR);
#endif /* HAVE_SOCKETS */
+
+ if ((rp->flag & RED_PTY) != 0) {
+ fwrite("\004\n", sizeof("\004\n") - 1, 1, rp->fp);
+ fflush(rp->fp);
+ }
status = fclose(rp->fp);
rp->fp = NULL;
}
@@ -974,8 +1029,8 @@ str2mode(const char *mode)
#ifdef HAVE_SOCKETS
/* socketopen --- open a socket and set it into connected state */
-int
-socketopen(enum inet_prot type, int localport, int remoteport, char *remotehostname)
+static int
+socketopen(enum inet_prot type, int localport, int remoteport, const char *remotehostname)
{
struct hostent *hp = gethostbyname(remotehostname);
struct sockaddr_in local_addr, remote_addr;
@@ -1278,8 +1333,7 @@ spec_setup(IOBUF *iop, int len, int allocate)
iop->buf[len] = '\0'; /* just in case */
}
iop->off = iop->buf;
- iop->cnt = 0;
- iop->secsiz = 0;
+ iop->count = 0;
iop->size = len;
iop->end = iop->buf + len;
iop->fd = -1;
@@ -1318,7 +1372,7 @@ specfdopen(IOBUF *iop, const char *name, const char *mode)
/* pidopen --- "open" /dev/pid, /dev/ppid, and /dev/pgrpid */
static int
-pidopen(IOBUF *iop, const char *name, const char *mode)
+pidopen(IOBUF *iop, const char *name, const char *mode ATTRIBUTE_UNUSED)
{
char tbuf[BUFSIZ];
int i;
@@ -1351,7 +1405,7 @@ pidopen(IOBUF *iop, const char *name, const char *mode)
*/
static int
-useropen(IOBUF *iop, const char *name, const char *mode)
+useropen(IOBUF *iop, const char *name ATTRIBUTE_UNUSED, const char *mode ATTRIBUTE_UNUSED)
{
char tbuf[BUFSIZ], *cp;
int i;
@@ -1446,8 +1500,10 @@ strictopen:
/* two_way_open --- open a two way communications channel */
static int
-two_way_open(char *str, struct redirect *rp)
+two_way_open(const char *str, struct redirect *rp)
{
+ static int no_ptys = FALSE;
+
#ifdef HAVE_SOCKETS
/* case 1: socket */
if (STREQN(str, "/inet/", 6)) {
@@ -1506,8 +1562,210 @@ two_way_open(char *str, struct redirect *rp)
}
#endif /* HAVE_PORTALS */
+#ifdef HAVE_TERMIOS_H
+ /* case 2: use ptys for two-way communications to child */
+ if (! no_ptys && pty_vs_pipe(str)) {
+ static int initialized = FALSE;
+ static char first_pty_letter;
+#ifdef HAVE_GRANTPT
+ static int have_dev_ptmx;
+#endif
+ char slavenam[32];
+ char c;
+ int master, dup_master;
+ int slave;
+ int save_errno;
+ pid_t pid;
+ struct stat statb;
+ struct termios st;
+
+ if (! initialized) {
+ initialized = TRUE;
+#ifdef HAVE_GRANTPT
+ have_dev_ptmx = (stat("/dev/ptmx", &statb) >= 0);
+#endif
+ c = 'p';
+ do {
+ sprintf(slavenam, "/dev/pty%c0", c);
+ if (stat(slavenam, &statb) >= 0) {
+ first_pty_letter = c;
+ break;
+ }
+ if (++c > 'z')
+ c = 'a';
+ } while (c != 'p');
+ }
+
+#ifdef HAVE_GRANTPT
+ if (have_dev_ptmx) {
+ master = open("/dev/ptmx", O_RDWR);
+ if (master >= 0) {
+ char *tem;
+
+ grantpt(master);
+ unlockpt(master);
+ tem = ptsname(master);
+ if (tem != NULL) {
+ strcpy(slavenam, tem);
+ goto got_the_pty;
+ }
+ (void) close(master);
+ }
+ }
+#endif
+
+ if (first_pty_letter) {
+ /*
+ * Assume /dev/ptyXNN and /dev/ttyXN naming system.
+ * The FIRST_PTY_LETTER gives the first X to try. We try in the
+ * sequence FIRST_PTY_LETTER, .., 'z', 'a', .., FIRST_PTY_LETTER.
+ * Is this worthwhile, or just over-zealous?
+ */
+ c = first_pty_letter;
+ do {
+ int i;
+ for (i = 0; i < 16; i++) {
+ sprintf(slavenam, "/dev/pty%c%x", c, i);
+ if (stat(slavenam, &statb) < 0) {
+ no_ptys = TRUE; /* bypass all this next time */
+ goto use_pipes;
+ }
+
+ if ((master = open(slavenam, O_RDWR)) >= 0) {
+ slavenam[sizeof("/dev/") - 1] = 't';
+ if (access(slavenam, R_OK | W_OK) == 0)
+ goto got_the_pty;
+ close(master);
+ }
+ }
+ if (++c > 'z')
+ c = 'a';
+ } while (c != first_pty_letter);
+ } else
+ no_ptys = TRUE;
+
+ /* Couldn't find a pty. Fall back to using pipes. */
+ goto use_pipes;
+
+ got_the_pty:
+ if ((slave = open(slavenam, O_RDWR)) < 0) {
+ fatal(_("could not open `%s', mode `%s'"),
+ slavenam, "r+");
+ }
+
+#ifdef I_PUSH
+ /*
+ * Push the necessary modules onto the slave to
+ * get terminal semantics.
+ */
+ ioctl(slave, I_PUSH, "ptem");
+ ioctl(slave, I_PUSH, "ldterm");
+#endif
+
+#ifdef TIOCSCTTY
+ ioctl(slave, TIOCSCTTY, 0);
+#endif
+ tcgetattr(slave, &st);
+ st.c_iflag &= ~(ISTRIP | IGNCR | INLCR | IXOFF);
+ st.c_iflag |= (ICRNL | IGNPAR | BRKINT | IXON);
+ st.c_oflag &= ~OPOST;
+ st.c_cflag &= ~CSIZE;
+ st.c_cflag |= CREAD | CS8 | CLOCAL;
+ st.c_lflag &= ~(ECHO | ECHOE | ECHOK | NOFLSH | TOSTOP);
+ st.c_lflag |= ISIG;
+#if 0
+ st.c_cc[VMIN] = 1;
+ st.c_cc[VTIME] = 0;
+#endif
+
+ /* Set some control codes to default values */
+#ifdef VINTR
+ st.c_cc[VINTR] = '\003'; /* ^c */
+#endif
+#ifdef VQUIT
+ st.c_cc[VQUIT] = '\034'; /* ^| */
+#endif
+#ifdef VERASE
+ st.c_cc[VERASE] = '\177'; /* ^? */
+#endif
+#ifdef VKILL
+ st.c_cc[VKILL] = '\025'; /* ^u */
+#endif
+#ifdef VEOF
+ st.c_cc[VEOF] = '\004'; /* ^d */
+#endif
+ tcsetattr(slave, TCSANOW, &st);
+
+ switch (pid = fork ()) {
+ case 0:
+ /* Child process */
+ if (close(master) == -1)
+ fatal(_("close of master pty failed (%s)"), strerror(errno));
+ if (close(1) == -1)
+ fatal(_("close of stdout in child failed (%s)"),
+ strerror(errno));
+ if (dup(slave) != 1)
+ fatal(_("moving slave pty to stdout in child failed (dup: %s)"), strerror(errno));
+ if (close(0) == -1)
+ fatal(_("close of stdin in child failed (%s)"),
+ strerror(errno));
+ if (dup(slave) != 0)
+ fatal(_("moving slave pty to stdin in child failed (dup: %s)"), strerror(errno));
+ if (close(slave))
+ fatal(_("close of slave pty failed (%s)"), strerror(errno));
+
+ /* stderr does NOT get dup'ed onto child's stdout */
+
+ signal(SIGPIPE, SIG_DFL);
+
+ execl("/bin/sh", "sh", "-c", str, NULL);
+ _exit(127);
+
+ case -1:
+ save_errno = errno;
+ close(master);
+ errno = save_errno;
+ return FALSE;
+
+ }
+
+ /* parent */
+ if (close(slave))
+ fatal(_("close of slave pty failed (%s)"), strerror(errno));
+
+ rp->pid = pid;
+ rp->iop = iop_alloc(master, str, NULL);
+ if (rp->iop == NULL) {
+ (void) close(master);
+ (void) kill(pid, SIGKILL); /* overkill? (pardon pun) */
+ return FALSE;
+ }
+
+ /*
+ * Force read and write ends of two-way connection to
+ * be different fd's so they can be closed independently.
+ */
+ if ((dup_master = dup(master)) < 0
+ || (rp->fp = fdopen(dup_master, "w")) == NULL) {
+ iop_close(rp->iop);
+ rp->iop = NULL;
+ (void) close(master);
+ (void) kill(pid, SIGKILL); /* overkill? (pardon pun) */
+ if (dup_master > 0)
+ (void) close(dup_master);
+ return FALSE;
+ }
+ rp->flag |= RED_PTY;
+ os_close_on_exec(master, str, "pipe", "from");
+ os_close_on_exec(dup_master, str, "pipe", "to");
+ first_pty_letter = '\0'; /* reset for next command */
+ return TRUE;
+ }
+#endif /* HAVE_TERMIOS_H */
+
+use_pipes:
#ifndef PIPES_SIMULATED /* real pipes */
- /* case 2: two way pipe to a child process */
+ /* case 3: two way pipe to a child process */
{
int ptoc[2], ctop[2];
int pid;
@@ -1610,7 +1868,7 @@ two_way_open(char *str, struct redirect *rp)
fatal(_("close of pipe failed (%s)"), strerror(errno));
/* stderr does NOT get dup'ed onto child's stdout */
execl("/bin/sh", "sh", "-c", str, NULL);
- _exit(127);
+ _exit(errno == ENOENT ? 127 : 126);
}
#endif /* NOT __EMX__ */
@@ -1666,7 +1924,7 @@ two_way_open(char *str, struct redirect *rp)
static int
wait_any(int interesting) /* pid of interest, if any */
{
- RETSIGTYPE (*hstat)(), (*istat)(), (*qstat)();
+ RETSIGTYPE (*hstat) P((int)), (*istat) P((int)), (*qstat) P((int));
int pid;
int status = 0;
struct redirect *redp;
@@ -1703,7 +1961,7 @@ wait_any(int interesting) /* pid of interest, if any */
/* gawk_popen --- open an IOBUF on a child process */
static IOBUF *
-gawk_popen(char *cmd, struct redirect *rp)
+gawk_popen(const char *cmd, struct redirect *rp)
{
int p[2];
register int pid;
@@ -1755,7 +2013,7 @@ gawk_popen(char *cmd, struct redirect *rp)
if (close(p[0]) == -1 || close(p[1]) == -1)
fatal(_("close of pipe failed (%s)"), strerror(errno));
execl("/bin/sh", "sh", "-c", cmd, NULL);
- _exit(127);
+ _exit(errno == ENOENT ? 127 : 126);
}
#endif /* NOT __EMX__ */
@@ -1785,10 +2043,10 @@ gawk_pclose(struct redirect *rp)
/* process previously found, return stored status */
if (rp->pid == -1)
- return (rp->status >> 8) + ((rp->status &0xFF) ? 128 + (rp->status & 0xF) : 0);
+ return rp->status;
rp->status = wait_any(rp->pid);
rp->pid = -1;
- return (rp->status >> 8) + ((rp->status &0xFF) ? 128 + (rp->status & 0xF) : 0);
+ return rp->status;
}
#else /* PIPES_SIMULATED */
@@ -1803,7 +2061,7 @@ gawk_pclose(struct redirect *rp)
/* gawk_popen --- open an IOBUF on a child process */
static IOBUF *
-gawk_popen(char *cmd, struct redirect *rp)
+gawk_popen(const char *cmd, struct redirect *rp)
{
FILE *current;
@@ -1849,7 +2107,7 @@ static struct pipeinfo {
/* gawk_popen --- open an IOBUF on a child process */
static IOBUF *
-gawk_popen(char *cmd, struct redirect *rp)
+gawk_popen(const char *cmd, struct redirect *rp)
{
extern char *strdup P((const char *));
int current;
@@ -1956,7 +2214,7 @@ do_getline(NODE *tree)
FNR++;
}
if (tree->lnode == NULL) /* no optional var. */
- set_record(s, cnt, TRUE);
+ set_record(s, cnt);
else { /* assignment to variable */
Func_ptr after_assign = NULL;
NODE **lhs;
@@ -2078,7 +2336,7 @@ do_pathopen(const char *file)
int bufsize = 8192;
void
-fatal(char *s)
+fatal(const char *s)
{
printf("%s\n", s);
exit(1);
@@ -2090,25 +2348,30 @@ fatal(char *s)
static IOBUF *
iop_alloc(int fd, const char *name, IOBUF *iop)
{
- struct stat sbuf;
-
- if (fd == INVALID_HANDLE)
- return NULL;
- if (iop == NULL)
- emalloc(iop, IOBUF *, sizeof(IOBUF), "iop_alloc");
+ struct stat sbuf;
+
+ if (fd == INVALID_HANDLE)
+ return NULL;
+ if (iop == NULL)
+ emalloc(iop, IOBUF *, sizeof(IOBUF), "iop_alloc");
+ memset(iop, '\0', sizeof(IOBUF));
+ iop->flag = 0;
+ if (isatty(fd))
+ iop->flag |= IOP_IS_TTY;
+ iop->readsize = iop->size = optimal_bufsize(fd, & sbuf);
+ iop->sbuf = sbuf;
+ if (do_lint && S_ISREG(sbuf.st_mode) && sbuf.st_size == 0)
+ lintwarn(_("data file `%s' is empty"), name);
+ errno = 0;
+ iop->fd = fd;
+ iop->count = iop->total = iop->scanoff = 0;
+ iop->name = name;
+ emalloc(iop->buf, char *, iop->size += 2, "iop_alloc");
+ iop->off = iop->buf;
+ iop->dataend = NULL;
+ iop->end = iop->buf + iop->size;
iop->flag = 0;
- if (isatty(fd))
- iop->flag |= IOP_IS_TTY;
- iop->size = optimal_bufsize(fd, & sbuf);
- if (do_lint && S_ISREG(sbuf.st_mode) && sbuf.st_size == 0)
- lintwarn(_("data file `%s' is empty"), name);
- iop->secsiz = -2;
- errno = 0;
- iop->fd = fd;
- iop->off = iop->buf = NULL;
- iop->cnt = 0;
- iop->name = name;
- return iop;
+ return iop;
}
#define set_RT_to_null() \
@@ -2119,379 +2382,857 @@ iop_alloc(int fd, const char *name, IOBUF *iop)
(void)(! do_traditional && (unref(RT_node->var_value), \
RT_node->var_value = make_string(str, len)))
-/*
- * get_a_record:
- * Get the next record. Uses a "split buffer" where the latter part is
- * the normal read buffer and the head part is an "overflow" area that is used
- * when a record spans the end of the normal buffer, in which case the first
- * part of the record is copied into the overflow area just before the
- * normal buffer. Thus, the eventual full record can be returned as a
- * contiguous area of memory with a minimum of copying. The overflow area
- * is expanded as needed, so that records are unlimited in length.
- * We also mark both the end of the buffer and the end of the read() with
- * a sentinel character (the current record separator) so that the inside
- * loop can run as a single test.
- *
- * Note that since we know or can compute the end of the read and the end
- * of the buffer, the sentinel character does not get in the way of regexp
- * based searching, since we simply search up to that character, but not
- * including it.
- */
+/* grow must increase size of buffer, set end, make sure off and dataend point at */
+/* right spot. */
+/* */
+/* */
+/* <growbuffer>= */
+/* grow_iop_buffer --- grow the buffer */
-static int
-get_a_record(char **out, /* pointer to pointer to data */
- IOBUF *iop, /* input IOP */
- register int grRS, /* first char in RS->stptr */
- Regexp *RSre, /* regexp for RS */
- int *errcode) /* pointer to error variable */
+static void
+grow_iop_buffer(IOBUF *iop)
{
- register char *bp = iop->off;
- char *bufend;
- char *start = iop->off; /* beginning of record */
- int rs;
- static Regexp *RS_null_re = NULL;
- Regexp *rsre = NULL;
- int continuing = FALSE, continued = FALSE; /* used for re matching */
- int onecase;
-#ifdef MBS_SUPPORT
- size_t mbclen = 0;
- mbstate_t mbs;
-#endif
+ size_t valid = iop->dataend - iop->off;
+ size_t off = iop->off - iop->buf;
+ size_t newsize;
-#ifdef TANDEM
- char *mend;
-#endif
-
-#ifdef TANDEM
-#define not_past_end() (bp < mend)
-#else
-#define not_past_end() (1)
-#endif
-
- /* first time through */
- if (RS_null_re == NULL) {
- RS_null_re = make_regexp("\n\n+", 3, TRUE, TRUE);
- if (RS_null_re == NULL)
- fatal(_("internal error: file `%s', line %d\n"),
- __FILE__, __LINE__);
- }
-
- if (iop->cnt == EOF) { /* previous read hit EOF */
- *out = NULL;
- set_RT_to_null();
- return EOF;
- }
-
-#ifdef TANDEM
- if (MRL)
- mend = start + MRL;
- else
- mend = (char *) LONG_MAX;
-#endif
+ /*
+ * Lop off original extra two bytes, double the size,
+ * add them back.
+ */
+ newsize = ((iop->size - 2) * 2) + 2;
- if (RS_is_null) /* special case: RS == "" */
- rs = '\n';
- else
- rs = (char) grRS;
+ /* Check for overflow */
+ if (newsize <= iop->size)
+ fatal(_("could not allocate more input memory"));
- onecase = (IGNORECASE && ISALPHA(rs));
- if (onecase)
- rs = casetable[(unsigned char) rs];
+ /* Make sure there's room for a disk block */
+ if (newsize - valid < iop->readsize)
+ newsize += iop->readsize + 2;
- /* set up sentinel */
- if (iop->buf) {
- bufend = iop->buf + iop->size + iop->secsiz;
- *bufend = rs; /* add sentinel to buffer */
- } else
- bufend = NULL;
+ /* Check for overflow, again */
+ if (newsize <= iop->size)
+ fatal(_("could not allocate more input memory"));
- for (;;) { /* break on end of record, read error or EOF */
-/* buffer mgmt, chunk #1 */
- /*
- * Following code is entered on the first call of this routine
- * for a new iop, or when we scan to the end of the buffer.
- * In the latter case, we copy the current partial record to
- * the space preceding the normal read buffer. If necessary,
- * we expand this space. This is done so that we can return
- * the record as a contiguous area of memory.
- */
- if ((iop->flag & IOP_IS_INTERNAL) == 0 && bp >= bufend) {
- char *oldbuf = NULL;
- char *oldsplit = iop->buf + iop->secsiz;
- long len; /* record length so far */
-
- len = bp - start;
- if (len > iop->secsiz) {
- /* expand secondary buffer */
- if (iop->secsiz == -2)
- iop->secsiz = 256;
- while (len > iop->secsiz)
- iop->secsiz *= 2;
- oldbuf = iop->buf;
- emalloc(iop->buf, char *,
- iop->size+iop->secsiz+2, "get_a_record");
- bufend = iop->buf + iop->size + iop->secsiz;
- *bufend = rs;
- }
- if (len > 0) {
- char *newsplit = iop->buf + iop->secsiz;
-
- if (start < oldsplit) {
- memcpy(newsplit - len, start,
- oldsplit - start);
- memcpy(newsplit - (bp - oldsplit),
- oldsplit, bp - oldsplit);
- } else
- memcpy(newsplit - len, start, len);
- }
- bp = iop->end = iop->off = iop->buf + iop->secsiz;
- start = bp - len;
-#ifdef TANDEM
- if (MRL)
- mend = start + MRL;
-#endif
- if (oldbuf != NULL) {
- free(oldbuf);
- oldbuf = NULL;
- }
- }
-/* buffer mgmt, chunk #2 */
- /*
- * Following code is entered whenever we have no more data to
- * scan. In most cases this will read into the beginning of
- * the main buffer, but in some cases (terminal, pipe etc.)
- * we may be doing smallish reads into more advanced positions.
- */
- if (bp >= iop->end) {
- if ((iop->flag & IOP_IS_INTERNAL) != 0) {
- iop->cnt = EOF;
- break;
- }
- iop->cnt = read(iop->fd, iop->end, bufend - iop->end);
- if (iop->cnt == -1) {
- if (! do_traditional && errcode != NULL) {
- *errcode = errno;
- iop->cnt = EOF;
- break;
- } else
- fatal(_("error reading input file `%s': %s"),
- iop->name, strerror(errno));
- } else if (iop->cnt == 0) {
- /*
- * hit EOF before matching RS, so end
- * the record and set RT to ""
- */
- iop->cnt = EOF;
- /* see comments below about this test */
- if (! continuing) {
- set_RT_to_null();
- break;
- }
- }
- if (iop->cnt != EOF) {
- iop->end += iop->cnt;
- *iop->end = rs; /* reset the sentinel */
- }
- }
-/* buffers are now setup and filled with data */
-/* search for RS, #1, regexp based, or RS = "" */
- /*
- * Attempt to simplify the code a bit. The case where
- * RS = "" can also be described by a regexp, RS = "\n\n+".
- * The buffer managment and searching code can thus now
- * use a common case (the one for regexps) both when RS is
- * a regexp, and when RS = "". This particularly benefits
- * us for keeping track of how many newlines were matched
- * in order to set RT.
- */
- if (! do_traditional && RSre != NULL) /* regexp */
- rsre = RSre;
- else if (RS_is_null) /* RS = "" */
- rsre = RS_null_re;
- else
- rsre = NULL;
+ iop->size = newsize;
+ erealloc(iop->buf, char *, iop->size, "grow_iop_buffer");
+ iop->off = iop->buf + off;
+ iop->dataend = iop->off + valid;
+ iop->end = iop->buf + iop->size;
+}
- /*
- * Look for regexp match of RS. Non-match conditions are:
- * 1. No match at all
- * 2. Match of a null string
- * 3. Match ends at exact end of buffer
- * Number 3 is subtle; we have to add more to the buffer
- * in case the match would have extended further into the
- * file, since regexp match by definition always matches the
- * longest possible match.
- *
- * It is even more subtle than you might think. Suppose
- * the re matches at exactly the end of file. We don't know
- * that until we try to add more to the buffer. Thus, we
- * set a flag to indicate, that if eof really does happen,
- * don't break early.
- *
- * Still more subtlety. Suppose RS is a multi-character regexp,
- * but it doesn't have the metacharacters that would let it
- * match an arbitrary number of characters. So it's an exact
- * string match. We need to check for this, in the case where
- * there is an exact match at the end, and NOT read more
- * data. Otherwise, this might bite us for an interactive
- * networking program that uses CR-LF as the line terminator.
- */
- continuing = FALSE;
- if (rsre != NULL) {
- again:
- /* cases 1 and 2 are simple, just keep going */
- if (research(rsre, start, 0, iop->end - start, TRUE) == -1
- || RESTART(rsre, start) == REEND(rsre, start)) {
- /*
- * Leading newlines at the beginning of the file
- * should be ignored. Whew!
- */
- if (RS_is_null && *start == '\n') {
- /*
- * have to catch the case of a
- * single newline at the front of
- * the record, which the regex
- * doesn't. gurr.
- */
- while (*start == '\n' && start < iop->end)
- start++;
- goto again;
- }
- bp = iop->end;
- continue;
- }
- /* case 3, regex match at exact end */
- if (start + REEND(rsre, start) >= iop->end) {
- if (iop->cnt != EOF) {
- /*
- * Only do the test if not at EOF
- */
- int isstring;
-
- isstring = reisstring(RS->stptr,
- RS->stlen, rsre, start);
- if (isstring == FALSE) {
- bp = iop->end;
- continuing = continued = TRUE;
- continue;
- }
- }
- }
- /* got a match! */
- /*
- * Leading newlines at the beginning of the file
- * should be ignored. Whew!
- */
- if (RS_is_null && *start == '\n') {
- /*
- * have to catch the case of a
- * single newline at the front of
- * the record, which the regex
- * doesn't. gurr.
- */
- while (*start == '\n' && start < iop->end)
- start++;
- /* if file is nothing but newlines, no record found */
- if (iop->cnt == EOF && start >= iop->end) {
- *out = NULL;
- set_RT_to_null();
- return EOF;
- }
- goto again;
- }
- bp = start + RESTART(rsre, start);
- set_RT(bp, REEND(rsre, start) - RESTART(rsre, start));
- *bp = '\0';
- iop->off = start + REEND(rsre, start);
- break;
- }
-/* search for RS, #2, RS = <single char> */
+/* <rs1>= */
+static int
+rs1_get_a_record(char **out, /* pointer to pointer to data */
+ IOBUF *iop, /* input IOP */
+ register int grRS, /* first char in RS->stptr */
+ Regexp *RSre ATTRIBUTE_UNUSED, /* regexp for RS */
+ int *errcode) /* pointer to error variable */
+{
+ /* We need a pointer into the buffer. */
+ /* */
+ /* <rs1 local vars>= */
+ register char *bp;
+ long retval;
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1) {
- int len = iop->end - bp + 1;
- int found = 0;
- memset(&mbs, 0, sizeof(mbstate_t));
- do {
- if (onecase ? casetable[(int) *bp] == rs : *bp == rs)
- found = 1;
- mbclen = mbrlen(bp, len, &mbs);
- if ((mbclen == 1) || (mbclen == (size_t) -1)
- || (mbclen == (size_t) -2) || (mbclen == 0)) {
- /* We treat it as a singlebyte character. */
- mbclen = 1;
- }
- len -= mbclen;
- bp += mbclen;
- } while (len > 0 && !found);
- } else
+ size_t mbclen = 0;
+ mbstate_t mbs;
#endif
- if (onecase) {
- while (casetable[(unsigned char) *bp++] != rs && not_past_end())
- continue;
- } else {
- while (*bp++ != rs && not_past_end())
- continue;
- }
- set_RT(bp - 1, 1);
- if (bp <= iop->end)
- break;
- else
- bp--;
-
- if ((iop->flag & IOP_IS_INTERNAL) != 0)
- iop->cnt = bp - start;
- }
- if (iop->cnt == EOF
- && (((iop->flag & IOP_IS_INTERNAL) != 0)
- || (start == bp && ! continued))) {
- *out = NULL;
- set_RT_to_null();
- return EOF;
- }
- if (do_traditional || rsre == NULL) {
- iop->off = bp;
- bp--;
- if (onecase ? casetable[(unsigned char) *bp] != rs : *bp != rs)
- bp++;
- if (MRL == 0)
- *bp = '\0';
- } else if (RS_is_null && iop->cnt == EOF) {
- /*
- * special case, delete trailing newlines,
- * should never be more than one.
- */
- while (bp[-1] == '\n')
- bp--;
- *bp = '\0';
- }
-
- *out = start;
- return bp - start;
+ /* The main code first checks if there was an EOF last */
+ /* time around, and then sets up the pointers. */
+ /* */
+ /* */
+ /* <rs1 code>= */
+ /* Upon EOF, set RT to null, set pointer to null, return EOF. */
+ /* We don't do this unless we've also run out of data. */
+ /* */
+ /* */
+ /* <check for EOF, return right stuff>= */
+ if ((iop->flag & IOP_AT_EOF) != 0 && iop->off >= iop->dataend) {
+ *out = NULL;
+ set_RT_to_null();
+ return EOF;
+ }
+ /* First time around, set it to point to start of current record. */
+ /* */
+ /* */
+ /* <set initial pointers>= */
+ bp = iop->off;
+
+ /* Most of the work is a for loop that expands the buffer, */
+ /* and fills it, until the rs character is found. */
+ /* */
+ /* */
+ /* <rs1 code>= */
+ for (;;) {
+ /* <common buffer setup code>= */
+ if (/* If there's data in the buffer, and we're pointing at the end of it, */
+ /* grow the buffer. */
+ /* */
+ /* */
+ /* <at end of buffer and rs not found yet>= */
+ (iop->flag & IOP_AT_EOF) == 0 &&
+ iop->dataend != NULL && bp >= iop->dataend) {
+ if (iop->off > iop->buf) {
+ /* Moving the data requires remembering how far off the */
+ /* dataend pointer was and the bp pointer too. */
+ /* */
+ /* <move data down>= */
+ size_t dataend_off = iop->dataend - iop->off;
+ memmove(iop->buf, iop->off, dataend_off);
+ iop->off = iop->buf;
+ bp = iop->dataend = iop->buf + dataend_off;
+
+ /* <reset pointers>= */
+ bp = iop->dataend;
+ } else {
+ /* <save position, grow buffer>= */
+ iop->scanoff = bp - iop->off;
+ grow_iop_buffer(iop);
+ bp = iop->off + iop->scanoff;
+ }
+ }
+
+ /* no data in buffer or ran out of data */
+ if ((iop->flag & IOP_AT_EOF) == 0 && (iop->dataend == NULL || bp >= iop->dataend)) {
+ iop->scanoff = bp - iop->off;
+ if (iop->dataend == NULL) {
+ iop->dataend = iop->buf; /* first read */
+ if ((iop->flag & IOP_IS_INTERNAL) != 0)
+ iop->dataend += strlen(iop->buf);
+ }
+ /* Use read to put more data into the buffer. If we've read */
+ /* as many characters as in the file, don't try to read more. */
+ /* */
+ /* */
+ /* <put more data into the buffer>= */
+ if ((iop->flag & IOP_IS_INTERNAL) != 0) {
+ iop->flag |= IOP_AT_EOF;
+ } else if (S_ISREG(iop->sbuf.st_mode) && iop->total >= iop->sbuf.st_size)
+ iop->flag |= IOP_AT_EOF;
+ else {
+#define min(x, y) (x < y ? x : y)
+ /* subtract one in read count to leave room for sentinel */
+ size_t room_left = iop->end - iop->dataend - 1;
+ size_t amt_to_read = min(iop->readsize, room_left);
+
+ if (amt_to_read < iop->readsize) {
+ /* <save position, grow buffer>= */
+ iop->scanoff = bp - iop->off;
+ grow_iop_buffer(iop);
+ bp = iop->off + iop->scanoff;
+ /* recalculate amt_to_read */
+ room_left = iop->end - iop->dataend - 1;
+ amt_to_read = min(iop->readsize, room_left);
+ }
+ while (amt_to_read + iop->readsize < room_left)
+ amt_to_read += iop->readsize;
+
+ iop->count = read(iop->fd, iop->dataend, amt_to_read);
+ if (iop->count == -1) {
+ if (! do_traditional && errcode != NULL) {
+ *errcode = errno;
+ iop->flag |= IOP_AT_EOF;
+ break;
+ } else
+ fatal(_("error reading input file `%s': %s"),
+ iop->name, strerror(errno));
+ } else if (iop->count == 0) {
+ /*
+ * hit EOF before matching RS, so end
+ * the record and set RT to ""
+ */
+ iop->flag |= IOP_AT_EOF;
+ }
+ else {
+ iop->dataend += iop->count;
+ iop->total += iop->count;
+ if (S_ISREG(iop->sbuf.st_mode) && iop->total >= iop->sbuf.st_size)
+ iop->flag |= IOP_AT_EOF;
+ /* reset the sentinel */
+ /* <set sentinel>= */
+ *iop->dataend = grRS;
+
+
+ }
+ }
+
+ bp = iop->off + iop->scanoff;
+ }
+
+ /* <set sentinel>= */
+ *iop->dataend = grRS;
+
+
+
+ /* search for rs */
+#ifdef MBS_SUPPORT
+ if (gawk_mb_cur_max > 1) {
+ int len = iop->end - bp + 1;
+ int found = 0;
+ memset(&mbs, 0, sizeof(mbstate_t));
+ do {
+ if (*bp == grRS)
+ found = 1;
+ mbclen = mbrlen(bp, len, &mbs);
+ if ((mbclen == 1) || (mbclen == (size_t) -1)
+ || (mbclen == (size_t) -2) || (mbclen == 0)) {
+ /* We treat it as a singlebyte character. */
+ mbclen = 1;
+ }
+ len -= mbclen;
+ bp += mbclen;
+ } while (len > 0 && ! found);
+ } else
+#endif
+ while (*bp++ != grRS)
+ continue;
+
+ /* At the end of the loop, if the rs char is found in the buffer, */
+ /* break. Otherwise, back the pointer up and then check for EOF. */
+ /* If an internal file, break. */
+ /* If EOF, break. */
+ /* */
+ /* */
+ /* <end loop logic>= */
+ /* bp is one past newline that marks end of record */
+ if (bp <= iop->dataend) /* found it in the buffer, not the sentinel */
+ break;
+
+ if ((iop->flag & IOP_IS_INTERNAL) != 0) {
+ iop->flag |= IOP_AT_EOF;
+ break;
+ }
+
+ if ((iop->flag & IOP_AT_EOF) != 0)
+ break;
+
+ /* bp points one past sentinel, back it up for buffer management code */
+ bp--;
+
+ /* hit end of data in buffer, continue around to find more */
+ }
+
+ /* Once out of the loop, either we hit EOF, or we found the */
+ /* character. */
+ /* */
+ /* */
+ /* <rs1 code>= */
+ /* now out of loop: either we hit EOF, or we found rs */
+ /* Upon EOF, set RT to null, set pointer to null, return EOF. */
+ /* We don't do this unless we've also run out of data. */
+ /* */
+ /* */
+ /* <check for EOF, return right stuff>= */
+ if ((iop->flag & IOP_AT_EOF) != 0 && iop->off >= iop->dataend) {
+ *out = NULL;
+ set_RT_to_null();
+ return EOF;
+ }
+
+ /* found rs, return the record */
+ *out = iop->off;
+ retval = bp - iop->off - 1;
+ iop->off = bp; /* set up for next time */
+
+ /* set RT */
+ set_RT(bp - 1, 1);
+
+ return retval;
}
-
-#ifdef TEST
-int
-main(int argc, char *argv[])
+/* This next part deals with the case of RS = "". The goal is to */
+/* 1. skip any leading newlines */
+/* 2. scan through for multiple newlines */
+/* 3. If hit the end of the buffer, shuffle things down and refill */
+/* and keep going. */
+/* */
+/* */
+/* <rsnull>= */
+static int
+rsnull_get_a_record(char **out, /* pointer to pointer to data */
+ IOBUF *iop, /* input IOP */
+ register int grRS, /* first char in RS->stptr */
+ Regexp *RSre ATTRIBUTE_UNUSED, /* regexp for RS */
+ int *errcode) /* pointer to error variable */
{
- IOBUF *iop;
- char *out;
- int cnt;
- char rs[2];
-
- rs[0] = '\0';
- if (argc > 1)
- bufsize = atoi(argv[1]);
- if (argc > 2)
- rs[0] = *argv[2];
- iop = iop_alloc(0, "stdin", NULL);
- while ((cnt = get_a_record(&out, iop, rs[0], NULL, NULL)) > 0) {
- fwrite(out, 1, cnt, stdout);
- fwrite(rs, 1, 1, stdout);
- }
- return 0;
+ /* We will need at least a buffer pointer so that hopefully */
+ /* some of the litprog code can be reused. */
+ /* */
+ /* */
+ /* <rsnull local vars>= */
+ register char *bp;
+ long retval;
+ /* 2. Start scanning the buffer for newlines. If we hit one, look for another; */
+ /* we need at least 2 successive newlines to terminate the record. */
+ /* */
+ /* If we find two, save the location of the first one so we can set RT */
+ /* correctly. Then continue scanning; if we hit the end of the buffer, */
+ /* we may need to save our state in order to expand the buffer. */
+ /* */
+ /* If we hit the end of the buffer without seeing any newlines, then */
+ /* we need to save grow the buffer and keep going. */
+ /* */
+ /* */
+ /* <rsnull local vars>= */
+ size_t firstnl = 0;
+ int restarting = FALSE;
+ char *rt_start = NULL;
+
+
+ /* ensure real sentinel value */
+ grRS = '\n';
+
+ /* Much of the code is similar to the rs1 case: */
+ /* */
+ /* */
+ /* <rsnull code>= */
+ /* Upon EOF, set RT to null, set pointer to null, return EOF. */
+ /* We don't do this unless we've also run out of data. */
+ /* */
+ /* */
+ /* <check for EOF, return right stuff>= */
+ if ((iop->flag & IOP_AT_EOF) != 0 && iop->off >= iop->dataend) {
+ *out = NULL;
+ set_RT_to_null();
+ return EOF;
+ }
+ /* First time around, set it to point to start of current record. */
+ /* */
+ /* */
+ /* <set initial pointers>= */
+ bp = iop->off;
+
+ /* The main loop is similar but not identical. */
+ /* */
+ /* */
+ /* <rsnull code>= */
+ for (;;) {
+ /* <common buffer setup code>= */
+ if (/* If there's data in the buffer, and we're pointing at the end of it, */
+ /* grow the buffer. */
+ /* */
+ /* */
+ /* <at end of buffer and rs not found yet>= */
+ (iop->flag & IOP_AT_EOF) == 0 &&
+ iop->dataend != NULL && bp >= iop->dataend) {
+ if (iop->off > iop->buf) {
+ /* Moving the data requires remembering how far off the */
+ /* dataend pointer was and the bp pointer too. */
+ /* */
+ /* <move data down>= */
+ size_t dataend_off = iop->dataend - iop->off;
+ memmove(iop->buf, iop->off, dataend_off);
+ iop->off = iop->buf;
+ bp = iop->dataend = iop->buf + dataend_off;
+
+ /* <reset pointers>= */
+ bp = iop->dataend;
+ } else {
+ /* <save position, grow buffer>= */
+ iop->scanoff = bp - iop->off;
+ grow_iop_buffer(iop);
+ bp = iop->off + iop->scanoff;
+ }
+ }
+
+ /* no data in buffer or ran out of data */
+ if ((iop->flag & IOP_AT_EOF) == 0 && (iop->dataend == NULL || bp >= iop->dataend)) {
+ iop->scanoff = bp - iop->off;
+ if (iop->dataend == NULL) {
+ iop->dataend = iop->buf; /* first read */
+ if ((iop->flag & IOP_IS_INTERNAL) != 0)
+ iop->dataend += strlen(iop->buf);
+ }
+ /* Use read to put more data into the buffer. If we've read */
+ /* as many characters as in the file, don't try to read more. */
+ /* */
+ /* */
+ /* <put more data into the buffer>= */
+ if ((iop->flag & IOP_IS_INTERNAL) != 0) {
+ iop->flag |= IOP_AT_EOF;
+ } else if (S_ISREG(iop->sbuf.st_mode) && iop->total >= iop->sbuf.st_size)
+ iop->flag |= IOP_AT_EOF;
+ else {
+#define min(x, y) (x < y ? x : y)
+ /* subtract one in read count to leave room for sentinel */
+ size_t room_left = iop->end - iop->dataend - 1;
+ size_t amt_to_read = min(iop->readsize, room_left);
+
+ if (amt_to_read < iop->readsize) {
+ /* <save position, grow buffer>= */
+ iop->scanoff = bp - iop->off;
+ grow_iop_buffer(iop);
+ bp = iop->off + iop->scanoff;
+ /* recalculate amt_to_read */
+ room_left = iop->end - iop->dataend - 1;
+ amt_to_read = min(iop->readsize, room_left);
+ }
+ while (amt_to_read + iop->readsize < room_left)
+ amt_to_read += iop->readsize;
+
+ iop->count = read(iop->fd, iop->dataend, amt_to_read);
+ if (iop->count == -1) {
+ if (! do_traditional && errcode != NULL) {
+ *errcode = errno;
+ iop->flag |= IOP_AT_EOF;
+ break;
+ } else
+ fatal(_("error reading input file `%s': %s"),
+ iop->name, strerror(errno));
+ } else if (iop->count == 0) {
+ /*
+ * hit EOF before matching RS, so end
+ * the record and set RT to ""
+ */
+ iop->flag |= IOP_AT_EOF;
+ }
+ else {
+ iop->dataend += iop->count;
+ iop->total += iop->count;
+ if (S_ISREG(iop->sbuf.st_mode) && iop->total >= iop->sbuf.st_size)
+ iop->flag |= IOP_AT_EOF;
+ /* reset the sentinel */
+ /* <set sentinel>= */
+ *iop->dataend = grRS;
+
+
+ }
+ }
+
+ bp = iop->off + iop->scanoff;
+ }
+
+ /* <set sentinel>= */
+ *iop->dataend = grRS;
+
+
+
+ /* The 2.15.6 logic doesn't seem to do the trick, let's do it */
+ /* ourselves. We need to handle the following things. */
+ /* */
+ /* 1. Skip any leading newlines in front of the record, they don't count. */
+ /* NOT leading whitespace, just newlines. See the comment, too. */
+ /* */
+ /* */
+ /* <actual rsnull logic>= */
+ /*
+ * skip any newlines at the front of the buffer,
+ * either in front of first record, or after previous
+ * record, e.g. if RS changed in the middle
+ * (see test/nulrsend)
+ */
+ if (*bp == '\n') {
+ while (bp < iop->dataend && *bp == '\n')
+ bp++;
+ if (bp == iop->dataend) {
+ if ((iop->flag & IOP_AT_EOF) == 0)
+ continue; /* fill buffer, there's LOTS of leading newlines */
+ else {
+ /* bug out early */
+ iop->off = iop->dataend;
+ *out = NULL;
+ set_RT_to_null();
+ return EOF;
+ }
+ } else {
+ iop->off = bp;
+ }
+ }
+ /* <actual rsnull logic>= */
+ /*
+ * This code entered if we previously hit the first
+ * newline at exactly the end of the buffer.
+ */
+ if (firstnl && restarting) {
+ restarting = FALSE;
+ /*
+ * back up to just before first newline so following
+ * logic always works.
+ */
+ bp = iop->off + firstnl - 1;
+ firstnl = 0;
+ }
+
+ /* we make use of the sentinel, so we don't have to check bp < iop->dataend */
+ more:
+ while (*bp++ != '\n')
+ continue;
+
+ if (bp >= iop->dataend && (iop->flag & IOP_AT_EOF) == 0) /* end of buffer */
+ continue; /* refill, start over */
+ else if (bp == (iop->dataend - 1) && (iop->flag & IOP_AT_EOF) == 0) {
+ /* one newline exactly at end, AND not at EOF */
+ firstnl = bp - iop->off;
+ restarting = TRUE;
+ bp++;
+ continue; /* refill, earlier logic catches */
+ }
+
+ /* found one newline */
+ if (*bp != '\n' && bp < iop->dataend)
+ goto more; /* only one */
+
+ rt_start = bp - 1; /* prev char was first newline, *bp is second */
+ while (bp < iop->dataend && *bp == '\n')
+ bp++;
+
+ if (bp >= iop->dataend && (iop->flag & IOP_AT_EOF) == 0) {
+ firstnl = bp - iop->off;
+ restarting = TRUE;
+ continue;
+ } else
+ break; /* got the record, done */
+
+
+
+ /* Here's the logic when the record has been identified. */
+ /* */
+ /* */
+ /* <rsnull end loop logic>= */
+
+ if ((iop->flag & IOP_IS_INTERNAL) != 0) {
+ iop->flag |= IOP_AT_EOF;
+ break;
+ }
+
+ if ((iop->flag & IOP_AT_EOF) != 0)
+ break;
+
+
+ /* hit end of data in buffer, continue around to find more */
+ }
+
+ /* <rsnull code>= */
+ /* now out of loop: either we hit EOF, or we found rs */
+ /* Upon EOF, set RT to null, set pointer to null, return EOF. */
+ /* We don't do this unless we've also run out of data. */
+ /* */
+ /* */
+ /* <check for EOF, return right stuff>= */
+ if ((iop->flag & IOP_AT_EOF) != 0 && iop->off >= iop->dataend) {
+ *out = NULL;
+ set_RT_to_null();
+ return EOF;
+ }
+
+ set_RT(rt_start, bp - rt_start);
+
+ /* found rs, return the record */
+ *out = iop->off;
+ retval = rt_start - iop->off;
+ iop->off = bp; /* set up for next time */
+
+ return retval;
+}
+/* Now the hardest part, regex separated records. */
+/* */
+/* */
+/* <rsre>= */
+static int
+rsre_get_a_record(char **out, /* pointer to pointer to data */
+ IOBUF *iop, /* input IOP */
+ register int grRS, /* first char in RS->stptr */
+ Regexp *RSre, /* regexp for RS */
+ int *errcode) /* pointer to error variable */
+{
+ /* Local vars are similar: */
+ /* */
+ /* */
+ /* <rsre local vars>= */
+ register char *bp;
+ long retval;
+ size_t restart = 0, reend = 0;
+ int set_res = FALSE;
+
+
+ /* And the basic code is also similar: */
+ /* */
+ /* */
+ /* <rsre code>= */
+ /* Upon EOF, set RT to null, set pointer to null, return EOF. */
+ /* We don't do this unless we've also run out of data. */
+ /* */
+ /* */
+ /* <check for EOF, return right stuff>= */
+ if ((iop->flag & IOP_AT_EOF) != 0 && iop->off >= iop->dataend) {
+ *out = NULL;
+ set_RT_to_null();
+ return EOF;
+ }
+ /* First time around, set it to point to start of current record. */
+ /* */
+ /* */
+ /* <set initial pointers>= */
+ bp = iop->off;
+
+
+ /* Here is the main loop: */
+ /* */
+ /* */
+ /* <rsre code>= */
+ for (;;) {
+ /* <common buffer setup code>= */
+ if (/* If there's data in the buffer, and we're pointing at the end of it, */
+ /* grow the buffer. */
+ /* */
+ /* */
+ /* <at end of buffer and rs not found yet>= */
+ (iop->flag & IOP_AT_EOF) == 0 &&
+ iop->dataend != NULL && bp >= iop->dataend) {
+ if (iop->off > iop->buf) {
+ /* Moving the data requires remembering how far off the */
+ /* dataend pointer was and the bp pointer too. */
+ /* */
+ /* <move data down>= */
+ size_t dataend_off = iop->dataend - iop->off;
+ memmove(iop->buf, iop->off, dataend_off);
+ iop->off = iop->buf;
+ bp = iop->dataend = iop->buf + dataend_off;
+
+ /* <reset pointers>= */
+ bp = iop->dataend;
+ } else {
+ /* <save position, grow buffer>= */
+ iop->scanoff = bp - iop->off;
+ grow_iop_buffer(iop);
+ bp = iop->off + iop->scanoff;
+ }
+ }
+
+ /* no data in buffer or ran out of data */
+ if ((iop->flag & IOP_AT_EOF) == 0 && (iop->dataend == NULL || bp >= iop->dataend)) {
+ iop->scanoff = bp - iop->off;
+ if (iop->dataend == NULL) {
+ iop->dataend = iop->buf; /* first read */
+ if ((iop->flag & IOP_IS_INTERNAL) != 0)
+ iop->dataend += strlen(iop->buf);
+ }
+ /* Use read to put more data into the buffer. If we've read */
+ /* as many characters as in the file, don't try to read more. */
+ /* */
+ /* */
+ /* <put more data into the buffer>= */
+ if ((iop->flag & IOP_IS_INTERNAL) != 0) {
+ iop->flag |= IOP_AT_EOF;
+ } else if (S_ISREG(iop->sbuf.st_mode) && iop->total >= iop->sbuf.st_size)
+ iop->flag |= IOP_AT_EOF;
+ else {
+#define min(x, y) (x < y ? x : y)
+ /* subtract one in read count to leave room for sentinel */
+ size_t room_left = iop->end - iop->dataend - 1;
+ size_t amt_to_read = min(iop->readsize, room_left);
+
+ if (amt_to_read < iop->readsize) {
+ /* <save position, grow buffer>= */
+ iop->scanoff = bp - iop->off;
+ grow_iop_buffer(iop);
+ bp = iop->off + iop->scanoff;
+ /* recalculate amt_to_read */
+ room_left = iop->end - iop->dataend - 1;
+ amt_to_read = min(iop->readsize, room_left);
+ }
+ while (amt_to_read + iop->readsize < room_left)
+ amt_to_read += iop->readsize;
+
+ iop->count = read(iop->fd, iop->dataend, amt_to_read);
+ if (iop->count == -1) {
+ if (! do_traditional && errcode != NULL) {
+ *errcode = errno;
+ iop->flag |= IOP_AT_EOF;
+ break;
+ } else
+ fatal(_("error reading input file `%s': %s"),
+ iop->name, strerror(errno));
+ } else if (iop->count == 0) {
+ /*
+ * hit EOF before matching RS, so end
+ * the record and set RT to ""
+ */
+ iop->flag |= IOP_AT_EOF;
+ }
+ else {
+ iop->dataend += iop->count;
+ iop->total += iop->count;
+ if (S_ISREG(iop->sbuf.st_mode) && iop->total >= iop->sbuf.st_size)
+ iop->flag |= IOP_AT_EOF;
+ /* reset the sentinel */
+ /* <set sentinel>= */
+ *iop->dataend = grRS;
+
+
+ }
+ }
+
+ bp = iop->off + iop->scanoff;
+ }
+
+ /* not needed for rsre, but doesn't hurt: */
+ /* <set sentinel>= */
+ *iop->dataend = grRS;
+
+
+
+ /* The hard part is the logic for regex matching. */
+ /* Start by searching the buffer for a match. Cases: */
+ /* */
+ /* 1. No match */
+ /* if not eof then */
+ /* grow buffer, add more data, try again */
+ /* else */
+ /* set RT to null */
+ /* return the record */
+ /* endif */
+ /* */
+ /* <actual rsre logic>= */
+ /* case 1, no match */
+ if (research(RSre, iop->off, 0, iop->dataend - iop->off, TRUE) == -1) {
+ if ((iop->flag & IOP_AT_EOF) == 0) {
+ bp = iop->dataend;
+ continue;
+ } else {
+ *out = iop->off;
+ retval = iop->dataend - iop->off;
+ iop->off = iop->dataend;
+ set_RT_to_null();
+ return retval;
+ }
+ }
+ /* 1a. Save the match info in variables for debugging, */
+ /* and readability. */
+ /* */
+ /* */
+ /* <actual rsre logic>= */
+ restart = RESTART(RSre, iop->off);
+ reend = REEND(RSre, iop->off);
+ set_res = TRUE;
+
+ /* 2. Match entirely within the bounds of the buffer: */
+ /* fill in RT */
+ /* break from loop to return record */
+ /* */
+ /* */
+ /* <actual rsre logic>= */
+ /* case 2 is simple, just keep going */
+ if (restart == reend) {
+ bp = iop->dataend;
+ continue;
+ }
+ /* 3. Match exactly at end: */
+ /* if not eof and re is not a simple string match */
+ /* grow buffer, add more data, try again */
+ /* else */
+ /* break from loop to set RT and return record */
+ /* fi */
+ /* */
+ /* */
+ /* <actual rsre logic>= */
+ if (iop->off + reend >= iop->dataend) {
+ if ((iop->flag & IOP_AT_EOF) == 0
+ && ! reisstring(RS->stptr, RS->stlen, RSre, iop->off)) {
+ bp = iop->dataend;
+ continue;
+ } else {
+ break;
+ }
+ }
+ /* 4. Match within xxx bytes of end & maybe islong re: */
+ /* if not eof */
+ /* grow buffer, add mor data, try again */
+ /* else */
+ /* fill in RT */
+ /* break from loop to return record */
+ /* fi */
+ /* */
+ /* */
+ /* <actual rsre logic>= */
+ /*
+ * case 4, match succeeded, but there may be more in
+ * the next input buffer.
+ *
+ * Consider an RS of xyz(abc)? where the
+ * exact end of the buffer is xyza and the
+ * next two, unread, characters are bc.
+ *
+ * This matches the "xyz" and ends up putting the
+ * "abc" into the front of the next record. Ooops.
+ *
+ * The remaybelong() function looks to see if the
+ * regex contains one of: + * ? |. This is a very
+ * simple heuristic, but in combination with the
+ * "end of match within a few bytes of end of buffer"
+ * check, should keep things reasonable.
+ */
+
+ /*
+ * XXX: The reisstring and remaybelong tests should
+ * really be done once when RS is assigned to and
+ * then tested as flags here. Maybe one day.
+ */
+
+ /* succession of tests is easier to trace in GDB. */
+ if ((iop->flag & IOP_AT_EOF) == 0) {
+ if (remaybelong(RS->stptr, RS->stlen)) {
+ char *matchend = iop->off + reend;
+
+ if (iop->dataend - matchend < RS->stlen) {
+ bp = iop->dataend;
+ continue;
+ }
+ }
+ }
+
+
+
+ /* Here is the end loop logic. */
+ /* */
+ /* */
+ /* <rsre end loop logic>= */
+ if (bp <= iop->dataend) {
+ break;
+ } else
+ bp--;
+
+ if ((iop->flag & IOP_IS_INTERNAL) != 0) {
+ iop->flag |= IOP_AT_EOF;
+ break;
+ }
+
+ if ((iop->flag & IOP_AT_EOF) != 0)
+ break;
+
+
+ /* hit end of data in buffer, continue around to find more */
+ }
+ /* And the end of function logic: */
+ /* */
+ /* */
+ /* <rsre code>= */
+ /* now out of loop: either we hit EOF, or we found rs */
+ /* Upon EOF, set RT to null, set pointer to null, return EOF. */
+ /* We don't do this unless we've also run out of data. */
+ /* */
+ /* */
+ /* <check for EOF, return right stuff>= */
+ if ((iop->flag & IOP_AT_EOF) != 0 && iop->off >= iop->dataend) {
+ *out = NULL;
+ set_RT_to_null();
+ return EOF;
+ }
+
+ /* found rs, return the record */
+
+ assert(set_res);
+ /* set RT before adjusting pointers in iop. */
+ set_RT(iop->off + restart, reend - restart);
+
+ *out = iop->off;
+ retval = (iop->off + restart) - iop->off;
+ iop->off += reend;
+
+ return retval;
}
-#endif
/* set_RS --- update things as appropriate when RS is set */
@@ -2500,28 +3241,109 @@ set_RS()
{
static NODE *save_rs = NULL;
- if (save_rs && cmp_nodes(RS_node->var_value, save_rs) == 0)
- return;
+ /*
+ * Don't use cmp_nodes(), which pays attention to IGNORECASE.
+ */
+ if (save_rs
+ && RS_node->var_value->stlen == save_rs->stlen
+ && STREQN(RS_node->var_value->stptr, save_rs->stptr, save_rs->stlen)) {
+ /*
+ * It could be that just IGNORECASE changed. If so,
+ * update the regex and then do the same for FS.
+ * set_IGNORECASE() relies on this routine to call
+ * set_FS().
+ */
+ RS_regexp = (IGNORECASE ? RS_re_no_case : RS_re_yes_case);
+ goto set_FS;
+ }
unref(save_rs);
save_rs = dupnode(RS_node->var_value);
RS_is_null = FALSE;
RS = force_string(RS_node->var_value);
if (RS_regexp != NULL) {
- refree(RS_regexp);
- RS_regexp = NULL;
+ refree(RS_re_yes_case);
+ refree(RS_re_no_case);
+ RS_re_yes_case = RS_re_no_case = RS_regexp = NULL;
}
- if (RS->stlen == 0)
+ if (RS->stlen == 0) {
RS_is_null = TRUE;
- else if (RS->stlen > 1) {
+ get_a_record = rsnull_get_a_record;
+ } else if (RS->stlen > 1) {
static int warned = FALSE;
- RS_regexp = make_regexp(RS->stptr, RS->stlen, IGNORECASE, TRUE);
+ RS_re_yes_case = make_regexp(RS->stptr, RS->stlen, FALSE);
+ RS_re_no_case = make_regexp(RS->stptr, RS->stlen, TRUE);
+ RS_regexp = (IGNORECASE ? RS_re_no_case : RS_re_yes_case);
+
+ get_a_record = rsre_get_a_record;
if (do_lint && ! warned) {
lintwarn(_("multicharacter value of `RS' is a gawk extension"));
warned = TRUE;
}
+ } else
+ get_a_record = rs1_get_a_record;
+set_FS:
+ if (! using_fieldwidths())
+ set_FS();
+}
+
+/* pty_vs_pipe --- return true if should use pty instead of pipes for `|&' */
+
+/*
+ * This works by checking if PROCINFO["command", "pty"] exists and is true.
+ */
+
+static int
+pty_vs_pipe(const char *command)
+{
+#ifdef HAVE_TERMIOS_H
+ char *full_index;
+ size_t full_len;
+ NODE *val;
+ NODE *sub;
+
+ if (PROCINFO_node == NULL)
+ return FALSE;
+
+ full_len = strlen(command)
+ + SUBSEP_node->var_value->stlen
+ + 3 /* strlen("pty") */
+ + 1; /* string terminator */
+ emalloc(full_index, char *, full_len, "pty_vs_pipe");
+ sprintf(full_index, "%s%.*spty", command,
+ (int) SUBSEP_node->var_value->stlen, SUBSEP_node->var_value->stptr);
+
+ sub = tmp_string(full_index, strlen(full_index));
+ val = in_array(PROCINFO_node, sub);
+ free_temp(sub);
+ free(full_index);
+
+ if (val) {
+ if (val->flags & MAYBE_NUM)
+ (void) force_number(val);
+ if (val->flags & NUMBER)
+ return (val->numbr != 0.0);
+ else
+ return (val->stlen != 0);
}
+#endif /* HAVE_TERMIOS_H */
+ return FALSE;
+}
+
+/* iopflags2str --- make IOP flags printable */
+
+const char *
+iopflags2str(int flag)
+{
+ static struct flagtab values[] = {
+ { IOP_IS_TTY, "IOP_IS_TTY" },
+ { IOP_IS_INTERNAL, "IOP_IS_INTERNAL" },
+ { IOP_NO_FREE, "IOP_NO_FREE" },
+ { IOP_NOFREE_OBJ, "IOP_NOFREE_OBJ" },
+ { IOP_AT_EOF, "IOP_AT_EOF" },
+ { 0, NULL }
+ };
- set_FS_if_not_FIELDWIDTHS();
+ return genflags2str(flag, values);
}
diff --git a/m4/ChangeLog b/m4/ChangeLog
index 295e4d0d..c0168b59 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,20 @@
+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.
+
+Wed Nov 20 13:15:59 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * arch.m4 (GAWK_AIX_TWEAK): Add -DGAWK_AIX for use in
+ io.c to get real pipes. Ugh.
+ Change test to -d /lpp so it actually works. Sigh.
+
Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.1: Release tar file made.
diff --git a/m4/arch.m4 b/m4/arch.m4
index e837ccf1..72319360 100644
--- a/m4/arch.m4
+++ b/m4/arch.m4
@@ -1,7 +1,7 @@
dnl
dnl arch.m4 --- autoconf input file for gawk
dnl
-dnl Copyright (C) 1995, 1996, 1998, 1999, 2000 the Free Software Foundation, Inc.
+dnl Copyright (C) 1995, 1996, 1998, 1999, 2000, 2003 the Free Software Foundation, Inc.
dnl
dnl This file is part of GAWK, the GNU implementation of the
dnl AWK Progamming Language.
@@ -25,9 +25,9 @@ dnl Check for AIX and add _XOPEN_SOURCE_EXTENDED
AC_DEFUN(GAWK_AC_AIX_TWEAK, [
AC_MSG_CHECKING([for AIX compilation hacks])
AC_CACHE_VAL(gawk_cv_aix_hack, [
-if test -d /lpp/bos
+if test -d /lpp
then
- CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
+ CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED=1 -DGAWK_AIX=1"
gawk_cv_aix_hack=yes
else
gawk_cv_aix_hack=no
diff --git a/m4/gettext.m4 b/m4/gettext.m4
index 94bc26c8..45cad855 100644
--- a/m4/gettext.m4
+++ b/m4/gettext.m4
@@ -1,4 +1,4 @@
-# gettext.m4 serial 14 (gettext-0.11.2)
+# gettext.m4 serial 17 (gettext-0.11.5)
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
@@ -33,7 +33,9 @@ dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
dnl $(top_builddir)/intl/libintl.a will be created.
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
dnl implementations (in libc or libintl) without the ngettext() function
-dnl will be ignored.
+dnl will be ignored. If NEEDSYMBOL is specified and is
+dnl 'need-formatstring-macros', then GNU gettext implementations that don't
+dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
dnl INTLDIR is used to find the intl libraries. If empty,
dnl the value `$(top_builddir)/intl/' is used.
dnl
@@ -60,9 +62,9 @@ AC_DEFUN([AM_GNU_GETTEXT],
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
])])])])])
- ifelse([$2], [], , [ifelse([$2], [need-ngettext], ,
+ ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
-])])])
+])])])])
define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
@@ -75,6 +77,21 @@ AC_DEFUN([AM_GNU_GETTEXT],
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
+ dnl Sometimes libintl requires libiconv, so first search for libiconv.
+ dnl Ideally we would do this search only after the
+ dnl if test "$USE_NLS" = "yes"; then
+ dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+ dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
+ dnl the configure script would need to contain the same shell code
+ dnl again, outside any 'if'. There are two solutions:
+ dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
+ dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
+ dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
+ dnl documented, we avoid it.
+ ifelse(gt_included_intl, yes, , [
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+ ])
+
AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE(nls,
@@ -110,13 +127,20 @@ AC_DEFUN([AM_GNU_GETTEXT],
dnl to fall back to GNU NLS library.
dnl Add a version number to the cache macros.
- define([gt_api_version], ifelse([$2], [need-ngettext], 2, 1))
+ define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
[AC_TRY_LINK([#include <libintl.h>
-extern int _nl_msg_cat_cntr;
+]ifelse([$2], [need-formatstring-macros],
+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+], [])[extern int _nl_msg_cat_cntr;
extern int *_nl_domain_bindings;],
[bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
@@ -141,7 +165,14 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
LIBS="$LIBS $LIBINTL"
dnl Now see whether libintl exists and does not depend on libiconv.
AC_TRY_LINK([#include <libintl.h>
-extern int _nl_msg_cat_cntr;
+]ifelse([$2], [need-formatstring-macros],
+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+], [])[extern int _nl_msg_cat_cntr;
extern
#ifdef __cplusplus
"C"
@@ -155,7 +186,14 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
LIBS="$LIBS $LIBICONV"
AC_TRY_LINK([#include <libintl.h>
-extern int _nl_msg_cat_cntr;
+]ifelse([$2], [need-formatstring-macros],
+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+], [])[extern int _nl_msg_cat_cntr;
extern
#ifdef __cplusplus
"C"
@@ -450,7 +488,7 @@ AC_DEFUN([AM_PO_SUBDIRS],
;;
esac
done],
- [# Capture the value of obsolete $ALL_LINGUAS because we need it to compute
+ [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
# POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
# from automake.
eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
@@ -479,6 +517,10 @@ AC_DEFUN([AM_INTL_SUBDIR],
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_REQUIRE([jm_GLIBC21])dnl
+ AC_REQUIRE([gt_INTDIV0])dnl
+ AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
+ AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
+ AC_REQUIRE([gt_INTTYPES_PRI])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
stdlib.h string.h unistd.h sys/param.h])
@@ -488,7 +530,9 @@ strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
AM_ICONV
AM_LANGINFO_CODESET
- AM_LC_MESSAGES
+ if test $ac_cv_header_locale_h = yes; then
+ AM_LC_MESSAGES
+ fi
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
dnl because plural.y uses bison specific features. It requires at least
@@ -537,3 +581,7 @@ AC_DEFUN([AM_MKINSTALLDIRS],
fi
AC_SUBST(MKINSTALLDIRS)
])
+
+
+dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
diff --git a/m4/iconv.m4 b/m4/iconv.m4
index f81e8b99..c5f35798 100644
--- a/m4/iconv.m4
+++ b/m4/iconv.m4
@@ -1,4 +1,4 @@
-# iconv.m4 serial AM3 (gettext-0.11)
+# iconv.m4 serial AM4 (gettext-0.11.3)
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
@@ -8,11 +8,8 @@ dnl the same distribution terms as the rest of that program.
dnl From Bruno Haible.
-AC_DEFUN([AM_ICONV_LINK],
+AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
[
- dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
- dnl those with the standalone portable GNU libiconv installed).
-
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
@@ -20,6 +17,16 @@ AC_DEFUN([AM_ICONV_LINK],
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
dnl accordingly.
AC_LIB_LINKFLAGS_BODY([iconv])
+])
+
+AC_DEFUN([AM_ICONV_LINK],
+[
+ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+ dnl those with the standalone portable GNU libiconv installed).
+
+ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+ dnl accordingly.
+ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
dnl because if the user has installed libiconv and not disabled its use
@@ -69,7 +76,7 @@ AC_DEFUN([AM_ICONV_LINK],
AC_DEFUN([AM_ICONV],
[
- AC_REQUIRE([AM_ICONV_LINK])
+ AM_ICONV_LINK
if test "$am_cv_func_iconv" = yes; then
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL(am_cv_proto_iconv, [
diff --git a/m4/intdiv0.m4 b/m4/intdiv0.m4
new file mode 100644
index 00000000..55dddcf1
--- /dev/null
+++ b/m4/intdiv0.m4
@@ -0,0 +1,72 @@
+# intdiv0.m4 serial 1 (gettext-0.11.3)
+dnl Copyright (C) 2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gt_INTDIV0],
+[
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+
+ AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
+ gt_cv_int_divbyzero_sigfpe,
+ [
+ AC_TRY_RUN([
+#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);
+}
+], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
+ [
+ # Guess based on the CPU.
+ case "$host_cpu" in
+ alpha* | i[34567]86 | m68k | s390*)
+ gt_cv_int_divbyzero_sigfpe="guessing yes";;
+ *)
+ gt_cv_int_divbyzero_sigfpe="guessing no";;
+ esac
+ ])
+ ])
+ case "$gt_cv_int_divbyzero_sigfpe" in
+ *yes) value=1;;
+ *) value=0;;
+ esac
+ AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
+ [Define if integer division by zero raises signal SIGFPE.])
+])
diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4
new file mode 100644
index 00000000..fd007c31
--- /dev/null
+++ b/m4/inttypes-pri.m4
@@ -0,0 +1,32 @@
+# inttypes-pri.m4 serial 1 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
+# macros to non-string values. This is the case on AIX 4.3.3.
+
+AC_DEFUN([gt_INTTYPES_PRI],
+[
+ AC_REQUIRE([gt_HEADER_INTTYPES_H])
+ if test $gt_cv_header_inttypes_h = yes; then
+ AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
+ gt_cv_inttypes_pri_broken,
+ [
+ AC_TRY_COMPILE([#include <inttypes.h>
+#ifdef PRId32
+char *p = PRId32;
+#endif
+], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
+ ])
+ fi
+ if test "$gt_cv_inttypes_pri_broken" = yes; then
+ AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
+ [Define if <inttypes.h> exists and defines unusable PRI* macros.])
+ fi
+])
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
new file mode 100644
index 00000000..ab370ffe
--- /dev/null
+++ b/m4/inttypes.m4
@@ -0,0 +1,27 @@
+# inttypes.m4 serial 1 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
+# <sys/types.h>.
+
+AC_DEFUN([gt_HEADER_INTTYPES_H],
+[
+ AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
+ [
+ AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <inttypes.h>],
+ [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
+ ])
+ if test $gt_cv_header_inttypes_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
+ [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
+ fi
+])
diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4
new file mode 100644
index 00000000..400a1118
--- /dev/null
+++ b/m4/inttypes_h.m4
@@ -0,0 +1,28 @@
+# inttypes_h.m4 serial 4 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
+[
+ AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
+ [AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <inttypes.h>],
+ [uintmax_t i = (uintmax_t) -1;],
+ jm_ac_cv_header_inttypes_h=yes,
+ jm_ac_cv_header_inttypes_h=no)])
+ if test $jm_ac_cv_header_inttypes_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
+[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
+ fi
+])
diff --git a/m4/jm-mktime.m4 b/m4/jm-mktime.m4
deleted file mode 100644
index be4191f4..00000000
--- a/m4/jm-mktime.m4
+++ /dev/null
@@ -1,178 +0,0 @@
-#serial 7
-
-dnl From Jim Meyering.
-dnl A wrapper around AC_FUNC_MKTIME.
-
-AC_DEFUN(jm_FUNC_MKTIME,
-[AC_REQUIRE([AC_FUNC_MKTIME])dnl
-
- dnl mktime.c uses localtime_r if it exists. Check for it.
- AC_CHECK_FUNCS(localtime_r)
-
- if test $ac_cv_func_working_mktime = no; then
- AC_DEFINE_UNQUOTED(mktime, rpl_mktime,
- [Define to rpl_mktime if the replacement function should be used.])
- fi
-])
-
-# AC_FUNC_MKTIME
-# --------------
-# Stolen from CVS Autoconf. Should be removed once you use Autoconf 2.15.
-AC_DEFUN(AC_FUNC_MKTIME,
-[AC_REQUIRE([AC_HEADER_TIME])dnl
-AC_CHECK_HEADERS(sys/time.h unistd.h)
-AC_CHECK_FUNCS(alarm)
-AC_CACHE_CHECK([for working mktime], ac_cv_func_working_mktime,
-[AC_TRY_RUN(
-[/* Test program from Paul Eggert (eggert@twinsun.com)
- and Tony Leneis (tony@plaza.ds.adp.com). */
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#if !HAVE_ALARM
-# define alarm(X) /* empty */
-#endif
-
-/* Work around redefinition to rpl_putenv by other config tests. */
-#undef putenv
-
-static time_t time_t_max;
-
-/* Values we'll use to set the TZ environment variable. */
-static const char *const tz_strings[] = {
- (const char *) 0, "TZ=GMT0", "TZ=JST-9",
- "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
-};
-#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
-
-/* Fail if mktime fails to convert a date in the spring-forward gap.
- Based on a problem report from Andreas Jaeger. */
-static void
-spring_forward_gap ()
-{
- /* glibc (up to about 1998-10-07) failed this test) */
- struct tm tm;
-
- /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
- instead of "TZ=America/Vancouver" in order to detect the bug even
- on systems that don't support the Olson extension, or don't have the
- full zoneinfo tables installed. */
- putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
-
- tm.tm_year = 98;
- tm.tm_mon = 3;
- tm.tm_mday = 5;
- tm.tm_hour = 2;
- tm.tm_min = 0;
- tm.tm_sec = 0;
- tm.tm_isdst = -1;
- if (mktime (&tm) == (time_t)-1)
- exit (1);
-}
-
-static void
-mktime_test (now)
- time_t now;
-{
- struct tm *lt;
- if ((lt = localtime (&now)) && mktime (lt) != now)
- exit (1);
- now = time_t_max - now;
- if ((lt = localtime (&now)) && mktime (lt) != now)
- exit (1);
-}
-
-static void
-irix_6_4_bug ()
-{
- /* Based on code from Ariel Faigon. */
- struct tm tm;
- tm.tm_year = 96;
- tm.tm_mon = 3;
- tm.tm_mday = 0;
- tm.tm_hour = 0;
- tm.tm_min = 0;
- tm.tm_sec = 0;
- tm.tm_isdst = -1;
- mktime (&tm);
- if (tm.tm_mon != 2 || tm.tm_mday != 31)
- exit (1);
-}
-
-static void
-bigtime_test (j)
- int j;
-{
- struct tm tm;
- time_t now;
- tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
- now = mktime (&tm);
- if (now != (time_t) -1)
- {
- struct tm *lt = localtime (&now);
- if (! (lt
- && lt->tm_year == tm.tm_year
- && lt->tm_mon == tm.tm_mon
- && lt->tm_mday == tm.tm_mday
- && lt->tm_hour == tm.tm_hour
- && lt->tm_min == tm.tm_min
- && lt->tm_sec == tm.tm_sec
- && lt->tm_yday == tm.tm_yday
- && lt->tm_wday == tm.tm_wday
- && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
- == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
- exit (1);
- }
-}
-
-int
-main ()
-{
- time_t t, delta;
- int i, j;
-
- /* This test makes some buggy mktime implementations loop.
- Give up after 60 seconds; a mktime slower than that
- isn't worth using anyway. */
- alarm (60);
-
- for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
- continue;
- time_t_max--;
- delta = time_t_max / 997; /* a suitable prime number */
- for (i = 0; i < N_STRINGS; i++)
- {
- if (tz_strings[i])
- putenv (tz_strings[i]);
-
- for (t = 0; t <= time_t_max - delta; t += delta)
- mktime_test (t);
- mktime_test ((time_t) 60 * 60);
- mktime_test ((time_t) 60 * 60 * 24);
-
- for (j = 1; 0 < j; j *= 2)
- bigtime_test (j);
- bigtime_test (j - 1);
- }
- irix_6_4_bug ();
- spring_forward_gap ();
- exit (0);
-}],
-ac_cv_func_working_mktime=yes, ac_cv_func_working_mktime=no,
-ac_cv_func_working_mktime=no)])
-if test $ac_cv_func_working_mktime = no; then
- LIBOBJS="$LIBOBJS mktime.${ac_objext}"
-fi
-])# AC_FUNC_MKTIME \ No newline at end of file
diff --git a/m4/largefile.m4 b/m4/largefile.m4
deleted file mode 100644
index db38757d..00000000
--- a/m4/largefile.m4
+++ /dev/null
@@ -1,92 +0,0 @@
-#serial 19
-
-dnl By default, many hosts won't let programs access large files;
-dnl one must use special compiler options to get large-file access to work.
-dnl For more details about this brain damage please see:
-dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
-
-dnl Written by Paul Eggert <eggert@twinsun.com>.
-
-dnl Internal subroutine of AC_SYS_LARGEFILE.
-dnl AC_SYS_LARGEFILE_TEST_INCLUDES
-AC_DEFUN(AC_SYS_LARGEFILE_TEST_INCLUDES,
- [[#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply "#define LARGE_OFF_T 9223372036854775807",
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
- ]])
-
-dnl Internal subroutine of AC_SYS_LARGEFILE.
-dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLUDES, FUNCTION-BODY)
-AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
- [AC_CACHE_CHECK([for $1 value needed for large files], $3,
- [$3=no
- AC_TRY_COMPILE([$5],
- [$6],
- ,
- [AC_TRY_COMPILE([#define $1 $2]
-[$5]
- ,
- [$6],
- [$3=$2])])])
- if test "[$]$3" != no; then
- AC_DEFINE_UNQUOTED([$1], [$]$3, [$4])
- fi])
-
-AC_DEFUN(AC_SYS_LARGEFILE,
- [AC_REQUIRE([AC_PROG_CC])
- AC_ARG_ENABLE(largefile,
- [ --disable-largefile omit support for large files])
- if test "$enable_largefile" != no; then
-
- AC_CACHE_CHECK([for special C compiler options needed for large files],
- ac_cv_sys_largefile_CC,
- [ac_cv_sys_largefile_CC=no
- if test "$GCC" != yes; then
- # IRIX 6.2 and later do not support large files by default,
- # so use the C compiler's -n32 option if that helps.
- AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , ,
- [ac_save_CC="$CC"
- CC="$CC -n32"
- AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, ,
- ac_cv_sys_largefile_CC=' -n32')
- CC="$ac_save_CC"])
- fi])
- if test "$ac_cv_sys_largefile_CC" != no; then
- CC="$CC$ac_cv_sys_largefile_CC"
- fi
-
- AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
- ac_cv_sys_file_offset_bits,
- [Number of bits in a file offset, on hosts where this is settable.],
- AC_SYS_LARGEFILE_TEST_INCLUDES)
- AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
- ac_cv_sys_large_files,
- [Define for large files, on AIX-style hosts.],
- AC_SYS_LARGEFILE_TEST_INCLUDES)
- fi
- ])
-
-AC_DEFUN(AC_FUNC_FSEEKO,
- [AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
- ac_cv_sys_largefile_source,
- [Define to make fseeko visible on some hosts (e.g. glibc 2.2).],
- [#include <stdio.h>], [return !fseeko;])
- # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
- # in glibc 2.1.3, but that breaks too many other things.
- # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
-
- AC_CACHE_CHECK([for fseeko], ac_cv_func_fseeko,
- [ac_cv_func_fseeko=no
- AC_TRY_LINK([#include <stdio.h>],
- [return fseeko && fseeko (stdin, 0, 0);],
- [ac_cv_func_fseeko=yes])])
- if test $ac_cv_func_fseeko != no; then
- AC_DEFINE(HAVE_FSEEKO, 1,
- [Define if fseeko (and presumably ftello) exists and is declared.])
- fi])
diff --git a/m4/lcmessage.m4 b/m4/lcmessage.m4
index ffbf915f..ffd4008b 100644
--- a/m4/lcmessage.m4
+++ b/m4/lcmessage.m4
@@ -1,4 +1,4 @@
-# lcmessage.m4 serial 2 (gettext-0.10.40)
+# lcmessage.m4 serial 3 (gettext-0.11.3)
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
@@ -21,12 +21,12 @@ dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
# Check whether LC_MESSAGES is available in <locale.h>.
AC_DEFUN([AM_LC_MESSAGES],
- [if test $ac_cv_header_locale_h = yes; then
- AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
- [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+[
+ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
- if test $am_cv_val_LC_MESSAGES = yes; then
- AC_DEFINE(HAVE_LC_MESSAGES, 1,
- [Define if your <locale.h> file defines LC_MESSAGES.])
- fi
- fi])
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES, 1,
+ [Define if your <locale.h> file defines LC_MESSAGES.])
+ fi
+])
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
index 09f7f172..6b942510 100644
--- a/m4/lib-link.m4
+++ b/m4/lib-link.m4
@@ -1,4 +1,4 @@
-# lib-link.m4 serial 2 (gettext-0.11.2)
+# lib-link.m4 serial 3 (gettext-0.11.3)
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
@@ -116,6 +116,10 @@ AC_DEFUN([AC_LIB_RPATH],
hardcode_minus_L="$acl_cv_hardcode_minus_L"
sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
+ dnl Determine whether the user wants rpath handling at all.
+ AC_ARG_ENABLE(rpath,
+ [ --disable-rpath do not hardcode runtime library paths],
+ :, enable_rpath=yes)
])
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
@@ -245,7 +249,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dnl Linking with a shared library. We attempt to hardcode its
dnl directory into the executable's runpath, unless it's the
dnl standard /usr/lib.
- if test "X$found_dir" = "X/usr/lib"; then
+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
dnl No hardcoding is needed.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
@@ -436,29 +440,31 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
;;
-R*)
dir=`echo "X$dep" | sed -e 's/^X-R//'`
- dnl Potentially add DIR to rpathdirs.
- dnl The rpathdirs will be appended to $LIBNAME at the end.
- haveit=
- for x in $rpathdirs; do
- if test "X$x" = "X$dir"; then
- haveit=yes
- break
+ if test "$enable_rpath" != no; then
+ dnl Potentially add DIR to rpathdirs.
+ dnl The rpathdirs will be appended to $LIBNAME at the end.
+ haveit=
+ for x in $rpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ rpathdirs="$rpathdirs $dir"
fi
- done
- if test -z "$haveit"; then
- rpathdirs="$rpathdirs $dir"
- fi
- dnl Potentially add DIR to ltrpathdirs.
- dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
- haveit=
- for x in $ltrpathdirs; do
- if test "X$x" = "X$dir"; then
- haveit=yes
- break
+ dnl Potentially add DIR to ltrpathdirs.
+ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+ haveit=
+ for x in $ltrpathdirs; do
+ if test "X$x" = "X$dir"; then
+ haveit=yes
+ break
+ fi
+ done
+ if test -z "$haveit"; then
+ ltrpathdirs="$ltrpathdirs $dir"
fi
- done
- if test -z "$haveit"; then
- ltrpathdirs="$ltrpathdirs $dir"
fi
;;
-l*)
diff --git a/m4/socket.m4 b/m4/socket.m4
index e0cbb7be..e0b51fb1 100644
--- a/m4/socket.m4
+++ b/m4/socket.m4
@@ -1,7 +1,7 @@
dnl
dnl socket.m4 --- autoconf input file for gawk
dnl
-dnl Copyright (C) 1995, 96, 98, 99, 2000 the Free Software Foundation, Inc.
+dnl Copyright (C) 1995, 1996, 1998, 1999, 2000, 2003 the Free Software Foundation, Inc.
dnl
dnl This file is part of GAWK, the GNU implementation of the
dnl AWK Progamming Language.
@@ -79,7 +79,7 @@ then
esac
AC_MSG_RESULT([${gawk_lib_loc}])
- AC_DEFINE(HAVE_SOCKETS)
+ AC_DEFINE(HAVE_SOCKETS, 1, [we have sockets on this system])
fi
AC_SUBST(SOCKET_LIBS)dnl
])dnl
diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4
deleted file mode 100644
index 2645c1ae..00000000
--- a/m4/ssize_t.m4
+++ /dev/null
@@ -1,24 +0,0 @@
-#serial 1
-
-dnl AC_PREREQ(2.14a)
-
-dnl This is a specialization of AC_CHECK_TYPE applied to `ssize_t' with
-dnl the difference that it also includes unistd.h on systems that have it.
-dnl On Fujitsu UXP/V systems ssize_t is defined in unistd.h.
-AC_DEFUN(GAWK_AC_TYPE_SSIZE_T,
- [
- AC_CHECK_HEADERS(unistd.h)
- AC_CHECK_TYPE(ssize_t, int,
- [
-#include <sys/types.h>
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
- ]
- )
- ]
-)
diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4
new file mode 100644
index 00000000..4b5a4ac6
--- /dev/null
+++ b/m4/stdint_h.m4
@@ -0,0 +1,28 @@
+# stdint_h.m4 serial 2 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([jm_AC_HEADER_STDINT_H],
+[
+ AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
+ [AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <stdint.h>],
+ [uintmax_t i = (uintmax_t) -1;],
+ jm_ac_cv_header_stdint_h=yes,
+ jm_ac_cv_header_stdint_h=no)])
+ if test $jm_ac_cv_header_stdint_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
+[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
+ fi
+])
diff --git a/m4/strtod.m4 b/m4/strtod.m4
index 8185e6cf..8f0abaa7 100644
--- a/m4/strtod.m4
+++ b/m4/strtod.m4
@@ -54,6 +54,6 @@ main ()
gawk_ac_cv_func_strtod_c89=yes, gawk_ac_cv_func_strtod_c89=no,
gawk_ac_cv_func_strtod_c89=no)])
if test $gawk_ac_cv_func_strtod_c89 = no; then
- AC_DEFINE(STRTOD_NOT_C89)
+ AC_DEFINE(STRTOD_NOT_C89, 1, [strtod doesn't have C89 semantics])
fi
])# GAWK_FUNC_STRTOD_C89
diff --git a/m4/uintmax_t.m4 b/m4/uintmax_t.m4
new file mode 100644
index 00000000..ec3a8b92
--- /dev/null
+++ b/m4/uintmax_t.m4
@@ -0,0 +1,29 @@
+# uintmax_t.m4 serial 6 (gettext-0.11)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+AC_PREREQ(2.13)
+
+# Define uintmax_t to `unsigned long' or `unsigned long long'
+# if <inttypes.h> does not exist.
+
+AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
+[
+ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([jm_AC_HEADER_STDINT_H])
+ if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
+ AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
+ test $ac_cv_type_unsigned_long_long = yes \
+ && ac_type='unsigned long long' \
+ || ac_type='unsigned long'
+ AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
+ [Define to unsigned long or unsigned long long
+ if <inttypes.h> and <stdint.h> don't define.])
+ fi
+])
diff --git a/m4/ulonglong.m4 b/m4/ulonglong.m4
new file mode 100644
index 00000000..c375e474
--- /dev/null
+++ b/m4/ulonglong.m4
@@ -0,0 +1,23 @@
+# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
+dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
+[
+ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
+ [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
+ [unsigned long long ullmax = (unsigned long long) -1;
+ return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
+ ac_cv_type_unsigned_long_long=yes,
+ ac_cv_type_unsigned_long_long=no)])
+ if test $ac_cv_type_unsigned_long_long = yes; then
+ AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
+ [Define if you have the unsigned long long type.])
+ fi
+])
diff --git a/main.c b/main.c
index bb772d93..6826207d 100644
--- a/main.c
+++ b/main.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2002 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.
@@ -42,17 +42,17 @@
#define DEFAULT_PROFILE "awkprof.out" /* where to put profile */
#define DEFAULT_VARFILE "awkvars.out" /* where to put vars */
-static char *varfile = DEFAULT_VARFILE;
+static const char *varfile = DEFAULT_VARFILE;
-static void usage P((int exitval, FILE *fp));
-static void copyleft P((void));
+static void usage P((int exitval, FILE *fp)) ATTRIBUTE_NORETURN;
+static void copyleft P((void)) ATTRIBUTE_NORETURN;
static void cmdline_fs P((char *str));
static void init_args P((int argc0, int argc, char *argv0, char **argv));
static void init_vars P((void));
-static void pre_assign P((char *v));
-RETSIGTYPE catchsig P((int sig, int code));
-static void nostalgia P((void));
-static void version P((void));
+static void add_src P((struct src **data, long *num, long *alloc, enum srctype stype, char *val));
+static RETSIGTYPE catchsig P((int sig)) ATTRIBUTE_NORETURN;
+static void nostalgia P((void)) ATTRIBUTE_NORETURN;
+static void version P((void)) ATTRIBUTE_NORETURN;
static void init_fds P((void));
static void init_groupset P((void));
@@ -105,6 +105,20 @@ extern int yydebug;
struct src *srcfiles = NULL; /* source file name(s) */
long numfiles = -1; /* how many source files */
+static long allocfiles; /* for how many is *srcfiles allocated */
+
+#define srcfiles_add(stype, val) \
+ add_src(&srcfiles, &numfiles, &allocfiles, stype, val)
+
+static struct src *preassigns = NULL; /* requested via -v or -F */
+static long numassigns = -1; /* how many of them */
+static long allocassigns; /* for how many is allocated */
+
+#define preassigns_add(stype, val) \
+ add_src(&preassigns, &numassigns, &allocassigns, stype, val)
+
+#undef do_lint
+#undef do_lint_old
int do_traditional = FALSE; /* no gnu extensions, add traditional weirdnesses */
int do_posix = FALSE; /* turn off gnu and unix extensions */
@@ -121,10 +135,13 @@ int do_tidy_mem = FALSE; /* release vars when done */
int in_begin_rule = FALSE; /* we're in a BEGIN rule */
int in_end_rule = FALSE; /* we're in a END rule */
int whiny_users = FALSE; /* do things that whiny users want */
+#ifdef MBS_SUPPORT
+int gawk_mb_cur_max = 1; /* MB_CUR_MAX value, see comment in main() */
+#endif
int output_is_tty = FALSE; /* control flushing of output */
-extern char *version_string; /* current version, for printing */
+extern const char *version_string; /* current version, for printing */
#if defined (HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0
GETGROUPS_T *groupset; /* current group set */
@@ -137,10 +154,14 @@ NODE *expression_value;
#if _MSC_VER == 510
void (*lintfunc) P((va_list va_alist, ...)) = warning;
#else
-void (*lintfunc) P((char *mesg, ...)) = warning;
+#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
+void (*lintfunc) P((const char *mesg, ...)) = warning;
+#else
+void (*lintfunc) () = warning;
+#endif
#endif
-static struct option optab[] = {
+static const struct option optab[] = {
{ "compat", no_argument, & do_traditional, 1 },
{ "traditional", no_argument, & do_traditional, 1 },
{ "lint", optional_argument, NULL, 'l' },
@@ -167,6 +188,11 @@ static struct option optab[] = {
{ NULL, 0, NULL, '\0' }
};
+#ifdef NO_LINT
+#define do_lint 0
+#define do_lint_old 0
+#endif
+
/* main --- process args, parse program, run it, clean up */
int
@@ -181,6 +207,7 @@ main(int argc, char **argv)
extern int optind;
extern int opterr;
extern char *optarg;
+ int i;
/* do these checks early */
if (getenv("TIDYMEM") != NULL)
@@ -194,19 +221,42 @@ main(int argc, char **argv)
mtrace();
#endif /* HAVE_MCHECK_H */
-
+#if defined(LC_CTYPE)
setlocale(LC_CTYPE, "");
+#endif
+#if defined(LC_COLLATE)
setlocale(LC_COLLATE, "");
-#if HAVE_LC_MESSAGES
+#endif
+#if HAVE_LC_MESSAGES && defined(LC_MESSAGES)
setlocale(LC_MESSAGES, "");
#endif
+#if defined(LC_NUMERIC)
+ /*
+ * Force the issue here. On some systems, gawk ends up
+ * printing output with commas for the decimal point.
+ */
+ setlocale(LC_NUMERIC, "C");
+#endif
+#if defined(LC_TIME)
+ setlocale(LC_TIME, "");
+#endif
+
+#ifdef MBS_SUPPORT
+ /*
+ * In glibc, MB_CUR_MAX is actually a function. This value is
+ * tested *a lot* in many speed-critical places in gawk. Caching
+ * this value once makes a speed difference.
+ */
+ gawk_mb_cur_max = MB_CUR_MAX;
+#endif
+
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
- (void) signal(SIGFPE, (RETSIGTYPE (*) P((int))) catchsig);
- (void) signal(SIGSEGV, (RETSIGTYPE (*) P((int))) catchsig);
+ (void) signal(SIGFPE, catchsig);
+ (void) signal(SIGSEGV, catchsig);
#ifdef SIGBUS
- (void) signal(SIGBUS, (RETSIGTYPE (*) P((int))) catchsig);
+ (void) signal(SIGBUS, catchsig);
#endif
myname = gawk_name(argv[0]);
@@ -220,42 +270,11 @@ main(int argc, char **argv)
if (argc < 2)
usage(1, stderr);
- /* initialize the null string */
- Nnull_string = make_string("", 0);
- Nnull_string->numbr = 0.0;
- Nnull_string->type = Node_val;
- Nnull_string->flags = (PERM|STR|STRING|NUM|NUMBER);
-
- /*
- * Tell the regex routines how they should work.
- * Do this before initializing variables, since
- * they could want to do a regexp compile.
- */
- resetup();
-
- /* Set up the special variables */
- /*
- * Note that this must be done BEFORE arg parsing else -F
- * breaks horribly.
- */
- init_vars();
-
- /* Set up the field variables */
- /*
- * Do this before arg parsing so that `-v NF=blah' won't
- * break anything.
- */
- init_fields();
-
- /* Robustness: check that 0, 1, 2, exist */
+ /* Robustness: check that file descriptors 0, 1, 2 are open */
init_fds();
- /* load group set */
- init_groupset();
-
- /* worst case */
- emalloc(srcfiles, struct src *, argc * sizeof(struct src), "main");
- memset(srcfiles, '\0', argc * sizeof(struct src));
+ /* init array handling. */
+ array_init();
/* we do error messages ourselves on invalid options */
opterr = FALSE;
@@ -269,7 +288,7 @@ main(int argc, char **argv)
switch (c) {
case 'F':
- cmdline_fs(optarg);
+ preassigns_add(PRE_ASSIGN_FS, optarg);
break;
case 'f':
@@ -282,19 +301,15 @@ main(int argc, char **argv)
* of a #! /bin/gawk line in an executable file
*/
scan = optarg;
- while (ISSPACE(*scan))
- scan++;
-
- ++numfiles;
- srcfiles[numfiles].stype = SOURCEFILE;
- if (*scan == '\0')
- srcfiles[numfiles].val = argv[optind++];
- else
- srcfiles[numfiles].val = optarg;
+ if (argv[optind-1] != optarg)
+ while (ISSPACE(*scan))
+ scan++;
+ srcfiles_add(SOURCEFILE,
+ (*scan == '\0' ? argv[optind++] : optarg));
break;
case 'v':
- pre_assign(optarg);
+ preassigns_add(PRE_ASSIGN, optarg);
break;
case 'm':
@@ -339,9 +354,15 @@ main(int argc, char **argv)
break;
case 'l':
- do_lint = TRUE;
- if (optarg != NULL && strcmp(optarg, "fatal") == 0)
- lintfunc = r_fatal;
+#ifndef NO_LINT
+ do_lint = LINT_ALL;
+ if (optarg != NULL) {
+ if (strcmp(optarg, "fatal") == 0)
+ lintfunc = r_fatal;
+ else if (strcmp(optarg, "invalid") == 0)
+ do_lint = LINT_INVALID;
+ }
+#endif
break;
case 'p':
@@ -355,10 +376,8 @@ main(int argc, char **argv)
case 's':
if (optarg[0] == '\0')
warning(_("empty argument to `--source' ignored"));
- else {
- srcfiles[++numfiles].stype = CMDLINE;
- srcfiles[numfiles].val = optarg;
- }
+ else
+ srcfiles_add(CMDLINE, optarg);
break;
case 'u':
@@ -449,38 +468,50 @@ out:
warning(_("running %s setuid root may be a security problem"), myname);
/*
- * Tell the regex routines how they should work.
- * Do this again, after argument processing, since do_posix
- * and do_traditional are now paid attention to by resetup().
+ * Force profiling if this is pgawk.
+ * Don't bother if the command line already set profiling up.
*/
- if (do_traditional || do_posix || do_intervals) {
- resetup();
-
- /* now handle RS and FS. have to be careful with FS */
- set_RS();
- if (using_fieldwidths()) {
- set_FS();
- set_FIELDWIDTHS();
- } else
- set_FS();
- }
+ if (! do_profiling)
+ init_profiling(& do_profiling, DEFAULT_PROFILE);
+
+ /* load group set */
+ init_groupset();
+
+ /* initialize the null string */
+ Nnull_string = make_string("", 0);
+ Nnull_string->numbr = 0.0;
+ Nnull_string->type = Node_val;
+ Nnull_string->flags = (PERM|STRCUR|STRING|NUMCUR|NUMBER);
/*
- * Initialize profiling info, do after parsing args,
- * in case this is pgawk. Don't bother if the command
- * line already set profling up.
+ * Tell the regex routines how they should work.
+ * Do this before initializing variables, since
+ * they could want to do a regexp compile.
*/
- if (! do_profiling)
- init_profiling(& do_profiling, DEFAULT_PROFILE);
+ resetup();
+
+ /* Set up the special variables */
+ init_vars();
+
+ /* Set up the field variables */
+ init_fields();
+
+ /* Now process the pre-assignments */
+ for (i = 0; i <= numassigns; i++)
+ if (preassigns[i].stype == PRE_ASSIGN)
+ (void) arg_assign(preassigns[i].val, TRUE);
+ else /* PRE_ASSIGN_FS */
+ cmdline_fs(preassigns[i].val);
+ free(preassigns);
if ((BINMODE & 1) != 0)
if (os_setbinmode(fileno(stdin), O_BINARY) == -1)
- fatal(_("can't set mode on stdin (%s)"), strerror(errno));
+ fatal(_("can't set binary mode on stdin (%s)"), strerror(errno));
if ((BINMODE & 2) != 0) {
if (os_setbinmode(fileno(stdout), O_BINARY) == -1)
- fatal(_("can't set mode on stdout (%s)"), strerror(errno));
+ fatal(_("can't set binary mode on stdout (%s)"), strerror(errno));
if (os_setbinmode(fileno(stderr), O_BINARY) == -1)
- fatal(_("can't set mode on stderr (%s)"), strerror(errno));
+ fatal(_("can't set binary mode on stderr (%s)"), strerror(errno));
}
#ifdef GAWKDEBUG
@@ -492,8 +523,7 @@ out:
if (numfiles == -1) {
if (optind > argc - 1 || stopped_early) /* no args left or no program */
usage(1, stderr);
- srcfiles[++numfiles].stype = CMDLINE;
- srcfiles[numfiles].val = argv[optind];
+ srcfiles_add(CMDLINE, argv[optind]);
optind++;
}
@@ -504,6 +534,8 @@ out:
if (yyparse() != 0 || errcount != 0)
exit(1);
+ free(srcfiles);
+
if (do_intl)
exit(0);
@@ -516,6 +548,7 @@ out:
init_profiling_signals();
+ /* Whew. Finally, run the program. */
if (begin_block != NULL) {
in_begin_rule = TRUE;
(void) interpret(begin_block);
@@ -546,6 +579,29 @@ out:
return exit_val; /* to suppress warnings */
}
+/* add_src --- add one element to *srcfiles or *preassigns */
+
+static void
+add_src(struct src **data, long *num, long *alloc, enum srctype stype, char *val)
+{
+#define INIT_SRC 4
+
+ ++*num;
+
+ if (*data == NULL) {
+ emalloc(*data, struct src *, INIT_SRC * sizeof(struct src), "add_src");
+ *alloc = INIT_SRC;
+ } else if (*num >= *alloc) {
+ (*alloc) *= 2;
+ erealloc(*data, struct src *, (*alloc) * sizeof(struct src), "add_src");
+ }
+
+ (*data)[*num].stype = stype;
+ (*data)[*num].val = val;
+
+#undef INIT_SRC
+}
+
/* usage --- print usage information and exit */
static void
@@ -609,7 +665,7 @@ By default it reads standard input and writes standard output.\n\n"), fp);
static void
copyleft()
{
- static char blurb_part1[] =
+ static const char blurb_part1[] =
N_("Copyright (C) 1989, 1991-%d Free Software Foundation.\n\
\n\
This program is free software; you can redistribute it and/or modify\n\
@@ -617,19 +673,19 @@ 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");
- static char blurb_part2[] =
+ static const char blurb_part2[] =
N_("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");
- static char blurb_part3[] =
+ static const char blurb_part3[] =
N_("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");
/* multiple blurbs are needed for some brain dead compilers. */
- printf(_(blurb_part1), 2002); /* Last update year */
+ printf(_(blurb_part1), 2003); /* Last update year */
fputs(_(blurb_part2), stdout);
fputs(_(blurb_part3), stdout);
fflush(stdout);
@@ -650,7 +706,7 @@ cmdline_fs(char *str)
* case so -F\t works as documented in awk book even though the shell
* hands us -Ft. Bleah!
*
- * Thankfully, Posix didn't propogate this "feature".
+ * Thankfully, Posix didn't propagate this "feature".
*/
if (str[0] == 't' && str[1] == '\0') {
if (do_lint)
@@ -670,7 +726,7 @@ init_args(int argc0, int argc, char *argv0, char **argv)
int i, j;
NODE **aptr;
- ARGV_node = install("ARGV", node(Nnull_string, Node_var_array, (NODE *) NULL));
+ ARGV_node = install("ARGV", node((NODE *) NULL, Node_var_array, (NODE *) NULL));
aptr = assoc_lookup(ARGV_node, tmp_number(0.0), FALSE);
*aptr = make_string(argv0, strlen(argv0));
(*aptr)->flags |= MAYBE_NUM;
@@ -701,9 +757,9 @@ struct varinit {
AWKNUM numval;
Func_ptr assign;
};
-static struct varinit varinit[] = {
+static const struct varinit varinit[] = {
{&CONVFMT_node, "CONVFMT", Node_CONVFMT, "%.6g", 0, set_CONVFMT },
-{&NF_node, "NF", Node_NF, NULL, -1, set_NF },
+{&NF_node, "NF", Node_NF, NULL, -1, NULL },
{&FIELDWIDTHS_node, "FIELDWIDTHS", Node_FIELDWIDTHS, "", 0, NULL },
{&NR_node, "NR", Node_NR, NULL, 0, set_NR },
{&FNR_node, "FNR", Node_FNR, NULL, 0, set_FNR },
@@ -731,7 +787,7 @@ static struct varinit varinit[] = {
static void
init_vars()
{
- register struct varinit *vp;
+ register const struct varinit *vp;
for (vp = varinit; vp->name; vp++) {
*(vp->spec) = install((char *) vp->name,
@@ -748,7 +804,7 @@ init_vars()
/* load_environ --- populate the ENVIRON array */
-void
+NODE *
load_environ()
{
#if ! defined(TANDEM)
@@ -758,9 +814,11 @@ load_environ()
register char *var, *val;
NODE **aptr;
register int i;
+#endif /* TANDEM */
ENVIRON_node = install("ENVIRON",
- node(Nnull_string, Node_var, (NODE *) NULL));
+ node((NODE *) NULL, Node_var_array, (NODE *) NULL));
+#if ! defined(TANDEM)
for (i = 0; environ[i] != NULL; i++) {
static char nullstr[] = "";
@@ -770,7 +828,7 @@ load_environ()
*val++ = '\0';
else
val = nullstr;
- aptr = assoc_lookup(ENVIRON_node,tmp_string(var, strlen(var)),
+ aptr = assoc_lookup(ENVIRON_node, tmp_string(var, strlen(var)),
FALSE);
*aptr = make_string(val, strlen(val));
(*aptr)->flags |= (MAYBE_NUM|SCALAR);
@@ -789,11 +847,12 @@ load_environ()
(*aptr)->flags |= SCALAR;
}
#endif /* TANDEM */
+ return ENVIRON_node;
}
/* load_procinfo --- populate the PROCINFO array */
-void
+NODE *
load_procinfo()
{
int i;
@@ -802,7 +861,7 @@ load_procinfo()
AWKNUM value;
PROCINFO_node = install("PROCINFO",
- node(Nnull_string, Node_var, (NODE *) NULL));
+ node((NODE *) NULL, Node_var_array, (NODE *) NULL));
#ifdef GETPGRP_VOID
#define getpgrp_arg() /* nothing */
@@ -845,7 +904,8 @@ load_procinfo()
*aptr = make_number(value);
aptr = assoc_lookup(PROCINFO_node, tmp_string("FS", 2), FALSE);
- *aptr = make_string("FS", 2);
+ *aptr = (using_fieldwidths() ? make_string("FIELDWIDTHS", 11) :
+ make_string("FS", 2) );
#if defined (HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0
for (i = 0; i < ngroups; i++) {
@@ -854,13 +914,18 @@ load_procinfo()
aptr = assoc_lookup(PROCINFO_node, tmp_string(name, strlen(name)), FALSE);
*aptr = make_number(value);
}
+ if (groupset) {
+ free(groupset);
+ groupset = NULL;
+ }
#endif
+ return PROCINFO_node;
}
/* arg_assign --- process a command-line assignment */
-char *
-arg_assign(char *arg)
+int
+arg_assign(char *arg, int initing)
{
char *cp, *cp2;
int badvar;
@@ -870,26 +935,38 @@ arg_assign(char *arg)
NODE **lhs;
cp = strchr(arg, '=');
- if (cp != NULL) {
- *cp++ = '\0';
- /* first check that the variable name has valid syntax */
- badvar = FALSE;
- if (! ISALPHA(arg[0]) && arg[0] != '_')
- badvar = TRUE;
- else
- for (cp2 = arg+1; *cp2; cp2++)
- if (! ISALNUM(*cp2) && *cp2 != '_') {
- badvar = TRUE;
- break;
- }
- if (badvar) {
- if (do_lint)
- lintwarn(_("invalid syntax in name `%s' for variable assignment"), arg);
- *--cp = '='; /* restore original text of ARGV */
- return NULL;
- }
+ if (cp == NULL) {
+ if (! initing)
+ return FALSE; /* This is file name, not assignment. */
+ fprintf(stderr,
+ _("%s: `%s' argument to `-v' not in `var=value' form\n\n"),
+ myname, arg);
+ usage(1, stderr);
+ }
+
+ *cp++ = '\0';
+
+ /* first check that the variable name has valid syntax */
+ badvar = FALSE;
+ if (! ISALPHA(arg[0]) && arg[0] != '_')
+ badvar = TRUE;
+ else
+ for (cp2 = arg+1; *cp2; cp2++)
+ if (! ISALNUM(*cp2) && *cp2 != '_') {
+ badvar = TRUE;
+ break;
+ }
+
+ if (badvar) {
+ if (initing)
+ fatal(_("`%s' is not a legal variable name"), arg);
+
+ if (do_lint)
+ lintwarn(_("`%s' is not a variable name, looking for file `%s=%s'"),
+ arg, arg, cp);
+ } else {
/*
* Recent versions of nawk expand escapes inside assignments.
* This makes sense, so we do it too.
@@ -902,57 +979,18 @@ arg_assign(char *arg)
*lhs = it;
if (after_assign != NULL)
(*after_assign)();
- *--cp = '='; /* restore original text of ARGV */
}
- return cp;
-}
-
-/* pre_assign --- handle -v, print a message and die if a problem */
-static void
-pre_assign(char *v)
-{
- char *cp;
- /*
- * There is a problem when doing profiling. For -v x=y,
- * the variable x gets installed into the symbol table pointing
- * at the value in argv. This is what gets dumped. The string
- * ends up containing the full x=y, leading to stuff in the profile
- * of the form:
- *
- * if (x=y) ...
- *
- * Needless to say, this is gross, ugly and wrong. To fix, we
- * malloc a private copy of the storage that we can tweak to
- * our heart's content.
- *
- * This can't depend upon do_profiling; that variable isn't set up yet.
- * Sigh.
- */
-
- emalloc(cp, char *, strlen(v) + 1, "pre_assign");
- strcpy(cp, v);
+ *--cp = '='; /* restore original text of ARGV */
- if (arg_assign(cp) == NULL) {
- fprintf(stderr,
- "%s: `%s' argument to `-v' not in `var=value' form\n",
- myname, v);
- usage(1, stderr);
- }
-
- cp = strchr(cp, '=');
- assert(cp);
- *cp = '\0';
+ return ! badvar;
}
/* catchsig --- catch signals */
-RETSIGTYPE
-catchsig(int sig, int code)
+static RETSIGTYPE
+catchsig(int sig)
{
-#ifdef lint
- code = 0; sig = code; code = sig;
-#endif
if (sig == SIGFPE) {
fatal(_("floating point exception"));
} else if (sig == SIGSEGV
@@ -1028,11 +1066,16 @@ static void
init_groupset()
{
#if defined(HAVE_GETGROUPS) && defined(NGROUPS_MAX) && NGROUPS_MAX > 0
+#ifdef GETGROUPS_NOT_STANDARD
+ /* For systems that aren't standards conformant, use old way. */
+ ngroups = NGROUPS_MAX;
+#else
/*
* If called with 0 for both args, return value is
* total number of groups.
*/
ngroups = getgroups(0, NULL);
+#endif
if (ngroups == -1)
fatal(_("could not find groups: %s"), strerror(errno));
else if (ngroups == 0)
diff --git a/missing b/missing
index 5f9da906..6a37006e 100755
--- a/missing
+++ b/missing
@@ -1,6 +1,6 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -18,6 +18,11 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
@@ -25,6 +30,14 @@ fi
run=:
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
@@ -65,7 +78,7 @@ Supported PROGRAM values:
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing 0.3 - GNU automake"
+ echo "missing 0.4 - GNU automake"
;;
-*)
@@ -74,31 +87,46 @@ Supported PROGRAM values:
exit 1
;;
- aclocal)
+ aclocal*)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`acinclude.m4' or \`configure.in'. You might want
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`configure.in'. You might want to install the
+ you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`acconfig.h' or \`configure.in'. You might want
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
@@ -111,10 +139,15 @@ WARNING: \`$1' is missing on your system. You should only need it if
touch $touch_files
;;
- automake)
+ automake*)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
@@ -122,6 +155,34 @@ WARNING: \`$1' is missing on your system. You should only need it if
while read f; do touch "$f"; done
;;
+ autom4te)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1Help2man' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+ test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
@@ -176,6 +237,11 @@ WARNING: \`$1' is missing on your system. You should only need it if
;;
help2man)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a dependency of a manual page. You may need the
@@ -196,6 +262,11 @@ WARNING: \`$1' is missing on your system. You should only need it if
;;
makeinfo)
+ if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
+ # We have makeinfo, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
@@ -222,23 +293,23 @@ WARNING: \`$1' is missing on your system. You should only need it if
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
- gnutar ${1+"$@"} && exit 0
+ gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
- gtar ${1+"$@"} && exit 0
+ gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
- tar "$firstarg" ${1+"$@"} && exit 0
+ tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
- tar "$firstarg" ${1+"$@"} && exit 0
+ tar "$firstarg" "$@" && exit 0
;;
esac
fi
diff --git a/missing_d/ChangeLog b/missing_d/ChangeLog
index 7220065c..d21af3b1 100644
--- a/missing_d/ChangeLog
+++ b/missing_d/ChangeLog
@@ -1,3 +1,24 @@
+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 Feb 3 20:37:09 2003 Pat Rankin <rankin@pactechdata.com>
+
+ * strftime.c: Restore use of TIME_T_IN_SYS_TYPES_H to control
+ inclusion of <sys/types.h>.
+ (TYPE_SIGNED): Add workaround to avoid diagnostic from Compaq C V6.4.
+ (my_strftime) [case 's']: Likewise; exclude negative number handling
+ if TIME_T_UNSIGNED is defined.
+
+Mon Jan 27 12:09:50 2003 Stepan Kasal <kasal@math.cas.cz>
+
+ * strtod.c (gawk_strtod): Cleanup, changing the logic
+ so that ptr is correct. Fixes the bug that 0e0 is not
+ recognized as numeric.
+
Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.1: Release tar file made.
diff --git a/missing_d/strftime.c b/missing_d/strftime.c
index 18350461..c1e1a1e2 100644
--- a/missing_d/strftime.c
+++ b/missing_d/strftime.c
@@ -1,22 +1,21 @@
-/* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1999, 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
- NOTE: The canonical source of this file is maintained with the GNU C Library.
- Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+ 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 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,
+ 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 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. */
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -41,9 +40,9 @@
#endif
#include <ctype.h>
-#ifdef TIME_T_IN_SYS_TYPES_H
+#ifdef TIME_T_IN_SYS_TYPES
#include <sys/types.h> /* Some systems define `time_t' here. */
-#endif /* HAVE_SYS_TYPES_H */
+#endif
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
@@ -93,9 +92,6 @@ extern char *tzname[];
# endif
#endif
-#undef TOUPPER
-#undef TOLOWER
-#undef ISDIGIT
#ifdef COMPILE_WIDE
# include <endian.h>
# define CHAR_T wchar_t
@@ -152,8 +148,14 @@ extern char *tzname[];
# define NULL 0
#endif
-#define TYPE_SIGNED(t) ((t) -1 < 0)
+/* Test for checking whether a given type is signed or not.
+ Some compilers issue a diagnostic about suspicious construct for
+ a test that will always fail when comparing a value that can't be
+ negative against 0 using `<' or `<=' operator. */
+/* #define TYPE_SIGNED(t) ((t) -1 < 0) */
+#define TYPE_SIGNED(t) ((t) -1 < 1)
+#ifndef INT_STRLEN_BOUND
/* Bound on length of the string representing an integer value of type t.
Subtract one for the sign bit if t is signed;
302 / 1000 is log10 (2) rounded up;
@@ -161,6 +163,7 @@ extern char *tzname[];
add one more for a minus sign if t is signed. */
#define INT_STRLEN_BOUND(t) \
((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 + 1 + TYPE_SIGNED (t))
+#endif
#define TM_YEAR_BASE 1900
@@ -270,7 +273,7 @@ static const CHAR_T zeroes[16] = /* "0000000000000000" */
int _n = (n); \
int _delta = width - _n; \
int _incr = _n + (_delta > 0 ? _delta : 0); \
- if (i + _incr >= maxsize) \
+ if ((size_t) _incr >= maxsize - i) \
return 0; \
if (p) \
{ \
@@ -290,35 +293,80 @@ static const CHAR_T zeroes[16] = /* "0000000000000000" */
#define cpy(n, s) \
add ((n), \
if (to_lowcase) \
- memcpy_lowcase (p, (s), _n); \
+ memcpy_lowcase (p, (s), _n LOCALE_ARG); \
else if (to_uppcase) \
- memcpy_uppcase (p, (s), _n); \
+ memcpy_uppcase (p, (s), _n LOCALE_ARG); \
else \
MEMCPY ((PTR) p, (const PTR) (s), _n))
#ifdef COMPILE_WIDE
+# ifndef USE_IN_EXTENDED_LOCALE_MODEL
+# undef __mbsrtowcs_l
+# define __mbsrtowcs_l(d, s, l, st, loc) __mbsrtowcs (d, s, l, st)
+# endif
# define widen(os, ws, l) \
{ \
mbstate_t __st; \
const char *__s = os; \
memset (&__st, '\0', sizeof (__st)); \
- l = __mbsrtowcs (NULL, &__s, 0, &__st); \
+ l = __mbsrtowcs_l (NULL, &__s, 0, &__st, loc); \
ws = alloca ((l + 1) * sizeof (wchar_t)); \
- (void) __mbsrtowcs (ws, &__s, l, &__st); \
+ (void) __mbsrtowcs_l (ws, &__s, l, &__st, loc); \
}
#endif
+/* For gawk */
+#undef TOLOWER
+#undef TOUPPER
+#undef ISDIGIT
+
+#if defined _LIBC && defined USE_IN_EXTENDED_LOCALE_MODEL
+/* We use this code also for the extended locale handling where the
+ function gets as an additional argument the locale which has to be
+ used. To access the values we have to redefine the _NL_CURRENT
+ macro. */
+# define strftime __strftime_l
+# define wcsftime __wcsftime_l
+# undef _NL_CURRENT
+# define _NL_CURRENT(category, item) \
+ (current->values[_NL_ITEM_INDEX (item)].string)
+# define LOCALE_PARAM , loc
+# define LOCALE_ARG , loc
+# define LOCALE_PARAM_DECL __locale_t loc;
+# define LOCALE_PARAM_PROTO , __locale_t loc
+# define HELPER_LOCALE_ARG , current
+#else
+# define LOCALE_PARAM
+# define LOCALE_PARAM_PROTO
+# define LOCALE_ARG
+# define LOCALE_PARAM_DECL
+# ifdef _LIBC
+# define HELPER_LOCALE_ARG , _NL_CURRENT_DATA (LC_TIME)
+# else
+# define HELPER_LOCALE_ARG
+# endif
+#endif
#ifdef COMPILE_WIDE
-# define TOUPPER(Ch) towupper (Ch)
-# define TOLOWER(Ch) towlower (Ch)
+# ifdef USE_IN_EXTENDED_LOCALE_MODEL
+# define TOUPPER(Ch, L) __towupper_l (Ch, L)
+# define TOLOWER(Ch, L) __towlower_l (Ch, L)
+# else
+# define TOUPPER(Ch, L) towupper (Ch)
+# define TOLOWER(Ch, L) towlower (Ch)
+# endif
#else
# ifdef _LIBC
-# define TOUPPER(Ch) toupper (Ch)
-# define TOLOWER(Ch) tolower (Ch)
+# ifdef USE_IN_EXTENDED_LOCALE_MODEL
+# define TOUPPER(Ch, L) __toupper_l (Ch, L)
+# define TOLOWER(Ch, L) __tolower_l (Ch, L)
+# else
+# define TOUPPER(Ch, L) toupper (Ch)
+# define TOLOWER(Ch, L) tolower (Ch)
+# endif
# else
-# define TOUPPER(Ch) (islower (Ch) ? toupper (Ch) : (Ch))
-# define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
+# define TOUPPER(Ch, L) (islower (Ch) ? toupper (Ch) : (Ch))
+# define TOLOWER(Ch, L) (isupper (Ch) ? tolower (Ch) : (Ch))
# endif
#endif
/* We don't use `isdigit' here since the locale dependent
@@ -328,30 +376,32 @@ static const CHAR_T zeroes[16] = /* "0000000000000000" */
#define ISDIGIT(Ch) ((unsigned int) (Ch) - L_('0') <= 9)
static CHAR_T *memcpy_lowcase __P ((CHAR_T *dest, const CHAR_T *src,
- size_t len));
+ size_t len LOCALE_PARAM_PROTO));
static CHAR_T *
-memcpy_lowcase (dest, src, len)
+memcpy_lowcase (dest, src, len LOCALE_PARAM)
CHAR_T *dest;
const CHAR_T *src;
size_t len;
+ LOCALE_PARAM_DECL
{
while (len-- > 0)
- dest[len] = TOLOWER ((UCHAR_T) src[len]);
+ dest[len] = TOLOWER ((UCHAR_T) src[len], loc);
return dest;
}
static CHAR_T *memcpy_uppcase __P ((CHAR_T *dest, const CHAR_T *src,
- size_t len));
+ size_t len LOCALE_PARAM_PROTO));
static CHAR_T *
-memcpy_uppcase (dest, src, len)
+memcpy_uppcase (dest, src, len LOCALE_PARAM)
CHAR_T *dest;
const CHAR_T *src;
size_t len;
+ LOCALE_PARAM_DECL
{
while (len-- > 0)
- dest[len] = TOUPPER ((UCHAR_T) src[len]);
+ dest[len] = TOUPPER ((UCHAR_T) src[len], loc);
return dest;
}
@@ -426,49 +476,42 @@ static CHAR_T const month_name[][10] =
#endif
-/* When compiling this file, GNU applications can #define my_strftime
- to a symbol (typically nstrftime) to get an extended strftime with
- extra arguments UT and NS. Emacs is a special case for now, but
- this Emacs-specific code can be removed once Emacs's config.h
- defines my_strftime. */
-#if defined emacs && !defined my_strftime
-# define my_strftime nstrftime
-#endif
-
-#ifdef my_strftime
-# define extra_args , ut, ns
-# define extra_args_spec int ut; int ns;
-# define extra_args_spec_iso , int ut, int ns
+#ifdef emacs
+# define my_strftime emacs_strftimeu
+# define ut_argument , ut
+# define ut_argument_spec int ut;
+# define ut_argument_spec_iso , int ut
#else
# ifdef COMPILE_WIDE
# define my_strftime wcsftime
+# define nl_get_alt_digit _nl_get_walt_digit
# else
# define my_strftime strftime
+# define nl_get_alt_digit _nl_get_alt_digit
# endif
-# define extra_args
-# define extra_args_spec
-# define extra_args_spec_iso
+# define ut_argument
+# define ut_argument_spec
+# define ut_argument_spec_iso
/* We don't have this information in general. */
# define ut 0
-# define ns 0
#endif
#if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET
/* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
Work around this bug by copying *tp before it might be munged. */
size_t _strftime_copytm __P ((char *, size_t, const char *,
- const struct tm * extra_args_spec_iso));
+ const struct tm * ut_argument_spec_iso));
size_t
- my_strftime (s, maxsize, format, tp extra_args)
+ my_strftime (s, maxsize, format, tp ut_argument)
CHAR_T *s;
size_t maxsize;
const CHAR_T *format;
const struct tm *tp;
- extra_args_spec
+ ut_argument_spec
{
struct tm tmcopy;
tmcopy = *tp;
- return _strftime_copytm (s, maxsize, format, &tmcopy extra_args);
+ return _strftime_copytm (s, maxsize, format, &tmcopy ut_argument);
}
# undef my_strftime
# define my_strftime _strftime_copytm
@@ -482,13 +525,18 @@ static CHAR_T const month_name[][10] =
anywhere, so to determine how many characters would be
written, use NULL for S and (size_t) UINT_MAX for MAXSIZE. */
size_t
-my_strftime (s, maxsize, format, tp extra_args)
+my_strftime (s, maxsize, format, tp ut_argument LOCALE_PARAM)
CHAR_T *s;
size_t maxsize;
const CHAR_T *format;
const struct tm *tp;
- extra_args_spec
+ ut_argument_spec
+ LOCALE_PARAM_DECL
{
+#if defined _LIBC && defined USE_IN_EXTENDED_LOCALE_MODEL
+ struct locale_data *const current = loc->__locales[LC_TIME];
+#endif
+
int hour12 = tp->tm_hour;
#ifdef _NL_CURRENT
/* We cannot make the following values variables since we must delay
@@ -551,9 +599,8 @@ my_strftime (s, maxsize, format, tp extra_args)
}
else
{
- /* POSIX.1 8.1.1 requires that whenever strftime() is called, the
- time zone names contained in the external variable `tzname' shall
- be set as if the tzset() function had been called. */
+ /* POSIX.1 requires that local time zone information is used as
+ though strftime called tzset. */
# if HAVE_TZSET
tzset ();
# endif
@@ -704,8 +751,15 @@ my_strftime (s, maxsize, format, tp extra_args)
width = 0;
do
{
- width *= 10;
- width += *f - L_('0');
+ if (width > INT_MAX / 10
+ || (width == INT_MAX / 10 && *f - L_('0') > INT_MAX % 10))
+ /* Avoid overflow. */
+ width = INT_MAX;
+ else
+ {
+ width *= 10;
+ width += *f - L_('0');
+ }
++f;
}
while (ISDIGIT (*f));
@@ -729,10 +783,10 @@ my_strftime (s, maxsize, format, tp extra_args)
switch (format_char)
{
#define DO_NUMBER(d, v) \
- digits = width == -1 ? d : width; \
+ digits = d > width ? d : width; \
number_value = v; goto do_number
#define DO_NUMBER_SPACEPAD(d, v) \
- digits = width == -1 ? d : width; \
+ digits = d > width ? d : width; \
number_value = v; goto do_number_spacepad
case L_('%'):
@@ -772,7 +826,7 @@ my_strftime (s, maxsize, format, tp extra_args)
#endif
case L_('b'):
- case L_('h'): /* POSIX.2 extension. */
+ case L_('h'):
if (change_case)
{
to_uppcase = 1;
@@ -824,14 +878,14 @@ my_strftime (s, maxsize, format, tp extra_args)
{
CHAR_T *old_start = p;
size_t len = my_strftime (NULL, (size_t) -1, subfmt,
- tp extra_args);
+ tp ut_argument LOCALE_ARG);
add (len, my_strftime (p, maxsize - i, subfmt,
- tp extra_args));
+ tp ut_argument LOCALE_ARG));
if (to_uppcase)
while (old_start < p)
{
- *old_start = TOUPPER ((UCHAR_T) *old_start);
+ *old_start = TOUPPER ((UCHAR_T) *old_start, loc);
++old_start;
}
}
@@ -867,13 +921,13 @@ my_strftime (s, maxsize, format, tp extra_args)
break;
#endif
- case L_('C'): /* POSIX.2 extension. */
+ case L_('C'):
if (modifier == L_('O'))
goto bad_format;
if (modifier == L_('E'))
{
#if HAVE_STRUCT_ERA_ENTRY
- struct era_entry *era = _nl_get_era_entry (tp);
+ struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
if (era)
{
# ifdef COMPILE_WIDE
@@ -914,7 +968,7 @@ my_strftime (s, maxsize, format, tp extra_args)
/* Fall through. */
# endif
#endif
- case L_('D'): /* POSIX.2 extension. */
+ case L_('D'):
if (modifier != 0)
goto bad_format;
subfmt = L_("%m/%d/%y");
@@ -926,7 +980,7 @@ my_strftime (s, maxsize, format, tp extra_args)
DO_NUMBER (2, tp->tm_mday);
- case L_('e'): /* POSIX.2 extension. */
+ case L_('e'):
if (modifier == L_('E'))
goto bad_format;
@@ -948,11 +1002,8 @@ my_strftime (s, maxsize, format, tp extra_args)
#ifdef _NL_CURRENT
/* Get the locale specific alternate representation of
the number NUMBER_VALUE. If none exist NULL is returned. */
-# ifdef COMPILE_WIDE
- const wchar_t *cp = _nl_get_walt_digit (number_value);
-# else
- const char *cp = _nl_get_alt_digit (number_value);
-# endif
+ const CHAR_T *cp = nl_get_alt_digit (number_value
+ HELPER_LOCALE_ARG);
if (cp != NULL)
{
@@ -992,18 +1043,37 @@ my_strftime (s, maxsize, format, tp extra_args)
int padding = digits - (buf + (sizeof (buf) / sizeof (buf[0]))
- bufp);
- if (pad == L_('_'))
- {
- while (0 < padding--)
- *--bufp = L_(' ');
- }
- else
+ if (padding > 0)
{
- bufp += negative_number;
- while (0 < padding--)
- *--bufp = L_('0');
- if (negative_number)
- *--bufp = L_('-');
+ if (pad == L_('_'))
+ {
+ if ((size_t) padding >= maxsize - i)
+ return 0;
+
+ if (p)
+ memset_space (p, padding);
+ i += padding;
+ width = width > padding ? width - padding : 0;
+ }
+ else
+ {
+ if ((size_t) digits >= maxsize - i)
+ return 0;
+
+ if (negative_number)
+ {
+ ++bufp;
+
+ if (p)
+ *p++ = L_('-');
+ ++i;
+ }
+
+ if (p)
+ memset_zero (p, padding);
+ i += padding;
+ width = 0;
+ }
}
}
@@ -1058,22 +1128,7 @@ my_strftime (s, maxsize, format, tp extra_args)
DO_NUMBER (2, tp->tm_mon + 1);
- case L_('N'): /* GNU extension. */
- if (modifier == L_('E'))
- goto bad_format;
-
- number_value = ns;
- if (width != -1)
- {
- /* Take an explicit width less than 9 as a precision. */
- int j;
- for (j = width; j < 9; j++)
- number_value /= 10;
- }
-
- DO_NUMBER (9, number_value);
-
- case L_('n'): /* POSIX.2 extension. */
+ case L_('n'):
add (1, *p = L_('\n'));
break;
@@ -1097,11 +1152,11 @@ my_strftime (s, maxsize, format, tp extra_args)
goto underlying_strftime;
#endif
- case L_('R'): /* ISO C99 extension. */
+ case L_('R'):
subfmt = L_("%H:%M");
goto subformat;
- case L_('r'): /* POSIX.2 extension. */
+ case L_('r'):
#ifdef _NL_CURRENT
if (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME,
NLW(T_FMT_AMPM)))
@@ -1128,13 +1183,16 @@ my_strftime (s, maxsize, format, tp extra_args)
this works even if sizeof (long) < sizeof (time_t). */
bufp = buf + sizeof (buf) / sizeof (buf[0]);
+#ifndef TIME_T_UNSIGNED
negative_number = t < 0;
+#endif
do
{
int d = t % 10;
t /= 10;
+#ifndef TIME_T_UNSIGNED
if (negative_number)
{
d = -d;
@@ -1146,6 +1204,7 @@ my_strftime (s, maxsize, format, tp extra_args)
d += 10;
}
}
+#endif
*--bufp = d + L_('0');
}
@@ -1172,15 +1231,15 @@ my_strftime (s, maxsize, format, tp extra_args)
/* Fall through. */
# endif
#endif
- case L_('T'): /* POSIX.2 extension. */
+ case L_('T'):
subfmt = L_("%H:%M:%S");
goto subformat;
- case L_('t'): /* POSIX.2 extension. */
+ case L_('t'):
add (1, *p = L_('\t'));
break;
- case L_('u'): /* POSIX.2 extension. */
+ case L_('u'):
DO_NUMBER (1, (tp->tm_wday - 1 + 7) % 7 + 1);
case L_('U'):
@@ -1190,8 +1249,8 @@ my_strftime (s, maxsize, format, tp extra_args)
DO_NUMBER (2, (tp->tm_yday - tp->tm_wday + 7) / 7);
case L_('V'):
- case L_('g'): /* ISO C99 extension. */
- case L_('G'): /* ISO C99 extension. */
+ case L_('g'):
+ case L_('G'):
if (modifier == L_('E'))
goto bad_format;
{
@@ -1246,7 +1305,7 @@ my_strftime (s, maxsize, format, tp extra_args)
if (modifier == 'E')
{
#if HAVE_STRUCT_ERA_ENTRY
- struct era_entry *era = _nl_get_era_entry (tp);
+ struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
if (era)
{
# ifdef COMPILE_WIDE
@@ -1271,7 +1330,7 @@ my_strftime (s, maxsize, format, tp extra_args)
if (modifier == L_('E'))
{
#if HAVE_STRUCT_ERA_ENTRY
- struct era_entry *era = _nl_get_era_entry (tp);
+ struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
if (era)
{
int delta = tp->tm_year - era->start_date[0];
@@ -1299,7 +1358,7 @@ my_strftime (s, maxsize, format, tp extra_args)
zone = tzname[tp->tm_isdst];
#endif
if (! zone)
- zone = ""; /* POSIX.2 requires the empty string here. */
+ zone = "";
#ifdef COMPILE_WIDE
{
@@ -1315,7 +1374,7 @@ my_strftime (s, maxsize, format, tp extra_args)
#endif
break;
- case L_('z'): /* ISO C99 extension. */
+ case L_('z'):
if (tp->tm_isdst < 0)
break;
@@ -1393,19 +1452,22 @@ my_strftime (s, maxsize, format, tp extra_args)
*p = L_('\0');
return i;
}
+#ifdef _LIBC
+libc_hidden_def (my_strftime)
+#endif
#ifdef emacs
/* For Emacs we have a separate interface which corresponds to the normal
- strftime function plus the ut argument, but without the ns argument. */
+ strftime function and does not have the extra information whether the
+ TP arguments comes from a `gmtime' call or not. */
size_t
-emacs_strftimeu (s, maxsize, format, tp, ut)
+emacs_strftime (s, maxsize, format, tp)
char *s;
size_t maxsize;
const char *format;
const struct tm *tp;
- int ut;
{
- return my_strftime (s, maxsize, format, tp, ut, 0);
+ return my_strftime (s, maxsize, format, tp, 0);
}
#endif
diff --git a/missing_d/strtod.c b/missing_d/strtod.c
index 2c4ee574..e33a5b5e 100644
--- a/missing_d/strtod.c
+++ b/missing_d/strtod.c
@@ -1,6 +1,7 @@
/*
- * strtod.c
- *
+ * gawk wrapper for strtod
+ */
+/*
* Stupid version of System V strtod(3) library routine.
* Does no overflow/underflow checking.
*
@@ -25,6 +26,8 @@
*
* Summer 2001. Try to make it smarter, so that a string like "0000"
* doesn't look like we failed. Sigh.
+ *
+ * Xmass 2002. Fix a bug in ptr determination, eg. for "0e0".
*/
#if 0
@@ -38,76 +41,68 @@ gawk_strtod(s, ptr)
register const char *s;
register const char **ptr;
{
- double ret = 0.0;
const char *start = s; /* save original start of string */
const char *begin = NULL; /* where the number really begins */
- int success = 0;
+ int dig = 0;
+ int dig0 = 0;
/* optional white space */
while (isspace(*s))
s++;
+ begin = s;
+
/* optional sign */
- if (*s == '+' || *s == '-') {
+ if (*s == '+' || *s == '-')
s++;
- if (*(s-1) == '-')
- begin = s - 1;
- else
- begin = s;
- }
/* string of digits with optional decimal point */
- if (isdigit(*s) && ! begin)
- begin = s;
-
+ while (*s == '0') {
+ s++;
+ dig0++;
+ }
while (isdigit(*s)) {
- /* don't succeed on 0x... */
- if (*s > '0')
- success++;
s++;
+ dig++;
}
if (*s == '.') {
- if (! begin)
- begin = s;
s++;
- while (isdigit(*s))
+ while (*s == '0') {
s++;
- success++;
+ dig0++;
+ }
+ while (isdigit(*s)) {
+ s++;
+ dig++;
+ }
}
- if (s == start || success == 0) /* nothing there */
- goto out;
+ dig0 += dig; /* any digit has appeared */
/*
* optional 'e' or 'E'
- * followed by optional sign or space
+ * if a digit (or at least zero) was seen
+ * followed by optional sign
* followed by an integer
*/
-
- if ((*s == 'e' || *s == 'E')
+ if (dig0
+ && (*s == 'e' || *s == 'E')
&& (isdigit(s[1])
- || ((s[1] == '-' || s[1] == '+') && isdigit(s[2])))) {
+ || ((s[1] == '-' || s[1] == '+') && isdigit(s[2])))) {
s++;
-
if (*s == '+' || *s == '-')
s++;
-
while (isdigit(*s))
s++;
}
- /* go for it */
- ret = atof(begin);
-
-out:
- if (! success && s == begin)
- s = start; /* in case all we did was skip whitespace */
-
+ /* In case we haven't found a number, set ptr to start. */
if (ptr)
- *ptr = s;
+ *ptr = (dig0 ? s : start);
- return ret;
+ /* Go for it. */
+ return (dig ? atof(begin) : 0.0);
}
#ifdef TEST
diff --git a/mkinstalldirs b/mkinstalldirs
index 0801ec2c..d2d5f21b 100755
--- a/mkinstalldirs
+++ b/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/msg.c b/msg.c
index 8b113c86..672d0867 100644
--- a/msg.c
+++ b/msg.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2001 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,12 +28,9 @@
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 */
@@ -65,7 +62,7 @@ err(const char *s, const char *emsg, 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);
@@ -80,7 +77,7 @@ err(const char *s, const char *emsg, va_list argp)
void
#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
- msg(char *mesg, ...)
+ msg(const char *mesg, ...)
#else
/*VARARGS0*/
msg(va_alist)
@@ -104,7 +101,7 @@ void
void
#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
- warning(char *mesg, ...)
+ warning(const char *mesg, ...)
#else
/*VARARGS0*/
warning(va_alist)
@@ -126,7 +123,7 @@ void
void
#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
- error(char *mesg, ...)
+ error(const char *mesg, ...)
#else
/*VARARGS0*/
error(va_alist)
@@ -149,17 +146,20 @@ void
/* set_loc --- set location where a fatal error happened */
void
-set_loc(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 */
void
#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
- r_fatal(char *mesg, ...)
+ r_fatal(const char *mesg, ...)
#else
/*VARARGS0*/
r_fatal(va_alist)
diff --git a/node.c b/node.c
index a814f6e1..5f7d57ba 100644
--- a/node.c
+++ b/node.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-2001 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.
@@ -42,16 +42,16 @@ r_force_number(register NODE *n)
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;
n->flags &= ~UNINITIALIZED;
if (n->stlen == 0) {
@@ -125,7 +125,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",
@@ -142,7 +142,7 @@ static const char *values[] = {
/* format_val --- format a numeric value based on format */
NODE *
-format_val(char *format, int index, register NODE *s)
+format_val(const char *format, int index, register NODE *s)
{
char buf[BUFSIZ];
register char *sp = buf;
@@ -210,7 +210,7 @@ format_val(char *format, int index, register NODE *s)
memcpy(s->stptr, sp, s->stlen+1);
no_malloc:
s->stref = 1;
- s->flags |= STR;
+ s->flags |= STRCUR;
s->flags &= ~UNINITIALIZED;
return s;
}
@@ -228,7 +228,7 @@ r_force_string(register NODE *s)
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
@@ -244,10 +244,11 @@ r_force_string(register NODE *s)
*/
NODE *
-dupnode(NODE *n)
+r_dupnode(NODE *n)
{
register NODE *r;
+#ifndef DUPNODE_MACRO
if ((n->flags & TEMP) != 0) {
n->flags &= ~TEMP;
n->flags |= MALLOC;
@@ -255,20 +256,34 @@ dupnode(NODE *n)
}
if ((n->flags & PERM) != 0)
return n;
- if ((n->flags & (MALLOC|STR)) == (MALLOC|STR)) {
+#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|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->stptr[r->ahname_len] = '\0';
}
return r;
}
@@ -311,13 +326,13 @@ mk_number(AWKNUM x, unsigned int flags)
/* make_str_node --- make a string node */
NODE *
-make_str_node(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|SCALAR);
if (flags & ALREADY_MALLOCED)
r->stptr = s;
else {
@@ -327,10 +342,10 @@ make_str_node(char *s, size_t len, 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;) {
@@ -432,10 +447,15 @@ unref(register NODE *tmp)
return;
tmp->flags &= ~TEMP;
if ((tmp->flags & MALLOC) != 0) {
- if ((tmp->flags & STR) != 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);
@@ -469,7 +489,7 @@ unref(register NODE *tmp)
*/
int
-parse_escape(char **string_ptr)
+parse_escape(const char **string_ptr)
{
register int c = *(*string_ptr)++;
register int i;
diff --git a/patchlev.h b/patchlev.h
index 2a15071c..a6567ca0 100644
--- a/patchlev.h
+++ b/patchlev.h
@@ -1 +1 @@
-#define PATCHLEVEL "1"
+#define PATCHLEVEL "2"
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 37a02436..bad45635 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,30 @@
+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.
+
+Sun Feb 23 16:25:44 2003 Scott Deifik <scottd@amgen.com>
+
+ * Makefile, Makefile.tst: Synchronized to main dist.
+
+Sun Feb 16 15:44:20 2003 Scott Deifik <scottd@amgen.com>
+
+ * config.h: Updated.
+
+Sun Feb 9 11:57:11 2003 Scott Deifik <scottd@amgen.com>
+
+ * Makefile, Makefile.tst: Synchronized to main dist.
+
+Tue Feb 4 14:28:06 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ All relevant files: Copyright year updated to 2003.
+
+Sun Nov 24 18:37:31 2002 Scott Deifik <scottd@amgen.com>
+
+ * Makefile, Makefile.tst: Synchronized to main dist.
+
Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.1: Release tar file made.
diff --git a/pc/Makefile b/pc/Makefile
index 57b1e0fa..85113b33 100644
--- a/pc/Makefile
+++ b/pc/Makefile
@@ -189,7 +189,8 @@ STDARGV = setargv.obj
# Optimization and library options:
# Os == optimize for size, Ot == optimize for speed, G2 == 286 or better
#MSCOPT = -Gt3600 -Os -G2
-MSCOPT = -Gt3600 -Ot # -G2
+# MSC seems to be more stable with -Od than with -Ot.
+MSCOPT = -Gt3600 -Od # -G2
# Alternate lib, does not use math coprocessor.
#MSCLIB = llibca
#MSCCL = -FPa
@@ -305,7 +306,7 @@ ALLOBJS = $(AWKOBJS) awkgram$O getid$O $(OBJ)
# LIBOBJS
# GNU and other stuff that gawk uses as library routines.
-LIBOBJS= getopt$O getopt1$O regex$O dfa$O random$O
+LIBOBJS= getopt$O getopt1$O regex$O random$O
GAWKOBJS = $(ALLOBJS) $(LIBOBJS)
PGAWKOBJS = $(PAWKOBJS1) $(PAWKOBJS2) awkgram$O getid$O $(OBJ)
@@ -338,7 +339,7 @@ $(PRSPFILE) : $(PGAWKOBJS)
echo $(PAWKOBJS2)$P >> $@
echo awkgram$O getid$O $(OBJ) $(LIBOBJS)$P >> $@
-$(ALLOBJS) eval_p$O profile_p$O: awk.h dfa.h regex.h config.h
+$(ALLOBJS) eval_p$O profile_p$O: awk.h regex.h config.h
gawkmisc$O: pc/gawkmisc.pc
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index 22928552..f94a67ba 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -1,6 +1,6 @@
# Makefile for GNU Awk test suite.
#
-# Copyright (C) 1988-2002 the Free Software Foundation, Inc.
+# Copyright (C) 1988-2003 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
@@ -64,6 +64,7 @@ AWK = ../gawk.exe
# Also point to gawk but for DOS commands needing backslashes. We need
# the forward slash version too or 'arrayparam' fails.
AWK2 = '..\gawk.exe'
+AWKPROG = ../gawk.exe
# Set your cmp command here (you can use most versions of diff instead of cmp
# if you don't want to convert the .ok files to the DOS CR/LF format).
@@ -101,46 +102,73 @@ MKDIR = command.com /c mkdir
#DATE = date
DATE = gdate
+# MS-DOS and OS/2 use ; as a PATH delimiter
+PATH_SEPARATOR = ;
+
# ============================================================================
# You shouldn't need to modify anything below this line.
# ============================================================================
srcdir = .
+# try to keep these sorted
+BASIC_TESTS = addcomma anchgsub argarray arrayparm arrayref arrymem1 arynasty \
+ arynocls arysubnm asgext awkpath back89 backgsub childin clobber \
+ clsflnam compare compare2 concat1 convfmt datanonl defref delarprm \
+ dynlj eofsplit fldchg fldchgnf fnamedat fnarray fnarydel fnaryscl \
+ fnasgnm fnmisc fnparydl forsimp fsbs fsrs fstabplus funsemnl funsmnam \
+ funstack getline getline2 getline3 getlnbuf getnr2tb getnr2tm gsubasgn gsubtest \
+ gsubtst2 gsubtst3 gsubtst4 hsprint inputred intest intprec leaddig leadnl \
+ litoct longsub longwrds math membug1 messages minusstr mmap8k \
+ nasty nasty2 negexp nfldstr nfneg nfset nlfldsep nlinstr nlstrina \
+ noeffect nofmtch noloop1 noloop2 nonl noparms nors nulrsend \
+ numindex numsubstr octsub ofmt ofmtbig ofmtfidl ofmts onlynl \
+ opasnidx opasnslf paramdup paramtyp parseme pcntplus prdupval prec \
+ printf0 printf1 prmarscl prmreuse prt1eval prtoeval psx96sub rand rebt8b1 \
+ rebt8b2 redfilnm regeq reindops reparse resplit rs rsnul1nl \
+ rstest1 rstest2 rswhite sclforin sclifin splitargv splitarr splitdef \
+ splitvar splitwht sprintfc strtod subslash substr swaplns synerr1 \
+ tradanch tweakfld uninitialized uninit2 zeroe0 zeroflag
+
+
+UNIX_TESTS = fflush getlnhd pid pipeio1 pipeio2 poundbang space strftlng
+
+GAWK_EXT_TESTS = argtest asort asorti badargs clos1way fieldwdth fsfwfs \
+ gensub gnuops2 gnureops icasefs icasers igncdym igncfs ignrcase lint \
+ match1 manyfiles nondec posix procinfs regx8bit rebuf reint shadow \
+ sort1 strftime
+
+
+EXTRA_TESTS = regtest inftest
+
+INET_TESTS = inetechu inetecht inetdayu inetdayt
+
+# List of the tests which should be run with --lint option:
+NEED_LINT = defref noeffect nofmtch shadow uninitialized uninit2
+
+# List of the files that appear in manual tests or are for reserve testing:
+GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk
+
# message stuff is to make it a little easier to follow
check: msg \
basic-msg-start basic basic-msg-end \
unix-msg-start unix-tests unix-msg-end \
- extend-msg-start gawk-extensions extend-msg-end
+ extend-msg-start gawk-extensions extend-msg-end \
+ pass-fail
-# try to keep these sorted
-basic: addcomma anchgsub argarray arrayparm arrayref arynasty arynocls \
- arysubnm arrymem1 asgext awkpath back89 backgsub childin clobber \
- clsflnam compare compare2 concat1 convfmt datanonl defref delarprm dynlj eofsplit \
- fldchg fldchgnf fnamedat fnarray fnarydel fnaryscl fnasgnm \
- fnparydl forsimp fsbs fsrs fstabplus funsemnl funsmnam funstack getline \
- getlnbuf getnr2tb getnr2tm gsubasgn gsubtest hsprint intest \
- intprec leaddig leadnl litoct longsub longwrds math membug1 messages minusstr \
- mmap8k nasty nasty2 negexp nfldstr nfset nlfldsep nlinstr nlstrina \
- noeffect nofmtch nonl noparms nors numindex numsubstr octsub \
- ofmt ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf paramdup paramtyp \
- parseme pcntplus prdupval printf1 prmarscl prmreuse prt1eval \
- prtoeval psx96sub rand rebt8b1 rebt8b2 redfilnm regeq reindops \
- reparse resplit rs rsnul1nl rswhite sclforin sclifin splitargv \
- splitdef splitvar splitwht sprintfc strtod subslash substr \
- swaplns tradanch tweakfld zeroflag
-
-unix-tests: fflush getlnhd pid pipeio1 pipeio2 poundba strftlng
-
-gawk-extensions: argtest badargs clos1way fieldwdth fsfwfs gensub \
- gnuops2 gnureops igncdym igncfs ignrcase lint manyfiles nondec \
- posix procinfs regx8bit reint shadow sort1 strftime
-
-extra: regtes inftest inet
-
-inet: inetmesg inetechu inetecht inetdayu inetdayt
+basic: $(BASIC_TESTS)
+
+unix-tests: $(UNIX_TESTS)
+
+gawk-extensions: $(GAWK_EXT_TESTS)
+
+#extra: $(EXTRA_TESTS) inet
+extra: $(EXTRA_TESTS) inetmesg
+
+inet: inetmesg $(INET_TESTS)
msg::
+ @echo ''
@echo 'Any output from "cmp" is bad news, although some differences'
@echo 'in floating point values are probably benign -- in particular,'
@echo 'some systems may omit a leading zero and the floating point'
@@ -165,734 +193,966 @@ extend-msg-end:
@echo "======== Done with gawk extension tests ========"
# This test is a PITA because increasingly, /tmp is getting
-# mounted noexec. So, we'll test it. Sigh.
-poundba::
-# @cp $(AWK) /tmp/gawk
- @$(CP) $(AWK2) '\tmp\gawk.exe'
-# @if /tmp/gawk 'BEGIN { print "OK" }' | grep OK > /dev/null ; \
-# then \
-# $(srcdir)/poundbang.awk $(srcdir)/poundbang.awk >_`basename $@` ; \
-# $(CMP) $(srcdir)/poundbang.ok _`basename $@` && rm -f _`basename $@` && echo poundbang is ok ; \
-# else \
-# echo "*** /tmp is apparently mounted noexec, skipping poundbang test." ; \
-# fi
- @if /tmp/gawk 'BEGIN { print "OK" }' | grep OK > NUL ; \
- then \
- $(srcdir)/poundbang.awk $(srcdir)/poundbang.awk >_`basename $@` ; \
- $(CMP) $(srcdir)/poundbang.ok _`basename $@` && rm -f _`basename $@` && echo poundbang is ok ; \
+# mounted noexec. So, we'll test it locally. Sigh.
+#
+# More PITA; some systems have medium short limits on #! paths,
+# so this can still fail
+poundbang::
+ @echo $@
+ @sed "s;/tmp/gawk;`pwd`/$(AWKPROG);" < $(srcdir)/poundbang.awk > ./_pbd.awk
+ @chmod +x ./_pbd.awk
+ @if ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@` ; \
+ then : ; \
else \
- echo "*** /tmp is apparently mounted noexec, skipping poundbang test." ; \
+ sed "s;/tmp/gawk;../$(AWKPROG);" < $(srcdir)/poundbang.awk > ./_pbd.awk ; \
+ chmod +x ./_pbd.awk ; \
+ ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@`; \
fi
-# @rm -f /tmp/gawk
- @rm -f /tmp/gawk.exe
-
-swaplns::
- @$(AWK) -f $(srcdir)/swaplns.awk $(srcdir)/swaplns.in >_$@
- -$(CMP) $(srcdir)/swaplns.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/poundbang.awk _`basename $@` && rm -f _`basename $@` _pbd.awk
messages::
+ @echo $@
@$(AWK) -f $(srcdir)/messages.awk >out2 2>out3
- -$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3
+ @-$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3
argarray::
+ @echo $@
@case $(srcdir) in \
.) : ;; \
*) cp $(srcdir)/argarray.in . ;; \
esac
@TEST=test echo just a test | $(AWK) -f $(srcdir)/argarray.awk ./argarray.in - >_$@
- -$(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@
-
-fstabplus::
- @echo '1 2' | $(AWK) -f $(srcdir)/fstabplus.awk >_$@
- -$(CMP) $(srcdir)/fstabplus.ok _$@ && rm -f _$@
-
-fsrs::
- @$(AWK) -f $(srcdir)/fsrs.awk $(srcdir)/fsrs.in >_$@
- -$(CMP) $(srcdir)/fsrs.ok _$@ && rm -f _$@
-
-igncfs::
- @$(AWK) -f $(srcdir)/igncfs.awk $(srcdir)/igncfs.in >_$@
- -$(CMP) $(srcdir)/igncfs.ok _$@ && rm -f _$@
-
-longwrds::
- @$(AWK) -f $(srcdir)/longwrds.awk $(srcdir)/manpage | (LC_ALL=C sort) >_$@
- -$(CMP) $(srcdir)/longwrds.ok _$@ && rm -f _$@
-
-fieldwdth::
- @echo '123456789' | $(AWK) -v FIELDWIDTHS="2 3 4" '{ print $$2}' >_$@
- -$(CMP) $(srcdir)/fieldwdth.ok _$@ && rm -f _$@
-
-ignrcase::
- @echo xYz | $(AWK) -v IGNORECASE=1 '{ sub(/y/, ""); print}' >_$@
- -$(CMP) $(srcdir)/ignrcase.ok _$@ && rm -f _$@
+ @case $(srcdir) in \
+ .) : ;; \
+ *) rm -f ./argarray.in ;; \
+ esac
+ @-$(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@
-regtes::
+regtest::
@echo 'Some of the output from regtest is very system specific, do not'
@echo 'be distressed if your output differs from that distributed.'
@echo 'Manual inspection is called for.'
-# AWK=`pwd`/$(AWK) $(srcdir)/regtest.sh
- AWK=`pwd`/$(AWK) CMP="$(CMP)" $(srcdir)/regtest.sh
-
-posix::
- @echo 'posix test may fail due to 1.500000e+000 not being equal to'
- @echo '1.500000e+00 for MSC gawk.'
- @echo '1:2,3 4' | $(AWK) -f $(srcdir)/posix.awk >_$@
- -$(CMP) $(srcdir)/posix.ok _$@ && rm -f _$@
+ AWK=`pwd`/$(AWK) $(srcdir)/regtest.sh
manyfiles::
+ @echo manyfiles
@rm -rf junk
-# @mkdir junk
- @$(MKDIR) junk
+ @mkdir junk
@$(AWK) 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >_$@
@$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@
- @echo 'If manyfiles says "junk/*: No such file or directory",'
- @echo 'use the line on test/Makefile which invokes wc'
- @echo 'without quoting the "junk/*" argument.'
- @echo "This number better be 1 ->" | tr -d '\012\015'
- @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l
-# @wc -l "junk/*" | $(AWK) '$$1 != 2' | wc -l
-# The quotes above are for people with a "wc" that doesn't too long a command
-# line.
- @rm -rf junk _$@
+ @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l | sed 's/ *//g' > _$@
+ @rm -rf junk ; $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
compare::
+ @echo $@
@$(AWK) -f $(srcdir)/compare.awk 0 1 $(srcdir)/compare.in >_$@
- -$(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@
-
-arrayref::
- @$(AWK) -f $(srcdir)/arrayref.awk >_$@
- -$(CMP) $(srcdir)/arrayref.ok _$@ && rm -f _$@
-
-rs::
- @$(AWK) -v RS="" '{ print $$1, $$2}' $(srcdir)/rs.in >_$@
- -$(CMP) $(srcdir)/rs.ok _$@ && rm -f _$@
-
-fsbs::
- @$(AWK) -v FS='\' '{ print $$1, $$2 }' $(srcdir)/fsbs.in >_$@
- -$(CMP) $(srcdir)/fsbs.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@
inftest::
+ @echo $@
@echo This test is very machine specific...
- @echo 'Both MSC 7.0 and 8.0 gawk generate a floating point exception.'
- @echo 'EMX gawk uses #INF rather than Inf.'
-# @$(AWK) -f $(srcdir)/inftest.awk >_$@
- @-$(AWK) -f $(srcdir)/inftest.awk >_$@
- -$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@
-
-getline::
- @$(AWK) -f $(srcdir)/getline.awk $(srcdir)/getline.awk $(srcdir)/getline.awk >_$@
- -$(CMP) $(srcdir)/getline.ok _$@ && rm -f _$@
-
-rand::
- @$(AWK) -f $(srcdir)/rand.awk >_$@
- -$(CMP) $(srcdir)/rand.ok _$@ && rm -f _$@
-
-negexp::
- @$(AWK) 'BEGIN { a = -2; print 10^a }' >_$@
- -$(CMP) $(srcdir)/negexp.ok _$@ && rm -f _$@
+ @$(AWK) -f $(srcdir)/inftest.awk | sed 's/inf/Inf/g' >_$@
+ @-$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@
-asgext::
- @$(AWK) -f $(srcdir)/asgext.awk $(srcdir)/asgext.in >_$@
- -$(CMP) $(srcdir)/asgext.ok _$@ && rm -f _$@
-
-anchgsub::
- @$(AWK) -f $(srcdir)/anchgsub.awk $(srcdir)/anchgsub.in >_$@
- -$(CMP) $(srcdir)/anchgsub.ok _$@ && rm -f _$@
-
-splitargv::
- @$(AWK) -f $(srcdir)/splitargv.awk $(srcdir)/splitargv.in >_$@
- -$(CMP) $(srcdir)/splitargv.ok _$@ && rm -f _$@
+getline2::
+ @echo $@
+ @$(AWK) -f $(srcdir)/getline2.awk $(srcdir)/getline2.awk $(srcdir)/getline2.awk >_$@
+ @-$(CMP) $(srcdir)/getline2.ok _$@ && rm -f _$@
awkpath::
-# MS-DOS and OS/2 use ; as a PATH delimiter
-# @AWKPATH="$(srcdir):$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@
- @AWKPATH="$(srcdir);$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@
- -$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@
-
-nfset::
- @$(AWK) -f $(srcdir)/nfset.awk $(srcdir)/nfset.in >_$@
- -$(CMP) $(srcdir)/nfset.ok _$@ && rm -f _$@
-
-reparse::
- @$(AWK) -f $(srcdir)/reparse.awk $(srcdir)/reparse.in >_$@
- -$(CMP) $(srcdir)/reparse.ok _$@ && rm -f _$@
+ @echo $@
+ @AWKPATH="$(srcdir)$(PATH_SEPARATOR)$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@
+ @-$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@
argtest::
+ @echo $@
@$(AWK) -f $(srcdir)/argtest.awk -x -y abc >_$@
- -$(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@
badargs::
-# For MS-DOS & OS/2, we use " rather than ' in the usage statement.
+ @echo $@
@-$(AWK) -f 2>&1 | grep -v patchlevel >_$@
-# Next line converts " to ' for $(CMP) to work with UNIX badargs.ok
- @cat _$@ | tr '\042' '\047' > _$@.2
-# -$(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@
- -$(CMP) $(srcdir)/badargs.ok _$@.2 && rm -f _$@ _$@.2
-
-convfmt::
- @$(AWK) -f $(srcdir)/convfmt.awk >_$@
- -$(CMP) $(srcdir)/convfmt.ok _$@ && rm -f _$@
-
-arrayparm::
- @-AWKPATH=$(srcdir) $(AWK) -f arrayparm.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/arrayparm.ok _$@ && rm -f _$@
-
-paramdup::
- @-AWKPATH=$(srcdir) $(AWK) -f paramdup.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/paramdup.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@
nonl::
-# @-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1
- @-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk NUL >_$@ 2>&1
- -$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@
-
-defref::
- @-AWKPATH=$(srcdir) $(AWK) --lint -f defref.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/defref.ok _$@ && rm -f _$@
-
-nofmtch::
- @-AWKPATH=$(srcdir) $(AWK) --lint -f nofmtch.awk >_$@ 2>&1
- -$(CMP) $(srcdir)/nofmtch.ok _$@ && rm -f _$@
+ @echo $@
+ @-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1
+ @-$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@
strftime::
- : this test could fail on slow machines or on a second boundary,
- : so if it does, double check the actual results
-# We set TZ to make sure that we properly set the timezone.
-# @LC_ALL=C; export LC_ALL; LANG=C; export LANG; \
-# TZ=GMT0; export TZ; \
-# date | $(AWK) -v OUTPUT=_$@ -f $(srcdir)/strftime.awk
+ @echo This test could fail on slow machines or on a second boundary,
+ @echo so if it does, double check the actual results:
+ @echo $@
@LC_ALL=C; export LC_ALL; LANG=C; export LANG; \
TZ=GMT0; export TZ; \
- $(DATE) | $(AWK) -v OUTPUT=_$@ -f $(srcdir)/strftime.awk
- -$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0
+ date | $(AWK) -v OUTPUT=_$@ -f $(srcdir)/strftime.awk
+ @-$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0
litoct::
+ @echo $@
@echo ab | $(AWK) --traditional -f $(srcdir)/litoct.awk >_$@
- -$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@
-
-gensub::
- @$(AWK) -f $(srcdir)/gensub.awk $(srcdir)/gensub.in >_$@
- -$(CMP) $(srcdir)/gensub.ok _$@ && rm -f _$@
-
-resplit::
- @echo a:b:c d:e:f | $(AWK) '{ FS = ":"; $$0 = $$0; print $$2 }' > _$@
- -$(CMP) $(srcdir)/resplit.ok _$@ && rm -f _$@
-
-rswhite::
- @$(AWK) -f $(srcdir)/rswhite.awk $(srcdir)/rswhite.in > _$@
- -$(CMP) $(srcdir)/rswhite.ok _$@ && rm -f _$@
-
-prmarscl::
- @-AWKPATH=$(srcdir) $(AWK) -f prmarscl.awk > _$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/prmarscl.ok _$@ && rm -f _$@
-
-sclforin::
- @-AWKPATH=$(srcdir) $(AWK) -f sclforin.awk > _$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/sclforin.ok _$@ && rm -f _$@
-
-sclifin::
- @-AWKPATH=$(srcdir) $(AWK) -f sclifin.awk > _$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/sclifin.ok _$@ && rm -f _$@
-
-intprec::
- @-$(AWK) -f $(srcdir)/intprec.awk > _$@ 2>&1
- -$(CMP) $(srcdir)/intprec.ok _$@ && rm -f _$@
-
-childin::
- @echo hi | $(AWK) 'BEGIN { "cat" | getline; print; close("cat") }' > _$@
- -$(CMP) $(srcdir)/childin.ok _$@ && rm -f _$@
-
-noeffect::
- @-AWKPATH=$(srcdir) $(AWK) --lint -f noeffect.awk > _$@ 2>&1
- -$(CMP) $(srcdir)/noeffect.ok _$@ && rm -f _$@
-
-numsubstr::
- @-AWKPATH=$(srcdir) $(AWK) -f numsubstr.awk $(srcdir)/numsubstr.in >_$@
- -$(CMP) $(srcdir)/numsubstr.ok _$@ && rm -f _$@
-
-gnureops::
- @$(AWK) -f $(srcdir)/gnureops.awk >_$@
- -$(CMP) $(srcdir)/gnureops.ok _$@ && rm -f _$@
-
-pcntplus::
- @$(AWK) -f $(srcdir)/pcntplus.awk >_$@
- -$(CMP) $(srcdir)/pcntplus.ok _$@ && rm -f _$@
-
-prmreuse::
- @$(AWK) -f $(srcdir)/prmreuse.awk >_$@
- -$(CMP) $(srcdir)/prmreuse.ok _$@ && rm -f _$@
-
-math::
- @$(AWK) -f $(srcdir)/math.awk >_$@
- -$(CMP) $(srcdir)/math.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@
fflush::
+ @echo $@
@$(srcdir)/fflush.sh >_$@
- -$(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@
-
-fldchg::
- @$(AWK) -f $(srcdir)/fldchg.awk $(srcdir)/fldchg.in >_$@
- -$(CMP) $(srcdir)/fldchg.ok _$@ && rm -f _$@
-
-fldchgnf::
- @$(AWK) -f $(srcdir)/fldchgnf.awk $(srcdir)/fldchgnf.in >_$@
- -$(CMP) $(srcdir)/fldchgnf.ok _$@ && rm -f _$@
-
-reindops::
- @$(AWK) -f $(srcdir)/reindops.awk $(srcdir)/reindops.in >_$@
- -$(CMP) $(srcdir)/reindops.ok _$@ && rm -f _$@
-
-sprintfc::
- @$(AWK) -f $(srcdir)/sprintfc.awk $(srcdir)/sprintfc.in >_$@
- -$(CMP) $(srcdir)/sprintfc.ok _$@ && rm -f _$@
-
-getlnhd::
-# In 3.0.3, COMSPEC=$(SHELL) was used for MSC and MINGW32 which do
-# not honor SHELL.
-# COMSPEC=$(SHELL) $(AWK) -f $(srcdir)/getlnhd.awk >_$@
- @$(AWK) -f $(srcdir)/getlnhd.awk >_$@
- -$(CMP) $(srcdir)/getlnhd.ok _$@ && rm -f _$@
-
-backgsub::
- @$(AWK) -f $(srcdir)/backgsub.awk $(srcdir)/backgsub.in >_$@
- -$(CMP) $(srcdir)/backgsub.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@
tweakfld::
+ @echo $@
@$(AWK) -f $(srcdir)/tweakfld.awk $(srcdir)/tweakfld.in >_$@
@rm -f errors.cleanup
- -$(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@
-
-clsflnam::
- @$(AWK) -f $(srcdir)/clsflnam.awk $(srcdir)/clsflnam.in >_$@ 2>&1
- -$(CMP) $(srcdir)/clsflnam.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@
mmap8k::
+ @echo $@
@$(AWK) '{ print }' $(srcdir)/mmap8k.in >_$@
- -$(CMP) $(srcdir)/mmap8k.in _$@ && rm -f _$@
-
-fnarray::
- @-AWKPATH=$(srcdir) $(AWK) -f fnarray.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/fnarray.ok _$@ && rm -f _$@
-
-dynlj::
- @$(AWK) -f $(srcdir)/dynlj.awk >_$@
- -$(CMP) $(srcdir)/dynlj.ok _$@ && rm -f _$@
-
-substr::
- @$(AWK) -f $(srcdir)/substr.awk >_$@
- -$(CMP) $(srcdir)/substr.ok _$@ && rm -f _$@
-
-eofsplit::
- @$(AWK) -f $(srcdir)/eofsplit.awk >_$@
- -$(CMP) $(srcdir)/eofsplit.ok _$@ && rm -f _$@
-
-prt1eval::
- @$(AWK) -f $(srcdir)/prt1eval.awk >_$@
- -$(CMP) $(srcdir)/prt1eval.ok _$@ && rm -f _$@
-
-gsubasgn::
- @-AWKPATH=$(srcdir) $(AWK) -f gsubasgn.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/gsubasgn.ok _$@ && rm -f _$@
-
-prtoeval::
- @$(AWK) -f $(srcdir)/prtoeval.awk >_$@
- -$(CMP) $(srcdir)/prtoeval.ok _$@ && rm -f _$@
-
-gsubtest::
- @$(AWK) -f $(srcdir)/gsubtest.awk >_$@
- -$(CMP) $(srcdir)/gsubtest.ok _$@ && rm -f _$@
-
-splitwht::
- @$(AWK) -f $(srcdir)/splitwht.awk >_$@
- -$(CMP) $(srcdir)/splitwht.ok _$@ && rm -f _$@
-
-back89::
- @$(AWK) '/a\8b/' $(srcdir)/back89.in >_$@
- -$(CMP) $(srcdir)/back89.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/mmap8k.in _$@ && rm -f _$@
tradanch::
+ @echo $@
@$(AWK) --traditional -f $(srcdir)/tradanch.awk $(srcdir)/tradanch.in >_$@
- -$(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@
-
-nlfldsep::
- @$(AWK) -f $(srcdir)/nlfldsep.awk $(srcdir)/nlfldsep.in > _$@
- -$(CMP) $(srcdir)/nlfldsep.ok _$@ && rm -f _$@
-
-splitvar::
- @$(AWK) -f $(srcdir)/splitvar.awk $(srcdir)/splitvar.in >_$@
- -$(CMP) $(srcdir)/splitvar.ok _$@ && rm -f _$@
-
-intest::
- @$(AWK) -f $(srcdir)/intest.awk >_$@
- -$(CMP) $(srcdir)/intest.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@
# AIX /bin/sh exec's the last command in a list, therefore issue a ":"
# command so that pid.sh is fork'ed as a child before being exec'ed.
pid::
+ @echo pid
+ @AWKPATH=$(srcdir) AWK=$(AWKPROG) LC_ALL=C $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; :
@echo 'Expect pid to fail in DOS.'
- @AWKPATH=$(srcdir) AWK=$(AWK) $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; :
- -$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in
+ @-$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in
strftlng::
- @echo 'Edit test/Makefile if you use MSC6, since strftlng will fail.'
+ @echo $@
@TZ=UTC; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@
-# @if $(CMP) -s $(srcdir)/strftlng.ok _$@ ; then : ; else \
-# TZ=UTC0; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \
-# fi
@if $(CMP) -s $(srcdir)/strftlng.ok _$@ ; then : ; else \
- env TZ=UTC0; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \
+ TZ=UTC0; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \
fi
- -$(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@
-
-nfldstr::
- @echo | $(AWK) '$$1 == 0 { print "bug" }' > _$@
- -$(CMP) $(srcdir)/nfldstr.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@
nors::
+ @echo $@
@echo A B C D E | tr -d '\12\15' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@
- -$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@
-
-fnarydel::
- @$(AWK) -f $(srcdir)/fnarydel.awk >_$@
- -$(CMP) $(srcdir)/fnarydel.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@
reint::
+ @echo $@
@$(AWK) --re-interval -f $(srcdir)/reint.awk $(srcdir)/reint.in >_$@
- -$(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@
-
-noparms::
- @-AWKPATH=$(srcdir) $(AWK) -f noparms.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/noparms.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@
pipeio1::
+ @echo $@
@$(AWK) -f $(srcdir)/pipeio1.awk >_$@
@rm -f test1 test2
- -$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@
pipeio2::
-# This would fail were it not for the "cat" line due to DOS's ECHO command.
- @echo 'pipeio may fail due to the way that your tr & echo work in DOS'
+ @echo $@
@$(AWK) -v SRCDIR=$(srcdir) -f $(srcdir)/pipeio2.awk >_$@
- @cat _$@ | $(AWK) '{ sub("ECHO is.*","",$$0); print $$0 } ' > _$@.2
-# -$(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@
- -diff -w $(srcdir)/pipeio2.ok _$@.2 && rm -f _$@ _$@.2
-
-funstack::
- @echo 'Expect funstack to fail with MSC DOS versions.'
-# @$(AWK) -f $(srcdir)/funstack.awk $(srcdir)/funstack.in >_$@
- @-$(AWK) -f $(srcdir)/funstack.awk $(srcdir)/funstack.in >_$@
- -$(CMP) $(srcdir)/funstack.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@
clobber::
+ @echo $@
@$(AWK) -f $(srcdir)/clobber.awk >_$@
- -$(CMP) $(srcdir)/clobber.ok seq && $(CMP) $(srcdir)/clobber.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/clobber.ok seq && $(CMP) $(srcdir)/clobber.ok _$@ && rm -f _$@
@rm -f seq
-delarprm::
- @$(AWK) -f $(srcdir)/delarprm.awk >_$@
- -$(CMP) $(srcdir)/delarprm.ok _$@ && rm -f _$@
-
-prdupval::
- @$(AWK) -f $(srcdir)/prdupval.awk $(srcdir)/prdupval.in >_$@
- -$(CMP) $(srcdir)/prdupval.ok _$@ && rm -f _$@
-
-nondec::
-# @if grep BITOP ../config.h | grep define > /dev/null; \
-# then \
-# $(AWK) -f $(srcdir)/nondec.awk >_$@; \
-# else \
-# cp $(srcdir)/nondec.ok _$@; \
-# fi
- @if grep BITOP ../config.h | grep define > /dev/null; \
- then \
- $(AWK) -f $(srcdir)/nondec.awk >_$@; \
- else \
- $(CP) $(srcdir)\\nondec.ok _$@; \
- fi
- -$(CMP) $(srcdir)/nondec.ok _$@ && rm -f _$@
-
-nasty::
- @$(AWK) -f $(srcdir)/nasty.awk >_$@
- -$(CMP) $(srcdir)/nasty.ok _$@ && rm -f _$@
-
-nasty2::
- @$(AWK) -f $(srcdir)/nasty2.awk >_$@
- -$(CMP) $(srcdir)/nasty2.ok _$@ && rm -f _$@
-
-zeroflag::
- @$(AWK) -f $(srcdir)/zeroflag.awk >_$@
- -$(CMP) $(srcdir)/zeroflag.ok _$@ && rm -f _$@
-
-getnr2tm::
- @$(AWK) -f $(srcdir)/getnr2tm.awk $(srcdir)/getnr2tm.in >_$@
- -$(CMP) $(srcdir)/getnr2tm.ok _$@ && rm -f _$@
-
-getnr2tb::
- @$(AWK) -f $(srcdir)/getnr2tb.awk $(srcdir)/getnr2tb.in >_$@
- -$(CMP) $(srcdir)/getnr2tb.ok _$@ && rm -f _$@
-
-printf1::
- @$(AWK) -f $(srcdir)/printf1.awk >_$@
- -$(CMP) $(srcdir)/printf1.ok _$@ && rm -f _$@
-
-funsmnam::
- @-AWKPATH=$(srcdir) $(AWK) -f funsmnam.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/funsmnam.ok _$@ && rm -f _$@
-
-fnamedat::
- @-AWKPATH=$(srcdir) $(AWK) -f fnamedat.awk < $(srcdir)/fnamedat.in >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/fnamedat.ok _$@ && rm -f _$@
-
-numindex::
- @-AWKPATH=$(srcdir) $(AWK) -f numindex.awk < $(srcdir)/numindex.in >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/numindex.ok _$@ && rm -f _$@
-
-subslash::
- @-AWKPATH=$(srcdir) $(AWK) -f subslash.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/subslash.ok _$@ && rm -f _$@
-
-opasnslf::
- @-AWKPATH=$(srcdir) $(AWK) -f opasnslf.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/opasnslf.ok _$@ && rm -f _$@
-
-opasnidx::
- @-AWKPATH=$(srcdir) $(AWK) -f opasnidx.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/opasnidx.ok _$@ && rm -f _$@
-
arynocls::
+ @echo $@
@-AWKPATH=$(srcdir) $(AWK) -v INPUT=$(srcdir)/arynocls.in -f arynocls.awk >_$@
- -$(CMP) $(srcdir)/arynocls.ok _$@ && rm -f _$@
-
-igncdym::
- @-AWKPATH=$(srcdir) $(AWK) -f igncdym.awk $(srcdir)/igncdym.in >_$@
- -$(CMP) $(srcdir)/igncdym.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/arynocls.ok _$@ && rm -f _$@
getlnbuf::
- @echo getlnbuf runs out of memory with MSC gawk.
+ @echo $@
@-AWKPATH=$(srcdir) $(AWK) -f getlnbuf.awk $(srcdir)/getlnbuf.in > _$@
@-AWKPATH=$(srcdir) $(AWK) -f gtlnbufv.awk $(srcdir)/getlnbuf.in > _2$@
- -$(CMP) $(srcdir)/getlnbuf.ok _$@ && $(CMP) $(srcdir)/getlnbuf.ok _2$@ && rm -f _$@ _2$@
-
-arysubnm::
- @-AWKPATH=$(srcdir) $(AWK) -f arysubnm.awk >_$@
- -$(CMP) $(srcdir)/arysubnm.ok _$@ && rm -f _$@
-
-fnparydl::
- @-AWKPATH=$(srcdir) $(AWK) -f fnparydl.awk >_$@
- -$(CMP) $(srcdir)/fnparydl.ok _$@ && rm -f _$@
-
-nlstrina::
- @-AWKPATH=$(srcdir) $(AWK) -f nlstrina.awk >_$@
- -$(CMP) $(srcdir)/nlstrina.ok _$@ && rm -f _$@
-
-octsub::
- @-AWKPATH=$(srcdir) $(AWK) -f octsub.awk >_$@
- -$(CMP) $(srcdir)/octsub.ok _$@ && rm -f _$@
-
-nlinstr::
- @$(AWK) -f $(srcdir)/nlinstr.awk $(srcdir)/nlinstr.in >_$@
- -$(CMP) $(srcdir)/nlinstr.ok _$@ && rm -f _$@
-
-ofmt::
- @$(AWK) -f $(srcdir)/ofmt.awk $(srcdir)/ofmt.in >_$@
- -$(CMP) $(srcdir)/ofmt.ok _$@ && rm -f _$@
-
-hsprint::
- @echo 'hsprint test may fail due to 1.27e+01 not being equal to'
- @echo '1.27e+001 (and similarly for other numbers) for MSC gawk.'
- @$(AWK) -f $(srcdir)/hsprint.awk >_$@
- -$(CMP) $(srcdir)/hsprint.ok _$@ && rm -f _$@
-
-fsfwfs::
- @$(AWK) -f $(srcdir)/fsfwfs.awk $(srcdir)/fsfwfs.in >_$@
- -$(CMP) $(srcdir)/fsfwfs.ok _$@ && rm -f _$@
-
-ofmts::
- @$(AWK) -f $(srcdir)/ofmts.awk $(srcdir)/ofmts.in >_$@
- -$(CMP) $(srcdir)/ofmts.ok _$@ && rm -f _$@
-
-parseme::
- @-AWKPATH=$(srcdir) $(AWK) -f parseme.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/parseme.ok _$@ && rm -f _$@
-
-splitdef::
- @$(AWK) -f $(srcdir)/splitdef.awk >_$@
- -$(CMP) $(srcdir)/splitdef.ok _$@ && rm -f _$@
-
-fnaryscl::
- @-AWKPATH=$(srcdir) $(AWK) -f fnaryscl.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/fnaryscl.ok _$@ && rm -f _$@
-
-fnasgnm::
- @-AWKPATH=$(srcdir) $(AWK) -f fnasgnm.awk < $(srcdir)/fnasgnm.in >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/fnasgnm.ok _$@ && rm -f _$@
-
-lint::
- @-AWKPATH=$(srcdir) $(AWK) -f lint.awk > _$@ 2>&1
- -$(CMP) $(srcdir)/lint.ok _$@ && rm -f _$@
-
-procinfs::
- @-$(AWK) -f $(srcdir)/procinfs.awk > _$@
- -$(CMP) $(srcdir)/procinfs.ok _$@ && rm -f _$@
-
-sort1::
- @-$(AWK) -f $(srcdir)/sort1.awk > _$@
- -$(CMP) $(srcdir)/sort1.ok _$@ && rm -f _$@
-
-ofmtbig::
- @$(AWK) -f $(srcdir)/ofmtbig.awk $(srcdir)/ofmtbig.in >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/ofmtbig.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/getlnbuf.ok _$@ && $(CMP) $(srcdir)/getlnbuf.ok _2$@ && rm -f _$@ _2$@
inetmesg::
@echo These tests only work if your system supports the services
- @echo "'discard'" at port 9 and "'daytimed" at port 13. Check your
+ @echo "'discard'" at port 9 and "'daytimed'" at port 13. Check your
@echo file /etc/services and do "'netstat -a'".
+ @echo Expect inet tests to fail with MSC and DJGPP because "|&" is not supported.
inetechu::
- @echo inetechu fails with MSC and DJGPP because "|&" is not supported.
@echo This test is for establishing UDP connections
-# @$(AWK) 'BEGIN {print "" |& "/inet/udp/0/127.0.0.1/9"}'
- @-$(AWK) 'BEGIN {print "" |& "/inet/udp/0/127.0.0.1/9"}'
+ @$(AWK) 'BEGIN {print "" |& "/inet/udp/0/127.0.0.1/9"}'
inetecht::
- @echo inetecht fails with MSC and DJGPP because "|&" is not supported.
@echo This test is for establishing TCP connections
-# @$(AWK) 'BEGIN {print "" |& "/inet/tcp/0/127.0.0.1/9"}'
- @-$(AWK) 'BEGIN {print "" |& "/inet/tcp/0/127.0.0.1/9"}'
+ @$(AWK) 'BEGIN {print "" |& "/inet/tcp/0/127.0.0.1/9"}'
inetdayu::
- @echo inetdayu fails with MSC and DJGPP because "|&" is not supported.
@echo This test is for bidirectional UDP transmission
-# @$(AWK) 'BEGIN { print "" |& "/inet/udp/0/127.0.0.1/13"; \
-# "/inet/udp/0/127.0.0.1/13" |& getline; print $0}'
- @-$(AWK) 'BEGIN { print "" |& "/inet/udp/0/127.0.0.1/13"; \
+ @$(AWK) 'BEGIN { print "" |& "/inet/udp/0/127.0.0.1/13"; \
"/inet/udp/0/127.0.0.1/13" |& getline; print $0}'
inetdayt::
- @echo inetdayt fails with MSC and DJGPP because "|&" is not supported.
@echo This test is for bidirectional TCP transmission
-# @$(AWK) 'BEGIN { print "" |& "/inet/tcp/0/127.0.0.1/13"; \
-# "/inet/tcp/0/127.0.0.1/13" |& getline; print $0}'
- @-$(AWK) 'BEGIN { print "" |& "/inet/tcp/0/127.0.0.1/13"; \
+ @$(AWK) 'BEGIN { print "" |& "/inet/tcp/0/127.0.0.1/13"; \
"/inet/tcp/0/127.0.0.1/13" |& getline; print $0}'
-paramtyp::
- @$(AWK) -f $(srcdir)/paramtyp.awk >_$@
- -$(CMP) $(srcdir)/paramtyp.ok _$@ && rm -f _$@
-
-rsnul1nl::
- @$(AWK) -f $(srcdir)/rsnul1nl.awk $(srcdir)/rsnul1nl.in >_$@
- -$(CMP) $(srcdir)/rsnul1nl.ok _$@ && rm -f _$@
-
-datanonl::
- @$(AWK) -f $(srcdir)/datanonl.awk $(srcdir)/datanonl.in >_$@
- -$(CMP) $(srcdir)/datanonl.ok _$@ && rm -f _$@
-
-regeq::
- @$(AWK) -f $(srcdir)/regeq.awk $(srcdir)/regeq.in >_$@
- -$(CMP) $(srcdir)/regeq.ok _$@ && rm -f _$@
-
redfilnm::
+ @echo $@
@$(AWK) -f $(srcdir)/redfilnm.awk srcdir=$(srcdir) $(srcdir)/redfilnm.in >_$@
- -$(CMP) $(srcdir)/redfilnm.ok _$@ && rm -f _$@
-
-strtod::
- @$(AWK) -f $(srcdir)/strtod.awk $(srcdir)/strtod.in >_$@
- -$(CMP) $(srcdir)/strtod.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/redfilnm.ok _$@ && rm -f _$@
leaddig::
+ @echo $@
@$(AWK) -v x=2E -f $(srcdir)/leaddig.awk >_$@
- -$(CMP) $(srcdir)/leaddig.ok _$@ && rm -f _$@
-
-clos1way::
- @echo clos1way fails with MSC and DJGPP because "|&" is not supported.
-# @$(AWK) -f $(srcdir)/clos1way.awk >_$@
- @-$(AWK) -f $(srcdir)/clos1way.awk >_$@
- -$(CMP) $(srcdir)/clos1way.ok _$@ && rm -f _$@
-
-arynasty::
- @$(AWK) -f $(srcdir)/arynasty.awk >_$@
- -$(CMP) $(srcdir)/arynasty.ok _$@ && rm -f _$@
-
-shadow::
- @-AWKPATH=$(srcdir) $(AWK) --lint -f shadow.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/shadow.ok _$@ && rm -f _$@
-
-regx8bit::
- @$(AWK) -f $(srcdir)/regx8bit.awk >_$@
- -$(CMP) $(srcdir)/regx8bit.ok _$@ && rm -f _$@
-
-psx96sub::
- @$(AWK) -f $(srcdir)/psx96sub.awk >_$@
- -$(CMP) $(srcdir)/psx96sub.ok _$@ && rm -f _$@
-
-addcomma::
- @echo 'If addcomma fails, set try setting LFN=n in your environment'
- @echo "before running make. If that still doesn't work, read the"
- @echo 'comment in this makefile about setting CMP for information'
- @echo 'about what may be happenning.'
- @$(AWK) -f $(srcdir)/addcomma.awk $(srcdir)/addcomma.in >_$@
- -$(CMP) $(srcdir)/addcomma.ok _$@ && rm -f _$@
-
-gnuops2::
- @$(AWK) -f $(srcdir)/gnuops2.awk >_$@
- -$(CMP) $(srcdir)/gnuops2.ok _$@ && rm -f _$@
-
-rebt8b1::
- @$(AWK) -f $(srcdir)/rebt8b1.awk >_$@
- -$(CMP) $(srcdir)/rebt8b1.ok _$@ && rm -f _$@
-
-rebt8b2::
- @$(AWK) -f $(srcdir)/rebt8b2.awk >_$@
- -$(CMP) $(srcdir)/rebt8b2.ok _$@ && rm -f _$@
-
-leadnl::
- @$(AWK) -f $(srcdir)/leadnl.awk $(srcdir)/leadnl.in >_$@
- -$(CMP) $(srcdir)/leadnl.ok _$@ && rm -f _$@
-
-funsemnl::
- @$(AWK) -f $(srcdir)/funsemnl.awk >_$@
- -$(CMP) $(srcdir)/funsemnl.ok _$@ && rm -f _$@
-
-ofmtfidl::
- @$(AWK) -f $(srcdir)/ofmtfidl.awk $(srcdir)/ofmtfidl.in >_$@
- -$(CMP) $(srcdir)/ofmtfidl.ok _$@ && rm -f _$@
-
-onlynl::
- @$(AWK) -f $(srcdir)/onlynl.awk $(srcdir)/onlynl.in >_$@
- -$(CMP) $(srcdir)/onlynl.ok _$@ && rm -f _$@
-
-arrymem1::
- @$(AWK) -f $(srcdir)/arrymem1.awk >_$@
- -$(CMP) $(srcdir)/arrymem1.ok _$@ && rm -f _$@
-
-compare2::
- @$(AWK) -f $(srcdir)/compare2.awk >_$@
- -$(CMP) $(srcdir)/compare2.ok _$@ && rm -f _$@
-
-minusstr::
- @$(AWK) -f $(srcdir)/minusstr.awk >_$@
- -$(CMP) $(srcdir)/minusstr.ok _$@ && rm -f _$@
-
-membug1::
- @$(AWK) -f $(srcdir)/membug1.awk $(srcdir)/membug1.in >_$@
- -$(CMP) $(srcdir)/membug1.ok _$@ && rm -f _$@
-
-forsimp::
- @$(AWK) -f $(srcdir)/forsimp.awk >_$@
- -$(CMP) $(srcdir)/forsimp.ok _$@ && rm -f _$@
-
-concat1::
- @$(AWK) -f $(srcdir)/concat1.awk $(srcdir)/concat1.in >_$@
- -$(CMP) $(srcdir)/concat1.ok _$@ && rm -f _$@
-
-longsub::
- @$(AWK) -f $(srcdir)/longsub.awk $(srcdir)/longsub.in >_$@
- -$(CMP) $(srcdir)/longsub.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/leaddig.ok _$@ && rm -f _$@
+
+gsubtst3::
+ @echo $@
+ @$(AWK) --re-interval -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+space::
+ @echo $@
+ @echo 'Expect space to fail in DOS.'
+ @$(AWK) -f ' ' $(srcdir)/space.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+printf0::
+ @echo $@
+ @$(AWK) --posix -f $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+Gt-dummy:
+# file Maketests, generated from Makefile.am by the Gentests program
+addcomma:
+ @echo addcomma
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+anchgsub:
+ @echo anchgsub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arrayparm:
+ @echo arrayparm
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arrayref:
+ @echo arrayref
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arrymem1:
+ @echo arrymem1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arynasty:
+ @echo arynasty
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arysubnm:
+ @echo arysubnm
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+asgext:
+ @echo asgext
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+back89:
+ @echo back89
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+backgsub:
+ @echo backgsub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+childin:
+ @echo childin
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+clsflnam:
+ @echo clsflnam
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+compare2:
+ @echo compare2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+concat1:
+ @echo concat1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+convfmt:
+ @echo convfmt
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+datanonl:
+ @echo datanonl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+defref:
+ @echo defref
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+delarprm:
+ @echo delarprm
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+dynlj:
+ @echo dynlj
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+eofsplit:
+ @echo eofsplit
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fldchg:
+ @echo fldchg
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fldchgnf:
+ @echo fldchgnf
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnamedat:
+ @echo fnamedat
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnarray:
+ @echo fnarray
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnarydel:
+ @echo fnarydel
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnaryscl:
+ @echo fnaryscl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnasgnm:
+ @echo fnasgnm
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnmisc:
+ @echo fnmisc
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnparydl:
+ @echo fnparydl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+forsimp:
+ @echo forsimp
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fsbs:
+ @echo fsbs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fsrs:
+ @echo fsrs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fstabplus:
+ @echo fstabplus
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+funsemnl:
+ @echo funsemnl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+funsmnam:
+ @echo funsmnam
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+funstack:
+ @echo funstack
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+getline:
+ @echo getline
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+getline3:
+ @echo getline3
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+getnr2tb:
+ @echo getnr2tb
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+getnr2tm:
+ @echo getnr2tm
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gsubasgn:
+ @echo gsubasgn
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gsubtest:
+ @echo gsubtest
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gsubtst2:
+ @echo gsubtst2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gsubtst4:
+ @echo gsubtst4
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+hsprint:
+ @echo hsprint
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+inputred:
+ @echo inputred
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+intest:
+ @echo intest
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+intprec:
+ @echo intprec
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+leadnl:
+ @echo leadnl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+longsub:
+ @echo longsub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+longwrds:
+ @echo longwrds
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+math:
+ @echo math
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+membug1:
+ @echo membug1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+minusstr:
+ @echo minusstr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nasty:
+ @echo nasty
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nasty2:
+ @echo nasty2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+negexp:
+ @echo negexp
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nfldstr:
+ @echo nfldstr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nfneg:
+ @echo nfneg
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nfset:
+ @echo nfset
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nlfldsep:
+ @echo nlfldsep
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nlinstr:
+ @echo nlinstr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nlstrina:
+ @echo nlstrina
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+noeffect:
+ @echo noeffect
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nofmtch:
+ @echo nofmtch
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+noloop1:
+ @echo noloop1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+noloop2:
+ @echo noloop2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+noparms:
+ @echo noparms
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nulrsend:
+ @echo nulrsend
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+numindex:
+ @echo numindex
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+numsubstr:
+ @echo numsubstr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+octsub:
+ @echo octsub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ofmt:
+ @echo ofmt
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ofmtbig:
+ @echo ofmtbig
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ofmtfidl:
+ @echo ofmtfidl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ofmts:
+ @echo ofmts
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+onlynl:
+ @echo onlynl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+opasnidx:
+ @echo opasnidx
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+opasnslf:
+ @echo opasnslf
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+paramdup:
+ @echo paramdup
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+paramtyp:
+ @echo paramtyp
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+parseme:
+ @echo parseme
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+pcntplus:
+ @echo pcntplus
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prdupval:
+ @echo prdupval
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prec:
+ @echo prec
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+printf1:
+ @echo printf1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prmarscl:
+ @echo prmarscl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prmreuse:
+ @echo prmreuse
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prt1eval:
+ @echo prt1eval
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prtoeval:
+ @echo prtoeval
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+psx96sub:
+ @echo psx96sub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rand:
+ @echo rand
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rebt8b1:
+ @echo rebt8b1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rebt8b2:
+ @echo rebt8b2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+regeq:
+ @echo regeq
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+reindops:
+ @echo reindops
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+reparse:
+ @echo reparse
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+resplit:
+ @echo resplit
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rs:
+ @echo rs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rsnul1nl:
+ @echo rsnul1nl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rstest1:
+ @echo rstest1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rstest2:
+ @echo rstest2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rswhite:
+ @echo rswhite
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+sclforin:
+ @echo sclforin
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+sclifin:
+ @echo sclifin
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+splitargv:
+ @echo splitargv
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+splitarr:
+ @echo splitarr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+splitdef:
+ @echo splitdef
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+splitvar:
+ @echo splitvar
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+splitwht:
+ @echo splitwht
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+sprintfc:
+ @echo sprintfc
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+strtod:
+ @echo strtod
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+subslash:
+ @echo subslash
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+substr:
+ @echo substr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+swaplns:
+ @echo swaplns
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+synerr1:
+ @echo synerr1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+uninitialized:
+ @echo uninitialized
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+uninit2:
+ @echo uninit2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+zeroe0:
+ @echo zeroe0
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+zeroflag:
+ @echo zeroflag
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+getlnhd:
+ @echo getlnhd
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+asort:
+ @echo asort
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+asorti:
+ @echo asorti
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+clos1way:
+ @echo clos1way
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ @echo Expect clos1way to fail with MSC and DJGPP because "|&" is not supported.
+
+fieldwdth:
+ @echo fieldwdth
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fsfwfs:
+ @echo fsfwfs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gensub:
+ @echo gensub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gnuops2:
+ @echo gnuops2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gnureops:
+ @echo gnureops
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+icasefs:
+ @echo icasefs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+icasers:
+ @echo icasers
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+igncdym:
+ @echo igncdym
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+igncfs:
+ @echo igncfs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ignrcase:
+ @echo ignrcase
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+lint:
+ @echo lint
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+match1:
+ @echo match1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nondec:
+ @echo nondec
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+posix:
+ @echo posix
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+procinfs:
+ @echo procinfs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+regx8bit:
+ @echo regx8bit
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rebuf:
+ @echo rebuf
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+shadow:
+ @echo shadow
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+sort1:
+ @echo sort1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+# end of file Maketests
+
+# Targets generated for other tests:
+
+$(srcdir)/Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
+ $(AWK) -f $(srcdir)/Gentests "$<" *.awk *.in > $(srcdir)/Maketests
clean:
rm -fr _* core junk out1 out2 out3 strftime.ok test1 test2 seq *~
+# An attempt to print something that can be grepped for in build logs
+pass-fail:
+ @COUNT=`ls _* 2>/dev/null | wc -l` ; \
+ if test $$COUNT = 0 ; \
+ then echo ALL TESTS PASSED ; \
+ else echo $$COUNT TESTS FAILED ; \
+ fi
+
# This target for my convenience to look at all the results
diffout:
for i in _* ; \
@@ -901,6 +1161,17 @@ diffout:
diff -c $${i#_}.ok $$i ; \
done | more
+# This target is for testing with electric fence.
+efence:
+ for i in $$(ls _* | sed 's;_\(.*\);\1;') ; \
+ do \
+ bad=$$(wc -l < _$$i) \
+ ok=$$(wc -l < $$i.ok) ; \
+ if (( $$bad == $$ok + 2 )) ; \
+ then \
+ rm _$$i ; \
+ fi ; \
+ done
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/pc/config.h b/pc/config.h
index 6544abb8..1048ecba 100644
--- a/pc/config.h
+++ b/pc/config.h
@@ -90,7 +90,9 @@
#define HAVE_VPRINTF 1
/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
+#if defined (_MSC_VER)
+#define inline
+#endif
/* Define if on MINIX. */
/* #undef _MINIX */
@@ -338,6 +340,11 @@
# define HAVE_POPEN_H
+/* #if defined (_MSC_VER) */
+#define ssize_t long int
+/* #endif */
+
+
#if (defined(_MSC_VER) && defined(MSDOS)) || defined(__MINGW32__)
# define system(s) os_system(s)
#endif
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc
index 10e4b140..e984c80e 100644
--- a/pc/gawkmisc.pc
+++ b/pc/gawkmisc.pc
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991 - 2002 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 Progamming Language.
@@ -33,6 +33,8 @@ char *defpath = ".;c:\\lib\\awk;c:\\gnu\\lib\\awk";
# endif
#ifdef __EMX__
+#include<io.h>
+
static int _os2_is_abs_path(const char *dirname);
static char* _os2_unixroot(const char *path);
static const char* _os2_unixroot_path(const char *path);
@@ -103,7 +105,7 @@ int flag;
/* optimal_bufsize --- determine optimal buffer size */
-int
+size_t
optimal_bufsize(fd, stb)
int fd;
struct stat *stb;
@@ -409,7 +411,7 @@ _os2_unixroot_path(const char *path)
*q = '\0'; /* terminating '\0' */
}
- for(i = 0; i++; i < dir_count) free((void*) list[i]);
+ for(i = 0; i < dir_count; i++) free((void*) list[i]);
}
return (result) ? (const char*) result : path;
diff --git a/po/ChangeLog b/po/ChangeLog
index 4a5af11e..24bde545 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -1,3 +1,22 @@
+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.
diff --git a/po/LINGUAS b/po/LINGUAS
index 6b500955..9e42f596 100644
--- a/po/LINGUAS
+++ b/po/LINGUAS
@@ -5,3 +5,5 @@ it
sv
tr
de
+da
+pt_BR
diff --git a/po/POTFILES.in b/po/POTFILES.in
index d5f623e2..a23ba31d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,23 +1,25 @@
# List of source files containing translatable strings.
-# Copyright (C) 1999 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2002 Free Software Foundation, Inc.
array.c
+awkgram.c
builtin.c
+eval.c
ext.c
-getopt.c
-main.c
-profile.c
-regex.c
-awkgram.c
-dfa.c
field.c
-getopt1.c
-msg.c
-random.c
-version.c
-eval.c
gawkmisc.c
+getopt.c
+getopt1.c
io.c
+main.c
+msg.c
node.c
-re.c
posix/gawkmisc.c
+profile.c
+random.c
+re.c
+regcomp.c
+regex_internal.c
+regexec.c
+replace.c
+version.c
diff --git a/po/Rules-quot b/po/Rules-quot
deleted file mode 100644
index 5f46d237..00000000
--- a/po/Rules-quot
+++ /dev/null
@@ -1,42 +0,0 @@
-# Special Makefile rules for English message catalogs with quotation marks.
-
-DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
-
-.SUFFIXES: .insert-header .po-update-en
-
-en@quot.po-update: en@quot.po-update-en
-en@boldquot.po-update: en@boldquot.po-update-en
-
-.insert-header.po-update-en:
- @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
- if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
- tmpdir=`pwd`; \
- echo "$$lang:"; \
- ll=`echo $$lang | sed -e 's/@.*//'`; \
- LC_ALL=C; export LC_ALL; \
- cd $(srcdir); \
- if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
- if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
- rm -f $$tmpdir/$$lang.new.po; \
- else \
- if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
- :; \
- else \
- echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
- exit 1; \
- fi; \
- fi; \
- else \
- echo "creation of $$lang.po failed!" 1>&2; \
- rm -f $$tmpdir/$$lang.new.po; \
- fi
-
-en@quot.insert-header: insert-header.sin
- sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
-
-en@boldquot.insert-header: insert-header.sin
- sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
-
-mostlyclean: mostlyclean-quot
-mostlyclean-quot:
- rm -f *.insert-header
diff --git a/po/boldquot.sed b/po/boldquot.sed
deleted file mode 100644
index 4b937aa5..00000000
--- a/po/boldquot.sed
+++ /dev/null
@@ -1,10 +0,0 @@
-s/"\([^"]*\)"/“\1â€/g
-s/`\([^`']*\)'/‘\1’/g
-s/ '\([^`']*\)' / ‘\1’ /g
-s/ '\([^`']*\)'$/ ‘\1’/g
-s/^'\([^`']*\)' /‘\1’ /g
-s/“â€/""/g
-s/“/“/g
-s/â€/â€/g
-s/‘/‘/g
-s/’/’/g
diff --git a/po/da.gmo b/po/da.gmo
new file mode 100644
index 00000000..4b2b23e9
--- /dev/null
+++ b/po/da.gmo
Binary files differ
diff --git a/po/da.po b/po/da.po
new file mode 100644
index 00000000..e4b58288
--- /dev/null
+++ b/po/da.po
@@ -0,0 +1,1808 @@
+# 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"
+"POT-Creation-Date: 2003-03-19 14:25+0200\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:274 array.c:309 array.c:314 eval.c:494
+#, c-format
+msgid "attempt to use scalar `%s' as array"
+msgstr "forsøg på at bruge skalaren \"%s\" som vektor"
+
+#: array.c:338
+#, c-format
+msgid "reference to uninitialized element `%s[\"%s\"]'"
+msgstr "reference til ikke-initieret element \"%s[\"%s\"]\""
+
+#: array.c:344
+#, c-format
+msgid "subscript of array `%s' is null string"
+msgstr "indeks i vektoren \"%s\" er en tom streng"
+
+#: array.c:412 array.c:425 array.c:466
+#, c-format
+msgid "delete: index `%s' not in array `%s'"
+msgstr "delete: indeks \"%s\" findes ikke i vektoren \"%s\""
+
+#: array.c:432 array.c:515
+#, c-format
+msgid "delete: illegal use of variable `%s' as array"
+msgstr "delete: ikke tilladt brug af variablen \"%s\" som vektor"
+
+#: array.c:633
+#, c-format
+msgid "%s: empty (null)\n"
+msgstr "%s: tom (nil)\n"
+
+#: array.c:638
+#, c-format
+msgid "%s: empty (zero)\n"
+msgstr "%s: tom (nul)\n"
+
+#: array.c:642
+#, c-format
+msgid "%s: table_size = %d, array_size = %d\n"
+msgstr "%s: tabelstørrelse = %d, vektorstørrelse = %d\n"
+
+#: array.c:671
+#, fuzzy, c-format
+msgid "%s: is parameter\n"
+msgstr "%s: er en parameter\n"
+
+#: array.c:676
+#, c-format
+msgid "%s: array_ref to %s\n"
+msgstr "%s: vektorreference til %s\n"
+
+#: array.c:975
+msgid "asort: first argument is not an array"
+msgstr "asort: første argument er ikke en vektor"
+
+#: array.c:984
+msgid "asort: second argument is not an array"
+msgstr "asort: andet argument er ikke en vektor"
+
+#: 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
+msgid "statement may have no effect"
+msgstr "kommandoen har måske ikke nogen effekt"
+
+#: awkgram.y:431 awkgram.y:451
+#, fuzzy, c-format
+msgid "`%s' used in %s action"
+msgstr "\"next\" brugt i BEGIN- eller END-handling"
+
+#: awkgram.y:444 awkgram.y:447
+msgid "`nextfile' is a gawk extension"
+msgstr "\"nextfile\" er en gawk-udvidelse"
+
+#: awkgram.y:461
+msgid "`return' used outside function context"
+msgstr "\"return\" brugt uden for funktion"
+
+#: awkgram.y:500
+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:513 awkgram.y:520
+msgid "`delete array' is a gawk extension"
+msgstr "\"delete array\" er en gawk-udvidelse"
+
+#: awkgram.y:528 awkgram.y:535
+#, fuzzy
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "\"delete array\" er en gawk-udvidelse"
+
+#: awkgram.y:578
+msgid "multistage two-way pipelines don't work"
+msgstr "flertrins dobbeltrettede datakanaler fungerer ikke"
+
+#: awkgram.y:669
+msgid "regular expression on right of assignment"
+msgstr "regulært udtryk i højreleddet af en tildeling"
+
+#: awkgram.y:679
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "regulært udtryk på venstre side af en \"~\"- eller \"!~\"-operator"
+
+#: awkgram.y:687
+msgid "regular expression on right of comparison"
+msgstr "regulært udtryk i højreleddet af en sammenligning"
+
+#: awkgram.y:754
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "ikke-omdirigeret \"getline\" udefineret inde i END-handling"
+
+#: awkgram.y:781
+msgid "call of `length' without parentheses is not portable"
+msgstr "kald af \"length\" uden parenteser er ikke portabelt"
+
+#: awkgram.y:784
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "kald af \"length\" uden parenteser er forældet ifølge POSIX"
+
+#: awkgram.y:835
+msgid "invalid subscript expression"
+msgstr "ugyldig indeksudtryk"
+
+#: awkgram.y:1020
+#, fuzzy
+msgid "unexpected newline or end of string"
+msgstr "uventet nylinjetegn"
+
+#: awkgram.y:1115
+msgid "empty program text on command line"
+msgstr "tom programtekst på kommandolinjen"
+
+#: awkgram.y:1172
+#, c-format
+msgid "can't open source file `%s' for reading (%s)"
+msgstr "kan ikke åbne kildefilen \"%s\" for læsning (%s)"
+
+#: awkgram.y:1207
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "kan ikke læse kildefilen \"%s\" (%s)"
+
+#: awkgram.y:1215
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "kildefilen \"%s\" er tom"
+
+#: awkgram.y:1417 awkgram.y:1527 awkgram.y:1545 awkgram.y:1895 awkgram.y:1980
+msgid "source file does not end in newline"
+msgstr "kildefilen slutter ikke med en ny linje"
+
+#: awkgram.y:1481
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr "uafsluttet regulært udtryk slutter med \"\\\" i slutningen af filen"
+
+#: awkgram.y:1501
+msgid "unterminated regexp"
+msgstr "uafsluttet regulært udtryk"
+
+#: awkgram.y:1504
+msgid "unterminated regexp at end of file"
+msgstr "uafsluttet regulært udtryk i slutningen af filen"
+
+#: awkgram.y:1571
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr "Brug af \"\\ #...\" for linjefortsættelse er ikke portabelt"
+
+#: awkgram.y:1583
+msgid "backslash not last character on line"
+msgstr "sidste tegn på linjen er ikke en omvendt skråstreg"
+
+#: awkgram.y:1628
+msgid "POSIX does not allow operator `**='"
+msgstr "POSIX tillader ikke operatoren \"**=\""
+
+#: awkgram.y:1630
+msgid "old awk does not support operator `**='"
+msgstr "gamle awk understøtter ikke operatoren \"**=\""
+
+#: awkgram.y:1639
+msgid "POSIX does not allow operator `**'"
+msgstr "POSIX tillader ikke operatoren \"**\""
+
+#: awkgram.y:1641
+msgid "old awk does not support operator `**'"
+msgstr "gamle awk understøtter ikke operatoren \"**\""
+
+#: awkgram.y:1672
+msgid "operator `^=' is not supported in old awk"
+msgstr "operatoren \"^=\" understøttes ikke i gamle awk"
+
+#: awkgram.y:1680
+msgid "operator `^' is not supported in old awk"
+msgstr "operatoren \"^\" understøttes ikke i gamle awk"
+
+#: awkgram.y:1764 awkgram.y:1781
+msgid "unterminated string"
+msgstr "uafsluttet streng"
+
+#: awkgram.y:1941
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "ugyldigt tegn \"%c\" i udtryk"
+
+#: awkgram.y:2001
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "\"%s\" er en gawk-udvidelse"
+
+#: awkgram.y:2004
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "\"%s\" er en Bell Labs-udvidelse"
+
+#: awkgram.y:2007
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "POSIX tillader ikke \"%s\""
+
+#: awkgram.y:2011
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "\"%s\" understøttes ikke i gamle awk"
+
+#: awkgram.y:2038
+msgid "`goto' considered harmful!\n"
+msgstr "\"goto\" anses for skadlig!\n"
+
+#: awkgram.y:2102
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
+msgstr "%d er et ugyldigt antal argumenter for %s"
+
+#: awkgram.y:2121 awkgram.y:2124
+msgid "match: third argument is a gawk extension"
+msgstr "match: tredje argument er en gawk-udvidelse"
+
+#: awkgram.y:2137
+#, 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:2140
+#, fuzzy, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "sub: tredje argument er ikke et ændringsbart objekt"
+
+#: awkgram.y:2167 awkgram.y:2170
+msgid "close: second argument is a gawk extension"
+msgstr "close: andet argument er en gawk-udvidelse"
+
+#: awkgram.y:2180
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"brug af dcgettext(_\"...\") er fejlagtigt: fjern det indledende "
+"understregningstegn"
+
+#: awkgram.y:2195
+#, fuzzy
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"brug af dcgettext(_\"...\") er fejlagtigt: fjern det indledende "
+"understregningstegn"
+
+#: awkgram.y:2266
+#, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "funktionen \"%s\": parameter %d, \"%s\", er samme som parameter %d"
+
+#: awkgram.y:2299
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "funktionen \"%s\": parameteren \"%s\" overskygger en global variabel"
+
+#: awkgram.y:2411
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "kunne ikke åbne \"%s\" for skrivning (%s)"
+
+#: awkgram.y:2412 profile.c:93
+msgid "sending profile to standard error"
+msgstr "sender profilen til standard fejl"
+
+#: awkgram.y:2442
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: mislykkedes at lukke (%s)"
+
+#: awkgram.y:2566
+msgid "shadow_funcs() called twice!"
+msgstr "shadow_funcs() kaldt to gange!"
+
+#: awkgram.y:2593
+msgid "there were shadowed variables."
+msgstr ""
+
+#: awkgram.y:2666
+#, c-format
+msgid "function `%s': can't use function name as parameter name"
+msgstr "funktionen \"%s\": kan ikke bruge funktionsnavn som parameternavn"
+
+#: awkgram.y:2676
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "funktionsnavnet \"%s\" er allerede defineret"
+
+#: awkgram.y:2827 awkgram.y:2833
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "funktionen \"%s\" kaldt, men aldrig defineret"
+
+#: awkgram.y:2836
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "funktionen \"%s\" defineret, men aldrig kaldt"
+
+#: awkgram.y:2863
+#, 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:2876
+#, 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:2878
+#, fuzzy
+msgid "or used as a variable or an array"
+msgstr "kan ikke bruge funktionsnavnet \"%s\" som variabel eller vektor"
+
+#: builtin.c:111
+#, c-format
+msgid "%s to \"%s\" failed (%s)"
+msgstr "%s til \"%s\" mislykkedes (%s)"
+
+#: builtin.c:112
+msgid "standard output"
+msgstr "standard ud"
+
+#: builtin.c:113
+msgid "reason unknown"
+msgstr "ukendt årsag"
+
+#: builtin.c:126
+msgid "exp: received non-numeric argument"
+msgstr "exp: fik et ikke-numerisk argument"
+
+#: builtin.c:132
+#, c-format
+msgid "exp: argument %g is out of range"
+msgstr "exp: argumentet %g er uden for tilladt område"
+
+#: builtin.c:190
+#, 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:193
+#, 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:205
+#, 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:299
+msgid "index: received non-string first argument"
+msgstr "indeks: første argument er ikke en streng"
+
+#: builtin.c:301
+msgid "index: received non-string second argument"
+msgstr "indeks: andet argument er ikke en streng"
+
+#: builtin.c:411
+msgid "int: received non-numeric argument"
+msgstr "int: fik et ikke-numerisk argument"
+
+#: builtin.c:428
+msgid "length: received non-string argument"
+msgstr "length: fik et argument som ikke er en streng"
+
+#: builtin.c:444
+msgid "log: received non-numeric argument"
+msgstr "log: fik et ikke-numerisk argument"
+
+#: builtin.c:447
+#, c-format
+msgid "log: received negative argument %g"
+msgstr "log: fik et negativt argument %g"
+
+#: builtin.c:609 builtin.c:612
+msgid "must use `count$' on all formats or none"
+msgstr ""
+
+#: builtin.c:714
+msgid "`$' is not permitted in awk formats"
+msgstr "\"$\" tillades ikke i awkformat"
+
+#: builtin.c:720
+msgid "arg count with `$' must be > 0"
+msgstr "argumentantallet med \"$\" skal være > 0"
+
+#: builtin.c:722
+#, 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:724
+msgid "`$' not permitted after period in format"
+msgstr "\"$\" tillades ikke efter et punktum i formatet"
+
+#: builtin.c:737
+msgid "no `$' supplied for positional field width or precision"
+msgstr "intet \"$\" angivet for positionsangivet feltbredde eller præcision"
+
+#: builtin.c:795
+msgid "`l' is meaningless in awk formats; ignored"
+msgstr "\"l\" er meningsløst i awk-formater, ignoreret"
+
+#: builtin.c:799
+msgid "`l' is not permitted in POSIX awk formats"
+msgstr "\"l\" tillades ikke i POSIX awk-formater"
+
+#: builtin.c:810
+msgid "`L' is meaningless in awk formats; ignored"
+msgstr "\"L\" er meningsløst i awk-formater, ignoreret"
+
+#: builtin.c:814
+msgid "`L' is not permitted in POSIX awk formats"
+msgstr "\"L\" tillades ikke i POSIX awk-formater"
+
+#: builtin.c:825
+msgid "`h' is meaningless in awk formats; ignored"
+msgstr "\"h\" er meningsløst i awk-formater, ignoreret"
+
+#: builtin.c:829
+msgid "`h' is not permitted in POSIX awk formats"
+msgstr "\"h\" tillades ikke i POSIX awk-formater"
+
+#: builtin.c:1078
+msgid "not enough arguments to satisfy format string"
+msgstr "for få argumenter til formatstrengen"
+
+#: builtin.c:1080
+msgid "^ ran out for this one"
+msgstr "^ sluttede her"
+
+#: builtin.c:1085
+msgid "[s]printf: format specifier does not have control letter"
+msgstr "[s]printf: formatspecifiereren har intet kommandobogstav"
+
+#: builtin.c:1088
+msgid "too many arguments supplied for format string"
+msgstr "for mange argumenter til formatstrengen"
+
+#: builtin.c:1154 builtin.c:1157
+msgid "printf: no arguments"
+msgstr "printf: ingen argumenter"
+
+#: builtin.c:1181
+msgid "sqrt: received non-numeric argument"
+msgstr "sqrt: fik ikke-numerisk argument"
+
+#: builtin.c:1185
+#, c-format
+msgid "sqrt: called with negative argument %g"
+msgstr "sqrt: kaldt med negativt argument %g"
+
+#: builtin.c:1207
+#, c-format
+msgid "substr: start index %g is invalid, using 1"
+msgstr "substr: startindeks %g er ugyldigt, bruger 1"
+
+#: builtin.c:1212
+#, 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:1231
+#, c-format
+msgid "substr: length %g is <= 0"
+msgstr "substr: længden %g er <= 0"
+
+#: builtin.c:1233
+#, fuzzy, c-format
+msgid "substr: length %g is < 0"
+msgstr "substr: længden %g er <= 0"
+
+#: builtin.c:1240
+#, 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:1245
+#, c-format
+msgid "substr: length %g too big for string indexing, truncating to %g"
+msgstr ""
+
+#: builtin.c:1257
+msgid "substr: source string is zero length"
+msgstr "substr: kildestrengen er tom"
+
+#: builtin.c:1263
+#, fuzzy, c-format
+msgid "substr: start index %g is past end of string"
+msgstr "substr: startindeks %d er forbi slutningen på strengen"
+
+#: builtin.c:1271
+#, 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:1306
+#, fuzzy
+msgid "strftime: received non-string first argument"
+msgstr "strftime: fik et første argument som ikke er en streng"
+
+#: builtin.c:1312
+msgid "strftime: received empty format string"
+msgstr "strftime: fik en tom formatstreng"
+
+#: builtin.c:1321
+#, fuzzy
+msgid "strftime: received non-numeric second argument"
+msgstr "strftime: fik et ikke-numerisk andet argument"
+
+#: builtin.c:1384
+msgid "mktime: received non-string argument"
+msgstr "mktime: fik et argument som ikke er en streng"
+
+#: builtin.c:1429
+#, fuzzy
+msgid "system: received non-string argument"
+msgstr "system: fik et argument som ikke er en streng"
+
+#: builtin.c:1573
+#, fuzzy
+msgid "tolower: received non-string argument"
+msgstr "tolower: fik et argument som ikke er en streng"
+
+#: builtin.c:1622
+#, fuzzy
+msgid "toupper: received non-string argument"
+msgstr "toupper: fik et argument som ikke er en streng"
+
+#: builtin.c:1667
+msgid "atan2: received non-numeric first argument"
+msgstr "atan2: fik et ikke-numerisk første argument"
+
+#: builtin.c:1669
+msgid "atan2: received non-numeric second argument"
+msgstr "atan2: fik et ikke-numerisk andet argument"
+
+#: builtin.c:1688
+msgid "sin: received non-numeric argument"
+msgstr "sin: fik et ikke-numerisk argument"
+
+#: builtin.c:1704
+msgid "cos: received non-numeric argument"
+msgstr "cos: fik et ikke-numerisk argument"
+
+#: builtin.c:1748
+msgid "srand: received non-numeric argument"
+msgstr "srand: fik et ikke-numerisk argument"
+
+#: builtin.c:1787
+msgid "match: third argument is not an array"
+msgstr "match: tredje argument er ikke en vektor"
+
+#: builtin.c:2264
+msgid "gensub: 3rd argument of 0 treated as 1"
+msgstr "gensub: Nullet i tredje argument behandlet som et ét-tal"
+
+#: builtin.c:2375 builtin.c:2377
+msgid "lshift: received non-numeric first argument"
+msgstr "lshift: fik et ikke-numerisk første argument"
+
+#: builtin.c:2379
+#, 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:2381
+#, c-format
+msgid "lshift(%lf, %lf): fractional values will be truncated"
+msgstr "lshift(%lf, %lf): flydendetalsværdier vil blive trunkeret"
+
+#: builtin.c:2383
+#, 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:2412 builtin.c:2414
+msgid "rshift: received non-numeric first argument"
+msgstr "rshift: fik et ikke-numerisk første argument"
+
+#: builtin.c:2416
+#, 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:2418
+#, c-format
+msgid "rshift(%lf, %lf): fractional values will be truncated"
+msgstr "rshift(%lf, %lf): flydendetalsværdier vil blive trunkeret"
+
+#: builtin.c:2420
+#, 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:2449 builtin.c:2451
+msgid "and: received non-numeric first argument"
+msgstr "and: fik et ikke-numerisk første argument"
+
+#: builtin.c:2453
+#, 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:2455
+#, c-format
+msgid "and(%lf, %lf): fractional values will be truncated"
+msgstr "and(%lf, %lf): flydendetalsværdier vil blive trunkeret"
+
+#: builtin.c:2484 builtin.c:2486
+msgid "or: received non-numeric first argument"
+msgstr "or: fik et ikke-numerisk første argument"
+
+#: builtin.c:2488
+#, 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:2490
+#, c-format
+msgid "or(%lf, %lf): fractional values will be truncated"
+msgstr "or(%lf, %lf): flydendetalsværdier vil blive trunkeret"
+
+#: builtin.c:2519 builtin.c:2521
+msgid "xor: received non-numeric first argument"
+msgstr "xor: fik et ikke-numerisk første argument"
+
+#: builtin.c:2523
+#, 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:2525
+#, c-format
+msgid "xor(%lf, %lf): fractional values will be truncated"
+msgstr "xor(%lf, %lf): flydendetalsværdier vil blive trunkeret"
+
+#: builtin.c:2553
+msgid "compl: received non-numeric argument"
+msgstr "compl: fik et ikke-numerisk argument"
+
+#: builtin.c:2555
+#, c-format
+msgid "compl(%lf): negative value will give strange results"
+msgstr "compl(%lf): negative værdier vil give mærkelige resultater"
+
+#: builtin.c:2557
+#, c-format
+msgid "compl(%lf): fractional value will be truncated"
+msgstr "compl(%lf): flydendetalsværdier vil blive trunkeret"
+
+#: builtin.c:2728
+#, c-format
+msgid "dcgettext: `%s' is not a valid locale category"
+msgstr "dcgettext: \"%s\" er ikke en gyldig lokalekategori"
+
+#: eval.c:262
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "ukendt nodetype %d"
+
+#: eval.c:310
+msgid "buffer overflow in genflags2str"
+msgstr "bufferoverløb i genflags2str"
+
+#: eval.c:555
+#, 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:576
+msgid "`break' outside a loop is not portable"
+msgstr "\"break\" uden for en løkke er ikke portabelt"
+
+#: eval.c:580
+msgid "`break' outside a loop is not allowed"
+msgstr "\"break\" uden for en løkke er ikke tilladt"
+
+#: eval.c:597
+msgid "`continue' outside a loop is not portable"
+msgstr "\"continue\" uden for en løkke er ikke portabelt"
+
+#: eval.c:601
+msgid "`continue' outside a loop is not allowed"
+msgstr "\"continue\" uden for en løkke er ikke tilladt"
+
+#: eval.c:635
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "\"next\" kan ikke kaldes fra en BEGIN-regel"
+
+#: eval.c:637
+msgid "`next' cannot be called from an END rule"
+msgstr "\"next\" kan ikke kaldes fra en END-regel"
+
+#: eval.c:646
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "\"nextfile\" kan ikke kaldes fra en BEGIN-regel"
+
+#: eval.c:648
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "\"nextfile\" kan ikke kaldes fra en END-regel"
+
+#: eval.c:696
+msgid "statement has no effect"
+msgstr "kommandoen har ingen effekt"
+
+#: eval.c:731 eval.c:761 eval.c:1733
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "reference til ikke-initieret variabel \"%s\""
+
+#: eval.c:739 eval.c:1721
+#, 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:746 eval.c:752
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "reference til ikke-initieret argument \"%s\""
+
+#: eval.c:810 eval.c:1728 profile.c:773
+#, 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:910
+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:935
+msgid "assignment used in conditional context"
+msgstr "tildeling brugt i sammenligningsammenhæng"
+
+#: eval.c:1026
+msgid "division by zero attempted"
+msgstr "forsøgte at dividere med nul"
+
+#: eval.c:1041
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "forsøgte at dividere med nul i \"%%\""
+
+#: eval.c:1056 profile.c:649
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "ikke tilladt type (%s) i tree_eval"
+
+#: eval.c:1232
+msgid "division by zero attempted in `/='"
+msgstr "forsøgte at dividere med nul i \"/=\""
+
+#: eval.c:1250
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "forsøgte at dividere med nul i \"%%=\""
+
+#: eval.c:1510
+#, c-format
+msgid "%s (from %s)"
+msgstr "%s (fra %s)"
+
+#: eval.c:1569
+#, c-format
+msgid "function `%s' called with more arguments than declared"
+msgstr "funktionen \"%s\" kaldt med flere argumenter end deklareret"
+
+#: eval.c:1628
+#, c-format
+msgid "function `%s' not defined"
+msgstr "funktionen \"%s\" er ikke defineret"
+
+#: eval.c:1634
+#, c-format
+msgid "function %s called\n"
+msgstr "funktionen %s kaldt\n"
+
+#: eval.c:1693
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# Funktionskaldsstak:\n"
+"\n"
+
+#: eval.c:1696
+msgid "\t# -- main --\n"
+msgstr "\t# -- main --\n"
+
+#: eval.c:1850
+msgid "attempt to field reference from non-numeric value"
+msgstr "forsøg på at feltreferere fra ikke-numerisk værdi"
+
+#: eval.c:1852
+msgid "attempt to reference from null string"
+msgstr "forsøg på at referere fra tom streng"
+
+#: eval.c:1858
+#, c-format
+msgid "attempt to access field %d"
+msgstr "forsøg på at få adgang til felt nummer %d"
+
+#: eval.c:1874
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr "forsøg på at bruge skalarparameteren \"%s\" som en vektor"
+
+#: eval.c:1886 eval.c:1893 profile.c:865
+msgid "assignment is not allowed to result of builtin function"
+msgstr "tildeling er ikke tilladt til resultatet fra en indbygget funktion"
+
+#: eval.c:1941
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "\"IGNORECASE\" er en gawk-udvidelse"
+
+#: eval.c:1970
+msgid "`BINMODE' is a gawk extension"
+msgstr "\"BINMODE\" er en gawk-udvidelse"
+
+#: eval.c:2082
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "fejlagtig \"%sFMT\"-specifikation \"%s\""
+
+#: eval.c:2160
+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:181
+msgid "Operation Not Supported"
+msgstr "Operationen understøttes ikke"
+
+#: field.c:321
+msgid "NF set to negative value"
+msgstr "NF sat til en negativ værdi"
+
+#: field.c:819
+msgid "split: second argument is not an array"
+msgstr "split: andet argument er ikke en vektor"
+
+#: field.c:854
+msgid "split: null string for third arg is a gawk extension"
+msgstr "split: tom streng som tredje argument er en gawk-udvidelse"
+
+#: field.c:906
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "\"FIELDWIDTHS\" er en gawk-udvidelse"
+
+#: field.c:933
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "felt %d i FIELDWIDTHS skal være > 0"
+
+#: field.c:1006
+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:431
+#, 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:257
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "kan ikke åbne filen \"%s\" for læsning (%s)"
+
+#: io.c:344
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "lukning af fd %d (\"%s\") mislykkedes (%s)"
+
+#: io.c:482
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "ugyldig trætype %s i redirect()"
+
+#: io.c:488
+#, c-format
+msgid "expression in `%s' redirection only has numeric value"
+msgstr "udtrykket i \"%s\"-omdirigering har kun numerisk værdi"
+
+#: io.c:494
+#, 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:499
+#, 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:521
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "unødig blanding af \">\" og \">>\" for filen \"%.*s\""
+
+#: io.c:573
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "kan ikke åbne røret \"%s\" for udskrivning (%s)"
+
+#: io.c:582
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "kan ikke åbne røret \"%s\" for indtastning (%s)"
+
+#: io.c:595
+#, 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:599
+#, 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:675
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "kan ikke omdirigere fra \"%s\" (%s)"
+
+#: io.c:678
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "kan ikke omdirigere til \"%s\" (%s)"
+
+#: io.c:717
+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:729
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "lukning af \"%s\" mislykkedes (%s)"
+
+#: io.c:736
+msgid "too many pipes or input files open"
+msgstr "for mange rør eller inddatafiler åbne"
+
+#: io.c:759
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: andet argument skal være \"to\" eller \"from\""
+
+#: io.c:773
+#, 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:777
+msgid "close of redirection that was never opened"
+msgstr "lukning af omdirigering som aldrig åbnedes"
+
+#: io.c:804
+#, c-format
+msgid "close: redirection `%s' not opened with `|&', second argument ignored"
+msgstr ""
+"close: omdirigeringen \"%s\" åbnedes ikke med \"|&\", andet argument "
+"ignoreret"
+
+#: io.c:866
+#, c-format
+msgid "failure status (%d) on pipe close of `%s' (%s)"
+msgstr "fejlstatus (%d) fra rørlukning af \"%s\" (%s)"
+
+#: io.c:869
+#, c-format
+msgid "failure status (%d) on file close of `%s' (%s)"
+msgstr "fejlstatus (%d) fra fillukning af \"%s\" (%s)"
+
+#: io.c:888
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "ingen eksplicit lukning af soklen \"%s\" angivet"
+
+#: io.c:891
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "ingen eksplicit lukning af ko-processen \"%s\" angivet"
+
+#: io.c:894
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "ingen eksplicit lukning af røret \"%s\" angivet"
+
+#: io.c:897
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "ingen eksplicit lukning af filen \"%s\" angivet"
+
+#: io.c:926 io.c:980
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "fejl ved skrivning til standard ud (%s)"
+
+#: io.c:930 io.c:984
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "fejl ved skrivning til standard fejl (%s)"
+
+#: io.c:938
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "rørspuling af \"%s\" mislykkedes (%s)"
+
+#: io.c:941
+#, c-format
+msgid "co-process flush of pipe to `%s' failed (%s)."
+msgstr "ko-processpuling af røret til \"%s\" mislykkedes (%s)"
+
+#: io.c:944
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "filspuling af \"%s\" mislykkedes (%s)"
+
+#: io.c:1103
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "/inet/raw-klient er desværre ikke klar endnu"
+
+#: io.c:1105 io.c:1142
+msgid "only root may use `/inet/raw'."
+msgstr "kun root kan bruge \"/inet/raw\"."
+
+#: io.c:1140
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "/inet/raw-server er desværre ikke klar endnu"
+
+#: io.c:1230
+#, c-format
+msgid "no (known) protocol supplied in special filename `%s'"
+msgstr "ingen (kendt) protokol opgivet i special-filnavn \"%s\""
+
+#: io.c:1248
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "special-filnavn \"%s\" er ufuldstændigt"
+
+#: io.c:1260
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "lokal port ugyldig i \"%s\""
+
+#: io.c:1272
+msgid "must supply a remote hostname to `/inet'"
+msgstr "skal angive et fjernmaskinenavn til \"/inet\""
+
+#: io.c:1287
+msgid "must supply a remote port to `/inet'"
+msgstr "skal angive en fjernport til \"/inet\""
+
+#: io.c:1293
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "fjernporten ugyldig i \"%s\""
+
+#: io.c:1303
+msgid "TCP/IP communications are not supported"
+msgstr "TCP/IP-kommunikation understøttes ikke"
+
+#: io.c:1312 io.c:1492
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "filen \"%s\" er et katalog"
+
+#: io.c:1381
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "brug \"PROCINFO[\"%s\"]\" i stedet for \"%s\""
+
+#: io.c:1413
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "brug \"PROCINFO[...]\" i stedet for \"dev/user\""
+
+#: io.c:1478 io.c:1652
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "kunne ikke åbne \"%s\", tilstand \"%s\""
+
+#: io.c:1703
+#, fuzzy, c-format
+msgid "close of master pty failed (%s)"
+msgstr "lukning af røret mislykkedes (%s)"
+
+#: io.c:1705 io.c:1857 io.c:2009
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "lukning af standard ud i barnet mislykkedes (%s)"
+
+#: io.c:1708
+#, 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:1710 io.c:1862
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "lukning af standard ind i barnet mislykkedes (%s)"
+
+#: io.c:1713
+#, 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:1715 io.c:1734
+#, fuzzy, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "lukning af røret mislykkedes (%s)"
+
+#: io.c:1808 io.c:1860 io.c:1990 io.c:2012
+#, 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:1812 io.c:1865
+#, 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:1829 io.c:2003
+msgid "restoring stdout in parent process failed\n"
+msgstr "genskabelse af standard ud i forælderprocessen mislykkedes\n"
+
+#: io.c:1834
+msgid "restoring stdin in parent process failed\n"
+msgstr "genskabelse af standard ind i forælderprocessen mislykkedes\n"
+
+#: io.c:1868 io.c:2014 io.c:2025
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "lukning af røret mislykkedes (%s)"
+
+#: io.c:1913
+msgid "`|&' not supported"
+msgstr "\"|&\" understøttes ikke"
+
+#: io.c:1980
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "kan ikke åbne røret \"%s\" (%s)"
+
+#: io.c:2021
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr "kan ikke oprette barneproces for \"%s\" (fork: %s)"
+
+#: io.c:2364
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "datafilen \"%s\" er tom"
+
+#: io.c:2407 io.c:2415
+msgid "could not allocate more input memory"
+msgstr ""
+
+#: io.c:2540 io.c:2782 io.c:3046
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "fejl ved læsning af inddatafilen \"%s\": %s"
+
+#: io.c:3281
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "flertegnsværdien af \"RS\" er en gawk-udvidelse"
+
+#: main.c:322
+msgid "`-m[fr]' option irrelevant in gawk"
+msgstr "\"-m[fr]\"-flaget er irrelevant i gawk"
+
+#: main.c:324
+msgid "-m option usage: `-m[fr] nnn'"
+msgstr "-m-flagets brug: \"-m[fr] nnn\""
+
+#: main.c:341
+#, c-format
+msgid "%s: option `-W %s' unrecognized, ignored\n"
+msgstr "%s: flaget \"-W %s\" ukendt, ignoreret\n"
+
+#: main.c:378
+msgid "empty argument to `--source' ignored"
+msgstr "tomt argument til \"--source\" ignoreret"
+
+#: main.c:448
+msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
+msgstr "miljøvariablen \"POSIXLY_CORRECT\" sat: aktiverer \"--posix\""
+
+#: main.c:453
+msgid "`--posix' overrides `--traditional'"
+msgstr "\"--posix\" tilsidesætter \"--traditional\""
+
+#: main.c:464
+msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
+msgstr "\"--posix\"/\"--traditional\" tilsidesætter \"--non-decimal-data\""
+
+#: main.c:468
+#, 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:509
+#, fuzzy, c-format
+msgid "can't set binary mode on stdin (%s)"
+msgstr "kan ikke sætte tilstand på standard ind (%s)"
+
+#: main.c:512
+#, fuzzy, c-format
+msgid "can't set binary mode on stdout (%s)"
+msgstr "kan ikke sætte tilstand på standard ud (%s)"
+
+#: main.c:514
+#, fuzzy, c-format
+msgid "can't set binary mode on stderr (%s)"
+msgstr "kan ikke sætte tilstand på standard fejl (%s)"
+
+#: main.c:544
+msgid "no program text at all!"
+msgstr "ingen programtekst overhovedet!"
+
+#: main.c:612
+#, 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:614
+#, 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:619
+msgid "POSIX options:\t\tGNU long options:\n"
+msgstr "POSIX-flag:\t\tGNU lange flag:\n"
+
+#: main.c:620
+msgid "\t-f progfile\t\t--file=progfile\n"
+msgstr "\t-f progfil\t\t--file=progfil\n"
+
+#: main.c:621
+msgid "\t-F fs\t\t\t--field-separator=fs\n"
+msgstr "\t-F fs\t\t\t--field-separator=fs\n"
+
+#: main.c:622
+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:623
+msgid "\t-m[fr] val\n"
+msgstr "\t-m[fr] værdi\n"
+
+#: main.c:624
+msgid "\t-W compat\t\t--compat\n"
+msgstr "\t-W compat\t\t--compat\n"
+
+#: main.c:625
+msgid "\t-W copyleft\t\t--copyleft\n"
+msgstr "\t-W copyleft\t\t--copyleft\n"
+
+#: main.c:626
+msgid "\t-W copyright\t\t--copyright\n"
+msgstr "\t-W copyright\t\t--copyright\n"
+
+#: main.c:627
+msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
+msgstr "\t-W dump-variables[=fil]\t--dump-variables[=fil]\n"
+
+#: main.c:628
+msgid "\t-W gen-po\t\t--gen-po\n"
+msgstr "\t-W gen-po\t\t--gen-po\n"
+
+#: main.c:629
+msgid "\t-W help\t\t\t--help\n"
+msgstr "\t-W help\t\t\t--help\n"
+
+#: main.c:630
+msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+
+#: main.c:631
+msgid "\t-W lint-old\t\t--lint-old\n"
+msgstr "\t-W lint-old\t\t--lint-old\n"
+
+#: main.c:632
+msgid "\t-W non-decimal-data\t--non-decimal-data\n"
+msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
+
+#: main.c:634
+msgid "\t-W nostalgia\t\t--nostalgia\n"
+msgstr "\t-W nostalgia\t\t--nostalgia\n"
+
+#: main.c:637
+msgid "\t-W parsedebug\t\t--parsedebug\n"
+msgstr "\t-W parsedebug\t\t--parsedebug\n"
+
+#: main.c:639
+msgid "\t-W profile[=file]\t--profile[=file]\n"
+msgstr "\t-W profile[=fil]\t--profile[=fil]\n"
+
+#: main.c:640
+msgid "\t-W posix\t\t--posix\n"
+msgstr "\t-W posix\t\t--posix\n"
+
+#: main.c:641
+msgid "\t-W re-interval\t\t--re-interval\n"
+msgstr "\t-W re-interval\t\t--re-interval\n"
+
+#: main.c:642
+msgid "\t-W source=program-text\t--source=program-text\n"
+msgstr "\t-W source=programtekst\t--source=programtekst\n"
+
+#: main.c:643
+msgid "\t-W traditional\t\t--traditional\n"
+msgstr "\t-W traditional\t\t--traditional\n"
+
+#: main.c:644
+msgid "\t-W usage\t\t--usage\n"
+msgstr "\t-W usage\t\t--usage\n"
+
+#: main.c:645
+msgid "\t-W version\t\t--version\n"
+msgstr "\t-W version\t\t--version\n"
+
+#: main.c:649
+#, 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:653
+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:657
+msgid ""
+"Examples:\n"
+"\tgawk '{ sum += $1 }; END { print sum }' file\n"
+"\tgawk -F: '{ print $1 }' /etc/passwd\n"
+msgstr ""
+
+#: main.c:669
+#, 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:677
+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:683
+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:713
+msgid "-Ft does not set FS to tab in POSIX awk"
+msgstr "-Ft sætter ikke FS til tab i POSIX-awk"
+
+#: main.c:944
+#, c-format
+msgid ""
+"%s: `%s' argument to `-v' not in `var=value' form\n"
+"\n"
+msgstr ""
+
+#: main.c:964
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr ""
+
+#: main.c:967
+#, c-format
+msgid "`%s' is not a variable name, looking for file `%s=%s'"
+msgstr ""
+
+#: main.c:995
+msgid "floating point exception"
+msgstr "flydendetalsundtagelse"
+
+#: main.c:1002
+msgid "fatal error: internal error"
+msgstr "fatal fejl: intern fejl"
+
+#: main.c:1052
+#, c-format
+msgid "no pre-opened fd %d"
+msgstr "ingen for-åbnet fd %d"
+
+#: main.c:1057
+#, c-format
+msgid "could not pre-open /dev/null for fd %d"
+msgstr "kunne ikke for-åbne /dev/null for fd %d"
+
+#: main.c:1080 main.c:1089
+#, 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:59 node.c:66 node.c:75 node.c:89 node.c:116
+msgid "can't convert string to float"
+msgstr "kan ikke konvertere en streng til flydende tal"
+
+#: node.c:357
+msgid "backslash at end of string"
+msgstr "omvendt skråstreg i slutningen af strengen"
+
+#: node.c:544
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX tillader ikke \"\\x\"-kontrolsekvenser"
+
+#: node.c:550
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "ingen heksadecimale cifre i \"\\x\"-kontrolsekvenser"
+
+#: node.c:584
+#, 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:409
+msgid "internal error: Node_var with null vname"
+msgstr "intern fejl: Node_var med null vname"
+
+#: profile.c:471
+msgid "# treated internally as `delete'"
+msgstr ""
+
+#: profile.c:545
+msgid "internal error: Node_var_array with null vname"
+msgstr "intern fejl: Node_var_vektor med null vname"
+
+#: profile.c:1127
+#, c-format
+msgid "\t# gawk profile, created %s\n"
+msgstr "\t# gawkprofil, oprettet %s\n"
+
+#: profile.c:1130
+msgid ""
+"\t# BEGIN block(s)\n"
+"\n"
+msgstr ""
+"\t# BEGIN-blok\n"
+"\n"
+
+#: profile.c:1140
+msgid ""
+"\t# Rule(s)\n"
+"\n"
+msgstr ""
+"\t# Regel/regler\n"
+"\n"
+
+#: profile.c:1146
+msgid ""
+"\t# END block(s)\n"
+"\n"
+msgstr ""
+"\t# END-blok\n"
+"\n"
+
+#: profile.c:1166
+msgid ""
+"\n"
+"\t# Functions, listed alphabetically\n"
+msgstr ""
+"\n"
+"\t# Funktioner, listede alfabetisk\n"
+
+#: profile.c:1376
+#, 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"
+
+#~ 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/po/de.gmo b/po/de.gmo
index 829881cf..bb4c1f07 100644
--- a/po/de.gmo
+++ b/po/de.gmo
Binary files differ
diff --git a/po/de.po b/po/de.po
index 675a69d9..9386f018 100644
--- a/po/de.po
+++ b/po/de.po
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: gawk 3.1.0\n"
-"POT-Creation-Date: 2002-05-01 16:40+0300\n"
+"POT-Creation-Date: 2003-03-19 14:25+0200\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"
@@ -13,410 +13,901 @@ msgstr ""
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
-#: array.c:243 array.c:275 array.c:280 eval.c:483
+#: array.c:274 array.c:309 array.c:314 eval.c:494
#, c-format
msgid "attempt to use scalar `%s' as array"
msgstr "Versuch, Skalar '%s' als Array zu verwenden."
-#: array.c:304
+#: array.c:338
#, c-format
msgid "reference to uninitialized element `%s[\"%s\"]'"
msgstr "Bezug auf nicht-initialisiertes Element »%s[\"%s\"]«"
-#: array.c:310
+#: array.c:344
#, c-format
msgid "subscript of array `%s' is null string"
msgstr "Index in Array »%s« ist Nullstring."
-#: array.c:373 array.c:456
-#, c-format
-msgid "delete: illegal use of variable `%s' as array"
-msgstr "delete: Benutzung der Variablen »%s« als Array ist nicht zulässig."
-
-#: array.c:406
+#: array.c:412 array.c:425 array.c:466
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete: Index »%s« nicht in Feld »%s« vorhanden."
-#: array.c:571
+#: array.c:432 array.c:515
+#, c-format
+msgid "delete: illegal use of variable `%s' as array"
+msgstr "delete: Benutzung der Variablen »%s« als Array ist nicht zulässig."
+
+#: array.c:633
#, c-format
msgid "%s: empty (null)\n"
msgstr "%s: leer (Null)\n"
-#: array.c:576
+#: array.c:638
#, c-format
msgid "%s: empty (zero)\n"
msgstr "%s: leer (0)\n"
-#: array.c:580
+#: array.c:642
#, c-format
msgid "%s: table_size = %d, array_size = %d\n"
msgstr "%s: Table_size = %d, array_size = %d\n"
-#: array.c:612
+#: array.c:671
#, fuzzy, c-format
msgid "%s: is parameter\n"
msgstr "%s: ist ein Parameter\n"
-#: array.c:617
+#: array.c:676
#, c-format
msgid "%s: array_ref to %s\n"
msgstr "%s: Array-Referenz auf %s\n"
-#: array.c:844
+#: array.c:975
msgid "asort: first argument is not an array"
msgstr "asort: Erstes Argument ist kein Array."
-#: array.c:853
+#: array.c:984
msgid "asort: second argument is not an array"
msgstr "asort: Zweites Argument ist kein array."
-#: builtin.c:107
+#: 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
+msgid "statement may have no effect"
+msgstr "Statement möglicherweise ohne Effekt."
+
+#: awkgram.y:431 awkgram.y:451
+#, fuzzy, c-format
+msgid "`%s' used in %s action"
+msgstr "'next' in BEGIN- oder END-Aktion benutzt."
+
+#: awkgram.y:444 awkgram.y:447
+msgid "`nextfile' is a gawk extension"
+msgstr "'nextfile' ist eine gawk-Erweiterung."
+
+#: awkgram.y:461
+msgid "`return' used outside function context"
+msgstr "'return' außerhalb einer Funktion benutzt."
+
+#: awkgram.y:500
+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:513 awkgram.y:520
+msgid "`delete array' is a gawk extension"
+msgstr "'delete array' ist eine gawk-Erweiterung."
+
+#: awkgram.y:528 awkgram.y:535
+#, fuzzy
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "'delete array' ist eine gawk-Erweiterung."
+
+#: awkgram.y:578
+msgid "multistage two-way pipelines don't work"
+msgstr "'multistage' Zweiwege-Pipes funktionieren nicht."
+
+#: awkgram.y:669
+msgid "regular expression on right of assignment"
+msgstr "Regulärer Ausdruck auf der rechten Seite einer Zuweisung."
+
+#: awkgram.y:679
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "Regulärer Ausdruck links vom '~'- oder '!~'-Operator."
+
+#: awkgram.y:687
+msgid "regular expression on right of comparison"
+msgstr "Regulärer Ausdruck rechts von einem Vergleich."
+
+#: awkgram.y:754
+msgid "non-redirected `getline' undefined inside END action"
+msgstr ""
+"Nicht-umgelenktes 'getline' ist innerhalb der END-Aktion nicht definiert."
+
+#: awkgram.y:781
+msgid "call of `length' without parentheses is not portable"
+msgstr "Aufruf von 'length' ohne Klammern ist nicht portabel."
+
+#: awkgram.y:784
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "Aufruf von 'length' ohne Klammern ist in POSIX-Mode veraltet."
+
+#: awkgram.y:835
+msgid "invalid subscript expression"
+msgstr "Ungültiger Index-Ausdruck."
+
+#: awkgram.y:1020
+#, fuzzy
+msgid "unexpected newline or end of string"
+msgstr "Unerwartetes Zeilenende"
+
+#: awkgram.y:1115
+msgid "empty program text on command line"
+msgstr "Kein Programmtext auf der Kommandozeile."
+
+#: awkgram.y:1172
+#, c-format
+msgid "can't open source file `%s' for reading (%s)"
+msgstr "Kann Quelldatei '%s' nicht zum Lesen öffnen (%s)."
+
+#: awkgram.y:1207
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "Kann Quelldatei '%s' nicht lesen (%s)."
+
+#: awkgram.y:1215
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "Quelldatei '%s' ist leer."
+
+#: awkgram.y:1417 awkgram.y:1527 awkgram.y:1545 awkgram.y:1895 awkgram.y:1980
+msgid "source file does not end in newline"
+msgstr "Quelldatei hört nicht mit Zeilenende auf."
+
+#: awkgram.y:1481
+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:1501
+msgid "unterminated regexp"
+msgstr "Nicht-beendeter Regulärer Ausdruck"
+
+#: awkgram.y:1504
+msgid "unterminated regexp at end of file"
+msgstr "Nicht-beendeter Regulärer Ausdruck am Dateiende."
+
+#: awkgram.y:1571
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr ""
+"Die Verwendung von '\\#...' zur Fortsetzung von Zeilen ist nicht portabel."
+
+#: awkgram.y:1583
+msgid "backslash not last character on line"
+msgstr "Backslash ist nicht letztes Zeichen auf der Zeile."
+
+#: awkgram.y:1628
+msgid "POSIX does not allow operator `**='"
+msgstr "POSIX erlaubt den Operator '**=' nicht."
+
+#: awkgram.y:1630
+msgid "old awk does not support operator `**='"
+msgstr "Das alte awk erlaubt den Operator '**=' nicht."
+
+#: awkgram.y:1639
+msgid "POSIX does not allow operator `**'"
+msgstr "POSIX erlaubt den Operator '**' nicht."
+
+#: awkgram.y:1641
+msgid "old awk does not support operator `**'"
+msgstr "Das alte awk erlaubt den Operator '**' nicht."
+
+#: awkgram.y:1672
+msgid "operator `^=' is not supported in old awk"
+msgstr "Das alte awk kennt den Operator '^=' nicht."
+
+#: awkgram.y:1680
+msgid "operator `^' is not supported in old awk"
+msgstr "Das alte awk kennt den Operator '^' nicht."
+
+#: awkgram.y:1764 awkgram.y:1781
+msgid "unterminated string"
+msgstr "Nicht-beendeter String"
+
+#: awkgram.y:1941
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "Ungültiges Zeichen '%c' in einem Ausdruck."
+
+#: awkgram.y:2001
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "'%s' ist eine gawk-Erweiterung"
+
+#: awkgram.y:2004
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "'%s' ist eine Erweiterung der Bell Labs."
+
+#: awkgram.y:2007
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "POSIX gestattet '%s' nicht."
+
+#: awkgram.y:2011
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "Das alte awk gestattet '%s' nicht."
+
+#: awkgram.y:2038
+msgid "`goto' considered harmful!\n"
+msgstr "'goto' gilt als schlechter Stil!\n"
+
+#: awkgram.y:2102
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
+msgstr "Unzulässige Argumentzahl %d für %s."
+
+#: awkgram.y:2121 awkgram.y:2124
+msgid "match: third argument is a gawk extension"
+msgstr "match: Das dritte Argument ist eine gawk-Erweiterung."
+
+#: awkgram.y:2137
+#, 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:2140
+#, 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:2167 awkgram.y:2170
+msgid "close: second argument is a gawk extension"
+msgstr "close: Das zweite Argument ist eine gawk-Erweiterung."
+
+#: awkgram.y:2180
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"Fehlerhafte Verwendung von dcgettext(_\"...\"): \n"
+"Entfernen Sie den führenden Unterstrich."
+
+#: awkgram.y:2195
+#, fuzzy
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"Fehlerhafte Verwendung von dcgettext(_\"...\"): \n"
+"Entfernen Sie den führenden Unterstrich."
+
+#: awkgram.y:2266
+#, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "Funktion '%s': Parameter #%d, '%s' wiederholt Parameter #%d."
+
+#: awkgram.y:2299
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "Funktion '%s': Parameter '%s' verdeckt eine globale Variable."
+
+#: awkgram.y:2411
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "Kann '%s' nicht zum Schreiben öffnen (%s)."
+
+#: awkgram.y:2412 profile.c:93
+msgid "sending profile to standard error"
+msgstr "Schicke Profile auf Stadard-Fehlerausgabe."
+
+#: awkgram.y:2442
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: close gescheitert (%s)."
+
+#: awkgram.y:2566
+msgid "shadow_funcs() called twice!"
+msgstr "shadow_funcs() zweimal aufgerufen!"
+
+#: awkgram.y:2593
+msgid "there were shadowed variables."
+msgstr ""
+
+#: awkgram.y:2666
+#, c-format
+msgid "function `%s': can't use function name as parameter name"
+msgstr "Funktion '%s': Kann Funktionsnamen nicht als Parameternamen benutzen."
+
+#: awkgram.y:2676
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "Funktion '%s' ist bereits definiert."
+
+#: awkgram.y:2827 awkgram.y:2833
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "Aufgerufene funktion '%s' ist nirgends definiert."
+
+#: awkgram.y:2836
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "Funktion '%s' wird nirgends aufgerufen."
+
+#: awkgram.y:2863
+#, 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:2876
+#, 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:2878
+#, fuzzy
+msgid "or used as a variable or an array"
+msgstr "Kann Funktion '%s' nicht als Variable oder Array verwenden."
+
+#: builtin.c:111
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "%s to \"%s\" fehlgeschlagen (%s)"
-#: builtin.c:108
+#: builtin.c:112
msgid "standard output"
msgstr "Standardausgabe"
-#: builtin.c:109
+#: builtin.c:113
msgid "reason unknown"
msgstr "Unbekannte Ursache"
-#: builtin.c:122
+#: builtin.c:126
msgid "exp: received non-numeric argument"
msgstr "exp: Argument ist keine Zahl."
-#: builtin.c:128
+#: builtin.c:132
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: Argument %g außerhalb des gültigen Zahlenbereichs."
-#: builtin.c:186
+#: builtin.c:190
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: Leeren der Puffer nicht möglich, Pipe »%s« ist nur zum Lesen "
"geöffnet."
-#: builtin.c:189
+#: builtin.c:193
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush: Leeren der Puffer nicht möglich, Datei »%s« ist nur zum Lesen "
"geöffnet."
-#: builtin.c:201
+#: builtin.c:205
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "fflush: »%s« ist keine geöffnete Datei, Pipe oder Prozess."
-#: builtin.c:295
+#: builtin.c:299
msgid "index: received non-string first argument"
msgstr "index: Erstes Argument ist kein String."
-#: builtin.c:297
+#: builtin.c:301
msgid "index: received non-string second argument"
msgstr "index: Zweites Argument ist kein string."
-#: builtin.c:407
+#: builtin.c:411
msgid "int: received non-numeric argument"
msgstr "Argument ist keine Zahl."
-#: builtin.c:424
+#: builtin.c:428
msgid "length: received non-string argument"
msgstr "length: Argument ist kein String."
-#: builtin.c:440
+#: builtin.c:444
msgid "log: received non-numeric argument"
msgstr "log: Argument ist keine Zahl."
-#: builtin.c:443
+#: builtin.c:447
#, c-format
msgid "log: received negative argument %g"
msgstr "log: Negatives Argument %g."
-#: builtin.c:605 builtin.c:608
+#: builtin.c:609 builtin.c:612
msgid "must use `count$' on all formats or none"
msgstr ""
-#: builtin.c:703
+#: builtin.c:714
msgid "`$' is not permitted in awk formats"
msgstr "»$« ist in awk-Formaten nicht zulässig."
-#: builtin.c:709
+#: builtin.c:720
msgid "arg count with `$' must be > 0"
msgstr "Argumentnummer bei »$« muss > 0 sein."
-#: builtin.c:711
-#, c-format
-msgid "arg count %d greater than total number of supplied arguments"
+#: builtin.c:722
+#, 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:713
+#: builtin.c:724
msgid "`$' not permitted after period in format"
msgstr "»$« nach Punkt in Formatangabe nicht zulässig."
-#: builtin.c:726
+#: builtin.c:737
msgid "no `$' supplied for positional field width or precision"
msgstr "»$« fehlt in positionsabhängiger Feldbreite oder Genauigkeit."
#
-#: builtin.c:784
+#: builtin.c:795
msgid "`l' is meaningless in awk formats; ignored"
msgstr "»l« ist in awk-Formaten bedeutungslos, ignoriert."
-#: builtin.c:788
+#: builtin.c:799
msgid "`l' is not permitted in POSIX awk formats"
msgstr "»l« in POSIX-awk-Formaten nicht zulässig."
-#: builtin.c:799
+#: builtin.c:810
msgid "`L' is meaningless in awk formats; ignored"
msgstr "»L« ist in awk-Formaten bedeutungslos, ignoriert."
-#: builtin.c:803
+#: builtin.c:814
msgid "`L' is not permitted in POSIX awk formats"
msgstr "»L« in POSIX-awk-Formaten nicht zulässig."
-#: builtin.c:814
+#: builtin.c:825
msgid "`h' is meaningless in awk formats; ignored"
msgstr "»h« ist in awk-Formaten bedeutungslos, ignoriert."
-#: builtin.c:818
+#: builtin.c:829
msgid "`h' is not permitted in POSIX awk formats"
msgstr "»h« in POSIX-awk-Formaten nicht zulässig.<"
-#: builtin.c:1067
+#: builtin.c:1078
msgid "not enough arguments to satisfy format string"
msgstr "Nicht genügend Argumente für Formatangabe."
-#: builtin.c:1069
+#: builtin.c:1080
msgid "^ ran out for this one"
msgstr "^ ran out for this one"
-#: builtin.c:1074
+#: builtin.c:1085
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf: Format-Specifier hat keinen Controlcode."
-#: builtin.c:1077
+#: builtin.c:1088
msgid "too many arguments supplied for format string"
msgstr "Zu viele Argumente für Formatstring."
-#: builtin.c:1120 builtin.c:1123
+#: builtin.c:1154 builtin.c:1157
msgid "printf: no arguments"
msgstr "printf: Keine Argumente"
-#: builtin.c:1156
+#: builtin.c:1181
msgid "sqrt: received non-numeric argument"
msgstr "sqrt: Argument ist keine Zahl."
-#: builtin.c:1160
+#: builtin.c:1185
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: Argument %g ist negativ."
-#: builtin.c:1182
+#: builtin.c:1207
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: Start-Index %g ist ungültig, 1 wird benutzt."
-#: builtin.c:1187
+#: builtin.c:1212
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "substr: Start-Wert %g wird abgeschnitten."
-#: builtin.c:1201
+#: builtin.c:1231
#, c-format
msgid "substr: length %g is <= 0"
msgstr "substr: Länge %g ist kleiner oder gleich 0."
-#: builtin.c:1207
+#: builtin.c:1233
+#, fuzzy, c-format
+msgid "substr: length %g is < 0"
+msgstr "substr: Länge %g ist kleiner oder gleich 0."
+
+#: builtin.c:1240
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: Länge %g wird abgeschnitten."
-#: builtin.c:1214
+#: builtin.c:1245
+#, c-format
+msgid "substr: length %g too big for string indexing, truncating to %g"
+msgstr ""
+
+#: builtin.c:1257
msgid "substr: source string is zero length"
msgstr "substr: String ist leer."
-#: builtin.c:1221
-#, c-format
+#: builtin.c:1263
+#, 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:1271
+#, fuzzy, c-format
msgid ""
-"substr: length %d at start index %d exceeds length of first argument (%d)"
+"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:1227
-#, c-format
-msgid "substr: start index %d is past end of string"
-msgstr "substr: Start-Wert %d liegt hinter dem Ende des Strings."
-
-#: builtin.c:1263
+#: builtin.c:1306
#, fuzzy
msgid "strftime: received non-string first argument"
msgstr "strftime: Erstes Argument ist kein String."
-#: builtin.c:1269
+#: builtin.c:1312
msgid "strftime: received empty format string"
msgstr "strftime: Format-String ist leer."
-#: builtin.c:1278
+#: builtin.c:1321
#, fuzzy
msgid "strftime: received non-numeric second argument"
msgstr "strftime. Zweites Argument ist keine Zahl."
-#: builtin.c:1341
+#: builtin.c:1384
msgid "mktime: received non-string argument"
msgstr "mktime: Argument ist kein String."
-#: builtin.c:1386
+#: builtin.c:1429
#, fuzzy
msgid "system: received non-string argument"
msgstr "system: Argument ist kein String."
-#: builtin.c:1512
+#: builtin.c:1573
#, fuzzy
msgid "tolower: received non-string argument"
msgstr "tolower: Argument ist kein String."
-#: builtin.c:1561
+#: builtin.c:1622
#, fuzzy
msgid "toupper: received non-string argument"
msgstr "toupper: Argument ist kein String."
-#: builtin.c:1606
+#: builtin.c:1667
msgid "atan2: received non-numeric first argument"
msgstr "atan2: Erstes Argument ist keine Zahl."
-#: builtin.c:1608
+#: builtin.c:1669
msgid "atan2: received non-numeric second argument"
msgstr "atan2: Zweites Argument ist keine Zahl."
-#: builtin.c:1627
+#: builtin.c:1688
msgid "sin: received non-numeric argument"
msgstr "sin: Argument istk eine Zahl."
-#: builtin.c:1643
+#: builtin.c:1704
msgid "cos: received non-numeric argument"
msgstr "cos: Argument ist keine Zahl."
-#: builtin.c:1687
+#: builtin.c:1748
msgid "srand: received non-numeric argument"
msgstr "srand: Argument ist keine Zahl."
-#: builtin.c:1721
+#: builtin.c:1787
msgid "match: third argument is not an array"
msgstr "match: Drittes Argument ist kein Array."
-#: builtin.c:2157
+#: builtin.c:2264
msgid "gensub: 3rd argument of 0 treated as 1"
msgstr "gensub: Drittes Argument 0 als 1 interpretiert"
-#: builtin.c:2268 builtin.c:2270
+#: builtin.c:2375 builtin.c:2377
msgid "lshift: received non-numeric first argument"
msgstr "lshift: Erstes Argument ist keine Zahl."
-#: builtin.c:2272
+#: builtin.c:2379
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr ""
"lshift(%lf, %lf): Negative Werte werden merkwürdige Ergebnisse liefern."
-#: builtin.c:2274
+#: builtin.c:2381
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf): Dezimalteil wird abgeschnitten."
-#: builtin.c:2276
+#: builtin.c:2383
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
"lshift(%lf, %lf): Zu große Shift-Werte werden merkwürdige Ergebnisse liefern."
-#: builtin.c:2305 builtin.c:2307
+#: builtin.c:2412 builtin.c:2414
msgid "rshift: received non-numeric first argument"
msgstr "rshift: Erstes Argument ist keine Zahl."
-#: builtin.c:2309
+#: builtin.c:2416
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr ""
"rshift (%lf, %lf): Negative Werte werden merkwürdige Ergebnisse liefern."
-#: builtin.c:2311
+#: builtin.c:2418
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf): Dezimalteil wird abgeschnitten."
-#: builtin.c:2313
+#: builtin.c:2420
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
"rshift(%lf, %lf): Zu große Shift-Werte werden merkwürdige Ergebnisse liefern."
-#: builtin.c:2342 builtin.c:2344
+#: builtin.c:2449 builtin.c:2451
msgid "and: received non-numeric first argument"
msgstr "and: Erstes Argument ist keine Zahl."
-#: builtin.c:2346
+#: builtin.c:2453
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr "and(%lf, %lf): Negative Werte werden merkwürdige Ergebnisse liefern."
-#: builtin.c:2348
+#: builtin.c:2455
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): Dezimalteil wird abgeschnitten."
-#: builtin.c:2377 builtin.c:2379
+#: builtin.c:2484 builtin.c:2486
msgid "or: received non-numeric first argument"
msgstr "or: Erstes Argument ist keine Zahl."
-#: builtin.c:2381
+#: builtin.c:2488
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr "or(%lf, %lf): Negative Werte werden merkwürdige Ergebnisse liefern."
-#: builtin.c:2383
+#: builtin.c:2490
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf): Dezimalteil wird abgeschnitten."
-#: builtin.c:2412 builtin.c:2414
+#: builtin.c:2519 builtin.c:2521
msgid "xor: received non-numeric first argument"
msgstr "xor: Erstes Argument ist keine Zahl."
-#: builtin.c:2416
+#: builtin.c:2523
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr "xor(%lf, %lf: Negative Werte werden merkwürdige Ergebnisse liefern."
-#: builtin.c:2418
+#: builtin.c:2525
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf): Dezimalteil wird abgeschnitten."
-#: builtin.c:2446
+#: builtin.c:2553
msgid "compl: received non-numeric argument"
msgstr "compl: Erstes Argument ist keine Zahl."
-#: builtin.c:2448
+#: builtin.c:2555
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf): Negativer Wert wird merkwürdige Ergebnisse liefern."
-#: builtin.c:2450
+#: builtin.c:2557
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf): Dezimalteil wird abgeschnitten."
-#: builtin.c:2621
+#: builtin.c:2728
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: '%s' ist keine gültige Locale-Kategorie."
+#: eval.c:262
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "Unbekannter Knotentyp %d"
+
+#: eval.c:310
+msgid "buffer overflow in genflags2str"
+msgstr "Pufferüberlauf in genflags2str."
+
+#: eval.c:555
+#, 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:576
+msgid "`break' outside a loop is not portable"
+msgstr "'break' außerhalb einer Schleife ist nicht portabel."
+
+#: eval.c:580
+msgid "`break' outside a loop is not allowed"
+msgstr "'break' außerhalb einer Schleife ist nicht zulässig."
+
+#: eval.c:597
+msgid "`continue' outside a loop is not portable"
+msgstr "'continue' außerhalb einer Schleife ist nicht portabel."
+
+#: eval.c:601
+msgid "`continue' outside a loop is not allowed"
+msgstr "'continue' außerhalb einer Schleife ist nicht zulässig."
+
+#: eval.c:635
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "'next' kann nicht in einer BEGIN-Regel benutzt werden."
+
+#: eval.c:637
+msgid "`next' cannot be called from an END rule"
+msgstr "'next' kann nicht in einer END-Regel benutzt werden."
+
+#: eval.c:646
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "'nextfile' kann nicht in einer BEGIN-Regel benutzt werden."
+
+#: eval.c:648
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "'nextfile' kann nicht in einer END-Regel benutzt werden."
+
+#: eval.c:696
+msgid "statement has no effect"
+msgstr "Anweisung hat keinen Effekt."
+
+#: eval.c:731 eval.c:761 eval.c:1733
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "Referenz auf die nicht-initialisierte Variable '%s'."
+
+#: eval.c:739 eval.c:1721
+#, 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:746 eval.c:752
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "Referenz auf nicht-initialisiertes Argument '%s'."
+
+#: eval.c:810 eval.c:1728 profile.c:773
+#, c-format
+msgid "attempt to use array `%s' in a scalar context"
+msgstr "Versuch, das Array '%s' in Skalarkontext zu verwenden."
+
+#: eval.c:910
+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:935
+msgid "assignment used in conditional context"
+msgstr "Zuweisung in einer Bedingung."
+
+#: eval.c:1026
+msgid "division by zero attempted"
+msgstr "Division durch Null versucht."
+
+#: eval.c:1041
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "Division durch Null versucht in '%%'."
+
+#: eval.c:1056 profile.c:649
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "Illegaler Typ (%s) in tree_eval"
+
+#: eval.c:1232
+msgid "division by zero attempted in `/='"
+msgstr "Division durch Null versucht in '/='."
+
+#: eval.c:1250
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "Division durch Null versucht in '%%='."
+
+#: eval.c:1510
+#, c-format
+msgid "%s (from %s)"
+msgstr "%s (von %s)"
+
+#: eval.c:1569
+#, c-format
+msgid "function `%s' called with more arguments than declared"
+msgstr "Funktion '%s' mit zu vielen Argumenten aufgerufen."
+
+#: eval.c:1628
+#, c-format
+msgid "function `%s' not defined"
+msgstr "Funktion '%s' ist nicht definiert."
+
+#: eval.c:1634
+#, c-format
+msgid "function %s called\n"
+msgstr "Funktion %s aufgerufen\n"
+
+#: eval.c:1693
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# Funktion Aufruf-Stack\n"
+"\n"
+
+#: eval.c:1696
+msgid "\t# -- main --\n"
+msgstr "\t# -- main --\n"
+
+#: eval.c:1850
+msgid "attempt to field reference from non-numeric value"
+msgstr "Nicht-numerischer Wert für Feldreferenz verwendet."
+
+#: eval.c:1852
+msgid "attempt to reference from null string"
+msgstr "Referenz von einem Null-String"
+
+#: eval.c:1858
+#, c-format
+msgid "attempt to access field %d"
+msgstr "Versuch des Zugriffs auf Feld %d."
+
+#: eval.c:1874
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr "Versuch den skalaren Parameter '%s' als Array zu benutzen."
+
+#: eval.c:1886 eval.c:1893 profile.c:865
+msgid "assignment is not allowed to result of builtin function"
+msgstr ""
+"Zuweisungen an das Ergebnis einer eingebauten Funktion sind nicht erlaubt."
+
+#: eval.c:1941
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "'IGNORECASE' ist eine gawk-Erweiterung"
+
+#: eval.c:1970
+msgid "`BINMODE' is a gawk extension"
+msgstr "'BINMODE' ist eine gawk-Erweiterung."
+
+#: eval.c:2082
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "Falsche '%sFMT'-Angabe '%s'"
+
+#: eval.c:2160
+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."
@@ -431,10 +922,35 @@ msgstr "extension: Kann '%s' nicht öffnen (%s)\n"
msgid "extension: library `%s': cannot call function `%s' (%s)\n"
msgstr "extension: Bibliothek '%s': kann Funktion '%s' nicht aufrufen (%s)\n"
-#: ext.c:180
+#: ext.c:181
msgid "Operation Not Supported"
msgstr "Operation nicht möglich."
+#: field.c:321
+msgid "NF set to negative value"
+msgstr ""
+
+#: field.c:819
+msgid "split: second argument is not an array"
+msgstr "split: Zweites Argument ist kein Array."
+
+#: field.c:854
+msgid "split: null string for third arg is a gawk extension"
+msgstr "split: Null-String als drittes Argument ist eine gawk-Erweiterung."
+
+#: field.c:906
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "'FIELDWIDTHS' ist eine gawk-Erweiterung."
+
+#: field.c:933
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "Feld %d in FIELDWIDTHS muss > 0 sein."
+
+#: field.c:1006
+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"
@@ -475,7 +991,7 @@ msgstr "%s: Illegale Option -- %c.\n"
msgid "%s: invalid option -- %c\n"
msgstr "%s: Ungültige Option -- %c.\n"
-#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412
+#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:431
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s Option erfordert ein Argument -- %c.\n"
@@ -490,163 +1006,469 @@ msgstr "%s: Option '-W %s' ist mehrdeutig.\n"
msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "%s. Option '-W %s' erlaubt kein Argument.\n"
-#: main.c:307
+#: io.c:257
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "Kann Datei '%s' nicht zum Lesen öffnen (%s)."
+
+#: io.c:344
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "Schließen von Dateideskriptor %d ('%s') gescheitert (%s)."
+
+#: io.c:482
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "Ungültiger Tree-Typ %s in redirect()."
+
+#: io.c:488
+#, c-format
+msgid "expression in `%s' redirection only has numeric value"
+msgstr "Ausdruck in '%s' Umlenkung hat nur einen numerischen Wert."
+
+#: io.c:494
+#, c-format
+msgid "expression for `%s' redirection has null string value"
+msgstr "Ausdruck für '%s' Umlenkung ist ein leerer String."
+
+#: io.c:499
+#, 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:521
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "Unnötige Kombination von '>' und '>>' für Datei '%.*s'."
+
+#: io.c:573
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "Kann Pipe '%s' nicht für Ausgabe öffnen (%s)."
+
+#: io.c:582
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "Kann Pipe '%s' nicht für Eingabe öffnen (%s)."
+
+#: io.c:595
+#, 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:599
+#, 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:675
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "Kann nicht von '%s' umlenken (%s)."
+
+#: io.c:678
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "Kann nicht auf '%s' umlenken (%s)."
+
+#: io.c:717
+msgid ""
+"reached system limit for open files: starting to multiplex file descriptors"
+msgstr ""
+"Systemgrenze offener Dateien erreicht; beginne mit Multiplexing von "
+"Dateideskriptoren."
+
+#: io.c:729
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "Schließen von '%s' gescheitert (%s)."
+
+#: io.c:736
+msgid "too many pipes or input files open"
+msgstr "Zu viele Pipes oder Eingabedateien offen."
+
+#: io.c:759
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: Zweites Argument muss 'to' oder 'from' sein."
+
+#: io.c:773
+#, 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:777
+msgid "close of redirection that was never opened"
+msgstr "'close' für eine Umlenkung, die nie geöffnet wurde."
+
+#: io.c:804
+#, 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:866
+#, c-format
+msgid "failure status (%d) on pipe close of `%s' (%s)"
+msgstr "Fehlerstatus (%d) beim Schließen der Pipe '%s' (%s)."
+
+#: io.c:869
+#, c-format
+msgid "failure status (%d) on file close of `%s' (%s)"
+msgstr "Fehlerstatus (%d) beim Schließen de rDatei '%s' (%s)."
+
+#: io.c:888
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "Das explizite des Sockets '%s' fehlt."
+
+#: io.c:891
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "Das explizite Schließen des Ko-Prozesses '%s' fehlt."
+
+#: io.c:894
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "Das explizite Schließen der Pipe '%s' fehlt."
+
+#: io.c:897
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "Das explizite Schließen der Datei '%s' fehlt."
+
+#: io.c:926 io.c:980
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "Fehler beim Schreiben auf stdout (%s)."
+
+#: io.c:930 io.c:984
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "Fehler beim Schreiben auf stderr (%s)."
+
+#: io.c:938
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "Leeren der Pipe '%s' gescheitert (%s)."
+
+#: io.c:941
+#, c-format
+msgid "co-process flush of pipe to `%s' failed (%s)."
+msgstr "Ko-Prozess: Leeren der Pipe zu '%s' gescheitert (%s)."
+
+#: io.c:944
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "Flush der Datei '%s' gescheitert (%s)."
+
+#: io.c:1103
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "/inet/raw Client noch nicht fertig."
+
+#: io.c:1105 io.c:1142
+msgid "only root may use `/inet/raw'."
+msgstr "Nur root darf '/inet/raw' benutzen"
+
+#: io.c:1140
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "'/inet/raw'-Server noch nicht fertig."
+
+#: io.c:1230
+#, c-format
+msgid "no (known) protocol supplied in special filename `%s'"
+msgstr "Kein bekanntes Protokoll in Dateinamen '%s' angegeben."
+
+#: io.c:1248
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "Dateiname '%s' ist unvollständig."
+
+#: io.c:1260
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "Lokaler Port in '%s' ist ungültig."
+
+#: io.c:1272
+msgid "must supply a remote hostname to `/inet'"
+msgstr "Sie müssen einen Rechnernamen in '/inet' angeben."
+
+#: io.c:1287
+msgid "must supply a remote port to `/inet'"
+msgstr "Sie müssen einen Port in '/inet' angeben."
+
+#: io.c:1293
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "Port-Angabe in '%s' ist ungültig."
+
+#: io.c:1303
+msgid "TCP/IP communications are not supported"
+msgstr "TCP/IP-Verbindungen sind nicht möglich."
+
+#: io.c:1312 io.c:1492
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "Datei '%s' ist ein Verzeichnis."
+
+#: io.c:1381
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "Benutzen Sie 'PROCINFO[\"%s\"]' statt '%s'"
+
+#: io.c:1413
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "Benutzen Sie 'PROCINFO[...] statt '/dev/user'."
+
+#: io.c:1478 io.c:1652
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "Konnte '%s' nicht öffnen, Mode '%s'."
+
+#: io.c:1703
+#, fuzzy, c-format
+msgid "close of master pty failed (%s)"
+msgstr "Schließen der Pipe gescheitert (%s)."
+
+#: io.c:1705 io.c:1857 io.c:2009
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "Schließen von stdout in Kindprozess gescheitert (%s)."
+
+#: io.c:1708
+#, 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:1710 io.c:1862
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "Schließen von stdin im Kindprozess gescheitert (%s)."
+
+#: io.c:1713
+#, 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:1715 io.c:1734
+#, fuzzy, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "Schließen der Pipe gescheitert (%s)."
+
+#: io.c:1808 io.c:1860 io.c:1990 io.c:2012
+#, 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:1812 io.c:1865
+#, 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:1829 io.c:2003
+msgid "restoring stdout in parent process failed\n"
+msgstr ""
+
+#: io.c:1834
+msgid "restoring stdin in parent process failed\n"
+msgstr ""
+
+#: io.c:1868 io.c:2014 io.c:2025
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "Schließen der Pipe gescheitert (%s)."
+
+#: io.c:1913
+msgid "`|&' not supported"
+msgstr "'|&' nicht möglich."
+
+#: io.c:1980
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "Kann Pipe '%s' nicht öffnen (%s)."
+
+#: io.c:2021
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr "Kann Kindprozess für '%s' nicht erzeugen (fork: %s)."
+
+#: io.c:2364
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "Datei '%s' ist leer."
+
+#: io.c:2407 io.c:2415
+msgid "could not allocate more input memory"
+msgstr ""
+
+#: io.c:2540 io.c:2782 io.c:3046
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "Fehler beim Lesen der Eingabedatei '%s': %s."
+
+#: io.c:3281
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "Multicharacter-Wert von 'RS' ist eine gawk-Erweiterung."
+
+#: main.c:322
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "Option '-m[fr]' ist in gawk bedeutungslos."
-#: main.c:309
+#: main.c:324
msgid "-m option usage: `-m[fr] nnn'"
msgstr "Anwendung der Option -m: '-m[fr] nnn'"
-#: main.c:326
+#: main.c:341
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s: Option '-W %s' unbekannt, ignoriert.\n"
-#: main.c:357
+#: main.c:378
msgid "empty argument to `--source' ignored"
msgstr "Leeres Argument für '--source' ignoriert."
-#: main.c:429
+#: main.c:448
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr ""
"Umgebungsvariable 'POSIXLY_CORRECT' ist gesetzt: '--posix' angeschaltet."
-#: main.c:434
+#: main.c:453
msgid "`--posix' overrides `--traditional'"
msgstr "'--posix' hat Vorrang vor '--traditional'"
-#: main.c:445
+#: main.c:464
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr "'--posix' /'--traditional' hat Vorrang vor '--non-decimal-data'."
-#: main.c:449
+#: main.c:468
#, fuzzy, c-format
msgid "running %s setuid root may be a security problem"
msgstr "%s als setuid root auszuführen, kann zu Sicherheitsproblemen führen."
-#: main.c:478
-#, c-format
-msgid "can't set mode on stdin (%s)"
+#: main.c:509
+#, fuzzy, c-format
+msgid "can't set binary mode on stdin (%s)"
msgstr "Kann Mode für stdin nicht setzen (%s)."
-#: main.c:481
-#, c-format
-msgid "can't set mode on stdout (%s)"
+#: main.c:512
+#, fuzzy, c-format
+msgid "can't set binary mode on stdout (%s)"
msgstr "Kann Mode für stdout nicht setzen (%s)."
-#: main.c:483
-#, c-format
-msgid "can't set mode on stderr (%s)"
+#: main.c:514
+#, fuzzy, c-format
+msgid "can't set binary mode on stderr (%s)"
msgstr "Kann Mode für stderr nicht setzen (%s)."
-#: main.c:512
+#: main.c:544
msgid "no program text at all!"
msgstr "Kein Programmtext."
-#: main.c:556
+#: main.c:612
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr "Anwendung: %s [POSIX- oder GNU-Optionen] -f PROGRAM [--] Datei ...\n"
-#: main.c:558
+#: main.c:614
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr "Anwendung: %s [POSIX- oder GNU-Optionen] -- %cPROGRAM%c Datei ...\n"
-#: main.c:563
+#: main.c:619
msgid "POSIX options:\t\tGNU long options:\n"
msgstr "POSIX-Optionen\t\tGNU-Optionen (lang):\n"
-#: main.c:564
+#: main.c:620
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f PROGRAM\t\t--file=PROGRAM\n"
-#: main.c:565
+#: main.c:621
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F Feldtrenner\t\t\t--field-separator=Feldtrenner\n"
-#: main.c:566
+#: main.c:622
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "\t-v var=Wert\t\t--assign=var=Wert\n"
-#: main.c:567
+#: main.c:623
msgid "\t-m[fr] val\n"
msgstr "\t-m[fr] Wert\n"
-#: main.c:568
+#: main.c:624
msgid "\t-W compat\t\t--compat\n"
msgstr "\t-W compat\t\t--compat\n"
-#: main.c:569
+#: main.c:625
msgid "\t-W copyleft\t\t--copyleft\n"
msgstr "\t-W copyleft\t\t--copyleft\n"
-#: main.c:570
+#: main.c:626
msgid "\t-W copyright\t\t--copyright\n"
msgstr "\t-W copyright\t\t--copyright\n"
-#: main.c:571
+#: main.c:627
msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
msgstr "\t-W dump-variables[=Datei]\t--dump-variables[=Datei]\n"
-#: main.c:572
+#: main.c:628
msgid "\t-W gen-po\t\t--gen-po\n"
msgstr "\t-W gen-po\t\t--gen-po\n"
-#: main.c:573
+#: main.c:629
msgid "\t-W help\t\t\t--help\n"
msgstr "\t-W help\t\t\t--help\n"
-#: main.c:574
+#: main.c:630
msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
-#: main.c:575
+#: main.c:631
msgid "\t-W lint-old\t\t--lint-old\n"
msgstr "\t-W lint-old\t\t--lint-old\n"
-#: main.c:576
+#: main.c:632
msgid "\t-W non-decimal-data\t--non-decimal-data\n"
msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
-#: main.c:578
+#: main.c:634
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:581
+#: main.c:637
msgid "\t-W parsedebug\t\t--parsedebug\n"
msgstr "\t-W parsedebug\t\t--parsedebug\n"
-#: main.c:583
+#: main.c:639
msgid "\t-W profile[=file]\t--profile[=file]\n"
msgstr "\t-W profile[=Datei]\t--profile[=Datei]\n"
-#: main.c:584
+#: main.c:640
msgid "\t-W posix\t\t--posix\n"
msgstr "\t-W posix\t\t--posix\n"
-#: main.c:585
+#: main.c:641
msgid "\t-W re-interval\t\t--re-interval\n"
msgstr "\t-W re-interval\t\t--re-interval\n"
-#: main.c:586
+#: main.c:642
msgid "\t-W source=program-text\t--source=program-text\n"
msgstr "\t-W source=Programmtext\t--source=Programmtext\n"
-#: main.c:587
+#: main.c:643
msgid "\t-W traditional\t\t--traditional\n"
msgstr "\t-W traditional\t\t--traditional\n"
-#: main.c:588
+#: main.c:644
msgid "\t-W usage\t\t--usage\n"
msgstr "\t-W usage\t\t--usage\n"
-#: main.c:589
+#: main.c:645
msgid "\t-W version\t\t--version\n"
msgstr "\t-W version\t\t--version\n"
-#: main.c:593
+#: main.c:649
#, fuzzy
msgid ""
"\n"
@@ -657,21 +1479,21 @@ msgstr ""
"den Sie im Kapitel 'Reporting Problems and Bugs' in der \n"
"gedruckten Version finden.\n"
-#: main.c:597
+#: main.c:653
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
"\n"
msgstr ""
-#: main.c:601
+#: main.c:657
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
msgstr ""
-#: main.c:613
+#: main.c:669
#, fuzzy, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -691,7 +1513,7 @@ msgstr ""
"spätere Version.\n"
"\n"
-#: main.c:621
+#: main.c:677
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"
@@ -705,7 +1527,7 @@ msgstr ""
"GNU General Public License for more details.\n"
"\n"
-#: main.c:627
+#: main.c:683
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"
@@ -716,99 +1538,115 @@ msgstr ""
"Software Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-"
"1307, USA.\n"
-#: main.c:657
+#: main.c:713
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "-Ft setzt FS im POSIX-awk nicht auf Tab."
-#: main.c:888
+#: main.c:944
+#, c-format
+msgid ""
+"%s: `%s' argument to `-v' not in `var=value' form\n"
+"\n"
+msgstr ""
+
+#: main.c:964
#, c-format
-msgid "invalid syntax in name `%s' for variable assignment"
-msgstr "Ungültige Syntax im Namen '%s' für Variablenzuweisung."
+msgid "`%s' is not a legal variable name"
+msgstr ""
-#: main.c:957
+#: main.c:967
+#, c-format
+msgid "`%s' is not a variable name, looking for file `%s=%s'"
+msgstr ""
+
+#: main.c:995
msgid "floating point exception"
msgstr "Floating point exception"
-#: main.c:964
+#: main.c:1002
msgid "fatal error: internal error"
msgstr "Fataler Fehler: interner Fehler"
-#: main.c:1014
+#: main.c:1052
#, c-format
msgid "no pre-opened fd %d"
msgstr "Kein geöffneter Dateideskriptor %d"
-#: main.c:1019
+#: main.c:1057
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "Konnte /dev/null nicht für Dateideskriptor %d öffnen."
-#: main.c:1037 main.c:1046
+#: main.c:1080 main.c:1089
#, c-format
msgid "could not find groups: %s"
msgstr "Konnte Gruppen nicht finden: %s"
-#: profile.c:94
-#, c-format
-msgid "could not open `%s' for writing: %s"
-msgstr "Konnte '%s' nicht zum Schreiben öffnen: %s"
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "Kommandozeile:"
-#: profile.c:96 awkgram.y:2465
-msgid "sending profile to standard error"
-msgstr "Schicke Profile auf Stadard-Fehlerausgabe."
+#: msg.c:120
+msgid "warning: "
+msgstr "Warnung: "
-#: profile.c:409
-msgid "internal error: Node_var with null vname"
-msgstr "Interner Fehler: Node_var with null vname."
+#: msg.c:142
+msgid "error: "
+msgstr "Fehler: "
-#: profile.c:524
-msgid "internal error: Node_var_array with null vname"
-msgstr "Interner Fehler: Node_var_array with null vname."
+#: msg.c:178
+msgid "fatal: "
+msgstr "Fatal: "
-#: profile.c:554 eval.c:813
-#, c-format
-msgid ""
-"function `%s' called with space between name and `(',\n"
-"%s"
-msgstr ""
-"Funktion '%s' mit Leerzeichen zwischen Name und '(' aufgerufen, \n"
-"%s"
+#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
+msgid "can't convert string to float"
+msgstr "Kann String nicht in Gleitkommazahl konvertieren."
-#: profile.c:556 eval.c:815
-msgid "or used in other expression context"
-msgstr "or in anderem Kontext benutzt"
+#: node.c:357
+msgid "backslash at end of string"
+msgstr "Backslash am String-Ende."
-#: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741
-#, c-format
-msgid "attempt to use array `%s' in a scalar context"
-msgstr "Versuch, das Array '%s' in Skalarkontext zu verwenden."
+#: node.c:544
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX erlabut keine '\\x'-Escapes."
-#: profile.c:637 eval.c:1047
-#, c-format
-msgid "illegal type (%s) in tree_eval"
-msgstr "Illegaler Typ (%s) in tree_eval"
+#: node.c:550
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "Keine Hex-Ziffern in '\\x'-Escape."
-#: profile.c:842 eval.c:1790
+#: node.c:584
#, c-format
-msgid "attempt to use function `%s' as array"
-msgstr "Versuch, die Funktion '%s' als Array zu verwenden."
+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:856 eval.c:1797
+#: profile.c:91
#, c-format
-msgid "`%s' is a function, assignment is not allowed"
-msgstr "'%s' ist eine Funktion, Zuweisungen sind nicht erlaubt."
+msgid "could not open `%s' for writing: %s"
+msgstr "Konnte '%s' nicht zum Schreiben öffnen: %s"
-#: profile.c:860 eval.c:1803 eval.c:1810
-msgid "assignment is not allowed to result of builtin function"
+#: profile.c:409
+msgid "internal error: Node_var with null vname"
+msgstr "Interner Fehler: Node_var with null vname."
+
+#: profile.c:471
+msgid "# treated internally as `delete'"
msgstr ""
-"Zuweisungen an das Ergebnis einer eingebauten Funktion sind nicht erlaubt."
-#: profile.c:1108
+#: profile.c:545
+msgid "internal error: Node_var_array with null vname"
+msgstr "Interner Fehler: Node_var_array with null vname."
+
+#: profile.c:1127
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# gawk-Profil, erzeugt %s\n"
-#: profile.c:1111
+#: profile.c:1130
msgid ""
"\t# BEGIN block(s)\n"
"\n"
@@ -816,7 +1654,7 @@ msgstr ""
"\t# BEGIN block(s)\n"
"\n"
-#: profile.c:1121
+#: profile.c:1140
msgid ""
"\t# Rule(s)\n"
"\n"
@@ -824,7 +1662,7 @@ msgstr ""
"\t# Rule(s)\n"
"\n"
-#: profile.c:1127
+#: profile.c:1146
msgid ""
"\t# END block(s)\n"
"\n"
@@ -832,7 +1670,7 @@ msgstr ""
"\t# END block(s)\n"
"\n"
-#: profile.c:1147
+#: profile.c:1166
msgid ""
"\n"
"\t# Functions, listed alphabetically\n"
@@ -840,928 +1678,143 @@ msgstr ""
"\n"
"\t# Functionen, alphabetisch sortiert\n"
-#: profile.c:1357
+#: profile.c:1376
#, c-format
msgid "unexpected type %s in prec_level"
msgstr "Unerwarteter Typ %s in prec_level."
-#: regex.c:1322
+#: 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"
-#: regex.c:1323
+#: regcomp.c:139
msgid "No match"
msgstr "Kein Treffer"
-#: regex.c:1324
+#: regcomp.c:142
msgid "Invalid regular expression"
msgstr "Ungültiger Regulärer Ausdruck."
-#: regex.c:1325
+#: regcomp.c:145
msgid "Invalid collation character"
msgstr "Ungültiges Zeichen."
-#: regex.c:1326
+#: regcomp.c:148
msgid "Invalid character class name"
msgstr "Ungültier Name für Zeichenklasse."
-#: regex.c:1327
+#: regcomp.c:151
msgid "Trailing backslash"
msgstr "Angehängter Backslash"
-#: regex.c:1328
+#: regcomp.c:154
msgid "Invalid back reference"
msgstr "Ungültige Referenze"
-#: regex.c:1329
+#: regcomp.c:157
msgid "Unmatched [ or [^"
msgstr "[ oder [^ nicht geschlossen"
-#: regex.c:1330
+#: regcomp.c:160
msgid "Unmatched ( or \\("
msgstr "( oder \\( nicht geschlossen"
-#: regex.c:1331
+#: regcomp.c:163
msgid "Unmatched \\{"
msgstr "\\{ nicht geschlossen"
-#: regex.c:1332
+#: regcomp.c:166
msgid "Invalid content of \\{\\}"
msgstr "Ungültiger Inhalt von \\{\\}"
-#: regex.c:1333
+#: regcomp.c:169
msgid "Invalid range end"
msgstr "Ungültiges Bereichsende"
-#: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204
+#: regcomp.c:172
msgid "Memory exhausted"
msgstr "Kein Speicher mehr."
-#: regex.c:1335
+#: regcomp.c:175
msgid "Invalid preceding regular expression"
msgstr "Vorangehender Regulärer Ausdruck ist ungültig."
-#: regex.c:1336
+#: regcomp.c:178
msgid "Premature end of regular expression"
msgstr "Vorzeitiges Ende des Regulären Ausdrucks."
-#: regex.c:1337
+#: regcomp.c:181
msgid "Regular expression too big"
msgstr "Regulärer Ausdruck zu groß."
-#: regex.c:1338
+#: regcomp.c:184
msgid "Unmatched ) or \\)"
msgstr ") oder \\) nicht geöffnet"
-#: regex.c:7365
+#: regcomp.c:621
msgid "No previous regular expression"
msgstr "Kein vorangehender Regulärer Ausdruck."
-#: awkgram.y:232
-msgid "BEGIN blocks must have an action part"
-msgstr "BEGIN-Blöcke müssen einen Aktionsteil haben."
+#~ msgid "BEGIN blocks must have an action part"
+#~ msgstr "BEGIN-Blöcke müssen einen Aktionsteil haben."
-#: awkgram.y:238
-msgid "END blocks must have an action part"
-msgstr "END-Blöcke müssen einen Aktionsteil haben."
+#~ msgid "`nextfile' used in BEGIN or END action"
+#~ msgstr "'nextfile' in BEGIN- oder END-Aktion benutzt."
-#: awkgram.y:274
-#, c-format
-msgid "`%s' is a built-in function, it cannot be redefined"
-msgstr "'%s' ist eine eingebaute Funktion und kann nicht umdefiniert werden."
+#~ msgid "gsub third parameter is not a changeable object"
+#~ msgstr "Der dritte Parameter von gsub ist ein unveränderliches Objekt."
-#: awkgram.y:362
-msgid "statement may have no effect"
-msgstr "Statement möglicherweise ohne Effekt."
-
-#: awkgram.y:455
-msgid "`next' used in BEGIN or END action"
-msgstr "'next' in BEGIN- oder END-Aktion benutzt."
+#~ msgid "or used in other expression context"
+#~ msgstr "or in anderem Kontext benutzt"
-#: awkgram.y:462 awkgram.y:469
-msgid "`nextfile' is a gawk extension"
-msgstr "'nextfile' ist eine gawk-Erweiterung."
+#~ msgid "attempt to use function `%s' as array"
+#~ msgstr "Versuch, die Funktion '%s' als Array zu verwenden."
-#: awkgram.y:474
-msgid "`nextfile' used in BEGIN or END action"
-msgstr "'nextfile' in BEGIN- oder END-Aktion benutzt."
+#~ msgid "`%s' is a function, assignment is not allowed"
+#~ msgstr "'%s' ist eine Funktion, Zuweisungen sind nicht erlaubt."
-#: awkgram.y:483
-msgid "`return' used outside function context"
-msgstr "'return' außerhalb einer Funktion benutzt."
+#~ msgid "internal error: file `%s', line %d\n"
+#~ msgstr "Interner Fehler: Datei '%s', Zeile %d\n"
-#: awkgram.y:519
-msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
-msgstr ""
-"Einfaches 'print' in BEGIN- oder END-Regel soll vermutlich 'print \"\"' sein."
-
-#: awkgram.y:532 awkgram.y:539
-msgid "`delete array' is a gawk extension"
-msgstr "'delete array' ist eine gawk-Erweiterung."
-
-#: awkgram.y:604
-msgid "multistage two-way pipelines don't work"
-msgstr "'multistage' Zweiwege-Pipes funktionieren nicht."
-
-#: awkgram.y:695
-msgid "regular expression on right of assignment"
-msgstr "Regulärer Ausdruck auf der rechten Seite einer Zuweisung."
-
-#: awkgram.y:713
-msgid "non-redirected `getline' undefined inside END action"
-msgstr ""
-"Nicht-umgelenktes 'getline' ist innerhalb der END-Aktion nicht definiert."
-
-#: awkgram.y:723
-msgid "regular expression on left of `~' or `!~' operator"
-msgstr "Regulärer Ausdruck links vom '~'- oder '!~'-Operator."
-
-#: awkgram.y:733
-#, c-format
-msgid "regexp constant `/%s/' looks like a C comment, but is not"
-msgstr ""
-"Konstanter Regulärer Ausdruck '/%s' sieht wie ein C-Kommentar aus, ist aber "
-"keiner."
-
-#: awkgram.y:749
-msgid "regular expression on right of comparison"
-msgstr "Regulärer Ausdruck rechts von einem Vergleich."
-
-#: awkgram.y:776
-msgid "non-redirected `getline' undefined inside BEGIN or END action"
-msgstr ""
-"Nicht-umgelenktes 'getline' ist innerhalb der BEGIN- und END-Aktion nicht "
-"definiert."
-
-#: awkgram.y:831
-msgid "call of `length' without parentheses is not portable"
-msgstr "Aufruf von 'length' ohne Klammern ist nicht portabel."
-
-#: awkgram.y:834
-msgid "call of `length' without parentheses is deprecated by POSIX"
-msgstr "Aufruf von 'length' ohne Klammern ist in POSIX-Mode veraltet."
-
-#: awkgram.y:884
-msgid "invalid subscript expression"
-msgstr "Ungültiger Index-Ausdruck."
-
-#: awkgram.y:1033
-#, c-format
-msgid "fptr %x not in tokentab\n"
-msgstr "fptr %x nicht in tokentab\n"
-
-#: awkgram.y:1068
-msgid "unexpected newline"
-msgstr "Unerwartetes Zeilenende"
-
-#: awkgram.y:1152
-msgid "empty program text on command line"
-msgstr "Kein Programmtext auf der Kommandozeile."
-
-#: awkgram.y:1209
-#, c-format
-msgid "can't open source file `%s' for reading (%s)"
-msgstr "Kann Quelldatei '%s' nicht zum Lesen öffnen (%s)."
-
-#: awkgram.y:1244
-#, c-format
-msgid "can't read sourcefile `%s' (%s)"
-msgstr "Kann Quelldatei '%s' nicht lesen (%s)."
-
-#: awkgram.y:1252
-#, c-format
-msgid "source file `%s' is empty"
-msgstr "Quelldatei '%s' ist leer."
-
-#: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011
-msgid "source file does not end in newline"
-msgstr "Quelldatei hört nicht mit Zeilenende auf."
-
-#: awkgram.y:1518
-msgid "unterminated regexp ends with `\\' at end of file"
-msgstr ""
-"Nicht-beendeter Regulärer Ausdruck (hört mit '\\' auf) am Ende der Datei."
-
-#: awkgram.y:1539
-msgid "unterminated regexp"
-msgstr "Nicht-beendeter Regulärer Ausdruck"
-
-#: awkgram.y:1542
-msgid "unterminated regexp at end of file"
-msgstr "Nicht-beendeter Regulärer Ausdruck am Dateiende."
-
-#: awkgram.y:1609
-msgid "use of `\\ #...' line continuation is not portable"
-msgstr ""
-"Die Verwendung von '\\#...' zur Fortsetzung von Zeilen ist nicht portabel."
-
-#: awkgram.y:1621
-msgid "backslash not last character on line"
-msgstr "Backslash ist nicht letztes Zeichen auf der Zeile."
-
-#: awkgram.y:1662
-msgid "POSIX does not allow operator `**='"
-msgstr "POSIX erlaubt den Operator '**=' nicht."
-
-#: awkgram.y:1664
-msgid "old awk does not support operator `**='"
-msgstr "Das alte awk erlaubt den Operator '**=' nicht."
-
-#: awkgram.y:1673
-msgid "POSIX does not allow operator `**'"
-msgstr "POSIX erlaubt den Operator '**' nicht."
-
-#: awkgram.y:1675
-msgid "old awk does not support operator `**'"
-msgstr "Das alte awk erlaubt den Operator '**' nicht."
-
-#: awkgram.y:1708
-msgid "operator `^=' is not supported in old awk"
-msgstr "Das alte awk kennt den Operator '^=' nicht."
-
-#: awkgram.y:1716
-msgid "operator `^' is not supported in old awk"
-msgstr "Das alte awk kennt den Operator '^' nicht."
-
-#: awkgram.y:1798 awkgram.y:1815
-msgid "unterminated string"
-msgstr "Nicht-beendeter String"
-
-#: awkgram.y:1972
-#, c-format
-msgid "invalid char '%c' in expression"
-msgstr "Ungültiges Zeichen '%c' in einem Ausdruck."
-
-#: awkgram.y:2032
-#, c-format
-msgid "`%s' is a gawk extension"
-msgstr "'%s' ist eine gawk-Erweiterung"
-
-#: awkgram.y:2035
-#, c-format
-msgid "`%s' is a Bell Labs extension"
-msgstr "'%s' ist eine Erweiterung der Bell Labs."
-
-#: awkgram.y:2038
-#, c-format
-msgid "POSIX does not allow `%s'"
-msgstr "POSIX gestattet '%s' nicht."
-
-#: awkgram.y:2042
-#, c-format
-msgid "`%s' is not supported in old awk"
-msgstr "Das alte awk gestattet '%s' nicht."
-
-#: awkgram.y:2070
-msgid "`goto' considered harmful!\n"
-msgstr "'goto' gilt als schlechter Stil!\n"
-
-#: awkgram.y:2134
-#, c-format
-msgid "%d is invalid as number of arguments for %s"
-msgstr "Unzulässige Argumentzahl %d für %s."
-
-#: awkgram.y:2153 awkgram.y:2156
-msgid "match: third argument is a gawk extension"
-msgstr "match: Das dritte Argument ist eine gawk-Erweiterung."
-
-#: awkgram.y:2172
-#, c-format
-msgid "%s: string literal as last arg of substitute has no effect"
-msgstr "%s: Ein String als letztes Argument von substitute hat keinen Effekt."
-
-#: awkgram.y:2176
-msgid "sub third parameter is not a changeable object"
-msgstr "Der dritte Parameter von sub ist ein unveränderliches Objekt."
-
-#: awkgram.y:2178
-msgid "gsub third parameter is not a changeable object"
-msgstr "Der dritte Parameter von gsub ist ein unveränderliches Objekt."
-
-#: awkgram.y:2204 awkgram.y:2207
-msgid "close: second argument is a gawk extension"
-msgstr "close: Das zweite Argument ist eine gawk-Erweiterung."
-
-#: awkgram.y:2217
-msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
-msgstr ""
-"Fehlerhafte Verwendung von dcgettext(_\"...\"): \n"
-"Entfernen Sie den führenden Unterstrich."
-
-#: awkgram.y:2232
-#, fuzzy
-msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
-msgstr ""
-"Fehlerhafte Verwendung von dcgettext(_\"...\"): \n"
-"Entfernen Sie den führenden Unterstrich."
-
-#: awkgram.y:2323
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "Funktion '%s': Parameter #%d, '%s' wiederholt Parameter #%d."
-
-#: awkgram.y:2355
-#, c-format
-msgid "function `%s': parameter `%s' shadows global variable"
-msgstr "Funktion '%s': Parameter '%s' verdeckt eine globale Variable."
-
-#: awkgram.y:2464
-#, c-format
-msgid "could not open `%s' for writing (%s)"
-msgstr "Kann '%s' nicht zum Schreiben öffnen (%s)."
-
-#: awkgram.y:2495
-#, c-format
-msgid "%s: close failed (%s)"
-msgstr "%s: close gescheitert (%s)."
-
-#: awkgram.y:2605
-msgid "shadow_funcs() called twice!"
-msgstr "shadow_funcs() zweimal aufgerufen!"
-
-#: awkgram.y:2680
-#, c-format
-msgid "function `%s': can't use function name as parameter name"
-msgstr "Funktion '%s': Kann Funktionsnamen nicht als Parameternamen benutzen."
-
-#: awkgram.y:2690
-#, c-format
-msgid "function name `%s' previously defined"
-msgstr "Funktion '%s' ist bereits definiert."
-
-#: awkgram.y:2838 awkgram.y:2844
-#, c-format
-msgid "function `%s' called but never defined"
-msgstr "Aufgerufene funktion '%s' ist nirgends definiert."
-
-#: awkgram.y:2847
-#, c-format
-msgid "function `%s' defined but never called"
-msgstr "Funktion '%s' wird nirgends aufgerufen."
-
-#: awkgram.y:2874
-#, c-format
-msgid "regexp constant for parameter #%d yields boolean value"
-msgstr ""
-"Konstanter Regulärer Ausdruck für Parameter #%d ergibt einen logischen Wert."
-
-#: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649
-#: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078
-#: dfa.c:1081 dfa.c:1094 dfa.c:1095
-msgid "Unbalanced ["
-msgstr "[ wird nicht geschlossen."
-
-#: dfa.c:783
-msgid "Unfinished \\ escape"
-msgstr "Nicht-beendetes \\\\-Escape."
-
-#: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955
-msgid "unfinished repeat count"
-msgstr "Nicht-beendeter Wiederholungszähler."
-
-#: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958
-msgid "malformed repeat count"
-msgstr "Fehlerhafter Wiederholungszähler."
-
-#: dfa.c:1285
-msgid "Unbalanced ("
-msgstr "( wird nicht geschlossen."
-
-#: dfa.c:1407
-msgid "No regexp syntax bits specified"
-msgstr "Kein Regulärer Ausdruck angegeben."
-
-#: dfa.c:1415
-msgid "Unbalanced )"
-msgstr ") wird nicht geöffnet."
-
-#: dfa.c:3014
-msgid "out of memory"
-msgstr "Kein Speicher mehr."
-
-#: field.c:849
-msgid "split: second argument is not an array"
-msgstr "split: Zweites Argument ist kein Array."
-
-#: field.c:876
-msgid "split: null string for third arg is a gawk extension"
-msgstr "split: Null-String als drittes Argument ist eine gawk-Erweiterung."
-
-#: field.c:916
-msgid "`FIELDWIDTHS' is a gawk extension"
-msgstr "'FIELDWIDTHS' ist eine gawk-Erweiterung."
-
-#: field.c:943
-#, c-format
-msgid "field %d in FIELDWIDTHS, must be > 0"
-msgstr "Feld %d in FIELDWIDTHS muss > 0 sein."
-
-#: field.c:997
-msgid "null string for `FS' is a gawk extension"
-msgstr "Null-String für 'FS' ist eine gawk-Erweiterung."
-
-#: msg.c:57
-msgid "cmd. line:"
-msgstr "Kommandozeile:"
-
-#: msg.c:123
-msgid "warning: "
-msgstr "Warnung: "
-
-#: msg.c:145
-msgid "error: "
-msgstr "Fehler: "
-
-#: msg.c:178
-msgid "fatal: "
-msgstr "Fatal: "
-
-#: eval.c:259
-#, c-format
-msgid "unknown nodetype %d"
-msgstr "Unbekannter Knotentyp %d"
-
-#: eval.c:307
-msgid "buffer overflow in genflags2str"
-msgstr "Pufferüberlauf in genflags2str."
-
-#: eval.c:541
-#, c-format
-msgid "for loop: array `%s' changed size from %d to %d during loop execution"
-msgstr ""
-"for-Schleife: Array '%s' ändert Größse von %d zu %d innerhalb der Schleife."
-
-#: eval.c:565
-msgid "`break' outside a loop is not portable"
-msgstr "'break' außerhalb einer Schleife ist nicht portabel."
-
-#: eval.c:569
-msgid "`break' outside a loop is not allowed"
-msgstr "'break' außerhalb einer Schleife ist nicht zulässig."
-
-#: eval.c:588
-msgid "`continue' outside a loop is not portable"
-msgstr "'continue' außerhalb einer Schleife ist nicht portabel."
-
-#: eval.c:592
-msgid "`continue' outside a loop is not allowed"
-msgstr "'continue' außerhalb einer Schleife ist nicht zulässig."
-
-#: eval.c:622
-msgid "`next' cannot be called from a BEGIN rule"
-msgstr "'next' kann nicht in einer BEGIN-Regel benutzt werden."
-
-#: eval.c:624
-msgid "`next' cannot be called from an END rule"
-msgstr "'next' kann nicht in einer END-Regel benutzt werden."
-
-#: eval.c:636
-msgid "`nextfile' cannot be called from a BEGIN rule"
-msgstr "'nextfile' kann nicht in einer BEGIN-Regel benutzt werden."
-
-#: eval.c:638
-msgid "`nextfile' cannot be called from an END rule"
-msgstr "'nextfile' kann nicht in einer END-Regel benutzt werden."
-
-#: eval.c:679
-msgid "statement has no effect"
-msgstr "Anweisung hat keinen Effekt."
-
-#: eval.c:713 eval.c:743 eval.c:1622
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "Referenz auf die nicht-initialisierte Variable '%s'."
-
-#: eval.c:721 eval.c:1608
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "Kann Funktion '%s' nicht als Variable oder Array verwenden."
-
-#: eval.c:728 eval.c:734 eval.c:1747
-#, c-format
-msgid "reference to uninitialized argument `%s'"
-msgstr "Referenz auf nicht-initialisiertes Argument '%s'."
-
-#: eval.c:823
-msgid "assignment used in conditional context"
-msgstr "Zuweisung in einer Bedingung."
-
-#: eval.c:914
-msgid ""
-"concatenation: side effects in one expression have changed the length of "
-"another!"
-msgstr ""
-"Konkatenierung: Seiteneffekte in einem Ausdruck haben die Länge des anderen\n"
-"geändert!"
-
-#: eval.c:1013
-msgid "division by zero attempted"
-msgstr "Division durch Null versucht."
-
-#: eval.c:1028
-#, c-format
-msgid "division by zero attempted in `%%'"
-msgstr "Division durch Null versucht in '%%'."
-
-#: eval.c:1236
-msgid "division by zero attempted in `/='"
-msgstr "Division durch Null versucht in '/='."
-
-#: eval.c:1254
-#, c-format
-msgid "division by zero attempted in `%%='"
-msgstr "Division durch Null versucht in '%%='."
-
-#: eval.c:1424
-#, c-format
-msgid "%s (from %s)"
-msgstr "%s (von %s)"
-
-#: eval.c:1472
-#, c-format
-msgid "function `%s' called with more arguments than declared"
-msgstr "Funktion '%s' mit zu vielen Argumenten aufgerufen."
-
-#: eval.c:1519
-#, c-format
-msgid "function `%s' not defined"
-msgstr "Funktion '%s' ist nicht definiert."
-
-#: eval.c:1521
-#, c-format
-msgid "function %s called\n"
-msgstr "Funktion %s aufgerufen\n"
-
-#: eval.c:1580
-msgid ""
-"\n"
-"\t# Function Call Stack:\n"
-"\n"
-msgstr ""
-"\n"
-"\t# Funktion Aufruf-Stack\n"
-"\n"
-
-#: eval.c:1583
-msgid "\t# -- main --\n"
-msgstr "\t# -- main --\n"
-
-#: eval.c:1759
-msgid "attempt to field reference from non-numeric value"
-msgstr "Nicht-numerischer Wert für Feldreferenz verwendet."
-
-#: eval.c:1761
-msgid "attempt to reference from null string"
-msgstr "Referenz von einem Null-String"
-
-#: eval.c:1767
-#, c-format
-msgid "attempt to access field %d"
-msgstr "Versuch des Zugriffs auf Feld %d."
-
-#: eval.c:1783
-#, c-format
-msgid "attempt to use scalar parameter `%s' as an array"
-msgstr "Versuch den skalaren Parameter '%s' als Array zu benutzen."
-
-#: eval.c:1874
-msgid "`IGNORECASE' is a gawk extension"
-msgstr "'IGNORECASE' ist eine gawk-Erweiterung"
-
-#: eval.c:1902
-msgid "`BINMODE' is a gawk extension"
-msgstr "'BINMODE' ist eine gawk-Erweiterung."
-
-#: eval.c:2014
-#, c-format
-msgid "bad `%sFMT' specification `%s'"
-msgstr "Falsche '%sFMT'-Angabe '%s'"
-
-#: eval.c:2080
-msgid "turning off `--lint' due to assignment to `LINT'"
-msgstr "'--lint' wird abgeschaltet, da 'LINT' gesetzt ist."
-
-#: eval.c:2116
-msgid "NF set to negative value"
-msgstr ""
-
-#: io.c:240
-#, c-format
-msgid "cannot open file `%s' for reading (%s)"
-msgstr "Kann Datei '%s' nicht zum Lesen öffnen (%s)."
-
-#: io.c:320
-#, c-format
-msgid "close of fd %d (`%s') failed (%s)"
-msgstr "Schließen von Dateideskriptor %d ('%s') gescheitert (%s)."
-
-#: io.c:432
-#, c-format
-msgid "invalid tree type %s in redirect()"
-msgstr "Ungültiger Tree-Typ %s in redirect()."
-
-#: io.c:438
-#, c-format
-msgid "expression in `%s' redirection only has numeric value"
-msgstr "Ausdruck in '%s' Umlenkung hat nur einen numerischen Wert."
-
-#: io.c:444
-#, c-format
-msgid "expression for `%s' redirection has null string value"
-msgstr "Ausdruck für '%s' Umlenkung ist ein leerer String."
-
-#: io.c:449
-#, c-format
-msgid "filename `%s' for `%s' redirection may be result of logical expression"
-msgstr ""
-"Dateiname '%s' für '%s' Umlenkung kann Ergebnis eines logischen Ausdrucks "
-"sein."
-
-#: io.c:471
-#, c-format
-msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
-msgstr "Unnötige Kombination von '>' und '>>' für Datei '%.*s'."
-
-#: io.c:523
-#, c-format
-msgid "can't open pipe `%s' for output (%s)"
-msgstr "Kann Pipe '%s' nicht für Ausgabe öffnen (%s)."
-
-#: io.c:532
-#, c-format
-msgid "can't open pipe `%s' for input (%s)"
-msgstr "Kann Pipe '%s' nicht für Eingabe öffnen (%s)."
-
-#: io.c:545
-#, c-format
-msgid "can't open two way socket `%s' for input/output (%s)"
-msgstr "Kann bidirektionalen Socket '%s' nicht für Ein-/Ausgabe öffnen (%s)."
-
-#: io.c:549
-#, c-format
-msgid "can't open two way pipe `%s' for input/output (%s)"
-msgstr "Kann bidirektionale Pipe '%s' nicht für Ein-/Ausgabe öffnen (%s)."
-
-#: io.c:625
-#, c-format
-msgid "can't redirect from `%s' (%s)"
-msgstr "Kann nicht von '%s' umlenken (%s)."
-
-#: io.c:628
-#, c-format
-msgid "can't redirect to `%s' (%s)"
-msgstr "Kann nicht auf '%s' umlenken (%s)."
-
-#: io.c:667
-msgid ""
-"reached system limit for open files: starting to multiplex file descriptors"
-msgstr ""
-"Systemgrenze offener Dateien erreicht; beginne mit Multiplexing von "
-"Dateideskriptoren."
-
-#: io.c:679
-#, c-format
-msgid "close of `%s' failed (%s)."
-msgstr "Schließen von '%s' gescheitert (%s)."
-
-#: io.c:686
-msgid "too many pipes or input files open"
-msgstr "Zu viele Pipes oder Eingabedateien offen."
-
-#: io.c:709
-msgid "close: second argument must be `to' or `from'"
-msgstr "close: Zweites Argument muss 'to' oder 'from' sein."
-
-#: io.c:723
-#, c-format
-msgid "close: `%.*s' is not an open file, pipe or co-process"
-msgstr "close: '%.*s' ist keine offene Datei, Pipe oder Ko-Prozess."
-
-#: io.c:727
-msgid "close of redirection that was never opened"
-msgstr "'close' für eine Umlenkung, die nie geöffnet wurde."
-
-#: io.c:754
-#, c-format
-msgid "close: redirection `%s' not opened with `|&', second argument ignored"
-msgstr ""
-"close: Umlenkung '%s' nicht mit '[&' geöffnet, zweites Argument wird "
-"ignoriert."
-
-#: io.c:811
-#, c-format
-msgid "failure status (%d) on pipe close of `%s' (%s)"
-msgstr "Fehlerstatus (%d) beim Schließen der Pipe '%s' (%s)."
-
-#: io.c:814
-#, c-format
-msgid "failure status (%d) on file close of `%s' (%s)"
-msgstr "Fehlerstatus (%d) beim Schließen de rDatei '%s' (%s)."
-
-#: io.c:833
-#, c-format
-msgid "no explicit close of socket `%s' provided"
-msgstr "Das explizite des Sockets '%s' fehlt."
-
-#: io.c:836
-#, c-format
-msgid "no explicit close of co-process `%s' provided"
-msgstr "Das explizite Schließen des Ko-Prozesses '%s' fehlt."
-
-#: io.c:839
-#, c-format
-msgid "no explicit close of pipe `%s' provided"
-msgstr "Das explizite Schließen der Pipe '%s' fehlt."
-
-#: io.c:842
-#, c-format
-msgid "no explicit close of file `%s' provided"
-msgstr "Das explizite Schließen der Datei '%s' fehlt."
-
-#: io.c:871 io.c:925
-#, c-format
-msgid "error writing standard output (%s)"
-msgstr "Fehler beim Schreiben auf stdout (%s)."
-
-#: io.c:875 io.c:929
-#, c-format
-msgid "error writing standard error (%s)"
-msgstr "Fehler beim Schreiben auf stderr (%s)."
-
-#: io.c:883
-#, c-format
-msgid "pipe flush of `%s' failed (%s)."
-msgstr "Leeren der Pipe '%s' gescheitert (%s)."
-
-#: io.c:886
-#, c-format
-msgid "co-process flush of pipe to `%s' failed (%s)."
-msgstr "Ko-Prozess: Leeren der Pipe zu '%s' gescheitert (%s)."
-
-#: io.c:889
-#, c-format
-msgid "file flush of `%s' failed (%s)."
-msgstr "Flush der Datei '%s' gescheitert (%s)."
-
-#: io.c:1048
-msgid "/inet/raw client not ready yet, sorry"
-msgstr "/inet/raw Client noch nicht fertig."
-
-#: io.c:1050 io.c:1087
-msgid "only root may use `/inet/raw'."
-msgstr "Nur root darf '/inet/raw' benutzen"
-
-#: io.c:1085
-msgid "/inet/raw server not ready yet, sorry"
-msgstr "'/inet/raw'-Server noch nicht fertig."
-
-#: io.c:1175
-#, c-format
-msgid "no (known) protocol supplied in special filename `%s'"
-msgstr "Kein bekanntes Protokoll in Dateinamen '%s' angegeben."
-
-#: io.c:1193
-#, c-format
-msgid "special file name `%s' is incomplete"
-msgstr "Dateiname '%s' ist unvollständig."
-
-#: io.c:1205
-#, c-format
-msgid "local port invalid in `%s'"
-msgstr "Lokaler Port in '%s' ist ungültig."
-
-#: io.c:1217
-msgid "must supply a remote hostname to `/inet'"
-msgstr "Sie müssen einen Rechnernamen in '/inet' angeben."
-
-#: io.c:1232
-msgid "must supply a remote port to `/inet'"
-msgstr "Sie müssen einen Port in '/inet' angeben."
-
-#: io.c:1238
-#, c-format
-msgid "remote port invalid in `%s'"
-msgstr "Port-Angabe in '%s' ist ungültig."
-
-#: io.c:1248
-msgid "TCP/IP communications are not supported"
-msgstr "TCP/IP-Verbindungen sind nicht möglich."
-
-#: io.c:1257 io.c:1438
-#, c-format
-msgid "file `%s' is a directory"
-msgstr "Datei '%s' ist ein Verzeichnis."
-
-#: io.c:1327
-#, c-format
-msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
-msgstr "Benutzen Sie 'PROCINFO[\"%s\"]' statt '%s'"
-
-#: io.c:1359
-msgid "use `PROCINFO[...]' instead of `/dev/user'"
-msgstr "Benutzen Sie 'PROCINFO[...] statt '/dev/user'."
-
-#: io.c:1424
-#, c-format
-msgid "could not open `%s', mode `%s'"
-msgstr "Konnte '%s' nicht öffnen, Mode '%s'."
-
-#: io.c:1550 io.c:1602 io.c:1732 io.c:1754
-#, c-format
-msgid "moving pipe to stdout in child failed (dup: %s)"
-msgstr "Verschieben der Pipe zu stdout in Kindprozess gescheitert (dup: %s)."
-
-#: io.c:1554 io.c:1607
-#, c-format
-msgid "moving pipe to stdin in child failed (dup: %s)"
-msgstr "Verschieben der Pipe zu stdin in Kindprozess gescheitert (dup: %s)."
-
-#: io.c:1571 io.c:1745
-msgid "restoring stdout in parent process failed\n"
-msgstr ""
-
-#: io.c:1576
-msgid "restoring stdin in parent process failed\n"
-msgstr ""
-
-#: io.c:1599 io.c:1751
-#, c-format
-msgid "close of stdout in child failed (%s)"
-msgstr "Schließen von stdout in Kindprozess gescheitert (%s)."
-
-#: io.c:1604
-#, c-format
-msgid "close of stdin in child failed (%s)"
-msgstr "Schließen von stdin im Kindprozess gescheitert (%s)."
-
-#: io.c:1610 io.c:1756 io.c:1767
-#, c-format
-msgid "close of pipe failed (%s)"
-msgstr "Schließen der Pipe gescheitert (%s)."
+#~ msgid "non-redirected `getline' undefined inside BEGIN or END action"
+#~ msgstr ""
+#~ "Nicht-umgelenktes 'getline' ist innerhalb der BEGIN- und END-Aktion nicht "
+#~ "definiert."
-#: io.c:1655
-msgid "`|&' not supported"
-msgstr "'|&' nicht möglich."
+#~ msgid "fptr %x not in tokentab\n"
+#~ msgstr "fptr %x nicht in tokentab\n"
-#: io.c:1722
-#, c-format
-msgid "cannot open pipe `%s' (%s)"
-msgstr "Kann Pipe '%s' nicht öffnen (%s)."
+#~ msgid "Unbalanced ["
+#~ msgstr "[ wird nicht geschlossen."
-#: io.c:1763
-#, c-format
-msgid "cannot create child process for `%s' (fork: %s)"
-msgstr "Kann Kindprozess für '%s' nicht erzeugen (fork: %s)."
+#~ msgid "Unfinished \\ escape"
+#~ msgstr "Nicht-beendetes \\\\-Escape."
-#: io.c:2104
-#, c-format
-msgid "data file `%s' is empty"
-msgstr "Datei '%s' ist leer."
+#~ msgid "unfinished repeat count"
+#~ msgstr "Nicht-beendeter Wiederholungszähler."
-#: io.c:2175
-#, c-format
-msgid "internal error: file `%s', line %d\n"
-msgstr "Interner Fehler: Datei '%s', Zeile %d\n"
+#~ msgid "malformed repeat count"
+#~ msgstr "Fehlerhafter Wiederholungszähler."
-#: io.c:2277
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "Fehler beim Lesen der Eingabedatei '%s': %s."
+#~ msgid "Unbalanced ("
+#~ msgstr "( wird nicht geschlossen."
-#: io.c:2521
-msgid "multicharacter value of `RS' is a gawk extension"
-msgstr "Multicharacter-Wert von 'RS' ist eine gawk-Erweiterung."
+#~ msgid "No regexp syntax bits specified"
+#~ msgstr "Kein Regulärer Ausdruck angegeben."
-#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
-msgid "can't convert string to float"
-msgstr "Kann String nicht in Gleitkommazahl konvertieren."
+#~ msgid "Unbalanced )"
+#~ msgstr ") wird nicht geöffnet."
-#: node.c:342
-msgid "backslash at end of string"
-msgstr "Backslash am String-Ende."
+#~ msgid "out of memory"
+#~ msgstr "Kein Speicher mehr."
-#: node.c:524
-msgid "POSIX does not allow `\\x' escapes"
-msgstr "POSIX erlabut keine '\\x'-Escapes."
-
-#: node.c:530
-msgid "no hex digits in `\\x' escape sequence"
-msgstr "Keine Hex-Ziffern in '\\x'-Escape."
-
-#: node.c:564
-#, c-format
-msgid "escape sequence `\\%c' treated as plain `%c'"
-msgstr "Escape-Sequenz '\\%c' als '%c' behandelt."
-
-#: re.c:208
-#, c-format
-msgid "regex match failed, not enough memory to match string \"%.*s%s\""
-msgstr ""
-
-#: posix/gawkmisc.c:122
-#, fuzzy, c-format
-msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
-msgstr "%s %s '%s': Konnte close-on-exec nicht setzen: %s"
+#~ msgid "invalid syntax in name `%s' for variable assignment"
+#~ msgstr "Ungültige Syntax im Namen '%s' für Variablenzuweisung."
#~ msgid ""
#~ "\n"
diff --git a/po/en@boldquot.header b/po/en@boldquot.header
deleted file mode 100644
index fedb6a06..00000000
--- a/po/en@boldquot.header
+++ /dev/null
@@ -1,25 +0,0 @@
-# All this catalog "translates" are quotation characters.
-# The msgids must be ASCII and therefore cannot contain real quotation
-# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
-# and double quote (0x22). These substitutes look strange; see
-# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
-#
-# This catalog translates grave accent (0x60) and apostrophe (0x27) to
-# left single quotation mark (U+2018) and right single quotation mark (U+2019).
-# It also translates pairs of apostrophe (0x27) to
-# left single quotation mark (U+2018) and right single quotation mark (U+2019)
-# and pairs of quotation mark (0x22) to
-# left double quotation mark (U+201C) and right double quotation mark (U+201D).
-#
-# When output to an UTF-8 terminal, the quotation characters appear perfectly.
-# When output to an ISO-8859-1 terminal, the single quotation marks are
-# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
-# grave/acute accent (by libiconv), and the double quotation marks are
-# transliterated to 0x22.
-# When output to an ASCII terminal, the single quotation marks are
-# transliterated to apostrophes, and the double quotation marks are
-# transliterated to 0x22.
-#
-# This catalog furthermore displays the text between the quotation marks in
-# bold face, assuming the VT100/XTerm escape sequences.
-#
diff --git a/po/en@quot.header b/po/en@quot.header
deleted file mode 100644
index a9647fc3..00000000
--- a/po/en@quot.header
+++ /dev/null
@@ -1,22 +0,0 @@
-# All this catalog "translates" are quotation characters.
-# The msgids must be ASCII and therefore cannot contain real quotation
-# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
-# and double quote (0x22). These substitutes look strange; see
-# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
-#
-# This catalog translates grave accent (0x60) and apostrophe (0x27) to
-# left single quotation mark (U+2018) and right single quotation mark (U+2019).
-# It also translates pairs of apostrophe (0x27) to
-# left single quotation mark (U+2018) and right single quotation mark (U+2019)
-# and pairs of quotation mark (0x22) to
-# left double quotation mark (U+201C) and right double quotation mark (U+201D).
-#
-# When output to an UTF-8 terminal, the quotation characters appear perfectly.
-# When output to an ISO-8859-1 terminal, the single quotation marks are
-# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
-# grave/acute accent (by libiconv), and the double quotation marks are
-# transliterated to 0x22.
-# When output to an ASCII terminal, the single quotation marks are
-# transliterated to apostrophes, and the double quotation marks are
-# transliterated to 0x22.
-#
diff --git a/po/es.gmo b/po/es.gmo
index 1f8fed83..b12766c0 100644
--- a/po/es.gmo
+++ b/po/es.gmo
Binary files differ
diff --git a/po/es.po b/po/es.po
index 3aadcc2f..2b644162 100644
--- a/po/es.po
+++ b/po/es.po
@@ -1,419 +1,904 @@
-# Mensajes en español para gawk-3.1.1a.
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-# Cristian Othón Martínez Vera <cfuga@itam.mx>, 2001, 2002.
+# Mensajes en español para gawk-3.1.1m.
+# 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.1a\n"
-"POT-Creation-Date: 2002-05-01 16:40+0300\n"
-"PO-Revision-Date: 2002-04-28 14:16-0600\n"
+"Project-Id-Version: gawk 3.1.1m\n"
+"POT-Creation-Date: 2003-03-19 14:25+0200\n"
+"PO-Revision-Date: 2003-02-27 17:38-0600\n"
"Last-Translator: Cristian Othón Martínez Vera <cfuga@itam.mx>\n"
"Language-Team: Spanish <es@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
-#: array.c:243 array.c:275 array.c:280 eval.c:483
+#: array.c:274 array.c:309 array.c:314 eval.c:494
#, c-format
msgid "attempt to use scalar `%s' as array"
msgstr "se intentó usar el dato escalar `%s' como un arreglo"
-#: array.c:304
+#: array.c:338
#, c-format
msgid "reference to uninitialized element `%s[\"%s\"]'"
msgstr "referencia al elemento sin valor inicial `%s[\"%s\"]'"
-#: array.c:310
+#: array.c:344
#, c-format
msgid "subscript of array `%s' is null string"
msgstr "el subíndice de la matriz `%s' es la cadena nula"
-#: array.c:373 array.c:456
-#, c-format
-msgid "delete: illegal use of variable `%s' as array"
-msgstr "delete: uso ilegal de la variable `%s' como una matriz"
-
-#: array.c:406
+#: array.c:412 array.c:425 array.c:466
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete: el índice `%s' no está en la matriz `%s'"
-#: array.c:571
+#: array.c:432 array.c:515
+#, c-format
+msgid "delete: illegal use of variable `%s' as array"
+msgstr "delete: uso ilegal de la variable `%s' como una matriz"
+
+#: array.c:633
#, c-format
msgid "%s: empty (null)\n"
msgstr "%s: vacío (nulo)\n"
-#: array.c:576
+#: array.c:638
#, c-format
msgid "%s: empty (zero)\n"
msgstr "%s: vacío (cero)\n"
-#: array.c:580
+#: array.c:642
#, c-format
msgid "%s: table_size = %d, array_size = %d\n"
msgstr "%s: tamaño_tabla = %d, tamaño_matriz = %d\n"
-#: array.c:612
+#: array.c:671
#, c-format
msgid "%s: is parameter\n"
msgstr "%s: es un parámetro\n"
-#: array.c:617
+#: array.c:676
#, c-format
msgid "%s: array_ref to %s\n"
msgstr "%s: array_ref a %s\n"
-#: array.c:844
+#: array.c:975
msgid "asort: first argument is not an array"
msgstr "asort: el primer argumento no es una matriz"
-#: array.c:853
+#: array.c:984
msgid "asort: second argument is not an array"
msgstr "asort: el segundo argumento no es una matriz"
-#: builtin.c:107
+#: 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
+msgid "statement may have no effect"
+msgstr "la sentencia puede no tener efecto"
+
+#: awkgram.y:431 awkgram.y:451
+#, c-format
+msgid "`%s' used in %s action"
+msgstr "se usó `%s' en la acción %s"
+
+#: awkgram.y:444 awkgram.y:447
+msgid "`nextfile' is a gawk extension"
+msgstr "`nextfile' es una extensión de gawk"
+
+#: awkgram.y:461
+msgid "`return' used outside function context"
+msgstr "se usó `return' fuera del contexto de la función"
+
+#: awkgram.y:500
+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:513 awkgram.y:520
+msgid "`delete array' is a gawk extension"
+msgstr "`delete array' es una extensión de gawk"
+
+#: awkgram.y:528 awkgram.y:535
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "`delete(array)' es una extensión de gawk que no es transportable"
+
+#: awkgram.y:578
+msgid "multistage two-way pipelines don't work"
+msgstr "las líneas de trabajo de dos vías multiestado no funcionan"
+
+#: awkgram.y:669
+msgid "regular expression on right of assignment"
+msgstr "expresión regular del lado derecho de una asignación"
+
+#: awkgram.y:679
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "expresión regular a la izquierda del operador `~' o `!~'"
+
+#: awkgram.y:687
+msgid "regular expression on right of comparison"
+msgstr "expresión regular a la derecha de una comparación"
+
+#: awkgram.y:754
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "`getline' no redirigido indefinido dentro de la acción de END"
+
+#: awkgram.y:781
+msgid "call of `length' without parentheses is not portable"
+msgstr "la llamada de `length' sin paréntesis no es transportable"
+
+#: awkgram.y:784
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "la llamada de `length' sin paréntesis está obsoleta por POSIX"
+
+#: awkgram.y:835
+msgid "invalid subscript expression"
+msgstr "expresión de subíndice inválida"
+
+#: awkgram.y:1020
+msgid "unexpected newline or end of string"
+msgstr "nueva línea o fin de la cadena inesperados"
+
+#: awkgram.y:1115
+msgid "empty program text on command line"
+msgstr "texto de programa vacío en la linea de comando"
+
+#: awkgram.y:1172
+#, 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:1207
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "no se puede leer el fichero fuente `%s' (%s)"
+
+#: awkgram.y:1215
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "el fichero fuente `%s' está vacío"
+
+#: awkgram.y:1417 awkgram.y:1527 awkgram.y:1545 awkgram.y:1895 awkgram.y:1980
+msgid "source file does not end in newline"
+msgstr "el fichero fuente no termina con línea nueva"
+
+#: awkgram.y:1481
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr "expresión regular sin terminar termina con `\\` al final del fichero"
+
+#: awkgram.y:1501
+msgid "unterminated regexp"
+msgstr "expresión regular sin terminar"
+
+#: awkgram.y:1504
+msgid "unterminated regexp at end of file"
+msgstr "expresión regular sin terminar al final del fichero"
+
+#: awkgram.y:1571
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr "el uso de la continuación de línea `\\ #...' no es transportable"
+
+#: awkgram.y:1583
+msgid "backslash not last character on line"
+msgstr "la barra invertida no es el último caracter en la línea"
+
+#: awkgram.y:1628
+msgid "POSIX does not allow operator `**='"
+msgstr "POSIX no permite el operador `**='"
+
+#: awkgram.y:1630
+msgid "old awk does not support operator `**='"
+msgstr "el awk antiguo no da soporte al operador `**='"
+
+#: awkgram.y:1639
+msgid "POSIX does not allow operator `**'"
+msgstr "POSIX no permite el operador `**'"
+
+#: awkgram.y:1641
+msgid "old awk does not support operator `**'"
+msgstr "el awk antiguo no da soporte al operador `**='"
+
+#: awkgram.y:1672
+msgid "operator `^=' is not supported in old awk"
+msgstr "el operador `^=' no tiene soporte en el awk antiguo"
+
+#: awkgram.y:1680
+msgid "operator `^' is not supported in old awk"
+msgstr "el operador `^' no tiene soporte en el awk antiguo"
+
+#: awkgram.y:1764 awkgram.y:1781
+msgid "unterminated string"
+msgstr "cadena sin terminar"
+
+#: awkgram.y:1941
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "caracter '%c' inválido en la expresión"
+
+#: awkgram.y:2001
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "`%s' es una extensión de gawk"
+
+#: awkgram.y:2004
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "`%s' es una extensión de Bell Labs"
+
+#: awkgram.y:2007
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "POSIX no permite `%s'"
+
+#: awkgram.y:2011
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "`%s' no tiene soporte en el awk antiguo"
+
+#: awkgram.y:2038
+msgid "`goto' considered harmful!\n"
+msgstr "¡`goto' se considera dañino!\n"
+
+#: awkgram.y:2102
+#, 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:2121 awkgram.y:2124
+msgid "match: third argument is a gawk extension"
+msgstr "match: el tercer argumento es una extensión de gawk"
+
+#: awkgram.y:2137
+#, 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:2140
+#, 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:2167 awkgram.y:2170
+msgid "close: second argument is a gawk extension"
+msgstr "close: el segundo argumento es una extensión de gawk"
+
+#: awkgram.y:2180
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"el uso de dcgettext(_\"...\") es incorrecto: quite el subrayado inicial"
+
+#: awkgram.y:2195
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"el uso de dcngettext(_\"...\") es incorrecto: quite el subrayado inicial"
+
+#: awkgram.y:2266
+#, 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:2299
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "función `%s': parámetro `%s' obscurece la variable global"
+
+#: awkgram.y:2411
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "no se puede abrir `%s' para escritura (%s)"
+
+#: awkgram.y:2412 profile.c:93
+msgid "sending profile to standard error"
+msgstr "enviando perfil a la salida estándar de error"
+
+#: awkgram.y:2442
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: falló close (%s)"
+
+#: awkgram.y:2566
+msgid "shadow_funcs() called twice!"
+msgstr "¡shadow_funcs() llamada dos veces!"
+
+#: awkgram.y:2593
+msgid "there were shadowed variables."
+msgstr "hay variables opacadas."
+
+#: awkgram.y:2666
+#, 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:2676
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "el nombre de función `%s' se definió previamente"
+
+#: awkgram.y:2827 awkgram.y:2833
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "se llamó a la función `%s' pero nunca se definió"
+
+#: awkgram.y:2836
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "la función `%s' está definida pero nunca se llamó"
+
+#: awkgram.y:2863
+#, 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:2876
+#, 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:2878
+msgid "or used as a variable or an array"
+msgstr "o se usó como una variable o una matriz"
+
+#: builtin.c:111
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "falló %s a \"%s\" (%s)"
-#: builtin.c:108
+#: builtin.c:112
msgid "standard output"
msgstr "salida estándar"
-#: builtin.c:109
+#: builtin.c:113
msgid "reason unknown"
msgstr "razón desconocida"
-#: builtin.c:122
+#: builtin.c:126
msgid "exp: received non-numeric argument"
-msgstr "exp: se recibió un argumento que no es un numéro"
+msgstr "exp: se recibió un argumento que no es un número"
-#: builtin.c:128
+#: builtin.c:132
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: el argumento %g está fuera de rango"
-#: builtin.c:186
+#: builtin.c:190
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: no se puede limpiar: se abrió la tubería `%s' para lectura, no para "
"escritura"
-#: builtin.c:189
+#: builtin.c:193
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush: no se puede limpiar: se abrió el fichero `%s' para lectura, no para "
"escritura"
-#: builtin.c:201
+#: builtin.c:205
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "fflush: `%s' no es un fichero abierto, tubería o co-proceso"
-#: builtin.c:295
+#: builtin.c:299
msgid "index: received non-string first argument"
msgstr "index: el primer argumento recibido no es una cadena"
-#: builtin.c:297
+#: builtin.c:301
msgid "index: received non-string second argument"
msgstr "index: el segundo argumento recibido no es una cadena"
-#: builtin.c:407
+#: builtin.c:411
msgid "int: received non-numeric argument"
-msgstr "int: se recibió un argumento que no es un numéro"
+msgstr "int: se recibió un argumento que no es un número"
-#: builtin.c:424
+#: builtin.c:428
msgid "length: received non-string argument"
msgstr "length: se recibió un argumento que no es una cadena"
-#: builtin.c:440
+#: builtin.c:444
msgid "log: received non-numeric argument"
-msgstr "log: se recibió un argumento que no es un numéro"
+msgstr "log: se recibió un argumento que no es un número"
-#: builtin.c:443
+#: builtin.c:447
#, c-format
msgid "log: received negative argument %g"
msgstr "log: se recibió el argumento negativo %g"
-#: builtin.c:605 builtin.c:608
+#: builtin.c:609 builtin.c:612
msgid "must use `count$' on all formats or none"
msgstr "se debe utilizar `count$' en todos los formatos o en ninguno"
-#: builtin.c:703
+#: builtin.c:714
msgid "`$' is not permitted in awk formats"
msgstr "no se permite `$' en los formatos de awk"
-#: builtin.c:709
+#: builtin.c:720
msgid "arg count with `$' must be > 0"
msgstr "la cuenta de argumentos con `$' debe ser > 0"
-#: builtin.c:711
+#: builtin.c:722
#, c-format
-msgid "arg count %d greater than total number of supplied arguments"
+msgid "arg count %ld greater than total number of supplied arguments"
msgstr ""
-"la cuenta de argumentos %d es mayor que el número total de argumentos "
+"la cuenta de argumentos %ld es mayor que el número total de argumentos "
"proporcionados"
-#: builtin.c:713
+#: builtin.c:724
msgid "`$' not permitted after period in format"
msgstr "no se permite `$' después de un punto en el formato"
-#: builtin.c:726
+#: builtin.c:737
msgid "no `$' supplied for positional field width or precision"
msgstr ""
"no se proporciona `$' para el ancho o la precisión del campo posicional"
-#: builtin.c:784
+#: builtin.c:795
msgid "`l' is meaningless in awk formats; ignored"
msgstr "`l' no tiene significado en los formatos de awk; ignorado"
-#: builtin.c:788
+#: builtin.c:799
msgid "`l' is not permitted in POSIX awk formats"
msgstr "no se permite `l' en los formatos POSIX de awk"
-#: builtin.c:799
+#: builtin.c:810
msgid "`L' is meaningless in awk formats; ignored"
msgstr "`L' no tiene significado en los formatos de awk; ignorado"
-#: builtin.c:803
+#: builtin.c:814
msgid "`L' is not permitted in POSIX awk formats"
msgstr "no se permite `L' en los formatos POSIX de awk"
-#: builtin.c:814
+#: builtin.c:825
msgid "`h' is meaningless in awk formats; ignored"
msgstr "`h' no tiene significado en los formatos de awk; ignorado"
-#: builtin.c:818
+#: builtin.c:829
msgid "`h' is not permitted in POSIX awk formats"
msgstr "no se permite `h' en los formatos POSIX de awk"
-#: builtin.c:1067
+#: builtin.c:1078
msgid "not enough arguments to satisfy format string"
msgstr "no hay suficientes argumentos para satisfacer a la cadena de formato"
-#: builtin.c:1069
+#: builtin.c:1080
msgid "^ ran out for this one"
msgstr "se acabó ^ para éste"
-#: builtin.c:1074
+#: builtin.c:1085
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf: el especificador de formato no tiene letras de control"
-#: builtin.c:1077
+#: builtin.c:1088
msgid "too many arguments supplied for format string"
msgstr "se proporcionaron demasiados argumentos para la cadena de formato"
-#: builtin.c:1120 builtin.c:1123
+#: builtin.c:1154 builtin.c:1157
msgid "printf: no arguments"
msgstr "printf: sin argumentos"
-#: builtin.c:1156
+#: builtin.c:1181
msgid "sqrt: received non-numeric argument"
-msgstr "sqrt: se recibió un argumento que no es un numéro"
+msgstr "sqrt: se recibió un argumento que no es un número"
-#: builtin.c:1160
+#: builtin.c:1185
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: llamado con el argumento negativo %g"
-#: builtin.c:1182
+#: builtin.c:1207
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: el índice de inicio %g es inválido, usando 1"
-#: builtin.c:1187
+#: builtin.c:1212
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "substr: el índice de inicio no entero %g será truncado"
-#: builtin.c:1201
+#: builtin.c:1231
#, c-format
msgid "substr: length %g is <= 0"
msgstr "substr: la longitud %g es <= 0"
-#: builtin.c:1207
+#: builtin.c:1233
+#, c-format
+msgid "substr: length %g is < 0"
+msgstr "substr: la longitud %g es < 0"
+
+#: builtin.c:1240
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: la longitud no entera %g será truncada"
-#: builtin.c:1214
+#: builtin.c:1245
+#, 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:1257
msgid "substr: source string is zero length"
msgstr "substr: la cadena de origen es de longitud cero"
-#: builtin.c:1221
+#: builtin.c:1263
#, c-format
-msgid ""
-"substr: length %d at start index %d exceeds length of first argument (%d)"
-msgstr ""
-"substr: la cadena %d en el índice de inicio %d excede la longitud del primer "
-"argumento (%d)"
+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:1227
+#: builtin.c:1271
#, c-format
-msgid "substr: start index %d is past end of string"
-msgstr "substr: el índice de inicio %d está después del fin de la cadena"
+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:1263
+#: builtin.c:1306
msgid "strftime: received non-string first argument"
msgstr "strftime: el primer argumento que se recibió no es una cadena"
-#: builtin.c:1269
+#: builtin.c:1312
msgid "strftime: received empty format string"
msgstr "strftime: se recibió una cadena de formato vacía"
-#: builtin.c:1278
+#: builtin.c:1321
msgid "strftime: received non-numeric second argument"
-msgstr "strftime: el segundo argumento que se recibió no es un numéro"
+msgstr "strftime: el segundo argumento que se recibió no es un número"
-#: builtin.c:1341
+#: builtin.c:1384
msgid "mktime: received non-string argument"
msgstr "mktime: se recibió un argumento que no es una cadena"
-#: builtin.c:1386
+#: builtin.c:1429
msgid "system: received non-string argument"
msgstr "system: se recibió un argumento que no es una cadena"
-#: builtin.c:1512
+#: builtin.c:1573
msgid "tolower: received non-string argument"
msgstr "tolower: se recibió un argumento que no es una cadena"
-#: builtin.c:1561
+#: builtin.c:1622
msgid "toupper: received non-string argument"
msgstr "toupper: se recibió un argumento que no es una cadena"
-#: builtin.c:1606
+#: builtin.c:1667
msgid "atan2: received non-numeric first argument"
-msgstr "atan2: el primer argumento recibido no es un numéro"
+msgstr "atan2: el primer argumento recibido no es un número"
-#: builtin.c:1608
+#: builtin.c:1669
msgid "atan2: received non-numeric second argument"
-msgstr "atan2: el segundo argumento recibido no es un numéro"
+msgstr "atan2: el segundo argumento recibido no es un número"
-#: builtin.c:1627
+#: builtin.c:1688
msgid "sin: received non-numeric argument"
-msgstr "sin: se recibió un argumento que no es un numéro"
+msgstr "sin: se recibió un argumento que no es un número"
-#: builtin.c:1643
+#: builtin.c:1704
msgid "cos: received non-numeric argument"
-msgstr "cos: se recibió un argumento que no es un numéro"
+msgstr "cos: se recibió un argumento que no es un número"
-#: builtin.c:1687
+#: builtin.c:1748
msgid "srand: received non-numeric argument"
-msgstr "srand: se recibió un argumento que no es un numéro"
+msgstr "srand: se recibió un argumento que no es un número"
-#: builtin.c:1721
+#: builtin.c:1787
msgid "match: third argument is not an array"
msgstr "match: el tercer argumento no es una matriz"
-#: builtin.c:2157
+#: builtin.c:2264
msgid "gensub: 3rd argument of 0 treated as 1"
-msgstr "gensub: el tercer argumento en 0 es tratado como 1"
+msgstr "gensub: el tercer argumento de 0 se trata como 1"
-#: builtin.c:2268 builtin.c:2270
+#: builtin.c:2375 builtin.c:2377
msgid "lshift: received non-numeric first argument"
-msgstr "lshift: el primer argumento recibido no es un numéro"
+msgstr "lshift: el primer argumento recibido no es un número"
-#: builtin.c:2272
+#: builtin.c:2379
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr "lshift(%lf, %lf): los valores negativos darán resultados extraños"
-#: builtin.c:2274
+#: builtin.c:2381
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf): los valores fraccionarios serán truncados"
-#: builtin.c:2276
+#: builtin.c:2383
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
"lshift(%lf, %lf): un valor de desplazamiento muy grande dará resultados "
"extraños"
-#: builtin.c:2305 builtin.c:2307
+#: builtin.c:2412 builtin.c:2414
msgid "rshift: received non-numeric first argument"
-msgstr "rshift: el primer argumento recibido no es un numéro"
+msgstr "rshift: el primer argumento recibido no es un número"
-#: builtin.c:2309
+#: builtin.c:2416
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr "rshift(%lf, %lf): los valores negativos darán resultados extraños"
-#: builtin.c:2311
+#: builtin.c:2418
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf): los valores fraccionarios serán truncados"
-#: builtin.c:2313
+#: builtin.c:2420
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
"rshift(%lf, %lf): un valor de desplazamiento muy grande dará resultados "
"extraños"
-#: builtin.c:2342 builtin.c:2344
+#: builtin.c:2449 builtin.c:2451
msgid "and: received non-numeric first argument"
msgstr "and: el primer argumento recibido no es un número"
-#: builtin.c:2346
+#: builtin.c:2453
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr "and(%lf, %lf): los valores negativos darán resultados extraños"
-#: builtin.c:2348
+#: builtin.c:2455
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): los valores fraccionarios serán truncados"
-#: builtin.c:2377 builtin.c:2379
+#: builtin.c:2484 builtin.c:2486
msgid "or: received non-numeric first argument"
msgstr "or: el primer argumento recibido no es un número"
-#: builtin.c:2381
+#: builtin.c:2488
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr "or(%lf, %lf): los valores negativos darán resultados extraños"
-#: builtin.c:2383
+#: builtin.c:2490
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf): los valores fraccionarios serán truncados"
-#: builtin.c:2412 builtin.c:2414
+#: builtin.c:2519 builtin.c:2521
msgid "xor: received non-numeric first argument"
msgstr "xor: el primer argumento recibido no es un número"
-#: builtin.c:2416
+#: builtin.c:2523
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr "xor(%lf, %lf): los valores negativos darán resultados extraños"
-#: builtin.c:2418
+#: builtin.c:2525
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf): los valores fraccionarios serán truncados"
-#: builtin.c:2446
+#: builtin.c:2553
msgid "compl: received non-numeric argument"
msgstr "compl: se recibió un argumento que no es un número"
-#: builtin.c:2448
+#: builtin.c:2555
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf): el valor negativo dará resultados extraños"
-#: builtin.c:2450
+#: builtin.c:2557
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf): el valor fraccionario será truncado"
-#: builtin.c:2621
+#: builtin.c:2728
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: `%s' no es una categoría local válida"
+#: eval.c:262
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "tipo de nodo %d desconocido"
+
+#: eval.c:310
+msgid "buffer overflow in genflags2str"
+msgstr "desbordamiento de almacenamiento temporal en genflags2str"
+
+#: eval.c:555
+#, 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:576
+msgid "`break' outside a loop is not portable"
+msgstr "`break' fuera de un ciclo no es transportable"
+
+#: eval.c:580
+msgid "`break' outside a loop is not allowed"
+msgstr "no se permite `break' fuera de un ciclo"
+
+#: eval.c:597
+msgid "`continue' outside a loop is not portable"
+msgstr "`continue' fuera de un ciclo no es transportable"
+
+#: eval.c:601
+msgid "`continue' outside a loop is not allowed"
+msgstr "no se permite `continue' fuera de un ciclo"
+
+#: eval.c:635
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "`next' no se puede llamar desde una regla BEGIN"
+
+#: eval.c:637
+msgid "`next' cannot be called from an END rule"
+msgstr "`next' no se puede llamar desde una regla END"
+
+#: eval.c:646
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "`nextfile' no se puede llamar desde una regla BEGIN"
+
+#: eval.c:648
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "`nextfile' no se puede llamar desde una regla END"
+
+#: eval.c:696
+msgid "statement has no effect"
+msgstr "la sentencia no tiene efecto"
+
+#: eval.c:731 eval.c:761 eval.c:1733
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "referencia a la variable sin iniciar `%s'"
+
+#: eval.c:739 eval.c:1721
+#, 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:746 eval.c:752
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "referencia al argumento sin iniciar `%s'"
+
+#: eval.c:810 eval.c:1728 profile.c:773
+#, 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:910
+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:935
+msgid "assignment used in conditional context"
+msgstr "se usó una asignación en un contexto condicional"
+
+#: eval.c:1026
+msgid "division by zero attempted"
+msgstr "se intentó una división por cero"
+
+#: eval.c:1041
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "se intentó una división por cero en `%%'"
+
+#: eval.c:1056 profile.c:649
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "tipo ilegal (%s) en tree_eval"
+
+#: eval.c:1232
+msgid "division by zero attempted in `/='"
+msgstr "se intentó una división por cero en `/='"
+
+#: eval.c:1250
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "se intentó una división por cero en `%%='"
+
+#: eval.c:1510
+#, c-format
+msgid "%s (from %s)"
+msgstr "%s (de %s)"
+
+#: eval.c:1569
+#, 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:1628
+#, c-format
+msgid "function `%s' not defined"
+msgstr "la función `%s' no está definida"
+
+#: eval.c:1634
+#, c-format
+msgid "function %s called\n"
+msgstr "se llamó a la función %s\n"
+
+#: eval.c:1693
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# Pila de Llamadas de Funciones:\n"
+"\n"
+
+#: eval.c:1696
+msgid "\t# -- main --\n"
+msgstr "\t# -- principal --\n"
+
+#: eval.c:1850
+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:1852
+msgid "attempt to reference from null string"
+msgstr "se intentó una referencia desde una cadena nula"
+
+#: eval.c:1858
+#, c-format
+msgid "attempt to access field %d"
+msgstr "se intentó accesar al campo %d"
+
+#: eval.c:1874
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr "se intentó usar el parámetro escalar `%s como una matriz'"
+
+#: eval.c:1886 eval.c:1893 profile.c:865
+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:1941
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "`IGNORECASE' es una extensión de gawk"
+
+#: eval.c:1970
+msgid "`BINMODE' is a gawk extension"
+msgstr "`BINMODE' es una extensión de gawk"
+
+#: eval.c:2082
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "especificación `%sFMT' `%s' errónea"
+
+#: eval.c:2160
+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"
@@ -429,10 +914,36 @@ msgid "extension: library `%s': cannot call function `%s' (%s)\n"
msgstr ""
"extension: biblioteca `%s': no se puede llamar a la función `%s' (%s)\n"
-#: ext.c:180
+#: ext.c:181
msgid "Operation Not Supported"
msgstr "No Se Da Soporte A La Operación"
+#: field.c:321
+msgid "NF set to negative value"
+msgstr "NF con un valor negativo"
+
+#: field.c:819
+msgid "split: second argument is not an array"
+msgstr "split: el segundo argumento no es una matriz"
+
+#: field.c:854
+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:906
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "`FIELDWIDTHS' es una extensión gawk"
+
+#: field.c:933
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "el campo %d en FIELDWIDTHS, debe ser > 0"
+
+#: field.c:1006
+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"
@@ -473,7 +984,7 @@ msgstr "%s: opción ilegal -- %c\n"
msgid "%s: invalid option -- %c\n"
msgstr "%s: opción inválida -- %c\n"
-#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412
+#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:431
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: la opción requiere un argumento -- %c\n"
@@ -488,170 +999,484 @@ msgstr "%s: la opción `-W %s' es ambigua\n"
msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "%s: la opción `-W %s' no admite ningún argumento\n"
-#: main.c:307
+#: io.c:257
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "no se puede abrir el fichero `%s' para lectura (%s)"
+
+#: io.c:344
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "falló al cerrar el df %d (`%s') (%s)"
+
+#: io.c:482
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "tipo de árbol %s inválido en redirect()"
+
+#: io.c:488
+#, 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:494
+#, 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:499
+#, 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:521
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "mezcla innecesaria de `>' y `>>' para el fichero `%.*s'"
+
+#: io.c:573
+#, 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:582
+#, 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:595
+#, 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:599
+#, 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:675
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "no se puede redirigir desde `%s' (%s)"
+
+#: io.c:678
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "no se puede redirigir a `%s' (%s)"
+
+#: io.c:717
+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:729
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "falló al cerrar `%s' (%s)."
+
+#: io.c:736
+msgid "too many pipes or input files open"
+msgstr "demasiadas tuberías o ficheros de entrada abiertos"
+
+#: io.c:759
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: el segundo argumento debe ser `to' o `from'"
+
+#: io.c:773
+#, 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:777
+msgid "close of redirection that was never opened"
+msgstr "cerrado de una redirección que nunca fue abierta"
+
+#: io.c:804
+#, 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:866
+#, 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:869
+#, 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:888
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "no se provee el cerrado explícito del `socket' `%s'"
+
+#: io.c:891
+#, 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:894
+#, 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:897
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "no se provee el cerrado explícito del fichero `%s'"
+
+#: io.c:926 io.c:980
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "error al escribir en la salida estándar (%s)"
+
+#: io.c:930 io.c:984
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "error al escribir en la salida estándar de error (%s)"
+
+#: io.c:938
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "falló la limpieza de la tubería de `%s' (%s)."
+
+#: io.c:941
+#, 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:944
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "falló la limpieza del fichero de `%s' (%s)."
+
+#: io.c:1103
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "el cliente /inet/raw no está listo aún, perdón"
+
+#: io.c:1105 io.c:1142
+msgid "only root may use `/inet/raw'."
+msgstr "sólo root puede utilizar `/inet/raw'."
+
+#: io.c:1140
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "el servidor /inet/raw no está listo aún, perdón"
+
+#: io.c:1230
+#, 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:1248
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "el nombre de fichero especial `%s' está incompleto"
+
+#: io.c:1260
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "puerto local inválido en `%s'"
+
+#: io.c:1272
+msgid "must supply a remote hostname to `/inet'"
+msgstr "se debe proporcionar a `/inet' un nombre de anfitrión remoto"
+
+#: io.c:1287
+msgid "must supply a remote port to `/inet'"
+msgstr "se debe proporcionar a `/inet' un puerto remoto"
+
+#: io.c:1293
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "puerto remoto inválido en `%s'"
+
+#: io.c:1303
+msgid "TCP/IP communications are not supported"
+msgstr "No tienen soporte las comunicaciones TCP/IP"
+
+#: io.c:1312 io.c:1492
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "el fichero `%s' es un directorio"
+
+#: io.c:1381
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "use `PROCINFO[\"%s\"]' en lugar de `%s'"
+
+#: io.c:1413
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "use `PROCINFO[...]' en lugar de `/dev/user'"
+
+#: io.c:1478 io.c:1652
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "no se puede abrir `%s', modo `%s'"
+
+#: io.c:1703
+#, c-format
+msgid "close of master pty failed (%s)"
+msgstr "falló al cerrar el pty maestro (%s)"
+
+#: io.c:1705 io.c:1857 io.c:2009
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "falló al cerrar la salida estándar en el hijo (%s)"
+
+#: io.c:1708
+#, 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:1710 io.c:1862
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "falló al cerrar la entrada estándar en el hijo (%s)"
+
+#: io.c:1713
+#, 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:1715 io.c:1734
+#, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "falló al cerrar el pty esclavo (%s)"
+
+#: io.c:1808 io.c:1860 io.c:1990 io.c:2012
+#, 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:1812 io.c:1865
+#, 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:1829 io.c:2003
+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:1834
+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:1868 io.c:2014 io.c:2025
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "falló al cerrar la tubería (%s)"
+
+#: io.c:1913
+msgid "`|&' not supported"
+msgstr "`|&' no tiene soporte"
+
+#: io.c:1980
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "no se puede abrir la tubería `%s' (%s)"
+
+#: io.c:2021
+#, 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:2364
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "el fichero de datos `%s' está vacío"
+
+#: io.c:2407 io.c:2415
+msgid "could not allocate more input memory"
+msgstr "no se puede reservar más memoria de entrada"
+
+#: io.c:2540 io.c:2782 io.c:3046
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "error al leer el fichero de entrada `%s': %s"
+
+#: io.c:3281
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "el valor multicaracter de `RS' es una extensión de gawk"
+
+#: main.c:322
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "la opción -m[fr] es irrelevante en gawk"
-#: main.c:309
+#: main.c:324
msgid "-m option usage: `-m[fr] nnn'"
msgstr "uso de la opción -m: `-m[fr]' nnn"
-#: main.c:326
+#: main.c:341
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
-msgstr "%s: no se reconoce la opción `-W %s', ignorada\n"
+msgstr "%s: no se reconoce la opción `-W %s', se ignora\n"
-#: main.c:357
+#: main.c:378
msgid "empty argument to `--source' ignored"
msgstr "se ignora el argumento vacío para `--source'"
-#: main.c:429
+#: main.c:448
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr ""
"la variable de ambiente `POSIXLY_CORRECT' está establecida: activando `--"
"posix'"
-#: main.c:434
+#: main.c:453
msgid "`--posix' overrides `--traditional'"
msgstr "`--posix' se impone a `--traditional'"
-#: main.c:445
+#: main.c:464
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr "`--posix'/`--traditional' se imponen a `--non-decimal-data'"
-#: main.c:449
+#: main.c:468
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr "ejecutar %s como setuid root puede ser un problema de seguridad"
-#: main.c:478
+#: main.c:509
#, c-format
-msgid "can't set mode on stdin (%s)"
-msgstr "no se puede establecer el modo en la entrada estándar (%s)"
+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:481
+#: main.c:512
#, c-format
-msgid "can't set mode on stdout (%s)"
-msgstr "no se puede establecer el modo en la salida estándar (%s)"
+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:483
+#: main.c:514
#, c-format
-msgid "can't set mode on stderr (%s)"
-msgstr "no se puede establecer el modo en la salida estándar de error (%s)"
+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:512
+#: main.c:544
msgid "no program text at all!"
msgstr "¡No hay ningún programa de texto!"
-#: main.c:556
+#: main.c:612
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr ""
"Modo de empleo: %s [opciones estilo POSIX o GNU] -f fichprog [--] "
"fichero ...\n"
-#: main.c:558
+#: main.c:614
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr ""
"Modo de empleo: %s [opciones estilo POSIX o GNU] [--] %cprograma%c "
"fichero ...\n"
-#: main.c:563
+#: main.c:619
msgid "POSIX options:\t\tGNU long options:\n"
msgstr "Opciones POSIX:\t\tOpciones largas GNU:\n"
-#: main.c:564
+#: main.c:620
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f fichprog\t\t--file=fichprog\n"
-#: main.c:565
+#: main.c:621
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F sc\t\t\t--field-separator=sc\n"
-#: main.c:566
+#: main.c:622
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "\t-v var=valor\t\t--assign=var=valor\n"
-#: main.c:567
+#: main.c:623
msgid "\t-m[fr] val\n"
msgstr "\t-m[fr] valor\n"
-#: main.c:568
+#: main.c:624
msgid "\t-W compat\t\t--compat\n"
msgstr "\t-W compat\t\t--compat\n"
-#: main.c:569
+#: main.c:625
msgid "\t-W copyleft\t\t--copyleft\n"
msgstr "\t-W copyleft\t\t--copyleft\n"
-#: main.c:570
+#: main.c:626
msgid "\t-W copyright\t\t--copyright\n"
msgstr "\t-W copyright\t\t--copyright\n"
-#: main.c:571
+#: main.c:627
msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
msgstr "\t-W dump-variables[=fichero]\t--dump-variables[=fichero]\n"
-#: main.c:572
+#: main.c:628
msgid "\t-W gen-po\t\t--gen-po\n"
msgstr "\t-W gen-po\t\t--gen-po\n"
-#: main.c:573
+#: main.c:629
msgid "\t-W help\t\t\t--help\n"
msgstr "\t-W help\t\t\t--help\n"
-#: main.c:574
+#: main.c:630
msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
-#: main.c:575
+#: main.c:631
msgid "\t-W lint-old\t\t--lint-old\n"
msgstr "\t-W lint-old\t\t--lint-old\n"
-#: main.c:576
+#: main.c:632
msgid "\t-W non-decimal-data\t--non-decimal-data\n"
msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
-#: main.c:578
+#: main.c:634
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:581
+#: main.c:637
msgid "\t-W parsedebug\t\t--parsedebug\n"
msgstr "\t-W parsedebug\t\t--parsedebug\n"
-#: main.c:583
+#: main.c:639
msgid "\t-W profile[=file]\t--profile[=file]\n"
msgstr "\t-W profile[=fichero]\t--profile[=fichero]\n"
-#: main.c:584
+#: main.c:640
msgid "\t-W posix\t\t--posix\n"
msgstr "\t-W posix\t\t--posix\n"
-#: main.c:585
+#: main.c:641
msgid "\t-W re-interval\t\t--re-interval\n"
msgstr "\t-W re-interval\t\t--re-interval\n"
# Esta es la línea más larga de la lista de argumentos.
# Probar con gawk para revisar tabuladores. cfuga
-#: main.c:586
+#: main.c:642
msgid "\t-W source=program-text\t--source=program-text\n"
msgstr "\t-W source=texto-prog\t--source=texto-prog\n"
-#: main.c:587
+#: main.c:643
msgid "\t-W traditional\t\t--traditional\n"
msgstr "\t-W traditional\t\t--traditional\n"
-#: main.c:588
+#: main.c:644
msgid "\t-W usage\t\t--usage\n"
msgstr "\t-W usage\t\t--usage\n"
-#: main.c:589
+#: main.c:645
msgid "\t-W version\t\t--version\n"
msgstr "\t-W version\t\t--version\n"
-#: main.c:593
+#: main.c:649
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -664,7 +1489,7 @@ msgstr ""
"impresa.\n"
"\n"
-#: main.c:597
+#: main.c:653
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -674,7 +1499,7 @@ msgstr ""
"Por omisión lee la entrada estándar y escribe en la salida estándar.\n"
"\n"
-#: main.c:601
+#: main.c:657
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -684,7 +1509,7 @@ msgstr ""
"\tgawk '{ sum += $1 }; END { print sum }' fichero\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:613
+#: main.c:669
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -704,7 +1529,7 @@ msgstr ""
"(a su elección) cualquier versión posterior.\n"
"\n"
-#: main.c:621
+#: main.c:677
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"
@@ -718,7 +1543,7 @@ msgstr ""
"Licencia Pública General de GNU para más detalles.\n"
"\n"
-#: main.c:627
+#: main.c:683
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"
@@ -728,98 +1553,117 @@ msgstr ""
"junto con este programa; si no es así, escriba a la Free Software\n"
"Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"
-#: main.c:657
+#: main.c:713
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "-Ft no establece FS a tabulador en el awk de POSIX"
-#: main.c:888
+#: main.c:944
+#, 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:964
#, c-format
-msgid "invalid syntax in name `%s' for variable assignment"
-msgstr "sintaxis inválida en el nombre `%s' para la asignación de variable"
+msgid "`%s' is not a legal variable name"
+msgstr "`%s' no es un nombre de variable legal"
-#: main.c:957
+#: main.c:967
+#, 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:995
msgid "floating point exception"
msgstr "excepción de coma flotante"
-#: main.c:964
+#: main.c:1002
msgid "fatal error: internal error"
msgstr "error fatal: error interno"
-#: main.c:1014
+#: main.c:1052
#, c-format
msgid "no pre-opened fd %d"
msgstr "no existe el df %d abierto previamente"
-#: main.c:1019
+#: main.c:1057
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "no se puede abrir previamente /dev/null para el df %d"
-#: main.c:1037 main.c:1046
+#: main.c:1080 main.c:1089
#, c-format
msgid "could not find groups: %s"
msgstr "no se pueden encontrar los grupos: %s"
-#: profile.c:94
-#, c-format
-msgid "could not open `%s' for writing: %s"
-msgstr "no se puede abrir `%s' para escritura: %s"
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "línea ord.:"
-#: profile.c:96 awkgram.y:2465
-msgid "sending profile to standard error"
-msgstr "enviando perfil a la salida estándar de error"
+#: msg.c:120
+msgid "warning: "
+msgstr "aviso: "
-#: profile.c:409
-msgid "internal error: Node_var with null vname"
-msgstr "error interno: Node_var con vname nulo"
+#: msg.c:142
+msgid "error: "
+msgstr "error: "
-#: profile.c:524
-msgid "internal error: Node_var_array with null vname"
-msgstr "error interno: Node_var_array con vname nulo"
+#: msg.c:178
+msgid "fatal: "
+msgstr "fatal: "
-#: profile.c:554 eval.c:813
-#, c-format
-msgid ""
-"function `%s' called with space between name and `(',\n"
-"%s"
-msgstr ""
-"se llamó la función `%s' con espacio entre el nombre y el `(',\n"
-"%s"
+#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
+msgid "can't convert string to float"
+msgstr "no se puede convertir una cadena a coma flotante"
-#: profile.c:556 eval.c:815
-msgid "or used in other expression context"
-msgstr "se usó or en otro contexto de la expresión"
+#: node.c:357
+msgid "backslash at end of string"
+msgstr "barra invertida al final de la cadena"
-#: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741
-#, c-format
-msgid "attempt to use array `%s' in a scalar context"
-msgstr "se intentó usar la matriz `%s' en un contexto escalar"
+#: node.c:544
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX no permite escapes `\\x'"
-#: profile.c:637 eval.c:1047
+#: node.c:550
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "no hay dígitos hexadecimales en la secuencia de escape `\\x'"
+
+#: node.c:584
#, c-format
-msgid "illegal type (%s) in tree_eval"
-msgstr "tipo ilegal (%s) en tree_eval"
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr "la secuencia de escape `\\%c' tratada como una simple `%c'"
-#: profile.c:842 eval.c:1790
+#: posix/gawkmisc.c:172
#, c-format
-msgid "attempt to use function `%s' as array"
-msgstr "se intentó usar la función `%s' como una matriz"
+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:856 eval.c:1797
+#: profile.c:91
#, c-format
-msgid "`%s' is a function, assignment is not allowed"
-msgstr "`%s' es una función, no se permite asignación"
+msgid "could not open `%s' for writing: %s"
+msgstr "no se puede abrir `%s' para escritura: %s"
-#: profile.c:860 eval.c:1803 eval.c:1810
-msgid "assignment is not allowed to result of builtin function"
-msgstr "no se permite asignación como resultado de una función interna"
+#: profile.c:409
+msgid "internal error: Node_var with null vname"
+msgstr "error interno: Node_var con vname nulo"
-#: profile.c:1108
+#: profile.c:471
+msgid "# treated internally as `delete'"
+msgstr "# se trata internamente como `delete'"
+
+#: profile.c:545
+msgid "internal error: Node_var_array with null vname"
+msgstr "error interno: Node_var_array con vname nulo"
+
+#: profile.c:1127
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# perfil de gawk, creado %s\n"
-#: profile.c:1111
+#: profile.c:1130
msgid ""
"\t# BEGIN block(s)\n"
"\n"
@@ -827,7 +1671,7 @@ msgstr ""
"\t# bloque(s) BEGIN\n"
"\n"
-#: profile.c:1121
+#: profile.c:1140
msgid ""
"\t# Rule(s)\n"
"\n"
@@ -835,7 +1679,7 @@ msgstr ""
"\t# Regla(s)\n"
"\n"
-#: profile.c:1127
+#: profile.c:1146
msgid ""
"\t# END block(s)\n"
"\n"
@@ -843,7 +1687,7 @@ msgstr ""
"\t# bloque(s) END\n"
"\n"
-#: profile.c:1147
+#: profile.c:1166
msgid ""
"\n"
"\t# Functions, listed alphabetically\n"
@@ -851,932 +1695,145 @@ msgstr ""
"\n"
"\t# Funciones, enumeradas alfabéticamente\n"
-#: profile.c:1357
+#: profile.c:1376
#, c-format
msgid "unexpected type %s in prec_level"
msgstr "tipo %s inesperado en prec_level"
-#: regex.c:1322
+#: 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"
-#: regex.c:1323
+#: regcomp.c:139
msgid "No match"
msgstr "No hay coincidencia"
-#: regex.c:1324
+#: regcomp.c:142
msgid "Invalid regular expression"
msgstr "Expresión regular inválida"
-#: regex.c:1325
+#: regcomp.c:145
msgid "Invalid collation character"
msgstr "Caracter de ordenación inválido"
-#: regex.c:1326
+#: regcomp.c:148
msgid "Invalid character class name"
msgstr "Nombre de clase de caracter inválido"
-#: regex.c:1327
+#: regcomp.c:151
msgid "Trailing backslash"
msgstr "Barra invertida extra al final"
-#: regex.c:1328
+#: regcomp.c:154
msgid "Invalid back reference"
msgstr "Referencia hacia atrás inválida"
-#: regex.c:1329
+#: regcomp.c:157
msgid "Unmatched [ or [^"
msgstr "[ o [^ desemparejados"
-#: regex.c:1330
+#: regcomp.c:160
msgid "Unmatched ( or \\("
msgstr "( o \\( desemparejados"
-#: regex.c:1331
+#: regcomp.c:163
msgid "Unmatched \\{"
msgstr "\\{ desemparejado"
-#: regex.c:1332
+#: regcomp.c:166
msgid "Invalid content of \\{\\}"
msgstr "Contenido inválido de \\{\\}"
-#: regex.c:1333
+#: regcomp.c:169
msgid "Invalid range end"
msgstr "Final de rango inválido"
-#: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204
+#: regcomp.c:172
msgid "Memory exhausted"
msgstr "Memoria agotada"
-#: regex.c:1335
+#: regcomp.c:175
msgid "Invalid preceding regular expression"
msgstr "Expresión regular precedente inválida"
-#: regex.c:1336
+#: regcomp.c:178
msgid "Premature end of regular expression"
msgstr "Fin prematuro de la expresión regular"
-#: regex.c:1337
+#: regcomp.c:181
msgid "Regular expression too big"
msgstr "La expresión regular es demasiado grande"
-#: regex.c:1338
+#: regcomp.c:184
msgid "Unmatched ) or \\)"
msgstr ") o \\) desemparejados"
-#: regex.c:7365
+#: regcomp.c:621
msgid "No previous regular expression"
msgstr "No hay una expresión regular previa"
-#: awkgram.y:232
-msgid "BEGIN blocks must have an action part"
-msgstr "Los bloques BEGIN deben tener una parte de acción"
-
-#: awkgram.y:238
-msgid "END blocks must have an action part"
-msgstr "Los bloques END deben tener una parte de acción"
-
-#: awkgram.y:274
-#, c-format
-msgid "`%s' is a built-in function, it cannot be redefined"
-msgstr "`%s' es una función interna, no puede ser redefinida"
-
-#: awkgram.y:362
-msgid "statement may have no effect"
-msgstr "la sentencia puede no tener efecto"
-
-#: awkgram.y:455
-msgid "`next' used in BEGIN or END action"
-msgstr "`next' es usado en la acción de BEGIN o END"
-
-#: awkgram.y:462 awkgram.y:469
-msgid "`nextfile' is a gawk extension"
-msgstr "`nextfile' es una extensión de gawk"
-
-#: awkgram.y:474
-msgid "`nextfile' used in BEGIN or END action"
-msgstr "`nextfile' es usado en la acción de BEGIN o END"
-
-#: awkgram.y:483
-msgid "`return' used outside function context"
-msgstr "`return' es usado fuera del contexto de la función"
-
-#: awkgram.y:519
-msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
-msgstr ""
-" el `print' simple en la regla BEGIN o END probablemente debe ser `print "
-"\"\"'"
-
-#: awkgram.y:532 awkgram.y:539
-msgid "`delete array' is a gawk extension"
-msgstr "`delete array' es una extensión de gawk"
-
-#: awkgram.y:604
-msgid "multistage two-way pipelines don't work"
-msgstr "las líneas de trabajo de dos vías multiestado no funcionan"
-
-#: awkgram.y:695
-msgid "regular expression on right of assignment"
-msgstr "expresión regular del lado derecho de una asignación"
+#~ msgid "invalid syntax in name `%s' for variable assignment"
+#~ msgstr "sintaxis inválida en el nombre `%s' para la asignación de variable"
-#: awkgram.y:713
-msgid "non-redirected `getline' undefined inside END action"
-msgstr "`getline' no redirigido indefinido dentro de la acción de END"
+#~ msgid "or used in other expression context"
+#~ msgstr "se usó or en otro contexto de la expresión"
-#: awkgram.y:723
-msgid "regular expression on left of `~' or `!~' operator"
-msgstr "expresión regular a la izquierda del operador `~' o `!~'"
+#~ msgid "attempt to use function `%s' as array"
+#~ msgstr "se intentó usar la función `%s' como una matriz"
-#: awkgram.y:733
-#, c-format
-msgid "regexp constant `/%s/' looks like a C comment, but is not"
-msgstr ""
-"la constante de expresión regular `/%s/' parece un comentario de C, pero no "
-"lo es"
-
-#: awkgram.y:749
-msgid "regular expression on right of comparison"
-msgstr "expresión regular a la derecha de una comparación"
-
-#: awkgram.y:776
-msgid "non-redirected `getline' undefined inside BEGIN or END action"
-msgstr "`getline' no redirigido indefinido dentro de la acción de BEGIN o END"
+#~ msgid "`%s' is a function, assignment is not allowed"
+#~ msgstr "`%s' es una función, no se permite asignación"
-#: awkgram.y:831
-msgid "call of `length' without parentheses is not portable"
-msgstr "la llamada de `length' sin paréntesis no es transportable"
+#~ msgid "BEGIN blocks must have an action part"
+#~ msgstr "Los bloques BEGIN deben tener una parte de acción"
-#: awkgram.y:834
-msgid "call of `length' without parentheses is deprecated by POSIX"
-msgstr "la llamada de `length' sin paréntesis está obsoleta por POSIX"
+#~ msgid "`nextfile' used in BEGIN or END action"
+#~ msgstr "`nextfile' es usado en la acción de BEGIN o END"
-#: awkgram.y:884
-msgid "invalid subscript expression"
-msgstr "expresión de subíndice inválida"
+#~ 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
-#: awkgram.y:1033
-#, c-format
-msgid "fptr %x not in tokentab\n"
-msgstr "fptr %x no está en tokentab\n"
-
-#: awkgram.y:1068
-msgid "unexpected newline"
-msgstr "nueva línea inesperada"
-
-#: awkgram.y:1152
-msgid "empty program text on command line"
-msgstr "texto de programa vacío en la linea de comando"
-
-#: awkgram.y:1209
-#, c-format
-msgid "can't open source file `%s' for reading (%s)"
-msgstr "no se puede abrir el fichero fuente `%s' para lectura (%s)"
-
-#: awkgram.y:1244
-#, c-format
-msgid "can't read sourcefile `%s' (%s)"
-msgstr "no se puede leer el fichero fuente `%s' (%s)"
-
-#: awkgram.y:1252
-#, c-format
-msgid "source file `%s' is empty"
-msgstr "el fichero fuente `%s' está vacío"
-
-#: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011
-msgid "source file does not end in newline"
-msgstr "el fichero fuente no termina con línea nueva"
+#~ msgid "fptr %x not in tokentab\n"
+#~ msgstr "fptr %x no está en tokentab\n"
-#: awkgram.y:1518
-msgid "unterminated regexp ends with `\\' at end of file"
-msgstr "expresión regular sin terminar termina con `\\` en el fin del fichero"
+#~ msgid "gsub third parameter is not a changeable object"
+#~ msgstr "el tercer argumento de gsub no es un objecto que se puede cambiar"
-#: awkgram.y:1539
-msgid "unterminated regexp"
-msgstr "expresión regular sin terminar"
+#~ msgid "Unbalanced ["
+#~ msgstr "[ desbalanceado"
-#: awkgram.y:1542
-msgid "unterminated regexp at end of file"
-msgstr "expresión regular sin terminar en el fin del fichero"
+#~ msgid "Unfinished \\ escape"
+#~ msgstr "Escape \\ sin terminar"
-#: awkgram.y:1609
-msgid "use of `\\ #...' line continuation is not portable"
-msgstr "el uso de la continuación de línea `\\ #...' no es transportable"
+#~ msgid "unfinished repeat count"
+#~ msgstr "cuenta de repetición sin terminar"
-#: awkgram.y:1621
-msgid "backslash not last character on line"
-msgstr "la barra invertida no es el último caracter en la línea"
+#~ msgid "malformed repeat count"
+#~ msgstr "cuenta de repetición malformada"
-#: awkgram.y:1662
-msgid "POSIX does not allow operator `**='"
-msgstr "POSIX no permite el operador `**='"
+#~ msgid "Unbalanced ("
+#~ msgstr "( desbalanceado"
-#: awkgram.y:1664
-msgid "old awk does not support operator `**='"
-msgstr "el awk antiguo no da soporte al operador `**='"
-
-#: awkgram.y:1673
-msgid "POSIX does not allow operator `**'"
-msgstr "POSIX no permite el operador `**'"
+#~ msgid "No regexp syntax bits specified"
+#~ msgstr "No se especifican los bits de sintaxis de la expresión regular"
-#: awkgram.y:1675
-msgid "old awk does not support operator `**'"
-msgstr "el awk antiguo no da soporte al operador `**='"
+#~ msgid "Unbalanced )"
+#~ msgstr ") desbalanceado"
-#: awkgram.y:1708
-msgid "operator `^=' is not supported in old awk"
-msgstr "el operador `^=' no tiene soporte en el awk antiguo"
+#~ msgid "out of memory"
+#~ msgstr "memoria agotada"
-#: awkgram.y:1716
-msgid "operator `^' is not supported in old awk"
-msgstr "el operador `^' no tiene soporte en el awk antiguo"
-
-#: awkgram.y:1798 awkgram.y:1815
-msgid "unterminated string"
-msgstr "cadena sin terminar"
-
-#: awkgram.y:1972
-#, c-format
-msgid "invalid char '%c' in expression"
-msgstr "caracter '%c' inválido en la expresión"
-
-#: awkgram.y:2032
-#, c-format
-msgid "`%s' is a gawk extension"
-msgstr "`%s' es una extensión de gawk"
-
-#: awkgram.y:2035
-#, c-format
-msgid "`%s' is a Bell Labs extension"
-msgstr "`%s' es una extensión de Bell Labs"
-
-#: awkgram.y:2038
-#, c-format
-msgid "POSIX does not allow `%s'"
-msgstr "POSIX no permite `%s'"
-
-#: awkgram.y:2042
-#, c-format
-msgid "`%s' is not supported in old awk"
-msgstr "`%s' no tiene soporte en el awk antiguo"
-
-#: awkgram.y:2070
-msgid "`goto' considered harmful!\n"
-msgstr "¡`goto' se considera dañino!\n"
-
-#: awkgram.y:2134
-#, c-format
-msgid "%d is invalid as number of arguments for %s"
-msgstr "%d es inválido como número de argumentos para %s"
-
-#: awkgram.y:2153 awkgram.y:2156
-msgid "match: third argument is a gawk extension"
-msgstr "match: el tercer argumento es una extensión de gawk"
-
-#: awkgram.y:2172
-#, c-format
-msgid "%s: string literal as last arg of substitute has no effect"
-msgstr ""
-"%s: la literal de cadena como último argumento de substitute no tiene efecto"
-
-#: awkgram.y:2176
-msgid "sub third parameter is not a changeable object"
-msgstr "el tercer argumento de sub no es un objecto que se puede cambiar"
-
-#: awkgram.y:2178
-msgid "gsub third parameter is not a changeable object"
-msgstr "el tercer argumento de gsub no es un objecto que se puede cambiar"
-
-#: awkgram.y:2204 awkgram.y:2207
-msgid "close: second argument is a gawk extension"
-msgstr "close: el segundo argumento es una extensión de gawk"
-
-#: awkgram.y:2217
-msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
-msgstr ""
-"el uso de dcgettext(_\"...\") es incorrecto: quite el subrayado inicial"
-
-#: awkgram.y:2232
-msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
-msgstr ""
-"el uso de dcngettext(_\"...\") es incorrecto: quite el subrayado inicial"
-
-#: awkgram.y:2323
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "función `%s': parámetro #%d, `%s', duplica el parámetro #%d"
-
-#: awkgram.y:2355
-#, c-format
-msgid "function `%s': parameter `%s' shadows global variable"
-msgstr "función `%s': parámetro `%s' obscurece la variable global"
-
-#: awkgram.y:2464
-#, c-format
-msgid "could not open `%s' for writing (%s)"
-msgstr "no se puede abrir `%s' para escritura (%s)"
-
-#: awkgram.y:2495
-#, c-format
-msgid "%s: close failed (%s)"
-msgstr "%s: falló close (%s)"
-
-#: awkgram.y:2605
-msgid "shadow_funcs() called twice!"
-msgstr "¡shadow_funcs() llamada dos veces!"
-
-#: awkgram.y:2680
-#, c-format
-msgid "function `%s': can't use function name as parameter name"
-msgstr ""
-"función `%s': no se puede usar un nombre de función como nombre de parámetro"
-
-#: awkgram.y:2690
-#, c-format
-msgid "function name `%s' previously defined"
-msgstr "el nombre de función `%s' fue previamente definida"
-
-#: awkgram.y:2838 awkgram.y:2844
-#, c-format
-msgid "function `%s' called but never defined"
-msgstr "se llama a la función `%s' pero nunca se definió"
-
-#: awkgram.y:2847
-#, c-format
-msgid "function `%s' defined but never called"
-msgstr "la función `%s' está definida pero nunca se llamó"
-
-#: awkgram.y:2874
-#, c-format
-msgid "regexp constant for parameter #%d yields boolean value"
-msgstr ""
-"la constante de expresión regular para el parámetro #%d da un valor booleano"
-
-#: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649
-#: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078
-#: dfa.c:1081 dfa.c:1094 dfa.c:1095
-msgid "Unbalanced ["
-msgstr "[ desbalanceado"
-
-#: dfa.c:783
-msgid "Unfinished \\ escape"
-msgstr "Escape \\ sin terminar"
-
-#: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955
-msgid "unfinished repeat count"
-msgstr "cuenta de repetición sin terminar"
-
-#: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958
-msgid "malformed repeat count"
-msgstr "cuenta de repetición malformada"
-
-#: dfa.c:1285
-msgid "Unbalanced ("
-msgstr "( desbalanceado"
-
-#: dfa.c:1407
-msgid "No regexp syntax bits specified"
-msgstr "No se especifican los bits de sintaxis de la expresión regular"
-
-#: dfa.c:1415
-msgid "Unbalanced )"
-msgstr ") desbalanceado"
-
-#: dfa.c:3014
-msgid "out of memory"
-msgstr "memoria agotada"
-
-#: field.c:849
-msgid "split: second argument is not an array"
-msgstr "split: el segundo argumento no es una matriz"
-
-#: field.c:876
-msgid "split: null string for third arg is a gawk extension"
-msgstr ""
-"split: la cadena nula para el tercer argumento es una extensión de gawk"
-
-#: field.c:916
-msgid "`FIELDWIDTHS' is a gawk extension"
-msgstr "`FIELDWIDTHS' es una extensión gawk"
-
-#: field.c:943
-#, c-format
-msgid "field %d in FIELDWIDTHS, must be > 0"
-msgstr "el campo %d en FIELDWIDTHS, debe ser > 0"
-
-#: field.c:997
-msgid "null string for `FS' is a gawk extension"
-msgstr "la cadena nula para `FS' es una extensión de gawk"
-
-#: msg.c:57
-msgid "cmd. line:"
-msgstr "línea ord.:"
-
-#: msg.c:123
-msgid "warning: "
-msgstr "aviso: "
-
-#: msg.c:145
-msgid "error: "
-msgstr "error: "
-
-#: msg.c:178
-msgid "fatal: "
-msgstr "fatal: "
-
-#: eval.c:259
-#, c-format
-msgid "unknown nodetype %d"
-msgstr "tipo de nodo %d desconocido"
-
-#: eval.c:307
-msgid "buffer overflow in genflags2str"
-msgstr "desbordamiento de almacenamiento temporal en genflags2str"
-
-#: eval.c:541
-#, c-format
-msgid "for loop: array `%s' changed size from %d to %d during loop execution"
-msgstr ""
-"ciclo for: la matriz `%s' cambió de tamaño de %d a %d durante la ejecución "
-"del ciclo"
-
-#: eval.c:565
-msgid "`break' outside a loop is not portable"
-msgstr "`break' fuera de un ciclo no es transportable"
-
-#: eval.c:569
-msgid "`break' outside a loop is not allowed"
-msgstr "no se permite `break' fuera de un ciclo"
-
-#: eval.c:588
-msgid "`continue' outside a loop is not portable"
-msgstr "`continue' fuera de un ciclo no es transportable"
-
-#: eval.c:592
-msgid "`continue' outside a loop is not allowed"
-msgstr "no se permite `continue' fuera de un ciclo"
-
-#: eval.c:622
-msgid "`next' cannot be called from a BEGIN rule"
-msgstr "`next' no puede ser llamado desde una regla BEGIN"
-
-#: eval.c:624
-msgid "`next' cannot be called from an END rule"
-msgstr "`next' no puede ser llamado desde una regla END"
-
-#: eval.c:636
-msgid "`nextfile' cannot be called from a BEGIN rule"
-msgstr "`nextfile' no puede ser llamado desde una regla BEGIN"
-
-#: eval.c:638
-msgid "`nextfile' cannot be called from an END rule"
-msgstr "`nextfile' no puede ser llamado desde una regla END"
-
-#: eval.c:679
-msgid "statement has no effect"
-msgstr "la sentencia no tiene efecto"
-
-#: eval.c:713 eval.c:743 eval.c:1622
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "referencia a la variable sin iniciar `%s'"
-
-#: eval.c:721 eval.c:1608
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "no se puede usar el nombre de la función `%s' como variable o matriz"
-
-#: eval.c:728 eval.c:734 eval.c:1747
-#, c-format
-msgid "reference to uninitialized argument `%s'"
-msgstr "referencia al argumento sin iniciar `%s'"
-
-#: eval.c:823
-msgid "assignment used in conditional context"
-msgstr "asignación usada en contexto condicional"
-
-#: eval.c:914
-msgid ""
-"concatenation: side effects in one expression have changed the length of "
-"another!"
-msgstr ""
-"concatenación: ¡Los efectos laterales en una expresión han cambiado la "
-"longitud de otra!"
-
-#: eval.c:1013
-msgid "division by zero attempted"
-msgstr "se intentó una división por cero"
-
-#: eval.c:1028
-#, c-format
-msgid "division by zero attempted in `%%'"
-msgstr "se intentó una división por cero en `%%'"
-
-#: eval.c:1236
-msgid "division by zero attempted in `/='"
-msgstr "se intentó una división por cero en `/='"
-
-#: eval.c:1254
-#, c-format
-msgid "division by zero attempted in `%%='"
-msgstr "se intentó una división por cero en `%%='"
-
-#: eval.c:1424
-#, c-format
-msgid "%s (from %s)"
-msgstr "%s (de %s)"
-
-#: eval.c:1472
-#, c-format
-msgid "function `%s' called with more arguments than declared"
-msgstr "se llamó a la función `%s' con más argumentos de los declarados"
-
-#: eval.c:1519
-#, c-format
-msgid "function `%s' not defined"
-msgstr "la función `%s' no está definida"
-
-#: eval.c:1521
-#, c-format
-msgid "function %s called\n"
-msgstr "la función %s fue llamada\n"
-
-#: eval.c:1580
-msgid ""
-"\n"
-"\t# Function Call Stack:\n"
-"\n"
-msgstr ""
-"\n"
-"\t# Pila de Llamadas de Funciones:\n"
-"\n"
-
-#: eval.c:1583
-msgid "\t# -- main --\n"
-msgstr "\t# -- principal --\n"
-
-#: eval.c:1759
-msgid "attempt to field reference from non-numeric value"
-msgstr "se intentó una referencia de campo desde un valor que no es un número"
-
-#: eval.c:1761
-msgid "attempt to reference from null string"
-msgstr "se intentó una referencia desde una cadena nula"
-
-#: eval.c:1767
-#, c-format
-msgid "attempt to access field %d"
-msgstr "se intentó accesar al campo %d"
-
-#: eval.c:1783
-#, c-format
-msgid "attempt to use scalar parameter `%s' as an array"
-msgstr "se intentó usar el parámetro escalar `%s como una matriz'"
-
-#: eval.c:1874
-msgid "`IGNORECASE' is a gawk extension"
-msgstr "`IGNORECASE' es una extensión de gawk"
-
-#: eval.c:1902
-msgid "`BINMODE' is a gawk extension"
-msgstr "`BINMODE' es una extensión de gawk"
-
-#: eval.c:2014
-#, c-format
-msgid "bad `%sFMT' specification `%s'"
-msgstr "especificación `%sFMT' `%s' errónea"
-
-#: eval.c:2080
-msgid "turning off `--lint' due to assignment to `LINT'"
-msgstr "desactivando `--lint' debido a una asignación a `LINT'"
-
-#: eval.c:2116
-msgid "NF set to negative value"
-msgstr "NF con un valor negativo"
-
-#: io.c:240
-#, c-format
-msgid "cannot open file `%s' for reading (%s)"
-msgstr "no se puede abrir el fichero `%s' para lectura (%s)"
-
-#: io.c:320
-#, c-format
-msgid "close of fd %d (`%s') failed (%s)"
-msgstr "falló el cerrado del df %d (`%s') (%s)"
-
-#: io.c:432
-#, c-format
-msgid "invalid tree type %s in redirect()"
-msgstr "tipo de árbol %s inválido en redirect()"
-
-#: io.c:438
-#, c-format
-msgid "expression in `%s' redirection only has numeric value"
-msgstr "la expresión en la redirección `%s' sólo tiene un valor numérico"
-
-#: io.c:444
-#, c-format
-msgid "expression for `%s' redirection has null string value"
-msgstr "la expresión para la redirección `%s' tiene un valor de cadena nula"
-
-#: io.c:449
-#, c-format
-msgid "filename `%s' for `%s' redirection may be result of logical expression"
-msgstr ""
-"el fichero `%s' para la redirección `%s' puede ser resultado de una "
-"expresión lógica"
-
-#: io.c:471
-#, c-format
-msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
-msgstr "mezcla innecesaria de `>' y `>>' para el fichero `%.*s'"
-
-#: io.c:523
-#, c-format
-msgid "can't open pipe `%s' for output (%s)"
-msgstr "no se puede abrir la tubería `%s' para la salida (%s)"
-
-#: io.c:532
-#, c-format
-msgid "can't open pipe `%s' for input (%s)"
-msgstr "no se puede abrir la tubería `%s' para la entrada (%s)"
-
-#: io.c:545
-#, c-format
-msgid "can't open two way socket `%s' for input/output (%s)"
-msgstr ""
-"no se puede abrir el `socket' de dos vías `%s' para entrada/salida (%s)"
-
-#: io.c:549
-#, c-format
-msgid "can't open two way pipe `%s' for input/output (%s)"
-msgstr "no se puede abrir la tubería de dos vías `%s' para entrada/salida (%s)"
-
-#: io.c:625
-#, c-format
-msgid "can't redirect from `%s' (%s)"
-msgstr "no se puede redirigir desde `%s' (%s)"
-
-#: io.c:628
-#, c-format
-msgid "can't redirect to `%s' (%s)"
-msgstr "no se puede redirigir a `%s' (%s)"
-
-#: io.c:667
-msgid ""
-"reached system limit for open files: starting to multiplex file descriptors"
-msgstr ""
-"se alcanzó el límite del sistema para ficheros abiertos: comenzando a "
-"multiplexar los descriptores de fichero"
-
-#: io.c:679
-#, c-format
-msgid "close of `%s' failed (%s)."
-msgstr "falló el cerrado de `%s' (%s)."
-
-#: io.c:686
-msgid "too many pipes or input files open"
-msgstr "demasiadas tuberías o ficheros de entrada abiertos"
-
-#: io.c:709
-msgid "close: second argument must be `to' or `from'"
-msgstr "close: el segundo argumento debe ser `to' o `from'"
-
-#: io.c:723
-#, c-format
-msgid "close: `%.*s' is not an open file, pipe or co-process"
-msgstr "close: `%.*s' no es un fichero abierto, tubería o co-proceso"
-
-#: io.c:727
-msgid "close of redirection that was never opened"
-msgstr "cerrado de una redirección que nunca fue abierta"
-
-#: io.c:754
-#, c-format
-msgid "close: redirection `%s' not opened with `|&', second argument ignored"
-msgstr ""
-"close: la redirección `%s' no se abre con `|&', se ignoró el segundo "
-"argumento"
-
-#: io.c:811
-#, c-format
-msgid "failure status (%d) on pipe close of `%s' (%s)"
-msgstr "estado de fallo (%d) en el cerrado de la tubería de `%s' (%s)"
-
-#: io.c:814
-#, c-format
-msgid "failure status (%d) on file close of `%s' (%s)"
-msgstr "estado de fallo (%d) en el cerrado del fichero de `%s' (%s)"
-
-#: io.c:833
-#, c-format
-msgid "no explicit close of socket `%s' provided"
-msgstr "no se provee el cerrado explícito del `socket' `%s'"
-
-#: io.c:836
-#, c-format
-msgid "no explicit close of co-process `%s' provided"
-msgstr "no se provee el cerrado explícito del co-proceso `%s'"
-
-#: io.c:839
-#, c-format
-msgid "no explicit close of pipe `%s' provided"
-msgstr "no se provee el cerrado explícito del la tubería `%s'"
-
-#: io.c:842
-#, c-format
-msgid "no explicit close of file `%s' provided"
-msgstr "no se provee el cerrado explícito del fichero `%s'"
-
-#: io.c:871 io.c:925
-#, c-format
-msgid "error writing standard output (%s)"
-msgstr "error al escribir en la salida estándar (%s)"
-
-#: io.c:875 io.c:929
-#, c-format
-msgid "error writing standard error (%s)"
-msgstr "error al escribir en la salida estándar de error (%s)"
-
-#: io.c:883
-#, c-format
-msgid "pipe flush of `%s' failed (%s)."
-msgstr "falló la limpieza de la tubería de `%s' (%s)."
-
-#: io.c:886
-#, c-format
-msgid "co-process flush of pipe to `%s' failed (%s)."
-msgstr "falló la limpieza del co-proceso de la tubería a `%s' (%s)."
-
-#: io.c:889
-#, c-format
-msgid "file flush of `%s' failed (%s)."
-msgstr "falló la limpieza del fichero de `%s' (%s)."
-
-#: io.c:1048
-msgid "/inet/raw client not ready yet, sorry"
-msgstr "el cliente /inet/raw no está listo aún, perdón"
-
-#: io.c:1050 io.c:1087
-msgid "only root may use `/inet/raw'."
-msgstr "sólo root puede utilizar `/inet/raw'."
-
-#: io.c:1085
-msgid "/inet/raw server not ready yet, sorry"
-msgstr "el servidor /inet/raw no está listo aún, perdón"
-
-#: io.c:1175
-#, c-format
-msgid "no (known) protocol supplied in special filename `%s'"
-msgstr ""
-"no se proporciona algún protocolo (conocido) en el nombre de fichero "
-"especial `%s'"
-
-#: io.c:1193
-#, c-format
-msgid "special file name `%s' is incomplete"
-msgstr "el nombre de fichero especial `%s' está incompleto"
-
-#: io.c:1205
-#, c-format
-msgid "local port invalid in `%s'"
-msgstr "puerto local inválido en `%s'"
-
-#: io.c:1217
-msgid "must supply a remote hostname to `/inet'"
-msgstr "se debe proporcionar a `/inet' un nombre de anfitrión remoto"
-
-#: io.c:1232
-msgid "must supply a remote port to `/inet'"
-msgstr "se debe proporcionar a `/inet' un puerto remoto"
-
-#: io.c:1238
-#, c-format
-msgid "remote port invalid in `%s'"
-msgstr "puerto remoto inválido en `%s'"
-
-#: io.c:1248
-msgid "TCP/IP communications are not supported"
-msgstr "No tienen soporte las comunicaciones TCP/IP"
-
-#: io.c:1257 io.c:1438
-#, c-format
-msgid "file `%s' is a directory"
-msgstr "el fichero `%s' es un directorio"
-
-#: io.c:1327
-#, c-format
-msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
-msgstr "use `PROCINFO[\"%s\"]' en lugar de `%s'"
-
-#: io.c:1359
-msgid "use `PROCINFO[...]' instead of `/dev/user'"
-msgstr "use `PROCINFO[...]' en lugar de `/dev/user'"
-
-#: io.c:1424
-#, c-format
-msgid "could not open `%s', mode `%s'"
-msgstr "no se puede abrir `%s', modo `%s'"
-
-#: io.c:1550 io.c:1602 io.c:1732 io.c:1754
-#, c-format
-msgid "moving pipe to stdout in child failed (dup: %s)"
-msgstr "falló el movimiento a la salida estándar en el hijo (dup: %s)"
-
-#: io.c:1554 io.c:1607
-#, c-format
-msgid "moving pipe to stdin in child failed (dup: %s)"
-msgstr ""
-"falló el movimiento de la tubería a la entrada estándar en el hijo (dup: %s)"
-
-#: io.c:1571 io.c:1745
-msgid "restoring stdout in parent process failed\n"
-msgstr "falló la restauración de la salida estándar en el proceso padre\n"
-
-#: io.c:1576
-msgid "restoring stdin in parent process failed\n"
-msgstr "falló la restauración de la entrada estándar en el proceso padre\n"
-
-#: io.c:1599 io.c:1751
-#, c-format
-msgid "close of stdout in child failed (%s)"
-msgstr "falló el cerrado de la salida estándar en el hijo (%s)"
-
-#: io.c:1604
-#, c-format
-msgid "close of stdin in child failed (%s)"
-msgstr "falló el cerrado de la entrada estándar en el hijo (%s)"
-
-#: io.c:1610 io.c:1756 io.c:1767
-#, c-format
-msgid "close of pipe failed (%s)"
-msgstr "falló el cerrado de la tubería (%s)"
-
-#: io.c:1655
-msgid "`|&' not supported"
-msgstr "`|&' no tiene soporte"
-
-#: io.c:1722
-#, c-format
-msgid "cannot open pipe `%s' (%s)"
-msgstr "no se puede abrir la tubería `%s' (%s)"
-
-#: io.c:1763
-#, c-format
-msgid "cannot create child process for `%s' (fork: %s)"
-msgstr "no se puede crear el proceso hijo para `%s' (fork: %s)"
-
-#: io.c:2104
-#, c-format
-msgid "data file `%s' is empty"
-msgstr "el fichero de datos `%s' está vacío"
-
-#: io.c:2175
-#, c-format
-msgid "internal error: file `%s', line %d\n"
-msgstr "error interno: fichero `%s', línea %d\n"
-
-#: io.c:2277
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "error al leer el fichero de entrada `%s': %s"
-
-#: io.c:2521
-msgid "multicharacter value of `RS' is a gawk extension"
-msgstr "el valor multicaracter de `RS' es una extensión de gawk"
-
-#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
-msgid "can't convert string to float"
-msgstr "no se puede convertir una cadena a coma flotante"
-
-#: node.c:342
-msgid "backslash at end of string"
-msgstr "barra invertida al final de la cadena"
-
-#: node.c:524
-msgid "POSIX does not allow `\\x' escapes"
-msgstr "POSIX no permite escapes `\\x'"
-
-#: node.c:530
-msgid "no hex digits in `\\x' escape sequence"
-msgstr "no hay dígitos hexadecimales en la secuencia de escape `\\x'"
-
-#: node.c:564
-#, c-format
-msgid "escape sequence `\\%c' treated as plain `%c'"
-msgstr "la secuencia de escape `\\%c' tratada como una simple `%c'"
-
-#: re.c:208
-#, c-format
-msgid "regex match failed, not enough memory to match string \"%.*s%s\""
-msgstr ""
-"falló la coincidencia de la expresión regular, no hay suficiente memoria "
-"para que coincida la cadena \"%.*s%s\""
-
-#: posix/gawkmisc.c:122
-#, c-format
-msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
-msgstr "%s %s `%s': no se puede establecer close-on-exec: (fcntl: %s)"
+#~ msgid "internal error: file `%s', line %d\n"
+#~ msgstr "error interno: fichero `%s', línea %d\n"
#~ msgid ""
#~ "\n"
diff --git a/po/fr.gmo b/po/fr.gmo
index 79cc9fd2..8a2666bd 100644
--- a/po/fr.gmo
+++ b/po/fr.gmo
Binary files differ
diff --git a/po/fr.po b/po/fr.po
index 4d209dbb..630af7a4 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -4,409 +4,903 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: gawk 3.1.1a\n"
-"POT-Creation-Date: 2002-05-01 16:40+0300\n"
-"PO-Revision-Date: 2002-04-29 20:00-0500\n"
+"Project-Id-Version: gawk 3.1.1m\n"
+"POT-Creation-Date: 2003-03-19 14:25+0200\n"
+"PO-Revision-Date: 2003-02-28 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:243 array.c:275 array.c:280 eval.c:483
+#: array.c:274 array.c:309 array.c:314 eval.c:494
#, c-format
msgid "attempt to use scalar `%s' as array"
msgstr "tentative d'utilisation du scalaire « %s » comme un tableau"
-#: array.c:304
+#: array.c:338
#, c-format
msgid "reference to uninitialized element `%s[\"%s\"]'"
msgstr "référence à un élément non initialisé « %s[\"%s\"] »"
-#: array.c:310
+#: array.c:344
#, c-format
msgid "subscript of array `%s' is null string"
msgstr "sous-description du tableau « %s » contient une chaîne nulle"
-#: array.c:373 array.c:456
-#, c-format
-msgid "delete: illegal use of variable `%s' as array"
-msgstr "destruction: utilisation illégale d'une variable « %s » comme tableau"
-
-#: array.c:406
+#: array.c:412 array.c:425 array.c:466
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "destruction: index « %s » n'est pas dans le tableau « %s »"
-#: array.c:571
+#: array.c:432 array.c:515
+#, c-format
+msgid "delete: illegal use of variable `%s' as array"
+msgstr "destruction: utilisation illégale d'une variable « %s » comme tableau"
+
+#: array.c:633
#, c-format
msgid "%s: empty (null)\n"
msgstr "%s: vide (null)\n"
-#: array.c:576
+#: array.c:638
#, c-format
msgid "%s: empty (zero)\n"
msgstr "%s: vide (zéro)\n"
-#: array.c:580
+#: array.c:642
#, c-format
msgid "%s: table_size = %d, array_size = %d\n"
msgstr "%s: table_size = %d, array_size = %d\n"
-#: array.c:612
+#: array.c:671
#, c-format
msgid "%s: is parameter\n"
msgstr "%s: est un paramètre\n"
-#: array.c:617
+#: array.c:676
#, c-format
msgid "%s: array_ref to %s\n"
msgstr "%s: array_ref de %s\n"
-#: array.c:844
+#: array.c:975
msgid "asort: first argument is not an array"
msgstr "asort(): le premier argument fourni n'est pas dans le tableau"
-#: array.c:853
+#: array.c:984
msgid "asort: second argument is not an array"
msgstr "asort(): le second argument fourni n'est pas dans le tableau"
-#: builtin.c:107
+#: 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
+msgid "statement may have no effect"
+msgstr "la déclaration peut n'avoir aucun effet"
+
+#: awkgram.y:431 awkgram.y:451
+#, c-format
+msgid "`%s' used in %s action"
+msgstr "« %s » utilisé dans l'action %s"
+
+#: awkgram.y:444 awkgram.y:447
+msgid "`nextfile' is a gawk extension"
+msgstr "« nextfile » est une extension de gawk"
+
+#: awkgram.y:461
+msgid "`return' used outside function context"
+msgstr "« return » utilisé en dehors du contexte d'une fonction"
+
+#: awkgram.y:500
+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:513 awkgram.y:520
+msgid "`delete array' is a gawk extension"
+msgstr "« delete array » est une extension de gawk"
+
+#: awkgram.y:528 awkgram.y:535
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "« delete(array) » est une extension tawk non portable"
+
+#: awkgram.y:578
+msgid "multistage two-way pipelines don't work"
+msgstr "pipelines bidirectionnel à multi-étapes ne fonctionnent pas"
+
+#: awkgram.y:669
+msgid "regular expression on right of assignment"
+msgstr "expression régulière à la droite de l'affectation"
+
+#: awkgram.y:679
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "expression régulière sur la gauche de l'opérateur « ~ » ou « !~ »"
+
+#: awkgram.y:687
+msgid "regular expression on right of comparison"
+msgstr "expression régulière sur la droite de la comparaison"
+
+#: awkgram.y:754
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "« getline » non redirigé indéfini à l'intérieur de l'action END"
+
+#: awkgram.y:781
+msgid "call of `length' without parentheses is not portable"
+msgstr "l'appel de « length » sans les parenthèses n'est pas portable"
+
+#: awkgram.y:784
+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:835
+msgid "invalid subscript expression"
+msgstr "sous-expression invalide"
+
+#: awkgram.y:1020
+msgid "unexpected newline or end of string"
+msgstr "nouvelle ligne inattendue ou fin de chaîne"
+
+#: awkgram.y:1115
+msgid "empty program text on command line"
+msgstr "texte du programme sur la ligne de commande est vide"
+
+#: awkgram.y:1172
+#, 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:1207
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "ne peut lire le fichier source « %s » (%s)"
+
+#: awkgram.y:1215
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "fichier source « %s » est vide"
+
+#: awkgram.y:1417 awkgram.y:1527 awkgram.y:1545 awkgram.y:1895 awkgram.y:1980
+msgid "source file does not end in newline"
+msgstr "fichier source ne se termine pas par un retour de chariot"
+
+#: awkgram.y:1481
+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:1501
+msgid "unterminated regexp"
+msgstr "expression régulière non terminée"
+
+#: awkgram.y:1504
+msgid "unterminated regexp at end of file"
+msgstr "expression régulière non terminée à la fin du fichier"
+
+#: awkgram.y:1571
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr ""
+"utilisation de « \\ #... » comme continuation de ligne n'est pas portable"
+
+#: awkgram.y:1583
+msgid "backslash not last character on line"
+msgstr "la barre oblique inverse n'est pas le dernier caractère sur la ligne"
+
+#: awkgram.y:1628
+msgid "POSIX does not allow operator `**='"
+msgstr "POSIX ne permet un opérateur « **= »"
+
+#: awkgram.y:1630
+msgid "old awk does not support operator `**='"
+msgstr "l'ancien awk ne supporte pas l'opérateur « **= »"
+
+#: awkgram.y:1639
+msgid "POSIX does not allow operator `**'"
+msgstr "POSIX ne permet pas l'opérateur « ** »"
+
+#: awkgram.y:1641
+msgid "old awk does not support operator `**'"
+msgstr "l'ancien awk ne supporte pas l'opérateur « ** »"
+
+#: awkgram.y:1672
+msgid "operator `^=' is not supported in old awk"
+msgstr "l'opérateur « ^= » n'est pas supporté dans l'ancien awk"
+
+#: awkgram.y:1680
+msgid "operator `^' is not supported in old awk"
+msgstr "l'opérateur « ^ » n'est pas supporté dans l'ancien awk"
+
+#: awkgram.y:1764 awkgram.y:1781
+msgid "unterminated string"
+msgstr "chaîne non complétée"
+
+#: awkgram.y:1941
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "caractère invalide « %c » dans l'expression"
+
+#: awkgram.y:2001
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "« %s » est une extension de gawk"
+
+#: awkgram.y:2004
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "« %s » est une extension de Bell Labs"
+
+#: awkgram.y:2007
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "POSIX ne permet pas « %s »"
+
+#: awkgram.y:2011
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "« %s » n'est pas supporté dans l'ancien awk"
+
+#: awkgram.y:2038
+msgid "`goto' considered harmful!\n"
+msgstr "« goto » considéré néfaste!\n"
+
+#: awkgram.y:2102
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
+msgstr "%d est invalide comme nombre d'arguments pour %s"
+
+#: awkgram.y:2121 awkgram.y:2124
+msgid "match: third argument is a gawk extension"
+msgstr "match: 3e argument est une extension de gawk"
+
+#: awkgram.y:2137
+#, 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:2140
+#, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "3e paramètre %s n'est pas un objet modifiable"
+
+#: awkgram.y:2167 awkgram.y:2170
+msgid "close: second argument is a gawk extension"
+msgstr "close: 2e argument est une extension de gawk"
+
+#: awkgram.y:2180
+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:2195
+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:2266
+#, 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:2299
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "fonction « %s »: paramètre « %s » porte ombrage à la variable globale"
+
+#: awkgram.y:2411
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "ne peut ourvrir « %s » en écriture (%s)"
+
+#: awkgram.y:2412 profile.c:93
+msgid "sending profile to standard error"
+msgstr "redirection du profile vers stderr"
+
+#: awkgram.y:2442
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: échec de fermeture (%s)"
+
+#: awkgram.y:2566
+msgid "shadow_funcs() called twice!"
+msgstr "shadows_funcs() appelé deux fois!"
+
+#: awkgram.y:2593
+msgid "there were shadowed variables."
+msgstr "il y a quelques variables qui sont cachées par ombrage"
+
+#: awkgram.y:2666
+#, 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:2676
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "nom de la fonction « %s » définie précédemment"
+
+#: awkgram.y:2827 awkgram.y:2833
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "fonction « %s » appelé mais jamais définie"
+
+#: awkgram.y:2836
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "fonction « %s » définie mais jamais utilisée"
+
+#: awkgram.y:2863
+#, 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:2876
+#, 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:2878
+msgid "or used as a variable or an array"
+msgstr "ou utilisé comme une variable ou un tableau"
+
+#: builtin.c:111
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "%s vers « %s » échec (%s)"
-#: builtin.c:108
+#: builtin.c:112
msgid "standard output"
msgstr "sortie standard"
-#: builtin.c:109
+#: builtin.c:113
msgid "reason unknown"
msgstr "raison inconnue"
-#: builtin.c:122
+#: builtin.c:126
msgid "exp: received non-numeric argument"
msgstr "exp: argument fourni n'est pas numérique"
-#: builtin.c:128
+#: builtin.c:132
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: argument fourni %g est hors gamme"
-#: builtin.c:186
+#: builtin.c:190
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: ne peut vider: le pipe « %s » est oouvert en lecture, pas en écriture"
-#: builtin.c:189
+#: builtin.c:193
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush: ne peut vider: fichier « %s » ouvert en lecture, pas en écriture"
-#: builtin.c:201
+#: builtin.c:205
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr ""
"fflush: « %s » n'est pas ni un fichier ouvert, un pipe ou un co-processus"
-#: builtin.c:295
+#: builtin.c:299
msgid "index: received non-string first argument"
msgstr "index: premier argument fourni n'est pas une chaîne"
-#: builtin.c:297
+#: builtin.c:301
msgid "index: received non-string second argument"
msgstr "index: second argument fourni n'est pas une chaîne"
-#: builtin.c:407
+#: builtin.c:411
msgid "int: received non-numeric argument"
msgstr "int: argument fourni n'est pas numérique"
-#: builtin.c:424
+#: builtin.c:428
msgid "length: received non-string argument"
msgstr "length: argument fourni n'est pas une chaîne"
-#: builtin.c:440
+#: builtin.c:444
msgid "log: received non-numeric argument"
msgstr "log: argument fourni n'est pas numérique"
-#: builtin.c:443
+#: builtin.c:447
#, c-format
msgid "log: received negative argument %g"
msgstr "log: argument fourni négatif %g"
-#: builtin.c:605 builtin.c:608
+#: builtin.c:609 builtin.c:612
msgid "must use `count$' on all formats or none"
msgstr "doit utiliser « count$ » pour tous les formats ou aucun"
-#: builtin.c:703
+#: builtin.c:714
msgid "`$' is not permitted in awk formats"
msgstr "« $ » n'est pas permis dans les formats awk"
-#: builtin.c:709
+#: builtin.c:720
msgid "arg count with `$' must be > 0"
msgstr "décompte d'arguments avec « $ » doit être > 0"
-#: builtin.c:711
+#: builtin.c:722
#, c-format
-msgid "arg count %d greater than total number of supplied arguments"
-msgstr "compteur d'arguments %d est > que le nombre total fournis d'arguments"
+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:713
+#: builtin.c:724
msgid "`$' not permitted after period in format"
msgstr "« $ » n'est pas permis après le point"
-#: builtin.c:726
+#: builtin.c:737
msgid "no `$' supplied for positional field width or precision"
msgstr "aucun « $ » fourni dans le champ positionnel (longueur ou précision)"
-#: builtin.c:784
+#: builtin.c:795
msgid "`l' is meaningless in awk formats; ignored"
msgstr "« l » n'a aucun sens dans les formats de awk; ignoré"
-#: builtin.c:788
+#: builtin.c:799
msgid "`l' is not permitted in POSIX awk formats"
msgstr "« l » n'est pas permis dans les format POSIX de awk"
-#: builtin.c:799
+#: builtin.c:810
msgid "`L' is meaningless in awk formats; ignored"
msgstr "« L » n'a aucun sens dans les formats s de awk; ignoré"
-#: builtin.c:803
+#: builtin.c:814
msgid "`L' is not permitted in POSIX awk formats"
msgstr "« L » n'est pas permis dans les formats POSIX de awk"
-#: builtin.c:814
+#: builtin.c:825
msgid "`h' is meaningless in awk formats; ignored"
msgstr "« h » n'a aucun send dans les formats de awk; ignoré"
-#: builtin.c:818
+#: builtin.c:829
msgid "`h' is not permitted in POSIX awk formats"
msgstr "« h » n'est pas permis dans les formats POSIX de awk"
-#: builtin.c:1067
+#: builtin.c:1078
msgid "not enough arguments to satisfy format string"
msgstr "pas assez d'arguments pour satisfaire le format d'une chaîne"
-#: builtin.c:1069
+#: builtin.c:1080
msgid "^ ran out for this one"
msgstr "^ débordement pour celle-ci"
-#: builtin.c:1074
+#: builtin.c:1085
msgid "[s]printf: format specifier does not have control letter"
msgstr ""
"[s]printf: spécificateur de format ne contient pas de lettre de contrôle"
-#: builtin.c:1077
+#: builtin.c:1088
msgid "too many arguments supplied for format string"
msgstr "trop d'arguments pour la chaîne de format"
-#: builtin.c:1120 builtin.c:1123
+#: builtin.c:1154 builtin.c:1157
msgid "printf: no arguments"
msgstr "printf: aucun argument"
-#: builtin.c:1156
+#: builtin.c:1181
msgid "sqrt: received non-numeric argument"
msgstr "sqrt: argument fourni n'est pas numérique"
-#: builtin.c:1160
+#: builtin.c:1185
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: appelé avec un argument négatif %g"
-#: builtin.c:1182
+#: builtin.c:1207
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: début de l'index %g est invalide, utilise 1"
-#: builtin.c:1187
+#: builtin.c:1212
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "substr: début avec un nombre non entier %g sera tronqué"
-#: builtin.c:1201
+#: builtin.c:1231
#, c-format
msgid "substr: length %g is <= 0"
msgstr "substr: longueur %g est <= 0"
-#: builtin.c:1207
+#: builtin.c:1233
+#, c-format
+msgid "substr: length %g is < 0"
+msgstr "substr: longueur %g est < 0"
+
+#: builtin.c:1240
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: longueur avec un nombre non entier %g sera tronqué"
-#: builtin.c:1214
+#: builtin.c:1245
+#, 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:1257
msgid "substr: source string is zero length"
msgstr "substr: chaîne de départ est de longueur zéro"
-#: builtin.c:1221
+#: builtin.c:1263
#, c-format
-msgid ""
-"substr: length %d at start index %d exceeds length of first argument (%d)"
-msgstr ""
-"substr: longueur %d début avec l'index %d déborde la longueur du 1er "
-"argument (%d)"
+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:1227
+#: builtin.c:1271
#, c-format
-msgid "substr: start index %d is past end of string"
-msgstr "substr: début de l'index %d dépasse la fin de la chaîne"
+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:1263
+#: builtin.c:1306
msgid "strftime: received non-string first argument"
msgstr "strftime: premier argument fourni n'est pas une chaîne"
-#: builtin.c:1269
+#: builtin.c:1312
msgid "strftime: received empty format string"
msgstr "strftime: chaîne de format vide"
-#: builtin.c:1278
+#: builtin.c:1321
msgid "strftime: received non-numeric second argument"
msgstr "strftime: second argument fourni n'est pas numérique"
-#: builtin.c:1341
+#: builtin.c:1384
msgid "mktime: received non-string argument"
msgstr "mktime: argument fourni n'est pas une chaîne"
-#: builtin.c:1386
+#: builtin.c:1429
msgid "system: received non-string argument"
msgstr "system: argument fourni n'est pas une chaîne"
-#: builtin.c:1512
+#: builtin.c:1573
msgid "tolower: received non-string argument"
msgstr "tolower: argument fourni n'est pas une chaîne"
-#: builtin.c:1561
+#: builtin.c:1622
msgid "toupper: received non-string argument"
msgstr "toupper: argument fourni n'est pas une chaîne"
-#: builtin.c:1606
+#: builtin.c:1667
msgid "atan2: received non-numeric first argument"
msgstr "atan2: premier argument fourni n'est pas numérique"
-#: builtin.c:1608
+#: builtin.c:1669
msgid "atan2: received non-numeric second argument"
msgstr "atan2: second argument fourni n'est pas numérique"
-#: builtin.c:1627
+#: builtin.c:1688
msgid "sin: received non-numeric argument"
msgstr "sin: argument fourni n'est pas numérique"
-#: builtin.c:1643
+#: builtin.c:1704
msgid "cos: received non-numeric argument"
msgstr "cos: argument fourni n'est pas numérique"
-#: builtin.c:1687
+#: builtin.c:1748
msgid "srand: received non-numeric argument"
msgstr "srand: argument fourni n'est pas numérique"
-#: builtin.c:1721
+#: builtin.c:1787
msgid "match: third argument is not an array"
msgstr "match: le 3e argument fourni n'est pas un tableau"
-#: builtin.c:2157
+#: builtin.c:2264
msgid "gensub: 3rd argument of 0 treated as 1"
msgstr "gensub: le 3e argument fourni de 0 traité comme un 1"
-#: builtin.c:2268 builtin.c:2270
+#: builtin.c:2375 builtin.c:2377
msgid "lshift: received non-numeric first argument"
msgstr "lshift: premier argument fourni n'est pas numérique"
-#: builtin.c:2272
+#: builtin.c:2379
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr "lshift(%lf, %lf): valeurs négatives donneront d'étranges résultats"
-#: builtin.c:2274
+#: builtin.c:2381
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf): valeurs fractionnaires seront tronquées"
-#: builtin.c:2276
+#: builtin.c:2383
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr "lshift(%lf, %lf): trop grand déplacement donnera d'étranges résultats"
-#: builtin.c:2305 builtin.c:2307
+#: builtin.c:2412 builtin.c:2414
msgid "rshift: received non-numeric first argument"
msgstr "rshift: premier argument fourni n'est pas numérique"
-#: builtin.c:2309
+#: builtin.c:2416
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr "rshift(%lf, %lf): valeurs négatives donneront d'étranges résultats"
-#: builtin.c:2311
+#: builtin.c:2418
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf): valeurs fractionnaires seront tronquées"
-#: builtin.c:2313
+#: builtin.c:2420
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr "rshift(%lf, %lf): trop grand déplacement donnera d'étranges résultats"
-#: builtin.c:2342 builtin.c:2344
+#: builtin.c:2449 builtin.c:2451
msgid "and: received non-numeric first argument"
msgstr "and: premier argument fourni n'est pas numérique"
-#: builtin.c:2346
+#: builtin.c:2453
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr "and(%lf, %lf): valeurs négatives donneront d'étranges résultats"
-#: builtin.c:2348
+#: builtin.c:2455
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): valeurs fractionnaires seront tronquées"
-#: builtin.c:2377 builtin.c:2379
+#: builtin.c:2484 builtin.c:2486
msgid "or: received non-numeric first argument"
msgstr "or: premier argument fourni n'est pas numérique"
-#: builtin.c:2381
+#: builtin.c:2488
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr "or(%lf, %lf): valeurs négatives donneront d'étranges résultats"
-#: builtin.c:2383
+#: builtin.c:2490
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf): valeurs fractionnaires seront tronquées"
-#: builtin.c:2412 builtin.c:2414
+#: builtin.c:2519 builtin.c:2521
msgid "xor: received non-numeric first argument"
msgstr "xor: premier argument fourni n'est pas numérique"
-#: builtin.c:2416
+#: builtin.c:2523
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr "xor(%lf, %lf): valeurs négatives donneront d'étranges résultats"
-#: builtin.c:2418
+#: builtin.c:2525
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf): valeurs fractionnaires seront tronquées"
-#: builtin.c:2446
+#: builtin.c:2553
msgid "compl: received non-numeric argument"
msgstr "compl: argument fourni n'est pas numérique"
-#: builtin.c:2448
+#: builtin.c:2555
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf): valeurs négatives donneront d'étranges résultats"
-#: builtin.c:2450
+#: builtin.c:2557
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf): valeurs fractionnaires seront tronquées"
-#: builtin.c:2621
+#: builtin.c:2728
#, 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:262
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "type de noeud inconnu %d"
+
+#: eval.c:310
+msgid "buffer overflow in genflags2str"
+msgstr "débordement de tampo dans genflag2str"
+
+#: eval.c:555
+#, 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:576
+msgid "`break' outside a loop is not portable"
+msgstr "« break » en dehors de la boucle n'est pas portable"
+
+#: eval.c:580
+msgid "`break' outside a loop is not allowed"
+msgstr "« break » en dehors de la boucle n'est pas permis"
+
+#: eval.c:597
+msgid "`continue' outside a loop is not portable"
+msgstr "« continue » en dehors de la boucle n'est pas portable"
+
+#: eval.c:601
+msgid "`continue' outside a loop is not allowed"
+msgstr "« continue » en dehors de la boucle n'est pas permis"
+
+#: eval.c:635
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "« next » ne peut être appelé depuis une règle BEGIN"
+
+#: eval.c:637
+msgid "`next' cannot be called from an END rule"
+msgstr "« next » ne peut être appelé depuis une règle END"
+
+#: eval.c:646
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "« nextfile » ne peut être appelé depuis une règle BEGIN"
+
+#: eval.c:648
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "« nextfile » ne peut être appelé depuis une règle END"
+
+#: eval.c:696
+msgid "statement has no effect"
+msgstr "la déclaration n'a aucun effet"
+
+#: eval.c:731 eval.c:761 eval.c:1733
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "référence à une variable non initialisée « %s »"
+
+#: eval.c:739 eval.c:1721
+#, 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:746 eval.c:752
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "référence à un argument non initialisé « %s »"
+
+#: eval.c:810 eval.c:1728 profile.c:773
+#, 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:910
+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:935
+msgid "assignment used in conditional context"
+msgstr "affectation utilisé dans un contexte conditionnel"
+
+#: eval.c:1026
+msgid "division by zero attempted"
+msgstr "tentative de division par zéro"
+
+#: eval.c:1041
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "tentative de division par zéro dans « %% »"
+
+#: eval.c:1056 profile.c:649
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "type illégal (%s) dans tree_eval"
+
+#: eval.c:1232
+msgid "division by zero attempted in `/='"
+msgstr "tentative de division par zéro dans « /= »"
+
+#: eval.c:1250
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "tentative de division par zéro dans « %%= »"
+
+#: eval.c:1510
+#, c-format
+msgid "%s (from %s)"
+msgstr "%s (de %s)"
+
+#: eval.c:1569
+#, 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:1628
+#, c-format
+msgid "function `%s' not defined"
+msgstr "fonction « %s » non définie"
+
+#: eval.c:1634
+#, c-format
+msgid "function %s called\n"
+msgstr "fonction %s appelée\n"
+
+#: eval.c:1693
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# Appel d'une fonction sur la pile:\n"
+"\n"
+
+#: eval.c:1696
+msgid "\t# -- main --\n"
+msgstr "#t# -- main --\n"
+
+#: eval.c:1850
+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:1852
+msgid "attempt to reference from null string"
+msgstr "tentative de référence à partir d'une chaîne nulle"
+
+#: eval.c:1858
+#, c-format
+msgid "attempt to access field %d"
+msgstr "tentative d'accès du champ %d"
+
+#: eval.c:1874
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr ""
+"tentative d'utilisation d'un paramètre scalaire « %s » comme un tableau"
+
+#: eval.c:1886 eval.c:1893 profile.c:865
+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:1941
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "« IGNORECASE » est une extension de gawk"
+
+#: eval.c:1970
+msgid "`BINMODE' is a gawk extension"
+msgstr "« BINMODE » est une extension de gawk"
+
+#: eval.c:2082
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "« %sFMT » spécification erronée « %s »"
+
+#: eval.c:2160
+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"
@@ -421,10 +915,35 @@ msgstr "extension: ne peut ouvrir « %s » (%s)\n"
msgid "extension: library `%s': cannot call function `%s' (%s)\n"
msgstr "extension: librairie « %s »: ne peut appeler la fonction « %s » (%s)\n"
-#: ext.c:180
+#: ext.c:181
msgid "Operation Not Supported"
msgstr "Opération non supportée"
+#: field.c:321
+msgid "NF set to negative value"
+msgstr "NF initialisé avec une valeur négative"
+
+#: field.c:819
+msgid "split: second argument is not an array"
+msgstr "split: 2e argument n'est pas un tableau"
+
+#: field.c:854
+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:906
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "« FIELDWIDTHS » est une extension de gawk"
+
+#: field.c:933
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "champ %d dans FIELDWIDTHS, doit être > 0"
+
+#: field.c:1006
+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"
@@ -465,7 +984,7 @@ msgstr "%s: option illégale -- %c\n"
msgid "%s: invalid option -- %c\n"
msgstr "%s: option invalide -- %c\n"
-#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412
+#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:431
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: l'option requiert un argument -- %c\n"
@@ -480,167 +999,478 @@ msgstr "%s: l'option « -W %s » est ambiguë\n"
msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "%s: l'option « -W %s » ne requiert pas d'argument\n"
-#: main.c:307
+#: io.c:257
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "ne peut ouvrir le fichier « %s » en lecture (%s)"
+
+#: io.c:344
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "fermeture de fd %d (« %s ») en échec (%s)"
+
+#: io.c:482
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "type d'arbre invalide %s dans redirect()"
+
+#: io.c:488
+#, 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:494
+#, 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:499
+#, 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:521
+#, 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:573
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "ne peut ouvrir un pipe « %s » en sortie (%s)"
+
+#: io.c:582
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "ne peut ouvrir un pipe « %s » en entrée (%s)"
+
+#: io.c:595
+#, 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:599
+#, 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:675
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "ne peut rediriger de « %s » (%s)"
+
+#: io.c:678
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "ne peut rediriger vers « %s » (%s)"
+
+#: io.c:717
+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:729
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "fermeture de « %s » en échec (%s)"
+
+#: io.c:736
+msgid "too many pipes or input files open"
+msgstr "trop de pipes ou de fichiers en lecture ouverts"
+
+#: io.c:759
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: 2e argument doit être « to » ou « from »"
+
+#: io.c:773
+#, 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:777
+msgid "close of redirection that was never opened"
+msgstr "fermeture de la redirection qui n'a jamais été ouverte"
+
+#: io.c:804
+#, 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:866
+#, 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:869
+#, 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:888
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "aucune fermeture explicite du socket « %s » fournie"
+
+#: io.c:891
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "aucune fermeture explicite du co-processus « %s » fournie"
+
+#: io.c:894
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "aucune fermeture explicite du pipe « %s » fournie"
+
+#: io.c:897
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "aucune fermeture explicite du fichier « %s » fournie"
+
+#: io.c:926 io.c:980
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "erreur lors de l'écriture vers stdout (%s)"
+
+#: io.c:930 io.c:984
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "erreur lors de l'écriture vers stderr (%s)"
+
+#: io.c:938
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "vidange du pipie de « %s » en échec (%s)"
+
+#: io.c:941
+#, 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:944
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "vidange du fichier « %s » en échec (%s)"
+
+#: io.c:1103
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "le client /inet/raw n'est pas encore prêt, désolé"
+
+#: io.c:1105 io.c:1142
+msgid "only root may use `/inet/raw'."
+msgstr "seul root peut utiliser « /inet/raw »"
+
+#: io.c:1140
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "le serveur /inet/raw n'est pas encore prêt, désolé"
+
+#: io.c:1230
+#, 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:1248
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "nom spécial de fichier « %s » est incomplet"
+
+#: io.c:1260
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "port local invalide dans « %s »"
+
+#: io.c:1272
+msgid "must supply a remote hostname to `/inet'"
+msgstr "un nom de hôte distant doit être fourni à « /inet »"
+
+#: io.c:1287
+msgid "must supply a remote port to `/inet'"
+msgstr "un port distant doit être fournis à « /inet »"
+
+#: io.c:1293
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "port distant invalide dans « %s »"
+
+#: io.c:1303
+msgid "TCP/IP communications are not supported"
+msgstr "les communications TCP/IP ne sont pas supportées"
+
+#: io.c:1312 io.c:1492
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "le fichier « %s » est un répertoire"
+
+#: io.c:1381
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "utliser « PROCINFO[\"%s\"] » au lieu de « %s »"
+
+#: io.c:1413
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "utliser « PROCINFO[\"%s\"] » au lieu de « /dev/user »"
+
+#: io.c:1478 io.c:1652
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "ne peut ouvrir « %s », mode « %s »"
+
+#: io.c:1703
+#, c-format
+msgid "close of master pty failed (%s)"
+msgstr "échec de la fermeture du pty maître (%s)"
+
+#: io.c:1705 io.c:1857 io.c:2009
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "échec de fermeture de stdout du processus fils (%s)"
+
+#: io.c:1708
+#, 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:1710 io.c:1862
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "échec de fermeture de stdin du processus fils (%s)"
+
+#: io.c:1713
+#, 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:1715 io.c:1734
+#, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "échec de la fermeture du pty esclave (%s)"
+
+#: io.c:1808 io.c:1860 io.c:1990 io.c:2012
+#, 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:1812 io.c:1865
+#, 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:1829 io.c:2003
+msgid "restoring stdout in parent process failed\n"
+msgstr "restauration de stdout par le processus parent a échoué\n"
+
+#: io.c:1834
+msgid "restoring stdin in parent process failed\n"
+msgstr "restauration de stdin par le processus parent a échoué\n"
+
+#: io.c:1868 io.c:2014 io.c:2025
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "échec de la fermeture du pipe (%s)"
+
+#: io.c:1913
+msgid "`|&' not supported"
+msgstr "« |& » non supporté"
+
+#: io.c:1980
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "ne ouvrir un pipe « %s » (%s)"
+
+#: io.c:2021
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr "ne créer le processus fils pour « %s » (fork: %s)"
+
+#: io.c:2364
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "le fichier de données « %s » est vide"
+
+#: io.c:2407 io.c:2415
+msgid "could not allocate more input memory"
+msgstr "ne peut allouer plus de mémoire pour l'entrée"
+
+#: io.c:2540 io.c:2782 io.c:3046
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "erreur lors de la lecture du fichier source « %s »: %s"
+
+#: io.c:3281
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "valeur de « RS » avec multiple caractères est une extension gawk"
+
+#: main.c:322
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "« -m[fr] » est une option non pertinente en gawk"
-#: main.c:309
+#: main.c:324
msgid "-m option usage: `-m[fr] nnn'"
msgstr "-m usage de l'option: « -m[fr] nnn »"
-#: main.c:326
+#: main.c:341
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s: l'option « -W %s » n'est pas reconnue, ignorée\n"
-#: main.c:357
+#: main.c:378
msgid "empty argument to `--source' ignored"
msgstr "argument vide à l'option « --source », ignorée"
-#: main.c:429
+#: main.c:448
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr ""
"variable d'environnement « POSIXLY__CORRECT » initialisée: utilisation de « "
"--posix »"
-#: main.c:434
+#: main.c:453
msgid "`--posix' overrides `--traditional'"
msgstr "« --posix » écrase « --traditional »"
-#: main.c:445
+#: main.c:464
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr "« --posix »/« --traditional » écrase « --non-decimal-data »"
-#: main.c:449
+#: main.c:468
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr ""
"l'exécution de %s en mode setuid root peut causer un problème de sécurité"
-#: main.c:478
+#: main.c:509
#, c-format
-msgid "can't set mode on stdin (%s)"
-msgstr "ne peut initialiser le mode sur stdin (%s)"
+msgid "can't set binary mode on stdin (%s)"
+msgstr "ne peut initialiser le mode binaire sur stdin (%s)"
-#: main.c:481
+#: main.c:512
#, c-format
-msgid "can't set mode on stdout (%s)"
-msgstr "ne peut initialiser le mode sur stdout (%s)"
+msgid "can't set binary mode on stdout (%s)"
+msgstr "ne peut initialiser le mode binaire sur stdout (%s)"
-#: main.c:483
+#: main.c:514
#, c-format
-msgid "can't set mode on stderr (%s)"
-msgstr "ne peut initialiser le mode sur stderr (%s)"
+msgid "can't set binary mode on stderr (%s)"
+msgstr "ne peut initialiser le mode binaire sur stderr (%s)"
-#: main.c:512
+#: main.c:544
msgid "no program text at all!"
msgstr "aucun programme!"
-#: main.c:556
+#: main.c:612
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr ""
"Usage: %s [style des options POSIX ou GNU] -f fichierprog [--] fichier ...\n"
-#: main.c:558
+#: main.c:614
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr ""
"Usage: %s [style des options POSIX ou GNU] [--] %cprogram%c fichier ...\n"
-#: main.c:563
+#: main.c:619
msgid "POSIX options:\t\tGNU long options:\n"
msgstr "Options POSIX:\t\toptions de long format GNU:\n"
-#: main.c:564
+#: main.c:620
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f fichierprog\t\t--file=fichierprog\n"
-#: main.c:565
+#: main.c:621
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "#t-F fs\t\t\t--field-separator=fs\n"
-#: main.c:566
+#: main.c:622
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "#t-v var=valeur\t\t--assign=var=valeur\n"
-#: main.c:567
+#: main.c:623
msgid "\t-m[fr] val\n"
msgstr "\t-m[fr] valeur\n"
-#: main.c:568
+#: main.c:624
msgid "\t-W compat\t\t--compat\n"
msgstr "\t-W compat\t\t--compat\n"
-#: main.c:569
+#: main.c:625
msgid "\t-W copyleft\t\t--copyleft\n"
msgstr "\t-W copyleft\t\t--copyleft\n"
-#: main.c:570
+#: main.c:626
msgid "\t-W copyright\t\t--copyright\n"
msgstr "\t-W copyright\t\t--copyright\n"
-#: main.c:571
+#: main.c:627
msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
msgstr "\t-W dump-variables[=fichier]\t--dump-variables[=fichier]\n"
-#: main.c:572
+#: main.c:628
msgid "\t-W gen-po\t\t--gen-po\n"
msgstr "\t-W gen-po\t\t--gen-po\n"
-#: main.c:573
+#: main.c:629
msgid "\t-W help\t\t\t--help\n"
msgstr "\t-W help\t\t\t--help\n"
-#: main.c:574
+#: main.c:630
msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
-#: main.c:575
+#: main.c:631
msgid "\t-W lint-old\t\t--lint-old\n"
msgstr "\t-W lint-old\t\t--lint-old\n"
-#: main.c:576
+#: main.c:632
msgid "\t-W non-decimal-data\t--non-decimal-data\n"
msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
-#: main.c:578
+#: main.c:634
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:581
+#: main.c:637
msgid "\t-W parsedebug\t\t--parsedebug\n"
msgstr "\t-W parsedebug\t\t--parsedebug\n"
-#: main.c:583
+#: main.c:639
msgid "\t-W profile[=file]\t--profile[=file]\n"
msgstr "\t-W profile[=fichier]\t--profile[=fichier]\n"
-#: main.c:584
+#: main.c:640
msgid "\t-W posix\t\t--posix\n"
msgstr "\t-W posix\t\t--posix\n"
-#: main.c:585
+#: main.c:641
msgid "\t-W re-interval\t\t--re-interval\n"
msgstr "\t-W re-interval\t\t--re-interval\n"
-#: main.c:586
+#: main.c:642
msgid "\t-W source=program-text\t--source=program-text\n"
msgstr "\t-W source=program-text\t--source=program-text\n"
-#: main.c:587
+#: main.c:643
msgid "\t-W traditional\t\t--traditional\n"
msgstr "\t-W traditional\t\t--traditional\n"
-#: main.c:588
+#: main.c:644
msgid "\t-W usage\t\t--usage\n"
msgstr "\t-W usage\t\t--usage\n"
-#: main.c:589
+#: main.c:645
msgid "\t-W version\t\t--version\n"
msgstr "\t-W version\t\t--version\n"
-#: main.c:593
+#: main.c:649
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -651,7 +1481,7 @@ msgstr ""
"Pour rapporter une anomalie, voir la rubrique « Bugs » dans « gawk.info »\n"
"dans la section « Reporting Problems and Bugs » de la version imprimée.\n"
-#: main.c:597
+#: main.c:653
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -661,7 +1491,7 @@ msgstr ""
"Par défaut, il lit de l'entrée standard et écrit sur la sortie standard.\n"
"\n"
-#: main.c:601
+#: main.c:657
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -671,7 +1501,7 @@ msgstr ""
"\tgawk '{ sum += $1 }; END { print sum }' fichier\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:613
+#: main.c:669
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -690,7 +1520,7 @@ msgstr ""
"soit (selon vos préférences) toute version ultérieure.\n"
"\n"
-#: main.c:621
+#: main.c:677
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"
@@ -705,7 +1535,7 @@ msgstr ""
"Pour plus d'informations à ce sujet, consulter la « GNU General Public "
"License ».\n"
-#: main.c:627
+#: main.c:683
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"
@@ -715,102 +1545,119 @@ msgstr ""
"avec ce programme; sinon, écrire à la Free Software Foundation, Inc.,\n"
"59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"
-#: main.c:657
+#: main.c:713
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr ""
"-Ft ne permet pas d'initialiser FS à un tabulateur dans la version POSIX de "
"awk"
-#: main.c:888
+#: main.c:944
#, c-format
-msgid "invalid syntax in name `%s' for variable assignment"
-msgstr "syntaxe invalide dans le nom « %s » pour l'affectation de variable"
+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:957
+#: main.c:964
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr "`%s' n'est pas un nom de variable légal"
+
+#: main.c:967
+#, 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:995
msgid "floating point exception"
msgstr "exception de la virgule flottante"
-#: main.c:964
+#: main.c:1002
msgid "fatal error: internal error"
msgstr "erreur fatale: erreur interne"
-#: main.c:1014
+#: main.c:1052
#, c-format
msgid "no pre-opened fd %d"
msgstr "aucun fd pré-ouvert pour %d"
-#: main.c:1019
+#: main.c:1057
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "ne peut pré-ouvrir /dev/null pour le descripteud fd %d"
-#: main.c:1037 main.c:1046
+#: main.c:1080 main.c:1089
#, c-format
msgid "could not find groups: %s"
msgstr "n'a pu trouvé les groupes: %s"
-#: profile.c:94
-#, c-format
-msgid "could not open `%s' for writing: %s"
-msgstr "ne peut ouvrir « %s » en écriture: %s"
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "cmd. ligne:"
-#: profile.c:96 awkgram.y:2465
-msgid "sending profile to standard error"
-msgstr "redirection du profile vers stderr"
+#: msg.c:120
+msgid "warning: "
+msgstr "AVERTISSEMENT:"
-#: profile.c:409
-msgid "internal error: Node_var with null vname"
-msgstr "erreur interne: Node_var avec un vname nul"
+#: msg.c:142
+msgid "error: "
+msgstr "Erreur: "
-#: profile.c:524
-msgid "internal error: Node_var_array with null vname"
-msgstr "erreur interne: Node_var_array avec un vname nul"
+#: msg.c:178
+msgid "fatal: "
+msgstr "Fatal: "
-#: profile.c:554 eval.c:813
-#, c-format
-msgid ""
-"function `%s' called with space between name and `(',\n"
-"%s"
-msgstr ""
-"fonction « %s » appelée avec un espace entre le nom et « ( »,\n"
-"%s"
+#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
+msgid "can't convert string to float"
+msgstr "ne peut convertir la chaîne en nombre flottant"
-#: profile.c:556 eval.c:815
-msgid "or used in other expression context"
-msgstr "ou utilisée dans un autre contexte d'expression"
+#: node.c:357
+msgid "backslash at end of string"
+msgstr "barre oblique inverse à la fin de la chaîne"
-#: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741
-#, c-format
-msgid "attempt to use array `%s' in a scalar context"
-msgstr "tentative d'utilisation du tableau « %s » dans un contexte scalaire"
+#: node.c:544
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX ne permet pas de séquence d'échappement « \\x »"
+
+#: node.c:550
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "aucun chiffre hexadécimal dans la séquence d'échappement « \\x » "
-#: profile.c:637 eval.c:1047
+#: node.c:584
#, c-format
-msgid "illegal type (%s) in tree_eval"
-msgstr "type illégal (%s) dans tree_eval"
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr "séquence d'échappement « \\%c » traitée simplement comme « %c »"
-#: profile.c:842 eval.c:1790
+#: posix/gawkmisc.c:172
#, c-format
-msgid "attempt to use function `%s' as array"
-msgstr "tentative d'utilisation de la fonction « %s » dans le tableau"
+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:856 eval.c:1797
+#: profile.c:91
#, c-format
-msgid "`%s' is a function, assignment is not allowed"
-msgstr "« %s » est une fonction, l'affectation n'est pas permise"
+msgid "could not open `%s' for writing: %s"
+msgstr "ne peut ouvrir « %s » en écriture: %s"
-#: profile.c:860 eval.c:1803 eval.c:1810
-msgid "assignment is not allowed to result of builtin function"
-msgstr ""
-"l'affectation n'est pas permise pour obtenir un résultat d'une fonction "
-"interne"
+#: profile.c:409
+msgid "internal error: Node_var with null vname"
+msgstr "erreur interne: Node_var avec un vname nul"
+
+#: profile.c:471
+msgid "# treated internally as `delete'"
+msgstr "# traitée de manière interne comme « delete »"
-#: profile.c:1108
+#: profile.c:545
+msgid "internal error: Node_var_array with null vname"
+msgstr "erreur interne: Node_var_array avec un vname nul"
+
+#: profile.c:1127
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# profile gawk, créé %s\n"
-#: profile.c:1111
+#: profile.c:1130
msgid ""
"\t# BEGIN block(s)\n"
"\n"
@@ -818,7 +1665,7 @@ msgstr ""
"#t# DÉBUT de bloc(s)\n"
"\n"
-#: profile.c:1121
+#: profile.c:1140
msgid ""
"\t# Rule(s)\n"
"\n"
@@ -826,7 +1673,7 @@ msgstr ""
"\t# Règle(s)\n"
"\n"
-#: profile.c:1127
+#: profile.c:1146
msgid ""
"\t# END block(s)\n"
"\n"
@@ -834,7 +1681,7 @@ msgstr ""
"\t# FIN de bloc(s)\n"
"\n"
-#: profile.c:1147
+#: profile.c:1166
msgid ""
"\n"
"\t# Functions, listed alphabetically\n"
@@ -842,937 +1689,144 @@ msgstr ""
"\n"
"\t# Liste alphabétique des fonctions\n"
-#: profile.c:1357
+#: profile.c:1376
#, c-format
msgid "unexpected type %s in prec_level"
msgstr "type %s inattendu dans prec_level"
-#: regex.c:1322
+#: 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"
-#: regex.c:1323
+#: regcomp.c:139
msgid "No match"
msgstr "Aucune concordance"
-#: regex.c:1324
+#: regcomp.c:142
msgid "Invalid regular expression"
msgstr "Expression régulière invalide"
-#: regex.c:1325
+#: regcomp.c:145
msgid "Invalid collation character"
msgstr "Caractère de collation invalide"
-#: regex.c:1326
+#: regcomp.c:148
msgid "Invalid character class name"
msgstr "Nom de classe de caractères invalide"
-#: regex.c:1327
+#: regcomp.c:151
msgid "Trailing backslash"
msgstr "Barre oblique inverse de terminaison"
-#: regex.c:1328
+#: regcomp.c:154
msgid "Invalid back reference"
msgstr "Mauvaise référence arrière"
-#: regex.c:1329
+#: regcomp.c:157
msgid "Unmatched [ or [^"
msgstr "Non appariement de [ ou [^"
-#: regex.c:1330
+#: regcomp.c:160
msgid "Unmatched ( or \\("
msgstr "Non appariement de ( ou \\("
-#: regex.c:1331
+#: regcomp.c:163
msgid "Unmatched \\{"
msgstr "Non appariement de \\{"
-#: regex.c:1332
+#: regcomp.c:166
msgid "Invalid content of \\{\\}"
msgstr "Contenu invalide de \\{\\}"
-#: regex.c:1333
+#: regcomp.c:169
msgid "Invalid range end"
msgstr "Borne finale invalide"
-#: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204
+#: regcomp.c:172
msgid "Memory exhausted"
msgstr "Mémoire épuisée"
-#: regex.c:1335
+#: regcomp.c:175
msgid "Invalid preceding regular expression"
msgstr "Expression régulière précédente invalide"
-#: regex.c:1336
+#: regcomp.c:178
msgid "Premature end of regular expression"
msgstr "Fin prématurée de l'expression régulière"
-#: regex.c:1337
+#: regcomp.c:181
msgid "Regular expression too big"
msgstr "Expression régulière trop grande"
-#: regex.c:1338
+#: regcomp.c:184
msgid "Unmatched ) or \\)"
msgstr "Non appariement de ) ou \\)"
-#: regex.c:7365
+#: regcomp.c:621
msgid "No previous regular expression"
msgstr "Aucune expression régulière antérieure"
-#: awkgram.y:232
-msgid "BEGIN blocks must have an action part"
-msgstr "Les blocs de DÉBUT doitvent avoir une partie action"
+#~ msgid "invalid syntax in name `%s' for variable assignment"
+#~ msgstr "syntaxe invalide dans le nom « %s » pour l'affectation de variable"
-#: awkgram.y:238
-msgid "END blocks must have an action part"
-msgstr "Les blocs de FIN doivent avoir une partie action"
+#~ msgid "or used in other expression context"
+#~ msgstr "ou utilisée dans un autre contexte d'expression"
-#: awkgram.y:274
-#, c-format
-msgid "`%s' is a built-in function, it cannot be redefined"
-msgstr "« %s » est une fonction interne, elle ne peut être redéfinie"
+#~ msgid "attempt to use function `%s' as array"
+#~ msgstr "tentative d'utilisation de la fonction « %s » dans le tableau"
-#: awkgram.y:362
-msgid "statement may have no effect"
-msgstr "la déclaration peut n'avoir aucun effet"
+#~ msgid "`%s' is a function, assignment is not allowed"
+#~ msgstr "« %s » est une fonction, l'affectation n'est pas permise"
-#: awkgram.y:455
-msgid "`next' used in BEGIN or END action"
-msgstr "« next » utilisé dans l'action BEGIN ou END"
+#~ msgid "BEGIN blocks must have an action part"
+#~ msgstr "Les blocs de DÉBUT doitvent avoir une partie action"
-#: awkgram.y:462 awkgram.y:469
-msgid "`nextfile' is a gawk extension"
-msgstr "« nextfile » est une extension de gawk"
-
-#: awkgram.y:474
-msgid "`nextfile' used in BEGIN or END action"
-msgstr "« nextfile » utilisé dans l'action BEGIN ou END"
-
-#: awkgram.y:483
-msgid "`return' used outside function context"
-msgstr "« return » utilisé en dehors du contexte d'une fonction"
-
-#: awkgram.y:519
-msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
-msgstr ""
-"utilisation de « print » dans une règle BEGIN ou END doit être probablement "
-"« print \"\" »"
+#~ msgid "`nextfile' used in BEGIN or END action"
+#~ msgstr "« nextfile » utilisé dans l'action BEGIN ou END"
-#: awkgram.y:532 awkgram.y:539
-msgid "`delete array' is a gawk extension"
-msgstr "« delete array » est une extension de gawk"
-
-#: awkgram.y:604
-msgid "multistage two-way pipelines don't work"
-msgstr "pipelines bidirectionnel à multi-étapes ne fonctionnent pas"
-
-#: awkgram.y:695
-msgid "regular expression on right of assignment"
-msgstr "expression régulière à la droite de l'affectation"
-
-#: awkgram.y:713
-msgid "non-redirected `getline' undefined inside END action"
-msgstr "« getline » non redirigé indéfini à l'intérieur de l'action END"
-
-#: awkgram.y:723
-msgid "regular expression on left of `~' or `!~' operator"
-msgstr "expression régulière sur la gauche de l'opérateur « ~ » ou « !~ »"
-
-#: awkgram.y:733
-#, c-format
-msgid "regexp constant `/%s/' looks like a C comment, but is not"
-msgstr ""
-"la constante d'expression régulière « /%s/ » ressemble à un commentaire en "
-"C, mais ne l'est pas"
-
-#: awkgram.y:749
-msgid "regular expression on right of comparison"
-msgstr "expression régulière sur la droite de la comparaison"
-
-#: awkgram.y:776
-msgid "non-redirected `getline' undefined inside BEGIN or END action"
-msgstr ""
-"« getline » non redirigé indéfini à l'intérieur de l'action BEGIN ou END"
-
-#: awkgram.y:831
-msgid "call of `length' without parentheses is not portable"
-msgstr "l'appel de « length » sans les parenthèses n'est pas portable"
-
-#: awkgram.y:834
-msgid "call of `length' without parentheses is deprecated by POSIX"
-msgstr "l'appel de « length » sans les parenthèses est déprécié par POSIX"
-
-#: awkgram.y:884
-msgid "invalid subscript expression"
-msgstr "sous-expression invalide"
-
-#: awkgram.y:1033
-#, c-format
-msgid "fptr %x not in tokentab\n"
-msgstr "fptr %x n'est pas dans la table des jetons\n"
-
-#: awkgram.y:1068
-msgid "unexpected newline"
-msgstr "nouvelle ligne inattendue"
-
-#: awkgram.y:1152
-msgid "empty program text on command line"
-msgstr "texte du programme sur la ligne de commande est vide"
-
-#: awkgram.y:1209
-#, c-format
-msgid "can't open source file `%s' for reading (%s)"
-msgstr "ne peut ouvrir le fichier source « %s » pour lecture (%s)"
-
-#: awkgram.y:1244
-#, c-format
-msgid "can't read sourcefile `%s' (%s)"
-msgstr "ne peut lire le fichier source « %s » (%s)"
-
-#: awkgram.y:1252
-#, c-format
-msgid "source file `%s' is empty"
-msgstr "fichier source « %s » est vide"
-
-#: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011
-msgid "source file does not end in newline"
-msgstr "fichier source ne se termine pas par un retour de chariot"
-
-#: awkgram.y:1518
-msgid "unterminated regexp ends with `\\' at end of file"
-msgstr ""
-"expression régulière non termineé se terminant par « \\ » à la fin du fichier"
-
-#: awkgram.y:1539
-msgid "unterminated regexp"
-msgstr "expression régulière non terminée"
-
-#: awkgram.y:1542
-msgid "unterminated regexp at end of file"
-msgstr "expression régulière non terminée à la fin du fichier"
-
-#: awkgram.y:1609
-msgid "use of `\\ #...' line continuation is not portable"
-msgstr ""
-"utilisation de « \\ #... » comme continuation de ligne n'est pas portable"
-
-#: awkgram.y:1621
-msgid "backslash not last character on line"
-msgstr "la barre oblique inverse n'est pas le dernier caractère sur la ligne"
-
-#: awkgram.y:1662
-msgid "POSIX does not allow operator `**='"
-msgstr "POSIX ne permet un opérateur « **= »"
-
-#: awkgram.y:1664
-msgid "old awk does not support operator `**='"
-msgstr "l'ancien awk ne supporte pas l'opérateur « **= »"
-
-#: awkgram.y:1673
-msgid "POSIX does not allow operator `**'"
-msgstr "POSIX ne permet pas l'opérateur « ** »"
-
-#: awkgram.y:1675
-msgid "old awk does not support operator `**'"
-msgstr "l'ancien awk ne supporte pas l'opérateur « ** »"
-
-#: awkgram.y:1708
-msgid "operator `^=' is not supported in old awk"
-msgstr "l'opérateur « ^= » n'est pas supporté dans l'ancien awk"
-
-#: awkgram.y:1716
-msgid "operator `^' is not supported in old awk"
-msgstr "l'opérateur « ^ » n'est pas supporté dans l'ancien awk"
-
-#: awkgram.y:1798 awkgram.y:1815
-msgid "unterminated string"
-msgstr "chaîne non complétée"
-
-#: awkgram.y:1972
-#, c-format
-msgid "invalid char '%c' in expression"
-msgstr "caractère invalide « %c » dans l'expression"
-
-#: awkgram.y:2032
-#, c-format
-msgid "`%s' is a gawk extension"
-msgstr "« %s » est une extension de gawk"
-
-#: awkgram.y:2035
-#, c-format
-msgid "`%s' is a Bell Labs extension"
-msgstr "« %s » est une extension de Bell Labs"
-
-#: awkgram.y:2038
-#, c-format
-msgid "POSIX does not allow `%s'"
-msgstr "POSIX ne permet pas « %s »"
-
-#: awkgram.y:2042
-#, c-format
-msgid "`%s' is not supported in old awk"
-msgstr "« %s » n'est pas supporté dans l'ancien awk"
-
-#: awkgram.y:2070
-msgid "`goto' considered harmful!\n"
-msgstr "« goto » considéré néfaste!\n"
-
-#: awkgram.y:2134
-#, c-format
-msgid "%d is invalid as number of arguments for %s"
-msgstr "%d est invalide comme nombre d'arguments pour %s"
-
-#: awkgram.y:2153 awkgram.y:2156
-msgid "match: third argument is a gawk extension"
-msgstr "match: 3e argument est une extension de gawk"
-
-#: awkgram.y:2172
-#, c-format
-msgid "%s: string literal as last arg of substitute has no effect"
-msgstr ""
-"%s: la chaîne litérale comme dernier argument d'une substitution n'a aucun "
-"effet"
-
-#: awkgram.y:2176
-msgid "sub third parameter is not a changeable object"
-msgstr "sub: 3e paramètre n'est pas un objet interchangeable"
-
-#: awkgram.y:2178
-msgid "gsub third parameter is not a changeable object"
-msgstr "gsub: 3e paramètre n'est pas un objet interchangeable"
-
-#: awkgram.y:2204 awkgram.y:2207
-msgid "close: second argument is a gawk extension"
-msgstr "close: 2e argument est une extension de gawk"
-
-#: awkgram.y:2217
-msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
-msgstr ""
-"utilisation de dcgettext(_\"...\") est incorrect: enlever les soulignés en "
-"en-tête"
-
-#: awkgram.y:2232
-msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
-msgstr ""
-"utilisation de dcgettext(_\"...\") est incorrecte: enlever les soulignés de "
-"l'en-tête"
-
-#: awkgram.y:2323
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "fonction « %s »: paramètre #%d, « %s » est un double du paramètre #%d"
-
-#: awkgram.y:2355
-#, c-format
-msgid "function `%s': parameter `%s' shadows global variable"
-msgstr "fonction « %s »: paramètre « %s » porte ombrage à la variable globale"
-
-#: awkgram.y:2464
-#, c-format
-msgid "could not open `%s' for writing (%s)"
-msgstr "ne peut ourvrir « %s » en écriture (%s)"
-
-#: awkgram.y:2495
-#, c-format
-msgid "%s: close failed (%s)"
-msgstr "%s: échec de fermeture (%s)"
-
-#: awkgram.y:2605
-msgid "shadow_funcs() called twice!"
-msgstr "shadows_funcs() appelé deux fois!"
-
-#: awkgram.y:2680
-#, c-format
-msgid "function `%s': can't use function name as parameter name"
-msgstr "fonction « %s »: ne peut utilise le nom de la fonction comme paramètre"
-
-#: awkgram.y:2690
-#, c-format
-msgid "function name `%s' previously defined"
-msgstr "nom de la fonction « %s » définie précédemment"
-
-#: awkgram.y:2838 awkgram.y:2844
-#, c-format
-msgid "function `%s' called but never defined"
-msgstr "fonction « %s » appelé mais jamais définie"
-
-#: awkgram.y:2847
-#, c-format
-msgid "function `%s' defined but never called"
-msgstr "fonction « %s » définie mais jamais utilisée"
-
-#: awkgram.y:2874
-#, c-format
-msgid "regexp constant for parameter #%d yields boolean value"
-msgstr ""
-"expression régulière constante pour le paramètre #%d conduit à une valeur "
-"booléenne"
-
-#: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649
-#: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078
-#: dfa.c:1081 dfa.c:1094 dfa.c:1095
-msgid "Unbalanced ["
-msgstr "Non appariement de ["
-
-#: dfa.c:783
-msgid "Unfinished \\ escape"
-msgstr "séquence d'échappement \\ non terminée"
-
-#: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955
-msgid "unfinished repeat count"
-msgstr "répétition de compteur non terminé"
-
-#: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958
-msgid "malformed repeat count"
-msgstr "compteur de répétition mal composé"
-
-#: dfa.c:1285
-msgid "Unbalanced ("
-msgstr "Non appariement de ("
-
-#: dfa.c:1407
-msgid "No regexp syntax bits specified"
-msgstr "Aucune syntaxe d'expression régulière des bits fournie"
-
-#: dfa.c:1415
-msgid "Unbalanced )"
-msgstr "Non appariement de )"
-
-#: dfa.c:3014
-msgid "out of memory"
-msgstr "Mémoire épuisée"
-
-#: field.c:849
-msgid "split: second argument is not an array"
-msgstr "split: 2e argument n'est pas un tableau"
-
-#: field.c:876
-msgid "split: null string for third arg is a gawk extension"
-msgstr "split: chaîne vide pour le 3e argument est une extension de gawk"
-
-#: field.c:916
-msgid "`FIELDWIDTHS' is a gawk extension"
-msgstr "« FIELDWIDTHS » est une extension de gawk"
-
-#: field.c:943
-#, c-format
-msgid "field %d in FIELDWIDTHS, must be > 0"
-msgstr "champ %d dans FIELDWIDTHS, doit être > 0"
-
-#: field.c:997
-msgid "null string for `FS' is a gawk extension"
-msgstr "chaîne vide pour « FS » est une extension de gawk"
-
-#: msg.c:57
-msgid "cmd. line:"
-msgstr "cmd. ligne:"
-
-#: msg.c:123
-msgid "warning: "
-msgstr "AVERTISSEMENT:"
-
-#: msg.c:145
-msgid "error: "
-msgstr "Erreur: "
-
-#: msg.c:178
-msgid "fatal: "
-msgstr "Fatal: "
-
-#: eval.c:259
-#, c-format
-msgid "unknown nodetype %d"
-msgstr "type de noeud inconnu %d"
-
-#: eval.c:307
-msgid "buffer overflow in genflags2str"
-msgstr "débordement de tampo dans genflag2str"
-
-#: eval.c:541
-#, c-format
-msgid "for loop: array `%s' changed size from %d to %d during loop execution"
-msgstr ""
-"for loop: tableau « %s » a changé de taille de %d à %d durant l'exécution de "
-"la boucle"
-
-#: eval.c:565
-msgid "`break' outside a loop is not portable"
-msgstr "« break » en dehors de la boucle n'est pas portable"
-
-#: eval.c:569
-msgid "`break' outside a loop is not allowed"
-msgstr "« break » en dehors de la boucle n'est pas permis"
-
-#: eval.c:588
-msgid "`continue' outside a loop is not portable"
-msgstr "« continue » en dehors de la boucle n'est pas portable"
-
-#: eval.c:592
-msgid "`continue' outside a loop is not allowed"
-msgstr "« continue » en dehors de la boucle n'est pas permis"
-
-#: eval.c:622
-msgid "`next' cannot be called from a BEGIN rule"
-msgstr "« next » ne peut être appelé depuis une règle BEGIN"
-
-#: eval.c:624
-msgid "`next' cannot be called from an END rule"
-msgstr "« next » ne peut être appelé depuis une règle END"
-
-#: eval.c:636
-msgid "`nextfile' cannot be called from a BEGIN rule"
-msgstr "« nextfile » ne peut être appelé depuis une règle BEGIN"
-
-#: eval.c:638
-msgid "`nextfile' cannot be called from an END rule"
-msgstr "« nextfile » ne peut être appelé depuis une règle END"
-
-#: eval.c:679
-msgid "statement has no effect"
-msgstr "la déclaration n'a aucun effet"
-
-#: eval.c:713 eval.c:743 eval.c:1622
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "référence à une variable non initialisée « %s »"
-
-#: eval.c:721 eval.c:1608
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr ""
-"ne peut utiliser le nom de la fonction « %s » comme variable ou tableau"
-
-#: eval.c:728 eval.c:734 eval.c:1747
-#, c-format
-msgid "reference to uninitialized argument `%s'"
-msgstr "référence à un argument non initialisé « %s »"
-
-#: eval.c:823
-msgid "assignment used in conditional context"
-msgstr "affectation utilisé dans un contexte conditionnel"
-
-#: eval.c:914
-msgid ""
-"concatenation: side effects in one expression have changed the length of "
-"another!"
-msgstr ""
-"concaténation: effects de bord dans une expression a modifié la longueur "
-"d'une autre!"
-
-#: eval.c:1013
-msgid "division by zero attempted"
-msgstr "tentative de division par zéro"
-
-#: eval.c:1028
-#, c-format
-msgid "division by zero attempted in `%%'"
-msgstr "tentative de division par zéro dans « %% »"
-
-#: eval.c:1236
-msgid "division by zero attempted in `/='"
-msgstr "tentative de division par zéro dans « /= »"
-
-#: eval.c:1254
-#, c-format
-msgid "division by zero attempted in `%%='"
-msgstr "tentative de division par zéro dans « %%= »"
-
-#: eval.c:1424
-#, c-format
-msgid "%s (from %s)"
-msgstr "%s (de %s)"
-
-#: eval.c:1472
-#, c-format
-msgid "function `%s' called with more arguments than declared"
-msgstr "fonction « %s » appelée avec plus d'arguments que déclarées"
-
-#: eval.c:1519
-#, c-format
-msgid "function `%s' not defined"
-msgstr "fonction « %s » non définie"
-
-#: eval.c:1521
-#, c-format
-msgid "function %s called\n"
-msgstr "fonction %s appelée\n"
-
-#: eval.c:1580
-msgid ""
-"\n"
-"\t# Function Call Stack:\n"
-"\n"
-msgstr ""
-"\n"
-"\t# Appel d'une fonction sur la pile:\n"
-"\n"
-
-#: eval.c:1583
-msgid "\t# -- main --\n"
-msgstr "#t# -- main --\n"
-
-#: eval.c:1759
-msgid "attempt to field reference from non-numeric value"
-msgstr "tentative de référence un champ à partir d'une valeur non numérique"
-
-#: eval.c:1761
-msgid "attempt to reference from null string"
-msgstr "tentative de référence à partir d'une chaîne nulle"
-
-#: eval.c:1767
-#, c-format
-msgid "attempt to access field %d"
-msgstr "tentative d'accès du champ %d"
-
-#: eval.c:1783
-#, c-format
-msgid "attempt to use scalar parameter `%s' as an array"
-msgstr ""
-"tentative d'utilisation d'un paramètre scalaire « %s » comme un tableau"
-
-#: eval.c:1874
-msgid "`IGNORECASE' is a gawk extension"
-msgstr "« IGNORECASE » est une extension de gawk"
-
-#: eval.c:1902
-msgid "`BINMODE' is a gawk extension"
-msgstr "« BINMODE » est une extension de gawk"
-
-#: eval.c:2014
-#, c-format
-msgid "bad `%sFMT' specification `%s'"
-msgstr "« %sFMT » spécification erronée « %s »"
-
-#: eval.c:2080
-msgid "turning off `--lint' due to assignment to `LINT'"
-msgstr "désactivation « --lint » en raison d'une affectation à « LINT »"
-
-#: eval.c:2116
-msgid "NF set to negative value"
-msgstr "NF initialisé avec une valeur négative"
-
-#: io.c:240
-#, c-format
-msgid "cannot open file `%s' for reading (%s)"
-msgstr "ne peut ouvrir le fichier « %s » en lecture (%s)"
-
-#: io.c:320
-#, c-format
-msgid "close of fd %d (`%s') failed (%s)"
-msgstr "fermeture de fd %d (« %s ») en échec (%s)"
-
-#: io.c:432
-#, c-format
-msgid "invalid tree type %s in redirect()"
-msgstr "type d'arbre invalide %s dans redirect()"
-
-#: io.c:438
-#, c-format
-msgid "expression in `%s' redirection only has numeric value"
-msgstr ""
-"l'expression de la redirection de « %s » a seulement une valeur numérique"
-
-#: io.c:444
-#, c-format
-msgid "expression for `%s' redirection has null string value"
-msgstr ""
-"l'expression de la redirection de « %s » a une valeur nulle pour la chaîne"
-
-#: io.c:449
-#, c-format
-msgid "filename `%s' for `%s' redirection may be result of logical expression"
-msgstr ""
-"nom de fichier « %s » pour le redirection « %s » peut être le résultat d'une "
-"expression logique"
-
-#: io.c:471
-#, c-format
-msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
-msgstr "mélange non nécessaire de « > » et de « >> » pour le fichier « %.*s »"
-
-#: io.c:523
-#, c-format
-msgid "can't open pipe `%s' for output (%s)"
-msgstr "ne peut ouvrir un pipe « %s » en sortie (%s)"
-
-#: io.c:532
-#, c-format
-msgid "can't open pipe `%s' for input (%s)"
-msgstr "ne peut ouvrir un pipe « %s » en entrée (%s)"
-
-#: io.c:545
-#, c-format
-msgid "can't open two way socket `%s' for input/output (%s)"
-msgstr ""
-"ne peut ouvrir un socket bidirectionnel « %s » pour les entrées/sorties (%s)"
-
-#: io.c:549
-#, c-format
-msgid "can't open two way pipe `%s' for input/output (%s)"
-msgstr ""
-"ne peut ouvrir un pipe bidirectionnel « %s » pour les entrées/sorties (%s)"
-
-#: io.c:625
-#, c-format
-msgid "can't redirect from `%s' (%s)"
-msgstr "ne peut rediriger de « %s » (%s)"
-
-#: io.c:628
-#, c-format
-msgid "can't redirect to `%s' (%s)"
-msgstr "ne peut rediriger vers « %s » (%s)"
-
-#: io.c:667
-msgid ""
-"reached system limit for open files: starting to multiplex file descriptors"
-msgstr ""
-"limite système atteinte pour l'ouverture des fichiers: début du multiplexage "
-"des descripteurs de fichiers"
-
-#: io.c:679
-#, c-format
-msgid "close of `%s' failed (%s)."
-msgstr "fermeture de « %s » en échec (%s)"
-
-#: io.c:686
-msgid "too many pipes or input files open"
-msgstr "trop de pipes ou de fichiers en lecture ouverts"
-
-#: io.c:709
-msgid "close: second argument must be `to' or `from'"
-msgstr "close: 2e argument doit être « to » ou « from »"
-
-#: io.c:723
-#, c-format
-msgid "close: `%.*s' is not an open file, pipe or co-process"
-msgstr "close: « %.*s » n'est pas ni un fichier ouvert, pipe ou co-processus"
-
-#: io.c:727
-msgid "close of redirection that was never opened"
-msgstr "fermeture de la redirection qui n'a jamais été ouverte"
-
-#: io.c:754
-#, c-format
-msgid "close: redirection `%s' not opened with `|&', second argument ignored"
-msgstr ""
-"close: redirection « %s » n'a pas été ouverte ave « |& » 2e argument ignoré"
-
-#: io.c:811
-#, c-format
-msgid "failure status (%d) on pipe close of `%s' (%s)"
-msgstr "constat d'échec (%d) lors de la fermeture du pipe « %s » (%s)"
-
-#: io.c:814
-#, c-format
-msgid "failure status (%d) on file close of `%s' (%s)"
-msgstr "constat d'échec (%d) lors de la fermeture du fichier « %s » (%s)"
-
-#: io.c:833
-#, c-format
-msgid "no explicit close of socket `%s' provided"
-msgstr "aucune fermeture explicite du socket « %s » fournie"
-
-#: io.c:836
-#, c-format
-msgid "no explicit close of co-process `%s' provided"
-msgstr "aucune fermeture explicite du co-processus « %s » fournie"
-
-#: io.c:839
-#, c-format
-msgid "no explicit close of pipe `%s' provided"
-msgstr "aucune fermeture explicite du pipe « %s » fournie"
-
-#: io.c:842
-#, c-format
-msgid "no explicit close of file `%s' provided"
-msgstr "aucune fermeture explicite du fichier « %s » fournie"
-
-#: io.c:871 io.c:925
-#, c-format
-msgid "error writing standard output (%s)"
-msgstr "erreur lors de l'écriture vers stdout (%s)"
-
-#: io.c:875 io.c:929
-#, c-format
-msgid "error writing standard error (%s)"
-msgstr "erreur lors de l'écriture vers stderr (%s)"
-
-#: io.c:883
-#, c-format
-msgid "pipe flush of `%s' failed (%s)."
-msgstr "vidange du pipie de « %s » en échec (%s)"
-
-#: io.c:886
-#, c-format
-msgid "co-process flush of pipe to `%s' failed (%s)."
-msgstr "vidange du pipe par le co-processus vers « %s » en échec (%s)"
-
-#: io.c:889
-#, c-format
-msgid "file flush of `%s' failed (%s)."
-msgstr "vidange du fichier « %s » en échec (%s)"
-
-#: io.c:1048
-msgid "/inet/raw client not ready yet, sorry"
-msgstr "le client /inet/raw n'est pas encore prêt, désolé"
-
-#: io.c:1050 io.c:1087
-msgid "only root may use `/inet/raw'."
-msgstr "seul root peut utiliser « /inet/raw »"
-
-#: io.c:1085
-msgid "/inet/raw server not ready yet, sorry"
-msgstr "le serveur /inet/raw n'est pas encore prêt, désolé"
-
-#: io.c:1175
-#, c-format
-msgid "no (known) protocol supplied in special filename `%s'"
-msgstr "aucun protocole (connu) fourni dans le nom de fichier spécial « %s »"
-
-#: io.c:1193
-#, c-format
-msgid "special file name `%s' is incomplete"
-msgstr "nom spécial de fichier « %s » est incomplet"
-
-#: io.c:1205
-#, c-format
-msgid "local port invalid in `%s'"
-msgstr "port local invalide dans « %s »"
-
-#: io.c:1217
-msgid "must supply a remote hostname to `/inet'"
-msgstr "un nom de hôte distant doit être fourni à « /inet »"
-
-#: io.c:1232
-msgid "must supply a remote port to `/inet'"
-msgstr "un port distant doit être fournis à « /inet »"
-
-#: io.c:1238
-#, c-format
-msgid "remote port invalid in `%s'"
-msgstr "port distant invalide dans « %s »"
-
-#: io.c:1248
-msgid "TCP/IP communications are not supported"
-msgstr "les communications TCP/IP ne sont pas supportées"
-
-#: io.c:1257 io.c:1438
-#, c-format
-msgid "file `%s' is a directory"
-msgstr "le fichier « %s » est un répertoire"
-
-#: io.c:1327
-#, c-format
-msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
-msgstr "utliser « PROCINFO[\"%s\"] » au lieu de « %s »"
-
-#: io.c:1359
-msgid "use `PROCINFO[...]' instead of `/dev/user'"
-msgstr "utliser « PROCINFO[\"%s\"] » au lieu de « /dev/user »"
-
-#: io.c:1424
-#, c-format
-msgid "could not open `%s', mode `%s'"
-msgstr "ne peut ouvrir « %s », mode « %s »"
-
-#: io.c:1550 io.c:1602 io.c:1732 io.c:1754
-#, c-format
-msgid "moving pipe to stdout in child failed (dup: %s)"
-msgstr "échec de redirection du pipe vers stdout du processus fils (dup: %s)"
-
-#: io.c:1554 io.c:1607
-#, c-format
-msgid "moving pipe to stdin in child failed (dup: %s)"
-msgstr "échec de redirection du pipe vers stdin du processus fils (dup: %s)"
-
-#: io.c:1571 io.c:1745
-msgid "restoring stdout in parent process failed\n"
-msgstr "restauration de stdout par le processus parent a échoué\n"
-
-#: io.c:1576
-msgid "restoring stdin in parent process failed\n"
-msgstr "restauration de stdin par le processus parent a échoué\n"
-
-#: io.c:1599 io.c:1751
-#, c-format
-msgid "close of stdout in child failed (%s)"
-msgstr "échec de fermeture de stdout du processus fils (%s)"
-
-#: io.c:1604
-#, c-format
-msgid "close of stdin in child failed (%s)"
-msgstr "échec de fermeture de stdin du processus fils (%s)"
-
-#: io.c:1610 io.c:1756 io.c:1767
-#, c-format
-msgid "close of pipe failed (%s)"
-msgstr "échec de la fermeture du pipe (%s)"
-
-#: io.c:1655
-msgid "`|&' not supported"
-msgstr "« |& » non supporté"
-
-#: io.c:1722
-#, c-format
-msgid "cannot open pipe `%s' (%s)"
-msgstr "ne ouvrir un pipe « %s » (%s)"
-
-#: io.c:1763
-#, c-format
-msgid "cannot create child process for `%s' (fork: %s)"
-msgstr "ne créer le processus fils pour « %s » (fork: %s)"
+#~ 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"
-#: io.c:2104
-#, c-format
-msgid "data file `%s' is empty"
-msgstr "le fichier de données « %s » est vide"
+#~ msgid "fptr %x not in tokentab\n"
+#~ msgstr "fptr %x n'est pas dans la table des jetons\n"
-#: io.c:2175
-#, c-format
-msgid "internal error: file `%s', line %d\n"
-msgstr "erreur interne: fichier « %s », ligne %d\n"
+#~ msgid "gsub third parameter is not a changeable object"
+#~ msgstr "gsub: 3e paramètre n'est pas un objet interchangeable"
-#: io.c:2277
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "erreur lors de la lecture du fichier source « %s »: %s"
+#~ msgid "Unbalanced ["
+#~ msgstr "Non appariement de ["
-#: io.c:2521
-msgid "multicharacter value of `RS' is a gawk extension"
-msgstr "valeur de « RS » avec multiple caractères est une extension gawk"
+#~ msgid "Unfinished \\ escape"
+#~ msgstr "séquence d'échappement \\ non terminée"
-#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
-msgid "can't convert string to float"
-msgstr "ne peut convertir la chaîne en nombre flottant"
+#~ msgid "unfinished repeat count"
+#~ msgstr "répétition de compteur non terminé"
-#: node.c:342
-msgid "backslash at end of string"
-msgstr "barre oblique inverse à la fin de la chaîne"
+#~ msgid "malformed repeat count"
+#~ msgstr "compteur de répétition mal composé"
-#: node.c:524
-msgid "POSIX does not allow `\\x' escapes"
-msgstr "POSIX ne permet pas de séquence d'échappement « \\x »"
+#~ msgid "Unbalanced ("
+#~ msgstr "Non appariement de ("
-#: node.c:530
-msgid "no hex digits in `\\x' escape sequence"
-msgstr "aucun chiffre hexadécimal dans la séquence d'échappement « \\x » "
+#~ msgid "No regexp syntax bits specified"
+#~ msgstr "Aucune syntaxe d'expression régulière des bits fournie"
-#: node.c:564
-#, c-format
-msgid "escape sequence `\\%c' treated as plain `%c'"
-msgstr "séquence d'échappement « \\%c » traitée simplement comme « %c »"
+#~ msgid "Unbalanced )"
+#~ msgstr "Non appariement de )"
-#: re.c:208
-#, c-format
-msgid "regex match failed, not enough memory to match string \"%.*s%s\""
-msgstr ""
-"échec de concordance de regex, pas assez de mémoire pour traiter la chaîne "
-"\"%.*s%s\""
+#~ msgid "out of memory"
+#~ msgstr "Mémoire épuisée"
-#: posix/gawkmisc.c:122
-#, c-format
-msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
-msgstr "%s %s « %s »: ne peut initialiser close-on-exec: (fcntl: %s)"
+#~ msgid "internal error: file `%s', line %d\n"
+#~ msgstr "erreur interne: fichier « %s », ligne %d\n"
#~ msgid ""
#~ "\n"
diff --git a/po/gawk.pot b/po/gawk.pot
index d0672df2..acc0be7a 100644
--- a/po/gawk.pot
+++ b/po/gawk.pot
@@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2002-05-01 16:40+0300\n"
+"POT-Creation-Date: 2003-03-19 14:25+0200\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"
@@ -15,1678 +15,1673 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: array.c:243 array.c:275 array.c:280 eval.c:483
+#: array.c:274 array.c:309 array.c:314 eval.c:494
#, c-format
msgid "attempt to use scalar `%s' as array"
msgstr ""
-#: array.c:304
+#: array.c:338
#, c-format
msgid "reference to uninitialized element `%s[\"%s\"]'"
msgstr ""
-#: array.c:310
+#: array.c:344
#, c-format
msgid "subscript of array `%s' is null string"
msgstr ""
-#: array.c:373 array.c:456
+#: array.c:412 array.c:425 array.c:466
#, c-format
-msgid "delete: illegal use of variable `%s' as array"
+msgid "delete: index `%s' not in array `%s'"
msgstr ""
-#: array.c:406
+#: array.c:432 array.c:515
#, c-format
-msgid "delete: index `%s' not in array `%s'"
+msgid "delete: illegal use of variable `%s' as array"
msgstr ""
-#: array.c:571
+#: array.c:633
#, c-format
msgid "%s: empty (null)\n"
msgstr ""
-#: array.c:576
+#: array.c:638
#, c-format
msgid "%s: empty (zero)\n"
msgstr ""
-#: array.c:580
+#: array.c:642
#, c-format
msgid "%s: table_size = %d, array_size = %d\n"
msgstr ""
-#: array.c:612
+#: array.c:671
#, c-format
msgid "%s: is parameter\n"
msgstr ""
-#: array.c:617
+#: array.c:676
#, c-format
msgid "%s: array_ref to %s\n"
msgstr ""
-#: array.c:844
+#: array.c:975
msgid "asort: first argument is not an array"
msgstr ""
-#: array.c:853
+#: array.c:984
msgid "asort: second argument is not an array"
msgstr ""
-#: builtin.c:107
+#: awkgram.y:208
#, c-format
-msgid "%s to \"%s\" failed (%s)"
-msgstr ""
-
-#: builtin.c:108
-msgid "standard output"
+msgid "%s blocks must have an action part"
msgstr ""
-#: builtin.c:109
-msgid "reason unknown"
-msgstr ""
-
-#: builtin.c:122
-msgid "exp: received non-numeric argument"
+#: awkgram.y:211
+msgid "each rule must have a pattern or an action part"
msgstr ""
-#: builtin.c:128
+#: awkgram.y:267
#, c-format
-msgid "exp: argument %g is out of range"
+msgid "`%s' is a built-in function, it cannot be redefined"
msgstr ""
-#: builtin.c:186
+#: awkgram.y:314
#, c-format
-msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
+msgid "regexp constant `/%s/' looks like a C comment, but is not"
msgstr ""
-#: builtin.c:189
-#, c-format
-msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
+#: awkgram.y:340
+msgid "statement may have no effect"
msgstr ""
-#: builtin.c:201
+#: awkgram.y:431 awkgram.y:451
#, c-format
-msgid "fflush: `%s' is not an open file, pipe or co-process"
+msgid "`%s' used in %s action"
msgstr ""
-#: builtin.c:295
-msgid "index: received non-string first argument"
+#: awkgram.y:444 awkgram.y:447
+msgid "`nextfile' is a gawk extension"
msgstr ""
-#: builtin.c:297
-msgid "index: received non-string second argument"
+#: awkgram.y:461
+msgid "`return' used outside function context"
msgstr ""
-#: builtin.c:407
-msgid "int: received non-numeric argument"
+#: awkgram.y:500
+msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
msgstr ""
-#: builtin.c:424
-msgid "length: received non-string argument"
+#: awkgram.y:513 awkgram.y:520
+msgid "`delete array' is a gawk extension"
msgstr ""
-#: builtin.c:440
-msgid "log: received non-numeric argument"
+#: awkgram.y:528 awkgram.y:535
+msgid "`delete(array)' is a non-portable tawk extension"
msgstr ""
-#: builtin.c:443
-#, c-format
-msgid "log: received negative argument %g"
+#: awkgram.y:578
+msgid "multistage two-way pipelines don't work"
msgstr ""
-#: builtin.c:605 builtin.c:608
-msgid "must use `count$' on all formats or none"
+#: awkgram.y:669
+msgid "regular expression on right of assignment"
msgstr ""
-#: builtin.c:703
-msgid "`$' is not permitted in awk formats"
+#: awkgram.y:679
+msgid "regular expression on left of `~' or `!~' operator"
msgstr ""
-#: builtin.c:709
-msgid "arg count with `$' must be > 0"
+#: awkgram.y:687
+msgid "regular expression on right of comparison"
msgstr ""
-#: builtin.c:711
-#, c-format
-msgid "arg count %d greater than total number of supplied arguments"
+#: awkgram.y:754
+msgid "non-redirected `getline' undefined inside END action"
msgstr ""
-#: builtin.c:713
-msgid "`$' not permitted after period in format"
+#: awkgram.y:781
+msgid "call of `length' without parentheses is not portable"
msgstr ""
-#: builtin.c:726
-msgid "no `$' supplied for positional field width or precision"
+#: awkgram.y:784
+msgid "call of `length' without parentheses is deprecated by POSIX"
msgstr ""
-#: builtin.c:784
-msgid "`l' is meaningless in awk formats; ignored"
+#: awkgram.y:835
+msgid "invalid subscript expression"
msgstr ""
-#: builtin.c:788
-msgid "`l' is not permitted in POSIX awk formats"
+#: awkgram.y:1020
+msgid "unexpected newline or end of string"
msgstr ""
-#: builtin.c:799
-msgid "`L' is meaningless in awk formats; ignored"
+#: awkgram.y:1115
+msgid "empty program text on command line"
msgstr ""
-#: builtin.c:803
-msgid "`L' is not permitted in POSIX awk formats"
+#: awkgram.y:1172
+#, c-format
+msgid "can't open source file `%s' for reading (%s)"
msgstr ""
-#: builtin.c:814
-msgid "`h' is meaningless in awk formats; ignored"
+#: awkgram.y:1207
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
msgstr ""
-#: builtin.c:818
-msgid "`h' is not permitted in POSIX awk formats"
+#: awkgram.y:1215
+#, c-format
+msgid "source file `%s' is empty"
msgstr ""
-#: builtin.c:1067
-msgid "not enough arguments to satisfy format string"
+#: awkgram.y:1417 awkgram.y:1527 awkgram.y:1545 awkgram.y:1895 awkgram.y:1980
+msgid "source file does not end in newline"
msgstr ""
-#: builtin.c:1069
-msgid "^ ran out for this one"
+#: awkgram.y:1481
+msgid "unterminated regexp ends with `\\' at end of file"
msgstr ""
-#: builtin.c:1074
-msgid "[s]printf: format specifier does not have control letter"
+#: awkgram.y:1501
+msgid "unterminated regexp"
msgstr ""
-#: builtin.c:1077
-msgid "too many arguments supplied for format string"
+#: awkgram.y:1504
+msgid "unterminated regexp at end of file"
msgstr ""
-#: builtin.c:1120 builtin.c:1123
-msgid "printf: no arguments"
+#: awkgram.y:1571
+msgid "use of `\\ #...' line continuation is not portable"
msgstr ""
-#: builtin.c:1156
-msgid "sqrt: received non-numeric argument"
+#: awkgram.y:1583
+msgid "backslash not last character on line"
msgstr ""
-#: builtin.c:1160
-#, c-format
-msgid "sqrt: called with negative argument %g"
+#: awkgram.y:1628
+msgid "POSIX does not allow operator `**='"
msgstr ""
-#: builtin.c:1182
-#, c-format
-msgid "substr: start index %g is invalid, using 1"
+#: awkgram.y:1630
+msgid "old awk does not support operator `**='"
msgstr ""
-#: builtin.c:1187
-#, c-format
-msgid "substr: non-integer start index %g will be truncated"
+#: awkgram.y:1639
+msgid "POSIX does not allow operator `**'"
msgstr ""
-#: builtin.c:1201
-#, c-format
-msgid "substr: length %g is <= 0"
+#: awkgram.y:1641
+msgid "old awk does not support operator `**'"
msgstr ""
-#: builtin.c:1207
-#, c-format
-msgid "substr: non-integer length %g will be truncated"
+#: awkgram.y:1672
+msgid "operator `^=' is not supported in old awk"
msgstr ""
-#: builtin.c:1214
-msgid "substr: source string is zero length"
+#: awkgram.y:1680
+msgid "operator `^' is not supported in old awk"
msgstr ""
-#: builtin.c:1221
-#, c-format
-msgid ""
-"substr: length %d at start index %d exceeds length of first argument (%d)"
+#: awkgram.y:1764 awkgram.y:1781
+msgid "unterminated string"
msgstr ""
-#: builtin.c:1227
+#: awkgram.y:1941
#, c-format
-msgid "substr: start index %d is past end of string"
-msgstr ""
-
-#: builtin.c:1263
-msgid "strftime: received non-string first argument"
-msgstr ""
-
-#: builtin.c:1269
-msgid "strftime: received empty format string"
-msgstr ""
-
-#: builtin.c:1278
-msgid "strftime: received non-numeric second argument"
+msgid "invalid char '%c' in expression"
msgstr ""
-#: builtin.c:1341
-msgid "mktime: received non-string argument"
+#: awkgram.y:2001
+#, c-format
+msgid "`%s' is a gawk extension"
msgstr ""
-#: builtin.c:1386
-msgid "system: received non-string argument"
+#: awkgram.y:2004
+#, c-format
+msgid "`%s' is a Bell Labs extension"
msgstr ""
-#: builtin.c:1512
-msgid "tolower: received non-string argument"
+#: awkgram.y:2007
+#, c-format
+msgid "POSIX does not allow `%s'"
msgstr ""
-#: builtin.c:1561
-msgid "toupper: received non-string argument"
+#: awkgram.y:2011
+#, c-format
+msgid "`%s' is not supported in old awk"
msgstr ""
-#: builtin.c:1606
-msgid "atan2: received non-numeric first argument"
+#: awkgram.y:2038
+msgid "`goto' considered harmful!\n"
msgstr ""
-#: builtin.c:1608
-msgid "atan2: received non-numeric second argument"
+#: awkgram.y:2102
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
msgstr ""
-#: builtin.c:1627
-msgid "sin: received non-numeric argument"
+#: awkgram.y:2121 awkgram.y:2124
+msgid "match: third argument is a gawk extension"
msgstr ""
-#: builtin.c:1643
-msgid "cos: received non-numeric argument"
+#: awkgram.y:2137
+#, c-format
+msgid "%s: string literal as last arg of substitute has no effect"
msgstr ""
-#: builtin.c:1687
-msgid "srand: received non-numeric argument"
+#: awkgram.y:2140
+#, c-format
+msgid "%s third parameter is not a changeable object"
msgstr ""
-#: builtin.c:1721
-msgid "match: third argument is not an array"
+#: awkgram.y:2167 awkgram.y:2170
+msgid "close: second argument is a gawk extension"
msgstr ""
-#: builtin.c:2157
-msgid "gensub: 3rd argument of 0 treated as 1"
+#: awkgram.y:2180
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
-#: builtin.c:2268 builtin.c:2270
-msgid "lshift: received non-numeric first argument"
+#: awkgram.y:2195
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
msgstr ""
-#: builtin.c:2272
+#: awkgram.y:2266
#, c-format
-msgid "lshift(%lf, %lf): negative values will give strange results"
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
msgstr ""
-#: builtin.c:2274
+#: awkgram.y:2299
#, c-format
-msgid "lshift(%lf, %lf): fractional values will be truncated"
+msgid "function `%s': parameter `%s' shadows global variable"
msgstr ""
-#: builtin.c:2276
+#: awkgram.y:2411
#, c-format
-msgid "lshift(%lf, %lf): too large shift value will give strange results"
+msgid "could not open `%s' for writing (%s)"
msgstr ""
-#: builtin.c:2305 builtin.c:2307
-msgid "rshift: received non-numeric first argument"
+#: awkgram.y:2412 profile.c:93
+msgid "sending profile to standard error"
msgstr ""
-#: builtin.c:2309
+#: awkgram.y:2442
#, c-format
-msgid "rshift(%lf, %lf): negative values will give strange results"
+msgid "%s: close failed (%s)"
msgstr ""
-#: builtin.c:2311
-#, c-format
-msgid "rshift(%lf, %lf): fractional values will be truncated"
+#: awkgram.y:2566
+msgid "shadow_funcs() called twice!"
msgstr ""
-#: builtin.c:2313
-#, c-format
-msgid "rshift(%lf, %lf): too large shift value will give strange results"
+#: awkgram.y:2593
+msgid "there were shadowed variables."
msgstr ""
-#: builtin.c:2342 builtin.c:2344
-msgid "and: received non-numeric first argument"
+#: awkgram.y:2666
+#, c-format
+msgid "function `%s': can't use function name as parameter name"
msgstr ""
-#: builtin.c:2346
+#: awkgram.y:2676
#, c-format
-msgid "and(%lf, %lf): negative values will give strange results"
+msgid "function name `%s' previously defined"
msgstr ""
-#: builtin.c:2348
+#: awkgram.y:2827 awkgram.y:2833
#, c-format
-msgid "and(%lf, %lf): fractional values will be truncated"
+msgid "function `%s' called but never defined"
msgstr ""
-#: builtin.c:2377 builtin.c:2379
-msgid "or: received non-numeric first argument"
+#: awkgram.y:2836
+#, c-format
+msgid "function `%s' defined but never called"
msgstr ""
-#: builtin.c:2381
+#: awkgram.y:2863
#, c-format
-msgid "or(%lf, %lf): negative values will give strange results"
+msgid "regexp constant for parameter #%d yields boolean value"
msgstr ""
-#: builtin.c:2383
+#: awkgram.y:2876
#, c-format
-msgid "or(%lf, %lf): fractional values will be truncated"
+msgid ""
+"function `%s' called with space between name and `(',\n"
+"%s"
msgstr ""
-#: builtin.c:2412 builtin.c:2414
-msgid "xor: received non-numeric first argument"
+#: awkgram.y:2878
+msgid "or used as a variable or an array"
msgstr ""
-#: builtin.c:2416
+#: builtin.c:111
#, c-format
-msgid "xor(%lf, %lf): negative values will give strange results"
+msgid "%s to \"%s\" failed (%s)"
msgstr ""
-#: builtin.c:2418
-#, c-format
-msgid "xor(%lf, %lf): fractional values will be truncated"
+#: builtin.c:112
+msgid "standard output"
msgstr ""
-#: builtin.c:2446
-msgid "compl: received non-numeric argument"
+#: builtin.c:113
+msgid "reason unknown"
msgstr ""
-#: builtin.c:2448
-#, c-format
-msgid "compl(%lf): negative value will give strange results"
+#: builtin.c:126
+msgid "exp: received non-numeric argument"
msgstr ""
-#: builtin.c:2450
+#: builtin.c:132
#, c-format
-msgid "compl(%lf): fractional value will be truncated"
+msgid "exp: argument %g is out of range"
msgstr ""
-#: builtin.c:2621
+#: builtin.c:190
#, c-format
-msgid "dcgettext: `%s' is not a valid locale category"
-msgstr ""
-
-#: ext.c:60 ext.c:64
-msgid "`extension' is a gawk extension"
+msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
-#: ext.c:74
+#: builtin.c:193
#, c-format
-msgid "extension: cannot open `%s' (%s)\n"
+msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
-#: ext.c:82
+#: builtin.c:205
#, c-format
-msgid "extension: library `%s': cannot call function `%s' (%s)\n"
+msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr ""
-#: ext.c:180
-msgid "Operation Not Supported"
+#: builtin.c:299
+msgid "index: received non-string first argument"
msgstr ""
-#: getopt.c:692 getopt.c:704
-#, c-format
-msgid "%s: option `%s' is ambiguous\n"
+#: builtin.c:301
+msgid "index: received non-string second argument"
msgstr ""
-#: getopt.c:737 getopt.c:741
-#, c-format
-msgid "%s: option `--%s' doesn't allow an argument\n"
+#: builtin.c:411
+msgid "int: received non-numeric argument"
msgstr ""
-#: getopt.c:750 getopt.c:755
-#, c-format
-msgid "%s: option `%c%s' doesn't allow an argument\n"
+#: builtin.c:428
+msgid "length: received non-string argument"
msgstr ""
-#: getopt.c:791 getopt.c:804 getopt.c:1093 getopt.c:1106
-#, c-format
-msgid "%s: option `%s' requires an argument\n"
+#: builtin.c:444
+msgid "log: received non-numeric argument"
msgstr ""
-#: getopt.c:842 getopt.c:845
+#: builtin.c:447
#, c-format
-msgid "%s: unrecognized option `--%s'\n"
+msgid "log: received negative argument %g"
msgstr ""
-#: getopt.c:853 getopt.c:856
-#, c-format
-msgid "%s: unrecognized option `%c%s'\n"
+#: builtin.c:609 builtin.c:612
+msgid "must use `count$' on all formats or none"
msgstr ""
-#: getopt.c:903 getopt.c:906
-#, c-format
-msgid "%s: illegal option -- %c\n"
+#: builtin.c:714
+msgid "`$' is not permitted in awk formats"
msgstr ""
-#: getopt.c:912 getopt.c:915
-#, c-format
-msgid "%s: invalid option -- %c\n"
+#: builtin.c:720
+msgid "arg count with `$' must be > 0"
msgstr ""
-#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412
+#: builtin.c:722
#, c-format
-msgid "%s: option requires an argument -- %c\n"
+msgid "arg count %ld greater than total number of supplied arguments"
msgstr ""
-#: getopt.c:1025 getopt.c:1036
-#, c-format
-msgid "%s: option `-W %s' is ambiguous\n"
+#: builtin.c:724
+msgid "`$' not permitted after period in format"
msgstr ""
-#: getopt.c:1060 getopt.c:1072
-#, c-format
-msgid "%s: option `-W %s' doesn't allow an argument\n"
+#: builtin.c:737
+msgid "no `$' supplied for positional field width or precision"
msgstr ""
-#: main.c:307
-msgid "`-m[fr]' option irrelevant in gawk"
+#: builtin.c:795
+msgid "`l' is meaningless in awk formats; ignored"
msgstr ""
-#: main.c:309
-msgid "-m option usage: `-m[fr] nnn'"
+#: builtin.c:799
+msgid "`l' is not permitted in POSIX awk formats"
msgstr ""
-#: main.c:326
-#, c-format
-msgid "%s: option `-W %s' unrecognized, ignored\n"
+#: builtin.c:810
+msgid "`L' is meaningless in awk formats; ignored"
msgstr ""
-#: main.c:357
-msgid "empty argument to `--source' ignored"
+#: builtin.c:814
+msgid "`L' is not permitted in POSIX awk formats"
msgstr ""
-#: main.c:429
-msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
+#: builtin.c:825
+msgid "`h' is meaningless in awk formats; ignored"
msgstr ""
-#: main.c:434
-msgid "`--posix' overrides `--traditional'"
+#: builtin.c:829
+msgid "`h' is not permitted in POSIX awk formats"
msgstr ""
-#: main.c:445
-msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
+#: builtin.c:1078
+msgid "not enough arguments to satisfy format string"
msgstr ""
-#: main.c:449
-#, c-format
-msgid "running %s setuid root may be a security problem"
+#: builtin.c:1080
+msgid "^ ran out for this one"
msgstr ""
-#: main.c:478
-#, c-format
-msgid "can't set mode on stdin (%s)"
+#: builtin.c:1085
+msgid "[s]printf: format specifier does not have control letter"
msgstr ""
-#: main.c:481
-#, c-format
-msgid "can't set mode on stdout (%s)"
+#: builtin.c:1088
+msgid "too many arguments supplied for format string"
msgstr ""
-#: main.c:483
-#, c-format
-msgid "can't set mode on stderr (%s)"
+#: builtin.c:1154 builtin.c:1157
+msgid "printf: no arguments"
msgstr ""
-#: main.c:512
-msgid "no program text at all!"
+#: builtin.c:1181
+msgid "sqrt: received non-numeric argument"
msgstr ""
-#: main.c:556
+#: builtin.c:1185
#, c-format
-msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
+msgid "sqrt: called with negative argument %g"
msgstr ""
-#: main.c:558
+#: builtin.c:1207
#, c-format
-msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
-msgstr ""
-
-#: main.c:563
-msgid "POSIX options:\t\tGNU long options:\n"
-msgstr ""
-
-#: main.c:564
-msgid "\t-f progfile\t\t--file=progfile\n"
+msgid "substr: start index %g is invalid, using 1"
msgstr ""
-#: main.c:565
-msgid "\t-F fs\t\t\t--field-separator=fs\n"
+#: builtin.c:1212
+#, c-format
+msgid "substr: non-integer start index %g will be truncated"
msgstr ""
-#: main.c:566
-msgid "\t-v var=val\t\t--assign=var=val\n"
+#: builtin.c:1231
+#, c-format
+msgid "substr: length %g is <= 0"
msgstr ""
-#: main.c:567
-msgid "\t-m[fr] val\n"
+#: builtin.c:1233
+#, c-format
+msgid "substr: length %g is < 0"
msgstr ""
-#: main.c:568
-msgid "\t-W compat\t\t--compat\n"
+#: builtin.c:1240
+#, c-format
+msgid "substr: non-integer length %g will be truncated"
msgstr ""
-#: main.c:569
-msgid "\t-W copyleft\t\t--copyleft\n"
+#: builtin.c:1245
+#, c-format
+msgid "substr: length %g too big for string indexing, truncating to %g"
msgstr ""
-#: main.c:570
-msgid "\t-W copyright\t\t--copyright\n"
+#: builtin.c:1257
+msgid "substr: source string is zero length"
msgstr ""
-#: main.c:571
-msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
+#: builtin.c:1263
+#, c-format
+msgid "substr: start index %g is past end of string"
msgstr ""
-#: main.c:572
-msgid "\t-W gen-po\t\t--gen-po\n"
+#: builtin.c:1271
+#, c-format
+msgid ""
+"substr: length %g at start index %g exceeds length of first argument (%lu)"
msgstr ""
-#: main.c:573
-msgid "\t-W help\t\t\t--help\n"
+#: builtin.c:1306
+msgid "strftime: received non-string first argument"
msgstr ""
-#: main.c:574
-msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+#: builtin.c:1312
+msgid "strftime: received empty format string"
msgstr ""
-#: main.c:575
-msgid "\t-W lint-old\t\t--lint-old\n"
+#: builtin.c:1321
+msgid "strftime: received non-numeric second argument"
msgstr ""
-#: main.c:576
-msgid "\t-W non-decimal-data\t--non-decimal-data\n"
+#: builtin.c:1384
+msgid "mktime: received non-string argument"
msgstr ""
-#: main.c:578
-msgid "\t-W nostalgia\t\t--nostalgia\n"
+#: builtin.c:1429
+msgid "system: received non-string argument"
msgstr ""
-#: main.c:581
-msgid "\t-W parsedebug\t\t--parsedebug\n"
+#: builtin.c:1573
+msgid "tolower: received non-string argument"
msgstr ""
-#: main.c:583
-msgid "\t-W profile[=file]\t--profile[=file]\n"
+#: builtin.c:1622
+msgid "toupper: received non-string argument"
msgstr ""
-#: main.c:584
-msgid "\t-W posix\t\t--posix\n"
+#: builtin.c:1667
+msgid "atan2: received non-numeric first argument"
msgstr ""
-#: main.c:585
-msgid "\t-W re-interval\t\t--re-interval\n"
+#: builtin.c:1669
+msgid "atan2: received non-numeric second argument"
msgstr ""
-#: main.c:586
-msgid "\t-W source=program-text\t--source=program-text\n"
+#: builtin.c:1688
+msgid "sin: received non-numeric argument"
msgstr ""
-#: main.c:587
-msgid "\t-W traditional\t\t--traditional\n"
+#: builtin.c:1704
+msgid "cos: received non-numeric argument"
msgstr ""
-#: main.c:588
-msgid "\t-W usage\t\t--usage\n"
+#: builtin.c:1748
+msgid "srand: received non-numeric argument"
msgstr ""
-#: main.c:589
-msgid "\t-W version\t\t--version\n"
+#: builtin.c:1787
+msgid "match: third argument is not an array"
msgstr ""
-#: main.c:593
-msgid ""
-"\n"
-"To report bugs, see node `Bugs' in `gawk.info', which is\n"
-"section `Reporting Problems and Bugs' in the printed version.\n"
-"\n"
+#: builtin.c:2264
+msgid "gensub: 3rd argument of 0 treated as 1"
msgstr ""
-#: main.c:597
-msgid ""
-"gawk is a pattern scanning and processing language.\n"
-"By default it reads standard input and writes standard output.\n"
-"\n"
+#: builtin.c:2375 builtin.c:2377
+msgid "lshift: received non-numeric first argument"
msgstr ""
-#: main.c:601
-msgid ""
-"Examples:\n"
-"\tgawk '{ sum += $1 }; END { print sum }' file\n"
-"\tgawk -F: '{ print $1 }' /etc/passwd\n"
+#: builtin.c:2379
+#, c-format
+msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr ""
-#: main.c:613
+#: builtin.c:2381
#, 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"
+msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr ""
-#: main.c:621
-msgid ""
-"This program is distributed in the hope that it will be useful,\n"
-"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
-"GNU General Public License for more details.\n"
-"\n"
+#: builtin.c:2383
+#, c-format
+msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
-#: main.c:627
-msgid ""
-"You should have received a copy of the GNU General Public License\n"
-"along with this program; if not, write to the Free Software\n"
-"Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"
+#: builtin.c:2412 builtin.c:2414
+msgid "rshift: received non-numeric first argument"
msgstr ""
-#: main.c:657
-msgid "-Ft does not set FS to tab in POSIX awk"
+#: builtin.c:2416
+#, c-format
+msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr ""
-#: main.c:888
+#: builtin.c:2418
#, c-format
-msgid "invalid syntax in name `%s' for variable assignment"
+msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr ""
-#: main.c:957
-msgid "floating point exception"
+#: builtin.c:2420
+#, c-format
+msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr ""
-#: main.c:964
-msgid "fatal error: internal error"
+#: builtin.c:2449 builtin.c:2451
+msgid "and: received non-numeric first argument"
msgstr ""
-#: main.c:1014
+#: builtin.c:2453
#, c-format
-msgid "no pre-opened fd %d"
+msgid "and(%lf, %lf): negative values will give strange results"
msgstr ""
-#: main.c:1019
+#: builtin.c:2455
#, c-format
-msgid "could not pre-open /dev/null for fd %d"
+msgid "and(%lf, %lf): fractional values will be truncated"
msgstr ""
-#: main.c:1037 main.c:1046
-#, c-format
-msgid "could not find groups: %s"
+#: builtin.c:2484 builtin.c:2486
+msgid "or: received non-numeric first argument"
msgstr ""
-#: profile.c:94
+#: builtin.c:2488
#, c-format
-msgid "could not open `%s' for writing: %s"
+msgid "or(%lf, %lf): negative values will give strange results"
msgstr ""
-#: profile.c:96 awkgram.y:2465
-msgid "sending profile to standard error"
+#: builtin.c:2490
+#, c-format
+msgid "or(%lf, %lf): fractional values will be truncated"
msgstr ""
-#: profile.c:409
-msgid "internal error: Node_var with null vname"
+#: builtin.c:2519 builtin.c:2521
+msgid "xor: received non-numeric first argument"
msgstr ""
-#: profile.c:524
-msgid "internal error: Node_var_array with null vname"
+#: builtin.c:2523
+#, c-format
+msgid "xor(%lf, %lf): negative values will give strange results"
msgstr ""
-#: profile.c:554 eval.c:813
+#: builtin.c:2525
#, c-format
-msgid ""
-"function `%s' called with space between name and `(',\n"
-"%s"
+msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr ""
-#: profile.c:556 eval.c:815
-msgid "or used in other expression context"
+#: builtin.c:2553
+msgid "compl: received non-numeric argument"
msgstr ""
-#: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741
+#: builtin.c:2555
#, c-format
-msgid "attempt to use array `%s' in a scalar context"
+msgid "compl(%lf): negative value will give strange results"
msgstr ""
-#: profile.c:637 eval.c:1047
+#: builtin.c:2557
#, c-format
-msgid "illegal type (%s) in tree_eval"
+msgid "compl(%lf): fractional value will be truncated"
msgstr ""
-#: profile.c:842 eval.c:1790
+#: builtin.c:2728
#, c-format
-msgid "attempt to use function `%s' as array"
+msgid "dcgettext: `%s' is not a valid locale category"
msgstr ""
-#: profile.c:856 eval.c:1797
+#: eval.c:262
#, c-format
-msgid "`%s' is a function, assignment is not allowed"
+msgid "unknown nodetype %d"
msgstr ""
-#: profile.c:860 eval.c:1803 eval.c:1810
-msgid "assignment is not allowed to result of builtin function"
+#: eval.c:310
+msgid "buffer overflow in genflags2str"
msgstr ""
-#: profile.c:1108
+#: eval.c:555
#, c-format
-msgid "\t# gawk profile, created %s\n"
+msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
msgstr ""
-#: profile.c:1111
-msgid ""
-"\t# BEGIN block(s)\n"
-"\n"
+#: eval.c:576
+msgid "`break' outside a loop is not portable"
msgstr ""
-#: profile.c:1121
-msgid ""
-"\t# Rule(s)\n"
-"\n"
+#: eval.c:580
+msgid "`break' outside a loop is not allowed"
msgstr ""
-#: profile.c:1127
-msgid ""
-"\t# END block(s)\n"
-"\n"
+#: eval.c:597
+msgid "`continue' outside a loop is not portable"
msgstr ""
-#: profile.c:1147
-msgid ""
-"\n"
-"\t# Functions, listed alphabetically\n"
+#: eval.c:601
+msgid "`continue' outside a loop is not allowed"
msgstr ""
-#: profile.c:1357
-#, c-format
-msgid "unexpected type %s in prec_level"
+#: eval.c:635
+msgid "`next' cannot be called from a BEGIN rule"
msgstr ""
-#: regex.c:1322
-msgid "Success"
+#: eval.c:637
+msgid "`next' cannot be called from an END rule"
msgstr ""
-#: regex.c:1323
-msgid "No match"
+#: eval.c:646
+msgid "`nextfile' cannot be called from a BEGIN rule"
msgstr ""
-#: regex.c:1324
-msgid "Invalid regular expression"
+#: eval.c:648
+msgid "`nextfile' cannot be called from an END rule"
msgstr ""
-#: regex.c:1325
-msgid "Invalid collation character"
+#: eval.c:696
+msgid "statement has no effect"
msgstr ""
-#: regex.c:1326
-msgid "Invalid character class name"
+#: eval.c:731 eval.c:761 eval.c:1733
+#, c-format
+msgid "reference to uninitialized variable `%s'"
msgstr ""
-#: regex.c:1327
-msgid "Trailing backslash"
+#: eval.c:739 eval.c:1721
+#, c-format
+msgid "can't use function name `%s' as variable or array"
msgstr ""
-#: regex.c:1328
-msgid "Invalid back reference"
+#: eval.c:746 eval.c:752
+#, c-format
+msgid "reference to uninitialized argument `%s'"
msgstr ""
-#: regex.c:1329
-msgid "Unmatched [ or [^"
+#: eval.c:810 eval.c:1728 profile.c:773
+#, c-format
+msgid "attempt to use array `%s' in a scalar context"
msgstr ""
-#: regex.c:1330
-msgid "Unmatched ( or \\("
+#: eval.c:910
+msgid ""
+"concatenation: side effects in one expression have changed the length of "
+"another!"
msgstr ""
-#: regex.c:1331
-msgid "Unmatched \\{"
+#: eval.c:935
+msgid "assignment used in conditional context"
msgstr ""
-#: regex.c:1332
-msgid "Invalid content of \\{\\}"
+#: eval.c:1026
+msgid "division by zero attempted"
msgstr ""
-#: regex.c:1333
-msgid "Invalid range end"
+#: eval.c:1041
+#, c-format
+msgid "division by zero attempted in `%%'"
msgstr ""
-#: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204
-msgid "Memory exhausted"
+#: eval.c:1056 profile.c:649
+#, c-format
+msgid "illegal type (%s) in tree_eval"
msgstr ""
-#: regex.c:1335
-msgid "Invalid preceding regular expression"
+#: eval.c:1232
+msgid "division by zero attempted in `/='"
msgstr ""
-#: regex.c:1336
-msgid "Premature end of regular expression"
+#: eval.c:1250
+#, c-format
+msgid "division by zero attempted in `%%='"
msgstr ""
-#: regex.c:1337
-msgid "Regular expression too big"
+#: eval.c:1510
+#, c-format
+msgid "%s (from %s)"
msgstr ""
-#: regex.c:1338
-msgid "Unmatched ) or \\)"
+#: eval.c:1569
+#, c-format
+msgid "function `%s' called with more arguments than declared"
msgstr ""
-#: regex.c:7365
-msgid "No previous regular expression"
+#: eval.c:1628
+#, c-format
+msgid "function `%s' not defined"
msgstr ""
-#: awkgram.y:232
-msgid "BEGIN blocks must have an action part"
+#: eval.c:1634
+#, c-format
+msgid "function %s called\n"
msgstr ""
-#: awkgram.y:238
-msgid "END blocks must have an action part"
+#: eval.c:1693
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
msgstr ""
-#: awkgram.y:274
-#, c-format
-msgid "`%s' is a built-in function, it cannot be redefined"
+#: eval.c:1696
+msgid "\t# -- main --\n"
msgstr ""
-#: awkgram.y:362
-msgid "statement may have no effect"
+#: eval.c:1850
+msgid "attempt to field reference from non-numeric value"
msgstr ""
-#: awkgram.y:455
-msgid "`next' used in BEGIN or END action"
+#: eval.c:1852
+msgid "attempt to reference from null string"
msgstr ""
-#: awkgram.y:462 awkgram.y:469
-msgid "`nextfile' is a gawk extension"
+#: eval.c:1858
+#, c-format
+msgid "attempt to access field %d"
msgstr ""
-#: awkgram.y:474
-msgid "`nextfile' used in BEGIN or END action"
+#: eval.c:1874
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
msgstr ""
-#: awkgram.y:483
-msgid "`return' used outside function context"
+#: eval.c:1886 eval.c:1893 profile.c:865
+msgid "assignment is not allowed to result of builtin function"
msgstr ""
-#: awkgram.y:519
-msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
+#: eval.c:1941
+msgid "`IGNORECASE' is a gawk extension"
msgstr ""
-#: awkgram.y:532 awkgram.y:539
-msgid "`delete array' is a gawk extension"
+#: eval.c:1970
+msgid "`BINMODE' is a gawk extension"
msgstr ""
-#: awkgram.y:604
-msgid "multistage two-way pipelines don't work"
+#: eval.c:2082
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
msgstr ""
-#: awkgram.y:695
-msgid "regular expression on right of assignment"
+#: eval.c:2160
+msgid "turning off `--lint' due to assignment to `LINT'"
msgstr ""
-#: awkgram.y:713
-msgid "non-redirected `getline' undefined inside END action"
+#: ext.c:60 ext.c:64
+msgid "`extension' is a gawk extension"
msgstr ""
-#: awkgram.y:723
-msgid "regular expression on left of `~' or `!~' operator"
+#: ext.c:74
+#, c-format
+msgid "extension: cannot open `%s' (%s)\n"
msgstr ""
-#: awkgram.y:733
+#: ext.c:82
#, c-format
-msgid "regexp constant `/%s/' looks like a C comment, but is not"
+msgid "extension: library `%s': cannot call function `%s' (%s)\n"
msgstr ""
-#: awkgram.y:749
-msgid "regular expression on right of comparison"
+#: ext.c:181
+msgid "Operation Not Supported"
msgstr ""
-#: awkgram.y:776
-msgid "non-redirected `getline' undefined inside BEGIN or END action"
+#: field.c:321
+msgid "NF set to negative value"
msgstr ""
-#: awkgram.y:831
-msgid "call of `length' without parentheses is not portable"
+#: field.c:819
+msgid "split: second argument is not an array"
msgstr ""
-#: awkgram.y:834
-msgid "call of `length' without parentheses is deprecated by POSIX"
+#: field.c:854
+msgid "split: null string for third arg is a gawk extension"
msgstr ""
-#: awkgram.y:884
-msgid "invalid subscript expression"
+#: field.c:906
+msgid "`FIELDWIDTHS' is a gawk extension"
msgstr ""
-#: awkgram.y:1033
+#: field.c:933
#, c-format
-msgid "fptr %x not in tokentab\n"
+msgid "field %d in FIELDWIDTHS, must be > 0"
msgstr ""
-#: awkgram.y:1068
-msgid "unexpected newline"
+#: field.c:1006
+msgid "null string for `FS' is a gawk extension"
msgstr ""
-#: awkgram.y:1152
-msgid "empty program text on command line"
+#: getopt.c:692 getopt.c:704
+#, c-format
+msgid "%s: option `%s' is ambiguous\n"
msgstr ""
-#: awkgram.y:1209
+#: getopt.c:737 getopt.c:741
#, c-format
-msgid "can't open source file `%s' for reading (%s)"
+msgid "%s: option `--%s' doesn't allow an argument\n"
msgstr ""
-#: awkgram.y:1244
+#: getopt.c:750 getopt.c:755
#, c-format
-msgid "can't read sourcefile `%s' (%s)"
+msgid "%s: option `%c%s' doesn't allow an argument\n"
msgstr ""
-#: awkgram.y:1252
+#: getopt.c:791 getopt.c:804 getopt.c:1093 getopt.c:1106
#, c-format
-msgid "source file `%s' is empty"
+msgid "%s: option `%s' requires an argument\n"
msgstr ""
-#: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011
-msgid "source file does not end in newline"
+#: getopt.c:842 getopt.c:845
+#, c-format
+msgid "%s: unrecognized option `--%s'\n"
msgstr ""
-#: awkgram.y:1518
-msgid "unterminated regexp ends with `\\' at end of file"
+#: getopt.c:853 getopt.c:856
+#, c-format
+msgid "%s: unrecognized option `%c%s'\n"
msgstr ""
-#: awkgram.y:1539
-msgid "unterminated regexp"
+#: getopt.c:903 getopt.c:906
+#, c-format
+msgid "%s: illegal option -- %c\n"
msgstr ""
-#: awkgram.y:1542
-msgid "unterminated regexp at end of file"
+#: getopt.c:912 getopt.c:915
+#, c-format
+msgid "%s: invalid option -- %c\n"
msgstr ""
-#: awkgram.y:1609
-msgid "use of `\\ #...' line continuation is not portable"
+#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:431
+#, c-format
+msgid "%s: option requires an argument -- %c\n"
msgstr ""
-#: awkgram.y:1621
-msgid "backslash not last character on line"
+#: getopt.c:1025 getopt.c:1036
+#, c-format
+msgid "%s: option `-W %s' is ambiguous\n"
msgstr ""
-#: awkgram.y:1662
-msgid "POSIX does not allow operator `**='"
+#: getopt.c:1060 getopt.c:1072
+#, c-format
+msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr ""
-#: awkgram.y:1664
-msgid "old awk does not support operator `**='"
+#: io.c:257
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
msgstr ""
-#: awkgram.y:1673
-msgid "POSIX does not allow operator `**'"
+#: io.c:344
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
msgstr ""
-#: awkgram.y:1675
-msgid "old awk does not support operator `**'"
+#: io.c:482
+#, c-format
+msgid "invalid tree type %s in redirect()"
msgstr ""
-#: awkgram.y:1708
-msgid "operator `^=' is not supported in old awk"
+#: io.c:488
+#, c-format
+msgid "expression in `%s' redirection only has numeric value"
msgstr ""
-#: awkgram.y:1716
-msgid "operator `^' is not supported in old awk"
+#: io.c:494
+#, c-format
+msgid "expression for `%s' redirection has null string value"
msgstr ""
-#: awkgram.y:1798 awkgram.y:1815
-msgid "unterminated string"
+#: io.c:499
+#, c-format
+msgid "filename `%s' for `%s' redirection may be result of logical expression"
msgstr ""
-#: awkgram.y:1972
+#: io.c:521
#, c-format
-msgid "invalid char '%c' in expression"
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
msgstr ""
-#: awkgram.y:2032
+#: io.c:573
#, c-format
-msgid "`%s' is a gawk extension"
+msgid "can't open pipe `%s' for output (%s)"
msgstr ""
-#: awkgram.y:2035
+#: io.c:582
#, c-format
-msgid "`%s' is a Bell Labs extension"
+msgid "can't open pipe `%s' for input (%s)"
msgstr ""
-#: awkgram.y:2038
+#: io.c:595
#, c-format
-msgid "POSIX does not allow `%s'"
+msgid "can't open two way socket `%s' for input/output (%s)"
msgstr ""
-#: awkgram.y:2042
+#: io.c:599
#, c-format
-msgid "`%s' is not supported in old awk"
+msgid "can't open two way pipe `%s' for input/output (%s)"
msgstr ""
-#: awkgram.y:2070
-msgid "`goto' considered harmful!\n"
+#: io.c:675
+#, c-format
+msgid "can't redirect from `%s' (%s)"
msgstr ""
-#: awkgram.y:2134
+#: io.c:678
#, c-format
-msgid "%d is invalid as number of arguments for %s"
+msgid "can't redirect to `%s' (%s)"
msgstr ""
-#: awkgram.y:2153 awkgram.y:2156
-msgid "match: third argument is a gawk extension"
+#: io.c:717
+msgid ""
+"reached system limit for open files: starting to multiplex file descriptors"
msgstr ""
-#: awkgram.y:2172
+#: io.c:729
#, c-format
-msgid "%s: string literal as last arg of substitute has no effect"
+msgid "close of `%s' failed (%s)."
msgstr ""
-#: awkgram.y:2176
-msgid "sub third parameter is not a changeable object"
+#: io.c:736
+msgid "too many pipes or input files open"
msgstr ""
-#: awkgram.y:2178
-msgid "gsub third parameter is not a changeable object"
+#: io.c:759
+msgid "close: second argument must be `to' or `from'"
msgstr ""
-#: awkgram.y:2204 awkgram.y:2207
-msgid "close: second argument is a gawk extension"
+#: io.c:773
+#, c-format
+msgid "close: `%.*s' is not an open file, pipe or co-process"
msgstr ""
-#: awkgram.y:2217
-msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+#: io.c:777
+msgid "close of redirection that was never opened"
msgstr ""
-#: awkgram.y:2232
-msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+#: io.c:804
+#, c-format
+msgid "close: redirection `%s' not opened with `|&', second argument ignored"
msgstr ""
-#: awkgram.y:2323
+#: io.c:866
#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgid "failure status (%d) on pipe close of `%s' (%s)"
msgstr ""
-#: awkgram.y:2355
+#: io.c:869
#, c-format
-msgid "function `%s': parameter `%s' shadows global variable"
+msgid "failure status (%d) on file close of `%s' (%s)"
msgstr ""
-#: awkgram.y:2464
+#: io.c:888
#, c-format
-msgid "could not open `%s' for writing (%s)"
+msgid "no explicit close of socket `%s' provided"
msgstr ""
-#: awkgram.y:2495
+#: io.c:891
#, c-format
-msgid "%s: close failed (%s)"
+msgid "no explicit close of co-process `%s' provided"
msgstr ""
-#: awkgram.y:2605
-msgid "shadow_funcs() called twice!"
+#: io.c:894
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
msgstr ""
-#: awkgram.y:2680
+#: io.c:897
#, c-format
-msgid "function `%s': can't use function name as parameter name"
+msgid "no explicit close of file `%s' provided"
msgstr ""
-#: awkgram.y:2690
+#: io.c:926 io.c:980
#, c-format
-msgid "function name `%s' previously defined"
+msgid "error writing standard output (%s)"
msgstr ""
-#: awkgram.y:2838 awkgram.y:2844
+#: io.c:930 io.c:984
#, c-format
-msgid "function `%s' called but never defined"
+msgid "error writing standard error (%s)"
msgstr ""
-#: awkgram.y:2847
+#: io.c:938
#, c-format
-msgid "function `%s' defined but never called"
+msgid "pipe flush of `%s' failed (%s)."
msgstr ""
-#: awkgram.y:2874
+#: io.c:941
#, c-format
-msgid "regexp constant for parameter #%d yields boolean value"
+msgid "co-process flush of pipe to `%s' failed (%s)."
msgstr ""
-#: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649
-#: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078
-#: dfa.c:1081 dfa.c:1094 dfa.c:1095
-msgid "Unbalanced ["
+#: io.c:944
+#, c-format
+msgid "file flush of `%s' failed (%s)."
msgstr ""
-#: dfa.c:783
-msgid "Unfinished \\ escape"
+#: io.c:1103
+msgid "/inet/raw client not ready yet, sorry"
msgstr ""
-#: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955
-msgid "unfinished repeat count"
+#: io.c:1105 io.c:1142
+msgid "only root may use `/inet/raw'."
msgstr ""
-#: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958
-msgid "malformed repeat count"
+#: io.c:1140
+msgid "/inet/raw server not ready yet, sorry"
msgstr ""
-#: dfa.c:1285
-msgid "Unbalanced ("
+#: io.c:1230
+#, c-format
+msgid "no (known) protocol supplied in special filename `%s'"
msgstr ""
-#: dfa.c:1407
-msgid "No regexp syntax bits specified"
+#: io.c:1248
+#, c-format
+msgid "special file name `%s' is incomplete"
msgstr ""
-#: dfa.c:1415
-msgid "Unbalanced )"
+#: io.c:1260
+#, c-format
+msgid "local port invalid in `%s'"
msgstr ""
-#: dfa.c:3014
-msgid "out of memory"
+#: io.c:1272
+msgid "must supply a remote hostname to `/inet'"
msgstr ""
-#: field.c:849
-msgid "split: second argument is not an array"
+#: io.c:1287
+msgid "must supply a remote port to `/inet'"
msgstr ""
-#: field.c:876
-msgid "split: null string for third arg is a gawk extension"
+#: io.c:1293
+#, c-format
+msgid "remote port invalid in `%s'"
msgstr ""
-#: field.c:916
-msgid "`FIELDWIDTHS' is a gawk extension"
+#: io.c:1303
+msgid "TCP/IP communications are not supported"
msgstr ""
-#: field.c:943
+#: io.c:1312 io.c:1492
#, c-format
-msgid "field %d in FIELDWIDTHS, must be > 0"
+msgid "file `%s' is a directory"
msgstr ""
-#: field.c:997
-msgid "null string for `FS' is a gawk extension"
+#: io.c:1381
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
msgstr ""
-#: msg.c:57
-msgid "cmd. line:"
+#: io.c:1413
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
msgstr ""
-#: msg.c:123
-msgid "warning: "
+#: io.c:1478 io.c:1652
+#, c-format
+msgid "could not open `%s', mode `%s'"
msgstr ""
-#: msg.c:145
-msgid "error: "
+#: io.c:1703
+#, c-format
+msgid "close of master pty failed (%s)"
msgstr ""
-#: msg.c:178
-msgid "fatal: "
+#: io.c:1705 io.c:1857 io.c:2009
+#, c-format
+msgid "close of stdout in child failed (%s)"
msgstr ""
-#: eval.c:259
+#: io.c:1708
#, c-format
-msgid "unknown nodetype %d"
+msgid "moving slave pty to stdout in child failed (dup: %s)"
msgstr ""
-#: eval.c:307
-msgid "buffer overflow in genflags2str"
+#: io.c:1710 io.c:1862
+#, c-format
+msgid "close of stdin in child failed (%s)"
msgstr ""
-#: eval.c:541
+#: io.c:1713
#, c-format
-msgid "for loop: array `%s' changed size from %d to %d during loop execution"
+msgid "moving slave pty to stdin in child failed (dup: %s)"
msgstr ""
-#: eval.c:565
-msgid "`break' outside a loop is not portable"
+#: io.c:1715 io.c:1734
+#, c-format
+msgid "close of slave pty failed (%s)"
msgstr ""
-#: eval.c:569
-msgid "`break' outside a loop is not allowed"
+#: io.c:1808 io.c:1860 io.c:1990 io.c:2012
+#, c-format
+msgid "moving pipe to stdout in child failed (dup: %s)"
msgstr ""
-#: eval.c:588
-msgid "`continue' outside a loop is not portable"
+#: io.c:1812 io.c:1865
+#, c-format
+msgid "moving pipe to stdin in child failed (dup: %s)"
msgstr ""
-#: eval.c:592
-msgid "`continue' outside a loop is not allowed"
+#: io.c:1829 io.c:2003
+msgid "restoring stdout in parent process failed\n"
msgstr ""
-#: eval.c:622
-msgid "`next' cannot be called from a BEGIN rule"
+#: io.c:1834
+msgid "restoring stdin in parent process failed\n"
msgstr ""
-#: eval.c:624
-msgid "`next' cannot be called from an END rule"
+#: io.c:1868 io.c:2014 io.c:2025
+#, c-format
+msgid "close of pipe failed (%s)"
msgstr ""
-#: eval.c:636
-msgid "`nextfile' cannot be called from a BEGIN rule"
+#: io.c:1913
+msgid "`|&' not supported"
msgstr ""
-#: eval.c:638
-msgid "`nextfile' cannot be called from an END rule"
+#: io.c:1980
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
msgstr ""
-#: eval.c:679
-msgid "statement has no effect"
+#: io.c:2021
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
msgstr ""
-#: eval.c:713 eval.c:743 eval.c:1622
+#: io.c:2364
#, c-format
-msgid "reference to uninitialized variable `%s'"
+msgid "data file `%s' is empty"
msgstr ""
-#: eval.c:721 eval.c:1608
-#, c-format
-msgid "can't use function name `%s' as variable or array"
+#: io.c:2407 io.c:2415
+msgid "could not allocate more input memory"
msgstr ""
-#: eval.c:728 eval.c:734 eval.c:1747
+#: io.c:2540 io.c:2782 io.c:3046
#, c-format
-msgid "reference to uninitialized argument `%s'"
+msgid "error reading input file `%s': %s"
msgstr ""
-#: eval.c:823
-msgid "assignment used in conditional context"
+#: io.c:3281
+msgid "multicharacter value of `RS' is a gawk extension"
msgstr ""
-#: eval.c:914
-msgid ""
-"concatenation: side effects in one expression have changed the length of "
-"another!"
+#: main.c:322
+msgid "`-m[fr]' option irrelevant in gawk"
msgstr ""
-#: eval.c:1013
-msgid "division by zero attempted"
+#: main.c:324
+msgid "-m option usage: `-m[fr] nnn'"
msgstr ""
-#: eval.c:1028
+#: main.c:341
#, c-format
-msgid "division by zero attempted in `%%'"
+msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr ""
-#: eval.c:1236
-msgid "division by zero attempted in `/='"
+#: main.c:378
+msgid "empty argument to `--source' ignored"
+msgstr ""
+
+#: main.c:448
+msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr ""
-#: eval.c:1254
+#: main.c:453
+msgid "`--posix' overrides `--traditional'"
+msgstr ""
+
+#: main.c:464
+msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
+msgstr ""
+
+#: main.c:468
#, c-format
-msgid "division by zero attempted in `%%='"
+msgid "running %s setuid root may be a security problem"
msgstr ""
-#: eval.c:1424
+#: main.c:509
#, c-format
-msgid "%s (from %s)"
+msgid "can't set binary mode on stdin (%s)"
msgstr ""
-#: eval.c:1472
+#: main.c:512
#, c-format
-msgid "function `%s' called with more arguments than declared"
+msgid "can't set binary mode on stdout (%s)"
msgstr ""
-#: eval.c:1519
+#: main.c:514
#, c-format
-msgid "function `%s' not defined"
+msgid "can't set binary mode on stderr (%s)"
+msgstr ""
+
+#: main.c:544
+msgid "no program text at all!"
msgstr ""
-#: eval.c:1521
+#: main.c:612
#, c-format
-msgid "function %s called\n"
+msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr ""
-#: eval.c:1580
-msgid ""
-"\n"
-"\t# Function Call Stack:\n"
-"\n"
+#: main.c:614
+#, c-format
+msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr ""
-#: eval.c:1583
-msgid "\t# -- main --\n"
+#: main.c:619
+msgid "POSIX options:\t\tGNU long options:\n"
msgstr ""
-#: eval.c:1759
-msgid "attempt to field reference from non-numeric value"
+#: main.c:620
+msgid "\t-f progfile\t\t--file=progfile\n"
msgstr ""
-#: eval.c:1761
-msgid "attempt to reference from null string"
+#: main.c:621
+msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr ""
-#: eval.c:1767
-#, c-format
-msgid "attempt to access field %d"
+#: main.c:622
+msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr ""
-#: eval.c:1783
-#, c-format
-msgid "attempt to use scalar parameter `%s' as an array"
+#: main.c:623
+msgid "\t-m[fr] val\n"
msgstr ""
-#: eval.c:1874
-msgid "`IGNORECASE' is a gawk extension"
+#: main.c:624
+msgid "\t-W compat\t\t--compat\n"
msgstr ""
-#: eval.c:1902
-msgid "`BINMODE' is a gawk extension"
+#: main.c:625
+msgid "\t-W copyleft\t\t--copyleft\n"
msgstr ""
-#: eval.c:2014
-#, c-format
-msgid "bad `%sFMT' specification `%s'"
+#: main.c:626
+msgid "\t-W copyright\t\t--copyright\n"
msgstr ""
-#: eval.c:2080
-msgid "turning off `--lint' due to assignment to `LINT'"
+#: main.c:627
+msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
msgstr ""
-#: eval.c:2116
-msgid "NF set to negative value"
+#: main.c:628
+msgid "\t-W gen-po\t\t--gen-po\n"
msgstr ""
-#: io.c:240
-#, c-format
-msgid "cannot open file `%s' for reading (%s)"
+#: main.c:629
+msgid "\t-W help\t\t\t--help\n"
msgstr ""
-#: io.c:320
-#, c-format
-msgid "close of fd %d (`%s') failed (%s)"
+#: main.c:630
+msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
msgstr ""
-#: io.c:432
-#, c-format
-msgid "invalid tree type %s in redirect()"
+#: main.c:631
+msgid "\t-W lint-old\t\t--lint-old\n"
msgstr ""
-#: io.c:438
-#, c-format
-msgid "expression in `%s' redirection only has numeric value"
+#: main.c:632
+msgid "\t-W non-decimal-data\t--non-decimal-data\n"
msgstr ""
-#: io.c:444
-#, c-format
-msgid "expression for `%s' redirection has null string value"
+#: main.c:634
+msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr ""
-#: io.c:449
-#, c-format
-msgid "filename `%s' for `%s' redirection may be result of logical expression"
+#: main.c:637
+msgid "\t-W parsedebug\t\t--parsedebug\n"
msgstr ""
-#: io.c:471
-#, c-format
-msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+#: main.c:639
+msgid "\t-W profile[=file]\t--profile[=file]\n"
msgstr ""
-#: io.c:523
-#, c-format
-msgid "can't open pipe `%s' for output (%s)"
+#: main.c:640
+msgid "\t-W posix\t\t--posix\n"
msgstr ""
-#: io.c:532
-#, c-format
-msgid "can't open pipe `%s' for input (%s)"
+#: main.c:641
+msgid "\t-W re-interval\t\t--re-interval\n"
msgstr ""
-#: io.c:545
-#, c-format
-msgid "can't open two way socket `%s' for input/output (%s)"
+#: main.c:642
+msgid "\t-W source=program-text\t--source=program-text\n"
msgstr ""
-#: io.c:549
-#, c-format
-msgid "can't open two way pipe `%s' for input/output (%s)"
+#: main.c:643
+msgid "\t-W traditional\t\t--traditional\n"
msgstr ""
-#: io.c:625
-#, c-format
-msgid "can't redirect from `%s' (%s)"
+#: main.c:644
+msgid "\t-W usage\t\t--usage\n"
msgstr ""
-#: io.c:628
-#, c-format
-msgid "can't redirect to `%s' (%s)"
+#: main.c:645
+msgid "\t-W version\t\t--version\n"
msgstr ""
-#: io.c:667
+#: main.c:649
msgid ""
-"reached system limit for open files: starting to multiplex file descriptors"
+"\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 ""
-#: io.c:679
-#, c-format
-msgid "close of `%s' failed (%s)."
+#: main.c:653
+msgid ""
+"gawk is a pattern scanning and processing language.\n"
+"By default it reads standard input and writes standard output.\n"
+"\n"
msgstr ""
-#: io.c:686
-msgid "too many pipes or input files open"
+#: main.c:657
+msgid ""
+"Examples:\n"
+"\tgawk '{ sum += $1 }; END { print sum }' file\n"
+"\tgawk -F: '{ print $1 }' /etc/passwd\n"
msgstr ""
-#: io.c:709
-msgid "close: second argument must be `to' or `from'"
+#: main.c:669
+#, 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 ""
-#: io.c:723
-#, c-format
-msgid "close: `%.*s' is not an open file, pipe or co-process"
+#: main.c:677
+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 ""
-#: io.c:727
-msgid "close of redirection that was never opened"
+#: main.c:683
+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 ""
-#: io.c:754
-#, c-format
-msgid "close: redirection `%s' not opened with `|&', second argument ignored"
+#: main.c:713
+msgid "-Ft does not set FS to tab in POSIX awk"
msgstr ""
-#: io.c:811
+#: main.c:944
#, c-format
-msgid "failure status (%d) on pipe close of `%s' (%s)"
+msgid ""
+"%s: `%s' argument to `-v' not in `var=value' form\n"
+"\n"
msgstr ""
-#: io.c:814
+#: main.c:964
#, c-format
-msgid "failure status (%d) on file close of `%s' (%s)"
+msgid "`%s' is not a legal variable name"
msgstr ""
-#: io.c:833
+#: main.c:967
#, c-format
-msgid "no explicit close of socket `%s' provided"
+msgid "`%s' is not a variable name, looking for file `%s=%s'"
msgstr ""
-#: io.c:836
-#, c-format
-msgid "no explicit close of co-process `%s' provided"
+#: main.c:995
+msgid "floating point exception"
msgstr ""
-#: io.c:839
-#, c-format
-msgid "no explicit close of pipe `%s' provided"
+#: main.c:1002
+msgid "fatal error: internal error"
msgstr ""
-#: io.c:842
+#: main.c:1052
#, c-format
-msgid "no explicit close of file `%s' provided"
+msgid "no pre-opened fd %d"
msgstr ""
-#: io.c:871 io.c:925
+#: main.c:1057
#, c-format
-msgid "error writing standard output (%s)"
+msgid "could not pre-open /dev/null for fd %d"
msgstr ""
-#: io.c:875 io.c:929
+#: main.c:1080 main.c:1089
#, c-format
-msgid "error writing standard error (%s)"
+msgid "could not find groups: %s"
msgstr ""
-#: io.c:883
-#, c-format
-msgid "pipe flush of `%s' failed (%s)."
+#: msg.c:54
+msgid "cmd. line:"
msgstr ""
-#: io.c:886
-#, c-format
-msgid "co-process flush of pipe to `%s' failed (%s)."
+#: msg.c:120
+msgid "warning: "
msgstr ""
-#: io.c:889
-#, c-format
-msgid "file flush of `%s' failed (%s)."
+#: msg.c:142
+msgid "error: "
msgstr ""
-#: io.c:1048
-msgid "/inet/raw client not ready yet, sorry"
+#: msg.c:178
+msgid "fatal: "
msgstr ""
-#: io.c:1050 io.c:1087
-msgid "only root may use `/inet/raw'."
+#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
+msgid "can't convert string to float"
msgstr ""
-#: io.c:1085
-msgid "/inet/raw server not ready yet, sorry"
+#: node.c:357
+msgid "backslash at end of string"
msgstr ""
-#: io.c:1175
-#, c-format
-msgid "no (known) protocol supplied in special filename `%s'"
+#: node.c:544
+msgid "POSIX does not allow `\\x' escapes"
msgstr ""
-#: io.c:1193
+#: node.c:550
+msgid "no hex digits in `\\x' escape sequence"
+msgstr ""
+
+#: node.c:584
#, c-format
-msgid "special file name `%s' is incomplete"
+msgid "escape sequence `\\%c' treated as plain `%c'"
msgstr ""
-#: io.c:1205
+#: posix/gawkmisc.c:172
#, c-format
-msgid "local port invalid in `%s'"
+msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
msgstr ""
-#: io.c:1217
-msgid "must supply a remote hostname to `/inet'"
+#: profile.c:91
+#, c-format
+msgid "could not open `%s' for writing: %s"
msgstr ""
-#: io.c:1232
-msgid "must supply a remote port to `/inet'"
+#: profile.c:409
+msgid "internal error: Node_var with null vname"
msgstr ""
-#: io.c:1238
-#, c-format
-msgid "remote port invalid in `%s'"
+#: profile.c:471
+msgid "# treated internally as `delete'"
msgstr ""
-#: io.c:1248
-msgid "TCP/IP communications are not supported"
+#: profile.c:545
+msgid "internal error: Node_var_array with null vname"
msgstr ""
-#: io.c:1257 io.c:1438
+#: profile.c:1127
#, c-format
-msgid "file `%s' is a directory"
+msgid "\t# gawk profile, created %s\n"
msgstr ""
-#: io.c:1327
-#, c-format
-msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+#: profile.c:1130
+msgid ""
+"\t# BEGIN block(s)\n"
+"\n"
msgstr ""
-#: io.c:1359
-msgid "use `PROCINFO[...]' instead of `/dev/user'"
+#: profile.c:1140
+msgid ""
+"\t# Rule(s)\n"
+"\n"
msgstr ""
-#: io.c:1424
-#, c-format
-msgid "could not open `%s', mode `%s'"
+#: profile.c:1146
+msgid ""
+"\t# END block(s)\n"
+"\n"
msgstr ""
-#: io.c:1550 io.c:1602 io.c:1732 io.c:1754
-#, c-format
-msgid "moving pipe to stdout in child failed (dup: %s)"
+#: profile.c:1166
+msgid ""
+"\n"
+"\t# Functions, listed alphabetically\n"
msgstr ""
-#: io.c:1554 io.c:1607
+#: profile.c:1376
#, c-format
-msgid "moving pipe to stdin in child failed (dup: %s)"
+msgid "unexpected type %s in prec_level"
msgstr ""
-#: io.c:1571 io.c:1745
-msgid "restoring stdout in parent process failed\n"
+#: re.c:193
+#, c-format
+msgid "regex match failed, not enough memory to match string \"%.*s%s\""
msgstr ""
-#: io.c:1576
-msgid "restoring stdin in parent process failed\n"
+#: regcomp.c:136
+msgid "Success"
msgstr ""
-#: io.c:1599 io.c:1751
-#, c-format
-msgid "close of stdout in child failed (%s)"
+#: regcomp.c:139
+msgid "No match"
msgstr ""
-#: io.c:1604
-#, c-format
-msgid "close of stdin in child failed (%s)"
+#: regcomp.c:142
+msgid "Invalid regular expression"
msgstr ""
-#: io.c:1610 io.c:1756 io.c:1767
-#, c-format
-msgid "close of pipe failed (%s)"
+#: regcomp.c:145
+msgid "Invalid collation character"
msgstr ""
-#: io.c:1655
-msgid "`|&' not supported"
+#: regcomp.c:148
+msgid "Invalid character class name"
msgstr ""
-#: io.c:1722
-#, c-format
-msgid "cannot open pipe `%s' (%s)"
+#: regcomp.c:151
+msgid "Trailing backslash"
msgstr ""
-#: io.c:1763
-#, c-format
-msgid "cannot create child process for `%s' (fork: %s)"
+#: regcomp.c:154
+msgid "Invalid back reference"
msgstr ""
-#: io.c:2104
-#, c-format
-msgid "data file `%s' is empty"
+#: regcomp.c:157
+msgid "Unmatched [ or [^"
msgstr ""
-#: io.c:2175
-#, c-format
-msgid "internal error: file `%s', line %d\n"
+#: regcomp.c:160
+msgid "Unmatched ( or \\("
msgstr ""
-#: io.c:2277
-#, c-format
-msgid "error reading input file `%s': %s"
+#: regcomp.c:163
+msgid "Unmatched \\{"
msgstr ""
-#: io.c:2521
-msgid "multicharacter value of `RS' is a gawk extension"
+#: regcomp.c:166
+msgid "Invalid content of \\{\\}"
msgstr ""
-#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
-msgid "can't convert string to float"
+#: regcomp.c:169
+msgid "Invalid range end"
msgstr ""
-#: node.c:342
-msgid "backslash at end of string"
+#: regcomp.c:172
+msgid "Memory exhausted"
msgstr ""
-#: node.c:524
-msgid "POSIX does not allow `\\x' escapes"
+#: regcomp.c:175
+msgid "Invalid preceding regular expression"
msgstr ""
-#: node.c:530
-msgid "no hex digits in `\\x' escape sequence"
+#: regcomp.c:178
+msgid "Premature end of regular expression"
msgstr ""
-#: node.c:564
-#, c-format
-msgid "escape sequence `\\%c' treated as plain `%c'"
+#: regcomp.c:181
+msgid "Regular expression too big"
msgstr ""
-#: re.c:208
-#, c-format
-msgid "regex match failed, not enough memory to match string \"%.*s%s\""
+#: regcomp.c:184
+msgid "Unmatched ) or \\)"
msgstr ""
-#: posix/gawkmisc.c:122
-#, c-format
-msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
+#: regcomp.c:621
+msgid "No previous regular expression"
msgstr ""
diff --git a/po/he.gmo b/po/he.gmo
index 42c880b6..0ee7b75e 100644
--- a/po/he.gmo
+++ b/po/he.gmo
Binary files differ
diff --git a/po/he.po b/po/he.po
index 9773f94e..0b09f638 100644
--- a/po/he.po
+++ b/po/he.po
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: gawk 3.1.1a\n"
-"POT-Creation-Date: 2002-05-01 16:40+0300\n"
+"POT-Creation-Date: 2003-03-19 14:25+0200\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"
@@ -13,395 +13,873 @@ msgstr ""
"Content-Type: text/plain; charset=ISO-8859-8\n"
"Content-Transfer-Encoding: 8-bit\n"
-#: array.c:243 array.c:275 array.c:280 eval.c:483
+#: array.c:274 array.c:309 array.c:314 eval.c:494
#, c-format
msgid "attempt to use scalar `%s' as array"
msgstr "êøòîë `%s' øàì÷ñá éåâù ùåîéù"
-#: array.c:304
+#: array.c:338
#, c-format
msgid "reference to uninitialized element `%s[\"%s\"]'"
msgstr "ìçåúî åðéàù `%s[\"%s\"]' èðîìàì äééðô"
-#: array.c:310
+#: array.c:344
#, c-format
msgid "subscript of array `%s' is null string"
msgstr "`%s' êøòî ïééöîë ä÷éø úæåøçîá ùåîéù"
-#: array.c:373 array.c:456
-#, c-format
-msgid "delete: illegal use of variable `%s' as array"
-msgstr "êøòîë `%s' äðúùîá éåâù ùåîéù :delete"
-
-#: array.c:406
+#: array.c:412 array.c:425 array.c:466
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "`%s' ïééöî ìéëî åðéà `%s' êøòî :delete"
-#: array.c:571
+#: array.c:432 array.c:515
+#, c-format
+msgid "delete: illegal use of variable `%s' as array"
+msgstr "êøòîë `%s' äðúùîá éåâù ùåîéù :delete"
+
+#: array.c:633
#, c-format
msgid "%s: empty (null)\n"
msgstr "%s: (ñôåàî) ÷éø\n"
-#: array.c:576
+#: array.c:638
#, c-format
msgid "%s: empty (zero)\n"
msgstr "%s: (ä÷éø hash úìáè) ÷éø\n"
-#: array.c:580
+#: array.c:642
#, c-format
msgid "%s: table_size = %d, array_size = %d\n"
msgstr "%s: table_size = %d, array_size = %d\n"
-#: array.c:612
+#: array.c:671
#, c-format
msgid "%s: is parameter\n"
msgstr "øèîøô åðéä %s\n"
-#: array.c:617
+#: array.c:676
#, c-format
msgid "%s: array_ref to %s\n"
msgstr "%s: %s-ì (array_ref) äéðôä\n"
-#: array.c:844
+#: array.c:975
msgid "asort: first argument is not an array"
msgstr "êøòî åðéà ïåùàø èðîåâøà :asort"
-#: array.c:853
+#: array.c:984
msgid "asort: second argument is not an array"
msgstr "êøòî åðéà éðù èðîåâøà :asort"
-#: builtin.c:107
+#: 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
+msgid "statement may have no effect"
+msgstr "úéìëú íåù äéäú àì äæ éåèéáìù ïëúé"
+
+#: awkgram.y:431 awkgram.y:451
+#, fuzzy, c-format
+msgid "`%s' used in %s action"
+msgstr "END åà BEGIN ìù äìåòô úøãâäá `next'-á ùåîéù"
+
+#: awkgram.y:444 awkgram.y:447
+msgid "`nextfile' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `nextfile'"
+
+#: awkgram.y:461
+msgid "`return' used outside function context"
+msgstr "äéö÷ðåô ìù èñ÷èðå÷á àìù `return'-á ùåîéù"
+
+#: awkgram.y:500
+msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
+msgstr "`print \"\"' úåéäì íúñä ïî êéøö END åà BEGIN éììëá èåùô `print'"
+
+#: awkgram.y:513 awkgram.y:520
+msgid "`delete array' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `delete array'"
+
+#: awkgram.y:528 awkgram.y:535
+#, fuzzy
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `delete array'"
+
+#: awkgram.y:578
+msgid "multistage two-way pipelines don't work"
+msgstr "íéãáåò íðéà íéáìù éáåøî íééðååéë-åã íé÷éôà"
+
+#: awkgram.y:669
+msgid "regular expression on right of assignment"
+msgstr "êøò úîùä úàøåä ìù ïéîé ãöá éøìåâø éåèéá"
+
+#: awkgram.y:679
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "`!~' åà `~' øåèøôåàì ìàîùî éøìåâø éåèéá"
+
+#: awkgram.y:687
+msgid "regular expression on right of comparison"
+msgstr "äàååùä ìù ïéîé ãöá éøìåâø éåèéá"
+
+#: awkgram.y:754
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "END úìåòô êåúá øãâåî åðéà äééðôä àìì `getline'"
+
+#: awkgram.y:781
+msgid "call of `length' without parentheses is not portable"
+msgstr "úéìéáèøåô äðéà íééøâåñ àìì `length'-ì äàéø÷"
+
+#: awkgram.y:784
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "POSIX ï÷úì ãåâéðá äðéä íééøâåñ àìì `length'-ì äàéø÷"
+
+#: awkgram.y:835
+msgid "invalid subscript expression"
+msgstr "êøòî ïééöîá éåâù øéáçú ìòá éåèéá"
+
+#: awkgram.y:1020
+#, fuzzy
+msgid "unexpected newline or end of string"
+msgstr "éåôö-éúìá íå÷îá äøåù óåñ"
+
+#: awkgram.y:1115
+msgid "empty program text on command line"
+msgstr "äãå÷ôä úøåùî äìá÷úä ä÷éø úéðëú"
+
+#: awkgram.y:1172
+#, c-format
+msgid "can't open source file `%s' for reading (%s)"
+msgstr "åúàéø÷ íùì `%s' øå÷î õáå÷ úçéúôá (%s) äì÷ú"
+
+#: awkgram.y:1207
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "`%s' øå÷î õáå÷î äàéø÷á (%s) äì÷ú"
+
+#: awkgram.y:1215
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "÷éø åðéä `%s' øå÷î õáå÷"
+
+#: awkgram.y:1417 awkgram.y:1527 awkgram.y:1545 awkgram.y:1895 awkgram.y:1980
+msgid "source file does not end in newline"
+msgstr "äøåù-óåñ åúá íééúñî åðéà øå÷îä õáå÷"
+
+#: awkgram.y:1481
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr "õáå÷ä óñá `\\'-á íééúñî øåîâ-éúìá éøìåâø éåèéá"
+
+#: awkgram.y:1501
+msgid "unterminated regexp"
+msgstr "øåîâ-éúìá éøìåâø éåèéá"
+
+#: awkgram.y:1504
+msgid "unterminated regexp at end of file"
+msgstr "õáå÷ä óåñá øåîâ-éúìá éøìåâø éåèéá"
+
+#: awkgram.y:1571
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr "éìéáèøåô åðéà äøåù êùîäì ïîéñë `\\ #...'-á ùåîéù"
+
+#: awkgram.y:1583
+msgid "backslash not last character on line"
+msgstr "äøåùá ïåøçà åú åðéàù êåôä ïñëåì"
+
+#: awkgram.y:1628
+msgid "POSIX does not allow operator `**='"
+msgstr "`**=' øåèøôåà äùøî åðéà POSIX"
+
+#: awkgram.y:1630
+msgid "old awk does not support operator `**='"
+msgstr "`**=' øåèøôåàá êîåú åðéà ïùé awk"
+
+#: awkgram.y:1639
+msgid "POSIX does not allow operator `**'"
+msgstr "`**' øåèøôåà äùøî åðéà POSIX"
+
+#: awkgram.y:1641
+msgid "old awk does not support operator `**'"
+msgstr "`**' øåèøôåàá êîåú åðéà ïùé awk"
+
+#: awkgram.y:1672
+msgid "operator `^=' is not supported in old awk"
+msgstr "ïùé awk-á êîúð åðéà `^=' øåèøôåà"
+
+#: awkgram.y:1680
+msgid "operator `^' is not supported in old awk"
+msgstr "ïùé awk-á êîúð åðéà `^' øåèøôåà"
+
+#: awkgram.y:1764 awkgram.y:1781
+msgid "unterminated string"
+msgstr "äøåîâ-éúìá úæåøçî"
+
+#: awkgram.y:1941
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "éåèéáá '%c' éåâù åú"
+
+#: awkgram.y:2001
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä äðéä `%s'"
+
+#: awkgram.y:2004
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "Bell úåãáòî úñøâá awk-ì úéôéöôñ äáçøä åðéä `%s'"
+
+#: awkgram.y:2007
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "`%s' äùøî åðéà POSIX"
+
+#: awkgram.y:2011
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "ïùé awk-á êîúð åðéà `%s'"
+
+#: awkgram.y:2038
+msgid "`goto' considered harmful!\n"
+msgstr "!òø-òâô áùçð `goto'\n"
+
+#: awkgram.y:2102
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
+msgstr "íéèðîåâøà øôñîë %d ìá÷ì ìåëé åðéà %s"
+
+#: awkgram.y:2121 awkgram.y:2124
+msgid "match: third argument is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `match' ìù éùéìù èðîåâøà"
+
+#: awkgram.y:2137
+#, c-format
+msgid "%s: string literal as last arg of substitute has no effect"
+msgstr "úéìëú íåù äì ïéà `%s' ìù ïåøçà èðîåâøàë äòåá÷ úæåøçî"
+
+#: awkgram.y:2140
+#, fuzzy, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "éåðéù-øá è÷ééáåà åðéà `sub' ìù éùéìù èðîåâøà"
+
+#: awkgram.y:2167 awkgram.y:2170
+msgid "close: second argument is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `close' ìù éðù èðîåâøà"
+
+#: awkgram.y:2180
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr "èðîåâøà úîã÷áù ïåúçú-ó÷î ÷ìñì ùé :dcgettext(_\"...\")-á éåâù ùåîéù"
+
+#: awkgram.y:2195
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr "èðîåâøà úîã÷áù ïåúçú-ó÷î ÷ìñì ùé :dncgettext(_\"...\")-á éåâù ùåîéù"
+
+#: awkgram.y:2266
+#, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "`%s' äéö÷ðåôá %d 'ñî øèîøôì ääæ ,`%s' ,%d 'ñî øèîøô ìù åîù"
+
+#: awkgram.y:2299
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "éìáåìâ äðúùî ìò ìéôàî `%s' äéö÷ðåôá `%s' øèîøô"
+
+#: awkgram.y:2411
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "äáéúë íùì `%s' úçéúôá (%s) äì÷ú"
+
+#: awkgram.y:2412 profile.c:93
+msgid "sending profile to standard error"
+msgstr "éð÷ú úåàéâù õåøòì çìùð òåöéá ìéôåøô"
+
+#: awkgram.y:2442
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "`%s' úøéâñ úòá (%s) äì÷ú"
+
+#: awkgram.y:2566
+msgid "shadow_funcs() called twice!"
+msgstr "!íééîòô äàø÷ð shadow_funcs()"
+
+#: awkgram.y:2593
+msgid "there were shadowed variables."
+msgstr ""
+
+#: awkgram.y:2666
+#, c-format
+msgid "function `%s': can't use function name as parameter name"
+msgstr "øèîøô íùë ùîùì ìåëé åðéà äéö÷ðåô íù :`%s' äéö÷ðåôá"
+
+#: awkgram.y:2676
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "úøãâåî øáë `%s' íùá äéö÷ðåô"
+
+#: awkgram.y:2827 awkgram.y:2833
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "úøãâåî äðéàù `%s' äéö÷ðåôì äàéø÷"
+
+#: awkgram.y:2836
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "úàø÷ð àì êà ,äøãâåä `%s' äéö÷ðåô"
+
+#: awkgram.y:2863
+#, c-format
+msgid "regexp constant for parameter #%d yields boolean value"
+msgstr "éðàéìåá êøò áéðî %d 'ñî øèîøôë òåá÷ éøìåâø éåèéá"
+
+#: awkgram.y:2876
+#, c-format
+msgid ""
+"function `%s' called with space between name and `(',\n"
+"%s"
+msgstr ""
+",`(' ïéáì äîù ïéá íéçååø íò `%s' äéö÷ðåôì äàéø÷\n"
+"%s"
+
+#: awkgram.y:2878
+#, fuzzy
+msgid "or used as a variable or an array"
+msgstr "êøòî åà äðúùîë `%s' äéö÷ðåô íùá ùîúùäì ïéà"
+
+#: builtin.c:111
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "%s é\"ò \"%s\"-ì äáéúëá (%s) äì÷ú"
-#: builtin.c:108
+#: builtin.c:112
msgid "standard output"
msgstr "úéèøãðèñ èìô úãéçé"
-#: builtin.c:109
+#: builtin.c:113
msgid "reason unknown"
msgstr "äòåãé-éúìá äáéñî"
-#: builtin.c:122
+#: builtin.c:126
msgid "exp: received non-numeric argument"
msgstr "øôñî åðéà èðîåâøà :exp"
-#: builtin.c:128
+#: builtin.c:132
#, c-format
msgid "exp: argument %g is out of range"
msgstr "øúåîä íåçúá åðéà %g èðîåâøà :exp"
-#: builtin.c:186
+#: builtin.c:190
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr "äáéúëì àì ,äàéø÷ì çåúô `%s' ÷éôà :õöåçä ï÷åøì ïúéð àì :fflush"
-#: builtin.c:189
+#: builtin.c:193
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr "äáéúëì àì ,äàéø÷ì çåúô `%s' õáå÷ :õöåçä ï÷åøì ïúéð àì :fflush"
-#: builtin.c:201
+#: builtin.c:205
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "ìéá÷î êéìäú åà çåúô ÷éôà ,çåúô õáå÷ åðéà `%s' :fflush"
-#: builtin.c:295
+#: builtin.c:299
msgid "index: received non-string first argument"
msgstr "úæåøçî åðéà ïåùàø èðîåâøà :index"
-#: builtin.c:297
+#: builtin.c:301
msgid "index: received non-string second argument"
msgstr "úæåøçî åðéà éðù èðîåâøà :index"
-#: builtin.c:407
+#: builtin.c:411
msgid "int: received non-numeric argument"
msgstr "øôñî åðéà èðîåâøà :int"
-#: builtin.c:424
+#: builtin.c:428
msgid "length: received non-string argument"
msgstr "úæåøçî åðéà èðîåâøà :length"
-#: builtin.c:440
+#: builtin.c:444
msgid "log: received non-numeric argument"
msgstr "øôñî åðéà èðîåâøà :log"
-#: builtin.c:443
+#: builtin.c:447
#, c-format
msgid "log: received negative argument %g"
msgstr "%g éìéìù èðîåâøà íò àø÷ð :log"
-#: builtin.c:605 builtin.c:608
+#: builtin.c:609 builtin.c:612
msgid "must use `count$' on all formats or none"
msgstr "ãçà óàá åà íéèîøåôä ìëá åà øúåî `count$'-á ùåîéù"
-#: builtin.c:703
+#: builtin.c:714
msgid "`$' is not permitted in awk formats"
msgstr "awk ìù íéèîøåôá ùåîéùì øåñà `$'"
-#: builtin.c:709
+#: builtin.c:720
msgid "arg count with `$' must be > 0"
msgstr "0-î ìåãâ úåéäì áééç `$' ãéì èðîåâøàä äðåî"
-#: builtin.c:711
-#, c-format
-msgid "arg count %d greater than total number of supplied arguments"
+#: builtin.c:722
+#, fuzzy, c-format
+msgid "arg count %ld greater than total number of supplied arguments"
msgstr "íéèðîåâøàä ìù ììåëä íøôñîî ìåãâ %d èðîåâøàä äðåî"
-#: builtin.c:713
+#: builtin.c:724
msgid "`$' not permitted after period in format"
msgstr "èîøåôá äãå÷ðä éøçà òéôåäì ìåëé åðéà `$'"
-#: builtin.c:726
+#: builtin.c:737
msgid "no `$' supplied for positional field width or precision"
msgstr "å÷åéã åà äãù áçåø ïééöîá èðîåâøàä äðåî øåáò `$' àöîð àì"
-#: builtin.c:784
+#: builtin.c:795
msgid "`l' is meaningless in awk formats; ignored"
msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `l'"
-#: builtin.c:788
+#: builtin.c:799
msgid "`l' is not permitted in POSIX awk formats"
msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `l'"
-#: builtin.c:799
+#: builtin.c:810
msgid "`L' is meaningless in awk formats; ignored"
msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `L'"
-#: builtin.c:803
+#: builtin.c:814
msgid "`L' is not permitted in POSIX awk formats"
msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `L'"
-#: builtin.c:814
+#: builtin.c:825
msgid "`h' is meaningless in awk formats; ignored"
msgstr "çðæåä ;awk ìù èîøåôá úåòîùî øñç åðéä `h'"
-#: builtin.c:818
+#: builtin.c:829
msgid "`h' is not permitted in POSIX awk formats"
msgstr "POSIX éô-ìò awk ìù èîøåôá òéôåäì ìåëé åðéà `h'"
-#: builtin.c:1067
+#: builtin.c:1078
msgid "not enough arguments to satisfy format string"
msgstr "èîøåôä øåáò íéèðîåâøà ÷éôñî ïéà"
-#: builtin.c:1069
+#: builtin.c:1080
msgid "^ ran out for this one"
msgstr "^ íéèðîåâøàä éì åøîâð ïàë"
-#: builtin.c:1074
+#: builtin.c:1085
msgid "[s]printf: format specifier does not have control letter"
msgstr "äøîää úø÷á úåà ìéëî åðéà èîøåôä :[s]printf"
-#: builtin.c:1077
+#: builtin.c:1088
msgid "too many arguments supplied for format string"
msgstr "èîøåôä øåáò íéèðîåâøà éãî øúåé"
-#: builtin.c:1120 builtin.c:1123
+#: builtin.c:1154 builtin.c:1157
msgid "printf: no arguments"
msgstr "èðîåâøà óà ïéà :printf"
-#: builtin.c:1156
+#: builtin.c:1181
msgid "sqrt: received non-numeric argument"
msgstr "øôñî åðéà èðîåâøà :sqrt"
-#: builtin.c:1160
+#: builtin.c:1185
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "%g éìéìù èðîåâøà íò àø÷ð :sqrt"
-#: builtin.c:1182
+#: builtin.c:1207
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "1-á óìçåä ,éåâù åðéä %g äìçúä ïééöî :substr"
-#: builtin.c:1187
+#: builtin.c:1212
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "õöå÷é ,íìù øôñî åðéàù, %g äìçúä ïééöî ìù åëøò :substr"
-#: builtin.c:1201
+#: builtin.c:1231
#, c-format
msgid "substr: length %g is <= 0"
msgstr "0-î ìåãâ øôñî åððéà %g êøåà :substr"
-#: builtin.c:1207
+#: builtin.c:1233
+#, fuzzy, c-format
+msgid "substr: length %g is < 0"
+msgstr "0-î ìåãâ øôñî åððéà %g êøåà :substr"
+
+#: builtin.c:1240
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "õöå÷é ,íìù øôñî åðéàù ,%g êøåà :substr"
-#: builtin.c:1214
+#: builtin.c:1245
+#, c-format
+msgid "substr: length %g too big for string indexing, truncating to %g"
+msgstr ""
+
+#: builtin.c:1257
msgid "substr: source string is zero length"
msgstr "ñôà êøåàá äðéä øå÷îä úæåøçî :substr"
-#: builtin.c:1221
-#, c-format
+#: builtin.c:1263
+#, fuzzy, c-format
+msgid "substr: start index %g is past end of string"
+msgstr "úæåøçîä óåñì øáòî åðéä %d äìçúä ïééöî :substr"
+
+#: builtin.c:1271
+#, fuzzy, c-format
msgid ""
-"substr: length %d at start index %d exceeds length of first argument (%d)"
+"substr: length %g at start index %g exceeds length of first argument (%lu)"
msgstr ""
"%d äëøåàå %d ïééöîá äúìéçúù úæåøçî-úúì ÷éôñî åðéà (%d) úæåøçî êøåà :substr"
-#: builtin.c:1227
-#, c-format
-msgid "substr: start index %d is past end of string"
-msgstr "úæåøçîä óåñì øáòî åðéä %d äìçúä ïééöî :substr"
-
-#: builtin.c:1263
+#: builtin.c:1306
msgid "strftime: received non-string first argument"
msgstr "úæåøçî åðéà ïåùàø èðîåâøà :strftime"
-#: builtin.c:1269
+#: builtin.c:1312
msgid "strftime: received empty format string"
msgstr "ä÷éø èîøåô úæåøçî :strftime"
-#: builtin.c:1278
+#: builtin.c:1321
msgid "strftime: received non-numeric second argument"
msgstr "øôñî åðéà éðù èðîåâøà :strftime"
-#: builtin.c:1341
+#: builtin.c:1384
msgid "mktime: received non-string argument"
msgstr "úæåøçî åðéà èðîåâøà :mktime"
-#: builtin.c:1386
+#: builtin.c:1429
msgid "system: received non-string argument"
msgstr "úæåøçî åðéà èðîåâøà :system"
-#: builtin.c:1512
+#: builtin.c:1573
msgid "tolower: received non-string argument"
msgstr "úæåøçî åðéà èðîåâøà :tolower"
-#: builtin.c:1561
+#: builtin.c:1622
msgid "toupper: received non-string argument"
msgstr "úæåøçî åðéà èðîåâøà :toupper"
-#: builtin.c:1606
+#: builtin.c:1667
msgid "atan2: received non-numeric first argument"
msgstr "øôñî åðéà ïåùàø èðîåâøà :atan2"
-#: builtin.c:1608
+#: builtin.c:1669
msgid "atan2: received non-numeric second argument"
msgstr "øôñî åðéà éðù èðîåâøà :atan2"
-#: builtin.c:1627
+#: builtin.c:1688
msgid "sin: received non-numeric argument"
msgstr "øôñî åðéà èðîåâøà :sin"
-#: builtin.c:1643
+#: builtin.c:1704
msgid "cos: received non-numeric argument"
msgstr "øôñî åðéà èðîåâøà :cos"
-#: builtin.c:1687
+#: builtin.c:1748
msgid "srand: received non-numeric argument"
msgstr "øôñî åðéà èðîåâøà :srand"
-#: builtin.c:1721
+#: builtin.c:1787
msgid "match: third argument is not an array"
msgstr "êøòî åðéà éùéìù èðîåâøà :match"
-#: builtin.c:2157
+#: builtin.c:2264
msgid "gensub: 3rd argument of 0 treated as 1"
msgstr "1-á óìçåä 0 åëøòù éùéìù èðîåâøà :gensub"
-#: builtin.c:2268 builtin.c:2270
+#: builtin.c:2375 builtin.c:2377
msgid "lshift: received non-numeric first argument"
msgstr "øôñî åðéà ïåùàø èðîåâøà :lshift"
-#: builtin.c:2272
+#: builtin.c:2379
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :lshift(%lf, %lf)"
-#: builtin.c:2274
+#: builtin.c:2381
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "åööå÷é íéøåáù íéëøò :lshift(%lf, %lf)"
-#: builtin.c:2276
+#: builtin.c:2383
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr "úåéåôö-éúìá úåàöåú áéðé éãî ìåãâ äææä øåòéù :lshift(%lf, %lf)"
-#: builtin.c:2305 builtin.c:2307
+#: builtin.c:2412 builtin.c:2414
msgid "rshift: received non-numeric first argument"
msgstr "øôñî åðéà ïåùàø èðîåâøà :rshift"
-#: builtin.c:2309
+#: builtin.c:2416
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :rshift(%lf, %lf)"
-#: builtin.c:2311
+#: builtin.c:2418
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "åööå÷é íéøåáù íéëøò :rshift(%lf, %lf)"
-#: builtin.c:2313
+#: builtin.c:2420
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr "úåéåôö-éúìá úåàöåú áéðé éãî ìåãâ äææä øåòéù :rshift(%lf, %lf)"
-#: builtin.c:2342 builtin.c:2344
+#: builtin.c:2449 builtin.c:2451
msgid "and: received non-numeric first argument"
msgstr "øôñî åðéà ïåùàø èðîåâøà :and"
-#: builtin.c:2346
+#: builtin.c:2453
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :and(%lf, %lf)"
-#: builtin.c:2348
+#: builtin.c:2455
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "åööå÷é íéøåáù íéëøò :and(%lf, %lf)"
-#: builtin.c:2377 builtin.c:2379
+#: builtin.c:2484 builtin.c:2486
msgid "or: received non-numeric first argument"
msgstr "øôñî åðéà ïåùàø èðîåâøà :or"
-#: builtin.c:2381
+#: builtin.c:2488
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :or(%lf, %lf)"
-#: builtin.c:2383
+#: builtin.c:2490
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "åööå÷é íéøåáù íéëøò :or(%lf, %lf)"
-#: builtin.c:2412 builtin.c:2414
+#: builtin.c:2519 builtin.c:2521
msgid "xor: received non-numeric first argument"
msgstr "øôñî åðéà ïåùàø èðîåâøà :xor"
-#: builtin.c:2416
+#: builtin.c:2523
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr "úåéåôö-éúìá úåàöåú åáéðé íééìéìù íéëøò :xor(%lf, %lf)"
-#: builtin.c:2418
+#: builtin.c:2525
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "åööå÷é íéøåáù íéëøò :xor(%lf, %lf)"
-#: builtin.c:2446
+#: builtin.c:2553
msgid "compl: received non-numeric argument"
msgstr "øôñî åðéà èðîåâøà :compl"
-#: builtin.c:2448
+#: builtin.c:2555
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "úåéåôö-éúìá úåàöåú áéðé éìéìù êøò :compl(%lf)"
-#: builtin.c:2450
+#: builtin.c:2557
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "õöå÷é øåáù êøò :compl(%lf)"
-#: builtin.c:2621
+#: builtin.c:2728
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "äðé÷ú íå÷éî úééøåâè÷ åðéà `%s' :dcgettext"
+#: eval.c:262
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "%d ääåæî-éúìá âåñ ìòá node"
+
+#: eval.c:310
+msgid "buffer overflow in genflags2str"
+msgstr "genflags2str-á õöåç úùéìâ"
+
+#: eval.c:555
+#, fuzzy, c-format
+msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
+msgstr "(`%s' êøòî) äàìåìä òåöéá êìäîá %d-î %d-ì äðåù êøòî ìù åìãåâ :for úàìåì"
+
+#: eval.c:576
+msgid "`break' outside a loop is not portable"
+msgstr "éìéáèøåô åðéà äàìåìì õåçî `break'"
+
+#: eval.c:580
+msgid "`break' outside a loop is not allowed"
+msgstr "äàìåìì õåçî `break'-á ùîúùäì ïéà"
+
+#: eval.c:597
+msgid "`continue' outside a loop is not portable"
+msgstr "éìéáèøåô åðéà äàìåìì õåçî `continue'"
+
+#: eval.c:601
+msgid "`continue' outside a loop is not allowed"
+msgstr "äàìåìì õåçî `continue'-á ùîúùäì ïéà"
+
+#: eval.c:635
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "BEGIN éììë êåúî `next'-ì àåø÷ì ïéà"
+
+#: eval.c:637
+msgid "`next' cannot be called from an END rule"
+msgstr "END éììë êåúî `next'-ì àåø÷ì ïéà"
+
+#: eval.c:646
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "BEGIN éììë êåúî `nextfile'-ì àåø÷ì ïéà"
+
+#: eval.c:648
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "END éììë êåúî `nextfile'-ì àåø÷ì ïéà"
+
+#: eval.c:696
+msgid "statement has no effect"
+msgstr "úéìëú-úìåèð äàøåä"
+
+#: eval.c:731 eval.c:761 eval.c:1733
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "`%s' ìçåúî-éúìá äðúùîì äéðôä"
+
+#: eval.c:739 eval.c:1721
+#, c-format
+msgid "can't use function name `%s' as variable or array"
+msgstr "êøòî åà äðúùîë `%s' äéö÷ðåô íùá ùîúùäì ïéà"
+
+#: eval.c:746 eval.c:752
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "`%s' ìçåúî-éúìá èðîåâøàì äéðôä"
+
+#: eval.c:810 eval.c:1728 profile.c:773
+#, c-format
+msgid "attempt to use array `%s' in a scalar context"
+msgstr "øàì÷ñ ùøåãä èñ÷èðå÷á `%s' êøòîá ùåîéù ïåéñð"
+
+#: eval.c:910
+msgid ""
+"concatenation: side effects in one expression have changed the length of "
+"another!"
+msgstr ""
+"!øçà éåèéá ìù åëøåà éåðéùì åîøâ ãçà éåèéá áåùéç ìù éàåì-úåòôåú :concatenation"
+
+#: eval.c:935
+msgid "assignment used in conditional context"
+msgstr "éàðú ìù èñ÷èðå÷á äîùäá ùåîéù"
+
+#: eval.c:1026
+msgid "division by zero attempted"
+msgstr "ñôàá ä÷åìç ïåéñð"
+
+#: eval.c:1041
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "`%%'-á ñôàá ä÷åìç ïåéñð"
+
+#: eval.c:1056 profile.c:649
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "tree_eval-á (%s) éåâù âåñ"
+
+#: eval.c:1232
+msgid "division by zero attempted in `/='"
+msgstr "`/='-á ñôàá ä÷åìç ïåéñð"
+
+#: eval.c:1250
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "`%%='-á ñôàá ä÷åìç ïåéñð"
+
+# This is not translated because it cannot be reworded in Hebrew
+# without looking awkward.
+#: eval.c:1510
+#, c-format
+msgid "%s (from %s)"
+msgstr "%s (from %s)"
+
+#: eval.c:1569
+#, c-format
+msgid "function `%s' called with more arguments than declared"
+msgstr "äúæøëäá øùàî íéèðîåâøà øúåé íò `%s' äéö÷ðåôì äàéø÷"
+
+#: eval.c:1628
+#, c-format
+msgid "function `%s' not defined"
+msgstr "úøãâåî äðéà `%s' äéö÷ðåô"
+
+#: eval.c:1634
+#, c-format
+msgid "function %s called\n"
+msgstr "`%s' äéö÷ðåôì äàéø÷\n"
+
+#: eval.c:1693
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# :úåéö÷ðåôì úåàéø÷ä úéðñçî\n"
+"\n"
+
+#: eval.c:1696
+msgid "\t# -- main --\n"
+msgstr "\t# -- main --\n"
+
+#: eval.c:1850
+msgid "attempt to field reference from non-numeric value"
+msgstr "øôñî åðéàù êøò úåòöîàá äãùì äéðôä ïåéñð"
+
+#: eval.c:1852
+msgid "attempt to reference from null string"
+msgstr "ä÷éø úæåøçî úåòöîàá äãùì äéðôä ïåéñð"
+
+#: eval.c:1858
+#, c-format
+msgid "attempt to access field %d"
+msgstr "%d 'ñî äãùì äùéâ ïåéñð"
+
+#: eval.c:1874
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr "êøòî äéä åìéàë `%s' éøì÷ñ øèîøôá ùåîéù ïåéñð"
+
+#: eval.c:1886 eval.c:1893 profile.c:865
+msgid "assignment is not allowed to result of builtin function"
+msgstr "úéðáåî äéö÷ðåô ìù äàöåúá êøò áéöäì ïéà"
+
+#: eval.c:1941
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `IGNORECASE'"
+
+#: eval.c:1970
+msgid "`BINMODE' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `BINMODE'"
+
+#: eval.c:2082
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "äðé÷ú `%sFMT' úøãâä åðéà `%s'"
+
+#: eval.c:2160
+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'"
@@ -416,10 +894,35 @@ msgstr "`%s' úçéúô úòá (%s) äì÷ú äòøéà :extension\n"
msgid "extension: library `%s': cannot call function `%s' (%s)\n"
msgstr "`%s' äéøôñî `%s' äéö÷ðåôì äàéø÷á (%s) äì÷ú äòøéà :extension\n"
-#: ext.c:180
+#: ext.c:181
msgid "Operation Not Supported"
msgstr "úëîúð äðéà åæ äìåòô"
+#: field.c:321
+msgid "NF set to negative value"
+msgstr "éìéìù êøò ìáé÷ NF"
+
+#: field.c:819
+msgid "split: second argument is not an array"
+msgstr "êøòî åðéà `split' ìù éðùä èðîåâøàä"
+
+#: field.c:854
+msgid "split: null string for third arg is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä äðéä `split'-ì éùéìù èðåîâøàë úñôåàî úæåøçî"
+
+#: field.c:906
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä åðéä `FIELDWIDTHS'"
+
+#: field.c:933
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "0-î ìåãâ úåéäì áééç FIELDWIDTHS-á %d 'ñî äãù"
+
+#: field.c:1006
+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
@@ -464,7 +967,7 @@ msgstr "%s: é÷åç-éúìá ïééôàî -- %c\n"
msgid "%s: invalid option -- %c\n"
msgstr "%s úéðëú øåáò éåâù ïééôàî -- %c\n"
-#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412
+#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:431
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: èðîåâøà áééçî ïééôàî -- %c\n"
@@ -479,164 +982,466 @@ msgstr "%s úéðëú øåáò éòîùî-ãç åðéà `-W %s' ïééôàî\n"
msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "%s úéðëú øåáò èðîåâøà ìá÷î åðéà `-W %s' ïééôàî\n"
-#: main.c:307
+#: io.c:257
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "åúàéø÷ íùì `%s' õáå÷ úçéúôá (%s) äì÷ú"
+
+#: io.c:344
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "(%d èìô/èì÷ õåøò) `%s' úøéâñá (%s) äì÷ú"
+
+#: io.c:482
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "redirect() äéö÷ðåôá %s éåâù õò âåñ"
+
+#: io.c:488
+#, c-format
+msgid "expression in `%s' redirection only has numeric value"
+msgstr "ãáìá éøîåð êøò áéðî `%s' èìô/èì÷ úééðôäá éåèéá"
+
+#: io.c:494
+#, c-format
+msgid "expression for `%s' redirection has null string value"
+msgstr "ä÷éø úæåøçî áéðî `%s' èìô/èì÷ úééðôäá éåèéá"
+
+#: io.c:499
+#, c-format
+msgid "filename `%s' for `%s' redirection may be result of logical expression"
+msgstr "éâåì éåèéá ìù äàöåú úåéäì ìåìò `%s' õáå÷ íù `%s' èìô/èì÷ úééðôäá"
+
+#: io.c:521
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "`%.*s' õáå÷ øåáò `>>'-á ïäå `>'-á ïä øúåéî ùåîéù"
+
+#: io.c:573
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "èìô êøåöì `%s' ÷éôà úçéúôá (%s) äì÷ú"
+
+#: io.c:582
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "èì÷ êøåöì `%s' ÷éôà úçéúôá (%s) äì÷ú"
+
+#: io.c:595
+#, c-format
+msgid "can't open two way socket `%s' for input/output (%s)"
+msgstr "èìô/èì÷ êøåöì éðååéë-åã (socket) ò÷ùë `%s' úçéúôá (%s) äì÷ú"
+
+#: io.c:599
+#, c-format
+msgid "can't open two way pipe `%s' for input/output (%s)"
+msgstr "èìô/èì÷ êøåöì éðååéë-åã (pipe) ÷éôàë `%s' úçéúôá (%s) äì÷ú"
+
+#: io.c:675
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "`%s'-î äééðôäá (%s) äì÷ú"
+
+#: io.c:678
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "`%s' ìà äééðôäá (%s) äì÷ú"
+
+#: io.c:717
+msgid ""
+"reached system limit for open files: starting to multiplex file descriptors"
+msgstr "èìô/èì÷ éöåøò áåáéø úìéçú ;íéçåúô íéöá÷ øôñî ìù úëøòî úìáâîì äòâä"
+
+#: io.c:729
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "`%s' úøéâñá (%s) äì÷ú"
+
+#: io.c:736
+msgid "too many pipes or input files open"
+msgstr "úéðîæ-åá íéçåúô èì÷ éöá÷ åà (pipes) íé÷éôà éãî øúåé"
+
+#: io.c:759
+msgid "close: second argument must be `to' or `from'"
+msgstr "`from' åà `to' úåéäì áééç `close' ìù éðùä èðîåâøàä"
+
+#: io.c:773
+#, c-format
+msgid "close: `%.*s' is not an open file, pipe or co-process"
+msgstr "ìéá÷î êéìäú åà çåúô ÷éôà ,çåúô õáå÷ åðéà `%.*s' :close"
+
+#: io.c:777
+msgid "close of redirection that was never opened"
+msgstr "íìåòî äçúôð àìù äééðôä úøéâñ"
+
+#: io.c:804
+#, c-format
+msgid "close: redirection `%s' not opened with `|&', second argument ignored"
+msgstr "çðæåä éðùä èðîåâøàä ,`|&' é\"ò äçúôð àì `%s' äééðôä"
+
+#: io.c:866
+#, c-format
+msgid "failure status (%d) on pipe close of `%s' (%s)"
+msgstr "(%d äì÷ú ãå÷) `%s'-ì ÷éôà úøéâñá (%s) äì÷ú"
+
+#: io.c:869
+#, c-format
+msgid "failure status (%d) on file close of `%s' (%s)"
+msgstr "(%d äì÷ú ãå÷) `%s' õáå÷ úøéâñá (%s) äì÷ú"
+
+#: io.c:888
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "ùøåôîá øâñð àì (socket) `%s' ò÷ù"
+
+#: io.c:891
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "ùøåôîá øâñð àì (co-process) `%s' ìéá÷î êéìäú"
+
+#: io.c:894
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "ùøåôîá øâñð àì (pipe) `%s' ÷éôà"
+
+#: io.c:897
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "ùøåôîá øâñð àì `%s' õáå÷"
+
+#: io.c:926 io.c:980
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "éð÷ú èìô õåøòì äáéúëá (%s) äì÷ú"
+
+#: io.c:930 io.c:984
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "éð÷ú úåàéâù õåøòì äáéúëá (%s) äì÷ú"
+
+#: io.c:938
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "`%s'-ì ÷éôà ìù õöåç ïå÷éøá (%s) äì÷ú"
+
+#: io.c:941
+#, c-format
+msgid "co-process flush of pipe to `%s' failed (%s)."
+msgstr "`%s'-ì ìéá÷î êéìäú ÷éôà ìù õöåç ïå÷éøá (%s) äì÷ú"
+
+#: io.c:944
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "`%s' ìù õáå÷ éðåúð õöåç ïå÷éøá (%s) äì÷ú"
+
+#: io.c:1103
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "ïëåî íøè /inet/raw çå÷ì ,íéøòèöî"
+
+#: io.c:1105 io.c:1142
+msgid "only root may use `/inet/raw'."
+msgstr "ãáìá root ùîúùîì øúåî `inet/raw'-á ùåîéù"
+
+#: io.c:1140
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "ïëåî íøè /inet/raw úøù ,íéøòèöî"
+
+#: io.c:1230
+#, c-format
+msgid "no (known) protocol supplied in special filename `%s'"
+msgstr "`%s' ãçåéî õáå÷ íùá ääåæî-éúìá åà øñç ìå÷åèåøô"
+
+#: io.c:1248
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "íìù åðéà `%s' ãçåéî õáå÷"
+
+#: io.c:1260
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "`%s'-á äéåâù úéîå÷î äàéöé"
+
+#: io.c:1272
+msgid "must supply a remote hostname to `/inet'"
+msgstr "`/inet' øåáò ÷çåøî çøàî-áùçî íù øéãâäì äáåç"
+
+#: io.c:1287
+msgid "must supply a remote port to `/inet'"
+msgstr "`/inet' øåáò ú÷çåøî äàéöé øéãâäì äáåç"
+
+#: io.c:1293
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "`%s'-á äéåâù ú÷çåøî äàéöé"
+
+#: io.c:1303
+msgid "TCP/IP communications are not supported"
+msgstr "TCP/IP úøåù÷úá äëéîú ïéà"
+
+#: io.c:1312 io.c:1492
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "äé÷éú åðéä `%s' õáå÷"
+
+#: io.c:1381
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "`PROCINFO[\"%s\"]'-á ùîúùäì óéãò `%s' íå÷îá"
+
+#: io.c:1413
+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:1478 io.c:1652
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "`%s' øåáò `%s' äìåòô ïôåà úçéúôá ïåìùë"
+
+#: io.c:1703
+#, fuzzy, c-format
+msgid "close of master pty failed (%s)"
+msgstr "÷éôà úøéâñá (%s) äì÷ú"
+
+#: io.c:1705 io.c:1857 io.c:2009
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "úá-úéðëúá stdout úøéâñá (%s) äì÷ú"
+
+#: io.c:1708
+#, fuzzy, c-format
+msgid "moving slave pty to stdout in child failed (dup: %s)"
+msgstr "úá-úéðëúá stdout-ì ÷éôà ìåôëùá (dup: %s) äì÷ú"
+
+#: io.c:1710 io.c:1862
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "úá-úéðëúá stdin úøéâñá (%s) äì÷ú"
+
+#: io.c:1713
+#, fuzzy, c-format
+msgid "moving slave pty to stdin in child failed (dup: %s)"
+msgstr "úá-úéðëúá stdin-ì ÷éôà ìåôëùá (dup: %s) äì÷ú"
+
+#: io.c:1715 io.c:1734
+#, fuzzy, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "÷éôà úøéâñá (%s) äì÷ú"
+
+#: io.c:1808 io.c:1860 io.c:1990 io.c:2012
+#, c-format
+msgid "moving pipe to stdout in child failed (dup: %s)"
+msgstr "úá-úéðëúá stdout-ì ÷éôà ìåôëùá (dup: %s) äì÷ú"
+
+#: io.c:1812 io.c:1865
+#, c-format
+msgid "moving pipe to stdin in child failed (dup: %s)"
+msgstr "úá-úéðëúá stdin-ì ÷éôà ìåôëùá (dup: %s) äì÷ú"
+
+#: io.c:1829 io.c:2003
+msgid "restoring stdout in parent process failed\n"
+msgstr "áà-úéðëúá stdout ÷éôà øåæçùá äì÷ú\n"
+
+#: io.c:1834
+msgid "restoring stdin in parent process failed\n"
+msgstr "áà-úéðëúá stdin ÷éôà øåæçùá äì÷ú\n"
+
+#: io.c:1868 io.c:2014 io.c:2025
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "÷éôà úøéâñá (%s) äì÷ú"
+
+#: io.c:1913
+msgid "`|&' not supported"
+msgstr "`|&'-á äëéîú ïéà"
+
+#: io.c:1980
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "`%s' ÷éôà úçéúôá (%s) äì÷ú"
+
+#: io.c:2021
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr "`%s' úá-úéðëúì êéìäú úøéöéá (fork: %s) äì÷ú"
+
+#: io.c:2364
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "÷éø åðéä `%s' íéðåúð õáå÷"
+
+#: io.c:2407 io.c:2415
+msgid "could not allocate more input memory"
+msgstr ""
+
+#: io.c:2540 io.c:2782 io.c:3046
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "`%s' õáå÷ úàéø÷á (%s) äì÷ú"
+
+#: io.c:3281
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "gawk-ì úéôéöôñ äáçøä äðéä `RS' ìù êøòá íéåú øôñîá äëéîú"
+
+#: main.c:322
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "gawk øåáò éèðååìø åðéà `-m[fr]' ïééôàî"
-#: main.c:309
+#: main.c:324
msgid "-m option usage: `-m[fr] nnn'"
msgstr "`-m[fr] nnn' :-m ïééôàîá ùåîéù ïôåà"
-#: main.c:326
+#: main.c:341
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "çðæåä ,%s úéðëú øåáò øëåî åðéà `-W %s' ïééôàî\n"
-#: main.c:357
+#: main.c:378
msgid "empty argument to `--source' ignored"
msgstr "çðæåä `--source'-ì ÷éø èðîåâøà"
-#: main.c:429
+#: main.c:448
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr "`--posix' ìéòôî :øãâåî `POSIXLY_CORRECT' äáéáñ äðúùî"
-#: main.c:434
+#: main.c:453
msgid "`--posix' overrides `--traditional'"
msgstr "`--traditional' ìò øáåâ `--posix'"
-#: main.c:445
+#: main.c:464
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr "`--non-decimal-data' ìò øáåâ `--posix'/`--traditional'"
-#: main.c:449
+#: main.c:468
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr "òãéî úçèáàá òåâôì äìåìò setuid root-ë %s úöøä"
-#: main.c:478
-#, c-format
-msgid "can't set mode on stdin (%s)"
+#: main.c:509
+#, fuzzy, c-format
+msgid "can't set binary mode on stdin (%s)"
msgstr "stdin úìåòô ïôåà úòéá÷á (%s) äì÷ú"
-#: main.c:481
-#, c-format
-msgid "can't set mode on stdout (%s)"
+#: main.c:512
+#, fuzzy, c-format
+msgid "can't set binary mode on stdout (%s)"
msgstr "stdout úìåòô ïôåà úòéá÷á (%s) äì÷ú"
-#: main.c:483
-#, c-format
-msgid "can't set mode on stderr (%s)"
+#: main.c:514
+#, fuzzy, c-format
+msgid "can't set binary mode on stderr (%s)"
msgstr "stderr úìåòô ïôåà úòéá÷á (%s) äì÷ú"
-#: main.c:512
+#: main.c:544
msgid "no program text at all!"
msgstr "!ììë àöîðá äéä àì úéðëú ìù èñ÷è"
-#: main.c:556
+#: main.c:612
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr ""
"%s [GNU åà POSIX ïåðâñá íéðééôàî] -f úéðëú-íù [--] õáå÷-íù ... :ùåîéù ïôåà\n"
-#: main.c:558
+#: main.c:614
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr ""
"%s [GNU åà POSIX ïåðâñá íéðééôàî] [--] %cúéðëú%c õáå÷-íù ... :ùåîéù ïôåà\n"
-#: main.c:563
+#: main.c:619
msgid "POSIX options:\t\tGNU long options:\n"
msgstr ":POSIX éðééôàî\t\t:íéëåøà GNU éðééôàî\n"
-#: main.c:564
+#: main.c:620
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f úéðëú-õáå÷\t\t--file=úéðëú-õáå÷\n"
-#: main.c:565
+#: main.c:621
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F úåãù-ãéøôî\t\t--field-separator=úåãù-ãéøôî\n"
-#: main.c:566
+#: main.c:622
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "\t-v äðúùî=êøò\t\t--assign=äðúùî=êøò\n"
-#: main.c:567
+#: main.c:623
msgid "\t-m[fr] val\n"
msgstr "\t-m[fr] êøò\n"
-#: main.c:568
+#: main.c:624
msgid "\t-W compat\t\t--compat\n"
msgstr "\t-W compat\t\t--compat\n"
-#: main.c:569
+#: main.c:625
msgid "\t-W copyleft\t\t--copyleft\n"
msgstr "\t-W copyleft\t\t--copyleft\n"
-#: main.c:570
+#: main.c:626
msgid "\t-W copyright\t\t--copyright\n"
msgstr "\t-W copyright\t\t--copyright\n"
-#: main.c:571
+#: main.c:627
msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
msgstr "\t-W dump-variables[=õáå÷-íù]\t--dump-variables[=õáå÷-íù]\n"
-#: main.c:572
+#: main.c:628
msgid "\t-W gen-po\t\t--gen-po\n"
msgstr "\t-W gen-po\t\t--gen-po\n"
-#: main.c:573
+#: main.c:629
msgid "\t-W help\t\t\t--help\n"
msgstr "\t-W help\t\t\t--help\n"
-#: main.c:574
+#: main.c:630
msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
-#: main.c:575
+#: main.c:631
msgid "\t-W lint-old\t\t--lint-old\n"
msgstr "\t-W lint-old\t\t--lint-old\n"
-#: main.c:576
+#: main.c:632
msgid "\t-W non-decimal-data\t--non-decimal-data\n"
msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
-#: main.c:578
+#: main.c:634
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:581
+#: main.c:637
msgid "\t-W parsedebug\t\t--parsedebug\n"
msgstr "\t-W parsedebug\t\t--parsedebug\n"
-#: main.c:583
+#: main.c:639
msgid "\t-W profile[=file]\t--profile[=file]\n"
msgstr "\t-W profile[=õáå÷-íù]\t--profile[=õáå÷-íù]\n"
-#: main.c:584
+#: main.c:640
msgid "\t-W posix\t\t--posix\n"
msgstr "\t-W posix\t\t--posix\n"
-#: main.c:585
+#: main.c:641
msgid "\t-W re-interval\t\t--re-interval\n"
msgstr "\t-W re-interval\t\t--re-interval\n"
-#: main.c:586
+#: main.c:642
msgid "\t-W source=program-text\t--source=program-text\n"
msgstr "\t-W source=úéðëú-èñ÷è\t--source=úéðëú-èñ÷è\n"
-#: main.c:587
+#: main.c:643
msgid "\t-W traditional\t\t--traditional\n"
msgstr "\t-W traditional\t\t--traditional\n"
-#: main.c:588
+#: main.c:644
msgid "\t-W usage\t\t--usage\n"
msgstr "\t-W usage\t\t--usage\n"
-#: main.c:589
+#: main.c:645
msgid "\t-W version\t\t--version\n"
msgstr "\t-W version\t\t--version\n"
-#: main.c:593
+#: main.c:649
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -648,7 +1453,7 @@ msgstr ""
" .ñôãåîä êéøãîá `Reporting Problems and Bugs' ä÷ñô\n"
"\n"
-#: main.c:597
+#: main.c:653
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -657,7 +1462,7 @@ msgstr ""
".èñ÷è úåéðáú ìù ãåáéòå äé÷øñì äôù åðéä gawk\n"
".éð÷ú èìôì áúåëå éð÷ú èì÷ õåøò àøå÷ àåä ìãçî úøéøáë\n"
-#: main.c:601
+#: main.c:657
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -667,7 +1472,7 @@ msgstr ""
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:613
+#: main.c:669
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -685,7 +1490,7 @@ msgstr ""
" íàå ,ïåéùøä ìù 2 àñøâá íà ;Free Software Foundation\n"
" .øúåé úøçåàî àñøâ ìëá (íëì äøåîùä äéöôåàë)\n"
-#: main.c:621
+#: main.c:677
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"
@@ -698,7 +1503,7 @@ msgstr ""
",íéèøôì .úîéåñî úéìëú åæéàì äîàúä åà úåøéçñ ìù\n"
" .GNU General Public License-á åðééò àðà\n"
-#: main.c:627
+#: main.c:683
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"
@@ -708,100 +1513,121 @@ msgstr ""
"Free Software Foundation, Inc.-ì åáúë àðà ,åúåà íúìáé÷ àì íà\n"
".59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\n"
-#: main.c:657
+#: main.c:713
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "awk ìù POSIX úñøâá TAB úåéäì FS-ì íøåâ åðéà -Ft"
-#: main.c:888
+#: main.c:944
+#, c-format
+msgid ""
+"%s: `%s' argument to `-v' not in `var=value' form\n"
+"\n"
+msgstr ""
+
+#: main.c:964
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr ""
+
+#: main.c:967
#, c-format
-msgid "invalid syntax in name `%s' for variable assignment"
-msgstr "êøò úîùäá `%s' äðúùî íù ìù éåâù øéáçú"
+msgid "`%s' is not a variable name, looking for file `%s=%s'"
+msgstr ""
-#: main.c:957
+#: main.c:995
msgid "floating point exception"
msgstr "äôö äãå÷ð éáåùéçá äâéøç"
-#: main.c:964
+#: main.c:1002
msgid "fatal error: internal error"
msgstr "úéîéðô äðëú úàéâù :äøåîç äì÷ú"
# FIXME: I wonder how many people will understand what "fd 2" means.
-#: main.c:1014
+#: main.c:1052
#, c-format
msgid "no pre-opened fd %d"
msgstr "ùàøî çåúô åðéà %d èìô/èì÷ õåøò"
# FIXME: /dev/null might not be known to all.
-#: main.c:1019
+#: main.c:1057
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "/dev/null-ì %d èìô/èì÷ õåøò çåúôì ïúéð àì"
-#: main.c:1037 main.c:1046
+#: main.c:1080 main.c:1089
#, c-format
msgid "could not find groups: %s"
msgstr "%s :úëøòîá íéùîúùî úåöåá÷ ìò òãéî ïéà"
-#: profile.c:94
-#, c-format
-msgid "could not open `%s' for writing: %s"
-msgstr "äáéúë êøåöì `%s' úçéúô úòá (%s) äì÷ú"
+# 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:"
-#: profile.c:96 awkgram.y:2465
-msgid "sending profile to standard error"
-msgstr "éð÷ú úåàéâù õåøòì çìùð òåöéá ìéôåøô"
+#: msg.c:120
+msgid "warning: "
+msgstr "warning: "
-#: profile.c:409
-msgid "internal error: Node_var with null vname"
-msgstr "ñôåàî åìù vname-äù Node_var :úéîéðô äðëú úàéâù"
+#: msg.c:142
+msgid "error: "
+msgstr "error: "
-#: profile.c:524
-msgid "internal error: Node_var_array with null vname"
-msgstr "ñôåàî åìù vname-äù Node_var_array :úéîéðô äðëú úàéâù"
+#: msg.c:178
+msgid "fatal: "
+msgstr "fatal: "
-#: profile.c:554 eval.c:813
-#, c-format
-msgid ""
-"function `%s' called with space between name and `(',\n"
-"%s"
-msgstr ""
-",`(' ïéáì äîù ïéá íéçååø íò `%s' äéö÷ðåôì äàéø÷\n"
-"%s"
+#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
+msgid "can't convert string to float"
+msgstr "øôñîì äøîäì úðúéð äðéà úæåøçî"
-#: profile.c:556 eval.c:815
-msgid "or used in other expression context"
-msgstr "øçà éåèéá ìù èñ÷èðå÷á äá ùåîéù åà"
+#: node.c:357
+msgid "backslash at end of string"
+msgstr "úæåøçî óåñá êåôä ïñëåì"
-#: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741
-#, c-format
-msgid "attempt to use array `%s' in a scalar context"
-msgstr "øàì÷ñ ùøåãä èñ÷èðå÷á `%s' êøòîá ùåîéù ïåéñð"
+#: node.c:544
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "`\\x' âåñî äø÷á úåøãñ äùøî åðéà POSIX ï÷ú"
+
+#: node.c:550
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "`\\x' äø÷á úøãñá úåéìîéöãñ÷ä úåøôñá ùîúùäì ïéà"
-#: profile.c:637 eval.c:1047
+#: node.c:584
#, c-format
-msgid "illegal type (%s) in tree_eval"
-msgstr "tree_eval-á (%s) éåâù âåñ"
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr "éìåìéî åúë ìôåè `\\%c' äø÷á úøãñá `%c' åú"
-#: profile.c:842 eval.c:1790
+#: posix/gawkmisc.c:172
#, c-format
-msgid "attempt to use function `%s' as array"
-msgstr "êøòîë `%s' äéö÷ðåôá ùåîéù ïåéñð"
+msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
+msgstr "%s %s `%s' øåáò close-on-exec ïééôàî úìòôäá (fcntl: %s) äì÷ú"
-#: profile.c:856 eval.c:1797
+#: profile.c:91
#, c-format
-msgid "`%s' is a function, assignment is not allowed"
-msgstr "äøåñà äá êøò úîùä ,äéö÷ðåô àéä `%s'"
+msgid "could not open `%s' for writing: %s"
+msgstr "äáéúë êøåöì `%s' úçéúô úòá (%s) äì÷ú"
-#: profile.c:860 eval.c:1803 eval.c:1810
-msgid "assignment is not allowed to result of builtin function"
-msgstr "úéðáåî äéö÷ðåô ìù äàöåúá êøò áéöäì ïéà"
+#: profile.c:409
+msgid "internal error: Node_var with null vname"
+msgstr "ñôåàî åìù vname-äù Node_var :úéîéðô äðëú úàéâù"
+
+#: profile.c:471
+msgid "# treated internally as `delete'"
+msgstr ""
-#: profile.c:1108
+#: profile.c:545
+msgid "internal error: Node_var_array with null vname"
+msgstr "ñôåàî åìù vname-äù Node_var_array :úéîéðô äðëú úàéâù"
+
+#: profile.c:1127
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# %s êéøàúî gawk ìù ìéôåøô\n"
-#: profile.c:1111
+#: profile.c:1130
msgid ""
"\t# BEGIN block(s)\n"
"\n"
@@ -809,7 +1635,7 @@ msgstr ""
"\t# BEGIN ÷åìá\n"
"\n"
-#: profile.c:1121
+#: profile.c:1140
msgid ""
"\t# Rule(s)\n"
"\n"
@@ -817,7 +1643,7 @@ msgstr ""
"\t# (íé)ììë\n"
"\n"
-#: profile.c:1127
+#: profile.c:1146
msgid ""
"\t# END block(s)\n"
"\n"
@@ -825,7 +1651,7 @@ msgstr ""
"\t# END ÷åìá\n"
"\n"
-#: profile.c:1147
+#: profile.c:1166
msgid ""
"\n"
"\t# Functions, listed alphabetically\n"
@@ -833,911 +1659,138 @@ msgstr ""
"\n"
"\t# úéá-óìà øãñá ,úåéö÷ðåô\n"
-#: profile.c:1357
+#: profile.c:1376
#, c-format
msgid "unexpected type %s in prec_level"
msgstr "prec_level-á %s éåâù âåñ"
-#: regex.c:1322
+#: 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 "äçìöä"
-#: regex.c:1323
+#: regcomp.c:139
msgid "No match"
msgstr "äîéàúî úæåøçî äàöîð àì"
-#: regex.c:1324
+#: regcomp.c:142
msgid "Invalid regular expression"
msgstr "éåâù éøìåâø éåèéá"
-#: regex.c:1325
+#: regcomp.c:145
msgid "Invalid collation character"
msgstr "øãâåî-éúìá øåãéñ åú"
-#: regex.c:1326
+#: regcomp.c:148
msgid "Invalid character class name"
msgstr "íéåú úöåá÷ ìù øãâåî-éúìá íù"
-#: regex.c:1327
+#: regcomp.c:151
msgid "Trailing backslash"
msgstr "`\\' éøåçà ïñëåìá íééúñî éøìåâø éåèéá"
-#: regex.c:1328
+#: regcomp.c:154
msgid "Invalid back reference"
msgstr "íãå÷ éåèéá-úúì äéåâù äééðôä"
-#: regex.c:1329
+#: regcomp.c:157
msgid "Unmatched [ or [^"
msgstr "âåæ-ïá åì ïéàù [^ åà ["
-#: regex.c:1330
+#: regcomp.c:160
msgid "Unmatched ( or \\("
msgstr "âåæ-ïá åì ïéàù \\( åà ("
-#: regex.c:1331
+#: regcomp.c:163
msgid "Unmatched \\{"
msgstr "âåæ-ïá åì ïéàù \\{"
-#: regex.c:1332
+#: regcomp.c:166
msgid "Invalid content of \\{\\}"
msgstr "\\{\\} êåúá éåâù äðáî"
-#: regex.c:1333
+#: regcomp.c:169
msgid "Invalid range end"
msgstr "íéåú íåçú ìù äéåâù äøãâä"
-#: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204
+#: regcomp.c:172
msgid "Memory exhausted"
msgstr "ïåøëæä øîâð"
-#: regex.c:1335
+#: regcomp.c:175
msgid "Invalid preceding regular expression"
msgstr "íéé÷ åðéà åà éåâù íãå÷ éøìåâø éåèéá"
-#: regex.c:1336
+#: regcomp.c:178
msgid "Premature end of regular expression"
msgstr "éãî íã÷åî íééúñî éøìåâø éåèéá"
-#: regex.c:1337
+#: regcomp.c:181
msgid "Regular expression too big"
msgstr "éãî áëøåî åà ìåãâ éøìåâø éåèéá"
-#: regex.c:1338
+#: regcomp.c:184
msgid "Unmatched ) or \\)"
msgstr "âåæ-ïá åì ïéàù \\) åà )"
-#: regex.c:7365
+#: regcomp.c:621
msgid "No previous regular expression"
msgstr "íãå÷ éøìåâø éåèéá ïéà"
-#: awkgram.y:232
-msgid "BEGIN blocks must have an action part"
-msgstr "äìåòô úøãâä ìåìëì áééç BEGIN ÷åìá"
+#~ msgid "BEGIN blocks must have an action part"
+#~ msgstr "äìåòô úøãâä ìåìëì áééç BEGIN ÷åìá"
-#: awkgram.y:238
-msgid "END blocks must have an action part"
-msgstr "äìåòô úøãâä ìåìëì áééç END ÷åìá"
+#~ msgid "`nextfile' used in BEGIN or END action"
+#~ msgstr "END åà BEGIN ìù äìåòô úøãâäá `nextfile'-á ùåîéù"
-#: awkgram.y:274
-#, c-format
-msgid "`%s' is a built-in function, it cannot be redefined"
-msgstr "äúøãâä úà úåðùì ïéà ,úéðáåî äéö÷ðåô äðéä `%s'"
+#~ msgid "gsub third parameter is not a changeable object"
+#~ msgstr "éåðéù-øá è÷ééáåà åðéà `gsub' ìù éùéìù èðîåâøà"
-#: awkgram.y:362
-msgid "statement may have no effect"
-msgstr "úéìëú íåù äéäú àì äæ éåèéáìù ïëúé"
+#~ msgid "or used in other expression context"
+#~ msgstr "øçà éåèéá ìù èñ÷èðå÷á äá ùåîéù åà"
-#: awkgram.y:455
-msgid "`next' used in BEGIN or END action"
-msgstr "END åà BEGIN ìù äìåòô úøãâäá `next'-á ùåîéù"
+#~ msgid "attempt to use function `%s' as array"
+#~ msgstr "êøòîë `%s' äéö÷ðåôá ùåîéù ïåéñð"
-#: awkgram.y:462 awkgram.y:469
-msgid "`nextfile' is a gawk extension"
-msgstr "gawk-ì úéôéöôñ äáçøä åðéä `nextfile'"
+#~ msgid "`%s' is a function, assignment is not allowed"
+#~ msgstr "äøåñà äá êøò úîùä ,äéö÷ðåô àéä `%s'"
-#: awkgram.y:474
-msgid "`nextfile' used in BEGIN or END action"
-msgstr "END åà BEGIN ìù äìåòô úøãâäá `nextfile'-á ùåîéù"
+#~ msgid "internal error: file `%s', line %d\n"
+#~ msgstr "`%s' õáå÷ ìù %d äøåùá úéîéðô äðëú äàéâù\n"
-#: awkgram.y:483
-msgid "`return' used outside function context"
-msgstr "äéö÷ðåô ìù èñ÷èðå÷á àìù `return'-á ùåîéù"
+#~ msgid "non-redirected `getline' undefined inside BEGIN or END action"
+#~ msgstr "END åà BEGIN úìåòô êåúá øãâåî åðéà äééðôä àìì `getline'"
-#: awkgram.y:519
-msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
-msgstr "`print \"\"' úåéäì íúñä ïî êéøö END åà BEGIN éììëá èåùô `print'"
+#~ msgid "fptr %x not in tokentab\n"
+#~ msgstr "tokentab-á àöîð àì fptr %x\n"
-#: awkgram.y:532 awkgram.y:539
-msgid "`delete array' is a gawk extension"
-msgstr "gawk-ì úéôéöôñ äáçøä åðéä `delete array'"
+#~ msgid "Unbalanced ["
+#~ msgstr "âåæ-ïá åì ïéàù ["
-#: awkgram.y:604
-msgid "multistage two-way pipelines don't work"
-msgstr "íéãáåò íðéà íéáìù éáåøî íééðååéë-åã íé÷éôà"
+#~ msgid "Unfinished \\ escape"
+#~ msgstr "äøåîâ-éúìá \\ äø÷á úøãñ"
-#: awkgram.y:695
-msgid "regular expression on right of assignment"
-msgstr "êøò úîùä úàøåä ìù ïéîé ãöá éøìåâø éåèéá"
+#~ msgid "unfinished repeat count"
+#~ msgstr "äøåîâ-éúìá úåðùéä äðåî úøãâä"
-#: awkgram.y:713
-msgid "non-redirected `getline' undefined inside END action"
-msgstr "END úìåòô êåúá øãâåî åðéà äééðôä àìì `getline'"
+#~ msgid "malformed repeat count"
+#~ msgstr "úåðùéä äðåî úøãâäá éåâù øéáçú"
-#: awkgram.y:723
-msgid "regular expression on left of `~' or `!~' operator"
-msgstr "`!~' åà `~' øåèøôåàì ìàîùî éøìåâø éåèéá"
-
-#: awkgram.y:733
-#, c-format
-msgid "regexp constant `/%s/' looks like a C comment, but is not"
-msgstr "äøòä åðéà êà ,C úôùá äøòä åîë äàøð `/%s/' éøìåâø éåèéá"
-
-#: awkgram.y:749
-msgid "regular expression on right of comparison"
-msgstr "äàååùä ìù ïéîé ãöá éøìåâø éåèéá"
-
-#: awkgram.y:776
-msgid "non-redirected `getline' undefined inside BEGIN or END action"
-msgstr "END åà BEGIN úìåòô êåúá øãâåî åðéà äééðôä àìì `getline'"
-
-#: awkgram.y:831
-msgid "call of `length' without parentheses is not portable"
-msgstr "úéìéáèøåô äðéà íééøâåñ àìì `length'-ì äàéø÷"
-
-#: awkgram.y:834
-msgid "call of `length' without parentheses is deprecated by POSIX"
-msgstr "POSIX ï÷úì ãåâéðá äðéä íééøâåñ àìì `length'-ì äàéø÷"
-
-#: awkgram.y:884
-msgid "invalid subscript expression"
-msgstr "êøòî ïééöîá éåâù øéáçú ìòá éåèéá"
-
-#: awkgram.y:1033
-#, c-format
-msgid "fptr %x not in tokentab\n"
-msgstr "tokentab-á àöîð àì fptr %x\n"
-
-#: awkgram.y:1068
-msgid "unexpected newline"
-msgstr "éåôö-éúìá íå÷îá äøåù óåñ"
+#~ msgid "Unbalanced ("
+#~ msgstr "âåæ-ïá åì ïéàù ("
-#: awkgram.y:1152
-msgid "empty program text on command line"
-msgstr "äãå÷ôä úøåùî äìá÷úä ä÷éø úéðëú"
+#~ msgid "No regexp syntax bits specified"
+#~ msgstr "íééøìåâø íééåèéá ìù øéáçú úøãâä ïéà"
-#: awkgram.y:1209
-#, c-format
-msgid "can't open source file `%s' for reading (%s)"
-msgstr "åúàéø÷ íùì `%s' øå÷î õáå÷ úçéúôá (%s) äì÷ú"
+#~ msgid "Unbalanced )"
+#~ msgstr "âåæ-ïá åì ïéàù )"
-#: awkgram.y:1244
-#, c-format
-msgid "can't read sourcefile `%s' (%s)"
-msgstr "`%s' øå÷î õáå÷î äàéø÷á (%s) äì÷ú"
+#~ msgid "out of memory"
+#~ msgstr "ïåøëæä øîâð"
-#: awkgram.y:1252
-#, c-format
-msgid "source file `%s' is empty"
-msgstr "÷éø åðéä `%s' øå÷î õáå÷"
-
-#: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011
-msgid "source file does not end in newline"
-msgstr "äøåù-óåñ åúá íééúñî åðéà øå÷îä õáå÷"
-
-#: awkgram.y:1518
-msgid "unterminated regexp ends with `\\' at end of file"
-msgstr "õáå÷ä óñá `\\'-á íééúñî øåîâ-éúìá éøìåâø éåèéá"
-
-#: awkgram.y:1539
-msgid "unterminated regexp"
-msgstr "øåîâ-éúìá éøìåâø éåèéá"
-
-#: awkgram.y:1542
-msgid "unterminated regexp at end of file"
-msgstr "õáå÷ä óåñá øåîâ-éúìá éøìåâø éåèéá"
-
-#: awkgram.y:1609
-msgid "use of `\\ #...' line continuation is not portable"
-msgstr "éìéáèøåô åðéà äøåù êùîäì ïîéñë `\\ #...'-á ùåîéù"
-
-#: awkgram.y:1621
-msgid "backslash not last character on line"
-msgstr "äøåùá ïåøçà åú åðéàù êåôä ïñëåì"
-
-#: awkgram.y:1662
-msgid "POSIX does not allow operator `**='"
-msgstr "`**=' øåèøôåà äùøî åðéà POSIX"
-
-#: awkgram.y:1664
-msgid "old awk does not support operator `**='"
-msgstr "`**=' øåèøôåàá êîåú åðéà ïùé awk"
-
-#: awkgram.y:1673
-msgid "POSIX does not allow operator `**'"
-msgstr "`**' øåèøôåà äùøî åðéà POSIX"
-
-#: awkgram.y:1675
-msgid "old awk does not support operator `**'"
-msgstr "`**' øåèøôåàá êîåú åðéà ïùé awk"
-
-#: awkgram.y:1708
-msgid "operator `^=' is not supported in old awk"
-msgstr "ïùé awk-á êîúð åðéà `^=' øåèøôåà"
-
-#: awkgram.y:1716
-msgid "operator `^' is not supported in old awk"
-msgstr "ïùé awk-á êîúð åðéà `^' øåèøôåà"
-
-#: awkgram.y:1798 awkgram.y:1815
-msgid "unterminated string"
-msgstr "äøåîâ-éúìá úæåøçî"
-
-#: awkgram.y:1972
-#, c-format
-msgid "invalid char '%c' in expression"
-msgstr "éåèéáá '%c' éåâù åú"
-
-#: awkgram.y:2032
-#, c-format
-msgid "`%s' is a gawk extension"
-msgstr "gawk-ì úéôéöôñ äáçøä äðéä `%s'"
-
-#: awkgram.y:2035
-#, c-format
-msgid "`%s' is a Bell Labs extension"
-msgstr "Bell úåãáòî úñøâá awk-ì úéôéöôñ äáçøä åðéä `%s'"
-
-#: awkgram.y:2038
-#, c-format
-msgid "POSIX does not allow `%s'"
-msgstr "`%s' äùøî åðéà POSIX"
-
-#: awkgram.y:2042
-#, c-format
-msgid "`%s' is not supported in old awk"
-msgstr "ïùé awk-á êîúð åðéà `%s'"
-
-#: awkgram.y:2070
-msgid "`goto' considered harmful!\n"
-msgstr "!òø-òâô áùçð `goto'\n"
-
-#: awkgram.y:2134
-#, c-format
-msgid "%d is invalid as number of arguments for %s"
-msgstr "íéèðîåâøà øôñîë %d ìá÷ì ìåëé åðéà %s"
-
-#: awkgram.y:2153 awkgram.y:2156
-msgid "match: third argument is a gawk extension"
-msgstr "gawk-ì úéôéöôñ äáçøä åðéä `match' ìù éùéìù èðîåâøà"
-
-#: awkgram.y:2172
-#, c-format
-msgid "%s: string literal as last arg of substitute has no effect"
-msgstr "úéìëú íåù äì ïéà `%s' ìù ïåøçà èðîåâøàë äòåá÷ úæåøçî"
-
-#: awkgram.y:2176
-msgid "sub third parameter is not a changeable object"
-msgstr "éåðéù-øá è÷ééáåà åðéà `sub' ìù éùéìù èðîåâøà"
-
-#: awkgram.y:2178
-msgid "gsub third parameter is not a changeable object"
-msgstr "éåðéù-øá è÷ééáåà åðéà `gsub' ìù éùéìù èðîåâøà"
-
-#: awkgram.y:2204 awkgram.y:2207
-msgid "close: second argument is a gawk extension"
-msgstr "gawk-ì úéôéöôñ äáçøä åðéä `close' ìù éðù èðîåâøà"
-
-#: awkgram.y:2217
-msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
-msgstr "èðîåâøà úîã÷áù ïåúçú-ó÷î ÷ìñì ùé :dcgettext(_\"...\")-á éåâù ùåîéù"
-
-#: awkgram.y:2232
-msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
-msgstr "èðîåâøà úîã÷áù ïåúçú-ó÷î ÷ìñì ùé :dncgettext(_\"...\")-á éåâù ùåîéù"
-
-#: awkgram.y:2323
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "`%s' äéö÷ðåôá %d 'ñî øèîøôì ääæ ,`%s' ,%d 'ñî øèîøô ìù åîù"
-
-#: awkgram.y:2355
-#, c-format
-msgid "function `%s': parameter `%s' shadows global variable"
-msgstr "éìáåìâ äðúùî ìò ìéôàî `%s' äéö÷ðåôá `%s' øèîøô"
-
-#: awkgram.y:2464
-#, c-format
-msgid "could not open `%s' for writing (%s)"
-msgstr "äáéúë íùì `%s' úçéúôá (%s) äì÷ú"
-
-#: awkgram.y:2495
-#, c-format
-msgid "%s: close failed (%s)"
-msgstr "`%s' úøéâñ úòá (%s) äì÷ú"
-
-#: awkgram.y:2605
-msgid "shadow_funcs() called twice!"
-msgstr "!íééîòô äàø÷ð shadow_funcs()"
-
-#: awkgram.y:2680
-#, c-format
-msgid "function `%s': can't use function name as parameter name"
-msgstr "øèîøô íùë ùîùì ìåëé åðéà äéö÷ðåô íù :`%s' äéö÷ðåôá"
-
-#: awkgram.y:2690
-#, c-format
-msgid "function name `%s' previously defined"
-msgstr "úøãâåî øáë `%s' íùá äéö÷ðåô"
-
-#: awkgram.y:2838 awkgram.y:2844
-#, c-format
-msgid "function `%s' called but never defined"
-msgstr "úøãâåî äðéàù `%s' äéö÷ðåôì äàéø÷"
-
-#: awkgram.y:2847
-#, c-format
-msgid "function `%s' defined but never called"
-msgstr "úàø÷ð àì êà ,äøãâåä `%s' äéö÷ðåô"
-
-#: awkgram.y:2874
-#, c-format
-msgid "regexp constant for parameter #%d yields boolean value"
-msgstr "éðàéìåá êøò áéðî %d 'ñî øèîøôë òåá÷ éøìåâø éåèéá"
-
-#: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649
-#: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078
-#: dfa.c:1081 dfa.c:1094 dfa.c:1095
-msgid "Unbalanced ["
-msgstr "âåæ-ïá åì ïéàù ["
-
-#: dfa.c:783
-msgid "Unfinished \\ escape"
-msgstr "äøåîâ-éúìá \\ äø÷á úøãñ"
-
-#: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955
-msgid "unfinished repeat count"
-msgstr "äøåîâ-éúìá úåðùéä äðåî úøãâä"
-
-#: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958
-msgid "malformed repeat count"
-msgstr "úåðùéä äðåî úøãâäá éåâù øéáçú"
-
-#: dfa.c:1285
-msgid "Unbalanced ("
-msgstr "âåæ-ïá åì ïéàù ("
-
-#: dfa.c:1407
-msgid "No regexp syntax bits specified"
-msgstr "íééøìåâø íééåèéá ìù øéáçú úøãâä ïéà"
-
-#: dfa.c:1415
-msgid "Unbalanced )"
-msgstr "âåæ-ïá åì ïéàù )"
-
-#: dfa.c:3014
-msgid "out of memory"
-msgstr "ïåøëæä øîâð"
-
-#: field.c:849
-msgid "split: second argument is not an array"
-msgstr "êøòî åðéà `split' ìù éðùä èðîåâøàä"
-
-#: field.c:876
-msgid "split: null string for third arg is a gawk extension"
-msgstr "gawk-ì úéôéöôñ äáçøä äðéä `split'-ì éùéìù èðåîâøàë úñôåàî úæåøçî"
-
-#: field.c:916
-msgid "`FIELDWIDTHS' is a gawk extension"
-msgstr "gawk-ì úéôéöôñ äáçøä åðéä `FIELDWIDTHS'"
-
-#: field.c:943
-#, c-format
-msgid "field %d in FIELDWIDTHS, must be > 0"
-msgstr "0-î ìåãâ úåéäì áééç FIELDWIDTHS-á %d 'ñî äãù"
-
-#: field.c:997
-msgid "null string for `FS' is a gawk extension"
-msgstr "gawk-ì úéôéöôñ äáçøä äðéä `FS'-ë úñôåàî úæåøçî"
-
-# 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:57
-msgid "cmd. line:"
-msgstr "cmd. line:"
-
-#: msg.c:123
-msgid "warning: "
-msgstr "warning: "
-
-#: msg.c:145
-msgid "error: "
-msgstr "error: "
-
-#: msg.c:178
-msgid "fatal: "
-msgstr "fatal: "
-
-#: eval.c:259
-#, c-format
-msgid "unknown nodetype %d"
-msgstr "%d ääåæî-éúìá âåñ ìòá node"
-
-#: eval.c:307
-msgid "buffer overflow in genflags2str"
-msgstr "genflags2str-á õöåç úùéìâ"
-
-#: eval.c:541
-#, c-format
-msgid "for loop: array `%s' changed size from %d to %d during loop execution"
-msgstr "(`%s' êøòî) äàìåìä òåöéá êìäîá %d-î %d-ì äðåù êøòî ìù åìãåâ :for úàìåì"
-
-#: eval.c:565
-msgid "`break' outside a loop is not portable"
-msgstr "éìéáèøåô åðéà äàìåìì õåçî `break'"
-
-#: eval.c:569
-msgid "`break' outside a loop is not allowed"
-msgstr "äàìåìì õåçî `break'-á ùîúùäì ïéà"
-
-#: eval.c:588
-msgid "`continue' outside a loop is not portable"
-msgstr "éìéáèøåô åðéà äàìåìì õåçî `continue'"
-
-#: eval.c:592
-msgid "`continue' outside a loop is not allowed"
-msgstr "äàìåìì õåçî `continue'-á ùîúùäì ïéà"
-
-#: eval.c:622
-msgid "`next' cannot be called from a BEGIN rule"
-msgstr "BEGIN éììë êåúî `next'-ì àåø÷ì ïéà"
-
-#: eval.c:624
-msgid "`next' cannot be called from an END rule"
-msgstr "END éììë êåúî `next'-ì àåø÷ì ïéà"
-
-#: eval.c:636
-msgid "`nextfile' cannot be called from a BEGIN rule"
-msgstr "BEGIN éììë êåúî `nextfile'-ì àåø÷ì ïéà"
-
-#: eval.c:638
-msgid "`nextfile' cannot be called from an END rule"
-msgstr "END éììë êåúî `nextfile'-ì àåø÷ì ïéà"
-
-#: eval.c:679
-msgid "statement has no effect"
-msgstr "úéìëú-úìåèð äàøåä"
-
-#: eval.c:713 eval.c:743 eval.c:1622
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "`%s' ìçåúî-éúìá äðúùîì äéðôä"
-
-#: eval.c:721 eval.c:1608
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "êøòî åà äðúùîë `%s' äéö÷ðåô íùá ùîúùäì ïéà"
-
-#: eval.c:728 eval.c:734 eval.c:1747
-#, c-format
-msgid "reference to uninitialized argument `%s'"
-msgstr "`%s' ìçåúî-éúìá èðîåâøàì äéðôä"
-
-#: eval.c:823
-msgid "assignment used in conditional context"
-msgstr "éàðú ìù èñ÷èðå÷á äîùäá ùåîéù"
-
-#: eval.c:914
-msgid ""
-"concatenation: side effects in one expression have changed the length of "
-"another!"
-msgstr ""
-"!øçà éåèéá ìù åëøåà éåðéùì åîøâ ãçà éåèéá áåùéç ìù éàåì-úåòôåú :concatenation"
-
-#: eval.c:1013
-msgid "division by zero attempted"
-msgstr "ñôàá ä÷åìç ïåéñð"
-
-#: eval.c:1028
-#, c-format
-msgid "division by zero attempted in `%%'"
-msgstr "`%%'-á ñôàá ä÷åìç ïåéñð"
-
-#: eval.c:1236
-msgid "division by zero attempted in `/='"
-msgstr "`/='-á ñôàá ä÷åìç ïåéñð"
-
-#: eval.c:1254
-#, c-format
-msgid "division by zero attempted in `%%='"
-msgstr "`%%='-á ñôàá ä÷åìç ïåéñð"
-
-# This is not translated because it cannot be reworded in Hebrew
-# without looking awkward.
-#: eval.c:1424
-#, c-format
-msgid "%s (from %s)"
-msgstr "%s (from %s)"
-
-#: eval.c:1472
-#, c-format
-msgid "function `%s' called with more arguments than declared"
-msgstr "äúæøëäá øùàî íéèðîåâøà øúåé íò `%s' äéö÷ðåôì äàéø÷"
-
-#: eval.c:1519
-#, c-format
-msgid "function `%s' not defined"
-msgstr "úøãâåî äðéà `%s' äéö÷ðåô"
-
-#: eval.c:1521
-#, c-format
-msgid "function %s called\n"
-msgstr "`%s' äéö÷ðåôì äàéø÷\n"
-
-#: eval.c:1580
-msgid ""
-"\n"
-"\t# Function Call Stack:\n"
-"\n"
-msgstr ""
-"\n"
-"\t# :úåéö÷ðåôì úåàéø÷ä úéðñçî\n"
-"\n"
-
-#: eval.c:1583
-msgid "\t# -- main --\n"
-msgstr "\t# -- main --\n"
-
-#: eval.c:1759
-msgid "attempt to field reference from non-numeric value"
-msgstr "øôñî åðéàù êøò úåòöîàá äãùì äéðôä ïåéñð"
-
-#: eval.c:1761
-msgid "attempt to reference from null string"
-msgstr "ä÷éø úæåøçî úåòöîàá äãùì äéðôä ïåéñð"
-
-#: eval.c:1767
-#, c-format
-msgid "attempt to access field %d"
-msgstr "%d 'ñî äãùì äùéâ ïåéñð"
-
-#: eval.c:1783
-#, c-format
-msgid "attempt to use scalar parameter `%s' as an array"
-msgstr "êøòî äéä åìéàë `%s' éøì÷ñ øèîøôá ùåîéù ïåéñð"
-
-#: eval.c:1874
-msgid "`IGNORECASE' is a gawk extension"
-msgstr "gawk-ì úéôéöôñ äáçøä åðéä `IGNORECASE'"
-
-#: eval.c:1902
-msgid "`BINMODE' is a gawk extension"
-msgstr "gawk-ì úéôéöôñ äáçøä åðéä `BINMODE'"
-
-#: eval.c:2014
-#, c-format
-msgid "bad `%sFMT' specification `%s'"
-msgstr "äðé÷ú `%sFMT' úøãâä åðéà `%s'"
-
-#: eval.c:2080
-msgid "turning off `--lint' due to assignment to `LINT'"
-msgstr "`LINT'-ì êøò úîùä á÷ò `--lint' ìèáî"
-
-#: eval.c:2116
-msgid "NF set to negative value"
-msgstr "éìéìù êøò ìáé÷ NF"
-
-#: io.c:240
-#, c-format
-msgid "cannot open file `%s' for reading (%s)"
-msgstr "åúàéø÷ íùì `%s' õáå÷ úçéúôá (%s) äì÷ú"
-
-#: io.c:320
-#, c-format
-msgid "close of fd %d (`%s') failed (%s)"
-msgstr "(%d èìô/èì÷ õåøò) `%s' úøéâñá (%s) äì÷ú"
-
-#: io.c:432
-#, c-format
-msgid "invalid tree type %s in redirect()"
-msgstr "redirect() äéö÷ðåôá %s éåâù õò âåñ"
-
-#: io.c:438
-#, c-format
-msgid "expression in `%s' redirection only has numeric value"
-msgstr "ãáìá éøîåð êøò áéðî `%s' èìô/èì÷ úééðôäá éåèéá"
-
-#: io.c:444
-#, c-format
-msgid "expression for `%s' redirection has null string value"
-msgstr "ä÷éø úæåøçî áéðî `%s' èìô/èì÷ úééðôäá éåèéá"
-
-#: io.c:449
-#, c-format
-msgid "filename `%s' for `%s' redirection may be result of logical expression"
-msgstr "éâåì éåèéá ìù äàöåú úåéäì ìåìò `%s' õáå÷ íù `%s' èìô/èì÷ úééðôäá"
-
-#: io.c:471
-#, c-format
-msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
-msgstr "`%.*s' õáå÷ øåáò `>>'-á ïäå `>'-á ïä øúåéî ùåîéù"
-
-#: io.c:523
-#, c-format
-msgid "can't open pipe `%s' for output (%s)"
-msgstr "èìô êøåöì `%s' ÷éôà úçéúôá (%s) äì÷ú"
-
-#: io.c:532
-#, c-format
-msgid "can't open pipe `%s' for input (%s)"
-msgstr "èì÷ êøåöì `%s' ÷éôà úçéúôá (%s) äì÷ú"
-
-#: io.c:545
-#, c-format
-msgid "can't open two way socket `%s' for input/output (%s)"
-msgstr "èìô/èì÷ êøåöì éðååéë-åã (socket) ò÷ùë `%s' úçéúôá (%s) äì÷ú"
-
-#: io.c:549
-#, c-format
-msgid "can't open two way pipe `%s' for input/output (%s)"
-msgstr "èìô/èì÷ êøåöì éðååéë-åã (pipe) ÷éôàë `%s' úçéúôá (%s) äì÷ú"
-
-#: io.c:625
-#, c-format
-msgid "can't redirect from `%s' (%s)"
-msgstr "`%s'-î äééðôäá (%s) äì÷ú"
-
-#: io.c:628
-#, c-format
-msgid "can't redirect to `%s' (%s)"
-msgstr "`%s' ìà äééðôäá (%s) äì÷ú"
-
-#: io.c:667
-msgid ""
-"reached system limit for open files: starting to multiplex file descriptors"
-msgstr "èìô/èì÷ éöåøò áåáéø úìéçú ;íéçåúô íéöá÷ øôñî ìù úëøòî úìáâîì äòâä"
-
-#: io.c:679
-#, c-format
-msgid "close of `%s' failed (%s)."
-msgstr "`%s' úøéâñá (%s) äì÷ú"
-
-#: io.c:686
-msgid "too many pipes or input files open"
-msgstr "úéðîæ-åá íéçåúô èì÷ éöá÷ åà (pipes) íé÷éôà éãî øúåé"
-
-#: io.c:709
-msgid "close: second argument must be `to' or `from'"
-msgstr "`from' åà `to' úåéäì áééç `close' ìù éðùä èðîåâøàä"
-
-#: io.c:723
-#, c-format
-msgid "close: `%.*s' is not an open file, pipe or co-process"
-msgstr "ìéá÷î êéìäú åà çåúô ÷éôà ,çåúô õáå÷ åðéà `%.*s' :close"
-
-#: io.c:727
-msgid "close of redirection that was never opened"
-msgstr "íìåòî äçúôð àìù äééðôä úøéâñ"
-
-#: io.c:754
-#, c-format
-msgid "close: redirection `%s' not opened with `|&', second argument ignored"
-msgstr "çðæåä éðùä èðîåâøàä ,`|&' é\"ò äçúôð àì `%s' äééðôä"
-
-#: io.c:811
-#, c-format
-msgid "failure status (%d) on pipe close of `%s' (%s)"
-msgstr "(%d äì÷ú ãå÷) `%s'-ì ÷éôà úøéâñá (%s) äì÷ú"
-
-#: io.c:814
-#, c-format
-msgid "failure status (%d) on file close of `%s' (%s)"
-msgstr "(%d äì÷ú ãå÷) `%s' õáå÷ úøéâñá (%s) äì÷ú"
-
-#: io.c:833
-#, c-format
-msgid "no explicit close of socket `%s' provided"
-msgstr "ùøåôîá øâñð àì (socket) `%s' ò÷ù"
-
-#: io.c:836
-#, c-format
-msgid "no explicit close of co-process `%s' provided"
-msgstr "ùøåôîá øâñð àì (co-process) `%s' ìéá÷î êéìäú"
-
-#: io.c:839
-#, c-format
-msgid "no explicit close of pipe `%s' provided"
-msgstr "ùøåôîá øâñð àì (pipe) `%s' ÷éôà"
-
-#: io.c:842
-#, c-format
-msgid "no explicit close of file `%s' provided"
-msgstr "ùøåôîá øâñð àì `%s' õáå÷"
-
-#: io.c:871 io.c:925
-#, c-format
-msgid "error writing standard output (%s)"
-msgstr "éð÷ú èìô õåøòì äáéúëá (%s) äì÷ú"
-
-#: io.c:875 io.c:929
-#, c-format
-msgid "error writing standard error (%s)"
-msgstr "éð÷ú úåàéâù õåøòì äáéúëá (%s) äì÷ú"
-
-#: io.c:883
-#, c-format
-msgid "pipe flush of `%s' failed (%s)."
-msgstr "`%s'-ì ÷éôà ìù õöåç ïå÷éøá (%s) äì÷ú"
-
-#: io.c:886
-#, c-format
-msgid "co-process flush of pipe to `%s' failed (%s)."
-msgstr "`%s'-ì ìéá÷î êéìäú ÷éôà ìù õöåç ïå÷éøá (%s) äì÷ú"
-
-#: io.c:889
-#, c-format
-msgid "file flush of `%s' failed (%s)."
-msgstr "`%s' ìù õáå÷ éðåúð õöåç ïå÷éøá (%s) äì÷ú"
-
-#: io.c:1048
-msgid "/inet/raw client not ready yet, sorry"
-msgstr "ïëåî íøè /inet/raw çå÷ì ,íéøòèöî"
-
-#: io.c:1050 io.c:1087
-msgid "only root may use `/inet/raw'."
-msgstr "ãáìá root ùîúùîì øúåî `inet/raw'-á ùåîéù"
-
-#: io.c:1085
-msgid "/inet/raw server not ready yet, sorry"
-msgstr "ïëåî íøè /inet/raw úøù ,íéøòèöî"
-
-#: io.c:1175
-#, c-format
-msgid "no (known) protocol supplied in special filename `%s'"
-msgstr "`%s' ãçåéî õáå÷ íùá ääåæî-éúìá åà øñç ìå÷åèåøô"
-
-#: io.c:1193
-#, c-format
-msgid "special file name `%s' is incomplete"
-msgstr "íìù åðéà `%s' ãçåéî õáå÷"
-
-#: io.c:1205
-#, c-format
-msgid "local port invalid in `%s'"
-msgstr "`%s'-á äéåâù úéîå÷î äàéöé"
-
-#: io.c:1217
-msgid "must supply a remote hostname to `/inet'"
-msgstr "`/inet' øåáò ÷çåøî çøàî-áùçî íù øéãâäì äáåç"
-
-#: io.c:1232
-msgid "must supply a remote port to `/inet'"
-msgstr "`/inet' øåáò ú÷çåøî äàéöé øéãâäì äáåç"
-
-#: io.c:1238
-#, c-format
-msgid "remote port invalid in `%s'"
-msgstr "`%s'-á äéåâù ú÷çåøî äàéöé"
-
-#: io.c:1248
-msgid "TCP/IP communications are not supported"
-msgstr "TCP/IP úøåù÷úá äëéîú ïéà"
-
-#: io.c:1257 io.c:1438
-#, c-format
-msgid "file `%s' is a directory"
-msgstr "äé÷éú åðéä `%s' õáå÷"
-
-#: io.c:1327
-#, c-format
-msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
-msgstr "`PROCINFO[\"%s\"]'-á ùîúùäì óéãò `%s' íå÷îá"
-
-#: io.c:1359
-msgid "use `PROCINFO[...]' instead of `/dev/user'"
-msgstr "`/dev/user' éðô-ìò óéãò `PROCINFO[...]'-á ùåîéù"
-
-# This probably sounds nonsensical in Hebrew, but what can I do,
-# given the original message text?
-#: io.c:1424
-#, c-format
-msgid "could not open `%s', mode `%s'"
-msgstr "`%s' øåáò `%s' äìåòô ïôåà úçéúôá ïåìùë"
-
-#: io.c:1550 io.c:1602 io.c:1732 io.c:1754
-#, c-format
-msgid "moving pipe to stdout in child failed (dup: %s)"
-msgstr "úá-úéðëúá stdout-ì ÷éôà ìåôëùá (dup: %s) äì÷ú"
-
-#: io.c:1554 io.c:1607
-#, c-format
-msgid "moving pipe to stdin in child failed (dup: %s)"
-msgstr "úá-úéðëúá stdin-ì ÷éôà ìåôëùá (dup: %s) äì÷ú"
-
-#: io.c:1571 io.c:1745
-msgid "restoring stdout in parent process failed\n"
-msgstr "áà-úéðëúá stdout ÷éôà øåæçùá äì÷ú\n"
-
-#: io.c:1576
-msgid "restoring stdin in parent process failed\n"
-msgstr "áà-úéðëúá stdin ÷éôà øåæçùá äì÷ú\n"
-
-#: io.c:1599 io.c:1751
-#, c-format
-msgid "close of stdout in child failed (%s)"
-msgstr "úá-úéðëúá stdout úøéâñá (%s) äì÷ú"
-
-#: io.c:1604
-#, c-format
-msgid "close of stdin in child failed (%s)"
-msgstr "úá-úéðëúá stdin úøéâñá (%s) äì÷ú"
-
-#: io.c:1610 io.c:1756 io.c:1767
-#, c-format
-msgid "close of pipe failed (%s)"
-msgstr "÷éôà úøéâñá (%s) äì÷ú"
-
-#: io.c:1655
-msgid "`|&' not supported"
-msgstr "`|&'-á äëéîú ïéà"
-
-#: io.c:1722
-#, c-format
-msgid "cannot open pipe `%s' (%s)"
-msgstr "`%s' ÷éôà úçéúôá (%s) äì÷ú"
-
-#: io.c:1763
-#, c-format
-msgid "cannot create child process for `%s' (fork: %s)"
-msgstr "`%s' úá-úéðëúì êéìäú úøéöéá (fork: %s) äì÷ú"
-
-#: io.c:2104
-#, c-format
-msgid "data file `%s' is empty"
-msgstr "÷éø åðéä `%s' íéðåúð õáå÷"
-
-#: io.c:2175
-#, c-format
-msgid "internal error: file `%s', line %d\n"
-msgstr "`%s' õáå÷ ìù %d äøåùá úéîéðô äðëú äàéâù\n"
-
-#: io.c:2277
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "`%s' õáå÷ úàéø÷á (%s) äì÷ú"
-
-#: io.c:2521
-msgid "multicharacter value of `RS' is a gawk extension"
-msgstr "gawk-ì úéôéöôñ äáçøä äðéä `RS' ìù êøòá íéåú øôñîá äëéîú"
-
-#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
-msgid "can't convert string to float"
-msgstr "øôñîì äøîäì úðúéð äðéà úæåøçî"
-
-#: node.c:342
-msgid "backslash at end of string"
-msgstr "úæåøçî óåñá êåôä ïñëåì"
-
-#: node.c:524
-msgid "POSIX does not allow `\\x' escapes"
-msgstr "`\\x' âåñî äø÷á úåøãñ äùøî åðéà POSIX ï÷ú"
-
-#: node.c:530
-msgid "no hex digits in `\\x' escape sequence"
-msgstr "`\\x' äø÷á úøãñá úåéìîéöãñ÷ä úåøôñá ùîúùäì ïéà"
-
-#: node.c:564
-#, c-format
-msgid "escape sequence `\\%c' treated as plain `%c'"
-msgstr "éìåìéî åúë ìôåè `\\%c' äø÷á úøãñá `%c' åú"
-
-#: re.c:208
-#, c-format
-msgid "regex match failed, not enough memory to match string \"%.*s%s\""
-msgstr "\"%.*s%s\" úæåøçî úîàúäì ïåøëæ éã ïéà ,ìùëð éøìåâø éåèéáì äîàúä ùåôéç"
-
-#: posix/gawkmisc.c:122
-#, c-format
-msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
-msgstr "%s %s `%s' øåáò close-on-exec ïééôàî úìòôäá (fcntl: %s) äì÷ú"
+#~ msgid "invalid syntax in name `%s' for variable assignment"
+#~ msgstr "êøò úîùäá `%s' äðúùî íù ìù éåâù øéáçú"
diff --git a/po/insert-header.sin b/po/insert-header.sin
deleted file mode 100644
index b26de01f..00000000
--- a/po/insert-header.sin
+++ /dev/null
@@ -1,23 +0,0 @@
-# Sed script that inserts the file called HEADER before the header entry.
-#
-# At each occurrence of a line starting with "msgid ", we execute the following
-# commands. At the first occurrence, insert the file. At the following
-# occurrences, do nothing. The distinction between the first and the following
-# occurrences is achieved by looking at the hold space.
-/^msgid /{
-x
-# Test if the hold space is empty.
-s/m/m/
-ta
-# Yes it was empty. First occurrence. Read the file.
-r HEADER
-# Output the file's contents by reading the next line. But don't lose the
-# current line while doing this.
-g
-N
-bb
-:a
-# The hold space was nonempty. Following occurrences. Do nothing.
-x
-:b
-}
diff --git a/po/it.gmo b/po/it.gmo
index a2f12bcb..973ce9d2 100644
--- a/po/it.gmo
+++ b/po/it.gmo
Binary files differ
diff --git a/po/it.po b/po/it.po
index 5ca93516..68f4ff26 100644
--- a/po/it.po
+++ b/po/it.po
@@ -1,412 +1,891 @@
# Italian messages for GNU Awk
-# Copyright (C) 2002 Free Software Foundation, Inc.
-# Antonio Colombo <azc10@amdahl.com>, 2002.
+# Copyright (C) 2002-2003 Free Software Foundation, Inc.
+# Antonio Colombo <azc10@amdahl.com>, 2003.
#
msgid ""
msgstr ""
"Project-Id-Version: gawk 3.1.35\n"
-"POT-Creation-Date: 2002-05-01 16:40+0300\n"
-"PO-Revision-Date: 2002-04-21 22:22+0100\n"
+"POT-Creation-Date: 2003-03-19 14:25+0200\n"
+"PO-Revision-Date: 2003-02-18 11:11+0100\n"
"Last-Translator: Antonio Colombo <azc10@amdahl.com>\n"
"Language-Team: Italian <it@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-8\n"
"Content-Transfer-Encoding: 8-bit\n"
-#: array.c:243 array.c:275 array.c:280 eval.c:483
+#: array.c:274 array.c:309 array.c:314 eval.c:494
#, c-format
msgid "attempt to use scalar `%s' as array"
msgstr "tentativo di usare scalare '%s' come vettore"
-#: array.c:304
+#: array.c:338
#, c-format
msgid "reference to uninitialized element `%s[\"%s\"]'"
msgstr "referenza a elemento non inizializzato `%s[\"%s\"]'"
-#: array.c:310
+#: array.c:344
#, c-format
msgid "subscript of array `%s' is null string"
msgstr "l'indice del vettore '%s' è una stringa nulla"
-#: array.c:373 array.c:456
-#, c-format
-msgid "delete: illegal use of variable `%s' as array"
-msgstr "delete: use non permesso della variabile `%s' come vettore"
-
-#: array.c:406
+#: array.c:412 array.c:425 array.c:466
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete: indice `%s' non presente nel vettore `%s'"
-#: array.c:571
+#: array.c:432 array.c:515
+#, c-format
+msgid "delete: illegal use of variable `%s' as array"
+msgstr "delete: use non permesso della variabile `%s' come vettore"
+
+#: array.c:633
#, c-format
msgid "%s: empty (null)\n"
msgstr "%s: vuoto (nullo)\n"
-#: array.c:576
+#: array.c:638
#, c-format
msgid "%s: empty (zero)\n"
msgstr "%s: vuoto (zero)\n"
-#: array.c:580
+#: array.c:642
#, c-format
msgid "%s: table_size = %d, array_size = %d\n"
msgstr "%s: dimensione_tabella = %d, dimensione_vettore = %d\n"
-#: array.c:612
+#: array.c:671
#, c-format
msgid "%s: is parameter\n"
msgstr "%s: è parametro\n"
-#: array.c:617
+#: array.c:676
#, c-format
msgid "%s: array_ref to %s\n"
msgstr "%s: referenza_vettoriale a %s\n"
-#: array.c:844
+#: array.c:975
msgid "asort: first argument is not an array"
msgstr "asort: il primo argomento non è un vettore"
-#: array.c:853
+#: array.c:984
msgid "asort: second argument is not an array"
msgstr "asort: il secondo argomento non è un vettore"
-#: builtin.c:107
+#: 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
+msgid "statement may have no effect"
+msgstr "istruzione che può non aver alcun effetto"
+
+#: awkgram.y:431 awkgram.y:451
+#, c-format
+msgid "`%s' used in %s action"
+msgstr "`%s' usato in 'azione' %s"
+
+#: awkgram.y:444 awkgram.y:447
+msgid "`nextfile' is a gawk extension"
+msgstr "`nextfile' è un'estensione gawk"
+
+#: awkgram.y:461
+msgid "`return' used outside function context"
+msgstr "`return' usato fuori da una funzione"
+
+#: awkgram.y:500
+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:513 awkgram.y:520
+msgid "`delete array' is a gawk extension"
+msgstr "`delete array' è un'estensione gawk"
+
+#: awkgram.y:528 awkgram.y:535
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "`delete(array)' è un'estensione tawk non-portabile"
+
+#: awkgram.y:578
+msgid "multistage two-way pipelines don't work"
+msgstr "'pipelines' multistadio bidirezionali non funzionano"
+
+#: awkgram.y:669
+msgid "regular expression on right of assignment"
+msgstr "espressione regolare usata per assegnare un valore"
+
+#: awkgram.y:679
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "espressione regolare prima di operatore `~' o `!~'"
+
+#: awkgram.y:687
+msgid "regular expression on right of comparison"
+msgstr "espressione regolare a destra in un confronto"
+
+#: awkgram.y:754
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "`getline' non re-diretta indefinita dentro 'azione' END"
+
+#: awkgram.y:781
+msgid "call of `length' without parentheses is not portable"
+msgstr "chiamata a `length' senza parentesi non portabile"
+
+#: awkgram.y:784
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "chiamata a `length' senza parentesi sconsigliata da POSIX"
+
+#: awkgram.y:835
+msgid "invalid subscript expression"
+msgstr "espressione indice invalida"
+
+#: awkgram.y:1020
+msgid "unexpected newline or end of string"
+msgstr "carattere 'a capo' o fine stringa inaspettati"
+
+#: awkgram.y:1115
+msgid "empty program text on command line"
+msgstr "programma nullo sulla linea comandi"
+
+#: awkgram.y:1172
+#, 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:1207
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "non riesco a leggere file sorgente `%s' (%s)"
+
+#: awkgram.y:1215
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "file sorgente `%s' vuoto"
+
+#: awkgram.y:1417 awkgram.y:1527 awkgram.y:1545 awkgram.y:1895 awkgram.y:1980
+msgid "source file does not end in newline"
+msgstr "file sorgente non termina con carattere 'a capo'"
+
+#: awkgram.y:1481
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr "espressione regolare non completata termina con `\\' a fine file"
+
+#: awkgram.y:1501
+msgid "unterminated regexp"
+msgstr "espressione regolare non completata"
+
+#: awkgram.y:1504
+msgid "unterminated regexp at end of file"
+msgstr "espressione regolare non completata a fine file"
+
+#: awkgram.y:1571
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr "uso di `\\ #...' continuazione linea non portabile"
+
+#: awkgram.y:1583
+msgid "backslash not last character on line"
+msgstr "'\\' non è l'ultimo carattere della linea"
+
+#: awkgram.y:1628
+msgid "POSIX does not allow operator `**='"
+msgstr "POSIX non permette l'operatore `**='"
+
+#: awkgram.y:1630
+msgid "old awk does not support operator `**='"
+msgstr "il vecchio awk non supporta l'operatore `**='"
+
+#: awkgram.y:1639
+msgid "POSIX does not allow operator `**'"
+msgstr "POSIX non permette l'operatore `**'"
+
+#: awkgram.y:1641
+msgid "old awk does not support operator `**'"
+msgstr "il vecchio awk non supporta l'operatore `**'"
+
+#: awkgram.y:1672
+msgid "operator `^=' is not supported in old awk"
+msgstr "l'operatore `^=' non è supportato nel vecchio awk"
+
+#: awkgram.y:1680
+msgid "operator `^' is not supported in old awk"
+msgstr "l'operatore `^' non è supportato nel vecchio awk"
+
+#: awkgram.y:1764 awkgram.y:1781
+msgid "unterminated string"
+msgstr "stringa non terminata"
+
+#: awkgram.y:1941
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "carattere '%c' invalido in un'espressione"
+
+#: awkgram.y:2001
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "`%s' è un'estensione gawk"
+
+#: awkgram.y:2004
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "`%s' è un'estensione Bell Labs"
+
+#: awkgram.y:2007
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "POSIX non permette `%s'"
+
+#: awkgram.y:2011
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "`%s' non è supportato nel vecchio awk"
+
+#: awkgram.y:2038
+msgid "`goto' considered harmful!\n"
+msgstr "`goto' considerato pericoloso!\n"
+
+#: awkgram.y:2102
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
+msgstr "%d invalido come numero di argomenti per %s"
+
+#: awkgram.y:2121 awkgram.y:2124
+msgid "match: third argument is a gawk extension"
+msgstr "match: il terzo argomento è un'estensione gawk"
+
+#: awkgram.y:2137
+#, 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:2140
+#, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "il terzo parametro di '%s' non è un oggetto modificabile"
+
+#: awkgram.y:2167 awkgram.y:2170
+msgid "close: second argument is a gawk extension"
+msgstr "close: il secondo argomento è un'estensione gawk"
+
+#: awkgram.y:2180
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"uso scorretto di dcgettext(_\"...\"): togliere il carattere '_' iniziale"
+
+#: awkgram.y:2195
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"uso scorretto di dcngettext(_\"...\"): togliere il carattere '_' iniziale"
+
+#: awkgram.y:2266
+#, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "funzione `%s': parametro #%d, `%s', duplica parametro #%d"
+
+#: awkgram.y:2299
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "funzione `%s': parametro `%s' nasconde variabile globale"
+
+#: awkgram.y:2411
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "non riesco ad aprire `%s' in scrittura (%s)"
+
+#: awkgram.y:2412 profile.c:93
+msgid "sending profile to standard error"
+msgstr "mando profilo a 'standard error'"
+
+#: awkgram.y:2442
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: 'close' fallita (%s)"
+
+#: awkgram.y:2566
+msgid "shadow_funcs() called twice!"
+msgstr "shadow_funcs() chiamata due volte!"
+
+#: awkgram.y:2593
+msgid "there were shadowed variables."
+msgstr "c'erano variabili nascoste."
+
+#: awkgram.y:2666
+#, 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:2676
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "funzione di nome `%s' definita in precedenza"
+
+#: awkgram.y:2827 awkgram.y:2833
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "funzione `%s' chiamata ma mai definita"
+
+#: awkgram.y:2836
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "funzione `%s' definita ma mai chiamata"
+
+#: awkgram.y:2863
+#, 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:2876
+#, 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:2878
+msgid "or used as a variable or an array"
+msgstr "o usato come variabile o come vettore"
+
+#: builtin.c:111
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "%s a \"%s\" fallita (%s)"
-#: builtin.c:108
+#: builtin.c:112
msgid "standard output"
msgstr "standard output"
-#: builtin.c:109
+#: builtin.c:113
msgid "reason unknown"
msgstr "ragione indeterminata"
-#: builtin.c:122
+#: builtin.c:126
msgid "exp: received non-numeric argument"
msgstr "exp: argomento non numerico"
-#: builtin.c:128
+#: builtin.c:132
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: argomento %g non accettabile"
-#: builtin.c:186
+#: builtin.c:190
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: non posso scaricare: 'pipe' `%s' aperta in lettura, non in scrittura"
-#: builtin.c:189
+#: builtin.c:193
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush: non posso scaricare: file `%s' aperto in lettura, non in scrittura"
-#: builtin.c:201
+#: builtin.c:205
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "fflush: `%s' non è un file aperto, una 'pipe' o un co-processo"
-#: builtin.c:295
+#: builtin.c:299
msgid "index: received non-string first argument"
msgstr "index: il primo argomento non è una stringa"
-#: builtin.c:297
+#: builtin.c:301
msgid "index: received non-string second argument"
msgstr "index: il secondo argomento non è una stringa"
-#: builtin.c:407
+#: builtin.c:411
msgid "int: received non-numeric argument"
msgstr "int: argomento non numerico"
-#: builtin.c:424
+#: builtin.c:428
msgid "length: received non-string argument"
msgstr "length: l'argomento non è una stringa"
-#: builtin.c:440
+#: builtin.c:444
msgid "log: received non-numeric argument"
msgstr "log: argomento non numerico"
-#: builtin.c:443
+#: builtin.c:447
#, c-format
msgid "log: received negative argument %g"
msgstr "log: argomento negativo %g"
-#: builtin.c:605 builtin.c:608
+#: builtin.c:609 builtin.c:612
msgid "must use `count$' on all formats or none"
msgstr "'count$' va usato per tutti i formati o per nessuno"
-#: builtin.c:703
+#: builtin.c:714
msgid "`$' is not permitted in awk formats"
msgstr "`$' non permesso nei 'format' awk"
-#: builtin.c:709
+#: builtin.c:720
msgid "arg count with `$' must be > 0"
msgstr "il numero di argomento con `$' deve essere > 0"
-#: builtin.c:711
+#: builtin.c:722
#, c-format
-msgid "arg count %d greater than total number of supplied arguments"
+msgid "arg count %ld greater than total number of supplied arguments"
msgstr ""
-"numero di argomento %d maggiore del numero totale di argomenti specificati"
+"numero di argomenti (%ld) maggiore del numero totale di argomenti specificati"
-#: builtin.c:713
+#: builtin.c:724
msgid "`$' not permitted after period in format"
msgstr "`$' non permesso dopo un punto nel 'format'"
-#: builtin.c:726
+#: builtin.c:737
msgid "no `$' supplied for positional field width or precision"
msgstr ""
"nessun `$' specificato per larghezza o precisione di un campo posizionale"
-#: builtin.c:784
+#: builtin.c:795
msgid "`l' is meaningless in awk formats; ignored"
msgstr "`l' non ha senso nei 'format' awk; ignorata"
-#: builtin.c:788
+#: builtin.c:799
msgid "`l' is not permitted in POSIX awk formats"
msgstr "`l' non permessa nei 'format' awk POSIX"
-#: builtin.c:799
+#: builtin.c:810
msgid "`L' is meaningless in awk formats; ignored"
msgstr "`L' non ha senso nei 'format' awk; ignorata"
-#: builtin.c:803
+#: builtin.c:814
msgid "`L' is not permitted in POSIX awk formats"
msgstr "`L' non permessa nei 'format' awk POSIX"
-#: builtin.c:814
+#: builtin.c:825
msgid "`h' is meaningless in awk formats; ignored"
msgstr "`h' non ha senso nei 'format' awk; ignorata"
-#: builtin.c:818
+#: builtin.c:829
msgid "`h' is not permitted in POSIX awk formats"
msgstr "`h' non permessa nei 'format' awk POSIX"
-#: builtin.c:1067
+#: builtin.c:1078
msgid "not enough arguments to satisfy format string"
msgstr "mancano argomenti per completare il 'format'"
-#: builtin.c:1069
+#: builtin.c:1080
msgid "^ ran out for this one"
msgstr "^ uscito per questo"
-#: builtin.c:1074
+#: builtin.c:1085
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf: il designatore di 'format' non ha una lettera di controllo"
-#: builtin.c:1077
+#: builtin.c:1088
msgid "too many arguments supplied for format string"
msgstr "troppi argomenti specificati per il 'format'"
-#: builtin.c:1120 builtin.c:1123
+#: builtin.c:1154 builtin.c:1157
msgid "printf: no arguments"
msgstr "printf: manca argomento"
-#: builtin.c:1156
+#: builtin.c:1181
msgid "sqrt: received non-numeric argument"
msgstr "sqrt: argomento non numerico"
-#: builtin.c:1160
+#: builtin.c:1185
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: chiamata con argomento negativo %g"
-#: builtin.c:1182
+#: builtin.c:1207
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: indice di partenza %g invalido, uso 1"
-#: builtin.c:1187
+#: builtin.c:1212
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "substr: indice di partenza non intero %g: sarà troncato"
-#: builtin.c:1201
+#: builtin.c:1231
#, c-format
msgid "substr: length %g is <= 0"
msgstr "substr: lunghezza %g <= 0"
-#: builtin.c:1207
+#: builtin.c:1233
+#, c-format
+msgid "substr: length %g is < 0"
+msgstr "substr: lunghezza %g < 0"
+
+#: builtin.c:1240
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: lunghezza non intera %g: sarà truncata"
-#: builtin.c:1214
+#: builtin.c:1245
+#, 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:1257
msgid "substr: source string is zero length"
msgstr "substr: stringa di partenza lunga zero"
-#: builtin.c:1221
+#: builtin.c:1263
#, c-format
-msgid ""
-"substr: length %d at start index %d exceeds length of first argument (%d)"
-msgstr ""
-"substr: lunghezza %d dell'indice di partenza %d supera lunghezza del primo "
-"argomento (%d)"
+msgid "substr: start index %g is past end of string"
+msgstr "substr: indice di partenza %g oltre la fine della stringa"
-#: builtin.c:1227
+#: builtin.c:1271
#, c-format
-msgid "substr: start index %d is past end of string"
-msgstr "substr: indice di partenza %d supera la fine della stringa"
+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:1263
+#: builtin.c:1306
msgid "strftime: received non-string first argument"
msgstr "strftime: il primo argomento non è una stringa"
-#: builtin.c:1269
+#: builtin.c:1312
msgid "strftime: received empty format string"
msgstr "strftime: 'format' è una stringa nulla"
-#: builtin.c:1278
+#: builtin.c:1321
msgid "strftime: received non-numeric second argument"
msgstr "strftime: il secondo argomento non è numerico"
-#: builtin.c:1341
+#: builtin.c:1384
msgid "mktime: received non-string argument"
msgstr "mktime: l'argomento non è una stringa"
-#: builtin.c:1386
+#: builtin.c:1429
msgid "system: received non-string argument"
msgstr "system: l'argomento non è una stringa"
-#: builtin.c:1512
+#: builtin.c:1573
msgid "tolower: received non-string argument"
msgstr "tolower: l'argomento non è una stringa"
-#: builtin.c:1561
+#: builtin.c:1622
msgid "toupper: received non-string argument"
msgstr "toupper: l'argomento non è una stringa"
-#: builtin.c:1606
+#: builtin.c:1667
msgid "atan2: received non-numeric first argument"
msgstr "atan2: il primo argomento non è numerico"
-#: builtin.c:1608
+#: builtin.c:1669
msgid "atan2: received non-numeric second argument"
msgstr "atan2: il secondo argomento non è numerico"
-#: builtin.c:1627
+#: builtin.c:1688
msgid "sin: received non-numeric argument"
msgstr "sin: l'argomento non è numerico"
-#: builtin.c:1643
+#: builtin.c:1704
msgid "cos: received non-numeric argument"
msgstr "cos: l'argomento non è numerico"
-#: builtin.c:1687
+#: builtin.c:1748
msgid "srand: received non-numeric argument"
msgstr "srand: l'argomento non è numerico"
-#: builtin.c:1721
+#: builtin.c:1787
msgid "match: third argument is not an array"
msgstr "match: il terzo argomento non è un vettore"
-#: builtin.c:2157
+#: builtin.c:2264
msgid "gensub: 3rd argument of 0 treated as 1"
msgstr "gensub: il terzo argomento è 0, trattato come 1"
-#: builtin.c:2268 builtin.c:2270
+#: builtin.c:2375 builtin.c:2377
msgid "lshift: received non-numeric first argument"
msgstr "lshift: il primo argomento non è numerico"
-#: builtin.c:2272
+#: builtin.c:2379
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr "lshift(%lf, %lf): valori negativi daranno risultati strani"
-#: builtin.c:2274
+#: builtin.c:2381
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf): valori con decimali verranno troncati"
-#: builtin.c:2276
+#: builtin.c:2383
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr "lshift(%lf, %lf): valori troppo alti daranno risultati strani"
-#: builtin.c:2305 builtin.c:2307
+#: builtin.c:2412 builtin.c:2414
msgid "rshift: received non-numeric first argument"
msgstr "rshift: il primo argomento non è numerico"
-#: builtin.c:2309
+#: builtin.c:2416
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr "rshift(%lf, %lf): valori negativi daranno risultati strani"
-#: builtin.c:2311
+#: builtin.c:2418
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf): valori con decimali verranno troncati"
-#: builtin.c:2313
+#: builtin.c:2420
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr "rshift(%lf, %lf): valori troppo alti daranno risultati strani"
-#: builtin.c:2342 builtin.c:2344
+#: builtin.c:2449 builtin.c:2451
msgid "and: received non-numeric first argument"
msgstr "and: il primo argomento non è numerico"
-#: builtin.c:2346
+#: builtin.c:2453
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr "and(%lf, %lf): valori negativi daranno risultati strani"
-#: builtin.c:2348
+#: builtin.c:2455
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): valori con decimali verranno troncati"
-#: builtin.c:2377 builtin.c:2379
+#: builtin.c:2484 builtin.c:2486
msgid "or: received non-numeric first argument"
msgstr "or: il primo argomento non è numerico"
-#: builtin.c:2381
+#: builtin.c:2488
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr "or(%lf, %lf): valori negativi daranno risultati strani"
-#: builtin.c:2383
+#: builtin.c:2490
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf): valori con decimali verranno troncati"
-#: builtin.c:2412 builtin.c:2414
+#: builtin.c:2519 builtin.c:2521
msgid "xor: received non-numeric first argument"
msgstr "xor: il primo argomento non è numerico"
-#: builtin.c:2416
+#: builtin.c:2523
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr "xor(%lf, %lf): valori negativi daranno risultati strani"
-#: builtin.c:2418
+#: builtin.c:2525
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf): valori con decimali verranno troncati"
-#: builtin.c:2446
+#: builtin.c:2553
msgid "compl: received non-numeric argument"
msgstr "compl: l'argomento non è numerico"
-#: builtin.c:2448
+#: builtin.c:2555
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf): valore negativo darà risultati strani"
-#: builtin.c:2450
+#: builtin.c:2557
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf): valore con decimali verrà troncato"
-#: builtin.c:2621
+#: builtin.c:2728
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: `%s' non è una categoria 'locale' valida"
+#: eval.c:262
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "tipo nodo sconosciuto %d"
+
+#: eval.c:310
+msgid "buffer overflow in genflags2str"
+msgstr "superament limiti buffer in 'genflags2str'"
+
+#: eval.c:555
+#, 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:576
+msgid "`break' outside a loop is not portable"
+msgstr "`break' all'esterno di un ciclo non è portabile"
+
+#: eval.c:580
+msgid "`break' outside a loop is not allowed"
+msgstr "`break' all'esterno di un ciclo non è consentito"
+
+#: eval.c:597
+msgid "`continue' outside a loop is not portable"
+msgstr "`continue' all'esterno di un ciclo non è portabile"
+
+#: eval.c:601
+msgid "`continue' outside a loop is not allowed"
+msgstr "`continue' all'esterno di un ciclo non è consentito"
+
+#: eval.c:635
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "`next' non può essere chiamato da una regola BEGIN"
+
+#: eval.c:637
+msgid "`next' cannot be called from an END rule"
+msgstr "`next' non può essere chiamato da una regola END"
+
+#: eval.c:646
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "`nextfile' non può essere chiamato da una regola BEGIN"
+
+#: eval.c:648
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "`nextfile' non può essere chiamato da una regola END"
+
+#: eval.c:696
+msgid "statement has no effect"
+msgstr "istruzione che non fa nulla"
+
+#: eval.c:731 eval.c:761 eval.c:1733
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "referenza a variabile non inizializzata `%s'"
+
+#: eval.c:739 eval.c:1721
+#, 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:746 eval.c:752
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "referenza ad argomento non inizializzato `%s'"
+
+#: eval.c:810 eval.c:1728 profile.c:773
+#, c-format
+msgid "attempt to use array `%s' in a scalar context"
+msgstr "tentativo di usare vettore `%s' in un contesto scalare"
+
+#: eval.c:910
+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:935
+msgid "assignment used in conditional context"
+msgstr "assegnamento usato nel contesto di un test condizionale"
+
+#: eval.c:1026
+msgid "division by zero attempted"
+msgstr "tentativo di dividere per zero"
+
+#: eval.c:1041
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "divisione per zero tentata in `%%'"
+
+#: eval.c:1056 profile.c:649
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "tipo non ammesso (%s) in 'tree_eval'"
+
+#: eval.c:1232
+msgid "division by zero attempted in `/='"
+msgstr "divisione per zero tentata in `/='"
+
+#: eval.c:1250
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "divisione per zero tentata in `%%='"
+
+#: eval.c:1510
+#, c-format
+msgid "%s (from %s)"
+msgstr "%s (da %s)"
+
+#: eval.c:1569
+#, c-format
+msgid "function `%s' called with more arguments than declared"
+msgstr "funzione `%s' chiamata con più argomenti di quelli previsti"
+
+#: eval.c:1628
+#, c-format
+msgid "function `%s' not defined"
+msgstr "funzione `%s' non definita"
+
+#: eval.c:1634
+#, c-format
+msgid "function %s called\n"
+msgstr "funzione %s chiamata\n"
+
+#: eval.c:1693
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# 'Stack' (Pila) Chiamate Funzione:\n"
+"\n"
+
+#: eval.c:1696
+msgid "\t# -- main --\n"
+msgstr "\t# -- principale --\n"
+
+#: eval.c:1850
+msgid "attempt to field reference from non-numeric value"
+msgstr "tentativo di referenziare campo da valore non numerico"
+
+#: eval.c:1852
+msgid "attempt to reference from null string"
+msgstr "tentativo to referenziare da stringa nulla"
+
+#: eval.c:1858
+#, c-format
+msgid "attempt to access field %d"
+msgstr "tentativo di accedere al campo %d"
+
+#: eval.c:1874
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr "tentativo di unare il parametro scalare `%s' come un vettore"
+
+#: eval.c:1886 eval.c:1893 profile.c:865
+msgid "assignment is not allowed to result of builtin function"
+msgstr "assegnamento non permesso al risultato di una funzione interna"
+
+#: eval.c:1941
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "`IGNORECASE' è un'estensione gawk"
+
+#: eval.c:1970
+msgid "`BINMODE' is a gawk extension"
+msgstr "`BINMODE' è un'estensione gawk"
+
+#: eval.c:2082
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "specificazione invalida `%sFMT' `%s'"
+
+#: eval.c:2160
+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"
@@ -421,10 +900,35 @@ msgstr "extension: non riesco ad aprire `%s' (%s)\n"
msgid "extension: library `%s': cannot call function `%s' (%s)\n"
msgstr "extension: biblioteca `%s': non riesco a chiamare funzione `%s' (%s)\n"
-#: ext.c:180
+#: ext.c:181
msgid "Operation Not Supported"
msgstr "Operazione Non Supportata"
+#: field.c:321
+msgid "NF set to negative value"
+msgstr "NF impostato a un valore negativo"
+
+#: field.c:819
+msgid "split: second argument is not an array"
+msgstr "split: il secondo argomento non è un vettore"
+
+#: field.c:854
+msgid "split: null string for third arg is a gawk extension"
+msgstr "split: la stringa nulla come terzo arg. è un'estensione gawk"
+
+#: field.c:906
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "`FIELDWIDTHS' è un'estensione gawk"
+
+#: field.c:933
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "campo %d in FIELDWIDTHS, deve essere > 0"
+
+#: field.c:1006
+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"
@@ -465,7 +969,7 @@ msgstr "%s: opzione non permessa -- %c\n"
msgid "%s: invalid option -- %c\n"
msgstr "%s: opzione non valida -- %c\n"
-#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412
+#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:431
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: l'opzione richiede un argomento -- %c\n"
@@ -480,162 +984,471 @@ msgstr "%s: opzione `-W %s' ambigua\n"
msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "%s: opzione `-W %s' non prevede un argomento\n"
-#: main.c:307
+#: io.c:257
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "non riesco ad aprire file `%s' in lettura (%s)"
+
+#: io.c:344
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "chiusura di fd %d (`%s') fallita (%s)"
+
+#: io.c:482
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "tipo di albero invalido %s in redirect()"
+
+#: io.c:488
+#, c-format
+msgid "expression in `%s' redirection only has numeric value"
+msgstr "espressione nella re-direzione `%s' ha solo un valore numerico"
+
+#: io.c:494
+#, 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:499
+#, 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:521
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "mistura non necessaria di `>' e `>>' per il file `%.*s'"
+
+#: io.c:573
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "non posso aprire 'pipe' `%s' in scrittura (%s)"
+
+#: io.c:582
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "non posso aprire 'pipe' `%s' in lettura (%s)"
+
+#: io.c:595
+#, 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:599
+#, 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:675
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "non posso re-dirigere da `%s' (%s)"
+
+#: io.c:678
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "non posso re-dirigere a `%s' (%s)"
+
+#: io.c:717
+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:729
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "chiusura di `%s' fallita (%s)."
+
+#: io.c:736
+msgid "too many pipes or input files open"
+msgstr "troppe 'pipe' o file di input aperti"
+
+#: io.c:759
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: il secondo argomento deve essere `a' o `da'"
+
+#: io.c:773
+#, 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:777
+msgid "close of redirection that was never opened"
+msgstr "chiusura di una re-direzione mai aperta"
+
+#: io.c:804
+#, 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:866
+#, c-format
+msgid "failure status (%d) on pipe close of `%s' (%s)"
+msgstr "errore ritornato (%d) dalla chiusura della 'pipe' `%s' (%s)"
+
+#: io.c:869
+#, c-format
+msgid "failure status (%d) on file close of `%s' (%s)"
+msgstr "errore ritornato (%d) dalla chiusura del file `%s' (%s)"
+
+#: io.c:888
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "nessuna chiusura esplicita richiesta per 'socket' `%s'"
+
+#: io.c:891
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "nessuna chiusura esplicita richiesta per co-processo `%s'"
+
+#: io.c:894
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "nessuna chiusura esplicita richiesta per 'pipe' `%s'"
+
+#: io.c:897
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "nessuna chiusura esplicita richiesta per file `%s'"
+
+#: io.c:926 io.c:980
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "errore scrivendo 'standard output' (%s)"
+
+#: io.c:930 io.c:984
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "errore scrivendo 'standard error' (%s)"
+
+#: io.c:938
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "scaricamento di 'pipe' `%s' fallita (%s)."
+
+#: io.c:941
+#, 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:944
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "scaricamento di file `%s' fallita (%s)."
+
+#: io.c:1103
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "spiacente, 'client' /inet/raw non ancora pronto"
+
+#: io.c:1105 io.c:1142
+msgid "only root may use `/inet/raw'."
+msgstr "solo root può usare `/inet/raw'."
+
+#: io.c:1140
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "spiacente, 'server' /inet/raw non ancora pronto"
+
+#: io.c:1230
+#, c-format
+msgid "no (known) protocol supplied in special filename `%s'"
+msgstr "nessuno protocollo (conosciuto) specificato nel filename speciale `%s'"
+
+#: io.c:1248
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "nome file speciale `%s' incompleto"
+
+#: io.c:1260
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "porta locale invalida in `%s'"
+
+#: io.c:1272
+msgid "must supply a remote hostname to `/inet'"
+msgstr "va fornito nome di 'host' remoto a `/inet'"
+
+#: io.c:1287
+msgid "must supply a remote port to `/inet'"
+msgstr "va fornita porta remota a `/inet'"
+
+#: io.c:1293
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "porta remota invalida in `%s'"
+
+#: io.c:1303
+msgid "TCP/IP communications are not supported"
+msgstr "comunicazioni TCP/IP non supportate"
+
+#: io.c:1312 io.c:1492
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "file `%s' è una 'directory'"
+
+#: io.c:1381
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "usa `PROCINFO[\"%s\"]' invece che `%s'"
+
+#: io.c:1413
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "usa `PROCINFO[...]' invece che `/dev/user'"
+
+#: io.c:1478 io.c:1652
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "non riesco ad aprire `%s', modo `%s'"
+
+#: io.c:1703
+#, c-format
+msgid "close of master pty failed (%s)"
+msgstr "fallita chiusura di 'pty' principale (%s)"
+
+#: io.c:1705 io.c:1857 io.c:2009
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "fallita chiusura di 'stdout' nel processo-figlio (%s)"
+
+#: io.c:1708
+#, 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:1710 io.c:1862
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "fallita chiusura di 'stdin' nel processo-figlio (%s)"
+
+#: io.c:1713
+#, 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:1715 io.c:1734
+#, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "fallita chiusura di 'pty' secondaria (%s)"
+
+#: io.c:1808 io.c:1860 io.c:1990 io.c:2012
+#, 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:1812 io.c:1865
+#, 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:1829 io.c:2003
+msgid "restoring stdout in parent process failed\n"
+msgstr "fallito ripristino di 'stdout' nel processo-padre\n"
+
+#: io.c:1834
+msgid "restoring stdin in parent process failed\n"
+msgstr "fallito ripristino di 'stdin' nel processo-padre\n"
+
+#: io.c:1868 io.c:2014 io.c:2025
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "fallita chiusura di 'pipe' (%s)"
+
+#: io.c:1913
+msgid "`|&' not supported"
+msgstr "`|&' non supportato"
+
+#: io.c:1980
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "non riesco ad aprire 'pipe' `%s' (%s)"
+
+#: io.c:2021
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr "non riesco a creare processo-figlio per `%s' (fork: %s)"
+
+#: io.c:2364
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "file dati `%s' vuoto"
+
+#: io.c:2407 io.c:2415
+msgid "could not allocate more input memory"
+msgstr "non riesco ad allocare ulteriore memoria per l'input"
+
+#: io.c:2540 io.c:2782 io.c:3046
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "errore leggendo file di input `%s': %s"
+
+#: io.c:3281
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "valore multicarattere per `RS' è un'estensione gawk"
+
+#: main.c:322
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "`-m[fr]' opzione irrilevante per gawk"
-#: main.c:309
+#: main.c:324
msgid "-m option usage: `-m[fr] nnn'"
msgstr "-m uso opzione: `-m[fr] nnn'"
-#: main.c:326
+#: main.c:341
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s: opzione `-W %s' non riconosciuta, ignorata\n"
-#: main.c:357
+#: main.c:378
msgid "empty argument to `--source' ignored"
msgstr "argomento di `--source' mancante, comando ignorato"
-#: main.c:429
+#: main.c:448
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr "variable d'ambiente `POSIXLY_CORRECT' impostata: attivo `--posix'"
-#: main.c:434
+#: main.c:453
msgid "`--posix' overrides `--traditional'"
msgstr "`--posix' annulla `--traditional'"
-#: main.c:445
+#: main.c:464
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr "`--posix'/`--traditional' annulla `--non-decimal-data'"
-#: main.c:449
+#: main.c:468
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr "eseguire %s con 'setuid' root può essere un rischio per la sicurezza"
-#: main.c:478
+#: main.c:509
#, c-format
-msgid "can't set mode on stdin (%s)"
-msgstr "non posso impostare mode su 'stdin'(%s)"
+msgid "can't set binary mode on stdin (%s)"
+msgstr "non posso impostare modalità binaria su 'stdin'(%s)"
-#: main.c:481
+#: main.c:512
#, c-format
-msgid "can't set mode on stdout (%s)"
-msgstr "non posso impostare mode su 'stdout'(%s)"
+msgid "can't set binary mode on stdout (%s)"
+msgstr "non posso impostare modalità binaria su 'stdout'(%s)"
-#: main.c:483
+#: main.c:514
#, c-format
-msgid "can't set mode on stderr (%s)"
-msgstr "non posso impostare mode su 'stderr'(%s)"
+msgid "can't set binary mode on stderr (%s)"
+msgstr "non posso impostare modalità binaria su 'stderr'(%s)"
-#: main.c:512
+#: main.c:544
msgid "no program text at all!"
msgstr "manca del tutto il testo del programma!"
-#: main.c:556
+#: main.c:612
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr "Uso: %s [opzioni in stile POSIX o GNU] -f fileprog [--] file ...\n"
-#: main.c:558
+#: main.c:614
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr "Usage: %s [opzioni in stile POSIX o GNU] [--] %cprogramma%c file ...\n"
-#: main.c:563
+#: main.c:619
msgid "POSIX options:\t\tGNU long options:\n"
msgstr "Opzioni POSIX:\t\topzioni lunghe GNU:\n"
-#: main.c:564
+#: main.c:620
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f fileprog\t\t--file=fileprog\n"
-#: main.c:565
+#: main.c:621
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F fs\t\t\t--field-separator=fs\n"
-#: main.c:566
+#: main.c:622
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "\t-v var=valore\t\t--assign=var=valore\n"
-#: main.c:567
+#: main.c:623
msgid "\t-m[fr] val\n"
msgstr "\t-m[fr] valore\n"
-#: main.c:568
+#: main.c:624
msgid "\t-W compat\t\t--compat\n"
msgstr "\t-W compat\t\t--compat\n"
-#: main.c:569
+#: main.c:625
msgid "\t-W copyleft\t\t--copyleft\n"
msgstr "\t-W copyleft\t\t--copyleft\n"
-#: main.c:570
+#: main.c:626
msgid "\t-W copyright\t\t--copyright\n"
msgstr "\t-W copyright\t\t--copyright\n"
-#: main.c:571
+#: main.c:627
msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
msgstr "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
-#: main.c:572
+#: main.c:628
msgid "\t-W gen-po\t\t--gen-po\n"
msgstr "\t-W gen-po\t\t--gen-po\n"
-#: main.c:573
+#: main.c:629
msgid "\t-W help\t\t\t--help\n"
msgstr "\t-W help\t\t\t--help\n"
-#: main.c:574
+#: main.c:630
msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
-#: main.c:575
+#: main.c:631
msgid "\t-W lint-old\t\t--lint-old\n"
msgstr "\t-W lint-old\t\t--lint-old\n"
-#: main.c:576
+#: main.c:632
msgid "\t-W non-decimal-data\t--non-decimal-data\n"
msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
-#: main.c:578
+#: main.c:634
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:581
+#: main.c:637
msgid "\t-W parsedebug\t\t--parsedebug\n"
msgstr "\t-W parsedebug\t\t--parsedebug\n"
-#: main.c:583
+#: main.c:639
msgid "\t-W profile[=file]\t--profile[=file]\n"
msgstr "\t-W profile[=file]\t--profile[=file]\n"
-#: main.c:584
+#: main.c:640
msgid "\t-W posix\t\t--posix\n"
msgstr "\t-W posix\t\t--posix\n"
-#: main.c:585
+#: main.c:641
msgid "\t-W re-interval\t\t--re-interval\n"
msgstr "\t-W re-interval\t\t--re-interval\n"
-#: main.c:586
+#: main.c:642
msgid "\t-W source=program-text\t--source=program-text\n"
msgstr "\t-W source=testo-programma\t--source=testo-programma\n"
-#: main.c:587
+#: main.c:643
msgid "\t-W traditional\t\t--traditional\n"
msgstr "\t-W traditional\t\t--traditional\n"
-#: main.c:588
+#: main.c:644
msgid "\t-W usage\t\t--usage\n"
msgstr "\t-W usage\t\t--usage\n"
-#: main.c:589
+#: main.c:645
msgid "\t-W version\t\t--version\n"
msgstr "\t-W version\t\t--version\n"
-#: main.c:593
+#: main.c:649
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -647,7 +1460,7 @@ msgstr ""
"sezione `Reporting Problems and Bugs' nella versione a stampa.\n"
"\n"
-#: main.c:597
+#: main.c:653
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -657,7 +1470,7 @@ msgstr ""
"Senza parametri, legge da 'standard input' e scrive su 'standard output'.\n"
"\n"
-#: main.c:601
+#: main.c:657
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -667,7 +1480,7 @@ msgstr ""
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:613
+#: main.c:669
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -680,13 +1493,13 @@ msgid ""
msgstr ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
"\n"
-"Questo programma è libero software; lo puoi distribuire e/o modificare\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:621
+#: main.c:677
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"
@@ -696,11 +1509,11 @@ msgid ""
msgstr ""
"Questo programma è distribuito con la speranza che sia utile,\n"
"ma SENZA ALCUNA GARANZIA; senza neppure la garanzia implicita\n"
-"di COMMERCIABILITA' o UTILITA' per UNO SCOPO PARTICOLARE.\n"
+"di COMMERCIABILITA' o IDONEITA' AD UN PARTICOLARE SCOPO.\n"
"Vedi la 'GNU General Public License' per ulteriori dettagli.\n"
"\n"
-#: main.c:627
+#: main.c:683
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"
@@ -710,98 +1523,117 @@ msgstr ""
"assieme a questo programma; se non è così, scrivi alla Free Software\n"
"Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"
-#: main.c:657
+#: main.c:713
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "-Ft non imposta FS a 'tab' nell'awk POSIX"
-#: main.c:888
+#: main.c:944
#, c-format
-msgid "invalid syntax in name `%s' for variable assignment"
-msgstr "sintassi invalida nel nome di variabile `%s'"
+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:957
+#: main.c:964
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr "`%s' non è un nome di variabile ammesso"
+
+#: main.c:967
+#, 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:995
msgid "floating point exception"
msgstr "eccezione floating point"
-#: main.c:964
+#: main.c:1002
msgid "fatal error: internal error"
msgstr "errore fatale: errore interno"
-#: main.c:1014
+#: main.c:1052
#, c-format
msgid "no pre-opened fd %d"
msgstr "manca 'fd' predefinita %d"
-#: main.c:1019
+#: main.c:1057
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "non riesco a predefinire /dev/null per 'fd' %d"
-#: main.c:1037 main.c:1046
+#: main.c:1080 main.c:1089
#, c-format
msgid "could not find groups: %s"
msgstr "non riesco a trovare gruppi: %s"
-#: profile.c:94
-#, c-format
-msgid "could not open `%s' for writing: %s"
-msgstr "non riesco ad aprire `%s' in scrittura: %s"
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "linea progr.:"
-#: profile.c:96 awkgram.y:2465
-msgid "sending profile to standard error"
-msgstr "mando profilo a 'standard error'"
+#: msg.c:120
+msgid "warning: "
+msgstr "attenzione: "
-#: profile.c:409
-msgid "internal error: Node_var with null vname"
-msgstr "errore interno: 'Node_var' con 'vname' nullo"
+#: msg.c:142
+msgid "error: "
+msgstr "errore: "
-#: profile.c:524
-msgid "internal error: Node_var_array with null vname"
-msgstr "errore interno: 'Node_var_array' con 'vname' nullo"
+#: msg.c:178
+msgid "fatal: "
+msgstr "fatale: "
-#: profile.c:554 eval.c:813
-#, c-format
-msgid ""
-"function `%s' called with space between name and `(',\n"
-"%s"
-msgstr ""
-"funzione `%s' chiamata con spazio tra il nome e `(',\n"
-"%s"
+#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
+msgid "can't convert string to float"
+msgstr "non riesco a convertire stringa a valore in virgola mobile"
-#: profile.c:556 eval.c:815
-msgid "or used in other expression context"
-msgstr "o usata nel contesto di altra espressione"
+#: node.c:357
+msgid "backslash at end of string"
+msgstr "'\\' a fine stringa"
-#: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741
-#, c-format
-msgid "attempt to use array `%s' in a scalar context"
-msgstr "tentativo di usare vettore `%s' in un contesto scalare"
+#: node.c:544
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX non permette formato `\\x'"
+
+#: node.c:550
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "niente cifre esadecimanli nel formato `\\x'"
-#: profile.c:637 eval.c:1047
+#: node.c:584
#, c-format
-msgid "illegal type (%s) in tree_eval"
-msgstr "tipo non ammesso (%s) in 'tree_eval'"
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr " sequenza in formato `\\%c' considerata come semplice `%c'"
-#: profile.c:842 eval.c:1790
+#: posix/gawkmisc.c:172
#, c-format
-msgid "attempt to use function `%s' as array"
-msgstr "tentativo di usare funzione `%s' come vettore"
+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:856 eval.c:1797
+#: profile.c:91
#, c-format
-msgid "`%s' is a function, assignment is not allowed"
-msgstr "`%s' è una funzione, assegnamento non permesso"
+msgid "could not open `%s' for writing: %s"
+msgstr "non riesco ad aprire `%s' in scrittura: %s"
-#: profile.c:860 eval.c:1803 eval.c:1810
-msgid "assignment is not allowed to result of builtin function"
-msgstr "assegnamento non permesso al risultato di una funzione interna"
+#: profile.c:409
+msgid "internal error: Node_var with null vname"
+msgstr "errore interno: 'Node_var' con 'vname' nullo"
+
+#: profile.c:471
+msgid "# treated internally as `delete'"
+msgstr "# gestito internamente come 'delete' (cancellazione)"
+
+#: profile.c:545
+msgid "internal error: Node_var_array with null vname"
+msgstr "errore interno: 'Node_var_array' con 'vname' nullo"
-#: profile.c:1108
+#: profile.c:1127
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# profilo gawk, creato %s\n"
-#: profile.c:1111
+#: profile.c:1130
msgid ""
"\t# BEGIN block(s)\n"
"\n"
@@ -809,7 +1641,7 @@ msgstr ""
"\t# blocco(hi) BEGIN\n"
"\n"
-#: profile.c:1121
+#: profile.c:1140
msgid ""
"\t# Rule(s)\n"
"\n"
@@ -817,7 +1649,7 @@ msgstr ""
"\t# Regola(e)\n"
"\n"
-#: profile.c:1127
+#: profile.c:1146
msgid ""
"\t# END block(s)\n"
"\n"
@@ -825,7 +1657,7 @@ msgstr ""
"\t# blocco(hi) END\n"
"\n"
-#: profile.c:1147
+#: profile.c:1166
msgid ""
"\n"
"\t# Functions, listed alphabetically\n"
@@ -833,917 +1665,86 @@ msgstr ""
"\n"
"\t# Funzioni, listate in ordine alfabetico\n"
-#: profile.c:1357
+#: profile.c:1376
#, c-format
msgid "unexpected type %s in prec_level"
msgstr "tipo non previsto %s in 'prec_level'"
-#: regex.c:1322
+#: 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"
-#: regex.c:1323
+#: regcomp.c:139
msgid "No match"
msgstr "Nessuna corrispondenza"
-#: regex.c:1324
+#: regcomp.c:142
msgid "Invalid regular expression"
msgstr "Espressione regolare invalida"
-#: regex.c:1325
+#: regcomp.c:145
msgid "Invalid collation character"
msgstr "Carattere di ordinamento non valido"
-#: regex.c:1326
+#: regcomp.c:148
msgid "Invalid character class name"
msgstr "Nome di 'classe di caratteri' invalido"
-#: regex.c:1327
+#: regcomp.c:151
msgid "Trailing backslash"
msgstr "'\\' finale"
-#: regex.c:1328
+#: regcomp.c:154
msgid "Invalid back reference"
msgstr "Riferimento indietro invalido"
-#: regex.c:1329
+#: regcomp.c:157
msgid "Unmatched [ or [^"
msgstr "[ or [^ non chiusa"
-#: regex.c:1330
+#: regcomp.c:160
msgid "Unmatched ( or \\("
msgstr "( or \\( non chiusa"
-#: regex.c:1331
+#: regcomp.c:163
msgid "Unmatched \\{"
msgstr "\\{ non chiusa"
-#: regex.c:1332
+#: regcomp.c:166
msgid "Invalid content of \\{\\}"
msgstr "Contenuto di \\{\\} invalido"
-#: regex.c:1333
+#: regcomp.c:169
msgid "Invalid range end"
msgstr "Fine di intervallo invalido"
-#: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204
+#: regcomp.c:172
msgid "Memory exhausted"
msgstr "Memoria esaurita"
-#: regex.c:1335
+#: regcomp.c:175
msgid "Invalid preceding regular expression"
msgstr "Espressione regolare precedente invalida"
-#: regex.c:1336
+#: regcomp.c:178
msgid "Premature end of regular expression"
msgstr "Fine di expressione regolare inaspettata"
-#: regex.c:1337
+#: regcomp.c:181
msgid "Regular expression too big"
msgstr "Espressione regolare troppo complessa"
-#: regex.c:1338
+#: regcomp.c:184
msgid "Unmatched ) or \\)"
msgstr ") or \\) non aperta"
-#: regex.c:7365
+#: regcomp.c:621
msgid "No previous regular expression"
msgstr "Nessuna espressione regolare precedente"
-
-#: awkgram.y:232
-msgid "BEGIN blocks must have an action part"
-msgstr "blocchi BEGIN richiedono una 'azione'"
-
-#: awkgram.y:238
-msgid "END blocks must have an action part"
-msgstr "blocchi END richiedono una 'azione'"
-
-#: awkgram.y:274
-#, c-format
-msgid "`%s' is a built-in function, it cannot be redefined"
-msgstr "`%s' è una funzione interna, non si può ridefinire"
-
-#: awkgram.y:362
-msgid "statement may have no effect"
-msgstr "istruzione che può non aver alcun effetto"
-
-#: awkgram.y:455
-msgid "`next' used in BEGIN or END action"
-msgstr "`next' usato in 'azione' BEGIN o END"
-
-#: awkgram.y:462 awkgram.y:469
-msgid "`nextfile' is a gawk extension"
-msgstr "`nextfile' è un'estensione gawk"
-
-#: awkgram.y:474
-msgid "`nextfile' used in BEGIN or END action"
-msgstr "`nextfile' usato in 'azione' BEGIN o END"
-
-#: awkgram.y:483
-msgid "`return' used outside function context"
-msgstr "`return' usato fuori da una funzione"
-
-#: awkgram.y:519
-msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
-msgstr "`print' da solo in BEGIN o END dovrebbe forse essere `print \"\"'"
-
-#: awkgram.y:532 awkgram.y:539
-msgid "`delete array' is a gawk extension"
-msgstr "`delete array' è un'estensione gawk"
-
-#: awkgram.y:604
-msgid "multistage two-way pipelines don't work"
-msgstr "'pipelines' multistadio bidirezionali non funzionano"
-
-#: awkgram.y:695
-msgid "regular expression on right of assignment"
-msgstr "espressione regolare usata per assegnare un valore"
-
-#: awkgram.y:713
-msgid "non-redirected `getline' undefined inside END action"
-msgstr "`getline' non re-diretta indefinita dentro 'azione' END"
-
-#: awkgram.y:723
-msgid "regular expression on left of `~' or `!~' operator"
-msgstr "espressione regolare prima di operatore `~' o `!~'"
-
-#: awkgram.y:733
-#, c-format
-msgid "regexp constant `/%s/' looks like a C comment, but is not"
-msgstr "costante 'regexp' `/%s/' sembra un commento commento C, ma non lo è"
-
-#: awkgram.y:749
-msgid "regular expression on right of comparison"
-msgstr "espressione regolare a destra in un confronto"
-
-#: awkgram.y:776
-msgid "non-redirected `getline' undefined inside BEGIN or END action"
-msgstr "`getline' non re-diretta indefinita dentro 'azione' BEGIN o END"
-
-#: awkgram.y:831
-msgid "call of `length' without parentheses is not portable"
-msgstr "chiamata a `length' senza parentesi non portabile"
-
-#: awkgram.y:834
-msgid "call of `length' without parentheses is deprecated by POSIX"
-msgstr "chiamata a `length' senza parentesi sconsigliata da POSIX"
-
-#: awkgram.y:884
-msgid "invalid subscript expression"
-msgstr "espressione indice invalida"
-
-#: awkgram.y:1033
-#, c-format
-msgid "fptr %x not in tokentab\n"
-msgstr "puntatore a funzione %x non in tabella\n"
-
-#: awkgram.y:1068
-msgid "unexpected newline"
-msgstr "carattere 'a capo' inaspettato"
-
-#: awkgram.y:1152
-msgid "empty program text on command line"
-msgstr "programma nullo sulla linea comandi"
-
-#: awkgram.y:1209
-#, c-format
-msgid "can't open source file `%s' for reading (%s)"
-msgstr "non riesco ad aprire file sorgente `%s' in lettura (%s)"
-
-#: awkgram.y:1244
-#, c-format
-msgid "can't read sourcefile `%s' (%s)"
-msgstr "non riesco a leggere file sorgente `%s' (%s)"
-
-#: awkgram.y:1252
-#, c-format
-msgid "source file `%s' is empty"
-msgstr "file sorgente `%s' vuoto"
-
-#: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011
-msgid "source file does not end in newline"
-msgstr "file sorgente non termina con carattere 'a capo'"
-
-#: awkgram.y:1518
-msgid "unterminated regexp ends with `\\' at end of file"
-msgstr "espressione regolare non completata termina con `\\' a fine file"
-
-#: awkgram.y:1539
-msgid "unterminated regexp"
-msgstr "espressione regolare non completata"
-
-#: awkgram.y:1542
-msgid "unterminated regexp at end of file"
-msgstr "espressione regolare non completata a fine file"
-
-#: awkgram.y:1609
-msgid "use of `\\ #...' line continuation is not portable"
-msgstr "uso di `\\ #...' continuazione linea non portabile"
-
-#: awkgram.y:1621
-msgid "backslash not last character on line"
-msgstr "'\\' non è l'ultimo carattere della linea"
-
-#: awkgram.y:1662
-msgid "POSIX does not allow operator `**='"
-msgstr "POSIX non permette l'operatore `**='"
-
-#: awkgram.y:1664
-msgid "old awk does not support operator `**='"
-msgstr "il vecchio awk non supporta l'operatore `**='"
-
-#: awkgram.y:1673
-msgid "POSIX does not allow operator `**'"
-msgstr "POSIX non permette l'operatore `**'"
-
-#: awkgram.y:1675
-msgid "old awk does not support operator `**'"
-msgstr "il vecchio awk non supporta l'operatore `**'"
-
-#: awkgram.y:1708
-msgid "operator `^=' is not supported in old awk"
-msgstr "l'operatore `^=' non è supportato nel vecchio awk"
-
-#: awkgram.y:1716
-msgid "operator `^' is not supported in old awk"
-msgstr "l'operatore `^' non è supportato nel vecchio awk"
-
-#: awkgram.y:1798 awkgram.y:1815
-msgid "unterminated string"
-msgstr "stringa non terminata"
-
-#: awkgram.y:1972
-#, c-format
-msgid "invalid char '%c' in expression"
-msgstr "carattere '%c' invalido in un'espressione"
-
-#: awkgram.y:2032
-#, c-format
-msgid "`%s' is a gawk extension"
-msgstr "`%s' è un'estensione gawk"
-
-#: awkgram.y:2035
-#, c-format
-msgid "`%s' is a Bell Labs extension"
-msgstr "`%s' è un'estensione Bell Labs"
-
-#: awkgram.y:2038
-#, c-format
-msgid "POSIX does not allow `%s'"
-msgstr "POSIX non permette `%s'"
-
-#: awkgram.y:2042
-#, c-format
-msgid "`%s' is not supported in old awk"
-msgstr "`%s' non è supportato nel vecchio awk"
-
-#: awkgram.y:2070
-msgid "`goto' considered harmful!\n"
-msgstr "`goto' considerato pericoloso!\n"
-
-#: awkgram.y:2134
-#, c-format
-msgid "%d is invalid as number of arguments for %s"
-msgstr "%d invalido come numero di argomenti per %s"
-
-#: awkgram.y:2153 awkgram.y:2156
-msgid "match: third argument is a gawk extension"
-msgstr "match: il terzo argomento è un'estensione gawk"
-
-#: awkgram.y:2172
-#, c-format
-msgid "%s: string literal as last arg of substitute has no effect"
-msgstr "%s: una stringa come ultimo argomento di 'substitute' non ha effetto"
-
-#: awkgram.y:2176
-msgid "sub third parameter is not a changeable object"
-msgstr "il terzo parametro di 'sub' non è un oggetto modificabile"
-
-#: awkgram.y:2178
-msgid "gsub third parameter is not a changeable object"
-msgstr "il terzo parametro di 'gsub' non è un oggetto modificabile"
-
-#: awkgram.y:2204 awkgram.y:2207
-msgid "close: second argument is a gawk extension"
-msgstr "close: il secondo argomento è un'estensione gawk"
-
-#: awkgram.y:2217
-msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
-msgstr ""
-"uso scorretto di dcgettext(_\"...\"): togliere il carattere '_' iniziale"
-
-#: awkgram.y:2232
-msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
-msgstr ""
-"uso scorretto di dcngettext(_\"...\"): togliere il carattere '_' iniziale"
-
-#: awkgram.y:2323
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "funzione `%s': parametro #%d, `%s', duplica parametro #%d"
-
-#: awkgram.y:2355
-#, c-format
-msgid "function `%s': parameter `%s' shadows global variable"
-msgstr "funzione `%s': parametro `%s' nasconde variabile globale"
-
-#: awkgram.y:2464
-#, c-format
-msgid "could not open `%s' for writing (%s)"
-msgstr "non riesco ad aprire `%s' in scrittura (%s)"
-
-#: awkgram.y:2495
-#, c-format
-msgid "%s: close failed (%s)"
-msgstr "%s: 'close' fallita (%s)"
-
-#: awkgram.y:2605
-msgid "shadow_funcs() called twice!"
-msgstr "shadow_funcs() chiamata due volte!"
-
-#: awkgram.y:2680
-#, c-format
-msgid "function `%s': can't use function name as parameter name"
-msgstr "funzione `%s': non posso usare nome della funzione come nome parametro"
-
-#: awkgram.y:2690
-#, c-format
-msgid "function name `%s' previously defined"
-msgstr "funzione di nome `%s' definita in precedenza"
-
-#: awkgram.y:2838 awkgram.y:2844
-#, c-format
-msgid "function `%s' called but never defined"
-msgstr "funzione `%s' chiamata ma mai definita"
-
-#: awkgram.y:2847
-#, c-format
-msgid "function `%s' defined but never called"
-msgstr "funzione `%s' definita ma mai chiamata"
-
-#: awkgram.y:2874
-#, c-format
-msgid "regexp constant for parameter #%d yields boolean value"
-msgstr ""
-"espressione regolare di valore costante per parametro #%d genera valore "
-"booleano"
-
-#: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649
-#: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078
-#: dfa.c:1081 dfa.c:1094 dfa.c:1095
-msgid "Unbalanced ["
-msgstr "[ sbilanciata"
-
-#: dfa.c:783
-msgid "Unfinished \\ escape"
-msgstr "Escape \\ non terminato"
-
-#: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955
-msgid "unfinished repeat count"
-msgstr "contatore di ripetizioni potenzialmente infinito"
-
-#: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958
-msgid "malformed repeat count"
-msgstr "contatore di ripetizioni non valido"
-
-#: dfa.c:1285
-msgid "Unbalanced ("
-msgstr "( sbilanciata"
-
-#: dfa.c:1407
-msgid "No regexp syntax bits specified"
-msgstr "Nessun'espressione regolare di bits sintattici specificata"
-
-#: dfa.c:1415
-msgid "Unbalanced )"
-msgstr ") sbilanciata"
-
-#: dfa.c:3014
-msgid "out of memory"
-msgstr "non c'è più memoria"
-
-#: field.c:849
-msgid "split: second argument is not an array"
-msgstr "split: il secondo argomento non è un vettore"
-
-#: field.c:876
-msgid "split: null string for third arg is a gawk extension"
-msgstr "split: la stringa nulla come terzo arg. è un'estensione gawk"
-
-#: field.c:916
-msgid "`FIELDWIDTHS' is a gawk extension"
-msgstr "`FIELDWIDTHS' è un'estensione gawk"
-
-#: field.c:943
-#, c-format
-msgid "field %d in FIELDWIDTHS, must be > 0"
-msgstr "campo %d in FIELDWIDTHS, deve essere > 0"
-
-#: field.c:997
-msgid "null string for `FS' is a gawk extension"
-msgstr "la stringa nulla usata come `FS' è un'estensione gawk"
-
-#: msg.c:57
-msgid "cmd. line:"
-msgstr "linea progr.:"
-
-#: msg.c:123
-msgid "warning: "
-msgstr "attenzione: "
-
-#: msg.c:145
-msgid "error: "
-msgstr "errore: "
-
-#: msg.c:178
-msgid "fatal: "
-msgstr "fatale: "
-
-#: eval.c:259
-#, c-format
-msgid "unknown nodetype %d"
-msgstr "tipo nodo sconosciuto %d"
-
-#: eval.c:307
-msgid "buffer overflow in genflags2str"
-msgstr "superament limiti buffer in 'genflags2str'"
-
-#: eval.c:541
-#, c-format
-msgid "for loop: array `%s' changed size from %d to %d during loop execution"
-msgstr ""
-"ciclo for: vettore `%s' ha cambiato dimensione da %d a %d durante "
-"l'esecuzione del ciclo"
-
-#: eval.c:565
-msgid "`break' outside a loop is not portable"
-msgstr "`break' all'esterno di un ciclo non è portabile"
-
-#: eval.c:569
-msgid "`break' outside a loop is not allowed"
-msgstr "`break' all'esterno di un ciclo non è consentito"
-
-#: eval.c:588
-msgid "`continue' outside a loop is not portable"
-msgstr "`continue' all'esterno di un ciclo non è portabile"
-
-#: eval.c:592
-msgid "`continue' outside a loop is not allowed"
-msgstr "`continue' all'esterno di un ciclo non è consentito"
-
-#: eval.c:622
-msgid "`next' cannot be called from a BEGIN rule"
-msgstr "`next' non può essere chiamato da una regola BEGIN"
-
-#: eval.c:624
-msgid "`next' cannot be called from an END rule"
-msgstr "`next' non può essere chiamato da una regola END"
-
-#: eval.c:636
-msgid "`nextfile' cannot be called from a BEGIN rule"
-msgstr "`nextfile' non può essere chiamato da una regola BEGIN"
-
-#: eval.c:638
-msgid "`nextfile' cannot be called from an END rule"
-msgstr "`nextfile' non può essere chiamato da una regola END"
-
-#: eval.c:679
-msgid "statement has no effect"
-msgstr "istruzione che non fa nulla"
-
-#: eval.c:713 eval.c:743 eval.c:1622
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "referenza a variabile non inizializzata `%s'"
-
-#: eval.c:721 eval.c:1608
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "non posso usare nome di funzione `%s' come variabile o vettore"
-
-#: eval.c:728 eval.c:734 eval.c:1747
-#, c-format
-msgid "reference to uninitialized argument `%s'"
-msgstr "referenza ad argomento non inizializzato `%s'"
-
-#: eval.c:823
-msgid "assignment used in conditional context"
-msgstr "assegnamento usato nel contesto di un test condizionale"
-
-#: eval.c:914
-msgid ""
-"concatenation: side effects in one expression have changed the length of "
-"another!"
-msgstr ""
-"concatenatione: effetti secondari in una espressione hanno modificato la "
-"lunghezza di un'altra espressione!"
-
-#: eval.c:1013
-msgid "division by zero attempted"
-msgstr "tentativo di dividere per zero"
-
-#: eval.c:1028
-#, c-format
-msgid "division by zero attempted in `%%'"
-msgstr "divisione per zero tentata in `%%'"
-
-#: eval.c:1236
-msgid "division by zero attempted in `/='"
-msgstr "divisione per zero tentata in `/='"
-
-#: eval.c:1254
-#, c-format
-msgid "division by zero attempted in `%%='"
-msgstr "divisione per zero tentata in `%%='"
-
-#: eval.c:1424
-#, c-format
-msgid "%s (from %s)"
-msgstr "%s (da %s)"
-
-#: eval.c:1472
-#, c-format
-msgid "function `%s' called with more arguments than declared"
-msgstr "funzione `%s' chiamata con più argomenti di quelli previsti"
-
-#: eval.c:1519
-#, c-format
-msgid "function `%s' not defined"
-msgstr "funzione `%s' non definita"
-
-#: eval.c:1521
-#, c-format
-msgid "function %s called\n"
-msgstr "funzione %s chiamata\n"
-
-#: eval.c:1580
-msgid ""
-"\n"
-"\t# Function Call Stack:\n"
-"\n"
-msgstr ""
-"\n"
-"\t# 'Stack' (Pila) Chiamate Funzione:\n"
-"\n"
-
-#: eval.c:1583
-msgid "\t# -- main --\n"
-msgstr "\t# -- principale --\n"
-
-#: eval.c:1759
-msgid "attempt to field reference from non-numeric value"
-msgstr "tentativo di referenziare campo da valore non numerico"
-
-#: eval.c:1761
-msgid "attempt to reference from null string"
-msgstr "tentativo to referenziare da stringa nulla"
-
-#: eval.c:1767
-#, c-format
-msgid "attempt to access field %d"
-msgstr "tentativo di accedere al campo %d"
-
-#: eval.c:1783
-#, c-format
-msgid "attempt to use scalar parameter `%s' as an array"
-msgstr "tentativo di unare il parametro scalare `%s' come un vettore"
-
-#: eval.c:1874
-msgid "`IGNORECASE' is a gawk extension"
-msgstr "`IGNORECASE' è un'estensione gawk"
-
-#: eval.c:1902
-msgid "`BINMODE' is a gawk extension"
-msgstr "`BINMODE' è un'estensione gawk"
-
-#: eval.c:2014
-#, c-format
-msgid "bad `%sFMT' specification `%s'"
-msgstr "specificazione invalida `%sFMT' `%s'"
-
-#: eval.c:2080
-msgid "turning off `--lint' due to assignment to `LINT'"
-msgstr "disabilito `--lint' a causa di assegnamento a `LINT'"
-
-#: eval.c:2116
-msgid "NF set to negative value"
-msgstr "NF impostato a un valore negativo"
-
-#: io.c:240
-#, c-format
-msgid "cannot open file `%s' for reading (%s)"
-msgstr "non riesco ad aprire file `%s' in lettura (%s)"
-
-#: io.c:320
-#, c-format
-msgid "close of fd %d (`%s') failed (%s)"
-msgstr "chiusura di fd %d (`%s') fallita (%s)"
-
-#: io.c:432
-#, c-format
-msgid "invalid tree type %s in redirect()"
-msgstr "tipo di albero invalido %s in redirect()"
-
-#: io.c:438
-#, c-format
-msgid "expression in `%s' redirection only has numeric value"
-msgstr "espressione nella re-direzione `%s' ha solo un valore numerico"
-
-#: io.c:444
-#, c-format
-msgid "expression for `%s' redirection has null string value"
-msgstr "espressione nella re-direzione `%s' ha per valore la stringa nulla"
-
-#: io.c:449
-#, c-format
-msgid "filename `%s' for `%s' redirection may be result of logical expression"
-msgstr ""
-"nome file `%s' per la re-direzione `%s' può essere il risultato di una "
-"espressione logica"
-
-#: io.c:471
-#, c-format
-msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
-msgstr "mistura non necessaria di `>' e `>>' per il file `%.*s'"
-
-#: io.c:523
-#, c-format
-msgid "can't open pipe `%s' for output (%s)"
-msgstr "non posso aprire 'pipe' `%s' in scrittura (%s)"
-
-#: io.c:532
-#, c-format
-msgid "can't open pipe `%s' for input (%s)"
-msgstr "non posso aprire 'pipe' `%s' in lettura (%s)"
-
-#: io.c:545
-#, c-format
-msgid "can't open two way socket `%s' for input/output (%s)"
-msgstr ""
-"non posso aprire 'socket' bidirezionale `%s' per lettura/scrittura (%s)"
-
-#: io.c:549
-#, c-format
-msgid "can't open two way pipe `%s' for input/output (%s)"
-msgstr "non posso aprire 'pipe' bidirezionale `%s' per lettura/scrittura (%s)"
-
-#: io.c:625
-#, c-format
-msgid "can't redirect from `%s' (%s)"
-msgstr "non posso re-dirigere da `%s' (%s)"
-
-#: io.c:628
-#, c-format
-msgid "can't redirect to `%s' (%s)"
-msgstr "non posso re-dirigere a `%s' (%s)"
-
-#: io.c:667
-msgid ""
-"reached system limit for open files: starting to multiplex file descriptors"
-msgstr ""
-"numero massimo consentito di file aperti raggiunto: comincio a riutilizzare "
-"i descrittori di file"
-
-#: io.c:679
-#, c-format
-msgid "close of `%s' failed (%s)."
-msgstr "chiusura di `%s' fallita (%s)."
-
-#: io.c:686
-msgid "too many pipes or input files open"
-msgstr "troppe 'pipe' o file di input aperti"
-
-#: io.c:709
-msgid "close: second argument must be `to' or `from'"
-msgstr "close: il secondo argomento deve essere `a' o `da'"
-
-#: io.c:723
-#, c-format
-msgid "close: `%.*s' is not an open file, pipe or co-process"
-msgstr "close: `%.*s' non è un file aperto, una 'pipe' o un co-processo"
-
-#: io.c:727
-msgid "close of redirection that was never opened"
-msgstr "chiusura di una re-direzione mai aperta"
-
-#: io.c:754
-#, c-format
-msgid "close: redirection `%s' not opened with `|&', second argument ignored"
-msgstr "close: re-direzione `%s' non aperta con `|&', ignoro secondo argomento"
-
-#: io.c:811
-#, c-format
-msgid "failure status (%d) on pipe close of `%s' (%s)"
-msgstr "errore ritornato (%d) dalla chiusura della 'pipe' `%s' (%s)"
-
-#: io.c:814
-#, c-format
-msgid "failure status (%d) on file close of `%s' (%s)"
-msgstr "errore ritornato (%d) dalla chiusura del file `%s' (%s)"
-
-#: io.c:833
-#, c-format
-msgid "no explicit close of socket `%s' provided"
-msgstr "nessuna chiusura esplicita richiesta per 'socket' `%s'"
-
-#: io.c:836
-#, c-format
-msgid "no explicit close of co-process `%s' provided"
-msgstr "nessuna chiusura esplicita richiesta per co-processo `%s'"
-
-#: io.c:839
-#, c-format
-msgid "no explicit close of pipe `%s' provided"
-msgstr "nessuna chiusura esplicita richiesta per 'pipe' `%s'"
-
-#: io.c:842
-#, c-format
-msgid "no explicit close of file `%s' provided"
-msgstr "nessuna chiusura esplicita richiesta per file `%s'"
-
-#: io.c:871 io.c:925
-#, c-format
-msgid "error writing standard output (%s)"
-msgstr "errore scrivendo 'standard output' (%s)"
-
-#: io.c:875 io.c:929
-#, c-format
-msgid "error writing standard error (%s)"
-msgstr "errore scrivendo 'standard error' (%s)"
-
-#: io.c:883
-#, c-format
-msgid "pipe flush of `%s' failed (%s)."
-msgstr "scaricamento di 'pipe' `%s' fallita (%s)."
-
-#: io.c:886
-#, c-format
-msgid "co-process flush of pipe to `%s' failed (%s)."
-msgstr "scaricamento da co-processo di 'pipe' a `%s' fallita (%s)."
-
-#: io.c:889
-#, c-format
-msgid "file flush of `%s' failed (%s)."
-msgstr "scaricamento di file `%s' fallita (%s)."
-
-#: io.c:1048
-msgid "/inet/raw client not ready yet, sorry"
-msgstr "spiacente, 'client' /inet/raw non ancora pronto"
-
-#: io.c:1050 io.c:1087
-msgid "only root may use `/inet/raw'."
-msgstr "solo root può usare `/inet/raw'."
-
-#: io.c:1085
-msgid "/inet/raw server not ready yet, sorry"
-msgstr "spiacente, 'server' /inet/raw non ancora pronto"
-
-#: io.c:1175
-#, c-format
-msgid "no (known) protocol supplied in special filename `%s'"
-msgstr "nessuno protocollo (conosciuto) specificato nel filename speciale `%s'"
-
-#: io.c:1193
-#, c-format
-msgid "special file name `%s' is incomplete"
-msgstr "nome file speciale `%s' incompleto"
-
-#: io.c:1205
-#, c-format
-msgid "local port invalid in `%s'"
-msgstr "porta locale invalida in `%s'"
-
-#: io.c:1217
-msgid "must supply a remote hostname to `/inet'"
-msgstr "va fornito nome di 'host' remoto a `/inet'"
-
-#: io.c:1232
-msgid "must supply a remote port to `/inet'"
-msgstr "va fornita porta remota a `/inet'"
-
-#: io.c:1238
-#, c-format
-msgid "remote port invalid in `%s'"
-msgstr "porta remota invalida in `%s'"
-
-#: io.c:1248
-msgid "TCP/IP communications are not supported"
-msgstr "comunicazioni TCP/IP non supportate"
-
-#: io.c:1257 io.c:1438
-#, c-format
-msgid "file `%s' is a directory"
-msgstr "file `%s' è una 'directory'"
-
-#: io.c:1327
-#, c-format
-msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
-msgstr "usa `PROCINFO[\"%s\"]' invece che `%s'"
-
-#: io.c:1359
-msgid "use `PROCINFO[...]' instead of `/dev/user'"
-msgstr "usa `PROCINFO[...]' invece che `/dev/user'"
-
-#: io.c:1424
-#, c-format
-msgid "could not open `%s', mode `%s'"
-msgstr "non riesco ad aprire `%s', modo `%s'"
-
-#: io.c:1550 io.c:1602 io.c:1732 io.c:1754
-#, c-format
-msgid "moving pipe to stdout in child failed (dup: %s)"
-msgstr "fallito passaggio di 'pipe' a 'stdout' nel processo-figlio (dup: %s)"
-
-#: io.c:1554 io.c:1607
-#, c-format
-msgid "moving pipe to stdin in child failed (dup: %s)"
-msgstr "fallito passaggio di pipe a 'stdin' nel processo-figlio (dup: %s)"
-
-#: io.c:1571 io.c:1745
-msgid "restoring stdout in parent process failed\n"
-msgstr "fallito ripristino di 'stdout' nel processo-padre\n"
-
-#: io.c:1576
-msgid "restoring stdin in parent process failed\n"
-msgstr "fallito ripristino di 'stdin' nel processo-padre\n"
-
-#: io.c:1599 io.c:1751
-#, c-format
-msgid "close of stdout in child failed (%s)"
-msgstr "fallita chiusura di 'stdout' nel processo-figlio (%s)"
-
-#: io.c:1604
-#, c-format
-msgid "close of stdin in child failed (%s)"
-msgstr "fallita chiusura di 'stdin' nel processo-figlio (%s)"
-
-#: io.c:1610 io.c:1756 io.c:1767
-#, c-format
-msgid "close of pipe failed (%s)"
-msgstr "fallita chiusura di 'pipe' (%s)"
-
-#: io.c:1655
-msgid "`|&' not supported"
-msgstr "`|&' non supportato"
-
-#: io.c:1722
-#, c-format
-msgid "cannot open pipe `%s' (%s)"
-msgstr "non riesco ad aprire 'pipe' `%s' (%s)"
-
-#: io.c:1763
-#, c-format
-msgid "cannot create child process for `%s' (fork: %s)"
-msgstr "non riesco a creare processo-figlio per `%s' (fork: %s)"
-
-#: io.c:2104
-#, c-format
-msgid "data file `%s' is empty"
-msgstr "file dati `%s' vuoto"
-
-#: io.c:2175
-#, c-format
-msgid "internal error: file `%s', line %d\n"
-msgstr "errore interno: file `%s', linea %d\n"
-
-#: io.c:2277
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "errore leggendo file di input `%s': %s"
-
-#: io.c:2521
-msgid "multicharacter value of `RS' is a gawk extension"
-msgstr "valore multicarattere per `RS' è un'estensione gawk"
-
-#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
-msgid "can't convert string to float"
-msgstr "non riesco a convertire stringa a valore in virgola mobile"
-
-#: node.c:342
-msgid "backslash at end of string"
-msgstr "'\\' a fine stringa"
-
-#: node.c:524
-msgid "POSIX does not allow `\\x' escapes"
-msgstr "POSIX non permette formato `\\x'"
-
-#: node.c:530
-msgid "no hex digits in `\\x' escape sequence"
-msgstr "niente cifre esadecimanli nel formato `\\x'"
-
-#: node.c:564
-#, c-format
-msgid "escape sequence `\\%c' treated as plain `%c'"
-msgstr " sequenza in formato `\\%c' considerata come semplice `%c'"
-
-#: re.c:208
-#, c-format
-msgid "regex match failed, not enough memory to match string \"%.*s%s\""
-msgstr ""
-"fallita ricerca di 'espressione regolare', non c'è memoria sufficiente a "
-"ricercare la stringa \"%.*s%s\""
-
-#: posix/gawkmisc.c:122
-#, c-format
-msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
-msgstr "%s %s `%s': non riesco a impostare 'close-on-exec': (fcntl: %s)"
diff --git a/po/pt_BR.gmo b/po/pt_BR.gmo
new file mode 100644
index 00000000..04b22ecf
--- /dev/null
+++ b/po/pt_BR.gmo
Binary files differ
diff --git a/po/pt_BR.po b/po/pt_BR.po
new file mode 100644
index 00000000..ef9999ca
--- /dev/null
+++ b/po/pt_BR.po
@@ -0,0 +1,1732 @@
+# 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.1l\n"
+"POT-Creation-Date: 2003-03-19 14:25+0200\n"
+"PO-Revision-Date: 2003-02-22 13:25-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:274 array.c:309 array.c:314 eval.c:494
+#, c-format
+msgid "attempt to use scalar `%s' as array"
+msgstr "tentativa de usar escalar `%s' como vetor"
+
+#: array.c:338
+#, c-format
+msgid "reference to uninitialized element `%s[\"%s\"]'"
+msgstr "referência a elemento não inicializado `%s[\"%s\"]'"
+
+#: array.c:344
+#, c-format
+msgid "subscript of array `%s' is null string"
+msgstr "índice do vetor `%s' é uma string nula"
+
+#: array.c:412 array.c:425 array.c:466
+#, c-format
+msgid "delete: index `%s' not in array `%s'"
+msgstr "delete: índice `%s' não está no vetor `%s'"
+
+#: array.c:432 array.c:515
+#, c-format
+msgid "delete: illegal use of variable `%s' as array"
+msgstr "delete: uso ilegal da variável `%s' como vetor"
+
+#: array.c:633
+#, c-format
+msgid "%s: empty (null)\n"
+msgstr "%s: vazio (nulo)\n"
+
+#: array.c:638
+#, c-format
+msgid "%s: empty (zero)\n"
+msgstr "%s: vazio (zero)\n"
+
+#: array.c:642
+#, c-format
+msgid "%s: table_size = %d, array_size = %d\n"
+msgstr "%s: table_size = %d, array_size = %d\n"
+
+#: array.c:671
+#, c-format
+msgid "%s: is parameter\n"
+msgstr "%s: é parâmetro\n"
+
+#: array.c:676
+#, c-format
+msgid "%s: array_ref to %s\n"
+msgstr "%s: array_ref para %s\n"
+
+#: array.c:975
+msgid "asort: first argument is not an array"
+msgstr "asort: primeiro argumento não é um vetor"
+
+#: array.c:984
+msgid "asort: second argument is not an array"
+msgstr "asort: segundo argumento não é um vetor"
+
+#: 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
+msgid "statement may have no effect"
+msgstr "declaração pode não ter efeito"
+
+#: awkgram.y:431 awkgram.y:451
+#, c-format
+msgid "`%s' used in %s action"
+msgstr "`%s' usado em ação %s"
+
+#: awkgram.y:444 awkgram.y:447
+msgid "`nextfile' is a gawk extension"
+msgstr "`nextfile' é uma extensão do gawk"
+
+#: awkgram.y:461
+msgid "`return' used outside function context"
+msgstr "`return' usado fora do contexto de função"
+
+#: awkgram.y:500
+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:513 awkgram.y:520
+msgid "`delete array' is a gawk extension"
+msgstr "`delete array' é uma extensão do gawk"
+
+#: awkgram.y:528 awkgram.y:535
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "`delete(array)' é uma extensão não-portável do tawk"
+
+#: awkgram.y:578
+msgid "multistage two-way pipelines don't work"
+msgstr "pipelines bidirecionais de múltiplos estágios não funcionam"
+
+#: awkgram.y:669
+msgid "regular expression on right of assignment"
+msgstr "expressão regular à direita de atribuição"
+
+#: awkgram.y:679
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "expressão regular à esquerda de operador `~' ou `!~'"
+
+#: awkgram.y:687
+msgid "regular expression on right of comparison"
+msgstr "expressão regular à direita de comparação"
+
+#: awkgram.y:754
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "`getline' não-redirecionado não é definido dentro da ação END"
+
+#: awkgram.y:781
+msgid "call of `length' without parentheses is not portable"
+msgstr "chamada a `length' sem parênteses não é portável"
+
+#: awkgram.y:784
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "chamada a `length' sem parênteses é obsoleta de acordo com POSIX"
+
+#: awkgram.y:835
+msgid "invalid subscript expression"
+msgstr "expressão de índice inválida"
+
+#: awkgram.y:1020
+msgid "unexpected newline or end of string"
+msgstr "fim de linha ou de string inesperado"
+
+#: awkgram.y:1115
+msgid "empty program text on command line"
+msgstr "texto de programa vazio na linha de comando"
+
+#: awkgram.y:1172
+#, c-format
+msgid "can't open source file `%s' for reading (%s)"
+msgstr "impossível abrir arquivo-fonte `%s' para leitura (%s)"
+
+#: awkgram.y:1207
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "impossível ler arquivo-fonte `%s' (%s)"
+
+#: awkgram.y:1215
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "arquivo-fonte `%s' está vazio"
+
+#: awkgram.y:1417 awkgram.y:1527 awkgram.y:1545 awkgram.y:1895 awkgram.y:1980
+msgid "source file does not end in newline"
+msgstr "arquivo-fonte não termina em fim-de-linha"
+
+#: awkgram.y:1481
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr "expressão regular inacabada termina com `\\' ao fim do arquivo"
+
+#: awkgram.y:1501
+msgid "unterminated regexp"
+msgstr "expressão regular inacabada"
+
+#: awkgram.y:1504
+msgid "unterminated regexp at end of file"
+msgstr "expressão regular inacabada no fim do arquivo"
+
+#: awkgram.y:1571
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr "uso da continuação de linha `\\ #...' não é portável"
+
+#: awkgram.y:1583
+msgid "backslash not last character on line"
+msgstr "`\\' não é o último caracter da linha"
+
+#: awkgram.y:1628
+msgid "POSIX does not allow operator `**='"
+msgstr "POSIX não permite o operador `**='"
+
+#: awkgram.y:1630
+msgid "old awk does not support operator `**='"
+msgstr "o velho awk não suporta o operador `**='"
+
+#: awkgram.y:1639
+msgid "POSIX does not allow operator `**'"
+msgstr "POSIX não permite o operador `**'"
+
+#: awkgram.y:1641
+msgid "old awk does not support operator `**'"
+msgstr "o velho awk não suporta o operador `**'"
+
+#: awkgram.y:1672
+msgid "operator `^=' is not supported in old awk"
+msgstr "o velho awk não suporta o operador `^='"
+
+#: awkgram.y:1680
+msgid "operator `^' is not supported in old awk"
+msgstr "o velho awk não suporta o operador `^'"
+
+#: awkgram.y:1764 awkgram.y:1781
+msgid "unterminated string"
+msgstr "string inacabada"
+
+#: awkgram.y:1941
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "caracter inválido '%c' em expressão"
+
+#: awkgram.y:2001
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "`%s' é uma extensão do gawk"
+
+#: awkgram.y:2004
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "`%s' é uma extensão da Bell Labs"
+
+#: awkgram.y:2007
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "POSIX não permite `%s'"
+
+#: awkgram.y:2011
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "`%s' não é suportado no velho awk"
+
+#: awkgram.y:2038
+msgid "`goto' considered harmful!\n"
+msgstr "`goto' é considerado danoso!\n"
+
+#: awkgram.y:2102
+#, 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:2121 awkgram.y:2124
+msgid "match: third argument is a gawk extension"
+msgstr "match: terceiro argumento é uma extensão do gawk"
+
+#: awkgram.y:2137
+#, 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:2140
+#, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "terceiro parâmetro %s não é um objeto modificável"
+
+#: awkgram.y:2167 awkgram.y:2170
+msgid "close: second argument is a gawk extension"
+msgstr "close: segundo argumento é uma extensão do gawk"
+
+#: awkgram.y:2180
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr "uso de dcgettext(_\"...\") é incorreto: remova o `_' precedente"
+
+#: awkgram.y:2195
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr "uso de dcngettext(_\"...\") é incorreto: remova o `_' precedente"
+
+#: awkgram.y:2266
+#, 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:2299
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "função `%s': parâmetro `%s' encobre variável global"
+
+#: awkgram.y:2411
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "impossível abrir `%s' para escrita (%s)"
+
+#: awkgram.y:2412 profile.c:93
+msgid "sending profile to standard error"
+msgstr "enviando perfil para saída de erros"
+
+#: awkgram.y:2442
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: `close' falhou (%s)"
+
+#: awkgram.y:2566
+msgid "shadow_funcs() called twice!"
+msgstr "shadow_funcs() chamada duas vezes!"
+
+#: awkgram.y:2593
+msgid "there were shadowed variables."
+msgstr "houve variáveis encobertas."
+
+#: awkgram.y:2666
+#, 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:2676
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "nome de função `%s' definido anteriormente"
+
+#: awkgram.y:2827 awkgram.y:2833
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "função `%s' chamada mas nunca definida"
+
+#: awkgram.y:2836
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "função `%s' definida mas nunca chamada"
+
+#: awkgram.y:2863
+#, 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:2876
+#, 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:2878
+msgid "or used as a variable or an array"
+msgstr "ou usado como uma variável ou vetor"
+
+#: builtin.c:111
+#, c-format
+msgid "%s to \"%s\" failed (%s)"
+msgstr "%s para \"%s\" falhou (%s)"
+
+#: builtin.c:112
+msgid "standard output"
+msgstr "saída padrão"
+
+#: builtin.c:113
+msgid "reason unknown"
+msgstr "motivo desconhecido"
+
+#: builtin.c:126
+msgid "exp: received non-numeric argument"
+msgstr "exp: recebeu argumento não-numérico"
+
+#: builtin.c:132
+#, c-format
+msgid "exp: argument %g is out of range"
+msgstr "exp: argumento %g está fora da faixa"
+
+#: builtin.c:190
+#, 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:193
+#, 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:205
+#, 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:299
+msgid "index: received non-string first argument"
+msgstr "index: recebeu primeiro argumento não-string"
+
+#: builtin.c:301
+msgid "index: received non-string second argument"
+msgstr "index: recebeu segundo argumento não-string"
+
+#: builtin.c:411
+msgid "int: received non-numeric argument"
+msgstr "int: recebeu argumento não-numérico"
+
+#: builtin.c:428
+msgid "length: received non-string argument"
+msgstr "length: recebeu argumento não-string"
+
+#: builtin.c:444
+msgid "log: received non-numeric argument"
+msgstr "log: recebeu argumento não-numérico"
+
+#: builtin.c:447
+#, c-format
+msgid "log: received negative argument %g"
+msgstr "log: recebeu argumento negativo %g"
+
+#: builtin.c:609 builtin.c:612
+msgid "must use `count$' on all formats or none"
+msgstr "deve usar `count$' em todos os formatos ou nenhum"
+
+#: builtin.c:714
+msgid "`$' is not permitted in awk formats"
+msgstr "`$' não é permitido em formatos awk"
+
+#: builtin.c:720
+msgid "arg count with `$' must be > 0"
+msgstr "nº de argumentos com `$' deve ser > 0"
+
+#: builtin.c:722
+#, 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:724
+msgid "`$' not permitted after period in format"
+msgstr "`$' não é permitido depois de ponto no formato"
+
+#: builtin.c:737
+msgid "no `$' supplied for positional field width or precision"
+msgstr "nenhum `$' fornecido para tamanho ou precisão de campo posicional"
+
+#: builtin.c:795
+msgid "`l' is meaningless in awk formats; ignored"
+msgstr "`l' não faz sentido em formatos awk; ignorado"
+
+#: builtin.c:799
+msgid "`l' is not permitted in POSIX awk formats"
+msgstr "`l' não é permitido em formatos POSIX awk"
+
+#: builtin.c:810
+msgid "`L' is meaningless in awk formats; ignored"
+msgstr "`L' não faz sentido em formatos awk; ignorado"
+
+#: builtin.c:814
+msgid "`L' is not permitted in POSIX awk formats"
+msgstr "`L' não é permitido em formatos POSIX awk"
+
+#: builtin.c:825
+msgid "`h' is meaningless in awk formats; ignored"
+msgstr "`h' não faz sentido em formatos awk; ignorado"
+
+#: builtin.c:829
+msgid "`h' is not permitted in POSIX awk formats"
+msgstr "`h' não é permitido em formatos POSIX awk"
+
+#: builtin.c:1078
+msgid "not enough arguments to satisfy format string"
+msgstr "argumentos insuficientes para a string de formato"
+
+#: builtin.c:1080
+msgid "^ ran out for this one"
+msgstr "^ acabou para este aqui"
+
+#: builtin.c:1085
+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:1088
+msgid "too many arguments supplied for format string"
+msgstr "excesso de argumentos para a string de formato"
+
+#: builtin.c:1154 builtin.c:1157
+msgid "printf: no arguments"
+msgstr "printf: nenhum argumento"
+
+#: builtin.c:1181
+msgid "sqrt: received non-numeric argument"
+msgstr "sqrt: recebeu argumento não-numérico"
+
+#: builtin.c:1185
+#, c-format
+msgid "sqrt: called with negative argument %g"
+msgstr "sqrt: chamada com argumento negativo %g"
+
+#: builtin.c:1207
+#, c-format
+msgid "substr: start index %g is invalid, using 1"
+msgstr "substr: posição inicial %g é inválida, usando 1"
+
+#: builtin.c:1212
+#, 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:1231
+#, c-format
+msgid "substr: length %g is <= 0"
+msgstr "substr: comprimento %g é <= 0"
+
+#: builtin.c:1233
+#, c-format
+msgid "substr: length %g is < 0"
+msgstr "substr: comprimento %g é < 0"
+
+#: builtin.c:1240
+#, c-format
+msgid "substr: non-integer length %g will be truncated"
+msgstr "substr: comprimento %g não-inteiro será truncado"
+
+#: builtin.c:1245
+#, 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:1257
+msgid "substr: source string is zero length"
+msgstr "substr: string origem tem comprimento zero"
+
+#: builtin.c:1263
+#, 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:1271
+#, 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:1306
+msgid "strftime: received non-string first argument"
+msgstr "strftime: recebeu primeiro argumento não-string"
+
+#: builtin.c:1312
+msgid "strftime: received empty format string"
+msgstr "strftime: recebeu string de formato vazia"
+
+#: builtin.c:1321
+msgid "strftime: received non-numeric second argument"
+msgstr "strftime: recebeu segundo argumento não-numérico"
+
+#: builtin.c:1384
+msgid "mktime: received non-string argument"
+msgstr "mktime: recebeu argumento não-string"
+
+#: builtin.c:1429
+msgid "system: received non-string argument"
+msgstr "system: recebeu argumento não-string"
+
+#: builtin.c:1573
+msgid "tolower: received non-string argument"
+msgstr "tolower: recebeu argumento não-string"
+
+#: builtin.c:1622
+msgid "toupper: received non-string argument"
+msgstr "toupper: recebeu argumento não-string"
+
+#: builtin.c:1667
+msgid "atan2: received non-numeric first argument"
+msgstr "atan2: recebeu primeiro argumento não-numérico"
+
+#: builtin.c:1669
+msgid "atan2: received non-numeric second argument"
+msgstr "atan2: recebeu segundo argumento não-numérico"
+
+#: builtin.c:1688
+msgid "sin: received non-numeric argument"
+msgstr "sin: recebeu argumento não-numérico"
+
+#: builtin.c:1704
+msgid "cos: received non-numeric argument"
+msgstr "cos: recebeu argumento não-numérico"
+
+#: builtin.c:1748
+msgid "srand: received non-numeric argument"
+msgstr "srand: recebeu argumento não-numérico"
+
+#: builtin.c:1787
+msgid "match: third argument is not an array"
+msgstr "match: terceiro argumento não é um vetor"
+
+#: builtin.c:2264
+msgid "gensub: 3rd argument of 0 treated as 1"
+msgstr "gensub: 3º argumento 0 tratado como 1"
+
+#: builtin.c:2375 builtin.c:2377
+msgid "lshift: received non-numeric first argument"
+msgstr "lshift: recebeu primeiro argumento não-numérico"
+
+#: builtin.c:2379
+#, c-format
+msgid "lshift(%lf, %lf): negative values will give strange results"
+msgstr "lshift(%lf, %lf): valores negativos darão resultados estranhos"
+
+#: builtin.c:2381
+#, c-format
+msgid "lshift(%lf, %lf): fractional values will be truncated"
+msgstr "lshift(%lf, %lf): valores fracionários serão truncados"
+
+#: builtin.c:2383
+#, 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:2412 builtin.c:2414
+msgid "rshift: received non-numeric first argument"
+msgstr "rshift: recebeu primeiro argumento não-numérico"
+
+#: builtin.c:2416
+#, c-format
+msgid "rshift(%lf, %lf): negative values will give strange results"
+msgstr "rshift(%lf, %lf): valores negativos darão resultados estranhos"
+
+#: builtin.c:2418
+#, c-format
+msgid "rshift(%lf, %lf): fractional values will be truncated"
+msgstr "rshift(%lf, %lf): valores fracionários serão truncados"
+
+#: builtin.c:2420
+#, 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:2449 builtin.c:2451
+msgid "and: received non-numeric first argument"
+msgstr "and: recebeu primeiro argumento não-numérico"
+
+#: builtin.c:2453
+#, c-format
+msgid "and(%lf, %lf): negative values will give strange results"
+msgstr "and(%lf, %lf): valores negativos darão resultados estranhos"
+
+#: builtin.c:2455
+#, c-format
+msgid "and(%lf, %lf): fractional values will be truncated"
+msgstr "and(%lf, %lf): valores fracionários serão truncados"
+
+#: builtin.c:2484 builtin.c:2486
+msgid "or: received non-numeric first argument"
+msgstr "or: recebeu primeiro argumento não-numérico"
+
+#: builtin.c:2488
+#, c-format
+msgid "or(%lf, %lf): negative values will give strange results"
+msgstr "or(%lf, %lf): valores negativos darão resultados estranhos"
+
+#: builtin.c:2490
+#, c-format
+msgid "or(%lf, %lf): fractional values will be truncated"
+msgstr "or(%lf, %lf): valores fracionários serão truncados"
+
+#: builtin.c:2519 builtin.c:2521
+msgid "xor: received non-numeric first argument"
+msgstr "xor: recebeu primeiro argumento não-numérico"
+
+#: builtin.c:2523
+#, c-format
+msgid "xor(%lf, %lf): negative values will give strange results"
+msgstr "xor(%lf, %lf): valores negativos darão resultados estranhos"
+
+#: builtin.c:2525
+#, c-format
+msgid "xor(%lf, %lf): fractional values will be truncated"
+msgstr "xor(%lf, %lf): valores fracionários serão truncados"
+
+#: builtin.c:2553
+msgid "compl: received non-numeric argument"
+msgstr "compl: recebeu primeiro argumento não-numérico"
+
+#: builtin.c:2555
+#, c-format
+msgid "compl(%lf): negative value will give strange results"
+msgstr "compl(%lf): valores negativos darão resultados estranhos"
+
+#: builtin.c:2557
+#, c-format
+msgid "compl(%lf): fractional value will be truncated"
+msgstr "compl(%lf): valores fracionários serão truncados"
+
+#: builtin.c:2728
+#, c-format
+msgid "dcgettext: `%s' is not a valid locale category"
+msgstr "dcgettext: `%s' não é uma categoria de \"locale\" válida"
+
+#: eval.c:262
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "tipo de nodo desconhecido %d"
+
+#: eval.c:310
+msgid "buffer overflow in genflags2str"
+msgstr "estouro de buffer em genflags2str"
+
+#: eval.c:555
+#, c-format
+msgid "for loop: array `%s' changed size from %ld to %ld during loop execution"
+msgstr ""
+
+#: eval.c:576
+msgid "`break' outside a loop is not portable"
+msgstr "`break' fora de um loop não é portável"
+
+#: eval.c:580
+msgid "`break' outside a loop is not allowed"
+msgstr "`break' fora de um loop não é permitido"
+
+#: eval.c:597
+msgid "`continue' outside a loop is not portable"
+msgstr "`continue' fora de um loop não é portável"
+
+#: eval.c:601
+msgid "`continue' outside a loop is not allowed"
+msgstr "`continue' fora de um loop não é permitido"
+
+#: eval.c:635
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "`next' não pode ser chamado de uma regra BEGIN"
+
+#: eval.c:637
+msgid "`next' cannot be called from an END rule"
+msgstr "`next' não pode ser chamado de uma regra END"
+
+#: eval.c:646
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "`nextfile' não pode ser chamado de uma regra BEGIN"
+
+#: eval.c:648
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "`nextfile' não pode ser chamado de uma regra END"
+
+#: eval.c:696
+msgid "statement has no effect"
+msgstr "declaração não tem efeito"
+
+#: eval.c:731 eval.c:761 eval.c:1733
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "referência a variável não inicializada `%s'"
+
+#: eval.c:739 eval.c:1721
+#, 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:746 eval.c:752
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "referência a argumento não inicializado `%s'"
+
+#: eval.c:810 eval.c:1728 profile.c:773
+#, c-format
+msgid "attempt to use array `%s' in a scalar context"
+msgstr "tentativa de usar vetor `%s' em um contexto escalar"
+
+#: eval.c:910
+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:935
+msgid "assignment used in conditional context"
+msgstr "atribuição usada em contexto condicional"
+
+#: eval.c:1026
+msgid "division by zero attempted"
+msgstr "tentativa de divisão por zero"
+
+#: eval.c:1041
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "tentativa de divisão por zero em `%%'"
+
+#: eval.c:1056 profile.c:649
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "tipo ilegal (%s) em tree_eval"
+
+#: eval.c:1232
+msgid "division by zero attempted in `/='"
+msgstr "tentativa de divisão por zero em `/='"
+
+#: eval.c:1250
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "tentativa de divisão por zero em `%%='"
+
+#: eval.c:1510
+#, c-format
+msgid "%s (from %s)"
+msgstr "%s (de %s)"
+
+#: eval.c:1569
+#, c-format
+msgid "function `%s' called with more arguments than declared"
+msgstr "função `%s' chamada com mais argumentos que os declarados"
+
+#: eval.c:1628
+#, c-format
+msgid "function `%s' not defined"
+msgstr "função `%s' não definida"
+
+#: eval.c:1634
+#, c-format
+msgid "function %s called\n"
+msgstr "função %s chamada\n"
+
+#: eval.c:1693
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# Pilha de Chamadas de Função:\n"
+"\n"
+
+#: eval.c:1696
+msgid "\t# -- main --\n"
+msgstr "\t# -- main --\n"
+
+#: eval.c:1850
+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:1852
+msgid "attempt to reference from null string"
+msgstr "tentativa de referência a partir de string nula"
+
+#: eval.c:1858
+#, c-format
+msgid "attempt to access field %d"
+msgstr "tentativa de acessar campo %d"
+
+#: eval.c:1874
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr "tentativa de usar parâmetro escalar `%s' como vetor"
+
+#: eval.c:1886 eval.c:1893 profile.c:865
+msgid "assignment is not allowed to result of builtin function"
+msgstr "atribuição não pode resultar de funções intrínsecas"
+
+#: eval.c:1941
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "`IGNORECASE' é uma extensão do gawk"
+
+#: eval.c:1970
+msgid "`BINMODE' is a gawk extension"
+msgstr "`BINMODE' é uma extensão do gawk"
+
+#: eval.c:2082
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "especificação `%sFMT' inválida `%s'"
+
+#: eval.c:2160
+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:181
+msgid "Operation Not Supported"
+msgstr "Operação Não Suportada"
+
+#: field.c:321
+msgid "NF set to negative value"
+msgstr "valor negativo atribuído a NF"
+
+#: field.c:819
+msgid "split: second argument is not an array"
+msgstr "split: segundo argumento não é um vetor"
+
+#: field.c:854
+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:906
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "`FIELDWIDTHS' é uma extensão do gawk"
+
+#: field.c:933
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "campo %d em FIELDWIDTHS deve ser > 0"
+
+#: field.c:1006
+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:431
+#, 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:257
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "impossível abrir arquivo `%s' para leitura (%s)"
+
+#: io.c:344
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "fechamento do descritor %d (`%s') falhou (%s)"
+
+#: io.c:482
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "tipo de árvore %s inválido em redirect()"
+
+#: io.c:488
+#, c-format
+msgid "expression in `%s' redirection only has numeric value"
+msgstr "expressão no redirecionamento `%s' só tem valor numérico"
+
+#: io.c:494
+#, c-format
+msgid "expression for `%s' redirection has null string value"
+msgstr "expressão para o redirecionamento `%s' tem valor string nulo"
+
+#: io.c:499
+#, 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:521
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "mistura desnecessária de `>' e `>>' para arquivo `%.*s'"
+
+#: io.c:573
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "impossível abrir pipe `%s' para saída (%s)"
+
+#: io.c:582
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "impossível abrir pipe `%s' para entrada (%s)"
+
+#: io.c:595
+#, 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:599
+#, 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:675
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "impossível redirecionar de `%s' (%s)"
+
+#: io.c:678
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "impossível redirecionar para `%s' (%s)"
+
+#: io.c:717
+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:729
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "fechamento de `%s' falhou (%s)"
+
+#: io.c:736
+msgid "too many pipes or input files open"
+msgstr "excesso de pipes ou arquivos de entrada abertos"
+
+#: io.c:759
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: segundo argumento deve ser `to' ou `from'"
+
+#: io.c:773
+#, 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:777
+msgid "close of redirection that was never opened"
+msgstr "fechamento de redirecionamento que nunca foi aberto"
+
+#: io.c:804
+#, 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:866
+#, 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:869
+#, 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:888
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "fechamento explícito do socket `%s' não fornecido"
+
+#: io.c:891
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "fechamento explícito do co-processo `%s' não fornecido"
+
+#: io.c:894
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "fechamento explícito do pipe `%s' não fornecido"
+
+#: io.c:897
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "fechamento explícito do arquivo `%s' não fornecido"
+
+#: io.c:926 io.c:980
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "erro ao escrever na saída padrão (%s)"
+
+#: io.c:930 io.c:984
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "erro ao escrever na saída padrão de erros (%s)"
+
+#: io.c:938
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr ""
+
+#: io.c:941
+#, c-format
+msgid "co-process flush of pipe to `%s' failed (%s)."
+msgstr ""
+
+#: io.c:944
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr ""
+
+#: io.c:1103
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "infelizmente, o cliente de /inet/raw não está concluído"
+
+#: io.c:1105 io.c:1142
+msgid "only root may use `/inet/raw'."
+msgstr "apenas root pode usar `/inet/raw'."
+
+#: io.c:1140
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "infelizmente, o servidor de /inet/raw não está concluído"
+
+#: io.c:1230
+#, c-format
+msgid "no (known) protocol supplied in special filename `%s'"
+msgstr ""
+"nenhum protocolo (conhecido) fornecido em nome de arquivo especial `%s'"
+
+#: io.c:1248
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "nome de arquivo especial `%s' está incompleto"
+
+#: io.c:1260
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "porta local inválida em `%s'"
+
+#: io.c:1272
+msgid "must supply a remote hostname to `/inet'"
+msgstr "deve ser fornecido um nome de host remoto para `/inet'"
+
+#: io.c:1287
+msgid "must supply a remote port to `/inet'"
+msgstr "deve ser fornecida uma porta remota para `/inet'"
+
+#: io.c:1293
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "porta remota inválida em `%s'"
+
+#: io.c:1303
+msgid "TCP/IP communications are not supported"
+msgstr "comunicação TCP/IP não é suportada"
+
+#: io.c:1312 io.c:1492
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "arquivo `%s' é um diretório"
+
+#: io.c:1381
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "use `PROCINFO[\"%s\"]' em vez de `%s'"
+
+#: io.c:1413
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "use `PROCINFO[...]' em vez de `/dev/user'"
+
+#: io.c:1478 io.c:1652
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "impossível abrir `%s', modo `%s'"
+
+#: io.c:1703
+#, c-format
+msgid "close of master pty failed (%s)"
+msgstr "falha ao fechar pty mestre (%s)"
+
+#: io.c:1705 io.c:1857 io.c:2009
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "falha ao fechar stdout em filho (%s)"
+
+#: io.c:1708
+#, 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:1710 io.c:1862
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "falha ao fechar stdin em filho (%s)"
+
+#: io.c:1713
+#, 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:1715 io.c:1734
+#, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "falha ao fechar pty escrava (%s)"
+
+#: io.c:1808 io.c:1860 io.c:1990 io.c:2012
+#, 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:1812 io.c:1865
+#, 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:1829 io.c:2003
+msgid "restoring stdout in parent process failed\n"
+msgstr "falha ao restaurar stdout em processo pai\n"
+
+#: io.c:1834
+msgid "restoring stdin in parent process failed\n"
+msgstr "falha ao restaurar stdin em processo pai\n"
+
+#: io.c:1868 io.c:2014 io.c:2025
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "falha ao fechar pipe (%s)"
+
+#: io.c:1913
+msgid "`|&' not supported"
+msgstr "`|&' não suportado"
+
+#: io.c:1980
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "impossível abrir pipe `%s' (%s)"
+
+#: io.c:2021
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr "impossível criar processo filho para `%s' (fork: %s)"
+
+#: io.c:2364
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "arquivo de dados `%s' vazio"
+
+#: io.c:2407 io.c:2415
+msgid "could not allocate more input memory"
+msgstr ""
+
+#: io.c:2540 io.c:2782 io.c:3046
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "erro ao ler arquivo de entrada `%s': %s"
+
+#: io.c:3281
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "valor de múltiplos caracteres para `RS' é uma extensão do gawk"
+
+#: main.c:322
+msgid "`-m[fr]' option irrelevant in gawk"
+msgstr "opção `-m[fr] é irrelevante no gawk"
+
+#: main.c:324
+msgid "-m option usage: `-m[fr] nnn'"
+msgstr "uso da opção -m: `-m[fr] nnn'"
+
+#: main.c:341
+#, c-format
+msgid "%s: option `-W %s' unrecognized, ignored\n"
+msgstr "%s: opção `-W %s' não reconhecida, ignorada\n"
+
+#: main.c:378
+msgid "empty argument to `--source' ignored"
+msgstr "argumento vazio para --source ignorado"
+
+#: main.c:448
+msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
+msgstr "variável de ambiente `POSIXLY_CORRECT' ativada: ligando `--posix'"
+
+#: main.c:453
+msgid "`--posix' overrides `--traditional'"
+msgstr "`--posix' sobrepõe `--traditional'"
+
+#: main.c:464
+msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
+msgstr "`--posix'/`--traditional' sobrepõe `--non-decimal-data'"
+
+#: main.c:468
+#, 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:509
+#, c-format
+msgid "can't set binary mode on stdin (%s)"
+msgstr "impossível ativar modo binário em stdin (%s)"
+
+#: main.c:512
+#, c-format
+msgid "can't set binary mode on stdout (%s)"
+msgstr "impossível ativar modo binário em stdout (%s)"
+
+#: main.c:514
+#, c-format
+msgid "can't set binary mode on stderr (%s)"
+msgstr "impossível ativar modo binário em stderr (%s)"
+
+#: main.c:544
+msgid "no program text at all!"
+msgstr "nenhum texto de programa"
+
+#: main.c:612
+#, 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:614
+#, 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:619
+msgid "POSIX options:\t\tGNU long options:\n"
+msgstr "Opções POSIX: \t\tOpções longas GNU:\n"
+
+#: main.c:620
+msgid "\t-f progfile\t\t--file=progfile\n"
+msgstr "\t-f arqprog \t\t--file=arqprog\n"
+
+#: main.c:621
+msgid "\t-F fs\t\t\t--field-separator=fs\n"
+msgstr "\t-F fs\t\t\t--field-separator=fs\n"
+
+#: main.c:622
+msgid "\t-v var=val\t\t--assign=var=val\n"
+msgstr "\t-v var=val\t\t--assign=var=val\n"
+
+#: main.c:623
+msgid "\t-m[fr] val\n"
+msgstr "\t-m[fr] val\n"
+
+#: main.c:624
+msgid "\t-W compat\t\t--compat\n"
+msgstr "\t-W compat\t\t--compat\n"
+
+#: main.c:625
+msgid "\t-W copyleft\t\t--copyleft\n"
+msgstr "\t-W copyleft\t\t--copyleft\n"
+
+#: main.c:626
+msgid "\t-W copyright\t\t--copyright\n"
+msgstr "\t-W copyright\t\t--copyright\n"
+
+#: main.c:627
+msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
+msgstr "\t-W dump-variables[=arq] \t--dump-variables[=arq]\n"
+
+#: main.c:628
+msgid "\t-W gen-po\t\t--gen-po\n"
+msgstr "\t-W gen-po\t\t--gen-po\n"
+
+#: main.c:629
+msgid "\t-W help\t\t\t--help\n"
+msgstr "\t-W help\t\t\t--help\n"
+
+#: main.c:630
+msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
+
+#: main.c:631
+msgid "\t-W lint-old\t\t--lint-old\n"
+msgstr "\t-W lint-old\t\t--lint-old\n"
+
+#: main.c:632
+msgid "\t-W non-decimal-data\t--non-decimal-data\n"
+msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
+
+#: main.c:634
+msgid "\t-W nostalgia\t\t--nostalgia\n"
+msgstr "\t-W nostalgia\t\t--nostalgia\n"
+
+#: main.c:637
+msgid "\t-W parsedebug\t\t--parsedebug\n"
+msgstr "\t-W parsedebug\t\t--parsedebug\n"
+
+#: main.c:639
+msgid "\t-W profile[=file]\t--profile[=file]\n"
+msgstr "\t-W profile[=arq] \t--profile[=arq]\n"
+
+#: main.c:640
+msgid "\t-W posix\t\t--posix\n"
+msgstr "\t-W posix\t\t--posix\n"
+
+#: main.c:641
+msgid "\t-W re-interval\t\t--re-interval\n"
+msgstr "\t-W re-interval\t\t--re-interval\n"
+
+#: main.c:642
+msgid "\t-W source=program-text\t--source=program-text\n"
+msgstr "\t-W source=program-text\t--source=program-text\n"
+
+#: main.c:643
+msgid "\t-W traditional\t\t--traditional\n"
+msgstr "\t-W traditional\t\t--traditional\n"
+
+#: main.c:644
+msgid "\t-W usage\t\t--usage\n"
+msgstr "\t-W usage\t\t--usage\n"
+
+#: main.c:645
+msgid "\t-W version\t\t--version\n"
+msgstr "\t-W version\t\t--version\n"
+
+#: main.c:649
+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:653
+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:657
+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:669
+#, 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:677
+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:683
+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:713
+msgid "-Ft does not set FS to tab in POSIX awk"
+msgstr "-Ft não faz FS ser tab no awk POSIX"
+
+#: main.c:944
+#, 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:964
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr "`%s' não é um nome legal de variável"
+
+#: main.c:967
+#, 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:995
+msgid "floating point exception"
+msgstr "exceção de ponto flutuante"
+
+#: main.c:1002
+msgid "fatal error: internal error"
+msgstr "erro fatal: erro interno"
+
+#: main.c:1052
+#, c-format
+msgid "no pre-opened fd %d"
+msgstr "nenhum descritor pré-aberto %d"
+
+#: main.c:1057
+#, c-format
+msgid "could not pre-open /dev/null for fd %d"
+msgstr "impossível pré-abrir /dev/null para descritor %d"
+
+#: main.c:1080 main.c:1089
+#, 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:59 node.c:66 node.c:75 node.c:89 node.c:116
+msgid "can't convert string to float"
+msgstr "impossível converter string para float"
+
+#: node.c:357
+msgid "backslash at end of string"
+msgstr "barra invertida (\\) no fim da string"
+
+#: node.c:544
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX não permite escapes do tipo `\\x'"
+
+#: node.c:550
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "nenhum dígito hexa em seqüência de escape `\\x'"
+
+#: node.c:584
+#, 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 ""
+
+#: profile.c:91
+#, c-format
+msgid "could not open `%s' for writing: %s"
+msgstr ""
+
+#: profile.c:409
+msgid "internal error: Node_var with null vname"
+msgstr ""
+
+#: profile.c:471
+msgid "# treated internally as `delete'"
+msgstr ""
+
+#: profile.c:545
+msgid "internal error: Node_var_array with null vname"
+msgstr ""
+
+#: profile.c:1127
+#, c-format
+msgid "\t# gawk profile, created %s\n"
+msgstr ""
+
+#: profile.c:1130
+msgid ""
+"\t# BEGIN block(s)\n"
+"\n"
+msgstr ""
+
+#: profile.c:1140
+msgid ""
+"\t# Rule(s)\n"
+"\n"
+msgstr ""
+
+#: profile.c:1146
+msgid ""
+"\t# END block(s)\n"
+"\n"
+msgstr ""
+
+#: profile.c:1166
+msgid ""
+"\n"
+"\t# Functions, listed alphabetically\n"
+msgstr ""
+
+#: profile.c:1376
+#, 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 "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"
diff --git a/po/quot.sed b/po/quot.sed
deleted file mode 100644
index 0122c463..00000000
--- a/po/quot.sed
+++ /dev/null
@@ -1,6 +0,0 @@
-s/"\([^"]*\)"/“\1â€/g
-s/`\([^`']*\)'/‘\1’/g
-s/ '\([^`']*\)' / ‘\1’ /g
-s/ '\([^`']*\)'$/ ‘\1’/g
-s/^'\([^`']*\)' /‘\1’ /g
-s/“â€/""/g
diff --git a/po/sv.gmo b/po/sv.gmo
index 1864923f..12c7aefa 100644
--- a/po/sv.gmo
+++ b/po/sv.gmo
Binary files differ
diff --git a/po/sv.po b/po/sv.po
index a9699c63..3e79e7b0 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -1,417 +1,892 @@
# Swedish translation of gawk
-# Copyright (C) 2001 Free Software Foundation, Inc.
-# Martin Sjögren <md9ms@mdstud.chalmers.se>, 2001.
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# Martin Sjögren <md9ms@mdstud.chalmers.se>, 2001-2002.
#
-# $Id: sv.po,v 1.18 2002/01/14 09:09:22 martin Exp $
+# $Id: sv.po,v 1.23 2003/02/27 18:54:30 martin Exp $
#
msgid ""
msgstr ""
-"Project-Id-Version: gawk 3.1.31\n"
-"POT-Creation-Date: 2002-05-01 16:40+0300\n"
-"PO-Revision-Date: 2002-01-14 10:09+0100\n"
+"Project-Id-Version: gawk 3.1.1m\n"
+"POT-Creation-Date: 2003-03-19 14:25+0200\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:243 array.c:275 array.c:280 eval.c:483
+#: array.c:274 array.c:309 array.c:314 eval.c:494
#, c-format
msgid "attempt to use scalar `%s' as array"
msgstr "försök att använda skalären \"%s\" som vektor"
-#: array.c:304
+#: array.c:338
#, c-format
msgid "reference to uninitialized element `%s[\"%s\"]'"
msgstr "referens till ickeinitierat element \"%s[\"%s\"]\""
-#: array.c:310
+#: array.c:344
#, c-format
msgid "subscript of array `%s' is null string"
msgstr "index i vektorn \"%s\" är en tom sträng"
-#: array.c:373 array.c:456
-#, c-format
-msgid "delete: illegal use of variable `%s' as array"
-msgstr "delete: otillåten användning av variabeln \"%s\" som vektor"
-
-#: array.c:406
+#: array.c:412 array.c:425 array.c:466
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete: index \"%s\" finns inte i vektorn \"%s\""
-#: array.c:571
+#: array.c:432 array.c:515
+#, c-format
+msgid "delete: illegal use of variable `%s' as array"
+msgstr "delete: otillåten användning av variabeln \"%s\" som vektor"
+
+#: array.c:633
#, c-format
msgid "%s: empty (null)\n"
msgstr "%s: tom (null)\n"
-#: array.c:576
+#: array.c:638
#, c-format
msgid "%s: empty (zero)\n"
msgstr "%s: tom (noll)\n"
-#: array.c:580
+#: array.c:642
#, c-format
msgid "%s: table_size = %d, array_size = %d\n"
msgstr "%s: tabellstorlek = %d, vektorstorlek = %d\n"
-#: array.c:612
-#, fuzzy, c-format
+#: array.c:671
+#, c-format
msgid "%s: is parameter\n"
msgstr "%s: är en parameter\n"
-#: array.c:617
+#: array.c:676
#, c-format
msgid "%s: array_ref to %s\n"
msgstr "%s: vektorreferens till %s\n"
-#: array.c:844
+#: array.c:975
msgid "asort: first argument is not an array"
msgstr "asort: första argumentet är inte en vektor"
-#: array.c:853
+#: array.c:984
msgid "asort: second argument is not an array"
msgstr "asort: andra argumentet är inte en vektor"
-#: builtin.c:107
+#: 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
+msgid "statement may have no effect"
+msgstr "kommandot kanske inte har någon effekt"
+
+#: awkgram.y:431 awkgram.y:451
+#, c-format
+msgid "`%s' used in %s action"
+msgstr "\"%s\" använd i %s-åtgärden"
+
+#: awkgram.y:444 awkgram.y:447
+msgid "`nextfile' is a gawk extension"
+msgstr "\"nextfile\" är en gawk-utökning"
+
+#: awkgram.y:461
+msgid "`return' used outside function context"
+msgstr "\"return\" använd utanför funktion"
+
+#: awkgram.y:500
+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:513 awkgram.y:520
+msgid "`delete array' is a gawk extension"
+msgstr "\"delete array\" är en gawk-utökning"
+
+#: awkgram.y:528 awkgram.y:535
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "\"delete(array)\" är en icke portabel tawk-utökning"
+
+#: awkgram.y:578
+msgid "multistage two-way pipelines don't work"
+msgstr "flerstegs dubbelriktade rör fungerar inte"
+
+#: awkgram.y:669
+msgid "regular expression on right of assignment"
+msgstr "reguljärt uttryck i högerledet av en tilldelning"
+
+#: awkgram.y:679
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "reguljärt uttryck på vänster sida om en \"~\"- eller \"!~\"-operator"
+
+#: awkgram.y:687
+msgid "regular expression on right of comparison"
+msgstr "reguljärt uttryck i högerledet av en jämförelse"
+
+#: awkgram.y:754
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "icke omdirigerad \"getline\" odefinierad inuti END-åtgärd"
+
+#: awkgram.y:781
+msgid "call of `length' without parentheses is not portable"
+msgstr "anrop av \"length\" utan parenteser är inte portabelt"
+
+#: awkgram.y:784
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "anrop av \"length\" utan parenteser är föråldrat enligt POSIX"
+
+#: awkgram.y:835
+msgid "invalid subscript expression"
+msgstr "ogiltig indexuttryck"
+
+#: awkgram.y:1020
+msgid "unexpected newline or end of string"
+msgstr "oväntat nyradstecken eller slut på strängen"
+
+#: awkgram.y:1115
+msgid "empty program text on command line"
+msgstr "tom programtext på kommandoraden"
+
+#: awkgram.y:1172
+#, 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:1207
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "kan inte läsa källfilen \"%s\" (%s)"
+
+#: awkgram.y:1215
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "källfilen \"%s\" är tom"
+
+#: awkgram.y:1417 awkgram.y:1527 awkgram.y:1545 awkgram.y:1895 awkgram.y:1980
+msgid "source file does not end in newline"
+msgstr "källfilen slutar inte med en ny rad"
+
+#: awkgram.y:1481
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr "oavslutat reguljärt uttryck slutar med \"\\\" i slutet av filen"
+
+#: awkgram.y:1501
+msgid "unterminated regexp"
+msgstr "oavslutat reguljärt uttryck"
+
+#: awkgram.y:1504
+msgid "unterminated regexp at end of file"
+msgstr "oavslutat reguljärt uttryck i slutet av filen"
+
+#: awkgram.y:1571
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr "Användning av \"\\ #...\" för radfortsättning är inte portabelt"
+
+#: awkgram.y:1583
+msgid "backslash not last character on line"
+msgstr "sista tecknet på raden är inte ett omvänt snedstreck"
+
+#: awkgram.y:1628
+msgid "POSIX does not allow operator `**='"
+msgstr "POSIX tillåter inte operatorn \"**=\""
+
+#: awkgram.y:1630
+msgid "old awk does not support operator `**='"
+msgstr "gamla awk stöder inte operatorn \"**=\""
+
+#: awkgram.y:1639
+msgid "POSIX does not allow operator `**'"
+msgstr "POSIX tillåter inte operatorn \"**\""
+
+#: awkgram.y:1641
+msgid "old awk does not support operator `**'"
+msgstr "gamla awk stöder inte operatorn \"**\""
+
+#: awkgram.y:1672
+msgid "operator `^=' is not supported in old awk"
+msgstr "operatorn \"^=\" stöds inte i gamla awk"
+
+#: awkgram.y:1680
+msgid "operator `^' is not supported in old awk"
+msgstr "operatorn \"^\" stöds inte i gamla awk"
+
+#: awkgram.y:1764 awkgram.y:1781
+msgid "unterminated string"
+msgstr "oavslutad sträng"
+
+#: awkgram.y:1941
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "ogiltigt tecken \"%c\" i uttryck"
+
+#: awkgram.y:2001
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "\"%s\" är en gawk-utökning"
+
+#: awkgram.y:2004
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "\"%s\" är en Bell Labs-utökning"
+
+#: awkgram.y:2007
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "POSIX tillåter inte \"%s\""
+
+#: awkgram.y:2011
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "\"%s\" stöds inte i gamla awk"
+
+#: awkgram.y:2038
+msgid "`goto' considered harmful!\n"
+msgstr "\"goto\" anses skadlig!\n"
+
+#: awkgram.y:2102
+#, c-format
+msgid "%d is invalid as number of arguments for %s"
+msgstr "%d är ett ogiltigt antal argument för %s"
+
+#: awkgram.y:2121 awkgram.y:2124
+msgid "match: third argument is a gawk extension"
+msgstr "match: tredje argumentet är en gawk-utökning"
+
+#: awkgram.y:2137
+#, 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:2140
+#, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "%s: tredje argumentet är inte ett ändringsbart objekt"
+
+#: awkgram.y:2167 awkgram.y:2170
+msgid "close: second argument is a gawk extension"
+msgstr "close: andra argumentet är en gawk-utökning"
+
+#: awkgram.y:2180
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"användandet av dcgettext(_\"...\") är felaktigt: ta bort det inledande "
+"understrykningstecknet"
+
+#: awkgram.y:2195
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr ""
+"användandet av dcngettext(_\"...\") är felaktigt: ta bort det inledande "
+"understrykningstecknet"
+
+#: awkgram.y:2266
+#, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "funktionen \"%s\": parameter %d, \"%s\", är samma som parameter %d"
+
+#: awkgram.y:2299
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "funktionen \"%s\": parametern \"%s\" överskuggar en global variabel"
+
+#: awkgram.y:2411
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "kunde inte öpnna \"%s\" för skrivning (%s)"
+
+#: awkgram.y:2412 profile.c:93
+msgid "sending profile to standard error"
+msgstr "skickar profilen till standard fel"
+
+#: awkgram.y:2442
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: misslyckades att stänga (%s)"
+
+#: awkgram.y:2566
+msgid "shadow_funcs() called twice!"
+msgstr "shadow_funcs() anropad två gånger!"
+
+#: awkgram.y:2593
+msgid "there were shadowed variables."
+msgstr "det fanns överskuggade variabler."
+
+#: awkgram.y:2666
+#, 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:2676
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "funktionsnamnet \"%s\" är definierat sedan tidigare"
+
+#: awkgram.y:2827 awkgram.y:2833
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "funktionen \"%s\" anropad men aldrig definierad"
+
+#: awkgram.y:2836
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "funktionen \"%s\" definierad men aldrig anropad"
+
+#: awkgram.y:2863
+#, 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:2876
+#, 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:2878
+msgid "or used as a variable or an array"
+msgstr "eller använd som variabel eller vektor"
+
+#: builtin.c:111
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "%s till \"%s\" misslyckades (%s)"
-#: builtin.c:108
+#: builtin.c:112
msgid "standard output"
msgstr "standard ut"
-#: builtin.c:109
+#: builtin.c:113
msgid "reason unknown"
msgstr "okänd anledning"
-#: builtin.c:122
+#: builtin.c:126
msgid "exp: received non-numeric argument"
msgstr "exp: fick ett ickenumeriskt argument"
-#: builtin.c:128
+#: builtin.c:132
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: argumentet %g är inte inom tillåten gräns"
-#: builtin.c:186
+#: builtin.c:190
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: kan inte spola: röret \"%s\" öppnat för läsning, inte skrivning"
-#: builtin.c:189
+#: builtin.c:193
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush: kan inte spola: filen \"%s\" öppnad för läsning, inte skrivning"
-#: builtin.c:201
+#: builtin.c:205
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "fflush: \"%s\" är inte en öppen fil, rör eller koprocess"
-#: builtin.c:295
+#: builtin.c:299
msgid "index: received non-string first argument"
msgstr "index: första argumentet är inte en sträng"
-#: builtin.c:297
+#: builtin.c:301
msgid "index: received non-string second argument"
msgstr "index: andra argumentet är inte en sträng"
-#: builtin.c:407
+#: builtin.c:411
msgid "int: received non-numeric argument"
msgstr "int: fick ett ickenumeriskt argument"
-#: builtin.c:424
+#: builtin.c:428
msgid "length: received non-string argument"
msgstr "length: fick ett argument som inte är en sträng"
-#: builtin.c:440
+#: builtin.c:444
msgid "log: received non-numeric argument"
msgstr "log: fick ett ickenumeriskt argument"
-#: builtin.c:443
+#: builtin.c:447
#, c-format
msgid "log: received negative argument %g"
msgstr "log: fick ett negativt argumentet %g"
-#: builtin.c:605 builtin.c:608
+#: builtin.c:609 builtin.c:612
msgid "must use `count$' on all formats or none"
-msgstr ""
+msgstr "måste använda \"count$\" på alla eller inga format"
-#: builtin.c:703
+#: builtin.c:714
msgid "`$' is not permitted in awk formats"
msgstr "\"$\" tillåts inte i awkformat"
-#: builtin.c:709
+#: builtin.c:720
msgid "arg count with `$' must be > 0"
msgstr "argumentantalet med \"$\" måste vara > 0"
-#: builtin.c:711
+#: builtin.c:722
#, c-format
-msgid "arg count %d greater than total number of supplied arguments"
-msgstr "argumentantalet %d är större än antalet givna argument"
+msgid "arg count %ld greater than total number of supplied arguments"
+msgstr "argumentantalet %ld är större än antalet givna argument"
-#: builtin.c:713
+#: builtin.c:724
msgid "`$' not permitted after period in format"
msgstr "\"$\" tillåts inte efter en punkt i formatet"
-#: builtin.c:726
+#: builtin.c:737
msgid "no `$' supplied for positional field width or precision"
msgstr "inget \"$\" bifogat för positionsangiven fältbredd eller precision"
-#: builtin.c:784
+#: builtin.c:795
msgid "`l' is meaningless in awk formats; ignored"
msgstr "\"l\" är meningslös i awk-format, ignorerad"
-#: builtin.c:788
+#: builtin.c:799
msgid "`l' is not permitted in POSIX awk formats"
msgstr "\"l\" tillåts inte i POSIX awk-format"
-#: builtin.c:799
+#: builtin.c:810
msgid "`L' is meaningless in awk formats; ignored"
msgstr "\"L\" är meningslös i awk-format, ignorerad"
-#: builtin.c:803
+#: builtin.c:814
msgid "`L' is not permitted in POSIX awk formats"
msgstr "\"L\" tillåts inte i POSIX awk-format"
-#: builtin.c:814
+#: builtin.c:825
msgid "`h' is meaningless in awk formats; ignored"
msgstr "\"h\" är meningslös i awk-format, ignorerad"
-#: builtin.c:818
+#: builtin.c:829
msgid "`h' is not permitted in POSIX awk formats"
msgstr "\"h\" tillåts inte i POSIX awk-format"
-#: builtin.c:1067
+#: builtin.c:1078
msgid "not enough arguments to satisfy format string"
msgstr "för få argument för formatsträngen"
-#: builtin.c:1069
+#: builtin.c:1080
msgid "^ ran out for this one"
msgstr "^ tog slut här"
-#: builtin.c:1074
+#: builtin.c:1085
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf: formatspecifieraren har ingen kommandobokstav"
-#: builtin.c:1077
+#: builtin.c:1088
msgid "too many arguments supplied for format string"
msgstr "för många argument för formatsträngen"
-#: builtin.c:1120 builtin.c:1123
+#: builtin.c:1154 builtin.c:1157
msgid "printf: no arguments"
msgstr "printf: inga argument"
-#: builtin.c:1156
+#: builtin.c:1181
msgid "sqrt: received non-numeric argument"
msgstr "sqrt: fick ickenumeriskt argument"
-#: builtin.c:1160
+#: builtin.c:1185
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: anropad med negativt argument %g"
-#: builtin.c:1182
+#: builtin.c:1207
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: startindex %g är ogiltigt, använder 1"
-#: builtin.c:1187
+#: builtin.c:1212
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr "substr: startindex %g som inte är ett heltal kommer trunkeras"
-#: builtin.c:1201
+#: builtin.c:1231
#, c-format
msgid "substr: length %g is <= 0"
msgstr "substr: längden %g är <= 0"
-#: builtin.c:1207
+#: builtin.c:1233
+#, c-format
+msgid "substr: length %g is < 0"
+msgstr "substr: längden %g är < 0"
+
+#: builtin.c:1240
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: längden %g som inte är ett heltal kommer trunkeras"
-#: builtin.c:1214
+#: builtin.c:1245
+#, 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:1257
msgid "substr: source string is zero length"
msgstr "substr: källsträngen är tom"
-#: builtin.c:1221
+#: builtin.c:1263
#, c-format
-msgid ""
-"substr: length %d at start index %d exceeds length of first argument (%d)"
-msgstr ""
-"substr: längden %d vid startindex %d överskrider längden av första "
-"argumentet (%d)"
+msgid "substr: start index %g is past end of string"
+msgstr "substr: startindex %g är bortom strängens slut"
-#: builtin.c:1227
+#: builtin.c:1271
#, c-format
-msgid "substr: start index %d is past end of string"
-msgstr "substr: startindex %d är bortom slutet på strängen"
+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:1263
-#, fuzzy
+#: builtin.c:1306
msgid "strftime: received non-string first argument"
msgstr "strftime: fick ett första argument som inte är en sträng"
-#: builtin.c:1269
+#: builtin.c:1312
msgid "strftime: received empty format string"
msgstr "strftime: fick en tom formatsträng"
-#: builtin.c:1278
-#, fuzzy
+#: builtin.c:1321
msgid "strftime: received non-numeric second argument"
msgstr "strftime: fick ett ickenumeriskt andra argument"
-#: builtin.c:1341
+#: builtin.c:1384
msgid "mktime: received non-string argument"
msgstr "mktime: fick ett argument som inte är en sträng"
-#: builtin.c:1386
-#, fuzzy
+#: builtin.c:1429
msgid "system: received non-string argument"
msgstr "system: fick ett argument som inte är en sträng"
-#: builtin.c:1512
-#, fuzzy
+#: builtin.c:1573
msgid "tolower: received non-string argument"
msgstr "tolower: fick ett argument som inte är en sträng"
-#: builtin.c:1561
-#, fuzzy
+#: builtin.c:1622
msgid "toupper: received non-string argument"
msgstr "toupper: fick ett argument som inte är en sträng"
-#: builtin.c:1606
+#: builtin.c:1667
msgid "atan2: received non-numeric first argument"
msgstr "atan2: fick ett ickenumeriskt första argument"
-#: builtin.c:1608
+#: builtin.c:1669
msgid "atan2: received non-numeric second argument"
msgstr "atan2: fick ett ickenumeriskt andra argument"
-#: builtin.c:1627
+#: builtin.c:1688
msgid "sin: received non-numeric argument"
msgstr "sin: fick ett ickenumeriskt argument"
-#: builtin.c:1643
+#: builtin.c:1704
msgid "cos: received non-numeric argument"
msgstr "cos: fick ett ickenumeriskt argument"
-#: builtin.c:1687
+#: builtin.c:1748
msgid "srand: received non-numeric argument"
msgstr "srand: fick ett ickenumeriskt argument"
-#: builtin.c:1721
+#: builtin.c:1787
msgid "match: third argument is not an array"
msgstr "match: tredje argumentet är inte en vektor"
-#: builtin.c:2157
+#: builtin.c:2264
msgid "gensub: 3rd argument of 0 treated as 1"
msgstr "gensub: Nollan i tredje argumentet behandlad som en etta"
-#: builtin.c:2268 builtin.c:2270
+#: builtin.c:2375 builtin.c:2377
msgid "lshift: received non-numeric first argument"
msgstr "lshift: fick ett ickenumeriskt första argument"
-#: builtin.c:2272
+#: builtin.c:2379
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr "lshift(%lf, %lf): negativa värden kommer ge konstiga resultat"
-#: builtin.c:2274
+#: builtin.c:2381
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf): flyttalsvärden kommer trunkeras"
-#: builtin.c:2276
+#: builtin.c:2383
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr "lshift(%lf, %lf): för stora skiftvärden kommer ge konstiga resultat"
-#: builtin.c:2305 builtin.c:2307
+#: builtin.c:2412 builtin.c:2414
msgid "rshift: received non-numeric first argument"
msgstr "rshift: fick ett ickenumeriskt första argument"
-#: builtin.c:2309
+#: builtin.c:2416
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr "rshift(%lf, %lf): negativa värden kommer ge konstiga resultat"
-#: builtin.c:2311
+#: builtin.c:2418
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf): flyttalsvärden kommer trunkeras"
-#: builtin.c:2313
+#: builtin.c:2420
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr "rshift(%lf, %lf): för stora skiftvärden kommer ge konstiga resultat"
-#: builtin.c:2342 builtin.c:2344
+#: builtin.c:2449 builtin.c:2451
msgid "and: received non-numeric first argument"
msgstr "and: fick ett ickenumeriskt första argument"
-#: builtin.c:2346
+#: builtin.c:2453
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr "and(%lf, %lf): negativa värden kommer ge konstiga resultat"
-#: builtin.c:2348
+#: builtin.c:2455
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): flyttalsvärden kommer trunkeras"
-#: builtin.c:2377 builtin.c:2379
+#: builtin.c:2484 builtin.c:2486
msgid "or: received non-numeric first argument"
msgstr "or: fick ett ickenumeriskt första argument"
-#: builtin.c:2381
+#: builtin.c:2488
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr "or(%lf, %lf): negativa värden kommer ge konstiga resultat"
-#: builtin.c:2383
+#: builtin.c:2490
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf): flyttalsvärden kommer trunkeras"
-#: builtin.c:2412 builtin.c:2414
+#: builtin.c:2519 builtin.c:2521
msgid "xor: received non-numeric first argument"
msgstr "xor: fick ett ickenumeriskt första argument"
-#: builtin.c:2416
+#: builtin.c:2523
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr "xor(%lf, %lf): negativa värden kommer ge konstiga resultat"
-#: builtin.c:2418
+#: builtin.c:2525
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf): flyttalsvärden kommer trunkeras"
-#: builtin.c:2446
+#: builtin.c:2553
msgid "compl: received non-numeric argument"
msgstr "compl: fick ett ickenumeriskt argument"
-#: builtin.c:2448
+#: builtin.c:2555
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf): negativa värden kommer ge konstiga resultat"
-#: builtin.c:2450
+#: builtin.c:2557
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf): flyttalsvärden kommer trunkeras"
-#: builtin.c:2621
+#: builtin.c:2728
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: \"%s\" är inte en giltig lokalkategori"
+#: eval.c:262
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "okänd nodtyp %d"
+
+#: eval.c:310
+msgid "buffer overflow in genflags2str"
+msgstr "buffertöverflöd i genflags2str"
+
+#: eval.c:555
+#, 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:576
+msgid "`break' outside a loop is not portable"
+msgstr "\"break\" utanför en slinga är inte portabelt"
+
+#: eval.c:580
+msgid "`break' outside a loop is not allowed"
+msgstr "\"break\" utanför en slinga är inte tillåtet"
+
+#: eval.c:597
+msgid "`continue' outside a loop is not portable"
+msgstr "\"continue\" utanför en slinga är inte portabelt"
+
+#: eval.c:601
+msgid "`continue' outside a loop is not allowed"
+msgstr "\"continue\" utanför en slinga är inte tillåtet"
+
+#: eval.c:635
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "\"next\" kan inte anropas från en BEGIN-regel"
+
+#: eval.c:637
+msgid "`next' cannot be called from an END rule"
+msgstr "\"next\" kan inte anropas från en END-regel"
+
+#: eval.c:646
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "\"nextfile\" kan inte anropas från en BEGIN-regel"
+
+#: eval.c:648
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "\"nextfile\" kan inte anropas från en END-regel"
+
+#: eval.c:696
+msgid "statement has no effect"
+msgstr "kommandot har ingen effekt"
+
+#: eval.c:731 eval.c:761 eval.c:1733
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "referens till icke initierad variabel \"%s\""
+
+#: eval.c:739 eval.c:1721
+#, 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:746 eval.c:752
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "referens till icke initierat argument \"%s\""
+
+#: eval.c:810 eval.c:1728 profile.c:773
+#, 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:910
+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:935
+msgid "assignment used in conditional context"
+msgstr "tilldelning använt i jämförelsesammanhang"
+
+#: eval.c:1026
+msgid "division by zero attempted"
+msgstr "försökte dividera med noll"
+
+#: eval.c:1041
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "försökte dividera med noll i \"%%\""
+
+#: eval.c:1056 profile.c:649
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "otillåten typ (%s) i tree_eval"
+
+#: eval.c:1232
+msgid "division by zero attempted in `/='"
+msgstr "försökte dividera med noll i \"/=\""
+
+#: eval.c:1250
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "försökte dividera med noll i \"%%=\""
+
+#: eval.c:1510
+#, c-format
+msgid "%s (from %s)"
+msgstr "%s (från %s)"
+
+#: eval.c:1569
+#, c-format
+msgid "function `%s' called with more arguments than declared"
+msgstr "funktionen \"%s\" anropad med fler argument än vad som deklarerats"
+
+#: eval.c:1628
+#, c-format
+msgid "function `%s' not defined"
+msgstr "funktionen \"%s\" är inte definierad"
+
+#: eval.c:1634
+#, c-format
+msgid "function %s called\n"
+msgstr "funktionen %s anropad\n"
+
+#: eval.c:1693
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# Funktionsanropsstack:\n"
+"\n"
+
+#: eval.c:1696
+msgid "\t# -- main --\n"
+msgstr "\t# -- main --\n"
+
+#: eval.c:1850
+msgid "attempt to field reference from non-numeric value"
+msgstr "försök att fältreferera från ickenumeriskt värde"
+
+#: eval.c:1852
+msgid "attempt to reference from null string"
+msgstr "försök att referera från tom sträng"
+
+#: eval.c:1858
+#, c-format
+msgid "attempt to access field %d"
+msgstr "försök att komma åt fält nummer %d"
+
+#: eval.c:1874
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr "försök att använda skalärparametern \"%s\" som en vektor"
+
+#: eval.c:1886 eval.c:1893 profile.c:865
+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:1941
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "\"IGNORECASE\" är en gawk-utökning"
+
+#: eval.c:1970
+msgid "`BINMODE' is a gawk extension"
+msgstr "\"BINMODE\" är en gawk-utökning"
+
+#: eval.c:2082
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "felaktig \"%sFMT\"-specifikation \"%s\""
+
+#: eval.c:2160
+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"
@@ -426,10 +901,35 @@ msgstr "extension: kan inte öppna \"%s\" (%s)\n"
msgid "extension: library `%s': cannot call function `%s' (%s)\n"
msgstr "extension: bibliotek \"%s\": kan inte anropa funktionen \"%s\" (%s)\n"
-#: ext.c:180
+#: ext.c:181
msgid "Operation Not Supported"
msgstr "Operationen stöds inte"
+#: field.c:321
+msgid "NF set to negative value"
+msgstr "NF satt till ett negativt värde"
+
+#: field.c:819
+msgid "split: second argument is not an array"
+msgstr "split: andra argumentet är inte en vektor"
+
+#: field.c:854
+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:906
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "\"FIELDWIDTHS\" är en gawk-utökning"
+
+#: field.c:933
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "fält %d i FIELDWIDTHS måste vara > 0"
+
+#: field.c:1006
+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"
@@ -470,7 +970,7 @@ msgstr "%s: otillåten flagga -- %c\n"
msgid "%s: invalid option -- %c\n"
msgstr "%s: ogiltig flagga -- %c\n"
-#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412
+#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:431
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: flaggan kräver ett argument -- %c\n"
@@ -485,188 +985,503 @@ msgstr "%s: flaggan \"-W %s\" är tvetydig\n"
msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "%s: flaggan \"-W %s\" tillåter inte något argument\n"
-#: main.c:307
+#: io.c:257
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "kan inte öppna filen \"%s\" för läsning (%s)"
+
+#: io.c:344
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "stängning av fd %d (\"%s\") misslyckades (%s)"
+
+#: io.c:482
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "ogiltig trädtyp %s i redirect()"
+
+#: io.c:488
+#, c-format
+msgid "expression in `%s' redirection only has numeric value"
+msgstr "uttrycket i \"%s\"-omdirigering har bara numeriskt värde"
+
+#: io.c:494
+#, 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:499
+#, 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:521
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "onödig blandning av \">\" och \">>\" för filen \"%.*s\""
+
+#: io.c:573
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "kan inte öppna röret \"%s\" för utmatning (%s)"
+
+#: io.c:582
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "kan inte öppna röret \"%s\" för inmatning (%s)"
+
+#: io.c:595
+#, 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:599
+#, 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:675
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "kan inte dirigera om från \"%s\" (%s)"
+
+#: io.c:678
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "kan inte dirigera om till \"%s\" (%s)"
+
+#: io.c:717
+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:729
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "stängning av \"%s\" misslyckades (%s)"
+
+#: io.c:736
+msgid "too many pipes or input files open"
+msgstr "för många rör eller indatafiler öppna"
+
+#: io.c:759
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: andra argumentet måste vara \"to\" eller \"from\""
+
+#: io.c:773
+#, 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:777
+msgid "close of redirection that was never opened"
+msgstr "stängning av omdirigering som aldrig öppnades"
+
+#: io.c:804
+#, c-format
+msgid "close: redirection `%s' not opened with `|&', second argument ignored"
+msgstr ""
+"close: omdirigeringen \"%s\" öppnades inte med \"|&\", andra argumentet "
+"ignorerat"
+
+#: io.c:866
+#, 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:869
+#, c-format
+msgid "failure status (%d) on file close of `%s' (%s)"
+msgstr "felstatus (%d) från filstängning av \"%s\" (%s)"
+
+#: io.c:888
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "ingen explicit stängning av uttaget \"%s\" tillhandahållen"
+
+#: io.c:891
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "ingen explicit stängning av koprocessen \"%s\" tillhandahållen"
+
+#: io.c:894
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "ingen explicit stängning av röret \"%s\" tillhandahållen"
+
+#: io.c:897
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "ingen explicit stängning av filen \"%s\" tillhandahållen"
+
+#: io.c:926 io.c:980
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "fel vid skrivning till standard ut (%s)"
+
+#: io.c:930 io.c:984
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "fel vid skrivning till standard fel (%s)"
+
+#: io.c:938
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "rörspolning av \"%s\" misslyckades (%s)"
+
+#: io.c:941
+#, c-format
+msgid "co-process flush of pipe to `%s' failed (%s)."
+msgstr "koprocesspolning av röret till \"%s\" misslyckades (%s)"
+
+#: io.c:944
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "filspolning av \"%s\" misslyckades (%s)"
+
+#: io.c:1103
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "/inet/raw-klient är tyvärr inte klar än"
+
+#: io.c:1105 io.c:1142
+msgid "only root may use `/inet/raw'."
+msgstr "bara root kan använda \"/inet/raw\"."
+
+#: io.c:1140
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "/inet/raw-server inte redo än, ledsen"
+
+#: io.c:1230
+#, 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:1248
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "speciellt filnamn \"%s\" är ofullständigt"
+
+#: io.c:1260
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "lokal port ogiltig i \"%s\""
+
+#: io.c:1272
+msgid "must supply a remote hostname to `/inet'"
+msgstr "måste tillhandahålla ett fjärrdatornamn till \"/inet\""
+
+#: io.c:1287
+msgid "must supply a remote port to `/inet'"
+msgstr "måste tillhandahålla en fjärrport till \"/inet\""
+
+#: io.c:1293
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "fjärrporten ogiltig i \"%s\""
+
+#: io.c:1303
+msgid "TCP/IP communications are not supported"
+msgstr "TCP/IP-kommunikation stöds inte"
+
+#: io.c:1312 io.c:1492
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "filen \"%s\" är en katalog"
+
+#: io.c:1381
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "använd \"PROCINFO[\"%s\"]\" istället för \"%s\""
+
+#: io.c:1413
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "använd \"PROCINFO[...]\" istället för \"dev/user\""
+
+#: io.c:1478 io.c:1652
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "kunde inte öppna \"%s\", läge \"%s\""
+
+#: io.c:1703
+#, c-format
+msgid "close of master pty failed (%s)"
+msgstr "stängning av huvudpty misslyckades (%s)"
+
+#: io.c:1705 io.c:1857 io.c:2009
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "stängning av standard ut i barnet misslyckades (%s)"
+
+#: io.c:1708
+#, 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:1710 io.c:1862
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "stängning av standard in i barnet misslyckades (%s)"
+
+#: io.c:1713
+#, 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:1715 io.c:1734
+#, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "stängning av slavpty misslyckades (%s)"
+
+#: io.c:1808 io.c:1860 io.c:1990 io.c:2012
+#, 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:1812 io.c:1865
+#, 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:1829 io.c:2003
+msgid "restoring stdout in parent process failed\n"
+msgstr "återställande av standard ut i förälderprocessen misslyckades\n"
+
+#: io.c:1834
+msgid "restoring stdin in parent process failed\n"
+msgstr "återställande av standard in i förälderprocessen misslyckades\n"
+
+#: io.c:1868 io.c:2014 io.c:2025
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "stängning av röret misslyckades (%s)"
+
+#: io.c:1913
+msgid "`|&' not supported"
+msgstr "\"|&\" stöds inte"
+
+#: io.c:1980
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "kan inte öppna röret \"%s\" (%s)"
+
+#: io.c:2021
+#, c-format
+msgid "cannot create child process for `%s' (fork: %s)"
+msgstr "kan inte skapa barnprocess för \"%s\" (fork: %s)"
+
+#: io.c:2364
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "datafilen \"%s\" är tom"
+
+#: io.c:2407 io.c:2415
+msgid "could not allocate more input memory"
+msgstr "kunde inte allokera mer indataminne"
+
+#: io.c:2540 io.c:2782 io.c:3046
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "fel vid läsning av indatafilen \"%s\": %s"
+
+#: io.c:3281
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "flerteckensvärdet av \"RS\" är en gawk-utökning"
+
+#: main.c:322
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "\"-m[fr]\"-flaggan är irrelevant i gawk"
-#: main.c:309
+#: main.c:324
msgid "-m option usage: `-m[fr] nnn'"
msgstr "-m-flaggans användning: \"-m[fr] nnn\""
-#: main.c:326
+#: main.c:341
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s: flaggan \"-W %s\" okänd, ignorerad\n"
-#: main.c:357
+#: main.c:378
msgid "empty argument to `--source' ignored"
msgstr "tomt argument till \"--source\" ignorerat"
-#: main.c:429
+#: main.c:448
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr "miljövariabeln \"POSIXLY_CORRECT\" satt: slår på \"--posix\""
-#: main.c:434
+#: main.c:453
msgid "`--posix' overrides `--traditional'"
msgstr "\"--posix\" åsidosätter \"--traditional\""
-#: main.c:445
+#: main.c:464
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr "\"--posix\"/\"--traditional\" åsidosätter \"--non-decimal-data\""
-#: main.c:449
-#, fuzzy, c-format
+#: main.c:468
+#, c-format
msgid "running %s setuid root may be a security problem"
-msgstr "att köra av %s setuid root kan vara ett säkerhetsproblem"
+msgstr "att köra %s setuid root kan vara ett säkerhetsproblem"
-#: main.c:478
+#: main.c:509
#, c-format
-msgid "can't set mode on stdin (%s)"
-msgstr "kan inte sätta läge på standard in (%s)"
+msgid "can't set binary mode on stdin (%s)"
+msgstr "kan inte sätta binärläge på standard in (%s)"
-#: main.c:481
+#: main.c:512
#, c-format
-msgid "can't set mode on stdout (%s)"
-msgstr "kan inte sätta läge på standard ut (%s)"
+msgid "can't set binary mode on stdout (%s)"
+msgstr "kan inte sätta binärläge på standard ut (%s)"
-#: main.c:483
+#: main.c:514
#, c-format
-msgid "can't set mode on stderr (%s)"
-msgstr "kan inte sätta läge på standard fel (%s)"
+msgid "can't set binary mode on stderr (%s)"
+msgstr "kan inte sätta binärläge på standard fel (%s)"
-#: main.c:512
+#: main.c:544
msgid "no program text at all!"
msgstr "ingen programtext alls!"
-#: main.c:556
+#: main.c:612
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr ""
"Användning: %s [POSIX- eller GNU-stilsflaggor] -f progfil [--] fil ...\n"
-#: main.c:558
+#: main.c:614
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr "Användning: %s [POSIX- eller GNU-stilsflaggor] %cprogram%c fil ...\n"
-#: main.c:563
+#: main.c:619
msgid "POSIX options:\t\tGNU long options:\n"
msgstr "POSIX-flaggor:\t\tGNU långa flaggor:\n"
-#: main.c:564
+#: main.c:620
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr "\t-f progfil\t\t--file=progfil\n"
-#: main.c:565
+#: main.c:621
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr "\t-F fs\t\t\t--field-separator=fs\n"
-#: main.c:566
+#: main.c:622
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr "\t-v var=värde\t\t--assign=var=värde\n"
-#: main.c:567
+#: main.c:623
msgid "\t-m[fr] val\n"
msgstr "\t-m[fr] värde\n"
-#: main.c:568
+#: main.c:624
msgid "\t-W compat\t\t--compat\n"
msgstr "\t-W compat\t\t--compat\n"
-#: main.c:569
+#: main.c:625
msgid "\t-W copyleft\t\t--copyleft\n"
msgstr "\t-W copyleft\t\t--copyleft\n"
-#: main.c:570
+#: main.c:626
msgid "\t-W copyright\t\t--copyright\n"
msgstr "\t-W copyright\t\t--copyright\n"
-#: main.c:571
+#: main.c:627
msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
msgstr "\t-W dump-variables[=fil]\t--dump-variables[=fil]\n"
-#: main.c:572
+#: main.c:628
msgid "\t-W gen-po\t\t--gen-po\n"
msgstr "\t-W gen-po\t\t--gen-po\n"
-#: main.c:573
+#: main.c:629
msgid "\t-W help\t\t\t--help\n"
msgstr "\t-W help\t\t\t--help\n"
-#: main.c:574
+#: main.c:630
msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
msgstr "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
-#: main.c:575
+#: main.c:631
msgid "\t-W lint-old\t\t--lint-old\n"
msgstr "\t-W lint-old\t\t--lint-old\n"
-#: main.c:576
+#: main.c:632
msgid "\t-W non-decimal-data\t--non-decimal-data\n"
msgstr "\t-W non-decimal-data\t--non-decimal-data\n"
-#: main.c:578
+#: main.c:634
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr "\t-W nostalgia\t\t--nostalgia\n"
-#: main.c:581
+#: main.c:637
msgid "\t-W parsedebug\t\t--parsedebug\n"
msgstr "\t-W parsedebug\t\t--parsedebug\n"
-#: main.c:583
+#: main.c:639
msgid "\t-W profile[=file]\t--profile[=file]\n"
msgstr "\t-W profile[=fil]\t--profile[=fil]\n"
-#: main.c:584
+#: main.c:640
msgid "\t-W posix\t\t--posix\n"
msgstr "\t-W posix\t\t--posix\n"
-#: main.c:585
+#: main.c:641
msgid "\t-W re-interval\t\t--re-interval\n"
msgstr "\t-W re-interval\t\t--re-interval\n"
-#: main.c:586
+#: main.c:642
msgid "\t-W source=program-text\t--source=program-text\n"
msgstr "\t-W source=programtext\t--source=programtext\n"
-#: main.c:587
+#: main.c:643
msgid "\t-W traditional\t\t--traditional\n"
msgstr "\t-W traditional\t\t--traditional\n"
-#: main.c:588
+#: main.c:644
msgid "\t-W usage\t\t--usage\n"
msgstr "\t-W usage\t\t--usage\n"
-#: main.c:589
+#: main.c:645
msgid "\t-W version\t\t--version\n"
msgstr "\t-W version\t\t--version\n"
-#: main.c:593
-#, fuzzy
+#: main.c:649
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
"section `Reporting Problems and Bugs' in the printed version.\n"
"\n"
msgstr ""
-"sektionen \"Reporting Problems and Bugs\" i den utskrivna versionen.\n"
+"\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:597
+#: main.c:653
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:601
+#: main.c:657
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:613
+#: main.c:669
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -685,7 +1500,7 @@ msgstr ""
"någon senare version.\n"
"\n"
-#: main.c:621
+#: main.c:677
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"
@@ -699,7 +1514,7 @@ msgstr ""
"General Public License för ytterligare information.\n"
"\n"
-#: main.c:627
+#: main.c:683
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"
@@ -709,98 +1524,115 @@ msgstr ""
"med detta program. Om inte, skriv till Free Software Foundation,\n"
"Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"
-#: main.c:657
+#: main.c:713
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "-Ft sätter inte FS till tab i POSIX-awk"
-#: main.c:888
+#: main.c:944
+#, 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:964
#, c-format
-msgid "invalid syntax in name `%s' for variable assignment"
-msgstr "ogiltig syntax i namnet \"%s\" för variabeltilldelning"
+msgid "`%s' is not a legal variable name"
+msgstr "\"%s\" är inte ett giltigt variabelnamn"
-#: main.c:957
+#: main.c:967
+#, 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:995
msgid "floating point exception"
msgstr "flyttalsundantag"
-#: main.c:964
+#: main.c:1002
msgid "fatal error: internal error"
msgstr "ödesdigert fel: internt fel"
-#: main.c:1014
+#: main.c:1052
#, c-format
msgid "no pre-opened fd %d"
msgstr "ingen föröppnad fd %d"
-#: main.c:1019
+#: main.c:1057
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "kunde inte föröppna /dev/null för fd %d"
-#: main.c:1037 main.c:1046
+#: main.c:1080 main.c:1089
#, c-format
msgid "could not find groups: %s"
msgstr "kunde inte hitta grupper: %s"
-#: profile.c:94
-#, c-format
-msgid "could not open `%s' for writing: %s"
-msgstr "kunde inte öppna \"%s\" för skrivning: %s"
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "kommandorad:"
-#: profile.c:96 awkgram.y:2465
-msgid "sending profile to standard error"
-msgstr "skickar profilen till standard fel"
+#: msg.c:120
+msgid "warning: "
+msgstr "varning: "
-#: profile.c:409
-msgid "internal error: Node_var with null vname"
-msgstr "internt fel: Node_var med null vname"
+#: msg.c:142
+msgid "error: "
+msgstr "fel: "
-#: profile.c:524
-msgid "internal error: Node_var_array with null vname"
-msgstr "internt fel: Node_var_vektor med null vname"
+#: msg.c:178
+msgid "fatal: "
+msgstr "ödesdigert: "
-#: profile.c:554 eval.c:813
-#, c-format
-msgid ""
-"function `%s' called with space between name and `(',\n"
-"%s"
-msgstr ""
-"funktionen \"%s\" anropad med blanktecken mellan namnet och \"(\",\n"
-"%s"
+#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
+msgid "can't convert string to float"
+msgstr "kan inte konvertera en sträng till flyttal"
+
+#: node.c:357
+msgid "backslash at end of string"
+msgstr "omvänt snedstreck i slutet av strängen"
-#: profile.c:556 eval.c:815
-msgid "or used in other expression context"
-msgstr "eller använt i andra uttryckssammanhang"
+#: node.c:544
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX tillåter inte \"\\x\"-kontrollsekvenser"
-#: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741
-#, c-format
-msgid "attempt to use array `%s' in a scalar context"
-msgstr "försök att använda vektorn \"%s\" i skalärsammanhang"
+#: node.c:550
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "inga hexadecimala siffror i \"\\x\"-kontrollsekvenser"
-#: profile.c:637 eval.c:1047
+#: node.c:584
#, c-format
-msgid "illegal type (%s) in tree_eval"
-msgstr "otillåten typ (%s) i tree_eval"
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr "kontrollsekvensen \"\\%c\" behandlad som bara \"%c\""
-#: profile.c:842 eval.c:1790
+#: posix/gawkmisc.c:172
#, c-format
-msgid "attempt to use function `%s' as array"
-msgstr "försök att använda funktionen \"%s\" som vektor"
+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:856 eval.c:1797
+#: profile.c:91
#, c-format
-msgid "`%s' is a function, assignment is not allowed"
-msgstr "\"%s\" är en funktion, tilldelning är inte tillåtet"
+msgid "could not open `%s' for writing: %s"
+msgstr "kunde inte öppna \"%s\" för skrivning: %s"
-#: profile.c:860 eval.c:1803 eval.c:1810
-msgid "assignment is not allowed to result of builtin function"
-msgstr "det är inte tillåtet att tilldela resultatet från en inbyggd funktion"
+#: profile.c:409
+msgid "internal error: Node_var with null vname"
+msgstr "internt fel: Node_var med null vname"
-#: profile.c:1108
+#: profile.c:471
+msgid "# treated internally as `delete'"
+msgstr "# behandlad internt som \"delete\""
+
+#: profile.c:545
+msgid "internal error: Node_var_array with null vname"
+msgstr "internt fel: Node_var_vektor med null vname"
+
+#: profile.c:1127
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# gawkprofil, skapad %s\n"
-#: profile.c:1111
+#: profile.c:1130
msgid ""
"\t# BEGIN block(s)\n"
"\n"
@@ -808,7 +1640,7 @@ msgstr ""
"\t# BEGIN-block\n"
"\n"
-#: profile.c:1121
+#: profile.c:1140
msgid ""
"\t# Rule(s)\n"
"\n"
@@ -816,7 +1648,7 @@ msgstr ""
"\t# Regel/regler\n"
"\n"
-#: profile.c:1127
+#: profile.c:1146
msgid ""
"\t# END block(s)\n"
"\n"
@@ -824,7 +1656,7 @@ msgstr ""
"\t# END-block\n"
"\n"
-#: profile.c:1147
+#: profile.c:1166
msgid ""
"\n"
"\t# Functions, listed alphabetically\n"
@@ -832,926 +1664,148 @@ msgstr ""
"\n"
"\t# Funktioner, listade alfabetiskt\n"
-#: profile.c:1357
+#: profile.c:1376
#, c-format
msgid "unexpected type %s in prec_level"
msgstr "oväntad typ %s i prec_level"
-#: regex.c:1322
+#: 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"
-#: regex.c:1323
+#: regcomp.c:139
msgid "No match"
msgstr "Misslyckades"
-#: regex.c:1324
+#: regcomp.c:142
msgid "Invalid regular expression"
msgstr "Ogiltigt reguljärt uttryck"
-#: regex.c:1325
+#: regcomp.c:145
msgid "Invalid collation character"
msgstr "Ogiltigt kollationeringstecken"
-#: regex.c:1326
+#: regcomp.c:148
msgid "Invalid character class name"
msgstr "Ogiltigt teckenklassnamn"
-#: regex.c:1327
+#: regcomp.c:151
msgid "Trailing backslash"
msgstr "Eftersläpande omvänt snedstreck"
-#: regex.c:1328
+#: regcomp.c:154
msgid "Invalid back reference"
msgstr "Ogiltig bakåtrerefens"
-#: regex.c:1329
+#: regcomp.c:157
msgid "Unmatched [ or [^"
msgstr "Obalanserad [ eller [^"
-#: regex.c:1330
+#: regcomp.c:160
msgid "Unmatched ( or \\("
msgstr "Obalanserad ( eller \\("
-#: regex.c:1331
+#: regcomp.c:163
msgid "Unmatched \\{"
msgstr "Obalanserad \\{"
-#: regex.c:1332
+#: regcomp.c:166
msgid "Invalid content of \\{\\}"
msgstr "Ogiltigt innehåll i \\{\\}"
-#: regex.c:1333
+#: regcomp.c:169
msgid "Invalid range end"
msgstr "Ogiltigt omfångsslut"
-#: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204
+#: regcomp.c:172
msgid "Memory exhausted"
msgstr "Minnet slut"
-#: regex.c:1335
+#: regcomp.c:175
msgid "Invalid preceding regular expression"
msgstr "Ogiltigt föregående reguljärt uttryck"
-#: regex.c:1336
+#: regcomp.c:178
msgid "Premature end of regular expression"
msgstr "För tidigt slut på reguljärt uttryck"
-#: regex.c:1337
+#: regcomp.c:181
msgid "Regular expression too big"
msgstr "Reguljärt uttryck för stort"
-#: regex.c:1338
+#: regcomp.c:184
msgid "Unmatched ) or \\)"
msgstr "Obalanserad ) eller \\)"
-#: regex.c:7365
+#: regcomp.c:621
msgid "No previous regular expression"
msgstr "Inget föregående reguljärt uttryck"
-#: awkgram.y:232
-msgid "BEGIN blocks must have an action part"
-msgstr "BEGIN-block måste ha en åtgärdsdel"
-
-#: awkgram.y:238
-msgid "END blocks must have an action part"
-msgstr "END-block måste ha en åtgärdsdel"
-
-#: awkgram.y:274
-#, c-format
-msgid "`%s' is a built-in function, it cannot be redefined"
-msgstr "\"%s\" är en inbyggd funktion, den kan inte definieras om"
-
-#: awkgram.y:362
-msgid "statement may have no effect"
-msgstr "kommandot kanske inte har någon effekt"
-
-#: awkgram.y:455
-msgid "`next' used in BEGIN or END action"
-msgstr "\"next\" använd i BEGIN- eller END-åtgärd"
-
-#: awkgram.y:462 awkgram.y:469
-msgid "`nextfile' is a gawk extension"
-msgstr "\"nextfile\" är en gawk-utökning"
-
-#: awkgram.y:474
-msgid "`nextfile' used in BEGIN or END action"
-msgstr "\"nextfile\" använd i BEGIN- eller END-åtgärd"
-
-#: awkgram.y:483
-msgid "`return' used outside function context"
-msgstr "\"return\" använd utanför funktion"
-
-#: awkgram.y:519
-msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
-msgstr ""
-"ensamt \"print\" i BEGIN eller END-regel bör troligen vara 'print \"\"'"
-
-#: awkgram.y:532 awkgram.y:539
-msgid "`delete array' is a gawk extension"
-msgstr "\"delete array\" är en gawk-utökning"
-
-#: awkgram.y:604
-msgid "multistage two-way pipelines don't work"
-msgstr "flerstegs dubbelriktade rör fungerar inte"
-
-#: awkgram.y:695
-msgid "regular expression on right of assignment"
-msgstr "reguljärt uttryck i högerledet av en tilldelning"
-
-#: awkgram.y:713
-msgid "non-redirected `getline' undefined inside END action"
-msgstr "icke omdirigerad \"getline\" odefinierad inuti END-åtgärd"
-
-#: awkgram.y:723
-msgid "regular expression on left of `~' or `!~' operator"
-msgstr "reguljärt uttryck på vänster sida om en \"~\"- eller \"!~\"-operator"
-
-#: awkgram.y:733
-#, c-format
-msgid "regexp constant `/%s/' looks like a C comment, but is not"
-msgstr "regexp-konstanten \"/%s/\" ser ut som en C-kommentar men är inte det"
-
-#: awkgram.y:749
-msgid "regular expression on right of comparison"
-msgstr "reguljärt uttryck i högerledet av en jämförelse"
-
-#: awkgram.y:776
-msgid "non-redirected `getline' undefined inside BEGIN or END action"
-msgstr ""
-"icke omdirigerad \"getline\" odefinierade inuti BEGIN- eller END-åtgärd"
-
-#: awkgram.y:831
-msgid "call of `length' without parentheses is not portable"
-msgstr "anrop av \"length\" utan parenteser är inte portabelt"
-
-#: awkgram.y:834
-msgid "call of `length' without parentheses is deprecated by POSIX"
-msgstr "anrop av \"length\" utan parenteser är föråldrat enligt POSIX"
-
-#: awkgram.y:884
-msgid "invalid subscript expression"
-msgstr "ogiltig indexuttryck"
-
-#: awkgram.y:1033
-#, c-format
-msgid "fptr %x not in tokentab\n"
-msgstr "fptr %x är inte i tokentab\n"
-
-#: awkgram.y:1068
-msgid "unexpected newline"
-msgstr "oväntat nyradstecken"
-
-#: awkgram.y:1152
-msgid "empty program text on command line"
-msgstr "tom programtext på kommandoraden"
-
-#: awkgram.y:1209
-#, c-format
-msgid "can't open source file `%s' for reading (%s)"
-msgstr "kan inte öppna källfilen \"%s\" för läsning (%s)"
-
-#: awkgram.y:1244
-#, c-format
-msgid "can't read sourcefile `%s' (%s)"
-msgstr "kan inte läsa källfilen \"%s\" (%s)"
-
-#: awkgram.y:1252
-#, c-format
-msgid "source file `%s' is empty"
-msgstr "källfilen \"%s\" är tom"
-
-#: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011
-msgid "source file does not end in newline"
-msgstr "källfilen slutar inte med en ny rad"
-
-#: awkgram.y:1518
-msgid "unterminated regexp ends with `\\' at end of file"
-msgstr "oavslutat reguljärt uttryck slutar med \"\\\" i slutet av filen"
-
-#: awkgram.y:1539
-msgid "unterminated regexp"
-msgstr "oavslutat reguljärt uttryck"
-
-#: awkgram.y:1542
-msgid "unterminated regexp at end of file"
-msgstr "oavslutat reguljärt uttryck i slutet av filen"
-
-#: awkgram.y:1609
-msgid "use of `\\ #...' line continuation is not portable"
-msgstr "Användning av \"\\ #...\" för radfortsättning är inte portabelt"
-
-#: awkgram.y:1621
-msgid "backslash not last character on line"
-msgstr "sista tecknet på raden är inte ett omvänt snedstreck"
-
-#: awkgram.y:1662
-msgid "POSIX does not allow operator `**='"
-msgstr "POSIX tillåter inte operatorn \"**=\""
-
-#: awkgram.y:1664
-msgid "old awk does not support operator `**='"
-msgstr "gamla awk stöder inte operatorn \"**=\""
-
-#: awkgram.y:1673
-msgid "POSIX does not allow operator `**'"
-msgstr "POSIX tillåter inte operatorn \"**\""
-
-#: awkgram.y:1675
-msgid "old awk does not support operator `**'"
-msgstr "gamla awk stöder inte operatorn \"**\""
-
-#: awkgram.y:1708
-msgid "operator `^=' is not supported in old awk"
-msgstr "operatorn \"^=\" stöds inte i gamla awk"
-
-#: awkgram.y:1716
-msgid "operator `^' is not supported in old awk"
-msgstr "operatorn \"^\" stöds inte i gamla awk"
-
-#: awkgram.y:1798 awkgram.y:1815
-msgid "unterminated string"
-msgstr "oavslutad sträng"
-
-#: awkgram.y:1972
-#, c-format
-msgid "invalid char '%c' in expression"
-msgstr "ogiltigt tecken \"%c\" i uttryck"
-
-#: awkgram.y:2032
-#, c-format
-msgid "`%s' is a gawk extension"
-msgstr "\"%s\" är en gawk-utökning"
-
-#: awkgram.y:2035
-#, c-format
-msgid "`%s' is a Bell Labs extension"
-msgstr "\"%s\" är en Bell Labs-utökning"
-
-#: awkgram.y:2038
-#, c-format
-msgid "POSIX does not allow `%s'"
-msgstr "POSIX tillåter inte \"%s\""
-
-#: awkgram.y:2042
-#, c-format
-msgid "`%s' is not supported in old awk"
-msgstr "\"%s\" stöds inte i gamla awk"
-
-#: awkgram.y:2070
-msgid "`goto' considered harmful!\n"
-msgstr "\"goto\" anses skadlig!\n"
-
-#: awkgram.y:2134
-#, c-format
-msgid "%d is invalid as number of arguments for %s"
-msgstr "%d är ett ogiltigt antal argument för %s"
-
-#: awkgram.y:2153 awkgram.y:2156
-msgid "match: third argument is a gawk extension"
-msgstr "match: tredje argumentet är en gawk-utökning"
-
-#: awkgram.y:2172
-#, c-format
-msgid "%s: string literal as last arg of substitute has no effect"
-msgstr ""
-"%s: bokstavlig sträng som sista argument till ersättning har ingen effekt"
-
-#: awkgram.y:2176
-msgid "sub third parameter is not a changeable object"
-msgstr "sub: tredje argumentet är inte ett ändringsbart objekt"
-
-#: awkgram.y:2178
-msgid "gsub third parameter is not a changeable object"
-msgstr "gsub: tredje argumentet är inte ett ändringsbart objekt"
-
-#: awkgram.y:2204 awkgram.y:2207
-msgid "close: second argument is a gawk extension"
-msgstr "close: andra argumentet är en gawk-utökning"
-
-#: awkgram.y:2217
-msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
-msgstr ""
-"användandet av dcgettext(_\"...\") är felaktigt: ta bort det inledande "
-"understrykningstecknet"
-
-#: awkgram.y:2232
-#, fuzzy
-msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
-msgstr ""
-"användandet av dcgettext(_\"...\") är felaktigt: ta bort det inledande "
-"understrykningstecknet"
-
-#: awkgram.y:2323
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "funktionen \"%s\": parameter %d, \"%s\", är samma som parameter %d"
-
-#: awkgram.y:2355
-#, c-format
-msgid "function `%s': parameter `%s' shadows global variable"
-msgstr "funktionen \"%s\": parametern \"%s\" överskuggar en global variabel"
-
-#: awkgram.y:2464
-#, c-format
-msgid "could not open `%s' for writing (%s)"
-msgstr "kunde inte öpnna \"%s\" för skrivning (%s)"
-
-#: awkgram.y:2495
-#, c-format
-msgid "%s: close failed (%s)"
-msgstr "%s: misslyckades att stänga (%s)"
-
-#: awkgram.y:2605
-msgid "shadow_funcs() called twice!"
-msgstr "shadow_funcs() anropad två gånger!"
-
-#: awkgram.y:2680
-#, c-format
-msgid "function `%s': can't use function name as parameter name"
-msgstr "funktionen \"%s\": kan inte använda funktionsnamn som parameternamn"
-
-#: awkgram.y:2690
-#, c-format
-msgid "function name `%s' previously defined"
-msgstr "funktionsnamnet \"%s\" är definierat sedan tidigare"
-
-#: awkgram.y:2838 awkgram.y:2844
-#, c-format
-msgid "function `%s' called but never defined"
-msgstr "funktionen \"%s\" anropad men aldrig definierad"
-
-#: awkgram.y:2847
-#, c-format
-msgid "function `%s' defined but never called"
-msgstr "funktionen \"%s\" definierad men aldrig anropad"
-
-#: awkgram.y:2874
-#, c-format
-msgid "regexp constant for parameter #%d yields boolean value"
-msgstr "konstant reguljärt uttryck för parameter %d ger ett booleskt värde"
-
-#: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649
-#: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078
-#: dfa.c:1081 dfa.c:1094 dfa.c:1095
-msgid "Unbalanced ["
-msgstr "Obalanserad ["
-
-#: dfa.c:783
-msgid "Unfinished \\ escape"
-msgstr "Oavslutad \\-kontrollsekvens"
-
-#: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955
-msgid "unfinished repeat count"
-msgstr "oavslutat upprepningsantal"
-
-#: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958
-msgid "malformed repeat count"
-msgstr "felaktigt utformat upprepningsantal"
-
-#: dfa.c:1285
-msgid "Unbalanced ("
-msgstr "Obalanserad ("
-
-#: dfa.c:1407
-msgid "No regexp syntax bits specified"
-msgstr "Inga syntaxbitar för reguljära uttryck angivna"
-
-#: dfa.c:1415
-msgid "Unbalanced )"
-msgstr "Obalanserad )"
-
-#: dfa.c:3014
-msgid "out of memory"
-msgstr "slut på minne"
-
-#: field.c:849
-msgid "split: second argument is not an array"
-msgstr "split: andra argumentet är inte en vektor"
-
-#: field.c:876
-msgid "split: null string for third arg is a gawk extension"
-msgstr "split: tom sträng som tredje argument är en gawk-utökning"
-
-#: field.c:916
-msgid "`FIELDWIDTHS' is a gawk extension"
-msgstr "\"FIELDWIDTHS\" är en gawk-utökning"
-
-#: field.c:943
-#, c-format
-msgid "field %d in FIELDWIDTHS, must be > 0"
-msgstr "fält %d i FIELDWIDTHS måste vara > 0"
-
-#: field.c:997
-msgid "null string for `FS' is a gawk extension"
-msgstr "tom sträng som \"FS\" är en gawk-utökning"
-
-#: msg.c:57
-msgid "cmd. line:"
-msgstr "kommandorad:"
-
-#: msg.c:123
-msgid "warning: "
-msgstr "varning: "
-
-#: msg.c:145
-msgid "error: "
-msgstr "fel: "
-
-#: msg.c:178
-msgid "fatal: "
-msgstr "ödesdigert: "
-
-#: eval.c:259
-#, c-format
-msgid "unknown nodetype %d"
-msgstr "okänd nodtyp %d"
-
-#: eval.c:307
-msgid "buffer overflow in genflags2str"
-msgstr "buffertöverflöd i genflags2str"
-
-#: eval.c:541
-#, c-format
-msgid "for loop: array `%s' changed size from %d to %d during loop execution"
-msgstr ""
-"forslinga: vektorn \"%s\" ändrade storlek från %d till %d under "
-"slingexekvering"
-
-#: eval.c:565
-msgid "`break' outside a loop is not portable"
-msgstr "\"break\" utanför en slinga är inte portabelt"
-
-#: eval.c:569
-msgid "`break' outside a loop is not allowed"
-msgstr "\"break\" utanför en slinga är inte tillåtet"
-
-#: eval.c:588
-msgid "`continue' outside a loop is not portable"
-msgstr "\"continue\" utanför en slinga är inte portabelt"
-
-#: eval.c:592
-msgid "`continue' outside a loop is not allowed"
-msgstr "\"continue\" utanför en slinga är inte tillåtet"
-
-#: eval.c:622
-msgid "`next' cannot be called from a BEGIN rule"
-msgstr "\"next\" kan inte anropas från en BEGIN-regel"
-
-#: eval.c:624
-msgid "`next' cannot be called from an END rule"
-msgstr "\"next\" kan inte anropas från en END-regel"
-
-#: eval.c:636
-msgid "`nextfile' cannot be called from a BEGIN rule"
-msgstr "\"nextfile\" kan inte anropas från en BEGIN-regel"
-
-#: eval.c:638
-msgid "`nextfile' cannot be called from an END rule"
-msgstr "\"nextfile\" kan inte anropas från en END-regel"
-
-#: eval.c:679
-msgid "statement has no effect"
-msgstr "kommandot har ingen effekt"
-
-#: eval.c:713 eval.c:743 eval.c:1622
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "referens till icke initierad variabel \"%s\""
-
-#: eval.c:721 eval.c:1608
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "kan inte använda funktionsnamnet \"%s\" som variabel eller vektor"
-
-#: eval.c:728 eval.c:734 eval.c:1747
-#, c-format
-msgid "reference to uninitialized argument `%s'"
-msgstr "referens till icke initierat argument \"%s\""
-
-#: eval.c:823
-msgid "assignment used in conditional context"
-msgstr "tilldelning använt i jämförelsesammanhang"
-
-#: eval.c:914
-msgid ""
-"concatenation: side effects in one expression have changed the length of "
-"another!"
-msgstr ""
-"concatenation: sidoeffekter i ett uttryck har ändrat längden av ett annat!"
-
-#: eval.c:1013
-msgid "division by zero attempted"
-msgstr "försökte dividera med noll"
-
-#: eval.c:1028
-#, c-format
-msgid "division by zero attempted in `%%'"
-msgstr "försökte dividera med noll i \"%%\""
-
-#: eval.c:1236
-msgid "division by zero attempted in `/='"
-msgstr "försökte dividera med noll i \"/=\""
-
-#: eval.c:1254
-#, c-format
-msgid "division by zero attempted in `%%='"
-msgstr "försökte dividera med noll i \"%%=\""
-
-#: eval.c:1424
-#, c-format
-msgid "%s (from %s)"
-msgstr "%s (från %s)"
-
-#: eval.c:1472
-#, c-format
-msgid "function `%s' called with more arguments than declared"
-msgstr "funktionen \"%s\" anropad med fler argument än vad som deklarerats"
-
-#: eval.c:1519
-#, c-format
-msgid "function `%s' not defined"
-msgstr "funktionen \"%s\" är inte definierad"
-
-#: eval.c:1521
-#, c-format
-msgid "function %s called\n"
-msgstr "funktionen %s anropad\n"
-
-#: eval.c:1580
-msgid ""
-"\n"
-"\t# Function Call Stack:\n"
-"\n"
-msgstr ""
-"\n"
-"\t# Funktionsanropsstack:\n"
-"\n"
-
-#: eval.c:1583
-msgid "\t# -- main --\n"
-msgstr "\t# -- main --\n"
-
-#: eval.c:1759
-msgid "attempt to field reference from non-numeric value"
-msgstr "försök att fältreferera från ickenumeriskt värde"
-
-#: eval.c:1761
-msgid "attempt to reference from null string"
-msgstr "försök att referera från tom sträng"
-
-#: eval.c:1767
-#, c-format
-msgid "attempt to access field %d"
-msgstr "försök att komma åt fält nummer %d"
-
-#: eval.c:1783
-#, c-format
-msgid "attempt to use scalar parameter `%s' as an array"
-msgstr "försök att använda skalärparametern \"%s\" som en vektor"
-
-#: eval.c:1874
-msgid "`IGNORECASE' is a gawk extension"
-msgstr "\"IGNORECASE\" är en gawk-utökning"
-
-#: eval.c:1902
-msgid "`BINMODE' is a gawk extension"
-msgstr "\"BINMODE\" är en gawk-utökning"
-
-#: eval.c:2014
-#, c-format
-msgid "bad `%sFMT' specification `%s'"
-msgstr "felaktig \"%sFMT\"-specifikation \"%s\""
-
-#: eval.c:2080
-msgid "turning off `--lint' due to assignment to `LINT'"
-msgstr "slår av \"--lint\" på grund av en tilldelning till \"LINT\""
-
-#: eval.c:2116
-msgid "NF set to negative value"
-msgstr "NF satt till ett negativt värde"
-
-#: io.c:240
-#, c-format
-msgid "cannot open file `%s' for reading (%s)"
-msgstr "kan inte öppna filen \"%s\" för läsning (%s)"
-
-#: io.c:320
-#, c-format
-msgid "close of fd %d (`%s') failed (%s)"
-msgstr "stängning av fd %d (\"%s\") misslyckades (%s)"
-
-#: io.c:432
-#, c-format
-msgid "invalid tree type %s in redirect()"
-msgstr "ogiltig trädtyp %s i redirect()"
-
-#: io.c:438
-#, c-format
-msgid "expression in `%s' redirection only has numeric value"
-msgstr "uttrycket i \"%s\"-omdirigering har bara numeriskt värde"
-
-#: io.c:444
-#, c-format
-msgid "expression for `%s' redirection has null string value"
-msgstr "uttrycket för \"%s\"-omdirigering har en tom sträng som värde"
-
-#: io.c:449
-#, c-format
-msgid "filename `%s' for `%s' redirection may be result of logical expression"
-msgstr ""
-"filnamnet \"%s\" för \"%s\"-omdirigering kan vara resultatet av ett logiskt "
-"uttryck"
-
-#: io.c:471
-#, c-format
-msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
-msgstr "onödig blandning av \">\" och \">>\" för filen \"%.*s\""
-
-#: io.c:523
-#, c-format
-msgid "can't open pipe `%s' for output (%s)"
-msgstr "kan inte öppna röret \"%s\" för utmatning (%s)"
-
-#: io.c:532
-#, c-format
-msgid "can't open pipe `%s' for input (%s)"
-msgstr "kan inte öppna röret \"%s\" för inmatning (%s)"
-
-#: io.c:545
-#, c-format
-msgid "can't open two way socket `%s' for input/output (%s)"
-msgstr "kan inte öppna tvåvägsuttaget \"%s\" för in-/utmatning (%s)"
-
-#: io.c:549
-#, c-format
-msgid "can't open two way pipe `%s' for input/output (%s)"
-msgstr "kan inte öppna tvåvägsröret \"%s\" för in-/utmatning (%s)"
-
-#: io.c:625
-#, c-format
-msgid "can't redirect from `%s' (%s)"
-msgstr "kan inte dirigera om från \"%s\" (%s)"
-
-#: io.c:628
-#, c-format
-msgid "can't redirect to `%s' (%s)"
-msgstr "kan inte dirigera om till \"%s\" (%s)"
-
-#: io.c:667
-msgid ""
-"reached system limit for open files: starting to multiplex file descriptors"
-msgstr ""
-"nådde systembegränsningen för öppna filer: börjar multiplexa fildeskriptorer"
-
-#: io.c:679
-#, c-format
-msgid "close of `%s' failed (%s)."
-msgstr "stängning av \"%s\" misslyckades (%s)"
-
-#: io.c:686
-msgid "too many pipes or input files open"
-msgstr "för många rör eller indatafiler öppna"
-
-#: io.c:709
-msgid "close: second argument must be `to' or `from'"
-msgstr "close: andra argumentet måste vara \"to\" eller \"from\""
-
-#: io.c:723
-#, c-format
-msgid "close: `%.*s' is not an open file, pipe or co-process"
-msgstr "close: \"%.*s\" är inte en öppen fil, rör eller koprocess"
-
-#: io.c:727
-msgid "close of redirection that was never opened"
-msgstr "stängning av omdirigering som aldrig öppnades"
-
-#: io.c:754
-#, c-format
-msgid "close: redirection `%s' not opened with `|&', second argument ignored"
-msgstr ""
-"close: omdirigeringen \"%s\" öppnades inte med \"|&\", andra argumentet "
-"ignorerat"
-
-#: io.c:811
-#, c-format
-msgid "failure status (%d) on pipe close of `%s' (%s)"
-msgstr "felstatus (%d) från rörstängning av \"%s\" (%s)"
-
-#: io.c:814
-#, c-format
-msgid "failure status (%d) on file close of `%s' (%s)"
-msgstr "felstatus (%d) från filstängning av \"%s\" (%s)"
-
-#: io.c:833
-#, c-format
-msgid "no explicit close of socket `%s' provided"
-msgstr "ingen explicit stängning av uttaget \"%s\" tillhandahållen"
-
-#: io.c:836
-#, c-format
-msgid "no explicit close of co-process `%s' provided"
-msgstr "ingen explicit stängning av koprocessen \"%s\" tillhandahållen"
-
-#: io.c:839
-#, c-format
-msgid "no explicit close of pipe `%s' provided"
-msgstr "ingen explicit stängning av röret \"%s\" tillhandahållen"
-
-#: io.c:842
-#, c-format
-msgid "no explicit close of file `%s' provided"
-msgstr "ingen explicit stängning av filen \"%s\" tillhandahållen"
-
-#: io.c:871 io.c:925
-#, c-format
-msgid "error writing standard output (%s)"
-msgstr "fel vid skrivning till standard ut (%s)"
-
-#: io.c:875 io.c:929
-#, c-format
-msgid "error writing standard error (%s)"
-msgstr "fel vid skrivning till standard fel (%s)"
-
-#: io.c:883
-#, c-format
-msgid "pipe flush of `%s' failed (%s)."
-msgstr "rörspolning av \"%s\" misslyckades (%s)"
-
-#: io.c:886
-#, c-format
-msgid "co-process flush of pipe to `%s' failed (%s)."
-msgstr "koprocesspolning av röret till \"%s\" misslyckades (%s)"
-
-#: io.c:889
-#, c-format
-msgid "file flush of `%s' failed (%s)."
-msgstr "filspolning av \"%s\" misslyckades (%s)"
-
-#: io.c:1048
-msgid "/inet/raw client not ready yet, sorry"
-msgstr "/inet/raw-klient är tyvärr inte klar än"
-
-#: io.c:1050 io.c:1087
-msgid "only root may use `/inet/raw'."
-msgstr "bara root kan använda \"/inet/raw\"."
-
-#: io.c:1085
-msgid "/inet/raw server not ready yet, sorry"
-msgstr "/inet/raw-server inte redo än, ledsen"
-
-#: io.c:1175
-#, c-format
-msgid "no (known) protocol supplied in special filename `%s'"
-msgstr ""
-"inget (känt) protokoll tillhandahållet i det speciella filnamnet \"%s\""
-
-#: io.c:1193
-#, c-format
-msgid "special file name `%s' is incomplete"
-msgstr "speciellt filnamn \"%s\" är ofullständigt"
-
-#: io.c:1205
-#, c-format
-msgid "local port invalid in `%s'"
-msgstr "lokal port ogiltig i \"%s\""
-
-#: io.c:1217
-msgid "must supply a remote hostname to `/inet'"
-msgstr "måste tillhandahålla ett fjärrdatornamn till \"/inet\""
-
-#: io.c:1232
-msgid "must supply a remote port to `/inet'"
-msgstr "måste tillhandahålla en fjärrport till \"/inet\""
-
-#: io.c:1238
-#, c-format
-msgid "remote port invalid in `%s'"
-msgstr "fjärrporten ogiltig i \"%s\""
-
-#: io.c:1248
-msgid "TCP/IP communications are not supported"
-msgstr "TCP/IP-kommunikation stöds inte"
-
-#: io.c:1257 io.c:1438
-#, c-format
-msgid "file `%s' is a directory"
-msgstr "filen \"%s\" är en katalog"
-
-#: io.c:1327
-#, c-format
-msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
-msgstr "använd \"PROCINFO[\"%s\"]\" istället för \"%s\""
-
-#: io.c:1359
-msgid "use `PROCINFO[...]' instead of `/dev/user'"
-msgstr "använd \"PROCINFO[...]\" istället för \"dev/user\""
-
-#: io.c:1424
-#, c-format
-msgid "could not open `%s', mode `%s'"
-msgstr "kunde inte öppna \"%s\", läge \"%s\""
-
-#: io.c:1550 io.c:1602 io.c:1732 io.c:1754
-#, c-format
-msgid "moving pipe to stdout in child failed (dup: %s)"
-msgstr "flyttande av rör till standard ut i barnet misslyckades (dup: %s)"
-
-#: io.c:1554 io.c:1607
-#, c-format
-msgid "moving pipe to stdin in child failed (dup: %s)"
-msgstr "flyttande av rör till standard in i barnet misslyckades (dup: %s)"
+#~ 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"
-#: io.c:1571 io.c:1745
-msgid "restoring stdout in parent process failed\n"
-msgstr "återställande av standard ut i förälderprocessen misslyckades\n"
+#~ msgid "invalid syntax in name `%s' for variable assignment"
+#~ msgstr "ogiltig syntax i namnet \"%s\" för variabeltilldelning"
-#: io.c:1576
-msgid "restoring stdin in parent process failed\n"
-msgstr "återställande av standard in i förälderprocessen misslyckades\n"
+#~ msgid "or used in other expression context"
+#~ msgstr "eller använt i andra uttryckssammanhang"
-#: io.c:1599 io.c:1751
-#, c-format
-msgid "close of stdout in child failed (%s)"
-msgstr "stängning av standard ut i barnet misslyckades (%s)"
+#~ msgid "attempt to use function `%s' as array"
+#~ msgstr "försök att använda funktionen \"%s\" som vektor"
-#: io.c:1604
-#, c-format
-msgid "close of stdin in child failed (%s)"
-msgstr "stängning av standard in i barnet misslyckades (%s)"
+#~ msgid "`%s' is a function, assignment is not allowed"
+#~ msgstr "\"%s\" är en funktion, tilldelning är inte tillåtet"
-#: io.c:1610 io.c:1756 io.c:1767
-#, c-format
-msgid "close of pipe failed (%s)"
-msgstr "stängning av röret misslyckades (%s)"
+#~ msgid "BEGIN blocks must have an action part"
+#~ msgstr "BEGIN-block måste ha en åtgärdsdel"
-#: io.c:1655
-msgid "`|&' not supported"
-msgstr "\"|&\" stöds inte"
+#~ msgid "`nextfile' used in BEGIN or END action"
+#~ msgstr "\"nextfile\" använd i BEGIN- eller END-åtgärd"
-#: io.c:1722
-#, c-format
-msgid "cannot open pipe `%s' (%s)"
-msgstr "kan inte öppna röret \"%s\" (%s)"
+#~ msgid "non-redirected `getline' undefined inside BEGIN or END action"
+#~ msgstr ""
+#~ "icke omdirigerad \"getline\" odefinierade inuti BEGIN- eller END-åtgärd"
-#: io.c:1763
-#, c-format
-msgid "cannot create child process for `%s' (fork: %s)"
-msgstr "kan inte skapa barnprocess för \"%s\" (fork: %s)"
+#~ msgid "fptr %x not in tokentab\n"
+#~ msgstr "fptr %x är inte i tokentab\n"
-#: io.c:2104
-#, c-format
-msgid "data file `%s' is empty"
-msgstr "datafilen \"%s\" är tom"
+#~ msgid "gsub third parameter is not a changeable object"
+#~ msgstr "gsub: tredje argumentet är inte ett ändringsbart objekt"
-#: io.c:2175
-#, c-format
-msgid "internal error: file `%s', line %d\n"
-msgstr "internt fel: filen \"%s\", rad %d\n"
+#~ msgid "Unfinished \\ escape"
+#~ msgstr "Oavslutad \\-kontrollsekvens"
-#: io.c:2277
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "fel vid läsning av indatafilen \"%s\": %s"
+#~ msgid "unfinished repeat count"
+#~ msgstr "oavslutat upprepningsantal"
-#: io.c:2521
-msgid "multicharacter value of `RS' is a gawk extension"
-msgstr "flerteckensvärdet av \"RS\" är en gawk-utökning"
+#~ msgid "malformed repeat count"
+#~ msgstr "felaktigt utformat upprepningsantal"
-#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
-msgid "can't convert string to float"
-msgstr "kan inte konvertera en sträng till flyttal"
+#~ msgid "Unbalanced ["
+#~ msgstr "Obalanserad ["
-#: node.c:342
-msgid "backslash at end of string"
-msgstr "omvänt snedstreck i slutet av strängen"
+#~ msgid "Unbalanced ("
+#~ msgstr "Obalanserad ("
-#: node.c:524
-msgid "POSIX does not allow `\\x' escapes"
-msgstr "POSIX tillåter inte \"\\x\"-kontrollsekvenser"
-
-#: node.c:530
-msgid "no hex digits in `\\x' escape sequence"
-msgstr "inga hexadecimala siffror i \"\\x\"-kontrollsekvenser"
-
-#: node.c:564
-#, c-format
-msgid "escape sequence `\\%c' treated as plain `%c'"
-msgstr "kontrollsekvensen \"\\%c\" behandlad som bara \"%c\""
+#~ msgid "No regexp syntax bits specified"
+#~ msgstr "Inga syntaxbitar för reguljära uttryck angivna"
-#: re.c:208
-#, c-format
-msgid "regex match failed, not enough memory to match string \"%.*s%s\""
-msgstr ""
+#~ msgid "Unbalanced )"
+#~ msgstr "Obalanserad )"
-#: posix/gawkmisc.c:122
-#, c-format
-msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
-msgstr "%s %s \"%s\": kunde inte sätta stäng-vid-exec (fcntl: %s)"
+#~ msgid "out of memory"
+#~ msgstr "slut på minne"
-#~ 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 "internal error: file `%s', line %d\n"
+#~ msgstr "internt fel: filen \"%s\", rad %d\n"
diff --git a/po/tr.gmo b/po/tr.gmo
index d6569cff..6fb7194f 100644
--- a/po/tr.gmo
+++ b/po/tr.gmo
Binary files differ
diff --git a/po/tr.po b/po/tr.po
index 9c707ffc..e705e4dc 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -1,416 +1,889 @@
# Turkish translations for GNU awk messages
-# Copyright (C) 2002 Free Software Foundation, Inc.
-# Nilgün Belma Bugüner <nilgun@fide.org>, 2001, 2002.
+# 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.1a\n"
-"POT-Creation-Date: 2002-05-01 16:40+0300\n"
-"PO-Revision-Date: 2002-04-29 18:03+0300\n"
-"Last-Translator: Nilgün Belma Bugüner <nilgun@fide.org>\n"
+"Project-Id-Version: gawk 3.1.1k\n"
+"POT-Creation-Date: 2003-03-19 14:25+0200\n"
+"PO-Revision-Date: 2003-02-04 18:55+0200\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 0.9.6\n"
-# ÖNEMLİ: Türkçe iletileri elde edebilmek için 3.1.0 sürümünde
-# paketi yapılandırırken --with-included-gettext seçeneği
-# kullanılmalıdır.(GNU-TR - 07.07.2001)
-#: array.c:243 array.c:275 array.c:280 eval.c:483
+#: array.c:274 array.c:309 array.c:314 eval.c:494
#, c-format
msgid "attempt to use scalar `%s' as array"
msgstr "sayısal `%s' dizi olarak kullanılmaya çalışılıyor"
-#: array.c:304
+#: array.c:338
#, c-format
msgid "reference to uninitialized element `%s[\"%s\"]'"
msgstr "ön değer atanmamış öğeye ( %s[\"%s\"] ) başvuru yapılıyor"
-#: array.c:310
+#: array.c:344
#, c-format
msgid "subscript of array `%s' is null string"
msgstr "dizinin indisi `%s' bir null dizge"
-#: array.c:373 array.c:456
-#, c-format
-msgid "delete: illegal use of variable `%s' as array"
-msgstr "delete: `%s' değişkeninin dizi olarak kullanımı kuraldışı"
-
-#: array.c:406
+#: array.c:412 array.c:425 array.c:466
#, c-format
msgid "delete: index `%s' not in array `%s'"
msgstr "delete: `%s' indeksi `%s' dizisinde deÄŸil"
-#: array.c:571
+#: array.c:432 array.c:515
+#, c-format
+msgid "delete: illegal use of variable `%s' as array"
+msgstr "delete: `%s' değişkeninin dizi olarak kullanımı kuraldışı"
+
+#: array.c:633
#, c-format
msgid "%s: empty (null)\n"
msgstr "%s: boÅŸ (null)\n"
-#: array.c:576
+#: array.c:638
#, c-format
msgid "%s: empty (zero)\n"
msgstr "%s: boş (sıfır)\n"
-#: array.c:580
+#: array.c:642
#, c-format
msgid "%s: table_size = %d, array_size = %d\n"
msgstr "%s: tablo_uzunluÄŸu = %d, dizi_indisi = %d\n"
-#: array.c:612
+#: array.c:671
#, c-format
msgid "%s: is parameter\n"
msgstr "%s: parametredir\n"
-#: array.c:617
+#: array.c:676
#, c-format
msgid "%s: array_ref to %s\n"
msgstr "%s: %s için dizi başvurusu\n"
-#: array.c:844
+#: array.c:975
msgid "asort: first argument is not an array"
msgstr "asort: ilk argüman bir dizi değil"
-#: array.c:853
+#: array.c:984
msgid "asort: second argument is not an array"
msgstr "asort: ikinci argüman bir dizi değil"
-#: builtin.c:107
+#: 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
+msgid "statement may have no effect"
+msgstr "deyim bir etkiye sahip olmayabilir"
+
+#: awkgram.y:431 awkgram.y:451
+#, c-format
+msgid "`%s' used in %s action"
+msgstr "`%s' %s eyleminde kullanılmış"
+
+#: awkgram.y:444 awkgram.y:447
+msgid "`nextfile' is a gawk extension"
+msgstr "`nextfile' bir gawk uzantısıdır"
+
+#: awkgram.y:461
+msgid "`return' used outside function context"
+msgstr "`return' işlev bağlamının dışında kullanılmış"
+
+#: awkgram.y:500
+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:513 awkgram.y:520
+msgid "`delete array' is a gawk extension"
+msgstr "`delete array' bir gawk uzantısıdır"
+
+#: awkgram.y:528 awkgram.y:535
+msgid "`delete(array)' is a non-portable tawk extension"
+msgstr "`delete array' uyarlanabilir olmayan bir gawk uzantısıdır"
+
+#: awkgram.y:578
+msgid "multistage two-way pipelines don't work"
+msgstr "çok katlı iki yönlü veriyolları çalışmaz"
+
+#: awkgram.y:669
+msgid "regular expression on right of assignment"
+msgstr "düzenli ifade atamanın sağında"
+
+#: awkgram.y:679
+msgid "regular expression on left of `~' or `!~' operator"
+msgstr "düzenli ifade `~' ya da `!~' işlemiminin solunda"
+
+#: awkgram.y:687
+msgid "regular expression on right of comparison"
+msgstr "düzenli ifade karşılaştırmanın sağında"
+
+#: awkgram.y:754
+msgid "non-redirected `getline' undefined inside END action"
+msgstr "END eyleminin içinde yönlendirme yapmayan `getline' tanımsız"
+
+#: awkgram.y:781
+msgid "call of `length' without parentheses is not portable"
+msgstr "parantezsiz `length' çağrısı taşınabilir değil"
+
+#: awkgram.y:784
+msgid "call of `length' without parentheses is deprecated by POSIX"
+msgstr "parantezsiz `length' çağrısı POSIX'e uygun değil"
+
+#: awkgram.y:835
+msgid "invalid subscript expression"
+msgstr "indis ifadesi geçersiz"
+
+#: awkgram.y:1020
+msgid "unexpected newline or end of string"
+msgstr "beklenmeyen satırsonu ya da dizge sonu"
+
+#: awkgram.y:1115
+msgid "empty program text on command line"
+msgstr "komut satırında boş program metni"
+
+#: awkgram.y:1172
+#, 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:1207
+#, c-format
+msgid "can't read sourcefile `%s' (%s)"
+msgstr "kaynak dosyası `%s' okunamıyor (%s)"
+
+#: awkgram.y:1215
+#, c-format
+msgid "source file `%s' is empty"
+msgstr "kaynak dosyası `%s' boş"
+
+#: awkgram.y:1417 awkgram.y:1527 awkgram.y:1545 awkgram.y:1895 awkgram.y:1980
+msgid "source file does not end in newline"
+msgstr "kaynak dosyasının sonunda satırsonu eksik"
+
+#: awkgram.y:1481
+msgid "unterminated regexp ends with `\\' at end of file"
+msgstr "sonlandırılmamış düzenli ifade dosya sonunda `\\' ile bitiyor"
+
+#: awkgram.y:1501
+msgid "unterminated regexp"
+msgstr "sonlandırılmamış düzenli ifade"
+
+#: awkgram.y:1504
+msgid "unterminated regexp at end of file"
+msgstr "dosya sonunda sonlandırılmamış düzenli ifade"
+
+#: awkgram.y:1571
+msgid "use of `\\ #...' line continuation is not portable"
+msgstr "`\\ #...' satır uzatma kullanımı taşınabilir değil"
+
+#: awkgram.y:1583
+msgid "backslash not last character on line"
+msgstr "tersbölü satırdaki son karakter değil"
+
+#: awkgram.y:1628
+msgid "POSIX does not allow operator `**='"
+msgstr "`**=' iÅŸlemimi POSIX uyumlu deÄŸil"
+
+#: awkgram.y:1630
+msgid "old awk does not support operator `**='"
+msgstr "`**=' iÅŸlemimini eski awk desteklemiyor"
+
+#: awkgram.y:1639
+msgid "POSIX does not allow operator `**'"
+msgstr "`**' iÅŸlemimi POSIX uyumlu deÄŸil"
+
+#: awkgram.y:1641
+msgid "old awk does not support operator `**'"
+msgstr "`**' iÅŸlemimini eski awk desteklemiyor"
+
+#: awkgram.y:1672
+msgid "operator `^=' is not supported in old awk"
+msgstr "`^=' iÅŸlemimini eski awk desteklemiyor"
+
+#: awkgram.y:1680
+msgid "operator `^' is not supported in old awk"
+msgstr "`^' iÅŸlemimini eski awk desteklemiyor"
+
+#: awkgram.y:1764 awkgram.y:1781
+msgid "unterminated string"
+msgstr "sonlandırılmamış dizge"
+
+#: awkgram.y:1941
+#, c-format
+msgid "invalid char '%c' in expression"
+msgstr "ifade içinde '%c' karakteri geçersiz"
+
+#: awkgram.y:2001
+#, c-format
+msgid "`%s' is a gawk extension"
+msgstr "`%s' bir gawk uzantısıdır"
+
+#: awkgram.y:2004
+#, c-format
+msgid "`%s' is a Bell Labs extension"
+msgstr "`%s' bir Bell Laboratuarları uzantısıdır"
+
+#: awkgram.y:2007
+#, c-format
+msgid "POSIX does not allow `%s'"
+msgstr "`%s' POSIX uyumlu deÄŸil"
+
+#: awkgram.y:2011
+#, c-format
+msgid "`%s' is not supported in old awk"
+msgstr "`%s' eski awk tarafından desteklemiyor"
+
+#: awkgram.y:2038
+msgid "`goto' considered harmful!\n"
+msgstr "`goto' zararlı sayılır!\n"
+
+#: awkgram.y:2102
+#, 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:2121 awkgram.y:2124
+msgid "match: third argument is a gawk extension"
+msgstr "match: üçüncü argüman bir gawk uzantısı"
+
+#: awkgram.y:2137
+#, 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:2140
+#, c-format
+msgid "%s third parameter is not a changeable object"
+msgstr "üçüncü %s parametresi değiştirilebilir bir nesne değil"
+
+#: awkgram.y:2167 awkgram.y:2170
+msgid "close: second argument is a gawk extension"
+msgstr "close: ikinci argüman bir gawk uzantısı"
+
+#: awkgram.y:2180
+msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
+msgstr "dcgettext(_\"...\") kullanımı yanlış: altçizgiyi kaldırın"
+
+#: awkgram.y:2195
+msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
+msgstr "dcngettext(_\"...\") kullanımı yanlış: altçizgiyi kaldırın"
+
+#: awkgram.y:2266
+#, c-format
+msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
+msgstr "`%s' işlevi: %d. parametre, `%s', %d. parametrenin tekrarı"
+
+#: awkgram.y:2299
+#, c-format
+msgid "function `%s': parameter `%s' shadows global variable"
+msgstr "`%s' işlevi: parametre, `%s'global değişkeni gölgeliyor"
+
+#: awkgram.y:2411
+#, c-format
+msgid "could not open `%s' for writing (%s)"
+msgstr "`%s' yazmak için açılamadı (%s)"
+
+#: awkgram.y:2412 profile.c:93
+msgid "sending profile to standard error"
+msgstr "profil standart hataya gönderiliyor"
+
+#: awkgram.y:2442
+#, c-format
+msgid "%s: close failed (%s)"
+msgstr "%s: kapatma başarısız (%s)"
+
+#: awkgram.y:2566
+msgid "shadow_funcs() called twice!"
+msgstr "shadow_funcs() iki kere çağrıldı!"
+
+#: awkgram.y:2593
+msgid "there were shadowed variables."
+msgstr "gölgeli değişkenler vardı."
+
+#: awkgram.y:2666
+#, 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:2676
+#, c-format
+msgid "function name `%s' previously defined"
+msgstr "işlev ismi `%s' önceden atanmış"
+
+#: awkgram.y:2827 awkgram.y:2833
+#, c-format
+msgid "function `%s' called but never defined"
+msgstr "`%s' işlevi çağrıldı ama hiç atanmamış"
+
+#: awkgram.y:2836
+#, c-format
+msgid "function `%s' defined but never called"
+msgstr "`%s' işlevi atanmış ama hiç çağrılmadı"
+
+#: awkgram.y:2863
+#, c-format
+msgid "regexp constant for parameter #%d yields boolean value"
+msgstr "%d numaralı argüman bir düzenli ifade sabiti"
+
+#: awkgram.y:2876
+#, 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:2878
+msgid "or used as a variable or an array"
+msgstr "ya da bir değişken ya da dizi olarak kullanılmış"
+
+#: builtin.c:111
#, c-format
msgid "%s to \"%s\" failed (%s)"
msgstr "%s \"%s\"ya yazılamadı (%s)"
-#: builtin.c:108
+#: builtin.c:112
msgid "standard output"
msgstr "standart çıktı"
-#: builtin.c:109
+#: builtin.c:113
msgid "reason unknown"
msgstr "sebebi bilinmiyor"
-#: builtin.c:122
+#: builtin.c:126
msgid "exp: received non-numeric argument"
msgstr "exp: sayısal olmayan argüman alındı"
-#: builtin.c:128
+#: builtin.c:132
#, c-format
msgid "exp: argument %g is out of range"
msgstr "exp: %g kapsamdışı"
-#: builtin.c:186
+#: builtin.c:190
#, c-format
msgid "fflush: cannot flush: pipe `%s' opened for reading, not writing"
msgstr ""
"fflush: kanala yazılamadı: veriyolu `%s' okumak için açıldı, yazmak için "
"deÄŸil"
-#: builtin.c:189
+#: builtin.c:193
#, c-format
msgid "fflush: cannot flush: file `%s' opened for reading, not writing"
msgstr ""
"fflush: kanala yazılamadı: dosya `%s' okumak için açıldı, yazmak için değil"
-#: builtin.c:201
+#: builtin.c:205
#, c-format
msgid "fflush: `%s' is not an open file, pipe or co-process"
msgstr "fflush: `%s' bir açık dosya, veriyolu ya da bir yan işlem değil"
-#: builtin.c:295
+#: builtin.c:299
msgid "index: received non-string first argument"
msgstr "index: ilk argüman dizge olmayan türde alındı"
-#: builtin.c:297
+#: builtin.c:301
msgid "index: received non-string second argument"
msgstr "index: ikinci argüman dizge olmayan türde alındı"
-#: builtin.c:407
+#: builtin.c:411
msgid "int: received non-numeric argument"
msgstr "int: sayısal olmayan argüman alındı"
-#: builtin.c:424
+#: builtin.c:428
msgid "length: received non-string argument"
msgstr "length: dizge olmayan argüman alındı"
-#: builtin.c:440
+#: builtin.c:444
msgid "log: received non-numeric argument"
msgstr "log: sayısal olmayan argüman alındı"
-#: builtin.c:443
+#: builtin.c:447
#, c-format
msgid "log: received negative argument %g"
msgstr "log: negatif argüman %g alındı"
-#: builtin.c:605 builtin.c:608
+#: builtin.c:609 builtin.c:612
msgid "must use `count$' on all formats or none"
msgstr "tüm biçemlerde ya `count$' kullanmalısınız ya da hiçbir şey"
-#: builtin.c:703
+#: builtin.c:714
msgid "`$' is not permitted in awk formats"
msgstr "`$' awk biçemlerde kullanılmaz"
-#: builtin.c:709
+#: builtin.c:720
msgid "arg count with `$' must be > 0"
msgstr "`$' ile birlikte verilen argüman sayısı > 0 olmalıdır"
-#: builtin.c:711
+#: builtin.c:722
#, c-format
-msgid "arg count %d greater than total number of supplied arguments"
-msgstr "argüman sayısı %d sağlanmış toplam argüman sayısından büyük olmalıdır"
+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:713
+#: builtin.c:724
msgid "`$' not permitted after period in format"
msgstr "`$' biçem içinde noktadan sonra kullanılmaz"
-#: builtin.c:726
+#: builtin.c:737
msgid "no `$' supplied for positional field width or precision"
msgstr "konumsal alan genişliği ya da duyarlığı için `$' kullanılmamış"
-#: builtin.c:784
+#: builtin.c:795
msgid "`l' is meaningless in awk formats; ignored"
msgstr "`l' awk biçemlerde anlamsız; yoksayıldı"
-#: builtin.c:788
+#: builtin.c:799
msgid "`l' is not permitted in POSIX awk formats"
msgstr "`l' POSIX awk biçemlerde kullanılmaz"
-#: builtin.c:799
+#: builtin.c:810
msgid "`L' is meaningless in awk formats; ignored"
msgstr "`L' awk biçemlerde anlamsız; yoksayıldı"
-#: builtin.c:803
+#: builtin.c:814
msgid "`L' is not permitted in POSIX awk formats"
msgstr "`L' POSIX awk biçemlerde kullanılmaz"
-#: builtin.c:814
+#: builtin.c:825
msgid "`h' is meaningless in awk formats; ignored"
msgstr "`h' awk biçemlerde anlamsız; yoksayıldı"
-#: builtin.c:818
+#: builtin.c:829
msgid "`h' is not permitted in POSIX awk formats"
msgstr "`h' POSIX awk biçemlerde kullanılmaz"
-#: builtin.c:1067
+#: builtin.c:1078
msgid "not enough arguments to satisfy format string"
msgstr "biçem dizgesini oluşturacak yeterli argüman yok"
-#: builtin.c:1069
+#: builtin.c:1080
msgid "^ ran out for this one"
msgstr "bir bunun için ^ tükendi"
-#: builtin.c:1074
+#: builtin.c:1085
msgid "[s]printf: format specifier does not have control letter"
msgstr "[s]printf: biçem belirteci denetim karakteri içermiyor"
-#: builtin.c:1077
+#: builtin.c:1088
msgid "too many arguments supplied for format string"
msgstr "biçem dizgesi için çok fazla argüman sağlanmış"
-#: builtin.c:1120 builtin.c:1123
+#: builtin.c:1154 builtin.c:1157
msgid "printf: no arguments"
msgstr "printf: argüman yok"
-#: builtin.c:1156
+#: builtin.c:1181
msgid "sqrt: received non-numeric argument"
msgstr "sqrt: sayısal olmayan argüman alındı"
-#: builtin.c:1160
+#: builtin.c:1185
#, c-format
msgid "sqrt: called with negative argument %g"
msgstr "sqrt: negatif argüman %g ile çağrıldı"
-#: builtin.c:1182
+#: builtin.c:1207
#, c-format
msgid "substr: start index %g is invalid, using 1"
msgstr "substr: başlangıç indeksi olarak %g geçersiz, 1 kullanılıyor"
-#: builtin.c:1187
+#: builtin.c:1212
#, c-format
msgid "substr: non-integer start index %g will be truncated"
msgstr ""
"substr: tamsayı olmayan başlangıç indeksi %g den ondalık kısım çıkarılacak"
-#: builtin.c:1201
+#: builtin.c:1231
#, c-format
msgid "substr: length %g is <= 0"
msgstr "substr: uzunluk %g <= 0 dır"
-#: builtin.c:1207
+#: builtin.c:1233
+#, c-format
+msgid "substr: length %g is < 0"
+msgstr "substr: uzunluk %g < 0"
+
+#: builtin.c:1240
#, c-format
msgid "substr: non-integer length %g will be truncated"
msgstr "substr: tamsayı olmayan uzunluk %g den ondalık kısım çıkarılacak"
-#: builtin.c:1214
+#: builtin.c:1245
+#, 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:1257
msgid "substr: source string is zero length"
msgstr "substr: kaynak dizge sıfır uzunlukta"
-#: builtin.c:1221
+#: builtin.c:1263
+#, c-format
+msgid "substr: start index %g is past end of string"
+msgstr "substr: başlangıç indisi %g dizgenin sonundan sonra"
+
+#: builtin.c:1271
#, c-format
msgid ""
-"substr: length %d at start index %d exceeds length of first argument (%d)"
+"substr: length %g at start index %g exceeds length of first argument (%lu)"
msgstr ""
-"substr: uzunluk %d, %d başlangıç indeksinde ilk argümanın uzunluğunu (%d) "
+"substr: uzunluk %g, %g başlangıç indisinde ilk argümanın uzunluğunu (%lu) "
"aÅŸar"
-#: builtin.c:1227
-#, c-format
-msgid "substr: start index %d is past end of string"
-msgstr "substr: başlangıç indeksi %d dizgenin sonundan sonra"
-
-#: builtin.c:1263
+#: builtin.c:1306
msgid "strftime: received non-string first argument"
msgstr "strftime: ilk argüman dizge olmayan türde alındı"
-#: builtin.c:1269
+#: builtin.c:1312
msgid "strftime: received empty format string"
msgstr "strftime: boş biçem dizgesi alındı"
-#: builtin.c:1278
+#: builtin.c:1321
msgid "strftime: received non-numeric second argument"
msgstr "strftime: ikinci argüman sayısal olmayan türde alındı"
-#: builtin.c:1341
+#: builtin.c:1384
msgid "mktime: received non-string argument"
msgstr "mktime: dizge olmayan argüman alındı"
-#: builtin.c:1386
+#: builtin.c:1429
msgid "system: received non-string argument"
msgstr "system: dizge olmayan argüman alındı"
-#: builtin.c:1512
+#: builtin.c:1573
msgid "tolower: received non-string argument"
msgstr "tolower: dizge olmayan argüman alındı"
-#: builtin.c:1561
+#: builtin.c:1622
msgid "toupper: received non-string argument"
msgstr "toupper: dizge olmayan argüman alındı"
-#: builtin.c:1606
+#: builtin.c:1667
msgid "atan2: received non-numeric first argument"
msgstr "atan2: ilk argüman sayısal olmayan türde alındı"
-#: builtin.c:1608
+#: builtin.c:1669
msgid "atan2: received non-numeric second argument"
msgstr "atan2: ikinci argüman sayısal olmayan türde alındı"
-#: builtin.c:1627
+#: builtin.c:1688
msgid "sin: received non-numeric argument"
msgstr "sin: sayısal olmayan argüman alındı"
-#: builtin.c:1643
+#: builtin.c:1704
msgid "cos: received non-numeric argument"
msgstr "cos: sayısal olmayan argüman alındı"
-#: builtin.c:1687
+#: builtin.c:1748
msgid "srand: received non-numeric argument"
msgstr "srand: sayısal olmayan argüman alındı"
-#: builtin.c:1721
+#: builtin.c:1787
msgid "match: third argument is not an array"
msgstr "match: üçüncü argüman bir dizi değil"
-#: builtin.c:2157
+#: builtin.c:2264
msgid "gensub: 3rd argument of 0 treated as 1"
msgstr "gensub: 0 olan 3. argüman 1 kabul edildi"
-#: builtin.c:2268 builtin.c:2270
+#: builtin.c:2375 builtin.c:2377
msgid "lshift: received non-numeric first argument"
msgstr "lshift: ilk argüman sayısal olmayan türde alındı"
-#: builtin.c:2272
+#: builtin.c:2379
#, c-format
msgid "lshift(%lf, %lf): negative values will give strange results"
msgstr "lshift(%lf, %lf): negatif değerler tuhaf sonuçlar verecek"
-#: builtin.c:2274
+#: builtin.c:2381
#, c-format
msgid "lshift(%lf, %lf): fractional values will be truncated"
msgstr "lshift(%lf, %lf): tamsayı kısım kalacak şekilde kalanı atılacak"
-#: builtin.c:2276
+#: builtin.c:2383
#, c-format
msgid "lshift(%lf, %lf): too large shift value will give strange results"
msgstr "lshift(%lf, %lf): çok büyük kaydırma değeri tuhaf sonuçlar verecek"
-#: builtin.c:2305 builtin.c:2307
+#: builtin.c:2412 builtin.c:2414
msgid "rshift: received non-numeric first argument"
msgstr "rshift: ilk argüman sayısal olmayan türde alındı"
-#: builtin.c:2309
+#: builtin.c:2416
#, c-format
msgid "rshift(%lf, %lf): negative values will give strange results"
msgstr "rshift(%lf, %lf): negatif değerler tuhaf sonuçlar verecek"
-#: builtin.c:2311
+#: builtin.c:2418
#, c-format
msgid "rshift(%lf, %lf): fractional values will be truncated"
msgstr "rshift(%lf, %lf): tamsayı kısım kalacak şekilde kalanı atılacak"
-#: builtin.c:2313
+#: builtin.c:2420
#, c-format
msgid "rshift(%lf, %lf): too large shift value will give strange results"
msgstr "rshift(%lf, %lf): çok büyük kaydırma değeri tuhaf sonuçlar verecek"
-#: builtin.c:2342 builtin.c:2344
+#: builtin.c:2449 builtin.c:2451
msgid "and: received non-numeric first argument"
msgstr "and: ilk argüman sayısal olmayan türde alındı"
-#: builtin.c:2346
+#: builtin.c:2453
#, c-format
msgid "and(%lf, %lf): negative values will give strange results"
msgstr "and(%lf, %lf): negatif değerler tuhaf sonuçlar verecek"
-#: builtin.c:2348
+#: builtin.c:2455
#, c-format
msgid "and(%lf, %lf): fractional values will be truncated"
msgstr "and(%lf, %lf): tamsayı kısım kalacak şekilde kalanı atılacak"
-#: builtin.c:2377 builtin.c:2379
+#: builtin.c:2484 builtin.c:2486
msgid "or: received non-numeric first argument"
msgstr "or: ilk argüman sayısal olmayan türde alındı"
-#: builtin.c:2381
+#: builtin.c:2488
#, c-format
msgid "or(%lf, %lf): negative values will give strange results"
msgstr "or(%lf, %lf): negatif değerler tuhaf sonuçlar verecek"
-#: builtin.c:2383
+#: builtin.c:2490
#, c-format
msgid "or(%lf, %lf): fractional values will be truncated"
msgstr "or(%lf, %lf): tamsayı kısım kalacak şekilde kalanı atılacak"
-#: builtin.c:2412 builtin.c:2414
+#: builtin.c:2519 builtin.c:2521
msgid "xor: received non-numeric first argument"
msgstr "xor: ilk argüman sayısal olmayan türde alındı"
-#: builtin.c:2416
+#: builtin.c:2523
#, c-format
msgid "xor(%lf, %lf): negative values will give strange results"
msgstr "xor(%lf, %lf): negatif değerler tuhaf sonuçlar verecek"
-#: builtin.c:2418
+#: builtin.c:2525
#, c-format
msgid "xor(%lf, %lf): fractional values will be truncated"
msgstr "xor(%lf, %lf): tamsayı kısım kalacak şekilde kalanı atılacak"
-#: builtin.c:2446
+#: builtin.c:2553
msgid "compl: received non-numeric argument"
msgstr "compl: sayısal olmayan argüman alındı"
-#: builtin.c:2448
+#: builtin.c:2555
#, c-format
msgid "compl(%lf): negative value will give strange results"
msgstr "compl(%lf): negatif değerler tuhaf sonuçlar verecek"
-#: builtin.c:2450
+#: builtin.c:2557
#, c-format
msgid "compl(%lf): fractional value will be truncated"
msgstr "compl(%lf): tamsayı kısım kalacak şekilde kalanı atılacak"
-#: builtin.c:2621
+#: builtin.c:2728
#, c-format
msgid "dcgettext: `%s' is not a valid locale category"
msgstr "dcgettext: `%s' geçerli bir yerel kategori değil"
+#: eval.c:262
+#, c-format
+msgid "unknown nodetype %d"
+msgstr "%d. düğümtürü bilinmiyor"
+
+#: eval.c:310
+msgid "buffer overflow in genflags2str"
+msgstr "genflags2str içinde tampon taştı"
+
+#: eval.c:555
+#, 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:576
+msgid "`break' outside a loop is not portable"
+msgstr "döngü dışında `break' kullanımı taşınabilir değil"
+
+#: eval.c:580
+msgid "`break' outside a loop is not allowed"
+msgstr "döngü dışında `break' kullanımı yasak"
+
+#: eval.c:597
+msgid "`continue' outside a loop is not portable"
+msgstr "döngü dışında `continue' kullanımı taşınabilir değil"
+
+#: eval.c:601
+msgid "`continue' outside a loop is not allowed"
+msgstr "döngü dışında `continue' kullanımı yasak"
+
+#: eval.c:635
+msgid "`next' cannot be called from a BEGIN rule"
+msgstr "`next' bir BEGIN kuralından çağrılamaz"
+
+#: eval.c:637
+msgid "`next' cannot be called from an END rule"
+msgstr "`next' bir END kuralından çağrılamaz"
+
+#: eval.c:646
+msgid "`nextfile' cannot be called from a BEGIN rule"
+msgstr "`nextfile' bir BEGIN kuralından çağrılamaz"
+
+#: eval.c:648
+msgid "`nextfile' cannot be called from an END rule"
+msgstr "`nextfile' bir END kuralından çağrılamaz"
+
+#: eval.c:696
+msgid "statement has no effect"
+msgstr "deyim etkisiz"
+
+#: eval.c:731 eval.c:761 eval.c:1733
+#, c-format
+msgid "reference to uninitialized variable `%s'"
+msgstr "öndeğer ataması yapılmamış `%s' değişkenine başvuru"
+
+#: eval.c:739 eval.c:1721
+#, 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:746 eval.c:752
+#, c-format
+msgid "reference to uninitialized argument `%s'"
+msgstr "başlangıç değeri olmayan `%s' argümanına başvuru"
+
+#: eval.c:810 eval.c:1728 profile.c:773
+#, 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:910
+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:935
+msgid "assignment used in conditional context"
+msgstr "koşul bağlamında atama yapılmış"
+
+#: eval.c:1026
+msgid "division by zero attempted"
+msgstr "sıfırla bölme hatası"
+
+#: eval.c:1041
+#, c-format
+msgid "division by zero attempted in `%%'"
+msgstr "`%%'de sıfırla bölme hatası"
+
+#: eval.c:1056 profile.c:649
+#, c-format
+msgid "illegal type (%s) in tree_eval"
+msgstr "tree_eval içinde kuraldışı tür (%s)"
+
+#: eval.c:1232
+msgid "division by zero attempted in `/='"
+msgstr "`/='de sıfırla bölme hatası"
+
+#: eval.c:1250
+#, c-format
+msgid "division by zero attempted in `%%='"
+msgstr "`%%='de sıfırla bölme hatası"
+
+#: eval.c:1510
+#, c-format
+msgid "%s (from %s)"
+msgstr "%s (%s'den)"
+
+#: eval.c:1569
+#, 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:1628
+#, c-format
+msgid "function `%s' not defined"
+msgstr "`%s' işlevi tanımsız"
+
+#: eval.c:1634
+#, c-format
+msgid "function %s called\n"
+msgstr "%s işlevi çağrıldı\n"
+
+#: eval.c:1693
+msgid ""
+"\n"
+"\t# Function Call Stack:\n"
+"\n"
+msgstr ""
+"\n"
+"\t# İşlev Çağrı Yığını:\n"
+"\n"
+
+#: eval.c:1696
+msgid "\t# -- main --\n"
+msgstr "\t# -- main --\n"
+
+#: eval.c:1850
+msgid "attempt to field reference from non-numeric value"
+msgstr "sayısal olmayan değerden alan başvurusu"
+
+#: eval.c:1852
+msgid "attempt to reference from null string"
+msgstr "null dizgeden alan baÅŸvurusu"
+
+#: eval.c:1858
+#, c-format
+msgid "attempt to access field %d"
+msgstr "%d. alana erişilmeye çalışılıyor"
+
+#: eval.c:1874
+#, c-format
+msgid "attempt to use scalar parameter `%s' as an array"
+msgstr "sayısal paramaetre `%s' bir dizi olarak kullanılmaya çalışılıyor"
+
+#: eval.c:1886 eval.c:1893 profile.c:865
+msgid "assignment is not allowed to result of builtin function"
+msgstr "deÄŸiÅŸken ismine yerleÅŸik iÅŸlevin sonucu atanamaz"
+
+#: eval.c:1941
+msgid "`IGNORECASE' is a gawk extension"
+msgstr "`IGNORECASE' bir gawk uzantısıdır"
+
+#: eval.c:1970
+msgid "`BINMODE' is a gawk extension"
+msgstr "`BINMODE' bir gawk uzantısıdır"
+
+#: eval.c:2082
+#, c-format
+msgid "bad `%sFMT' specification `%s'"
+msgstr "`%sFMT' özelliği `%s' hatalı"
+
+#: eval.c:2160
+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"
@@ -425,10 +898,35 @@ msgstr "extension: `%s' açılamıyor (%s)\n"
msgid "extension: library `%s': cannot call function `%s' (%s)\n"
msgstr "extension: kitaplık `%s': `%s' işlevi çağrılamıyor (%s)\n"
-#: ext.c:180
+#: ext.c:181
msgid "Operation Not Supported"
msgstr "Ä°ÅŸlem Desteklenmiyor"
+#: field.c:321
+msgid "NF set to negative value"
+msgstr "NF negatif değere ayarlı"
+
+#: field.c:819
+msgid "split: second argument is not an array"
+msgstr "split: ikinci argüman bir dizi değil"
+
+#: field.c:854
+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:906
+msgid "`FIELDWIDTHS' is a gawk extension"
+msgstr "`FIELDWIDTHS' bir gawk uzantısıdır"
+
+#: field.c:933
+#, c-format
+msgid "field %d in FIELDWIDTHS, must be > 0"
+msgstr "FIELDWIDTHS içindeki %d. alan > 0 olmalı"
+
+#: field.c:1006
+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"
@@ -469,7 +967,7 @@ msgstr "%s: kuraldışı seçenek -- %c\n"
msgid "%s: invalid option -- %c\n"
msgstr "%s: geçersiz seçenek -- %c\n"
-#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:412
+#: getopt.c:962 getopt.c:973 getopt.c:1159 getopt.c:1172 main.c:431
#, c-format
msgid "%s: option requires an argument -- %c\n"
msgstr "%s: seçenek bir argümanla kullanılır -- %c\n"
@@ -484,167 +982,471 @@ msgstr "%s: `-W %s' seçeneği belirsiz\n"
msgid "%s: option `-W %s' doesn't allow an argument\n"
msgstr "%s: `-W %s' seçeneği argümansız kullanılır\n"
-#: main.c:307
+#: io.c:257
+#, c-format
+msgid "cannot open file `%s' for reading (%s)"
+msgstr "`%s' okumak için açılamıyor (%s)"
+
+#: io.c:344
+#, c-format
+msgid "close of fd %d (`%s') failed (%s)"
+msgstr "dosya tanımlayıcı %d (`%s') başarısız (%s)"
+
+#: io.c:482
+#, c-format
+msgid "invalid tree type %s in redirect()"
+msgstr "redirect() içindeki ağaç türü %s geçersiz"
+
+#: io.c:488
+#, 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:494
+#, 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:499
+#, 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:521
+#, c-format
+msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
+msgstr "`%.*s' dosyası için `>' ve `>>' karışımı gereksiz"
+
+#: io.c:573
+#, c-format
+msgid "can't open pipe `%s' for output (%s)"
+msgstr "`%s' veriyolu çıktı için açılamadı (%s)"
+
+#: io.c:582
+#, c-format
+msgid "can't open pipe `%s' for input (%s)"
+msgstr "`%s' veriyolu girdi için açılamadı (%s)"
+
+#: io.c:595
+#, 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:599
+#, 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:675
+#, c-format
+msgid "can't redirect from `%s' (%s)"
+msgstr "`%s'den yönlendirilemiyor (%s)"
+
+#: io.c:678
+#, c-format
+msgid "can't redirect to `%s' (%s)"
+msgstr "`%s'e yönlendirilemiyor (%s)"
+
+#: io.c:717
+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:729
+#, c-format
+msgid "close of `%s' failed (%s)."
+msgstr "`%s' kapatılamadı (%s)."
+
+#: io.c:736
+msgid "too many pipes or input files open"
+msgstr "çok fazla veriyolu ya da dosya açık"
+
+#: io.c:759
+msgid "close: second argument must be `to' or `from'"
+msgstr "close: ikinci argüman `to' ya da `from' olmalı"
+
+#: io.c:773
+#, 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:777
+msgid "close of redirection that was never opened"
+msgstr "hiç açılmamış bir yönlendirmenin kapatılması"
+
+#: io.c:804
+#, 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:866
+#, 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:869
+#, 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:888
+#, c-format
+msgid "no explicit close of socket `%s' provided"
+msgstr "`%s' soketinin açıkça kapatılması istenmedi"
+
+#: io.c:891
+#, c-format
+msgid "no explicit close of co-process `%s' provided"
+msgstr "`%s' alt-işleminin açıkça kapatılması istenmedi"
+
+#: io.c:894
+#, c-format
+msgid "no explicit close of pipe `%s' provided"
+msgstr "`%s' veriyolunun açıkça kapatılması istenmedi"
+
+#: io.c:897
+#, c-format
+msgid "no explicit close of file `%s' provided"
+msgstr "`%s' dosyasının açıkça kapatılması istenmedi"
+
+#: io.c:926 io.c:980
+#, c-format
+msgid "error writing standard output (%s)"
+msgstr "standart çıktıya yazarken hata (%s)"
+
+#: io.c:930 io.c:984
+#, c-format
+msgid "error writing standard error (%s)"
+msgstr "standart hataya yazarken hata (%s)"
+
+#: io.c:938
+#, c-format
+msgid "pipe flush of `%s' failed (%s)."
+msgstr "`%s'in veriyolu ile veri aktarımı başarısız (%s)."
+
+#: io.c:941
+#, 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:944
+#, c-format
+msgid "file flush of `%s' failed (%s)."
+msgstr "`%s'in dosya ile veri aktarımı başarısız (%s)."
+
+#: io.c:1103
+msgid "/inet/raw client not ready yet, sorry"
+msgstr "/inet/raw istemci henüz hazır değil"
+
+#: io.c:1105 io.c:1142
+msgid "only root may use `/inet/raw'."
+msgstr "`/inet/raw' sadece root tarafından kullanılabilir"
+
+#: io.c:1140
+msgid "/inet/raw server not ready yet, sorry"
+msgstr "/inet/raw sunucu henüz hazır değil"
+
+#: io.c:1230
+#, 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:1248
+#, c-format
+msgid "special file name `%s' is incomplete"
+msgstr "özel dosya ismi `%s' tamamlanmamış"
+
+#: io.c:1260
+#, c-format
+msgid "local port invalid in `%s'"
+msgstr "`%s' deki yerel port geçersiz"
+
+#: io.c:1272
+msgid "must supply a remote hostname to `/inet'"
+msgstr "`/inet' e bir karşı makina ismi sağlanmalı"
+
+#: io.c:1287
+msgid "must supply a remote port to `/inet'"
+msgstr "`/inet' e bir karşı port sağlanmalı"
+
+#: io.c:1293
+#, c-format
+msgid "remote port invalid in `%s'"
+msgstr "`%s' de karşı port geçersiz"
+
+#: io.c:1303
+msgid "TCP/IP communications are not supported"
+msgstr "TCP/IP haberleÅŸmesi desteklenmiyor"
+
+#: io.c:1312 io.c:1492
+#, c-format
+msgid "file `%s' is a directory"
+msgstr "`%s' dosya deÄŸil dizin"
+
+#: io.c:1381
+#, c-format
+msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
+msgstr "`PROCINFO[\"%s\"]' kullanın (`%s' yerine)"
+
+#: io.c:1413
+msgid "use `PROCINFO[...]' instead of `/dev/user'"
+msgstr "`/dev/user' yerine `PROCINFO[...]' kullanın"
+
+#: io.c:1478 io.c:1652
+#, c-format
+msgid "could not open `%s', mode `%s'"
+msgstr "`%s', `%s' kipinde açılamadı"
+
+#: io.c:1703
+#, c-format
+msgid "close of master pty failed (%s)"
+msgstr "ana pty kapatılamadı (%s)"
+
+#: io.c:1705 io.c:1857 io.c:2009
+#, c-format
+msgid "close of stdout in child failed (%s)"
+msgstr "ast süreçte stdÇ kapatılamadı (%s)"
+
+#: io.c:1708
+#, 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:1710 io.c:1862
+#, c-format
+msgid "close of stdin in child failed (%s)"
+msgstr "ast süreçte stdG kapatılamadı (%s)"
+
+#: io.c:1713
+#, 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:1715 io.c:1734
+#, c-format
+msgid "close of slave pty failed (%s)"
+msgstr "yardımcı pty kapatılamadı (%s)"
+
+#: io.c:1808 io.c:1860 io.c:1990 io.c:2012
+#, 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:1812 io.c:1865
+#, 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:1829 io.c:2003
+msgid "restoring stdout in parent process failed\n"
+msgstr "üst süreçte stdÇ eski durumuna getirilemedi\n"
+
+#: io.c:1834
+msgid "restoring stdin in parent process failed\n"
+msgstr "üst süreçte stdG eski durumuna getirilemedi\n"
+
+#: io.c:1868 io.c:2014 io.c:2025
+#, c-format
+msgid "close of pipe failed (%s)"
+msgstr "veriyolu kapatılamadı (%s)"
+
+#: io.c:1913
+msgid "`|&' not supported"
+msgstr "`|&' desteklenmiyor"
+
+#: io.c:1980
+#, c-format
+msgid "cannot open pipe `%s' (%s)"
+msgstr "`%s' veriyolu açılamıyor (%s)"
+
+#: io.c:2021
+#, 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:2364
+#, c-format
+msgid "data file `%s' is empty"
+msgstr "veri dosyası `%s' boş"
+
+#: io.c:2407 io.c:2415
+msgid "could not allocate more input memory"
+msgstr ""
+
+#: io.c:2540 io.c:2782 io.c:3046
+#, c-format
+msgid "error reading input file `%s': %s"
+msgstr "`%s' girdi dosyası okunurken hata: %s"
+
+#: io.c:3281
+msgid "multicharacter value of `RS' is a gawk extension"
+msgstr "`RS' çoklu karakter değeri bir gawk uzantısıdır"
+
+#: main.c:322
msgid "`-m[fr]' option irrelevant in gawk"
msgstr "`-m[fr]' seçeneği gawk'da böyle kullanılmaz"
-#: main.c:309
+#: main.c:324
msgid "-m option usage: `-m[fr] nnn'"
msgstr "-m seçeneğinin kullanımı: `-m[fr] nnn'"
-#: main.c:326
+#: main.c:341
#, c-format
msgid "%s: option `-W %s' unrecognized, ignored\n"
msgstr "%s: `-W %s' seçeneği tanımlı değil, yok sayıldı\n"
-#: main.c:357
+#: main.c:378
msgid "empty argument to `--source' ignored"
msgstr "`--source' seçeneği için boş argüman yoksayıldı"
-#: main.c:429
+#: main.c:448
msgid "environment variable `POSIXLY_CORRECT' set: turning on `--posix'"
msgstr "ortam değişkeni `POSIXLY_CORRECT' var: `--posix' kullanılıyor"
-#: main.c:434
+#: main.c:453
msgid "`--posix' overrides `--traditional'"
msgstr "`--posix' seçeneği `--traditional' seçeneğini etkisiz kılar"
-#: main.c:445
+#: main.c:464
msgid "`--posix'/`--traditional' overrides `--non-decimal-data'"
msgstr ""
"`--posix'/`--traditional' seçenekleri `--non-decimal-data' seçeneğini "
"etkisiz kılar"
-#: main.c:449
+#: main.c:468
#, c-format
msgid "running %s setuid root may be a security problem"
msgstr "%s root yetkileriyle çalıştırıldığında güvenlik sorunları olabilir"
-#: main.c:478
+#: main.c:509
#, c-format
-msgid "can't set mode on stdin (%s)"
-msgstr "standart girdide kip belirlenemiyor (%s)"
+msgid "can't set binary mode on stdin (%s)"
+msgstr "standart girdi ikilik kipe ayarlanamaz (%s)"
-#: main.c:481
+#: main.c:512
#, c-format
-msgid "can't set mode on stdout (%s)"
-msgstr "standart çıktıda kip belirlenemiyor (%s)"
+msgid "can't set binary mode on stdout (%s)"
+msgstr "standart çıktı ikilik kipe ayarlanamaz (%s)"
-#: main.c:483
+#: main.c:514
#, c-format
-msgid "can't set mode on stderr (%s)"
-msgstr "standart hatada kip belirlenemiyor (%s)"
+msgid "can't set binary mode on stderr (%s)"
+msgstr "standart hata ikilik kipe ayarlanamaz (%s)"
-#: main.c:512
+#: main.c:544
msgid "no program text at all!"
msgstr "program metni hiç yok!"
-#: main.c:556
+#: main.c:612
#, c-format
msgid "Usage: %s [POSIX or GNU style options] -f progfile [--] file ...\n"
msgstr ""
"Kullanımı: %s [POSIX veya GNU tarzı seçenekler] -f progdosyası [--] "
"dosya ...\n"
-#: main.c:558
+#: main.c:614
#, c-format
msgid "Usage: %s [POSIX or GNU style options] [--] %cprogram%c file ...\n"
msgstr ""
"Kullanımı: %s [POSIX veya GNU tarzı seçenekler] %cprogram%c dosya ...\n"
-#: main.c:563
+#: main.c:619
msgid "POSIX options:\t\tGNU long options:\n"
msgstr "POSIX seçenekleri: GNU uzun seçenekleri:\n"
-#: main.c:564
+#: main.c:620
msgid "\t-f progfile\t\t--file=progfile\n"
msgstr " -f progDosyası --file=progDosyası\n"
-#: main.c:565
+#: main.c:621
msgid "\t-F fs\t\t\t--field-separator=fs\n"
msgstr " -F ayraç --field-separator=ayraç\n"
-#: main.c:566
+#: main.c:622
msgid "\t-v var=val\t\t--assign=var=val\n"
msgstr " -v var=deÄŸer --assign=var=deÄŸer\n"
-#: main.c:567
+#: main.c:623
msgid "\t-m[fr] val\n"
msgstr " -m[fr] deÄŸer\n"
-#: main.c:568
+#: main.c:624
msgid "\t-W compat\t\t--compat\n"
msgstr " -W compat --compat\n"
-#: main.c:569
+#: main.c:625
msgid "\t-W copyleft\t\t--copyleft\n"
msgstr " -W copyleft --copyleft\n"
-#: main.c:570
+#: main.c:626
msgid "\t-W copyright\t\t--copyright\n"
msgstr " -W copyright --copyright\n"
-#: main.c:571
+#: main.c:627
msgid "\t-W dump-variables[=file]\t--dump-variables[=file]\n"
msgstr " -W dump-variables[=dosya] --dump-variables[=dosya]\n"
-#: main.c:572
+#: main.c:628
msgid "\t-W gen-po\t\t--gen-po\n"
msgstr " -W gen-po --gen-po\n"
-#: main.c:573
+#: main.c:629
msgid "\t-W help\t\t\t--help\n"
msgstr " -W help --help\n"
-#: main.c:574
+#: main.c:630
msgid "\t-W lint[=fatal]\t\t--lint[=fatal]\n"
msgstr " -W lint[=ölümcül] --lint[=ölümcül]\n"
-#: main.c:575
+#: main.c:631
msgid "\t-W lint-old\t\t--lint-old\n"
msgstr " -W lint-old --lint-old\n"
-#: main.c:576
+#: main.c:632
msgid "\t-W non-decimal-data\t--non-decimal-data\n"
msgstr " -W non-decimal-data --non-decimal-data\n"
-#: main.c:578
+#: main.c:634
msgid "\t-W nostalgia\t\t--nostalgia\n"
msgstr " -W nostalgia --nostalgia\n"
-#: main.c:581
+#: main.c:637
msgid "\t-W parsedebug\t\t--parsedebug\n"
msgstr " -W parsedebug --parsedebug\n"
-#: main.c:583
+#: main.c:639
msgid "\t-W profile[=file]\t--profile[=file]\n"
msgstr " -W profile[=dosya] --profile[=dosya]\n"
-#: main.c:584
+#: main.c:640
msgid "\t-W posix\t\t--posix\n"
msgstr " -W posix --posix\n"
-#: main.c:585
+#: main.c:641
msgid "\t-W re-interval\t\t--re-interval\n"
msgstr " -W re-interval --re-interval\n"
-#: main.c:586
+#: main.c:642
msgid "\t-W source=program-text\t--source=program-text\n"
msgstr " -W source=program-metni --source=program-metni\n"
-#: main.c:587
+#: main.c:643
msgid "\t-W traditional\t\t--traditional\n"
msgstr " -W traditional --traditional\n"
-#: main.c:588
+#: main.c:644
msgid "\t-W usage\t\t--usage\n"
msgstr " -W usage --usage\n"
-#: main.c:589
+#: main.c:645
msgid "\t-W version\t\t--version\n"
msgstr " -W version --version\n"
-#: main.c:593
+#: main.c:649
msgid ""
"\n"
"To report bugs, see node `Bugs' in `gawk.info', which is\n"
@@ -658,7 +1460,7 @@ msgstr ""
"Çeviri hatalarını <gnu-tr-u12a@lists.sourceforge.net> adresine bildiriniz.\n"
"\n"
-#: main.c:597
+#: main.c:653
msgid ""
"gawk is a pattern scanning and processing language.\n"
"By default it reads standard input and writes standard output.\n"
@@ -668,7 +1470,7 @@ msgstr ""
"Öntanımlı olarak standart girdiyi okur ve standart çıktıya yazar.\n"
"\n"
-#: main.c:601
+#: main.c:657
msgid ""
"Examples:\n"
"\tgawk '{ sum += $1 }; END { print sum }' file\n"
@@ -678,7 +1480,7 @@ msgstr ""
"\tgawk '{ sum += $1 }; END { print sum }' dosya\n"
"\tgawk -F: '{ print $1 }' /etc/passwd\n"
-#: main.c:613
+#: main.c:669
#, c-format
msgid ""
"Copyright (C) 1989, 1991-%d Free Software Foundation.\n"
@@ -697,7 +1499,7 @@ msgstr ""
"üzerinde değişiklik yapabilirsiniz.\n"
"\n"
-#: main.c:621
+#: main.c:677
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"
@@ -711,7 +1513,7 @@ msgstr ""
"edinmek için GNU Genel Kamu Lisansına bakınız.\n"
"\n"
-#: main.c:627
+#: main.c:683
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"
@@ -721,98 +1523,117 @@ msgstr ""
"olacaksınız; yoksa Free Software Foundation, Inc., 59 Temple Place\n"
"Suite 330, Boston, MA 02111-1307, USA. adresinden isteyebilirsiniz.\n"
-#: main.c:657
+#: main.c:713
msgid "-Ft does not set FS to tab in POSIX awk"
msgstr "POSIX awk -Ft ile dosya sistemini belirlemez"
-#: main.c:888
+#: main.c:944
+#, 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:964
+#, c-format
+msgid "`%s' is not a legal variable name"
+msgstr "`%s' kurala uygun bir deÄŸiÅŸken ismi deÄŸil"
+
+#: main.c:967
#, c-format
-msgid "invalid syntax in name `%s' for variable assignment"
-msgstr "değişken ismi `%s' de sözdizimi hatası"
+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:957
+#: main.c:995
msgid "floating point exception"
msgstr "Gerçel sayı istisnası"
-#: main.c:964
+#: main.c:1002
msgid "fatal error: internal error"
msgstr "ölümcül iç hata"
-#: main.c:1014
+#: main.c:1052
#, c-format
msgid "no pre-opened fd %d"
msgstr "ön açılışlı bir %d dosya tanımlayıcısı yok"
-#: main.c:1019
+#: main.c:1057
#, c-format
msgid "could not pre-open /dev/null for fd %d"
msgstr "%d dosya tanımlayıcısı için /dev/null ön açılışı yapılamadı"
-#: main.c:1037 main.c:1046
+#: main.c:1080 main.c:1089
#, c-format
msgid "could not find groups: %s"
msgstr "gruplar bulunamadı: %s"
-#: profile.c:94
-#, c-format
-msgid "could not open `%s' for writing: %s"
-msgstr "`%s' yazmak için açılamadı: %s"
+#: msg.c:54
+msgid "cmd. line:"
+msgstr "komut satırı:"
-#: profile.c:96 awkgram.y:2465
-msgid "sending profile to standard error"
-msgstr "profil standart hataya gönderiliyor"
+#: msg.c:120
+msgid "warning: "
+msgstr "uyarı: "
-#: profile.c:409
-msgid "internal error: Node_var with null vname"
-msgstr "iç hata: null vname'li node_var"
+#: msg.c:142
+msgid "error: "
+msgstr "hata: "
-#: profile.c:524
-msgid "internal error: Node_var_array with null vname"
-msgstr "iç hata: null vname'li node_var_array"
+#: msg.c:178
+msgid "fatal: "
+msgstr "ölümcül: "
-#: profile.c:554 eval.c:813
-#, c-format
-msgid ""
-"function `%s' called with space between name and `(',\n"
-"%s"
-msgstr ""
-"`%s' işlevi `(' ile isim arasında boşlukla çağrılmış,\n"
-"%s"
+#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
+msgid "can't convert string to float"
+msgstr "dizge gerçel sayıya dönüştürülemiyor"
-#: profile.c:556 eval.c:815
-msgid "or used in other expression context"
-msgstr "ya da diğer ifadenin içeriğinde kullanılmış"
+#: node.c:357
+msgid "backslash at end of string"
+msgstr "dizge sonunda tersbölü"
-#: profile.c:633 profile.c:761 eval.c:792 eval.c:1043 eval.c:1615 eval.c:1741
-#, c-format
-msgid "attempt to use array `%s' in a scalar context"
-msgstr "`%s' dizisi bir sayısal bağlamda kullanılmaya çalışılıyor"
+#: node.c:544
+msgid "POSIX does not allow `\\x' escapes"
+msgstr "POSIX `\\x' öncelemelerine izin vermez"
+
+#: node.c:550
+msgid "no hex digits in `\\x' escape sequence"
+msgstr "`\\x' önceleme dizgesinde onaltılık rakamlar yok"
-#: profile.c:637 eval.c:1047
+#: node.c:584
#, c-format
-msgid "illegal type (%s) in tree_eval"
-msgstr "tree_eval içinde kuraldışı tür (%s)"
+msgid "escape sequence `\\%c' treated as plain `%c'"
+msgstr "`\\%c' önceleme dizgesi `%c' olarak kullanıldı"
-#: profile.c:842 eval.c:1790
+#: posix/gawkmisc.c:172
#, c-format
-msgid "attempt to use function `%s' as array"
-msgstr "`%s' işlevi dizi olarak kullanılmaya çalışılıyor"
+msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
+msgstr "%s %s `%s': close-on-exec belirlenemedi: (fcntl: %s)"
-#: profile.c:856 eval.c:1797
+#: profile.c:91
#, c-format
-msgid "`%s' is a function, assignment is not allowed"
-msgstr "`%s' bir işlevdir, bir değişken ismi olarak kullanılamaz"
+msgid "could not open `%s' for writing: %s"
+msgstr "`%s' yazmak için açılamadı: %s"
-#: profile.c:860 eval.c:1803 eval.c:1810
-msgid "assignment is not allowed to result of builtin function"
-msgstr "deÄŸiÅŸken ismine yerleÅŸik iÅŸlevin sonucu atanamaz"
+#: profile.c:409
+msgid "internal error: Node_var with null vname"
+msgstr "iç hata: null vname'li node_var"
+
+#: profile.c:471
+msgid "# treated internally as `delete'"
+msgstr "# dahili olarak `delete' varsayıldı"
-#: profile.c:1108
+#: profile.c:545
+msgid "internal error: Node_var_array with null vname"
+msgstr "iç hata: null vname'li node_var_array"
+
+#: profile.c:1127
#, c-format
msgid "\t# gawk profile, created %s\n"
msgstr "\t# gawk profili, oluÅŸturuldu: %s\n"
-#: profile.c:1111
+#: profile.c:1130
msgid ""
"\t# BEGIN block(s)\n"
"\n"
@@ -820,7 +1641,7 @@ msgstr ""
"\t# BEGIN blokları\n"
"\n"
-#: profile.c:1121
+#: profile.c:1140
msgid ""
"\t# Rule(s)\n"
"\n"
@@ -828,7 +1649,7 @@ msgstr ""
"\t# Kurallar\n"
"\n"
-#: profile.c:1127
+#: profile.c:1146
msgid ""
"\t# END block(s)\n"
"\n"
@@ -836,7 +1657,7 @@ msgstr ""
"\t# END blokları\n"
"\n"
-#: profile.c:1147
+#: profile.c:1166
msgid ""
"\n"
"\t# Functions, listed alphabetically\n"
@@ -844,913 +1665,144 @@ msgstr ""
"\n"
"\t# İşlevler, alfabetik sırayla\n"
-#: profile.c:1357
+#: profile.c:1376
#, c-format
msgid "unexpected type %s in prec_level"
msgstr "prec_level'da anlaşılamayan tür %s"
-#: regex.c:1322
+#: 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ı"
-#: regex.c:1323
+#: regcomp.c:139
msgid "No match"
msgstr "EÅŸleÅŸmez"
-#: regex.c:1324
+#: regcomp.c:142
msgid "Invalid regular expression"
msgstr "Düzenli ifade geçersiz"
-#: regex.c:1325
+#: regcomp.c:145
msgid "Invalid collation character"
msgstr "Karşılaştırma karakteri geçersiz"
-#: regex.c:1326
+#: regcomp.c:148
msgid "Invalid character class name"
msgstr "Karakter sınıf ismi geçersiz"
-#: regex.c:1327
+#: regcomp.c:151
msgid "Trailing backslash"
msgstr "İzleyen tersbölü"
-#: regex.c:1328
+#: regcomp.c:154
msgid "Invalid back reference"
msgstr "Geriye başvuru geçersiz"
-#: regex.c:1329
+#: regcomp.c:157
msgid "Unmatched [ or [^"
msgstr "[ ya da [^ eÅŸleÅŸmiyor"
-#: regex.c:1330
+#: regcomp.c:160
msgid "Unmatched ( or \\("
msgstr "( ya da \\( eÅŸleÅŸmiyor"
-#: regex.c:1331
+#: regcomp.c:163
msgid "Unmatched \\{"
msgstr "\\{ eÅŸleÅŸmiyor"
-#: regex.c:1332
+#: regcomp.c:166
msgid "Invalid content of \\{\\}"
msgstr "\\{\\} içeriği geçersiz"
-#: regex.c:1333
+#: regcomp.c:169
msgid "Invalid range end"
msgstr "Kapsam sonu geçersiz"
-#: regex.c:1334 dfa.c:182 dfa.c:193 dfa.c:204
+#: regcomp.c:172
msgid "Memory exhausted"
msgstr "Bellek tükendi"
-#: regex.c:1335
+#: regcomp.c:175
msgid "Invalid preceding regular expression"
msgstr "düzenli ifade önceliği geçersiz"
-#: regex.c:1336
+#: regcomp.c:178
msgid "Premature end of regular expression"
msgstr "Düzenli ifade sonu eksik kalmış"
-#: regex.c:1337
+#: regcomp.c:181
msgid "Regular expression too big"
msgstr "Düzenli ifade çok büyük"
-#: regex.c:1338
+#: regcomp.c:184
msgid "Unmatched ) or \\)"
msgstr ") ya da \\) eÅŸleÅŸmiyor"
-#: regex.c:7365
+#: regcomp.c:621
msgid "No previous regular expression"
msgstr "Daha önce düzenli ifade yok"
-#: awkgram.y:232
-msgid "BEGIN blocks must have an action part"
-msgstr "BEGIN blokları bir eylem bölümü içermeli"
-
-#: awkgram.y:238
-msgid "END blocks must have an action part"
-msgstr "END blokları bir eylem bölümü içermeli"
-
-#: awkgram.y:274
-#, c-format
-msgid "`%s' is a built-in function, it cannot be redefined"
-msgstr "`%s' bir yerleÅŸik iÅŸlevdir, yeniden atanamaz"
-
-#: awkgram.y:362
-msgid "statement may have no effect"
-msgstr "deyim bir etkiye sahip olmayabilir"
-
-#: awkgram.y:455
-msgid "`next' used in BEGIN or END action"
-msgstr "`next' BEGIN ya da END eyleminde kullanılmış"
-
-#: awkgram.y:462 awkgram.y:469
-msgid "`nextfile' is a gawk extension"
-msgstr "`nextfile' bir gawk uzantısıdır"
-
-#: awkgram.y:474
-msgid "`nextfile' used in BEGIN or END action"
-msgstr "`nextfile' BEGIN ya da END eyleminde kullanılmış"
-
-#: awkgram.y:483
-msgid "`return' used outside function context"
-msgstr "`return' işlev bağlamının dışında kullanılmış"
-
-#: awkgram.y:519
-msgid "plain `print' in BEGIN or END rule should probably be `print \"\"'"
-msgstr "BEGIN veya END kuralındaki `print' aslında `print \"\"' olmalıydı"
-
-#: awkgram.y:532 awkgram.y:539
-msgid "`delete array' is a gawk extension"
-msgstr "`delete array' bir gawk uzantısıdır"
-
-#: awkgram.y:604
-msgid "multistage two-way pipelines don't work"
-msgstr "çok katlı iki yönlü veriyolları çalışmaz"
-
-#: awkgram.y:695
-msgid "regular expression on right of assignment"
-msgstr "düzenli ifade atamanın sağında"
-
-#: awkgram.y:713
-msgid "non-redirected `getline' undefined inside END action"
-msgstr "END eyleminin içinde yönlendirme yapmayan `getline' tanımsız"
-
-#: awkgram.y:723
-msgid "regular expression on left of `~' or `!~' operator"
-msgstr "düzenli ifade `~' ya da `!~' işlemiminin solunda"
-
-#: awkgram.y:733
-#, c-format
-msgid "regexp constant `/%s/' looks like a C comment, but is not"
-msgstr "düzenli ifade sabiti `/%s/' bir C açıklaması gibi görünüyor ama değil"
-
-#: awkgram.y:749
-msgid "regular expression on right of comparison"
-msgstr "düzenli ifade karşılaştırmanın sağında"
-
-#: awkgram.y:776
-msgid "non-redirected `getline' undefined inside BEGIN or END action"
-msgstr ""
-"BEGIN ya da END eyleminin içinde yönlendirme yapmayan `getline' tanımsız"
-
-#: awkgram.y:831
-msgid "call of `length' without parentheses is not portable"
-msgstr "parantezsiz `length' çağrısı taşınabilir değil"
-
-#: awkgram.y:834
-msgid "call of `length' without parentheses is deprecated by POSIX"
-msgstr "parantezsiz `length' çağrısı POSIX'e uygun değil"
-
-#: awkgram.y:884
-msgid "invalid subscript expression"
-msgstr "indis ifadesi geçersiz"
-
-#: awkgram.y:1033
-#, c-format
-msgid "fptr %x not in tokentab\n"
-msgstr "işlev imleyicisi %x işlev isim listesinde bulunamadı\n"
-
-#: awkgram.y:1068
-msgid "unexpected newline"
-msgstr "beklenmeyen satırsonu"
-
-#: awkgram.y:1152
-msgid "empty program text on command line"
-msgstr "komut satırında boş program metni"
-
-#: awkgram.y:1209
-#, c-format
-msgid "can't open source file `%s' for reading (%s)"
-msgstr "kaynak dosyası `%s' okumak için açılamıyor (%s)"
-
-#: awkgram.y:1244
-#, c-format
-msgid "can't read sourcefile `%s' (%s)"
-msgstr "kaynak dosyası `%s' okunamıyor (%s)"
-
-#: awkgram.y:1252
-#, c-format
-msgid "source file `%s' is empty"
-msgstr "kaynak dosyası `%s' boş"
-
-#: awkgram.y:1454 awkgram.y:1565 awkgram.y:1583 awkgram.y:1929 awkgram.y:2011
-msgid "source file does not end in newline"
-msgstr "kaynak dosyasının sonunda satırsonu eksik"
-
-#: awkgram.y:1518
-msgid "unterminated regexp ends with `\\' at end of file"
-msgstr "sonlandırılmamış düzenli ifade dosya sonunda `\\' ile bitiyor"
-
-#: awkgram.y:1539
-msgid "unterminated regexp"
-msgstr "sonlandırılmamış düzenli ifade"
-
-#: awkgram.y:1542
-msgid "unterminated regexp at end of file"
-msgstr "dosya sonunda sonlandırılmamış düzenli ifade"
-
-#: awkgram.y:1609
-msgid "use of `\\ #...' line continuation is not portable"
-msgstr "`\\ #...' satır uzatma kullanımı taşınabilir değil"
-
-#: awkgram.y:1621
-msgid "backslash not last character on line"
-msgstr "tersbölü satırdaki son karakter değil"
-
-#: awkgram.y:1662
-msgid "POSIX does not allow operator `**='"
-msgstr "`**=' iÅŸlemimi POSIX uyumlu deÄŸil"
-
-#: awkgram.y:1664
-msgid "old awk does not support operator `**='"
-msgstr "`**=' iÅŸlemimini eski awk desteklemiyor"
-
-#: awkgram.y:1673
-msgid "POSIX does not allow operator `**'"
-msgstr "`**' iÅŸlemimi POSIX uyumlu deÄŸil"
-
-#: awkgram.y:1675
-msgid "old awk does not support operator `**'"
-msgstr "`**' iÅŸlemimini eski awk desteklemiyor"
-
-#: awkgram.y:1708
-msgid "operator `^=' is not supported in old awk"
-msgstr "`^=' iÅŸlemimini eski awk desteklemiyor"
-
-#: awkgram.y:1716
-msgid "operator `^' is not supported in old awk"
-msgstr "`^' iÅŸlemimini eski awk desteklemiyor"
-
-#: awkgram.y:1798 awkgram.y:1815
-msgid "unterminated string"
-msgstr "sonlandırılmamış dizge"
-
-#: awkgram.y:1972
-#, c-format
-msgid "invalid char '%c' in expression"
-msgstr "ifade içinde '%c' karakteri geçersiz"
-
-#: awkgram.y:2032
-#, c-format
-msgid "`%s' is a gawk extension"
-msgstr "`%s' bir gawk uzantısıdır"
-
-#: awkgram.y:2035
-#, c-format
-msgid "`%s' is a Bell Labs extension"
-msgstr "`%s' bir Bell Laboratuarları uzantısıdır"
-
-#: awkgram.y:2038
-#, c-format
-msgid "POSIX does not allow `%s'"
-msgstr "`%s' POSIX uyumlu deÄŸil"
-
-#: awkgram.y:2042
-#, c-format
-msgid "`%s' is not supported in old awk"
-msgstr "`%s' eski awk tarafından desteklemiyor"
-
-#: awkgram.y:2070
-msgid "`goto' considered harmful!\n"
-msgstr "`goto' zararlı sayılır!\n"
-
-#: awkgram.y:2134
-#, c-format
-msgid "%d is invalid as number of arguments for %s"
-msgstr "%d argüman sayısı olarak %s için geçersiz"
-
-#: awkgram.y:2153 awkgram.y:2156
-msgid "match: third argument is a gawk extension"
-msgstr "match: üçüncü argüman bir gawk uzantısı"
-
-#: awkgram.y:2172
-#, c-format
-msgid "%s: string literal as last arg of substitute has no effect"
-msgstr "%s: yerine kullanılan son argüman olarak dizge sabiti etkisiz"
-
-#: awkgram.y:2176
-msgid "sub third parameter is not a changeable object"
-msgstr "üçüncü sub parametresi değiştirilebilir bir nesne değil"
-
-#: awkgram.y:2178
-msgid "gsub third parameter is not a changeable object"
-msgstr "üçüncü gsub parametresi değiştirilebilir bir nesne değil"
-
-#: awkgram.y:2204 awkgram.y:2207
-msgid "close: second argument is a gawk extension"
-msgstr "close: ikinci argüman bir gawk uzantısı"
-
-#: awkgram.y:2217
-msgid "use of dcgettext(_\"...\") is incorrect: remove leading underscore"
-msgstr "dcgettext(_\"...\") kullanımı yanlış: altçizgiyi kaldırın"
-
-#: awkgram.y:2232
-msgid "use of dcngettext(_\"...\") is incorrect: remove leading underscore"
-msgstr "dcngettext(_\"...\") kullanımı yanlış: altçizgiyi kaldırın"
-
-#: awkgram.y:2323
-#, c-format
-msgid "function `%s': parameter #%d, `%s', duplicates parameter #%d"
-msgstr "`%s' işlevi: %d. parametre, `%s', %d. parametrenin tekrarı"
-
-#: awkgram.y:2355
-#, c-format
-msgid "function `%s': parameter `%s' shadows global variable"
-msgstr "`%s' işlevi: parametre, `%s'global değişkeni gölgeliyor"
-
-#: awkgram.y:2464
-#, c-format
-msgid "could not open `%s' for writing (%s)"
-msgstr "`%s' yazmak için açılamadı (%s)"
-
-#: awkgram.y:2495
-#, c-format
-msgid "%s: close failed (%s)"
-msgstr "%s: kapatma başarısız (%s)"
-
-#: awkgram.y:2605
-msgid "shadow_funcs() called twice!"
-msgstr "shadow_funcs() iki kere çağrıldı!"
-
-#: awkgram.y:2680
-#, c-format
-msgid "function `%s': can't use function name as parameter name"
-msgstr "işlev `%s': işlev ismi parametre ismi olarak kullanılamaz"
-
-#: awkgram.y:2690
-#, c-format
-msgid "function name `%s' previously defined"
-msgstr "işlev ismi `%s' önceden atanmış"
-
-#: awkgram.y:2838 awkgram.y:2844
-#, c-format
-msgid "function `%s' called but never defined"
-msgstr "`%s' işlevi çağrıldı ama hiç atanmamış"
-
-#: awkgram.y:2847
-#, c-format
-msgid "function `%s' defined but never called"
-msgstr "`%s' işlevi atanmış ama hiç çağrılmadı"
-
-#: awkgram.y:2874
-#, c-format
-msgid "regexp constant for parameter #%d yields boolean value"
-msgstr "%d numaralı argüman bir düzenli ifade sabiti"
-
-#: dfa.c:529 dfa.c:532 dfa.c:550 dfa.c:561 dfa.c:585 dfa.c:644 dfa.c:649
-#: dfa.c:662 dfa.c:663 dfa.c:1043 dfa.c:1046 dfa.c:1073 dfa.c:1077 dfa.c:1078
-#: dfa.c:1081 dfa.c:1094 dfa.c:1095
-msgid "Unbalanced ["
-msgstr "Dengesiz ["
-
-#: dfa.c:783
-msgid "Unfinished \\ escape"
-msgstr "Tamamlanmamış \\ escape"
-
-#: dfa.c:916 dfa.c:922 dfa.c:932 dfa.c:940 dfa.c:955
-msgid "unfinished repeat count"
-msgstr "Tamamlanmamış tekrar sayısı"
-
-#: dfa.c:929 dfa.c:946 dfa.c:954 dfa.c:958
-msgid "malformed repeat count"
-msgstr "Tekrar sayısı hatalı"
-
-#: dfa.c:1285
-msgid "Unbalanced ("
-msgstr "Dengesiz ("
-
-#: dfa.c:1407
-msgid "No regexp syntax bits specified"
-msgstr "Düzenli ifade sözdizimi bitleri belirtilmemiş"
-
-#: dfa.c:1415
-msgid "Unbalanced )"
-msgstr "Karşılıksız )"
-
-#: dfa.c:3014
-msgid "out of memory"
-msgstr "bellek yetersiz"
-
-#: field.c:849
-msgid "split: second argument is not an array"
-msgstr "split: ikinci argüman bir dizi değil"
-
-#: field.c:876
-msgid "split: null string for third arg is a gawk extension"
-msgstr "split: üçüncü argüman olan null dizge bir gawk uzantısı"
-
-#: field.c:916
-msgid "`FIELDWIDTHS' is a gawk extension"
-msgstr "`FIELDWIDTHS' bir gawk uzantısıdır"
-
-#: field.c:943
-#, c-format
-msgid "field %d in FIELDWIDTHS, must be > 0"
-msgstr "FIELDWIDTHS içindeki %d. alan > 0 olmalı"
-
-#: field.c:997
-msgid "null string for `FS' is a gawk extension"
-msgstr "`FS' için null dizge bir gawk uzantısıdır"
-
-#: msg.c:57
-msgid "cmd. line:"
-msgstr "komut satırı:"
-
-#: msg.c:123
-msgid "warning: "
-msgstr "uyarı: "
-
-#: msg.c:145
-msgid "error: "
-msgstr "hata: "
-
-#: msg.c:178
-msgid "fatal: "
-msgstr "ölümcül: "
-
-#: eval.c:259
-#, c-format
-msgid "unknown nodetype %d"
-msgstr "%d. düğümtürü bilinmiyor"
+#~ msgid "invalid syntax in name `%s' for variable assignment"
+#~ msgstr "değişken ismi `%s' de sözdizimi hatası"
-#: eval.c:307
-msgid "buffer overflow in genflags2str"
-msgstr "genflags2str içinde tampon taştı"
+#~ msgid "or used in other expression context"
+#~ msgstr "ya da diğer ifadenin içeriğinde kullanılmış"
-#: eval.c:541
-#, c-format
-msgid "for loop: array `%s' changed size from %d to %d during loop execution"
-msgstr "for loop: `%s' dizisinin indisi döngü sırasında %d iken %d oldu"
+#~ msgid "attempt to use function `%s' as array"
+#~ msgstr "`%s' işlevi dizi olarak kullanılmaya çalışılıyor"
-#: eval.c:565
-msgid "`break' outside a loop is not portable"
-msgstr "döngü dışında `break' kullanımı taşınabilir değil"
+#~ msgid "`%s' is a function, assignment is not allowed"
+#~ msgstr "`%s' bir işlevdir, bir değişken ismi olarak kullanılamaz"
-#: eval.c:569
-msgid "`break' outside a loop is not allowed"
-msgstr "döngü dışında `break' kullanımı yasak"
-
-#: eval.c:588
-msgid "`continue' outside a loop is not portable"
-msgstr "döngü dışında `continue' kullanımı taşınabilir değil"
+#~ msgid "BEGIN blocks must have an action part"
+#~ msgstr "BEGIN blokları bir eylem bölümü içermeli"
-#: eval.c:592
-msgid "`continue' outside a loop is not allowed"
-msgstr "döngü dışında `continue' kullanımı yasak"
-
-#: eval.c:622
-msgid "`next' cannot be called from a BEGIN rule"
-msgstr "`next' bir BEGIN kuralından çağrılamaz"
-
-#: eval.c:624
-msgid "`next' cannot be called from an END rule"
-msgstr "`next' bir END kuralından çağrılamaz"
-
-#: eval.c:636
-msgid "`nextfile' cannot be called from a BEGIN rule"
-msgstr "`nextfile' bir BEGIN kuralından çağrılamaz"
-
-#: eval.c:638
-msgid "`nextfile' cannot be called from an END rule"
-msgstr "`nextfile' bir END kuralından çağrılamaz"
-
-#: eval.c:679
-msgid "statement has no effect"
-msgstr "deyim etkisiz"
-
-#: eval.c:713 eval.c:743 eval.c:1622
-#, c-format
-msgid "reference to uninitialized variable `%s'"
-msgstr "öndeğer ataması yapılmamış `%s' değişkenine başvuru"
-
-#: eval.c:721 eval.c:1608
-#, c-format
-msgid "can't use function name `%s' as variable or array"
-msgstr "`%s' işlev ismi bir değişken ya da dizi olarak kullanılamaz"
+#~ msgid "`nextfile' used in BEGIN or END action"
+#~ msgstr "`nextfile' BEGIN ya da END eyleminde kullanılmış"
-#: eval.c:728 eval.c:734 eval.c:1747
-#, c-format
-msgid "reference to uninitialized argument `%s'"
-msgstr "başlangıç değeri olmayan `%s' argümanına başvuru"
-
-#: eval.c:823
-msgid "assignment used in conditional context"
-msgstr "koşul bağlamında atama yapılmış"
-
-#: eval.c:914
-msgid ""
-"concatenation: side effects in one expression have changed the length of "
-"another!"
-msgstr ""
-"bitiÅŸtirme: bir ifadenin yan etkileri diÄŸerinin uzunluÄŸunu deÄŸiÅŸtirmiÅŸ!"
-
-#: eval.c:1013
-msgid "division by zero attempted"
-msgstr "sıfırla bölme hatası"
-
-#: eval.c:1028
-#, c-format
-msgid "division by zero attempted in `%%'"
-msgstr "`%%'de sıfırla bölme hatası"
-
-#: eval.c:1236
-msgid "division by zero attempted in `/='"
-msgstr "`/='de sıfırla bölme hatası"
-
-#: eval.c:1254
-#, c-format
-msgid "division by zero attempted in `%%='"
-msgstr "`%%='de sıfırla bölme hatası"
-
-#: eval.c:1424
-#, c-format
-msgid "%s (from %s)"
-msgstr "%s (%s'den)"
-
-#: eval.c:1472
-#, c-format
-msgid "function `%s' called with more arguments than declared"
-msgstr "`%s' işlevi bildirilenden daha fazla argümanla çağrıldı"
-
-#: eval.c:1519
-#, c-format
-msgid "function `%s' not defined"
-msgstr "`%s' işlevi tanımsız"
-
-#: eval.c:1521
-#, c-format
-msgid "function %s called\n"
-msgstr "%s işlevi çağrıldı\n"
-
-#: eval.c:1580
-msgid ""
-"\n"
-"\t# Function Call Stack:\n"
-"\n"
-msgstr ""
-"\n"
-"\t# İşlev Çağrı Yığını:\n"
-"\n"
-
-#: eval.c:1583
-msgid "\t# -- main --\n"
-msgstr "\t# -- main --\n"
-
-#: eval.c:1759
-msgid "attempt to field reference from non-numeric value"
-msgstr "sayısal olmayan değerden alan başvurusu"
-
-#: eval.c:1761
-msgid "attempt to reference from null string"
-msgstr "null dizgeden alan baÅŸvurusu"
-
-#: eval.c:1767
-#, c-format
-msgid "attempt to access field %d"
-msgstr "%d. alana erişilmeye çalışılıyor"
-
-#: eval.c:1783
-#, c-format
-msgid "attempt to use scalar parameter `%s' as an array"
-msgstr "sayısal paramaetre `%s' bir dizi olarak kullanılmaya çalışılıyor"
-
-#: eval.c:1874
-msgid "`IGNORECASE' is a gawk extension"
-msgstr "`IGNORECASE' bir gawk uzantısıdır"
-
-#: eval.c:1902
-msgid "`BINMODE' is a gawk extension"
-msgstr "`BINMODE' bir gawk uzantısıdır"
-
-#: eval.c:2014
-#, c-format
-msgid "bad `%sFMT' specification `%s'"
-msgstr "`%sFMT' özelliği `%s' hatalı"
-
-#: eval.c:2080
-msgid "turning off `--lint' due to assignment to `LINT'"
-msgstr "`LINT' atamasından dolayı `--lint' kapatılıyor"
-
-#: eval.c:2116
-msgid "NF set to negative value"
-msgstr "NF negatif değere ayarlı"
-
-#: io.c:240
-#, c-format
-msgid "cannot open file `%s' for reading (%s)"
-msgstr "`%s' okumak için açılamıyor (%s)"
-
-#: io.c:320
-#, c-format
-msgid "close of fd %d (`%s') failed (%s)"
-msgstr "dosya tanımlayıcı %d (`%s') başarısız (%s)"
-
-#: io.c:432
-#, c-format
-msgid "invalid tree type %s in redirect()"
-msgstr "redirect() içindeki ağaç türü %s geçersiz"
-
-#: io.c:438
-#, c-format
-msgid "expression in `%s' redirection only has numeric value"
-msgstr "`%s' yönlendirmesi içindeki ifade sadece sayısal değer içeriyor"
-
-#: io.c:444
-#, c-format
-msgid "expression for `%s' redirection has null string value"
-msgstr "`%s' yönlendirmesi içindeki ifade null dizge değeri içeriyor"
-
-#: io.c:449
-#, c-format
-msgid "filename `%s' for `%s' redirection may be result of logical expression"
-msgstr ""
-"`%s' dosya ismi (`%s' yönlendirmesi için) mantıksal ifadenin sonucu olabilir"
-
-#: io.c:471
-#, c-format
-msgid "unnecessary mixing of `>' and `>>' for file `%.*s'"
-msgstr "`%.*s' dosyası için `>' ve `>>' karışımı gereksiz"
-
-#: io.c:523
-#, c-format
-msgid "can't open pipe `%s' for output (%s)"
-msgstr "`%s' veriyolu çıktı için açılamadı (%s)"
-
-#: io.c:532
-#, c-format
-msgid "can't open pipe `%s' for input (%s)"
-msgstr "`%s' veriyolu girdi için açılamadı (%s)"
-
-#: io.c:545
-#, c-format
-msgid "can't open two way socket `%s' for input/output (%s)"
-msgstr "iki yönlü `%s' soketi G/Ç için açılamıyor (%s)"
-
-#: io.c:549
-#, c-format
-msgid "can't open two way pipe `%s' for input/output (%s)"
-msgstr "iki yönlü `%s' veriyolu G/Ç için açılamıyor (%s)"
-
-#: io.c:625
-#, c-format
-msgid "can't redirect from `%s' (%s)"
-msgstr "`%s'den yönlendirilemiyor (%s)"
-
-#: io.c:628
-#, c-format
-msgid "can't redirect to `%s' (%s)"
-msgstr "`%s'e yönlendirilemiyor (%s)"
-
-#: io.c:667
-msgid ""
-"reached system limit for open files: starting to multiplex file descriptors"
-msgstr ""
-"açık dosyalar için sistem sınırı aşıldı: çoğul dosya tanımlayıcılara "
-"baÅŸlarken"
-
-#: io.c:679
-#, c-format
-msgid "close of `%s' failed (%s)."
-msgstr "`%s' kapatılamadı (%s)."
-
-#: io.c:686
-msgid "too many pipes or input files open"
-msgstr "çok fazla veriyolu ya da dosya açık"
-
-#: io.c:709
-msgid "close: second argument must be `to' or `from'"
-msgstr "close: ikinci argüman `to' ya da `from' olmalı"
-
-#: io.c:723
-#, c-format
-msgid "close: `%.*s' is not an open file, pipe or co-process"
-msgstr "close: `%.*s' bir açık dosya, veriyolu ya da alt-işlem değil"
-
-#: io.c:727
-msgid "close of redirection that was never opened"
-msgstr "hiç açılmamış bir yönlendirmenin kapatılması"
-
-#: io.c:754
-#, c-format
-msgid "close: redirection `%s' not opened with `|&', second argument ignored"
-msgstr ""
-"close: `%s' yönlendirmesi bir `|&' ile açılmamış, ikinci argüman yoksayıldı"
-
-#: io.c:811
-#, c-format
-msgid "failure status (%d) on pipe close of `%s' (%s)"
-msgstr "başarısızlık durumu (%d): `%s' veriyolunun kapatılması (%s)"
-
-#: io.c:814
-#, c-format
-msgid "failure status (%d) on file close of `%s' (%s)"
-msgstr "başarısızlık durumu (%d): `%s' dosyasının kapatılması (%s)"
-
-#: io.c:833
-#, c-format
-msgid "no explicit close of socket `%s' provided"
-msgstr "`%s' soketinin açıkça kapatılması istenmedi"
-
-#: io.c:836
-#, c-format
-msgid "no explicit close of co-process `%s' provided"
-msgstr "`%s' alt-işleminin açıkça kapatılması istenmedi"
-
-#: io.c:839
-#, c-format
-msgid "no explicit close of pipe `%s' provided"
-msgstr "`%s' veriyolunun açıkça kapatılması istenmedi"
-
-#: io.c:842
-#, c-format
-msgid "no explicit close of file `%s' provided"
-msgstr "`%s' dosyasının açıkça kapatılması istenmedi"
-
-#: io.c:871 io.c:925
-#, c-format
-msgid "error writing standard output (%s)"
-msgstr "standart çıktıya yazarken hata (%s)"
-
-#: io.c:875 io.c:929
-#, c-format
-msgid "error writing standard error (%s)"
-msgstr "standart hataya yazarken hata (%s)"
-
-#: io.c:883
-#, c-format
-msgid "pipe flush of `%s' failed (%s)."
-msgstr "`%s'in veriyolu ile veri aktarımı başarısız (%s)."
-
-#: io.c:886
-#, c-format
-msgid "co-process flush of pipe to `%s' failed (%s)."
-msgstr "`%s'e veriyolunun alt-işlemi ile veri aktarımı başarısız (%s)."
-
-#: io.c:889
-#, c-format
-msgid "file flush of `%s' failed (%s)."
-msgstr "`%s'in dosya ile veri aktarımı başarısız (%s)."
-
-#: io.c:1048
-msgid "/inet/raw client not ready yet, sorry"
-msgstr "/inet/raw istemci henüz hazır değil"
-
-#: io.c:1050 io.c:1087
-msgid "only root may use `/inet/raw'."
-msgstr "`/inet/raw' sadece root tarafından kullanılabilir"
-
-#: io.c:1085
-msgid "/inet/raw server not ready yet, sorry"
-msgstr "/inet/raw sunucu henüz hazır değil"
-
-#: io.c:1175
-#, c-format
-msgid "no (known) protocol supplied in special filename `%s'"
-msgstr "özel dosya ismi `%s' içinde (bilinen) bir protokol sağlanmamış"
-
-#: io.c:1193
-#, c-format
-msgid "special file name `%s' is incomplete"
-msgstr "özel dosya ismi `%s' tamamlanmamış"
-
-#: io.c:1205
-#, c-format
-msgid "local port invalid in `%s'"
-msgstr "`%s' deki yerel port geçersiz"
-
-#: io.c:1217
-msgid "must supply a remote hostname to `/inet'"
-msgstr "`/inet' e bir karşı makina ismi sağlanmalı"
-
-#: io.c:1232
-msgid "must supply a remote port to `/inet'"
-msgstr "`/inet' e bir karşı port sağlanmalı"
-
-#: io.c:1238
-#, c-format
-msgid "remote port invalid in `%s'"
-msgstr "`%s' de karşı port geçersiz"
-
-#: io.c:1248
-msgid "TCP/IP communications are not supported"
-msgstr "TCP/IP haberleÅŸmesi desteklenmiyor"
-
-#: io.c:1257 io.c:1438
-#, c-format
-msgid "file `%s' is a directory"
-msgstr "`%s' dosya deÄŸil dizin"
-
-#: io.c:1327
-#, c-format
-msgid "use `PROCINFO[\"%s\"]' instead of `%s'"
-msgstr "`PROCINFO[\"%s\"]' kullanın (`%s' yerine)"
-
-#: io.c:1359
-msgid "use `PROCINFO[...]' instead of `/dev/user'"
-msgstr "`/dev/user' yerine `PROCINFO[...]' kullanın"
-
-#: io.c:1424
-#, c-format
-msgid "could not open `%s', mode `%s'"
-msgstr "`%s', `%s' kipinde açılamadı"
-
-#: io.c:1550 io.c:1602 io.c:1732 io.c:1754
-#, c-format
-msgid "moving pipe to stdout in child failed (dup: %s)"
-msgstr "ast süreçte veriyolu standart çıktıya taşınamadı (dup: %s)"
-
-#: io.c:1554 io.c:1607
-#, c-format
-msgid "moving pipe to stdin in child failed (dup: %s)"
-msgstr "ast süreçte veriyolu standart girdiye taşınamadı (dup: %s)"
-
-#: io.c:1571 io.c:1745
-msgid "restoring stdout in parent process failed\n"
-msgstr "üst süreçte stdÇ eski durumuna getirilemedi\n"
-
-#: io.c:1576
-msgid "restoring stdin in parent process failed\n"
-msgstr "üst süreçte stdG eski durumuna getirilemedi\n"
-
-#: io.c:1599 io.c:1751
-#, c-format
-msgid "close of stdout in child failed (%s)"
-msgstr "ast süreçte stdÇ kapatılamadı (%s)"
-
-#: io.c:1604
-#, c-format
-msgid "close of stdin in child failed (%s)"
-msgstr "ast süreçte stdG kapatılamadı (%s)"
-
-#: io.c:1610 io.c:1756 io.c:1767
-#, c-format
-msgid "close of pipe failed (%s)"
-msgstr "veriyolu kapatılamadı (%s)"
-
-#: io.c:1655
-msgid "`|&' not supported"
-msgstr "`|&' desteklenmiyor"
-
-#: io.c:1722
-#, c-format
-msgid "cannot open pipe `%s' (%s)"
-msgstr "`%s' veriyolu açılamıyor (%s)"
-
-#: io.c:1763
-#, c-format
-msgid "cannot create child process for `%s' (fork: %s)"
-msgstr "`%s' için ast süreç oluşturulamıyor (fork: %s)"
+#~ 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"
-#: io.c:2104
-#, c-format
-msgid "data file `%s' is empty"
-msgstr "veri dosyası `%s' boş"
+#~ msgid "fptr %x not in tokentab\n"
+#~ msgstr "işlev imleyicisi %x işlev isim listesinde bulunamadı\n"
-#: io.c:2175
-#, c-format
-msgid "internal error: file `%s', line %d\n"
-msgstr "iç hata: dosya `%s', satır %d\n"
+#~ msgid "gsub third parameter is not a changeable object"
+#~ msgstr "üçüncü gsub parametresi değiştirilebilir bir nesne değil"
-#: io.c:2277
-#, c-format
-msgid "error reading input file `%s': %s"
-msgstr "`%s' girdi dosyası okunurken hata: %s"
+#~ msgid "Unbalanced ["
+#~ msgstr "Dengesiz ["
-#: io.c:2521
-msgid "multicharacter value of `RS' is a gawk extension"
-msgstr "`RS' çoklu karakter değeri bir gawk uzantısıdır"
+#~ msgid "Unfinished \\ escape"
+#~ msgstr "Tamamlanmamış \\ escape"
-#: node.c:59 node.c:66 node.c:75 node.c:89 node.c:116
-msgid "can't convert string to float"
-msgstr "dizge gerçel sayıya dönüştürülemiyor"
+#~ msgid "unfinished repeat count"
+#~ msgstr "Tamamlanmamış tekrar sayısı"
-#: node.c:342
-msgid "backslash at end of string"
-msgstr "dizge sonunda tersbölü"
+#~ msgid "malformed repeat count"
+#~ msgstr "Tekrar sayısı hatalı"
-#: node.c:524
-msgid "POSIX does not allow `\\x' escapes"
-msgstr "POSIX `\\x' öncelemelerine izin vermez"
+#~ msgid "Unbalanced ("
+#~ msgstr "Dengesiz ("
-#: node.c:530
-msgid "no hex digits in `\\x' escape sequence"
-msgstr "`\\x' önceleme dizgesinde onaltılık rakamlar yok"
+#~ msgid "No regexp syntax bits specified"
+#~ msgstr "Düzenli ifade sözdizimi bitleri belirtilmemiş"
-#: node.c:564
-#, c-format
-msgid "escape sequence `\\%c' treated as plain `%c'"
-msgstr "`\\%c' önceleme dizgesi `%c' olarak kullanıldı"
+#~ msgid "Unbalanced )"
+#~ msgstr "Karşılıksız )"
-#: re.c:208
-#, c-format
-msgid "regex match failed, not enough memory to match string \"%.*s%s\""
-msgstr ""
-"düzenli ifade eşleşmesi sağlanamadı, \"%.*s%s\" dizgesini eşleştirmek için "
-"yeterli bellek yok"
+#~ msgid "out of memory"
+#~ msgstr "bellek yetersiz"
-#: posix/gawkmisc.c:122
-#, c-format
-msgid "%s %s `%s': could not set close-on-exec: (fcntl: %s)"
-msgstr "%s %s `%s': close-on-exec belirlenemedi: (fcntl: %s)"
+#~ msgid "internal error: file `%s', line %d\n"
+#~ msgstr "iç hata: dosya `%s', satır %d\n"
#~ msgid ""
#~ "\n"
diff --git a/posix/ChangeLog b/posix/ChangeLog
index 0325c92e..cba078f4 100644
--- a/posix/ChangeLog
+++ b/posix/ChangeLog
@@ -1,3 +1,29 @@
+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.
@@ -17,7 +43,7 @@ Sun Jan 28 15:50:02 2001 Eli Zaretskii <eliz@is.elta.co.il>
Sun Dec 3 16:53:37 2000 Arnold D. Robbins <arnold@skeeve.com>
- * gawkmisc.c (os_setbinmode): new function.
+ * gawkmisc.c (os_setbinmode): New function.
Tue Nov 14 16:13:08 2000 Arnold D. Robbins <arnold@skeeve.com>
@@ -27,11 +53,6 @@ Tue Nov 7 14:09:14 2000 Arnold D. Robbins <arnold@skeeve.com>
* gawkmisc.c (os_is_setuid): new function.
-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.
-
Mon Aug 7 15:23:00 2000 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.0.6: Release tar file made.
@@ -44,6 +65,11 @@ 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/posix/gawkmisc.c b/posix/gawkmisc.c
index 7f5e47ab..6ca9ee3d 100644
--- a/posix/gawkmisc.c
+++ b/posix/gawkmisc.c
@@ -1,6 +1,6 @@
/* gawkmisc.c --- miscellaneous gawk routines that are OS specific.
- Copyright (C) 1986, 1988, 1989, 1991 - 1998, 2001, 2002 the Free Software Foundation, Inc.
+ 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
@@ -62,14 +62,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
@@ -77,16 +126,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 (fstat(fd, stb) == -1)
- fatal("can't stat fd %d (%s)", fd, strerror(errno));
- if (S_ISREG(stb->st_mode)
- && 0 < stb->st_size && stb->st_size < DEFBLKSIZE) /* small file */
- return stb->st_size;
+ 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;
}
diff --git a/profile.c b/profile.c
index 1065d535..44d27855 100644
--- a/profile.c
+++ b/profile.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1999-2002 the Free Software Foundation, Inc.
+ * Copyright (C) 1999-2003 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -36,7 +36,7 @@ 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 *name, NODE *arg_list));
+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));
@@ -45,11 +45,11 @@ 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((char *str, size_t len, int delim));
+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));
+static RETSIGTYPE dump_and_exit P((int signum)) ATTRIBUTE_NORETURN;
static RETSIGTYPE just_dump P((int signum));
#endif
@@ -69,11 +69,8 @@ static int in_expr = FALSE;
/* init_profiling --- do needed initializations, see also main.c */
void
-init_profiling(int *flag, const char *def_file)
+init_profiling(int *flag ATTRIBUTE_UNUSED, const char *def_file ATTRIBUTE_UNUSED)
{
- /* run time init avoids glibc innovations */
- prof_fp = stderr;
-
#ifdef PROFILING
if (*flag == FALSE) {
*flag = TRUE;
@@ -138,7 +135,7 @@ indent(long count)
/* indent_in --- increase the level, with error checking */
static void
-indent_in()
+indent_in(void)
{
assert(indent_level >= 0);
indent_level++;
@@ -147,7 +144,7 @@ indent_in()
/* indent_out --- decrease the level, with error checking */
static void
-indent_out()
+indent_out(void)
{
indent_level--;
assert(indent_level >= 0);
@@ -320,6 +317,8 @@ pprint(register NODE *volatile tree)
indent(SPACEOVER);
fprintf(prof_fp, "}\n");
break;
+#undef hakvar
+#undef arrvar
case Node_K_break:
indent(tree->exec_count);
@@ -332,6 +331,7 @@ pprint(register NODE *volatile tree)
break;
case Node_K_print:
+ case Node_K_print_rec:
pp_print_stmt("print", tree);
break;
@@ -447,7 +447,7 @@ tree_eval(register NODE *tree)
return;
case Node_func_call:
- pp_func_call(tree->rnode, tree->lnode);
+ pp_func_call(tree);
return;
case Node_K_getline:
@@ -455,8 +455,29 @@ tree_eval(register NODE *tree)
return;
case Node_K_delete_loop:
- fprintf(prof_fp, "delete ");
- tree_eval(tree->lnode);
+ {
+ 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 */
@@ -550,11 +571,6 @@ tree_eval(register NODE *tree)
pp_match_op(tree);
return;
- case Node_func:
- fatal(_("function `%s' called with space between name and `(',\n%s"),
- tree->lnode->param,
- _("or used in other expression context"));
-
/* assignments */
case Node_assign:
tree_eval(tree->lnode);
@@ -629,10 +645,6 @@ tree_eval(register NODE *tree)
case Node_minus:
fprintf(prof_fp, " - ");
break;
- case Node_var_array:
- fatal(_("attempt to use array `%s' in a scalar context"),
- tree->vname);
- return;
default:
fatal(_("illegal type (%s) in tree_eval"), nodetype2str(tree->type));
}
@@ -672,7 +684,7 @@ eval_condition(register NODE *tree)
static void
pp_op_assign(register NODE *tree)
{
- char *op = NULL;
+ const char *op = NULL;
enum Order {
NA = 0,
PRE = 1,
@@ -838,10 +850,7 @@ pp_lhs(register NODE *ptr)
case Node_subscript:
n = ptr->lnode;
- if (n->type == Node_func) {
- fatal(_("attempt to use function `%s' as array"),
- n->lnode->param);
- } else if (n->type == Node_param_list) {
+ if (n->type == Node_param_list) {
fprintf(prof_fp, "%s[", fparms[n->param_cnt]);
} else
fprintf(prof_fp, "%s[", n->vname);
@@ -852,10 +861,6 @@ pp_lhs(register NODE *ptr)
fprintf(prof_fp, "]");
break;
- case Node_func:
- fatal(_("`%s' is a function, assignment is not allowed"),
- ptr->lnode->param);
-
case Node_builtin:
fatal(_("assignment is not allowed to result of builtin function"));
@@ -870,8 +875,8 @@ static void
pp_match_op(register NODE *tree)
{
register NODE *re;
- char *op;
- char *restr;
+ const char *op;
+ const char *restr;
size_t relen;
NODE *text = NULL;
@@ -910,7 +915,7 @@ pp_match_op(register NODE *tree)
static void
pp_redir(register NODE *tree, enum redir_placement dir)
{
- char *op = "[BOGUS]"; /* should never be seen */
+ const char *op = "[BOGUS]"; /* should never be seen */
if (tree == NULL)
return;
@@ -984,14 +989,21 @@ pp_print_stmt(const char *command, register NODE *tree)
indent(tree->exec_count);
fprintf(prof_fp, "%s", command);
- if (redir != NULL) { /* parenthesize if have a redirection */
- fprintf(prof_fp, "(");
- pp_list(tree->lnode);
- fprintf(prof_fp, ")");
+ 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, " ");
- pp_list(tree->lnode);
+ if (tree->lnode != NULL)
+ pp_list(tree->lnode);
+ else
+ fprintf(prof_fp, "$0");
}
fprintf(prof_fp, "\n");
}
@@ -1076,16 +1088,23 @@ pp_getline(register NODE *tree)
static void
pp_builtin(register NODE *tree)
{
- fprintf(prof_fp, "%s(", getfname(tree->proc));
- pp_list(tree->subnode);
+ 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 *name, NODE *arglist)
+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, ")");
@@ -1136,7 +1155,7 @@ dump_prog(NODE *begin, NODE *prog, NODE *end)
/* pp_func --- pretty print a function */
void
-pp_func(char *name, size_t namelen, NODE *f)
+pp_func(const char *name, size_t namelen, NODE *f)
{
int j;
char **pnames;
@@ -1167,7 +1186,7 @@ pp_func(char *name, size_t namelen, NODE *f)
/* pp_string --- pretty print a string or regex constant */
static void
-pp_string(char *str, size_t len, int delim)
+pp_string(const char *str, size_t len, int delim)
{
pp_string_fp(prof_fp, str, len, delim, FALSE);
}
@@ -1180,7 +1199,7 @@ pp_string(char *str, size_t len, int delim)
*/
void
-pp_string_fp(FILE *fp, char *in_str, size_t len, int delim, int breaklines)
+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\\";
@@ -1188,7 +1207,7 @@ pp_string_fp(FILE *fp, char *in_str, size_t len, int delim, int breaklines)
int i;
int count;
#define BREAKPOINT 70 /* arbitrary */
- unsigned char *str = (unsigned char *) in_str;
+ const unsigned char *str = (const unsigned char *) in_str;
fprintf(fp, "%c", delim);
for (count = 0; len > 0; len--, str++) {
diff --git a/random.c b/random.c
index 723da48a..73d078dc 100644
--- a/random.c
+++ b/random.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)random.c 8.2 (Berkeley) 5/19/95";
+static const char sccsid[] = "@(#)random.c 8.2 (Berkeley) 5/19/95";
#endif /* LIBC_SCCS and not lint */
#include "random.h" /* gawk addition */
diff --git a/random.h b/random.h
index fe329a27..aea7a8ff 100644
--- a/random.h
+++ b/random.h
@@ -39,4 +39,4 @@
#define __P(s) ()
#endif
-extern long random();
+extern long random __P((void));
diff --git a/re.c b/re.c
index 221f3891..4c954cd3 100644
--- a/re.c
+++ b/re.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1991-2002 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,13 +30,13 @@ static reg_syntax_t syn;
/* make_regexp --- generate compiled regular expressions */
Regexp *
-make_regexp(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
@@ -44,7 +44,8 @@ make_regexp(char *s, size_t len, int ignorecase, int dfa)
It is 0, when the current character is a singlebyte character. */
size_t is_multibyte = 0;
mbstate_t mbs;
- if (MB_CUR_MAX > 1)
+
+ if (gawk_mb_cur_max > 1)
memset(&mbs, 0, sizeof(mbstate_t)); /* Initialize. */
#endif
@@ -60,7 +61,7 @@ make_regexp(char *s, size_t len, int ignorecase, int dfa)
while (src < end) {
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1 && !is_multibyte) {
+ 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);
@@ -72,13 +73,13 @@ make_regexp(char *s, size_t len, int ignorecase, int dfa)
}
#endif
+ if (
#ifdef MBS_SUPPORT
/* We skip multibyte character, since it must not be a special
character. */
- if ((MB_CUR_MAX == 1 || !is_multibyte) && (*src == '\\')) {
-#else
- if (*src == '\\') {
+ (gawk_mb_cur_max == 1 || ! is_multibyte) &&
#endif
+ (*src == '\\')) {
c = *++src;
switch (c) {
case 'a':
@@ -133,10 +134,10 @@ make_regexp(char *s, size_t len, int ignorecase, int dfa)
} else
*dest++ = *src++; /* not '\\' */
#ifdef MBS_SUPPORT
- if (MB_CUR_MAX > 1 && is_multibyte)
+ if (gawk_mb_cur_max > 1 && is_multibyte)
is_multibyte--;
#endif
- } /* for */
+ } /* while */
*dest = '\0' ; /* Only necessary if we print dest ? */
emalloc(rp, Regexp *, sizeof(*rp), "make_regexp");
@@ -150,68 +151,50 @@ make_regexp(char *s, size_t len, int ignorecase, int dfa)
rp->pat.translate = NULL;
len = dest - temp;
if ((rerr = re_compile_pattern(temp, len, &(rp->pat))) != NULL)
- fatal("%s: /%s/", gettext(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(Regexp *rp, register char *str, int 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 res = re_search(&(rp->pat), str, start+len,
- start, len, &(rp->regs));
-
- /*
- * A return of -2 indicates that a heuristic in
- * regex decided it might allocate too much memory
- * on the C stack. This doesn't apply to gawk, which
- * uses REGEX_MALLOC. This is dealt with by the
- * assignment to re_max_failures in resetup().
- * Naetheless, we keep this code here as a fallback.
- */
- if (res == -2) {
- /* the 10 here is arbitrary */
- fatal(_("regex match failed, not enough memory to match string \"%.*s%s\""),
- len > 10 ? 10 : len, str + start,
- len > 10 ? "..." : "");
- }
- return res;
- } else
- return 1;
+ 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;
}
@@ -221,25 +204,22 @@ research(Regexp *rp, register char *str, int start,
void
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(const char *s)
-{
- fatal("%s", s);
-}
-
/* re_update --- recompile a dynamic regexp */
Regexp *
@@ -265,10 +245,6 @@ re_update(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 || (t->re_flags & CASE) != IGNORECASE) {
t1 = force_string(tree_eval(t->re_exp));
unref(t->re_text);
@@ -276,7 +252,7 @@ re_update(NODE *t)
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;
@@ -302,69 +278,43 @@ resetup()
syn |= RE_INTERVALS;
(void) re_set_syntax(syn);
- dfasyntax(syn, FALSE, '\n');
-}
-
-/* avoid_dfa --- FIXME: temporary kludge function until we have a new dfa.c */
-
-int
-avoid_dfa(NODE *re, char *str, size_t len)
-{
- 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;
- }
- }
- if (! anchor)
- return FALSE;
-
- for (end = str + len; str < end; str++)
- if (*str == '\n')
- return TRUE;
-
- return FALSE;
}
/* reisstring --- return TRUE if the RE match is a simple string match */
int
-reisstring(char *text, size_t len, Regexp *re, char *buf)
+reisstring(const char *text, size_t len, Regexp *re, const char *buf)
{
static char metas[] = ".*+(){}[]|?^$\\";
int i;
- int has_meta = FALSE;
int res;
- char *matched;
+ const char *matched;
/* simple checking for has meta characters in re */
for (i = 0; i < len; i++) {
if (strchr(metas, text[i]) != NULL) {
- has_meta = TRUE;
- break;
+ return FALSE; /* give up early, can't be string match */
}
}
/* make accessable to gdb */
matched = &buf[RESTART(re, buf)];
- if (has_meta)
- return FALSE; /* give up early, can't be string match */
-
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;
+}
diff --git a/regcomp.c b/regcomp.c
new file mode 100644
index 00000000..fd417b84
--- /dev/null
+++ b/regcomp.c
@@ -0,0 +1,3559 @@
+/* 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/regex.c b/regex.c
index 9ea11811..2428a263 100644
--- a/regex.c
+++ b/regex.c
@@ -1,7768 +1,66 @@
-/* Extended regular expression matching and search library,
- version 0.12.
- (Implements POSIX draft P1003.2/D11.2, except for some of the
- internationalization features.)
- Copyright (C) 1993, 94, 95, 96, 97, 98, 99, 2000, 2002 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. */
-
-/* AIX requires this to be the first thing in the file. */
-#if defined _AIX && !defined REGEX_MALLOC
- #pragma alloca
-#endif
-
-#undef _GNU_SOURCE
-#define _GNU_SOURCE
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#ifndef PARAMS
-# if defined __GNUC__ || (defined __STDC__ && __STDC__)
-# define PARAMS(args) args
-# else
-# define PARAMS(args) ()
-# endif /* GCC. */
-#endif /* Not PARAMS. */
-
-#ifndef INSIDE_RECURSION
-
-#if !defined __GNUC__
-# define __alignof__(type) sizeof(type)
-#endif
-
-#if defined STDC_HEADERS && !defined emacs
-# include <stddef.h>
-#else
-/* We need this for `regex.h', and perhaps for the Emacs include files. */
-# include <sys/types.h>
-#endif
-
-#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC
-/* We can handle multibyte string. */
-# define MBS_SUPPORT
-# if !WIDE_CHAR_SUPPORT
-# define WIDE_CHAR_SUPPORT 1
-# endif
-#else
-#define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC)
-#endif
-
-/* Activate this if definition of alignof() for non-GNU C is good.
-#if !defined __GNUC__
-# undef MBS_SUPPORT
-#endif
-*/
-
-/* For platform which support the ISO C amendement 1 functionality we
- support user defined character classes. */
-#if defined _LIBC || WIDE_CHAR_SUPPORT
-/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
-# include <wchar.h>
-# include <wctype.h>
-#endif
+ 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 _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) \
+# 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) \
+# 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) \
+# 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) \
+# define re_match(bufp, string, size, pos, regs) \
__re_match (bufp, string, size, pos, regs)
-# define re_search(bufp, string, size, startpos, range, 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) \
+# 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) \
+# define re_set_syntax(syntax) __re_set_syntax (syntax)
+# define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
__re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
-# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
-
-#define btowc __btowc
+# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
#endif
-/* Don't use gettext if ENABLE_NLS is not defined */
-#ifdef ENABLE_NLS
-/* This is for other GNU distributions with internationalized messages. */
-# if HAVE_LIBINTL_H || defined _LIBC
-# include <libintl.h>
-# else
-# define gettext(msgid) (msgid)
-# 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
+#ifdef HAVE_CONFIG_H
+#include "config.h"
#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 bzero
-# ifndef _LIBC
-# define bzero(s, n) (memset (s, '\0', n), (s))
-# else
-# define bzero(s, n) __bzero (s, n)
-# endif
-# endif
-# else
-# include <strings.h>
-# ifndef memcmp
-# define memcmp(s1, s2, n) bcmp (s1, s2, n)
-# endif
-# ifndef memcpy
-# define memcpy(d, s, n) (bcopy (s, d, n), (d))
-# endif
-# endif
-# endif
-
-/* Define the syntax stuff for \<, \>, etc. */
-
-/* This must be nonzero for the wordchar and notwordchar pattern
- commands in re_match_2. */
-# ifndef Sword
-# define Sword 1
-# endif
-
-# ifdef SWITCH_ENUM_BUG
-# define SWITCH_ENUM_CAST(x) ((int)(x))
-# else
-# define SWITCH_ENUM_CAST(x) (x)
-# endif
-
-#endif /* not emacs */
-
-# if defined _LIBC || HAVE_LIMITS_H
-# include <limits.h>
-# endif
-
-# ifndef MB_LEN_MAX
-# define MB_LEN_MAX 1
-# endif
-
-/* Get the interface, including the syntax bits. */
+/* POSIX says that <sys/types.h> must be included (by the caller) before
+ <regex.h>. */
+#include <sys/types.h>
+#include <limits.h>
#include <regex.h>
+#include "regex_internal.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."
- Solaris defines some of these symbols so we must undefine them first. */
-
-#undef ISASCII
-#if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII)
-# define ISASCII(c) 1
-#else
-# define ISASCII(c) isascii(c)
-#endif
-
-#ifdef isblank
-# define ISBLANK(c) (ISASCII (c) && isblank (c))
-#else
-# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
-#endif
-#ifdef isgraph
-# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
-#else
-# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
-#endif
-
-#undef ISPRINT
-#define ISPRINT(c) (ISASCII (c) && isprint (c))
-#define ISDIGIT(c) (ISASCII (c) && isdigit (c))
-#define ISALNUM(c) (ISASCII (c) && isalnum (c))
-#define ISALPHA(c) (ISASCII (c) && isalpha (c))
-#define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
-#define ISLOWER(c) (ISASCII (c) && islower (c))
-#define ISPUNCT(c) (ISASCII (c) && ispunct (c))
-#define ISSPACE(c) (ISASCII (c) && isspace (c))
-#define ISUPPER(c) (ISASCII (c) && isupper (c))
-#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
-
-#ifdef _tolower
-# define TOLOWER(c) _tolower(c)
-#else
-# define TOLOWER(c) tolower(c)
-#endif
-
-#ifndef NULL
-# define NULL (void *)0
-#endif
-
-/* We remove any previous definition of `SIGN_EXTEND_CHAR',
- since ours (we hope) works properly with all combinations of
- machines, compilers, `char' and `unsigned char' argument types.
- (Per Bothner suggested the basic approach.) */
-#undef SIGN_EXTEND_CHAR
-#if __STDC__
-# define SIGN_EXTEND_CHAR(c) ((signed char) (c))
-#else /* not __STDC__ */
-/* As in Harbison and Steele. */
-# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
-#endif
-
-#ifndef emacs
-/* How many characters in the character set. */
-#define CHAR_SET_SIZE 256
-
-#ifdef SYNTAX_TABLE
-
-extern char *re_syntax_table;
-
-#else /* not SYNTAX_TABLE */
-
-static char re_syntax_table[CHAR_SET_SIZE];
-
-static void
-init_syntax_once ()
-{
- register int c;
- static int done = 0;
-
- if (done)
- return;
- bzero (re_syntax_table, sizeof re_syntax_table);
-
- for (c = 0; c < CHAR_SET_SIZE; c++)
- if (ISALNUM (c))
- re_syntax_table[c] = Sword;
-
- re_syntax_table['_'] = Sword;
-
- done = 1;
-}
-
-#endif /* not SYNTAX_TABLE */
-
-#define SYNTAX(c) re_syntax_table[(unsigned char) (c)]
-
-#endif /* emacs */
-
-/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
- use `alloca' instead of `malloc'. This is because using malloc in
- re_search* or re_match* could cause memory leaks when C-g is used in
- Emacs; also, malloc is slower and causes storage fragmentation. On
- the other hand, malloc is more portable, and easier to debug.
-
- Because we sometimes use alloca, some routines have to be macros,
- not functions -- `alloca'-allocated space disappears at the end of the
- function it is called in. */
-
-#ifdef REGEX_MALLOC
-
-# define REGEX_ALLOCATE malloc
-# define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize)
-# define REGEX_FREE free
-
-#else /* not REGEX_MALLOC */
-
-/* Emacs already defines alloca, sometimes. */
-# ifndef alloca
-
-/* Make alloca work the best possible way. */
-# ifdef __GNUC__
-# define alloca __builtin_alloca
-# else /* not __GNUC__ */
-# if HAVE_ALLOCA_H
-# include <alloca.h>
-# endif /* HAVE_ALLOCA_H */
-# endif /* not __GNUC__ */
-
-# endif /* not alloca */
-
-# define REGEX_ALLOCATE alloca
-
-/* Assumes a `char *destination' variable. */
-# define REGEX_REALLOCATE(source, osize, nsize) \
- (destination = (char *) alloca (nsize), \
- memcpy (destination, source, osize))
-
-/* No need to do anything to free, after alloca. */
-# define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */
-
-#endif /* not REGEX_MALLOC */
-
-/* Define how to allocate the failure stack. */
-
-#if defined REL_ALLOC && defined REGEX_MALLOC
-
-# define REGEX_ALLOCATE_STACK(size) \
- r_alloc (&failure_stack_ptr, (size))
-# define REGEX_REALLOCATE_STACK(source, osize, nsize) \
- r_re_alloc (&failure_stack_ptr, (nsize))
-# define REGEX_FREE_STACK(ptr) \
- r_alloc_free (&failure_stack_ptr)
-
-#else /* not using relocating allocator */
-
-# ifdef REGEX_MALLOC
-
-# define REGEX_ALLOCATE_STACK malloc
-# define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize)
-# define REGEX_FREE_STACK free
-
-# else /* not REGEX_MALLOC */
-
-# define REGEX_ALLOCATE_STACK alloca
-
-# define REGEX_REALLOCATE_STACK(source, osize, nsize) \
- REGEX_REALLOCATE (source, osize, nsize)
-/* No need to explicitly free anything. */
-# define REGEX_FREE_STACK(arg)
-
-# endif /* not REGEX_MALLOC */
-#endif /* not using relocating allocator */
-
-
-/* True if `size1' is non-NULL and PTR is pointing anywhere inside
- `string1' or just past its end. This works if PTR is NULL, which is
- a good thing. */
-#define FIRST_STRING_P(ptr) \
- (size1 && string1 <= (ptr) && (ptr) <= string1 + size1)
-
-/* (Re)Allocate N items of type T using malloc, or fail. */
-#define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t)))
-#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t)))
-#define RETALLOC_IF(addr, n, t) \
- if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t)
-#define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t)))
-
-#define BYTEWIDTH 8 /* In bits. */
-
-#define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
-
-#undef MAX
-#undef MIN
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-
-typedef char boolean;
-#define false 0
-#define true 1
-
-static reg_errcode_t byte_regex_compile _RE_ARGS ((const char *pattern, size_t size,
- reg_syntax_t syntax,
- struct re_pattern_buffer *bufp));
-
-static int byte_re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp,
- const char *string1, int size1,
- const char *string2, int size2,
- int pos,
- struct re_registers *regs,
- int stop));
-static int byte_re_search_2 PARAMS ((struct re_pattern_buffer *bufp,
- const char *string1, int size1,
- const char *string2, int size2,
- int startpos, int range,
- struct re_registers *regs, int stop));
-static int byte_re_compile_fastmap PARAMS ((struct re_pattern_buffer *bufp));
-
-#ifdef MBS_SUPPORT
-static reg_errcode_t wcs_regex_compile _RE_ARGS ((const char *pattern, size_t size,
- reg_syntax_t syntax,
- struct re_pattern_buffer *bufp));
-
-
-static int wcs_re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp,
- const char *cstring1, int csize1,
- const char *cstring2, int csize2,
- int pos,
- struct re_registers *regs,
- int stop,
- wchar_t *string1, int size1,
- wchar_t *string2, int size2,
- int *mbs_offset1, int *mbs_offset2));
-static int wcs_re_search_2 PARAMS ((struct re_pattern_buffer *bufp,
- const char *string1, int size1,
- const char *string2, int size2,
- int startpos, int range,
- struct re_registers *regs, int stop));
-static int wcs_re_compile_fastmap PARAMS ((struct re_pattern_buffer *bufp));
-#endif
-
-
-/* These are the command codes that appear in compiled regular
- expressions. Some opcodes are followed by argument bytes. A
- command code can specify any interpretation whatsoever for its
- arguments. Zero bytes may appear in the compiled regular expression. */
-
-typedef enum
-{
- no_op = 0,
-
- /* Succeed right away--no more backtracking. */
- succeed,
-
- /* Followed by one byte giving n, then by n literal bytes. */
- exactn,
-
-# ifdef MBS_SUPPORT
- /* Same as exactn, but contains binary data. */
- exactn_bin,
-# endif
-
- /* Matches any (more or less) character. */
- anychar,
-
- /* Matches any one char belonging to specified set. First
- following byte is number of bitmap bytes. Then come bytes
- for a bitmap saying which chars are in. Bits in each byte
- are ordered low-bit-first. A character is in the set if its
- bit is 1. A character too large to have a bit in the map is
- automatically not in the set. */
- /* ifdef MBS_SUPPORT, following element is length of character
- classes, length of collating symbols, length of equivalence
- classes, length of character ranges, and length of characters.
- Next, character class element, collating symbols elements,
- equivalence class elements, range elements, and character
- elements follow.
- See regex_compile function. */
- charset,
-
- /* Same parameters as charset, but match any character that is
- not one of those specified. */
- charset_not,
-
- /* Start remembering the text that is matched, for storing in a
- register. Followed by one byte with the register number, in
- the range 0 to one less than the pattern buffer's re_nsub
- field. Then followed by one byte with the number of groups
- inner to this one. (This last has to be part of the
- start_memory only because we need it in the on_failure_jump
- of re_match_2.) */
- start_memory,
-
- /* Stop remembering the text that is matched and store it in a
- memory register. Followed by one byte with the register
- number, in the range 0 to one less than `re_nsub' in the
- pattern buffer, and one byte with the number of inner groups,
- just like `start_memory'. (We need the number of inner
- groups here because we don't have any easy way of finding the
- corresponding start_memory when we're at a stop_memory.) */
- stop_memory,
-
- /* Match a duplicate of something remembered. Followed by one
- byte containing the register number. */
- duplicate,
-
- /* Fail unless at beginning of line. */
- begline,
-
- /* Fail unless at end of line. */
- endline,
-
- /* Succeeds if at beginning of buffer (if emacs) or at beginning
- of string to be matched (if not). */
- begbuf,
-
- /* Analogously, for end of buffer/string. */
- endbuf,
-
- /* Followed by two byte relative address to which to jump. */
- jump,
-
- /* Same as jump, but marks the end of an alternative. */
- jump_past_alt,
-
- /* Followed by two-byte relative address of place to resume at
- in case of failure. */
- /* ifdef WCHAR, the size of address is 1. */
- on_failure_jump,
-
- /* Like on_failure_jump, but pushes a placeholder instead of the
- current string position when executed. */
- on_failure_keep_string_jump,
-
- /* Throw away latest failure point and then jump to following
- two-byte relative address. */
- /* ifdef WCHAR, the size of address is 1. */
- pop_failure_jump,
-
- /* Change to pop_failure_jump if know won't have to backtrack to
- match; otherwise change to jump. This is used to jump
- back to the beginning of a repeat. If what follows this jump
- clearly won't match what the repeat does, such that we can be
- sure that there is no use backtracking out of repetitions
- already matched, then we change it to a pop_failure_jump.
- Followed by two-byte address. */
- /* ifdef WCHAR, the size of address is 1. */
- maybe_pop_jump,
-
- /* Jump to following two-byte address, and push a dummy failure
- point. This failure point will be thrown away if an attempt
- is made to use it for a failure. A `+' construct makes this
- before the first repeat. Also used as an intermediary kind
- of jump when compiling an alternative. */
- /* ifdef WCHAR, the size of address is 1. */
- dummy_failure_jump,
-
- /* Push a dummy failure point and continue. Used at the end of
- alternatives. */
- push_dummy_failure,
-
- /* Followed by two-byte relative address and two-byte number n.
- After matching N times, jump to the address upon failure. */
- /* ifdef WCHAR, the size of address is 1. */
- succeed_n,
-
- /* Followed by two-byte relative address, and two-byte number n.
- Jump to the address N times, then fail. */
- /* ifdef WCHAR, the size of address is 1. */
- jump_n,
-
- /* Set the following two-byte relative address to the
- subsequent two-byte number. The address *includes* the two
- bytes of number. */
- /* ifdef WCHAR, the size of address is 1. */
- set_number_at,
-
- wordchar, /* Matches any word-constituent character. */
- 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;
-#endif /* not INSIDE_RECURSION */
-
-
-#ifdef BYTE
-# define CHAR_T char
-# define UCHAR_T unsigned char
-# define COMPILED_BUFFER_VAR bufp->buffer
-/* Offset address size in compiled pattern. */
-# define OFFSET_ADDRESS_SIZE 2
-#ifdef HAVE_STRINGIZE /* if it supports #, it probably supports ## too */
-# define PREFIX(name) byte_##name
-#else
-# define PREFIX(name) byte_/**/name
-#endif
-# define ARG_PREFIX(name) name
-# define PUT_CHAR(c) putchar (c)
-#else
-#ifdef WCHAR
-# define CHAR_T wchar_t
-# define CHAR_T_SIGN (1 << (sizeof(CHAR_T) * 8 - 1))
-# if defined _AIX
-# define WCHAR_T_NEED_SIGNEXTEND 1
-# endif /* _AIX */
-# define UCHAR_T wchar_t
-# define COMPILED_BUFFER_VAR wc_buffer
-/* Offset address size in compiled pattern. */
-# define OFFSET_ADDRESS_SIZE 1
-# define CHAR_CLASS_SIZE ((__alignof__(wctype_t)+sizeof(wctype_t))/sizeof(CHAR_T)+1)
-#ifdef HAVE_STRINGIZE /* if it supports #, it probably supports ## too */
-# define PREFIX(name) wcs_##name
-#else
-# define PREFIX(name) wcs_/**/name
-#endif
-# define ARG_PREFIX(name) c##name
-/* Should we use wide stream?? */
-# define PUT_CHAR(c) printf ("%C", c);
-# define TRUE 1
-# define FALSE 0
-#else
-# ifdef MBS_SUPPORT
-# define WCHAR
-# define INSIDE_RECURSION
-# include "regex.c"
-# undef INSIDE_RECURSION
-# endif /* MBS_SUPPORT */
-# define BYTE
-# define INSIDE_RECURSION
-# include "regex.c"
-# undef INSIDE_RECURSION
-#endif /* WCHAR */
-#endif /* BYTE */
-
-#ifdef INSIDE_RECURSION
-/* Common operations on the compiled pattern. */
-
-/* Store NUMBER in two contiguous bytes starting at DESTINATION. */
-/* ifdef WCHAR, we store NUMBER in 1 element. */
-
-# ifdef WCHAR
-# define STORE_NUMBER(destination, number) \
- do { \
- *(destination) = (UCHAR_T)(number); \
- } while (0)
-# else /* BYTE */
-# define STORE_NUMBER(destination, number) \
- do { \
- (destination)[0] = (number) & 0377; \
- (destination)[1] = (number) >> 8; \
- } while (0)
-# endif /* WCHAR */
-
-/* Same as STORE_NUMBER, except increment DESTINATION to
- the byte after where the number is stored. Therefore, DESTINATION
- must be an lvalue. */
-/* ifdef WCHAR, we store NUMBER in 1 element. */
-
-#define STORE_NUMBER_AND_INCR(destination, number) \
- do { \
- STORE_NUMBER (destination, number); \
- (destination) += OFFSET_ADDRESS_SIZE; \
- } while (0)
-
-/* Put into DESTINATION a number stored in two contiguous bytes starting
- at SOURCE. */
-/* ifdef WCHAR, we store NUMBER in 1 element. */
-
-# ifdef WCHAR
-# ifdef WCHAR_T_NEED_SIGNEXTEND
-# define EXTRACT_NUMBER(destination, source) \
- (destination) = (*(source) ^ CHAR_T_SIGN) - CHAR_T_SIGN;
-# else
-# define EXTRACT_NUMBER(destination, source) \
- (destination) = *(source)
-# endif /* WCHAR_T_NEED_SIGNEXTEND */
-# else /* BYTE */
-# define EXTRACT_NUMBER(destination, source) \
- do { \
- (destination) = *(source) & 0377; \
- (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \
- } while (0)
-# endif
-
-#ifdef DEBUG
-static void PREFIX(extract_number) _RE_ARGS ((int *dest, UCHAR_T *source));
-static void
-PREFIX(extract_number) (dest, source)
- int *dest;
- UCHAR_T *source;
-{
-# ifdef WCHAR
-# ifdef WCHAR_T_NEED_SIGNEXTEND
- *dest = (*source ^ CHAR_T_SIGN) - CHAR_T_SIGN;
-# else
- *dest = *source;
-# endif /* WCHAR_T_NEED_SIGNEXTEND */
-# else /* BYTE */
- int temp = SIGN_EXTEND_CHAR (*(source + 1));
- *dest = *source & 0377;
- *dest += temp << 8;
-# endif
-}
-
-# ifndef EXTRACT_MACROS /* To debug the macros. */
-# undef EXTRACT_NUMBER
-# define EXTRACT_NUMBER(dest, src) PREFIX(extract_number) (&dest, src)
-# endif /* not EXTRACT_MACROS */
-
-#endif /* DEBUG */
-
-/* Same as EXTRACT_NUMBER, except increment SOURCE to after the number.
- SOURCE must be an lvalue. */
-
-#define EXTRACT_NUMBER_AND_INCR(destination, source) \
- do { \
- EXTRACT_NUMBER (destination, source); \
- (source) += OFFSET_ADDRESS_SIZE; \
- } while (0)
-
-#ifdef DEBUG
-static void PREFIX(extract_number_and_incr) _RE_ARGS ((int *destination,
- UCHAR_T **source));
-static void
-PREFIX(extract_number_and_incr) (destination, source)
- int *destination;
- UCHAR_T **source;
-{
- PREFIX(extract_number) (destination, *source);
- *source += OFFSET_ADDRESS_SIZE;
-}
-
-# ifndef EXTRACT_MACROS
-# undef EXTRACT_NUMBER_AND_INCR
-# define EXTRACT_NUMBER_AND_INCR(dest, src) \
- PREFIX(extract_number_and_incr) (&dest, &src)
-# endif /* not EXTRACT_MACROS */
-
-#endif /* DEBUG */
-
-/* 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
-
-#ifndef DEFINED_ONCE
-
-/* 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>
-
-static int debug;
-
-# define DEBUG_STATEMENT(e) e
-# define DEBUG_PRINT1(x) if (debug) printf (x)
-# define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2)
-# define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3)
-# define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4)
-#endif /* not DEFINED_ONCE */
-
-# define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \
- if (debug) PREFIX(print_partial_compiled_pattern) (s, e)
-# define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \
- if (debug) PREFIX(print_double_string) (w, s1, sz1, s2, sz2)
+#include "regex_internal.c"
+#include "regcomp.c"
+#include "regexec.c"
-
-/* Print the fastmap in human-readable form. */
-
-#ifndef DEFINED_ONCE
-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');
-}
-#endif /* not DEFINED_ONCE */
-
-
-/* Print a compiled pattern string in human-readable form, starting at
- the START pointer into it and ending just before the pointer END. */
-
-void
-PREFIX(print_partial_compiled_pattern) (start, end)
- UCHAR_T *start;
- UCHAR_T *end;
-{
- int mcnt, mcnt2;
- UCHAR_T *p1;
- UCHAR_T *p = start;
- UCHAR_T *pend = end;
-
- if (start == NULL)
- {
- 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 ('/');
- PUT_CHAR (*p++);
- }
- while (--mcnt);
- break;
-
-# ifdef MBS_SUPPORT
- case exactn_bin:
- mcnt = *p++;
- printf ("/exactn_bin/%d", mcnt);
- do
- {
- printf("/%lx", (long int) *p++);
- }
- while (--mcnt);
- break;
-# endif /* MBS_SUPPORT */
-
- case start_memory:
- mcnt = *p++;
- printf ("/start_memory/%d/%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:
- {
-# ifdef WCHAR
- int i, length;
- wchar_t *workp = p;
- printf ("/charset [%s",
- (re_opcode_t) *(workp - 1) == charset_not ? "^" : "");
- p += 5;
- length = *workp++; /* the length of char_classes */
- for (i=0 ; i<length ; i++)
- printf("[:%lx:]", (long int) *p++);
- length = *workp++; /* the length of collating_symbol */
- for (i=0 ; i<length ;)
- {
- printf("[.");
- while(*p != 0)
- PUT_CHAR((i++,*p++));
- i++,p++;
- printf(".]");
- }
- length = *workp++; /* the length of equivalence_class */
- for (i=0 ; i<length ;)
- {
- printf("[=");
- while(*p != 0)
- PUT_CHAR((i++,*p++));
- i++,p++;
- printf("=]");
- }
- length = *workp++; /* the length of char_range */
- for (i=0 ; i<length ; i++)
- {
- wchar_t range_start = *p++;
- wchar_t range_end = *p++;
- printf("%C-%C", range_start, range_end);
- }
- length = *workp++; /* the length of char */
- for (i=0 ; i<length ; i++)
- printf("%C", *p++);
- putchar (']');
-# else
- register int c, last = -100;
- register int in_range = 0;
-
- 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;
-# endif /* WCHAR */
- }
- break;
-
- case begline:
- printf ("/begline");
- break;
-
- case endline:
- printf ("/endline");
- break;
-
- case on_failure_jump:
- PREFIX(extract_number_and_incr) (&mcnt, &p);
- printf ("/on_failure_jump to %d", p + mcnt - start);
- break;
-
- case on_failure_keep_string_jump:
- PREFIX(extract_number_and_incr) (&mcnt, &p);
- printf ("/on_failure_keep_string_jump to %d", p + mcnt - start);
- break;
-
- case dummy_failure_jump:
- PREFIX(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:
- PREFIX(extract_number_and_incr) (&mcnt, &p);
- printf ("/maybe_pop_jump to %d", p + mcnt - start);
- break;
-
- case pop_failure_jump:
- PREFIX(extract_number_and_incr) (&mcnt, &p);
- printf ("/pop_failure_jump to %d", p + mcnt - start);
- break;
-
- case jump_past_alt:
- PREFIX(extract_number_and_incr) (&mcnt, &p);
- printf ("/jump_past_alt to %d", p + mcnt - start);
- break;
-
- case jump:
- PREFIX(extract_number_and_incr) (&mcnt, &p);
- printf ("/jump to %d", p + mcnt - start);
- break;
-
- case succeed_n:
- PREFIX(extract_number_and_incr) (&mcnt, &p);
- p1 = p + mcnt;
- PREFIX(extract_number_and_incr) (&mcnt2, &p);
- printf ("/succeed_n to %d, %d times", p1 - start, mcnt2);
- break;
-
- case jump_n:
- PREFIX(extract_number_and_incr) (&mcnt, &p);
- p1 = p + mcnt;
- PREFIX(extract_number_and_incr) (&mcnt2, &p);
- printf ("/jump_n to %d, %d times", p1 - start, mcnt2);
- break;
-
- case set_number_at:
- PREFIX(extract_number_and_incr) (&mcnt, &p);
- p1 = p + mcnt;
- PREFIX(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
-PREFIX(print_compiled_pattern) (bufp)
- struct re_pattern_buffer *bufp;
-{
- UCHAR_T *buffer = (UCHAR_T*) bufp->buffer;
-
- PREFIX(print_partial_compiled_pattern) (buffer, buffer
- + bufp->used / sizeof(UCHAR_T));
- printf ("%ld bytes used/%ld bytes allocated.\n",
- bufp->used, bufp->allocated);
-
- 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
-PREFIX(print_double_string) (where, string1, size1, string2, size2)
- const CHAR_T *where;
- const CHAR_T *string1;
- const CHAR_T *string2;
- int size1;
- int size2;
-{
- int this_char;
-
- if (where == NULL)
- printf ("(null)");
- else
- {
- if (FIRST_STRING_P (where))
- {
- for (this_char = where - string1; this_char < size1; this_char++)
- PUT_CHAR (string1[this_char]);
-
- where = string2;
- }
-
- for (this_char = where - string2; this_char < size2; this_char++)
- PUT_CHAR (string2[this_char]);
- }
-}
-
-# ifndef DEFINED_ONCE
-void
-printchar (c)
- int c;
-{
- putc (c, stderr);
-}
-#endif
-
-#else /* not DEBUG */
-
-#ifndef DEFINED_ONCE
-# 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)
-#endif /* not DEFINED_ONCE */
-# define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
-# define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
-
-#endif /* not DEBUG */
-
-# ifdef WCHAR
-/* This convert a multibyte string to a wide character string.
- And write their correspondances to offset_buffer(see below)
- and write whether each wchar_t is binary data to is_binary.
- This assume invalid multibyte sequences as binary data.
- We assume offset_buffer and is_binary is already allocated
- enough space. */
-
-static size_t convert_mbs_to_wcs (CHAR_T *dest, const unsigned char* src,
- size_t len, int *offset_buffer,
- char *is_binary);
-static size_t
-convert_mbs_to_wcs (dest, src, len, offset_buffer, is_binary)
- CHAR_T *dest;
- const unsigned char* src;
- size_t len; /* the length of multibyte string. */
-
- /* It hold correspondances between src(char string) and
- dest(wchar_t string) for optimization.
- e.g. src = "xxxyzz"
- dest = {'X', 'Y', 'Z'}
- (each "xxx", "y" and "zz" represent one multibyte character
- corresponding to 'X', 'Y' and 'Z'.)
- offset_buffer = {0, 0+3("xxx"), 0+3+1("y"), 0+3+1+2("zz")}
- = {0, 3, 4, 6}
- */
- int *offset_buffer;
- char *is_binary;
-{
- wchar_t *pdest = dest;
- const unsigned char *psrc = src;
- size_t wc_count = 0;
-
- mbstate_t mbs;
- int i, consumed;
- size_t mb_remain = len;
- size_t mb_count = 0;
-
- /* Initialize the conversion state. */
- memset (&mbs, 0, sizeof (mbstate_t));
-
- offset_buffer[0] = 0;
- for( ; mb_remain > 0 ; ++wc_count, ++pdest, mb_remain -= consumed,
- psrc += consumed)
- {
- consumed = mbrtowc (pdest, psrc, mb_remain, &mbs);
-
- if (consumed <= 0)
- /* failed to convert. maybe src contains binary data.
- So we consume 1 byte manualy. */
- {
- *pdest = *psrc;
- consumed = 1;
- is_binary[wc_count] = TRUE;
- }
- else
- is_binary[wc_count] = FALSE;
- /* In sjis encoding, we use yen sign as escape character in
- place of reverse solidus. So we convert 0x5c(yen sign in
- sjis) to not 0xa5(yen sign in UCS2) but 0x5c(reverse
- solidus in UCS2). */
- if (consumed == 1 && (int) *psrc == 0x5c && (int) *pdest == 0xa5)
- *pdest = (wchar_t) *psrc;
-
- offset_buffer[wc_count + 1] = mb_count += consumed;
- }
-
- /* Fill remain of the buffer with sentinel. */
- for (i = wc_count + 1 ; i <= len ; i++)
- offset_buffer[i] = mb_count + 1;
-
- return wc_count;
-}
-# endif /* WCHAR */
-
-#else /* not INSIDE_RECURSION */
-/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can
- also be assigned to arbitrarily: each pattern buffer stores its own
- syntax, so it can be changed between regex compilations. */
-/* This has no initializer because initialized variables in Emacs
- become read-only after dumping. */
-reg_syntax_t re_syntax_options = 0; /* Gawk: initialize to force this one,
- not the one in the C library. */
-
-
-/* Specify the precise syntax of regexps for compilation. This provides
- for compatibility for various utilities which historically have
- different, incompatible syntaxes.
-
- The argument SYNTAX is a bit mask comprised of the various bits
- defined in regex.h. We return the old syntax. */
-
-reg_syntax_t
-re_set_syntax (syntax)
- reg_syntax_t syntax;
-{
- reg_syntax_t ret = re_syntax_options;
-
- re_syntax_options = syntax;
-#ifdef DEBUG
- if (syntax & RE_DEBUG)
- debug = 1;
- else if (debug) /* was on but now is not */
- debug = 0;
-#endif /* DEBUG */
- return ret;
-}
-#ifdef _LIBC
-weak_alias (__re_set_syntax, re_set_syntax)
-#endif
-
-/* This table gives an error message for each of the error codes listed
- in regex.h. Obviously the order here has to be same as there.
- POSIX doesn't require that we do anything for REG_NOERROR,
- but why not be nice? */
-
-/* Gawk: 12 Dec 2000 --- revert to array of char * for use with K&R Compilers. */
-
-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 */
- };
-
-#endif /* INSIDE_RECURSION */
-
-#ifndef DEFINED_ONCE
-/* Avoiding alloca during matching, to placate r_alloc. */
-
-/* Define MATCH_MAY_ALLOCATE unless we need to make sure that the
- 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
-#endif /* not DEFINED_ONCE */
-
-
-#ifdef INSIDE_RECURSION
-/* Failure stack declarations and macros; both re_compile_fastmap and
- re_match_2 use a failure stack. These have to be macros because of
- REGEX_ALLOCATE_STACK. */
-
-
-/* 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
-
-#ifndef DEFINED_ONCE
-
-# ifdef REGEX_MALLOC
-/*
- * Set RE_MAX_FAILURES to the largest reasonable value,
- * to avoid spurious "not enough memory" messages.
- * The '80' is computed as follows:
- * regex.c's MAX_FAILURE_ITEMS is at most 20.
- * regex.c computes 2 * MAX_FAILURE_ITEMS, giving us 40.
- * re_max_failures is signed, not unsigned, for another factor of 2,
- * giving us 80.
- */
-long int re_max_failures = ((unsigned) -1) / 80;
-# else /* ! not REGEX_MALLOC */
-# if defined MATCH_MAY_ALLOCATE
-/* 4400 was enough to cause a crash on Alpha OSF/1,
- whose default stack limit is 2mb. */
-long int re_max_failures = 4000;
-# else
-long int re_max_failures = 2000;
-# endif
-# endif /* ! not REGEX_MALLOC */
-#endif /* ! DEFINED_ONCE */
-
-union PREFIX(fail_stack_elt)
-{
- UCHAR_T *pointer;
- long int integer;
-};
-
-typedef union PREFIX(fail_stack_elt) PREFIX(fail_stack_elt_t);
-
-typedef struct
-{
- PREFIX(fail_stack_elt_t) *stack;
- unsigned long int size;
- unsigned long int avail; /* Offset of next open position. */
-} PREFIX(fail_stack_type);
-
-#else /* not INT_IS_16BIT */
-
-#ifndef DEFINED_ONCE
-
-# ifdef REGEX_MALLOC
-/*
- * Set RE_MAX_FAILURES to the largest reasonable value,
- * to avoid spurious "not enough memory" messages.
- * The '80' is computed as follows:
- * regex.c's MAX_FAILURE_ITEMS is at most 20.
- * regex.c computes 2 * MAX_FAILURE_ITEMS, giving us 40.
- * re_max_failures is signed, not unsigned, for another factor of 2,
- * giving us 80.
- */
-long int re_max_failures = ((unsigned) -1) / 80;
-# else /* ! not REGEX_MALLOC */
-# if defined MATCH_MAY_ALLOCATE
-/* 4400 was enough to cause a crash on Alpha OSF/1,
- whose default stack limit is 2mb. */
-int re_max_failures = 20000;
-# else
+/* 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
-# endif /* ! not REGEX_MALLOC */
-#endif
-
-union PREFIX(fail_stack_elt)
-{
- UCHAR_T *pointer;
- int integer;
-};
-
-typedef union PREFIX(fail_stack_elt) PREFIX(fail_stack_elt_t);
-
-typedef struct
-{
- PREFIX(fail_stack_elt_t) *stack;
- unsigned size;
- unsigned avail; /* Offset of next open position. */
-} PREFIX(fail_stack_type);
-
-#endif /* INT_IS_16BIT */
-
-#ifndef DEFINED_ONCE
-#define FAIL_STACK_EMPTY() (fail_stack.avail == 0)
-#define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0)
-#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size)
-#endif
-
-
-/* Define macros to initialize and free the failure stack.
- Do `return -2' if the alloc fails. */
-
-#ifdef MATCH_MAY_ALLOCATE
-# define INIT_FAIL_STACK() \
- do { \
- fail_stack.stack = (PREFIX(fail_stack_elt_t) *) \
- REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (PREFIX(fail_stack_elt_t))); \
- \
- if (fail_stack.stack == NULL) \
- return -2; \
- \
- 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 = (PREFIX(fail_stack_elt_t) *) \
- REGEX_REALLOCATE_STACK ((fail_stack).stack, \
- (fail_stack).size * sizeof (PREFIX(fail_stack_elt_t)), \
- ((fail_stack).size << 1) * sizeof (PREFIX(fail_stack_elt_t))),\
- \
- (fail_stack).stack == NULL \
- ? 0 \
- : ((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 = (UCHAR_T *) (item)
-
-/* This pushes an integer-valued item onto the failure stack.
- Assumes the variable `fail_stack'. Probably should only
- be called from within `PUSH_FAILURE_POINT'. */
-#define PUSH_FAILURE_INT(item) \
- fail_stack.stack[fail_stack.avail++].integer = (item)
-
-/* Push a fail_stack_elt_t value onto the failure stack.
- Assumes the variable `fail_stack'. Probably should only
- be called from within `PUSH_FAILURE_POINT'. */
-#define PUSH_FAILURE_ELT(item) \
- fail_stack.stack[fail_stack.avail++] = (item)
-
-/* These three POP... operations complement the three PUSH... operations.
- All assume that `fail_stack' is nonempty. */
-#define POP_FAILURE_POINTER() fail_stack.stack[--fail_stack.avail].pointer
-#define POP_FAILURE_INT() fail_stack.stack[--fail_stack.avail].integer
-#define POP_FAILURE_ELT() fail_stack.stack[--fail_stack.avail]
-
-/* Used to omit pushing failure point id's when we're not debugging. */
-#ifdef DEBUG
-# define DEBUG_PUSH PUSH_FAILURE_INT
-# define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_INT ()
-#else
-# define DEBUG_PUSH(item)
-# define DEBUG_POP(item_addr)
-#endif
-
-
-/* Push the information about the state we will need
- if we ever fail back to it.
-
- Requires variables fail_stack, regstart, regend, reg_info, and
- num_regs_pushed be declared. DOUBLE_FAIL_STACK requires `destination'
- be declared.
-
- Does `return FAILURE_CODE' if runs out of memory. */
-
-#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \
- do { \
- char *destination; \
- /* Must be int, so when we don't save any registers, the arithmetic \
- of 0 + -1 isn't done as unsigned. */ \
- /* Can't be int, since there is not a shred of a guarantee that int \
- is wide enough to hold a value of something to which pointer can \
- be assigned */ \
- active_reg_t this_reg; \
- \
- DEBUG_STATEMENT (failure_id++); \
- DEBUG_STATEMENT (nfailure_points_pushed++); \
- DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \
- DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\
- DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\
- \
- DEBUG_PRINT2 (" slots needed: %ld\n", NUM_FAILURE_ITEMS); \
- DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \
- \
- /* Ensure we have enough space allocated for what we will push. */ \
- while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \
- { \
- if (!DOUBLE_FAIL_STACK (fail_stack)) \
- return failure_code; \
- \
- DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \
- (fail_stack).size); \
- DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\
- } \
- \
- /* Push the info, starting with the registers. */ \
- DEBUG_PRINT1 ("\n"); \
- \
- if (1) \
- for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \
- this_reg++) \
- { \
- DEBUG_PRINT2 (" Pushing reg: %lu\n", this_reg); \
- DEBUG_STATEMENT (num_regs_pushed++); \
- \
- DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \
- PUSH_FAILURE_POINTER (regstart[this_reg]); \
- \
- DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \
- PUSH_FAILURE_POINTER (regend[this_reg]); \
- \
- DEBUG_PRINT2 (" info: %p\n ", \
- reg_info[this_reg].word.pointer); \
- DEBUG_PRINT2 (" match_null=%d", \
- REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \
- DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \
- DEBUG_PRINT2 (" matched_something=%d", \
- MATCHED_SOMETHING (reg_info[this_reg])); \
- DEBUG_PRINT2 (" ever_matched=%d", \
- EVER_MATCHED_SOMETHING (reg_info[this_reg])); \
- DEBUG_PRINT1 ("\n"); \
- PUSH_FAILURE_ELT (reg_info[this_reg].word); \
- } \
- \
- DEBUG_PRINT2 (" Pushing low active reg: %ld\n", lowest_active_reg);\
- PUSH_FAILURE_INT (lowest_active_reg); \
- \
- DEBUG_PRINT2 (" Pushing high active reg: %ld\n", highest_active_reg);\
- PUSH_FAILURE_INT (highest_active_reg); \
- \
- DEBUG_PRINT2 (" Pushing pattern %p:\n", pattern_place); \
- DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \
- PUSH_FAILURE_POINTER (pattern_place); \
- \
- DEBUG_PRINT2 (" Pushing string %p: `", string_place); \
- DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \
- size2); \
- DEBUG_PRINT1 ("'\n"); \
- PUSH_FAILURE_POINTER (string_place); \
- \
- DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \
- DEBUG_PUSH (failure_id); \
- } while (0)
-
-#ifndef DEFINED_ONCE
-/* This is the number of items that are pushed and popped on the stack
- for each register. */
-#define NUM_REG_ITEMS 3
-
-/* 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)
-#endif /* not DEFINED_ONCE */
-
-
-/* Pops what PUSH_FAIL_STACK pushes.
-
- We restore into the parameters, all of which should be lvalues:
- STR -- the saved data position.
- PAT -- the saved pattern position.
- LOW_REG, HIGH_REG -- the highest and lowest active registers.
- REGSTART, REGEND -- arrays of string positions.
- REG_INFO -- array of information about each subexpression.
-
- Also assumes the variables `fail_stack' and (if debugging), `bufp',
- `pend', `string1', `size1', `string2', and `size2'. */
-
-#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\
-{ \
- DEBUG_STATEMENT (unsigned failure_id;) \
- active_reg_t this_reg; \
- const UCHAR_T *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_T *) string_temp; \
- \
- DEBUG_PRINT2 (" Popping string %p: `", str); \
- DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \
- DEBUG_PRINT1 ("'\n"); \
- \
- pat = (UCHAR_T *) POP_FAILURE_POINTER (); \
- DEBUG_PRINT2 (" Popping pattern %p:\n", pat); \
- DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \
- \
- /* Restore register info. */ \
- high_reg = (active_reg_t) POP_FAILURE_INT (); \
- DEBUG_PRINT2 (" Popping high active reg: %ld\n", high_reg); \
- \
- low_reg = (active_reg_t) POP_FAILURE_INT (); \
- DEBUG_PRINT2 (" Popping low active reg: %ld\n", low_reg); \
- \
- if (1) \
- for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \
- { \
- DEBUG_PRINT2 (" Popping reg: %ld\n", this_reg); \
- \
- reg_info[this_reg].word = POP_FAILURE_ELT (); \
- DEBUG_PRINT2 (" info: %p\n", \
- reg_info[this_reg].word.pointer); \
- \
- regend[this_reg] = (const CHAR_T *) POP_FAILURE_POINTER (); \
- DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \
- \
- regstart[this_reg] = (const CHAR_T *) POP_FAILURE_POINTER (); \
- DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \
- } \
- else \
- { \
- 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
-{
- PREFIX(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;
-} PREFIX(register_info_type);
-
-#ifndef DEFINED_ONCE
-#define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p)
-#define IS_ACTIVE(R) ((R).bits.is_active)
-#define MATCHED_SOMETHING(R) ((R).bits.matched_something)
-#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)
-#endif /* not DEFINED_ONCE */
-
-/* Registers are set to a sentinel when they haven't yet matched. */
-static CHAR_T PREFIX(reg_unset_dummy);
-#define REG_UNSET_VALUE (&PREFIX(reg_unset_dummy))
-#define REG_UNSET(e) ((e) == REG_UNSET_VALUE)
-
-/* Subroutine declarations and macros for regex_compile. */
-static void PREFIX(store_op1) _RE_ARGS ((re_opcode_t op, UCHAR_T *loc, int arg));
-static void PREFIX(store_op2) _RE_ARGS ((re_opcode_t op, UCHAR_T *loc,
- int arg1, int arg2));
-static void PREFIX(insert_op1) _RE_ARGS ((re_opcode_t op, UCHAR_T *loc,
- int arg, UCHAR_T *end));
-static void PREFIX(insert_op2) _RE_ARGS ((re_opcode_t op, UCHAR_T *loc,
- int arg1, int arg2, UCHAR_T *end));
-static boolean PREFIX(at_begline_loc_p) _RE_ARGS ((const CHAR_T *pattern, const CHAR_T *p,
- reg_syntax_t syntax));
-static boolean PREFIX(at_endline_loc_p) _RE_ARGS ((const CHAR_T *p, const CHAR_T *pend,
- reg_syntax_t syntax));
-# ifdef WCHAR
-static reg_errcode_t wcs_compile_range _RE_ARGS ((CHAR_T range_start,
- const CHAR_T **p_ptr,
- const CHAR_T *pend,
- char *translate,
- reg_syntax_t syntax,
- UCHAR_T *b,
- CHAR_T *char_set));
-static void insert_space _RE_ARGS ((int num, CHAR_T *loc, CHAR_T *end));
-# else /* BYTE */
-static reg_errcode_t byte_compile_range _RE_ARGS ((unsigned int range_start,
- const char **p_ptr,
- const char *pend,
- char *translate,
- reg_syntax_t syntax,
- unsigned char *b));
-# endif /* WCHAR */
-
-/* Fetch the next character in the uncompiled pattern---translating it
- if necessary. Also cast from a signed character in the constant
- string passed to us by the user to an unsigned char that we can use
- as an array index (in, e.g., `translate'). */
-/* ifdef WCHAR, we translate only if character <= 0xff,
- because it is impossible to allocate 4GB array for some encodings
- which have 4 byte character_set like UCS4. */
-#ifndef PATFETCH
-# ifdef WCHAR
-# define PATFETCH(c) \
- do {if (p == pend) return REG_EEND; \
- c = (UCHAR_T) *p++; \
- if (translate && (c <= 0xff)) c = (UCHAR_T) translate[c]; \
- } while (0)
-# else /* BYTE */
-# define PATFETCH(c) \
- do {if (p == pend) return REG_EEND; \
- c = (unsigned char) *p++; \
- if (translate) c = (unsigned char) translate[c]; \
- } while (0)
-# endif /* WCHAR */
-#endif
-
-/* Fetch the next character in the uncompiled pattern, with no
- translation. */
-#define PATFETCH_RAW(c) \
- do {if (p == pend) return REG_EEND; \
- c = (UCHAR_T) *p++; \
- } while (0)
-
-/* Go backwards one character in the pattern. */
-#define PATUNFETCH p--
-
-
-/* If `translate' is non-null, return translate[D], else just D. We
- cast the subscript to translate because some data is declared as
- `char *', to avoid warnings when a string constant is passed. But
- when we use a character as a subscript we must make it unsigned. */
-/* ifdef WCHAR, we translate only if character <= 0xff,
- because it is impossible to allocate 4GB array for some encodings
- which have 4 byte character_set like UCS4. */
-#ifndef TRANSLATE
-# ifdef WCHAR
-# define TRANSLATE(d) \
- ((translate && ((UCHAR_T) (d)) <= 0xff) \
- ? (char) translate[(unsigned char) (d)] : (d))
-# else /* BYTE */
-# define TRANSLATE(d) \
- (translate ? (char) translate[(unsigned char) (d)] : (d))
-# endif /* WCHAR */
-#endif
-
-
-/* Macros for outputting the compiled pattern into `buffer'. */
-
-/* If the buffer isn't allocated when it comes in, use this. */
-# define INIT_BUF_SIZE (32 * sizeof(UCHAR_T))
-
-/* Make sure we have at least N more bytes of space in buffer. */
-# ifdef WCHAR
-# define GET_BUFFER_SPACE(n) \
- while (((unsigned long)b - (unsigned long)COMPILED_BUFFER_VAR \
- + (n)*sizeof(CHAR_T)) > bufp->allocated) \
- EXTEND_BUFFER ()
-# else /* BYTE */
-# define GET_BUFFER_SPACE(n) \
- while ((unsigned long) (b - bufp->buffer + (n)) > bufp->allocated) \
- EXTEND_BUFFER ()
-# endif /* WCHAR */
-
-/* Make sure we have one more byte of buffer space and then add C to it. */
-#define BUF_PUSH(c) \
- do { \
- GET_BUFFER_SPACE (1); \
- *b++ = (UCHAR_T) (c); \
- } while (0)
-
-
-/* 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++ = (UCHAR_T) (c1); \
- *b++ = (UCHAR_T) (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++ = (UCHAR_T) (c1); \
- *b++ = (UCHAR_T) (c2); \
- *b++ = (UCHAR_T) (c3); \
- } while (0)
-
-
-/* Store a jump with opcode OP at LOC to location TO. We store a
- relative address offset by the three bytes the jump itself occupies. */
-#define STORE_JUMP(op, loc, to) \
- PREFIX(store_op1) (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)))
-
-/* Likewise, for a two-argument jump. */
-#define STORE_JUMP2(op, loc, to, arg) \
- PREFIX(store_op2) (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)), arg)
-
-/* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */
-#define INSERT_JUMP(op, loc, to) \
- PREFIX(insert_op1) (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)), b)
-
-/* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */
-#define INSERT_JUMP2(op, loc, to, arg) \
- PREFIX(insert_op2) (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)), arg, b)
-
-
-/* This is not an arbitrary limit: the arguments which represent offsets
- 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!! */
-#ifndef DEFINED_ONCE
-#if defined _MSC_VER && !defined WIN32
-/* Microsoft C 16-bit versions limit malloc to approx 65512 bytes.
- The REALLOC define eliminates a flurry of conversion warnings,
- but is not required. */
-# define MAX_BUF_SIZE 65500L
-# define REALLOC(p,s) realloc ((p), (size_t) (s))
-#else
-# define MAX_BUF_SIZE (1L << 16)
-# define REALLOC(p,s) realloc ((p), (s))
-#endif
-
-/* Extend the buffer by twice its current size via realloc and
- reset the pointers that pointed into the old block to point to the
- correct places in the new one. If extending the buffer results in it
- being larger than MAX_BUF_SIZE, then flag memory exhausted. */
-#if __BOUNDED_POINTERS__
-# define SET_HIGH_BOUND(P) (__ptrhigh (P) = __ptrlow (P) + bufp->allocated)
-# define MOVE_BUFFER_POINTER(P) \
- (__ptrlow (P) += incr, SET_HIGH_BOUND (P), __ptrvalue (P) += incr)
-# define ELSE_EXTEND_BUFFER_HIGH_BOUND \
- else \
- { \
- SET_HIGH_BOUND (b); \
- SET_HIGH_BOUND (begalt); \
- if (fixup_alt_jump) \
- SET_HIGH_BOUND (fixup_alt_jump); \
- if (laststart) \
- SET_HIGH_BOUND (laststart); \
- if (pending_exact) \
- SET_HIGH_BOUND (pending_exact); \
- }
-#else
-# define MOVE_BUFFER_POINTER(P) (P) += incr
-# define ELSE_EXTEND_BUFFER_HIGH_BOUND
-#endif
-#endif /* not DEFINED_ONCE */
-# ifdef WCHAR
-# define EXTEND_BUFFER() \
- do { \
- UCHAR_T *old_buffer = COMPILED_BUFFER_VAR; \
- int wchar_count; \
- if (bufp->allocated + sizeof(UCHAR_T) > MAX_BUF_SIZE) \
- return REG_ESIZE; \
- bufp->allocated <<= 1; \
- if (bufp->allocated > MAX_BUF_SIZE) \
- bufp->allocated = MAX_BUF_SIZE; \
- /* How many characters the new buffer can have? */ \
- wchar_count = bufp->allocated / sizeof(UCHAR_T); \
- if (wchar_count == 0) wchar_count = 1; \
- /* Truncate the buffer to CHAR_T align. */ \
- bufp->allocated = wchar_count * sizeof(UCHAR_T); \
- RETALLOC (COMPILED_BUFFER_VAR, wchar_count, UCHAR_T); \
- bufp->buffer = (char*)COMPILED_BUFFER_VAR; \
- if (COMPILED_BUFFER_VAR == NULL) \
- return REG_ESPACE; \
- /* If the buffer moved, move all the pointers into it. */ \
- if (old_buffer != COMPILED_BUFFER_VAR) \
- { \
- int incr = COMPILED_BUFFER_VAR - old_buffer; \
- MOVE_BUFFER_POINTER (b); \
- MOVE_BUFFER_POINTER (begalt); \
- if (fixup_alt_jump) \
- MOVE_BUFFER_POINTER (fixup_alt_jump); \
- if (laststart) \
- MOVE_BUFFER_POINTER (laststart); \
- if (pending_exact) \
- MOVE_BUFFER_POINTER (pending_exact); \
- } \
- ELSE_EXTEND_BUFFER_HIGH_BOUND \
- } while (0)
-# else /* BYTE */
-# define EXTEND_BUFFER() \
- do { \
- UCHAR_T *old_buffer = COMPILED_BUFFER_VAR; \
- if (bufp->allocated == MAX_BUF_SIZE) \
- return REG_ESIZE; \
- bufp->allocated <<= 1; \
- if (bufp->allocated > MAX_BUF_SIZE) \
- bufp->allocated = MAX_BUF_SIZE; \
- bufp->buffer = (UCHAR_T *) REALLOC (COMPILED_BUFFER_VAR, \
- bufp->allocated); \
- if (COMPILED_BUFFER_VAR == NULL) \
- return REG_ESPACE; \
- /* If the buffer moved, move all the pointers into it. */ \
- if (old_buffer != COMPILED_BUFFER_VAR) \
- { \
- int incr = COMPILED_BUFFER_VAR - old_buffer; \
- MOVE_BUFFER_POINTER (b); \
- MOVE_BUFFER_POINTER (begalt); \
- if (fixup_alt_jump) \
- MOVE_BUFFER_POINTER (fixup_alt_jump); \
- if (laststart) \
- MOVE_BUFFER_POINTER (laststart); \
- if (pending_exact) \
- MOVE_BUFFER_POINTER (pending_exact); \
- } \
- ELSE_EXTEND_BUFFER_HIGH_BOUND \
- } while (0)
-# endif /* WCHAR */
-
-#ifndef DEFINED_ONCE
-/* Since we have one byte reserved for the register number argument to
- {start,stop}_memory, the maximum number of groups we can report
- things about is what fits in that byte. */
-#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])
-
-#endif /* not DEFINED_ONCE */
-
-/* Set the bit for character C in a list. */
-#ifndef DEFINED_ONCE
-#define SET_LIST_BIT(c) \
- (b[((unsigned char) (c)) / BYTEWIDTH] \
- |= 1 << (((unsigned char) c) % BYTEWIDTH))
-
-#endif /* DEFINED_ONCE */
-
-/* Get the next unsigned number in the uncompiled pattern. */
-#define GET_UNSIGNED_NUMBER(num) \
- { if (p != pend) \
- { \
- PATFETCH (c); \
- while (ISDIGIT (c)) \
- { \
- if (num < 0) \
- num = 0; \
- num = num * 10 + c - '0'; \
- if (p == pend) \
- break; \
- PATFETCH (c); \
- } \
- } \
- }
-
-#ifndef DEFINED_ONCE
-#if defined _LIBC || WIDE_CHAR_SUPPORT
-/* The GNU C library provides support for user-defined character classes
- and the functions from ISO C amendement 1. */
-# ifdef CHARCLASS_NAME_MAX
-# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
-# else
-/* This shouldn't happen but some implementation might still have this
- problem. Use a reasonable default value. */
-# define CHAR_CLASS_MAX_LENGTH 256
-# endif
-
-# ifdef _LIBC
-# define IS_CHAR_CLASS(string) __wctype (string)
-# else
-# define IS_CHAR_CLASS(string) wctype (string)
-# endif
-#else
-# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
-
-# define IS_CHAR_CLASS(string) \
- (STREQ (string, "alpha") || STREQ (string, "upper") \
- || STREQ (string, "lower") || STREQ (string, "digit") \
- || STREQ (string, "alnum") || STREQ (string, "xdigit") \
- || STREQ (string, "space") || STREQ (string, "print") \
- || STREQ (string, "punct") || STREQ (string, "graph") \
- || STREQ (string, "cntrl") || STREQ (string, "blank"))
-#endif
-#endif /* DEFINED_ONCE */
-
-#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 PREFIX(fail_stack_type) fail_stack;
-
-/* Size with which the following vectors are currently allocated.
- That is so we can make them bigger as needed,
- but never make them smaller. */
-#ifdef DEFINED_ONCE
-static int regs_allocated_size;
-
-static const char ** regstart, ** regend;
-static const char ** old_regstart, ** old_regend;
-static const char **best_regstart, **best_regend;
-static const char **reg_dummy;
-#endif /* DEFINED_ONCE */
-
-static PREFIX(register_info_type) *PREFIX(reg_info);
-static PREFIX(register_info_type) *PREFIX(reg_info_dummy);
-
-/* Make the register vectors big enough for NUM_REGS registers,
- but don't make them smaller. */
-
-static void
-PREFIX(regex_grow_registers) (num_regs)
- int num_regs;
-{
- if (num_regs > regs_allocated_size)
- {
- 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 (PREFIX(reg_info), num_regs, PREFIX(register_info_type));
- RETALLOC_IF (reg_dummy, num_regs, const char *);
- RETALLOC_IF (PREFIX(reg_info_dummy), num_regs, PREFIX(register_info_type));
-
- regs_allocated_size = num_regs;
- }
-}
-
-#endif /* not MATCH_MAY_ALLOCATE */
-
-#ifndef DEFINED_ONCE
-static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type
- compile_stack,
- regnum_t regnum));
-#endif /* not DEFINED_ONCE */
-
-/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
- Returns one of error codes defined in `regex.h', or zero for success.
-
- Assumes the `allocated' (and perhaps `buffer') and `translate'
- fields are set in BUFP on entry.
-
- If it succeeds, results are put in BUFP (if it returns an error, the
- contents of BUFP are undefined):
- `buffer' is the compiled pattern;
- `syntax' is set to SYNTAX;
- `used' is set to the length of the compiled pattern;
- `fastmap_accurate' is zero;
- `re_nsub' is the number of subexpressions in PATTERN;
- `not_bol' and `not_eol' are zero;
-
- The `fastmap' and `newline_anchor' fields are neither
- examined nor set. */
-
-/* Return, freeing storage we allocated. */
-# ifdef WCHAR
-# define FREE_STACK_RETURN(value) \
- return (free(pattern), free(mbs_offset), free(is_binary), free (compile_stack.stack), value)
-# else
-# define FREE_STACK_RETURN(value) \
- return (free (compile_stack.stack), value)
-# endif /* WCHAR */
-
-static reg_errcode_t
-PREFIX(regex_compile) (ARG_PREFIX(pattern), ARG_PREFIX(size), syntax, bufp)
- const char *ARG_PREFIX(pattern);
- size_t ARG_PREFIX(size);
- reg_syntax_t syntax;
- struct re_pattern_buffer *bufp;
-{
- /* We fetch characters from PATTERN here. Even though PATTERN is
- `char *' (i.e., signed), we declare these variables as unsigned, so
- they can be reliably used as array indices. */
- register UCHAR_T c, c1;
-
-#ifdef WCHAR
- /* A temporary space to keep wchar_t pattern and compiled pattern. */
- CHAR_T *pattern, *COMPILED_BUFFER_VAR;
- size_t size;
- /* offset buffer for optimization. See convert_mbs_to_wc. */
- int *mbs_offset = NULL;
- /* It hold whether each wchar_t is binary data or not. */
- char *is_binary = NULL;
- /* A flag whether exactn is handling binary data or not. */
- char is_exactn_bin = FALSE;
-#endif /* WCHAR */
-
- /* A random temporary spot in PATTERN. */
- const CHAR_T *p1;
-
- /* Points to the end of the buffer, where we should append. */
- register UCHAR_T *b;
-
- /* Keeps track of unclosed groups. */
- compile_stack_type compile_stack;
-
- /* Points to the current (ending) position in the pattern. */
-#ifdef WCHAR
- const CHAR_T *p;
- const CHAR_T *pend;
-#else /* BYTE */
- const CHAR_T *p = pattern;
- const CHAR_T *pend = pattern + size;
-#endif /* WCHAR */
-
- /* How to translate the characters in the pattern. */
- RE_TRANSLATE_TYPE translate = bufp->translate;
-
- /* 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. */
- UCHAR_T *pending_exact = 0;
-
- /* Address of start of the most recently finished expression.
- This tells, e.g., postfix * where to find the start of its
- operand. Reset at the beginning of groups and alternatives. */
- UCHAR_T *laststart = 0;
-
- /* Address of beginning of regexp, or inside of last group. */
- UCHAR_T *begalt;
-
- /* Place in the uncompiled pattern (i.e., the {) to
- which to go back if the interval is invalid. */
- const CHAR_T *beg_interval;
-
- /* Address of the place where a forward jump should go to the end of
- the containing expression. Each alternative of an `or' -- except the
- last -- ends with a forward jump of this sort. */
- UCHAR_T *fixup_alt_jump = 0;
-
- /* Counts open-groups as they are encountered. Remembered for the
- matching close-group on the compile stack, so the same register
- number is put in the stop_memory as the start_memory. */
- regnum_t regnum = 0;
-
-#ifdef WCHAR
- /* Initialize the wchar_t PATTERN and offset_buffer. */
- p = pend = pattern = TALLOC(csize + 1, CHAR_T);
- mbs_offset = TALLOC(csize + 1, int);
- is_binary = TALLOC(csize + 1, char);
- if (pattern == NULL || mbs_offset == NULL || is_binary == NULL)
- {
- free(pattern);
- free(mbs_offset);
- free(is_binary);
- return REG_ESPACE;
- }
- pattern[csize] = L'\0'; /* sentinel */
- size = convert_mbs_to_wcs(pattern, cpattern, csize, mbs_offset, is_binary);
- pend = p + size;
- if (size < 0)
- {
- free(pattern);
- free(mbs_offset);
- free(is_binary);
- return REG_BADPAT;
- }
-#endif
-
-#ifdef DEBUG
- DEBUG_PRINT1 ("\nCompiling pattern: ");
- if (debug)
- {
- unsigned debug_count;
-
- for (debug_count = 0; debug_count < size; debug_count++)
- PUT_CHAR (pattern[debug_count]);
- putchar ('\n');
- }
-#endif /* DEBUG */
-
- /* Initialize the compile stack. */
- compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t);
- if (compile_stack.stack == NULL)
- {
-#ifdef WCHAR
- free(pattern);
- free(mbs_offset);
- free(is_binary);
-#endif
- return REG_ESPACE;
- }
-
-
- compile_stack.size = INIT_COMPILE_STACK_SIZE;
- compile_stack.avail = 0;
-
- /* Initialize the pattern buffer. */
- bufp->syntax = syntax;
- bufp->fastmap_accurate = 0;
- bufp->not_bol = bufp->not_eol = 0;
-
- /* Set `used' to zero, so that if we return an error, the pattern
- printer (for debugging) will think there's no pattern. We reset it
- at the end. */
- bufp->used = 0;
-
- /* Always count groups, whether or not bufp->no_sub is set. */
- bufp->re_nsub = 0;
-
-#if !defined emacs && !defined SYNTAX_TABLE
- /* Initialize the syntax table. */
- init_syntax_once ();
-#endif
-
- if (bufp->allocated == 0)
- {
- if (bufp->buffer)
- { /* If zero allocated, but buffer is non-null, try to realloc
- enough space. This loses if buffer's address is bogus, but
- that is the user's responsibility. */
-#ifdef WCHAR
- /* Free bufp->buffer and allocate an array for wchar_t pattern
- buffer. */
- free(bufp->buffer);
- COMPILED_BUFFER_VAR = TALLOC (INIT_BUF_SIZE/sizeof(UCHAR_T),
- UCHAR_T);
-#else
- RETALLOC (COMPILED_BUFFER_VAR, INIT_BUF_SIZE, UCHAR_T);
-#endif /* WCHAR */
- }
- else
- { /* Caller did not allocate a buffer. Do it for them. */
- COMPILED_BUFFER_VAR = TALLOC (INIT_BUF_SIZE / sizeof(UCHAR_T),
- UCHAR_T);
- }
- if (!COMPILED_BUFFER_VAR) FREE_STACK_RETURN (REG_ESPACE);
-#ifdef WCHAR
- bufp->buffer = (char*)COMPILED_BUFFER_VAR;
-#endif /* WCHAR */
-
- bufp->allocated = INIT_BUF_SIZE;
- }
-#ifdef WCHAR
- else
- COMPILED_BUFFER_VAR = (UCHAR_T*) bufp->buffer;
-#endif
-
- begalt = b = COMPILED_BUFFER_VAR;
-
- /* Loop through the uncompiled pattern until we're at the end. */
- while (p != pend)
- {
- 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. */
- || PREFIX(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. */
- || PREFIX(at_endline_loc_p) (p, pend, syntax))
- BUF_PUSH (endline);
- else
- goto normal_char;
- }
- break;
-
-
- case '+':
- case '?':
- if ((syntax & RE_BK_PLUS_QM)
- || (syntax & RE_LIMITED_OPS))
- goto normal_char;
- handle_plus:
- case '*':
- /* If there is no previous pattern... */
- if (!laststart)
- {
- if (syntax & RE_CONTEXT_INVALID_OPS)
- FREE_STACK_RETURN (REG_BADRPT);
- else if (!(syntax & RE_CONTEXT_INDEP_OPS))
- goto normal_char;
- }
-
- {
- /* Are we optimizing this jump? */
- boolean keep_string_p = false;
-
- /* 1 means zero (many) matches is allowed. */
- char zero_times_ok = 0, many_times_ok = 0;
-
- /* If there is a sequence of repetition chars, collapse it
- down to just one (the right one). We can't combine
- interval operators with these because of, e.g., `a{2}*',
- which should only match an even number of `a's. */
-
- for (;;)
- {
- zero_times_ok |= c != '+';
- many_times_ok |= c != '?';
-
- if (p == pend)
- break;
-
- PATFETCH (c);
-
- if (c == '*'
- || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?')))
- ;
-
- else if (syntax & RE_BK_PLUS_QM && c == '\\')
- {
- if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
-
- PATFETCH (c1);
- if (!(c1 == '+' || c1 == '?'))
- {
- PATUNFETCH;
- PATUNFETCH;
- break;
- }
-
- c = c1;
- }
- else
- {
- PATUNFETCH;
- break;
- }
-
- /* If we get here, we found another repeat character. */
- }
-
- /* Star, etc. applied to an empty pattern is equivalent
- to an empty pattern. */
- if (!laststart)
- break;
-
- /* Now we know whether or not zero matches is allowed
- and also whether or not two or more matches is allowed. */
- if (many_times_ok)
- { /* More than one repetition is allowed, so put in at the
- end a backward relative jump from `b' to before the next
- jump we're going to put in below (which jumps from
- laststart to after this jump).
-
- But if we are at the `*' in the exact sequence `.*\n',
- insert an unconditional jump backwards to the .,
- instead of the beginning of the loop. This way we only
- push a failure point once, instead of every time
- through the loop. */
- assert (p - 1 > pattern);
-
- /* Allocate the space for the jump. */
- GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE);
-
- /* We know we are not at the first character of the pattern,
- because laststart was nonzero. And we've already
- incremented `p', by the way, to be the character after
- the `*'. Do we have to do something analogous here
- for null bytes, because of RE_DOT_NOT_NULL? */
- if (TRANSLATE (*(p - 2)) == TRANSLATE ('.')
- && zero_times_ok
- && p < pend && TRANSLATE (*p) == TRANSLATE ('\n')
- && !(syntax & RE_DOT_NEWLINE))
- { /* We have .*\n. */
- STORE_JUMP (jump, b, laststart);
- keep_string_p = true;
- }
- else
- /* Anything else. */
- STORE_JUMP (maybe_pop_jump, b, laststart -
- (1 + OFFSET_ADDRESS_SIZE));
-
- /* We've added more stuff to the buffer. */
- b += 1 + OFFSET_ADDRESS_SIZE;
- }
-
- /* On failure, jump from laststart to b + 3, which will be the
- end of the buffer after this jump is inserted. */
- /* ifdef WCHAR, 'b + 1 + OFFSET_ADDRESS_SIZE' instead of
- 'b + 3'. */
- GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE);
- INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump
- : on_failure_jump,
- laststart, b + 1 + OFFSET_ADDRESS_SIZE);
- pending_exact = 0;
- b += 1 + OFFSET_ADDRESS_SIZE;
-
- if (!zero_times_ok)
- {
- /* At least one repetition is required, so insert a
- `dummy_failure_jump' before the initial
- `on_failure_jump' instruction of the loop. This
- effects a skip over that instruction the first time
- we hit that loop. */
- GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE);
- INSERT_JUMP (dummy_failure_jump, laststart, laststart +
- 2 + 2 * OFFSET_ADDRESS_SIZE);
- b += 1 + OFFSET_ADDRESS_SIZE;
- }
- }
- break;
-
-
- case '.':
- laststart = b;
- BUF_PUSH (anychar);
- break;
-
-
- case '[':
- {
- boolean had_char_class = false;
-#ifdef WCHAR
- CHAR_T range_start = 0xffffffff;
-#else
- unsigned int range_start = 0xffffffff;
-#endif
- if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
-
-#ifdef WCHAR
- /* We assume a charset(_not) structure as a wchar_t array.
- charset[0] = (re_opcode_t) charset(_not)
- charset[1] = l (= length of char_classes)
- charset[2] = m (= length of collating_symbols)
- charset[3] = n (= length of equivalence_classes)
- charset[4] = o (= length of char_ranges)
- charset[5] = p (= length of chars)
-
- charset[6] = char_class (wctype_t)
- charset[6+CHAR_CLASS_SIZE] = char_class (wctype_t)
- ...
- charset[l+5] = char_class (wctype_t)
-
- charset[l+6] = collating_symbol (wchar_t)
- ...
- charset[l+m+5] = collating_symbol (wchar_t)
- ifdef _LIBC we use the index if
- _NL_COLLATE_SYMB_EXTRAMB instead of
- wchar_t string.
-
- charset[l+m+6] = equivalence_classes (wchar_t)
- ...
- charset[l+m+n+5] = equivalence_classes (wchar_t)
- ifdef _LIBC we use the index in
- _NL_COLLATE_WEIGHT instead of
- wchar_t string.
-
- charset[l+m+n+6] = range_start
- charset[l+m+n+7] = range_end
- ...
- charset[l+m+n+2o+4] = range_start
- charset[l+m+n+2o+5] = range_end
- ifdef _LIBC we use the value looked up
- in _NL_COLLATE_COLLSEQ instead of
- wchar_t character.
-
- charset[l+m+n+2o+6] = char
- ...
- charset[l+m+n+2o+p+5] = char
-
- */
-
- /* We need at least 6 spaces: the opcode, the length of
- char_classes, the length of collating_symbols, the length of
- equivalence_classes, the length of char_ranges, the length of
- chars. */
- GET_BUFFER_SPACE (6);
-
- /* Save b as laststart. And We use laststart as the pointer
- to the first element of the charset here.
- In other words, laststart[i] indicates charset[i]. */
- laststart = b;
-
- /* We test `*p == '^' twice, instead of using an if
- statement, so we only need one BUF_PUSH. */
- BUF_PUSH (*p == '^' ? charset_not : charset);
- if (*p == '^')
- p++;
-
- /* Push the length of char_classes, the length of
- collating_symbols, the length of equivalence_classes, the
- length of char_ranges and the length of chars. */
- BUF_PUSH_3 (0, 0, 0);
- BUF_PUSH_2 (0, 0);
-
- /* Remember the first position in the bracket expression. */
- p1 = p;
-
- /* charset_not matches newline according to a syntax bit. */
- if ((re_opcode_t) b[-6] == charset_not
- && (syntax & RE_HAT_LISTS_NOT_NEWLINE))
- {
- BUF_PUSH('\n');
- laststart[5]++; /* Update the length of characters */
- }
-
- /* Read in characters and ranges, setting map bits. */
- for (;;)
- {
- if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
-
- PATFETCH (c);
-
- /* \ might escape characters inside [...] and [^...]. */
- if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\')
- {
- if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
-
- PATFETCH (c1);
- BUF_PUSH(c1);
- laststart[5]++; /* Update the length of chars */
- range_start = c1;
- continue;
- }
-
- /* Could be the end of the bracket expression. If it's
- not (i.e., when the bracket expression is `[]' so
- far), the ']' character bit gets set way below. */
- if (c == ']' && p != p1 + 1)
- break;
-
- /* Look ahead to see if it's a range when the last thing
- was a character class. */
- if (had_char_class && c == '-' && *p != ']')
- FREE_STACK_RETURN (REG_ERANGE);
-
- /* Look ahead to see if it's a range when the last thing
- was a character: if this is a hyphen not at the
- beginning or the end of a list, then it's the range
- operator. */
- if (c == '-'
- && !(p - 2 >= pattern && p[-2] == '[')
- && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
- && *p != ']')
- {
- reg_errcode_t ret;
- /* Allocate the space for range_start and range_end. */
- GET_BUFFER_SPACE (2);
- /* Update the pointer to indicate end of buffer. */
- b += 2;
- ret = wcs_compile_range (range_start, &p, pend, translate,
- syntax, b, laststart);
- if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
- range_start = 0xffffffff;
- }
- else if (p[0] == '-' && p[1] != ']')
- { /* This handles ranges made up of characters only. */
- reg_errcode_t ret;
-
- /* Move past the `-'. */
- PATFETCH (c1);
- /* Allocate the space for range_start and range_end. */
- GET_BUFFER_SPACE (2);
- /* Update the pointer to indicate end of buffer. */
- b += 2;
- ret = wcs_compile_range (c, &p, pend, translate, syntax, b,
- laststart);
- if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
- range_start = 0xffffffff;
- }
-
- /* See if we're at the beginning of a possible character
- class. */
- else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':')
- { /* Leave room for the null. */
- char str[CHAR_CLASS_MAX_LENGTH + 1];
-
- PATFETCH (c);
- c1 = 0;
-
- /* If pattern is `[[:'. */
- if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
-
- for (;;)
- {
- PATFETCH (c);
- if ((c == ':' && *p == ']') || p == pend)
- break;
- if (c1 < CHAR_CLASS_MAX_LENGTH)
- str[c1++] = c;
- else
- /* This is in any case an invalid class name. */
- str[0] = '\0';
- }
- str[c1] = '\0';
-
- /* If isn't a word bracketed by `[:' and `:]':
- undo the ending character, the letters, and leave
- the leading `:' and `[' (but store them as character). */
- if (c == ':' && *p == ']')
- {
- wctype_t wt;
- unsigned long int alignedp;
-
- /* Query the character class as wctype_t. */
- wt = IS_CHAR_CLASS (str);
- if (wt == 0)
- FREE_STACK_RETURN (REG_ECTYPE);
-
- /* Throw away the ] at the end of the character
- class. */
- PATFETCH (c);
-
- if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
-
- /* Allocate the space for character class. */
- GET_BUFFER_SPACE(CHAR_CLASS_SIZE);
- /* Update the pointer to indicate end of buffer. */
- b += CHAR_CLASS_SIZE;
- /* Move data which follow character classes
- not to violate the data. */
- insert_space(CHAR_CLASS_SIZE,
- laststart + 6 + laststart[1],
- b - 1);
- alignedp = ((unsigned long int)(laststart + 6 + laststart[1])
- + __alignof__(wctype_t) - 1)
- & ~(unsigned long int)(__alignof__(wctype_t) - 1);
- /* Store the character class. */
- *((wctype_t*)alignedp) = wt;
- /* Update length of char_classes */
- laststart[1] += CHAR_CLASS_SIZE;
-
- had_char_class = true;
- }
- else
- {
- c1++;
- while (c1--)
- PATUNFETCH;
- BUF_PUSH ('[');
- BUF_PUSH (':');
- laststart[5] += 2; /* Update the length of characters */
- range_start = ':';
- had_char_class = false;
- }
- }
- else if (syntax & RE_CHAR_CLASSES && c == '[' && (*p == '='
- || *p == '.'))
- {
- CHAR_T str[128]; /* Should be large enough. */
- CHAR_T delim = *p; /* '=' or '.' */
- PATFETCH (c);
- c1 = 0;
-
- /* If pattern is `[[=' or '[[.'. */
- if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
-
- for (;;)
- {
- PATFETCH (c);
- if ((c == delim && *p == ']') || p == pend)
- break;
- if (c1 < sizeof (str) - 1)
- str[c1++] = c;
- else
- /* This is in any case an invalid class name. */
- str[0] = '\0';
- }
- str[c1] = '\0';
-
- if (c == delim && *p == ']' && str[0] != '\0')
- {
- unsigned int i, offset;
- /* If we have no collation data we use the default
- collation in which each character is in a class
- by itself. It also means that ASCII is the
- character set and therefore we cannot have character
- with more than one byte in the multibyte
- representation. */
-
- /* If not defined _LIBC, we push the name and
- `\0' for the sake of matching performance. */
- int datasize = c1 + 1;
-
- if (c1 != 1)
- FREE_STACK_RETURN (REG_ECOLLATE);
-
- /* Throw away the ] at the end of the equivalence
- class (or collating symbol). */
- PATFETCH (c);
-
- /* Allocate the space for the equivalence class
- (or collating symbol) (and '\0' if needed). */
- GET_BUFFER_SPACE(datasize);
- /* Update the pointer to indicate end of buffer. */
- b += datasize;
-
- if (delim == '=')
- { /* equivalence class */
- /* Calculate the offset of char_ranges,
- which is next to equivalence_classes. */
- offset = laststart[1] + laststart[2]
- + laststart[3] +6;
- /* Insert space. */
- insert_space(datasize, laststart + offset, b - 1);
-
- /* Write the equivalence_class and \0. */
- for (i = 0 ; i < datasize ; i++)
- laststart[offset + i] = str[i];
-
- /* Update the length of equivalence_classes. */
- laststart[3] += datasize;
- had_char_class = true;
- }
- else /* delim == '.' */
- { /* collating symbol */
- /* Calculate the offset of the equivalence_classes,
- which is next to collating_symbols. */
- offset = laststart[1] + laststart[2] + 6;
- /* Insert space and write the collationg_symbol
- and \0. */
- insert_space(datasize, laststart + offset, b-1);
- for (i = 0 ; i < datasize ; i++)
- laststart[offset + i] = str[i];
-
- /* In re_match_2_internal if range_start < -1, we
- assume -range_start is the offset of the
- collating symbol which is specified as
- the character of the range start. So we assign
- -(laststart[1] + laststart[2] + 6) to
- range_start. */
- range_start = -(laststart[1] + laststart[2] + 6);
- /* Update the length of collating_symbol. */
- laststart[2] += datasize;
- had_char_class = false;
- }
- }
- else
- {
- c1++;
- while (c1--)
- PATUNFETCH;
- BUF_PUSH ('[');
- BUF_PUSH (delim);
- laststart[5] += 2; /* Update the length of characters */
- range_start = delim;
- had_char_class = false;
- }
- }
- else
- {
- had_char_class = false;
- BUF_PUSH(c);
- laststart[5]++; /* Update the length of characters */
- range_start = c;
- }
- }
-
-#else /* BYTE */
- /* Ensure that we have enough space to push a charset: the
- opcode, the length count, and the bitset; 34 bytes in all. */
- GET_BUFFER_SPACE (34);
-
- laststart = b;
-
- /* We test `*p == '^' twice, instead of using an if
- statement, so we only need one BUF_PUSH. */
- BUF_PUSH (*p == '^' ? charset_not : charset);
- if (*p == '^')
- p++;
-
- /* Remember the first position in the bracket expression. */
- p1 = p;
-
- /* Push the number of bytes in the bitmap. */
- BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
-
- /* Clear the whole map. */
- bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
-
- /* charset_not matches newline according to a syntax bit. */
- if ((re_opcode_t) b[-2] == charset_not
- && (syntax & RE_HAT_LISTS_NOT_NEWLINE))
- SET_LIST_BIT ('\n');
-
- /* Read in characters and ranges, setting map bits. */
- for (;;)
- {
- if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
-
- PATFETCH (c);
-
- /* \ might escape characters inside [...] and [^...]. */
- if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\')
- {
- if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
-
- PATFETCH (c1);
- SET_LIST_BIT (c1);
- range_start = c1;
- continue;
- }
-
- /* Could be the end of the bracket expression. If it's
- not (i.e., when the bracket expression is `[]' so
- far), the ']' character bit gets set way below. */
- if (c == ']' && p != p1 + 1)
- break;
-
- /* Look ahead to see if it's a range when the last thing
- was a character class. */
- if (had_char_class && c == '-' && *p != ']')
- FREE_STACK_RETURN (REG_ERANGE);
-
- /* Look ahead to see if it's a range when the last thing
- was a character: if this is a hyphen not at the
- beginning or the end of a list, then it's the range
- operator. */
- if (c == '-'
- && !(p - 2 >= pattern && p[-2] == '[')
- && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
- && *p != ']')
- {
- reg_errcode_t ret
- = byte_compile_range (range_start, &p, pend, translate,
- syntax, b);
- if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
- range_start = 0xffffffff;
- }
-
- else if (p[0] == '-' && p[1] != ']')
- { /* This handles ranges made up of characters only. */
- reg_errcode_t ret;
-
- /* Move past the `-'. */
- PATFETCH (c1);
-
- ret = byte_compile_range (c, &p, pend, translate, syntax, b);
- if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
- range_start = 0xffffffff;
- }
-
- /* See if we're at the beginning of a possible character
- class. */
-
- else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':')
- { /* Leave room for the null. */
- char str[CHAR_CLASS_MAX_LENGTH + 1];
-
- PATFETCH (c);
- c1 = 0;
-
- /* If pattern is `[[:'. */
- if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
-
- for (;;)
- {
- PATFETCH (c);
- if ((c == ':' && *p == ']') || p == pend)
- break;
- if (c1 < CHAR_CLASS_MAX_LENGTH)
- str[c1++] = c;
- else
- /* This is in any case an invalid class name. */
- str[0] = '\0';
- }
- str[c1] = '\0';
-
- /* If isn't a word bracketed by `[:' and `:]':
- undo the ending character, the letters, and leave
- the leading `:' and `[' (but set bits for them). */
- if (c == ':' && *p == ']')
- {
-#if defined _LIBC || WIDE_CHAR_SUPPORT
- boolean is_lower = STREQ (str, "lower");
- boolean is_upper = STREQ (str, "upper");
- wctype_t wt;
- int ch;
-
- wt = IS_CHAR_CLASS (str);
- if (wt == 0)
- FREE_STACK_RETURN (REG_ECTYPE);
-
- /* Throw away the ] at the end of the character
- class. */
- PATFETCH (c);
-
- if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
-
- for (ch = 0; ch < 1 << BYTEWIDTH; ++ch)
- {
-# ifdef _LIBC
- if (__iswctype (__btowc (ch), wt))
- SET_LIST_BIT (ch);
-# else
- if (iswctype (btowc (ch), wt))
- SET_LIST_BIT (ch);
-# endif
-
- if (translate && (is_upper || is_lower)
- && (ISUPPER (ch) || ISLOWER (ch)))
- SET_LIST_BIT (ch);
- }
-
- had_char_class = true;
-#else
- int ch;
- boolean is_alnum = STREQ (str, "alnum");
- boolean is_alpha = STREQ (str, "alpha");
- boolean is_blank = STREQ (str, "blank");
- boolean is_cntrl = STREQ (str, "cntrl");
- boolean is_digit = STREQ (str, "digit");
- boolean is_graph = STREQ (str, "graph");
- boolean is_lower = STREQ (str, "lower");
- boolean is_print = STREQ (str, "print");
- boolean is_punct = STREQ (str, "punct");
- boolean is_space = STREQ (str, "space");
- boolean is_upper = STREQ (str, "upper");
- boolean is_xdigit = STREQ (str, "xdigit");
-
- if (!IS_CHAR_CLASS (str))
- FREE_STACK_RETURN (REG_ECTYPE);
-
- /* Throw away the ] at the end of the character
- class. */
- PATFETCH (c);
-
- if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
-
- for (ch = 0; ch < 1 << BYTEWIDTH; ch++)
- {
- /* This was split into 3 if's to
- avoid an arbitrary limit in some compiler. */
- if ( (is_alnum && ISALNUM (ch))
- || (is_alpha && ISALPHA (ch))
- || (is_blank && ISBLANK (ch))
- || (is_cntrl && ISCNTRL (ch)))
- SET_LIST_BIT (ch);
- if ( (is_digit && ISDIGIT (ch))
- || (is_graph && ISGRAPH (ch))
- || (is_lower && ISLOWER (ch))
- || (is_print && ISPRINT (ch)))
- SET_LIST_BIT (ch);
- if ( (is_punct && ISPUNCT (ch))
- || (is_space && ISSPACE (ch))
- || (is_upper && ISUPPER (ch))
- || (is_xdigit && ISXDIGIT (ch)))
- SET_LIST_BIT (ch);
- if ( translate && (is_upper || is_lower)
- && (ISUPPER (ch) || ISLOWER (ch)))
- SET_LIST_BIT (ch);
- }
- had_char_class = true;
-#endif /* libc || wctype.h */
- }
- else
- {
- c1++;
- while (c1--)
- PATUNFETCH;
- SET_LIST_BIT ('[');
- SET_LIST_BIT (':');
- range_start = ':';
- had_char_class = false;
- }
- }
- else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '=')
- {
- unsigned char str[MB_LEN_MAX + 1];
-
- PATFETCH (c);
- c1 = 0;
-
- /* If pattern is `[[='. */
- if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
-
- for (;;)
- {
- PATFETCH (c);
- if ((c == '=' && *p == ']') || p == pend)
- break;
- if (c1 < MB_LEN_MAX)
- str[c1++] = c;
- else
- /* This is in any case an invalid class name. */
- str[0] = '\0';
- }
- str[c1] = '\0';
-
- if (c == '=' && *p == ']' && str[0] != '\0')
- {
- /* If we have no collation data we use the default
- collation in which each character is in a class
- by itself. It also means that ASCII is the
- character set and therefore we cannot have character
- with more than one byte in the multibyte
- representation. */
- {
- if (c1 != 1)
- FREE_STACK_RETURN (REG_ECOLLATE);
-
- /* Throw away the ] at the end of the equivalence
- class. */
- PATFETCH (c);
-
- /* Set the bit for the character. */
- SET_LIST_BIT (str[0]);
- }
- had_char_class = true;
- }
- else
- {
- c1++;
- while (c1--)
- PATUNFETCH;
- SET_LIST_BIT ('[');
- SET_LIST_BIT ('=');
- range_start = '=';
- had_char_class = false;
- }
- }
- else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '.')
- {
- unsigned char str[128]; /* Should be large enough. */
-
- PATFETCH (c);
- c1 = 0;
-
- /* If pattern is `[[.'. */
- if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
-
- for (;;)
- {
- PATFETCH (c);
- if ((c == '.' && *p == ']') || p == pend)
- break;
- if (c1 < sizeof (str))
- str[c1++] = c;
- else
- /* This is in any case an invalid class name. */
- str[0] = '\0';
- }
- str[c1] = '\0';
-
- if (c == '.' && *p == ']' && str[0] != '\0')
- {
- /* If we have no collation data we use the default
- collation in which each character is the name
- for its own class which contains only the one
- character. It also means that ASCII is the
- character set and therefore we cannot have character
- with more than one byte in the multibyte
- representation. */
- {
- if (c1 != 1)
- FREE_STACK_RETURN (REG_ECOLLATE);
-
- /* Throw away the ] at the end of the equivalence
- class. */
- PATFETCH (c);
-
- /* Set the bit for the character. */
- SET_LIST_BIT (str[0]);
- range_start = ((const unsigned char *) str)[0];
- }
- had_char_class = false;
- }
- else
- {
- c1++;
- while (c1--)
- PATUNFETCH;
- SET_LIST_BIT ('[');
- SET_LIST_BIT ('.');
- range_start = '.';
- had_char_class = false;
- }
- }
- else
- {
- had_char_class = false;
- SET_LIST_BIT (c);
- range_start = c;
- }
- }
-
- /* Discard any (non)matching list bytes that are all 0 at the
- end of the map. Decrease the map-length byte too. */
- while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
- b[-1]--;
- b += b[-1];
-#endif /* WCHAR */
- }
- break;
-
-
- case '(':
- if (syntax & RE_NO_BK_PARENS)
- goto handle_open;
- else
- goto normal_char;
-
-
- case ')':
- if (syntax & RE_NO_BK_PARENS)
- goto handle_close;
- else
- goto normal_char;
-
-
- case '\n':
- if (syntax & RE_NEWLINE_ALT)
- goto handle_alt;
- else
- goto normal_char;
-
-
- case '|':
- if (syntax & RE_NO_BK_VBAR)
- goto handle_alt;
- else
- goto normal_char;
-
-
- case '{':
- if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES)
- goto handle_interval;
- else
- goto normal_char;
-
-
- case '\\':
- if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
-
- /* Do not translate the character after the \, so that we can
- distinguish, e.g., \B from \b, even if we normally would
- translate, e.g., B to b. */
- PATFETCH_RAW (c);
-
- switch (c)
- {
- case '(':
- if (syntax & RE_NO_BK_PARENS)
- goto normal_backslash;
-
- handle_open:
- bufp->re_nsub++;
- regnum++;
-
- if (COMPILE_STACK_FULL)
- {
- RETALLOC (compile_stack.stack, compile_stack.size << 1,
- compile_stack_elt_t);
- if (compile_stack.stack == NULL) return REG_ESPACE;
-
- compile_stack.size <<= 1;
- }
-
- /* These are the values to restore when we hit end of this
- group. They are all relative offsets, so that if the
- whole pattern moves because of realloc, they will still
- be valid. */
- COMPILE_STACK_TOP.begalt_offset = begalt - COMPILED_BUFFER_VAR;
- COMPILE_STACK_TOP.fixup_alt_jump
- = fixup_alt_jump ? fixup_alt_jump - COMPILED_BUFFER_VAR + 1 : 0;
- COMPILE_STACK_TOP.laststart_offset = b - COMPILED_BUFFER_VAR;
- COMPILE_STACK_TOP.regnum = regnum;
-
- /* We will eventually replace the 0 with the number of
- groups inner to this one. But do not push a
- start_memory for groups beyond the last one we can
- represent in the compiled pattern. */
- if (regnum <= MAX_REGNUM)
- {
- COMPILE_STACK_TOP.inner_group_offset = b
- - COMPILED_BUFFER_VAR + 2;
- BUF_PUSH_3 (start_memory, regnum, 0);
- }
-
- compile_stack.avail++;
-
- fixup_alt_jump = 0;
- laststart = 0;
- begalt = b;
- /* If we've reached MAX_REGNUM groups, then this open
- won't actually generate any code, so we'll have to
- clear pending_exact explicitly. */
- pending_exact = 0;
- break;
-
-
- case ')':
- if (syntax & RE_NO_BK_PARENS) goto normal_backslash;
-
- if (COMPILE_STACK_EMPTY)
- {
- if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
- goto normal_backslash;
- else
- FREE_STACK_RETURN (REG_ERPAREN);
- }
-
- handle_close:
- if (fixup_alt_jump)
- { /* Push a dummy failure point at the end of the
- alternative for a possible future
- `pop_failure_jump' to pop. See comments at
- `push_dummy_failure' in `re_match_2'. */
- BUF_PUSH (push_dummy_failure);
-
- /* We allocated space for this jump when we assigned
- to `fixup_alt_jump', in the `handle_alt' case below. */
- STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
- }
-
- /* See similar code for backslashed left paren above. */
- if (COMPILE_STACK_EMPTY)
- {
- if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
- goto normal_char;
- else
- FREE_STACK_RETURN (REG_ERPAREN);
- }
-
- /* Since we just checked for an empty stack above, this
- ``can't happen''. */
- assert (compile_stack.avail != 0);
- {
- /* We don't just want to restore into `regnum', because
- later groups should continue to be numbered higher,
- as in `(ab)c(de)' -- the second group is #2. */
- regnum_t this_group_regnum;
-
- compile_stack.avail--;
- begalt = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.begalt_offset;
- fixup_alt_jump
- = COMPILE_STACK_TOP.fixup_alt_jump
- ? COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.fixup_alt_jump - 1
- : 0;
- laststart = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.laststart_offset;
- this_group_regnum = COMPILE_STACK_TOP.regnum;
- /* If we've reached MAX_REGNUM groups, then this open
- won't actually generate any code, so we'll have to
- clear pending_exact explicitly. */
- pending_exact = 0;
-
- /* We're at the end of the group, so now we know how many
- groups were inside this one. */
- if (this_group_regnum <= MAX_REGNUM)
- {
- UCHAR_T *inner_group_loc
- = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.inner_group_offset;
-
- *inner_group_loc = regnum - this_group_regnum;
- BUF_PUSH_3 (stop_memory, this_group_regnum,
- regnum - this_group_regnum);
- }
- }
- break;
-
-
- case '|': /* `\|'. */
- if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR)
- goto normal_backslash;
- handle_alt:
- if (syntax & RE_LIMITED_OPS)
- goto normal_char;
-
- /* Insert before the previous alternative a jump which
- jumps to this alternative if the former fails. */
- GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE);
- INSERT_JUMP (on_failure_jump, begalt,
- b + 2 + 2 * OFFSET_ADDRESS_SIZE);
- pending_exact = 0;
- b += 1 + OFFSET_ADDRESS_SIZE;
-
- /* The alternative before this one has a jump after it
- which gets executed if it gets matched. Adjust that
- jump so it will jump to this alternative's analogous
- jump (put in below, which in turn will jump to the next
- (if any) alternative's such jump, etc.). The last such
- jump jumps to the correct final destination. A picture:
- _____ _____
- | | | |
- | v | v
- a | b | c
-
- If we are at `b', then fixup_alt_jump right now points to a
- three-byte space after `a'. We'll put in the jump, set
- fixup_alt_jump to right after `b', and leave behind three
- bytes which we'll fill in when we get to after `c'. */
-
- if (fixup_alt_jump)
- STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
-
- /* Mark and leave space for a jump after this alternative,
- to be filled in later either by next alternative or
- when know we're at the end of a series of alternatives. */
- fixup_alt_jump = b;
- GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE);
- b += 1 + OFFSET_ADDRESS_SIZE;
-
- laststart = 0;
- begalt = b;
- break;
-
-
- case '{':
- /* If \{ is a literal. */
- if (!(syntax & RE_INTERVALS)
- /* If we're at `\{' and it's not the open-interval
- operator. */
- || ((syntax & RE_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. */
- /* ifdef WCHAR, 'b + 1 + OFFSET_ADDRESS_SIZE'
- instead of 'b + 3'. */
- if (upper_bound == 0)
- {
- GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE);
- INSERT_JUMP (jump, laststart, b + 1 + OFFSET_ADDRESS_SIZE);
- b += 1 + OFFSET_ADDRESS_SIZE;
- }
-
- /* Otherwise, we have a nontrivial interval. When
- 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 = 2 + 4 * OFFSET_ADDRESS_SIZE +
- (upper_bound > 1) * (2 + 4 * OFFSET_ADDRESS_SIZE);
-
- GET_BUFFER_SPACE (nbytes);
-
- /* Initialize lower bound of the `succeed_n', even
- though it will be set during matching by its
- attendant `set_number_at' (inserted next),
- because `re_compile_fastmap' needs to know.
- Jump to the `jump_n' we might insert below. */
- INSERT_JUMP2 (succeed_n, laststart,
- b + 1 + 2 * OFFSET_ADDRESS_SIZE +
- (upper_bound > 1) * (1 + 2 * OFFSET_ADDRESS_SIZE),
- lower_bound);
- b += 1 + 2 * OFFSET_ADDRESS_SIZE;
-
- /* Code to initialize the lower bound. Insert
- before the `succeed_n'. The `5' is the last two
- bytes of this `set_number_at', plus 3 bytes of
- the following `succeed_n'. */
- /* ifdef WCHAR, The '1+2*OFFSET_ADDRESS_SIZE'
- is the 'set_number_at', plus '1+OFFSET_ADDRESS_SIZE'
- of the following `succeed_n'. */
- PREFIX(insert_op2) (set_number_at, laststart,
- 1 + 2 * OFFSET_ADDRESS_SIZE, lower_bound, b);
- b += 1 + 2 * OFFSET_ADDRESS_SIZE;
-
- if (upper_bound > 1)
- { /* More than one repetition is allowed, so
- 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 +
- 1 + 2 * OFFSET_ADDRESS_SIZE,
- upper_bound - 1);
- b += 1 + 2 * OFFSET_ADDRESS_SIZE;
-
- /* The location we want to set is the second
- parameter of the `jump_n'; that is `b-2' as
- 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. */
- PREFIX(insert_op2) (set_number_at, laststart,
- b - laststart,
- upper_bound - 1, b);
- b += 1 + 2 * OFFSET_ADDRESS_SIZE;
- }
- }
- 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 (syntax & RE_NO_GNU_OPS)
- goto normal_char;
- laststart = b;
- BUF_PUSH (wordchar);
- break;
-
-
- case 'W':
- if (syntax & RE_NO_GNU_OPS)
- goto normal_char;
- laststart = b;
- BUF_PUSH (notwordchar);
- break;
-
-
- case '<':
- if (syntax & RE_NO_GNU_OPS)
- goto normal_char;
- BUF_PUSH (wordbeg);
- break;
-
- case '>':
- if (syntax & RE_NO_GNU_OPS)
- goto normal_char;
- BUF_PUSH (wordend);
- break;
-
- case 'b':
- if (syntax & RE_NO_GNU_OPS)
- goto normal_char;
- BUF_PUSH (wordbound);
- break;
-
- case 'B':
- if (syntax & RE_NO_GNU_OPS)
- goto normal_char;
- BUF_PUSH (notwordbound);
- break;
-
- case '`':
- if (syntax & RE_NO_GNU_OPS)
- goto normal_char;
- BUF_PUSH (begbuf);
- break;
-
- case '\'':
- if (syntax & RE_NO_GNU_OPS)
- goto normal_char;
- BUF_PUSH (endbuf);
- break;
-
- case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9':
- if (syntax & RE_NO_BK_REFS)
- goto normal_char;
-
- c1 = c - '0';
-
- if (c1 > regnum)
- FREE_STACK_RETURN (REG_ESUBREG);
-
- /* Can't back reference to a subexpression if inside of it. */
- if (group_in_compile_stack (compile_stack, (regnum_t) c1))
- goto normal_char;
-
- laststart = b;
- BUF_PUSH_2 (duplicate, c1);
- break;
-
-
- case '+':
- case '?':
- if (syntax & RE_BK_PLUS_QM)
- goto handle_plus;
- else
- goto normal_backslash;
-
- default:
- normal_backslash:
- /* You might think it would be useful for \ to mean
- not to translate; but if we don't translate it
- it will never match anything. */
- c = TRANSLATE (c);
- goto normal_char;
- }
- break;
-
-
- default:
- /* Expects the character in `c'. */
- normal_char:
- /* If no exactn currently being built. */
- if (!pending_exact
-#ifdef WCHAR
- /* If last exactn handle binary(or character) and
- new exactn handle character(or binary). */
- || is_exactn_bin != is_binary[p - 1 - pattern]
-#endif /* WCHAR */
-
- /* If last exactn not at current position. */
- || pending_exact + *pending_exact + 1 != b
-
- /* We have only one byte following the exactn for the count. */
- || *pending_exact == (1 << BYTEWIDTH) - 1
-
- /* If followed by a repetition operator. */
- || *p == '*' || *p == '^'
- || ((syntax & RE_BK_PLUS_QM)
- ? *p == '\\' && (p[1] == '+' || p[1] == '?')
- : (*p == '+' || *p == '?'))
- || ((syntax & RE_INTERVALS)
- && ((syntax & RE_NO_BK_BRACES)
- ? *p == '{'
- : (p[0] == '\\' && p[1] == '{'))))
- {
- /* Start building a new exactn. */
-
- laststart = b;
-
-#ifdef WCHAR
- /* Is this exactn binary data or character? */
- is_exactn_bin = is_binary[p - 1 - pattern];
- if (is_exactn_bin)
- BUF_PUSH_2 (exactn_bin, 0);
- else
- BUF_PUSH_2 (exactn, 0);
-#else
- BUF_PUSH_2 (exactn, 0);
-#endif /* WCHAR */
- pending_exact = b - 1;
- }
-
- BUF_PUSH (c);
- (*pending_exact)++;
- break;
- } /* switch (c) */
- } /* while p != pend */
-
-
- /* Through the pattern now. */
-
- if (fixup_alt_jump)
- STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
-
- if (!COMPILE_STACK_EMPTY)
- FREE_STACK_RETURN (REG_EPAREN);
-
- /* If we don't want backtracking, force success
- the first time we reach the end of the compiled pattern. */
- if (syntax & RE_NO_POSIX_BACKTRACKING)
- BUF_PUSH (succeed);
-
-#ifdef WCHAR
- free (pattern);
- free (mbs_offset);
- free (is_binary);
-#endif
- free (compile_stack.stack);
-
- /* We have succeeded; set the length of the buffer. */
-#ifdef WCHAR
- bufp->used = (unsigned long int) b - (unsigned long int) COMPILED_BUFFER_VAR;
-#else
- bufp->used = b - bufp->buffer;
-#endif
-
-#ifdef DEBUG
- if (debug)
- {
- DEBUG_PRINT1 ("\nCompiled pattern: \n");
- PREFIX(print_compiled_pattern) (bufp);
- }
-#endif /* DEBUG */
-
-#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
- = (PREFIX(fail_stack_elt_t) *) xmalloc (fail_stack.size
- * sizeof (PREFIX(fail_stack_elt_t)));
- else
- fail_stack.stack
- = (PREFIX(fail_stack_elt_t) *) xrealloc (fail_stack.stack,
- (fail_stack.size
- * sizeof (PREFIX(fail_stack_elt_t))));
-# else /* not emacs */
- if (! fail_stack.stack)
- fail_stack.stack
- = (PREFIX(fail_stack_elt_t) *) malloc (fail_stack.size
- * sizeof (PREFIX(fail_stack_elt_t)));
- else
- fail_stack.stack
- = (PREFIX(fail_stack_elt_t) *) realloc (fail_stack.stack,
- (fail_stack.size
- * sizeof (PREFIX(fail_stack_elt_t))));
-# endif /* not emacs */
- }
-
- PREFIX(regex_grow_registers (num_regs));
- }
-#endif /* not MATCH_MAY_ALLOCATE */
-
- return REG_NOERROR;
-} /* regex_compile */
-
-/* Subroutines for `regex_compile'. */
-
-/* Store OP at LOC followed by two-byte integer parameter ARG. */
-/* ifdef WCHAR, integer parameter is 1 wchar_t. */
-
-static void
-PREFIX(store_op1) (op, loc, arg)
- re_opcode_t op;
- UCHAR_T *loc;
- int arg;
-{
- *loc = (UCHAR_T) op;
- STORE_NUMBER (loc + 1, arg);
-}
-
-
-/* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */
-/* ifdef WCHAR, integer parameter is 1 wchar_t. */
-
-static void
-PREFIX(store_op2) (op, loc, arg1, arg2)
- re_opcode_t op;
- UCHAR_T *loc;
- int arg1, arg2;
-{
- *loc = (UCHAR_T) op;
- STORE_NUMBER (loc + 1, arg1);
- STORE_NUMBER (loc + 1 + OFFSET_ADDRESS_SIZE, arg2);
-}
-
-
-/* Copy the bytes from LOC to END to open up three bytes of space at LOC
- for OP followed by two-byte integer parameter ARG. */
-/* ifdef WCHAR, integer parameter is 1 wchar_t. */
-
-static void
-PREFIX(insert_op1) (op, loc, arg, end)
- re_opcode_t op;
- UCHAR_T *loc;
- int arg;
- UCHAR_T *end;
-{
- register UCHAR_T *pfrom = end;
- register UCHAR_T *pto = end + 1 + OFFSET_ADDRESS_SIZE;
-
- while (pfrom != loc)
- *--pto = *--pfrom;
-
- PREFIX(store_op1) (op, loc, arg);
-}
-
-
-/* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */
-/* ifdef WCHAR, integer parameter is 1 wchar_t. */
-
-static void
-PREFIX(insert_op2) (op, loc, arg1, arg2, end)
- re_opcode_t op;
- UCHAR_T *loc;
- int arg1, arg2;
- UCHAR_T *end;
-{
- register UCHAR_T *pfrom = end;
- register UCHAR_T *pto = end + 1 + 2 * OFFSET_ADDRESS_SIZE;
-
- while (pfrom != loc)
- *--pto = *--pfrom;
-
- PREFIX(store_op2) (op, loc, arg1, arg2);
-}
-
-
-/* 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
-PREFIX(at_begline_loc_p) (pattern, p, syntax)
- const CHAR_T *pattern, *p;
- reg_syntax_t syntax;
-{
- const CHAR_T *prev = p - 2;
- boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
-
- return
- /* 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
-PREFIX(at_endline_loc_p) (p, pend, syntax)
- const CHAR_T *p, *pend;
- reg_syntax_t syntax;
-{
- const CHAR_T *next = p;
- boolean next_backslash = *next == '\\';
- const CHAR_T *next_next = p + 1 < pend ? p + 1 : 0;
-
- return
- /* Before a subexpression? */
- (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 == '|');
-}
-
-#else /* not INSIDE_RECURSION */
-
-/* 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;
-}
-
-#endif /* not INSIDE_RECURSION */
-
-#ifdef INSIDE_RECURSION
-
-#ifdef WCHAR
-/* This insert space, which size is "num", into the pattern at "loc".
- "end" must point the end of the allocated buffer. */
-static void
-insert_space (num, loc, end)
- int num;
- CHAR_T *loc;
- CHAR_T *end;
-{
- register CHAR_T *pto = end;
- register CHAR_T *pfrom = end - num;
-
- while (pfrom >= loc)
- *pto-- = *pfrom--;
-}
-#endif /* WCHAR */
-
-#ifdef WCHAR
-static reg_errcode_t
-wcs_compile_range (range_start_char, p_ptr, pend, translate, syntax, b,
- char_set)
- CHAR_T range_start_char;
- const CHAR_T **p_ptr, *pend;
- CHAR_T *char_set, *b;
- RE_TRANSLATE_TYPE translate;
- reg_syntax_t syntax;
-{
- const CHAR_T *p = *p_ptr;
- CHAR_T range_start, range_end;
- reg_errcode_t ret;
- if (p == pend)
- return REG_ERANGE;
-
- range_start = (range_start_char >= 0)? TRANSLATE (range_start_char):
- range_start_char;
- range_end = TRANSLATE (p[0]);
- /* Report an error if the range is empty and the syntax prohibits
- this. */
- ret = ((syntax & RE_NO_EMPTY_RANGES)
- && (range_start > range_end))? REG_ERANGE : REG_NOERROR;
-
- /* Insert space to the end of the char_ranges. */
- insert_space(2, b - char_set[5] - 2, b - 1);
- *(b - char_set[5] - 2) = range_start;
- *(b - char_set[5] - 1) = range_end;
- char_set[4]++; /* ranges_index */
-
- /* Have to increment the pointer into the pattern string, so the
- caller isn't still at the ending character. */
- (*p_ptr)++;
- return ret;
-}
-#else /* BYTE */
-/* Read the ending character of a range (in a bracket expression) from the
- uncompiled pattern *P_PTR (which ends at PEND). We assume the
- starting character is in `P[-2]'. (`P[-1]' is the character `-'.)
- 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
-byte_compile_range (range_start_char, p_ptr, pend, translate, syntax, b)
- unsigned int range_start_char;
- const char **p_ptr, *pend;
- RE_TRANSLATE_TYPE translate;
- reg_syntax_t syntax;
- unsigned char *b;
-{
- unsigned this_char;
-
- const char *p = *p_ptr;
- reg_errcode_t ret;
- unsigned end_char;
-
-
- if (p == pend)
- return REG_ERANGE;
-
- /* Have to increment the pointer into the pattern string, so the
- caller isn't still at the ending character. */
- (*p_ptr)++;
-
- /* Report an error if the range is empty and the syntax prohibits this. */
- ret = syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
-
- /* Here we see why `this_char' has to be larger than an `unsigned
- char' -- we would otherwise go into an infinite loop, since all
- characters <= 0xff. */
- range_start_char = TRANSLATE (range_start_char);
- /* TRANSLATE(p[0]) is casted to char (not unsigned char) in TRANSLATE,
- and some compilers cast it to int implicitly, so following for_loop
- may fall to (almost) infinite loop.
- e.g. If translate[p[0]] = 0xff, end_char may equals to 0xffffffff.
- To avoid this, we cast p[0] to unsigned int and truncate it. */
- end_char = ((unsigned)TRANSLATE(p[0]) & ((1 << BYTEWIDTH) - 1));
-
- for (this_char = range_start_char; this_char <= end_char; ++this_char)
- {
- SET_LIST_BIT (TRANSLATE (this_char));
- ret = REG_NOERROR;
- }
-
- return ret;
-}
-# endif /* WCHAR */
-
-/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
- BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible
- characters can start a string that matches the pattern. This fastmap
- is used by re_search to skip quickly over impossible starting points.
-
- The caller must supply the address of a (1 << BYTEWIDTH)-byte data
- area as BUFP->fastmap.
-
- We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
- the pattern buffer.
-
- Returns 0 if we succeed, -2 if an internal error. */
-
-#ifdef WCHAR
-/* local function for re_compile_fastmap.
- truncate wchar_t character to char. */
-static unsigned char truncate_wchar (CHAR_T c);
-
-static unsigned char
-truncate_wchar (c)
- CHAR_T c;
-{
- unsigned char buf[MB_LEN_MAX];
- int retval = wctomb(buf, c);
- return retval > 0 ? buf[0] : (unsigned char)c;
-}
-#endif /* WCHAR */
-
-static int
-PREFIX(re_compile_fastmap) (bufp)
- struct re_pattern_buffer *bufp;
-{
- int j, k;
-#ifdef MATCH_MAY_ALLOCATE
- PREFIX(fail_stack_type) fail_stack;
-#endif
-#ifndef REGEX_MALLOC
- char *destination;
-#endif
-
- register char *fastmap = bufp->fastmap;
-
-#ifdef WCHAR
- /* We need to cast pattern to (wchar_t*), because we casted this compiled
- pattern to (char*) in regex_compile. */
- UCHAR_T *pattern = (UCHAR_T*)bufp->buffer;
- register UCHAR_T *pend = (UCHAR_T*) (bufp->buffer + bufp->used);
-#else /* BYTE */
- UCHAR_T *pattern = bufp->buffer;
- register UCHAR_T *pend = pattern + bufp->used;
-#endif /* WCHAR */
- UCHAR_T *p = pattern;
-
-#ifdef REL_ALLOC
- /* This holds the pointer to the failure stack, when
- it is allocated relocatably. */
- PREFIX(fail_stack_elt_t) *failure_stack_ptr;
-#endif
-
- /* Assume that each path through the pattern can be null until
- proven otherwise. We set this false at the bottom of switch
- statement, to which we get only if a particular path doesn't
- match the empty string. */
- boolean path_can_be_null = true;
-
- /* We aren't doing a `succeed_n' to begin with. */
- boolean succeed_n_p = false;
-
- assert (fastmap != NULL && p != NULL);
-
- INIT_FAIL_STACK ();
- bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */
- bufp->fastmap_accurate = 1; /* It will be when we're done. */
- bufp->can_be_null = 0;
-
- while (1)
- {
- if (p == pend || *p == succeed)
- {
- /* We have reached the (effective) end of pattern. */
- if (!FAIL_STACK_EMPTY ())
- {
- bufp->can_be_null |= path_can_be_null;
-
- /* Reset for next path. */
- path_can_be_null = true;
-
- p = fail_stack.stack[--fail_stack.avail].pointer;
-
- continue;
- }
- else
- break;
- }
-
- /* We should never be about to go beyond the end of the pattern. */
- assert (p < pend);
-
- switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
- {
-
- /* I guess the idea here is to simply not bother with a fastmap
- if a backreference is used, since it's too hard to figure out
- the fastmap for the corresponding group. Setting
- `can_be_null' stops `re_search_2' from using the fastmap, so
- that is all we do. */
- case duplicate:
- bufp->can_be_null = 1;
- goto done;
-
-
- /* Following are the cases which match a character. These end
- with `break'. */
-
-#ifdef WCHAR
- case exactn:
- fastmap[truncate_wchar(p[1])] = 1;
- break;
-#else /* BYTE */
- case exactn:
- fastmap[p[1]] = 1;
- break;
-#endif /* WCHAR */
-#ifdef MBS_SUPPORT
- case exactn_bin:
- fastmap[p[1]] = 1;
- break;
-#endif
-
-
-#ifdef WCHAR
- /* It is hard to distinguish fastmap from (multi byte) characters
- which depends on current locale. */
- case charset:
- case charset_not:
- case wordchar:
- case notwordchar:
- bufp->can_be_null = 1;
- goto done;
-#else /* BYTE */
- case charset:
- for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
- if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
- fastmap[j] = 1;
- break;
-
-
- case charset_not:
- /* Chars beyond end of map must be allowed. */
- for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++)
- fastmap[j] = 1;
-
- for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
- if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))))
- fastmap[j] = 1;
- break;
-
-
- case wordchar:
- for (j = 0; j < (1 << BYTEWIDTH); j++)
- if (SYNTAX (j) == Sword)
- fastmap[j] = 1;
- break;
-
-
- case notwordchar:
- for (j = 0; j < (1 << BYTEWIDTH); j++)
- if (SYNTAX (j) != Sword)
- fastmap[j] = 1;
- break;
-#endif /* WCHAR */
-
-
- case anychar:
- {
- int fastmap_newline = fastmap['\n'];
-
- /* `.' matches anything ... */
- for (j = 0; j < (1 << BYTEWIDTH); j++)
- fastmap[j] = 1;
-
- /* ... except perhaps newline. */
- if (!(bufp->syntax & RE_DOT_NEWLINE))
- fastmap['\n'] = fastmap_newline;
-
- /* Return if we have already set `can_be_null'; if we have,
- then the fastmap is irrelevant. Something's wrong here. */
- else if (bufp->can_be_null)
- goto done;
-
- /* Otherwise, have to check alternative paths. */
- break;
- }
-
-#ifdef emacs
- case syntaxspec:
- k = *p++;
- for (j = 0; j < (1 << BYTEWIDTH); j++)
- if (SYNTAX (j) == (enum syntaxcode) k)
- fastmap[j] = 1;
- break;
-
-
- case notsyntaxspec:
- k = *p++;
- for (j = 0; j < (1 << BYTEWIDTH); j++)
- if (SYNTAX (j) != (enum syntaxcode) k)
- fastmap[j] = 1;
- break;
-
-
- /* All cases after this match the empty string. These end with
- `continue'. */
-
-
- case before_dot:
- case at_dot:
- case after_dot:
- continue;
-#endif /* emacs */
-
-
- case no_op:
- case begline:
- case endline:
- case begbuf:
- case endbuf:
- case wordbound:
- case notwordbound:
- case wordbeg:
- case wordend:
- case push_dummy_failure:
- continue;
-
-
- case jump_n:
- case pop_failure_jump:
- case maybe_pop_jump:
- case jump:
- case jump_past_alt:
- case dummy_failure_jump:
- EXTRACT_NUMBER_AND_INCR (j, p);
- p += j;
- if (j > 0)
- continue;
-
- /* Jump backward implies we just went through the body of a
- loop and matched nothing. Opcode jumped to should be
- `on_failure_jump' or `succeed_n'. Just treat it like an
- ordinary jump. For a * loop, it has pushed its failure
- point already; if so, discard that as redundant. */
- if ((re_opcode_t) *p != on_failure_jump
- && (re_opcode_t) *p != succeed_n)
- continue;
-
- p++;
- EXTRACT_NUMBER_AND_INCR (j, p);
- p += j;
-
- /* If what's on the stack is where we are now, pop it. */
- if (!FAIL_STACK_EMPTY ()
- && fail_stack.stack[fail_stack.avail - 1].pointer == p)
- fail_stack.avail--;
-
- continue;
-
-
- case on_failure_jump:
- case on_failure_keep_string_jump:
- handle_on_failure_jump:
- EXTRACT_NUMBER_AND_INCR (j, p);
-
- /* For some patterns, e.g., `(a?)?', `p+j' here points to the
- end of the pattern. We don't want to push such a point,
- since when we restore it above, entering the switch will
- increment `p' past the end of the pattern. We don't need
- to push such a point since we obviously won't find any more
- fastmap entries beyond `pend'. Such a pattern can match
- the null string, though. */
- if (p + j < pend)
- {
- if (!PUSH_PATTERN_OP (p + j, fail_stack))
- {
- RESET_FAIL_STACK ();
- return -2;
- }
- }
- else
- bufp->can_be_null = 1;
-
- if (succeed_n_p)
- {
- EXTRACT_NUMBER_AND_INCR (k, p); /* Skip the n. */
- succeed_n_p = false;
- }
-
- continue;
-
-
- case succeed_n:
- /* Get to the number of times to succeed. */
- p += OFFSET_ADDRESS_SIZE;
-
- /* Increment p past the n for when k != 0. */
- EXTRACT_NUMBER_AND_INCR (k, p);
- if (k == 0)
- {
- p -= 2 * OFFSET_ADDRESS_SIZE;
- succeed_n_p = true; /* Spaghetti code alert. */
- goto handle_on_failure_jump;
- }
- continue;
-
-
- case set_number_at:
- p += 2 * OFFSET_ADDRESS_SIZE;
- continue;
-
-
- case start_memory:
- case stop_memory:
- p += 2;
- continue;
-
-
- default:
- abort (); /* We have listed all the cases. */
- } /* switch *p++ */
-
- /* Getting here means we have found the possible starting
- characters for one path of the pattern -- and that the empty
- string does not match. We need not follow this path further.
- Instead, look at the next alternative (remembered on the
- stack), or quit if no more. The test at the top of the loop
- does these things. */
- path_can_be_null = false;
- p = pend;
- } /* while p */
-
- /* Set `can_be_null' for the last path (also the first path, if the
- pattern is empty). */
- bufp->can_be_null |= path_can_be_null;
-
- done:
- RESET_FAIL_STACK ();
- return 0;
-}
-
-#else /* not INSIDE_RECURSION */
-
-int
-re_compile_fastmap (bufp)
- struct re_pattern_buffer *bufp;
-{
-# ifdef MBS_SUPPORT
- if (MB_CUR_MAX != 1)
- return wcs_re_compile_fastmap(bufp);
- else
-# endif
- return byte_re_compile_fastmap(bufp);
-} /* re_compile_fastmap */
-#ifdef _LIBC
-weak_alias (__re_compile_fastmap, re_compile_fastmap)
-#endif
-
-/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
- ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use
- this memory for recording register information. STARTS and ENDS
- must be allocated using the malloc library routine, and must each
- be at least NUM_REGS * sizeof (regoff_t) bytes long.
-
- If NUM_REGS == 0, then subsequent matches should allocate their own
- register data.
-
- Unless this function is called, the first search or match using
- PATTERN_BUFFER will allocate its own register data, without
- freeing the old data. */
-
-void
-re_set_registers (bufp, regs, num_regs, starts, ends)
- struct re_pattern_buffer *bufp;
- struct re_registers *regs;
- unsigned num_regs;
- regoff_t *starts, *ends;
-{
- if (num_regs)
- {
- bufp->regs_allocated = REGS_REALLOCATE;
- regs->num_regs = num_regs;
- regs->start = starts;
- regs->end = ends;
- }
- else
- {
- bufp->regs_allocated = REGS_UNALLOCATED;
- regs->num_regs = 0;
- regs->start = regs->end = (regoff_t *) 0;
- }
-}
-#ifdef _LIBC
-weak_alias (__re_set_registers, re_set_registers)
-#endif
-
-/* Searching routines. */
-
-/* Like re_search_2, below, but only one string is specified, and
- doesn't let you say where to stop matching. */
-
-int
-re_search (bufp, string, size, startpos, range, regs)
- struct re_pattern_buffer *bufp;
- const char *string;
- int size, startpos, range;
- struct re_registers *regs;
-{
- return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
- regs, size);
-}
-#ifdef _LIBC
-weak_alias (__re_search, re_search)
-#endif
-
-
-/* Using the compiled pattern in BUFP->buffer, first tries to match the
- virtual concatenation of STRING1 and STRING2, starting first at index
- STARTPOS, then at STARTPOS + 1, and so on.
-
- STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
-
- RANGE is how far to scan while trying to match. RANGE = 0 means try
- only at STARTPOS; in general, the last start tried is STARTPOS +
- RANGE.
-
- In REGS, return the indices of the virtual concatenation of STRING1
- and STRING2 that matched the entire BUFP->buffer and its contained
- subexpressions.
-
- Do not consider matching one past the index STOP in the virtual
- concatenation of STRING1 and STRING2.
-
- We return either the position in the strings at which the match was
- found, -1 if no match, or -2 if error (such as failure
- stack overflow). */
-
-int
-re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
- struct re_pattern_buffer *bufp;
- const char *string1, *string2;
- int size1, size2;
- int startpos;
- int range;
- struct re_registers *regs;
- int stop;
-{
-# ifdef MBS_SUPPORT
- if (MB_CUR_MAX != 1)
- return wcs_re_search_2 (bufp, string1, size1, string2, size2, startpos,
- range, regs, stop);
- else
-# endif
- return byte_re_search_2 (bufp, string1, size1, string2, size2, startpos,
- range, regs, stop);
-} /* re_search_2 */
-#ifdef _LIBC
-weak_alias (__re_search_2, re_search_2)
-#endif
-
-#endif /* not INSIDE_RECURSION */
-
-#ifdef INSIDE_RECURSION
-
-#ifdef MATCH_MAY_ALLOCATE
-# define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL
-#else
-# define FREE_VAR(var) if (var) free (var); var = NULL
-#endif
-
-#ifdef WCHAR
-# define MAX_ALLOCA_SIZE 2000
-
-# define FREE_WCS_BUFFERS() \
- do { \
- if (size1 > MAX_ALLOCA_SIZE) \
- { \
- free (wcs_string1); \
- free (mbs_offset1); \
- } \
- else \
- { \
- FREE_VAR (wcs_string1); \
- FREE_VAR (mbs_offset1); \
- } \
- if (size2 > MAX_ALLOCA_SIZE) \
- { \
- free (wcs_string2); \
- free (mbs_offset2); \
- } \
- else \
- { \
- FREE_VAR (wcs_string2); \
- FREE_VAR (mbs_offset2); \
- } \
- } while (0)
-
-#endif
-
-static int
-PREFIX(re_search_2) (bufp, string1, size1, string2, size2, startpos, range,
- regs, stop)
- struct re_pattern_buffer *bufp;
- const char *string1, *string2;
- int size1, size2;
- int startpos;
- int range;
- struct re_registers *regs;
- int stop;
-{
- int val;
- register char *fastmap = bufp->fastmap;
- register RE_TRANSLATE_TYPE translate = bufp->translate;
- int total_size = size1 + size2;
- int endpos = startpos + range;
-#ifdef WCHAR
- /* We need wchar_t* buffers correspond to cstring1, cstring2. */
- wchar_t *wcs_string1 = NULL, *wcs_string2 = NULL;
- /* We need the size of wchar_t buffers correspond to csize1, csize2. */
- int wcs_size1 = 0, wcs_size2 = 0;
- /* offset buffer for optimizatoin. See convert_mbs_to_wc. */
- int *mbs_offset1 = NULL, *mbs_offset2 = NULL;
- /* They hold whether each wchar_t is binary data or not. */
- char *is_binary = NULL;
-#endif /* WCHAR */
-
- /* Check for out-of-range STARTPOS. */
- if (startpos < 0 || startpos > total_size)
- return -1;
-
- /* Fix up RANGE if it might eventually take us outside
- the virtual concatenation of STRING1 and STRING2.
- Make sure we won't move STARTPOS below 0 or above TOTAL_SIZE. */
- if (endpos < 0)
- range = 0 - startpos;
- else if (endpos > total_size)
- range = total_size - startpos;
-
- /* If the search isn't to be a backwards one, don't waste time in a
- search for a pattern that must be anchored. */
- if (bufp->used > 0 && range > 0
- && ((re_opcode_t) bufp->buffer[0] == begbuf
- /* `begline' is like `begbuf' if it cannot match at newlines. */
- || ((re_opcode_t) bufp->buffer[0] == begline
- && !bufp->newline_anchor)))
- {
- if (startpos > 0)
- return -1;
- else
- range = 1;
- }
-
-#ifdef emacs
- /* In a forward search for something that starts with \=.
- don't keep searching past point. */
- if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot && range > 0)
- {
- range = PT - startpos;
- if (range <= 0)
- return -1;
- }
-#endif /* emacs */
-
- /* Update the fastmap now if not correct already. */
- if (fastmap && !bufp->fastmap_accurate)
- if (re_compile_fastmap (bufp) == -2)
- return -2;
-
-#ifdef WCHAR
- /* Allocate wchar_t array for wcs_string1 and wcs_string2 and
- fill them with converted string. */
- if (size1 != 0)
- {
- if (size1 > MAX_ALLOCA_SIZE)
- {
- wcs_string1 = TALLOC (size1 + 1, CHAR_T);
- mbs_offset1 = TALLOC (size1 + 1, int);
- is_binary = TALLOC (size1 + 1, char);
- }
- else
- {
- wcs_string1 = REGEX_TALLOC (size1 + 1, CHAR_T);
- mbs_offset1 = REGEX_TALLOC (size1 + 1, int);
- is_binary = REGEX_TALLOC (size1 + 1, char);
- }
- if (!wcs_string1 || !mbs_offset1 || !is_binary)
- {
- if (size1 > MAX_ALLOCA_SIZE)
- {
- free (wcs_string1);
- free (mbs_offset1);
- free (is_binary);
- }
- else
- {
- FREE_VAR (wcs_string1);
- FREE_VAR (mbs_offset1);
- FREE_VAR (is_binary);
- }
- return -2;
- }
- wcs_size1 = convert_mbs_to_wcs(wcs_string1, string1, size1,
- mbs_offset1, is_binary);
- wcs_string1[wcs_size1] = L'\0'; /* for a sentinel */
- if (size1 > MAX_ALLOCA_SIZE)
- free (is_binary);
- else
- FREE_VAR (is_binary);
- }
- if (size2 != 0)
- {
- if (size2 > MAX_ALLOCA_SIZE)
- {
- wcs_string2 = TALLOC (size2 + 1, CHAR_T);
- mbs_offset2 = TALLOC (size2 + 1, int);
- is_binary = TALLOC (size2 + 1, char);
- }
- else
- {
- wcs_string2 = REGEX_TALLOC (size2 + 1, CHAR_T);
- mbs_offset2 = REGEX_TALLOC (size2 + 1, int);
- is_binary = REGEX_TALLOC (size2 + 1, char);
- }
- if (!wcs_string2 || !mbs_offset2 || !is_binary)
- {
- FREE_WCS_BUFFERS ();
- if (size2 > MAX_ALLOCA_SIZE)
- free (is_binary);
- else
- FREE_VAR (is_binary);
- return -2;
- }
- wcs_size2 = convert_mbs_to_wcs(wcs_string2, string2, size2,
- mbs_offset2, is_binary);
- wcs_string2[wcs_size2] = L'\0'; /* for a sentinel */
- if (size2 > MAX_ALLOCA_SIZE)
- free (is_binary);
- else
- FREE_VAR (is_binary);
- }
-#endif /* WCHAR */
-
- /* Loop through the string, looking for a place to start matching. */
- for (;;)
- {
- /* 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_T 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)
- {
-#ifdef WCHAR
- FREE_WCS_BUFFERS ();
-#endif
- return -1;
- }
-
-#ifdef WCHAR
- val = wcs_re_match_2_internal (bufp, string1, size1, string2,
- size2, startpos, regs, stop,
- wcs_string1, wcs_size1,
- wcs_string2, wcs_size2,
- mbs_offset1, mbs_offset2);
-#else /* BYTE */
- val = byte_re_match_2_internal (bufp, string1, size1, string2,
- size2, startpos, regs, stop);
-#endif /* BYTE */
-
-#ifndef REGEX_MALLOC
-# ifdef C_ALLOCA
- alloca (0);
# endif
#endif
-
- if (val >= 0)
- {
-#ifdef WCHAR
- FREE_WCS_BUFFERS ();
-#endif
- return startpos;
- }
-
- if (val == -2)
- {
-#ifdef WCHAR
- FREE_WCS_BUFFERS ();
-#endif
- return -2;
- }
-
- advance:
- if (!range)
- break;
- else if (range > 0)
- {
- range--;
- startpos++;
- }
- else
- {
- range++;
- startpos--;
- }
- }
-#ifdef WCHAR
- FREE_WCS_BUFFERS ();
-#endif
- return -1;
-
-} /* re_search_2 */
-
-#ifdef WCHAR
-/* This converts PTR, a pointer into one of the search wchar_t strings
- `string1' and `string2' into an multibyte string offset from the
- beginning of that string. We use mbs_offset to optimize.
- See convert_mbs_to_wcs. */
-# define POINTER_TO_OFFSET(ptr) \
- (FIRST_STRING_P (ptr) \
- ? ((regoff_t)(mbs_offset1 != NULL? mbs_offset1[(ptr)-string1] : 0)) \
- : ((regoff_t)((mbs_offset2 != NULL? mbs_offset2[(ptr)-string2] : 0) \
- + csize1)))
-#else /* BYTE */
-/* This converts PTR, a pointer into one of the search strings `string1'
- and `string2' into an offset from the beginning of that string. */
-#define POINTER_TO_OFFSET(ptr) \
- (FIRST_STRING_P (ptr) \
- ? ((regoff_t) ((ptr) - string1)) \
- : ((regoff_t) ((ptr) - string2 + size1)))
-#endif /* WCHAR */
-
-/* Macros for dealing with the split strings in re_match_2. */
-
-#define MATCHING_IN_FIRST_STRING (dend == end_match_1)
-
-/* Call before fetching a character with *d. This switches over to
- string2 if necessary. */
-#define PREFETCH() \
- while (d == dend) \
- { \
- /* End of string2 => fail. */ \
- if (dend == end_match_2) \
- goto fail; \
- /* End of string1 => advance to string2. */ \
- d = string2; \
- dend = end_match_2; \
- }
-
-
-/* Test if at very beginning or at very end of the virtual concatenation
- of `string1' and `string2'. If only one string, it's `string2'. */
-#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
-#define AT_STRINGS_END(d) ((d) == end2)
-
-
-/* Test if D points to a character which is word-constituent. We have
- two special cases to check for: if past the end of string1, look at
- the first character in string2; and if before the beginning of
- string2, look at the last character in string1. */
-#ifdef WCHAR
-/* Use internationalized API instead of SYNTAX. */
-# define WORDCHAR_P(d) \
- (iswalnum ((wint_t)((d) == end1 ? *string2 \
- : (d) == string2 - 1 ? *(end1 - 1) : *(d))) != 0 \
- || ((d) == end1 ? *string2 \
- : (d) == string2 - 1 ? *(end1 - 1) : *(d)) == L'_')
-#else /* BYTE */
-#define WORDCHAR_P(d) \
- (SYNTAX ((d) == end1 ? *string2 \
- : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \
- == Sword)
-#endif /* WCHAR */
-
-/* Disabled due to a compiler bug -- see comment at case wordbound */
-#if 0
-/* 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
-# ifdef WCHAR
-# 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); \
- if (!cant_free_wcs_buf) \
- { \
- FREE_VAR (string1); \
- FREE_VAR (string2); \
- FREE_VAR (mbs_offset1); \
- FREE_VAR (mbs_offset2); \
- } \
- } while (0)
-# else /* BYTE */
-# define FREE_VARIABLES() \
- do { \
- REGEX_FREE_STACK (fail_stack.stack); \
- FREE_VAR (regstart); \
- FREE_VAR (regend); \
- FREE_VAR (old_regstart); \
- FREE_VAR (old_regend); \
- FREE_VAR (best_regstart); \
- FREE_VAR (best_regend); \
- FREE_VAR (reg_info); \
- FREE_VAR (reg_dummy); \
- FREE_VAR (reg_info_dummy); \
- } while (0)
-# endif /* WCHAR */
-#else
-# ifdef WCHAR
-# define FREE_VARIABLES() \
- do { \
- if (!cant_free_wcs_buf) \
- { \
- FREE_VAR (string1); \
- FREE_VAR (string2); \
- FREE_VAR (mbs_offset1); \
- FREE_VAR (mbs_offset2); \
- } \
- } while (0)
-# else /* BYTE */
-# define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */
-# endif /* WCHAR */
-#endif /* not MATCH_MAY_ALLOCATE */
-
-/* These values must meet several constraints. They must not be valid
- 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)
-#else /* not INSIDE_RECURSION */
-
-/* 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;
-# ifdef MBS_SUPPORT
- if (MB_CUR_MAX != 1)
- result = wcs_re_match_2_internal (bufp, NULL, 0, string, size,
- pos, regs, size,
- NULL, 0, NULL, 0, NULL, NULL);
- else
-# endif
- result = byte_re_match_2_internal (bufp, NULL, 0, string, size,
- pos, regs, size);
-# ifndef REGEX_MALLOC
-# ifdef C_ALLOCA
- alloca (0);
-# endif
-# endif
- return result;
-}
-# ifdef _LIBC
-weak_alias (__re_match, re_match)
-# endif
-#endif /* not emacs */
-
-#endif /* not INSIDE_RECURSION */
-
-#ifdef INSIDE_RECURSION
-static boolean PREFIX(group_match_null_string_p) _RE_ARGS ((UCHAR_T **p,
- UCHAR_T *end,
- PREFIX(register_info_type) *reg_info));
-static boolean PREFIX(alt_match_null_string_p) _RE_ARGS ((UCHAR_T *p,
- UCHAR_T *end,
- PREFIX(register_info_type) *reg_info));
-static boolean PREFIX(common_op_match_null_string_p) _RE_ARGS ((UCHAR_T **p,
- UCHAR_T *end,
- PREFIX(register_info_type) *reg_info));
-static int PREFIX(bcmp_translate) _RE_ARGS ((const CHAR_T *s1, const CHAR_T *s2,
- int len, char *translate));
-#else /* not INSIDE_RECURSION */
-
-/* re_match_2 matches the compiled pattern in BUFP against the
- the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
- 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;
-# ifdef MBS_SUPPORT
- if (MB_CUR_MAX != 1)
- result = wcs_re_match_2_internal (bufp, string1, size1, string2, size2,
- pos, regs, stop,
- NULL, 0, NULL, 0, NULL, NULL);
- else
-# endif
- result = byte_re_match_2_internal (bufp, string1, size1, string2, size2,
- pos, regs, stop);
-#ifndef REGEX_MALLOC
-# ifdef C_ALLOCA
- alloca (0);
-# endif
-#endif
- return result;
-}
-#ifdef _LIBC
-weak_alias (__re_match_2, re_match_2)
-#endif
-
-#endif /* not INSIDE_RECURSION */
-
-#ifdef INSIDE_RECURSION
-
-#ifdef WCHAR
-static int count_mbs_length PARAMS ((int *, int));
-
-/* This check the substring (from 0, to length) of the multibyte string,
- to which offset_buffer correspond. And count how many wchar_t_characters
- the substring occupy. We use offset_buffer to optimization.
- See convert_mbs_to_wcs. */
-
-static int
-count_mbs_length(offset_buffer, length)
- int *offset_buffer;
- int length;
-{
- int upper, lower;
-
- /* Check whether the size is valid. */
- if (length < 0)
- return -1;
-
- if (offset_buffer == NULL)
- return 0;
-
- /* If there are no multibyte character, offset_buffer[i] == i.
- Optmize for this case. */
- if (offset_buffer[length] == length)
- return length;
-
- /* Set up upper with length. (because for all i, offset_buffer[i] >= i) */
- upper = length;
- lower = 0;
-
- while (true)
- {
- int middle = (lower + upper) / 2;
- if (middle == lower || middle == upper)
- break;
- if (offset_buffer[middle] > length)
- upper = middle;
- else if (offset_buffer[middle] < length)
- lower = middle;
- else
- return middle;
- }
-
- return -1;
-}
-#endif /* WCHAR */
-
-/* This is a separate function so that we can force an alloca cleanup
- afterwards. */
-#ifdef WCHAR
-static int
-wcs_re_match_2_internal (bufp, cstring1, csize1, cstring2, csize2, pos,
- regs, stop, string1, size1, string2, size2,
- mbs_offset1, mbs_offset2)
- struct re_pattern_buffer *bufp;
- const char *cstring1, *cstring2;
- int csize1, csize2;
- int pos;
- struct re_registers *regs;
- int stop;
- /* string1 == string2 == NULL means string1/2, size1/2 and
- mbs_offset1/2 need seting up in this function. */
- /* We need wchar_t* buffers correspond to cstring1, cstring2. */
- wchar_t *string1, *string2;
- /* We need the size of wchar_t buffers correspond to csize1, csize2. */
- int size1, size2;
- /* offset buffer for optimizatoin. See convert_mbs_to_wc. */
- int *mbs_offset1, *mbs_offset2;
-#else /* BYTE */
-static int
-byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos,
- regs, stop)
- struct re_pattern_buffer *bufp;
- const char *string1, *string2;
- int size1, size2;
- int pos;
- struct re_registers *regs;
- int stop;
-#endif /* BYTE */
-{
- /* General temporaries. */
- int mcnt;
- UCHAR_T *p1;
-#ifdef WCHAR
- /* They hold whether each wchar_t is binary data or not. */
- char *is_binary = NULL;
- /* If true, we can't free string1/2, mbs_offset1/2. */
- int cant_free_wcs_buf = 1;
-#endif /* WCHAR */
-
- /* Just past the end of the corresponding string. */
- const CHAR_T *end1, *end2;
-
- /* Pointers into string1 and string2, just past the last characters in
- each to consider matching. */
- const CHAR_T *end_match_1, *end_match_2;
-
- /* Where we are in the data, and the end of the current string. */
- const CHAR_T *d, *dend;
-
- /* Where we are in the pattern, and the end of the pattern. */
-#ifdef WCHAR
- UCHAR_T *pattern, *p;
- register UCHAR_T *pend;
-#else /* BYTE */
- UCHAR_T *p = bufp->buffer;
- register UCHAR_T *pend = p + bufp->used;
-#endif /* WCHAR */
-
- /* Mark the opcode just after a start_memory, so we can test for an
- empty subpattern when we get to the stop_memory. */
- UCHAR_T *just_past_start_mem = 0;
-
- /* We use this to map every character in the string. */
- RE_TRANSLATE_TYPE translate = bufp->translate;
-
- /* 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. */
- PREFIX(fail_stack_type) fail_stack;
-#endif
-#ifdef DEBUG
- static unsigned failure_id;
- unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
-#endif
-
-#ifdef REL_ALLOC
- /* This holds the pointer to the failure stack, when
- it is allocated relocatably. */
- fail_stack_elt_t *failure_stack_ptr;
-#endif
-
- /* We fill all the registers internally, independent of what we
- return, for use in backreferences. The number here includes
- an element for register zero. */
- size_t num_regs = bufp->re_nsub + 1;
-
- /* The currently active registers. */
- active_reg_t lowest_active_reg = NO_LOWEST_ACTIVE_REG;
- active_reg_t highest_active_reg = NO_HIGHEST_ACTIVE_REG;
-
- /* Information on the contents of registers. These are pointers into
- the input strings; they record just what was matched (on this
- attempt) by a subexpression part of the pattern, that is, the
- regnum-th regstart pointer points to where in the pattern we began
- matching and the regnum-th regend points to right after where we
- stopped matching the regnum-th subexpression. (The zeroth register
- keeps track of what the whole pattern matches.) */
-#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */
- const CHAR_T **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_T **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. */
- PREFIX(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_T **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_T *match_end = NULL;
-
- /* This helps SET_REGS_MATCHED avoid doing redundant work. */
- int set_regs_matched_done = 0;
-
- /* Used when we pop values we don't care about. */
-#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */
- const CHAR_T **reg_dummy;
- PREFIX(register_info_type) *reg_info_dummy;
-#endif
-
-#ifdef DEBUG
- /* 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_T *);
- regend = REGEX_TALLOC (num_regs, const CHAR_T *);
- old_regstart = REGEX_TALLOC (num_regs, const CHAR_T *);
- old_regend = REGEX_TALLOC (num_regs, const CHAR_T *);
- best_regstart = REGEX_TALLOC (num_regs, const CHAR_T *);
- best_regend = REGEX_TALLOC (num_regs, const CHAR_T *);
- reg_info = REGEX_TALLOC (num_regs, PREFIX(register_info_type));
- reg_dummy = REGEX_TALLOC (num_regs, const CHAR_T *);
- reg_info_dummy = REGEX_TALLOC (num_regs, PREFIX(register_info_type));
-
- if (!(regstart && regend && old_regstart && old_regend && reg_info
- && best_regstart && best_regend && reg_dummy && reg_info_dummy))
- {
- 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 = (PREFIX(register_info_type) *) NULL;
- }
-#endif /* MATCH_MAY_ALLOCATE */
-
- /* The starting position is bogus. */
-#ifdef WCHAR
- if (pos < 0 || pos > csize1 + csize2)
-#else /* BYTE */
- if (pos < 0 || pos > size1 + size2)
-#endif
- {
- FREE_VARIABLES ();
- return -1;
- }
-
-#ifdef WCHAR
- /* Allocate wchar_t array for string1 and string2 and
- fill them with converted string. */
- if (string1 == NULL && string2 == NULL)
- {
- /* We need seting up buffers here. */
-
- /* We must free wcs buffers in this function. */
- cant_free_wcs_buf = 0;
-
- if (csize1 != 0)
- {
- string1 = REGEX_TALLOC (csize1 + 1, CHAR_T);
- mbs_offset1 = REGEX_TALLOC (csize1 + 1, int);
- is_binary = REGEX_TALLOC (csize1 + 1, char);
- if (!string1 || !mbs_offset1 || !is_binary)
- {
- FREE_VAR (string1);
- FREE_VAR (mbs_offset1);
- FREE_VAR (is_binary);
- return -2;
- }
- }
- if (csize2 != 0)
- {
- string2 = REGEX_TALLOC (csize2 + 1, CHAR_T);
- mbs_offset2 = REGEX_TALLOC (csize2 + 1, int);
- is_binary = REGEX_TALLOC (csize2 + 1, char);
- if (!string2 || !mbs_offset2 || !is_binary)
- {
- FREE_VAR (string1);
- FREE_VAR (mbs_offset1);
- FREE_VAR (string2);
- FREE_VAR (mbs_offset2);
- FREE_VAR (is_binary);
- return -2;
- }
- size2 = convert_mbs_to_wcs(string2, cstring2, csize2,
- mbs_offset2, is_binary);
- string2[size2] = L'\0'; /* for a sentinel */
- FREE_VAR (is_binary);
- }
- }
-
- /* We need to cast pattern to (wchar_t*), because we casted this compiled
- pattern to (char*) in regex_compile. */
- p = pattern = (CHAR_T*)bufp->buffer;
- pend = (CHAR_T*)(bufp->buffer + bufp->used);
-
-#endif /* WCHAR */
-
- /* Initialize subexpression text positions to -1 to mark ones that no
- start_memory/stop_memory has been seen for. Also initialize the
- register information struct. */
- 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;
-#ifdef WCHAR
- mbs_offset2 = mbs_offset1;
- csize2 = csize1;
- mbs_offset1 = NULL;
- csize1 = 0;
-#endif
- }
- end1 = string1 + size1;
- end2 = string2 + size2;
-
- /* Compute where to stop matching, within the two strings. */
-#ifdef WCHAR
- if (stop <= csize1)
- {
- mcnt = count_mbs_length(mbs_offset1, stop);
- end_match_1 = string1 + mcnt;
- end_match_2 = string2;
- }
- else
- {
- if (stop > csize1 + csize2)
- stop = csize1 + csize2;
- end_match_1 = end1;
- mcnt = count_mbs_length(mbs_offset2, stop-csize1);
- end_match_2 = string2 + mcnt;
- }
- if (mcnt < 0)
- { /* count_mbs_length return error. */
- FREE_VARIABLES ();
- return -1;
- }
-#else
- if (stop <= size1)
- {
- end_match_1 = string1 + stop;
- end_match_2 = string2;
- }
- else
- {
- end_match_1 = end1;
- end_match_2 = string2 + stop - size1;
- }
-#endif /* WCHAR */
-
- /* `p' scans through the pattern as `d' scans through the data.
- `dend' is the end of the input string that `d' points within. `d'
- is advanced into the following input string whenever necessary, but
- this happens before fetching; therefore, at the beginning of the
- loop, `d' can be pointing at the end of a string, but it cannot
- equal `string2'. */
-#ifdef WCHAR
- if (size1 > 0 && pos <= csize1)
- {
- mcnt = count_mbs_length(mbs_offset1, pos);
- d = string1 + mcnt;
- dend = end_match_1;
- }
- else
- {
- mcnt = count_mbs_length(mbs_offset2, pos-csize1);
- d = string2 + mcnt;
- dend = end_match_2;
- }
-
- if (mcnt < 0)
- { /* count_mbs_length return error. */
- FREE_VARIABLES ();
- return -1;
- }
-#else
- if (size1 > 0 && pos <= size1)
- {
- d = string1 + pos;
- dend = end_match_1;
- }
- else
- {
- d = string2 + pos - size1;
- dend = end_match_2;
- }
-#endif /* WCHAR */
-
- DEBUG_PRINT1 ("The compiled pattern is:\n");
- DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend);
- DEBUG_PRINT1 ("The string to match is: `");
- DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
- DEBUG_PRINT1 ("'\n");
-
- /* This loops over pattern commands. It exits by returning from the
- function if the match is complete, or it drops through if the match
- fails at this starting point in the input data. */
- for (;;)
- {
-#ifdef _LIBC
- DEBUG_PRINT2 ("\n%p: ", p);
-#else
- DEBUG_PRINT2 ("\n0x%x: ", p);
-#endif
-
- if (p == pend)
- { /* End of pattern means we might have succeeded. */
- DEBUG_PRINT1 ("end of pattern ... ");
-
- /* If we haven't matched the entire string, and we want the
- longest match, try backtracking. */
- if (d != end_match_2)
- {
- /* 1 if this match ends in the same string (string1 or string2)
- as the best previous match. */
- boolean same_str_p = (FIRST_STRING_P (match_end)
- == MATCHING_IN_FIRST_STRING);
- /* 1 if this match is the best seen so far. */
- boolean best_match_p;
-
- /* AIX compiler got confused when this was combined
- with the previous declaration. */
- if (same_str_p)
- best_match_p = d > match_end;
- else
- best_match_p = !MATCHING_IN_FIRST_STRING;
-
- DEBUG_PRINT1 ("backtracking.\n");
-
- if (!FAIL_STACK_EMPTY ())
- { /* More failure points to try. */
-
- /* If exceeds best match so far, save it. */
- if (!best_regs_set || best_match_p)
- {
- best_regs_set = true;
- match_end = d;
-
- DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
-
- for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
- {
- best_regstart[mcnt] = regstart[mcnt];
- best_regend[mcnt] = regend[mcnt];
- }
- }
- goto fail;
- }
-
- /* If no failure points, don't restore garbage. And if
- last match is real best match, don't restore second
- best one. */
- else if (best_regs_set && !best_match_p)
- {
- restore_best_regs:
- /* Restore best match. It may happen that `dend ==
- end_match_1' while the restored d is in string2.
- For example, the pattern `x.*y.*z' against the
- strings `x-' and `y-z-', if the two strings are
- not consecutive in memory. */
- DEBUG_PRINT1 ("Restoring best registers.\n");
-
- d = match_end;
- dend = ((d >= string1 && d <= end1)
- ? end_match_1 : end_match_2);
-
- for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
- {
- regstart[mcnt] = best_regstart[mcnt];
- regend[mcnt] = best_regend[mcnt];
- }
- }
- } /* d != end_match_2 */
-
- succeed_label:
- DEBUG_PRINT1 ("Accepting match.\n");
-
- /* If caller wants register contents data back, do it. */
- if (regs && !bufp->no_sub)
- {
- /* Have the register data arrays been allocated? */
- if (bufp->regs_allocated == REGS_UNALLOCATED)
- { /* No. So allocate them with malloc. We need one
- extra element beyond `num_regs' for the `-1' marker
- GNU code uses. */
- regs->num_regs = MAX (RE_NREGS, num_regs + 1);
- regs->start = TALLOC (regs->num_regs, regoff_t);
- regs->end = TALLOC (regs->num_regs, regoff_t);
- if (regs->start == NULL || regs->end == NULL)
- {
- FREE_VARIABLES ();
- return -2;
- }
- bufp->regs_allocated = REGS_REALLOCATE;
- }
- else if (bufp->regs_allocated == REGS_REALLOCATE)
- { /* Yes. If we need more elements than were already
- allocated, reallocate them. If we need fewer, just
- leave it alone. */
- if (regs->num_regs < num_regs + 1)
- {
- regs->num_regs = num_regs + 1;
- RETALLOC (regs->start, regs->num_regs, regoff_t);
- RETALLOC (regs->end, regs->num_regs, regoff_t);
- if (regs->start == NULL || regs->end == NULL)
- {
- FREE_VARIABLES ();
- return -2;
- }
- }
- }
- else
- {
- /* These braces fend off a "empty body in an else-statement"
- warning under GCC when assert expands to nothing. */
- assert (bufp->regs_allocated == REGS_FIXED);
- }
-
- /* Convert the pointer data in `regstart' and `regend' to
- indices. Register zero has to be set differently,
- since we haven't kept track of any info for it. */
- if (regs->num_regs > 0)
- {
- regs->start[0] = pos;
-#ifdef WCHAR
- if (MATCHING_IN_FIRST_STRING)
- regs->end[0] = mbs_offset1 != NULL ?
- mbs_offset1[d-string1] : 0;
- else
- regs->end[0] = csize1 + (mbs_offset2 != NULL ?
- mbs_offset2[d-string2] : 0);
-#else
- regs->end[0] = (MATCHING_IN_FIRST_STRING
- ? ((regoff_t) (d - string1))
- : ((regoff_t) (d - string2 + size1)));
-#endif /* WCHAR */
- }
-
- /* Go through the first `min (num_regs, regs->num_regs)'
- registers, since that is all we initialized. */
- for (mcnt = 1; (unsigned) mcnt < MIN (num_regs, regs->num_regs);
- mcnt++)
- {
- if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt]))
- regs->start[mcnt] = regs->end[mcnt] = -1;
- else
- {
- regs->start[mcnt]
- = (regoff_t) POINTER_TO_OFFSET (regstart[mcnt]);
- regs->end[mcnt]
- = (regoff_t) POINTER_TO_OFFSET (regend[mcnt]);
- }
- }
-
- /* If the regs structure we return has more elements than
- were in the pattern, set the extra elements to -1. If
- we (re)allocated the registers, this is the case,
- because we always allocate enough to have at least one
- -1 at the end. */
- for (mcnt = num_regs; (unsigned) mcnt < regs->num_regs; mcnt++)
- regs->start[mcnt] = regs->end[mcnt] = -1;
- } /* regs && !bufp->no_sub */
-
- DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n",
- nfailure_points_pushed, nfailure_points_popped,
- nfailure_points_pushed - nfailure_points_popped);
- DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
-
-#ifdef WCHAR
- if (MATCHING_IN_FIRST_STRING)
- mcnt = mbs_offset1 != NULL ? mbs_offset1[d-string1] : 0;
- else
- mcnt = (mbs_offset2 != NULL ? mbs_offset2[d-string2] : 0) +
- csize1;
- mcnt -= pos;
-#else
- mcnt = d - pos - (MATCHING_IN_FIRST_STRING
- ? string1
- : string2 - size1);
-#endif /* WCHAR */
-
- DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
-
- FREE_VARIABLES ();
- return mcnt;
- }
-
- /* Otherwise match next pattern command. */
- switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
- {
- /* Ignore these. Used to ignore the n of succeed_n's which
- currently have n == 0. */
- case no_op:
- DEBUG_PRINT1 ("EXECUTING no_op.\n");
- break;
-
- case succeed:
- DEBUG_PRINT1 ("EXECUTING succeed.\n");
- goto succeed_label;
-
- /* Match the next n pattern characters exactly. The following
- byte in the pattern defines n, and the n bytes after that
- are the characters to match. */
- case exactn:
-#ifdef MBS_SUPPORT
- case exactn_bin:
-#endif
- mcnt = *p++;
- DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt);
-
- /* This is written out as an if-else so we don't waste time
- testing `translate' inside the loop. */
- if (translate)
- {
- do
- {
- PREFETCH ();
-#ifdef WCHAR
- if (*d <= 0xff)
- {
- if ((UCHAR_T) translate[(unsigned char) *d++]
- != (UCHAR_T) *p++)
- goto fail;
- }
- else
- {
- if (*d++ != (CHAR_T) *p++)
- goto fail;
- }
-#else
- if ((UCHAR_T) translate[(unsigned char) *d++]
- != (UCHAR_T) *p++)
- goto fail;
-#endif /* WCHAR */
- }
- while (--mcnt);
- }
- else
- {
- do
- {
- PREFETCH ();
- if (*d++ != (CHAR_T) *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:
- {
-#ifdef WCHAR
- unsigned int i, char_class_length, coll_symbol_length,
- equiv_class_length, ranges_length, chars_length, length;
- CHAR_T *workp, *workp2, *charset_top;
-# define WORK_BUFFER_SIZE 128
- CHAR_T str_buf[WORK_BUFFER_SIZE];
-#endif /* WCHAR */
- register UCHAR_T c;
- boolean not = (re_opcode_t) *(p - 1) == charset_not;
-
- DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : "");
-
- PREFETCH ();
- c = TRANSLATE (*d); /* The character to match. */
-
-#ifdef WCHAR
- charset_top = p - 1;
- char_class_length = *p++;
- coll_symbol_length = *p++;
- equiv_class_length = *p++;
- ranges_length = *p++;
- chars_length = *p++;
- /* p points charset[6], so the address of the next instruction
- (charset[l+m+n+2o+k+p']) equals p[l+m+n+2*o+p'],
- where l=length of char_classes, m=length of collating_symbol,
- n=equivalence_class, o=length of char_range,
- p'=length of character. */
- workp = p;
- /* Update p to indicate the next instruction. */
- p += char_class_length + coll_symbol_length+ equiv_class_length +
- 2*ranges_length + chars_length;
-
- /* match with char_class? */
- for (i = 0; i < char_class_length ; i += CHAR_CLASS_SIZE)
- {
- wctype_t wctype;
- unsigned long int alignedp = ((unsigned long int)workp
- + __alignof__(wctype_t) - 1)
- & ~(unsigned long int)(__alignof__(wctype_t) - 1);
- wctype = *((wctype_t*)alignedp);
- workp += CHAR_CLASS_SIZE;
- if (iswctype((wint_t)c, wctype))
- goto char_set_matched;
- }
-
- /* match with collating_symbol? */
- /* If we can't look up collation data, we use wcscoll
- instead. */
- for (workp2 = workp + coll_symbol_length ; workp < workp2 ;)
- {
- const CHAR_T *backup_d = d, *backup_dend = dend;
- length = wcslen(workp);
-
- /* If wcscoll(the collating symbol, whole string) > 0,
- any substring of the string never match with the
- collating symbol. */
- if (wcscoll(workp, d) > 0)
- {
- workp += length + 1;
- continue;
- }
-
- /* First, we compare the collating symbol with
- the first character of the string.
- If it don't match, we add the next character to
- the compare buffer in turn. */
- for (i = 0 ; i < WORK_BUFFER_SIZE-1 ; i++, d++)
- {
- int match;
- if (d == dend)
- {
- if (dend == end_match_2)
- break;
- d = string2;
- dend = end_match_2;
- }
-
- /* add next character to the compare buffer. */
- str_buf[i] = TRANSLATE(*d);
- str_buf[i+1] = '\0';
-
- match = wcscoll(workp, str_buf);
- if (match == 0)
- goto char_set_matched;
-
- if (match < 0)
- /* (str_buf > workp) indicate (str_buf + X > workp),
- because for all X (str_buf + X > str_buf).
- So we don't need continue this loop. */
- break;
-
- /* Otherwise(str_buf < workp),
- (str_buf+next_character) may equals (workp).
- So we continue this loop. */
- }
- /* not matched */
- d = backup_d;
- dend = backup_dend;
- workp += length + 1;
- }
- /* match with equivalence_class? */
- /* If we can't look up collation data, we use wcscoll
- instead. */
- for (workp2 = workp + equiv_class_length ; workp < workp2 ;)
- {
- const CHAR_T *backup_d = d, *backup_dend = dend;
- length = wcslen(workp);
-
- /* If wcscoll(the collating symbol, whole string) > 0,
- any substring of the string never match with the
- collating symbol. */
- if (wcscoll(workp, d) > 0)
- {
- workp += length + 1;
- break;
- }
-
- /* First, we compare the equivalence class with
- the first character of the string.
- If it don't match, we add the next character to
- the compare buffer in turn. */
- for (i = 0 ; i < WORK_BUFFER_SIZE - 1 ; i++, d++)
- {
- int match;
- if (d == dend)
- {
- if (dend == end_match_2)
- break;
- d = string2;
- dend = end_match_2;
- }
-
- /* add next character to the compare buffer. */
- str_buf[i] = TRANSLATE(*d);
- str_buf[i+1] = '\0';
-
- match = wcscoll(workp, str_buf);
-
- if (match == 0)
- goto char_set_matched;
-
- if (match < 0)
- /* (str_buf > workp) indicate (str_buf + X > workp),
- because for all X (str_buf + X > str_buf).
- So we don't need continue this loop. */
- break;
-
- /* Otherwise(str_buf < workp),
- (str_buf+next_character) may equals (workp).
- So we continue this loop. */
- }
- /* not matched */
- d = backup_d;
- dend = backup_dend;
- workp += length + 1;
- }
-
- /* match with char_range? */
- /* We set range_start_char at str_buf[0], range_end_char
- at str_buf[4], and compared char at str_buf[2]. */
- str_buf[1] = 0;
- str_buf[2] = c;
- str_buf[3] = 0;
- str_buf[5] = 0;
- for (; workp < p - chars_length ;)
- {
- wchar_t *range_start_char, *range_end_char;
-
- /* match if (range_start_char <= c <= range_end_char). */
-
- /* If range_start(or end) < 0, we assume -range_start(end)
- is the offset of the collating symbol which is specified
- as the character of the range start(end). */
-
- /* range_start */
- if (*workp < 0)
- range_start_char = charset_top - (*workp++);
- else
- {
- str_buf[0] = *workp++;
- range_start_char = str_buf;
- }
-
- /* range_end */
- if (*workp < 0)
- range_end_char = charset_top - (*workp++);
- else
- {
- str_buf[4] = *workp++;
- range_end_char = str_buf + 4;
- }
-
- if (wcscoll(range_start_char, str_buf+2) <= 0 &&
- wcscoll(str_buf+2, range_end_char) <= 0)
-
- goto char_set_matched;
- }
-
- /* match with char? */
- for (; workp < p ; workp++)
- if (c == *workp)
- goto char_set_matched;
-
- not = !not;
-
- char_set_matched:
- if (not) goto fail;
-#else
- /* Cast to `unsigned' instead of `unsigned char' in case the
- bit list is a full 32 bytes long. */
- if (c < (unsigned) (*p * BYTEWIDTH)
- && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
- not = !not;
-
- p += 1 + *p;
-
- if (!not) goto fail;
-#undef WORK_BUFFER_SIZE
-#endif /* WCHAR */
- 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])
- = PREFIX(group_match_null_string_p) (&p1, pend, reg_info);
-
- /* Save the position in the string where we were the last time
- we were at this open-group operator in case the group is
- 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. */
- UCHAR_T r = *p - 1;
- while (r > 0 && !IS_ACTIVE (reg_info[r]))
- r--;
-
- /* If we end up at register zero, that means that we saved
- the registers as the result of an `on_failure_jump', not
- a `start_memory', and we jumped to past the innermost
- `stop_memory'. For example, in ((.)*) we save
- registers 1 and 2 as a result of the *, but when we pop
- back to the second ), we are at the stop_memory 1.
- Thus, nothing is active. */
- if (r == 0)
- {
- lowest_active_reg = NO_LOWEST_ACTIVE_REG;
- highest_active_reg = NO_HIGHEST_ACTIVE_REG;
- }
- else
- highest_active_reg = r;
- }
-
- /* If just failed to match something this time around with a
- group that's operated on by a repetition operator, try to
- force exit from the ``loop'', and restore the register
- information for this group that we had before trying this
- last match. */
- if ((!MATCHED_SOMETHING (reg_info[*p])
- || just_past_start_mem == p - 1)
- && (p + 2) < pend)
- {
- boolean is_a_jump_n = false;
-
- p1 = p + 2;
- mcnt = 0;
- switch ((re_opcode_t) *p1++)
- {
- case jump_n:
- is_a_jump_n = true;
- case pop_failure_jump:
- case maybe_pop_jump:
- case jump:
- case dummy_failure_jump:
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- if (is_a_jump_n)
- p1 += OFFSET_ADDRESS_SIZE;
- break;
-
- default:
- /* do nothing */ ;
- }
- p1 += mcnt;
-
- /* If the next operation is a jump backwards in the pattern
- to an on_failure_jump right before the start_memory
- corresponding to this stop_memory, exit from the loop
- by forcing a failure after pushing on the stack the
- on_failure_jump's jump in the pattern, and d. */
- if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump
- && (re_opcode_t) p1[1 + OFFSET_ADDRESS_SIZE] == start_memory
- && p1[2 + OFFSET_ADDRESS_SIZE] == *p)
- {
- /* If this group ever matched anything, then restore
- what its registers were before trying this last
- failed match, e.g., with `(a*)*b' against `ab' for
- regstart[1], and, e.g., with `((a*)*(b*)*)*'
- against `aba' for regend[3].
-
- Also restore the registers for inner groups for,
- e.g., `((a*)(b*))*' against `aba' (register 3 would
- otherwise get trashed). */
-
- if (EVER_MATCHED_SOMETHING (reg_info[*p]))
- {
- unsigned r;
-
- EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
-
- /* Restore this and inner groups' (if any) registers. */
- for (r = *p; r < (unsigned) *p + (unsigned) *(p + 1);
- r++)
- {
- regstart[r] = old_regstart[r];
-
- /* xx why this test? */
- if (old_regend[r] >= regstart[r])
- regend[r] = old_regend[r];
- }
- }
- p1++;
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- PUSH_FAILURE_POINT (p1 + mcnt, d, -2);
-
- goto fail;
- }
- }
-
- /* Move past the register number and the inner group count. */
- p += 2;
- break;
-
-
- /* \<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_T *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
- ? PREFIX(bcmp_translate) (d, d2, mcnt, translate)
- : memcmp (d, d2, mcnt*sizeof(UCHAR_T)))
- 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 UCHAR_T *p2 = p;
-
- /* Compare the beginning of the repeat with what in the
- pattern follows its end. If we can establish that there
- is nothing that they would both match, i.e., that we
- would have to backtrack because of (as in, e.g., `a*a')
- then we can change to pop_failure_jump, because we'll
- never have to backtrack.
-
- This is not true in the case of alternatives: in
- `(a|ab)*' we do need to backtrack to the `ab' alternative
- (e.g., if the string was `ab'). But instead of trying to
- detect that here, the alternative has put on a dummy
- failure point which is what we will end up popping. */
-
- /* Skip over open/close-group commands.
- If what follows this loop is a ...+ construct,
- look at what begins its body, since we will have to
- match at least one of that. */
- while (1)
- {
- if (p2 + 2 < pend
- && ((re_opcode_t) *p2 == stop_memory
- || (re_opcode_t) *p2 == start_memory))
- p2 += 3;
- else if (p2 + 2 + 2 * OFFSET_ADDRESS_SIZE < pend
- && (re_opcode_t) *p2 == dummy_failure_jump)
- p2 += 2 + 2 * OFFSET_ADDRESS_SIZE;
- else
- break;
- }
-
- p1 = p + mcnt;
- /* p1[0] ... p1[2] are the `on_failure_jump' corresponding
- to the `maybe_finalize_jump' of this case. Examine what
- follows. */
-
- /* If we're at the end of the pattern, we can change. */
- if (p2 == pend)
- {
- /* Consider what happens when matching ":\(.*\)"
- against ":/". I don't really understand this code
- yet. */
- p[-(1 + OFFSET_ADDRESS_SIZE)] = (UCHAR_T) pop_failure_jump;
- DEBUG_PRINT1
- (" End of pattern: change to `pop_failure_jump'.\n");
- }
-
- else if ((re_opcode_t) *p2 == exactn
-#ifdef MBS_SUPPORT
- || (re_opcode_t) *p2 == exactn_bin
-#endif
- || (bufp->newline_anchor && (re_opcode_t) *p2 == endline))
- {
- register UCHAR_T c
- = *p2 == (UCHAR_T) endline ? '\n' : p2[2];
-
- if (((re_opcode_t) p1[1 + OFFSET_ADDRESS_SIZE] == exactn
-#ifdef MBS_SUPPORT
- || (re_opcode_t) p1[1 + OFFSET_ADDRESS_SIZE] == exactn_bin
-#endif
- ) && p1[3 + OFFSET_ADDRESS_SIZE] != c)
- {
- p[-(1 + OFFSET_ADDRESS_SIZE)] = (UCHAR_T) pop_failure_jump;
-#ifdef WCHAR
- DEBUG_PRINT3 (" %C != %C => pop_failure_jump.\n",
- (wint_t) c,
- (wint_t) p1[3+OFFSET_ADDRESS_SIZE]);
-#else
- DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
- (char) c,
- (char) p1[3+OFFSET_ADDRESS_SIZE]);
-#endif
- }
-
-#ifndef WCHAR
- else if ((re_opcode_t) p1[3] == charset
- || (re_opcode_t) p1[3] == charset_not)
- {
- int not = (re_opcode_t) p1[3] == charset_not;
-
- if (c < (unsigned) (p1[4] * BYTEWIDTH)
- && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
- not = !not;
-
- /* `not' is equal to 1 if c would match, which means
- that we can't change to pop_failure_jump. */
- if (!not)
- {
- p[-3] = (unsigned char) pop_failure_jump;
- DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
- }
- }
-#endif /* not WCHAR */
- }
-#ifndef WCHAR
- else if ((re_opcode_t) *p2 == charset)
- {
- /* We win if the first character of the loop is not part
- of the charset. */
- if ((re_opcode_t) p1[3] == exactn
- && ! ((int) p2[1] * BYTEWIDTH > (int) p1[5]
- && (p2[2 + p1[5] / BYTEWIDTH]
- & (1 << (p1[5] % BYTEWIDTH)))))
- {
- p[-3] = (unsigned char) pop_failure_jump;
- DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
- }
-
- else if ((re_opcode_t) p1[3] == charset_not)
- {
- int idx;
- /* We win if the charset_not inside the loop
- lists every character listed in the charset after. */
- for (idx = 0; idx < (int) p2[1]; idx++)
- if (! (p2[2 + idx] == 0
- || (idx < (int) p1[4]
- && ((p2[2 + idx] & ~ p1[5 + idx]) == 0))))
- break;
-
- if (idx == p2[1])
- {
- p[-3] = (unsigned char) pop_failure_jump;
- DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
- }
- }
- else if ((re_opcode_t) p1[3] == charset)
- {
- int idx;
- /* We win if the charset inside the loop
- has no overlap with the one after the loop. */
- for (idx = 0;
- idx < (int) p2[1] && idx < (int) p1[4];
- idx++)
- if ((p2[2 + idx] & p1[5 + idx]) != 0)
- break;
-
- if (idx == p2[1] || idx == p1[4])
- {
- p[-3] = (unsigned char) pop_failure_jump;
- DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
- }
- }
- }
-#endif /* not WCHAR */
- }
- p -= OFFSET_ADDRESS_SIZE; /* Point at relative address again. */
- if ((re_opcode_t) p[-1] != pop_failure_jump)
- {
- p[-1] = (UCHAR_T) jump;
- DEBUG_PRINT1 (" Match => jump.\n");
- goto unconditional_jump;
- }
- /* 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;
- UCHAR_T *pdummy = NULL;
- const CHAR_T *sdummy = NULL;
-
- DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n");
- POP_FAILURE_POINT (sdummy, pdummy,
- dummy_low_reg, dummy_high_reg,
- reg_dummy, reg_dummy, reg_info_dummy);
- }
- /* Note fall through. */
-
- unconditional_jump:
-#ifdef _LIBC
- DEBUG_PRINT2 ("\n%p: ", p);
-#else
- DEBUG_PRINT2 ("\n0x%x: ", p);
-#endif
- /* Note fall through. */
-
- /* Unconditionally jump (without popping any failure points). */
- case jump:
- EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */
- DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt);
- p += mcnt; /* Do the jump. */
-#ifdef _LIBC
- DEBUG_PRINT2 ("(to %p).\n", p);
-#else
- DEBUG_PRINT2 ("(to 0x%x).\n", p);
-#endif
- break;
-
-
- /* We need this opcode so we can detect where alternatives end
- in `group_match_null_string_p' et al. */
- case jump_past_alt:
- DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n");
- goto unconditional_jump;
-
-
- /* Normally, the on_failure_jump pushes a failure point, which
- then gets popped at pop_failure_jump. We will end up at
- pop_failure_jump, also, and with a pattern of, say, `a+', we
- are skipping over the on_failure_jump, so we have to push
- something meaningless for pop_failure_jump to pop. */
- case dummy_failure_jump:
- DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n");
- /* It doesn't matter what we push for the string here. What
- the code at `fail' tests is the value for the pattern. */
- PUSH_FAILURE_POINT (NULL, NULL, -2);
- goto unconditional_jump;
-
-
- /* At the end of an alternative, we need to push a dummy failure
- point in case we are followed by a `pop_failure_jump', because
- we don't want the failure point for the alternative to be
- popped. For example, matching `(a|ab)*' against `aab'
- requires that we match the `ab' alternative. */
- case push_dummy_failure:
- DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n");
- /* See comments just above at `dummy_failure_jump' about the
- two zeroes. */
- PUSH_FAILURE_POINT (NULL, NULL, -2);
- break;
-
- /* Have to succeed matching what follows at least n times.
- After that, handle like `on_failure_jump'. */
- case succeed_n:
- EXTRACT_NUMBER (mcnt, p + OFFSET_ADDRESS_SIZE);
- DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
-
- assert (mcnt >= 0);
- /* Originally, this is how many times we HAVE to succeed. */
- if (mcnt > 0)
- {
- mcnt--;
- p += OFFSET_ADDRESS_SIZE;
- STORE_NUMBER_AND_INCR (p, mcnt);
-#ifdef _LIBC
- DEBUG_PRINT3 (" Setting %p to %d.\n", p - OFFSET_ADDRESS_SIZE,
- mcnt);
-#else
- DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p - OFFSET_ADDRESS_SIZE,
- mcnt);
-#endif
- }
- else if (mcnt == 0)
- {
-#ifdef _LIBC
- DEBUG_PRINT2 (" Setting two bytes from %p to no_op.\n",
- p + OFFSET_ADDRESS_SIZE);
-#else
- DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n",
- p + OFFSET_ADDRESS_SIZE);
-#endif
-
-#ifdef WCHAR
- p[1] = (UCHAR_T) no_op;
-#else
- p[2] = (UCHAR_T) no_op;
- p[3] = (UCHAR_T) no_op;
-#endif /* WCHAR */
- goto on_failure;
- }
- break;
-
- case jump_n:
- EXTRACT_NUMBER (mcnt, p + OFFSET_ADDRESS_SIZE);
- DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
-
- /* Originally, this is how many times we CAN jump. */
- if (mcnt)
- {
- mcnt--;
- STORE_NUMBER (p + OFFSET_ADDRESS_SIZE, mcnt);
-#ifdef _LIBC
- DEBUG_PRINT3 (" Setting %p to %d.\n", p + OFFSET_ADDRESS_SIZE,
- mcnt);
-#else
- DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p + OFFSET_ADDRESS_SIZE,
- mcnt);
-#endif
- goto unconditional_jump;
- }
- /* If don't have to jump any more, skip over the rest of command. */
- else
- p += 2 * OFFSET_ADDRESS_SIZE;
- break;
-
- case set_number_at:
- {
- 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
-PREFIX(group_match_null_string_p) (p, end, reg_info)
- UCHAR_T **p, *end;
- PREFIX(register_info_type) *reg_info;
-{
- int mcnt;
- /* Point to after the args to the start_memory. */
- UCHAR_T *p1 = *p + 2;
-
- while (p1 < end)
- {
- /* Skip over opcodes that can match nothing, and return true or
- false, as appropriate, when we get to one that can't, or to the
- matching stop_memory. */
-
- switch ((re_opcode_t) *p1)
- {
- /* Could be either a loop or a series of alternatives. */
- case on_failure_jump:
- p1++;
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-
- /* If the next operation is not a jump backwards in the
- pattern. */
-
- if (mcnt >= 0)
- {
- /* Go through the on_failure_jumps of the alternatives,
- seeing if any of the alternatives cannot match nothing.
- The last alternative starts with only a jump,
- whereas the rest start with on_failure_jump and end
- with a jump, e.g., here is the pattern for `a|b|c':
-
- /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
- /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
- /exactn/1/c
-
- So, we have to first go through the first (n-1)
- alternatives and then deal with the last one separately. */
-
-
- /* Deal with the first (n-1) alternatives, which start
- with an on_failure_jump (see above) that jumps to right
- past a jump_past_alt. */
-
- while ((re_opcode_t) p1[mcnt-(1+OFFSET_ADDRESS_SIZE)] ==
- jump_past_alt)
- {
- /* `mcnt' holds how many bytes long the alternative
- is, including the ending `jump_past_alt' and
- its number. */
-
- if (!PREFIX(alt_match_null_string_p) (p1, p1 + mcnt -
- (1 + OFFSET_ADDRESS_SIZE),
- reg_info))
- return false;
-
- /* Move to right after this alternative, including the
- jump_past_alt. */
- p1 += mcnt;
-
- /* Break if it's the beginning of an n-th alternative
- that doesn't begin with an on_failure_jump. */
- if ((re_opcode_t) *p1 != on_failure_jump)
- break;
-
- /* Still have to check that it's not an n-th
- alternative that starts with an on_failure_jump. */
- p1++;
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- if ((re_opcode_t) p1[mcnt-(1+OFFSET_ADDRESS_SIZE)] !=
- jump_past_alt)
- {
- /* Get to the beginning of the n-th alternative. */
- p1 -= 1 + OFFSET_ADDRESS_SIZE;
- break;
- }
- }
-
- /* Deal with the last alternative: go back and get number
- of the `jump_past_alt' just before it. `mcnt' contains
- the length of the alternative. */
- EXTRACT_NUMBER (mcnt, p1 - OFFSET_ADDRESS_SIZE);
-
- if (!PREFIX(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 (!PREFIX(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
-PREFIX(alt_match_null_string_p) (p, end, reg_info)
- UCHAR_T *p, *end;
- PREFIX(register_info_type) *reg_info;
-{
- int mcnt;
- UCHAR_T *p1 = p;
-
- while (p1 < end)
- {
- /* 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 (!PREFIX(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
-PREFIX(common_op_match_null_string_p) (p, end, reg_info)
- UCHAR_T **p, *end;
- PREFIX(register_info_type) *reg_info;
-{
- int mcnt;
- boolean ret;
- int reg_no;
- UCHAR_T *p1 = *p;
-
- switch ((re_opcode_t) *p1++)
- {
- 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 = PREFIX(group_match_null_string_p) (&p1, end, reg_info);
-
- /* Have to set this here in case we're checking a group which
- contains a group and a back reference to it. */
-
- if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE)
- REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret;
-
- if (!ret)
- return false;
- break;
-
- /* If this is an optimized succeed_n for zero times, make the jump. */
- case jump:
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- if (mcnt >= 0)
- p1 += mcnt;
- else
- return false;
- break;
-
- case succeed_n:
- /* Get to the number of times to succeed. */
- p1 += OFFSET_ADDRESS_SIZE;
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-
- if (mcnt == 0)
- {
- p1 -= 2 * OFFSET_ADDRESS_SIZE;
- EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- p1 += mcnt;
- }
- else
- return false;
- break;
-
- case duplicate:
- if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
- return false;
- break;
-
- case set_number_at:
- p1 += 2 * OFFSET_ADDRESS_SIZE;
-
- default:
- /* All other opcodes mean we cannot match the empty string. */
- return false;
- }
-
- *p = p1;
- return true;
-} /* common_op_match_null_string_p */
-
-
-/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
- bytes; nonzero otherwise. */
-
-static int
-PREFIX(bcmp_translate) (s1, s2, len, translate)
- const CHAR_T *s1, *s2;
- register int len;
- RE_TRANSLATE_TYPE translate;
-{
- register const UCHAR_T *p1 = (const UCHAR_T *) s1;
- register const UCHAR_T *p2 = (const UCHAR_T *) s2;
- while (len)
- {
-#ifdef WCHAR
- if (((*p1<=0xff)?translate[*p1++]:*p1++)
- != ((*p2<=0xff)?translate[*p2++]:*p2++))
- return 1;
-#else /* BYTE */
- if (translate[*p1++] != translate[*p2++]) return 1;
-#endif /* WCHAR */
- len--;
- }
- return 0;
-}
-
-
-#else /* not INSIDE_RECURSION */
-
-/* Entry points for GNU code. */
-
-/* re_compile_pattern is the GNU regular expression compiler: it
- 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;
-
-# ifdef MBS_SUPPORT
- if (MB_CUR_MAX != 1)
- ret = wcs_regex_compile (pattern, length, re_syntax_options, bufp);
- else
-# endif
- ret = byte_regex_compile (pattern, length, re_syntax_options, bufp);
-
- if (!ret)
- return NULL;
- return gettext (re_error_msgid[(int) ret]);
-}
-#ifdef _LIBC
-weak_alias (__re_compile_pattern, re_compile_pattern)
-#endif
-
-/* Entry points compatible with 4.2 BSD regex library. We don't define
- them unless specifically requested. */
-
-#if defined _REGEX_RE_COMP || defined _LIBC
-
-/* BSD has one and only one pattern buffer. */
-static struct re_pattern_buffer re_comp_buf;
-
-char *
-#ifdef _LIBC
-/* Make these definitions weak in libc, so POSIX programs can redefine
- these names if they don't use our functions, and still use
- regcomp/regexec below without link errors. */
-weak_function
-#endif
-re_comp (s)
- const char *s;
-{
- reg_errcode_t ret;
-
- if (!s)
- {
- if (!re_comp_buf.buffer)
- return gettext ("No previous regular expression");
- return 0;
- }
-
- if (!re_comp_buf.buffer)
- {
- re_comp_buf.buffer = (unsigned char *) malloc (200);
- if (re_comp_buf.buffer == NULL)
- return (char *) gettext (re_error_msgid[(int) REG_ESPACE]);
- re_comp_buf.allocated = 200;
-
- re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
- if (re_comp_buf.fastmap == NULL)
- return (char *) gettext (re_error_msgid[(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;
-
-# ifdef MBS_SUPPORT
- if (MB_CUR_MAX != 1)
- ret = wcs_regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
- else
-# endif
- ret = byte_regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
-
- if (!ret)
- return NULL;
-
- /* 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' 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.) */
-
-#ifdef __APPLE__
-__private_extern__
-#endif
-int
-regcomp (preg, pattern, cflags)
- regex_t *preg;
- const char *pattern;
- int cflags;
-{
- reg_errcode_t ret;
- reg_syntax_t syntax
- = (cflags & REG_EXTENDED) ?
- RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
-
- /* regex_compile will allocate the space for the compiled pattern. */
- preg->buffer = 0;
- preg->allocated = 0;
- preg->used = 0;
-
- /* Try to allocate space for the fastmap. */
- preg->fastmap = (char *) malloc (1 << BYTEWIDTH);
-
- if (cflags & REG_ICASE)
- {
- unsigned i;
-
- preg->translate
- = (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE
- * sizeof (*(RE_TRANSLATE_TYPE)0));
- if (preg->translate == NULL)
- return (int) REG_ESPACE;
-
- /* Map uppercase characters to corresponding lowercase ones. */
- for (i = 0; i < CHAR_SET_SIZE; i++)
- preg->translate[i] = ISUPPER (i) ? TOLOWER (i) : i;
- }
- else
- preg->translate = NULL;
-
- /* If REG_NEWLINE is set, newlines are treated differently. */
- if (cflags & REG_NEWLINE)
- { /* REG_NEWLINE implies neither . nor [^...] match newline. */
- syntax &= ~RE_DOT_NEWLINE;
- syntax |= RE_HAT_LISTS_NOT_NEWLINE;
- /* It also changes the matching behavior. */
- preg->newline_anchor = 1;
- }
- else
- preg->newline_anchor = 0;
-
- preg->no_sub = !!(cflags & REG_NOSUB);
-
- /* POSIX says a null character in the pattern terminates it, so we
- can use strlen here in compiling the pattern. */
-# ifdef MBS_SUPPORT
- if (MB_CUR_MAX != 1)
- ret = wcs_regex_compile (pattern, strlen (pattern), syntax, preg);
- else
-# endif
- ret = byte_regex_compile (pattern, strlen (pattern), syntax, preg);
-
- /* POSIX doesn't distinguish between an unmatched open-group and an
- unmatched close-group: both are REG_EPAREN. */
- if (ret == REG_ERPAREN) ret = REG_EPAREN;
-
- if (ret == REG_NOERROR && preg->fastmap)
- {
- /* Compute the fastmap now, since regexec cannot modify the pattern
- buffer. */
- if (re_compile_fastmap (preg) == -2)
- {
- /* Some error occured while computing the fastmap, just forget
- about it. */
- free (preg->fastmap);
- preg->fastmap = NULL;
- }
- }
-
- return (int) ret;
-}
-#ifdef _LIBC
-weak_alias (__regcomp, regcomp)
-#endif
-
-
-/* regexec searches for a given pattern, specified by PREG, in the
- string STRING.
-
- If NMATCH is zero or REG_NOSUB was set in the cflags argument to
- `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
- least NMATCH elements, and we set them to the offsets of the
- corresponding matched substrings.
-
- EFLAGS specifies `execution flags' which affect matching: if
- REG_NOTBOL is set, then ^ does not match at the beginning of the
- string; if REG_NOTEOL is set, then $ does not match at the end.
-
- We return 0 if we find a match and REG_NOMATCH if not. */
-
-#ifdef __APPLE__
-__private_extern__
-#endif
-int
-regexec (preg, string, nmatch, pmatch, eflags)
- const regex_t *preg;
- const char *string;
- size_t nmatch;
- regmatch_t pmatch[];
- int eflags;
-{
- int ret;
- struct re_registers regs;
- regex_t private_preg;
- int len = strlen (string);
- boolean want_reg_info = !preg->no_sub && nmatch > 0;
-
- private_preg = *preg;
-
- private_preg.not_bol = !!(eflags & REG_NOTBOL);
- private_preg.not_eol = !!(eflags & REG_NOTEOL);
-
- /* The user has told us exactly how many registers to return
- information about, via `nmatch'. We have to pass that on to the
- matching routines. */
- private_preg.regs_allocated = REGS_FIXED;
-
- if (want_reg_info)
- {
- regs.num_regs = nmatch;
- regs.start = TALLOC (nmatch * 2, regoff_t);
- if (regs.start == NULL)
- return (int) REG_NOMATCH;
- regs.end = regs.start + nmatch;
- }
-
- /* Perform the searching operation. */
- ret = re_search (&private_preg, string, len,
- /* start: */ 0, /* range: */ len,
- want_reg_info ? &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);
- }
-
- /* We want zero return to mean success, unlike `re_search'. */
- return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
-}
-#ifdef _LIBC
-weak_alias (__regexec, regexec)
-#endif
-
-
-/* Returns a message corresponding to an error code, ERRCODE, returned
- from either regcomp or regexec. We don't use PREG here. */
-
-size_t
-regerror (errcode, preg, errbuf, errbuf_size)
- int errcode;
- const regex_t *preg;
- char *errbuf;
- size_t errbuf_size;
-{
- const char *msg;
- size_t msg_size;
-
- if (errcode < 0
- || errcode >= (int) (sizeof (re_error_msgid)
- / 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)
- {
-#if defined HAVE_MEMPCPY || defined _LIBC
- *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
-#else
- memcpy (errbuf, msg, errbuf_size - 1);
- errbuf[errbuf_size - 1] = 0;
-#endif
- }
- else
- memcpy (errbuf, msg, msg_size);
- }
-
- return msg_size;
-}
-#ifdef _LIBC
-weak_alias (__regerror, regerror)
-#endif
-
-
-/* Free dynamically allocated space used by PREG. */
-
-#ifdef __APPLE__
-__private_extern__
-#endif
-void
-regfree (preg)
- regex_t *preg;
-{
- if (preg->buffer != NULL)
- free (preg->buffer);
- preg->buffer = NULL;
-
- preg->allocated = 0;
- preg->used = 0;
-
- if (preg->fastmap != NULL)
- free (preg->fastmap);
- preg->fastmap = NULL;
- preg->fastmap_accurate = 0;
-
- if (preg->translate != NULL)
- free (preg->translate);
- preg->translate = NULL;
-}
-#ifdef _LIBC
-weak_alias (__regfree, regfree)
-#endif
-
-#endif /* not emacs */
-
-#endif /* not INSIDE_RECURSION */
-
-#undef STORE_NUMBER
-#undef STORE_NUMBER_AND_INCR
-#undef EXTRACT_NUMBER
-#undef EXTRACT_NUMBER_AND_INCR
-
-#undef DEBUG_PRINT_COMPILED_PATTERN
-#undef DEBUG_PRINT_DOUBLE_STRING
-
-#undef INIT_FAIL_STACK
-#undef RESET_FAIL_STACK
-#undef DOUBLE_FAIL_STACK
-#undef PUSH_PATTERN_OP
-#undef PUSH_FAILURE_POINTER
-#undef PUSH_FAILURE_INT
-#undef PUSH_FAILURE_ELT
-#undef POP_FAILURE_POINTER
-#undef POP_FAILURE_INT
-#undef POP_FAILURE_ELT
-#undef DEBUG_PUSH
-#undef DEBUG_POP
-#undef PUSH_FAILURE_POINT
-#undef POP_FAILURE_POINT
-
-#undef REG_UNSET_VALUE
-#undef REG_UNSET
-
-#undef PATFETCH
-#undef PATFETCH_RAW
-#undef PATUNFETCH
-#undef TRANSLATE
-
-#undef INIT_BUF_SIZE
-#undef GET_BUFFER_SPACE
-#undef BUF_PUSH
-#undef BUF_PUSH_2
-#undef BUF_PUSH_3
-#undef STORE_JUMP
-#undef STORE_JUMP2
-#undef INSERT_JUMP
-#undef INSERT_JUMP2
-#undef EXTEND_BUFFER
-#undef GET_UNSIGNED_NUMBER
-#undef FREE_STACK_RETURN
-
-#undef POINTER_TO_OFFSET
-#undef MATCHING_IN_FRST_STRING
-#undef PREFETCH
-#undef AT_STRINGS_BEG
-#undef AT_STRINGS_END
-#undef WORDCHAR_P
-#undef FREE_VAR
-#undef FREE_VARIABLES
-#undef NO_HIGHEST_ACTIVE_REG
-#undef NO_LOWEST_ACTIVE_REG
-
-#undef CHAR_T
-#undef UCHAR_T
-#undef COMPILED_BUFFER_VAR
-#undef OFFSET_ADDRESS_SIZE
-#undef CHAR_CLASS_SIZE
-#undef PREFIX
-#undef ARG_PREFIX
-#undef PUT_CHAR
-#undef BYTE
-#undef WCHAR
-
-#define DEFINED_ONCE
diff --git a/regex.h b/regex.h
index 955fa04e..3794051d 100644
--- a/regex.h
+++ b/regex.h
@@ -1,20 +1,23 @@
/* Definitions for data structures and routines for the regular
- expression library, version 0.12.
- Copyright (C) 1985,89,90,91,92,93,95,96,97,98,2002 Free Software Foundation, Inc.
+ 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 _REGEX_H
#define _REGEX_H 1
@@ -156,6 +159,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 +189,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 +208,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 +231,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 \
@@ -509,13 +523,37 @@ 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,
+extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,
+ const char *__restrict __pattern,
int __cflags));
-extern int regexec _RE_ARGS ((const regex_t *__preg,
- const char *__string, size_t __nmatch,
- regmatch_t __pmatch[], int __eflags));
+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));
diff --git a/regex_internal.c b/regex_internal.c
new file mode 100644
index 00000000..72cb7c06
--- /dev/null
+++ b/regex_internal.c
@@ -0,0 +1,1266 @@
+/* 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/regex_internal.h b/regex_internal.h
new file mode 100644
index 00000000..6e81710e
--- /dev/null
+++ b/regex_internal.h
@@ -0,0 +1,753 @@
+/* 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/regexec.c b/regexec.c
new file mode 100644
index 00000000..841218e7
--- /dev/null
+++ b/regexec.c
@@ -0,0 +1,3983 @@
+/* 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/stamp-h.in b/stamp-h.in
deleted file mode 100644
index 9788f702..00000000
--- a/stamp-h.in
+++ /dev/null
@@ -1 +0,0 @@
-timestamp
diff --git a/test/ChangeLog b/test/ChangeLog
index 10fc85a8..3da3d663 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,227 @@
+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.
+
+Wed Mar 19 14:00:00 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (synerr1): New test.
+ * synerr1.awk, synerr1.ok: New files.
+
+Tue Mar 4 10:32:23 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (clean): Remove `core*' for modern Linux which
+ drops core in `core.PID' files.
+
+2003-02-17 Jim Meyering <jim@meyering.net>
+
+ * Makefile.am (check): Don't depend on the pass-fail rule that
+ reports any failures. Otherwise, `make -j' that rule's commands
+ could run before all tests had completed, resulting in spurious
+ failures or potentially, even unreported failures. Instead, just
+ `$(MAKE) pass-fail'.
+
+Sun Feb 9 11:48:32 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am: Moved `space' into UNIX_TESTS. Breaks in
+ MS environments.
+
+Tue Feb 4 14:28:06 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ All relevant files: Copyright year updated to 2003.
+
+Tue Feb 4 12:22:41 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (fnmisc): New test case.
+ * fnmisc.awk, fnmisc.ok: New files.
+
+Sun Feb 2 15:33:33 2003 Stepan Kasal <kasal@math.cas.cz>
+
+ * getline3.awk, getline3.ok: Renamed from getline2.awk, getline2.ok
+ * Makefile.am (getline, getline2): getline renamed to getline2,
+ new test under the name getline.
+ * getline.awk, getline.ok, getline2.awk, getline2.ok:
+ rename getline.* getline2.*; new files getline.* .
+ * getline.awk, getline.ok: add tests for ``cmd | getline ''
+ * Makefile.am (printf0): New test.
+ * printf0.awk, printf0.ok: New files.
+ * fnarray.ok: The error message has changed.
+
+Thu Jan 30 15:32:56 2003 Stepan Kasal <kasal@math.cas.cz>
+
+ * Makefile.am (splitarr, getline2, inputred, prec): New tests.
+ * splitarr.awk, splitarr.ok: New files.
+ * getline2.awk, getline2.ok: New files.
+ * inputred.awk, inputred.ok: New files.
+ * prec.awk, prec.ok: New files.
+ * noeffect.awk: add second no-effect command; two error messages
+ should be generated. Add some empty statements, to check that --lint
+ doesn't abort on them.
+
+Tue Jan 28 18:34:22 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * arrymem1.awk: Enhanced test.
+ * arrayme1.ok: Updated for new output
+
+Mon Jan 27 14:07:16 2003 Stepan Kasal <kasal@math.cas.cz>
+
+ * nfldstr.awk: Add tests for automatic number conversion.
+
+Mon Jan 27 12:25:41 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (asort, asorti, match1): New tests.
+ * match1.awk, match1.in: New files.
+ * asort.awk, asort.in: New files.
+ * asorti.awk, asorti.in: New files.
+
+Mon Jan 27 12:10:16 2003 Stepan Kasal <kasal@math.cas.cz>
+
+ * strtod.awk, strtod.in, strtod.ok: Added test for 0e0 and similar.
+
+Sun Jan 26 16:49:41 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (zeroe0): New test.
+ * zeroe0.awk, zeroe0.in: New files.
+
+Thu Jan 2 11:09:12 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ * parseme.ok, noparms.ok: Revised for bison 1.875.
+
+Tue Dec 31 16:54:44 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am: (poundbang): Fix code.
+ (efence): New target to remove _* files run with Electric Fence
+ but that are otherwise OK.
+
+Thu Dec 26 16:44:37 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (poundbang): Add code to handle systems with limits on
+ paths for #! files.
+
+Mon Dec 9 14:20:44 2002 Stepan Kasal <kasal@math.cas.cz>
+
+ * Makefile.am (space): New test: ``gawk -f " " file'' should try
+ to include file ` '.
+
+Sun Nov 17 21:47:11 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (manyfiles): Reference $(srcdir)/$@.ok so can build
+ and test in a different directory.
+
+Sun Nov 3 14:47:59 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ Move tests with inline input and/or programs into separate files so can let
+ Gentests do more work. Per Nelson Beebe, just print the name of each test.
+
+ * Makefile.am (fstabplus, longwrds, fieldwdth, ignrcase, posix, rs, fsbs):
+ removed targets so will be generated by Gentests.
+ (negexp, resplit, childin, back89, nfldstr, nondec): ditto.
+ * Gentests: print name of test, make cmp not echo by prefixing with @.
+ * fstabplus.in: new file.
+ * fieldwdth.awk, fieldwdth.in: new files.
+ * ignrcase.awk, ignrcase.in: new files.
+ * longwrds.awk: send output to sort instead of letting makefile do it.
+ * longwrds.in: renamed from manpage.
+ * posix.in: new file.
+ * manyfiles.ok: new file.
+ * rs.awk: new file.
+ * fsbs.awk: new file.
+ * negexp.awk: new file.
+ * resplit.awk, resplit.in: new files.
+ * childin.awk, childin.in: new files.
+ * back89.awk: new file.
+ * nfldstr.awk, nfldstr.in: new files.
+
+Sun Nov 3 14:37:39 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (uninit2): new test case, requires lint.
+ * uninit2.awk, uninit2.ok: new files.
+
+Fri Nov 1 11:34:45 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (nondec): Always run this test.
+
+Tue Oct 29 10:40:47 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (EXTRA_DIST): Added Gentests to list of files
+ to distribute.
+
+Mon Oct 28 15:36:42 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (icasers, icasefs, rstest1, rstest2): new test cases.
+ (argarray): Remove argarray.in if not in srcdir.
+ * icasers.awk, icasers.in, icasers.ok: new files.
+ * icasefs.awk, icasefs.ok: new files.
+ * rstest1.awk, rstest1.ok: new files.
+ * rstest2.awk, rstest2.ok: new files.
+
+Mon Oct 28 12:25:25 2002 Stepan Kasal <kasal@math.cas.cz>
+
+ * Makefile.am (uninitialized): New test.
+ * uninitialized.awk, uninitialized.ok: New files.
+
+Mon Oct 28 11:24:16 2002 Stepan Kasal <kasal@math.cas.cz>
+
+ * Gentests: new script
+ * Maketests: new file, generated automatically by Gentests
+ * Makefile.am: new rules and variables to make use of Gentests;
+ Most targets removed, Gentests will take care
+
+Sun Oct 13 16:58:07 2002 Stepan Kasal <kasal@math.cas.cz>
+
+ * Makefile.am (nfneg): new test case.
+ * nfneg.awk, nfneg.ok: new files.
+
+Mon Oct 7 09:38:07 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (noloop1, noloop2): new test cases.
+ * noloop.awk, noloop1.in, noloop1.ok, noloop2.in, noloop2.ok:
+ new files.
+
+Tue Oct 1 18:28:40 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (poundbang): Rewrote rule to avoid problems
+ with hardcoding of /tmp pathname.
+ (poundbang.awk): Changed the way it works.
+ (poundbang.ok): Removed.
+
+Thu Sep 5 13:31:28 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (rebuf): new test case.
+ * rebuf.awk, rebuf.in, rebuf.ok: new files.
+
+Wed Aug 21 15:31:57 2002 Andreas Buening <andreas.buening@nexgo.de>
+
+ * Makefile.am (AWKPROG): Add $(EXEEXT) macro.
+ (PATH_SEPERATOR): Removed.
+ (poundbag): Added $(EXEEXT) and use of ${TMPDIR-/tmp}.
+
+Wed Aug 7 13:47:09 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (nulrsend): new test case.
+ * nulrsend.awk, nulrsend.in, nulrsend.ok: new files.
+
+Sun Aug 4 00:25:23 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (gsubtst3, gsubtst4): new test cases.
+ * gsubtst3.awk, gsubtst3.ok, gsubtst4.awk, gsubtst4.ok: new files.
+
+Thu May 9 22:31:36 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (gsubtst2): new test case.
+ * gsubtest.awk, gsubtest.ok: Added new test.
+ * gsubtst2.awk, gsubtst2.ok: new files.
+
+Sun May 5 12:38:55 2002 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am: Minor mods to use LC_ALL=C so that checks will
+ use the English messages, not any translations.
+ (manyfiles): Fixed (hopefully) to leave a file around if the
+ test fails, so that we don't get a spurious "ALL TESTS PASSED"
+ message.
+
Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.1: Release tar file made.
diff --git a/test/Gentests b/test/Gentests
new file mode 100755
index 00000000..10401ddf
--- /dev/null
+++ b/test/Gentests
@@ -0,0 +1,92 @@
+#!/usr/bin/gawk -f
+
+# This program should generate Maketests
+
+BEGIN {
+ # read the list of files
+ for (i = 2; i < ARGC; i++)
+ files[ARGV[i]]
+
+ # throw it away
+ ARGC = 2
+
+ ntests = 0
+}
+
+# process the file Makefile.am:
+
+/^[A-Z_]*_TESTS *=/,/[^\\]$/ {
+ gsub(/(^[A-Z_]*_TESTS *=|\\$)/,"")
+ for (i = 1; i <= NF; i++)
+ tests[++ntests] = $i
+ next
+}
+
+/^NEED_LINT *=/,/[^\\]$/ {
+ gsub(/(^NEED_LINT *=|\\$)/,"")
+ for (i = 1; i <= NF; i++)
+ lint[$i]
+ next
+}
+
+/^GENTESTS_UNUSED *=/,/[^\\]$/ {
+ gsub(/(^GENTESTS_UNUSED *=|\\$)/,"")
+ for (i = 1; i <= NF; i++)
+ unused[$i]
+ next
+}
+
+/^[a-zA-Z][a-zA-Z0-9]*:/ {
+ # remember all targets from Makefile.am
+ sub(/:.*/,"")
+ targets[$0]
+}
+
+# Now write the output file:
+END {
+ # this line tells automake to keep the comment with the rules:
+ print "Gt-dummy:"
+ print "# file Maketests, generated from Makefile.am by the Gentests program"
+
+ for (i = 1; i <= ntests; i++) {
+ x = tests[i]
+ if (!(x in targets))
+ generate(x)
+ }
+
+ print "# end of file Maketests"
+}
+
+function generate(x, s)
+{
+ if (!(x".awk" in files))
+ printf "WARNING: file `%s.awk' not found.\n", x > "/dev/stderr"
+ else
+ delete files[x".awk"]
+
+ print x ":"
+
+ s = ""
+ if (x in lint) {
+ s = s " --lint"
+ delete lint[x]
+ }
+ if (x".in" in files) {
+ s = s " < $(srcdir)/$@.in"
+ delete files[x".in"]
+ }
+
+ printf "\t@echo %s\n", x
+ printf "\t@AWKPATH=$(srcdir) $(AWK) -f $@.awk %s >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@\n", s
+ printf "\t@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@\n\n"
+}
+
+END {
+ for (x in lint)
+ if (!(x in targets))
+ printf "WARNING: --lint target `%s' is missing.\n", x > "/dev/stderr"
+ for (x in files)
+ if (!(x in unused) && \
+ !(gensub(/\.(awk|in)$/,"","",x) in targets))
+ printf "WARNING: unused file `%s'.\n", x > "/dev/stderr"
+}
diff --git a/test/Makefile.am b/test/Makefile.am
index be4acada..fb0917b4 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,7 +1,7 @@
#
# test/Makefile.am --- automake input file for gawk
#
-# Copyright (C) 1988-2002 the Free Software Foundation, Inc.
+# Copyright (C) 1988-2003 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
@@ -26,6 +26,8 @@
EXTRA_DIST = \
reg \
lib \
+ Gentests \
+ Maketests \
README \
addcomma.awk \
addcomma.in \
@@ -54,13 +56,20 @@ EXTRA_DIST = \
asgext.awk \
asgext.in \
asgext.ok \
+ asort.awk \
+ asort.ok \
+ asorti.awk \
+ asorti.ok \
awkpath.ok \
+ back89.awk \
back89.in \
back89.ok \
backgsub.awk \
backgsub.in \
backgsub.ok \
badargs.ok \
+ childin.awk \
+ childin.in \
childin.ok \
clobber.awk \
clobber.ok \
@@ -92,6 +101,8 @@ EXTRA_DIST = \
eofsplit.ok \
fflush.ok \
fflush.sh \
+ fieldwdth.awk \
+ fieldwdth.in \
fieldwdth.ok \
fldchg.awk \
fldchg.in \
@@ -111,10 +122,13 @@ EXTRA_DIST = \
fnasgnm.awk \
fnasgnm.in \
fnasgnm.ok \
+ fnmisc.awk \
+ fnmisc.ok \
fnparydl.awk \
fnparydl.ok \
forsimp.awk \
forsimp.ok \
+ fsbs.awk \
fsbs.in \
fsbs.ok \
fsfwfs.awk \
@@ -124,6 +138,7 @@ EXTRA_DIST = \
fsrs.in \
fsrs.ok \
fstabplus.awk \
+ fstabplus.in \
fstabplus.ok \
funsemnl.awk \
funsemnl.ok \
@@ -136,7 +151,12 @@ EXTRA_DIST = \
gensub.in \
gensub.ok \
getline.awk \
+ getline.in \
getline.ok \
+ getline2.awk \
+ getline2.ok \
+ getline3.awk \
+ getline3.ok \
getlnbuf.awk \
getlnbuf.in \
getlnbuf.ok \
@@ -156,18 +176,34 @@ EXTRA_DIST = \
gsubasgn.ok \
gsubtest.awk \
gsubtest.ok \
+ gsubtst2.awk \
+ gsubtst2.ok \
+ gsubtst3.awk \
+ gsubtst3.in \
+ gsubtst3.ok \
+ gsubtst4.awk \
+ gsubtst4.ok \
gtlnbufv.awk \
hsprint.awk \
hsprint.ok \
+ icasefs.awk \
+ icasefs.ok \
+ icasers.awk \
+ icasers.in \
+ icasers.ok \
igncdym.awk \
igncdym.in \
igncdym.ok \
igncfs.awk \
igncfs.in \
igncfs.ok \
+ ignrcase.awk \
+ ignrcase.in \
ignrcase.ok \
inftest.awk \
inftest.ok \
+ inputred.awk \
+ inputred.ok \
intest.awk \
intest.ok \
intprec.awk \
@@ -186,8 +222,11 @@ EXTRA_DIST = \
longsub.ok \
longwrds.awk \
longwrds.ok \
- manpage \
+ longwrds.in \
manyfiles.awk \
+ manyfiles.ok \
+ match1.awk \
+ match1.ok \
math.awk \
math.ok \
membug1.awk \
@@ -201,8 +240,13 @@ EXTRA_DIST = \
nasty.ok \
nasty2.awk \
nasty2.ok \
+ negexp.awk \
negexp.ok \
+ nfldstr.awk \
+ nfldstr.in \
nfldstr.ok \
+ nfneg.awk \
+ nfneg.ok \
nfset.awk \
nfset.in \
nfset.ok \
@@ -218,6 +262,12 @@ EXTRA_DIST = \
noeffect.ok \
nofmtch.awk \
nofmtch.ok \
+ noloop1.awk \
+ noloop1.in \
+ noloop1.ok \
+ noloop2.awk \
+ noloop2.in \
+ noloop2.ok \
nondec.awk \
nondec.ok \
nonl.awk \
@@ -226,6 +276,9 @@ EXTRA_DIST = \
noparms.ok \
nors.in \
nors.ok \
+ nulrsend.awk \
+ nulrsend.in \
+ nulrsend.ok \
numindex.awk \
numindex.in \
numindex.ok \
@@ -273,12 +326,16 @@ EXTRA_DIST = \
pipeio2.in \
pipeio2.ok \
posix.awk \
+ posix.in \
posix.ok \
poundbang.awk \
- poundbang.ok \
prdupval.awk \
prdupval.in \
prdupval.ok \
+ prec.awk \
+ prec.ok \
+ printf0.awk \
+ printf0.ok \
printf1.awk \
printf1.ok \
printfloat.awk \
@@ -309,6 +366,9 @@ EXTRA_DIST = \
regtest.sh \
regx8bit.awk \
regx8bit.ok \
+ rebuf.awk \
+ rebuf.in \
+ rebuf.ok \
reindops.awk \
reindops.in \
reindops.ok \
@@ -318,12 +378,19 @@ EXTRA_DIST = \
reparse.awk \
reparse.in \
reparse.ok \
+ resplit.awk \
+ resplit.in \
resplit.ok \
+ rs.awk \
rs.in \
rs.ok \
rsnul1nl.awk \
rsnul1nl.in \
rsnul1nl.ok \
+ rstest1.awk \
+ rstest1.ok \
+ rstest2.awk \
+ rstest2.ok \
rswhite.awk \
rswhite.in \
rswhite.ok \
@@ -335,9 +402,12 @@ EXTRA_DIST = \
shadow.ok \
sort1.awk \
sort1.ok \
+ space.ok \
splitargv.awk \
splitargv.in \
splitargv.ok \
+ splitarr.awk \
+ splitarr.ok \
splitdef.awk \
splitdef.ok \
splitvar.awk \
@@ -361,56 +431,84 @@ EXTRA_DIST = \
swaplns.awk \
swaplns.in \
swaplns.ok \
+ synerr1.awk \
+ synerr1.ok \
tradanch.awk \
tradanch.in \
tradanch.ok \
tweakfld.awk \
tweakfld.in \
tweakfld.ok \
+ uninitialized.awk \
+ uninitialized.ok \
+ uninit2.awk \
+ uninit2.ok \
+ zeroe0.awk \
+ zeroe0.ok \
zeroflag.awk \
zeroflag.ok
-CMP = cmp
-AWK = ../gawk
+# try to keep these sorted
+BASIC_TESTS = addcomma anchgsub argarray arrayparm arrayref arrymem1 arynasty \
+ arynocls arysubnm asgext awkpath back89 backgsub childin clobber \
+ clsflnam compare compare2 concat1 convfmt datanonl defref delarprm \
+ dynlj eofsplit fldchg fldchgnf fnamedat fnarray fnarydel fnaryscl \
+ fnasgnm fnmisc fnparydl forsimp fsbs fsrs fstabplus funsemnl funsmnam \
+ funstack getline getline2 getline3 getlnbuf getnr2tb getnr2tm gsubasgn gsubtest \
+ gsubtst2 gsubtst3 gsubtst4 hsprint inputred intest intprec leaddig leadnl \
+ litoct longsub longwrds math membug1 messages minusstr mmap8k \
+ nasty nasty2 negexp nfldstr nfneg nfset nlfldsep nlinstr nlstrina \
+ noeffect nofmtch noloop1 noloop2 nonl noparms nors nulrsend \
+ numindex numsubstr octsub ofmt ofmtbig ofmtfidl ofmts onlynl \
+ opasnidx opasnslf paramdup paramtyp parseme pcntplus prdupval prec \
+ printf0 printf1 prmarscl prmreuse prt1eval prtoeval psx96sub rand rebt8b1 \
+ rebt8b2 redfilnm regeq reindops reparse resplit rs rsnul1nl \
+ rstest1 rstest2 rswhite sclforin sclifin splitargv splitarr splitdef \
+ splitvar splitwht sprintfc strtod subslash substr swaplns synerr1 \
+ tradanch tweakfld uninitialized uninit2 zeroe0 zeroflag
+
+UNIX_TESTS = fflush getlnhd pid pipeio1 pipeio2 poundbang space strftlng
+
+GAWK_EXT_TESTS = argtest asort asorti badargs clos1way fieldwdth fsfwfs \
+ gensub gnuops2 gnureops icasefs icasers igncdym igncfs ignrcase lint \
+ match1 manyfiles nondec posix procinfs regx8bit rebuf reint shadow \
+ sort1 strftime
+
+EXTRA_TESTS = regtest inftest
+
+INET_TESTS = inetechu inetecht inetdayu inetdayt
+
+# List of the tests which should be run with --lint option:
+NEED_LINT = defref noeffect nofmtch shadow uninitialized uninit2
+
+# List of the files that appear in manual tests or are for reserve testing:
+GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk
-# Special stuff for OS/2
-PATH_SEPARATOR = @PATH_SEPARATOR@
+CMP = cmp
+AWKPROG = ../gawk$(EXEEXT)
+AWK = LC_ALL=C $(AWKPROG)
-# message stuff is to make it a little easier to follow
+# Message stuff is to make it a little easier to follow.
+# Make the pass-fail last and dependent on others to avoid
+# spurious errors if `make -j' in effect.
check: msg \
basic-msg-start basic basic-msg-end \
unix-msg-start unix-tests unix-msg-end \
- extend-msg-start gawk-extensions extend-msg-end \
- pass-fail
+ extend-msg-start gawk-extensions extend-msg-end
+ @$(MAKE) pass-fail
-# try to keep these sorted
-basic: addcomma anchgsub argarray arrayparm arrayref arynasty arynocls \
- arysubnm arrymem1 asgext awkpath back89 backgsub childin clobber \
- clsflnam compare compare2 concat1 convfmt datanonl defref delarprm dynlj eofsplit \
- fldchg fldchgnf fnamedat fnarray fnarydel fnaryscl fnasgnm \
- fnparydl forsimp fsbs fsrs fstabplus funsemnl funsmnam funstack getline \
- getlnbuf getnr2tb getnr2tm gsubasgn gsubtest hsprint intest \
- intprec leaddig leadnl litoct longsub longwrds math membug1 messages minusstr \
- mmap8k nasty nasty2 negexp nfldstr nfset nlfldsep nlinstr nlstrina \
- noeffect nofmtch nonl noparms nors numindex numsubstr octsub \
- ofmt ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf paramdup paramtyp \
- parseme pcntplus prdupval printf1 prmarscl prmreuse prt1eval \
- prtoeval psx96sub rand rebt8b1 rebt8b2 redfilnm regeq reindops \
- reparse resplit rs rsnul1nl rswhite sclforin sclifin splitargv \
- splitdef splitvar splitwht sprintfc strtod subslash substr \
- swaplns tradanch tweakfld zeroflag
-
-unix-tests: fflush getlnhd pid pipeio1 pipeio2 poundbang strftlng
-
-gawk-extensions: argtest badargs clos1way fieldwdth fsfwfs gensub \
- gnuops2 gnureops igncdym igncfs ignrcase lint manyfiles nondec \
- posix procinfs regx8bit reint shadow sort1 strftime
-
-extra: regtest inftest inet
-
-inet: inetmesg inetechu inetecht inetdayu inetdayt
+basic: $(BASIC_TESTS)
+
+unix-tests: $(UNIX_TESTS)
+
+gawk-extensions: $(GAWK_EXT_TESTS)
+
+extra: $(EXTRA_TESTS) inet
+
+inet: inetmesg $(INET_TESTS)
msg::
+ @echo ''
@echo 'Any output from "cmp" is bad news, although some differences'
@echo 'in floating point values are probably benign -- in particular,'
@echo 'some systems may omit a leading zero and the floating point'
@@ -436,57 +534,40 @@ extend-msg-end:
# This test is a PITA because increasingly, /tmp is getting
-# mounted noexec. So, we'll test it. Sigh.
+# mounted noexec. So, we'll test it locally. Sigh.
+#
+# More PITA; some systems have medium short limits on #! paths,
+# so this can still fail
poundbang::
- @cp $(AWK) /tmp/gawk
- @if /tmp/gawk 'BEGIN { print "OK" }' | grep OK > /dev/null ; \
- then \
- $(srcdir)/poundbang.awk $(srcdir)/poundbang.awk >_`basename $@` ; \
- $(CMP) $(srcdir)/poundbang.ok _`basename $@` && rm -f _`basename $@` && echo poundbang is ok ; \
+ @echo $@
+ @sed "s;/tmp/gawk;`pwd`/$(AWKPROG);" < $(srcdir)/poundbang.awk > ./_pbd.awk
+ @chmod +x ./_pbd.awk
+ @if ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@` ; \
+ then : ; \
else \
- echo "*** /tmp is apparently mounted noexec, skipping poundbang test." ; \
+ sed "s;/tmp/gawk;../$(AWKPROG);" < $(srcdir)/poundbang.awk > ./_pbd.awk ; \
+ chmod +x ./_pbd.awk ; \
+ ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@`; \
fi
- @rm -f /tmp/gawk
-
-swaplns::
- @$(AWK) -f $(srcdir)/swaplns.awk $(srcdir)/swaplns.in >_$@
- -$(CMP) $(srcdir)/swaplns.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/poundbang.awk _`basename $@` && rm -f _`basename $@` _pbd.awk
messages::
+ @echo $@
@$(AWK) -f $(srcdir)/messages.awk >out2 2>out3
- -$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3
+ @-$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3
argarray::
+ @echo $@
@case $(srcdir) in \
.) : ;; \
*) cp $(srcdir)/argarray.in . ;; \
esac
@TEST=test echo just a test | $(AWK) -f $(srcdir)/argarray.awk ./argarray.in - >_$@
- -$(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@
-
-fstabplus::
- @echo '1 2' | $(AWK) -f $(srcdir)/fstabplus.awk >_$@
- -$(CMP) $(srcdir)/fstabplus.ok _$@ && rm -f _$@
-
-fsrs::
- @$(AWK) -f $(srcdir)/fsrs.awk $(srcdir)/fsrs.in >_$@
- -$(CMP) $(srcdir)/fsrs.ok _$@ && rm -f _$@
-
-igncfs::
- @$(AWK) -f $(srcdir)/igncfs.awk $(srcdir)/igncfs.in >_$@
- -$(CMP) $(srcdir)/igncfs.ok _$@ && rm -f _$@
-
-longwrds::
- @$(AWK) -f $(srcdir)/longwrds.awk $(srcdir)/manpage | (LC_ALL=C sort) >_$@
- -$(CMP) $(srcdir)/longwrds.ok _$@ && rm -f _$@
-
-fieldwdth::
- @echo '123456789' | $(AWK) -v FIELDWIDTHS="2 3 4" '{ print $$2}' >_$@
- -$(CMP) $(srcdir)/fieldwdth.ok _$@ && rm -f _$@
-
-ignrcase::
- @echo xYz | $(AWK) -v IGNORECASE=1 '{ sub(/y/, ""); print}' >_$@
- -$(CMP) $(srcdir)/ignrcase.ok _$@ && rm -f _$@
+ @case $(srcdir) in \
+ .) : ;; \
+ *) rm -f ./argarray.in ;; \
+ esac
+ @-$(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@
regtest::
@echo 'Some of the output from regtest is very system specific, do not'
@@ -494,473 +575,142 @@ regtest::
@echo 'Manual inspection is called for.'
AWK=`pwd`/$(AWK) $(srcdir)/regtest.sh
-posix::
- @echo '1:2,3 4' | $(AWK) -f $(srcdir)/posix.awk >_$@
- -$(CMP) $(srcdir)/posix.ok _$@ && rm -f _$@
-
manyfiles::
+ @echo manyfiles
@rm -rf junk
@mkdir junk
@$(AWK) 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >_$@
@$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@
- @echo "This number better be 1 ->" | tr -d '\012\015'
- @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l
- @rm -rf junk _$@
+ @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l | sed 's/ *//g' > _$@
+ @rm -rf junk ; $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
compare::
+ @echo $@
@$(AWK) -f $(srcdir)/compare.awk 0 1 $(srcdir)/compare.in >_$@
- -$(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@
-
-arrayref::
- @$(AWK) -f $(srcdir)/arrayref.awk >_$@
- -$(CMP) $(srcdir)/arrayref.ok _$@ && rm -f _$@
-
-rs::
- @$(AWK) -v RS="" '{ print $$1, $$2}' $(srcdir)/rs.in >_$@
- -$(CMP) $(srcdir)/rs.ok _$@ && rm -f _$@
-
-fsbs::
- @$(AWK) -v FS='\' '{ print $$1, $$2 }' $(srcdir)/fsbs.in >_$@
- -$(CMP) $(srcdir)/fsbs.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@
inftest::
+ @echo $@
@echo This test is very machine specific...
@$(AWK) -f $(srcdir)/inftest.awk | sed 's/inf/Inf/g' >_$@
- -$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@
-
-getline::
- @$(AWK) -f $(srcdir)/getline.awk $(srcdir)/getline.awk $(srcdir)/getline.awk >_$@
- -$(CMP) $(srcdir)/getline.ok _$@ && rm -f _$@
-
-rand::
- @$(AWK) -f $(srcdir)/rand.awk >_$@
- -$(CMP) $(srcdir)/rand.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@
-negexp::
- @$(AWK) 'BEGIN { a = -2; print 10^a }' >_$@
- -$(CMP) $(srcdir)/negexp.ok _$@ && rm -f _$@
-
-asgext::
- @$(AWK) -f $(srcdir)/asgext.awk $(srcdir)/asgext.in >_$@
- -$(CMP) $(srcdir)/asgext.ok _$@ && rm -f _$@
-
-anchgsub::
- @$(AWK) -f $(srcdir)/anchgsub.awk $(srcdir)/anchgsub.in >_$@
- -$(CMP) $(srcdir)/anchgsub.ok _$@ && rm -f _$@
-
-splitargv::
- @$(AWK) -f $(srcdir)/splitargv.awk $(srcdir)/splitargv.in >_$@
- -$(CMP) $(srcdir)/splitargv.ok _$@ && rm -f _$@
+getline2::
+ @echo $@
+ @$(AWK) -f $(srcdir)/getline2.awk $(srcdir)/getline2.awk $(srcdir)/getline2.awk >_$@
+ @-$(CMP) $(srcdir)/getline2.ok _$@ && rm -f _$@
awkpath::
+ @echo $@
@AWKPATH="$(srcdir)$(PATH_SEPARATOR)$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@
- -$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@
-
-nfset::
- @$(AWK) -f $(srcdir)/nfset.awk $(srcdir)/nfset.in >_$@
- -$(CMP) $(srcdir)/nfset.ok _$@ && rm -f _$@
-
-reparse::
- @$(AWK) -f $(srcdir)/reparse.awk $(srcdir)/reparse.in >_$@
- -$(CMP) $(srcdir)/reparse.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@
argtest::
+ @echo $@
@$(AWK) -f $(srcdir)/argtest.awk -x -y abc >_$@
- -$(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@
badargs::
+ @echo $@
@-$(AWK) -f 2>&1 | grep -v patchlevel >_$@
- -$(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@
-
-convfmt::
- @$(AWK) -f $(srcdir)/convfmt.awk >_$@
- -$(CMP) $(srcdir)/convfmt.ok _$@ && rm -f _$@
-
-arrayparm::
- @-AWKPATH=$(srcdir) $(AWK) -f arrayparm.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/arrayparm.ok _$@ && rm -f _$@
-
-paramdup::
- @-AWKPATH=$(srcdir) $(AWK) -f paramdup.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/paramdup.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@
nonl::
+ @echo $@
@-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1
- -$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@
-
-defref::
- @-AWKPATH=$(srcdir) $(AWK) --lint -f defref.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/defref.ok _$@ && rm -f _$@
-
-nofmtch::
- @-AWKPATH=$(srcdir) $(AWK) --lint -f nofmtch.awk >_$@ 2>&1
- -$(CMP) $(srcdir)/nofmtch.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@
strftime::
- : this test could fail on slow machines or on a second boundary,
- : so if it does, double check the actual results
+ @echo This test could fail on slow machines or on a second boundary,
+ @echo so if it does, double check the actual results:
+ @echo $@
@LC_ALL=C; export LC_ALL; LANG=C; export LANG; \
TZ=GMT0; export TZ; \
date | $(AWK) -v OUTPUT=_$@ -f $(srcdir)/strftime.awk
- -$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0
+ @-$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0
litoct::
+ @echo $@
@echo ab | $(AWK) --traditional -f $(srcdir)/litoct.awk >_$@
- -$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@
-
-gensub::
- @$(AWK) -f $(srcdir)/gensub.awk $(srcdir)/gensub.in >_$@
- -$(CMP) $(srcdir)/gensub.ok _$@ && rm -f _$@
-
-resplit::
- @echo a:b:c d:e:f | $(AWK) '{ FS = ":"; $$0 = $$0; print $$2 }' > _$@
- -$(CMP) $(srcdir)/resplit.ok _$@ && rm -f _$@
-
-rswhite::
- @$(AWK) -f $(srcdir)/rswhite.awk $(srcdir)/rswhite.in > _$@
- -$(CMP) $(srcdir)/rswhite.ok _$@ && rm -f _$@
-
-prmarscl::
- @-AWKPATH=$(srcdir) $(AWK) -f prmarscl.awk > _$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/prmarscl.ok _$@ && rm -f _$@
-
-sclforin::
- @-AWKPATH=$(srcdir) $(AWK) -f sclforin.awk > _$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/sclforin.ok _$@ && rm -f _$@
-
-sclifin::
- @-AWKPATH=$(srcdir) $(AWK) -f sclifin.awk > _$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/sclifin.ok _$@ && rm -f _$@
-
-intprec::
- @-$(AWK) -f $(srcdir)/intprec.awk > _$@ 2>&1
- -$(CMP) $(srcdir)/intprec.ok _$@ && rm -f _$@
-
-childin::
- @echo hi | $(AWK) 'BEGIN { "cat" | getline; print; close("cat") }' > _$@
- -$(CMP) $(srcdir)/childin.ok _$@ && rm -f _$@
-
-noeffect::
- @-AWKPATH=$(srcdir) $(AWK) --lint -f noeffect.awk > _$@ 2>&1
- -$(CMP) $(srcdir)/noeffect.ok _$@ && rm -f _$@
-
-numsubstr::
- @-AWKPATH=$(srcdir) $(AWK) -f numsubstr.awk $(srcdir)/numsubstr.in >_$@
- -$(CMP) $(srcdir)/numsubstr.ok _$@ && rm -f _$@
-
-gnureops::
- @$(AWK) -f $(srcdir)/gnureops.awk >_$@
- -$(CMP) $(srcdir)/gnureops.ok _$@ && rm -f _$@
-
-pcntplus::
- @$(AWK) -f $(srcdir)/pcntplus.awk >_$@
- -$(CMP) $(srcdir)/pcntplus.ok _$@ && rm -f _$@
-
-prmreuse::
- @$(AWK) -f $(srcdir)/prmreuse.awk >_$@
- -$(CMP) $(srcdir)/prmreuse.ok _$@ && rm -f _$@
-
-math::
- @$(AWK) -f $(srcdir)/math.awk >_$@
- -$(CMP) $(srcdir)/math.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@
fflush::
+ @echo $@
@$(srcdir)/fflush.sh >_$@
- -$(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@
-
-fldchg::
- @$(AWK) -f $(srcdir)/fldchg.awk $(srcdir)/fldchg.in >_$@
- -$(CMP) $(srcdir)/fldchg.ok _$@ && rm -f _$@
-
-fldchgnf::
- @$(AWK) -f $(srcdir)/fldchgnf.awk $(srcdir)/fldchgnf.in >_$@
- -$(CMP) $(srcdir)/fldchgnf.ok _$@ && rm -f _$@
-
-reindops::
- @$(AWK) -f $(srcdir)/reindops.awk $(srcdir)/reindops.in >_$@
- -$(CMP) $(srcdir)/reindops.ok _$@ && rm -f _$@
-
-sprintfc::
- @$(AWK) -f $(srcdir)/sprintfc.awk $(srcdir)/sprintfc.in >_$@
- -$(CMP) $(srcdir)/sprintfc.ok _$@ && rm -f _$@
-
-getlnhd::
- @$(AWK) -f $(srcdir)/getlnhd.awk >_$@
- -$(CMP) $(srcdir)/getlnhd.ok _$@ && rm -f _$@
-
-backgsub::
- @$(AWK) -f $(srcdir)/backgsub.awk $(srcdir)/backgsub.in >_$@
- -$(CMP) $(srcdir)/backgsub.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@
tweakfld::
+ @echo $@
@$(AWK) -f $(srcdir)/tweakfld.awk $(srcdir)/tweakfld.in >_$@
@rm -f errors.cleanup
- -$(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@
-
-clsflnam::
- @$(AWK) -f $(srcdir)/clsflnam.awk $(srcdir)/clsflnam.in >_$@ 2>&1
- -$(CMP) $(srcdir)/clsflnam.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@
mmap8k::
+ @echo $@
@$(AWK) '{ print }' $(srcdir)/mmap8k.in >_$@
- -$(CMP) $(srcdir)/mmap8k.in _$@ && rm -f _$@
-
-fnarray::
- @-AWKPATH=$(srcdir) $(AWK) -f fnarray.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/fnarray.ok _$@ && rm -f _$@
-
-dynlj::
- @$(AWK) -f $(srcdir)/dynlj.awk >_$@
- -$(CMP) $(srcdir)/dynlj.ok _$@ && rm -f _$@
-
-substr::
- @$(AWK) -f $(srcdir)/substr.awk >_$@
- -$(CMP) $(srcdir)/substr.ok _$@ && rm -f _$@
-
-eofsplit::
- @$(AWK) -f $(srcdir)/eofsplit.awk >_$@
- -$(CMP) $(srcdir)/eofsplit.ok _$@ && rm -f _$@
-
-prt1eval::
- @$(AWK) -f $(srcdir)/prt1eval.awk >_$@
- -$(CMP) $(srcdir)/prt1eval.ok _$@ && rm -f _$@
-
-gsubasgn::
- @-AWKPATH=$(srcdir) $(AWK) -f gsubasgn.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/gsubasgn.ok _$@ && rm -f _$@
-
-prtoeval::
- @$(AWK) -f $(srcdir)/prtoeval.awk >_$@
- -$(CMP) $(srcdir)/prtoeval.ok _$@ && rm -f _$@
-
-gsubtest::
- @$(AWK) -f $(srcdir)/gsubtest.awk >_$@
- -$(CMP) $(srcdir)/gsubtest.ok _$@ && rm -f _$@
-
-splitwht::
- @$(AWK) -f $(srcdir)/splitwht.awk >_$@
- -$(CMP) $(srcdir)/splitwht.ok _$@ && rm -f _$@
-
-back89::
- @$(AWK) '/a\8b/' $(srcdir)/back89.in >_$@
- -$(CMP) $(srcdir)/back89.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/mmap8k.in _$@ && rm -f _$@
tradanch::
+ @echo $@
@$(AWK) --traditional -f $(srcdir)/tradanch.awk $(srcdir)/tradanch.in >_$@
- -$(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@
-
-nlfldsep::
- @$(AWK) -f $(srcdir)/nlfldsep.awk $(srcdir)/nlfldsep.in > _$@
- -$(CMP) $(srcdir)/nlfldsep.ok _$@ && rm -f _$@
-
-splitvar::
- @$(AWK) -f $(srcdir)/splitvar.awk $(srcdir)/splitvar.in >_$@
- -$(CMP) $(srcdir)/splitvar.ok _$@ && rm -f _$@
-
-intest::
- @$(AWK) -f $(srcdir)/intest.awk >_$@
- -$(CMP) $(srcdir)/intest.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@
# AIX /bin/sh exec's the last command in a list, therefore issue a ":"
# command so that pid.sh is fork'ed as a child before being exec'ed.
pid::
- @AWKPATH=$(srcdir) AWK=$(AWK) $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; :
- -$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in
+ @echo pid
+ @AWKPATH=$(srcdir) AWK=$(AWKPROG) LC_ALL=C $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; :
+ @-$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in
strftlng::
+ @echo $@
@TZ=UTC; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@
@if $(CMP) -s $(srcdir)/strftlng.ok _$@ ; then : ; else \
TZ=UTC0; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \
fi
- -$(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@
-
-nfldstr::
- @echo | $(AWK) '$$1 == 0 { print "bug" }' > _$@
- -$(CMP) $(srcdir)/nfldstr.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@
nors::
+ @echo $@
@echo A B C D E | tr -d '\12\15' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@
- -$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@
-
-fnarydel::
- @$(AWK) -f $(srcdir)/fnarydel.awk >_$@
- -$(CMP) $(srcdir)/fnarydel.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@
reint::
+ @echo $@
@$(AWK) --re-interval -f $(srcdir)/reint.awk $(srcdir)/reint.in >_$@
- -$(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@
-
-noparms::
- @-AWKPATH=$(srcdir) $(AWK) -f noparms.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/noparms.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@
pipeio1::
+ @echo $@
@$(AWK) -f $(srcdir)/pipeio1.awk >_$@
@rm -f test1 test2
- -$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@
pipeio2::
+ @echo $@
@$(AWK) -v SRCDIR=$(srcdir) -f $(srcdir)/pipeio2.awk >_$@
- -$(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@
-
-funstack::
- @$(AWK) -f $(srcdir)/funstack.awk $(srcdir)/funstack.in >_$@
- -$(CMP) $(srcdir)/funstack.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@
clobber::
+ @echo $@
@$(AWK) -f $(srcdir)/clobber.awk >_$@
- -$(CMP) $(srcdir)/clobber.ok seq && $(CMP) $(srcdir)/clobber.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/clobber.ok seq && $(CMP) $(srcdir)/clobber.ok _$@ && rm -f _$@
@rm -f seq
-delarprm::
- @$(AWK) -f $(srcdir)/delarprm.awk >_$@
- -$(CMP) $(srcdir)/delarprm.ok _$@ && rm -f _$@
-
-prdupval::
- @$(AWK) -f $(srcdir)/prdupval.awk $(srcdir)/prdupval.in >_$@
- -$(CMP) $(srcdir)/prdupval.ok _$@ && rm -f _$@
-
-nondec::
- @if grep BITOP ../config.h | grep define > /dev/null; \
- then \
- $(AWK) -f $(srcdir)/nondec.awk >_$@; \
- else \
- cp $(srcdir)/nondec.ok _$@; \
- fi
- -$(CMP) $(srcdir)/nondec.ok _$@ && rm -f _$@
-
-nasty::
- @$(AWK) -f $(srcdir)/nasty.awk >_$@
- -$(CMP) $(srcdir)/nasty.ok _$@ && rm -f _$@
-
-nasty2::
- @$(AWK) -f $(srcdir)/nasty2.awk >_$@
- -$(CMP) $(srcdir)/nasty2.ok _$@ && rm -f _$@
-
-zeroflag::
- @$(AWK) -f $(srcdir)/zeroflag.awk >_$@
- -$(CMP) $(srcdir)/zeroflag.ok _$@ && rm -f _$@
-
-getnr2tm::
- @$(AWK) -f $(srcdir)/getnr2tm.awk $(srcdir)/getnr2tm.in >_$@
- -$(CMP) $(srcdir)/getnr2tm.ok _$@ && rm -f _$@
-
-getnr2tb::
- @$(AWK) -f $(srcdir)/getnr2tb.awk $(srcdir)/getnr2tb.in >_$@
- -$(CMP) $(srcdir)/getnr2tb.ok _$@ && rm -f _$@
-
-printf1::
- @$(AWK) -f $(srcdir)/printf1.awk >_$@
- -$(CMP) $(srcdir)/printf1.ok _$@ && rm -f _$@
-
-funsmnam::
- @-AWKPATH=$(srcdir) $(AWK) -f funsmnam.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/funsmnam.ok _$@ && rm -f _$@
-
-fnamedat::
- @-AWKPATH=$(srcdir) $(AWK) -f fnamedat.awk < $(srcdir)/fnamedat.in >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/fnamedat.ok _$@ && rm -f _$@
-
-numindex::
- @-AWKPATH=$(srcdir) $(AWK) -f numindex.awk < $(srcdir)/numindex.in >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/numindex.ok _$@ && rm -f _$@
-
-subslash::
- @-AWKPATH=$(srcdir) $(AWK) -f subslash.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/subslash.ok _$@ && rm -f _$@
-
-opasnslf::
- @-AWKPATH=$(srcdir) $(AWK) -f opasnslf.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/opasnslf.ok _$@ && rm -f _$@
-
-opasnidx::
- @-AWKPATH=$(srcdir) $(AWK) -f opasnidx.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/opasnidx.ok _$@ && rm -f _$@
-
arynocls::
+ @echo $@
@-AWKPATH=$(srcdir) $(AWK) -v INPUT=$(srcdir)/arynocls.in -f arynocls.awk >_$@
- -$(CMP) $(srcdir)/arynocls.ok _$@ && rm -f _$@
-
-igncdym::
- @-AWKPATH=$(srcdir) $(AWK) -f igncdym.awk $(srcdir)/igncdym.in >_$@
- -$(CMP) $(srcdir)/igncdym.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/arynocls.ok _$@ && rm -f _$@
getlnbuf::
+ @echo $@
@-AWKPATH=$(srcdir) $(AWK) -f getlnbuf.awk $(srcdir)/getlnbuf.in > _$@
@-AWKPATH=$(srcdir) $(AWK) -f gtlnbufv.awk $(srcdir)/getlnbuf.in > _2$@
- -$(CMP) $(srcdir)/getlnbuf.ok _$@ && $(CMP) $(srcdir)/getlnbuf.ok _2$@ && rm -f _$@ _2$@
-
-arysubnm::
- @-AWKPATH=$(srcdir) $(AWK) -f arysubnm.awk >_$@
- -$(CMP) $(srcdir)/arysubnm.ok _$@ && rm -f _$@
-
-fnparydl::
- @-AWKPATH=$(srcdir) $(AWK) -f fnparydl.awk >_$@
- -$(CMP) $(srcdir)/fnparydl.ok _$@ && rm -f _$@
-
-nlstrina::
- @-AWKPATH=$(srcdir) $(AWK) -f nlstrina.awk >_$@
- -$(CMP) $(srcdir)/nlstrina.ok _$@ && rm -f _$@
-
-octsub::
- @-AWKPATH=$(srcdir) $(AWK) -f octsub.awk >_$@
- -$(CMP) $(srcdir)/octsub.ok _$@ && rm -f _$@
-
-nlinstr::
- @$(AWK) -f $(srcdir)/nlinstr.awk $(srcdir)/nlinstr.in >_$@
- -$(CMP) $(srcdir)/nlinstr.ok _$@ && rm -f _$@
-
-ofmt::
- @$(AWK) -f $(srcdir)/ofmt.awk $(srcdir)/ofmt.in >_$@
- -$(CMP) $(srcdir)/ofmt.ok _$@ && rm -f _$@
-
-hsprint::
- @$(AWK) -f $(srcdir)/hsprint.awk >_$@
- -$(CMP) $(srcdir)/hsprint.ok _$@ && rm -f _$@
-
-fsfwfs::
- @$(AWK) -f $(srcdir)/fsfwfs.awk $(srcdir)/fsfwfs.in >_$@
- -$(CMP) $(srcdir)/fsfwfs.ok _$@ && rm -f _$@
-
-ofmts::
- @$(AWK) -f $(srcdir)/ofmts.awk $(srcdir)/ofmts.in >_$@
- -$(CMP) $(srcdir)/ofmts.ok _$@ && rm -f _$@
-
-parseme::
- @-AWKPATH=$(srcdir) $(AWK) -f parseme.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/parseme.ok _$@ && rm -f _$@
-
-splitdef::
- @$(AWK) -f $(srcdir)/splitdef.awk >_$@
- -$(CMP) $(srcdir)/splitdef.ok _$@ && rm -f _$@
-
-fnaryscl::
- @-AWKPATH=$(srcdir) $(AWK) -f fnaryscl.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/fnaryscl.ok _$@ && rm -f _$@
-
-fnasgnm::
- @-AWKPATH=$(srcdir) $(AWK) -f fnasgnm.awk < $(srcdir)/fnasgnm.in >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/fnasgnm.ok _$@ && rm -f _$@
-
-lint::
- @-AWKPATH=$(srcdir) $(AWK) -f lint.awk > _$@ 2>&1
- -$(CMP) $(srcdir)/lint.ok _$@ && rm -f _$@
-
-procinfs::
- @-$(AWK) -f $(srcdir)/procinfs.awk > _$@
- -$(CMP) $(srcdir)/procinfs.ok _$@ && rm -f _$@
-
-sort1::
- @-$(AWK) -f $(srcdir)/sort1.awk > _$@
- -$(CMP) $(srcdir)/sort1.ok _$@ && rm -f _$@
-
-ofmtbig::
- @$(AWK) -f $(srcdir)/ofmtbig.awk $(srcdir)/ofmtbig.in >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/ofmtbig.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/getlnbuf.ok _$@ && $(CMP) $(srcdir)/getlnbuf.ok _2$@ && rm -f _$@ _2$@
inetmesg::
@echo These tests only work if your system supports the services
- @echo "'discard'" at port 9 and "'daytimed" at port 13. Check your
+ @echo "'discard'" at port 9 and "'daytimed'" at port 13. Check your
@echo file /etc/services and do "'netstat -a'".
inetechu::
@@ -981,116 +731,39 @@ inetdayt::
@$(AWK) 'BEGIN { print "" |& "/inet/tcp/0/127.0.0.1/13"; \
"/inet/tcp/0/127.0.0.1/13" |& getline; print $0}'
-paramtyp::
- @$(AWK) -f $(srcdir)/paramtyp.awk >_$@
- -$(CMP) $(srcdir)/paramtyp.ok _$@ && rm -f _$@
-
-rsnul1nl::
- @$(AWK) -f $(srcdir)/rsnul1nl.awk $(srcdir)/rsnul1nl.in >_$@
- -$(CMP) $(srcdir)/rsnul1nl.ok _$@ && rm -f _$@
-
-datanonl::
- @$(AWK) -f $(srcdir)/datanonl.awk $(srcdir)/datanonl.in >_$@
- -$(CMP) $(srcdir)/datanonl.ok _$@ && rm -f _$@
-
-regeq::
- @$(AWK) -f $(srcdir)/regeq.awk $(srcdir)/regeq.in >_$@
- -$(CMP) $(srcdir)/regeq.ok _$@ && rm -f _$@
-
redfilnm::
+ @echo $@
@$(AWK) -f $(srcdir)/redfilnm.awk srcdir=$(srcdir) $(srcdir)/redfilnm.in >_$@
- -$(CMP) $(srcdir)/redfilnm.ok _$@ && rm -f _$@
-
-strtod::
- @$(AWK) -f $(srcdir)/strtod.awk $(srcdir)/strtod.in >_$@
- -$(CMP) $(srcdir)/strtod.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/redfilnm.ok _$@ && rm -f _$@
leaddig::
+ @echo $@
@$(AWK) -v x=2E -f $(srcdir)/leaddig.awk >_$@
- -$(CMP) $(srcdir)/leaddig.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/leaddig.ok _$@ && rm -f _$@
-clos1way::
- @$(AWK) -f $(srcdir)/clos1way.awk >_$@
- -$(CMP) $(srcdir)/clos1way.ok _$@ && rm -f _$@
+gsubtst3::
+ @echo $@
+ @$(AWK) --re-interval -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
-arynasty::
- @$(AWK) -f $(srcdir)/arynasty.awk >_$@
- -$(CMP) $(srcdir)/arynasty.ok _$@ && rm -f _$@
+space::
+ @echo $@
+ @$(AWK) -f ' ' $(srcdir)/space.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
-shadow::
- @-AWKPATH=$(srcdir) $(AWK) --lint -f shadow.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/shadow.ok _$@ && rm -f _$@
+printf0::
+ @echo $@
+ @$(AWK) --posix -f $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
-regx8bit::
- @$(AWK) -f $(srcdir)/regx8bit.awk >_$@
- -$(CMP) $(srcdir)/regx8bit.ok _$@ && rm -f _$@
+# Targets generated for other tests:
+include Maketests
-psx96sub::
- @$(AWK) -f $(srcdir)/psx96sub.awk >_$@
- -$(CMP) $(srcdir)/psx96sub.ok _$@ && rm -f _$@
-
-addcomma::
- @$(AWK) -f $(srcdir)/addcomma.awk $(srcdir)/addcomma.in >_$@
- -$(CMP) $(srcdir)/addcomma.ok _$@ && rm -f _$@
-
-gnuops2::
- @$(AWK) -f $(srcdir)/gnuops2.awk >_$@
- -$(CMP) $(srcdir)/gnuops2.ok _$@ && rm -f _$@
-
-rebt8b1::
- @$(AWK) -f $(srcdir)/rebt8b1.awk >_$@
- -$(CMP) $(srcdir)/rebt8b1.ok _$@ && rm -f _$@
-
-rebt8b2::
- @$(AWK) -f $(srcdir)/rebt8b2.awk >_$@
- -$(CMP) $(srcdir)/rebt8b2.ok _$@ && rm -f _$@
-
-leadnl::
- @$(AWK) -f $(srcdir)/leadnl.awk $(srcdir)/leadnl.in >_$@
- -$(CMP) $(srcdir)/leadnl.ok _$@ && rm -f _$@
-
-funsemnl::
- @$(AWK) -f $(srcdir)/funsemnl.awk >_$@
- -$(CMP) $(srcdir)/funsemnl.ok _$@ && rm -f _$@
-
-ofmtfidl::
- @$(AWK) -f $(srcdir)/ofmtfidl.awk $(srcdir)/ofmtfidl.in >_$@
- -$(CMP) $(srcdir)/ofmtfidl.ok _$@ && rm -f _$@
-
-onlynl::
- @$(AWK) -f $(srcdir)/onlynl.awk $(srcdir)/onlynl.in >_$@
- -$(CMP) $(srcdir)/onlynl.ok _$@ && rm -f _$@
-
-arrymem1::
- @$(AWK) -f $(srcdir)/arrymem1.awk >_$@
- -$(CMP) $(srcdir)/arrymem1.ok _$@ && rm -f _$@
-
-compare2::
- @$(AWK) -f $(srcdir)/compare2.awk >_$@
- -$(CMP) $(srcdir)/compare2.ok _$@ && rm -f _$@
-
-minusstr::
- @$(AWK) -f $(srcdir)/minusstr.awk >_$@
- -$(CMP) $(srcdir)/minusstr.ok _$@ && rm -f _$@
-
-membug1::
- @$(AWK) -f $(srcdir)/membug1.awk $(srcdir)/membug1.in >_$@
- -$(CMP) $(srcdir)/membug1.ok _$@ && rm -f _$@
-
-forsimp::
- @$(AWK) -f $(srcdir)/forsimp.awk >_$@
- -$(CMP) $(srcdir)/forsimp.ok _$@ && rm -f _$@
-
-concat1::
- @$(AWK) -f $(srcdir)/concat1.awk $(srcdir)/concat1.in >_$@
- -$(CMP) $(srcdir)/concat1.ok _$@ && rm -f _$@
-
-longsub::
- @$(AWK) -f $(srcdir)/longsub.awk $(srcdir)/longsub.in >_$@
- -$(CMP) $(srcdir)/longsub.ok _$@ && rm -f _$@
+$(srcdir)/Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
+ $(AWK) -f $(srcdir)/Gentests "$<" *.awk *.in > $(srcdir)/Maketests
clean:
- rm -fr _* core junk out1 out2 out3 strftime.ok test1 test2 seq *~
+ rm -fr _* core core.* junk out1 out2 out3 strftime.ok test1 test2 seq *~
# An attempt to print something that can be grepped for in build logs
pass-fail:
@@ -1107,3 +780,15 @@ diffout:
echo ============== $$i ============= ; \
diff -c $${i#_}.ok $$i ; \
done | more
+
+# This target is for testing with electric fence.
+efence:
+ for i in $$(ls _* | sed 's;_\(.*\);\1;') ; \
+ do \
+ bad=$$(wc -l < _$$i) \
+ ok=$$(wc -l < $$i.ok) ; \
+ if (( $$bad == $$ok + 2 )) ; \
+ then \
+ rm _$$i ; \
+ fi ; \
+ done
diff --git a/test/Makefile.in b/test/Makefile.in
index a05e0e45..135f689e 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1,6 +1,7 @@
-# Makefile.in generated automatically by automake 1.5 from Makefile.am.
+# Makefile.in generated by automake 1.7.3 from Makefile.am.
+# @configure_input@
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# 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,
@@ -16,7 +17,7 @@
#
# test/Makefile.am --- automake input file for gawk
#
-# Copyright (C) 1988-2002 the Free Software Foundation, Inc.
+# Copyright (C) 1988-2003 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
@@ -36,98 +37,139 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
#
-SHELL = @SHELL@
-
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
+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@
+transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-host_alias = @host_alias@
host_triplet = @host@
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = LC_ALL=C $(AWKPROG)
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@
-HAVE_LIB = @HAVE_LIB@
+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@
-LIB = @LIB@
+LDFLAGS = @LDFLAGS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
LN_S = @LN_S@
-LTLIB = @LTLIB@
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@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
install_sh = @install_sh@
-AWK = ../gawk
-
-# Special stuff for OS/2
-PATH_SEPARATOR = @PATH_SEPARATOR@
+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@
EXTRA_DIST = \
reg \
lib \
+ Gentests \
+ Maketests \
README \
addcomma.awk \
addcomma.in \
@@ -156,13 +198,20 @@ EXTRA_DIST = \
asgext.awk \
asgext.in \
asgext.ok \
+ asort.awk \
+ asort.ok \
+ asorti.awk \
+ asorti.ok \
awkpath.ok \
+ back89.awk \
back89.in \
back89.ok \
backgsub.awk \
backgsub.in \
backgsub.ok \
badargs.ok \
+ childin.awk \
+ childin.in \
childin.ok \
clobber.awk \
clobber.ok \
@@ -194,6 +243,8 @@ EXTRA_DIST = \
eofsplit.ok \
fflush.ok \
fflush.sh \
+ fieldwdth.awk \
+ fieldwdth.in \
fieldwdth.ok \
fldchg.awk \
fldchg.in \
@@ -213,10 +264,13 @@ EXTRA_DIST = \
fnasgnm.awk \
fnasgnm.in \
fnasgnm.ok \
+ fnmisc.awk \
+ fnmisc.ok \
fnparydl.awk \
fnparydl.ok \
forsimp.awk \
forsimp.ok \
+ fsbs.awk \
fsbs.in \
fsbs.ok \
fsfwfs.awk \
@@ -226,6 +280,7 @@ EXTRA_DIST = \
fsrs.in \
fsrs.ok \
fstabplus.awk \
+ fstabplus.in \
fstabplus.ok \
funsemnl.awk \
funsemnl.ok \
@@ -238,7 +293,12 @@ EXTRA_DIST = \
gensub.in \
gensub.ok \
getline.awk \
+ getline.in \
getline.ok \
+ getline2.awk \
+ getline2.ok \
+ getline3.awk \
+ getline3.ok \
getlnbuf.awk \
getlnbuf.in \
getlnbuf.ok \
@@ -258,18 +318,34 @@ EXTRA_DIST = \
gsubasgn.ok \
gsubtest.awk \
gsubtest.ok \
+ gsubtst2.awk \
+ gsubtst2.ok \
+ gsubtst3.awk \
+ gsubtst3.in \
+ gsubtst3.ok \
+ gsubtst4.awk \
+ gsubtst4.ok \
gtlnbufv.awk \
hsprint.awk \
hsprint.ok \
+ icasefs.awk \
+ icasefs.ok \
+ icasers.awk \
+ icasers.in \
+ icasers.ok \
igncdym.awk \
igncdym.in \
igncdym.ok \
igncfs.awk \
igncfs.in \
igncfs.ok \
+ ignrcase.awk \
+ ignrcase.in \
ignrcase.ok \
inftest.awk \
inftest.ok \
+ inputred.awk \
+ inputred.ok \
intest.awk \
intest.ok \
intprec.awk \
@@ -288,8 +364,11 @@ EXTRA_DIST = \
longsub.ok \
longwrds.awk \
longwrds.ok \
- manpage \
+ longwrds.in \
manyfiles.awk \
+ manyfiles.ok \
+ match1.awk \
+ match1.ok \
math.awk \
math.ok \
membug1.awk \
@@ -303,8 +382,13 @@ EXTRA_DIST = \
nasty.ok \
nasty2.awk \
nasty2.ok \
+ negexp.awk \
negexp.ok \
+ nfldstr.awk \
+ nfldstr.in \
nfldstr.ok \
+ nfneg.awk \
+ nfneg.ok \
nfset.awk \
nfset.in \
nfset.ok \
@@ -320,6 +404,12 @@ EXTRA_DIST = \
noeffect.ok \
nofmtch.awk \
nofmtch.ok \
+ noloop1.awk \
+ noloop1.in \
+ noloop1.ok \
+ noloop2.awk \
+ noloop2.in \
+ noloop2.ok \
nondec.awk \
nondec.ok \
nonl.awk \
@@ -328,6 +418,9 @@ EXTRA_DIST = \
noparms.ok \
nors.in \
nors.ok \
+ nulrsend.awk \
+ nulrsend.in \
+ nulrsend.ok \
numindex.awk \
numindex.in \
numindex.ok \
@@ -375,12 +468,16 @@ EXTRA_DIST = \
pipeio2.in \
pipeio2.ok \
posix.awk \
+ posix.in \
posix.ok \
poundbang.awk \
- poundbang.ok \
prdupval.awk \
prdupval.in \
prdupval.ok \
+ prec.awk \
+ prec.ok \
+ printf0.awk \
+ printf0.ok \
printf1.awk \
printf1.ok \
printfloat.awk \
@@ -411,6 +508,9 @@ EXTRA_DIST = \
regtest.sh \
regx8bit.awk \
regx8bit.ok \
+ rebuf.awk \
+ rebuf.in \
+ rebuf.ok \
reindops.awk \
reindops.in \
reindops.ok \
@@ -420,12 +520,19 @@ EXTRA_DIST = \
reparse.awk \
reparse.in \
reparse.ok \
+ resplit.awk \
+ resplit.in \
resplit.ok \
+ rs.awk \
rs.in \
rs.ok \
rsnul1nl.awk \
rsnul1nl.in \
rsnul1nl.ok \
+ rstest1.awk \
+ rstest1.ok \
+ rstest2.awk \
+ rstest2.ok \
rswhite.awk \
rswhite.in \
rswhite.ok \
@@ -437,9 +544,12 @@ EXTRA_DIST = \
shadow.ok \
sort1.awk \
sort1.ok \
+ space.ok \
splitargv.awk \
splitargv.in \
splitargv.ok \
+ splitarr.awk \
+ splitarr.ok \
splitdef.awk \
splitdef.ok \
splitvar.awk \
@@ -463,37 +573,85 @@ EXTRA_DIST = \
swaplns.awk \
swaplns.in \
swaplns.ok \
+ synerr1.awk \
+ synerr1.ok \
tradanch.awk \
tradanch.in \
tradanch.ok \
tweakfld.awk \
tweakfld.in \
tweakfld.ok \
+ uninitialized.awk \
+ uninitialized.ok \
+ uninit2.awk \
+ uninit2.ok \
+ zeroe0.awk \
+ zeroe0.ok \
zeroflag.awk \
zeroflag.ok
+# try to keep these sorted
+BASIC_TESTS = addcomma anchgsub argarray arrayparm arrayref arrymem1 arynasty \
+ arynocls arysubnm asgext awkpath back89 backgsub childin clobber \
+ clsflnam compare compare2 concat1 convfmt datanonl defref delarprm \
+ dynlj eofsplit fldchg fldchgnf fnamedat fnarray fnarydel fnaryscl \
+ fnasgnm fnmisc fnparydl forsimp fsbs fsrs fstabplus funsemnl funsmnam \
+ funstack getline getline2 getline3 getlnbuf getnr2tb getnr2tm gsubasgn gsubtest \
+ gsubtst2 gsubtst3 gsubtst4 hsprint inputred intest intprec leaddig leadnl \
+ litoct longsub longwrds math membug1 messages minusstr mmap8k \
+ nasty nasty2 negexp nfldstr nfneg nfset nlfldsep nlinstr nlstrina \
+ noeffect nofmtch noloop1 noloop2 nonl noparms nors nulrsend \
+ numindex numsubstr octsub ofmt ofmtbig ofmtfidl ofmts onlynl \
+ opasnidx opasnslf paramdup paramtyp parseme pcntplus prdupval prec \
+ printf0 printf1 prmarscl prmreuse prt1eval prtoeval psx96sub rand rebt8b1 \
+ rebt8b2 redfilnm regeq reindops reparse resplit rs rsnul1nl \
+ rstest1 rstest2 rswhite sclforin sclifin splitargv splitarr splitdef \
+ splitvar splitwht sprintfc strtod subslash substr swaplns synerr1 \
+ tradanch tweakfld uninitialized uninit2 zeroe0 zeroflag
+
+
+UNIX_TESTS = fflush getlnhd pid pipeio1 pipeio2 poundbang space strftlng
+
+GAWK_EXT_TESTS = argtest asort asorti badargs clos1way fieldwdth fsfwfs \
+ gensub gnuops2 gnureops icasefs icasers igncdym igncfs ignrcase lint \
+ match1 manyfiles nondec posix procinfs regx8bit rebuf reint shadow \
+ sort1 strftime
+
+
+EXTRA_TESTS = regtest inftest
+
+INET_TESTS = inetechu inetecht inetdayu inetdayt
+
+# List of the tests which should be run with --lint option:
+NEED_LINT = defref noeffect nofmtch shadow uninitialized uninit2
+
+# List of the files that appear in manual tests or are for reserve testing:
+GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk
+
CMP = cmp
+AWKPROG = ../gawk$(EXEEXT)
subdir = test
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
-DIST_COMMON = README ChangeLog Makefile.am Makefile.in
+DIST_COMMON = README $(srcdir)/Maketests ChangeLog Makefile.am \
+ Makefile.in
all: all-am
.SUFFIXES:
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: Makefile.am $(srcdir)/Maketests $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu test/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) && \
- CONFIG_HEADERS= CONFIG_LINKS= \
- CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
uninstall-info-am:
tags: TAGS
TAGS:
+ctags: CTAGS
+CTAGS:
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -501,15 +659,26 @@ top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ @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 \
- $(mkinstalldirs) "$(distdir)/$$dir"; \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
fi; \
if test -d $$d/$$file; then \
- cp -pR $$d/$$file $(distdir) \
- || exit 1; \
+ 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 \
@@ -533,6 +702,7 @@ install-am: all-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:
@@ -540,7 +710,7 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -579,6 +749,14 @@ mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic distclean \
@@ -587,44 +765,31 @@ uninstall-am: uninstall-info-am
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-generic uninstall uninstall-am uninstall-info-am
+ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am
-# message stuff is to make it a little easier to follow
+# Message stuff is to make it a little easier to follow.
+# Make the pass-fail last and dependent on others to avoid
+# spurious errors if `make -j' in effect.
check: msg \
basic-msg-start basic basic-msg-end \
unix-msg-start unix-tests unix-msg-end \
- extend-msg-start gawk-extensions extend-msg-end \
- pass-fail
+ extend-msg-start gawk-extensions extend-msg-end
+ @$(MAKE) pass-fail
-# try to keep these sorted
-basic: addcomma anchgsub argarray arrayparm arrayref arynasty arynocls \
- arysubnm arrymem1 asgext awkpath back89 backgsub childin clobber \
- clsflnam compare compare2 concat1 convfmt datanonl defref delarprm dynlj eofsplit \
- fldchg fldchgnf fnamedat fnarray fnarydel fnaryscl fnasgnm \
- fnparydl forsimp fsbs fsrs fstabplus funsemnl funsmnam funstack getline \
- getlnbuf getnr2tb getnr2tm gsubasgn gsubtest hsprint intest \
- intprec leaddig leadnl litoct longsub longwrds math membug1 messages minusstr \
- mmap8k nasty nasty2 negexp nfldstr nfset nlfldsep nlinstr nlstrina \
- noeffect nofmtch nonl noparms nors numindex numsubstr octsub \
- ofmt ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf paramdup paramtyp \
- parseme pcntplus prdupval printf1 prmarscl prmreuse prt1eval \
- prtoeval psx96sub rand rebt8b1 rebt8b2 redfilnm regeq reindops \
- reparse resplit rs rsnul1nl rswhite sclforin sclifin splitargv \
- splitdef splitvar splitwht sprintfc strtod subslash substr \
- swaplns tradanch tweakfld zeroflag
-
-unix-tests: fflush getlnhd pid pipeio1 pipeio2 poundbang strftlng
-
-gawk-extensions: argtest badargs clos1way fieldwdth fsfwfs gensub \
- gnuops2 gnureops igncdym igncfs ignrcase lint manyfiles nondec \
- posix procinfs regx8bit reint shadow sort1 strftime
-
-extra: regtest inftest inet
-
-inet: inetmesg inetechu inetecht inetdayu inetdayt
+basic: $(BASIC_TESTS)
+
+unix-tests: $(UNIX_TESTS)
+
+gawk-extensions: $(GAWK_EXT_TESTS)
+
+extra: $(EXTRA_TESTS) inet
+
+inet: inetmesg $(INET_TESTS)
msg::
+ @echo ''
@echo 'Any output from "cmp" is bad news, although some differences'
@echo 'in floating point values are probably benign -- in particular,'
@echo 'some systems may omit a leading zero and the floating point'
@@ -649,57 +814,40 @@ extend-msg-end:
@echo "======== Done with gawk extension tests ========"
# This test is a PITA because increasingly, /tmp is getting
-# mounted noexec. So, we'll test it. Sigh.
+# mounted noexec. So, we'll test it locally. Sigh.
+#
+# More PITA; some systems have medium short limits on #! paths,
+# so this can still fail
poundbang::
- @cp $(AWK) /tmp/gawk
- @if /tmp/gawk 'BEGIN { print "OK" }' | grep OK > /dev/null ; \
- then \
- $(srcdir)/poundbang.awk $(srcdir)/poundbang.awk >_`basename $@` ; \
- $(CMP) $(srcdir)/poundbang.ok _`basename $@` && rm -f _`basename $@` && echo poundbang is ok ; \
+ @echo $@
+ @sed "s;/tmp/gawk;`pwd`/$(AWKPROG);" < $(srcdir)/poundbang.awk > ./_pbd.awk
+ @chmod +x ./_pbd.awk
+ @if ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@` ; \
+ then : ; \
else \
- echo "*** /tmp is apparently mounted noexec, skipping poundbang test." ; \
+ sed "s;/tmp/gawk;../$(AWKPROG);" < $(srcdir)/poundbang.awk > ./_pbd.awk ; \
+ chmod +x ./_pbd.awk ; \
+ ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@`; \
fi
- @rm -f /tmp/gawk
-
-swaplns::
- @$(AWK) -f $(srcdir)/swaplns.awk $(srcdir)/swaplns.in >_$@
- -$(CMP) $(srcdir)/swaplns.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/poundbang.awk _`basename $@` && rm -f _`basename $@` _pbd.awk
messages::
+ @echo $@
@$(AWK) -f $(srcdir)/messages.awk >out2 2>out3
- -$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3
+ @-$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3
argarray::
+ @echo $@
@case $(srcdir) in \
.) : ;; \
*) cp $(srcdir)/argarray.in . ;; \
esac
@TEST=test echo just a test | $(AWK) -f $(srcdir)/argarray.awk ./argarray.in - >_$@
- -$(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@
-
-fstabplus::
- @echo '1 2' | $(AWK) -f $(srcdir)/fstabplus.awk >_$@
- -$(CMP) $(srcdir)/fstabplus.ok _$@ && rm -f _$@
-
-fsrs::
- @$(AWK) -f $(srcdir)/fsrs.awk $(srcdir)/fsrs.in >_$@
- -$(CMP) $(srcdir)/fsrs.ok _$@ && rm -f _$@
-
-igncfs::
- @$(AWK) -f $(srcdir)/igncfs.awk $(srcdir)/igncfs.in >_$@
- -$(CMP) $(srcdir)/igncfs.ok _$@ && rm -f _$@
-
-longwrds::
- @$(AWK) -f $(srcdir)/longwrds.awk $(srcdir)/manpage | (LC_ALL=C sort) >_$@
- -$(CMP) $(srcdir)/longwrds.ok _$@ && rm -f _$@
-
-fieldwdth::
- @echo '123456789' | $(AWK) -v FIELDWIDTHS="2 3 4" '{ print $$2}' >_$@
- -$(CMP) $(srcdir)/fieldwdth.ok _$@ && rm -f _$@
-
-ignrcase::
- @echo xYz | $(AWK) -v IGNORECASE=1 '{ sub(/y/, ""); print}' >_$@
- -$(CMP) $(srcdir)/ignrcase.ok _$@ && rm -f _$@
+ @case $(srcdir) in \
+ .) : ;; \
+ *) rm -f ./argarray.in ;; \
+ esac
+ @-$(CMP) $(srcdir)/argarray.ok _$@ && rm -f _$@
regtest::
@echo 'Some of the output from regtest is very system specific, do not'
@@ -707,473 +855,142 @@ regtest::
@echo 'Manual inspection is called for.'
AWK=`pwd`/$(AWK) $(srcdir)/regtest.sh
-posix::
- @echo '1:2,3 4' | $(AWK) -f $(srcdir)/posix.awk >_$@
- -$(CMP) $(srcdir)/posix.ok _$@ && rm -f _$@
-
manyfiles::
+ @echo manyfiles
@rm -rf junk
@mkdir junk
@$(AWK) 'BEGIN { for (i = 1; i <= 300; i++) print i, i}' >_$@
@$(AWK) -f $(srcdir)/manyfiles.awk _$@ _$@
- @echo "This number better be 1 ->" | tr -d '\012\015'
- @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l
- @rm -rf junk _$@
+ @wc -l junk/* | $(AWK) '$$1 != 2' | wc -l | sed 's/ *//g' > _$@
+ @rm -rf junk ; $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
compare::
+ @echo $@
@$(AWK) -f $(srcdir)/compare.awk 0 1 $(srcdir)/compare.in >_$@
- -$(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@
-
-arrayref::
- @$(AWK) -f $(srcdir)/arrayref.awk >_$@
- -$(CMP) $(srcdir)/arrayref.ok _$@ && rm -f _$@
-
-rs::
- @$(AWK) -v RS="" '{ print $$1, $$2}' $(srcdir)/rs.in >_$@
- -$(CMP) $(srcdir)/rs.ok _$@ && rm -f _$@
-
-fsbs::
- @$(AWK) -v FS='\' '{ print $$1, $$2 }' $(srcdir)/fsbs.in >_$@
- -$(CMP) $(srcdir)/fsbs.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/compare.ok _$@ && rm -f _$@
inftest::
+ @echo $@
@echo This test is very machine specific...
@$(AWK) -f $(srcdir)/inftest.awk | sed 's/inf/Inf/g' >_$@
- -$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@
-
-getline::
- @$(AWK) -f $(srcdir)/getline.awk $(srcdir)/getline.awk $(srcdir)/getline.awk >_$@
- -$(CMP) $(srcdir)/getline.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@
-rand::
- @$(AWK) -f $(srcdir)/rand.awk >_$@
- -$(CMP) $(srcdir)/rand.ok _$@ && rm -f _$@
-
-negexp::
- @$(AWK) 'BEGIN { a = -2; print 10^a }' >_$@
- -$(CMP) $(srcdir)/negexp.ok _$@ && rm -f _$@
-
-asgext::
- @$(AWK) -f $(srcdir)/asgext.awk $(srcdir)/asgext.in >_$@
- -$(CMP) $(srcdir)/asgext.ok _$@ && rm -f _$@
-
-anchgsub::
- @$(AWK) -f $(srcdir)/anchgsub.awk $(srcdir)/anchgsub.in >_$@
- -$(CMP) $(srcdir)/anchgsub.ok _$@ && rm -f _$@
-
-splitargv::
- @$(AWK) -f $(srcdir)/splitargv.awk $(srcdir)/splitargv.in >_$@
- -$(CMP) $(srcdir)/splitargv.ok _$@ && rm -f _$@
+getline2::
+ @echo $@
+ @$(AWK) -f $(srcdir)/getline2.awk $(srcdir)/getline2.awk $(srcdir)/getline2.awk >_$@
+ @-$(CMP) $(srcdir)/getline2.ok _$@ && rm -f _$@
awkpath::
+ @echo $@
@AWKPATH="$(srcdir)$(PATH_SEPARATOR)$(srcdir)/lib" $(AWK) -f awkpath.awk >_$@
- -$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@
-
-nfset::
- @$(AWK) -f $(srcdir)/nfset.awk $(srcdir)/nfset.in >_$@
- -$(CMP) $(srcdir)/nfset.ok _$@ && rm -f _$@
-
-reparse::
- @$(AWK) -f $(srcdir)/reparse.awk $(srcdir)/reparse.in >_$@
- -$(CMP) $(srcdir)/reparse.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/awkpath.ok _$@ && rm -f _$@
argtest::
+ @echo $@
@$(AWK) -f $(srcdir)/argtest.awk -x -y abc >_$@
- -$(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/argtest.ok _$@ && rm -f _$@
badargs::
+ @echo $@
@-$(AWK) -f 2>&1 | grep -v patchlevel >_$@
- -$(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@
-
-convfmt::
- @$(AWK) -f $(srcdir)/convfmt.awk >_$@
- -$(CMP) $(srcdir)/convfmt.ok _$@ && rm -f _$@
-
-arrayparm::
- @-AWKPATH=$(srcdir) $(AWK) -f arrayparm.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/arrayparm.ok _$@ && rm -f _$@
-
-paramdup::
- @-AWKPATH=$(srcdir) $(AWK) -f paramdup.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/paramdup.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/badargs.ok _$@ && rm -f _$@
nonl::
+ @echo $@
@-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1
- -$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@
-
-defref::
- @-AWKPATH=$(srcdir) $(AWK) --lint -f defref.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/defref.ok _$@ && rm -f _$@
-
-nofmtch::
- @-AWKPATH=$(srcdir) $(AWK) --lint -f nofmtch.awk >_$@ 2>&1
- -$(CMP) $(srcdir)/nofmtch.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@
strftime::
- : this test could fail on slow machines or on a second boundary,
- : so if it does, double check the actual results
+ @echo This test could fail on slow machines or on a second boundary,
+ @echo so if it does, double check the actual results:
+ @echo $@
@LC_ALL=C; export LC_ALL; LANG=C; export LANG; \
TZ=GMT0; export TZ; \
date | $(AWK) -v OUTPUT=_$@ -f $(srcdir)/strftime.awk
- -$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0
+ @-$(CMP) strftime.ok _$@ && rm -f _$@ strftime.ok || exit 0
litoct::
+ @echo $@
@echo ab | $(AWK) --traditional -f $(srcdir)/litoct.awk >_$@
- -$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@
-
-gensub::
- @$(AWK) -f $(srcdir)/gensub.awk $(srcdir)/gensub.in >_$@
- -$(CMP) $(srcdir)/gensub.ok _$@ && rm -f _$@
-
-resplit::
- @echo a:b:c d:e:f | $(AWK) '{ FS = ":"; $$0 = $$0; print $$2 }' > _$@
- -$(CMP) $(srcdir)/resplit.ok _$@ && rm -f _$@
-
-rswhite::
- @$(AWK) -f $(srcdir)/rswhite.awk $(srcdir)/rswhite.in > _$@
- -$(CMP) $(srcdir)/rswhite.ok _$@ && rm -f _$@
-
-prmarscl::
- @-AWKPATH=$(srcdir) $(AWK) -f prmarscl.awk > _$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/prmarscl.ok _$@ && rm -f _$@
-
-sclforin::
- @-AWKPATH=$(srcdir) $(AWK) -f sclforin.awk > _$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/sclforin.ok _$@ && rm -f _$@
-
-sclifin::
- @-AWKPATH=$(srcdir) $(AWK) -f sclifin.awk > _$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/sclifin.ok _$@ && rm -f _$@
-
-intprec::
- @-$(AWK) -f $(srcdir)/intprec.awk > _$@ 2>&1
- -$(CMP) $(srcdir)/intprec.ok _$@ && rm -f _$@
-
-childin::
- @echo hi | $(AWK) 'BEGIN { "cat" | getline; print; close("cat") }' > _$@
- -$(CMP) $(srcdir)/childin.ok _$@ && rm -f _$@
-
-noeffect::
- @-AWKPATH=$(srcdir) $(AWK) --lint -f noeffect.awk > _$@ 2>&1
- -$(CMP) $(srcdir)/noeffect.ok _$@ && rm -f _$@
-
-numsubstr::
- @-AWKPATH=$(srcdir) $(AWK) -f numsubstr.awk $(srcdir)/numsubstr.in >_$@
- -$(CMP) $(srcdir)/numsubstr.ok _$@ && rm -f _$@
-
-gnureops::
- @$(AWK) -f $(srcdir)/gnureops.awk >_$@
- -$(CMP) $(srcdir)/gnureops.ok _$@ && rm -f _$@
-
-pcntplus::
- @$(AWK) -f $(srcdir)/pcntplus.awk >_$@
- -$(CMP) $(srcdir)/pcntplus.ok _$@ && rm -f _$@
-
-prmreuse::
- @$(AWK) -f $(srcdir)/prmreuse.awk >_$@
- -$(CMP) $(srcdir)/prmreuse.ok _$@ && rm -f _$@
-
-math::
- @$(AWK) -f $(srcdir)/math.awk >_$@
- -$(CMP) $(srcdir)/math.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@
fflush::
+ @echo $@
@$(srcdir)/fflush.sh >_$@
- -$(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@
-
-fldchg::
- @$(AWK) -f $(srcdir)/fldchg.awk $(srcdir)/fldchg.in >_$@
- -$(CMP) $(srcdir)/fldchg.ok _$@ && rm -f _$@
-
-fldchgnf::
- @$(AWK) -f $(srcdir)/fldchgnf.awk $(srcdir)/fldchgnf.in >_$@
- -$(CMP) $(srcdir)/fldchgnf.ok _$@ && rm -f _$@
-
-reindops::
- @$(AWK) -f $(srcdir)/reindops.awk $(srcdir)/reindops.in >_$@
- -$(CMP) $(srcdir)/reindops.ok _$@ && rm -f _$@
-
-sprintfc::
- @$(AWK) -f $(srcdir)/sprintfc.awk $(srcdir)/sprintfc.in >_$@
- -$(CMP) $(srcdir)/sprintfc.ok _$@ && rm -f _$@
-
-getlnhd::
- @$(AWK) -f $(srcdir)/getlnhd.awk >_$@
- -$(CMP) $(srcdir)/getlnhd.ok _$@ && rm -f _$@
-
-backgsub::
- @$(AWK) -f $(srcdir)/backgsub.awk $(srcdir)/backgsub.in >_$@
- -$(CMP) $(srcdir)/backgsub.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/fflush.ok _$@ && rm -f _$@
tweakfld::
+ @echo $@
@$(AWK) -f $(srcdir)/tweakfld.awk $(srcdir)/tweakfld.in >_$@
@rm -f errors.cleanup
- -$(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@
-
-clsflnam::
- @$(AWK) -f $(srcdir)/clsflnam.awk $(srcdir)/clsflnam.in >_$@ 2>&1
- -$(CMP) $(srcdir)/clsflnam.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/tweakfld.ok _$@ && rm -f _$@
mmap8k::
+ @echo $@
@$(AWK) '{ print }' $(srcdir)/mmap8k.in >_$@
- -$(CMP) $(srcdir)/mmap8k.in _$@ && rm -f _$@
-
-fnarray::
- @-AWKPATH=$(srcdir) $(AWK) -f fnarray.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/fnarray.ok _$@ && rm -f _$@
-
-dynlj::
- @$(AWK) -f $(srcdir)/dynlj.awk >_$@
- -$(CMP) $(srcdir)/dynlj.ok _$@ && rm -f _$@
-
-substr::
- @$(AWK) -f $(srcdir)/substr.awk >_$@
- -$(CMP) $(srcdir)/substr.ok _$@ && rm -f _$@
-
-eofsplit::
- @$(AWK) -f $(srcdir)/eofsplit.awk >_$@
- -$(CMP) $(srcdir)/eofsplit.ok _$@ && rm -f _$@
-
-prt1eval::
- @$(AWK) -f $(srcdir)/prt1eval.awk >_$@
- -$(CMP) $(srcdir)/prt1eval.ok _$@ && rm -f _$@
-
-gsubasgn::
- @-AWKPATH=$(srcdir) $(AWK) -f gsubasgn.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/gsubasgn.ok _$@ && rm -f _$@
-
-prtoeval::
- @$(AWK) -f $(srcdir)/prtoeval.awk >_$@
- -$(CMP) $(srcdir)/prtoeval.ok _$@ && rm -f _$@
-
-gsubtest::
- @$(AWK) -f $(srcdir)/gsubtest.awk >_$@
- -$(CMP) $(srcdir)/gsubtest.ok _$@ && rm -f _$@
-
-splitwht::
- @$(AWK) -f $(srcdir)/splitwht.awk >_$@
- -$(CMP) $(srcdir)/splitwht.ok _$@ && rm -f _$@
-
-back89::
- @$(AWK) '/a\8b/' $(srcdir)/back89.in >_$@
- -$(CMP) $(srcdir)/back89.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/mmap8k.in _$@ && rm -f _$@
tradanch::
+ @echo $@
@$(AWK) --traditional -f $(srcdir)/tradanch.awk $(srcdir)/tradanch.in >_$@
- -$(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@
-
-nlfldsep::
- @$(AWK) -f $(srcdir)/nlfldsep.awk $(srcdir)/nlfldsep.in > _$@
- -$(CMP) $(srcdir)/nlfldsep.ok _$@ && rm -f _$@
-
-splitvar::
- @$(AWK) -f $(srcdir)/splitvar.awk $(srcdir)/splitvar.in >_$@
- -$(CMP) $(srcdir)/splitvar.ok _$@ && rm -f _$@
-
-intest::
- @$(AWK) -f $(srcdir)/intest.awk >_$@
- -$(CMP) $(srcdir)/intest.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/tradanch.ok _$@ && rm -f _$@
# AIX /bin/sh exec's the last command in a list, therefore issue a ":"
# command so that pid.sh is fork'ed as a child before being exec'ed.
pid::
- @AWKPATH=$(srcdir) AWK=$(AWK) $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; :
- -$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in
+ @echo pid
+ @AWKPATH=$(srcdir) AWK=$(AWKPROG) LC_ALL=C $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; :
+ @-$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in
strftlng::
+ @echo $@
@TZ=UTC; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@
@if $(CMP) -s $(srcdir)/strftlng.ok _$@ ; then : ; else \
TZ=UTC0; export TZ; $(AWK) -f $(srcdir)/strftlng.awk >_$@ ; \
fi
- -$(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@
-
-nfldstr::
- @echo | $(AWK) '$$1 == 0 { print "bug" }' > _$@
- -$(CMP) $(srcdir)/nfldstr.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/strftlng.ok _$@ && rm -f _$@
nors::
+ @echo $@
@echo A B C D E | tr -d '\12\15' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@
- -$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@
-
-fnarydel::
- @$(AWK) -f $(srcdir)/fnarydel.awk >_$@
- -$(CMP) $(srcdir)/fnarydel.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@
reint::
+ @echo $@
@$(AWK) --re-interval -f $(srcdir)/reint.awk $(srcdir)/reint.in >_$@
- -$(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@
-
-noparms::
- @-AWKPATH=$(srcdir) $(AWK) -f noparms.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/noparms.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/reint.ok _$@ && rm -f _$@
pipeio1::
+ @echo $@
@$(AWK) -f $(srcdir)/pipeio1.awk >_$@
@rm -f test1 test2
- -$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@
pipeio2::
+ @echo $@
@$(AWK) -v SRCDIR=$(srcdir) -f $(srcdir)/pipeio2.awk >_$@
- -$(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@
-
-funstack::
- @$(AWK) -f $(srcdir)/funstack.awk $(srcdir)/funstack.in >_$@
- -$(CMP) $(srcdir)/funstack.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/pipeio2.ok _$@ && rm -f _$@
clobber::
+ @echo $@
@$(AWK) -f $(srcdir)/clobber.awk >_$@
- -$(CMP) $(srcdir)/clobber.ok seq && $(CMP) $(srcdir)/clobber.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/clobber.ok seq && $(CMP) $(srcdir)/clobber.ok _$@ && rm -f _$@
@rm -f seq
-delarprm::
- @$(AWK) -f $(srcdir)/delarprm.awk >_$@
- -$(CMP) $(srcdir)/delarprm.ok _$@ && rm -f _$@
-
-prdupval::
- @$(AWK) -f $(srcdir)/prdupval.awk $(srcdir)/prdupval.in >_$@
- -$(CMP) $(srcdir)/prdupval.ok _$@ && rm -f _$@
-
-nondec::
- @if grep BITOP ../config.h | grep define > /dev/null; \
- then \
- $(AWK) -f $(srcdir)/nondec.awk >_$@; \
- else \
- cp $(srcdir)/nondec.ok _$@; \
- fi
- -$(CMP) $(srcdir)/nondec.ok _$@ && rm -f _$@
-
-nasty::
- @$(AWK) -f $(srcdir)/nasty.awk >_$@
- -$(CMP) $(srcdir)/nasty.ok _$@ && rm -f _$@
-
-nasty2::
- @$(AWK) -f $(srcdir)/nasty2.awk >_$@
- -$(CMP) $(srcdir)/nasty2.ok _$@ && rm -f _$@
-
-zeroflag::
- @$(AWK) -f $(srcdir)/zeroflag.awk >_$@
- -$(CMP) $(srcdir)/zeroflag.ok _$@ && rm -f _$@
-
-getnr2tm::
- @$(AWK) -f $(srcdir)/getnr2tm.awk $(srcdir)/getnr2tm.in >_$@
- -$(CMP) $(srcdir)/getnr2tm.ok _$@ && rm -f _$@
-
-getnr2tb::
- @$(AWK) -f $(srcdir)/getnr2tb.awk $(srcdir)/getnr2tb.in >_$@
- -$(CMP) $(srcdir)/getnr2tb.ok _$@ && rm -f _$@
-
-printf1::
- @$(AWK) -f $(srcdir)/printf1.awk >_$@
- -$(CMP) $(srcdir)/printf1.ok _$@ && rm -f _$@
-
-funsmnam::
- @-AWKPATH=$(srcdir) $(AWK) -f funsmnam.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/funsmnam.ok _$@ && rm -f _$@
-
-fnamedat::
- @-AWKPATH=$(srcdir) $(AWK) -f fnamedat.awk < $(srcdir)/fnamedat.in >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/fnamedat.ok _$@ && rm -f _$@
-
-numindex::
- @-AWKPATH=$(srcdir) $(AWK) -f numindex.awk < $(srcdir)/numindex.in >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/numindex.ok _$@ && rm -f _$@
-
-subslash::
- @-AWKPATH=$(srcdir) $(AWK) -f subslash.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/subslash.ok _$@ && rm -f _$@
-
-opasnslf::
- @-AWKPATH=$(srcdir) $(AWK) -f opasnslf.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/opasnslf.ok _$@ && rm -f _$@
-
-opasnidx::
- @-AWKPATH=$(srcdir) $(AWK) -f opasnidx.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/opasnidx.ok _$@ && rm -f _$@
-
arynocls::
+ @echo $@
@-AWKPATH=$(srcdir) $(AWK) -v INPUT=$(srcdir)/arynocls.in -f arynocls.awk >_$@
- -$(CMP) $(srcdir)/arynocls.ok _$@ && rm -f _$@
-
-igncdym::
- @-AWKPATH=$(srcdir) $(AWK) -f igncdym.awk $(srcdir)/igncdym.in >_$@
- -$(CMP) $(srcdir)/igncdym.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/arynocls.ok _$@ && rm -f _$@
getlnbuf::
+ @echo $@
@-AWKPATH=$(srcdir) $(AWK) -f getlnbuf.awk $(srcdir)/getlnbuf.in > _$@
@-AWKPATH=$(srcdir) $(AWK) -f gtlnbufv.awk $(srcdir)/getlnbuf.in > _2$@
- -$(CMP) $(srcdir)/getlnbuf.ok _$@ && $(CMP) $(srcdir)/getlnbuf.ok _2$@ && rm -f _$@ _2$@
-
-arysubnm::
- @-AWKPATH=$(srcdir) $(AWK) -f arysubnm.awk >_$@
- -$(CMP) $(srcdir)/arysubnm.ok _$@ && rm -f _$@
-
-fnparydl::
- @-AWKPATH=$(srcdir) $(AWK) -f fnparydl.awk >_$@
- -$(CMP) $(srcdir)/fnparydl.ok _$@ && rm -f _$@
-
-nlstrina::
- @-AWKPATH=$(srcdir) $(AWK) -f nlstrina.awk >_$@
- -$(CMP) $(srcdir)/nlstrina.ok _$@ && rm -f _$@
-
-octsub::
- @-AWKPATH=$(srcdir) $(AWK) -f octsub.awk >_$@
- -$(CMP) $(srcdir)/octsub.ok _$@ && rm -f _$@
-
-nlinstr::
- @$(AWK) -f $(srcdir)/nlinstr.awk $(srcdir)/nlinstr.in >_$@
- -$(CMP) $(srcdir)/nlinstr.ok _$@ && rm -f _$@
-
-ofmt::
- @$(AWK) -f $(srcdir)/ofmt.awk $(srcdir)/ofmt.in >_$@
- -$(CMP) $(srcdir)/ofmt.ok _$@ && rm -f _$@
-
-hsprint::
- @$(AWK) -f $(srcdir)/hsprint.awk >_$@
- -$(CMP) $(srcdir)/hsprint.ok _$@ && rm -f _$@
-
-fsfwfs::
- @$(AWK) -f $(srcdir)/fsfwfs.awk $(srcdir)/fsfwfs.in >_$@
- -$(CMP) $(srcdir)/fsfwfs.ok _$@ && rm -f _$@
-
-ofmts::
- @$(AWK) -f $(srcdir)/ofmts.awk $(srcdir)/ofmts.in >_$@
- -$(CMP) $(srcdir)/ofmts.ok _$@ && rm -f _$@
-
-parseme::
- @-AWKPATH=$(srcdir) $(AWK) -f parseme.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/parseme.ok _$@ && rm -f _$@
-
-splitdef::
- @$(AWK) -f $(srcdir)/splitdef.awk >_$@
- -$(CMP) $(srcdir)/splitdef.ok _$@ && rm -f _$@
-
-fnaryscl::
- @-AWKPATH=$(srcdir) $(AWK) -f fnaryscl.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/fnaryscl.ok _$@ && rm -f _$@
-
-fnasgnm::
- @-AWKPATH=$(srcdir) $(AWK) -f fnasgnm.awk < $(srcdir)/fnasgnm.in >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/fnasgnm.ok _$@ && rm -f _$@
-
-lint::
- @-AWKPATH=$(srcdir) $(AWK) -f lint.awk > _$@ 2>&1
- -$(CMP) $(srcdir)/lint.ok _$@ && rm -f _$@
-
-procinfs::
- @-$(AWK) -f $(srcdir)/procinfs.awk > _$@
- -$(CMP) $(srcdir)/procinfs.ok _$@ && rm -f _$@
-
-sort1::
- @-$(AWK) -f $(srcdir)/sort1.awk > _$@
- -$(CMP) $(srcdir)/sort1.ok _$@ && rm -f _$@
-
-ofmtbig::
- @$(AWK) -f $(srcdir)/ofmtbig.awk $(srcdir)/ofmtbig.in >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/ofmtbig.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/getlnbuf.ok _$@ && $(CMP) $(srcdir)/getlnbuf.ok _2$@ && rm -f _$@ _2$@
inetmesg::
@echo These tests only work if your system supports the services
- @echo "'discard'" at port 9 and "'daytimed" at port 13. Check your
+ @echo "'discard'" at port 9 and "'daytimed'" at port 13. Check your
@echo file /etc/services and do "'netstat -a'".
inetechu::
@@ -1194,116 +1011,756 @@ inetdayt::
@$(AWK) 'BEGIN { print "" |& "/inet/tcp/0/127.0.0.1/13"; \
"/inet/tcp/0/127.0.0.1/13" |& getline; print $0}'
-paramtyp::
- @$(AWK) -f $(srcdir)/paramtyp.awk >_$@
- -$(CMP) $(srcdir)/paramtyp.ok _$@ && rm -f _$@
-
-rsnul1nl::
- @$(AWK) -f $(srcdir)/rsnul1nl.awk $(srcdir)/rsnul1nl.in >_$@
- -$(CMP) $(srcdir)/rsnul1nl.ok _$@ && rm -f _$@
-
-datanonl::
- @$(AWK) -f $(srcdir)/datanonl.awk $(srcdir)/datanonl.in >_$@
- -$(CMP) $(srcdir)/datanonl.ok _$@ && rm -f _$@
-
-regeq::
- @$(AWK) -f $(srcdir)/regeq.awk $(srcdir)/regeq.in >_$@
- -$(CMP) $(srcdir)/regeq.ok _$@ && rm -f _$@
-
redfilnm::
+ @echo $@
@$(AWK) -f $(srcdir)/redfilnm.awk srcdir=$(srcdir) $(srcdir)/redfilnm.in >_$@
- -$(CMP) $(srcdir)/redfilnm.ok _$@ && rm -f _$@
-
-strtod::
- @$(AWK) -f $(srcdir)/strtod.awk $(srcdir)/strtod.in >_$@
- -$(CMP) $(srcdir)/strtod.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/redfilnm.ok _$@ && rm -f _$@
leaddig::
+ @echo $@
@$(AWK) -v x=2E -f $(srcdir)/leaddig.awk >_$@
- -$(CMP) $(srcdir)/leaddig.ok _$@ && rm -f _$@
-
-clos1way::
- @$(AWK) -f $(srcdir)/clos1way.awk >_$@
- -$(CMP) $(srcdir)/clos1way.ok _$@ && rm -f _$@
-
-arynasty::
- @$(AWK) -f $(srcdir)/arynasty.awk >_$@
- -$(CMP) $(srcdir)/arynasty.ok _$@ && rm -f _$@
-
-shadow::
- @-AWKPATH=$(srcdir) $(AWK) --lint -f shadow.awk >_$@ 2>&1 || exit 0
- -$(CMP) $(srcdir)/shadow.ok _$@ && rm -f _$@
-
-regx8bit::
- @$(AWK) -f $(srcdir)/regx8bit.awk >_$@
- -$(CMP) $(srcdir)/regx8bit.ok _$@ && rm -f _$@
-
-psx96sub::
- @$(AWK) -f $(srcdir)/psx96sub.awk >_$@
- -$(CMP) $(srcdir)/psx96sub.ok _$@ && rm -f _$@
-
-addcomma::
- @$(AWK) -f $(srcdir)/addcomma.awk $(srcdir)/addcomma.in >_$@
- -$(CMP) $(srcdir)/addcomma.ok _$@ && rm -f _$@
-
-gnuops2::
- @$(AWK) -f $(srcdir)/gnuops2.awk >_$@
- -$(CMP) $(srcdir)/gnuops2.ok _$@ && rm -f _$@
-
-rebt8b1::
- @$(AWK) -f $(srcdir)/rebt8b1.awk >_$@
- -$(CMP) $(srcdir)/rebt8b1.ok _$@ && rm -f _$@
-
-rebt8b2::
- @$(AWK) -f $(srcdir)/rebt8b2.awk >_$@
- -$(CMP) $(srcdir)/rebt8b2.ok _$@ && rm -f _$@
-
-leadnl::
- @$(AWK) -f $(srcdir)/leadnl.awk $(srcdir)/leadnl.in >_$@
- -$(CMP) $(srcdir)/leadnl.ok _$@ && rm -f _$@
-
-funsemnl::
- @$(AWK) -f $(srcdir)/funsemnl.awk >_$@
- -$(CMP) $(srcdir)/funsemnl.ok _$@ && rm -f _$@
-
-ofmtfidl::
- @$(AWK) -f $(srcdir)/ofmtfidl.awk $(srcdir)/ofmtfidl.in >_$@
- -$(CMP) $(srcdir)/ofmtfidl.ok _$@ && rm -f _$@
-
-onlynl::
- @$(AWK) -f $(srcdir)/onlynl.awk $(srcdir)/onlynl.in >_$@
- -$(CMP) $(srcdir)/onlynl.ok _$@ && rm -f _$@
-
-arrymem1::
- @$(AWK) -f $(srcdir)/arrymem1.awk >_$@
- -$(CMP) $(srcdir)/arrymem1.ok _$@ && rm -f _$@
-
-compare2::
- @$(AWK) -f $(srcdir)/compare2.awk >_$@
- -$(CMP) $(srcdir)/compare2.ok _$@ && rm -f _$@
-
-minusstr::
- @$(AWK) -f $(srcdir)/minusstr.awk >_$@
- -$(CMP) $(srcdir)/minusstr.ok _$@ && rm -f _$@
-
-membug1::
- @$(AWK) -f $(srcdir)/membug1.awk $(srcdir)/membug1.in >_$@
- -$(CMP) $(srcdir)/membug1.ok _$@ && rm -f _$@
-
-forsimp::
- @$(AWK) -f $(srcdir)/forsimp.awk >_$@
- -$(CMP) $(srcdir)/forsimp.ok _$@ && rm -f _$@
-
-concat1::
- @$(AWK) -f $(srcdir)/concat1.awk $(srcdir)/concat1.in >_$@
- -$(CMP) $(srcdir)/concat1.ok _$@ && rm -f _$@
-
-longsub::
- @$(AWK) -f $(srcdir)/longsub.awk $(srcdir)/longsub.in >_$@
- -$(CMP) $(srcdir)/longsub.ok _$@ && rm -f _$@
+ @-$(CMP) $(srcdir)/leaddig.ok _$@ && rm -f _$@
+
+gsubtst3::
+ @echo $@
+ @$(AWK) --re-interval -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+space::
+ @echo $@
+ @$(AWK) -f ' ' $(srcdir)/space.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+printf0::
+ @echo $@
+ @$(AWK) --posix -f $(srcdir)/$@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+Gt-dummy:
+# file Maketests, generated from Makefile.am by the Gentests program
+addcomma:
+ @echo addcomma
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+anchgsub:
+ @echo anchgsub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arrayparm:
+ @echo arrayparm
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arrayref:
+ @echo arrayref
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arrymem1:
+ @echo arrymem1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arynasty:
+ @echo arynasty
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arysubnm:
+ @echo arysubnm
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+asgext:
+ @echo asgext
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+back89:
+ @echo back89
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+backgsub:
+ @echo backgsub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+childin:
+ @echo childin
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+clsflnam:
+ @echo clsflnam
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+compare2:
+ @echo compare2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+concat1:
+ @echo concat1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+convfmt:
+ @echo convfmt
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+datanonl:
+ @echo datanonl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+defref:
+ @echo defref
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+delarprm:
+ @echo delarprm
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+dynlj:
+ @echo dynlj
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+eofsplit:
+ @echo eofsplit
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fldchg:
+ @echo fldchg
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fldchgnf:
+ @echo fldchgnf
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnamedat:
+ @echo fnamedat
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnarray:
+ @echo fnarray
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnarydel:
+ @echo fnarydel
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnaryscl:
+ @echo fnaryscl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnasgnm:
+ @echo fnasgnm
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnmisc:
+ @echo fnmisc
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnparydl:
+ @echo fnparydl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+forsimp:
+ @echo forsimp
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fsbs:
+ @echo fsbs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fsrs:
+ @echo fsrs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fstabplus:
+ @echo fstabplus
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+funsemnl:
+ @echo funsemnl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+funsmnam:
+ @echo funsmnam
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+funstack:
+ @echo funstack
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+getline:
+ @echo getline
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+getline3:
+ @echo getline3
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+getnr2tb:
+ @echo getnr2tb
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+getnr2tm:
+ @echo getnr2tm
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gsubasgn:
+ @echo gsubasgn
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gsubtest:
+ @echo gsubtest
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gsubtst2:
+ @echo gsubtst2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gsubtst4:
+ @echo gsubtst4
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+hsprint:
+ @echo hsprint
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+inputred:
+ @echo inputred
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+intest:
+ @echo intest
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+intprec:
+ @echo intprec
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+leadnl:
+ @echo leadnl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+longsub:
+ @echo longsub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+longwrds:
+ @echo longwrds
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+math:
+ @echo math
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+membug1:
+ @echo membug1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+minusstr:
+ @echo minusstr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nasty:
+ @echo nasty
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nasty2:
+ @echo nasty2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+negexp:
+ @echo negexp
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nfldstr:
+ @echo nfldstr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nfneg:
+ @echo nfneg
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nfset:
+ @echo nfset
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nlfldsep:
+ @echo nlfldsep
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nlinstr:
+ @echo nlinstr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nlstrina:
+ @echo nlstrina
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+noeffect:
+ @echo noeffect
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nofmtch:
+ @echo nofmtch
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+noloop1:
+ @echo noloop1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+noloop2:
+ @echo noloop2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+noparms:
+ @echo noparms
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nulrsend:
+ @echo nulrsend
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+numindex:
+ @echo numindex
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+numsubstr:
+ @echo numsubstr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+octsub:
+ @echo octsub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ofmt:
+ @echo ofmt
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ofmtbig:
+ @echo ofmtbig
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ofmtfidl:
+ @echo ofmtfidl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ofmts:
+ @echo ofmts
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+onlynl:
+ @echo onlynl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+opasnidx:
+ @echo opasnidx
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+opasnslf:
+ @echo opasnslf
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+paramdup:
+ @echo paramdup
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+paramtyp:
+ @echo paramtyp
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+parseme:
+ @echo parseme
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+pcntplus:
+ @echo pcntplus
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prdupval:
+ @echo prdupval
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prec:
+ @echo prec
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+printf1:
+ @echo printf1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prmarscl:
+ @echo prmarscl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prmreuse:
+ @echo prmreuse
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prt1eval:
+ @echo prt1eval
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prtoeval:
+ @echo prtoeval
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+psx96sub:
+ @echo psx96sub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rand:
+ @echo rand
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rebt8b1:
+ @echo rebt8b1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rebt8b2:
+ @echo rebt8b2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+regeq:
+ @echo regeq
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+reindops:
+ @echo reindops
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+reparse:
+ @echo reparse
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+resplit:
+ @echo resplit
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rs:
+ @echo rs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rsnul1nl:
+ @echo rsnul1nl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rstest1:
+ @echo rstest1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rstest2:
+ @echo rstest2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rswhite:
+ @echo rswhite
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+sclforin:
+ @echo sclforin
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+sclifin:
+ @echo sclifin
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+splitargv:
+ @echo splitargv
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+splitarr:
+ @echo splitarr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+splitdef:
+ @echo splitdef
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+splitvar:
+ @echo splitvar
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+splitwht:
+ @echo splitwht
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+sprintfc:
+ @echo sprintfc
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+strtod:
+ @echo strtod
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+subslash:
+ @echo subslash
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+substr:
+ @echo substr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+swaplns:
+ @echo swaplns
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+synerr1:
+ @echo synerr1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+uninitialized:
+ @echo uninitialized
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+uninit2:
+ @echo uninit2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+zeroe0:
+ @echo zeroe0
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+zeroflag:
+ @echo zeroflag
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+getlnhd:
+ @echo getlnhd
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+asort:
+ @echo asort
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+asorti:
+ @echo asorti
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+clos1way:
+ @echo clos1way
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fieldwdth:
+ @echo fieldwdth
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fsfwfs:
+ @echo fsfwfs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gensub:
+ @echo gensub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gnuops2:
+ @echo gnuops2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gnureops:
+ @echo gnureops
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+icasefs:
+ @echo icasefs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+icasers:
+ @echo icasers
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+igncdym:
+ @echo igncdym
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+igncfs:
+ @echo igncfs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ignrcase:
+ @echo ignrcase
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+lint:
+ @echo lint
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+match1:
+ @echo match1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nondec:
+ @echo nondec
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+posix:
+ @echo posix
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+procinfs:
+ @echo procinfs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+regx8bit:
+ @echo regx8bit
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rebuf:
+ @echo rebuf
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+shadow:
+ @echo shadow
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+sort1:
+ @echo sort1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+# end of file Maketests
+
+# Targets generated for other tests:
+
+$(srcdir)/Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
+ $(AWK) -f $(srcdir)/Gentests "$<" *.awk *.in > $(srcdir)/Maketests
clean:
- rm -fr _* core junk out1 out2 out3 strftime.ok test1 test2 seq *~
+ rm -fr _* core core.* junk out1 out2 out3 strftime.ok test1 test2 seq *~
# An attempt to print something that can be grepped for in build logs
pass-fail:
@@ -1320,6 +1777,18 @@ diffout:
echo ============== $$i ============= ; \
diff -c $${i#_}.ok $$i ; \
done | more
+
+# This target is for testing with electric fence.
+efence:
+ for i in $$(ls _* | sed 's;_\(.*\);\1;') ; \
+ do \
+ bad=$$(wc -l < _$$i) \
+ ok=$$(wc -l < $$i.ok) ; \
+ if (( $$bad == $$ok + 2 )) ; \
+ then \
+ rm _$$i ; \
+ fi ; \
+ done
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/test/Maketests b/test/Maketests
new file mode 100644
index 00000000..97179e7b
--- /dev/null
+++ b/test/Maketests
@@ -0,0 +1,718 @@
+Gt-dummy:
+# file Maketests, generated from Makefile.am by the Gentests program
+addcomma:
+ @echo addcomma
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+anchgsub:
+ @echo anchgsub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arrayparm:
+ @echo arrayparm
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arrayref:
+ @echo arrayref
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arrymem1:
+ @echo arrymem1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arynasty:
+ @echo arynasty
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+arysubnm:
+ @echo arysubnm
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+asgext:
+ @echo asgext
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+back89:
+ @echo back89
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+backgsub:
+ @echo backgsub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+childin:
+ @echo childin
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+clsflnam:
+ @echo clsflnam
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+compare2:
+ @echo compare2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+concat1:
+ @echo concat1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+convfmt:
+ @echo convfmt
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+datanonl:
+ @echo datanonl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+defref:
+ @echo defref
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+delarprm:
+ @echo delarprm
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+dynlj:
+ @echo dynlj
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+eofsplit:
+ @echo eofsplit
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fldchg:
+ @echo fldchg
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fldchgnf:
+ @echo fldchgnf
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnamedat:
+ @echo fnamedat
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnarray:
+ @echo fnarray
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnarydel:
+ @echo fnarydel
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnaryscl:
+ @echo fnaryscl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnasgnm:
+ @echo fnasgnm
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnmisc:
+ @echo fnmisc
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fnparydl:
+ @echo fnparydl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+forsimp:
+ @echo forsimp
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fsbs:
+ @echo fsbs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fsrs:
+ @echo fsrs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fstabplus:
+ @echo fstabplus
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+funsemnl:
+ @echo funsemnl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+funsmnam:
+ @echo funsmnam
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+funstack:
+ @echo funstack
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+getline:
+ @echo getline
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+getline3:
+ @echo getline3
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+getnr2tb:
+ @echo getnr2tb
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+getnr2tm:
+ @echo getnr2tm
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gsubasgn:
+ @echo gsubasgn
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gsubtest:
+ @echo gsubtest
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gsubtst2:
+ @echo gsubtst2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gsubtst4:
+ @echo gsubtst4
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+hsprint:
+ @echo hsprint
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+inputred:
+ @echo inputred
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+intest:
+ @echo intest
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+intprec:
+ @echo intprec
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+leadnl:
+ @echo leadnl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+longsub:
+ @echo longsub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+longwrds:
+ @echo longwrds
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+math:
+ @echo math
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+membug1:
+ @echo membug1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+minusstr:
+ @echo minusstr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nasty:
+ @echo nasty
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nasty2:
+ @echo nasty2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+negexp:
+ @echo negexp
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nfldstr:
+ @echo nfldstr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nfneg:
+ @echo nfneg
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nfset:
+ @echo nfset
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nlfldsep:
+ @echo nlfldsep
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nlinstr:
+ @echo nlinstr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nlstrina:
+ @echo nlstrina
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+noeffect:
+ @echo noeffect
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nofmtch:
+ @echo nofmtch
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+noloop1:
+ @echo noloop1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+noloop2:
+ @echo noloop2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+noparms:
+ @echo noparms
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nulrsend:
+ @echo nulrsend
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+numindex:
+ @echo numindex
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+numsubstr:
+ @echo numsubstr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+octsub:
+ @echo octsub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ofmt:
+ @echo ofmt
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ofmtbig:
+ @echo ofmtbig
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ofmtfidl:
+ @echo ofmtfidl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ofmts:
+ @echo ofmts
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+onlynl:
+ @echo onlynl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+opasnidx:
+ @echo opasnidx
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+opasnslf:
+ @echo opasnslf
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+paramdup:
+ @echo paramdup
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+paramtyp:
+ @echo paramtyp
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+parseme:
+ @echo parseme
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+pcntplus:
+ @echo pcntplus
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prdupval:
+ @echo prdupval
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prec:
+ @echo prec
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+printf1:
+ @echo printf1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prmarscl:
+ @echo prmarscl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prmreuse:
+ @echo prmreuse
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prt1eval:
+ @echo prt1eval
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+prtoeval:
+ @echo prtoeval
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+psx96sub:
+ @echo psx96sub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rand:
+ @echo rand
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rebt8b1:
+ @echo rebt8b1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rebt8b2:
+ @echo rebt8b2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+regeq:
+ @echo regeq
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+reindops:
+ @echo reindops
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+reparse:
+ @echo reparse
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+resplit:
+ @echo resplit
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rs:
+ @echo rs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rsnul1nl:
+ @echo rsnul1nl
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rstest1:
+ @echo rstest1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rstest2:
+ @echo rstest2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rswhite:
+ @echo rswhite
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+sclforin:
+ @echo sclforin
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+sclifin:
+ @echo sclifin
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+splitargv:
+ @echo splitargv
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+splitarr:
+ @echo splitarr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+splitdef:
+ @echo splitdef
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+splitvar:
+ @echo splitvar
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+splitwht:
+ @echo splitwht
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+sprintfc:
+ @echo sprintfc
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+strtod:
+ @echo strtod
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+subslash:
+ @echo subslash
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+substr:
+ @echo substr
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+swaplns:
+ @echo swaplns
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+synerr1:
+ @echo synerr1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+uninitialized:
+ @echo uninitialized
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+uninit2:
+ @echo uninit2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+zeroe0:
+ @echo zeroe0
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+zeroflag:
+ @echo zeroflag
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+getlnhd:
+ @echo getlnhd
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+asort:
+ @echo asort
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+asorti:
+ @echo asorti
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+clos1way:
+ @echo clos1way
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fieldwdth:
+ @echo fieldwdth
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+fsfwfs:
+ @echo fsfwfs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gensub:
+ @echo gensub
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gnuops2:
+ @echo gnuops2
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+gnureops:
+ @echo gnureops
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+icasefs:
+ @echo icasefs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+icasers:
+ @echo icasers
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+igncdym:
+ @echo igncdym
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+igncfs:
+ @echo igncfs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+ignrcase:
+ @echo ignrcase
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+lint:
+ @echo lint
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+match1:
+ @echo match1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+nondec:
+ @echo nondec
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+posix:
+ @echo posix
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+procinfs:
+ @echo procinfs
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+regx8bit:
+ @echo regx8bit
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+rebuf:
+ @echo rebuf
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+shadow:
+ @echo shadow
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+sort1:
+ @echo sort1
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+# end of file Maketests
diff --git a/test/arrayparm.ok b/test/arrayparm.ok
index 4a775efe..4dd199f4 100644
--- a/test/arrayparm.ok
+++ b/test/arrayparm.ok
@@ -1 +1,2 @@
gawk: arrayparm.awk:18: fatal: attempt to use array `i (from foo)' in a scalar context
+EXIT CODE: 2
diff --git a/test/arrymem1.awk b/test/arrymem1.awk
index 561cc956..0a4ae899 100644
--- a/test/arrymem1.awk
+++ b/test/arrymem1.awk
@@ -40,14 +40,20 @@
}
function f1(Procs,a) {
- a[""]
+ # a[""]
+ a[""] = "a" # ADR: Give it a value so can trace it
f2()
}
function f2() {
- b[""]
+ # b[""]
+ b[""] = "b" # ADR: Give it a value so can trace it
}
+ # ADR: 1/28/2003: Added this:
+ BEGIN { for (i in b) printf("b[\"%s\"] = \"%s\"\n", i, b[i]) }
+ # END ADR added.
+
# gives:
#
# gawk: ./gtest:5: fatal error: internal error
diff --git a/test/arrymem1.ok b/test/arrymem1.ok
index 9daeafb9..e37775bc 100644
--- a/test/arrymem1.ok
+++ b/test/arrymem1.ok
@@ -1 +1,2 @@
test
+b[""] = "b"
diff --git a/test/asort.awk b/test/asort.awk
new file mode 100644
index 00000000..8a42e26a
--- /dev/null
+++ b/test/asort.awk
@@ -0,0 +1,25 @@
+function init(a)
+{
+ a[1] = "aardvark"
+ a[2] = "animal"
+ a[3] = "zebra"
+ a[4] = "zoo"
+ a[5] = "Iguana"
+ a[6] = "Alligator"
+ a[7] = "Nouns"
+ a[8] = "people"
+}
+
+BEGIN {
+
+ for (IGNORECASE = 0; IGNORECASE < 2; IGNORECASE++) {
+ init(a)
+
+ n = asort(a)
+
+ for (i = 1; i <= n; i++)
+ printf("a[%d] = \"%s\"\n", i, a[i])
+
+ print "============"
+ }
+}
diff --git a/test/asort.ok b/test/asort.ok
new file mode 100644
index 00000000..1d0ddd0f
--- /dev/null
+++ b/test/asort.ok
@@ -0,0 +1,18 @@
+a[1] = "Alligator"
+a[2] = "Iguana"
+a[3] = "Nouns"
+a[4] = "aardvark"
+a[5] = "animal"
+a[6] = "people"
+a[7] = "zebra"
+a[8] = "zoo"
+============
+a[1] = "aardvark"
+a[2] = "Alligator"
+a[3] = "animal"
+a[4] = "Iguana"
+a[5] = "Nouns"
+a[6] = "people"
+a[7] = "zebra"
+a[8] = "zoo"
+============
diff --git a/test/asorti.awk b/test/asorti.awk
new file mode 100644
index 00000000..3314c9f3
--- /dev/null
+++ b/test/asorti.awk
@@ -0,0 +1,27 @@
+function init(a)
+{
+ delete a
+
+ a["aardvark"] = 1
+ a["animal"] = 2
+ a["zebra"] = 3
+ a["zoo"] = 4
+ a["Iguana"] = 5
+ a["Alligator"] = 6
+ a["Nouns"] = 7
+ a["people"] = 8
+}
+
+BEGIN {
+
+ for (IGNORECASE = 0; IGNORECASE < 2; IGNORECASE++) {
+ init(a)
+
+ n = asorti(a)
+
+ for (i = 1; i <= n; i++)
+ printf("a[%d] = \"%s\"\n", i, a[i])
+
+ print "============"
+ }
+}
diff --git a/test/asorti.ok b/test/asorti.ok
new file mode 100644
index 00000000..1d0ddd0f
--- /dev/null
+++ b/test/asorti.ok
@@ -0,0 +1,18 @@
+a[1] = "Alligator"
+a[2] = "Iguana"
+a[3] = "Nouns"
+a[4] = "aardvark"
+a[5] = "animal"
+a[6] = "people"
+a[7] = "zebra"
+a[8] = "zoo"
+============
+a[1] = "aardvark"
+a[2] = "Alligator"
+a[3] = "animal"
+a[4] = "Iguana"
+a[5] = "Nouns"
+a[6] = "people"
+a[7] = "zebra"
+a[8] = "zoo"
+============
diff --git a/test/back89.awk b/test/back89.awk
new file mode 100644
index 00000000..0da33625
--- /dev/null
+++ b/test/back89.awk
@@ -0,0 +1 @@
+/a\8b/
diff --git a/test/childin.awk b/test/childin.awk
new file mode 100644
index 00000000..041c6ec1
--- /dev/null
+++ b/test/childin.awk
@@ -0,0 +1 @@
+BEGIN { "cat" | getline; print; close("cat") }
diff --git a/test/childin.in b/test/childin.in
new file mode 100644
index 00000000..45b983be
--- /dev/null
+++ b/test/childin.in
@@ -0,0 +1 @@
+hi
diff --git a/test/defref.ok b/test/defref.ok
index f833c961..e0061a0d 100644
--- a/test/defref.ok
+++ b/test/defref.ok
@@ -1,2 +1,3 @@
gawk: defref.awk:2: warning: function `foo' called but never defined
gawk: defref.awk:1: fatal: function `foo' not defined
+EXIT CODE: 2
diff --git a/test/fieldwdth.awk b/test/fieldwdth.awk
new file mode 100644
index 00000000..f2eeb6ce
--- /dev/null
+++ b/test/fieldwdth.awk
@@ -0,0 +1,2 @@
+BEGIN { FIELDWIDTHS = "2 3 4" }
+{ print $2 }
diff --git a/test/fieldwdth.in b/test/fieldwdth.in
new file mode 100644
index 00000000..28d14454
--- /dev/null
+++ b/test/fieldwdth.in
@@ -0,0 +1 @@
+123456789
diff --git a/test/fnamedat.ok b/test/fnamedat.ok
index 0dd0ae5a..d32acff4 100644
--- a/test/fnamedat.ok
+++ b/test/fnamedat.ok
@@ -1 +1,2 @@
gawk: fnamedat.awk:1: (FILENAME=- FNR=1) fatal: can't use function name `foo' as variable or array
+EXIT CODE: 2
diff --git a/test/fnarray.ok b/test/fnarray.ok
index 94beacdd..2ef124b7 100644
--- a/test/fnarray.ok
+++ b/test/fnarray.ok
@@ -1 +1,3 @@
-gawk: fnarray.awk:5: fatal: attempt to use function `foo' as array
+gawk: fnarray.awk:5: fatal: function `foo' called with space between name and `(',
+or used as a variable or an array
+EXIT CODE: 2
diff --git a/test/fnaryscl.ok b/test/fnaryscl.ok
index d39dfdcc..2fecd582 100644
--- a/test/fnaryscl.ok
+++ b/test/fnaryscl.ok
@@ -1 +1,2 @@
gawk: fnaryscl.awk:10: fatal: attempt to use array `c (from b (from a (from foo)))' in a scalar context
+EXIT CODE: 2
diff --git a/test/fnasgnm.ok b/test/fnasgnm.ok
index 844893c0..0db5c6d8 100644
--- a/test/fnasgnm.ok
+++ b/test/fnasgnm.ok
@@ -1 +1,2 @@
gawk: fnasgnm.awk:14: (FILENAME=- FNR=1) fatal: can't use function name `ShowMe' as variable or array
+EXIT CODE: 2
diff --git a/test/fnmisc.awk b/test/fnmisc.awk
new file mode 100644
index 00000000..4dcc94ee
--- /dev/null
+++ b/test/fnmisc.awk
@@ -0,0 +1,13 @@
+# Tue Feb 4 12:20:10 IST 2003
+
+# Misc functions tests, in case we start mucking around in the grammar again.
+
+# Empty body shouldn't hurt anything:
+function f() {}
+BEGIN { f() }
+
+# Using a built-in function name should manage the symbol table
+# correctly:
+function split(x) { return x }
+
+function x(a) { return a }
diff --git a/test/fnmisc.ok b/test/fnmisc.ok
new file mode 100644
index 00000000..a265e401
--- /dev/null
+++ b/test/fnmisc.ok
@@ -0,0 +1,3 @@
+gawk: fnmisc.awk:11: function split(x) { return x }
+gawk: fnmisc.awk:11: ^ `split' is a built-in function, it cannot be redefined
+EXIT CODE: 1
diff --git a/test/fsbs.awk b/test/fsbs.awk
new file mode 100644
index 00000000..d2ec52ee
--- /dev/null
+++ b/test/fsbs.awk
@@ -0,0 +1,2 @@
+BEGIN { FS = "\\" }
+{ print $1, $2 }
diff --git a/test/fstabplus.in b/test/fstabplus.in
new file mode 100644
index 00000000..c35ba0a2
--- /dev/null
+++ b/test/fstabplus.in
@@ -0,0 +1 @@
+1 2
diff --git a/test/funsmnam.ok b/test/funsmnam.ok
index bc68a2f3..c0234f3a 100644
--- a/test/funsmnam.ok
+++ b/test/funsmnam.ok
@@ -1 +1,2 @@
gawk: funsmnam.awk:6: fatal: function `foo': can't use function name as parameter name
+EXIT CODE: 2
diff --git a/test/getline.awk b/test/getline.awk
index f4e413f9..fc09f789 100644
--- a/test/getline.awk
+++ b/test/getline.awk
@@ -1 +1,29 @@
-BEGIN { while( getline > 0) { print } }
+BEGIN {
+ x = y = "s"
+ a = (getline x y)
+ print a, x
+ a = (getline x + 1)
+ print a, x
+ a = (getline x - 2)
+ print a, x
+
+ cmd = "echo A"
+ a = (cmd | getline x y)
+ close(cmd)
+ print a, x
+
+ cmd = "echo B"
+ a = (cmd | getline x + 1)
+ close(cmd)
+ print a, x
+
+ cmd = "echo C"
+ a = (cmd | getline x - 2)
+ close(cmd)
+ print a, x
+
+ cmd = "echo D"
+ a = cmd | getline x
+ close(cmd)
+ print a, x
+}
diff --git a/test/getline.in b/test/getline.in
new file mode 100644
index 00000000..b1e67221
--- /dev/null
+++ b/test/getline.in
@@ -0,0 +1,3 @@
+A
+B
+C
diff --git a/test/getline.ok b/test/getline.ok
index 9b7f2b90..dd5bdb64 100644
--- a/test/getline.ok
+++ b/test/getline.ok
@@ -1,2 +1,7 @@
-BEGIN { while( getline > 0) { print } }
-BEGIN { while( getline > 0) { print } }
+1s A
+2 B
+-1 C
+1s A
+2 B
+-1 C
+1 D
diff --git a/test/getline2.awk b/test/getline2.awk
new file mode 100644
index 00000000..f4e413f9
--- /dev/null
+++ b/test/getline2.awk
@@ -0,0 +1 @@
+BEGIN { while( getline > 0) { print } }
diff --git a/test/getline2.ok b/test/getline2.ok
new file mode 100644
index 00000000..9b7f2b90
--- /dev/null
+++ b/test/getline2.ok
@@ -0,0 +1,2 @@
+BEGIN { while( getline > 0) { print } }
+BEGIN { while( getline > 0) { print } }
diff --git a/test/getline3.awk b/test/getline3.awk
new file mode 100644
index 00000000..03e1239d
--- /dev/null
+++ b/test/getline3.awk
@@ -0,0 +1,7 @@
+BEGIN {
+ cmd = "echo 3"
+ y = 7
+ cmd | getline x y
+ close(cmd)
+ print (cmd | getline x y)
+}
diff --git a/test/getline3.ok b/test/getline3.ok
new file mode 100644
index 00000000..98d9bcb7
--- /dev/null
+++ b/test/getline3.ok
@@ -0,0 +1 @@
+17
diff --git a/test/gsubasgn.ok b/test/gsubasgn.ok
index dfa6fbc7..8817c36d 100644
--- a/test/gsubasgn.ok
+++ b/test/gsubasgn.ok
@@ -2,3 +2,4 @@ gawk: gsubasgn.awk:4: function test1 (r) { gsub(r, "x", test1) }
gawk: gsubasgn.awk:4: ^ gsub third parameter is not a changeable object
gawk: gsubasgn.awk:8: function test2 () { gsub(/a/, "x", test2) }
gawk: gsubasgn.awk:8: ^ gsub third parameter is not a changeable object
+EXIT CODE: 1
diff --git a/test/gsubtest.awk b/test/gsubtest.awk
index 5dfefe93..1d6fd1cf 100644
--- a/test/gsubtest.awk
+++ b/test/gsubtest.awk
@@ -5,4 +5,5 @@ BEGIN {
str = "abc"; print gsub("c", "X", str), str
str = "abc"; print gsub("c+", "X", str), str
str = "abc"; print gsub("x*$", "X", str), str
+ str = "abc"; print gsub("b|$", "X", str), str
}
diff --git a/test/gsubtest.ok b/test/gsubtest.ok
index 7c18f431..f909d0d2 100644
--- a/test/gsubtest.ok
+++ b/test/gsubtest.ok
@@ -4,3 +4,4 @@
1 abX
1 abX
1 abcX
+2 aXcX
diff --git a/test/gsubtst2.awk b/test/gsubtst2.awk
new file mode 100644
index 00000000..fafbf963
--- /dev/null
+++ b/test/gsubtst2.awk
@@ -0,0 +1,241 @@
+#From arnold Thu May 9 17:27:03 2002
+#Return-Path: <arnold@skeeve.com>
+#Received: (from arnold@localhost)
+# by skeeve.com (8.11.6/8.11.6) id g49ER3K27925
+# for arnold; Thu, 9 May 2002 17:27:03 +0300
+#Date: Thu, 9 May 2002 17:27:03 +0300
+#From: Aharon Robbins <arnold@skeeve.com>
+#Message-Id: <200205091427.g49ER3K27925@skeeve.com>
+#To: arnold@skeeve.com
+#Subject: fixme
+#X-SpamBouncer: 1.4 (10/07/01)
+#X-SBRule: Pattern Match (Other Patterns) (Score: 4850)
+#X-SBRule: Pattern Match (Spam Phone #) (Score: 0)
+#X-SBClass: Blocked
+#Status: O
+#
+#Path: ord-read.news.verio.net!dfw-artgen!iad-peer.news.verio.net!news.verio.net!fu-berlin.de!uni-berlin.de!host213-120-137-48.in-addr.btopenworld.COM!not-for-mail
+#From: laura@madonnaweb.com (laura fairhead)
+#Newsgroups: comp.lang.awk
+#Subject: bug in gawk3.1.0 regex code
+#Date: Wed, 08 May 2002 23:31:40 GMT
+#Organization: that'll be the daewooo :)
+#Lines: 211
+#Message-ID: <3cd9b0f7.29675926@NEWS.CIS.DFN.DE>
+#Reply-To: laura@madonnaweb.com
+#NNTP-Posting-Host: host213-120-137-48.in-addr.btopenworld.com (213.120.137.48)
+#X-Trace: fu-berlin.de 1020900891 18168286 213.120.137.48 (16 [53286])
+#X-Newsreader: Forte Free Agent 1.21/32.243
+#Xref: dfw-artgen comp.lang.awk:13059
+#
+#
+#I believe I've just found a bug in gawk3.1.0 implementation of
+#extended regular expressions. It seems to be down to the alternation
+#operator; when using an end anchor '$' as a subexpression in an
+#alternation and the entire matched RE is a nul-string it fails
+#to match the end of string, for example;
+#
+#gsub(/$|2/,"x")
+#print
+#
+#input = 12345
+#expected output = 1x345x
+#actual output = 1x345
+#
+#The start anchor '^' always works as expected;
+#
+#gsub(/^|2/,"x")
+#print
+#
+#input = 12345
+#expected output = x1x345
+#actual output = x1x345
+#
+#This was with POSIX compliance enabled althought that doesn't
+#effect the result.
+#
+#I checked on gawk3.0.6 and got exactly the same results however
+#gawk2.15.6 gives the expected results.
+#
+#I'm about to post a bug report about this into gnu.utils.bug
+#but I thought I'd post it here first in case anyone has
+#any input/comments/whatever ....
+#
+#Complete test results were as follows;
+#
+#input 12345
+#output gsub(/regex/,"x",input)
+#
+#regex output
+#(^) x12345
+#($) 12345x
+#(^)|($) x12345x
+#($)|(^) x12345x
+#(2) 1x345
+#(^)|2 x1x345
+#2|(^) x1x345
+#($)|2 1x345
+#2|($) 1x345
+#(2)|(^) x1x345
+#(^)|(2) x1x345
+#(2)|($) 1x345
+#($)|(2) 1x345
+#.((2)|(^)) x345
+#.((^)|(2)) x345
+#.((2)|($)) x34x
+#.(($)|(2)) x34x
+#x{0}((2)|(^)) x1x345
+#x{0}((^)|(2)) x1x345
+#x{0}((2)|($)) 1x345
+#x{0}(($)|(2)) 1x345
+#x*((2)|(^)) x1x345
+#x*((^)|(2)) x1x345
+#x*((2)|($)) 1x345
+#x*(($)|(2)) 1x345
+#
+#Here's the test program I used, a few of the cases use ERE {n[,[m]]}
+#operators so that will have to be commented out or have a check
+#added or something (should have put a conditional in I know... ;-)
+#
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+BEGIN{
+
+TESTSTR="12345"
+
+print "input "TESTSTR
+print "output gsub(/regex/,\"x\",input)"
+print ""
+
+print "regex output"
+$0=TESTSTR
+gsub(/(^)/,"x")
+print "(^) "$0
+
+$0=TESTSTR
+gsub(/($)/,"x")
+print "($) "$0
+
+$0=TESTSTR
+gsub(/(^)|($)/,"x")
+print "(^)|($) "$0
+
+$0=TESTSTR
+gsub(/($)|(^)/,"x")
+print "($)|(^) "$0
+
+$0=TESTSTR
+gsub(/2/,"x")
+print "(2) "$0
+
+$0=TESTSTR
+gsub(/(^)|2/,"x")
+print "(^)|2 "$0
+
+$0=TESTSTR
+gsub(/2|(^)/,"x")
+print "2|(^) "$0
+
+$0=TESTSTR
+gsub(/($)|2/,"x")
+print "($)|2 "$0
+
+$0=TESTSTR
+gsub(/2|($)/,"x")
+print "2|($) "$0
+
+$0=TESTSTR
+gsub(/(2)|(^)/,"x")
+print "(2)|(^) "$0
+
+$0=TESTSTR
+gsub(/(^)|(2)/,"x")
+print "(^)|(2) "$0
+
+$0=TESTSTR
+gsub(/(2)|($)/,"x")
+print "(2)|($) "$0
+
+$0=TESTSTR
+gsub(/($)|(2)/,"x")
+print "($)|(2) "$0
+
+$0=TESTSTR
+gsub(/.((2)|(^))/,"x")
+print ".((2)|(^)) "$0
+
+$0=TESTSTR
+gsub(/.((^)|(2))/,"x")
+print ".((^)|(2)) "$0
+
+$0=TESTSTR
+gsub(/.((2)|($))/,"x")
+print ".((2)|($)) "$0
+
+$0=TESTSTR
+gsub(/.(($)|(2))/,"x")
+print ".(($)|(2)) "$0
+
+# $0=TESTSTR
+# gsub(/x{0}((2)|(^))/,"x")
+# print "x{0}((2)|(^)) "$0
+#
+# $0=TESTSTR
+# gsub(/x{0}((^)|(2))/,"x")
+# print "x{0}((^)|(2)) "$0
+#
+# $0=TESTSTR
+# gsub(/x{0}((2)|($))/,"x")
+# print "x{0}((2)|($)) "$0
+#
+# $0=TESTSTR
+# gsub(/x{0}(($)|(2))/,"x")
+# print "x{0}(($)|(2)) "$0
+
+$0=TESTSTR
+gsub(/x*((2)|(^))/,"x")
+print "x*((2)|(^)) "$0
+
+$0=TESTSTR
+gsub(/x*((^)|(2))/,"x")
+print "x*((^)|(2)) "$0
+
+$0=TESTSTR
+gsub(/x*((2)|($))/,"x")
+print "x*((2)|($)) "$0
+
+$0=TESTSTR
+gsub(/x*(($)|(2))/,"x")
+print "x*(($)|(2)) "$0
+
+# $0=TESTSTR
+# gsub(/x{0}^/,"x")
+# print "x{0}^ "$0
+#
+# $0=TESTSTR
+# gsub(/x{0}$/,"x")
+# print "x{0}$ "$0
+#
+# $0=TESTSTR
+# gsub(/(x{0}^)|2/,"x")
+# print "(x{0}^)|2 "$0
+#
+# $0=TESTSTR
+# gsub(/(x{0}$)|2/,"x")
+# print "(x{0}$)|2 "$0
+
+
+}
+#
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#byefrom
+#
+#--
+#laura fairhead # laura@madonnaweb.com http://lf.8k.com
+# # if you are bored crack my sig.
+#1F8B0808CABB793C0000666667002D8E410E83300C04EF91F2877D00CA138A7A
+#EAA98F30C494480157B623C4EF1B508FDED1CEFA9152A23DE35D661593C5318E
+#630C313CD701BE92E390563326EE17A3CA818F5266E4C2461547F1F5267659CA
+#8EE2092F76C329ED02CA430C5373CC62FF94BAC6210B36D9F9BC4AB53378D978
+#80F2978A1A6E5D6F5133B67B6113178DC1059526698AFE5C17A5187E7D930492
diff --git a/test/gsubtst2.ok b/test/gsubtst2.ok
new file mode 100644
index 00000000..a038528b
--- /dev/null
+++ b/test/gsubtst2.ok
@@ -0,0 +1,25 @@
+input 12345
+output gsub(/regex/,"x",input)
+
+regex output
+(^) x12345
+($) 12345x
+(^)|($) x12345x
+($)|(^) x12345x
+(2) 1x345
+(^)|2 x1x345
+2|(^) x1x345
+($)|2 1x345x
+2|($) 1x345x
+(2)|(^) x1x345
+(^)|(2) x1x345
+(2)|($) 1x345x
+($)|(2) 1x345x
+.((2)|(^)) x345
+.((^)|(2)) x345
+.((2)|($)) x34x
+.(($)|(2)) x34x
+x*((2)|(^)) x1x345
+x*((^)|(2)) x1x345
+x*((2)|($)) 1x345x
+x*(($)|(2)) 1x345x
diff --git a/test/gsubtst3.awk b/test/gsubtst3.awk
new file mode 100644
index 00000000..1c4f4ead
--- /dev/null
+++ b/test/gsubtst3.awk
@@ -0,0 +1,290 @@
+# From laura_fairhead@talk21.com Fri May 10 11:24:41 2002
+# Return-Path: <laura_fairhead@talk21.com>
+# Received: from localhost (aahz [127.0.0.1])
+# by skeeve.com (8.11.2/8.11.2) with ESMTP id g4A8OdU01822
+# for <arnold@localhost>; Fri, 10 May 2002 11:24:40 +0300
+# Received: from actcom.co.il [192.114.47.1]
+# by localhost with POP3 (fetchmail-5.7.4)
+# for arnold@localhost (single-drop); Fri, 10 May 2002 11:24:40 +0300 (IDT)
+# Received: by actcom.co.il (mbox arobbins)
+# (with Cubic Circle's cucipop (v1.31 1998/05/13) Fri May 10 11:30:42 2002)
+# X-From_: laura_fairhead@talk21.com Fri May 10 05:39:57 2002
+# Received: from lmail.actcom.co.il by actcom.co.il with ESMTP
+# (8.11.6/actcom-0.2) id g4A2dpw26380 for <arobbins@actcom.co.il>;
+# Fri, 10 May 2002 05:39:52 +0300 (EET DST)
+# (rfc931-sender: mail.actcom.co.il [192.114.47.13])
+# Received: from f7.net (consort.superb.net [209.61.216.22])
+# by lmail.actcom.co.il (8.11.6/8.11.6) with ESMTP id g4A2dxl10851
+# for <arobbins@actcom.co.il>; Fri, 10 May 2002 05:39:59 +0300
+# Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164])
+# by f7.net (8.11.6/8.11.6) with ESMTP id g4A2dwN11097
+# for <arnold@skeeve.com>; Thu, 9 May 2002 22:39:58 -0400
+# Received: from [194.73.242.6] (helo=wmpmta04-app.mail-store.com)
+# by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian))
+# id 1760K4-0001QX-00
+# for <bug-gawk@gnu.org>; Thu, 09 May 2002 22:39:56 -0400
+# Received: from wmpmtavirtual ([10.216.84.15])
+# by wmpmta04-app.mail-store.com
+# (InterMail vM.5.01.02.00 201-253-122-103-101-20001108) with SMTP
+# id <20020510023921.EEW24107.wmpmta04-app.mail-store.com@wmpmtavirtual>
+# for <bug-gawk@gnu.org>; Fri, 10 May 2002 03:39:21 +0100
+# Received: from 213.1.102.243 by t21web05-lrs ([10.216.84.15]); Fri, 10 May 02 03:38:42 GMT+01:00
+# X-Mailer: talk21 v1.24 - http://talk21.btopenworld.com
+# From: laura_fairhead@talk21.com
+# To: bug-gawk@gnu.org
+# X-Talk21Ref: none
+# Date: Fri, 10 May 2002 03:38:42 GMT+01:00
+# Subject: bug in gawk 3.1.0 regex code
+# Mime-Version: 1.0
+# Content-type: multipart/mixed; boundary="--GgOuLpDpIyE--1020998322088--"
+# Message-Id: <20020510023921.EEW24107.wmpmta04-app.mail-store.com@wmpmtavirtual>
+# X-SpamBouncer: 1.4 (10/07/01)
+# X-SBClass: OK
+# Status: RO
+#
+# Multipart Message Boundary - attachment/bodypart follows:
+#
+#
+# ----GgOuLpDpIyE--1020998322088--
+# Content-Type: text/plain
+# Content-Transfer-Encoding: 7bit
+#
+#
+# I believe I've just found a bug in gawk3.1.0 implementation of
+# extended regular expressions. It seems to be down to the alternation
+# operator; when using an end anchor '$' as a subexpression in an
+# alternation and the entire matched RE is a nul-string it fails
+# to match the end of string, for example;
+#
+# gsub(/$|2/,"x")
+# print
+#
+# input = 12345
+# expected output = 1x345x
+# actual output = 1x345
+#
+# The start anchor '^' always works as expected;
+#
+# gsub(/^|2/,"x")
+# print
+#
+# input = 12345
+# expected output = x1x345
+# actual output = x1x345
+#
+# This was with POSIX compliance enabled althought that doesn't
+# effect the result.
+#
+# I checked on gawk3.0.6 and got exactly the same results however
+# gawk2.15.6 gives the expected results.
+#
+# All the follow platforms produced the same results;
+#
+# gawk3.0.6 / Win98 / i386
+# gawk3.1.0 / Win98 / i386
+# gawk3.0.5 / Linux2.2.16 / i386
+#
+# Complete test results were as follows;
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# regex input expected actual bug?
+# -------------------------------------------------------------
+# (^) 12345 x12345 x12345
+# ($) 12345 12345x 12345x
+# (^)|($) 12345 x12345x x12345x
+# ($)|(^) 12345 x12345x x12345x
+# 2 12345 1x345 1x345
+# (^)|2 12345 x1x345 x1x345
+# 2|(^) 12345 x1x345 x1x345
+# ($)|2 12345 1x345x 1x345 **BUG**
+# 2|($) 12345 1x345x 1x345 **BUG**
+# (2)|(^) 12345 x1x345 x1x345
+# (^)|(2) 12345 x1x345 x1x345
+# (2)|($) 12345 1x345x 1x345 **BUG**
+# ($)|(2) 12345 1x345x 1x345 **BUG**
+# ((2)|(^)). 12345 xx45 xx45
+# ((^)|(2)). 12345 xx45 xx45
+# .((2)|($)) 12345 x34x x34x
+# .(($)|(2)) 12345 x34x x34x
+# (^)|6 12345 x12345 x12345
+# 6|(^) 12345 x12345 x12345
+# ($)|6 12345 12345x 12345x
+# 6|($) 12345 12345x 12345x
+# 2|6|(^) 12345 x1x345 x1x345
+# 2|(^)|6 12345 x1x345 x1x345
+# 6|2|(^) 12345 x1x345 x1x345
+# 6|(^)|2 12345 x1x345 x1x345
+# (^)|6|2 12345 x1x345 x1x345
+# (^)|2|6 12345 x1x345 x1x345
+# 2|6|($) 12345 1x345x 1x345 **BUG**
+# 2|($)|6 12345 1x345x 1x345 **BUG**
+# 6|2|($) 12345 1x345x 1x345 **BUG**
+# 6|($)|2 12345 1x345x 1x345 **BUG**
+# ($)|6|2 12345 1x345x 1x345 **BUG**
+# ($)|2|6 12345 1x345x 1x345 **BUG**
+# 2|4|(^) 12345 x1x3x5 x1x3x5
+# 2|(^)|4 12345 x1x3x5 x1x3x5
+# 4|2|(^) 12345 x1x3x5 x1x3x5
+# 4|(^)|2 12345 x1x3x5 x1x3x5
+# (^)|4|2 12345 x1x3x5 x1x3x5
+# (^)|2|4 12345 x1x3x5 x1x3x5
+# 2|4|($) 12345 1x3x5x 1x3x5 **BUG**
+# 2|($)|4 12345 1x3x5x 1x3x5 **BUG**
+# 4|2|($) 12345 1x3x5x 1x3x5 **BUG**
+# 4|($)|2 12345 1x3x5x 1x3x5 **BUG**
+# ($)|4|2 12345 1x3x5x 1x3x5 **BUG**
+# ($)|2|4 12345 1x3x5x 1x3x5 **BUG**
+# x{0}((2)|(^)) 12345 x1x345 x1x345
+# x{0}((^)|(2)) 12345 x1x345 x1x345
+# x{0}((2)|($)) 12345 1x345x 1x345 **BUG**
+# x{0}(($)|(2)) 12345 1x345x 1x345 **BUG**
+# x*((2)|(^)) 12345 x1x345 x1x345
+# x*((^)|(2)) 12345 x1x345 x1x345
+# x*((2)|($)) 12345 1x345x 1x345 **BUG**
+# x*(($)|(2)) 12345 1x345x 1x345 **BUG**
+# x{0}^ 12345 x12345 x12345
+# x{0}$ 12345 12345x 12345x
+# (x{0}^)|2 12345 x1x345 x1x345
+# (x{0}$)|2 12345 1x345x 1x345 **BUG**
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#
+# Here's the test program I used, a few of the cases use ERE {n[,[m]]}
+# operators so need '-W posix', (although the same results minus
+# those tests came out without POSIX compliance enabled)
+#
+# [ Invocation was 'gawk -W posix -f tregex.awk' ]
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# tregex.awk
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+BEGIN{
+print _=sprintf("%-20s%-10s%-10s%-10s%-10s\n","regex","input","expected","actual","bug?")
+OFS="-"
+$(length(_)+1)=""
+print $0
+
+while(getline <ARGV[1]) # ADR: was testre.dat
+{
+RE=$1;IN=$2;OUT=$3
+$0=IN
+gsub(RE,"x")
+printf "%-20s%-10s%-10s%-10s%-10s\n",RE,IN,OUT,$0,$0==OUT?"":"**BUG**"
+}
+}
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# This is the test data file used;
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# testre.dat
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# (^) 12345 x12345
+# ($) 12345 12345x
+# (^)|($) 12345 x12345x
+# ($)|(^) 12345 x12345x
+# 2 12345 1x345
+# (^)|2 12345 x1x345
+# 2|(^) 12345 x1x345
+# ($)|2 12345 1x345x
+# 2|($) 12345 1x345x
+# (2)|(^) 12345 x1x345
+# (^)|(2) 12345 x1x345
+# (2)|($) 12345 1x345x
+# ($)|(2) 12345 1x345x
+# ((2)|(^)). 12345 xx45
+# ((^)|(2)). 12345 xx45
+# .((2)|($)) 12345 x34x
+# .(($)|(2)) 12345 x34x
+# (^)|6 12345 x12345
+# 6|(^) 12345 x12345
+# ($)|6 12345 12345x
+# 6|($) 12345 12345x
+# 2|6|(^) 12345 x1x345
+# 2|(^)|6 12345 x1x345
+# 6|2|(^) 12345 x1x345
+# 6|(^)|2 12345 x1x345
+# (^)|6|2 12345 x1x345
+# (^)|2|6 12345 x1x345
+# 2|6|($) 12345 1x345x
+# 2|($)|6 12345 1x345x
+# 6|2|($) 12345 1x345x
+# 6|($)|2 12345 1x345x
+# ($)|6|2 12345 1x345x
+# ($)|2|6 12345 1x345x
+# 2|4|(^) 12345 x1x3x5
+# 2|(^)|4 12345 x1x3x5
+# 4|2|(^) 12345 x1x3x5
+# 4|(^)|2 12345 x1x3x5
+# (^)|4|2 12345 x1x3x5
+# (^)|2|4 12345 x1x3x5
+# 2|4|($) 12345 1x3x5x
+# 2|($)|4 12345 1x3x5x
+# 4|2|($) 12345 1x3x5x
+# 4|($)|2 12345 1x3x5x
+# ($)|4|2 12345 1x3x5x
+# ($)|2|4 12345 1x3x5x
+# x{0}((2)|(^)) 12345 x1x345
+# x{0}((^)|(2)) 12345 x1x345
+# x{0}((2)|($)) 12345 1x345x
+# x{0}(($)|(2)) 12345 1x345x
+# x*((2)|(^)) 12345 x1x345
+# x*((^)|(2)) 12345 x1x345
+# x*((2)|($)) 12345 1x345x
+# x*(($)|(2)) 12345 1x345x
+# x{0}^ 12345 x12345
+# x{0}$ 12345 12345x
+# (x{0}^)|2 12345 x1x345
+# (x{0}$)|2 12345 1x345x
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# I've attached a full copy of this e-mail in ZIP format
+# in case of e-mail transport errors corrupting the data.
+#
+# I've posted the same bug report to gnu.utils.bug and
+# it's being discussed in this thread on comp.lang.awk;
+#
+# From: laura@madonnaweb.com (laura fairhead)
+# Newsgroups: comp.lang.awk
+# Subject: bug in gawk3.1.0 regex code
+# Date: Wed, 08 May 2002 23:31:40 GMT
+# Message-ID: <3cd9b0f7.29675926@NEWS.CIS.DFN.DE>
+#
+#
+# byefrom
+#
+# Laura Fairhead
+#
+#
+#
+#
+# --------------------
+# talk21 your FREE portable and private address on the net at http://www.talk21.com
+# ----GgOuLpDpIyE--1020998322088--
+# Content-Type: : application/zip;; Name="COPY.ZIP"
+# Content-Transfer-Encoding: base64
+# Content-Disposition: attachment; filename="COPY.ZIP"
+#
+# UEsDBBQAAAAIALoaqiyj8d/bjwMAAKsaAAADAAAARklMrVjfa+JAEH4P5H8ISwrRU9EYfbheKBR6
+# xRcLvevbYbFtzsqJlBrpQr3722+zMWZ31pk1MaG0Q/m+nR87O9kvruM6/5p4XOc9WSTc05/l
+# +m2bSivhb8lzmrx43vw53c5X2f+etourHOc63XMe1wlmLQ8+g3AYjaTFD2ZplY9g+xRbWly3
+# NPastYMrQN9cs4DvHYz+dHbomY8SOTctGDlcQfXND1Uz6cK3EXcVdpY37ltSuB55u339cNtu
+# F76NPTudHYR0zS2RZ/sd1maHVLdYI/cp31b2PvFW72jkvIi2tLTI94nXY/eCfeZK8Ap7GO1b
+# u7QAO8+8FjsLfFx7OowtfW6dLYRv22wZ031uYYc7M/aK5xvEfjp7vDPnQxW2OZuqndDxWeyw
+# dt6y5rXPt5xrqG8bW9a8tm8ZN1q1UyYTXvNT2HjN7VWLLL3GR7pl9nlUkx1Z+5xm2/qcYsu4
+# z2KHtfOWNad6jR92jGN9jvm2sSNbn1vYlj4n2TLus9h4zW1s/tn/e3iHV55MOXumvUarsvVX
+# +OknNGfrr/AK7DbMulLkbZh1VTa8uFSLHF5cqlVt5tW9eWRsH2VbVY10rp+TCu9Q6Rxj2/Ju
+# SJE2KG5TqW57848/jS15fXM7mX66ztv7cp16j/FGGr8DdtEN+5uL7sD49WvNOkwGIv5KaS3+
+# FsJamLmyFkYmrFnLde6+/4hZl7mOH6yS9SJ9DR5bXwatmLHCrd/PivTxulwlwSJJV8t14n1j
+# abIRCfde5mm2iojx/ib2B5eTaeyHl3cPP2N/KNbsx5Op6yw226fg/qbDeIbNc/DoHAR6Mu2I
+# dTp+X/zEsTCvGPvK9j0govsrfxqqdJN9cKhMY0vilwdPOebmRwqIy4+x+Tni+Hrc/PKAAnGZ
+# 7pXH2fyaYK6X4+B9CcPBt/RRt9z8FoDhoOpH/QJ9j+KAkkf9As2O4oA6N/xy6RWo8OMoqLYN
+# 1DDipqo+joIqEGtQqDWJRibXK9oO6igMB1Uu2XeKZwwHlSuO0zue6idVGVE4VQPheeiVIc8F
+# sV6Bg6oRx+knkup3Kl8VR+Vb5qGru2N14SNTx2E4qNhwnH1/+chUYRROvfvjeejK6khdeLm/
+# +HoFDqolHGfdX17sG5WviqPyLXBQ1WB9D/ULjSvHH9ZXUJOgOKA+UL9AZ1A4dThTftXxTOWh
+# qgRs7kI9gF4gwM0fnVfgjo/F19A96T9QSwECFAAUAAAACAC6Gqoso/Hf248DAACrGgAAAwAA
+# AAAAAAABACAAAAAAAAAARklMUEsFBgAAAAABAAEAMQAAALADAAAAAA==
+# ----GgOuLpDpIyE--1020998322088----
+#
+#
+#
diff --git a/test/gsubtst3.in b/test/gsubtst3.in
new file mode 100644
index 00000000..2dcf75af
--- /dev/null
+++ b/test/gsubtst3.in
@@ -0,0 +1,57 @@
+(^) 12345 x12345
+($) 12345 12345x
+(^)|($) 12345 x12345x
+($)|(^) 12345 x12345x
+2 12345 1x345
+(^)|2 12345 x1x345
+2|(^) 12345 x1x345
+($)|2 12345 1x345x
+2|($) 12345 1x345x
+(2)|(^) 12345 x1x345
+(^)|(2) 12345 x1x345
+(2)|($) 12345 1x345x
+($)|(2) 12345 1x345x
+((2)|(^)). 12345 xx45
+((^)|(2)). 12345 xx45
+.((2)|($)) 12345 x34x
+.(($)|(2)) 12345 x34x
+(^)|6 12345 x12345
+6|(^) 12345 x12345
+($)|6 12345 12345x
+6|($) 12345 12345x
+2|6|(^) 12345 x1x345
+2|(^)|6 12345 x1x345
+6|2|(^) 12345 x1x345
+6|(^)|2 12345 x1x345
+(^)|6|2 12345 x1x345
+(^)|2|6 12345 x1x345
+2|6|($) 12345 1x345x
+2|($)|6 12345 1x345x
+6|2|($) 12345 1x345x
+6|($)|2 12345 1x345x
+($)|6|2 12345 1x345x
+($)|2|6 12345 1x345x
+2|4|(^) 12345 x1x3x5
+2|(^)|4 12345 x1x3x5
+4|2|(^) 12345 x1x3x5
+4|(^)|2 12345 x1x3x5
+(^)|4|2 12345 x1x3x5
+(^)|2|4 12345 x1x3x5
+2|4|($) 12345 1x3x5x
+2|($)|4 12345 1x3x5x
+4|2|($) 12345 1x3x5x
+4|($)|2 12345 1x3x5x
+($)|4|2 12345 1x3x5x
+($)|2|4 12345 1x3x5x
+x{0}((2)|(^)) 12345 x1x345
+x{0}((^)|(2)) 12345 x1x345
+x{0}((2)|($)) 12345 1x345x
+x{0}(($)|(2)) 12345 1x345x
+x*((2)|(^)) 12345 x1x345
+x*((^)|(2)) 12345 x1x345
+x*((2)|($)) 12345 1x345x
+x*(($)|(2)) 12345 1x345x
+x{0}^ 12345 x12345
+x{0}$ 12345 12345x
+(x{0}^)|2 12345 x1x345
+(x{0}$)|2 12345 1x345x
diff --git a/test/gsubtst3.ok b/test/gsubtst3.ok
new file mode 100644
index 00000000..190a20ac
--- /dev/null
+++ b/test/gsubtst3.ok
@@ -0,0 +1,60 @@
+regex input expected actual bug?
+
+-------------------------------------------------------------
+(^) 12345 x12345 x12345
+($) 12345 12345x 12345x
+(^)|($) 12345 x12345x x12345x
+($)|(^) 12345 x12345x x12345x
+2 12345 1x345 1x345
+(^)|2 12345 x1x345 x1x345
+2|(^) 12345 x1x345 x1x345
+($)|2 12345 1x345x 1x345x
+2|($) 12345 1x345x 1x345x
+(2)|(^) 12345 x1x345 x1x345
+(^)|(2) 12345 x1x345 x1x345
+(2)|($) 12345 1x345x 1x345x
+($)|(2) 12345 1x345x 1x345x
+((2)|(^)). 12345 xx45 xx45
+((^)|(2)). 12345 xx45 xx45
+.((2)|($)) 12345 x34x x34x
+.(($)|(2)) 12345 x34x x34x
+(^)|6 12345 x12345 x12345
+6|(^) 12345 x12345 x12345
+($)|6 12345 12345x 12345x
+6|($) 12345 12345x 12345x
+2|6|(^) 12345 x1x345 x1x345
+2|(^)|6 12345 x1x345 x1x345
+6|2|(^) 12345 x1x345 x1x345
+6|(^)|2 12345 x1x345 x1x345
+(^)|6|2 12345 x1x345 x1x345
+(^)|2|6 12345 x1x345 x1x345
+2|6|($) 12345 1x345x 1x345x
+2|($)|6 12345 1x345x 1x345x
+6|2|($) 12345 1x345x 1x345x
+6|($)|2 12345 1x345x 1x345x
+($)|6|2 12345 1x345x 1x345x
+($)|2|6 12345 1x345x 1x345x
+2|4|(^) 12345 x1x3x5 x1x3x5
+2|(^)|4 12345 x1x3x5 x1x3x5
+4|2|(^) 12345 x1x3x5 x1x3x5
+4|(^)|2 12345 x1x3x5 x1x3x5
+(^)|4|2 12345 x1x3x5 x1x3x5
+(^)|2|4 12345 x1x3x5 x1x3x5
+2|4|($) 12345 1x3x5x 1x3x5x
+2|($)|4 12345 1x3x5x 1x3x5x
+4|2|($) 12345 1x3x5x 1x3x5x
+4|($)|2 12345 1x3x5x 1x3x5x
+($)|4|2 12345 1x3x5x 1x3x5x
+($)|2|4 12345 1x3x5x 1x3x5x
+x{0}((2)|(^)) 12345 x1x345 x1x345
+x{0}((^)|(2)) 12345 x1x345 x1x345
+x{0}((2)|($)) 12345 1x345x 1x345x
+x{0}(($)|(2)) 12345 1x345x 1x345x
+x*((2)|(^)) 12345 x1x345 x1x345
+x*((^)|(2)) 12345 x1x345 x1x345
+x*((2)|($)) 12345 1x345x 1x345x
+x*(($)|(2)) 12345 1x345x 1x345x
+x{0}^ 12345 x12345 x12345
+x{0}$ 12345 12345x 12345x
+(x{0}^)|2 12345 x1x345 x1x345
+(x{0}$)|2 12345 1x345x 1x345x
diff --git a/test/gsubtst4.awk b/test/gsubtst4.awk
new file mode 100644
index 00000000..48b8413e
--- /dev/null
+++ b/test/gsubtst4.awk
@@ -0,0 +1,242 @@
+# From arnold Thu May 9 17:27:03 2002
+# Return-Path: <arnold@skeeve.com>
+# Received: (from arnold@localhost)
+# by skeeve.com (8.11.6/8.11.6) id g49ER3K27925
+# for arnold; Thu, 9 May 2002 17:27:03 +0300
+# Date: Thu, 9 May 2002 17:27:03 +0300
+# From: Aharon Robbins <arnold@skeeve.com>
+# Message-Id: <200205091427.g49ER3K27925@skeeve.com>
+# To: arnold@skeeve.com
+# Subject: fixme
+# X-SpamBouncer: 1.4 (10/07/01)
+# X-SBRule: Pattern Match (Other Patterns) (Score: 4850)
+# X-SBRule: Pattern Match (Spam Phone #) (Score: 0)
+# X-SBClass: Blocked
+# Status: RO
+#
+# Path: ord-read.news.verio.net!dfw-artgen!iad-peer.news.verio.net!news.verio.net!fu-berlin.de!uni-berlin.de!host213-120-137-48.in-addr.btopenworld.COM!not-for-mail
+# From: laura@madonnaweb.com (laura fairhead)
+# Newsgroups: comp.lang.awk
+# Subject: bug in gawk3.1.0 regex code
+# Date: Wed, 08 May 2002 23:31:40 GMT
+# Organization: that'll be the daewooo :)
+# Lines: 211
+# Message-ID: <3cd9b0f7.29675926@NEWS.CIS.DFN.DE>
+# Reply-To: laura@madonnaweb.com
+# NNTP-Posting-Host: host213-120-137-48.in-addr.btopenworld.com (213.120.137.48)
+# X-Trace: fu-berlin.de 1020900891 18168286 213.120.137.48 (16 [53286])
+# X-Newsreader: Forte Free Agent 1.21/32.243
+# Xref: dfw-artgen comp.lang.awk:13059
+#
+#
+# I believe I've just found a bug in gawk3.1.0 implementation of
+# extended regular expressions. It seems to be down to the alternation
+# operator; when using an end anchor '$' as a subexpression in an
+# alternation and the entire matched RE is a nul-string it fails
+# to match the end of string, for example;
+#
+# gsub(/$|2/,"x")
+# print
+#
+# input = 12345
+# expected output = 1x345x
+# actual output = 1x345
+#
+# The start anchor '^' always works as expected;
+#
+# gsub(/^|2/,"x")
+# print
+#
+# input = 12345
+# expected output = x1x345
+# actual output = x1x345
+#
+# This was with POSIX compliance enabled althought that doesn't
+# effect the result.
+#
+# I checked on gawk3.0.6 and got exactly the same results however
+# gawk2.15.6 gives the expected results.
+#
+# I'm about to post a bug report about this into gnu.utils.bug
+# but I thought I'd post it here first in case anyone has
+# any input/comments/whatever ....
+#
+# Complete test results were as follows;
+#
+# input 12345
+# output gsub(/regex/,"x",input)
+#
+# regex output
+# (^) x12345
+# ($) 12345x
+# (^)|($) x12345x
+# ($)|(^) x12345x
+# (2) 1x345
+# (^)|2 x1x345
+# 2|(^) x1x345
+# ($)|2 1x345
+# 2|($) 1x345
+# (2)|(^) x1x345
+# (^)|(2) x1x345
+# (2)|($) 1x345
+# ($)|(2) 1x345
+# .((2)|(^)) x345
+# .((^)|(2)) x345
+# .((2)|($)) x34x
+# .(($)|(2)) x34x
+# x{0}((2)|(^)) x1x345
+# x{0}((^)|(2)) x1x345
+# x{0}((2)|($)) 1x345
+# x{0}(($)|(2)) 1x345
+# x*((2)|(^)) x1x345
+# x*((^)|(2)) x1x345
+# x*((2)|($)) 1x345
+# x*(($)|(2)) 1x345
+#
+# Here's the test program I used, a few of the cases use ERE {n[,[m]]}
+# operators so that will have to be commented out or have a check
+# added or something (should have put a conditional in I know... ;-)
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+BEGIN{
+
+TESTSTR="12345"
+
+print "input "TESTSTR
+print "output gsub(/regex/,\"x\",input)"
+print ""
+
+print "regex output"
+$0=TESTSTR
+gsub(/(^)/,"x")
+print "(^) "$0
+
+$0=TESTSTR
+gsub(/($)/,"x")
+print "($) "$0
+
+$0=TESTSTR
+gsub(/(^)|($)/,"x")
+print "(^)|($) "$0
+
+$0=TESTSTR
+gsub(/($)|(^)/,"x")
+print "($)|(^) "$0
+
+$0=TESTSTR
+gsub(/2/,"x")
+print "(2) "$0
+
+$0=TESTSTR
+gsub(/(^)|2/,"x")
+print "(^)|2 "$0
+
+$0=TESTSTR
+gsub(/2|(^)/,"x")
+print "2|(^) "$0
+
+$0=TESTSTR
+gsub(/($)|2/,"x")
+print "($)|2 "$0
+
+$0=TESTSTR
+gsub(/2|($)/,"x")
+print "2|($) "$0
+
+$0=TESTSTR
+gsub(/(2)|(^)/,"x")
+print "(2)|(^) "$0
+
+$0=TESTSTR
+gsub(/(^)|(2)/,"x")
+print "(^)|(2) "$0
+
+$0=TESTSTR
+gsub(/(2)|($)/,"x")
+print "(2)|($) "$0
+
+$0=TESTSTR
+gsub(/($)|(2)/,"x")
+print "($)|(2) "$0
+
+$0=TESTSTR
+gsub(/.((2)|(^))/,"x")
+print ".((2)|(^)) "$0
+
+$0=TESTSTR
+gsub(/.((^)|(2))/,"x")
+print ".((^)|(2)) "$0
+
+$0=TESTSTR
+gsub(/.((2)|($))/,"x")
+print ".((2)|($)) "$0
+
+$0=TESTSTR
+gsub(/.(($)|(2))/,"x")
+print ".(($)|(2)) "$0
+
+$0=TESTSTR
+gsub(/x{0}((2)|(^))/,"x")
+print "x{0}((2)|(^)) "$0
+
+$0=TESTSTR
+gsub(/x{0}((^)|(2))/,"x")
+print "x{0}((^)|(2)) "$0
+
+$0=TESTSTR
+gsub(/x{0}((2)|($))/,"x")
+print "x{0}((2)|($)) "$0
+
+$0=TESTSTR
+gsub(/x{0}(($)|(2))/,"x")
+print "x{0}(($)|(2)) "$0
+
+$0=TESTSTR
+gsub(/x*((2)|(^))/,"x")
+print "x*((2)|(^)) "$0
+
+$0=TESTSTR
+gsub(/x*((^)|(2))/,"x")
+print "x*((^)|(2)) "$0
+
+$0=TESTSTR
+gsub(/x*((2)|($))/,"x")
+print "x*((2)|($)) "$0
+
+$0=TESTSTR
+gsub(/x*(($)|(2))/,"x")
+print "x*(($)|(2)) "$0
+
+$0=TESTSTR
+gsub(/x{0}^/,"x")
+print "x{0}^ "$0
+
+$0=TESTSTR
+gsub(/x{0}$/,"x")
+print "x{0}$ "$0
+
+$0=TESTSTR
+gsub(/(x{0}^)|2/,"x")
+print "(x{0}^)|2 "$0
+
+$0=TESTSTR
+gsub(/(x{0}$)|2/,"x")
+print "(x{0}$)|2 "$0
+
+
+}
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# byefrom
+#
+# --
+# laura fairhead # laura@madonnaweb.com http://lf.8k.com
+# # if you are bored crack my sig.
+# 1F8B0808CABB793C0000666667002D8E410E83300C04EF91F2877D00CA138A7A
+# EAA98F30C494480157B623C4EF1B508FDED1CEFA9152A23DE35D661593C5318E
+# 630C313CD701BE92E390563326EE17A3CA818F5266E4C2461547F1F5267659CA
+# 8EE2092F76C329ED02CA430C5373CC62FF94BAC6210B36D9F9BC4AB53378D978
+# 80F2978A1A6E5D6F5133B67B6113178DC1059526698AFE5C17A5187E7D930492
+#
diff --git a/test/gsubtst4.ok b/test/gsubtst4.ok
new file mode 100644
index 00000000..6d0e490a
--- /dev/null
+++ b/test/gsubtst4.ok
@@ -0,0 +1,33 @@
+input 12345
+output gsub(/regex/,"x",input)
+
+regex output
+(^) x12345
+($) 12345x
+(^)|($) x12345x
+($)|(^) x12345x
+(2) 1x345
+(^)|2 x1x345
+2|(^) x1x345
+($)|2 1x345x
+2|($) 1x345x
+(2)|(^) x1x345
+(^)|(2) x1x345
+(2)|($) 1x345x
+($)|(2) 1x345x
+.((2)|(^)) x345
+.((^)|(2)) x345
+.((2)|($)) x34x
+.(($)|(2)) x34x
+x{0}((2)|(^)) 12345
+x{0}((^)|(2)) 12345
+x{0}((2)|($)) 12345
+x{0}(($)|(2)) 12345
+x*((2)|(^)) x1x345
+x*((^)|(2)) x1x345
+x*((2)|($)) 1x345x
+x*(($)|(2)) 1x345x
+x{0}^ 12345
+x{0}$ 12345
+(x{0}^)|2 1x345
+(x{0}$)|2 1x345
diff --git a/test/icasefs.awk b/test/icasefs.awk
new file mode 100644
index 00000000..86481d86
--- /dev/null
+++ b/test/icasefs.awk
@@ -0,0 +1,43 @@
+BEGIN {
+ # 1. Should print aCa
+ IGNORECASE = 1
+ FS = "[c]"
+ IGNORECASE = 0
+ $0 = "aCa"
+ print $1
+
+ # 2. Should print a
+ IGNORECASE = 1
+ FS = "[c]"
+ $0 = "aCa"
+ print $1
+
+ # 3. Should print a
+ IGNORECASE = 1
+ FS = "C"
+ IGNORECASE = 0
+ $0 = "aCa"
+ print $1
+
+ # 4. Should print aCa
+ IGNORECASE = 1
+ FS = "c"
+ $0 = "aCa"
+ print $1
+
+ # 5. Should print aCa
+ FS = "xy"
+ IGNORECASE = 0
+ FS = "c"
+ IGNORECASE = 1
+ $0 = "aCa"
+ print $1
+
+ # 6. Should print aCa
+ FS = "xy"
+ IGNORECASE = 0
+ FS = "c"
+ IGNORECASE = 1
+ split("aCa",a)
+ print a[1]
+}
diff --git a/test/icasefs.ok b/test/icasefs.ok
new file mode 100644
index 00000000..658fac78
--- /dev/null
+++ b/test/icasefs.ok
@@ -0,0 +1,6 @@
+aCa
+a
+a
+aCa
+aCa
+aCa
diff --git a/test/icasers.awk b/test/icasers.awk
new file mode 100644
index 00000000..933e3bf7
--- /dev/null
+++ b/test/icasers.awk
@@ -0,0 +1,2 @@
+BEGIN { RS = "[[:upper:]]+" }
+{ print ; IGNORECASE = ! IGNORECASE }
diff --git a/test/icasers.in b/test/icasers.in
new file mode 100644
index 00000000..b3476994
--- /dev/null
+++ b/test/icasers.in
@@ -0,0 +1 @@
+1111AAAA2222bbbb \ No newline at end of file
diff --git a/test/icasers.ok b/test/icasers.ok
new file mode 100644
index 00000000..4f142ee3
--- /dev/null
+++ b/test/icasers.ok
@@ -0,0 +1,2 @@
+1111
+2222
diff --git a/test/ignrcase.awk b/test/ignrcase.awk
new file mode 100644
index 00000000..61d7a833
--- /dev/null
+++ b/test/ignrcase.awk
@@ -0,0 +1,2 @@
+BEGIN { IGNORECASE = 1 }
+{ sub(/y/, ""); print }
diff --git a/test/ignrcase.in b/test/ignrcase.in
new file mode 100644
index 00000000..aba8e51e
--- /dev/null
+++ b/test/ignrcase.in
@@ -0,0 +1 @@
+xYz
diff --git a/test/inputred.awk b/test/inputred.awk
new file mode 100644
index 00000000..6524df62
--- /dev/null
+++ b/test/inputred.awk
@@ -0,0 +1 @@
+BEGIN { print getline < "file" ".txt" }
diff --git a/test/inputred.ok b/test/inputred.ok
new file mode 100644
index 00000000..7de4d5d7
--- /dev/null
+++ b/test/inputred.ok
@@ -0,0 +1 @@
+-1.txt
diff --git a/test/longwrds.awk b/test/longwrds.awk
index f6a7816d..d496ac79 100644
--- a/test/longwrds.awk
+++ b/test/longwrds.awk
@@ -14,7 +14,8 @@ END {
for (x in used)
if (length(x) > 10) {
++num_long_words
- print x
+ print x | "LC_ALL=C sort"
}
- print num_long_words, "long words"
+ print(num_long_words, "long words") | "LC_ALL=C sort"
+ close("LC_ALL=C sort")
}
diff --git a/test/manpage b/test/longwrds.in
index 09c39485..09c39485 100644
--- a/test/manpage
+++ b/test/longwrds.in
diff --git a/test/manyfiles.ok b/test/manyfiles.ok
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/test/manyfiles.ok
@@ -0,0 +1 @@
+1
diff --git a/test/match1.awk b/test/match1.awk
new file mode 100644
index 00000000..6d4791be
--- /dev/null
+++ b/test/match1.awk
@@ -0,0 +1,9 @@
+BEGIN {
+ data = "foooobazbarrrrr"
+ match(data, /(fo+).+(bar*)/, arr)
+ for (i = 0; i in arr; i++) {
+ printf("arr[%d] = \"%s\"\n", i, arr[i])
+ printf("arr[%d, \"start\"] = %s, arr[%d, \"length\"] = %s\n",
+ i, arr[i, "start"], i, arr[i, "length"])
+ }
+}
diff --git a/test/match1.ok b/test/match1.ok
new file mode 100644
index 00000000..4490db2a
--- /dev/null
+++ b/test/match1.ok
@@ -0,0 +1,6 @@
+arr[0] = "foooobazbarrrrr"
+arr[0, "start"] = 1, arr[0, "length"] = 15
+arr[1] = "foooo"
+arr[1, "start"] = 1, arr[1, "length"] = 5
+arr[2] = "barrrrr"
+arr[2, "start"] = 9, arr[2, "length"] = 7
diff --git a/test/negexp.awk b/test/negexp.awk
new file mode 100644
index 00000000..3b3a3c06
--- /dev/null
+++ b/test/negexp.awk
@@ -0,0 +1 @@
+BEGIN { a = -2; print 10^a }
diff --git a/test/nfldstr.awk b/test/nfldstr.awk
new file mode 100644
index 00000000..09b4a2b8
--- /dev/null
+++ b/test/nfldstr.awk
@@ -0,0 +1,13 @@
+$1 == 0 {
+ print "bug"
+}
+{
+ $0 = "0"
+ if (!$0)
+ print "another bug"
+ $0 = a = "0"
+ if (!$0)
+ print "yet another bug"
+ if ($1)
+ print "a buggie"
+}
diff --git a/test/nfldstr.in b/test/nfldstr.in
new file mode 100644
index 00000000..8b137891
--- /dev/null
+++ b/test/nfldstr.in
@@ -0,0 +1 @@
+
diff --git a/test/nfneg.awk b/test/nfneg.awk
new file mode 100644
index 00000000..6d54ee0c
--- /dev/null
+++ b/test/nfneg.awk
@@ -0,0 +1 @@
+BEGIN { NF -= 2 ; print }
diff --git a/test/nfneg.ok b/test/nfneg.ok
new file mode 100644
index 00000000..bcdb0376
--- /dev/null
+++ b/test/nfneg.ok
@@ -0,0 +1,2 @@
+gawk: nfneg.awk:1: fatal: NF set to negative value
+EXIT CODE: 2
diff --git a/test/noeffect.awk b/test/noeffect.awk
index b375a4c2..b67a5c57 100644
--- a/test/noeffect.awk
+++ b/test/noeffect.awk
@@ -1,4 +1,5 @@
BEGIN {
s == "hello, world";
- print s
+ s + 1
+ ;;
}
diff --git a/test/noeffect.ok b/test/noeffect.ok
index ea2d0965..d2da47a2 100644
--- a/test/noeffect.ok
+++ b/test/noeffect.ok
@@ -1,4 +1,4 @@
gawk: noeffect.awk:3: warning: statement may have no effect
+gawk: noeffect.awk:4: warning: statement may have no effect
gawk: noeffect.awk:2: warning: reference to uninitialized variable `s'
gawk: noeffect.awk:3: warning: reference to uninitialized variable `s'
-
diff --git a/test/noloop1.awk b/test/noloop1.awk
new file mode 100644
index 00000000..ae461e34
--- /dev/null
+++ b/test/noloop1.awk
@@ -0,0 +1,70 @@
+# From jhart@avcnet.bates.edu Sun Oct 6 16:05:21 2002
+# Return-Path: <jhart@avcnet.bates.edu>
+# Received: from localhost (skeeve [127.0.0.1])
+# by skeeve.com (8.11.6/8.11.6) with ESMTP id g96D5Jf28053
+# for <arnold@localhost>; Sun, 6 Oct 2002 16:05:21 +0300
+# Received: from actcom.co.il [192.114.47.1]
+# by localhost with POP3 (fetchmail-5.9.0)
+# for arnold@localhost (single-drop); Sun, 06 Oct 2002 16:05:21 +0300 (IDT)
+# Received: by actcom.co.il (mbox arobbins)
+# (with Cubic Circle's cucipop (v1.31 1998/05/13) Sun Oct 6 16:06:39 2002)
+# X-From_: jhart@avcnet.bates.edu Sun Oct 6 15:31:59 2002
+# Received: from lmail.actcom.co.il by actcom.co.il with ESMTP
+# (8.11.6/actcom-0.2) id g96CVrS27315 for <arobbins@actcom.co.il>;
+# Sun, 6 Oct 2002 15:31:54 +0300 (EET DST)
+# (rfc931-sender: mail.actcom.co.il [192.114.47.13])
+# Received: from f7.net (consort.superb.net [209.61.216.22])
+# by lmail.actcom.co.il (8.11.6/8.11.6) with ESMTP id g96CVqY01629
+# for <arobbins@actcom.co.il>; Sun, 6 Oct 2002 15:31:52 +0300
+# Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164])
+# by f7.net (8.11.6/8.11.6) with ESMTP id g96CVp418974
+# for <arnold@skeeve.com>; Sun, 6 Oct 2002 08:31:51 -0400
+# Received: from monty-python.gnu.org ([199.232.76.173])
+# by fencepost.gnu.org with esmtp (Exim 4.10)
+# id 17yAZa-00055o-00
+# for bug-gawk@gnu.org; Sun, 06 Oct 2002 08:31:50 -0400
+# Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10)
+# id 17yAZE-0007eB-00
+# for bug-gawk@gnu.org; Sun, 06 Oct 2002 08:31:29 -0400
+# Received: from avcnet.bates.edu ([134.181.128.62])
+# by monty-python.gnu.org with esmtp (Exim 4.10)
+# id 17yAZ9-0007X3-00
+# for bug-gawk@gnu.org; Sun, 06 Oct 2002 08:31:23 -0400
+# Received: from a5514a.bates.edu (www.bates.edu [134.181.128.62])
+# by avcnet.bates.edu (8.9.3/8.9.3) with ESMTP id IAA05400
+# for <bug-gawk@gnu.org>; Sun, 6 Oct 2002 08:31:20 -0400
+# Date: Sun, 6 Oct 2002 08:36:54 -0400
+# Mime-Version: 1.0 (Apple Message framework v482)
+# Content-Type: text/plain; charset=US-ASCII; format=flowed
+# Subject: Infinite loop in sub/gsub
+# From: jhart@avcnet.bates.edu
+# To: bug-gawk@gnu.org
+# Content-Transfer-Encoding: 7bit
+# Message-Id: <4BC4A4F0-D928-11D6-8E78-00039384A9CC@mail.avcnet.org>
+# X-Mailer: Apple Mail (2.482)
+# X-Spam-Status: No, hits=0.3 required=5.0
+# tests=NO_REAL_NAME,SPAM_PHRASE_00_01,USER_AGENT_APPLEMAIL
+# version=2.41
+# X-Spam-Level:
+# X-SpamBouncer: 1.4 (10/07/01)
+# X-SBClass: OK
+# Status: RO
+#
+# This command line:
+#
+# echo "''Italics with an apostrophe'' embedded''"|gawk -f test.awk
+#
+# where test.awk contains this instruction:
+#
+/''/ { sub(/''(.?[^']+)*''/, "<em>&</em>"); }
+#
+# puts gawk 3.11 into an infinite loop. Whereas, this command works:
+#
+# echo "''Italics with an apostrophe' embedded''"|gawk -f test.awk
+#
+#
+#
+# Platform: Mac OS X 10.1.5/Darwin Kernel Version 5.5: Thu May 30 14:51:26
+# PDT 2002; root:xnu/xnu-201.42.3.obj~1/RELEASE_PPC
+#
+#
diff --git a/test/noloop1.in b/test/noloop1.in
new file mode 100644
index 00000000..da2c2f24
--- /dev/null
+++ b/test/noloop1.in
@@ -0,0 +1 @@
+''Italics with an apostrophe'' embedded''
diff --git a/test/noloop1.ok b/test/noloop1.ok
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/noloop1.ok
diff --git a/test/noloop2.awk b/test/noloop2.awk
new file mode 100644
index 00000000..ae461e34
--- /dev/null
+++ b/test/noloop2.awk
@@ -0,0 +1,70 @@
+# From jhart@avcnet.bates.edu Sun Oct 6 16:05:21 2002
+# Return-Path: <jhart@avcnet.bates.edu>
+# Received: from localhost (skeeve [127.0.0.1])
+# by skeeve.com (8.11.6/8.11.6) with ESMTP id g96D5Jf28053
+# for <arnold@localhost>; Sun, 6 Oct 2002 16:05:21 +0300
+# Received: from actcom.co.il [192.114.47.1]
+# by localhost with POP3 (fetchmail-5.9.0)
+# for arnold@localhost (single-drop); Sun, 06 Oct 2002 16:05:21 +0300 (IDT)
+# Received: by actcom.co.il (mbox arobbins)
+# (with Cubic Circle's cucipop (v1.31 1998/05/13) Sun Oct 6 16:06:39 2002)
+# X-From_: jhart@avcnet.bates.edu Sun Oct 6 15:31:59 2002
+# Received: from lmail.actcom.co.il by actcom.co.il with ESMTP
+# (8.11.6/actcom-0.2) id g96CVrS27315 for <arobbins@actcom.co.il>;
+# Sun, 6 Oct 2002 15:31:54 +0300 (EET DST)
+# (rfc931-sender: mail.actcom.co.il [192.114.47.13])
+# Received: from f7.net (consort.superb.net [209.61.216.22])
+# by lmail.actcom.co.il (8.11.6/8.11.6) with ESMTP id g96CVqY01629
+# for <arobbins@actcom.co.il>; Sun, 6 Oct 2002 15:31:52 +0300
+# Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164])
+# by f7.net (8.11.6/8.11.6) with ESMTP id g96CVp418974
+# for <arnold@skeeve.com>; Sun, 6 Oct 2002 08:31:51 -0400
+# Received: from monty-python.gnu.org ([199.232.76.173])
+# by fencepost.gnu.org with esmtp (Exim 4.10)
+# id 17yAZa-00055o-00
+# for bug-gawk@gnu.org; Sun, 06 Oct 2002 08:31:50 -0400
+# Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10)
+# id 17yAZE-0007eB-00
+# for bug-gawk@gnu.org; Sun, 06 Oct 2002 08:31:29 -0400
+# Received: from avcnet.bates.edu ([134.181.128.62])
+# by monty-python.gnu.org with esmtp (Exim 4.10)
+# id 17yAZ9-0007X3-00
+# for bug-gawk@gnu.org; Sun, 06 Oct 2002 08:31:23 -0400
+# Received: from a5514a.bates.edu (www.bates.edu [134.181.128.62])
+# by avcnet.bates.edu (8.9.3/8.9.3) with ESMTP id IAA05400
+# for <bug-gawk@gnu.org>; Sun, 6 Oct 2002 08:31:20 -0400
+# Date: Sun, 6 Oct 2002 08:36:54 -0400
+# Mime-Version: 1.0 (Apple Message framework v482)
+# Content-Type: text/plain; charset=US-ASCII; format=flowed
+# Subject: Infinite loop in sub/gsub
+# From: jhart@avcnet.bates.edu
+# To: bug-gawk@gnu.org
+# Content-Transfer-Encoding: 7bit
+# Message-Id: <4BC4A4F0-D928-11D6-8E78-00039384A9CC@mail.avcnet.org>
+# X-Mailer: Apple Mail (2.482)
+# X-Spam-Status: No, hits=0.3 required=5.0
+# tests=NO_REAL_NAME,SPAM_PHRASE_00_01,USER_AGENT_APPLEMAIL
+# version=2.41
+# X-Spam-Level:
+# X-SpamBouncer: 1.4 (10/07/01)
+# X-SBClass: OK
+# Status: RO
+#
+# This command line:
+#
+# echo "''Italics with an apostrophe'' embedded''"|gawk -f test.awk
+#
+# where test.awk contains this instruction:
+#
+/''/ { sub(/''(.?[^']+)*''/, "<em>&</em>"); }
+#
+# puts gawk 3.11 into an infinite loop. Whereas, this command works:
+#
+# echo "''Italics with an apostrophe' embedded''"|gawk -f test.awk
+#
+#
+#
+# Platform: Mac OS X 10.1.5/Darwin Kernel Version 5.5: Thu May 30 14:51:26
+# PDT 2002; root:xnu/xnu-201.42.3.obj~1/RELEASE_PPC
+#
+#
diff --git a/test/noloop2.in b/test/noloop2.in
new file mode 100644
index 00000000..b5cb226a
--- /dev/null
+++ b/test/noloop2.in
@@ -0,0 +1 @@
+''Italics with an apostrophe' embedded''
diff --git a/test/noloop2.ok b/test/noloop2.ok
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/noloop2.ok
diff --git a/test/noparms.ok b/test/noparms.ok
index 4c934c38..504c4e41 100644
--- a/test/noparms.ok
+++ b/test/noparms.ok
@@ -1,4 +1,5 @@
gawk: noparms.awk:1: function x(a, b, c , ,) {}
-gawk: noparms.awk:1: ^ parse error
+gawk: noparms.awk:1: ^ syntax error
gawk: noparms.awk:1: function x(a, b, c , ,) {}
-gawk: noparms.awk:1: ^ parse error
+gawk: noparms.awk:1: ^ syntax error
+EXIT CODE: 1
diff --git a/test/nulrsend.awk b/test/nulrsend.awk
new file mode 100644
index 00000000..ef70b81b
--- /dev/null
+++ b/test/nulrsend.awk
@@ -0,0 +1,112 @@
+# From murata@nips.ac.jp Tue Aug 6 08:02:14 2002
+# Return-Path: <murata@nips.ac.jp>
+# Received: from localhost (aahz [127.0.0.1])
+# by skeeve.com (8.11.2/8.11.2) with ESMTP id g7652Ej01784
+# for <arnold@localhost>; Tue, 6 Aug 2002 08:02:14 +0300
+# Received: from actcom.co.il [192.114.47.1]
+# by localhost with POP3 (fetchmail-5.7.4)
+# for arnold@localhost (single-drop); Mon, 05 Aug 2002 22:02:14 -0700 (PDT)
+# Received: by actcom.co.il (mbox arobbins)
+# (with Cubic Circle's cucipop (v1.31 1998/05/13) Tue Aug 6 08:13:06 2002)
+# X-From_: murata@nips.ac.jp Tue Aug 6 07:26:32 2002
+# Received: from lmail.actcom.co.il by actcom.co.il with ESMTP
+# (8.11.6/actcom-0.2) id g764QTu27770 for <arobbins@actcom.co.il>;
+# Tue, 6 Aug 2002 07:26:30 +0300 (EET DST)
+# (rfc931-sender: mail.actcom.co.il [192.114.47.13])
+# Received: from f7.net (consort.superb.net [209.61.216.22])
+# by lmail.actcom.co.il (8.11.6/8.11.6) with ESMTP id g764QRi04673
+# for <arobbins@actcom.co.il>; Tue, 6 Aug 2002 07:26:28 +0300
+# Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164])
+# by f7.net (8.11.6/8.11.6) with ESMTP id g764QQ920486
+# for <arnold@skeeve.com>; Tue, 6 Aug 2002 00:26:26 -0400
+# Received: from ccms.nips.ac.jp ([133.48.72.2])
+# by fencepost.gnu.org with smtp (Exim 3.35 #1 (Debian))
+# id 17bvvL-00011b-00
+# for <bug-gawk@gnu.org>; Tue, 06 Aug 2002 00:26:23 -0400
+# Received: (from murata@localhost)
+# by ccms.nips.ac.jp (8.9.3+3.2W/3.7W) id NAA01026;
+# Tue, 6 Aug 2002 13:26:21 +0900
+# Date: Tue, 6 Aug 2002 13:26:21 +0900
+# Message-Id: <200208060426.NAA01026@ccms.nips.ac.jp>
+# To: bug-gawk@gnu.org
+# Cc: murata@nips.ac.jp
+# Subject: Bug Report (gawk)
+# From: murata@nips.ac.jp (MURATA Yasuhisa)
+# Mime-Version: 1.0
+# Content-Type: text/plain; charset=US-ASCII
+# X-Mailer: mnews [version 1.21PL5] 1999-04/04(Sun)
+#
+# Hello, I report a bug.
+#
+#
+# == PROGRAM (filename: atest.awk) ==
+BEGIN {
+ RS=""
+}
+
+NR==1 {
+ print 1
+ RS="\n"
+ next
+}
+
+NR==2 {
+ print 2
+ RS=""
+ next
+}
+
+NR==3 {
+ print 3
+ RS="\n"
+ next
+}
+# ====
+#
+# == DATA (filename: atest.txt) ==
+# 1111
+#
+# 2222
+#
+# ====
+# note: last line is "\n".
+#
+#
+# == RUN (gawk) ==
+# > gawk -f atest.awk atest.txt
+# 1
+# 2
+# (no stop!)
+# ====
+#
+# == RUN (nawk) ==
+# > nawk -f atest.awk atest.txt
+# 1
+# 2
+# 3
+# ====
+#
+# == VERSION ==
+# > gawk --version
+# GNU Awk 3.1.1
+# Copyright (C) 1989, 1991-2002 Free Software Foundation.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# ==
+#
+# --
+# MURATA Yasuhisa, Technical Staff
+# National Institute for Physiological Sciences
+# E-mail: murata@nips.ac.jp
diff --git a/test/nulrsend.in b/test/nulrsend.in
new file mode 100644
index 00000000..af3eba16
--- /dev/null
+++ b/test/nulrsend.in
@@ -0,0 +1,4 @@
+1111
+
+2222
+
diff --git a/test/nulrsend.ok b/test/nulrsend.ok
new file mode 100644
index 00000000..1191247b
--- /dev/null
+++ b/test/nulrsend.ok
@@ -0,0 +1,2 @@
+1
+2
diff --git a/test/paramdup.ok b/test/paramdup.ok
index 0308cc8c..9a9df807 100644
--- a/test/paramdup.ok
+++ b/test/paramdup.ok
@@ -1,2 +1,3 @@
gawk: paramdup.awk:4: error: function `foo': parameter #4, `b', duplicates parameter #2
gawk: paramdup.awk:4: error: function `foo': parameter #5, `a', duplicates parameter #1
+EXIT CODE: 1
diff --git a/test/parseme.ok b/test/parseme.ok
index f08fee66..5e6552a3 100644
--- a/test/parseme.ok
+++ b/test/parseme.ok
@@ -1,3 +1,4 @@
gawk: parseme.awk:1: BEGIN { toupper(substr*line,1,12)) }
-gawk: parseme.awk:1: ^ parse error
+gawk: parseme.awk:1: ^ syntax error
gawk: parseme.awk:1: fatal: 0 is invalid as number of arguments for toupper
+EXIT CODE: 2
diff --git a/test/posix.in b/test/posix.in
new file mode 100644
index 00000000..c16777b8
--- /dev/null
+++ b/test/posix.in
@@ -0,0 +1 @@
+1:2,3 4
diff --git a/test/poundbang.awk b/test/poundbang.awk
index d60652e3..a6440fff 100755
--- a/test/poundbang.awk
+++ b/test/poundbang.awk
@@ -1,3 +1,2 @@
#! /tmp/gawk -f
- { ccount += length($0) }
-END { printf "average line length is %2.4f\n", ccount/NR}
+{ print }
diff --git a/test/poundbang.ok b/test/poundbang.ok
deleted file mode 100644
index 143e28dd..00000000
--- a/test/poundbang.ok
+++ /dev/null
@@ -1 +0,0 @@
-average line length is 32.6667
diff --git a/test/prec.awk b/test/prec.awk
new file mode 100644
index 00000000..8b377348
--- /dev/null
+++ b/test/prec.awk
@@ -0,0 +1,7 @@
+# check the precedence of operators:
+BEGIN {
+ $1 = i = 1
+ $+i++
+ $- -i++
+ print
+}
diff --git a/test/prec.ok b/test/prec.ok
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/test/prec.ok
@@ -0,0 +1 @@
+1
diff --git a/test/printf0.awk b/test/printf0.awk
new file mode 100644
index 00000000..ac8ad3c2
--- /dev/null
+++ b/test/printf0.awk
@@ -0,0 +1,5 @@
+BEGIN {
+ # bwk accepts this silently:
+ printf
+ print "X"
+}
diff --git a/test/printf0.ok b/test/printf0.ok
new file mode 100644
index 00000000..62d8fe9f
--- /dev/null
+++ b/test/printf0.ok
@@ -0,0 +1 @@
+X
diff --git a/test/prmarscl.ok b/test/prmarscl.ok
index 1c8db51e..a0f7ab81 100644
--- a/test/prmarscl.ok
+++ b/test/prmarscl.ok
@@ -1 +1,2 @@
gawk: prmarscl.awk:3: fatal: attempt to use scalar parameter `a' as an array
+EXIT CODE: 2
diff --git a/test/prmreuse.awk b/test/prmreuse.awk
index 37e06f59..c1ffa179 100644
--- a/test/prmreuse.awk
+++ b/test/prmreuse.awk
@@ -1,4 +1,4 @@
-# from Pat Rankin, rankin@eql.caltech.edu
+# from Pat Rankin, rankin@eql.caltech.edu, now rankin@pactechdata.com
BEGIN { dummy(1); legit(); exit }
diff --git a/test/rebuf.awk b/test/rebuf.awk
new file mode 100644
index 00000000..69b5f057
--- /dev/null
+++ b/test/rebuf.awk
@@ -0,0 +1,73 @@
+# From lole@epost.de Wed Sep 4 09:54:19 IDT 2002
+# Article: 14288 of comp.lang.awk
+# Path: iad-read.news.verio.net!dfw-artgen!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!213.70.124.113!not-for-mail
+# From: LorenzAtWork <familie.lenhardt@epost.de>
+# Newsgroups: comp.lang.awk
+# Subject: bug in gawk 3.1.1?
+# Date: Wed, 28 Aug 2002 10:34:50 +0200
+# Lines: 45
+# Message-ID: <7g1pmukv07c56ep3qav3uebnipdaohqh2l@4ax.com>
+# Reply-To: lole@epost.de
+# NNTP-Posting-Host: 213.70.124.113
+# Mime-Version: 1.0
+# Content-Type: text/plain; charset=us-ascii
+# Content-Transfer-Encoding: 7bit
+# X-Trace: fu-berlin.de 1030523788 53278293 213.70.124.113 (16 [68559])
+# X-Newsreader: Forte Agent 1.91/32.564
+# Xref: dfw-artgen comp.lang.awk:14288
+#
+# hello all,
+#
+# I'm using the following script
+#
+BEGIN {
+ RS="ti1\n(dwv,)?"
+ s = 0
+ i = 0
+}
+{
+ if ($1 != "")
+ s = $1
+ print ++i, s
+}
+#
+# to extract values from a file of the form
+#
+# ti1
+# dwv,98.22
+# ti1
+# dwv,103.08
+# ti1
+# ti1
+# dwv,196.25
+# ti1
+# dwv,210.62
+# ti1
+# dwv,223.53
+#
+# The desired result for this example looks like
+#
+# 1 0
+# 2 98.22
+# 3 103.08
+# 4 103.08
+# 5 196.25
+# 6 210.62
+# 7 223.53
+#
+# The script work fine the most time, but when run on the attached file
+# (sorry for the size, but the error would not appear with less data) I
+# get some (three with the attached file) lines that look like
+#
+# 1262 dwv,212.97
+# 1277 dwv,174.33
+# 1279 dwv,151.79
+#
+# I can't think of a other reason for this than a bug in gawk!
+#
+# I'm running gawk 3.1.1 on winnt 4.0
+#
+# best regards
+# Lorenz
+#
+#
diff --git a/test/rebuf.in b/test/rebuf.in
new file mode 100644
index 00000000..46d22107
--- /dev/null
+++ b/test/rebuf.in
@@ -0,0 +1,2350 @@
+ti1
+dwv,214.59
+ti1
+dwv,230.31
+ti1
+dwv,242.64
+ti1
+dwv,253.94
+ti1
+dwv,264.33
+ti1
+dwv,270.94
+ti1
+dwv,273.52
+ti1
+dwv,270.08
+ti1
+dwv,263.19
+ti1
+dwv,254.45
+ti1
+dwv,244.91
+ti1
+dwv,234.55
+ti1
+dwv,222.49
+ti1
+dwv,209.94
+ti1
+dwv,197.17
+ti1
+dwv,182.89
+ti1
+dwv,169.76
+ti1
+dwv,158.59
+ti1
+dwv,145.37
+ti1
+dwv,135.46
+ti1
+dwv,124.77
+ti1
+dwv,115.98
+ti1
+dwv,108.77
+ti1
+dwv,101.12
+ti1
+dwv,94.45
+ti1
+dwv,89.08
+ti1
+dwv,84.63
+ti1
+dwv,81.05
+ti1
+dwv,78.93
+ti1
+dwv,76.65
+ti1
+dwv,75.59
+ti1
+ti1
+ti1
+dwv,77.47
+ti1
+dwv,80.17
+ti1
+dwv,83.90
+ti1
+dwv,88.56
+ti1
+dwv,95.69
+ti1
+dwv,97.48
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,203.08
+ti1
+dwv,218.22
+ti1
+dwv,229.37
+ti1
+dwv,238.49
+ti1
+dwv,247.43
+ti1
+dwv,255.22
+ti1
+dwv,261.31
+ti1
+dwv,262.36
+ti1
+dwv,260.66
+ti1
+dwv,256.33
+ti1
+dwv,249.34
+ti1
+dwv,240.03
+ti1
+dwv,228.55
+ti1
+dwv,215.42
+ti1
+dwv,203.37
+ti1
+dwv,190.01
+ti1
+dwv,177.81
+ti1
+dwv,165.44
+ti1
+dwv,152.92
+ti1
+dwv,142.03
+ti1
+dwv,132.91
+ti1
+dwv,124.48
+ti1
+dwv,116.45
+ti1
+dwv,109.06
+ti1
+dwv,103.27
+ti1
+dwv,98.87
+ti1
+dwv,94.95
+ti1
+dwv,92.56
+ti1
+dwv,90.47
+ti1
+dwv,89.48
+ti1
+ti1
+dwv,90.53
+ti1
+dwv,93.07
+ti1
+dwv,97.12
+ti1
+dwv,101.82
+ti1
+dwv,108.18
+ti1
+dwv,109.73
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,202.97
+ti1
+dwv,217.38
+ti1
+dwv,231.73
+ti1
+dwv,243.11
+ti1
+dwv,255.37
+ti1
+dwv,264.12
+ti1
+dwv,269.64
+ti1
+dwv,270.98
+ti1
+dwv,269.65
+ti1
+dwv,264.55
+ti1
+dwv,257.16
+ti1
+dwv,246.01
+ti1
+dwv,232.88
+ti1
+dwv,219.85
+ti1
+dwv,208.79
+ti1
+dwv,197.00
+ti1
+dwv,183.93
+ti1
+dwv,172.00
+ti1
+dwv,160.55
+ti1
+dwv,150.59
+ti1
+dwv,141.47
+ti1
+dwv,133.02
+ti1
+dwv,126.21
+ti1
+dwv,120.64
+ti1
+dwv,115.79
+ti1
+dwv,111.62
+ti1
+dwv,108.41
+ti1
+dwv,106.41
+ti1
+ti1
+ti1
+dwv,109.08
+ti1
+dwv,113.23
+ti1
+dwv,118.57
+ti1
+dwv,122.57
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,208.07
+ti1
+dwv,224.14
+ti1
+dwv,236.28
+ti1
+dwv,248.12
+ti1
+dwv,258.97
+ti1
+dwv,267.74
+ti1
+dwv,272.47
+ti1
+dwv,271.52
+ti1
+dwv,266.80
+ti1
+dwv,258.61
+ti1
+dwv,249.30
+ti1
+dwv,239.19
+ti1
+dwv,228.28
+ti1
+dwv,215.79
+ti1
+dwv,203.86
+ti1
+dwv,190.08
+ti1
+dwv,177.40
+ti1
+dwv,163.81
+ti1
+dwv,152.60
+ti1
+dwv,141.33
+ti1
+dwv,130.98
+ti1
+dwv,121.98
+ti1
+dwv,114.08
+ti1
+dwv,106.61
+ti1
+dwv,99.75
+ti1
+dwv,93.10
+ti1
+dwv,86.57
+ti1
+dwv,80.62
+ti1
+dwv,76.05
+ti1
+dwv,71.52
+ti1
+dwv,68.85
+ti1
+dwv,67.46
+ti1
+dwv,66.86
+ti1
+dwv,67.51
+ti1
+dwv,69.75
+ti1
+dwv,72.85
+ti1
+dwv,76.23
+ti1
+dwv,82.85
+ti1
+dwv,89.33
+ti1
+dwv,93.39
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,188.37
+ti1
+dwv,204.42
+ti1
+dwv,217.16
+ti1
+dwv,228.89
+ti1
+dwv,238.83
+ti1
+dwv,247.70
+ti1
+dwv,253.59
+ti1
+dwv,257.17
+ti1
+ti1
+dwv,254.00
+ti1
+dwv,248.24
+ti1
+dwv,240.14
+ti1
+dwv,229.42
+ti1
+dwv,218.97
+ti1
+dwv,205.09
+ti1
+dwv,192.61
+ti1
+dwv,179.74
+ti1
+dwv,166.76
+ti1
+dwv,155.36
+ti1
+dwv,143.58
+ti1
+dwv,131.40
+ti1
+dwv,121.84
+ti1
+dwv,112.46
+ti1
+dwv,105.41
+ti1
+dwv,97.15
+ti1
+dwv,90.09
+ti1
+dwv,84.79
+ti1
+dwv,80.52
+ti1
+dwv,75.58
+ti1
+dwv,72.59
+ti1
+dwv,69.39
+ti1
+dwv,67.51
+ti1
+dwv,66.42
+ti1
+ti1
+ti1
+dwv,67.82
+ti1
+dwv,69.76
+ti1
+dwv,73.19
+ti1
+dwv,77.35
+ti1
+dwv,82.36
+ti1
+dwv,87.82
+ti1
+dwv,93.30
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,190.58
+ti1
+dwv,203.43
+ti1
+dwv,216.48
+ti1
+dwv,228.89
+ti1
+dwv,241.91
+ti1
+dwv,251.60
+ti1
+dwv,257.78
+ti1
+dwv,262.18
+ti1
+dwv,263.13
+ti1
+dwv,260.91
+ti1
+dwv,255.34
+ti1
+dwv,247.17
+ti1
+dwv,236.85
+ti1
+dwv,225.24
+ti1
+dwv,213.39
+ti1
+dwv,201.46
+ti1
+dwv,187.77
+ti1
+dwv,175.31
+ti1
+dwv,162.95
+ti1
+dwv,152.55
+ti1
+dwv,142.56
+ti1
+dwv,132.94
+ti1
+dwv,125.00
+ti1
+dwv,117.69
+ti1
+dwv,110.96
+ti1
+dwv,105.02
+ti1
+dwv,101.78
+ti1
+dwv,98.48
+ti1
+dwv,97.06
+ti1
+dwv,96.50
+ti1
+ti1
+dwv,98.48
+ti1
+dwv,101.18
+ti1
+dwv,104.56
+ti1
+dwv,109.67
+ti1
+dwv,115.86
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,200.02
+ti1
+dwv,217.51
+ti1
+dwv,233.21
+ti1
+dwv,245.72
+ti1
+dwv,258.21
+ti1
+dwv,267.24
+ti1
+dwv,273.79
+ti1
+dwv,273.20
+ti1
+dwv,270.38
+ti1
+dwv,260.76
+ti1
+dwv,250.05
+ti1
+dwv,241.32
+ti1
+dwv,231.14
+ti1
+dwv,219.83
+ti1
+dwv,206.13
+ti1
+dwv,193.24
+ti1
+dwv,180.73
+ti1
+dwv,167.82
+ti1
+dwv,156.94
+ti1
+dwv,144.13
+ti1
+dwv,134.40
+ti1
+dwv,125.23
+ti1
+dwv,116.13
+ti1
+dwv,107.34
+ti1
+dwv,99.71
+ti1
+dwv,94.11
+ti1
+dwv,88.91
+ti1
+dwv,84.51
+ti1
+dwv,81.50
+ti1
+dwv,78.66
+ti1
+dwv,76.57
+ti1
+dwv,75.82
+ti1
+ti1
+dwv,76.88
+ti1
+dwv,79.03
+ti1
+dwv,82.12
+ti1
+dwv,85.73
+ti1
+dwv,91.05
+ti1
+dwv,96.31
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,184.18
+ti1
+dwv,201.10
+ti1
+dwv,214.21
+ti1
+dwv,226.18
+ti1
+dwv,237.72
+ti1
+dwv,247.57
+ti1
+dwv,254.36
+ti1
+dwv,258.34
+ti1
+dwv,259.80
+ti1
+dwv,257.76
+ti1
+dwv,253.17
+ti1
+dwv,246.51
+ti1
+dwv,237.92
+ti1
+dwv,227.09
+ti1
+dwv,214.13
+ti1
+dwv,202.20
+ti1
+dwv,189.21
+ti1
+dwv,177.65
+ti1
+dwv,166.18
+ti1
+dwv,154.03
+ti1
+dwv,142.21
+ti1
+dwv,131.51
+ti1
+dwv,121.28
+ti1
+dwv,111.80
+ti1
+dwv,104.47
+ti1
+dwv,98.80
+ti1
+dwv,94.76
+ti1
+dwv,91.81
+ti1
+dwv,89.17
+ti1
+dwv,88.00
+ti1
+ti1
+ti1
+dwv,89.20
+ti1
+dwv,91.17
+ti1
+dwv,94.35
+ti1
+dwv,99.00
+ti1
+dwv,105.43
+ti1
+dwv,109.34
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,194.84
+ti1
+dwv,212.05
+ti1
+dwv,226.30
+ti1
+dwv,239.03
+ti1
+dwv,250.94
+ti1
+dwv,259.73
+ti1
+dwv,266.64
+ti1
+dwv,269.67
+ti1
+dwv,269.03
+ti1
+dwv,265.03
+ti1
+dwv,258.23
+ti1
+dwv,249.32
+ti1
+dwv,238.03
+ti1
+dwv,226.20
+ti1
+dwv,213.46
+ti1
+dwv,200.53
+ti1
+dwv,187.65
+ti1
+dwv,174.89
+ti1
+dwv,163.22
+ti1
+dwv,152.47
+ti1
+dwv,142.65
+ti1
+dwv,133.97
+ti1
+dwv,126.59
+ti1
+dwv,120.52
+ti1
+dwv,115.57
+ti1
+dwv,111.49
+ti1
+dwv,108.03
+ti1
+dwv,106.01
+ti1
+dwv,105.28
+ti1
+ti1
+dwv,106.91
+ti1
+dwv,109.73
+ti1
+dwv,114.91
+ti1
+dwv,120.66
+ti1
+dwv,123.74
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,211.57
+ti1
+dwv,227.06
+ti1
+dwv,240.57
+ti1
+dwv,252.26
+ti1
+dwv,262.67
+ti1
+dwv,270.66
+ti1
+dwv,273.40
+ti1
+dwv,270.25
+ti1
+dwv,263.76
+ti1
+dwv,256.03
+ti1
+dwv,246.87
+ti1
+dwv,237.10
+ti1
+dwv,225.11
+ti1
+dwv,211.53
+ti1
+dwv,197.77
+ti1
+dwv,185.75
+ti1
+dwv,173.00
+ti1
+dwv,159.31
+ti1
+dwv,147.18
+ti1
+dwv,134.84
+ti1
+dwv,125.07
+ti1
+dwv,115.82
+ti1
+dwv,107.33
+ti1
+dwv,100.07
+ti1
+dwv,93.55
+ti1
+dwv,87.60
+ti1
+dwv,81.75
+ti1
+dwv,77.03
+ti1
+dwv,73.39
+ti1
+dwv,70.97
+ti1
+dwv,67.94
+ti1
+dwv,66.64
+ti1
+dwv,65.80
+ti1
+ti1
+dwv,66.85
+ti1
+dwv,68.78
+ti1
+dwv,71.47
+ti1
+dwv,74.20
+ti1
+dwv,78.68
+ti1
+dwv,85.08
+ti1
+dwv,87.47
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,185.81
+ti1
+dwv,201.66
+ti1
+dwv,215.07
+ti1
+dwv,227.26
+ti1
+dwv,238.00
+ti1
+dwv,247.64
+ti1
+dwv,255.03
+ti1
+dwv,257.12
+ti1
+dwv,256.17
+ti1
+dwv,253.47
+ti1
+dwv,248.93
+ti1
+dwv,241.39
+ti1
+dwv,231.45
+ti1
+dwv,220.49
+ti1
+dwv,208.48
+ti1
+dwv,196.04
+ti1
+dwv,182.73
+ti1
+dwv,169.40
+ti1
+dwv,157.24
+ti1
+dwv,145.56
+ti1
+dwv,133.54
+ti1
+dwv,124.01
+ti1
+dwv,114.55
+ti1
+dwv,105.75
+ti1
+dwv,98.32
+ti1
+dwv,91.91
+ti1
+dwv,86.08
+ti1
+dwv,81.35
+ti1
+dwv,77.78
+ti1
+dwv,73.85
+ti1
+dwv,71.12
+ti1
+dwv,68.53
+ti1
+dwv,67.09
+ti1
+dwv,66.34
+ti1
+ti1
+ti1
+dwv,67.92
+ti1
+dwv,70.08
+ti1
+dwv,73.78
+ti1
+dwv,78.68
+ti1
+dwv,84.33
+ti1
+dwv,90.25
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,183.19
+ti1
+dwv,198.96
+ti1
+dwv,213.55
+ti1
+dwv,225.91
+ti1
+dwv,237.33
+ti1
+dwv,246.66
+ti1
+dwv,254.98
+ti1
+dwv,259.46
+ti1
+dwv,261.02
+ti1
+dwv,260.02
+ti1
+dwv,255.96
+ti1
+dwv,249.08
+ti1
+dwv,240.15
+ti1
+dwv,229.51
+ti1
+dwv,217.21
+ti1
+dwv,205.06
+ti1
+dwv,192.62
+ti1
+dwv,177.43
+ti1
+dwv,165.06
+ti1
+dwv,152.36
+ti1
+dwv,142.35
+ti1
+dwv,134.58
+ti1
+dwv,126.20
+ti1
+dwv,119.86
+ti1
+dwv,113.67
+ti1
+dwv,108.20
+ti1
+dwv,104.71
+ti1
+dwv,100.83
+ti1
+dwv,98.96
+ti1
+dwv,98.38
+ti1
+ti1
+dwv,100.29
+ti1
+dwv,103.47
+ti1
+dwv,107.73
+ti1
+dwv,113.04
+ti1
+dwv,118.90
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,200.70
+ti1
+dwv,217.77
+ti1
+dwv,232.45
+ti1
+dwv,244.28
+ti1
+dwv,256.61
+ti1
+dwv,265.93
+ti1
+dwv,272.01
+ti1
+ti1
+dwv,268.67
+ti1
+dwv,260.53
+ti1
+dwv,252.09
+ti1
+dwv,243.72
+ti1
+dwv,232.68
+ti1
+dwv,220.49
+ti1
+dwv,206.88
+ti1
+dwv,193.98
+ti1
+dwv,181.33
+ti1
+dwv,168.61
+ti1
+dwv,156.50
+ti1
+dwv,145.54
+ti1
+dwv,136.43
+ti1
+dwv,125.95
+ti1
+dwv,117.26
+ti1
+dwv,109.81
+ti1
+dwv,103.36
+ti1
+dwv,97.15
+ti1
+dwv,92.86
+ti1
+dwv,89.02
+ti1
+dwv,86.39
+ti1
+dwv,84.44
+ti1
+dwv,83.72
+ti1
+ti1
+dwv,85.89
+ti1
+dwv,88.39
+ti1
+dwv,92.31
+ti1
+dwv,96.00
+ti1
+dwv,100.24
+ti1
+dwv,102.55
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,197.15
+ti1
+dwv,212.33
+ti1
+dwv,225.48
+ti1
+dwv,236.75
+ti1
+dwv,247.52
+ti1
+dwv,255.21
+ti1
+dwv,260.74
+ti1
+dwv,262.81
+ti1
+dwv,262.09
+ti1
+dwv,258.08
+ti1
+dwv,250.83
+ti1
+dwv,242.39
+ti1
+dwv,230.86
+ti1
+dwv,219.62
+ti1
+dwv,206.80
+ti1
+dwv,193.41
+ti1
+dwv,180.60
+ti1
+dwv,168.20
+ti1
+dwv,157.77
+ti1
+dwv,145.25
+ti1
+dwv,136.23
+ti1
+dwv,126.28
+ti1
+dwv,118.10
+ti1
+dwv,110.74
+ti1
+dwv,105.29
+ti1
+dwv,99.75
+ti1
+dwv,95.61
+ti1
+dwv,92.16
+ti1
+dwv,89.93
+ti1
+dwv,88.45
+ti1
+ti1
+dwv,89.11
+ti1
+dwv,90.87
+ti1
+dwv,94.21
+ti1
+dwv,98.16
+ti1
+dwv,104.24
+ti1
+dwv,108.98
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,195.81
+ti1
+dwv,211.95
+ti1
+dwv,226.36
+ti1
+dwv,240.61
+ti1
+dwv,251.93
+ti1
+dwv,259.13
+ti1
+dwv,265.36
+ti1
+dwv,269.71
+ti1
+dwv,270.27
+ti1
+dwv,266.44
+ti1
+dwv,260.44
+ti1
+dwv,251.94
+ti1
+dwv,240.79
+ti1
+dwv,228.95
+ti1
+dwv,215.90
+ti1
+dwv,203.25
+ti1
+dwv,190.01
+ti1
+dwv,177.92
+ti1
+dwv,165.60
+ti1
+dwv,155.49
+ti1
+dwv,144.32
+ti1
+dwv,136.07
+ti1
+dwv,127.64
+ti1
+dwv,120.28
+ti1
+dwv,114.57
+ti1
+dwv,109.99
+ti1
+dwv,106.36
+ti1
+dwv,104.49
+ti1
+dwv,103.84
+ti1
+ti1
+dwv,105.77
+ti1
+dwv,107.83
+ti1
+dwv,112.41
+ti1
+dwv,117.71
+ti1
+dwv,120.66
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,210.13
+ti1
+dwv,225.03
+ti1
+dwv,238.76
+ti1
+dwv,250.50
+ti1
+dwv,261.18
+ti1
+dwv,269.22
+ti1
+dwv,274.18
+ti1
+dwv,272.28
+ti1
+dwv,266.66
+ti1
+dwv,258.68
+ti1
+dwv,249.88
+ti1
+dwv,239.94
+ti1
+dwv,227.14
+ti1
+dwv,213.22
+ti1
+dwv,197.58
+ti1
+dwv,184.86
+ti1
+dwv,172.52
+ti1
+dwv,160.19
+ti1
+dwv,149.20
+ti1
+dwv,137.49
+ti1
+dwv,127.86
+ti1
+dwv,118.91
+ti1
+dwv,110.49
+ti1
+dwv,102.73
+ti1
+dwv,96.33
+ti1
+dwv,90.95
+ti1
+dwv,86.38
+ti1
+dwv,82.72
+ti1
+dwv,79.65
+ti1
+dwv,77.61
+ti1
+dwv,75.70
+ti1
+dwv,74.49
+ti1
+ti1
+ti1
+dwv,76.48
+ti1
+dwv,79.14
+ti1
+dwv,82.84
+ti1
+dwv,87.86
+ti1
+dwv,92.69
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,181.33
+ti1
+dwv,196.86
+ti1
+dwv,210.98
+ti1
+dwv,223.13
+ti1
+dwv,233.90
+ti1
+dwv,243.19
+ti1
+dwv,250.57
+ti1
+dwv,255.00
+ti1
+dwv,256.36
+ti1
+dwv,255.16
+ti1
+dwv,250.15
+ti1
+dwv,242.80
+ti1
+dwv,233.82
+ti1
+dwv,223.41
+ti1
+dwv,210.81
+ti1
+dwv,199.04
+ti1
+dwv,187.39
+ti1
+dwv,174.14
+ti1
+dwv,162.62
+ti1
+dwv,151.39
+ti1
+dwv,139.59
+ti1
+dwv,128.71
+ti1
+dwv,119.17
+ti1
+dwv,111.02
+ti1
+dwv,103.91
+ti1
+dwv,96.78
+ti1
+dwv,91.56
+ti1
+dwv,87.13
+ti1
+dwv,83.22
+ti1
+dwv,80.50
+ti1
+dwv,76.83
+ti1
+dwv,74.24
+ti1
+dwv,70.80
+ti1
+dwv,69.04
+ti1
+dwv,67.12
+ti1
+dwv,66.51
+ti1
+ti1
+dwv,68.77
+ti1
+dwv,72.19
+ti1
+dwv,77.34
+ti1
+dwv,84.04
+ti1
+dwv,88.55
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,190.51
+ti1
+dwv,207.14
+ti1
+dwv,220.57
+ti1
+dwv,232.51
+ti1
+dwv,243.35
+ti1
+dwv,252.41
+ti1
+dwv,258.62
+ti1
+dwv,262.18
+ti1
+ti1
+dwv,259.10
+ti1
+dwv,253.54
+ti1
+dwv,245.44
+ti1
+dwv,235.55
+ti1
+dwv,223.43
+ti1
+dwv,209.91
+ti1
+dwv,197.52
+ti1
+dwv,185.90
+ti1
+dwv,172.13
+ti1
+dwv,161.09
+ti1
+dwv,150.58
+ti1
+dwv,140.37
+ti1
+dwv,130.27
+ti1
+dwv,122.13
+ti1
+dwv,114.99
+ti1
+dwv,108.76
+ti1
+dwv,104.67
+ti1
+dwv,100.36
+ti1
+dwv,97.61
+ti1
+dwv,95.48
+ti1
+dwv,94.83
+ti1
+dwv,95.45
+ti1
+dwv,97.15
+ti1
+dwv,100.73
+ti1
+dwv,105.10
+ti1
+dwv,111.46
+ti1
+dwv,118.27
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,202.92
+ti1
+dwv,220.25
+ti1
+dwv,233.35
+ti1
+dwv,243.48
+ti1
+dwv,254.85
+ti1
+dwv,265.75
+ti1
+dwv,272.62
+ti1
+ti1
+dwv,269.36
+ti1
+dwv,261.82
+ti1
+dwv,252.85
+ti1
+dwv,244.08
+ti1
+dwv,232.96
+ti1
+dwv,219.59
+ti1
+dwv,207.32
+ti1
+dwv,193.87
+ti1
+dwv,181.77
+ti1
+dwv,168.60
+ti1
+dwv,155.76
+ti1
+dwv,144.03
+ti1
+dwv,134.07
+ti1
+dwv,123.46
+ti1
+dwv,114.47
+ti1
+dwv,107.64
+ti1
+dwv,100.46
+ti1
+dwv,94.53
+ti1
+dwv,89.28
+ti1
+dwv,84.59
+ti1
+dwv,80.96
+ti1
+dwv,78.54
+ti1
+dwv,76.28
+ti1
+dwv,75.51
+ti1
+ti1
+dwv,76.55
+ti1
+dwv,78.55
+ti1
+dwv,81.57
+ti1
+dwv,85.18
+ti1
+dwv,90.61
+ti1
+dwv,96.01
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,184.51
+ti1
+dwv,201.57
+ti1
+dwv,216.33
+ti1
+dwv,228.69
+ti1
+dwv,239.90
+ti1
+dwv,250.41
+ti1
+dwv,257.91
+ti1
+dwv,262.29
+ti1
+dwv,263.41
+ti1
+dwv,261.70
+ti1
+dwv,256.75
+ti1
+dwv,246.82
+ti1
+dwv,236.35
+ti1
+dwv,225.17
+ti1
+dwv,212.90
+ti1
+dwv,201.61
+ti1
+dwv,188.42
+ti1
+dwv,175.92
+ti1
+dwv,163.70
+ti1
+dwv,153.18
+ti1
+dwv,142.89
+ti1
+dwv,132.95
+ti1
+dwv,125.18
+ti1
+dwv,117.61
+ti1
+dwv,110.36
+ti1
+dwv,104.56
+ti1
+dwv,100.13
+ti1
+dwv,96.64
+ti1
+dwv,93.52
+ti1
+dwv,91.91
+ti1
+ti1
+ti1
+dwv,93.84
+ti1
+dwv,97.13
+ti1
+dwv,101.08
+ti1
+dwv,107.19
+ti1
+dwv,111.89
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,195.89
+ti1
+dwv,212.65
+ti1
+dwv,226.60
+ti1
+dwv,239.28
+ti1
+dwv,251.28
+ti1
+dwv,259.92
+ti1
+dwv,266.03
+ti1
+dwv,269.76
+ti1
+ti1
+dwv,265.55
+ti1
+dwv,258.92
+ti1
+dwv,250.42
+ti1
+dwv,240.04
+ti1
+dwv,229.03
+ti1
+dwv,216.69
+ti1
+dwv,204.21
+ti1
+dwv,191.25
+ti1
+dwv,178.40
+ti1
+dwv,168.31
+ti1
+dwv,157.47
+ti1
+dwv,148.62
+ti1
+dwv,139.12
+ti1
+dwv,129.54
+ti1
+dwv,121.65
+ti1
+dwv,114.59
+ti1
+dwv,109.30
+ti1
+dwv,106.39
+ti1
+dwv,104.71
+ti1
+ti1
+dwv,106.41
+ti1
+dwv,109.22
+ti1
+dwv,113.62
+ti1
+dwv,118.31
+ti1
+dwv,124.34
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,205.67
+ti1
+dwv,221.25
+ti1
+dwv,235.02
+ti1
+dwv,247.47
+ti1
+dwv,258.37
+ti1
+dwv,267.42
+ti1
+dwv,272.60
+ti1
+dwv,272.00
+ti1
+dwv,267.91
+ti1
+dwv,260.38
+ti1
+dwv,251.10
+ti1
+dwv,241.32
+ti1
+dwv,230.96
+ti1
+dwv,217.34
+ti1
+dwv,204.99
+ti1
+dwv,191.24
+ti1
+dwv,178.58
+ti1
+dwv,164.79
+ti1
+dwv,153.07
+ti1
+dwv,141.06
+ti1
+dwv,129.86
+ti1
+dwv,119.79
+ti1
+dwv,111.13
+ti1
+dwv,103.53
+ti1
+dwv,96.95
+ti1
+dwv,89.42
+ti1
+dwv,85.22
+ti1
+dwv,80.54
+ti1
+dwv,76.85
+ti1
+dwv,74.41
+ti1
+dwv,72.12
+ti1
+dwv,71.21
+ti1
+ti1
+ti1
+dwv,72.13
+ti1
+dwv,74.22
+ti1
+dwv,76.95
+ti1
+dwv,80.65
+ti1
+dwv,85.36
+ti1
+dwv,90.60
+ti1
+dwv,92.36
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,191.27
+ti1
+dwv,205.03
+ti1
+dwv,218.89
+ti1
+dwv,230.87
+ti1
+dwv,241.63
+ti1
+dwv,249.83
+ti1
+dwv,255.42
+ti1
+dwv,257.98
+ti1
+dwv,257.33
+ti1
+dwv,252.87
+ti1
+dwv,245.90
+ti1
+dwv,237.78
+ti1
+dwv,227.14
+ti1
+dwv,214.67
+ti1
+dwv,202.31
+ti1
+dwv,188.68
+ti1
+dwv,175.96
+ti1
+dwv,163.25
+ti1
+dwv,151.43
+ti1
+dwv,139.79
+ti1
+dwv,130.40
+ti1
+dwv,118.92
+ti1
+dwv,110.88
+ti1
+dwv,101.92
+ti1
+dwv,94.45
+ti1
+dwv,88.13
+ti1
+dwv,83.19
+ti1
+dwv,79.11
+ti1
+dwv,74.60
+ti1
+dwv,71.86
+ti1
+dwv,68.77
+ti1
+dwv,66.57
+ti1
+dwv,65.24
+ti1
+dwv,64.41
+ti1
+ti1
+dwv,64.92
+ti1
+dwv,66.62
+ti1
+dwv,68.93
+ti1
+dwv,72.77
+ti1
+dwv,77.76
+ti1
+dwv,83.41
+ti1
+dwv,89.19
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,182.68
+ti1
+dwv,199.88
+ti1
+dwv,214.62
+ti1
+dwv,227.29
+ti1
+dwv,238.62
+ti1
+dwv,249.01
+ti1
+dwv,256.68
+ti1
+dwv,262.71
+ti1
+dwv,263.44
+ti1
+dwv,259.87
+ti1
+dwv,254.66
+ti1
+dwv,248.11
+ti1
+dwv,240.01
+ti1
+dwv,229.30
+ti1
+dwv,216.52
+ti1
+dwv,205.15
+ti1
+dwv,192.49
+ti1
+dwv,179.70
+ti1
+dwv,167.51
+ti1
+dwv,156.31
+ti1
+dwv,145.97
+ti1
+dwv,135.93
+ti1
+dwv,128.06
+ti1
+dwv,119.45
+ti1
+dwv,113.01
+ti1
+dwv,108.31
+ti1
+dwv,103.79
+ti1
+dwv,100.92
+ti1
+dwv,98.90
+ti1
+dwv,98.28
+ti1
+ti1
+dwv,100.12
+ti1
+dwv,102.38
+ti1
+dwv,106.07
+ti1
+dwv,111.06
+ti1
+dwv,117.00
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,202.42
+ti1
+dwv,217.46
+ti1
+dwv,232.83
+ti1
+dwv,245.05
+ti1
+dwv,256.39
+ti1
+dwv,265.28
+ti1
+dwv,271.80
+ti1
+ti1
+dwv,268.63
+ti1
+dwv,261.21
+ti1
+dwv,253.57
+ti1
+dwv,244.41
+ti1
+dwv,233.79
+ti1
+dwv,220.80
+ti1
+dwv,209.24
+ti1
+dwv,196.54
+ti1
+dwv,183.38
+ti1
+dwv,170.14
+ti1
+dwv,157.79
+ti1
+dwv,144.31
+ti1
+dwv,131.53
+ti1
+dwv,122.20
+ti1
+dwv,113.46
+ti1
+dwv,106.57
+ti1
+dwv,100.93
+ti1
+dwv,96.80
+ti1
+dwv,92.10
+ti1
+dwv,88.77
+ti1
+dwv,86.07
+ti1
+dwv,83.75
+ti1
+dwv,82.40
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,84.82
+ti1
+dwv,88.34
+ti1
+dwv,92.06
+ti1
+dwv,98.22
+ti1
+dwv,103.08
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,196.25
+ti1
+dwv,210.62
+ti1
+dwv,223.53
+ti1
+dwv,235.01
+ti1
+dwv,245.30
+ti1
+dwv,253.56
+ti1
+dwv,259.86
+ti1
+dwv,261.87
+ti1
+ti1
+dwv,257.71
+ti1
+dwv,251.10
+ti1
+dwv,242.25
+ti1
+dwv,232.00
+ti1
+dwv,219.62
+ti1
+dwv,207.54
+ti1
+dwv,194.54
+ti1
+dwv,182.85
+ti1
+dwv,170.49
+ti1
+dwv,158.24
+ti1
+dwv,147.54
+ti1
+dwv,137.40
+ti1
+dwv,129.81
+ti1
+dwv,121.07
+ti1
+dwv,114.39
+ti1
+dwv,109.32
+ti1
+dwv,103.67
+ti1
+dwv,99.51
+ti1
+dwv,96.53
+ti1
+dwv,94.67
+ti1
+dwv,93.79
+ti1
+ti1
+dwv,95.31
+ti1
+dwv,98.43
+ti1
+dwv,102.95
+ti1
+dwv,109.01
+ti1
+dwv,115.86
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,209.63
+ti1
+dwv,224.03
+ti1
+dwv,236.93
+ti1
+dwv,249.17
+ti1
+dwv,259.34
+ti1
+dwv,267.41
+ti1
+dwv,271.07
+ti1
+dwv,270.51
+ti1
+dwv,263.93
+ti1
+dwv,255.80
+ti1
+dwv,246.03
+ti1
+dwv,235.96
+ti1
+dwv,223.79
+ti1
+dwv,209.68
+ti1
+dwv,196.98
+ti1
+dwv,184.70
+ti1
+dwv,171.16
+ti1
+dwv,157.06
+ti1
+dwv,145.05
+ti1
+dwv,133.80
+ti1
+dwv,123.45
+ti1
+dwv,114.06
+ti1
+dwv,106.78
+ti1
+dwv,98.12
+ti1
+dwv,91.19
+ti1
+dwv,84.78
+ti1
+dwv,80.10
+ti1
+dwv,74.95
+ti1
+dwv,71.88
+ti1
+dwv,68.51
+ti1
+dwv,66.13
+ti1
+dwv,64.64
+ti1
+dwv,63.65
+ti1
+dwv,63.06
+ti1
+ti1
+dwv,64.29
+ti1
+dwv,66.41
+ti1
+dwv,68.95
+ti1
+dwv,73.12
+ti1
+dwv,78.00
+ti1
+dwv,83.67
+ti1
+dwv,85.55
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,187.86
+ti1
+dwv,202.65
+ti1
+dwv,216.23
+ti1
+dwv,228.24
+ti1
+dwv,239.81
+ti1
+dwv,248.77
+ti1
+dwv,252.97
+ti1
+dwv,254.72
+ti1
+ti1
+dwv,253.22
+ti1
+dwv,247.80
+ti1
+dwv,239.99
+ti1
+dwv,229.87
+ti1
+dwv,218.26
+ti1
+dwv,205.99
+ti1
+dwv,193.09
+ti1
+dwv,180.59
+ti1
+dwv,167.42
+ti1
+dwv,154.33
+ti1
+dwv,142.32
+ti1
+dwv,131.88
+ti1
+dwv,122.32
+ti1
+dwv,112.84
+ti1
+dwv,104.07
+ti1
+dwv,96.62
+ti1
+dwv,90.02
+ti1
+dwv,84.43
+ti1
+dwv,79.90
+ti1
+dwv,74.59
+ti1
+dwv,71.27
+ti1
+dwv,67.37
+ti1
+dwv,64.97
+ti1
+dwv,62.82
+ti1
+dwv,61.60
+ti1
+ti1
+ti1
+dwv,62.99
+ti1
+dwv,64.80
+ti1
+dwv,68.51
+ti1
+dwv,72.70
+ti1
+dwv,77.97
+ti1
+dwv,84.10
+ti1
+dwv,88.07
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+ti1
+dwv,184.25
+ti1
+dwv,199.56
+ti1
+dwv,212.97
+ti1
+dwv,226.37
+ti1
+dwv,237.23
+ti1
+dwv,247.66
+ti1
+dwv,254.97
+ti1
+dwv,259.77
+ti1
+dwv,261.89
+ti1
+dwv,260.39
+ti1
+dwv,255.67
+ti1
+dwv,248.49
+ti1
+dwv,238.75
+ti1
+dwv,228.34
+ti1
+dwv,215.95
+ti1
+dwv,201.71
+ti1
+dwv,187.12
+ti1
+dwv,174.33
+ti1
+dwv,162.05
+ti1
+dwv,151.79
+ti1
+dwv,142.67
+ti1
+dwv,134.03
+ti1
+dwv,126.03
+ti1
+dwv,118.64
+ti1
+dwv,112.00
+ti1
+dwv,107.16
+ti1
+dwv,103.71
+ti1
+dwv,100.06
+ti1
+dwv,98.59
+ti1
+dwv,97.68
+ti1
+ti1
diff --git a/test/rebuf.ok b/test/rebuf.ok
new file mode 100644
index 00000000..f452f553
--- /dev/null
+++ b/test/rebuf.ok
@@ -0,0 +1,1290 @@
+1 0
+2 214.59
+3 230.31
+4 242.64
+5 253.94
+6 264.33
+7 270.94
+8 273.52
+9 270.08
+10 263.19
+11 254.45
+12 244.91
+13 234.55
+14 222.49
+15 209.94
+16 197.17
+17 182.89
+18 169.76
+19 158.59
+20 145.37
+21 135.46
+22 124.77
+23 115.98
+24 108.77
+25 101.12
+26 94.45
+27 89.08
+28 84.63
+29 81.05
+30 78.93
+31 76.65
+32 75.59
+33 75.59
+34 75.59
+35 77.47
+36 80.17
+37 83.90
+38 88.56
+39 95.69
+40 97.48
+41 97.48
+42 97.48
+43 97.48
+44 97.48
+45 97.48
+46 97.48
+47 97.48
+48 203.08
+49 218.22
+50 229.37
+51 238.49
+52 247.43
+53 255.22
+54 261.31
+55 262.36
+56 260.66
+57 256.33
+58 249.34
+59 240.03
+60 228.55
+61 215.42
+62 203.37
+63 190.01
+64 177.81
+65 165.44
+66 152.92
+67 142.03
+68 132.91
+69 124.48
+70 116.45
+71 109.06
+72 103.27
+73 98.87
+74 94.95
+75 92.56
+76 90.47
+77 89.48
+78 89.48
+79 90.53
+80 93.07
+81 97.12
+82 101.82
+83 108.18
+84 109.73
+85 109.73
+86 109.73
+87 109.73
+88 109.73
+89 109.73
+90 109.73
+91 202.97
+92 217.38
+93 231.73
+94 243.11
+95 255.37
+96 264.12
+97 269.64
+98 270.98
+99 269.65
+100 264.55
+101 257.16
+102 246.01
+103 232.88
+104 219.85
+105 208.79
+106 197.00
+107 183.93
+108 172.00
+109 160.55
+110 150.59
+111 141.47
+112 133.02
+113 126.21
+114 120.64
+115 115.79
+116 111.62
+117 108.41
+118 106.41
+119 106.41
+120 106.41
+121 109.08
+122 113.23
+123 118.57
+124 122.57
+125 122.57
+126 122.57
+127 122.57
+128 122.57
+129 122.57
+130 122.57
+131 208.07
+132 224.14
+133 236.28
+134 248.12
+135 258.97
+136 267.74
+137 272.47
+138 271.52
+139 266.80
+140 258.61
+141 249.30
+142 239.19
+143 228.28
+144 215.79
+145 203.86
+146 190.08
+147 177.40
+148 163.81
+149 152.60
+150 141.33
+151 130.98
+152 121.98
+153 114.08
+154 106.61
+155 99.75
+156 93.10
+157 86.57
+158 80.62
+159 76.05
+160 71.52
+161 68.85
+162 67.46
+163 66.86
+164 67.51
+165 69.75
+166 72.85
+167 76.23
+168 82.85
+169 89.33
+170 93.39
+171 93.39
+172 93.39
+173 93.39
+174 93.39
+175 93.39
+176 93.39
+177 93.39
+178 188.37
+179 204.42
+180 217.16
+181 228.89
+182 238.83
+183 247.70
+184 253.59
+185 257.17
+186 257.17
+187 254.00
+188 248.24
+189 240.14
+190 229.42
+191 218.97
+192 205.09
+193 192.61
+194 179.74
+195 166.76
+196 155.36
+197 143.58
+198 131.40
+199 121.84
+200 112.46
+201 105.41
+202 97.15
+203 90.09
+204 84.79
+205 80.52
+206 75.58
+207 72.59
+208 69.39
+209 67.51
+210 66.42
+211 66.42
+212 66.42
+213 67.82
+214 69.76
+215 73.19
+216 77.35
+217 82.36
+218 87.82
+219 93.30
+220 93.30
+221 93.30
+222 93.30
+223 93.30
+224 93.30
+225 93.30
+226 93.30
+227 190.58
+228 203.43
+229 216.48
+230 228.89
+231 241.91
+232 251.60
+233 257.78
+234 262.18
+235 263.13
+236 260.91
+237 255.34
+238 247.17
+239 236.85
+240 225.24
+241 213.39
+242 201.46
+243 187.77
+244 175.31
+245 162.95
+246 152.55
+247 142.56
+248 132.94
+249 125.00
+250 117.69
+251 110.96
+252 105.02
+253 101.78
+254 98.48
+255 97.06
+256 96.50
+257 96.50
+258 98.48
+259 101.18
+260 104.56
+261 109.67
+262 115.86
+263 115.86
+264 115.86
+265 115.86
+266 115.86
+267 115.86
+268 115.86
+269 200.02
+270 217.51
+271 233.21
+272 245.72
+273 258.21
+274 267.24
+275 273.79
+276 273.20
+277 270.38
+278 260.76
+279 250.05
+280 241.32
+281 231.14
+282 219.83
+283 206.13
+284 193.24
+285 180.73
+286 167.82
+287 156.94
+288 144.13
+289 134.40
+290 125.23
+291 116.13
+292 107.34
+293 99.71
+294 94.11
+295 88.91
+296 84.51
+297 81.50
+298 78.66
+299 76.57
+300 75.82
+301 75.82
+302 76.88
+303 79.03
+304 82.12
+305 85.73
+306 91.05
+307 96.31
+308 96.31
+309 96.31
+310 96.31
+311 96.31
+312 96.31
+313 96.31
+314 96.31
+315 184.18
+316 201.10
+317 214.21
+318 226.18
+319 237.72
+320 247.57
+321 254.36
+322 258.34
+323 259.80
+324 257.76
+325 253.17
+326 246.51
+327 237.92
+328 227.09
+329 214.13
+330 202.20
+331 189.21
+332 177.65
+333 166.18
+334 154.03
+335 142.21
+336 131.51
+337 121.28
+338 111.80
+339 104.47
+340 98.80
+341 94.76
+342 91.81
+343 89.17
+344 88.00
+345 88.00
+346 88.00
+347 89.20
+348 91.17
+349 94.35
+350 99.00
+351 105.43
+352 109.34
+353 109.34
+354 109.34
+355 109.34
+356 109.34
+357 109.34
+358 109.34
+359 194.84
+360 212.05
+361 226.30
+362 239.03
+363 250.94
+364 259.73
+365 266.64
+366 269.67
+367 269.03
+368 265.03
+369 258.23
+370 249.32
+371 238.03
+372 226.20
+373 213.46
+374 200.53
+375 187.65
+376 174.89
+377 163.22
+378 152.47
+379 142.65
+380 133.97
+381 126.59
+382 120.52
+383 115.57
+384 111.49
+385 108.03
+386 106.01
+387 105.28
+388 105.28
+389 106.91
+390 109.73
+391 114.91
+392 120.66
+393 123.74
+394 123.74
+395 123.74
+396 123.74
+397 123.74
+398 123.74
+399 123.74
+400 211.57
+401 227.06
+402 240.57
+403 252.26
+404 262.67
+405 270.66
+406 273.40
+407 270.25
+408 263.76
+409 256.03
+410 246.87
+411 237.10
+412 225.11
+413 211.53
+414 197.77
+415 185.75
+416 173.00
+417 159.31
+418 147.18
+419 134.84
+420 125.07
+421 115.82
+422 107.33
+423 100.07
+424 93.55
+425 87.60
+426 81.75
+427 77.03
+428 73.39
+429 70.97
+430 67.94
+431 66.64
+432 65.80
+433 65.80
+434 66.85
+435 68.78
+436 71.47
+437 74.20
+438 78.68
+439 85.08
+440 87.47
+441 87.47
+442 87.47
+443 87.47
+444 87.47
+445 87.47
+446 87.47
+447 87.47
+448 185.81
+449 201.66
+450 215.07
+451 227.26
+452 238.00
+453 247.64
+454 255.03
+455 257.12
+456 256.17
+457 253.47
+458 248.93
+459 241.39
+460 231.45
+461 220.49
+462 208.48
+463 196.04
+464 182.73
+465 169.40
+466 157.24
+467 145.56
+468 133.54
+469 124.01
+470 114.55
+471 105.75
+472 98.32
+473 91.91
+474 86.08
+475 81.35
+476 77.78
+477 73.85
+478 71.12
+479 68.53
+480 67.09
+481 66.34
+482 66.34
+483 66.34
+484 67.92
+485 70.08
+486 73.78
+487 78.68
+488 84.33
+489 90.25
+490 90.25
+491 90.25
+492 90.25
+493 90.25
+494 90.25
+495 90.25
+496 90.25
+497 183.19
+498 198.96
+499 213.55
+500 225.91
+501 237.33
+502 246.66
+503 254.98
+504 259.46
+505 261.02
+506 260.02
+507 255.96
+508 249.08
+509 240.15
+510 229.51
+511 217.21
+512 205.06
+513 192.62
+514 177.43
+515 165.06
+516 152.36
+517 142.35
+518 134.58
+519 126.20
+520 119.86
+521 113.67
+522 108.20
+523 104.71
+524 100.83
+525 98.96
+526 98.38
+527 98.38
+528 100.29
+529 103.47
+530 107.73
+531 113.04
+532 118.90
+533 118.90
+534 118.90
+535 118.90
+536 118.90
+537 118.90
+538 118.90
+539 200.70
+540 217.77
+541 232.45
+542 244.28
+543 256.61
+544 265.93
+545 272.01
+546 272.01
+547 268.67
+548 260.53
+549 252.09
+550 243.72
+551 232.68
+552 220.49
+553 206.88
+554 193.98
+555 181.33
+556 168.61
+557 156.50
+558 145.54
+559 136.43
+560 125.95
+561 117.26
+562 109.81
+563 103.36
+564 97.15
+565 92.86
+566 89.02
+567 86.39
+568 84.44
+569 83.72
+570 83.72
+571 85.89
+572 88.39
+573 92.31
+574 96.00
+575 100.24
+576 102.55
+577 102.55
+578 102.55
+579 102.55
+580 102.55
+581 102.55
+582 102.55
+583 102.55
+584 197.15
+585 212.33
+586 225.48
+587 236.75
+588 247.52
+589 255.21
+590 260.74
+591 262.81
+592 262.09
+593 258.08
+594 250.83
+595 242.39
+596 230.86
+597 219.62
+598 206.80
+599 193.41
+600 180.60
+601 168.20
+602 157.77
+603 145.25
+604 136.23
+605 126.28
+606 118.10
+607 110.74
+608 105.29
+609 99.75
+610 95.61
+611 92.16
+612 89.93
+613 88.45
+614 88.45
+615 89.11
+616 90.87
+617 94.21
+618 98.16
+619 104.24
+620 108.98
+621 108.98
+622 108.98
+623 108.98
+624 108.98
+625 108.98
+626 108.98
+627 195.81
+628 211.95
+629 226.36
+630 240.61
+631 251.93
+632 259.13
+633 265.36
+634 269.71
+635 270.27
+636 266.44
+637 260.44
+638 251.94
+639 240.79
+640 228.95
+641 215.90
+642 203.25
+643 190.01
+644 177.92
+645 165.60
+646 155.49
+647 144.32
+648 136.07
+649 127.64
+650 120.28
+651 114.57
+652 109.99
+653 106.36
+654 104.49
+655 103.84
+656 103.84
+657 105.77
+658 107.83
+659 112.41
+660 117.71
+661 120.66
+662 120.66
+663 120.66
+664 120.66
+665 120.66
+666 120.66
+667 120.66
+668 210.13
+669 225.03
+670 238.76
+671 250.50
+672 261.18
+673 269.22
+674 274.18
+675 272.28
+676 266.66
+677 258.68
+678 249.88
+679 239.94
+680 227.14
+681 213.22
+682 197.58
+683 184.86
+684 172.52
+685 160.19
+686 149.20
+687 137.49
+688 127.86
+689 118.91
+690 110.49
+691 102.73
+692 96.33
+693 90.95
+694 86.38
+695 82.72
+696 79.65
+697 77.61
+698 75.70
+699 74.49
+700 74.49
+701 74.49
+702 76.48
+703 79.14
+704 82.84
+705 87.86
+706 92.69
+707 92.69
+708 92.69
+709 92.69
+710 92.69
+711 92.69
+712 92.69
+713 92.69
+714 181.33
+715 196.86
+716 210.98
+717 223.13
+718 233.90
+719 243.19
+720 250.57
+721 255.00
+722 256.36
+723 255.16
+724 250.15
+725 242.80
+726 233.82
+727 223.41
+728 210.81
+729 199.04
+730 187.39
+731 174.14
+732 162.62
+733 151.39
+734 139.59
+735 128.71
+736 119.17
+737 111.02
+738 103.91
+739 96.78
+740 91.56
+741 87.13
+742 83.22
+743 80.50
+744 76.83
+745 74.24
+746 70.80
+747 69.04
+748 67.12
+749 66.51
+750 66.51
+751 68.77
+752 72.19
+753 77.34
+754 84.04
+755 88.55
+756 88.55
+757 88.55
+758 88.55
+759 88.55
+760 88.55
+761 88.55
+762 88.55
+763 190.51
+764 207.14
+765 220.57
+766 232.51
+767 243.35
+768 252.41
+769 258.62
+770 262.18
+771 262.18
+772 259.10
+773 253.54
+774 245.44
+775 235.55
+776 223.43
+777 209.91
+778 197.52
+779 185.90
+780 172.13
+781 161.09
+782 150.58
+783 140.37
+784 130.27
+785 122.13
+786 114.99
+787 108.76
+788 104.67
+789 100.36
+790 97.61
+791 95.48
+792 94.83
+793 95.45
+794 97.15
+795 100.73
+796 105.10
+797 111.46
+798 118.27
+799 118.27
+800 118.27
+801 118.27
+802 118.27
+803 118.27
+804 118.27
+805 202.92
+806 220.25
+807 233.35
+808 243.48
+809 254.85
+810 265.75
+811 272.62
+812 272.62
+813 269.36
+814 261.82
+815 252.85
+816 244.08
+817 232.96
+818 219.59
+819 207.32
+820 193.87
+821 181.77
+822 168.60
+823 155.76
+824 144.03
+825 134.07
+826 123.46
+827 114.47
+828 107.64
+829 100.46
+830 94.53
+831 89.28
+832 84.59
+833 80.96
+834 78.54
+835 76.28
+836 75.51
+837 75.51
+838 76.55
+839 78.55
+840 81.57
+841 85.18
+842 90.61
+843 96.01
+844 96.01
+845 96.01
+846 96.01
+847 96.01
+848 96.01
+849 96.01
+850 96.01
+851 184.51
+852 201.57
+853 216.33
+854 228.69
+855 239.90
+856 250.41
+857 257.91
+858 262.29
+859 263.41
+860 261.70
+861 256.75
+862 246.82
+863 236.35
+864 225.17
+865 212.90
+866 201.61
+867 188.42
+868 175.92
+869 163.70
+870 153.18
+871 142.89
+872 132.95
+873 125.18
+874 117.61
+875 110.36
+876 104.56
+877 100.13
+878 96.64
+879 93.52
+880 91.91
+881 91.91
+882 91.91
+883 93.84
+884 97.13
+885 101.08
+886 107.19
+887 111.89
+888 111.89
+889 111.89
+890 111.89
+891 111.89
+892 111.89
+893 111.89
+894 195.89
+895 212.65
+896 226.60
+897 239.28
+898 251.28
+899 259.92
+900 266.03
+901 269.76
+902 269.76
+903 265.55
+904 258.92
+905 250.42
+906 240.04
+907 229.03
+908 216.69
+909 204.21
+910 191.25
+911 178.40
+912 168.31
+913 157.47
+914 148.62
+915 139.12
+916 129.54
+917 121.65
+918 114.59
+919 109.30
+920 106.39
+921 104.71
+922 104.71
+923 106.41
+924 109.22
+925 113.62
+926 118.31
+927 124.34
+928 124.34
+929 124.34
+930 124.34
+931 124.34
+932 124.34
+933 124.34
+934 205.67
+935 221.25
+936 235.02
+937 247.47
+938 258.37
+939 267.42
+940 272.60
+941 272.00
+942 267.91
+943 260.38
+944 251.10
+945 241.32
+946 230.96
+947 217.34
+948 204.99
+949 191.24
+950 178.58
+951 164.79
+952 153.07
+953 141.06
+954 129.86
+955 119.79
+956 111.13
+957 103.53
+958 96.95
+959 89.42
+960 85.22
+961 80.54
+962 76.85
+963 74.41
+964 72.12
+965 71.21
+966 71.21
+967 71.21
+968 72.13
+969 74.22
+970 76.95
+971 80.65
+972 85.36
+973 90.60
+974 92.36
+975 92.36
+976 92.36
+977 92.36
+978 92.36
+979 92.36
+980 92.36
+981 92.36
+982 191.27
+983 205.03
+984 218.89
+985 230.87
+986 241.63
+987 249.83
+988 255.42
+989 257.98
+990 257.33
+991 252.87
+992 245.90
+993 237.78
+994 227.14
+995 214.67
+996 202.31
+997 188.68
+998 175.96
+999 163.25
+1000 151.43
+1001 139.79
+1002 130.40
+1003 118.92
+1004 110.88
+1005 101.92
+1006 94.45
+1007 88.13
+1008 83.19
+1009 79.11
+1010 74.60
+1011 71.86
+1012 68.77
+1013 66.57
+1014 65.24
+1015 64.41
+1016 64.41
+1017 64.92
+1018 66.62
+1019 68.93
+1020 72.77
+1021 77.76
+1022 83.41
+1023 89.19
+1024 89.19
+1025 89.19
+1026 89.19
+1027 89.19
+1028 89.19
+1029 89.19
+1030 89.19
+1031 182.68
+1032 199.88
+1033 214.62
+1034 227.29
+1035 238.62
+1036 249.01
+1037 256.68
+1038 262.71
+1039 263.44
+1040 259.87
+1041 254.66
+1042 248.11
+1043 240.01
+1044 229.30
+1045 216.52
+1046 205.15
+1047 192.49
+1048 179.70
+1049 167.51
+1050 156.31
+1051 145.97
+1052 135.93
+1053 128.06
+1054 119.45
+1055 113.01
+1056 108.31
+1057 103.79
+1058 100.92
+1059 98.90
+1060 98.28
+1061 98.28
+1062 100.12
+1063 102.38
+1064 106.07
+1065 111.06
+1066 117.00
+1067 117.00
+1068 117.00
+1069 117.00
+1070 117.00
+1071 117.00
+1072 117.00
+1073 202.42
+1074 217.46
+1075 232.83
+1076 245.05
+1077 256.39
+1078 265.28
+1079 271.80
+1080 271.80
+1081 268.63
+1082 261.21
+1083 253.57
+1084 244.41
+1085 233.79
+1086 220.80
+1087 209.24
+1088 196.54
+1089 183.38
+1090 170.14
+1091 157.79
+1092 144.31
+1093 131.53
+1094 122.20
+1095 113.46
+1096 106.57
+1097 100.93
+1098 96.80
+1099 92.10
+1100 88.77
+1101 86.07
+1102 83.75
+1103 82.40
+1104 82.40
+1105 82.40
+1106 82.40
+1107 82.40
+1108 84.82
+1109 88.34
+1110 92.06
+1111 98.22
+1112 103.08
+1113 103.08
+1114 103.08
+1115 103.08
+1116 103.08
+1117 103.08
+1118 196.25
+1119 210.62
+1120 223.53
+1121 235.01
+1122 245.30
+1123 253.56
+1124 259.86
+1125 261.87
+1126 261.87
+1127 257.71
+1128 251.10
+1129 242.25
+1130 232.00
+1131 219.62
+1132 207.54
+1133 194.54
+1134 182.85
+1135 170.49
+1136 158.24
+1137 147.54
+1138 137.40
+1139 129.81
+1140 121.07
+1141 114.39
+1142 109.32
+1143 103.67
+1144 99.51
+1145 96.53
+1146 94.67
+1147 93.79
+1148 93.79
+1149 95.31
+1150 98.43
+1151 102.95
+1152 109.01
+1153 115.86
+1154 115.86
+1155 115.86
+1156 115.86
+1157 115.86
+1158 115.86
+1159 115.86
+1160 115.86
+1161 209.63
+1162 224.03
+1163 236.93
+1164 249.17
+1165 259.34
+1166 267.41
+1167 271.07
+1168 270.51
+1169 263.93
+1170 255.80
+1171 246.03
+1172 235.96
+1173 223.79
+1174 209.68
+1175 196.98
+1176 184.70
+1177 171.16
+1178 157.06
+1179 145.05
+1180 133.80
+1181 123.45
+1182 114.06
+1183 106.78
+1184 98.12
+1185 91.19
+1186 84.78
+1187 80.10
+1188 74.95
+1189 71.88
+1190 68.51
+1191 66.13
+1192 64.64
+1193 63.65
+1194 63.06
+1195 63.06
+1196 64.29
+1197 66.41
+1198 68.95
+1199 73.12
+1200 78.00
+1201 83.67
+1202 85.55
+1203 85.55
+1204 85.55
+1205 85.55
+1206 85.55
+1207 85.55
+1208 85.55
+1209 85.55
+1210 187.86
+1211 202.65
+1212 216.23
+1213 228.24
+1214 239.81
+1215 248.77
+1216 252.97
+1217 254.72
+1218 254.72
+1219 253.22
+1220 247.80
+1221 239.99
+1222 229.87
+1223 218.26
+1224 205.99
+1225 193.09
+1226 180.59
+1227 167.42
+1228 154.33
+1229 142.32
+1230 131.88
+1231 122.32
+1232 112.84
+1233 104.07
+1234 96.62
+1235 90.02
+1236 84.43
+1237 79.90
+1238 74.59
+1239 71.27
+1240 67.37
+1241 64.97
+1242 62.82
+1243 61.60
+1244 61.60
+1245 61.60
+1246 62.99
+1247 64.80
+1248 68.51
+1249 72.70
+1250 77.97
+1251 84.10
+1252 88.07
+1253 88.07
+1254 88.07
+1255 88.07
+1256 88.07
+1257 88.07
+1258 88.07
+1259 88.07
+1260 184.25
+1261 199.56
+1262 212.97
+1263 226.37
+1264 237.23
+1265 247.66
+1266 254.97
+1267 259.77
+1268 261.89
+1269 260.39
+1270 255.67
+1271 248.49
+1272 238.75
+1273 228.34
+1274 215.95
+1275 201.71
+1276 187.12
+1277 174.33
+1278 162.05
+1279 151.79
+1280 142.67
+1281 134.03
+1282 126.03
+1283 118.64
+1284 112.00
+1285 107.16
+1286 103.71
+1287 100.06
+1288 98.59
+1289 97.68
+1290 97.68
diff --git a/test/resplit.awk b/test/resplit.awk
new file mode 100644
index 00000000..f75fe397
--- /dev/null
+++ b/test/resplit.awk
@@ -0,0 +1 @@
+{ FS = ":"; $0 = $0; print $2 }
diff --git a/test/resplit.in b/test/resplit.in
new file mode 100644
index 00000000..5f06f10b
--- /dev/null
+++ b/test/resplit.in
@@ -0,0 +1 @@
+a:b:c d:e:f
diff --git a/test/rs.awk b/test/rs.awk
new file mode 100644
index 00000000..d3a3cf04
--- /dev/null
+++ b/test/rs.awk
@@ -0,0 +1,2 @@
+BEGIN { RS = "" }
+{ print $1, $2 }
diff --git a/test/rstest1.awk b/test/rstest1.awk
new file mode 100644
index 00000000..3eb88366
--- /dev/null
+++ b/test/rstest1.awk
@@ -0,0 +1,7 @@
+BEGIN {
+ RS = ""
+ FS = ":"
+ s = "a:b\nc:d"
+ print split(s,a)
+ print length(a[2])
+}
diff --git a/test/rstest1.ok b/test/rstest1.ok
new file mode 100644
index 00000000..a5c88062
--- /dev/null
+++ b/test/rstest1.ok
@@ -0,0 +1,2 @@
+3
+3
diff --git a/test/rstest2.awk b/test/rstest2.awk
new file mode 100644
index 00000000..5ed4701d
--- /dev/null
+++ b/test/rstest2.awk
@@ -0,0 +1,6 @@
+BEGIN {
+ RS = ""
+ FS = "\\"
+ $0 = "a\\b"
+ print $1
+}
diff --git a/test/rstest2.ok b/test/rstest2.ok
new file mode 100644
index 00000000..78981922
--- /dev/null
+++ b/test/rstest2.ok
@@ -0,0 +1 @@
+a
diff --git a/test/sclforin.ok b/test/sclforin.ok
index f41fc77a..948df438 100644
--- a/test/sclforin.ok
+++ b/test/sclforin.ok
@@ -1 +1,2 @@
gawk: sclforin.awk:1: fatal: attempt to use scalar `j' as array
+EXIT CODE: 2
diff --git a/test/sclifin.ok b/test/sclifin.ok
index dc746231..5bc93016 100644
--- a/test/sclifin.ok
+++ b/test/sclifin.ok
@@ -1 +1,2 @@
gawk: sclifin.awk:7: fatal: attempt to use scalar `j' as array
+EXIT CODE: 2
diff --git a/test/space.ok b/test/space.ok
new file mode 100644
index 00000000..0f769564
--- /dev/null
+++ b/test/space.ok
@@ -0,0 +1,2 @@
+gawk: fatal: can't open source file ` ' for reading (No such file or directory)
+EXIT CODE: 2
diff --git a/test/splitarr.awk b/test/splitarr.awk
new file mode 100644
index 00000000..c1185a4d
--- /dev/null
+++ b/test/splitarr.awk
@@ -0,0 +1,5 @@
+BEGIN {
+ a[1] = "elephantie"
+ a[2] = "e"
+ print split(a[1],a,a[2]), a[2], a[3], split(a[2],a,a[2])
+}
diff --git a/test/splitarr.ok b/test/splitarr.ok
new file mode 100644
index 00000000..9402b94f
--- /dev/null
+++ b/test/splitarr.ok
@@ -0,0 +1 @@
+4 l phanti 2
diff --git a/test/strtod.awk b/test/strtod.awk
index 27df8a4f..3326478e 100644
--- a/test/strtod.awk
+++ b/test/strtod.awk
@@ -1 +1,5 @@
-{ x = "0x" $1 ; print x, x + 0 }
+{
+ x = "0x" $1 ; print x, x + 0
+ for (i=1; i<=NF; i++)
+ if ($i) print $i, "is not zero"
+}
diff --git a/test/strtod.in b/test/strtod.in
index 51b40081..d7f71aa9 100644
--- a/test/strtod.in
+++ b/test/strtod.in
@@ -1 +1 @@
-345
+345 0 00 0e0 0E1 00E0 000e-5 .0e+0
diff --git a/test/strtod.ok b/test/strtod.ok
index bedd0f23..a47a9b17 100644
--- a/test/strtod.ok
+++ b/test/strtod.ok
@@ -1 +1,2 @@
0x345 0
+345 is not zero
diff --git a/test/synerr1.awk b/test/synerr1.awk
new file mode 100644
index 00000000..131708d2
--- /dev/null
+++ b/test/synerr1.awk
@@ -0,0 +1,4 @@
+# program to make sure we don't infinite
+# syntax errors
+
+print "hi"
diff --git a/test/synerr1.ok b/test/synerr1.ok
new file mode 100644
index 00000000..e180f132
--- /dev/null
+++ b/test/synerr1.ok
@@ -0,0 +1,3 @@
+gawk: synerr1.awk:4: print "hi"
+gawk: synerr1.awk:4: ^ syntax error
+EXIT CODE: 1
diff --git a/test/uninit2.awk b/test/uninit2.awk
new file mode 100644
index 00000000..9ded5575
--- /dev/null
+++ b/test/uninit2.awk
@@ -0,0 +1,2 @@
+BEGIN { a = a + 1; x = a; print a}
+BEGIN { ++b; x = b; print b}
diff --git a/test/uninit2.ok b/test/uninit2.ok
new file mode 100644
index 00000000..2001a39b
--- /dev/null
+++ b/test/uninit2.ok
@@ -0,0 +1,4 @@
+gawk: uninit2.awk:1: warning: reference to uninitialized variable `a'
+1
+gawk: uninit2.awk:2: warning: reference to uninitialized variable `b'
+1
diff --git a/test/uninitialized.awk b/test/uninitialized.awk
new file mode 100644
index 00000000..09bb643b
--- /dev/null
+++ b/test/uninitialized.awk
@@ -0,0 +1,3 @@
+BEGIN {
+ a += 2
+}
diff --git a/test/uninitialized.ok b/test/uninitialized.ok
new file mode 100644
index 00000000..86ab474c
--- /dev/null
+++ b/test/uninitialized.ok
@@ -0,0 +1 @@
+gawk: uninitialized.awk:2: warning: reference to uninitialized variable `a'
diff --git a/test/zeroe0.awk b/test/zeroe0.awk
new file mode 100644
index 00000000..5dc9c6bc
--- /dev/null
+++ b/test/zeroe0.awk
@@ -0,0 +1,40 @@
+# From sbohdjal@matrox.com Tue Dec 31 11:41:25 2002
+# Return-Path: <sbohdjal@matrox.com>
+# X-From_: sbohdjal@matrox.com Mon Dec 30 17:34:41 2002
+# Message-Id: <4.3.1.1.20021230101824.00fc4bd8@mailbox.matrox.com>
+# Date: Mon, 30 Dec 2002 10:33:10 -0500
+# To: bug-gawk@gnu.org
+# From: Serge Bohdjalian <sbohdjal@matrox.com>
+# Subject: GAWK 3.1.1 bug, DJGPP port
+#
+# When I run the following AWK file...
+#
+BEGIN {
+ $0 = "00E0";
+ print $0 ", " ($0 && 1) ", " ($0 != "");
+ $1 = "00E0";
+ print $1 ", " ($1 && 1) ", " ($1 != "");
+}
+#
+# With the SimTel version of GAWK 3.1.1 for Windows (downloadable from
+# ftp://ftp.cdrom.com/pub/simtelnet/gnu/djgpp/v2gnu/), I get the following
+# output...
+#
+# 00E0, 0, 1
+# 00E0, 1, 1
+#
+# With the Cygwin version of GAWK 3.1.1 for Windows, I get...
+#
+# 00E0, 1, 1
+# 00E0, 1, 1
+#
+# As far as I know, if "$0" isn't blank, the value of "($0 && 1)" should be
+# "1" (true). I get the same problem if I substitute "00E0" with "00E1" to
+# "00E9". Other strings don't have have this problem (for example, "00EA").
+# The problem occurs whether I use file input or whether I manually assign
+# "$0" (as above).
+#
+# The problem is also discussed in a comp.lang.awk posting ("Bug in GAWK
+# 3.1.1?", Dec. 27, 2002).
+#
+# -Serge
diff --git a/test/zeroe0.ok b/test/zeroe0.ok
new file mode 100644
index 00000000..cdf28fb6
--- /dev/null
+++ b/test/zeroe0.ok
@@ -0,0 +1,2 @@
+00E0, 1, 1
+00E0, 1, 1
diff --git a/unsupported/atari/ChangeLog b/unsupported/atari/ChangeLog
index 8a93397a..37c2ad76 100644
--- a/unsupported/atari/ChangeLog
+++ b/unsupported/atari/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.1: Release tar file made.
diff --git a/unsupported/atari/gawkmisc.atr b/unsupported/atari/gawkmisc.atr
index f4ee1fc1..0425c796 100644
--- a/unsupported/atari/gawkmisc.atr
+++ b/unsupported/atari/gawkmisc.atr
@@ -79,7 +79,7 @@ int flag;
/* optimal_bufsize --- determine optimal buffer size */
-int
+size_t
optimal_bufsize(fd, stb)
int fd;
struct stat *stb;
diff --git a/unsupported/tandem/ChangeLog b/unsupported/tandem/ChangeLog
index f0af15b7..fd8ffd8d 100644
--- a/unsupported/tandem/ChangeLog
+++ b/unsupported/tandem/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.1: Release tar file made.
diff --git a/unsupported/tandem/tmisc.c b/unsupported/tandem/tmisc.c
index a8db4da5..550898f3 100644
--- a/unsupported/tandem/tmisc.c
+++ b/unsupported/tandem/tmisc.c
@@ -90,7 +90,7 @@ int flag;
/* optimal_bufsize --- determine optimal buffer size */
-int
+size_t
optimal_bufsize(fd, stb)
int fd;
struct stat *stb;
diff --git a/version.c b/version.c
index 57a9abdf..ded3f0cd 100644
--- a/version.c
+++ b/version.c
@@ -1,4 +1,7 @@
-char *version_string = "@(#)GNU Awk 3.1";
+#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 */
diff --git a/version.in b/version.in
index e17195b9..4c77ba64 100644
--- a/version.in
+++ b/version.in
@@ -1,4 +1,7 @@
-char *version_string = "@(#)GNU Awk X.Y";
+#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 */
diff --git a/vms/ChangeLog b/vms/ChangeLog
index 162b2fb5..210976ba 100644
--- a/vms/ChangeLog
+++ b/vms/ChangeLog
@@ -1,3 +1,55 @@
+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 Feb 27 17:54:33 2003 Pat Rankin <rankin@pactechdata.com>
+
+ * descrip.mms: Revert regex compilation to single file.
+ vmsbuild.com: Likewise.
+
+Thu Feb 20 18:06:54 2003 Pat Rankin <rankin@pactechdata.com>
+
+ * vms_gawk.c (vms_gawk): Don't check for `RUNUSED' status because
+ it gets a false match when gawk is invoked via fork+exec.
+
+ * gawk.hlp: Limited updates to the release notes section.
+
+Tue Feb 4 14:28:06 2003 Arnold D. Robbins <arnold@skeeve.com>
+
+ All relevant files: Copyright year updated to 2003.
+
+Mon Feb 3 20:37:09 2003 Pat Rankin <rankin@pactechdata.com>
+
+ * vms-conf.h (ssize_t): Define as int.
+ (TIME_T_UNSIGNED): New macro; used in strftime.
+ * vms_cli.c (Cli_Parse_Command): Increase command buffer size
+ from 2.5Kb to 8Kb.
+
+ From Steve Pitcher:
+ * vms_gawk.c (vms_gawk): Don't report "missing required element"
+ for INSFPRM status unless invoked via a native DCL verb.
+
+ From Jouk Jansen:
+ * vms-conf.h (CRTL_VER_V731): New macro.
+ * vms_misc.c (getpgrp): Use it.
+
+Mon Dec 23 16:53:42 2002 Pat Rankin <rankin@pactechdata.com>
+
+ * descrip.mms (AWKOBJ1, AWKOBJ2): Split AWKOBJS into pieces to
+ avoid line length overflow when creating gawk.opt.
+ (regcomp.obj, regexec.obj, regex_internal.obj): New targets.
+ * vmsbuild.com: Likewise.
+
+Thu Nov 21 19:45:08 2002 Pat Rankin <rankin@pactechdata.com>
+
+ * descrip.mms: Update to reflect regex changes; eliminate dfa.
+
+ * vmstest.com (exit_code): Hack to add "EXIT CODE n" record to
+ output for tests that trigger gawk failure.
+
Wed May 1 16:41:32 2002 Arnold D. Robbins <arnold@skeeve.com>
* Release 3.1.1: Release tar file made.
diff --git a/vms/descrip.mms b/vms/descrip.mms
index c9e979d2..b1dc393e 100644
--- a/vms/descrip.mms
+++ b/vms/descrip.mms
@@ -88,10 +88,11 @@ ECHO = write sys$output
NOOP = continue
# object files
-AWKOBJS = array.obj,awkgram.obj,builtin.obj,dfa.obj,ext.obj,\
+AWKOBJ1 = array.obj,awkgram.obj,builtin.obj,ext.obj,\
field.obj,gawkmisc.obj,getopt.obj,getopt1.obj,io.obj,main.obj,\
- msg.obj,node.obj,random.obj,re.obj,regex.obj,replace.obj,\
- version.obj,eval.obj,profile.obj
+ msg.obj,node.obj,random.obj,re.obj
+AWKOBJ2 = regex.obj,replace.obj,version.obj,eval.obj,profile.obj
+AWKOBJS = $(AWKOBJ1),$(AWKOBJ2)
# VMSOBJS
# VMS specific stuff
@@ -101,11 +102,12 @@ VMSCMD = gawk_cmd.obj # built from .cld file
VMSOBJS = $(VMSCODE),$(VMSCMD)
# source and documentation files
-AWKSRC = array.c,builtin.c,dfa.c,ext.c,eval.c,field.c,gawkmisc.c,\
+AWKSRC = array.c,builtin.c,ext.c,eval.c,field.c,gawkmisc.c,\
getopt.c,getopt1.c,io.c,main.c,msg.c,node.c,random.c,re.c,\
- random.c,regex.c,replace.c,version.c,eval.c,profile.c
+ random.c,regcomp.c,regex.c,regex_internal.c,regexec.c,\
+ replace.c,version.c,eval.c,profile.c
-ALLSRC = $(AWKSRC),awkgram.y,awk.h,custom.h,dfa.h,getopt.h,\
+ALLSRC = $(AWKSRC),awkgram.y,awk.h,custom.h,getopt.h,\
patchlev.h,protos.h,random.h
VMSSRC = $(VMSDIR)gawkmisc.vms,$(VMSDIR)vms_misc.c,$(VMSDIR)vms_popen.c,\
@@ -137,7 +139,8 @@ gawk.exe : $(AWKOBJS) $(VMSOBJS) gawk.opt
gawk.opt : $(MAKEFILE) # create linker options file
open/write opt gawk.opt ! ~ 'cat <<close >gawk.opt'
write opt "! GAWK -- GNU awk"
- @ write opt "$(AWKOBJS)"
+ @ write opt "$(AWKOBJ1)"
+ @ write opt "$(AWKOBJ2)"
@ write opt "$(VMSOBJS)"
@ write opt "psect_attr=environ,noshr !extern [noshare] char **"
@ write opt "stack=48 !preallocate more pages (default is 20)"
@@ -156,11 +159,12 @@ $(VMSCODE) : awk.h config.h $(VMSDIR)redirect.h $(VMSDIR)vms.h
gawkmisc.obj : gawkmisc.c $(VMSDIR)gawkmisc.vms
-$(AWKOBJS) : awk.h dfa.h regex.h config.h $(VMSDIR)redirect.h
+$(AWKOBJS) : awk.h regex.h config.h $(VMSDIR)redirect.h
random.obj : random.h
builtin.obj : random.h
main.obj : patchlev.h
awkgram.obj : awkgram.c awk.h
+regex.obj : regex.c regcomp.c regex_internal.c regexec.c regex.h regex_internal.h
# bison or yacc required
awkgram.c : awkgram.y # foo.y :: yacc => y[_]tab.c, bison => foo_tab.c
diff --git a/vms/gawk.hlp b/vms/gawk.hlp
index bc1a2210..8b5cbdcd 100644
--- a/vms/gawk.hlp
+++ b/vms/gawk.hlp
@@ -4,6 +4,7 @@
! revised, Jul'92
! revised, Jan'95
! revised, Apr'97
+! revised, Jan'03
! Online help for GAWK.
!
1 GAWK
@@ -11,7 +12,7 @@
the awk programming language. awk is an interpretive language which
can handle many data-reformatting jobs with just a few lines of code.
It has powerful string manipulation and pattern matching capabilities
- built in. This version should be compatible with POSIX 1003.2 awk.
+ built in. This version is compatible with POSIX 1003.2 awk.
The VMS version of GAWK supports both the original UN*X-style command
interface and a DCL interface. The only setup requirement for GAWK
@@ -31,10 +32,8 @@
The options are case-sensitive. On VMS, the DCL command interpreter
converts unquoted text into uppercase before passing it to the running
program. However, GAWK is written in 'C' and the C Run-Time Library
- (VAXCRTL) converts unquoted text into *lowercase*. Therefore, the
- -Fval and -W options must be enclosed in quotes.
-
- Note: under VMS POSIX, the usual shell command line processing occurs.
+ (VAXCRTL or DECC$SHR) converts unquoted text into *lowercase*.
+ Therefore, the -Fval and -W options must be enclosed in quotes.
3 options
-f file use the specified file as the awk program source; if more
than one instance of -f is used, each file will be read
@@ -67,7 +66,7 @@
(since awk's 'print' statement includes the trailing 'newline').
On VMS, to include a quote character inside of a quoted string, two
- successive quotes ("") must be used. (Not necessary for VMS POSIX.)
+ successive quotes ("") must be used.
3 data_files
After all dash-options are examined, and after the program text if
there were no occurrences of the -f option, remaining (space separated)
@@ -104,10 +103,6 @@
>>$vfile incorrect; would be interpreted as file "$vfile" in stream-lf
format rather than as file "vfile" in RMS 'text' format
| error; command line pipes not supported
-
- Note: under VMS POSIX these features are implemented by the shell
- rather than inside GAWK, so consult the shell documentation for
- specific details.
3 wildcard_expansion
The command parsing in the VMS implementation of GAWK does some
emulation of a UN*X-style shell, where certain characters on the
@@ -127,11 +122,6 @@
found, those filenames are put into the command line in place of the
original pattern. If no matching files are found, the original
pattern is left in place.
-
- Note: under VMS POSIX wildcard expansion, or "file globbing", is
- performed by the shell rather than inside GAWK, so consult the shell
- documentation for details. In particular, the last sentence of the
- previous paragraph does not apply.
2 DCL_syntax
GAWK's DCL-style interface is more or less a standard DCL command, with
one required parameter. Multiple values--when present--are separated
@@ -143,8 +133,6 @@
Usage: GAWK /COMMANDS="awk program text" data_file[,data_file,...]
or GAWK /INPUT=awk_file data_file[,"Var=value",data_file,...]
( or GAWK /INPUT=(awk_file1,awk_file2,...) data_file[,...] )
-
- Not applicable under VMS POSIX.
3 Parameter
data_file[,datafile,...] (data_file data_file ...)
data_file[,"Var=value",...,data_file,...] (data_file Var=value &c)
@@ -1110,6 +1098,13 @@
incorporated into the official GNU distribution of version 2.13 in
Spring 1991. (Version 2.12 was never publically released.)
2 release_notes
+ GAWK 3.1.2 handles parsing of the command line differently than
+ earlier versions for the case where there is a single token, which
+ often yielded a "missing required element" error in earlier versions.
+
+ [Note for 3.1.x: these release notes haven't been updated in quite
+ some time. Most of the information is still applicable though.]
+
GAWK 3.0.3 tested under VAX/VMS V6.2 and Alpha/VMS V6.2, April, 1997;
should be compatible with VMS versions V4.6 and later. Current source
code is compatible with DEC's DEC C v5.x or VAX C v3.2; also compiles
@@ -1121,24 +1116,9 @@
look in the current default directory, then if the file wasn't found
it will look in the directory specified by the translation of logical
name "AWK_LIBRARY".
-
- Not applicable under VMS POSIX.
3 known_problems
There are several known problems with GAWK running on VMS. Some can
- be ignored, others require work-arounds. Note: GAWK in the VMS POSIX
- environment does not have these problems.
-4 command_line_parsing
- The command
- gawk "program text"
- will pass the first phase of DCL parsing (the single required
- parameter is present), then it will give an error that a required
- element (either /input=awk_file or /commands="program text") is
- missing. If what was intended (as is most likely) is to pass the
- program text to the UN*X-style command interface, the following
- variation is required
- gawk -- "program text"
- The presence of "--", which is normally optional, will inhibit the
- attempt to use DCL parsing (as will any '-' option or redirection).
+ be ignored, others require work-arounds.
4 file_formats
If a file having the RMS attribute "Fortran carriage control" is
read as input, it will generate an empty first record if the first
@@ -1199,7 +1179,8 @@
VMS status value, so 0 indicates success and non-zero indicates
failure. The final exit status will be 1 (VMS success) if 0 is
used, or even (VMS non-success) if non-zero is used.
-3 changes
+!3 changes
+3 prior_changes
Changes between version 3.0.6 and 2.15.6
General
@@ -1211,8 +1192,6 @@
VMS-specific
Switched to build with DEC C by default
-
-3 prior_changes
Changes between version 2.15.6 and 2.14
General
diff --git a/vms/gawkmisc.vms b/vms/gawkmisc.vms
index 4d47369c..a364801d 100644
--- a/vms/gawkmisc.vms
+++ b/vms/gawkmisc.vms
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-1996 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-1996, 2003 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -70,7 +70,7 @@ int flag;
/* optimal_bufsize --- determine optimal buffer size */
-int
+size_t
optimal_bufsize(fd, stb)
int fd;
struct stat *stb;
diff --git a/vms/vms-conf.h b/vms/vms-conf.h
index 92794d2d..50c2790a 100644
--- a/vms/vms-conf.h
+++ b/vms/vms-conf.h
@@ -3,11 +3,11 @@
/*
* config.h -- configuration definitions for gawk.
*
- * For VMS (assumes V4.6 or later; tested on V5.5-2)
+ * For VMS (assumes V4.6 or later; tested on V5.5-2 and V7.1)
*/
/*
- * Copyright (C) 1991-1992, 1995-1996, 1999, 2001, 2002 the Free Software Foundation, Inc.
+ * Copyright (C) 1991-1992, 1995-1996, 1999, 2001, 2002, 2003 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -144,7 +144,7 @@
#undef HAVE_PORTALS /* don't have portals on /p on this system */
#undef DYNAMIC /* don't allow dynamic addition of builtins */
#define STRTOD_NOT_C89 1 /* strtod doesn't have C89 semantics */
-/* #undef ssize_t */ /* signed version of size_t */
+#define ssize_t int /* signed version of size_t */
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT
@@ -330,6 +330,9 @@
/* Define as 1 if you have catgets and don't want to use GNU gettext. */
#undef HAVE_CATGETS
+/* Whether `time_t' is an unsigned type. */
+#define TIME_T_UNSIGNED 1
+
#if 0
#include <custom.h> /* overrides for stuff autoconf can't deal with */
#else
@@ -397,10 +400,13 @@
# define __VMS_VER 60100000
#endif
#if __CRTL_VER >= 60200000
+# if __CRTL_VER >= 70301000
+# define CRTL_VER_V731
+# endif
# undef __CRTL_VER
# define __CRTL_VER 60100000
#endif
-#endif
+#endif /* __DECC */
/*
* GNU C
diff --git a/vms/vms_args.c b/vms/vms_args.c
index fbe50ff6..e63758f7 100644
--- a/vms/vms_args.c
+++ b/vms/vms_args.c
@@ -23,7 +23,7 @@
* expansion. Should be called immediately upon image startup.
*
* Pat Rankin, Nov'89
- * rankin@eql.Caltech.EDU
+ * rankin@pactechdata.com
*
* <ifile - open 'ifile' (readonly) as 'stdin'
* >nfile - create 'nfile' as 'stdout' (stream-lf format)
diff --git a/vms/vms_cli.c b/vms/vms_cli.c
index a9386216..1638290b 100644
--- a/vms/vms_cli.c
+++ b/vms/vms_cli.c
@@ -60,7 +60,7 @@ Cli_Parse_Command( const void *cmd_tables, const char *cmd_verb )
Dsc rdesc; unsigned :32; unsigned :32; unsigned :32; } cmd;
U_Long sts;
int ltmp;
- char longbuf[2600];
+ char longbuf[8200];
(void)lib$establish(lib$sig_to_ret);
memset(&cmd, 0, sizeof cmd);
diff --git a/vms/vms_gawk.c b/vms/vms_gawk.c
index e021b375..619144bf 100644
--- a/vms/vms_gawk.c
+++ b/vms/vms_gawk.c
@@ -1,6 +1,6 @@
/* vms_gawk.c -- parse GAWK command line using DCL syntax
- Copyright (C) 1991-1993, 1996 the Free Software Foundation, Inc.
+ Copyright (C) 1991-1993, 1996, 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
@@ -65,10 +65,12 @@ vms_gawk()
union arg_w_prefix buf;
char misc_args[10], *misc_argp;
int argc, W_cnt;
+ int native_dcl = 1; /* assume true until we know otherwise */
/* check "GAWK_P1"--it's required; its presence will tip us off */
sts = Cli_Present("GAWK_P1");
if (CondVal(sts) == CondVal(CLI$_SYNTAX)) {
+ native_dcl = 0; /* not invoked via a native command verb */
/* syntax error indicates that we weren't invoked as a native DCL
command, so we'll now attempt to generate a command from the
foreign command string and parse that.
@@ -80,18 +82,20 @@ vms_gawk()
if (vmswork(sts)) /* command parsed successfully */
v_add_arg(argc = 0, COMMAND_NAME); /* save "GAWK" as argv[0] */
else if (CondVal(sts) == CondVal(CLI$_INSFPRM))
- return vms_usage(USAGE_FILE_RQRD); /* insufficient parameters */
+ return native_dcl ? vms_usage(USAGE_FILE_RQRD) : 0; /* insufficient parameters */
else if (CondVal(sts) == CondVal(CLI$_CONFLICT))
return vms_usage(USAGE_BAD_COMBO); /* conflicting qualifiers (/input+/command) */
+#if 0 /* 3.1.2: removed since this can't distinguish RUN vs fork+exec */
else if (CondVal(sts) == CondVal(CLI$_RUNUSED))
return vms_usage(USAGE_RUN_CMD); /* RUN GAWK won't work (no command line) */
+#endif
else
return 0; /* forced to rely on original parsing */
if (Present("USAGE")) /* give usage message and quit */
return vms_usage(0);
else if (! (Present("PROGRAM") || Present("PROGFILE")) )
- return vms_usage(USAGE_PROG_RQRD); /* missing required option */
+ return native_dcl ? vms_usage(USAGE_PROG_RQRD) : 0; /* missing required option */
misc_argp = misc_args;
*misc_argp++ = '-'; /* now points at &misc_args[1] */
@@ -172,7 +176,7 @@ vms_gawk()
}
/* vms_usage() - display one or more messages and then terminate */
-static int /* note: doesn't return anything; allows 'return vms_usage()' */
+static int /* note: usually doesn't return */
vms_usage( int complaint )
{
static const char
diff --git a/vms/vms_misc.c b/vms/vms_misc.c
index 439790d5..46c87ef1 100644
--- a/vms/vms_misc.c
+++ b/vms/vms_misc.c
@@ -1,6 +1,6 @@
/* vms_misc.c -- sustitute code for missing/different run-time library routines.
- Copyright (C) 1991-1993, 1996-1997, 2001 the Free Software Foundation, Inc.
+ Copyright (C) 1991-1993, 1996-1997, 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
@@ -222,6 +222,7 @@ void tzset(void)
#endif /*VMS_V7*/
+#ifndef CRTL_VER_V731
/* getpgrp() -- there's no such thing as process group under VMS;
* job tree might be close enough to be useful though.
*/
@@ -229,6 +230,7 @@ int getpgrp(void)
{
return 0;
}
+#endif
#ifndef __GNUC__
void vms_bcopy( const char *src, char *dst, int len )
diff --git a/vms/vmstest.com b/vms/vmstest.com
index 6bff4e22..8fb26a53 100644
--- a/vms/vmstest.com
+++ b/vms/vmstest.com
@@ -338,6 +338,7 @@ $arrayparm: echo "arrayparm"
$ set noOn
$ AWKPATH_srcdir
$ gawk -f arrayparm.awk >tmp. 2>&1
+$ if .not.$status then call exit_code 2
$ set On
$ cmp arrayparm.ok tmp.
$ if $status then rm tmp.;
@@ -347,6 +348,7 @@ $paramdup: echo "paramdup"
$ set noOn
$ AWKPATH_srcdir
$ gawk -f paramdup.awk >tmp. 2>&1
+$ if .not.$status then call exit_code 1
$ set On
$ cmp paramdup.ok tmp.
$ if $status then rm tmp.;
@@ -365,6 +367,7 @@ $defref: echo "defref"
$ set noOn
$ AWKPATH_srcdir
$ gawk --lint -f defref.awk >tmp. 2>&1
+$ if .not.$status then call exit_code 2
$ set On
$ cmp defref.ok tmp.
$ if $status then rm tmp.;
@@ -430,6 +433,7 @@ $prmarscl: echo "prmarscl"
$ set noOn
$ AWKPATH_srcdir
$ gawk -f prmarscl.awk >tmp. 2>&1
+$ if .not.$status then call exit_code 2
$ set On
$ cmp prmarscl.ok tmp.
$ if $status then rm tmp.;
@@ -439,6 +443,7 @@ $sclforin: echo "sclforin"
$ set noOn
$ AWKPATH_srcdir
$ gawk -f sclforin.awk >tmp. 2>&1
+$ if .not.$status then call exit_code 2
$ set On
$ cmp sclforin.ok tmp.
$ if $status then rm tmp.;
@@ -448,6 +453,7 @@ $sclifin: echo "sclifin"
$ set noOn
$ AWKPATH_srcdir
$ gawk -f sclifin.awk >tmp. 2>&1
+$ if .not.$status then call exit_code 2
$ set On
$ cmp sclifin.ok tmp.
$ if $status then rm tmp.;
@@ -584,6 +590,7 @@ $fnarray: echo "fnarray"
$ set noOn
$ AWKPATH_srcdir
$ gawk -f fnarray.awk >tmp. 2>&1
+$ if .not.$status then call exit_code 2
$ set On
$ cmp fnarray.ok tmp.
$ if $status then rm tmp.;
@@ -705,6 +712,7 @@ $noparms: echo "noparms"
$ set noOn
$ AWKPATH_srcdir
$ gawk -f noparms.awk >tmp. 2>&1
+$ if .not.$status then call exit_code 1
$ set On
$ cmp noparms.ok tmp.
$ if $status then rm tmp.;
@@ -804,6 +812,7 @@ $
$funsmnam: echo "funsmnam"
$ set noOn
$ gawk -f funsmnam.awk >tmp. 2>&1
+$ if .not.$status then call exit_code 2
$ set On
$ cmp funsmnam.ok tmp.
$ if $status then rm tmp.;
@@ -812,6 +821,7 @@ $
$fnamedat: echo "fnamedat"
$ set noOn
$ gawk -f fnamedat.awk < fnamedat.in >tmp. 2>&1
+$ if .not.$status then call exit_code 2
$ set On
$ cmp fnamedat.ok tmp.
$ if $status then rm tmp.;
@@ -820,6 +830,7 @@ $
$numindex: echo "numindex"
$ set noOn
$ gawk -f numindex.awk < numindex.in >tmp. 2>&1
+$ if .not.$status then call exit_code 2
$ set On
$ cmp numindex.ok tmp.
$ if $status then rm tmp.;
@@ -828,6 +839,7 @@ $
$subslash: echo "subslash"
$ set noOn
$ gawk -f subslash.awk >tmp. 2>&1
+$ if .not.$status then call exit_code 2
$ set On
$ cmp subslash.ok tmp.
$ if $status then rm tmp.;
@@ -836,6 +848,7 @@ $
$opasnslf: echo "opasnslf"
$ set noOn
$ gawk -f opasnslf.awk >tmp. 2>&1
+$ if .not.$status then call exit_code 2
$ set On
$ cmp opasnslf.ok tmp.
$ if $status then rm tmp.;
@@ -844,6 +857,7 @@ $
$opasnidx: echo "opasnidx"
$ set noOn
$ gawk -f opasnidx.awk >tmp. 2>&1
+$ if .not.$status then call exit_code 2
$ set On
$ cmp opasnidx.ok tmp.
$ if $status then rm tmp.;
@@ -936,6 +950,7 @@ $parseme: echo "parseme"
$ set noOn
$ AWKPATH_srcdir
$ gawk -f parseme.awk >tmp. 2>&1
+$ if .not.$status then call exit_code 2
$ set On
$ cmp parseme.ok tmp.
$ if $status then rm tmp.;
@@ -951,6 +966,7 @@ $fnaryscl: echo "fnaryscl"
$ set noOn
$ AWKPATH_srcdir
$ gawk -f fnaryscl.awk >tmp. 2>&1
+$ if .not.$status then call exit_code 2
$ set On
$ cmp fnaryscl.ok tmp.
$ if $status then rm tmp.;
@@ -960,6 +976,7 @@ $fnasgnm: echo "fnasgnm"
$ set noOn
$ AWKPATH_srcdir
$ gawk -f fnasgnm.awk < fnasgnm.in >tmp. 2>&1
+$ if .not.$status then call exit_code 2
$ set On
$ cmp fnasgnm.ok tmp.
$ if $status then rm tmp.;
@@ -1241,5 +1258,14 @@ $ else cmp nl: nl: !deassign/user sys${error,output}
$ endif
$ endsubroutine !fixup_LRL
$
+$! add a fake "EXIT CODE" record to the end of the temporary output file
+$! to simulate the ``|| echo EXIT CODE $$? >>_$@'' shell script usage
+$exit_code: subroutine
+$ if f$trnlnm("FTMP").nes."" then close/noLog ftmp
+$ open/Append ftmp tmp.
+$ write ftmp "EXIT CODE: ",p1
+$ close ftmp
+$ endsubroutine !exit_code
+$
$!NOTREACHED
$ exit
diff --git a/ylwrap b/ylwrap
index 5ea68e4f..71e52250 100755
--- a/ylwrap
+++ b/ylwrap
@@ -1,6 +1,9 @@
#! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.
-# Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+#
+# 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
@@ -44,14 +47,6 @@ case "$input" in
;;
esac
-# The directory holding the input.
-input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
-# Quote $INPUT_DIR so we can use it in a regexp.
-# FIXME: really we should care about more than `.' and `\'.
-input_rx=`echo "$input_dir" | sed -e 's,\\\\,\\\\\\\\,g' -e 's,\\.,\\\\.,g'`
-
-echo "got $input_rx"
-
pairlist=
while test "$#" -ne 0; do
if test "$1" = "--"; then
@@ -79,7 +74,10 @@ mkdir $dirname || exit 1
cd $dirname
-$prog ${1+"$@"} "$input"
+case $# in
+ 0) $prog "$input" ;;
+ *) $prog "$@" "$input" ;;
+esac
status=$?
if test $status -eq 0; then
@@ -94,6 +92,12 @@ if test $status -eq 0; 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
@@ -114,11 +118,24 @@ if test $status -eq 0; then
*) target="../$2";;
esac
- # Edit out `#line' or `#' directives. We don't want the
- # resulting debug information to point at an absolute srcdir;
- # it is better for it to just mention the .y file with no
- # path.
- sed -e "/^#/ s,$input_rx,," "$from" > "$target" || status=$?
+ # 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